This commit is contained in:
2022-07-10 15:57:19 +08:00
parent fb51814ea8
commit 3ee0d6d5ae
13 changed files with 376 additions and 130 deletions

View File

@@ -937,6 +937,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
obj.setHasgoods(hasGoodStatus);
obj.setMaterial_type(material_type);
obj.setBatch(batch);
obj.setIslock(islock);
hailiangEngravingCacheDeviceDriver.setMaterial(material_type);
if (hailiangEngravingCacheDeviceDriver.getMove() != Integer.parseInt(hasGoodStatus)){
hailiangEngravingCacheDeviceDriver.writing("to_cache_write",hasGoodStatus);

View File

@@ -250,31 +250,22 @@ public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver
instructionService.update(inst);
// TODO 指令中根据起始点位驱动类型判断空满
String start_device_code = inst.getStart_device_code();
log.warn("起点设备为:{}",start_device_code);
String next_device_code = inst.getNext_device_code();
log.warn("终点设备为:{}",next_device_code);
Device start_device = deviceAppservice.findDeviceByCode(start_device_code);
Device next_device = deviceAppservice.findDeviceByCode(next_device_code);
WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint");
if (start_device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver){
writing("to_cache_write", "2");
this.setMaterial(inst.getMaterial());
next_device.setMaterial_type(inst.getMaterial());
JSONObject updatejson = new JSONObject();
updatejson.put("hasgoods","2");
updatejson.put("islock","0");
updatejson.put("material_type",inst.getMaterial());
runpointwo.update(updatejson, "device_code = '" + device_code + "'");
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置刻字机,缓存位锁定成功");
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置刻字机,缓存位解锁成功");
}
if (start_device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver){
writing("to_cache_write", "1");
this.setMaterial("");
next_device.setMaterial_type("");
JSONObject updatejson = new JSONObject();
updatejson.put("hasgoods","1");
updatejson.put("islock","0");
updatejson.put("material_type","");
runpointwo.update(updatejson, "device_code = '" + device_code + "'");
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置包装机,缓存位锁定成功");
logServer.deviceLogToacs(this.device_code,"","","agvphase:" + agvphase + "起点位置包装机,缓存位解锁成功");
}
byte[] data = agvService.sendAgvOneModeInst(agvphase, index, 0);
OneNDCSocketConnectionAutoRun.write(data);

View File

@@ -364,6 +364,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
if ( move == 1 && mode == 1 && full_req == 1 ) {
// if ( full_req == 1 ) {
logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请任务");
apply_task();
} else {
logServer.deviceLogToacs(this.device_code,"","","不满足下发满框请求任务条件mode:"+mode+"move:"+move+"full_req:"+full_req);
@@ -589,6 +590,10 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单");
throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单");
}
if (order.getIs_needmove().equals("0")){
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "工单不需要agv搬运");
return false;
}
//查找当前工单对应的物料编号
String cpbh = order.getMaterial_code();

View File

