|
@@ -52,6 +52,7 @@ import com.platform.dao.util.compare.FieldComparedUtils;
|
|
|
import com.platform.dao.vo.SysUserDeptVO;
|
|
|
import com.platform.dao.vo.SysUserVO;
|
|
|
import com.platform.dao.vo.export.sb.ExportSbInfoVO;
|
|
|
+import com.platform.dao.vo.query.sb.SbChangeRecordVO;
|
|
|
import com.platform.dao.vo.query.upms.SysDeptVO;
|
|
|
import com.platform.dao.vo.report.SbInfoTypeReportVO;
|
|
|
import com.platform.dao.vo.report.SbInfoTypeReportVO2;
|
|
@@ -135,6 +136,77 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
private final SbChangeRecordMapper sbChangeRecordMapper;
|
|
|
private final FillGatherTaskDetailMapper fillGatherTaskDetailMapper;
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<SbInfoVO> getPositionNoHistory(SbInfoDTO dto) {
|
|
|
+ dto.setUseType(4);//仪表
|
|
|
+ List<SbInfoVO> sbInfoVOS = mapper.selectVOList(dto);
|
|
|
+ List<String> positionNos = sbInfoVOS.stream().map(SbInfoVO::getPositionNo).collect(Collectors.toList());
|
|
|
+ List<SbChangeRecord> sbChangeRecords = new ArrayList<>();
|
|
|
+// if (positionNos!=null){
|
|
|
+ Weekend<SbChangeRecord> weekend = new Weekend<>(SbChangeRecord.class);
|
|
|
+ WeekendCriteria<SbChangeRecord,Object> weekendCriteria = weekend.weekendCriteria();
|
|
|
+// weekendCriteria.andIn(SbChangeRecord::getSbNoId,positionNos);
|
|
|
+ weekendCriteria.andIsNotNull(SbChangeRecord::getActionType);
|
|
|
+ sbChangeRecords = sbChangeRecordMapper.selectByExample(weekend);
|
|
|
+// }
|
|
|
+ List<SbChangeRecord> tempInList = new ArrayList<>();
|
|
|
+ List<SbChangeRecord> tempOutList = new ArrayList<>();
|
|
|
+ if (sbChangeRecords!=null) {
|
|
|
+ for (SbChangeRecord record : sbChangeRecords){
|
|
|
+ if (record.getActionType()==1){
|
|
|
+ tempInList.add(record);
|
|
|
+ }else {
|
|
|
+ tempOutList.add(record);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<String> recordPositions = sbChangeRecords.stream().map(SbChangeRecord::getSbNoId).distinct().collect(Collectors.toList());
|
|
|
+ SbInfoDTO sbInfoDTO = new SbInfoDTO();
|
|
|
+ sbInfoDTO.setPositionIds(recordPositions);
|
|
|
+ List<SbInfoVO> sbInfoVOS2 = mapper.selectVOList(sbInfoDTO);
|
|
|
+ for (String po:recordPositions){
|
|
|
+ for (SbInfoVO vo:sbInfoVOS2){
|
|
|
+ if (vo.getPositionNo()!=null&&vo.getPositionNo().equals(po)){
|
|
|
+ YiBiaoHisroryVO yiBiaoHisroryVO = new YiBiaoHisroryVO();
|
|
|
+ yiBiaoHisroryVO.setSbName(vo.getName());
|
|
|
+ yiBiaoHisroryVO.setSbId(vo.getId());
|
|
|
+ yiBiaoHisroryVO.setSbNo(vo.getNo());
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (String positions:recordPositions){
|
|
|
+ for (SbInfoVO vo:sbInfoVOS){
|
|
|
+ if (vo.getPositionNo()!=null&&vo.getPositionNo().equals(positions)){
|
|
|
+ YiBiaoHisroryVO yiBiaoHisroryVO = new YiBiaoHisroryVO();
|
|
|
+ yiBiaoHisroryVO.setSbName(vo.getName());
|
|
|
+ yiBiaoHisroryVO.setSbId(vo.getId());
|
|
|
+ yiBiaoHisroryVO.setSbNo(vo.getNo());
|
|
|
+ for (SbChangeRecord record : sbChangeRecords){
|
|
|
+
|
|
|
+ }
|
|
|
+// yiBiaoHisroryVO.setCreatedTime()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+// List<String> inPositions = tempInList.stream().distinct().map(SbChangeRecord::getSbNoId).collect(Collectors.toList());
|
|
|
+// List<String> outPositions = tempOutList.stream().map(SbChangeRecord::getSbNoId).collect(Collectors.toList());
|
|
|
+
|
|
|
+
|
|
|
+ if (sbChangeRecords!=null){
|
|
|
+ for (SbInfoVO vo:sbInfoVOS){
|
|
|
+ YiBiaoHisroryVO yiBiaoHisroryVO = new YiBiaoHisroryVO();
|
|
|
+ yiBiaoHisroryVO.setSbName(vo.getName());
|
|
|
+ yiBiaoHisroryVO.setSbNo(vo.getNo());
|
|
|
+ for (SbChangeRecord record:sbChangeRecords){
|
|
|
+// if (record.getSbId()!=null&&record.getSbId().equals(vo.get))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public int batchDelete(List<String> ids) {
|
|
|
Weekend<SbInfo> weekend = new Weekend<>(SbInfo.class);
|
|
@@ -487,10 +559,29 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
if (model.getIsFinancing() == null) {
|
|
|
model.setIsFinancing(SbInfoFinancingEnum.NOT.getValue());
|
|
|
}
|
|
|
+
|
|
|
setSaveDept(model);
|
|
|
setSbStatusLogAndStopLog(model);
|
|
|
+
|
|
|
// 保存修改记录
|
|
|
SbInfo sbInfo = mapper.selectByPrimaryKey(model.getId());
|
|
|
+ if (model!=null&&model.getPositionNo()!=null&&sbInfo.getUseType()!=null&&sbInfo.getUseType()==4){
|
|
|
+ SbChangeRecord record = new SbChangeRecord();
|
|
|
+ record.setSbId(model.getId());
|
|
|
+ record.setSbNoId(sbInfo.getPositionNo());
|
|
|
+ UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
+ record.setCreatedUserId(userInfo.getUserId());
|
|
|
+ record.setCreatedUserName(userInfo.getUsername());
|
|
|
+ record.setCreatedTime(LocalDateTime.now());
|
|
|
+ record.setId(IdGeneratorUtils.getObjectId());
|
|
|
+ record.setActionType(2);
|
|
|
+ sbChangeRecordMapper.insert(record);
|
|
|
+
|
|
|
+ record.setSbNoId(model.getPositionNo());
|
|
|
+ record.setId(IdGeneratorUtils.getObjectId());
|
|
|
+ record.setActionType(1);
|
|
|
+ sbChangeRecordMapper.insert(record);
|
|
|
+ }
|
|
|
SbInfoDTO oldDTO = BeanConverterUtil.copyObjectProperties(sbInfo, SbInfoDTO.class);
|
|
|
String updateInfo = FieldComparedUtils.compareBean(oldDTO, model);
|
|
|
packageLogInfo(updateInfo, model.getId());
|
|
@@ -526,6 +617,8 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public List<SbInfoTypeReportVO2> getSbNumReport(SbTypeDTO model) {
|
|
|
List<SbInfoTypeReportVO2> sbInfoTypeReportVO2s = new ArrayList<>();
|