From d394d2a1dfbea850299c96f8b78c0383e02b3951 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Wed, 20 Sep 2023 09:02:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=88=A0=E9=99=A4+=E6=89=8B?= =?UTF-8?q?=E6=8C=81=E5=A2=9E=E5=8A=A0=E7=BC=93=E5=86=B2=E5=8C=BA=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3+=E5=B7=A5=E8=89=BA=E8=BD=A6=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../op/system/api/domain/dto/WCSDataDTO.java | 63 ++++++------ .../mapper/ProRfidProcessDetailMapper.java | 2 + .../service/impl/IWCInterfaceServiceImpl.java | 84 +++++++++------- .../impl/MesPrepareValidateServiceImpl.java | 96 ------------------- .../mapper/mes/ProRfidProcessDetailMapper.xml | 5 + .../java/com/op/plan/domain/ProRoute.java | 11 ++- .../resources/mapper/plan/ProRouteMapper.xml | 4 +- .../com/op/technology/domain/ProRoute.java | 10 ++ .../mapper/technology/ProRouteMapper.xml | 11 ++- 9 files changed, 121 insertions(+), 165 deletions(-) delete mode 100644 op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesPrepareValidateServiceImpl.java diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/WCSDataDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/WCSDataDTO.java index c6f4cc41..6dcefaeb 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/WCSDataDTO.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/WCSDataDTO.java @@ -5,13 +5,22 @@ import java.util.List; public class WCSDataDTO { - private String sku; +// private String sku; +// +// private String loadNo; +// +// private List unLoadItems; - private String loadNo; + private String stationNo; + private int qty; - private List unLoadItems; + public int getQty() { + return qty; + } - private String stationNo; + public void setQty(int qty) { + this.qty = qty; + } public String getStationNo() { return stationNo; @@ -21,27 +30,27 @@ public class WCSDataDTO { this.stationNo = stationNo; } - public String getSku() { - return sku; - } - - public void setSku(String sku) { - this.sku = sku; - } - - public String getLoadNo() { - return loadNo; - } - - public void setLoadNo(String loadNo) { - this.loadNo = loadNo; - } - - public List getUnLoadItems() { - return unLoadItems; - } - - public void setUnLoadItems(List unLoadItems) { - this.unLoadItems = unLoadItems; - } +// public String getSku() { +// return sku; +// } +// +// public void setSku(String sku) { +// this.sku = sku; +// } +// +// public String getLoadNo() { +// return loadNo; +// } +// +// public void setLoadNo(String loadNo) { +// this.loadNo = loadNo; +// } +// +// public List getUnLoadItems() { +// return unLoadItems; +// } +// +// public void setUnLoadItems(List unLoadItems) { +// this.unLoadItems = unLoadItems; +// } } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProRfidProcessDetailMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProRfidProcessDetailMapper.java index 22ca741c..00e2db1c 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProRfidProcessDetailMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProRfidProcessDetailMapper.java @@ -66,4 +66,6 @@ public interface ProRfidProcessDetailMapper { public String getStationType(String equipmentCode); String getActuaEquips(ProRfidProcessDetail rfidInfo); + + Integer getEquipNum(String machineCode); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index 5aacde51..9115f00d 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -79,49 +79,59 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { */ @Override public WCSDTO requestDestinationStations(WCSDTO wcsdto) { - DynamicDataSourceContextHolder.push("ds_"+wcsdto.getFactory()); + + DynamicDataSourceContextHolder.push("ds_" + wcsdto.getFactory()); WCSDTO dto = new WCSDTO();//最终结果 - BeanUtils.copyBeanProp(dto,wcsdto); - //根据rfid跟工单绑定,成型机跟工单绑定,获取对应工艺。 - ProRfidProcessDetail rfidInfo = proRfidProcessDetailMapper.getRfidInfo(wcsdto.getRfidNo()); - //获取设备类型 - if(rfidInfo!=null && StringUtils.isNotBlank(rfidInfo.getMachineCode())){ - //设备-工艺路线的设备大范围 - String[] machineCodes0 = rfidInfo.getMachineCode().split(","); - String stationType = proRfidProcessDetailMapper.getStationType(machineCodes0[0]); - if(StringUtils.isNotBlank(stationType)){ - dto.setStationType(stationType); - } - //设备-根据工单获取实际规划设备路线 - String machinecode = rfidInfo.getProdLineCode();//proRfidProcessDetailMapper.getActuaEquips(rfidInfo); - JSONArray codeArray = JSONArray.parseArray(machinecode); - List list2 = new ArrayList<>(); - for(int c1=0;c1 list2 = new ArrayList<>(); + for (int c1 = 0; c1 < codeArray.size(); c1++) { + String equipCode0 = codeArray.getJSONArray(c1).getString(1); + list2.add(equipCode0); + } - //取交集 - List list1 = Arrays.asList(machineCodes0); - List machineArray = list1.stream() - .filter(u1-> list2.contains(u1)) - .collect(Collectors.toList()); + //取交集 + List list1 = Arrays.asList(machineCodes0); + List machineArray = list1.stream() + .filter(u1 -> list2.contains(u1)) + .collect(Collectors.toList()); - dto.setSku(rfidInfo.getProductCode()); - dto.setSpec(rfidInfo.getProductModel()); - dto.setProductionState(rfidInfo.getNowProcessId()); - List stationNos = new ArrayList<>(); - WCSDataDTO wCSDataDTO = null; - for(String machineCode:machineArray){ - wCSDataDTO = new WCSDataDTO(); - if(StringUtils.isNotBlank(machineCode)){ - wCSDataDTO.setStationNo(machineCode); - stationNos.add(wCSDataDTO); + dto.setSku(rfidInfo.getProductCode()); + dto.setSpec(rfidInfo.getProductModel()); + dto.setProductionState(rfidInfo.getNowProcessId()); + List stationNos = new ArrayList<>(); + WCSDataDTO wCSDataDTO = null; + for (String machineCode : machineArray) { + wCSDataDTO = new WCSDataDTO(); + if (StringUtils.isNotBlank(machineCode)) { + wCSDataDTO.setStationNo(machineCode); + if ("2".equals(stationType)) { + Integer qty = proRfidProcessDetailMapper.getEquipNum(machineCode); + wCSDataDTO.setQty(qty == null ? 0 : qty); + } + stationNos.add(wCSDataDTO); + } } + dto.setStationNos(stationNos); + dto.setCode("0"); } - dto.setStationNos(stationNos); + }catch (Exception e){ + dto.setCode("1"); + dto.setMessage("MES管理系统接口调用失败"); } - return dto; } public static void main(String args[]){ diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesPrepareValidateServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesPrepareValidateServiceImpl.java deleted file mode 100644 index 80830a57..00000000 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesPrepareValidateServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.op.mes.service.impl; - -import java.util.List; - -import com.baomidou.dynamic.datasource.annotation.DS; -import com.op.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.op.mes.mapper.MesPrepareValidateMapper; -import com.op.mes.domain.MesPrepareValidate; -import com.op.mes.service.IMesPrepareValidateService; - -/** - * 生产前准备记录报表Service业务层处理 - * - * @author Open Platform - * @date 2023-08-04 - */ -@Service -public class MesPrepareValidateServiceImpl implements IMesPrepareValidateService { - @Autowired - private MesPrepareValidateMapper mesPrepareValidateMapper; - - /** - * 查询生产前准备记录报表 - * - * @param validateId 生产前准备记录报表主键 - * @return 生产前准备记录报表 - */ - @Override - @DS("#header.poolName") - public MesPrepareValidate selectMesPrepareValidateByValidateId(String validateId) { - return mesPrepareValidateMapper.selectMesPrepareValidateByValidateId(validateId); - } - - /** - * 查询生产前准备记录报表列表 - * - * @param mesPrepareValidate 生产前准备记录报表 - * @return 生产前准备记录报表 - */ - @Override - @DS("#header.poolName") - public List selectMesPrepareValidateList(MesPrepareValidate mesPrepareValidate) { - return mesPrepareValidateMapper.selectMesPrepareValidateList(mesPrepareValidate); - } - - /** - * 新增生产前准备记录报表 - * - * @param mesPrepareValidate 生产前准备记录报表 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int insertMesPrepareValidate(MesPrepareValidate mesPrepareValidate) { - mesPrepareValidate.setCreateTime(DateUtils.getNowDate()); - return mesPrepareValidateMapper.insertMesPrepareValidate(mesPrepareValidate); - } - - /** - * 修改生产前准备记录报表 - * - * @param mesPrepareValidate 生产前准备记录报表 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int updateMesPrepareValidate(MesPrepareValidate mesPrepareValidate) { - mesPrepareValidate.setUpdateTime(DateUtils.getNowDate()); - return mesPrepareValidateMapper.updateMesPrepareValidate(mesPrepareValidate); - } - - /** - * 批量删除生产前准备记录报表 - * - * @param validateIds 需要删除的生产前准备记录报表主键 - * @return 结果 - */ - @Override - @DS("#header.poolName") - public int deleteMesPrepareValidateByValidateIds(String[] validateIds) { - return mesPrepareValidateMapper.deleteMesPrepareValidateByValidateIds(validateIds); - } - - /** - * 删除生产前准备记录报表信息 - * - * @param validateId 生产前准备记录报表主键 - * @return 结果 - */ - @Override - public int deleteMesPrepareValidateByValidateId(String validateId) { - return mesPrepareValidateMapper.deleteMesPrepareValidateByValidateId(validateId); - } -} diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/ProRfidProcessDetailMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/ProRfidProcessDetailMapper.xml index 70e27160..9c6ac474 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/ProRfidProcessDetailMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/ProRfidProcessDetailMapper.xml @@ -92,6 +92,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from pro_order_workorder where workorder_code = #{workorderCode} + insert into pro_rfid_process_detail diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProRoute.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProRoute.java index 80f0875f..8036117a 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProRoute.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProRoute.java @@ -54,12 +54,21 @@ public class ProRoute extends BaseEntity private String attr4; private String fileList; - + //每车的bp数 + private Integer carNumUnit; private List idList; private String routeVersion; + public Integer getCarNumUnit() { + return carNumUnit; + } + + public void setCarNumUnit(Integer carNumUnit) { + this.carNumUnit = carNumUnit; + } + public List getIdList() { return idList; } diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProRouteMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProRouteMapper.xml index 3976b7dd..c05bc21e 100644 --- a/op-modules/op-plan/src/main/resources/mapper/plan/ProRouteMapper.xml +++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProRouteMapper.xml @@ -21,11 +21,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + select top 1 route_id, route_code, route_name, route_desc, enable_flag, remark, attr1, attr2, attr3, attr4, - create_by, create_time, update_by, update_time,need_check,tec_man,tec_machine,tec_other,tec_depreciation + create_by, create_time, update_by, update_time,need_check,tec_man,tec_machine,tec_other,tec_depreciation, + car_num_unit from pro_route where route_code = #{routeCode} @@ -98,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tec_machine, tec_other, tec_depreciation, + car_num_unit, + #{routeId}, @@ -121,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{tecMachine}, #{tecOther}, #{tecDepreciation}, + #{carNumUnit}, @@ -147,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tec_machine = #{tecMachine}, tec_other = #{tecOther}, tec_depreciation=#{tecDepreciation}, + car_num_unit= #{carNumUnit}, where route_id = #{routeId}