@@ -302,13 +302,13 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
if (ObjectUtil.isEmpty(inst)) {
if (!requireSucess) {
if (lack_req == 1 && move == 0) {
logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请缺料请求任务");
if (mode == 1 && lack_req == 1 && move == 0) {
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,move:" + move + ",mode:" + mode + ",requireSucess:" + requireSucess + "开始申请缺料请求任务");
apply_task();
}
if (req_task_empty == 1 && move == 1){
logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move+",requireSucess:" + requireSucess + "开始申请请求取走空料斗任务");
if (mode == 1 && req_task_empty == 1 && move == 1) {
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,move:" + move + ",mode:" + mode + ",requireSucess:" + requireSucess + "开始申请请求取走空料斗任务");
apply_take_empty_task();
}
logServer.deviceLogToacs(this.device_code, "", "", "lack_req:" + lack_req + "move:" + move + "req_task_empty:" + req_task_empty);
@@ -319,8 +319,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
}
if(agvphase == 0x03)
{
if (agvphase == 0x03) {
//&& lack_req =1 缺料请求 先不判断
/*if( move == 1 && error == 0 && ObjectUtil.isNotEmpty(inst)){*/
inst.setExecute_status("1");
@@ -435,6 +434,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
public void set_last_container_type_desc(String type) {
}
public synchronized boolean apply_take_empty_task() throws Exception {
WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint");
@@ -522,6 +522,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
}
return true;
}
public synchronized boolean apply_task() throws Exception {
Date date = new Date();
if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) {
@@ -540,6 +541,10 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单");
throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单");
}
if (order.getIs_needmove().equals("0")) {
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "工单不需要agv搬运");
return false;
}
//查找当前工单对应的物料编号
String cpbh = order.getMaterial_code();

View File

@@ -4,16 +4,19 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.nl.acs.agv.server.AgvService;
import org.nl.acs.config.server.AcsConfigService;
import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line.HailiangAutoCacheLineDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_feeding_line.HailiangCleaningFeedingLineDefination;
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station.HailiangCleaningMachineStorageStationDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver;
@@ -394,27 +397,27 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
String empty_device = this.getDevice().getExtraValue().get("empty_device_code").toString();
//通过满料位设备关联的设备tw查找订单
ProduceshiftorderDto order = produceshiftorderService.findOrderByDeviceCode(link_device);
if (ObjectUtil.isEmpty(order)) {
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单");
throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单");
}
//判断是否需要agv搬运
if (order.getIs_needmove().equals("0")){
requireSucess = true;
logServer.deviceLogToacs(this.device_code,"","","不需要agv搬运工单号:"+order.getOrder_code());
return true;
}
if (ObjectUtil.isEmpty(order)) {
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":关联设备" + link_device + "未找到对应设备工单");
throw new BadRequestException(this.device_code + ":关联设备" + link_device + "未找到对应设备工单");
}
//查找当前工单对应的物料编号
String cpbh = order.getMaterial_code();
HailiangSpecialPourStationDeviceDriver hailiangSpecialPourStationDeviceDriver;
HailiangCleaningMachineStorageStationDeviceDriver hailiangCleaningMachineStorageStationDeviceDriver;
HailiangAutoCacheLineDeviceDriver hailiangAutoCacheLineDeviceDriver;
String clear_storage_device =null;
//遍历路由,找到对应所有的物料进行匹配
for (int i = 0; i < list.size(); i++) {
RouteLineDto dto = list.get(i);
//找到路由对应工位 清洗机设备编号
String route_device_code = dto.getNext_device_code();
//根据清洗机设备编号获取清洗剂设备信息
Device route_link_device = deviceAppservice.findDeviceByCode(route_device_code);
//找到路由工位对应设备
String route_link_device_code = (String)route_link_device.getExtraValue().get("link_device_code");
@@ -480,6 +483,51 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
}
}
else if (route_link_device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver){
JSONObject json = new JSONObject();
json.put("device_code",device_code);
json.put("type","1");
HttpResponse httpResponse = acsToWmsService.applyInCacheLineTask(json);
JSONObject jsonObject = JSONObject.parseObject(httpResponse.body());
String ext_task_id = jsonObject.getString("ext_task_id");
String task_code = jsonObject.getString("task_code");
String start_device_code = jsonObject.getString("start_device_code");
String put_device_code = jsonObject.getString("put_device_code");
String next_device_code = jsonObject.getString("next_device_code");
String task_type = jsonObject.getString("task_type");
String barcodeArr = jsonObject.getString("barcodeArr");
String[] barcodeArrs = barcodeArr.split("\\,");
TaskDto onedto = new TaskDto();
String now = DateUtil.now();
onedto.setTask_id(IdUtil.simpleUUID());
onedto.setQuantity(String.valueOf(full_number));
onedto.setCreate_by(this.getDevice().getDevice_code());
onedto.setUpdate_by(this.getDevice().getDevice_code());
onedto.setExt_task_id(ext_task_id);
onedto.setRoute_plan_code("normal");
String taskcode = CodeUtil.getNewCode("TASK_NO");
onedto.setTask_code("-" + taskcode);
onedto.setTask_status("0");
onedto.setPriority("101");
onedto.setAgv_system_type("1");
onedto.setTask_type(task_type);
onedto.setTask_id(IdUtil.simpleUUID());
onedto.setTask_code(task_code);
onedto.setStart_device_code(start_device_code);
onedto.setStart_point_code(start_device_code);
onedto.setPut_device_code(put_device_code);
onedto.setPut_point_code(put_device_code);
onedto.setNext_point_code(next_device_code);
onedto.setNext_device_code(next_device_code);
onedto.setUpdate_time(now);
onedto.setCreate_time(now);
try {
taskserver.create(onedto);
flag = true;
} catch (Exception e) {
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage()));
}
}
} else {
//清洗倒料位是没有工单的
if (route_link_device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
@@ -580,7 +628,6 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
hailiangCleaningMachineStorageStationDeviceDriver.setMaterial("");
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage()));
}
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务成功");
break;
}
}
@@ -601,6 +648,23 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
return true;
}
public synchronized boolean applyInCacheLineTask() throws Exception {
Boolean flag = false;
//生成任务成功
if (flag) {
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":专机生成任务成功");
requireSucess = true;
} else {
//如果都没有则调用mes接口申请入缓存线
//生成任务
//前往缓存线
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":分配任务缓存线");
}
return true;
}
public synchronized boolean finish_instruction() throws Exception {

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
@@ -243,6 +244,21 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
Instruction instruction = null;
List toInstructions;
if(!requireSucess){
Device device = deviceAppservice.findDeviceByCode(device_code);
Integer min_num = Integer.parseInt(device.getExtraValue().get("min_num")+"");
// TODO 是否需要手自动状态开启判断条件
if ( mode == 1 && storage_stock_num < min_num ) {
logServer.deviceLogToacs(this.device_code,"","",device_code+":requireSucess:" + requireSucess + "开始申请任务");
applyOutCacheLineTask();
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":requireSucess:" + requireSucess + "倒料位数量:"+storage_stock_num+"最小数量:"+min_num+ "申请任务失败,不符合条件");
}
} else {
logServer.deviceLogToacs(this.device_code,"","","是否请求成功requireSucess:"+requireSucess);
}
if(agvphase == 0x0B || agvphase == 0x0F )
{
if(error == 0 && ObjectUtil.isNotEmpty(inst)){
@@ -295,6 +311,64 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
}
}
public synchronized boolean applyOutCacheLineTask() throws Exception {
Boolean flag = false;
JSONObject json = new JSONObject();
json.put("device_code",device_code);
json.put("type","2");
HttpResponse httpResponse = acsToWmsService.applyOutCacheLineTask(json);
String body = httpResponse.body();
JSONObject jsonObject = JSONObject.parseObject(body);
String ext_task_id = jsonObject.getString("ext_task_id");
String task_code = jsonObject.getString("task_code");
String start_device_code = jsonObject.getString("start_device_code");
String put_device_code = jsonObject.getString("put_device_code");
String next_device_code = jsonObject.getString("next_device_code");
String task_type = jsonObject.getString("task_type");
TaskDto onedto = new TaskDto();
String now = DateUtil.now();
onedto.setTask_id(IdUtil.simpleUUID());
onedto.setQuantity(String.valueOf(full_number));
onedto.setCreate_by(this.getDevice().getDevice_code());
onedto.setUpdate_by(this.getDevice().getDevice_code());
onedto.setRoute_plan_code("normal");
String taskcode = CodeUtil.getNewCode("TASK_NO");
onedto.setTask_code("-" + taskcode);
onedto.setTask_status("0");
onedto.setPriority("101");
onedto.setAgv_system_type("1");
onedto.setTask_type(task_type);
onedto.setExt_task_id(ext_task_id);
onedto.setTask_id(IdUtil.simpleUUID());
onedto.setTask_code(task_code);
onedto.setStart_device_code(start_device_code);
onedto.setStart_point_code(start_device_code);
onedto.setPut_device_code(put_device_code);
onedto.setPut_point_code(put_device_code);
onedto.setNext_point_code(next_device_code);
onedto.setNext_device_code(next_device_code);
onedto.setUpdate_time(now);
onedto.setCreate_time(now);
try {
taskserver.create(onedto);
flag = true;
} catch (Exception e) {
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage()));
}
//生成任务成功
if (flag) {
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":专机生成任务成功");
requireSucess = true;
} else {
//如果都没有则调用mes接口申请入缓存线
//生成任务
//前往缓存线
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":分配任务缓存线");
}
return true;
}
protected void thingToNothing() {
log.debug("从有货到无货 清理数据");
this.setRequireSucess(false);

View File

@@ -80,4 +80,19 @@ public class AcsToWmsController {
public ResponseEntity<Object> feedbackOrderStatus(@RequestBody JSONObject param) {
return new ResponseEntity<>(acstowmsService.feedbackOrderStatus(param), HttpStatus.OK);
}
@PostMapping("/applyInCacheLineTask")
@Log("ACS申请缓存线入库任务")
@ApiOperation("ACS申请缓存线入库任务")
public ResponseEntity<Object> applyInCacheLineTask(@RequestBody JSONObject param) {
return new ResponseEntity<>(acstowmsService.applyInCacheLineTask(param), HttpStatus.OK);
}
@PostMapping("/applyOutCacheLineTask")
@Log("ACS系统申请出库任务")
@ApiOperation("ACS系统申请出库任务")
public ResponseEntity<Object> applyOutCacheLineTask(@RequestBody JSONObject param) {
return new ResponseEntity<>(acstowmsService.applyOutCacheLineTask(param), HttpStatus.OK);
}
}

View File

@@ -100,4 +100,20 @@ public interface AcsToWmsService {
* @return
*/
HttpResponse feedbackOrderStatus(JSONObject param);
/**
* ACS申请缓存线入库任务
*
* @param param
* @return
*/
HttpResponse applyInCacheLineTask(JSONObject param);
/**
* ACS系统申请出库任务
*
* @param param
* @return
*/
HttpResponse applyOutCacheLineTask(JSONObject param);
}

View File

@@ -439,7 +439,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
@Override
@Transactional(rollbackFor = Exception.class)
public HttpResponse feedbackOrderStatus(JSONObject param) {
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS).toString(), "1")) {
String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL);
@@ -466,7 +465,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
type = "error";
}
logServer.log(ext_order_id, "feedbackOrderStatus", type, param.toString(), result.body(), String.valueOf(result.getStatus()), url, status);
logServer.log(ext_order_id, "feedbackOrderStatus", type, param.toString(), result.body(), String.valueOf(result.getStatus()), url, "");
log.info("feedbackOrderStatus----返回参数{}", result);
} catch (Exception e) {
String msg = e.getMessage();
@@ -479,4 +478,70 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return null;
}
@Override
public HttpResponse applyInCacheLineTask(JSONObject param) {
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS).toString(), "1")) {
String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL);
// TODO 还没向地址表中添加 applyInCacheLineTask地址
AddressDto addressDto = addressService.findByCode("applyInCacheLineTask");
String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url;
HttpResponse result = null;
log.info("feedbackOrderStatus----请求参数{}", param);
try {
result = HttpRequest.post(url)
.body(String.valueOf(param))
.execute();
String type = "";
if (result.getStatus() == 200) {
type = "info";
} else {
type = "error";
}
logServer.log("", "applyInCacheLineTask", type, param.toString(), result.body(), String.valueOf(result.getStatus()), url, "");
log.info("applyInCacheLineTask----返回参数{}", result);
} catch (Exception e) {
String msg = e.getMessage();
//网络不通
System.out.println(msg);
}
return result;
}
return null;
}
@Override
public HttpResponse applyOutCacheLineTask(JSONObject param) {
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS).toString(), "1")) {
String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL);
// TODO 还没向地址表中添加 applyOutCacheLineTask
AddressDto addressDto = addressService.findByCode("applyOutCacheLineTask");
String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url;
HttpResponse result = null;
log.info("feedbackOrderStatus----请求参数{}", param);
try {
result = HttpRequest.post(url)
.body(String.valueOf(param))
.execute();
String type = "";
if (result.getStatus() == 200) {
type = "info";
} else {
type = "error";
}
logServer.log("", "applyOutCacheLineTask", type, param.toString(), result.body(), String.valueOf(result.getStatus()), url, "");
log.info("applyOutCacheLineTask----返回参数{}", result);
} catch (Exception e) {
String msg = e.getMessage();
//网络不通
System.out.println(msg);
}
return result;
}
return null;
}
}

