Browse Source

更新

master
汪菘 3 years ago
parent
commit
8dfec1d7f7
  1. 42
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDeviceDriver.java
  2. 46
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding/HaiLiangFeedingDeviceDriver.java
  3. 75
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java
  4. 48
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java
  5. 91
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java
  6. 40
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_risking/HaiLiangRiskingDeviceDriver.java
  7. 41
      nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_strapping/HaiLiangStrappingDeviceDriver.java
  8. 14
      nladmin-system/src/main/java/org/nl/acs/log/service/LogServer.java
  9. 24
      nladmin-system/src/main/java/org/nl/acs/log/service/dto/DeviceLogDto.java
  10. 46
      nladmin-system/src/main/java/org/nl/acs/log/service/impl/LogServerImpl.java
  11. 11
      nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java
  12. 2
      nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java
  13. 43
      nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java
  14. 6
      nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderdetailServiceImpl.java
  15. BIN
      nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls
  16. 2
      nladmin-system/src/main/resources/config/application-dev.yml
  17. 72
      nladmin-system/src/main/resources/config/application-prod.yml

42
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_coating/HaiLiangCoatingDeviceDriver.java

@ -7,6 +7,7 @@ import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.opc.Device;
import org.nl.acs.order.service.ProduceshiftorderService;
import org.nl.acs.order.service.ProduceshiftorderdetailService;
@ -40,15 +41,24 @@ public class HaiLiangCoatingDeviceDriver extends AbstractOpcDeviceDriver impleme
@Autowired
ProduceshiftorderdetailService produceshiftorderdetailService = SpringContextHolder.getBean(ProduceshiftorderdetailService.class);
@Autowired
LogServer logServer = SpringContextHolder.getBean(LogServer.class);
String device_code;
int mode = 0;
int last_mode = 0;
int error = 0;
int last_error = 0;
int move = 0;
int order = 0;
int last_order = 0;
int order_detail = 0;
int last_order_detail = 0;
int detail_qty = 0;
int last_detail_qty = 0;
int detail_qualified_qty = 0;
int last_detail_qualified_qty = 0;
boolean requireSucess = false;
@ -70,8 +80,30 @@ public class HaiLiangCoatingDeviceDriver extends AbstractOpcDeviceDriver impleme
//当前工单明细号上料合格数量
detail_qualified_qty = this.itemProtocol.getDetail_qualified_qty();
if (mode != last_mode) {
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
this.setRequireSucess(false);
}
if (error != last_error) {
logServer.deviceLog(this.device_code,"error" ,String.valueOf(error));
logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error);
}
if (order != last_order) {
logServer.deviceLog(this.device_code,"order" ,String.valueOf(order));
logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order);
}
if (order_detail != last_order_detail) {
logServer.deviceLog(this.device_code,"order_detail" ,String.valueOf(order_detail));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_order_detail + "->" + order_detail);
}
if (detail_qty != last_detail_qty) {
logServer.deviceLog(this.device_code,"detail_qty" ,String.valueOf(detail_qty));
logServer.deviceLogToacs(this.device_code,"","","信号detail_qty:" + last_detail_qty + "->" + detail_qty);
}
if (detail_qualified_qty != last_detail_qualified_qty) {
logServer.deviceLog(this.device_code,"detail_qualified_qty" ,String.valueOf(detail_qualified_qty));
logServer.deviceLogToacs(this.device_code,"","","信号detail_qualified_qty:" + last_detail_qualified_qty + "->" + detail_qualified_qty);
}
} catch (Exception var17) {
return;
}
@ -95,13 +127,13 @@ public class HaiLiangCoatingDeviceDriver extends AbstractOpcDeviceDriver impleme
case 2:
break;
case 4:
//上料完成
//裹膜完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
}
break;
case 5:
//强制上料完成
//强制裹膜完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
}
@ -109,6 +141,12 @@ public class HaiLiangCoatingDeviceDriver extends AbstractOpcDeviceDriver impleme
}
}
last_mode = mode;
last_mode = mode;
last_error = error;
last_order = order;
last_order_detail = order_detail;
last_detail_qty = detail_qty;
last_detail_qualified_qty = detail_qualified_qty;
}
public synchronized boolean update_detail(String order, String order_detail,String status) {

46
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding/HaiLiangFeedingDeviceDriver.java

@ -1,5 +1,6 @@
package org.nl.acs.device_driver.hailiang.hailiang_feeding;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -8,10 +9,12 @@ import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.opc.Device;
import org.nl.acs.order.service.ProduceshiftorderService;
import org.nl.acs.order.service.ProduceshiftorderdetailService;
import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto;
import org.nl.exception.BadRequestException;
import org.nl.utils.SpringContextHolder;
import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired;
@ -40,15 +43,24 @@ public class HaiLiangFeedingDeviceDriver extends AbstractOpcDeviceDriver impleme
@Autowired
ProduceshiftorderdetailService produceshiftorderdetailService = SpringContextHolder.getBean(ProduceshiftorderdetailService.class);
@Autowired
LogServer logServer = SpringContextHolder.getBean(LogServer.class);
String device_code;
int mode = 0;
int last_mode = 0;
int error = 0;
int last_error = 0;
int move = 0;
int order = 0;
int last_order = 0;
int order_detail = 0;
int last_order_detail = 0;
int detail_qty = 0;
int last_detail_qty = 0;
int detail_qualified_qty = 0;
int last_detail_qualified_qty = 0;
boolean requireSucess = false;
@ -69,8 +81,30 @@ public class HaiLiangFeedingDeviceDriver extends AbstractOpcDeviceDriver impleme
//当前工单明细号上料合格数量
detail_qualified_qty = this.itemProtocol.getDetail_qualified_qty();
if (mode != last_mode) {
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
this.setRequireSucess(false);
}
if (error != last_error) {
logServer.deviceLog(this.device_code,"error" ,String.valueOf(error));
logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error);
}
if (order != last_order) {
logServer.deviceLog(this.device_code,"order" ,String.valueOf(order));
logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order);
}
if (order_detail != last_order_detail) {
logServer.deviceLog(this.device_code,"order_detail" ,String.valueOf(order_detail));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_order_detail + "->" + order_detail);
}
if (detail_qty != last_detail_qty) {
logServer.deviceLog(this.device_code,"detail_qty" ,String.valueOf(detail_qty));
logServer.deviceLogToacs(this.device_code,"","","信号detail_qty:" + last_detail_qty + "->" + detail_qty);
}
if (detail_qualified_qty != last_detail_qualified_qty) {
logServer.deviceLog(this.device_code,"detail_qualified_qty" ,String.valueOf(detail_qualified_qty));
logServer.deviceLogToacs(this.device_code,"","","信号detail_qualified_qty:" + last_detail_qualified_qty + "->" + detail_qualified_qty);
}
} catch (Exception var17) {
return;
}
@ -108,6 +142,13 @@ public class HaiLiangFeedingDeviceDriver extends AbstractOpcDeviceDriver impleme
}
}
last_mode = mode;
last_mode = mode;
last_error = error;
last_order = order;
last_order_detail = order_detail;
last_detail_qty = detail_qty;
last_detail_qualified_qty = detail_qualified_qty;
}
@ -119,10 +160,15 @@ public class HaiLiangFeedingDeviceDriver extends AbstractOpcDeviceDriver impleme
} else {
this.detail_time = date;
ProduceshiftorderdetailDto dto = produceshiftorderdetailService.findOrderDetailFromCache(String.valueOf(order), String.valueOf(order_detail));
if(!StrUtil.equals(dto.getOrder_detail_qty(),String.valueOf(detail_qualified_qty)) ){
logServer.deviceLogToacs(this.device_code,"","","工单明细上料完成,上料合格数量与订单数量不一致");
throw new BadRequestException("工单明细上料完成,上料合格数量与订单数量不一致!");
}
dto.setFeeding_finished(status);
dto.setFeeding_finish_time(date.toString());
produceshiftorderdetailService.update(dto);
writing(itemProtocol.item_to_command,String.valueOf(mode));
requireSucess = true;
return true;
}
}

