|
|
|
|
@ -3,6 +3,7 @@ package org.springblade.desk.quality.service.impl; |
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.alibaba.nacos.common.utils.CollectionUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
@ -31,12 +32,10 @@ import org.springblade.desk.basic.service.ICenterTeamService; |
|
|
|
|
import org.springblade.desk.basic.service.IPlatingService; |
|
|
|
|
import org.springblade.desk.basic.util.IdUtil; |
|
|
|
|
import org.springblade.desk.basic.util.StatusCountMap; |
|
|
|
|
import org.springblade.desk.dashboard.pojo.entity.BsProcessSetEntity; |
|
|
|
|
import org.springblade.desk.dashboard.pojo.entity.DsPartEntity; |
|
|
|
|
import org.springblade.desk.dashboard.pojo.entity.DsPartRelationEntity; |
|
|
|
|
import org.springblade.desk.dashboard.pojo.entity.DsPartSub; |
|
|
|
|
import org.springblade.desk.dashboard.pojo.entity.*; |
|
|
|
|
import org.springblade.desk.dashboard.service.IBsProcessSetService; |
|
|
|
|
import org.springblade.desk.dashboard.service.IDsPartService; |
|
|
|
|
import org.springblade.desk.dashboard.service.IDsPartVersionService; |
|
|
|
|
import org.springblade.desk.device.pojo.entity.EquipmentEntity; |
|
|
|
|
import org.springblade.desk.device.pojo.entity.FeiBaSetEntity; |
|
|
|
|
import org.springblade.desk.device.pojo.entity.RackSetEntity; |
|
|
|
|
@ -50,7 +49,9 @@ import org.springblade.desk.produce.mapper.WorkOrderMapper; |
|
|
|
|
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.MakeRecExpandVO; |
|
|
|
|
import org.springblade.desk.produce.pojo.vo.ProduceMonitorSlotListVO; |
|
|
|
|
import org.springblade.desk.produce.pojo.vo.WorkPlanExpandVO; |
|
|
|
|
import org.springblade.desk.produce.service.*; |
|
|
|
|
import org.springblade.desk.quality.constant.InspectionItemConst; |
|
|
|
|
import org.springblade.desk.quality.constant.InspectionTaskConst; |
|
|
|
|
@ -63,6 +64,7 @@ import org.springblade.desk.quality.pojo.request.InspectionTaskStartNew; |
|
|
|
|
import org.springblade.desk.quality.pojo.vo.*; |
|
|
|
|
import org.springblade.desk.quality.service.*; |
|
|
|
|
import org.springblade.desk.quality.wrapper.InspectionTaskListWrapper; |
|
|
|
|
import org.springblade.scheduling.pojo.entity.WorkPlanEntity; |
|
|
|
|
import org.springblade.system.feign.IDictClient; |
|
|
|
|
import org.springblade.system.feign.IUserClient; |
|
|
|
|
import org.springblade.system.pojo.entity.User; |
|
|
|
|
@ -75,6 +77,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.function.Function; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -138,6 +141,12 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap |
|
|
|
|
private IProReTemplateService proReTemplateService; |
|
|
|
|
@Resource |
|
|
|
|
private IMesRbFilePreserveDetailService mesRbFilePreserveDetailService; |
|
|
|
|
@Resource |
|
|
|
|
private IDsPartVersionService dsPartVersionService; |
|
|
|
|
@Resource |
|
|
|
|
private IWorkPlanItemService workPlanItemService; |
|
|
|
|
@Resource |
|
|
|
|
private IMakeRecService makeRecService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@ -403,7 +412,6 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* |
|
|
|
|
* @param start |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@ -626,68 +634,345 @@ public class InspectionTaskServiceImpl extends BaseServiceImpl<InspectionTaskMap |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public JSONObject newPagePrintEleFiles(Long woId, List<Boolean> planList, List<Boolean> moduleList) { |
|
|
|
|
|
|
|
|
|
if (woId == null || planList == null || planList.size() == 0) { |
|
|
|
|
if (woId == null) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
List<WorkPlanExpandVO> wpList = workPlanMapper.selectExpandByWoId(woId); |
|
|
|
|
if (planList == null || planList.isEmpty()) { |
|
|
|
|
planList = new ArrayList<>(); |
|
|
|
|
for (int i = 0; i < wpList.size(); i++) { |
|
|
|
|
planList.add(Boolean.TRUE); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
JSONObject jsonObj = new JSONObject(); |
|
|
|
|
// WorkOrder wo = workOrderService.getById(woId);
|
|
|
|
|
WorkOrder wo = workOrderMapper.selectById(woId); |
|
|
|
|
YieldOrder pjYieldOrder = yieldOrderMapper.selectById(wo.getYoId()); |
|
|
|
|
QueryWrapper<DsPartEntity> qwpart = new QueryWrapper<>(); |
|
|
|
|
qwpart.eq("PART_CODE", pjYieldOrder.getPartCode()); |
|
|
|
|
List<DsPartEntity> partList = partService.list(qwpart); |
|
|
|
|
DsPartEntity dsPart = new DsPartEntity(); |
|
|
|
|
if (partList != null && partList.size() > 0) { |
|
|
|
|
dsPart = partList.get(0); |
|
|
|
|
YieldOrder yo = yieldOrderMapper.selectById(wo.getYoId()); |
|
|
|
|
List<DsPartVersionEntity> partVersionList = dsPartVersionService.list(new LambdaQueryWrapper<DsPartVersionEntity>().eq(DsPartVersionEntity::getPartCode, yo.getPartCode()).eq(DsPartVersionEntity::getPartVersion, yo.getPartVersion())); |
|
|
|
|
DsPartEntity dsPart = null; |
|
|
|
|
if (CollectionUtils.isNotEmpty(partVersionList)) { |
|
|
|
|
dsPart = partService.getById(partVersionList.get(0).getPartId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QueryWrapper<WorkPlan> qwplan = new QueryWrapper<>(); |
|
|
|
|
qwplan.eq("WO_ID", woId); |
|
|
|
|
List<WorkPlan> wpList = workPlanMapper.selectList(qwplan); |
|
|
|
|
if (moduleList.get(0)) { |
|
|
|
|
// 头记录
|
|
|
|
|
JSONObject modelJson = new JSONObject(); |
|
|
|
|
modelJson.put("wo", wo); |
|
|
|
|
modelJson.put("dsPart", dsPart); |
|
|
|
|
JSONObject modelJson = buildModelOne(wo, yo, dsPart); |
|
|
|
|
jsonObj.put("modelOne", modelJson); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 检验记录
|
|
|
|
|
if (moduleList.get(1)) { |
|
|
|
|
JSONObject modelJson1 = new JSONObject(); |
|
|
|
|
// List<PrintChildCheck> checkList = this.getCheckListNotNG(woId, true);
|
|
|
|
|
// modelJson1.put("checkList", checkList);
|
|
|
|
|
//
|
|
|
|
|
// List<PrWorkPlan> checkPrWorkPlan = new ArrayList<>();
|
|
|
|
|
// for (PrWorkPlan prWorkPlan : wpList) {
|
|
|
|
|
// if(prWorkPlan.getProcedureSet() != null){
|
|
|
|
|
// if("镀后检验".equals(prWorkPlan.getProcedureSet().getPpsName())){
|
|
|
|
|
// checkPrWorkPlan.add(prWorkPlan);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// modelJson1.put("checkPrWorkPlan", checkPrWorkPlan);
|
|
|
|
|
List<JSONObject> checkList = this.getCheckListNotNG(woId, wpList, true); |
|
|
|
|
modelJson1.put("checkList", checkList); |
|
|
|
|
jsonObj.put("modelThree", modelJson1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 生产过程(放在获取检验记录下面,这个方法会排除数据)
|
|
|
|
|
this.getNewProcess(wpList, jsonObj, planList); |
|
|
|
|
jsonObj.put("modelTwo", wpList); |
|
|
|
|
List<JSONObject> modelTwoList = this.buildModelTwo(wpList, planList); |
|
|
|
|
jsonObj.put("modelTwo", modelTwoList); |
|
|
|
|
|
|
|
|
|
if (moduleList.get(2)) { |
|
|
|
|
// 镀后入库记录
|
|
|
|
|
jsonObj.put("modelFour", null); |
|
|
|
|
} |
|
|
|
|
if (moduleList.get(3)) { |
|
|
|
|
// 审理单记录
|
|
|
|
|
// PrWorkOrder wor = this.getByKey(woId);
|
|
|
|
|
// PjYieldOrder yo = wo.getPjYieldOrder();
|
|
|
|
|
// jsonObj.put("modelFive", qcReviewSheetDao.getQcReviewSheetList(yo.getPartCode(), yo.getBatchNo()));
|
|
|
|
|
jsonObj.put("modelFive", null); |
|
|
|
|
} |
|
|
|
|
if (moduleList.get(2)) { |
|
|
|
|
// 镀后入库记录
|
|
|
|
|
jsonObj.put("modelFour", wpList.get(wpList.size() - 1)); |
|
|
|
|
} |
|
|
|
|
return jsonObj; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 构建modelOne |
|
|
|
|
* @param wo |
|
|
|
|
* @param yo |
|
|
|
|
* @param dsPart |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private JSONObject buildModelOne(WorkOrder wo, YieldOrder yo, DsPartEntity dsPart) { |
|
|
|
|
JSONObject woJson = new JSONObject(); |
|
|
|
|
JSONObject yoJson = new JSONObject(); |
|
|
|
|
JSONObject partJson = new JSONObject(); |
|
|
|
|
JSONObject modelJson = new JSONObject(); |
|
|
|
|
partJson.put("partCode", dsPart.getPartCode()); |
|
|
|
|
partJson.put("partName", dsPart.getPartName()); |
|
|
|
|
partJson.put("hardness", dsPart.getHardness()); |
|
|
|
|
partJson.put("plate", dsPart.getPlate()); |
|
|
|
|
partJson.put("material", dsPart.getMaterial()); |
|
|
|
|
partJson.put("cruxMemo", dsPart.getKeyInfo()); |
|
|
|
|
partJson.put("memo", dsPart.getRemarks()); |
|
|
|
|
yoJson.put("productType", yo.getProductType()); |
|
|
|
|
yoJson.put("prodIdent", yo.getProductIdent()); |
|
|
|
|
yoJson.put("poQty", yo.getYpQty()); |
|
|
|
|
yoJson.put("poArea", yo.getYpArea()); |
|
|
|
|
yoJson.put("primaryCraft", yo.getPrimaryCraft()); |
|
|
|
|
woJson.put("batchNo", wo.getBatchNo()); |
|
|
|
|
woJson.put("pjYieldOrder", yoJson); |
|
|
|
|
modelJson.put("wo", woJson); |
|
|
|
|
modelJson.put("dsPart", partJson); |
|
|
|
|
return modelJson; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 构建modelTwo |
|
|
|
|
* @param wpList |
|
|
|
|
* @param modelFlag |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private List<JSONObject> buildModelTwo(List<WorkPlanExpandVO> wpList, List<Boolean> modelFlag) { |
|
|
|
|
if (wpList == null || wpList.size() == 0) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
List<JSONObject> modelTwoList = new ArrayList<>(); |
|
|
|
|
for (int i = 0; i < wpList.size(); i++) { |
|
|
|
|
if (i < modelFlag.size() && modelFlag.get(i)) { |
|
|
|
|
JSONObject modelTwo = new JSONObject(); |
|
|
|
|
JSONObject procedureSet = new JSONObject(); |
|
|
|
|
List<JSONObject> slotList = new ArrayList<>(); |
|
|
|
|
JSONObject tankInfo = new JSONObject(); |
|
|
|
|
WorkPlanExpandVO prWorkPlan = wpList.get(i); |
|
|
|
|
procedureSet.put("ppsName", prWorkPlan.getPpsName()); |
|
|
|
|
tankInfo.put("cdjArea", null); |
|
|
|
|
tankInfo.put("pdjArea", null); |
|
|
|
|
tankInfo.put("gjArea", null); |
|
|
|
|
modelTwo.put("orders", prWorkPlan.getOrders()); |
|
|
|
|
modelTwo.put("papers", prWorkPlan.getPapers()); |
|
|
|
|
modelTwo.put("createMan", prWorkPlan.getCreateMan()); |
|
|
|
|
modelTwo.put("factEndTime", prWorkPlan.getFactEndTime()); |
|
|
|
|
modelTwo.put("referenceFile", prWorkPlan.getReferenceFile()); |
|
|
|
|
modelTwo.put("procedureSet", procedureSet); |
|
|
|
|
modelTwo.put("slotList", slotList); |
|
|
|
|
modelTwo.put("tankInfo", tankInfo); |
|
|
|
|
if (WorkPlan.PRINT_TYPE_PROCESS.equals(prWorkPlan.getPrintType())) { |
|
|
|
|
// 同槽信息(从设备,工装使用记录获取)
|
|
|
|
|
List<ProduceMonitorSlotListVO> slotVOList = null; |
|
|
|
|
//zxh 20250626 增加固溶工序同炉数据
|
|
|
|
|
if ("固溶".equals(prWorkPlan.getPpsName())) { |
|
|
|
|
slotVOList = workPlanMapper.listSlotInfoGr(prWorkPlan.getId(), Boolean.FALSE); |
|
|
|
|
} else { |
|
|
|
|
slotVOList = workPlanMapper.listSlotInfoList(prWorkPlan.getId(), Boolean.TRUE); |
|
|
|
|
if (slotVOList == null || slotVOList.size() == 0) { |
|
|
|
|
slotVOList = workPlanMapper.listSlotInfoList(prWorkPlan.getId(), Boolean.FALSE); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (CollectionUtils.isNotEmpty(slotVOList)) { |
|
|
|
|
for (ProduceMonitorSlotListVO slot : slotVOList) { |
|
|
|
|
JSONObject slotJson = new JSONObject(); |
|
|
|
|
slotJson.put("mtuCode", slot.getMtuCode()); |
|
|
|
|
slotJson.put("partCode", slot.getPartCode()); |
|
|
|
|
slotJson.put("batchNo", slot.getBatchNo()); |
|
|
|
|
slotJson.put("workQty", slot.getWorkQty()); |
|
|
|
|
slotJson.put("prodIdent", slot.getProdIdent()); |
|
|
|
|
slotJson.put("area", slot.getArea()); |
|
|
|
|
slotJson.put("totalArea", slot.getTotalArea()); |
|
|
|
|
slotList.add(slotJson); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<MesRbFilePreserveSlotEntity> dsRbFilePreserveSlotList = buildDsRbFilePreserveSlotList(prWorkPlan); |
|
|
|
|
modelTwo.put("dsRbFilePreserveSlotList", dsRbFilePreserveSlotList); |
|
|
|
|
} |
|
|
|
|
// 设备编号信息(从设备,工装使用记录获取)
|
|
|
|
|
List<MacToolUse> mtuList = workPlanMapper.listMacToolUse(prWorkPlan.getId(), Boolean.FALSE); |
|
|
|
|
if (CollectionUtils.isNotEmpty(mtuList)) { |
|
|
|
|
List<Long> racks = mtuList.stream().map(MacToolUse::getBsRackSet).collect(Collectors.toList()); |
|
|
|
|
List<Long> bas = mtuList.stream().map(MacToolUse::getBsFeiBaSet).collect(Collectors.toList()); |
|
|
|
|
List<Long> cards = mtuList.stream().map(MacToolUse::getEquipmentCard).collect(Collectors.toList()); |
|
|
|
|
List<RackSetEntity> rackList = rackSetService.listByIds(racks); |
|
|
|
|
List<FeiBaSetEntity> basList = feiBaSetService.listByIds(bas); |
|
|
|
|
List<EquipmentEntity> cardList = mesEquipmentCardService.listByIds(cards); |
|
|
|
|
// 设备编号
|
|
|
|
|
String gj = StringUtils.join(rackList.stream().filter(j -> j.getRsType() != null).map(j -> j.getRsType()).collect(Collectors.toList()), "'、'"); |
|
|
|
|
String fb = StringUtils.join(basList.stream().filter(j -> j.getFsType() != null).map(j -> j.getFsType()).collect(Collectors.toList()), "、"); |
|
|
|
|
String eq = StringUtils.join(cardList.stream().filter(j -> j.getDeviceCode() != null).map(j -> j.getDeviceCode()).collect(Collectors.toList()), "、"); |
|
|
|
|
modelTwo.put("gjCode", gj); |
|
|
|
|
modelTwo.put("fbCode", fb); |
|
|
|
|
modelTwo.put("deviceCode", eq); |
|
|
|
|
} |
|
|
|
|
List<MakeRecExpandVO> makeRecs = makeRecService.selectVOByWpId(prWorkPlan.getId()); |
|
|
|
|
MakeRecExpandVO makeRec = null; |
|
|
|
|
if (CollectionUtils.isNotEmpty(makeRecs)) { |
|
|
|
|
makeRec = makeRecs.get(0); |
|
|
|
|
} |
|
|
|
|
List<InspectionTask> workCheckListByWpId = this.getPrWorkCheckListByWpId(prWorkPlan.getId()); |
|
|
|
|
InspectionTask maxPrWorkCheck = workCheckListByWpId.stream().max(Comparator.comparing(InspectionTask::getCheckDate)).orElse(null); |
|
|
|
|
if (prWorkPlan.getOcId() == null && prWorkPlan.getReceiveMan() != null) { |
|
|
|
|
if (makeRec != null) { |
|
|
|
|
modelTwo.put("createMan", makeRec.getWorkerName()); |
|
|
|
|
} else if (maxPrWorkCheck != null) { |
|
|
|
|
R<User> user = userClient.userInfoById(maxPrWorkCheck.getCheckUserId()); |
|
|
|
|
if (user != null && user.getData() != null) { |
|
|
|
|
modelTwo.put("createMan", user.getData().getRealName()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
R<User> user = userClient.userInfoById(prWorkPlan.getReceiveMan()); |
|
|
|
|
if (user != null && user.getData() != null) { |
|
|
|
|
modelTwo.put("createMan", user.getData().getRealName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else if (prWorkPlan.getOcId() != null) { // 外协
|
|
|
|
|
Oem oem = oemMapper.selectById(prWorkPlan.getOcId()); |
|
|
|
|
if (oem != null) { |
|
|
|
|
modelTwo.put("createMan", oem.getCode()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 如果是荧光检测工序,需要返回报工人签章图片
|
|
|
|
|
if ("荧光检测".equals(prWorkPlan.getPpsName())) { |
|
|
|
|
if (makeRec != null) { |
|
|
|
|
String checkManByNewErpMes = workPlanMapper.getCheckManByNewErpMes(makeRec.getWorkerAccount()); |
|
|
|
|
modelTwo.put("workerImgUrl", checkManByNewErpMes); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
modelTwoList.add(modelTwo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return modelTwoList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 构建dsRbFilePreserveSlotList |
|
|
|
|
* @param workPlan |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private List<MesRbFilePreserveSlotEntity> buildDsRbFilePreserveSlotList(WorkPlanExpandVO workPlan){ |
|
|
|
|
List<MesRbFilePreserveSlotEntity> dsRbFilePreserveSlotList = new ArrayList<>(); |
|
|
|
|
QueryWrapper<CenterTeam> qwteam = new QueryWrapper<>(); |
|
|
|
|
qwteam.eq("TS_ID", workPlan.getMakeTeam()); |
|
|
|
|
List<CenterTeam> teamList = centerTeamService.list(qwteam); |
|
|
|
|
CenterTeam bsCenterTeam = null; |
|
|
|
|
if (teamList != null && teamList.size() > 0) { |
|
|
|
|
bsCenterTeam = teamList.get(0); |
|
|
|
|
} |
|
|
|
|
if (bsCenterTeam != null && bsCenterTeam.getWcId() != null) { |
|
|
|
|
MacToolUse prMacToolUse; |
|
|
|
|
List<MesRbFilePreserveSlotEntity> preserveSlotList; |
|
|
|
|
List<MesQcProduceRunEntity> qcProduceRunsList; |
|
|
|
|
MesQcProduceRunEntity boxInfo = new MesQcProduceRunEntity(); |
|
|
|
|
// 根据电子档案维护组装数据(上线前) 分槽
|
|
|
|
|
List<MacToolUse> dataByWpIdAndIndexList = workPlanMapper.getDataByWpIdAndIndexList(workPlan.getId(), "1"); |
|
|
|
|
if (dataByWpIdAndIndexList != null && dataByWpIdAndIndexList.size() > 0) { |
|
|
|
|
for (MacToolUse prMacToolUseItem : dataByWpIdAndIndexList) { |
|
|
|
|
if (prMacToolUseItem != null && prMacToolUseItem.getId() != null) { |
|
|
|
|
// 获取模板数据
|
|
|
|
|
preserveSlotList = mesRbFilePreserveSlotService.getByRfpId(Long.valueOf(prMacToolUseItem.getRfpId())); |
|
|
|
|
qcProduceRunsList = workPlanMapper.listPrByWpIdIndexAndMtnCode(workPlan.getId(), 1, prMacToolUseItem.getMtnCode()); |
|
|
|
|
// 烘箱信息(从设备,工装使用记录获取)
|
|
|
|
|
List<MesQcProduceRunEntity> runs = workPlanMapper.getBoxInfoByWpIdMtnCodeList(workPlan.getId()); |
|
|
|
|
if (runs != null && runs.size() > 0) { |
|
|
|
|
boxInfo = runs.get(0); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(boxInfo.getInDate())) { |
|
|
|
|
qcProduceRunsList.add(boxInfo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (qcProduceRunsList != null && qcProduceRunsList.size() > 0) { |
|
|
|
|
|
|
|
|
|
// 2025-07-23 线上迁移修改删除了日志打印
|
|
|
|
|
// cdl 20250218 修改分槽同一槽号连续出现
|
|
|
|
|
this.setRbFilePreserveData(preserveSlotList, qcProduceRunsList, workPlan, |
|
|
|
|
dsRbFilePreserveSlotList, prMacToolUseItem); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 根据电子档案维护组装数据(自动)
|
|
|
|
|
prMacToolUse = workPlanMapper.getDataByWpIdAndIndex(workPlan.getId(), "2"); |
|
|
|
|
if (prMacToolUse != null && prMacToolUse.getId() != null) { |
|
|
|
|
|
|
|
|
|
List<ProReTemplate> dsRbFilePreserveList = null; |
|
|
|
|
if (workPlan.getPpsId() != null) { |
|
|
|
|
BsProcessSetEntity process = processSetService.getById(workPlan.getPpsId()); |
|
|
|
|
if ("喷砂".equals(process.getName()) || "涂色标".equals(process.getName())) { |
|
|
|
|
dsRbFilePreserveList = workPlanMapper.getDataByWcIdAndPpsId(null, |
|
|
|
|
workPlan.getPpsId(), Boolean.TRUE); |
|
|
|
|
} else { |
|
|
|
|
dsRbFilePreserveList = workPlanMapper.getDataByWcIdAndPpsId(bsCenterTeam.getWcId(), |
|
|
|
|
workPlan.getPpsId(), Boolean.TRUE); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//sql不对
|
|
|
|
|
if (dsRbFilePreserveList != null && dsRbFilePreserveList.size() > 0) { |
|
|
|
|
//00000000000000
|
|
|
|
|
preserveSlotList = workPlanMapper.getByRfpId(dsRbFilePreserveList.get(0).getId()); |
|
|
|
|
qcProduceRunsList = workPlanMapper.listPrByWpIdIndex(workPlan.getId(), 2, Boolean.TRUE); |
|
|
|
|
List<MesQcProduceRunEntity> runs = workPlanMapper.getBoxInfoByWpIdMtnCodeList(workPlan.getId()); |
|
|
|
|
if (runs != null && runs.size() > 0) { |
|
|
|
|
boxInfo = runs.get(0); |
|
|
|
|
} |
|
|
|
|
// 烘箱信息(从设备,工装使用记录获取)
|
|
|
|
|
if (qcProduceRunsList != null && qcProduceRunsList.size() > 0 && StringUtils.isNotBlank(boxInfo.getInDate())) { |
|
|
|
|
qcProduceRunsList.add(boxInfo); |
|
|
|
|
} |
|
|
|
|
if (qcProduceRunsList != null && qcProduceRunsList.size() > 0) { |
|
|
|
|
// cdl 20250218 修改分槽同一槽号连续出现
|
|
|
|
|
this.setRbFilePreserveData(preserveSlotList, qcProduceRunsList, workPlan, |
|
|
|
|
dsRbFilePreserveSlotList, prMacToolUse); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//zxh 20250117 解决单工序绑定两个手动记录只显示一个问题
|
|
|
|
|
List<MacToolUse> prMacToolUseList = workPlanMapper.getDataByWpIdAndIndexList(workPlan.getId(), "3"); |
|
|
|
|
if (prMacToolUseList != null && prMacToolUseList.size() > 0) { |
|
|
|
|
for (MacToolUse prMacToolUseSd : prMacToolUseList) { |
|
|
|
|
if (prMacToolUseSd != null && prMacToolUseSd.getId() != null) { |
|
|
|
|
// 获取模板数据
|
|
|
|
|
preserveSlotList = workPlanMapper.getByRfpId(Long.valueOf(prMacToolUseSd.getRfpId())); |
|
|
|
|
qcProduceRunsList = workPlanMapper.listPrByWpIdIndexAndMtnCode(workPlan.getId(), 3, prMacToolUseSd.getMtnCode()); |
|
|
|
|
// 烘箱信息(从设备,工装使用记录获取)
|
|
|
|
|
List<MesQcProduceRunEntity> runs = workPlanMapper.getBoxInfoByWpIdMtnCodeList(workPlan.getId()); |
|
|
|
|
if (runs != null && runs.size() > 0) { |
|
|
|
|
boxInfo = runs.get(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(boxInfo.getInDate())) { |
|
|
|
|
qcProduceRunsList.add(boxInfo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (qcProduceRunsList != null && qcProduceRunsList.size() > 0) { |
|
|
|
|
|
|
|
|
|
// cdl 20250218 修改分槽同一槽号连续出现
|
|
|
|
|
this.setRbFilePreserveData(preserveSlotList, qcProduceRunsList, workPlan, |
|
|
|
|
dsRbFilePreserveSlotList, prMacToolUseSd); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return dsRbFilePreserveSlotList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private List<JSONObject> getCheckListNotNG(Long woId, List<WorkPlanExpandVO> wpList, Boolean eleOrPrint) { |
|
|
|
|
List<JSONObject> checkList = new ArrayList<>(); |
|
|
|
|
//组装检测项集合
|
|
|
|
|
List<WorkPlanItemVO> piLst = workPlanItemService.listByWoIdNotNG(woId); |
|
|
|
|
Map<Long, WorkPlanExpandVO> workPlanMap = wpList.stream() |
|
|
|
|
.collect(Collectors.toMap( |
|
|
|
|
WorkPlanExpandVO::getId, |
|
|
|
|
Function.identity() |
|
|
|
|
)); |
|
|
|
|
if (CollectionUtils.isNotEmpty(piLst)) { |
|
|
|
|
for (WorkPlanItemVO pi : piLst) { |
|
|
|
|
WorkPlanExpandVO workPlan = workPlanMap.get(pi.getWpId()); |
|
|
|
|
String testOrder = workPlan.getOrders() + "-" + pi.getItemCode(); |
|
|
|
|
JSONObject checkDetail = new JSONObject(); |
|
|
|
|
checkDetail.put("testOrders", testOrder); |
|
|
|
|
checkDetail.put("checkName", pi.getCheckUserRealName()); |
|
|
|
|
if (StringUtils.isNotEmpty(pi.getCheckUserAccount())) { |
|
|
|
|
String checkManByNewErp = workPlanMapper.getCheckManByNewErpMes(pi.getCheckUserAccount()); |
|
|
|
|
if (eleOrPrint) { |
|
|
|
|
checkDetail.put("imgUrl", checkManByNewErp); |
|
|
|
|
} else { |
|
|
|
|
if (checkManByNewErp != null && checkManByNewErp.indexOf("base64,") > 0) { |
|
|
|
|
String checkManByNewErpSubString = checkManByNewErp.substring(checkManByNewErp.indexOf("base64,") + 7); |
|
|
|
|
checkDetail.put("imgUrl", checkManByNewErpSubString); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
checkList.add(checkDetail); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return checkList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void getNewProcess(List<WorkPlan> wpList, JSONObject jsonObj, List<Boolean> modelFlag) { |
|
|
|
|
if (wpList == null || wpList.size() == 0) { |
|
|
|
|
return; |
|
|
|
|
|