|
|
|
|
@ -51,10 +51,7 @@ import org.springblade.desk.produce.mapper.WorkPlanMapper; |
|
|
|
|
import org.springblade.desk.produce.pojo.dto.*; |
|
|
|
|
import org.springblade.desk.produce.pojo.entity.*; |
|
|
|
|
import org.springblade.desk.produce.pojo.vo.ProduceMonitorSlotListVO; |
|
|
|
|
import org.springblade.desk.produce.service.IMesEquipmentCardService; |
|
|
|
|
import org.springblade.desk.produce.service.IMesRbFilePreserveSlotService; |
|
|
|
|
import org.springblade.desk.produce.service.IWorkOrderService; |
|
|
|
|
import org.springblade.desk.produce.service.IWorkPlanService; |
|
|
|
|
import org.springblade.desk.produce.service.*; |
|
|
|
|
import org.springblade.desk.quality.constant.InspectionItemConst; |
|
|
|
|
import org.springblade.desk.quality.constant.InspectionTaskConst; |
|
|
|
|
import org.springblade.desk.quality.constant.ReviewSheetConst; |
|
|
|
|
@ -70,6 +67,7 @@ import org.springblade.scheduling.pojo.entity.ProcessSetEntity; |
|
|
|
|
import org.springblade.system.feign.IDictClient; |
|
|
|
|
import org.springblade.system.feign.IUserClient; |
|
|
|
|
import org.springblade.system.pojo.entity.User; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
@ -142,6 +140,10 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap |
|
|
|
|
private ICenterTeamService centerTeamService; |
|
|
|
|
@Resource |
|
|
|
|
private IMesRbFilePreserveSlotService mesRbFilePreserveSlotService; |
|
|
|
|
@Resource |
|
|
|
|
private IProReTemplateService proReTemplateService; |
|
|
|
|
@Resource |
|
|
|
|
private IMesRbFilePreserveDetailService mesRbFilePreserveDetailService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@ -1719,6 +1721,64 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap |
|
|
|
|
List<MesRbFilePreserveDetailEntity> list = workPlanMapper.getByRfpsIdMesNew(id); |
|
|
|
|
return list; |
|
|
|
|
} |
|
|
|
|
@Override |
|
|
|
|
public void saveOrEditMes(List<MesRbFilePreserveSlotEntity> submitList, List<Long> deleteIds, BladeUser curUserInfo,Long rfpId){ |
|
|
|
|
Map<String, Long> slotNameCountMap = submitList.stream() |
|
|
|
|
// 按slotName分组,key=slotName,value=该名称的元素数量
|
|
|
|
|
.collect(Collectors.groupingBy(MesRbFilePreserveSlotEntity::getSlotName, Collectors.counting())); |
|
|
|
|
List<String> duplicateSlotNames = slotNameCountMap.entrySet().stream().filter(entry -> entry.getValue() > 1).map(Map.Entry::getKey).collect(Collectors.toList()); |
|
|
|
|
if (!duplicateSlotNames.isEmpty()) { |
|
|
|
|
String errorMsg = String.format("以下槽位名称存在重复,不允许保存:%s", String.join(",", duplicateSlotNames)); |
|
|
|
|
throw new RuntimeException(errorMsg); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (submitList.size() > 0) { |
|
|
|
|
ProReTemplate dsRbFilePreserve = proReTemplateService.getById(rfpId); |
|
|
|
|
for (MesRbFilePreserveSlotEntity dsRbFilePreserveSlot : submitList) { |
|
|
|
|
dsRbFilePreserveSlot.setKeepTime(new Date()); |
|
|
|
|
dsRbFilePreserveSlot.setKeepMan(curUserInfo.getNickName()); |
|
|
|
|
dsRbFilePreserveSlot.setDsRbFilePreserve(dsRbFilePreserve); |
|
|
|
|
dsRbFilePreserveSlot.setRfpId(rfpId); |
|
|
|
|
if(StringUtils.isBlank(dsRbFilePreserveSlot.getSlotName())){ |
|
|
|
|
throw new RuntimeException("请将槽号/工位填写完成"); |
|
|
|
|
} |
|
|
|
|
if (dsRbFilePreserveSlot.getRfpId() != null) { |
|
|
|
|
mesRbFilePreserveSlotService.updateById(dsRbFilePreserveSlot); |
|
|
|
|
} else { |
|
|
|
|
mesRbFilePreserveSlotService.save(dsRbFilePreserveSlot); |
|
|
|
|
} |
|
|
|
|
// List<DsRbFilePreserveDetail> subList = dsRbFilePreserveSlot.getChildrenList();
|
|
|
|
|
List<MesRbFilePreserveDetailDTO> subList = dsRbFilePreserveSlot.getChildrenList(); |
|
|
|
|
if (subList.size() > 0) { |
|
|
|
|
for (MesRbFilePreserveDetailDTO dsRbFilePreserveDetail : subList) { |
|
|
|
|
// dsRbFilePreserveDetail.setDsRbFilePreserveSlot(dsRbFilePreserveSlot);
|
|
|
|
|
dsRbFilePreserveDetail.setRfpsId(dsRbFilePreserveSlot.getId()); |
|
|
|
|
if (dsRbFilePreserveDetail.getRfpsId() != null) { |
|
|
|
|
MesRbFilePreserveDetailEntity dsRbFilePreserveDetailDao = new MesRbFilePreserveDetailEntity(); |
|
|
|
|
BeanUtils.copyProperties(dsRbFilePreserveDetail, dsRbFilePreserveDetailDao); |
|
|
|
|
mesRbFilePreserveDetailService.updateById(dsRbFilePreserveDetailDao); |
|
|
|
|
} else { |
|
|
|
|
mesRbFilePreserveDetailService.save(dsRbFilePreserveDetail); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (deleteIds.size() > 0) { |
|
|
|
|
for (Long rfpsId : deleteIds) { |
|
|
|
|
// 删除槽号对应的明细
|
|
|
|
|
// dsRbFilePreserveDetailDao.deleteByRfpsId(rfpsId);
|
|
|
|
|
// dsRbFilePreserveSlotDao.delete(rfpsId);
|
|
|
|
|
mesRbFilePreserveSlotService.removeById(rfpsId); |
|
|
|
|
QueryWrapper<MesRbFilePreserveDetailEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("rfps_id", rfpsId); |
|
|
|
|
mesRbFilePreserveDetailService.remove(queryWrapper); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JSONObject metalParts(Long woId) { |
|
|
|
|
JSONObject obj = new JSONObject(); |
|
|
|
|
|