rev:修改了日志获取IP和登录端

This commit is contained in:
2023-08-21 15:24:18 +08:00
parent 4a0e519617
commit 1240aae17b
12 changed files with 84 additions and 12 deletions

View File

@@ -100,6 +100,9 @@ public class DeviceStatusServiceImpl implements DeviceStatusService {
try {
if (!jo.containsKey("need_update_flag")){
JSONArray rows = jo.getJSONArray("upload_user");
if (ObjectUtil.isEmpty(rows)){
rows = new JSONArray();
}
HashMap<String,String> map = new HashMap<>();
String msg = "";
for (int i = 0; i < rows.size(); i++) {

View File

@@ -808,6 +808,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
public JSONObject sendDeviceStatus(JSONObject whereJson) {
log.info("sendDeviceStatus--------------输入为:"+whereJson.toString());
WQLObject wo = WQLObject.getWQLObject("em_bi_devicestatus");
String device_code = whereJson.getString("device_code");
String device_name = whereJson.getString("device_name");

View File

@@ -0,0 +1,32 @@
package org.nl.wms.ext.szls.rest;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.logging.annotation.Log;
import org.nl.wms.ext.szls.service.LmsToBigScreenService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequiredArgsConstructor
@Api(tags = "lms发送数字孪生")
@RequestMapping("/api/szls")
@Slf4j
public class LmsToBigScreenController {
private final LmsToBigScreenService LmsToBigScreenService;
@PostMapping("/getDeviceInfo")
@Log("数字孪生请求LMS获取设备信息")
@ApiOperation("数字孪生请求LMS获取设备信息")
public ResponseEntity<Object> getDeviceInfo(@RequestBody JSONObject jo) {
return new ResponseEntity<>(LmsToBigScreenService.getDeviceInfo(jo), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,8 @@
package org.nl.wms.ext.szls.service;
import com.alibaba.fastjson.JSONObject;
public interface LmsToBigScreenService {
JSONObject getDeviceInfo(JSONObject jo);
}

View File

@@ -0,0 +1,27 @@
package org.nl.wms.ext.szls.service.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.nl.wms.ext.szls.service.LmsToBigScreenService;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
@Service
@RequiredArgsConstructor
@Slf4j
public class LmsToBigScreenServiceImpl implements LmsToBigScreenService {
@Override
public JSONObject getDeviceInfo(JSONObject jo) {
return null;
}
}

View File

@@ -25,9 +25,9 @@ public class AutoQueryBillInfo {
String nofity_day = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("NOFITY_DAY").getValue();
JSONArray send_rows = new JSONArray();
if (Integer.parseInt(nofity_day) == 0) {
send_rows = wo.query("bill_type = '1001' AND bill_status = '99' AND stor_code = 'CP01' AND upload_sap = '0' AND is_delete = '0' AND (IFNULL(carno,'') = '' OR IFNULL(trans_code,'') = '' OR IFNULL(estimated_freight,'') = '' OR IFNULL(order_number,'') = '' OR IFNULL(car_type,'') = '')").getResultJSONArray(0);
send_rows = wo.query("bill_type = '1001' AND bill_status = '99' AND stor_code = 'AC01' AND upload_sap = '0' AND is_delete = '0' AND (IFNULL(carno,'') = '' OR IFNULL(trans_code,'') = '' OR IFNULL(estimated_freight,'') = '' OR IFNULL(order_number,'') = '' OR IFNULL(car_type,'') = '')").getResultJSONArray(0);
} else {
send_rows = wo.query("bill_type = '1001' AND bill_status = '99' AND stor_code = 'CP01' AND upload_sap = '0' AND is_delete = '0' AND (IFNULL(carno,'') = '' OR IFNULL(trans_code,'') = '' OR IFNULL(estimated_freight,'') = '' OR IFNULL(order_number,'') = '' OR IFNULL(car_type,'') = '') AND TIMESTAMPDIFF(DAY,confirm_time,NOW()) = " + nofity_day).getResultJSONArray(0);
send_rows = wo.query("bill_type = '1001' AND bill_status = '99' AND stor_code = 'AC01' AND upload_sap = '0' AND is_delete = '0' AND (IFNULL(carno,'') = '' OR IFNULL(trans_code,'') = '' OR IFNULL(estimated_freight,'') = '' OR IFNULL(order_number,'') = '' OR IFNULL(car_type,'') = '') AND TIMESTAMPDIFF(DAY,confirm_time,NOW()) = " + nofity_day).getResultJSONArray(0);
}
this.sendInfo(send_rows);
}

View File

@@ -22,7 +22,7 @@ public class AutoQueryUpload {
public void run() {
//查询已经处于分配中、分配完但还未回传给MES的销售出库单
WQLObject wo = WQLObject.getWQLObject("st_ivt_iostorinv");
JSONArray send_rows = wo.query("mst.bill_type = '1001' AND mst.bill_status IN ( '30', '40' ) AND mst.stor_code = 'CP01' AND upload_mes = '0' AND is_delete = '0'").getResultJSONArray(0);
JSONArray send_rows = wo.query("bill_type = '1001' AND bill_status IN ( '30', '40' ) AND stor_code = 'AC01' AND upload_mes = '0' AND is_delete = '0'").getResultJSONArray(0);
this.sendInfo(send_rows);
}
@@ -64,7 +64,7 @@ public class AutoQueryUpload {
String resultMsg = HttpRequest.post(url)
.body(String.valueOf(jo))
.execute().body();
log.info("飞书输入参数为:-------------------" + jo);
log.info(" " + jo);
log.info("飞书输出参数为:-------------------" + resultMsg);
HashMap<String, String> map = new HashMap<>();
map.put("is_upload", "1");

View File

@@ -85,7 +85,7 @@
find_in_set( task.task_status, 输入.task_status)
ENDOPTION
OPTION 输入.vehicle_code <> ""
(task.vehicle_code like 输入.vehicle_code)
(task.vehicle_code like 输入.vehicle_code OR task.material_code like 输入.vehicle_code OR task.vehicle_code2 like 输入.vehicle_code)
ENDOPTION
OPTION 输入.task_code <> ""
(task.task_code like 输入.task_code)