75
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_feeding_trunk/HaiLiangFeedingTrunkDeviceDriver.java

@ -1,6 +1,7 @@
package org.nl.acs.device_driver.hailiang.hailiang_feeding_trunk;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -8,6 +9,7 @@ import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.opc.Device;
import org.nl.acs.order.service.ProduceshiftorderService;
import org.nl.acs.order.service.ProduceshiftorderdetailService;
@ -37,6 +39,9 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
@Autowired
ProduceshiftorderdetailService produceshiftorderdetailService = SpringContextHolder.getBean(ProduceshiftorderdetailService.class);
@Autowired
LogServer logServer = SpringContextHolder.getBean(LogServer.class);
@Override
public Device getDevice() {
return this.device;
@ -51,6 +56,7 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
int order_detail = 0;
int last_mode = 0;
int last_order = order;
int last_order_detail = order_detail;
int ready = 0;
int pause = 0;
int clear = 0;
@ -117,8 +123,26 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
if (mode != last_mode) {
this.setRequireSucess(false);
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
}
if(order != last_order)
{
if(order != 0){
update_order_status(String.valueOf(order),"02");
}
logServer.deviceLog(this.device_code,"order" ,String.valueOf(order));
logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order);
}
if(order_detail != last_order_detail)
{
if(order_detail != 0){
update_orderdetail_status(String.valueOf(order),String.valueOf(order_detail),"01");
}
logServer.deviceLog(this.device_code,"order_detail" ,String.valueOf(order_detail));
logServer.deviceLogToacs(this.device_code,"","","信号order_detail:" + last_order_detail + "->" + order_detail);
}
try{
if(order >0 && order_detail>0){
update_detail(String.valueOf(order),String.valueOf(order_detail));
@ -165,6 +189,7 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
}
last_mode = mode;
last_order = order;
last_order_detail = order_detail;
}
public synchronized boolean update_detail(String order, String order_detail) throws Exception {
@ -181,7 +206,7 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
//上料数量
dto.setPresent_feeding_number(String.valueOf(detail_feeding_qty));
//上料合格数量
dto.setFeeding_qualified_qty(String.valueOf(detail_feeding_qualified_qty));
dto.setFeeding_qualified_number(String.valueOf(detail_feeding_qualified_qty));
//当前工单明细号刻字数量
dto.setPresent_lettering_number(String.valueOf(detail_lettering_qty));
//当前工单明细号刻字合格数量
@ -203,6 +228,46 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
}
}
public synchronized boolean update_orderdetail_status(String order,String order_detail,String status) throws Exception {
Date date = new Date();
if (date.getTime() - this.detail_time_out < (long) this.detail_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.detail_time_out);
return false;
} else {
this.detail_time= date;
ProduceshiftorderdetailDto dto = produceshiftorderdetailService.findOrderDetailFromCache(String.valueOf(order),String.valueOf(order_detail));
if(ObjectUtil.isEmpty(dto)){
return false;
}
if(!StrUtil.equals(dto.getOrder_detail_status(),status)){
dto.setOrder_detail_status("01");
produceshiftorderdetailService.update(dto);
}
return true;
}
}
public synchronized boolean update_order_status(String order,String status) throws Exception {
Date date = new Date();
if (date.getTime() - this.detail_time_out < (long) this.detail_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.detail_time_out);
return false;
} else {
this.detail_time= date;
ProduceshiftorderDto dto = produceshiftorderService.findOrderByOrderCodeFromCache(String.valueOf(order));
if(ObjectUtil.isEmpty(dto)){
return false;
}
//02是已下发
if(!StrUtil.equals(dto.getOrder_status(),status) && StrUtil.equals(dto.getOrder_status(),"02") ){
dto.setOrder_status("03");
produceshiftorderService.autoupdate(dto);
}
return true;
}
}
public boolean apply_order() throws Exception {
ProduceshiftorderDto dto = produceshiftorderService.apply_order();
if(ObjectUtil.isEmpty(dto)){
@ -239,8 +304,8 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
writing(ItemProtocol.item_to_is_lettering,is_lettering);
writing(ItemProtocol.item_to_command,String.valueOf(mode));
dto.setOrder_status("02");
produceshiftorderService.update(dto);
dto.setOrder_status("03");
produceshiftorderService.autoupdate(dto);
requireSucess = true;
return true;
@ -277,8 +342,8 @@ public class HaiLiangFeedingTrunkDeviceDriver extends AbstractOpcDeviceDriver im
writing(ItemProtocol.item_to_coating_qty,strap_pack_number);
writing(ItemProtocol.item_to_labeling_qty,strap_pack_number);
writing(ItemProtocol.item_to_command,String.valueOf(mode));
dto.setOrder_detail_status("01");
produceshiftorderdetailService.update(dto);
// dto.setOrder_detail_status("01");
// produceshiftorderdetailService.update(dto);
send_letter_flag = false;
send_letter_flag_back = false;
requireSucess = true;

48
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_labeling/HaiLiangLabelingDeviceDriver.java

@ -1,5 +1,6 @@
package org.nl.acs.device_driver.hailiang.hailiang_labeling;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -7,10 +8,12 @@ import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.opc.Device;
import org.nl.acs.order.service.ProduceshiftorderService;
import org.nl.acs.order.service.ProduceshiftorderdetailService;
import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto;
import org.nl.exception.BadRequestException;
import org.nl.utils.SpringContextHolder;
import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired;
@ -39,15 +42,23 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem
@Autowired
ProduceshiftorderdetailService produceshiftorderdetailService = SpringContextHolder.getBean(ProduceshiftorderdetailService.class);
@Autowired
LogServer logServer = SpringContextHolder.getBean(LogServer.class);
String device_code;
int mode = 0;
int last_mode = 0;
int error = 0;
int last_error = 0;
int move = 0;
int order = 0;
int last_order = 0;
int order_detail = 0;
int last_order_detail = 0;
int detail_qty = 0;
int last_detail_qty = 0;
int detail_qualified_qty = 0;
int last_detail_qualified_qty = 0;
boolean requireSucess = false;
@ -68,8 +79,30 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem
//当前工单明细号上料合格数量
detail_qualified_qty = this.itemProtocol.getDetail_qualified_qty();
if (mode != last_mode) {
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
this.setRequireSucess(false);
}
if (error != last_error) {
logServer.deviceLog(this.device_code,"error" ,String.valueOf(error));
logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error);
}
if (order != last_order) {
logServer.deviceLog(this.device_code,"order" ,String.valueOf(order));
logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order);
}
if (order_detail != last_order_detail) {
logServer.deviceLog(this.device_code,"order_detail" ,String.valueOf(order_detail));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_order_detail + "->" + order_detail);
}
if (detail_qty != last_detail_qty) {
logServer.deviceLog(this.device_code,"detail_qty" ,String.valueOf(detail_qty));
logServer.deviceLogToacs(this.device_code,"","","信号detail_qty:" + last_detail_qty + "->" + detail_qty);
}
if (detail_qualified_qty != last_detail_qualified_qty) {
logServer.deviceLog(this.device_code,"detail_qualified_qty" ,String.valueOf(detail_qualified_qty));
logServer.deviceLogToacs(this.device_code,"","","信号detail_qualified_qty:" + last_detail_qualified_qty + "->" + detail_qualified_qty);
}
} catch (Exception var17) {
return;
}
@ -93,13 +126,13 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem
case 2:
break;
case 4:
//上料完成
//贴标完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
}
break;
case 5:
//强制上料完成
//强制贴标完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
}
@ -107,6 +140,12 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem
}
}
last_mode = mode;
last_mode = mode;
last_error = error;
last_order = order;
last_order_detail = order_detail;
last_detail_qty = detail_qty;
last_detail_qualified_qty = detail_qualified_qty;
}
@ -118,10 +157,15 @@ public class HaiLiangLabelingDeviceDriver extends AbstractOpcDeviceDriver implem
} else {
this.detail_time = date;
ProduceshiftorderdetailDto dto = produceshiftorderdetailService.findOrderDetailFromCache(String.valueOf(order), String.valueOf(order_detail));
if(!StrUtil.equals(dto.getWraping_number(),String.valueOf(detail_qualified_qty)) ){
logServer.deviceLogToacs(this.device_code,"","","工单明细贴标完成,贴标合格数量与订单数量不一致");
throw new BadRequestException("工单明细贴标完成,贴标合格数量与订单数量不一致!");
}
dto.setLabeling_finished(status);
dto.setLabeling_finish_time(date.toString());
produceshiftorderdetailService.update(dto);
writing(itemProtocol.item_to_command,String.valueOf(mode));
requireSucess = true;
return true;
}
}

