Browse Source

迦南新需求更新(手持、驱动同步产品信息)

master
pangshenghao 2 years ago
parent
commit
2c642ec8bb
  1. 16
      acs/hd/nladmin-system/pom.xml
  2. 2
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/ItemProtocol.java
  3. 2
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor_smart/ItemProtocol.java
  4. 2
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/ItemProtocol.java
  5. 2
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_plcscanner/ItemProtocol.java
  6. 2
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_scanner/ItemProtocol.java
  7. 2
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_monitor/ItemProtocol.java
  8. 43
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java
  9. 33
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java
  10. 2
      acs/hd/nladmin-system/src/main/java/org/nl/hand/service/impl/PadServiceImpl.java
  11. 45
      acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java
  12. 4
      acs/hd/nladmin-system/src/main/resources/config/application-dev.yml
  13. 2
      acs/qd/.env.development
  14. 2
      acs/qd/src/layout/components/Sidebar/Logo.vue
  15. 2
      acs/qd/src/views/login.vue
  16. 2
      acs/qd/vue.config.js
  17. 2
      lms/hd/nladmin-system/src/main/java/org/nl/modules/security/security/TokenFilter.java
  18. 15
      lms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  19. 150
      lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/emptyandqty/service/impl/EmptyAndQtyServiceImpl.java
  20. 11
      lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/rest/SendMaterialController.java
  21. 8
      lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/service/SendMaterialService.java
  22. 96
      lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/service/impl/SendMaterialServiceImpl.java
  23. 29
      lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/wql/PDA_SENDMATERIAL_01.wql
  24. 49
      lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/dto/VehicleDto.java
  25. 4
      lms/qd/.env.development
  26. 2
      lms/qd/src/layout/components/Sidebar/Logo.vue

16
acs/hd/nladmin-system/pom.xml

@ -20,11 +20,11 @@
</properties>
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.50</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.bouncycastle</groupId>-->
<!-- <artifactId>bcprov-jdk15on</artifactId>-->
<!-- <version>1.50</version>-->
<!-- </dependency>-->
<dependency>
<groupId>net.logstash.logback</groupId>
@ -56,6 +56,12 @@
<groupId>org.openscada.utgard</groupId>
<artifactId>org.openscada.opc.lib</artifactId>
<version>1.5.0</version>
<exclusions>
<exclusion>
<artifactId>bcprov-jdk15on</artifactId>
<groupId>org.bouncycastle</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>

2
acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor/ItemProtocol.java

@ -45,7 +45,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if (value == null) {
log.error("读取错误!");
// log.error("读取错误!");
} else {
return value;
}

2
acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_autodoor_smart/ItemProtocol.java

@ -45,7 +45,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if (value == null) {
log.error("读取错误!");
// log.error("读取错误!");
} else {
return value;
}

2
acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/ItemProtocol.java

@ -84,7 +84,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

2
acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_plcscanner/ItemProtocol.java

@ -101,7 +101,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

2
acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_scanner/ItemProtocol.java

@ -96,7 +96,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

2
acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_monitor/ItemProtocol.java

@ -79,7 +79,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

43
acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java

