|
|
|
@ -73,6 +73,8 @@ import org.springblade.system.cache.UserCache; |
|
|
|
import org.springblade.system.feign.IDictClient; |
|
|
|
import org.springblade.system.feign.IDictClient; |
|
|
|
import org.springblade.system.pojo.entity.Dict; |
|
|
|
import org.springblade.system.pojo.entity.Dict; |
|
|
|
import org.springblade.system.pojo.entity.User; |
|
|
|
import org.springblade.system.pojo.entity.User; |
|
|
|
|
|
|
|
import org.springblade.wms.feign.StGlassCakeOutClient; |
|
|
|
|
|
|
|
import org.springblade.wms.pojo.dto.StGlassCakeOutDTO; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
@ -105,6 +107,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
|
|
|
|
|
|
|
private final IWorkPlanService workPlanService; |
|
|
|
private final IWorkPlanService workPlanService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final StGlassCakeOutClient stGlassCakeOutClient; |
|
|
|
|
|
|
|
|
|
|
|
// 关键:用set方法注入
|
|
|
|
// 关键:用set方法注入
|
|
|
|
// @Autowired
|
|
|
|
// @Autowired
|
|
|
|
@ -1993,6 +1996,18 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
workOrder.setOem("1"); |
|
|
|
workOrder.setOem("1"); |
|
|
|
workOrder.setOemOut("0"); |
|
|
|
workOrder.setOemOut("0"); |
|
|
|
this.updateById(workOrder); |
|
|
|
this.updateById(workOrder); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
YieldOrder yieldOrder = yieldOrderService.getById(workOrder.getYoId()); |
|
|
|
|
|
|
|
// 玻璃封接退火
|
|
|
|
|
|
|
|
if (yieldOrder.getYieldType() == YieldOrderEnum.YIELD_TYPE_4.getCode() && frontWorkPlan != null && 63 == frontWorkPlan.getPpsId()) { |
|
|
|
|
|
|
|
StGlassCakeOutDTO stGlassCakeOutDTO = new StGlassCakeOutDTO(); |
|
|
|
|
|
|
|
stGlassCakeOutDTO.setYoCode(yieldOrder.getYoCode()); |
|
|
|
|
|
|
|
stGlassCakeOutClient.callGeneratePreOutOrder(stGlassCakeOutDTO); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
log.error("调用玻璃饼出库接口失败", e); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@ -2623,14 +2638,14 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Boolean isTransferTest(Long woId) { |
|
|
|
public Boolean isTransferTest(Long woId) { |
|
|
|
WorkOrder workOrder = this.getById(woId); |
|
|
|
WorkOrder workOrder = this.getById(woId); |
|
|
|
if(workOrder == null){ |
|
|
|
if (workOrder == null) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
YieldOrder yieldOrder = yieldOrderService.getById(workOrder.getYoId()); |
|
|
|
YieldOrder yieldOrder = yieldOrderService.getById(workOrder.getYoId()); |
|
|
|
if(yieldOrder == null){ |
|
|
|
if (yieldOrder == null) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
List<DsProcessProjectVO> dsProcessProjectEntities = dsPartService.selectDsProcessProjectByCraftId(yieldOrder.getCraftId(),null); |
|
|
|
List<DsProcessProjectVO> dsProcessProjectEntities = dsPartService.selectDsProcessProjectByCraftId(yieldOrder.getCraftId(), null); |
|
|
|
if (dsProcessProjectEntities == null || dsProcessProjectEntities.isEmpty()) { |
|
|
|
if (dsProcessProjectEntities == null || dsProcessProjectEntities.isEmpty()) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2654,7 +2669,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
// 转换查询结果
|
|
|
|
// 转换查询结果
|
|
|
|
List<Map<String, String>> result = new ArrayList<>(); |
|
|
|
List<Map<String, String>> result = new ArrayList<>(); |
|
|
|
if (mapList != null && !mapList.isEmpty()) { |
|
|
|
if (mapList != null && !mapList.isEmpty()) { |
|
|
|
for (Map<String,String> map : mapList) { |
|
|
|
for (Map<String, String> map : mapList) { |
|
|
|
Map<String, String> item = new HashMap<>(); |
|
|
|
Map<String, String> item = new HashMap<>(); |
|
|
|
item.put("value", map.get("KEY") != null ? map.get("KEY") : ""); |
|
|
|
item.put("value", map.get("KEY") != null ? map.get("KEY") : ""); |
|
|
|
item.put("label", map.get("VALUE") != null ? map.get("VALUE") : ""); |
|
|
|
item.put("label", map.get("VALUE") != null ? map.get("VALUE") : ""); |
|
|
|
@ -2665,24 +2680,24 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String,Object> queryAllocationMess(AllocationMessPageDTO dto) { |
|
|
|
public Map<String, Object> queryAllocationMess(AllocationMessPageDTO dto) { |
|
|
|
List<AllocationMessVO> allocationMessList = erpDataLogisticsClient.queryAllocationMess(dto).getData(); |
|
|
|
List<AllocationMessVO> allocationMessList = erpDataLogisticsClient.queryAllocationMess(dto).getData(); |
|
|
|
int totalAllocationMessNum = erpDataLogisticsClient.queryAllocationMessNum(dto).getData(); |
|
|
|
int totalAllocationMessNum = erpDataLogisticsClient.queryAllocationMessNum(dto).getData(); |
|
|
|
Map<String,Object> result = new HashMap<>(3); |
|
|
|
Map<String, Object> result = new HashMap<>(3); |
|
|
|
result.put("current",dto.getCurrent()); |
|
|
|
result.put("current", dto.getCurrent()); |
|
|
|
result.put("records",allocationMessList); |
|
|
|
result.put("records", allocationMessList); |
|
|
|
result.put("total",totalAllocationMessNum); |
|
|
|
result.put("total", totalAllocationMessNum); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String,Object> queryAllocationStatistics(AllocationMessPageDTO dto) { |
|
|
|
public Map<String, Object> queryAllocationStatistics(AllocationMessPageDTO dto) { |
|
|
|
List<AllocationMessVO> allocationMessList = erpDataLogisticsClient.queryAllocationStatistics(dto).getData(); |
|
|
|
List<AllocationMessVO> allocationMessList = erpDataLogisticsClient.queryAllocationStatistics(dto).getData(); |
|
|
|
int totalAllocationMessNum = erpDataLogisticsClient.queryAllocationStatisticsNum(dto).getData(); |
|
|
|
int totalAllocationMessNum = erpDataLogisticsClient.queryAllocationStatisticsNum(dto).getData(); |
|
|
|
Map<String,Object> result = new HashMap<>(3); |
|
|
|
Map<String, Object> result = new HashMap<>(3); |
|
|
|
result.put("current",dto.getCurrent()); |
|
|
|
result.put("current", dto.getCurrent()); |
|
|
|
result.put("records",allocationMessList); |
|
|
|
result.put("records", allocationMessList); |
|
|
|
result.put("total",totalAllocationMessNum); |
|
|
|
result.put("total", totalAllocationMessNum); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -2726,7 +2741,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
WorkOrder workOrder = this.getById(woId); |
|
|
|
WorkOrder workOrder = this.getById(woId); |
|
|
|
String cardNo = workOrder.getCardNo(); |
|
|
|
String cardNo = workOrder.getCardNo(); |
|
|
|
// 处理每个测试项
|
|
|
|
// 处理每个测试项
|
|
|
|
processTestItems(testList, batchNo, quantity, woCode, remark, partCode, partName, productType, pptCode, workPlan, user,cardNo); |
|
|
|
processTestItems(testList, batchNo, quantity, woCode, remark, partCode, partName, productType, pptCode, workPlan, user, cardNo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String generatePptCode() { |
|
|
|
private String generatePptCode() { |
|
|
|
@ -2755,14 +2770,14 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
private WorkPlan findRelevantWorkPlan(Long woId) { |
|
|
|
private WorkPlan findRelevantWorkPlan(Long woId) { |
|
|
|
WorkOrder workOrder = this.getById(woId); |
|
|
|
WorkOrder workOrder = this.getById(woId); |
|
|
|
YieldOrder yieldOrder = yieldOrderService.getById(workOrder.getYoId()); |
|
|
|
YieldOrder yieldOrder = yieldOrderService.getById(workOrder.getYoId()); |
|
|
|
List<DsProcessProjectVO> dsProcessProjectEntities = dsPartService.selectDsProcessProjectByCraftId(yieldOrder.getCraftId(),null); |
|
|
|
List<DsProcessProjectVO> dsProcessProjectEntities = dsPartService.selectDsProcessProjectByCraftId(yieldOrder.getCraftId(), null); |
|
|
|
WorkPlan prWorkPlan = null; |
|
|
|
WorkPlan prWorkPlan = null; |
|
|
|
if (dsProcessProjectEntities != null && !dsProcessProjectEntities.isEmpty()) { |
|
|
|
if (dsProcessProjectEntities != null && !dsProcessProjectEntities.isEmpty()) { |
|
|
|
for (DsProcessProjectVO dsProcessProjectEntity : dsProcessProjectEntities) { |
|
|
|
for (DsProcessProjectVO dsProcessProjectEntity : dsProcessProjectEntities) { |
|
|
|
if ("承压检测".equals(dsProcessProjectEntity.getProjectName())) { |
|
|
|
if ("承压检测".equals(dsProcessProjectEntity.getProjectName())) { |
|
|
|
prWorkPlan = workPlanService.getOne(new LambdaQueryWrapper<WorkPlan>() |
|
|
|
prWorkPlan = workPlanService.getOne(new LambdaQueryWrapper<WorkPlan>() |
|
|
|
.eq(WorkPlan::getWoId, woId) |
|
|
|
.eq(WorkPlan::getWoId, woId) |
|
|
|
.eq(WorkPlan::getOrders,dsProcessProjectEntity.getProcessNo())); |
|
|
|
.eq(WorkPlan::getOrders, dsProcessProjectEntity.getProcessNo())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2771,7 +2786,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
|
|
|
|
|
|
|
private void processTestItems(JSONArray testList, String batchNo, Integer quantity, String woCode, String remark, |
|
|
|
private void processTestItems(JSONArray testList, String batchNo, Integer quantity, String woCode, String remark, |
|
|
|
String partCode, String partName, String productType, String pptCode, |
|
|
|
String partCode, String partName, String productType, String pptCode, |
|
|
|
WorkPlan workPlan, BladeUser user,String cardNo) throws Exception { |
|
|
|
WorkPlan workPlan, BladeUser user, String cardNo) throws Exception { |
|
|
|
for (int i = 0; i < testList.size(); i++) { |
|
|
|
for (int i = 0; i < testList.size(); i++) { |
|
|
|
JSONObject object = testList.getObject(i, JSONObject.class); |
|
|
|
JSONObject object = testList.getObject(i, JSONObject.class); |
|
|
|
String value = object.getString("value"); |
|
|
|
String value = object.getString("value"); |
|
|
|
@ -2782,7 +2797,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if (response != null) { |
|
|
|
if (response != null) { |
|
|
|
saveTestRecord(workPlan, user, value, label, pptCode, response, i + 1,cardNo); |
|
|
|
saveTestRecord(workPlan, user, value, label, pptCode, response, i + 1, cardNo); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
throw new BusinessException("LIMS系统接口调用失败,请联系相关负责人处理。"); |
|
|
|
throw new BusinessException("LIMS系统接口调用失败,请联系相关负责人处理。"); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2790,7 +2805,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void saveTestRecord(WorkPlan workPlan, BladeUser user, String testKey, String testName, |
|
|
|
private void saveTestRecord(WorkPlan workPlan, BladeUser user, String testKey, String testName, |
|
|
|
String pptCode, JSONObject response, int sequence,String cardNo) { |
|
|
|
String pptCode, JSONObject response, int sequence, String cardNo) { |
|
|
|
PlanTest prPlanTest = new PlanTest(); |
|
|
|
PlanTest prPlanTest = new PlanTest(); |
|
|
|
prPlanTest.setWpId(workPlan.getId()); |
|
|
|
prPlanTest.setWpId(workPlan.getId()); |
|
|
|
prPlanTest.setTestUserId(user.getUserId()); |
|
|
|
prPlanTest.setTestUserId(user.getUserId()); |
|
|
|
|