91
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_lettering/HaiLiangLetteringDeviceDriver.java

@ -1,16 +1,21 @@
package org.nl.acs.device_driver.hailiang.hailiang_lettering;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.config.AcsConfig;
import org.nl.acs.config.server.AcsConfigService;
import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.opc.Device;
import org.nl.acs.order.service.ProduceshiftorderService;
import org.nl.acs.order.service.ProduceshiftorderdetailService;
import org.nl.acs.order.service.dto.ProduceshiftorderdetailDto;
import org.nl.exception.BadRequestException;
import org.nl.utils.SpringContextHolder;
import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired;
@ -34,21 +39,38 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple
@Autowired
ProduceshiftorderdetailService produceshiftorderdetailService = SpringContextHolder.getBean(ProduceshiftorderdetailService.class);
@Autowired
LogServer logServer = SpringContextHolder.getBean(LogServer.class);
@Autowired
AcsConfigService acsConfigService = SpringContextHolder.getBean(AcsConfigService.class);
String device_code;
int mode = 0;
int last_mode = 0;
int error = 0;
int last_error = 0;
int move = 0;
int order = 0;
int last_order = 0;
int order_detail = 0;
int last_order_detail = 0;
int detail_qty = 0;
int last_detail_qty = 0;
int detail_qualified_qty = 0;
int last_detail_qualified_qty = 0;
boolean requireSucess = false;
private Date detail_time = new Date();
private int detail_time_out = 3000;
Process printProcess;
String printName = "HP LaserJet Pro MFP M225-M226 PCL 6";
String printurl = "";
@Override
public Device getDevice() {
return this.device;
@ -68,8 +90,30 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple
//当前工单明细号上料合格数量
detail_qualified_qty = this.itemProtocol.getDetail_qualified_qty();
if (mode != last_mode) {
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
this.setRequireSucess(false);
}
if (error != last_error) {
logServer.deviceLog(this.device_code,"error" ,String.valueOf(error));
logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error);
}
if (order != last_order) {
logServer.deviceLog(this.device_code,"order" ,String.valueOf(order));
logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order);
}
if (order_detail != last_order_detail) {
logServer.deviceLog(this.device_code,"order_detail" ,String.valueOf(order_detail));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_order_detail + "->" + order_detail);
}
if (detail_qty != last_detail_qty) {
logServer.deviceLog(this.device_code,"detail_qty" ,String.valueOf(detail_qty));
logServer.deviceLogToacs(this.device_code,"","","信号detail_qty:" + last_detail_qty + "->" + detail_qty);
}
if (detail_qualified_qty != last_detail_qualified_qty) {
logServer.deviceLog(this.device_code,"detail_qualified_qty" ,String.valueOf(detail_qualified_qty));
logServer.deviceLogToacs(this.device_code,"","","信号detail_qualified_qty:" + last_detail_qualified_qty + "->" + detail_qualified_qty);
}
} catch (Exception var17) {
return;
}
@ -92,14 +136,20 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple
break;
case 2:
break;
case 3:
//申请贴标
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
printMessage(String.valueOf(order),String.valueOf(order_detail),String.valueOf(detail_qualified_qty));
}
break;
case 4:
//上料完成
//贴标完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
}
break;
case 5:
//强制上料完成
//强制贴标完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
}
@ -107,6 +157,12 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple
}
}
last_mode = mode;
last_mode = mode;
last_error = error;
last_order = order;
last_order_detail = order_detail;
last_detail_qty = detail_qty;
last_detail_qualified_qty = detail_qualified_qty;
}
@ -125,6 +181,37 @@ public class HaiLiangLetteringDeviceDriver extends AbstractOpcDeviceDriver imple
return true;
}
}
public synchronized boolean printMessage(String order, String order_detail,String qty) {
Date date = new Date();
if (date.getTime() - this.detail_time_out < (long) this.detail_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.detail_time_out);
return false;
} else {
this.detail_time = date;
ProduceshiftorderdetailDto dto = produceshiftorderdetailService.findOrderDetailFromCache(String.valueOf(order), String.valueOf(order_detail));
if(ObjectUtil.isEmpty(dto)){
throw new BadRequestException("未找到可下发工单明细!");
}
String template = dto.getLabeling_template();
printName = acsConfigService.findConfigFromCache().get(AcsConfig.PRINTNAME);
printurl = acsConfigService.findConfigFromCache().get(AcsConfig.PRINTURL);
try
{
printProcess = Runtime
.getRuntime()
.exec(new String[] {
printurl, "PrinterName=" + printName,
"LabelName=Label.ct", "Text5="+ "111","Text6="+"222","Text7="+"333","Text8="+"444"});
}
catch (Exception e)
{
System.out.println("aaa");
}
return true;
}
}
public void writing(String param, String value) {
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()

40
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_risking/HaiLiangRiskingDeviceDriver.java

@ -7,6 +7,7 @@ import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.opc.Device;
import org.nl.acs.order.service.ProduceshiftorderService;
import org.nl.acs.order.service.ProduceshiftorderdetailService;
@ -35,15 +36,24 @@ public class HaiLiangRiskingDeviceDriver extends AbstractOpcDeviceDriver impleme
@Autowired
ProduceshiftorderdetailService produceshiftorderdetailService = SpringContextHolder.getBean(ProduceshiftorderdetailService.class);
@Autowired
LogServer logServer = SpringContextHolder.getBean(LogServer.class);
String device_code;
int mode = 0;
int last_mode = 0;
int error = 0;
int last_error = 0;
int move = 0;
int order = 0;
int last_order = 0;
int order_detail = 0;
int last_order_detail = 0;
int detail_qty = 0;
int last_detail_qty = 0;
int detail_qualified_qty = 0;
int last_detail_qualified_qty = 0;
boolean requireSucess = false;
@ -70,8 +80,30 @@ public class HaiLiangRiskingDeviceDriver extends AbstractOpcDeviceDriver impleme
//当前工单明细号上料合格数量
detail_qualified_qty = this.itemProtocol.getDetail_qualified_qty();
if (mode != last_mode) {
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
this.setRequireSucess(false);
}
if (error != last_error) {
logServer.deviceLog(this.device_code,"error" ,String.valueOf(error));
logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error);
}
if (order != last_order) {
logServer.deviceLog(this.device_code,"order" ,String.valueOf(order));
logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order);
}
if (order_detail != last_order_detail) {
logServer.deviceLog(this.device_code,"order_detail" ,String.valueOf(order_detail));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_order_detail + "->" + order_detail);
}
if (detail_qty != last_detail_qty) {
logServer.deviceLog(this.device_code,"detail_qty" ,String.valueOf(detail_qty));
logServer.deviceLogToacs(this.device_code,"","","信号detail_qty:" + last_detail_qty + "->" + detail_qty);
}
if (detail_qualified_qty != last_detail_qualified_qty) {
logServer.deviceLog(this.device_code,"detail_qualified_qty" ,String.valueOf(detail_qualified_qty));
logServer.deviceLogToacs(this.device_code,"","","信号detail_qualified_qty:" + last_detail_qualified_qty + "->" + detail_qualified_qty);
}
} catch (Exception var17) {
return;
}
@ -95,7 +127,7 @@ public class HaiLiangRiskingDeviceDriver extends AbstractOpcDeviceDriver impleme
case 2:
break;
case 4:
//上料完成
//套冒完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
}
@ -109,6 +141,12 @@ public class HaiLiangRiskingDeviceDriver extends AbstractOpcDeviceDriver impleme
}
}
last_mode = mode;
last_mode = mode;
last_error = error;
last_order = order;
last_order_detail = order_detail;
last_detail_qty = detail_qty;
last_detail_qualified_qty = detail_qualified_qty;
}