@ -22,6 +22,10 @@ public class ItemProtocol {
public static String item_to_target = "to_target";
public static String item_to_task = "to_task";
public static String item_weight = "weight";
public static String item_product_code = "product_code";
public static String item_batch_code = "batch_code";
public static String item_product_specifications = "product_specifications";
public static String item_time = "time";
private StandardInspectSiteSmartDeviceDriver driver;
@ -53,6 +57,27 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_task);
}
public String getWeight() {
return this.getOpcStringValue(item_weight);
}
public String getProductCode() {
return this.getOpcStringValue(item_product_code);
}
public String getBatchCode() {
return this.getOpcStringValue(item_batch_code);
}
public String getProductSpecifications() {
return this.getOpcStringValue(item_product_specifications);
}
public String getTime() {
return this.getOpcStringValue(item_time);
}
public int getToCommand() {
return this.getOpcIntegerValue(item_to_command);
}
@ -75,7 +100,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);
@ -85,6 +110,17 @@ public class ItemProtocol {
}
public String getOpcStringValue(String protocol) {
String value = this.driver.getStringValue(protocol);
if (value == null) {
//throw new BusinessException("{} : {}", new Object[]{protocol, DeviceErrorProtocol.getMessage(10000)});
} else {
return value;
}
return "0";
}
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "VW0"));
@ -93,6 +129,11 @@ public class ItemProtocol {
list.add(new ItemDto(item_action, "动作信号", "VW8"));
list.add(new ItemDto(item_error, "报警信号", "VW12"));
list.add(new ItemDto(item_task, "任务号", "VD14"));
list.add(new ItemDto(item_product_code, "产品名称", "VW18"));
list.add(new ItemDto(item_batch_code, "批次号", "VW20", Boolean.valueOf(true)));
list.add(new ItemDto(item_product_specifications, "产品规格", "VW40"));
list.add(new ItemDto(item_weight, "重量", "VW50"));
list.add(new ItemDto(item_time, "时间", "VW60"));
return list;
}

33
acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/StandardInspectSiteSmartDeviceDriver.java

