|
@@ -9,6 +9,7 @@ import com.platform.common.util.*;
|
|
import com.platform.dao.bean.MyPage;
|
|
import com.platform.dao.bean.MyPage;
|
|
import com.platform.dao.dto.sb.BatchSbMeasureLog;
|
|
import com.platform.dao.dto.sb.BatchSbMeasureLog;
|
|
import com.platform.dao.dto.sb.SbChangeRecordDTO;
|
|
import com.platform.dao.dto.sb.SbChangeRecordDTO;
|
|
|
|
+import com.platform.dao.dto.sb.SbInfoDTO;
|
|
import com.platform.dao.dto.sb.SbMeasureLogDTO;
|
|
import com.platform.dao.dto.sb.SbMeasureLogDTO;
|
|
import com.platform.dao.entity.check.CheckProjectStandardRelation;
|
|
import com.platform.dao.entity.check.CheckProjectStandardRelation;
|
|
import com.platform.dao.entity.sb.SbChangeRecord;
|
|
import com.platform.dao.entity.sb.SbChangeRecord;
|
|
@@ -23,6 +24,7 @@ import com.platform.dao.enums.YesNoEnum;
|
|
import com.platform.dao.mapper.sb.*;
|
|
import com.platform.dao.mapper.sb.*;
|
|
import com.platform.dao.vo.query.sb.SbMeasureLogVO;
|
|
import com.platform.dao.vo.query.sb.SbMeasureLogVO;
|
|
import com.platform.dao.vo.report.MeasureLogReportVO;
|
|
import com.platform.dao.vo.report.MeasureLogReportVO;
|
|
|
|
+import com.platform.dao.vo.sb.SbInfoVO;
|
|
import com.platform.service.base.impl.BaseServiceImpl;
|
|
import com.platform.service.base.impl.BaseServiceImpl;
|
|
import com.platform.service.sb.SbMeasureLogService;
|
|
import com.platform.service.sb.SbMeasureLogService;
|
|
import com.platform.service.upms.SysFileService;
|
|
import com.platform.service.upms.SysFileService;
|
|
@@ -143,7 +145,6 @@ public class SbMeasureLogServiceImpl extends BaseServiceImpl<SbMeasureLogMapper,
|
|
SbInfo tempInfo = new SbInfo();
|
|
SbInfo tempInfo = new SbInfo();
|
|
tempInfo.setId(sbInfo.getId());
|
|
tempInfo.setId(sbInfo.getId());
|
|
// 判断设备状态,如果是在库,修改设备状态即可
|
|
// 判断设备状态,如果是在库,修改设备状态即可
|
|
-
|
|
|
|
model.setCheckUserId(SecurityUtils.getUserInfo().getUserId()); // 谁操作即是检定记录人
|
|
model.setCheckUserId(SecurityUtils.getUserInfo().getUserId()); // 谁操作即是检定记录人
|
|
if (SbUseType.BGCL.getValue().equals(sbInfo.getUseType())) {
|
|
if (SbUseType.BGCL.getValue().equals(sbInfo.getUseType())) {
|
|
model.setType(1);
|
|
model.setType(1);
|
|
@@ -316,6 +317,19 @@ public class SbMeasureLogServiceImpl extends BaseServiceImpl<SbMeasureLogMapper,
|
|
record.setOldParentId(sb.getParentId());
|
|
record.setOldParentId(sb.getParentId());
|
|
record.setParentId(model.getSbParentId());
|
|
record.setParentId(model.getSbParentId());
|
|
break;
|
|
break;
|
|
|
|
+ case CommonConstants.CHANGE_TYPE_SB_PPNO:
|
|
|
|
+ record.setSbNoId(model.getSbPpno());
|
|
|
|
+ record.setStartTime(LocalDateTime.now());
|
|
|
|
+ // 将之前位置编号的结束时间修正
|
|
|
|
+ SbChangeRecordDTO dto2 = new SbChangeRecordDTO();
|
|
|
|
+ dto2.setChangeType(record.getChangeType());
|
|
|
|
+ dto2.setSbNoId(model.getSbPositionNo());
|
|
|
|
+ SbChangeRecord oldRecord2 = sbChangeRecordMapper.getLastOne(dto2);
|
|
|
|
+ if (oldRecord2 != null) {
|
|
|
|
+ oldRecord2.setEndTime(LocalDateTime.now());
|
|
|
|
+ sbChangeRecordMapper.updateByPrimaryKey(oldRecord2);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
case CommonConstants.CHANGE_TYPE_SB_STATUS:
|
|
case CommonConstants.CHANGE_TYPE_SB_STATUS:
|
|
case CommonConstants.CHANGE_TYPE_SB_ZZH:
|
|
case CommonConstants.CHANGE_TYPE_SB_ZZH:
|
|
break;
|
|
break;
|
|
@@ -468,6 +482,62 @@ public class SbMeasureLogServiceImpl extends BaseServiceImpl<SbMeasureLogMapper,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void saveBatchIn(BatchSbMeasureLog batchSbMeasureLog) {
|
|
|
|
+ if (batchSbMeasureLog.getSbIds() != null && batchSbMeasureLog.getSbIds().size() > 0) {
|
|
|
|
+ batchSbMeasureLog.getSbIds().forEach(item -> {
|
|
|
|
+ this.saveModelForIn(item);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void generateInitLog() {
|
|
|
|
+ SbInfoDTO sbInfoDTO = new SbInfoDTO();
|
|
|
|
+ sbInfoDTO.setUseType(4);
|
|
|
|
+ sbInfoDTO.setIsMeasure(1);
|
|
|
|
+ List<SbInfoVO> list = sbInfoMapper.selectVOList(sbInfoDTO);
|
|
|
|
+ List<SbMeasureLog> logList = ListUtils.newArrayList();
|
|
|
|
+ list.forEach(item -> {
|
|
|
|
+ SbMeasureLog log = new SbMeasureLog();
|
|
|
|
+ log.setName("huangrh");
|
|
|
|
+ log.setLastDate(item.getCheckDate());
|
|
|
|
+ log.setType(1);
|
|
|
|
+ log.setCheckUserId("62d61960030de40d4cdd579f");
|
|
|
|
+ log.setRequirement("龙岩质检");
|
|
|
|
+ log.setCreatedUserId("62d61960030de40d4cdd579f");
|
|
|
|
+ log.setCreatedTime(LocalDateTime.now());
|
|
|
|
+ log.setCreatedUserName("黄汝煌");
|
|
|
|
+ log.setUpdateTime(LocalDateTime.now());
|
|
|
|
+ log.setSbId(item.getId());
|
|
|
|
+ log.setId(IdGeneratorUtils.getObjectId());
|
|
|
|
+ logList.add(log);
|
|
|
|
+ });
|
|
|
|
+ mapper.insertList(logList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 入库
|
|
|
|
+ * @param sbId
|
|
|
|
+ */
|
|
|
|
+ private void saveModelForIn(String sbId){
|
|
|
|
+ SbInfo sbInfo = sbInfoMapper.selectByPrimaryKey(sbId);
|
|
|
|
+ String oldPositionId = getPureString(sbInfo.getPositionId());
|
|
|
|
+ // 修改设备状态,【位号、父位号、设备位置清空】
|
|
|
|
+
|
|
|
|
+ SbMeasureLogDTO dto = new SbMeasureLogDTO();
|
|
|
|
+ // 记录位号
|
|
|
|
+ String remark1 = "设备位号变动【" + sbInfo.getPositionNo() + "】 ---> 【无】";
|
|
|
|
+ handleSbChangeRecord(remark1,dto,sbInfo,CommonConstants.CHANGE_TYPE_SB_NO);
|
|
|
|
+ // 记录父位号
|
|
|
|
+ String remark2 = "设备父位号变动【" + sbInfo.getPpNo() + "】 ---> 【无】";
|
|
|
|
+ handleSbChangeRecord(remark2,dto,sbInfo,CommonConstants.CHANGE_TYPE_SB_PPNO);
|
|
|
|
+ // 记录设备位置
|
|
|
|
+ String before = oldPositionId == "" ? oldPositionId : sbPositionMapper.selectNameById(oldPositionId);
|
|
|
|
+ String remark3 = "设备位置变动【" + before + "】 ---> 【无】";
|
|
|
|
+ handleSbChangeRecord(remark3,dto,sbInfo,CommonConstants.CHANGE_TYPE_SB_POSITION);
|
|
|
|
+ }
|
|
|
|
+
|
|
/*@Override
|
|
/*@Override
|
|
public void saveTZSBByDTTO(SbMeasureLogDTO model) {
|
|
public void saveTZSBByDTTO(SbMeasureLogDTO model) {
|
|
// 更新设备下次检定日期
|
|
// 更新设备下次检定日期
|