|
@@ -8,7 +8,6 @@ import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.ZipUtil;
|
|
import cn.hutool.core.util.ZipUtil;
|
|
-import cn.hutool.json.JSONUtil;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -19,10 +18,7 @@ import com.rongwei.bsentity.domain.*;
|
|
import com.rongwei.bscommon.sys.dao.ZhcxInsideInspectionDao;
|
|
import com.rongwei.bscommon.sys.dao.ZhcxInsideInspectionDao;
|
|
import com.rongwei.bscommon.sys.service.ZhcxInsideInspectionService;
|
|
import com.rongwei.bscommon.sys.service.ZhcxInsideInspectionService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import com.rongwei.bsentity.dto.InsideInspectionOperRequest;
|
|
|
|
-import com.rongwei.bsentity.dto.InsideOperLogDto;
|
|
|
|
-import com.rongwei.bsentity.dto.NotifyDto;
|
|
|
|
-import com.rongwei.bsentity.dto.OperDto;
|
|
|
|
|
|
+import com.rongwei.bsentity.dto.*;
|
|
import com.rongwei.bsentity.dto.inside.*;
|
|
import com.rongwei.bsentity.dto.inside.*;
|
|
import com.rongwei.commonservice.serial.service.SysSerialNumberService;
|
|
import com.rongwei.commonservice.serial.service.SysSerialNumberService;
|
|
import com.rongwei.rwadmincommon.system.domain.SysRoleDo;
|
|
import com.rongwei.rwadmincommon.system.domain.SysRoleDo;
|
|
@@ -91,6 +87,62 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
@Value("${temp.filepath:#{null}}")
|
|
@Value("${temp.filepath:#{null}}")
|
|
private String filepath;
|
|
private String filepath;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 保存报验单
|
|
|
|
+ *
|
|
|
|
+ * @param req
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void insertInspection(InsideInspectionInsertRequest req) {
|
|
|
|
+ //保存单据
|
|
|
|
+ try {
|
|
|
|
+ generalCRUDService.generalMsInsert(req.getInsert());
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("保存失败: {}", e);
|
|
|
|
+ throw new CustomException("保存失败");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //发起
|
|
|
|
+ launch(req);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改报验单
|
|
|
|
+ *
|
|
|
|
+ * @param req
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //保存单据
|
|
|
|
+ try {
|
|
|
|
+ generalCRUDService.generalMsUpdate(req.getUpdate());
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("保存失败: {}", e);
|
|
|
|
+ throw new CustomException("保存失败");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //单个报验点保存后操作
|
|
|
|
+ //生成报验单号
|
|
|
|
+ updateInspection(inspection, req);
|
|
|
|
+ //生成空派单信息
|
|
|
|
+ dispatchService.genDispatch(inspection);
|
|
|
|
+ }
|
|
|
|
+ //重新报验
|
|
|
|
+ else if("reInspection".equals(req.getOperType())) {
|
|
|
|
+ reInspection(req.getId(), req.getUpdate());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 保存后操作
|
|
* 保存后操作
|
|
*
|
|
*
|
|
@@ -435,6 +487,36 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
return 2;
|
|
return 2;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 保存历史记录
|
|
|
|
+ *
|
|
|
|
+ * @param inspection
|
|
|
|
+ * @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)) {
|
|
|
|
+ return ;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ OperDto operDto = getOper("80");
|
|
|
|
+ //添加日志
|
|
|
|
+ InsideInspectionOperBaseDto operBaseDto = new InsideInspectionOperBaseDto();
|
|
|
|
+ operBaseDto.setLaunchSource(req.getLaunchSource());
|
|
|
|
+ List<String> list = new ArrayList();
|
|
|
|
+ list.add(req.getId());
|
|
|
|
+ operBaseDto.setInsideIdList(list);
|
|
|
|
+
|
|
|
|
+ operLogService.saveOperLog(operBaseDto, operDto, descMap);
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 派单和执行
|
|
* 派单和执行
|
|
*
|
|
*
|