41
nladmin-system/src/main/java/org/nl/acs/device_driver/hailiang/hailiang_strapping/HaiLiangStrappingDeviceDriver.java

@ -7,6 +7,7 @@ import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.opc.Device;
import org.nl.acs.order.service.ProduceshiftorderService;
import org.nl.acs.order.service.ProduceshiftorderdetailService;
@ -39,15 +40,23 @@ public class HaiLiangStrappingDeviceDriver extends AbstractOpcDeviceDriver imple
@Autowired
ProduceshiftorderdetailService produceshiftorderdetailService = SpringContextHolder.getBean(ProduceshiftorderdetailService.class);
@Autowired
LogServer logServer = SpringContextHolder.getBean(LogServer.class);
String device_code;
int mode = 0;
int last_mode = 0;
int error = 0;
int last_error = 0;
int move = 0;
int order = 0;
int last_order = 0;
int order_detail = 0;
int last_order_detail = 0;
int detail_qty = 0;
int last_detail_qty = 0;
int detail_qualified_qty = 0;
int last_detail_qualified_qty = 0;
boolean requireSucess = false;
@ -69,8 +78,30 @@ public class HaiLiangStrappingDeviceDriver extends AbstractOpcDeviceDriver imple
//当前工单明细号上料合格数量
detail_qualified_qty = this.itemProtocol.getDetail_qualified_qty();
if (mode != last_mode) {
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
this.setRequireSucess(false);
}
if (error != last_error) {
logServer.deviceLog(this.device_code,"error" ,String.valueOf(error));
logServer.deviceLogToacs(this.device_code,"","","信号error:" + last_error + "->" + error);
}
if (order != last_order) {
logServer.deviceLog(this.device_code,"order" ,String.valueOf(order));
logServer.deviceLogToacs(this.device_code,"","","信号order:" + last_order + "->" + order);
}
if (order_detail != last_order_detail) {
logServer.deviceLog(this.device_code,"order_detail" ,String.valueOf(order_detail));
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_order_detail + "->" + order_detail);
}
if (detail_qty != last_detail_qty) {
logServer.deviceLog(this.device_code,"detail_qty" ,String.valueOf(detail_qty));
logServer.deviceLogToacs(this.device_code,"","","信号detail_qty:" + last_detail_qty + "->" + detail_qty);
}
if (detail_qualified_qty != last_detail_qualified_qty) {
logServer.deviceLog(this.device_code,"detail_qualified_qty" ,String.valueOf(detail_qualified_qty));
logServer.deviceLogToacs(this.device_code,"","","信号detail_qualified_qty:" + last_detail_qualified_qty + "->" + detail_qualified_qty);
}
} catch (Exception var17) {
return;
}
@ -94,13 +125,13 @@ public class HaiLiangStrappingDeviceDriver extends AbstractOpcDeviceDriver imple
case 2:
break;
case 4:
//上料完成
//捆扎完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0){
update_detail(String.valueOf(order),String.valueOf(order_detail),"01");
}
break;
case 5:
//强制上料完成
//强制捆扎完成
if(!requireSucess && order > 0 && order_detail > 0 && detail_qty>0 && detail_qualified_qty>0 ) {
update_detail(String.valueOf(order),String.valueOf(order_detail),"02");
}
@ -108,6 +139,12 @@ public class HaiLiangStrappingDeviceDriver extends AbstractOpcDeviceDriver imple
}
}
last_mode = mode;
last_mode = mode;
last_error = error;
last_order = order;
last_order_detail = order_detail;
last_detail_qty = detail_qty;
last_detail_qualified_qty = detail_qualified_qty;
}
public synchronized boolean update_detail(String order, String order_detail,String status) {

14
nladmin-system/src/main/java/org/nl/acs/log/service/LogServer.java

@ -33,4 +33,18 @@ public interface LogServer {
* @param vehicle_code 载具号
*/
void log(String task_code, String method, String type, String requestParam, String responseParam, String status_code, String requestUrl, String vehicle_code);
/**
* @param device_code 设备编号
* @param key plc信号
* @param value plc信号值
*/
void deviceLog(String device_code, String key, String value);
/**
* @param device_code 设备编号
* @param vehicle_code 载具号
* @param inst_code 指令号
*/
void deviceLogToacs(String device_code, String vehicle_code, String inst_code, String message);
}

24
nladmin-system/src/main/java/org/nl/acs/log/service/dto/DeviceLogDto.java

@ -0,0 +1,24 @@
package org.nl.acs.log.service.dto;
import lombok.Data;
@Data
public class DeviceLogDto {
/* 日志标识 */
private String log_uuid;
/* 设备编码 */
private String device_code;
/* plc信号标识 */
private String key;
/* plc信号值 */
private String value;
/* 修改时间 YYYY-MM-DD hh:mm:ss */
private String update_time;
}

46
nladmin-system/src/main/java/org/nl/acs/log/service/impl/LogServerImpl.java

@ -3,11 +3,13 @@ package org.nl.acs.log.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.log.service.dto.DeviceLogDto;
import org.nl.acs.log.service.dto.LogDto;
import org.nl.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -16,6 +18,7 @@ import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service;
import java.util.List;
@ -87,4 +90,47 @@ public class LogServerImpl implements LogServer {
mongoTemplate.save(logDto,"interface_log");
}
@Override
public void deviceLog(String device_code,String key, String value) {
String now = DateUtil.now();
DeviceLogDto dto;
Query query = new Query(Criteria
.where("device_code").is(device_code)
.and("key").is(key)
);
List<DeviceLogDto> deviceList = mongoTemplate.find(query, DeviceLogDto.class,"device_log");
if (ObjectUtil.isEmpty(deviceList)) {
JSONObject json = new JSONObject();
json.put("device_code",device_code);
json.put("key",key);
json.put("value",value);
json.put("update_time",now);
mongoTemplate.save(json,"device_log");
} else {
for (int i = 0; i < deviceList.size(); i++) {
dto = deviceList.get(i);
Update update = new Update();
update.set("device_code",dto.getDevice_code());
update.set("key",dto.getKey());
update.set("value",value);
update.set("update_time",now);
mongoTemplate.upsert(query, update, "device_log");
}
}
}
@Override
public void deviceLogToacs(String device_code, String vehicle_code, String inst_code, String message) {
String now = DateUtil.now();
JSONObject json = new JSONObject();
json.put("vehicle_code",vehicle_code);
json.put("inst_code",inst_code);
json.put("message",message);
json.put("create_time",now);
mongoTemplate.save(json,device_code);
}
}

