Browse Source

add:PC呼叫满下料,叫空,回库功能;add:添加sqlserver驱动及测试代码

master
zhangzq 5 months ago
parent
commit
a30c3724bd
  1. 6
      lms/nladmin-system/nlsso-server/pom.xml
  2. 32
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/FabConsumptionDo.java
  3. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/mapper/FabRequestMapper.java
  4. 35
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/mapper/FabRequestMapper.xml
  5. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dto/SendMaterVo.java
  6. 54
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java
  7. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/pcoperation/PcOperationSMTTask.java
  8. 12
      lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml

6
lms/nladmin-system/nlsso-server/pom.xml

@ -71,6 +71,12 @@
<version>1.1.7</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.4.0.jre8</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>

32
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;
}

5
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<MdBaseMaterial> getMesMaterialInfos(@Param("time") String time);
@DS("sqlserver")
List<JSONObject> getMesMaterialInfos2();
List<Map> sqlServerConnectionDemo();
/**
* 根据工序查看FAb的订单列表

35
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/mapper/FabRequestMapper.xml

@ -1,33 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.ext.fab.service.dao.mapper.FabRequestMapper">
<insert id="getMesMaterialInfos" parameterType="org.nl.wms.ext.fab.service.dao.FabConsumptionDo">
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>
<insert id="getMesMaterialInfos2" parameterType="org.nl.wms.ext.fab.service.dao.FabConsumptionDo">
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>
<insert id="getMWorkOrderInfos" parameterType="org.nl.wms.ext.fab.service.dao.FabConsumptionDo">
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})
</insert>
<select id="getMWorkOrderInfos" resultType="org.nl.wms.ext.fab.service.dao.FabConsumptionDo">
SELECT * FROM produktionsaga where AuftragsNr in (#{regionCode})
</select>
<select id="sqlServerConnectionDemo" resultType="java.util.Map">
SELECT TOP 10 * FROM produktionsaga;
</select>
</mapper>

4
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;
}

54
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<String> orders) {
if (CollectionUtils.isEmpty(orders)){
//查询所有组盘表800号
//1.查询库存中所有800号,
// 2.根据800号查询fab数据库,
//3.根据组盘记录表工序,及交期,以及has_work已生成
// List<SchBaseVehiclematerialgroup> list = iSchBaseVehiclematerialgroupService.groupOrderCode();
// for (SchBaseVehiclematerialgroup schBaseVehiclematerialgroup : list) {
//
@ -48,24 +61,14 @@ public class FabServiceImpl {
}
}
public List<OrderMater> getOrderBycode(String regionCode) {
List<OrderMater> result = new ArrayList<>();
List<FabConsumptionDo> 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<MdBaseVehicle>().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;
}
}

4
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());

12
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:
#数据库索引

Loading…
Cancel
Save