@ -130,9 +130,6 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive
// 工序
private String process;
// 重量
private String weight;
// 质量状态
private String qc_status;
@ -146,6 +143,26 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive
Boolean islock = false;
// 重量
private String weight;
private String last_weight;
// 产品名称
private String product_code;
private String last_product_code;
// 批次号
private String batch_code;
private String last_batch_code;
// 产品规格
private String product_specifications;
private String last_product_specifications;
// 时间
private String time;
private String last_time;
@Override
public Device getDevice() {
return this.device;
@ -162,6 +179,11 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive
move = this.itemProtocol.getMove();
task = this.itemProtocol.getTask();
hasGoods = this.itemProtocol.getMove();
weight = this.itemProtocol.getWeight();
product_code = this.itemProtocol.getProductCode();
batch_code = this.itemProtocol.getBatchCode();
product_specifications = this.itemProtocol.getProductSpecifications();
time = this.itemProtocol.getTime();
if (mode != last_mode) {
if (mode == 5) {
@ -337,6 +359,11 @@ public class StandardInspectSiteSmartDeviceDriver extends AbstractOpcDeviceDrive
last_error = error;
last_move = move;
last_task = task;
last_weight = weight;
last_product_code = product_code;
last_product_specifications = product_specifications;
last_batch_code = batch_code;
last_time = time;
}

2
acs/hd/nladmin-system/src/main/java/org/nl/hand/service/impl/PadServiceImpl.java

@ -91,7 +91,6 @@ public class PadServiceImpl implements PadService {
3 强制完成*/
if (type.equals("1")) {
//调用agv删除任务的接口
agvService = SpringContextHolder.getBean("agvServiceImpl");
try {
agvService.deleteAgvInstToNDC(instwo.toJavaObject(Instruction.class));
instructionService.cancel(inst_uuid);
@ -105,7 +104,6 @@ public class PadServiceImpl implements PadService {
}
if (type.equals("2")) {
Instruction instdto = (Instruction) JSONObject.toJavaObject(instwo, Instruction.class);
AgvService agvserver = SpringContextHolder.getBean("agvServiceImpl");
try {
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) {

45
acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java

@ -14,6 +14,7 @@ import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver;
import org.nl.acs.device_driver.standard_conveyor_control.StandardCoveyorControlDeviceDriver;
import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver;
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.device_driver.standard_inspect_site_smart200.StandardInspectSiteSmartDeviceDriver;
import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
import org.nl.acs.device_driver.standard_storage.StandardStorageDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
@ -156,6 +157,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
StandardStorageDeviceDriver standardStorageDeviceDriver;
StandardAutodoorDeviceDriver standardAutodoorDeviceDriver;
StandardEmptyPalletSiteDeviceDriver standardEmptyPalletSiteDeviceDriver;
StandardInspectSiteSmartDeviceDriver standardInspectSiteSmartDeviceDriver;
int type = Integer.parseInt(acsConfigService.findConfigFromCache().get(AcsConfig.BUSINESSTYPE));
try {
@ -216,6 +218,37 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
}
}
}
//检测站点smart200
if (device.getDeviceDriver() instanceof StandardInspectSiteSmartDeviceDriver) {
standardInspectSiteSmartDeviceDriver = (StandardInspectSiteSmartDeviceDriver) device.getDeviceDriver();
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.IGNOREHASGOODS), "1")) {
inst.setExecute_status("1");
instructionService.update(inst);
data = AgvService.sendAgvOneModeInst(phase, index, 0);
flag = true;
} else {
if (device.getHas_goods() != 0) {
inst.setExecute_status("1");
instructionService.update(inst);
data = AgvService.sendAgvOneModeInst(phase, index, 0);
flag = true;
} else {
logServer.deviceExecuteLog(device_code, "", "", "AGV请求取货设备{}无货,无法反馈");
}
}
//如果是混料区则上送LMS当前点位的字段,同步到st_ivt_structivt仓位库存表
JSONObject jsonObject = new JSONObject();
jsonObject.put("device_code", device_code);
jsonObject.put("weight", standardInspectSiteSmartDeviceDriver.getWeight());
jsonObject.put("product_code", standardInspectSiteSmartDeviceDriver.getProduct_code());
jsonObject.put("batch_code", standardInspectSiteSmartDeviceDriver.getBatch_code());
jsonObject.put("product_specifications", standardInspectSiteSmartDeviceDriver.getProduct_specifications());
jsonObject.put("time", standardInspectSiteSmartDeviceDriver.getTime());
jsonObject.put("type","9");
acsToWmsService.lnshApplyTaskToWms(jsonObject);
}
// 检验取放货条件
JSONObject agv_check = device_extra_table
.query("is_delete = '0' AND extra_code = 'agv_check' AND device_code = '" + device.getDevice_code() + "'")
@ -280,7 +313,8 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
standardInspectSiteDeviceDriver.writing(4);
if (standardInspectSiteDeviceDriver.getMode() != 0
&& standardInspectSiteDeviceDriver.getMove() == 0) { inst.setExecute_status("3");
&& standardInspectSiteDeviceDriver.getMove() == 0) {
inst.setExecute_status("3");
instructionService.update(inst);
data = AgvService.sendAgvOneModeInst(phase, index, 0);
flag = true;
@ -488,10 +522,15 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
}
}
} catch (Exception e) {
} catch(
Exception e)
{
} finally
} finally {
{
}

4
acs/hd/nladmin-system/src/main/resources/config/application-dev.yml

@ -8,11 +8,11 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:xugong_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:jianan_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
# url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:rljn_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
username: ${DB_USER:root}
# password: ${DB_PWD:P@ssw0rd}
password: ${DB_PWD:Root.123456}
password: ${DB_PWD:123456}
# password: ${DB_PWD:123456}
# 初始连接数
initial-size: 5

2
acs/qd/.env.development

@ -1,7 +1,7 @@
ENV = 'development'
# 接口地址
VUE_APP_BASE_API = 'http://192.168.81.140:8010'
VUE_APP_BASE_API = 'http://127.0.0.1:8010'
VUE_APP_WS_API = 'ws://127.0.0.1:8010'
# 是否启用 babel-plugin-dynamic-import-node插件

2
acs/qd/src/layout/components/Sidebar/Logo.vue

@ -25,7 +25,7 @@ export default {
},
data() {
return {
title: '诺力ACS系统',
title: '迦南ACS系统',
logo: Logo
}
}

2
acs/qd/src/views/login.vue

@ -2,7 +2,7 @@
<div class="login" :style="'background-image:url('+ Background +');'">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form">
<h3 class="title">
诺力ACS系统
迦南ACS系统
</h3>
<el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">

2
acs/qd/vue.config.js

@ -7,7 +7,7 @@ function resolve(dir) {
}
const name = defaultSettings.title // 网址标题
const port = 8013 // 端口配置
const port = 8014 // 端口配置
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {

2
lms/hd/nladmin-system/src/main/java/org/nl/modules/security/security/TokenFilter.java

@ -67,7 +67,7 @@ public class TokenFilter extends GenericFilterBean {
HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
String token = resolveToken(httpServletRequest);
// 对于 Token 为空的不需要去查 Redis
if (StrUtil.isNotBlank(token)) {
if (StrUtil.isNotBlank(token)&&!"/api/pda/handlogin".equals(httpServletRequest.getServletPath())) {
OnlineUserDto onlineUserDto = null;
boolean cleanUserCache = false;
try {

15
lms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -153,6 +153,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");// 空载具作业记录表
WQLObject regionTab = WQLObject.getWQLObject("ST_IVT_regionIO"); // 区域出入库表
WQLObject veQtyTab = WQLObject.getWQLObject("PDM_BI_vehicleQty"); // 托盘对应数量表
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structivt"); // 仓位库存表
/*
@ -165,6 +166,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
* 6.一楼空盘入库 有载具号
* 7.油漆线->输送线
* 8.豪凯自动线下料入库
* 9.同步混料区产品信息
*/
JSONObject resuft = new JSONObject();
try {
@ -409,6 +411,19 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} else {
throw new BadRequestException(jsonObject.getString("message"));
}
} else if (StrUtil.equals(type, "9")) {
//todo
String device_code=whereJson.getString("device_code");
JSONObject param = new JSONObject();
JSONObject jsonIvt = ivtTab.query("struct_code = '" + device_code + "'").uniqueResult(0);
jsonIvt.put("weight",whereJson.getString("weight"));
jsonIvt.put("product_code",whereJson.getString("product_code"));
jsonIvt.put("batch_code",whereJson.getString("batch_code"));
jsonIvt.put("product_specifications",whereJson.getString("product_specifications"));
jsonIvt.put("time",whereJson.getString("time"));
ivtTab.update(jsonIvt);
resuft.put("status", "200");
resuft.put("message", "");
}
} catch (Exception e) {
resuft.put("status", ((BadRequestException) e).getStatus());

150
lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/emptyandqty/service/impl/EmptyAndQtyServiceImpl.java

@ -28,76 +28,96 @@ public class EmptyAndQtyServiceImpl implements EmptyAndQtyService {
public JSONObject confirm(JSONObject whereJSON) {
// 返回值
JSONObject resultJSON = new JSONObject();
// 参数校验
String pointId = whereJSON.getString("point_id");
if (StrUtil.isEmpty(pointId)) {
resultJSON.put("code", "0");
resultJSON.put("desc", "点位不能为空");
return resultJSON;
}
String pointStatus = whereJSON.getString("point_status");
if (StrUtil.isEmpty(pointStatus)) {
resultJSON.put("code", "0");
resultJSON.put("desc", "点位状态不能为空");
return resultJSON;
}
String qualityScode = whereJSON.getString("quality_scode");
if (StrUtil.equals(pointStatus, "03") && StrUtil.isEmpty(qualityScode)) {
resultJSON.put("code", "0");
resultJSON.put("desc", "质量不能为空");
return resultJSON;
}
// 查询点位
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
JSONObject point = pointTable
.query("point_id = " + pointId)
.uniqueResult(0);
// 判断点位是否有为完成的指令
String pointCode = point.getString("point_code");
JSONObject task = WQLObject
.getWQLObject("sch_base_task")
.query("(start_point_code = '" + pointCode + "' OR next_point_code = '" + pointCode + "') AND is_delete = '0' AND task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'")
.uniqueResult(0);
if (ObjectUtil.isNotEmpty(task)) {
resultJSON.put("code", "0");
resultJSON.put("desc", "当前点位存在未完成的指令");
return resultJSON;
}
// 修改点位
point.put("point_status", pointStatus);
pointTable.update(point);
if (StrUtil.equals(pointStatus, "03") && StrUtil.equals(point.getString("point_type"), "01")) {
// 如果是有料桶且是仓位(待检区),则需要修改库存表
WQLObject structTable = WQLObject.getWQLObject("st_ivt_structivt");
JSONObject struct = structTable
.query("struct_id = " + pointId)
.uniqueResult(0);
if (ObjectUtil.isEmpty(struct)) {
// 当前库存为空,则添加库存
struct = new JSONObject();
struct.put("stockrecord_id", IdUtil.getSnowflake(1L, 1L).nextId());
struct.put("struct_id", pointId);
struct.put("struct_code", point.get("point_code"));
struct.put("struct_name", point.get("point_name"));
struct.put("region_id", point.get("region_id"));
struct.put("quality_scode", qualityScode);
structTable.insert(struct);
} else {
// 当前存在库存,则更新库存
struct.put("quality_scode", qualityScode);
structTable.update(struct);
String point_id=whereJSON.getString("point_id");
int type=whereJSON.getIntValue("type");
String quality_scode=whereJSON.getString("quality_scode");
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structivt");
JSONObject ivt_json = ivtTab.query("struct_id ='" + point_id + "'").uniqueResult(0);
if(ObjectUtil.isNotEmpty(ivt_json)) {
if (type == 1) {
ivt_json.put("quality_scode", quality_scode);
} else if (type == 2) {
ivt_json.put("quality_scode", null);
}
ivtTab.update(ivt_json);
}
// 返回
resultJSON.put("code", "1");
resultJSON.put("desc", "绑定成功");
resultJSON.put("desc", "更新成功");
return resultJSON;
// // 返回值
// JSONObject resultJSON = new JSONObject();
//
// // 参数校验
// String pointId = whereJSON.getString("point_id");
// if (StrUtil.isEmpty(pointId)) {
// resultJSON.put("code", "0");
// resultJSON.put("desc", "点位不能为空");
// return resultJSON;
// }
// String pointStatus = whereJSON.getString("point_status");
// if (StrUtil.isEmpty(pointStatus)) {
// resultJSON.put("code", "0");
// resultJSON.put("desc", "点位状态不能为空");
// return resultJSON;
// }
// String qualityScode = whereJSON.getString("quality_scode");
// if (StrUtil.equals(pointStatus, "03") && StrUtil.isEmpty(qualityScode)) {
// resultJSON.put("code", "0");
// resultJSON.put("desc", "质量不能为空");
// return resultJSON;
// }
//
// // 查询点位
// WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
// JSONObject point = pointTable
// .query("point_id = " + pointId)
// .uniqueResult(0);
//
// // 判断点位是否有为完成的指令
// String pointCode = point.getString("point_code");
// JSONObject task = WQLObject
// .getWQLObject("sch_base_task")
// .query("(start_point_code = '" + pointCode + "' OR next_point_code = '" + pointCode + "') AND is_delete = '0' AND task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'")
// .uniqueResult(0);
// if (ObjectUtil.isNotEmpty(task)) {
// resultJSON.put("code", "0");
// resultJSON.put("desc", "当前点位存在未完成的指令");
// return resultJSON;
// }
//
// // 修改点位
// point.put("point_status", pointStatus);
// pointTable.update(point);
//
// if (StrUtil.equals(pointStatus, "03") && StrUtil.equals(point.getString("point_type"), "01")) {
// // 如果是有料桶且是仓位(待检区),则需要修改库存表
// WQLObject structTable = WQLObject.getWQLObject("st_ivt_structivt");
// JSONObject struct = structTable
// .query("struct_id = " + pointId)
// .uniqueResult(0);
//
// if (ObjectUtil.isEmpty(struct)) {
// // 当前库存为空,则添加库存
// struct = new JSONObject();
// struct.put("stockrecord_id", IdUtil.getSnowflake(1L, 1L).nextId());
// struct.put("struct_id", pointId);
// struct.put("struct_code", point.get("point_code"));
// struct.put("struct_name", point.get("point_name"));
// struct.put("region_id", point.get("region_id"));
// struct.put("quality_scode", qualityScode);
// structTable.insert(struct);
// } else {
// // 当前存在库存,则更新库存
// struct.put("quality_scode", qualityScode);
// structTable.update(struct);
// }
// }
//
// // 返回
// resultJSON.put("code", "1");
// resultJSON.put("desc", "绑定成功");
// return resultJSON;
}
}

11
lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/rest/SendMaterialController.java

@ -28,11 +28,18 @@ public class SendMaterialController {
*
* @return 双层数组外层区域内层点位
*/
@PostMapping("/queryRegion")
@Log("查询区域点位")
@ApiOperation("查询区域点位")
public ResponseEntity<JSONObject> queryRegion() {
return new ResponseEntity<>(sendMaterialService.queryRegion(), HttpStatus.OK);
}
@PostMapping("/queryPoint")
@Log("查询区域点位")
@ApiOperation("查询区域点位")
public ResponseEntity<JSONObject> queryPoint() {
return new ResponseEntity<>(sendMaterialService.queryPoint(), HttpStatus.OK);
public ResponseEntity<Object> queryPoint(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(sendMaterialService.queryPoint(whereJson), HttpStatus.OK);
}
@PostMapping("/confirm")

8
lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/service/SendMaterialService.java

@ -9,7 +9,13 @@ public interface SendMaterialService {
*
* @return 双层数组外层区域内层点位
*/
JSONObject queryPoint();
JSONObject queryRegion();
/**
* 查询区域点位
* @return json
*/
JSONObject queryPoint(JSONObject whereJson);
/**
* 送料确定

96
lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/service/impl/SendMaterialServiceImpl.java

@ -27,7 +27,7 @@ public class SendMaterialServiceImpl implements SendMaterialService {
private final SendMaterialTask sendMaterialTask;
@Override
public JSONObject queryPoint() {
public JSONObject queryRegion() {
// 返回值
JSONObject resultJSON = new JSONObject();
@ -56,83 +56,45 @@ public class SendMaterialServiceImpl implements SendMaterialService {
return resultJSON;
}
@Transactional(rollbackFor = Exception.class)
@Override
public JSONObject confirm(JSONObject param) {
public JSONObject queryPoint(JSONObject whereJson) {
// 返回值
JSONObject resultJSON = new JSONObject();
// 参数校验
String startRegionId = param.getString("start_region_id");
if (StrUtil.isEmpty(startRegionId)) {
resultJSON.put("code", "0");
resultJSON.put("desc", "起点区域不能为空");
return resultJSON;
}
String startPointCode = param.getString("start_point_code");
if (StrUtil.isEmpty(startPointCode)) {
resultJSON.put("code", "0");
resultJSON.put("desc", "起点不能为空");
return resultJSON;
}
String nextRegionId = param.getString("next_region_id");
if (StrUtil.isEmpty(nextRegionId)) {
resultJSON.put("code", "0");
resultJSON.put("desc", "终点区域不能为空");
return resultJSON;
}
String nextPointCode = param.getString("next_point_code");
if (StrUtil.isEmpty(nextPointCode)) {
resultJSON.put("code", "0");
resultJSON.put("desc", "终点不能为空");
// 查询所有区域
JSONArray result = WQL
.getWO("PDA_SENDMATERIAL_01")
.addParam("flag", "3")
.addParam("region_id", whereJson.getString("region_id"))
.process()
.getResultJSONArray(0);
resultJSON.put("pointArr", result);
resultJSON.put("code", "1");
resultJSON.put("desc", "查询成功");
return resultJSON;
}
WQLObject regionIOTable = WQLObject.getWQLObject("st_ivt_regionio");
long id = IdUtil.getSnowflake(1, 1).nextId();
try {
// 创建搬运记录
RegionioDto dto = new RegionioDto();
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getNickName();
String now = DateUtil.now();
dto.setIostorinv_id(id);
dto.setBill_code(CodeUtil.getNewCode("IN_STORE_CODE"));
dto.setIo_type("0");
dto.setBill_status("10");
dto.setStart_region_id(startRegionId);
dto.setStart_point_code(startPointCode);
dto.setEnd_region_id(nextRegionId);
dto.setEnd_point_code(nextPointCode);
dto.setCreate_mode("02");
dto.setCreate_id(currentUserId);
dto.setCreate_name(nickName);
dto.setUpdate_optid(currentUserId);
dto.setUpdate_optname(nickName);
dto.setUpdate_time(now);
dto.setCreate_time(now);
regionIOTable.insert(JSONObject.parseObject(JSON.toJSONString(dto)));
// 创建任务并自动下发
String taskId = sendMaterialTask.createTask(param);
// 创建并下发成功后更新搬运记录
JSONObject json = new JSONObject();
json.put("task_id", taskId);
json.put("bill_status", "20");
regionIOTable.update(json, "iostorinv_id = " + id);
} catch (Exception e) {
// 手动回滚事务
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
resultJSON.put("code", "0");
resultJSON.put("desc", e.getMessage());
return resultJSON;
@Transactional(rollbackFor = Exception.class)
@Override
public JSONObject confirm(JSONObject param) {
// 返回值
JSONObject resultJSON = new JSONObject();
String point_id=param.getString("point_id");
int type=param.getIntValue("type");
String quality_scode=param.getString("quality_scode");
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structivt");
JSONObject ivt_json = ivtTab.query("struct_id ='" + point_id + "'").uniqueResult(0);
if (type==1) {
ivt_json.put("quality_scode",quality_scode);
}else if (type==2){
ivt_json.put("quality_scode",null);
}
ivtTab.update(ivt_json);
// 返回
resultJSON.put("code", "1");
resultJSON.put("desc", "搬运任务已生成");
resultJSON.put("desc", "更新成功");
return resultJSON;
}
}

29
lms/hd/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/wql/PDA_SENDMATERIAL_01.wql

@ -69,3 +69,32 @@
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "3"
QUERY
SELECT
P.point_id,
P.point_code,
P.point_name,
P.point_status,
S.quality_scode,
S.product_code,
S.batch_code,
S.product_specifications,
S.weight,
S.time
FROM
sch_base_point p
LEFT JOIN
st_ivt_StructIvt s
ON
p.point_code = s.struct_code
WHERE
p.is_used = '1'
OPTION 输入.region_id <> ""
p.region_id = 输入.region_id
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF

49
lms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/dto/VehicleDto.java

@ -0,0 +1,49 @@
package org.nl.wms.sch.service.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class VehicleDto implements Serializable {
/** 组盘标识 */
private String group_id;
/** 载具编码 */
private String vehicle_code;
/** 重量 */
private String weight;
/** 产品名称 */
private String product_code;
/** 批次号 */
private String batch_code;
/** 产品规格 */
private String product_specifications;
/** 时间 */
private String time;
/** 是否合格 */
private String qualityScode;
/** 是否删除 */
private Integer is_delete;
/** 创建人 */
private String create_name;
/** 创建时间 */
private String create_time;
/** 修改人 */
private Long update_optid;
/** 修改人 */
private String update_optname;
/** 修改时间 */
private String update_time;
}

4
lms/qd/.env.development

@ -1,8 +1,8 @@
ENV = 'development'
# 接口地址
VUE_APP_BASE_API = 'http://localhost:8010'
VUE_APP_WS_API = 'ws://localhost:8010'
VUE_APP_BASE_API = 'http://127.0.0.1:8011'
VUE_APP_WS_API = 'ws://127.0.0.1:8011'
# 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true

2
lms/qd/src/layout/components/Sidebar/Logo.vue

@ -25,7 +25,7 @@ export default {
},
data() {
return {
title: '永裕家居LMS系统',
title: '迦南LMS系统',
logo: Logo
}
}

Loading…
Cancel
Save