|
@@ -93,6 +93,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
* @param req
|
|
|
*/
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public void insertInspection(InsideInspectionInsertRequest req) {
|
|
|
//保存单据
|
|
|
try {
|
|
@@ -112,17 +113,22 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
* @param req
|
|
|
*/
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public void updateInspection(InsideInspectionUpdateRequest req) {
|
|
|
//修改操作
|
|
|
if(ObjectUtil.isEmpty(req.getOperType()) || "updateInspection".equals(req.getOperType())) {
|
|
|
ZhcxInsideInspectionDo inspection = this.getById(req.getId());//报验单
|
|
|
-
|
|
|
//生成修改记录
|
|
|
//报验单中编码不存在,为首次提交,不需要生成修改记录
|
|
|
if(ObjectUtil.isNotEmpty(inspection.getInspectioncode())) {
|
|
|
saveEditHistory(inspection, req);
|
|
|
}
|
|
|
|
|
|
+ //只有待报验状态才能修改
|
|
|
+ if(!"20".equals(inspection.getInspectionstatus())) {
|
|
|
+ throw new CustomException("只有待报验状态才能修改");
|
|
|
+ }
|
|
|
+
|
|
|
//保存单据
|
|
|
try {
|
|
|
generalCRUDService.generalMsUpdate(req.getUpdate());
|
|
@@ -139,8 +145,35 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
}
|
|
|
//重新报验
|
|
|
else if("reInspection".equals(req.getOperType())) {
|
|
|
- reInspection(req.getId(), req.getUpdate());
|
|
|
+ saveReInspection(req);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存重新报验
|
|
|
+ *
|
|
|
+ * @param req
|
|
|
+ */
|
|
|
+ private void saveReInspection(InsideInspectionUpdateRequest req) {
|
|
|
+ List<String> editHistoryList = reInspection(req.getId(), req.getUpdate());
|
|
|
+
|
|
|
+ //保存历史记录
|
|
|
+ if(ObjectUtil.isEmpty(editHistoryList)) {
|
|
|
+ return ;
|
|
|
}
|
|
|
+
|
|
|
+ //添加日志
|
|
|
+ Map<String, String> descMap = new HashMap<>();
|
|
|
+ InsideInspectionOperBaseDto dto = new InsideInspectionOperBaseDto();
|
|
|
+ dto.setLaunchSource(req.getLaunchSource());
|
|
|
+ List<String> list = new ArrayList<>(1);
|
|
|
+ list.add(req.getId());
|
|
|
+ dto.setInsideIdList(list);
|
|
|
+
|
|
|
+ OperDto operDto = getOper("70");
|
|
|
+ descMap.put(req.getId(), StringUtils.join(editHistoryList, "; "));
|
|
|
+
|
|
|
+ operLogService.saveOperLog(dto, operDto, descMap);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -494,15 +527,15 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
* @param req
|
|
|
*/
|
|
|
private void saveEditHistory(ZhcxInsideInspectionDo inspection, InsideInspectionUpdateRequest req) {
|
|
|
-
|
|
|
Map<String, String> descMap = new HashMap<>();
|
|
|
+
|
|
|
List<String> editList = editColsHistory(inspection, req.getUpdate().getMasterUpdate().getUpdatecolumns());
|
|
|
if(ObjectUtil.isNotEmpty(editList)) {
|
|
|
descMap.put(req.getId(), StringUtils.join(editList, "; "));
|
|
|
}
|
|
|
|
|
|
//没有更改,不存修改日志
|
|
|
- if(ObjectUtil.isNotEmpty(descMap)) {
|
|
|
+ if(ObjectUtil.isEmpty(descMap)) {
|
|
|
return ;
|
|
|
}
|
|
|
|