diff --git a/lms/nladmin-system/nlsso-server/pom.xml b/lms/nladmin-system/nlsso-server/pom.xml index d88c505..86f3b85 100644 --- a/lms/nladmin-system/nlsso-server/pom.xml +++ b/lms/nladmin-system/nlsso-server/pom.xml @@ -71,6 +71,12 @@ 1.1.7 + + com.microsoft.sqlserver + mssql-jdbc + 6.4.0.jre8 + runtime + org.springframework spring-jdbc diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/FabConsumptionDo.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/FabConsumptionDo.java index 1a0ead0..d6583a2 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/FabConsumptionDo.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/FabConsumptionDo.java @@ -9,31 +9,37 @@ import java.math.BigDecimal; @Data public class FabConsumptionDo implements Serializable { // 唯一标识 - private String MSGID; + private String ID; /** - * 压机作业计划号 + * 0100xxx */ - private String PWORKSCHE_ID; + private String Code; /** - * 配料作业计划号 + * 462 461 */ - private String FWORKSCHE_ID; + private String ProdAuftragID; /** - * 配料批次号 + * 800号订单 */ - private String FPROBATCH; + private String AuftragsNr; /** - * 配料吨袋号 + * */ - private String FBAGCODE; + private String AppositionsNr; /** - * 泥料仓库编号 + * */ - private String LOGT; + private String AgaNr; /** - * 出库数量 + * */ - private BigDecimal OUT_NUMBER; + private BigDecimal AgaTyp; + //工序编码 + private String TaetigkeitsName; + // 工序类型 + private String TaetigkeitsTyp; + // 工序名称 + private String Beschreibung; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/mapper/FabRequestMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/mapper/FabRequestMapper.java index 65cb7c0..0c0dca1 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/mapper/FabRequestMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/mapper/FabRequestMapper.java @@ -7,15 +7,14 @@ import org.nl.wms.database.material.service.dao.MdBaseMaterial; import org.nl.wms.ext.fab.service.dao.FabConsumptionDo; import java.util.List; +import java.util.Map; public interface FabRequestMapper { - @DS("sqlserver") - List getMesMaterialInfos(@Param("time") String time); @DS("sqlserver") - List getMesMaterialInfos2(); + List sqlServerConnectionDemo(); /** * 根据工序查看FAb的订单列表 diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/mapper/FabRequestMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/mapper/FabRequestMapper.xml index 32563f6..6615c9f 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/mapper/FabRequestMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/mapper/FabRequestMapper.xml @@ -1,33 +1,10 @@ - - INSERT INTO "LMSTELCOM"."RECEIVE_MUDMATERIEL_OUT"( MSGID, PWORKSCHE_ID, OUT_FINNUM, PRESSUNIT, FBAGCODE, LOGT - , SENDTIM - , CREATE_TM, OP_FLAG, SLEEP_TIME) - VALUES ( #{MSGID}, #{PWORKSCHE_ID}, #{OUT_FINNUM}, #{PRESSUNIT}, #{FBAGCODE}, #{LOGT} - , #{SENDTIM}, #{CREATE_TM}, #{OP_FLAG}, #{SLEEP_TIME}) - - - INSERT INTO "LMSTELCOM"."RECEIVE_R_SEMIPRODUCT"( MSGID, FORDER_NO, PWORKSCHE_ID, FPRODUCT_MATERIAL_ID - , FPRODUCT_MATERIAL_NAME, FMATSPEC, FMATMODEL, BATCHNO, PRESSUNIT - , FTEAM, TRAY_NO, PRO_SUBNUM - , PRO_SUBUNIT, CHECKERIN_TIM, PRODATE, CREATE_TM, OP_FLAG) - VALUES ( #{MSGID}, #{FORDER_NO}, #{PWORKSCHE_ID} - , #{FPRODUCT_MATERIAL_ID}, #{FPRODUCT_MATERIAL_NAME}, #{FMATSPEC}, #{FMATMODEL}, #{BATCHNO}, #{PRESSUNIT} - , #{FTEAM}, #{TRAY_NO}, #{PRO_SUBNUM}, #{PRO_SUBUNIT}, #{CHECKERIN_TIM}, #{PRODATE}, #{CREATE_TM} - , #{OP_FLAG}) - - - INSERT INTO "LMSTELCOM"."RECEIVE_CS_SEMIPROINFO_IN"( MSGID, FORDER_NO, PWORKSCHE_ID, PRESSUNIT, FSCHEDULE_ID - , FPRODUCT_MATERIAL_ID, FPRODUCT_MATERIAL_NAME, FMATSPEC - , FMATMODEL, BATCHNO, FTEAM, TRAY_NO, PRO_SUBNUM - , PRO_SUBUNIT, CHECKERIN_TIM, PRODATE, CREATE_TM, OP_FLAG) - VALUES ( #{MSGID}, #{FORDER_NO}, #{PWORKSCHE_ID} - , #{PRESSUNIT}, #{FSCHEDULE_ID}, #{FPRODUCT_MATERIAL_ID}, #{FPRODUCT_MATERIAL_NAME}, #{FMATSPEC} - , #{FMATMODEL} - , #{BATCHNO}, #{FTEAM}, #{TRAY_NO}, #{PRO_SUBNUM}, #{PRO_SUBUNIT}, #{CHECKERIN_TIM}, #{PRODATE} - , #{CREATE_TM} - , #{OP_FLAG}) - + + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dto/SendMaterVo.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dto/SendMaterVo.java index 552aa0c..e6289c7 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dto/SendMaterVo.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dto/SendMaterVo.java @@ -36,4 +36,8 @@ public class SendMaterVo { * 是否报功 */ public Boolean has_report; + /** + * 是否报功 + */ + public Boolean has_work = true; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java index ff039b8..5c87c87 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java @@ -2,14 +2,21 @@ package org.nl.wms.ext.fab.service.impl; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.nl.wms.database.vehicle.service.IMdBaseVehicleService; +import org.nl.wms.database.vehicle.service.dao.MdBaseVehicle; import org.nl.wms.ext.acs.service.dto.to.BaseResponse; import org.nl.wms.ext.fab.service.dao.FabConsumptionDo; import org.nl.wms.ext.fab.service.dao.mapper.FabRequestMapper; import org.nl.wms.ext.fab.service.dto.*; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; +import org.nl.wms.sch.point.service.ISchBasePointService; +import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.task_manage.task.tasks.handheld.CallEmptyTask; import org.nl.wms.sch.task_manage.task.tasks.pcoperation.PcOperationCMTask; +import org.nl.wms.sch.task_manage.task.tasks.pcoperation.PcOperationSMTTask; +import org.nl.wms.sch.task_manage.task.tasks.pcoperation.PcOperationSNTTask; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -25,22 +32,28 @@ public class FabServiceImpl { @Resource private FabRequestMapper fabRequestMapper; @Autowired - private ISchBaseVehiclematerialgroupService iSchBaseVehiclematerialgroupService; + private ISchBasePointService iSchBasePointService; + @Autowired + private IMdBaseVehicleService iMdBaseVehicleService; /** * pc呼叫满料 */ @Autowired private PcOperationCMTask pcOperationCMTask; - /** - * 呼叫空料笼 - */ + @Autowired + private PcOperationSMTTask pcOperationSMTTask; + @Autowired + private PcOperationSNTTask pcOperationSNTTask; @Autowired private CallEmptyTask callEmptyTask; public void syncFab(List orders) { + if (CollectionUtils.isEmpty(orders)){ - //查询所有组盘表800号 + //1.查询库存中所有800号, + // 2.根据800号查询fab数据库, + //3.根据组盘记录表工序,及交期,以及has_work已生成 // List list = iSchBaseVehiclematerialgroupService.groupOrderCode(); // for (SchBaseVehiclematerialgroup schBaseVehiclematerialgroup : list) { // @@ -48,24 +61,14 @@ public class FabServiceImpl { } } - public List getOrderBycode(String regionCode) { - List result = new ArrayList<>(); - List mWorkOrderInfos = fabRequestMapper.getMWorkOrderInfos(regionCode); - for (FabConsumptionDo mWorkOrderInfo : mWorkOrderInfos) { - OrderMater orderMater = new OrderMater(); - result.add(orderMater); - } - return result; - } - public void createAgvTask(JSONObject form,String type) { JSONObject param = new JSONObject(); - switch (type){ case "cmt": CallMaterVo callMaterVo = form.toJavaObject(CallMaterVo.class); param.put("device_code",callMaterVo.getPoint_code()); param.put("config_code","PcOperationCMTask"); + param.put("region_code",callMaterVo.getRegion_code()); param.put("vehicle_code",callMaterVo.getVehicle_code()); param.put("ext_data",callMaterVo); pcOperationCMTask.apply(param); @@ -73,15 +76,32 @@ public class FabServiceImpl { case "cnt": CallEmpVo callEmpVo = form.toJavaObject(CallEmpVo.class); param.put("device_code",callEmpVo.getDevice_code()); - param.put("config_code","PcOperationCNTask"); + param.put("config_code","CALLEMPTYTask"); + param.put("region_code",callEmpVo.getRegin_code()); param.put("ext_data",callEmpVo); callEmptyTask.apply(param); break; case "smt": SendMaterVo sendMaterVo = form.toJavaObject(SendMaterVo.class); + MdBaseVehicle vehicle = iMdBaseVehicleService.getOne(new QueryWrapper().eq("vehicle_code", sendMaterVo.getVehicle_code())); + param.put("device_code",sendMaterVo.getDevice_code()); + param.put("config_code","PcOperationSMTTask"); + param.put("ext_data",sendMaterVo); + param.put("region_code",sendMaterVo.getRegion_code()); + param.put("vehicle_code",sendMaterVo.getVehicle_code()); + param.put("vehicle_type",vehicle.getVehicle_type()); + pcOperationSMTTask.apply(param); break; case "snt": SendVehicleVo sendVehicleVo = form.toJavaObject(SendVehicleVo.class); + SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(sendVehicleVo.getDevice_code()); + param.put("device_code",sendVehicleVo.getDevice_code()); + param.put("region_code",sendVehicleVo.getRegion_code()); + param.put("config_code","PcOperationSNTTask"); + param.put("vehicle_code",schBasePoint.getVehicle_code()); + param.put("vehicle_type",schBasePoint.getVehicle_type()); + param.put("ext_data",sendVehicleVo); + pcOperationSNTTask.apply(param); break; } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSMTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSMTTask.java index d698e82..b47ff5f 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSMTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSMTTask.java @@ -64,7 +64,7 @@ public class PcOperationSMTTask extends AbstractTask { for (SchBaseTask task : tasks) { TaskUtils.setUpdateByAcs(task); - // 找起点 + SendMaterVo sendMaterVo = JSONObject.parseObject(task.getRequest_param(), SendMaterVo.class); //判断是否指定到外协区 String targetRegionCode = sendMaterVo.getTarget_region_code(); @@ -92,7 +92,7 @@ public class PcOperationSMTTask extends AbstractTask { schBaseVehiclematerialgroup.setMaterial_qty(sendMaterVo.getMaterial_qty()); schBaseVehiclematerialgroup.setRegion_code(sendMaterVo.getRegion_code()); schBaseVehiclematerialgroup.setOrder_code(sendMaterVo.getOrder_code()); - schBaseVehiclematerialgroup.setHas_work(true); + schBaseVehiclematerialgroup.setHas_work(sendMaterVo.getHas_work()); schBaseVehiclematerialgroupService.create(schBaseVehiclematerialgroup); // 设置终点并修改创建成功状态 task.setPoint_code2(schBasePoint.getPoint_code()); diff --git a/lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml b/lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml index e241189..8ccce9f 100644 --- a/lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml +++ b/lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml @@ -33,12 +33,12 @@ spring: username: ${DB_USER:root} password: ${DB_PWD:123456} type: com.alibaba.druid.pool.DruidDataSource -# sqlserver: -# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver -# url: jdbc:sqlserver://10.93.41.2\WINCC;DatabaseName=马钢_RH -# username: ${DB_USER:sa} -# password: ${DB_PWD:123} -# type: com.alibaba.druid.pool.DruidDataSource + sqlserver: + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + url: jdbc:sqlserver://10.192.37.50:49206;DatabaseName=T1000_V01_V001 + username: ${DB_USER:mes} + password: ${DB_PWD:Abc~123456} + type: com.alibaba.druid.pool.DruidDataSource redis: #数据库索引