11
nladmin-system/src/main/java/org/nl/acs/order/service/ProduceshiftorderService.java

@ -95,6 +95,13 @@ public interface ProduceshiftorderService {
void update(ProduceshiftorderDto dto);
/**
* 编辑
*
* @param dto /
*/
void autoupdate(ProduceshiftorderDto dto);
/**
* 编辑
*
@ -197,9 +204,9 @@ public interface ProduceshiftorderService {
JSONArray getDtl(Map whereJson);
ProduceshiftorderDto findOrderByOrderCodeFromCache(String order_id);
ProduceshiftorderDto findOrderByOrderCodeFromCache(String order_code);
ProduceshiftorderDto findOrderByOrderIdFromCache(String order_code);
ProduceshiftorderDto findOrderByOrderIdFromCache(String order_id);

2
nladmin-system/src/main/java/org/nl/acs/order/service/dto/ProduceshiftorderdetailDto.java

@ -135,7 +135,7 @@ public class ProduceshiftorderdetailDto implements Serializable {
private String present_feeding_number;
/** 上料合格数量 */
private String feeding_qualified_qty;
private String feeding_qualified_number;
/** 上料开始时间 */
private String feeding_start_time;

43
nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderServiceImpl.java

@ -112,7 +112,6 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
newja.add(jo);
}
json.put("content", newja);
System.out.println("json:" + json);
return json;
}
@ -241,7 +240,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
orderDto.setIs_risking("1");
orderDto.setIs_strapping("1");
orderDto.setIs_unbundling("1");
orderDto.setFeeding_mouth("3");
for(int i=0; i<tableData.size(); i++){
JSONObject jsonObject = tableData.getJSONObject(i);
ProduceshiftorderdetailDto detaildto = JSON.toJavaObject(jsonObject,ProduceshiftorderdetailDto.class);
@ -297,8 +296,33 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
ProduceshiftorderDto entity = this.findById(dto.getOrder_id());
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
if(!StrUtil.equals(entity.getOrder_status(),"00")){
throw new BadRequestException("单据状态非就绪,删除失败!");
throw new BadRequestException("单据状态非就绪,修改失败!");
}
String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now();
dto.setUpdate_time(now);
dto.setUpdate_by(currentUsername);
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder");
JSONObject json= (JSONObject) JSONObject.toJSON(dto);
wo.update(json);
Iterator<ProduceshiftorderDto> iterator = order.iterator();
while (iterator.hasNext()) {
ProduceshiftorderDto produceshiftorderDto = iterator.next();
if (produceshiftorderDto.getOrder_id().equals(dto.getOrder_id())) {
iterator.remove();
}
}
if (!StrUtil.equals(dto.getOrder_id(), "07") || !StrUtil.equals(dto.getOrder_id(), "08")) {
order.add(dto);
}
}
@Override
public void autoupdate(ProduceshiftorderDto dto) {
ProduceshiftorderDto entity = this.findById(dto.getOrder_id());
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now();
dto.setUpdate_time(now);
@ -750,7 +774,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
@Override
public Map<String, Object> querySorting(Map whereJson, Pageable page) {
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder");
String where = "1=1 and (order_status !='00' or order_status !='04' or order_status !='05' ) and is_deleted= '0'";
String where = "1=1 and (order_status !='00' and order_status !='07' and order_status !='08' ) and is_deleted= '0'";
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), where, "order_id desc");
final JSONObject json = rb.pageResult();
JSONArray newja = new JSONArray();
@ -781,8 +805,8 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
new_jo.put("type", "orderDteail");
new_jo.put("is_flag", "0");
new_jo.put("feeding_qty", orderDteail_jo.getString("feeding_qty"));
new_jo.put("feeding_qualified_qty", orderDteail_jo.getString("feeding_qualified_qty"));
new_jo.put("present_feeding_number", orderDteail_jo.getString("present_feeding_number"));
new_jo.put("feeding_qualified_number", orderDteail_jo.getString("feeding_qualified_number"));
new_jo.put("present_lettering_number", orderDteail_jo.getString("present_lettering_number"));
new_jo.put("qualified_lettering_number", orderDteail_jo.getString("qualified_lettering_number"));
new_jo.put("present_sleeveing_number", orderDteail_jo.getString("present_sleeveing_number"));
@ -792,6 +816,12 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
new_jo.put("present_wraping_number", orderDteail_jo.getString("present_wraping_number"));
new_jo.put("qualified_wraping_number", orderDteail_jo.getString("qualified_wraping_number"));
new_jo.put("present_labeling_number", orderDteail_jo.getString("present_labeling_number"));
new_jo.put("feeding_finished", orderDteail_jo.getString("feeding_finished"));
new_jo.put("lettering_finished", orderDteail_jo.getString("lettering_finished"));
new_jo.put("sleeveing_finished", orderDteail_jo.getString("sleeveing_finished"));
new_jo.put("strap_finished", orderDteail_jo.getString("strap_finished"));
new_jo.put("wraping_finished", orderDteail_jo.getString("wraping_finished"));
new_jo.put("labeling_finished", orderDteail_jo.getString("labeling_finished"));
children.add(new_jo);
}
@ -803,7 +833,6 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
newja.add(jo);
}
json.put("content", newja);
System.out.println("json:" + json);
return json;
}

