|
@@ -11,6 +11,7 @@ import cn.hutool.core.util.ZipUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.rongwei.bscommon.sys.dao.ZhcxInsideInspectionDao;
|
|
|
import com.rongwei.bscommon.sys.feign.BsPlatformService;
|
|
|
import com.rongwei.bscommon.sys.service.*;
|
|
|
import com.rongwei.bscommon.sys.utils.ZhcxCommon;
|
|
@@ -104,6 +105,9 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
@Autowired
|
|
|
private ZhcxOutsideInspectionSyncRecordService syncRecordService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ZhcxInsideInspectionDao insideInspectionDao;
|
|
|
+
|
|
|
/**
|
|
|
* 保存外部报验单
|
|
|
*
|
|
@@ -113,6 +117,8 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
@Transactional
|
|
|
public void insertInspection(OutsideInspectionInsertRequest req) {
|
|
|
|
|
|
+
|
|
|
+
|
|
|
//保存单据
|
|
|
try {
|
|
|
sysGeneralCRUDService.generalMsInsert(req.getInsert());
|
|
@@ -888,7 +894,7 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
ZhcxOutsideInspectionItpDo updateEntity = new ZhcxOutsideInspectionItpDo();
|
|
|
updateEntity.setId(itpDo.getId());
|
|
|
updateEntity.setInspectioncode(genCode());
|
|
|
- //构件
|
|
|
+ //设值构件
|
|
|
ZhcxItpProjectNodesDo structre = itpProjectNodesService.getById(itpDo.getStructureid());
|
|
|
if(ObjectUtil.isNotNull(structre)) {
|
|
|
StringBuilder sb = new StringBuilder();
|
|
@@ -908,11 +914,16 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- //报验点
|
|
|
+
|
|
|
+ //设值报验点
|
|
|
ZhcxItpProjectNodesDo inspectionContentPoint = itpProjectNodesService.getById(itpDo.getInspectioncontentid());
|
|
|
if(ObjectUtil.isNotNull(inspectionContentPoint) && ObjectUtil.isNotEmpty(inspectionContentPoint.getNodename())) {
|
|
|
updateEntity.setInspectionenpoint(inspectionContentPoint.getEnname());
|
|
|
}
|
|
|
+
|
|
|
+ //设值检验员班组检验室
|
|
|
+ updateSetLaboratoryByCheckerId(itpDo.getCheckerid(), updateEntity);
|
|
|
+
|
|
|
updateById(updateEntity);
|
|
|
|
|
|
//操作记录
|
|
@@ -921,6 +932,48 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
zhcxOutsideInspectionItpOperLogService.save(itpLog);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 设置检验室和班组
|
|
|
+ *
|
|
|
+ * @param checkerId
|
|
|
+ * @param updateEntity
|
|
|
+ */
|
|
|
+ private void updateSetLaboratoryByCheckerId(String checkerId, ZhcxOutsideInspectionItpDo updateEntity) {
|
|
|
+ List<Map<String, String>> laboratoryList = insideInspectionDao.getLaboratoryByCheckId(checkerId);
|
|
|
+ if(ObjectUtil.isEmpty(laboratoryList)) {
|
|
|
+ throw new CustomException("检验员暂无检验室");
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, String> row30 = null;
|
|
|
+ for(Map<String, String> row : laboratoryList) {
|
|
|
+ if("30".equals(row.get("ORGTYPE"))) {
|
|
|
+ row30 = row;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //不存在班组,按检验室处理
|
|
|
+ if(ObjectUtil.isNull(row30)) {
|
|
|
+ //检验室
|
|
|
+ updateEntity.setLaboratoryid(laboratoryList.get(0).get("ID"));
|
|
|
+ updateEntity.setLaboratoryname(laboratoryList.get(0).get("SHORTNAME"));
|
|
|
+ updateEntity.setLaboratorypathid(laboratoryList.get(0).get("FULLPID"));
|
|
|
+ //班组
|
|
|
+ updateEntity.setTeamgroupid("");
|
|
|
+ updateEntity.setTeamgroupname("");
|
|
|
+ updateEntity.setTeamgrouppathid("");
|
|
|
+ } else {
|
|
|
+ //检验室
|
|
|
+ updateEntity.setLaboratoryid(row30.get("PID"));
|
|
|
+ updateEntity.setLaboratoryname(row30.get("PSHORTNAME"));
|
|
|
+ updateEntity.setLaboratorypathid(row30.get("PFULLPID"));
|
|
|
+ //班组
|
|
|
+ updateEntity.setTeamgroupid(row30.get("ID"));
|
|
|
+ updateEntity.setTeamgroupname(row30.get("SHORTNAME"));
|
|
|
+ updateEntity.setTeamgrouppathid(row30.get("FULLPID"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 生成派单
|
|
|
* 1、校验是否已存在
|
|
@@ -1160,7 +1213,7 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
|
sync.setIssupp("n");
|
|
|
}
|
|
|
|
|
|
- sync.setBase("长兴分公司");
|
|
|
+ sync.setBase(sync.getCompanyname());
|
|
|
|
|
|
//同步信息
|
|
|
ZhcxOutsideInspectionSyncRecordDo record = new ZhcxOutsideInspectionSyncRecordDo();
|