|
@@ -38,6 +38,7 @@ import com.jeeplus.test.materialManagement.wareHouse.service.dto.WareHouseDto;
|
|
import com.jeeplus.test.mould.service.SerialnumTplService;
|
|
import com.jeeplus.test.mould.service.SerialnumTplService;
|
|
import com.jeeplus.test.oss.domain.WorkAttachment;
|
|
import com.jeeplus.test.oss.domain.WorkAttachment;
|
|
import com.jeeplus.test.oss.mapper.OssServiceMapper;
|
|
import com.jeeplus.test.oss.mapper.OssServiceMapper;
|
|
|
|
+import com.jeeplus.test.oss.service.OssService;
|
|
import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
|
|
import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -93,6 +94,9 @@ public class CollectService {
|
|
@Resource
|
|
@Resource
|
|
private CollectBasicsReturnHiMapper returnHiMapper;
|
|
private CollectBasicsReturnHiMapper returnHiMapper;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private OssService ossService;
|
|
|
|
+
|
|
public void updateStatusById(CollectDto dto) {
|
|
public void updateStatusById(CollectDto dto) {
|
|
basicMapper.updateStatusById(dto.getId(), dto.getStatus());
|
|
basicMapper.updateStatusById(dto.getId(), dto.getStatus());
|
|
}
|
|
}
|
|
@@ -135,6 +139,7 @@ public class CollectService {
|
|
}
|
|
}
|
|
String returnId = createReturnData(dto.getId());
|
|
String returnId = createReturnData(dto.getId());
|
|
detailedMapper.updateByIdReturn(returnId, dto.getStatusReturn(), UserUtils.getCurrentUserDTO().getId(), dto.getReturnCause());
|
|
detailedMapper.updateByIdReturn(returnId, dto.getStatusReturn(), UserUtils.getCurrentUserDTO().getId(), dto.getReturnCause());
|
|
|
|
+ ossService.saveOrUpdateFileList(dto.getReturnFiles(), returnId, "collect_return"); // 修改附件信息列表
|
|
return returnId;
|
|
return returnId;
|
|
} else {
|
|
} else {
|
|
return "";
|
|
return "";
|
|
@@ -187,8 +192,9 @@ public class CollectService {
|
|
}
|
|
}
|
|
returnHiMapper.insert(returnHi); // 将数据存储到历史表中
|
|
returnHiMapper.insert(returnHi); // 将数据存储到历史表中
|
|
// 修改退回流程的状态
|
|
// 修改退回流程的状态
|
|
- String returnId = createReturnData(dto.getId());
|
|
|
|
- detailedMapper.updateStatusByIdReturn(returnId, dto.getStatusReturn());
|
|
|
|
|
|
+ detailedMapper.updateStatusByIdReturn(collectBasicsReturn.getId(), dto.getStatusReturn());
|
|
|
|
+ // 删除退回关联附件
|
|
|
|
+ ossService.remove(new LambdaQueryWrapper<WorkAttachment>().eq(WorkAttachment::getAttachmentId, collectBasicsReturn.getId()));
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(collectBasicsReturn)) {
|
|
if (ObjectUtil.isNotEmpty(collectBasicsReturn)) {
|
|
return collectBasicsReturn.getId();
|
|
return collectBasicsReturn.getId();
|
|
@@ -431,7 +437,7 @@ public class CollectService {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
dto.setDetailInfos(detailedList);
|
|
dto.setDetailInfos(detailedList);
|
|
- //附件信息
|
|
|
|
|
|
+ // 领用 附件信息
|
|
List<WorkAttachmentDto> files = detailedMapper.getByAttachmentId(info.getId());
|
|
List<WorkAttachmentDto> files = detailedMapper.getByAttachmentId(info.getId());
|
|
if (CollectionUtils.isNotEmpty(files)) {
|
|
if (CollectionUtils.isNotEmpty(files)) {
|
|
for (WorkAttachmentDto i : files) {
|
|
for (WorkAttachmentDto i : files) {
|
|
@@ -458,6 +464,14 @@ public class CollectService {
|
|
}
|
|
}
|
|
if (StringUtils.isNotBlank(collectBasicsReturn.getId())){
|
|
if (StringUtils.isNotBlank(collectBasicsReturn.getId())){
|
|
dto.setReturnId(collectBasicsReturn.getId());
|
|
dto.setReturnId(collectBasicsReturn.getId());
|
|
|
|
+ // 领用-退回 附件信息
|
|
|
|
+ List<WorkAttachmentDto> returnFiles = detailedMapper.getByAttachmentId(collectBasicsReturn.getId());
|
|
|
|
+ if (CollectionUtils.isNotEmpty(returnFiles)) {
|
|
|
|
+ for (WorkAttachmentDto i : returnFiles) {
|
|
|
|
+ i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ dto.setReturnFiles(returnFiles);
|
|
}
|
|
}
|
|
if (StringUtils.isNotBlank(collectBasicsReturn.getRemarks())){
|
|
if (StringUtils.isNotBlank(collectBasicsReturn.getRemarks())){
|
|
dto.setReturnCause(collectBasicsReturn.getRemarks());
|
|
dto.setReturnCause(collectBasicsReturn.getRemarks());
|
|
@@ -562,6 +576,7 @@ public class CollectService {
|
|
if (ObjectUtil.isNotEmpty(returnData) && StringUtils.isNotBlank(returnData.getId())) {
|
|
if (ObjectUtil.isNotEmpty(returnData) && StringUtils.isNotBlank(returnData.getId())) {
|
|
detailedMapper.updateStatusByIdReturn(returnData.getId(), "0"); // 修改退回的流程状态
|
|
detailedMapper.updateStatusByIdReturn(returnData.getId(), "0"); // 修改退回的流程状态
|
|
basicMapper.setCauseEmptyById(returnData.getId()); // 清空退回原因
|
|
basicMapper.setCauseEmptyById(returnData.getId()); // 清空退回原因
|
|
|
|
+ ossService.remove(new LambdaQueryWrapper<WorkAttachment>().eq(WorkAttachment::getAttachmentId, returnData.getId())); // 清除退回附件
|
|
}
|
|
}
|
|
// 将退回状态的数据全部撤回
|
|
// 将退回状态的数据全部撤回
|
|
detailedMapper.updateNoReturnByBasicId(id);
|
|
detailedMapper.updateNoReturnByBasicId(id);
|