6
nladmin-system/src/main/java/org/nl/acs/order/service/impl/ProduceshiftorderdetailServiceImpl.java

@ -173,7 +173,7 @@ public class ProduceshiftorderdetailServiceImpl implements Produceshiftorderdeta
map.put("物料长度", produceshiftorderdetail.getLength());
map.put("工单明细状态", produceshiftorderdetail.getOrder_detail_status());
map.put("上料数量", produceshiftorderdetail.getFeeding_qty());
map.put("上料合格数量", produceshiftorderdetail.getFeeding_qualified_qty());
map.put("上料合格数量", produceshiftorderdetail.getFeeding_qualified_number());
map.put("上料开始时间", produceshiftorderdetail.getFeeding_start_time());
map.put("上料完成时间", produceshiftorderdetail.getFeeding_finish_time());
map.put("刻字合格数量", produceshiftorderdetail.getQualified_lettering_number());
@ -183,8 +183,8 @@ public class ProduceshiftorderdetailServiceImpl implements Produceshiftorderdeta
map.put("套冒合格数量", produceshiftorderdetail.getQualified_sleeveing_number());
map.put("套冒开始时间", produceshiftorderdetail.getSleeveing_start_time());
map.put("套冒完成时间", produceshiftorderdetail.getSleeveing_finish_time());
map.put("捆扎开始时间", produceshiftorderdetail.getStarp_start_time());
map.put("捆扎完成时间", produceshiftorderdetail.getStarp_finish_time());
map.put("捆扎开始时间", produceshiftorderdetail.getStrap_start_time());
map.put("捆扎完成时间", produceshiftorderdetail.getStrap_finish_time());
map.put("裹膜数量", produceshiftorderdetail.getWraping_number());
map.put("当前裹膜数量", produceshiftorderdetail.getPresent_wraping_number());
map.put("裹膜合格数量", produceshiftorderdetail.getQualified_wraping_number());

