Merge remote-tracking branch 'origin/master'
@@ -0,0 +1,36 @@
|
||||
package org.nl.acs.autotask;
|
||||
|
||||
/**
|
||||
* @Author : TuQiang
|
||||
* @create 2024/5/27 9:45
|
||||
*/
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.modules.system.service.ParamService;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 自动清除日志(设备故障)数据
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class CleanDeviceErrorLog {
|
||||
|
||||
private final ParamService paramService;
|
||||
|
||||
public void run() {
|
||||
//delete from acs_log where DATE(create_time) <= DATE(DATE_SUB(NOW(),INTERVAL 30 day)) limit 10;
|
||||
log.info("开始打印日志");
|
||||
int days = Integer.parseInt(paramService.findByCode(AcsConfig.AutoCleanDays).getValue());
|
||||
WQLObject logTab = WQLObject.getWQLObject("acs_device_error_log");
|
||||
logTab.delete("DATE(error_time) <= DATE(DATE_SUB(NOW(),INTERVAL " + days + " day))");
|
||||
log.info("自动清理日志执行成功...!");
|
||||
}
|
||||
}
|
||||
@@ -121,4 +121,16 @@ public interface AcsConfig {
|
||||
* 日志级别
|
||||
*/
|
||||
String LOGLEVEL = "log_level";
|
||||
/**
|
||||
* AGV偏移量A点
|
||||
*/
|
||||
String OFFSET_A = "offSet_A";
|
||||
/**
|
||||
* AGV偏移量B点
|
||||
*/
|
||||
String OFFSET_B = "offSet_B";
|
||||
/**
|
||||
* 选择A点还是B点
|
||||
*/
|
||||
String CHOOSE = "choose";
|
||||
}
|
||||
|
||||
@@ -31,6 +31,12 @@ public class AddressController {
|
||||
return new ResponseEntity<>(addressService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/queryAddressCodeList")
|
||||
@Log("查询接口方法地址编码")
|
||||
public ResponseEntity<Object> queryAddressCodeList() {
|
||||
return new ResponseEntity<>(addressService.queryAddressCodeList(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增接口方法地址")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody AddressDto dto) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.acs.address.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.acs.common.base.PageInfo;
|
||||
import org.nl.acs.common.base.CommonService;
|
||||
import org.nl.acs.address.domain.Address;
|
||||
@@ -146,4 +147,6 @@ public interface AddressService extends CommonService<Address> {
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<AddressDto> dtos, HttpServletResponse response) throws IOException;
|
||||
|
||||
JSONObject queryAddressCodeList();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.acs.address.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -198,4 +199,21 @@ public class AddressServiceImpl extends CommonServiceImpl<AddressMapper, Address
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject queryAddressCodeList() {
|
||||
List<JSONObject> list = new ArrayList<>();
|
||||
List<AddressDto> addressDtoList = this.queryAll(new HashMap());
|
||||
if (CollectionUtil.isNotEmpty(addressDtoList)){
|
||||
for (AddressDto addressDto : addressDtoList) {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("label",addressDto.getMethods_name());
|
||||
jo.put("value",addressDto.getMethods_code());
|
||||
list.add(jo);
|
||||
}
|
||||
}
|
||||
JSONObject ja1 = new JSONObject();
|
||||
ja1.put("content",list);
|
||||
return ja1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,6 +241,8 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
if (standardAutodoorDeviceDriver.getOpen() == 1 && standardAutodoorDeviceDriver.getToOpen() == 1 ) {
|
||||
log.info("下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose());
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
}else {
|
||||
log.info("未下发NDC信号原因: 下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.acs.agv.server.NDCAgvService;
|
||||
import org.nl.acs.auto.run.TwoNDCSocketConnectionAutoRun;
|
||||
import org.nl.acs.common.base.CommonFinalParam;
|
||||
@@ -39,6 +40,7 @@ import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.acs.task.service.impl.TaskServiceImpl;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.nl.config.lucene.enums.LogTypeEnum;
|
||||
import org.nl.config.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.config.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
@@ -310,17 +312,37 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
|
||||
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
|
||||
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
|
||||
String choose = paramService.findByCode(AcsConfig.CHOOSE).getValue();
|
||||
String length1 = rangingStationsDeviceDriver.getLength1();
|
||||
Float len = 0.0F;
|
||||
if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1)) {
|
||||
len = Float.parseFloat(length1);
|
||||
String length2 = rangingStationsDeviceDriver.getLength2();
|
||||
Float len1 = 0.0F;
|
||||
Float len2 = 0.0F;
|
||||
if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1) && ObjectUtil.isNotEmpty(length2) && !"null".equals(length2)) {
|
||||
len1 = Float.parseFloat(length1);
|
||||
len2 = Float.parseFloat(length2);
|
||||
}
|
||||
int roundedNumber = ObjectUtil.isNotEmpty(len) ? NumberUtil.round(len, 0).intValue() : 0;
|
||||
if("A".equals(choose)){
|
||||
String offSet_A = paramService.findByCode(AcsConfig.OFFSET_A).getValue();
|
||||
if(ObjectUtil.isNotEmpty(offSet_A) && !"null".equals(offSet_A)){
|
||||
Integer integer = Integer.valueOf(offSet_A);
|
||||
len1 = len1 - integer;
|
||||
}
|
||||
}else if("B".equals(choose)){
|
||||
String offSet_B = paramService.findByCode(AcsConfig.OFFSET_B).getValue();
|
||||
if(ObjectUtil.isNotEmpty(offSet_B) && !"null".equals(offSet_B)){
|
||||
Integer integer = Integer.valueOf(offSet_B);
|
||||
len1 = integer + len1;
|
||||
}
|
||||
}
|
||||
if(len1 * len2 < 1 ){
|
||||
int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0;
|
||||
if (roundedNumber == 0) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber);
|
||||
} else {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
@@ -588,16 +610,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
|
||||
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
|
||||
String length1 = rangingStationsDeviceDriver.getLength1();
|
||||
Float len = 0.0F;
|
||||
if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1)) {
|
||||
len = Float.parseFloat(length1);
|
||||
String length2 = rangingStationsDeviceDriver.getLength2();
|
||||
Float len1 = 0.0F;
|
||||
Float len2 = 0.0F;
|
||||
if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1) && ObjectUtil.isNotEmpty(length2) && !"null".equals(length2)) {
|
||||
len1 = Float.parseFloat(length1);
|
||||
len2 = Float.parseFloat(length2);
|
||||
}
|
||||
int roundedNumber = ObjectUtil.isNotEmpty(len) ? NumberUtil.round(len, 0).intValue() : 0;
|
||||
if(len1 * len2 < 1 ){
|
||||
int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0;
|
||||
if (roundedNumber == 0) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber);
|
||||
} else {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
@@ -862,16 +889,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
|
||||
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
|
||||
String length1 = rangingStationsDeviceDriver.getLength1();
|
||||
Float len = 0.0F;
|
||||
if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1)) {
|
||||
len = Float.parseFloat(length1);
|
||||
String length2 = rangingStationsDeviceDriver.getLength2();
|
||||
Float len1 = 0.0F;
|
||||
Float len2 = 0.0F;
|
||||
if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1) && ObjectUtil.isNotEmpty(length2) && !"null".equals(length2)) {
|
||||
len1 = Float.parseFloat(length1);
|
||||
len2 = Float.parseFloat(length2);
|
||||
}
|
||||
int roundedNumber = ObjectUtil.isNotEmpty(len) ? NumberUtil.round(len, 0).intValue() : 0;
|
||||
if(len1 * len2 < 1 ){
|
||||
int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0;
|
||||
if (roundedNumber == 0) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber);
|
||||
} else {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
}
|
||||
@@ -1090,16 +1122,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
|
||||
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
|
||||
String length1 = rangingStationsDeviceDriver.getLength1();
|
||||
Float len = 0.0F;
|
||||
if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1)) {
|
||||
len = Float.parseFloat(length1);
|
||||
String length2 = rangingStationsDeviceDriver.getLength2();
|
||||
Float len1 = 0.0F;
|
||||
Float len2 = 0.0F;
|
||||
if (ObjectUtil.isNotEmpty(length1) && !"null".equals(length1) && ObjectUtil.isNotEmpty(length2) && !"null".equals(length2)) {
|
||||
len1 = Float.parseFloat(length1);
|
||||
len2 = Float.parseFloat(length2);
|
||||
}
|
||||
int roundedNumber = ObjectUtil.isNotEmpty(len) ? NumberUtil.round(len, 0).intValue() : 0;
|
||||
if(len1 * len2 < 1 ){
|
||||
int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0;
|
||||
if (roundedNumber == 0) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber);
|
||||
} else {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ 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_material_type = "material_type";
|
||||
public static String item_barcode = "barcode";
|
||||
/*public static String item_material_type = "material_type";
|
||||
public static String item_barcode = "barcode";*/
|
||||
|
||||
private StandardInspectSiteDeviceDriver driver;
|
||||
|
||||
@@ -50,13 +50,13 @@ public class ItemProtocol {
|
||||
}
|
||||
|
||||
|
||||
public int getMaterialType() {
|
||||
/*public int getMaterialType() {
|
||||
return this.getOpcIntegerValue(item_material_type);
|
||||
}
|
||||
|
||||
public int getBarcode() {
|
||||
return this.getOpcIntegerValue(item_barcode);
|
||||
}
|
||||
}*/
|
||||
|
||||
public int getToCommand() {
|
||||
return this.getOpcIntegerValue(item_to_command);
|
||||
@@ -98,9 +98,9 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_mode, "工作状态", "DB600.B2", Boolean.valueOf(true)));
|
||||
list.add(new ItemDto(item_move, "光电开关信号", "DB600.B3"));
|
||||
list.add(new ItemDto(item_action, "取放信号", "DB600.B4"));
|
||||
list.add(new ItemDto(item_material_type, "物料类型", "DB600.D6"));
|
||||
/*list.add(new ItemDto(item_material_type, "物料类型", "DB600.D6"));*/
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB600.B7"));
|
||||
list.add(new ItemDto(item_barcode, "条码", "DB600.D8"));
|
||||
/*list.add(new ItemDto(item_barcode, "条码", "DB600.D8"));*/
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -178,8 +178,8 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
move = this.itemProtocol.getMove();
|
||||
hasGoods = this.itemProtocol.getMove();
|
||||
action = this.itemProtocol.getAction();
|
||||
material_type = this.itemProtocol.getMaterialType();
|
||||
barcode = this.itemProtocol.getBarcode();
|
||||
/*material_type = this.itemProtocol.getMaterialType();
|
||||
barcode = this.itemProtocol.getBarcode();*/
|
||||
if (mode != last_mode) {
|
||||
this.setRequireSucess(false);
|
||||
if (mode == 2) {
|
||||
|
||||
@@ -27,9 +27,9 @@ public class ItemProtocol {
|
||||
//报警
|
||||
public static String item_error = "error";
|
||||
//x轴坐标
|
||||
public static String item_x_position = "x_position";
|
||||
public static String item_x_position = "x";
|
||||
//y轴坐标
|
||||
public static String item_y_position = "y_position";
|
||||
public static String item_y_position = "y";
|
||||
|
||||
//下发命令
|
||||
public static String item_to_command = "to_command";
|
||||
|
||||
@@ -18,9 +18,9 @@ public class ItemProtocol {
|
||||
//工作模式
|
||||
public static String item_mode = "mode";
|
||||
//光电信号
|
||||
public static String item_move = "move";
|
||||
public static String item_move = "move1";
|
||||
//动作信号
|
||||
public static String item_action = "action";
|
||||
public static String item_action = "action1";
|
||||
//任务号
|
||||
public static String item_task = "task";
|
||||
//报警
|
||||
|
||||
@@ -164,6 +164,8 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
String device_code;
|
||||
|
||||
String message = null;
|
||||
private Date instruction_require_time = new Date();
|
||||
private int instruction_require_time_out = 3000;
|
||||
|
||||
@Override
|
||||
public Device getDevice() {
|
||||
@@ -300,6 +302,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
* 申请套管
|
||||
*/
|
||||
private synchronized void apply_casing(int mode) throws Exception {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
@@ -326,10 +333,10 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
map.put("to_material1", to_material1);
|
||||
map.put("to_material2", to_material2);
|
||||
|
||||
if (StrUtil.isNotEmpty(leftSize)){
|
||||
if (StrUtil.isNotEmpty(leftSize)) {
|
||||
map.put("to_size1", leftSize);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(rightSize)){
|
||||
if (StrUtil.isNotEmpty(rightSize)) {
|
||||
map.put("to_size2", rightSize);
|
||||
}
|
||||
map.put("to_spec1", to_spec1);
|
||||
@@ -352,11 +359,17 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 套管完成
|
||||
*/
|
||||
private synchronized void bushingSucess(int mode) throws Exception {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
@@ -380,6 +393,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
message = "申请套管失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -387,6 +401,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
* 拔轴完成
|
||||
*/
|
||||
private synchronized void pullShaftSucess(int mode) throws Exception {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
@@ -410,11 +429,17 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请拔轴
|
||||
*/
|
||||
private synchronized void applyPullShaft(int mode) throws Exception {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
@@ -466,11 +491,17 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存线已满,生成行架任务
|
||||
*/
|
||||
private synchronized void applyTask(int mode) throws Exception {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
@@ -491,6 +522,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发电气信号
|
||||
@@ -632,7 +664,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
/*jo.put("action", action);*/
|
||||
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
|
||||
jo.put("error", ErrorUtil.getDictDetail("cbj_error_type", String.valueOf(this.getError())));
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("message", message);
|
||||
|
||||
@@ -27,9 +27,9 @@ public class ItemProtocol {
|
||||
//报警
|
||||
public static String item_error = "error";
|
||||
//x轴坐标
|
||||
public static String item_x_position = "x_position";
|
||||
public static String item_x_position = "x";
|
||||
//y轴坐标
|
||||
public static String item_y_position = "y_position";
|
||||
public static String item_y_position = "y";
|
||||
|
||||
//下发命令
|
||||
public static String item_to_command = "to_command";
|
||||
@@ -42,7 +42,7 @@ public class ItemProtocol {
|
||||
//是否拔轴
|
||||
public static String item_to_pull = "to_pull";
|
||||
//是否套轴
|
||||
public static String item_to_sleeve = "to_sleeve";
|
||||
public static String item_to_sleeve = "is_bushing";
|
||||
//尺寸
|
||||
public static String item_to_size = "to_size";
|
||||
|
||||
|
||||
@@ -32,9 +32,9 @@ public class ItemProtocol {
|
||||
*/
|
||||
public static String item_walk_y = "walk_y";
|
||||
//x坐标
|
||||
public static String item_x_position = "x_position";
|
||||
public static String item_x_position = "x";
|
||||
//动作信号
|
||||
public static String item_y_position = "y_position";
|
||||
public static String item_y_position = "y";
|
||||
/**
|
||||
* 报警
|
||||
*/
|
||||
|
||||
@@ -284,7 +284,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
try {
|
||||
finish_instruction(inst);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 9);
|
||||
map.put("to_command", 5);
|
||||
this.writing(map);
|
||||
this.setRequireSucess(true);
|
||||
} catch (Exception e) {
|
||||
@@ -533,7 +533,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
public void isSetAddress(Device device) {
|
||||
if (ObjectUtil.isEmpty(device.getExtraValue().get("address"))) {
|
||||
logServer.deviceExecuteLog(device_code, "", "task:" + task, "设备:" + device.getDevice_code() + "未设置电气调度号!");
|
||||
notCreateInstMessage = "设备:" + device.getDevice_code() + "未设置电气调度号!";
|
||||
notCreateInstMessage = device.getDevice_code() + "universal_notCreateInstMessage1";;
|
||||
throw new BadRequestException("设备:" + device.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,6 +224,11 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl
|
||||
* 取消称重
|
||||
*/
|
||||
public synchronized void cancelWeight() {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest();
|
||||
GetWasteFoilWeightResponse getWasteFoilWeightResponse;
|
||||
getWasteFoilWeightRequest.setDevice_code(device_code);
|
||||
@@ -232,32 +237,39 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl
|
||||
getWasteFoilWeightRequest.setCurrentWeight(String.valueOf(weight));
|
||||
getWasteFoilWeightRequest.setWeightGap(String.valueOf(gap_weight));
|
||||
getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest);
|
||||
if (getWasteFoilWeightResponse.getstatus()==200){
|
||||
if (getWasteFoilWeightResponse.getstatus() == 200) {
|
||||
feedbackSucess = true;
|
||||
message = "取消称重成功...";
|
||||
}else {
|
||||
} else {
|
||||
feedbackSucess = false;
|
||||
message = "取消称重失败";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请任务
|
||||
*/
|
||||
public synchronized void applyTask() {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest();
|
||||
GetWasteFoilWeightResponse getWasteFoilWeightResponse;
|
||||
getWasteFoilWeightRequest.setDevice_code(device_code);
|
||||
getWasteFoilWeightRequest.setType("4");
|
||||
getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest);
|
||||
if (getWasteFoilWeightResponse.getstatus()==200){
|
||||
if (getWasteFoilWeightResponse.getstatus() == 200) {
|
||||
feedbackSucess = true;
|
||||
message = "申请任务成功...";
|
||||
}else {
|
||||
} else {
|
||||
feedbackSucess = false;
|
||||
message = "申请任务失败";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -470,7 +470,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
log.info("ApplyPlugPullSitResponse----返回参数{}", result);
|
||||
applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class);
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"ApplyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getCode()),
|
||||
JSON.toJSONString(param), String.valueOf(result), "ACS向LMS申请套管");
|
||||
JSON.toJSONString(param), String.valueOf(result), "ACS向LMS申请"
|
||||
+ ("1".equals(param.getType()) ? "套轴": "2".equals(param.getType()) ? "套轴完成": "3".equals(param.getType()) ? "拔轴完成":
|
||||
"4".equals(param.getType()) ? "拔轴": "缓存线已满,生成行架任务"));
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
} catch (Exception e) {
|
||||
JSONObject map = new JSONObject();
|
||||
@@ -513,7 +515,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return JSONObject.toJavaObject(map, ApplyfeedbackSubVolumeWeightResponse.class);
|
||||
}
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyfeedbackSubVolumeWeightRequest", String.valueOf(applyfeedbackSubVolumeWeightResponse.getCode()),
|
||||
JSON.toJSONString(param), String.valueOf(applyfeedbackSubVolumeWeightResponse.getMessage()), "ACS向LMS申请套管");
|
||||
JSON.toJSONString(param), String.valueOf(applyfeedbackSubVolumeWeightResponse.getMessage()), "ACS反馈LMS子卷重量");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
}
|
||||
return applyfeedbackSubVolumeWeightResponse;
|
||||
|
||||
@@ -579,21 +579,32 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
try {
|
||||
//称重完成
|
||||
if (StrUtil.equals("1", type)) {
|
||||
wasteFoilWeighingStationDriver.writing("to_command", "6");
|
||||
Thread.sleep(1000); //休眠1秒
|
||||
if (wasteFoilWeighingStationDriver.getMode() == 6) {
|
||||
while (true) {
|
||||
if (wasteFoilWeighingStationDriver.getMode()==6){
|
||||
jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量
|
||||
jo.put("lastWeight", wasteFoilWeighingStationDriver.getGap_weight());//上一次重量
|
||||
jo.put("weightGap", wasteFoilWeighingStationDriver.getOld_weight());//重量差
|
||||
wasteFoilWeighingStationDriver.writing("to_command", "6");
|
||||
break;
|
||||
}
|
||||
}
|
||||
wasteFoilWeighingStationDriver.writing("to_command", "0");
|
||||
}
|
||||
//称重确认信号
|
||||
else if (StrUtil.equals("2", type)) {
|
||||
wasteFoilWeighingStationDriver.writing("to_command", "7");
|
||||
Thread.sleep(1000); //休眠1秒
|
||||
if (wasteFoilWeighingStationDriver.getMode() == 7) {
|
||||
wasteFoilWeighingStationDriver.writing("to_command", "8");
|
||||
while (true) {
|
||||
if (wasteFoilWeighingStationDriver.getMode()==7){
|
||||
jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量
|
||||
jo.put("lastWeight", wasteFoilWeighingStationDriver.getGap_weight());//上一次重量
|
||||
jo.put("weightGap", wasteFoilWeighingStationDriver.getOld_weight());//重量差
|
||||
break;
|
||||
}
|
||||
}
|
||||
wasteFoilWeighingStationDriver.writing("to_command", "0");
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -822,953 +833,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
public JSONObject notifyAcs(JSONObject param) {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
private final ApplicationContext applicationContext;
|
||||
|
||||
private final InstructionService instructionService;
|
||||
private final TaskService taskService;
|
||||
private final DeviceService deviceService;
|
||||
private final DeviceAppService deviceAppService;
|
||||
private final RouteLineService routeLineService;
|
||||
private final AcsToLiKuService acsToLiKuService;
|
||||
private final DictDetailService dictDetailService;
|
||||
private final DictService dictService;
|
||||
|
||||
|
||||
private String log_file_type = "log_file_type";
|
||||
private String log_type = "LMS请求ACS";
|
||||
|
||||
@Override public CancelTaskResponse cancelFromWms(String param) throws Exception {
|
||||
ParamService paramService = SpringContextHolder.getBean(ParamService.class);
|
||||
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
|
||||
JSONArray datas = JSONArray.parseArray(param);
|
||||
CancelTaskResponse response = new CancelTaskResponse();
|
||||
JSONArray errArr = new JSONArray();
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
String data = datas.get(i).toString();
|
||||
CancelTaskRequest request = JsonUtl.format(param, CancelTaskRequest.class);
|
||||
|
||||
String task_uuid = request.getExt_task_id();
|
||||
String task_code = request.getTask_code();
|
||||
String vehicle_code = request.getVehicle_code();
|
||||
|
||||
if (StrUtil.isEmpty(task_uuid)) {
|
||||
throw new WDKException("任务标识不能为空");
|
||||
}
|
||||
if (StrUtil.isEmpty(task_code)) {
|
||||
throw new WDKException("任务号不能为空");
|
||||
}
|
||||
String cancelTaskCheck = paramService.findByCode(AcsConfig.CANCELTASKCHECK).getValue();
|
||||
if (StrUtil.equals(cancelTaskCheck, CommonFinalParam.ONE)) {
|
||||
taskService.cancel(task_uuid);
|
||||
} else if (StrUtil.equals(cancelTaskCheck, "0")) {
|
||||
Instruction inst = instructionService.findByTaskcode(task_code);
|
||||
if (inst == null) {
|
||||
taskService.cancel(task_uuid);
|
||||
} else {
|
||||
throw new RuntimeException("指令正在执行中,操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(errArr)) {
|
||||
response.setStatus(200);
|
||||
} else {
|
||||
response.setStatus(400);
|
||||
}
|
||||
response.setMessage("success");
|
||||
response.setErrArr(errArr);
|
||||
log.info("cancelFromWms--------------:输出参数:" + response);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override public Map<String, Object> updateDeviceGoodsFromWms(String param) {
|
||||
JSONArray datas = JSONArray.parseArray(param);
|
||||
log.info("updateDeviceGoodsFromWms--------------:输入参数" + datas.toString());
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
JSONObject data = datas.getJSONObject(i);
|
||||
String device_code = data.getString("point_code");
|
||||
String has_goods = data.getString("has_goods");
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("device_code", device_code);
|
||||
jo.put("hasGoodStatus", has_goods);
|
||||
deviceService.changeDeviceStatus(jo);
|
||||
|
||||
}
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.OK);
|
||||
resultJson.put("message", "操作成功");
|
||||
resultJson.put("data", new JSONObject());
|
||||
log.info("updateDeviceGoodsFromWms--------------:输出参数" + resultJson.toString());
|
||||
return resultJson;
|
||||
}
|
||||
|
||||
@Override public Map<String, Object> areaControl(JSONObject form) {
|
||||
String device_code = form.getString("device_code");
|
||||
String type = form.getString("type");
|
||||
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.OK);
|
||||
resultJson.put("message", "操作成功");
|
||||
resultJson.put("data", new JSONObject());
|
||||
log.info("updateDeviceGoodsFromWms--------------:输出参数" + resultJson.toString());
|
||||
return resultJson;
|
||||
}
|
||||
|
||||
@Override public PutActionResponse putAction(String jsonObject) throws Exception {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("putAction--------------:输出参数" + jsonObject);
|
||||
JSONArray datas = JSONArray.parseArray(jsonObject);
|
||||
PutActionResponse response = new PutActionResponse();
|
||||
JSONArray errArr = new JSONArray();
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
String data = datas.get(i).toString();
|
||||
PutActionRequest request = JsonUtl.format(data, PutActionRequest.class);
|
||||
String device_code = request.getDevice_code();
|
||||
String code = request.getCode();
|
||||
String value = request.getValue();
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device)) {
|
||||
throw new Exception("未找到对应设备:" + device_code);
|
||||
}
|
||||
HongXiangStationDeviceDriver hongXiangStationDeviceDriver;
|
||||
LampThreecolorDeviceDriver lampThreecolorDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
|
||||
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
||||
hongXiangStationDeviceDriver.writing(code, value);
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof LampThreecolorDeviceDriver) {
|
||||
lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) device.getDeviceDriver();
|
||||
lampThreecolorDeviceDriver.writing(code, value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.OK.value());
|
||||
resultJson.put("message", "操作成功");
|
||||
resultJson.put("data", backja);
|
||||
// log.info("queryDevice--------------:输出参数" + resultJson.toString());
|
||||
return resultJson;
|
||||
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override public Map<String, Object> queryDeviceDBValue(String whereJson) {
|
||||
JSONArray datas = JSONArray.parseArray(whereJson);
|
||||
log.info("orderStatusUpdate--------------:输入参数" + datas.toString());
|
||||
JSONObject map = new JSONObject();
|
||||
if (datas.size() > 0) {
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
JSONObject jsonObject = datas.getJSONObject(i);
|
||||
String device_code = jsonObject.getString("device_code");
|
||||
String dbName = jsonObject.getString("DB");
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||
List<DeviceExtraManageDto> extra = device.getExtra();
|
||||
for (int j = 0; j < extra.size(); j++) {
|
||||
DeviceExtraManageDto deviceExtraManageDto = extra.get(j);
|
||||
String deviceCode = deviceExtraManageDto.getDevice_code();
|
||||
String extra_name = deviceExtraManageDto.getExtra_name();
|
||||
if (deviceCode.equals(device_code) && extra_name.equals(dbName)) {
|
||||
String extra_code = deviceExtraManageDto.getExtra_code();
|
||||
String[] split = extra_code.split("\\.");
|
||||
extra_code = split[split.length - 1];
|
||||
extra_code = extra_code.substring(0, 1).toUpperCase() + extra_code.substring(1);
|
||||
IDriverService driverService = applicationContext.getBean(device.getDeviceDriverDefination().getDriverCode(), IDriverService.class);
|
||||
Integer dbValue = driverService.getDbValue(device, extra_code);
|
||||
map.put(dbName, dbValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.OK);
|
||||
resultJson.put("message", "操作成功");
|
||||
resultJson.put("data", map);
|
||||
return resultJson;
|
||||
}
|
||||
|
||||
@Override public Map<String, Object> querydevice(String whereJson) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override public Map<String, Object> putPlusPullAction(String param) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("putPlusPullAction-----输入参数{}", param);
|
||||
JSONObject jo = JSON.parseObject(param);
|
||||
String device_code = jo.getString("device_code");
|
||||
String size = jo.getString("size");
|
||||
String type = jo.getString("type");
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device)) {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "未找到对应的设备:" + device_code);
|
||||
return resultJson;
|
||||
}
|
||||
PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
|
||||
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver();
|
||||
// 0 穿轴 1拔轴
|
||||
if (StrUtil.equals(type, CommonFinalParam.ONE)) {
|
||||
|
||||
if (plugPullDeviceSiteDeviceDriver.getMode() == 1) {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "请求拔轴,当前设备工作模式未自动");
|
||||
return resultJson;
|
||||
}
|
||||
if (plugPullDeviceSiteDeviceDriver.getAction() == 0) {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "请求拔轴,当前设备未全自动");
|
||||
return resultJson;
|
||||
}
|
||||
if (plugPullDeviceSiteDeviceDriver.getStatus() != 0) {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "请求拔轴,当前设备未待机");
|
||||
return resultJson;
|
||||
}
|
||||
if (plugPullDeviceSiteDeviceDriver.getControl() != 0) {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "请求拔轴,当前设备未远程控制");
|
||||
return resultJson;
|
||||
}
|
||||
if (plugPullDeviceSiteDeviceDriver.getMove() != 0) {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "请求拔轴,当前设备有轴");
|
||||
return resultJson;
|
||||
}
|
||||
if (plugPullDeviceSiteDeviceDriver.getMode() == 0 && plugPullDeviceSiteDeviceDriver.getAction() == 1
|
||||
&& plugPullDeviceSiteDeviceDriver.getStatus() == 0 && plugPullDeviceSiteDeviceDriver.getMove() == 0
|
||||
&& plugPullDeviceSiteDeviceDriver.getControl() == 0) {
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_size");
|
||||
map.put("value", size);
|
||||
list.add(map);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code", "to_type");
|
||||
map2.put("value", type);
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code", "to_command");
|
||||
map3.put("value", "1");
|
||||
list.add(map3);
|
||||
plugPullDeviceSiteDeviceDriver.writing(list);
|
||||
|
||||
} else {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "当前设备状态不满足下发条件");
|
||||
return resultJson;
|
||||
}
|
||||
|
||||
} else if (StrUtil.equals(type, "0")) {
|
||||
|
||||
if (plugPullDeviceSiteDeviceDriver.getMode() == 1) {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "请求插轴,当前设备工作模式未自动");
|
||||
return resultJson;
|
||||
}
|
||||
if (plugPullDeviceSiteDeviceDriver.getAction() == 0) {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "请求插轴,当前设备未全自动");
|
||||
return resultJson;
|
||||
}
|
||||
if (plugPullDeviceSiteDeviceDriver.getStatus() != 0) {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "请求插轴,当前设备未待机");
|
||||
return resultJson;
|
||||
}
|
||||
if (plugPullDeviceSiteDeviceDriver.getControl() != 0) {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "请求插轴,当前设备未远程控制");
|
||||
return resultJson;
|
||||
}
|
||||
if (plugPullDeviceSiteDeviceDriver.getMove() != 1) {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "请求插轴,当前设备没有轴");
|
||||
return resultJson;
|
||||
}
|
||||
|
||||
if (plugPullDeviceSiteDeviceDriver.getMode() == 0 && plugPullDeviceSiteDeviceDriver.getAction() == 1
|
||||
&& plugPullDeviceSiteDeviceDriver.getStatus() == 0 && plugPullDeviceSiteDeviceDriver.getMove() == 1
|
||||
&& plugPullDeviceSiteDeviceDriver.getControl() == 0) {
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_size");
|
||||
map.put("value", size);
|
||||
list.add(map);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code", "to_type");
|
||||
map2.put("value", type);
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code", "to_command");
|
||||
map3.put("value", CommonFinalParam.ONE);
|
||||
list.add(map3);
|
||||
plugPullDeviceSiteDeviceDriver.writing(list);
|
||||
|
||||
} else {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "当前设备状态不满足下发条件");
|
||||
return resultJson;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.OK.value());
|
||||
resultJson.put("message", "操作成功");
|
||||
log.info("putPlusPullAction--------------:输出参数" + resultJson.toString());
|
||||
return resultJson;
|
||||
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override public CreateTaskResponse crateTask(String param) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("crateTask-----输入参数{}", param);
|
||||
JSONArray datas = JSONArray.parseArray(param);
|
||||
CreateTaskResponse response = new CreateTaskResponse();
|
||||
ParamService paramService = SpringContextHolder.getBean(ParamService.class);
|
||||
String cancelTaskCheck = paramService.findByCode(AcsConfig.ISALLOWTASK).getValue();
|
||||
JSONArray errArr = new JSONArray();
|
||||
if (StrUtil.equals(cancelTaskCheck, "0")) {
|
||||
response.setStatus(400);
|
||||
response.setMessage("ACS系统需要更新,请稍等");
|
||||
response.setErrArr(datas);
|
||||
return response;
|
||||
}
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
String data = datas.get(i).toString();
|
||||
CreateTaskRequest request = JsonUtl.format(data, CreateTaskRequest.class);
|
||||
String paper_array = request.getPaper_array();
|
||||
String ext_task_id = request.getExt_task_id();
|
||||
String task_code = request.getTask_code();
|
||||
String start_device_code = request.getStart_device_code();
|
||||
String start_device_code2 = request.getStart_device_code2();
|
||||
String next_device_code = request.getNext_device_code();
|
||||
String next_device_code2 = request.getNext_device_code2();
|
||||
String put_device_code = request.getPut_device_code();
|
||||
String priority = request.getPriority();
|
||||
String vehicle_code = request.getVehicle_code();
|
||||
String vehicle_type = request.getVehicle_type();
|
||||
String route_plan_code = request.getRoute_plan_code();
|
||||
String task_type = request.getTask_type();
|
||||
String truss_type = request.getTruss_type();
|
||||
String is_bushing = request.getIs_bushing();
|
||||
String version = request.getVersion();
|
||||
String bushing_num = request.getBushing_num();
|
||||
String storage_task_type = request.getDtl_type();
|
||||
String agv_system_type = request.getAgv_system_type();
|
||||
String remark = request.getRemark();
|
||||
double oven_time = 0.00d;
|
||||
if (StrUtil.isNotEmpty(request.getOven_time())) {
|
||||
oven_time = Double.parseDouble(request.getOven_time());
|
||||
}
|
||||
String temperature = request.getTemperature();
|
||||
String start_height = request.getStart_height();
|
||||
String next_height = request.getNext_height();
|
||||
Map<String, String> params = request.getParams();
|
||||
|
||||
String start_point_code = "";
|
||||
String start_point_code2 = "";
|
||||
String next_point_code = "";
|
||||
String next_point_code2 = "";
|
||||
String put_point_code = "";
|
||||
if (StrUtil.isEmpty(task_code)) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", task_code);
|
||||
json.put("ext_task_id", ext_task_id);
|
||||
json.put("message", "任务号不能为空");
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
if (StrUtil.isEmpty(start_device_code)) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", task_code);
|
||||
json.put("ext_task_id", ext_task_id);
|
||||
json.put("message", "起点不能为空");
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
if (StrUtil.isEmpty(next_device_code)) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", task_code);
|
||||
json.put("ext_task_id", ext_task_id);
|
||||
json.put("message", "终点不能为空");
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (StrUtil.equals(task_type, "8")) {
|
||||
next_device_code = request.getPut_device_code();
|
||||
put_device_code = request.getNext_device_code();
|
||||
}
|
||||
|
||||
JSONObject start_device_json = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + start_device_code + "'").uniqueResult(0);
|
||||
if (!ObjectUtil.isEmpty(start_device_json)) {
|
||||
start_point_code = (String) start_device_json.get("parent_storage_code") == null ? start_device_code : (String) start_device_json.get("storage_code");
|
||||
}
|
||||
JSONObject next_device_json = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + next_device_code + "'").uniqueResult(0);
|
||||
if (!ObjectUtil.isEmpty(next_device_json)) {
|
||||
next_point_code = (String) next_device_json.get("parent_storage_code") == null ? next_point_code : (String) next_device_json.get("storage_code");
|
||||
}
|
||||
JSONObject start_device_json2 = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + start_device_code2 + "'").uniqueResult(0);
|
||||
if (!ObjectUtil.isEmpty(start_device_json2)) {
|
||||
start_point_code2 = (String) start_device_json2.get("parent_storage_code") == null ? start_device_code2 : (String) start_device_json2.get("storage_code");
|
||||
}
|
||||
JSONObject next_device_json2 = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + next_device_code2 + "'").uniqueResult(0);
|
||||
if (!ObjectUtil.isEmpty(next_device_json2)) {
|
||||
next_point_code2 = (String) next_device_json2.get("parent_storage_code") == null ? next_device_code2 : (String) next_device_json2.get("storage_code");
|
||||
}
|
||||
JSONObject put_device_json = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + put_device_code + "'").uniqueResult(0);
|
||||
if (!ObjectUtil.isEmpty(put_device_json)) {
|
||||
put_point_code = (String) put_device_json.get("parent_storage_code") == null ? put_device_code : (String) put_device_json.get("storage_code");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(start_point_code) && start_point_code.indexOf("-") > 0) {
|
||||
String str[] = start_point_code.split("-");
|
||||
start_device_code = str[0];
|
||||
} else {
|
||||
start_device_code = start_point_code;
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(next_point_code) && next_point_code.indexOf("-") > 0) {
|
||||
String str[] = next_point_code.split("-");
|
||||
next_device_code = str[0];
|
||||
} else {
|
||||
next_device_code = next_point_code;
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(start_point_code2) && start_point_code2.indexOf("-") > 0) {
|
||||
String str[] = start_point_code2.split("-");
|
||||
start_device_code2 = str[0];
|
||||
} else {
|
||||
start_device_code2 = start_point_code2;
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(next_point_code2) && next_point_code2.indexOf("-") > 0) {
|
||||
String str[] = next_point_code2.split("-");
|
||||
next_device_code2 = str[0];
|
||||
} else {
|
||||
next_device_code2 = next_point_code2;
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(put_point_code) && put_point_code.indexOf("-") > 0) {
|
||||
String str[] = put_point_code.split("-");
|
||||
put_device_code = str[0];
|
||||
} else {
|
||||
put_device_code = put_point_code;
|
||||
}
|
||||
|
||||
if (StrUtil.isEmpty(route_plan_code)) {
|
||||
route_plan_code = "normal";
|
||||
}
|
||||
|
||||
if (StrUtil.equals(task_type, "5")) {
|
||||
Device device = deviceAppService.findDeviceByCode(next_device_code);
|
||||
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
||||
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
||||
if (ObjectUtil.equal("true", siemensConveyorDeviceDriver.getExtraValue().get("inspect_in_stock"))) {
|
||||
if (siemensConveyorDeviceDriver.getMove() == 1) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", task_code);
|
||||
json.put("ext_task_id", ext_task_id);
|
||||
json.put("message", "终点" + siemensConveyorDeviceDriver.getDevice_code() + "有货无法生成任务");
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (taskService.querySameDeviceReadyTask(start_device_code, next_device_code, "0") > 1) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", task_code);
|
||||
json.put("ext_task_id", ext_task_id);
|
||||
json.put("message", "已存在相同的起点:" + start_device_code + "终点:" + next_device_code + "未执行的输送任务");
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
TaskDto taskDto = taskService.findByCodeFromCache(task_code);
|
||||
if (taskDto != null) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", task_code);
|
||||
json.put("ext_task_id", ext_task_id);
|
||||
json.put("message", "存在相同的任务号:" + task_code);
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
if (!StrUtil.isEmpty(vehicle_code)) {
|
||||
TaskDto vehicle_dto = taskService.findByContainer(vehicle_code);
|
||||
if (vehicle_dto != null) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", task_code);
|
||||
json.put("ext_task_id", ext_task_id);
|
||||
json.put("message", "已存在任务编号为" + vehicle_dto.getTask_code() + "托盘号:" + vehicle_code);
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.isEmpty(start_point_code)) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", task_code);
|
||||
json.put("ext_task_id", ext_task_id);
|
||||
json.put("message", request.getStart_device_code() + " 该设备号未找到对应点位");
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
if (StrUtil.isEmpty(next_point_code)) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", task_code);
|
||||
json.put("ext_task_id", ext_task_id);
|
||||
json.put("message", request.getNext_device_code() + " 该设备号未找到对应点位");
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_id", IdUtil.simpleUUID());
|
||||
jo.put("task_code", task_code);
|
||||
jo.put("start_point_code", start_point_code);
|
||||
jo.put("next_point_code", next_point_code);
|
||||
jo.put("start_point_code2", start_point_code2);
|
||||
jo.put("next_point_code2", next_point_code2);
|
||||
jo.put("put_point_code", put_point_code);
|
||||
jo.put("start_parent_code", start_point_code);
|
||||
jo.put("next_parent_code", next_point_code);
|
||||
jo.put("start_device_code", start_device_code);
|
||||
jo.put("next_device_code", next_device_code);
|
||||
jo.put("start_device_code2", start_device_code2);
|
||||
jo.put("next_device_code2", next_device_code2);
|
||||
jo.put("put_device_code", put_device_code);
|
||||
jo.put("priority", priority);
|
||||
jo.put("vehicle_code", vehicle_code);
|
||||
jo.put("vehicle_type", vehicle_type);
|
||||
jo.put("storage_task_type", storage_task_type);
|
||||
jo.put("agv_system_type", agv_system_type);
|
||||
jo.put("start_height", start_height);
|
||||
jo.put("next_height", next_height);
|
||||
jo.put("oven_time", (int) Math.ceil(oven_time));
|
||||
jo.put("remark", remark);
|
||||
jo.put("params", params);
|
||||
jo.put("task_type", StrUtil.isEmpty(task_type) ? 1 : Integer.parseInt(task_type));
|
||||
jo.put("paper_array", JSONUtil.toJsonStr(paper_array));
|
||||
jo.put("truss_type", JSONUtil.toJsonStr(truss_type));
|
||||
jo.put("is_bushing", JSONUtil.toJsonStr(is_bushing));
|
||||
jo.put("version", JSONUtil.toJsonStr(version));
|
||||
jo.put("bushing_num", JSONUtil.toJsonStr(bushing_num));
|
||||
|
||||
|
||||
if (!StrUtil.isEmpty(ext_task_id)) {
|
||||
jo.put("ext_task_id", ext_task_id);
|
||||
}
|
||||
|
||||
TaskDto task_dto = jo.toJavaObject(TaskDto.class);
|
||||
try {
|
||||
// task_type=7 则是立库任务需要下刻下发
|
||||
if (StrUtil.equals(task_dto.getTask_type(), "7")) {
|
||||
//创建临时指令 不创建、不生成
|
||||
//等立库反馈成功才能创建任务和指令
|
||||
Instruction inst = null;
|
||||
try {
|
||||
inst = taskService.createTemporaryInst(task_dto);
|
||||
} catch (Exception e) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", task_code);
|
||||
json.put("ext_task_id", ext_task_id);
|
||||
json.put("message", "起始点:"+ task_dto.getStart_point_code() + ",终点:"+
|
||||
task_dto.getNext_point_code()+",条码:" + task_dto.getVehicle_code() +
|
||||
"," + e.getMessage());
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
Resp resp = acsToLiKuService.sendInst(task_dto.getStorage_task_type(), inst);
|
||||
|
||||
if (StrUtil.equals(resp.result, "true")) {
|
||||
//创建任务和指令
|
||||
taskService.create(task_dto);
|
||||
inst.setSend_status(CommonFinalParam.ONE);
|
||||
taskService.extCreateInst(inst);
|
||||
|
||||
} else {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", task_code);
|
||||
json.put("ext_task_id", ext_task_id);
|
||||
json.put("message", resp.getComment());
|
||||
json.put("code", resp.code);
|
||||
json.put("data", data);
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
|
||||
} else {
|
||||
taskService.create(task_dto);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", task_code);
|
||||
json.put("ext_task_id", ext_task_id);
|
||||
json.put("message", e.getMessage());
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(errArr)) {
|
||||
response.setStatus(200);
|
||||
response.setMessage("success");
|
||||
} else {
|
||||
response.setStatus(400);
|
||||
if (ObjectUtil.isNotEmpty(errArr)) {
|
||||
response.setMessage(errArr.getJSONObject(0).getString("message"));
|
||||
} else {
|
||||
response.setMessage("false");
|
||||
}
|
||||
response.setErrArr(errArr);
|
||||
}
|
||||
log.info("createFromWms--------------:输出参数:" + JSON.toJSONString(response));
|
||||
|
||||
return response;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override public Map<String, Object> unLock(String param) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("unLock--------------:输入参数" + param);
|
||||
JSONObject jo = JSONObject.parseObject(param);
|
||||
String task_code = String.valueOf(jo.get("task_code"));
|
||||
if (StrUtil.isEmpty(task_code)) {
|
||||
throw new BadRequestException("任务号不能为空");
|
||||
}
|
||||
String device_code = String.valueOf(jo.get("device_code"));
|
||||
if (StrUtil.isEmpty(device_code)) {
|
||||
throw new BadRequestException("设备号不能为空");
|
||||
}
|
||||
String vehicle_code = String.valueOf(jo.get("vehicle_code"));
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("载具号不能为空");
|
||||
}
|
||||
OutConfirmRequest outConfirmRequest = new OutConfirmRequest();
|
||||
outConfirmRequest.setOutPortNo(device_code);
|
||||
outConfirmRequest.setPalletCode(vehicle_code);
|
||||
Instruction instruction = instructionService.findByCode(String.valueOf(task_code));
|
||||
if (ObjectUtil.isNotEmpty(instruction)) {
|
||||
task_code = instruction.getInstruction_code();
|
||||
outConfirmRequest.setOrderId(task_code);
|
||||
}
|
||||
Resp<OutConfirmReportResponse> resp = acsToLiKuService.outConfirm(outConfirmRequest);
|
||||
if (StrUtil.equals(resp.getResult(), "false")) {
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", 400);
|
||||
resultJson.put("message", resp.getComment());
|
||||
log.info("unLock--------------:输出参数" + resultJson);
|
||||
return resultJson;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", 400);
|
||||
resultJson.put("message", e.getMessage());
|
||||
log.info("unLock--------------:输出参数" + resultJson);
|
||||
return resultJson;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.OK.value());
|
||||
resultJson.put("message", "操作成功");
|
||||
log.info("unLock--------------:输出参数" + resultJson);
|
||||
return resultJson;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Map<String, Object> sendAgvChargeTask(JSONObject param) {
|
||||
// log.info("sendAgvChargeTask--------------:输入参数" + param.toString());
|
||||
// String agv_system = param.getString("agv_system");
|
||||
// String car_no = param.getString("car_no");
|
||||
// if (StrUtil.isEmpty(agv_system)) {
|
||||
// throw new BadRequestException("AGV系统类型不能为空");
|
||||
// }
|
||||
// if (StrUtil.isEmpty(car_no)) {
|
||||
// throw new BadRequestException("AGV车号不能为空");
|
||||
// }
|
||||
// Device device = deviceAppService.findDeviceByCode(car_no);
|
||||
// if (device == null) {
|
||||
// throw new BadRequestException("agv车号在ACS系统中不存在!");
|
||||
// }
|
||||
// NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class);
|
||||
// agvService.createChargingTaskToNDC(agv_system, car_no);
|
||||
// JSONObject resp = new JSONObject();
|
||||
// resp.put("status", 200);
|
||||
// resp.put("message", "操作成功");
|
||||
// return resp;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Map<String, Object> queryDeviceInfo(JSONObject param) {
|
||||
// log.info("queryDeviceInfo--------------:输入参数" + param.toString());
|
||||
// String region_code = param.getString("region_code");
|
||||
//// if (StrUtil.isEmpty(region_code)) {
|
||||
//// throw new BadRequestException("区域编码不能为空");
|
||||
//// }
|
||||
// AgvNdcTwoDeviceDriver agvNdcTwoDeviceDriver;
|
||||
// AgvNdcOneDeviceDriver agvNdcOneDeviceDriver;
|
||||
// List<Device> devices = deviceAppService.findDevice(DeviceType.agv);
|
||||
// JSONArray data = new JSONArray();
|
||||
// if (StrUtil.isEmpty(region_code)) {
|
||||
// throw new BadRequestException("区域编码不能为空");
|
||||
// }
|
||||
AgvNdcTwoDeviceDriver agvNdcTwoDeviceDriver;
|
||||
AgvNdcOneDeviceDriver agvNdcOneDeviceDriver;
|
||||
List<Device> devices = deviceAppService.findDevice(DeviceType.agv);
|
||||
JSONArray data = new JSONArray();
|
||||
if (StrUtil.isEmpty(region_code)) {
|
||||
if (ObjectUtil.isNotEmpty(devices)) {
|
||||
for (int i = 0; i < devices.size(); i++) {
|
||||
Device device = devices.get(i);
|
||||
Device agvDevice = deviceAppService.findDeviceByCode(device.getDevice_code());
|
||||
if (agvDevice.getDeviceDriver() instanceof DeviceStageMonitor) {
|
||||
DeviceStageMonitor deviceStageMonitor = (DeviceStageMonitor) agvDevice.getDeviceDriver();
|
||||
try {
|
||||
JSONObject jo = deviceStageMonitor.getDeviceStatusName();
|
||||
data.add(jo);
|
||||
} catch (Exception e) {
|
||||
log.error("反馈AGV信息失败:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (ObjectUtil.isNotEmpty(devices)) {
|
||||
for (int i = 0; i < devices.size(); i++) {
|
||||
Device device = devices.get(i);
|
||||
Device agvDevice = deviceAppService.findDeviceByCode(device.getDevice_code());
|
||||
if (agvDevice.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) {
|
||||
if (StrUtil.equals(region_code, "1")) {
|
||||
agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) agvDevice.getDeviceDriver();
|
||||
JSONObject jo = agvNdcTwoDeviceDriver.getDeviceStatusName();
|
||||
data.add(jo);
|
||||
}
|
||||
}
|
||||
if (agvDevice.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) {
|
||||
if (StrUtil.equals(region_code, "5")) {
|
||||
agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) agvDevice.getDeviceDriver();
|
||||
JSONObject jo = agvNdcOneDeviceDriver.getDeviceStatusName();
|
||||
data.add(jo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject resp = new JSONObject();
|
||||
resp.put("status", 200);
|
||||
resp.put("message", "操作成功");
|
||||
resp.put("data", data);
|
||||
return resp;
|
||||
}
|
||||
|
||||
@Override public Map<String, Object> syncfaultInfo() {
|
||||
log.info("syncfaultInfo--------------:输入参数");
|
||||
JSONArray data = new JSONArray();
|
||||
List<Dict> dicts = dictService.queryAll();
|
||||
if (ObjectUtil.isNotEmpty(dicts)) {
|
||||
List<Dict> error_dists = dicts
|
||||
.stream()
|
||||
.filter(dict -> dict.getName().contains("error_type"))
|
||||
.collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(error_dists)) {
|
||||
for (int i = 0; i < error_dists.size(); i++) {
|
||||
Dict dict = error_dists.get(i);
|
||||
String dictName = dict.getName();
|
||||
List<DictDetailDto> dictDetailDtos = dictDetailService.getDictByName(dictName);
|
||||
for (DictDetailDto dictDetailDto : dictDetailDtos) {
|
||||
JSONObject faultInfo = new JSONObject();
|
||||
faultInfo.put("fault_type", dictName);
|
||||
faultInfo.put("fault_code", dictDetailDto.getValue());
|
||||
faultInfo.put("fault_info", dictDetailDto.getLabel());
|
||||
data.add(faultInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject resp = new JSONObject();
|
||||
resp.put("status", 200);
|
||||
resp.put("message", "操作成功");
|
||||
resp.put("data", data);
|
||||
return resp;
|
||||
}
|
||||
|
||||
@Override public Map<String, Object> realTimefaultInfo(JSONObject param) {
|
||||
log.info("realTimefaultInfo--------------:输入参数" + param.toString());
|
||||
String device_code = param.getString("device_code");
|
||||
JSONArray data = new JSONArray();
|
||||
if (StrUtil.isNotEmpty(device_code)) {
|
||||
String[] devices = device_code.split(",");
|
||||
Device device = null;
|
||||
for (String deviceCode : devices) {
|
||||
device = deviceAppService.findDeviceByCode(deviceCode);
|
||||
if (device == null) {
|
||||
continue;
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof FeedLmsRealFailed) {
|
||||
FeedLmsRealFailed feedLmsRealFailed = (FeedLmsRealFailed) device.getDeviceDriver();
|
||||
JSONObject jsonObject = feedLmsRealFailed.feedLmsRealFailedInfo();
|
||||
data.add(jsonObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject resp = new JSONObject();
|
||||
resp.put("status", 200);
|
||||
resp.put("message", "操作成功");
|
||||
resp.put("data", data);
|
||||
return resp;
|
||||
}
|
||||
|
||||
|
||||
@Override public Map<String, Object> paperTubeAction(JSONObject param) {
|
||||
log.info("paperTubeAction--------------:输入参数" + param.toString());
|
||||
JSONObject resp = new JSONObject();
|
||||
String device_code = param.getString("device_code");
|
||||
String type = param.getString("type");
|
||||
String material_code = param.getString("material_code");
|
||||
String qty = param.getString("qty");
|
||||
|
||||
if (StrUtil.isNotEmpty(device_code)) {
|
||||
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (device == null) {
|
||||
resp.put("status", 400);
|
||||
resp.put("message", "未找到对应设备");
|
||||
log.info("paperTubeAction--------------:输出参数" + resp.toString());
|
||||
return resp;
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof PaperTubeConveyorDeviceDriver) {
|
||||
PaperTubeConveyorDeviceDriver paperTubeConveyorDeviceDriver = (PaperTubeConveyorDeviceDriver) device.getDeviceDriver();
|
||||
if (paperTubeConveyorDeviceDriver.getMode() != 2) {
|
||||
resp.put("status", 400);
|
||||
resp.put("message", "设备:" + device_code + "未待机,无法下发信号");
|
||||
log.info("paperTubeAction--------------:输出参数" + resp.toString());
|
||||
return resp;
|
||||
}
|
||||
if (StrUtil.equals(type, "1")) {
|
||||
if (paperTubeConveyorDeviceDriver.getInventory_qty() > 0) {
|
||||
resp.put("status", 400);
|
||||
resp.put("message", "设备:" + device_code + "当前数量为" + paperTubeConveyorDeviceDriver.getInventory_qty() + "无法设置物料");
|
||||
log.info("paperTubeAction--------------:输出参数" + resp.toString());
|
||||
return resp;
|
||||
}
|
||||
try{
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_material");
|
||||
map.put("value", material_code);
|
||||
list.add(map);
|
||||
paperTubeConveyorDeviceDriver.writing(list);
|
||||
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (StrUtil.equals(type, "2")) {
|
||||
if (paperTubeConveyorDeviceDriver.getInventory_qty() < Integer.parseInt(qty)) {
|
||||
resp.put("status", 400);
|
||||
resp.put("message", "设备:" + device_code + "当前数量为" + paperTubeConveyorDeviceDriver.getInventory_qty() + "小于出库数量" + qty);
|
||||
log.info("paperTubeAction--------------:输出参数" + resp.toString());
|
||||
return resp;
|
||||
}
|
||||
if (StrUtil.isEmpty(paperTubeConveyorDeviceDriver.getMaterial())) {
|
||||
resp.put("status", 400);
|
||||
resp.put("message", "设备:" + device_code + "设备上报物料为空无法出库");
|
||||
log.info("paperTubeAction--------------:输出参数" + resp.toString());
|
||||
return resp;
|
||||
} else {
|
||||
if (!StrUtil.equals(paperTubeConveyorDeviceDriver.getMaterial(), material_code)) {
|
||||
resp.put("status", 400);
|
||||
resp.put("message", "设备:" + device_code + "设备上报物料为" + paperTubeConveyorDeviceDriver.getMaterial() + "与出库物料" + material_code + "不匹配");
|
||||
log.info("paperTubeAction--------------:输出参数" + resp.toString());
|
||||
return resp;
|
||||
}
|
||||
}
|
||||
if (paperTubeConveyorDeviceDriver.getTo_command() != 0 || paperTubeConveyorDeviceDriver.getTo_target() != 0) {
|
||||
resp.put("status", 400);
|
||||
resp.put("message", "设备:" + device_code + "下发命令信号值为" + paperTubeConveyorDeviceDriver.getTo_command() + ",下发目标站:" + paperTubeConveyorDeviceDriver.getTo_target() + ",已存在待执行的任务");
|
||||
log.info("paperTubeAction--------------:输出参数" + resp.toString());
|
||||
return resp;
|
||||
}
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_out_qty");
|
||||
map.put("value", qty);
|
||||
list.add(map);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code", "to_target");
|
||||
map2.put("value", device.getAddress());
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code", "to_command");
|
||||
map3.put("value", 2);
|
||||
list.add(map3);
|
||||
try{
|
||||
// paperTubeConveyorDeviceDriver.writing("to_out_qty", qty);
|
||||
// paperTubeConveyorDeviceDriver.writing("to_target", device.getAddress());
|
||||
// paperTubeConveyorDeviceDriver.writing("to_command", "2");
|
||||
paperTubeConveyorDeviceDriver.writing(list);
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else if(StrUtil.equals(type, "3")){
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_command");
|
||||
map.put("value", 3);
|
||||
list.add(map);
|
||||
paperTubeConveyorDeviceDriver.writing(list);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
resp.put("status", 200);
|
||||
resp.put("message", "操作成功");
|
||||
return resp;
|
||||
}**/
|
||||
|
||||
}
|
||||
|
||||
@@ -1164,14 +1164,14 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
//
|
||||
// } else
|
||||
//1=XZ 2=NDC
|
||||
if (entity.getAgv_system_type().equals(CommonFinalParam.TWO)) {
|
||||
if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(CommonFinalParam.TWO)) {
|
||||
// NDC agv指令不当场取消指令,需要等agv上报
|
||||
if (!StrUtil.isEmpty(entity.getAgv_jobno())) {
|
||||
ndcAgvService.deleteAgvInstToNDC(BeanUtil.copyProperties(entity, Instruction.class));
|
||||
} else {
|
||||
flag = true;
|
||||
}
|
||||
} else if (entity.getAgv_system_type().equals(CommonFinalParam.ONE)
|
||||
} else if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(CommonFinalParam.ONE)
|
||||
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
||||
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
|
||||
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
|
||||
|
||||
@@ -343,7 +343,7 @@ public class RouteLineServiceImpl extends CommonServiceImpl<RouteLineMapper, Rou
|
||||
list1.add(convert);
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestException(LangProcess.msg("error_creat_route"));
|
||||
throw new BadRequestException(LangProcess.msg("error_creat_route")+dto.getDevice_code()+"==>"+dto.getNext_device_code());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,4 +35,11 @@ public class LuceneController {
|
||||
public ResponseEntity<Object> get(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(luceneService.getAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getAddressLog")
|
||||
@Log("接口日志检索")
|
||||
//@PreAuthorize("@el.check('task:list')")
|
||||
public ResponseEntity<Object> getAddressLog(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(luceneService.getAddressLog(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,4 +15,6 @@ public interface LuceneService {
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> getAll(Map whereJson, Pageable page);
|
||||
|
||||
Map<String, Object> getAddressLog(Map whereJson, Pageable page);
|
||||
}
|
||||
|
||||
@@ -126,6 +126,100 @@ public class LuceneServiceImpl implements LuceneService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getAddressLog(Map whereJson, Pageable page) {
|
||||
//获取要查询的路径,也就是索引所在的位置
|
||||
try {
|
||||
Resource resource = new ClassPathResource("config/application.yml");
|
||||
YamlPropertiesFactoryBean yamlPropertiesFactoryBean = new YamlPropertiesFactoryBean();
|
||||
yamlPropertiesFactoryBean.setResources(resource);
|
||||
Properties properties = yamlPropertiesFactoryBean.getObject();
|
||||
// 获取配置值
|
||||
String luceneDir = properties.getProperty("lucene.index.path");
|
||||
FSDirectory directory = FSDirectory.open(Paths.get(luceneDir));
|
||||
DirectoryReader open = DirectoryReader.open(directory);
|
||||
IndexSearcher searcher = new IndexSearcher(open);
|
||||
// 实际上Lucene本身不支持分页。因此我们需要自己进行逻辑分页。我们要准备分页参数:
|
||||
int pageSize = Integer.parseInt(whereJson.get("size").toString());// 每页条数
|
||||
int pageNum = Integer.parseInt(whereJson.get("page").toString());// 当前页码
|
||||
|
||||
BooleanQuery.Builder booleanQueryBuilder = new BooleanQuery.Builder();
|
||||
//时间范围查询
|
||||
String startDate = (String) whereJson.get("begin_time");
|
||||
String endDate = (String) whereJson.get("end_time");
|
||||
|
||||
if (startDate == null){
|
||||
Calendar calendar=Calendar.getInstance();
|
||||
calendar.set(1970, 0, 1);
|
||||
startDate = DateUtil.format(calendar.getTime(),"yyyy-MM-dd HH:mm:ss.SSS");
|
||||
}else{
|
||||
startDate = getDate(startDate);
|
||||
}
|
||||
if (endDate == null){
|
||||
endDate = DateUtil.format(new DateTime(),"yyyy-MM-dd HH:mm:ss.SSS");
|
||||
} else {
|
||||
endDate = getDate(endDate);
|
||||
}
|
||||
TermRangeQuery termRangeQuery = new TermRangeQuery("logTime", new BytesRef(startDate), new BytesRef(endDate), true, true);
|
||||
booleanQueryBuilder.add(termRangeQuery, BooleanClause.Occur.MUST);
|
||||
if (whereJson.get("device_code") != null){
|
||||
Query termQuery = new TermQuery(new Term("device_code", (String) whereJson.get("device_code")));
|
||||
booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST);
|
||||
}
|
||||
if (whereJson.get("method") != null){
|
||||
Query termQuery = new TermQuery(new Term("method", (String) whereJson.get("method")));
|
||||
booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST);
|
||||
}
|
||||
if (whereJson.get("status_code") != null){
|
||||
Query termQuery = new TermQuery(new Term("status_code", (String) whereJson.get("status_code")));
|
||||
booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST);
|
||||
}
|
||||
if (whereJson.get("requestparam") != null){
|
||||
WildcardQuery query = new WildcardQuery(new Term("requestparam", "*"+(String) whereJson.get("requestparam")+"*"));
|
||||
booleanQueryBuilder.add(query,BooleanClause.Occur.MUST);
|
||||
}
|
||||
if (whereJson.get("responseparam") != null){
|
||||
WildcardQuery query = new WildcardQuery(new Term("responseparam", "*"+(String) whereJson.get("responseparam")+"*"));
|
||||
booleanQueryBuilder.add(query,BooleanClause.Occur.MUST);
|
||||
}
|
||||
if (whereJson.get("blurry") != null) {
|
||||
WildcardQuery query = new WildcardQuery(new Term("fieldContent", "*"+(String) whereJson.get("blurry")+"*"));
|
||||
booleanQueryBuilder.add(query, BooleanClause.Occur.MUST);
|
||||
}
|
||||
|
||||
TopFieldCollector collector = TopFieldCollector.create(new Sort(new SortField("logTime", SortField.Type.LONG,true)), 20000, 0);
|
||||
searcher.search(booleanQueryBuilder.build(), collector);
|
||||
TopDocs topDocs = collector.topDocs(pageNum*pageSize, pageSize);
|
||||
int totalSize = collector.getTotalHits();
|
||||
ScoreDoc[] scoreDocs = topDocs.scoreDocs;
|
||||
|
||||
List<JSONObject> list = new ArrayList<>();
|
||||
for (ScoreDoc scoreDoc : scoreDocs) {
|
||||
Document doc = open.document(scoreDoc.doc);
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("content",doc.get("fieldContent"));
|
||||
object.put("device_code",doc.get("device_code"));
|
||||
object.put("logTime",doc.get("logTime"));
|
||||
object.put("method",doc.get("method"));
|
||||
object.put("status_code",doc.get("status_code"));
|
||||
object.put("requestparam",doc.get("requestparam"));
|
||||
object.put("responseparam",doc.get("responseparam"));
|
||||
if(doc.get("fieldContent") != null) {
|
||||
list.add(object);
|
||||
}
|
||||
}
|
||||
open.close();
|
||||
directory.close();
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("content", list);
|
||||
jo.put("totalElements", totalSize);
|
||||
return jo;
|
||||
} catch (Exception e) {
|
||||
log.error("索引查询为空", e);
|
||||
throw new NullPointerException("索引查询为空");
|
||||
}
|
||||
}
|
||||
|
||||
public static String getDate(String timeString) throws ParseException {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX");//时间格式
|
||||
Date date = sdf.parse(timeString);
|
||||
|
||||
@@ -264,7 +264,7 @@ public class OnlineUserService {
|
||||
String tokenValue = StpUtil.getTokenValue();
|
||||
SaCookieConfig cfg = SaManager.getConfig().getCookie();
|
||||
SaCookie cookie = new SaCookie()
|
||||
.setName(StpUtil.getTokenValue())
|
||||
.setName("Authorization")
|
||||
.setValue(tokenValue)
|
||||
.setMaxAge(-1)
|
||||
.setDomain(cfg.getDomain())
|
||||
|
||||
@@ -25,5 +25,5 @@ error_sysFile=\u4E0A\u4F20\u5931\u8D25
|
||||
error_sysLimit=\u8BBF\u95EE\u6B21\u6570\u9650\u5236\!
|
||||
zh_device_name_isNotNull = \u4E2D\u6587\u8BBE\u5907\u540D\u79F0\u4E0D\u80FD\u4F4D\u7A7A
|
||||
error_not_configured=\u5B57\u5178\u8868\u672A\u914D\u7F6E\u5BF9\u5E94\u7684\u62A5\u8B66\u4FE1\u606F
|
||||
error_creat_route=\u5DF2\u5B58\u5728\u8BE5\u8DEF\u7531\u8DEF\u7EBF\uFF01
|
||||
error_creat_route=\u5DF2\u5B58\u5728\u8BE5\u8DEF\u7531\u8DEF\u7EBF:
|
||||
error_regional_max=\u533A\u57DF\u6307\u4EE4\u6570\u91CF\u5DF2\u6700\u5927\u503C
|
||||
|
||||
@@ -25,6 +25,6 @@ error_sysFile=Upload failed
|
||||
error_sysLimit=Access limit\!
|
||||
zh_device_name_isNotNull = Chinese device name cannot be empty\!
|
||||
error_not_configured=The dictionary table is not configured with alarm information
|
||||
error_creat_route=The route already exists!
|
||||
error_creat_route=The route already exists:
|
||||
error_regional_max=Maximum limit for regional instructions reached
|
||||
|
||||
|
||||
@@ -25,5 +25,5 @@ error_sysFile=Upload gagal
|
||||
error_sysLimit=Batas akses\!
|
||||
zh_device_name_isNotNull= Nama perangkat dalam bahasa Cina tidak boleh kosong!
|
||||
error_not_configured=Informasi alarm tak dikonfigurasi dari tabel kamus
|
||||
error_creat_route=Itu sudah ada!
|
||||
error_creat_route=Itu sudah ada:
|
||||
error_regional_max=Jumlah maksimum instruksi wilayah telah tercapai
|
||||
|
||||
@@ -25,6 +25,6 @@ error_sysFile=\u4E0A\u4F20\u5931\u8D25
|
||||
error_sysLimit=\u8BBF\u95EE\u6B21\u6570\u9650\u5236\!
|
||||
zh_device_name_isNotNull = \u4E2D\u6587\u8BBE\u5907\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A
|
||||
error_not_configured=\u5B57\u5178\u8868\u672A\u914D\u7F6E\u5BF9\u5E94\u7684\u62A5\u8B66\u4FE1\u606F
|
||||
error_creat_route=\u5DF2\u5B58\u5728\u8BE5\u8DEF\u7531\u8DEF\u7EBF\uFF01
|
||||
error_creat_route=\u5DF2\u5B58\u5728\u8BE5\u8DEF\u7531\u8DEF\u7EBF:
|
||||
error_regional_max=\u533A\u57DF\u6307\u4EE4\u6570\u91CF\u5DF2\u6700\u5927\u503C
|
||||
|
||||
|
||||
@@ -8,6 +8,13 @@ export function add(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function queryAddressCodeList() {
|
||||
return request({
|
||||
url: 'api/Address/queryAddressCodeList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/Address/',
|
||||
@@ -24,4 +31,4 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
export default { add, edit, del, queryAddressCodeList }
|
||||
|
||||
@@ -301,6 +301,9 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="行架任务类型">
|
||||
<el-input v-model="form.truss_type" style="width: 370px;" @change="isDisabled=false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="grid-content bg-purple-light" />
|
||||
@@ -405,6 +408,9 @@
|
||||
<el-form-item :label="$t('task.txt_box.Vehicle_number')">
|
||||
<el-input v-model="form.vehicle_code" style="width: 370px;" @change="isDisabled=false" />
|
||||
</el-form-item>
|
||||
<el-form-item label="空轴位">
|
||||
<el-input v-model="form.empty_site" style="width: 370px;" @change="isDisabled=false" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('task.txt_box.extension_field')">
|
||||
<div>
|
||||
<el-button @click="openDialog">{{ $t('task.select.Placeholder') }}</el-button>
|
||||
|
||||
106
acs2/nladmin-ui/src/views/monitor/logQuery/index.vue
Normal file
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<Search />
|
||||
<crudOperation />
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="55"/>-->
|
||||
<!-- <el-table-column v-if="false" prop="id" label="id"/>-->
|
||||
<el-table-column prop="operate" label="操作" :min-width="flexWidth('operate',crud.data,操作)" />
|
||||
<!-- <el-table-column prop="trace_id" label="链路追踪" /> -->
|
||||
<el-table-column prop="method" label="方法" :min-width="flexWidth('method',crud.data,方法)" />
|
||||
<el-table-column prop="requestparam" label="请求参数" :min-width="flexWidth('requestparam',crud.data,请求参数)" />
|
||||
<el-table-column prop="responseparam" label="返回参数" :min-width="flexWidth('responseparam',crud.data,返回参数)" />
|
||||
<el-table-column prop="logTime" label="记录时间" :min-width="flexWidth('logTime',crud.data,记录时间)" />
|
||||
<el-table-column prop="content" label="内容详情" :show-overflow-tooltip="true" />
|
||||
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Search from './search'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import { delAll } from '@/api/acs/lucene/log'
|
||||
|
||||
export default {
|
||||
name: 'LuceneLog',
|
||||
components: { Search, pagination, crudOperation },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds: function() {
|
||||
return CRUD({
|
||||
title: '系统参数', url: 'api/lucene/getAddressLog', idField: 'id', sort: 'id,desc',
|
||||
queryOnPresenterCreated: true,
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false
|
||||
},
|
||||
page: {
|
||||
size: 40,
|
||||
total: 0,
|
||||
page: 0
|
||||
},
|
||||
query: {
|
||||
createTime: [new Date(new Date().setTime(new Date().getTime() - 3600 * 1000)), new Date(new Date().setTime(new Date().getTime() + 3600 * 1000))],
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
query: { blurry: '123' },
|
||||
permission: {
|
||||
add: ['admin', 'param:add'],
|
||||
edit: ['admin', 'param:edit'],
|
||||
del: ['admin', 'param:del']
|
||||
},
|
||||
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
confirmDelAll() {
|
||||
this.$confirm(`确认清空所有操作日志吗?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.crud.delAllLoading = true
|
||||
delAll('device_execute').then(res => {
|
||||
this.crud.delAllLoading = false
|
||||
this.crud.dleChangePage(1)
|
||||
this.crud.delSuccessNotify()
|
||||
this.crud.toQuery()
|
||||
}).catch(err => {
|
||||
this.crud.delAllLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
125
acs2/nladmin-ui/src/views/monitor/logQuery/search.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="query.method"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- placeholder="请输入你要搜索的方法名"-->
|
||||
<!-- style="width: 200px;"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- />-->
|
||||
<el-select
|
||||
v-model="query.method"
|
||||
clearable
|
||||
filterable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的方法名"
|
||||
class="filter-item"
|
||||
style="width: 200px"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option v-for="item in methods" :key="item.id" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<el-input
|
||||
v-model="query.requestparam"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的请求参数"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.responseparam"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的返回参数"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="请输入你要搜索的内容详情"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<!--
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
-->
|
||||
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="datetimerange"
|
||||
:picker-options="pickerOptions"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
class="date-item1"
|
||||
/>
|
||||
<rrOperation />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { header } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import {queryAddressCodeList} from "../../../api/acs/Address";
|
||||
|
||||
export default {
|
||||
components: { rrOperation },
|
||||
mixins: [header()],
|
||||
|
||||
data() {
|
||||
return {
|
||||
methods: [],
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}, {
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}]
|
||||
},
|
||||
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
|
||||
value2: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
queryAddressCodeList().then(data => {
|
||||
this.methods = data.content
|
||||
})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.date-item1 {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-bottom: 10px;
|
||||
height: 30.5px !important;
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<el-table-column prop="requestparam" label="请求参数" :min-width="flexWidth('requestparam',crud.data,请求参数)" />
|
||||
<el-table-column prop="responseparam" label="返回参数" :min-width="flexWidth('responseparam',crud.data,返回参数)" />
|
||||
<el-table-column prop="logTime" label="记录时间" :min-width="flexWidth('logTime',crud.data,记录时间)" />
|
||||
<el-table-column prop="content" label="内容详情" :min-width="flexWidth('content',crud.data,内容详情)" />
|
||||
<el-table-column prop="content" label="内容详情" :show-overflow-tooltip="true" />
|
||||
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
@@ -59,7 +59,7 @@ export default {
|
||||
page: 0
|
||||
},
|
||||
query: {
|
||||
createTime: [new Date(new Date().setTime(new Date().getTime() - 3600 * 1000)), new Date(new Date().setTime(new Date().getTime() + 3600 * 1000))]
|
||||
createTime: [new Date(new Date().setTime(new Date().getTime() - 3600 * 1000)), new Date(new Date().setTime(new Date().getTime() + 3600 * 1000))],
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -57,10 +57,9 @@
|
||||
type="datetimerange"
|
||||
:picker-options="pickerOptions"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
align="right"
|
||||
class="date-item1"
|
||||
/>
|
||||
<rrOperation />
|
||||
</div>
|
||||
@@ -111,3 +110,15 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.date-item1 {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-bottom: 10px;
|
||||
height: 30.5px !important;
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@@ -1076,7 +1076,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String demand_limit = detail.getString("Attribute4");//客户需求抗拉下限
|
||||
String standard_limit = detail.getString("Attribute5");//内控标准抗拉下限
|
||||
String actual_value = detail.getString("Attribute6");//生产实际抗拉值
|
||||
String Attribute7 = detail.getString("7");//生产实际抗拉值
|
||||
String Attribute7 = detail.getString("Attribute7");//包装关系类型
|
||||
String Attribute8 = detail.getString("Attribute8");//产品类型
|
||||
String Attribute9 = detail.getString("Attribute9");//接头数
|
||||
if (ObjectUtil.isNotEmpty(Attribute7) && "1".equals(Attribute7)) {
|
||||
sub_type = "2";
|
||||
}
|
||||
@@ -1131,6 +1133,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
jo.put("un_plan_product_property3", UnPlanProductProperty3);
|
||||
jo.put("width_standard", width_standard);
|
||||
jo.put("thickness_request", thickness_request);
|
||||
jo.put("material_type", Attribute8);
|
||||
jo.put("joint_num", Attribute9);
|
||||
jo.put("thickness_request", thickness_request);
|
||||
jo.put("status", "0");
|
||||
jo.put("create_id", "1");
|
||||
jo.put("create_name", "管理员");
|
||||
|
||||
@@ -131,7 +131,7 @@ public class PrintServiceImpl implements PrintService {
|
||||
fw = new FileWriter(filePath);
|
||||
OutputStreamWriter write = new OutputStreamWriter(new FileOutputStream(file), "utf-8");
|
||||
BufferedWriter bw = new BufferedWriter(write);
|
||||
bw.write("bz_print_no,package_box_sn1,package_box_sn2,sale_order_name,product_description,product_name,width,pcsn,date_of_FG_inbound,box_weight,date_of_production,quanlity_in_box,quality_guaran_period,nspector,storage_conditions,weight,customer_name,customer_description,thickness,mass_per_unit_area,length,box_type,sap_pcsn,box_length,box_width,box_high\n");
|
||||
bw.write("bz_print_no,package_box_sn1,package_box_sn2,sale_order_name,product_description,product_name,width,pcsn,date_of_FG_inbound,box_weight,date_of_production,quanlity_in_box,quality_guaran_period,nspector,storage_conditions,weight,customer_name,customer_description,thickness,mass_per_unit_area,length,box_type,sap_pcsn,box_length,box_width,box_high,material_type,joint_type\n");
|
||||
|
||||
bw.write(bz_print_no + ","
|
||||
+ package_box_sn1 + ","
|
||||
@@ -158,7 +158,9 @@ public class PrintServiceImpl implements PrintService {
|
||||
+ box_jo.getString("sap_pcsn") + ","
|
||||
+ box_jo.getString("box_length") + ","
|
||||
+ box_jo.getString("box_width") + ","
|
||||
+ box_jo.getString("box_high") + "\n"
|
||||
+ box_jo.getString("box_high") + ","
|
||||
+ box_jo.getString("material_type") + ","
|
||||
+ NumberUtil.round(box_jo.getString("joint_type"),2) + "\n"
|
||||
);
|
||||
|
||||
bw.close();
|
||||
@@ -271,7 +273,7 @@ public class PrintServiceImpl implements PrintService {
|
||||
fw = new FileWriter(filePath);
|
||||
OutputStreamWriter write = new OutputStreamWriter(new FileOutputStream(file), "utf-8");
|
||||
BufferedWriter bw = new BufferedWriter(write);
|
||||
bw.write("bz_print_no,package_box_sn1,package_box_sn2,sale_order_name,product_description,product_name,width,pcsn,date_of_FG_inbound,box_weight,date_of_production,quanlity_in_box,quality_guaran_period,nspector,storage_conditions,weight,customer_name,customer_description,thickness,mass_per_unit_area,length,box_type,sap_pcsn,box_length,box_width,box_high\n");
|
||||
bw.write("bz_print_no,package_box_sn1,package_box_sn2,sale_order_name,product_description,product_name,width,pcsn,date_of_FG_inbound,box_weight,date_of_production,quanlity_in_box,quality_guaran_period,nspector,storage_conditions,weight,customer_name,customer_description,thickness,mass_per_unit_area,length,box_type,sap_pcsn,box_length,box_width,box_high,material_type,joint_type\n");
|
||||
|
||||
bw.write(bz_print_no + ","
|
||||
+ package_box_sn1 + ","
|
||||
@@ -298,7 +300,9 @@ public class PrintServiceImpl implements PrintService {
|
||||
+ box_jo.getString("sap_pcsn") + ","
|
||||
+ box_jo.getString("box_length") + ","
|
||||
+ box_jo.getString("box_width") + ","
|
||||
+ box_jo.getString("box_high") + "\n"
|
||||
+ box_jo.getString("box_high") + ","
|
||||
+ box_jo.getString("material_type") + ","
|
||||
+ NumberUtil.round(box_jo.getString("joint_type"),2) + "\n"
|
||||
);
|
||||
|
||||
bw.close();
|
||||
|
||||
@@ -5678,6 +5678,36 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
subTab.update(jsonSub);
|
||||
|
||||
|
||||
if ("1003".equals(jo_mst.getString("bill_type")) || "1006".equals(jo_mst.getString("bill_type"))) {
|
||||
//如果为返检出库或者改切出库删除对应的包装关系
|
||||
JSONArray dis_rows = new JSONArray();
|
||||
if (jo_mst.getString("is_overdue").equals("1")) {
|
||||
dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "' and is_overdue = '0'").getResultJSONArray(0);
|
||||
} else {
|
||||
dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
|
||||
}
|
||||
|
||||
for (int j = 0; j < dis_rows.size(); j++) {
|
||||
JSONObject dis_row = dis_rows.getJSONObject(j);
|
||||
String sect_code = dis_row.getString("sect_code");
|
||||
JSONObject sect_jo = WQLObject.getWQLObject("st_ivt_sectattr").query("sect_code = '" + sect_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sect_jo)) {
|
||||
throw new BadRequestException("未查询到对应的库区!");
|
||||
}
|
||||
//如果是虚拟区的出库,直接把包装关系删除;如果为立库的包装关系,将解绑删除标识置为1。当发货区解绑时,删除包装关系
|
||||
String pcsn = dis_row.getString("pcsn");
|
||||
if ("09".equals(sect_jo.getString("sect_type_attr"))) {
|
||||
WQLObject.getWQLObject("pdm_bi_subpackagerelation").delete("container_name = '" + pcsn + "'");
|
||||
} else {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("need_delete", "1");
|
||||
WQLObject.getWQLObject("pdm_bi_subpackagerelation").update(map, "container_name = '" + pcsn + "'");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 解锁起点
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("struct_id", dis.getString("struct_id"));
|
||||
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 876 KiB |
|
Before Width: | Height: | Size: 389 KiB |
|
Before Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 647 KiB |
|
Before Width: | Height: | Size: 82 KiB |