View File

@@ -18,6 +18,7 @@ import org.nl.acs.config.server.AcsConfigService;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device.service.impl.DeviceServiceImpl;
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine.HailiangEngravingMachineDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver;
import org.nl.acs.device_driver.basedriver.lamp_three_color.LampThreecolorDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_conveyor_control.StandardCoveyorControlDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_plcscanner.StandardCoveyorControlWithPlcScannerDeviceDriver;
@@ -753,15 +754,19 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
}
if(deviceByCode.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver){
jo1.put("hasGoodStatus", "2");
jo1.put("material_type",startdevice.getMaterial_type());
} else if (deviceByCode.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver){
jo1.put("hasGoodStatus", "1");
jo1.put("material_type", "");
} else {
jo1.put("hasGoodStatus", "1");
}
jo1.put("material_type",startdevice.getMaterial_type());
}
jo1.put("quantity", startdevice.getQuantity());
jo1.put("remark", startdevice.getRemark());
jo1.put("batch", startdevice.getBatch());
jo1.put("vehicle_code", entity.getVehicle_code());
jo1.put("islock", "false");
jo1.put("islock", "0");
jo1.put("barrels_code", startdevice.getBarrels_code());
jo1.put("cooperate_code", startdevice.getCooperate_code());
jo1.put("powder_name", startdevice.getPowder_name());
@@ -775,7 +780,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
jo.put("quantity", "");
jo.put("remark", "");
jo.put("batch", "");
jo.put("islock", "false");
jo.put("islock", "0");
deviceService.changeDeviceStatus(jo);
JSONObject json = (JSONObject) JSONObject.toJSON(entity);

View File

@@ -18,6 +18,11 @@ public class TaskDto implements Serializable {
*/
private String task_id;
/**
* 任务外部标识
*/
private String ext_task_id;
/**
* 任务号
*/

View File

@@ -29,7 +29,7 @@ public class AutoCleanUpLogs {
public void run() throws Exception {
try {
WQLObject wo = WQLObject.getWQLObject("acs_device");
JSONArray array = wo.query().getResultJSONArray(0);
JSONArray array = wo.query("1=1","device_code").getResultJSONArray(0);
Date now = DateUtil.parse(DateUtil.now());
DateTime dateTime = DateUtil.offsetDay(now, -15);
String formatDateTime = DateUtil.formatDateTime(dateTime);
@@ -39,8 +39,8 @@ public class AutoCleanUpLogs {
JSONObject jsonObject = array.getJSONObject(i);
String device_code = jsonObject.getString("device_code");
mongoTemplate.remove(query,device_code);
System.out.println(device_code+"设备日志清除成功---------------------");
}
System.out.println("设备日志清除成功---------------------");
}
} catch (Exception e) {
e.printStackTrace();