BIN
nladmin-system/src/main/java/org/nl/acs/order/service/wql/order.xls

Binary file not shown.

2
nladmin-system/src/main/resources/config/application-dev.yml

@ -9,9 +9,11 @@ spring:
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:hl_zgbz_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:hl_zgbz_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}
# 初始连接数
initial-size: 5
# 最小连接数

72
nladmin-system/src/main/resources/config/application-prod.yml

@ -8,8 +8,11 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:ch_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
#url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_zgbz_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:hl_zgbz_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}
# 初始连接数
initial-size: 5
@ -17,8 +20,12 @@ spring:
min-idle: 15
# 最大连接数
max-active: 30
# 是否自动回收超时连接
remove-abandoned: true
# 超时时间(以秒数为单位)
remove-abandoned-timeout: 180
# 获取连接超时时间
max-wait: 5000
max-wait: 3000
# 连接有效性检测时间
time-between-eviction-runs-millis: 60000
# 连接在池中最小生存的时间
@ -38,11 +45,8 @@ spring:
enabled: true
stat-view-servlet:
enabled: true
# 控制台管理用户名和密码
url-pattern: /druid/*
reset-enable: false
login-username: admin
login-password: 123456
filter:
stat:
enabled: true
@ -52,12 +56,12 @@ spring:
merge-sql: true
wall:
config:
multi-statement-allow: true
multi-statement-alagvslow: true
data:
mongodb:
host: 127.0.0.1
port: 27017
database: logdb
database: nlacs
redis:
#数据库索引
database: ${REDIS_DB:0}
@ -84,7 +88,7 @@ login:
heigth: 36
# 内容长度
length: 2
# 字体名称,为空则使用默认字体,如遇到线上乱码,设置其他字体即可
# 字体名称,为空则使用默认字体
font-name:
# 字体大小
font-size: 25
@ -96,36 +100,29 @@ jwt:
token-start-with: Bearer
# 必须使用最少88位的Base64对该令牌进行编码
base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
# 令牌过期时间 此处单位/毫秒 ,默认2小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
token-validity-in-seconds: 7200000
# 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
token-validity-in-seconds: 14400000
# 在线用户key
online-key: online-token-
# 验证码
code-key: code-key-
# token 续期检查时间范围(默认30分钟,单位默认毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
# token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
detect: 1800000
# 续期时间范围,默认 1小时,这里单位毫秒
# 续期时间范围,默认1小时,单位毫秒
renew: 3600000
# IP 本地解析
ip:
local-parsing: true
#是否允许生成代码,生产环境设置为false
generator:
enabled: false
#如果生产环境要开启swagger,需要配置请求地址
#springfox:
# documentation:
# swagger:
# v2:
# host: # 接口域名或外网ip
enabled: true
#是否开启 swagger-ui
swagger:
enabled: true
# IP 本地解析
ip:
local-parsing: true
# 文件存储路径
file:
mac:
@ -140,3 +137,30 @@ file:
# 文件大小 /M
maxSize: 100
avatarMaxSize: 5
jetcache:
defaultCacheType: LOCAL
statIntervalMinutes: 15
areaInCacheName: false
hiddenPackages: com.yb
local:
default:
type: caffeine
limit: 100
keyConvertor: fastjson
expireAfterWriteInMillis: 60000
remote:
default:
type: redis.lettuce
keyConvertor: fastjson
valueEncoder: kryo
valueDecoder: kryo
poolConfig:
minIdle: 5
maxIdle: 200
maxTotal: 1000
uri:
- redis://127.0.0.1:6379

Loading…
Cancel
Save