add:lc接口

This commit is contained in:
2025-11-21 13:34:56 +08:00
parent 42adddcf6a
commit 393745202a
6 changed files with 180 additions and 15 deletions

View File

@@ -29,7 +29,7 @@ public class Init implements ApplicationRunner {
public void run(ApplicationArguments args) throws Exception {
// initTwoAttr(4,30,3,2, "2");
// createAttr();
// initTwoAttr2(9,11,3);
// initTwoAttr2(4,10,8);
}
@@ -66,33 +66,33 @@ public class Init implements ApplicationRunner {
col_num = "0" + i;
}
String struct_code = "B" + row + "-" + col_num + "-" + layer_num + "";
String struct_code = "L" + row + "-" + col_num + "-" + layer_num + "";
// 新增仓位
json.setSect_id("1945408460665524224");
json.setSect_code("ZC01");
json.setSect_name("主存");
json.setSect_id("1955103578733547520");
json.setSect_code("HG01");
json.setSect_name("合格");
json.setStor_id("1582991156504039424");
json.setStor_code("BA01");
json.setStor_name("北安仓库");
json.setStor_code("HC01");
json.setStor_name("焊材仓库");
json.setLock_type("0");
json.setRow_num(BigDecimal.valueOf(row_num));
json.setCol_num(BigDecimal.valueOf(i));
json.setLayer_num(BigDecimal.valueOf(j));
json.setBlock_num(BigDecimal.valueOf(1));
json.setBlock_num(BigDecimal.valueOf(2));
json.setStruct_code(struct_code);
json.setStruct_name(row + "" + col_num+ ""+ layer_num +"");
json.setSimple_name(json.getStruct_name());
// 长宽高
json.setZdepth(BigDecimal.valueOf(2700));
json.setWidth(BigDecimal.valueOf(1100));
json.setHeight(BigDecimal.valueOf(4000));
// 深浅货位
json.setPlacement_type("1");
// 载具类型
json.setStoragevehicle_type("3");
// 长宽高
json.setZdepth(BigDecimal.valueOf(0));
json.setWidth(BigDecimal.valueOf(0));
json.setHeight(BigDecimal.valueOf(0));
json.setCreate_id("1");
json.setCreate_name("管理员");

View File

@@ -0,0 +1,41 @@
package org.nl.wms.ext.controller;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.logging.annotation.Log;
import org.nl.wms.ext.service.LcToWmsService;
import org.springframework.beans.factory.annotation.Autowired;
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;
/**
* <p>
* 浪潮数据采集调用WMS 控制层
* </p>
*
* @author Liuxy
* @since 2025-11-07
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/lc")
@Slf4j
public class LcToWmsController {
@Autowired
private LcToWmsService lcToWmsService;
@PostMapping("/taskDataQuery")
@Log("出入库任务查询")
@SaIgnore
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(lcToWmsService.taskDataQuery(whereJson), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,27 @@
package org.nl.wms.ext.service;
import com.alibaba.fastjson.JSONObject;
import org.nl.wms.ext.service.util.LcResponse;
/**
* <p>
* 浪潮调用WMS 服务类
* </p>
*
* @author Liuxy
* @since 2025-11-07
*/
public interface LcToWmsService {
/**
* 出入库任务查询
* @param whereJson {
* task_status: 任务状态7-未完成4-执行中5-已完成)
* start_time: 开始时间
* end_time: 结束时间
* task_code: 任务编码
* }
* @return LcResponse
*/
LcResponse taskDataQuery(JSONObject whereJson);
}

View File

@@ -181,7 +181,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
AbstractTask task = taskFactory.getTask(taskDao.getConfig_code());
JSONObject resultWeigh = task.resultWeigh(taskDao);
//调用相机服务保存照片
// TODO HikvisionSnapshotUtil.sync截图(vehicleDao.getStoragevehicle_code(),taskDao.getTask_code());
HikvisionSnapshotUtil.sync截图(vehicleDao.getStoragevehicle_code(),taskDao.getTask_code());
log.info("ACS向WMS反馈重量返回参数--------------------------------------" + BaseResponse.responseOk(resultWeigh).toString());
return BaseResponse.responseOk(resultWeigh);
}

View File

@@ -0,0 +1,25 @@
package org.nl.wms.ext.service.impl;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.nl.wms.ext.service.LcToWmsService;
import org.nl.wms.ext.service.util.LcResponse;
import org.springframework.stereotype.Service;
/**
* <p>
* 浪潮调用WMS 实现类
* </p>
*
* @author Liuxy
* @since 2025-11-07
*/
@Service
@Slf4j
public class LcToWmsServiceImpl implements LcToWmsService {
@Override
public LcResponse taskDataQuery(JSONObject whereJson) {
return null;
}
}

View File

@@ -0,0 +1,72 @@
package org.nl.wms.ext.service.util;
import cn.hutool.http.HttpStatus;
import lombok.Builder;
import lombok.Data;
/**
* <p>
* 浪潮调用WMS 返回结果
* </p>
*
* @author Liuxy
* @since 2025-11-07
*/
@Data
@Builder
public class LcResponse<T> {
/**
* 状态码
*/
private Integer status;
/**
* 信息
*/
private String message;
/**
* 返回数据
*/
private T data;
/**
* 不带数据反馈
*
* @return ErpResponse
*/
public static LcResponse requestOk() {
return LcResponse.builder()
.status(HttpStatus.HTTP_OK)
.message("请求成功!")
.build();
}
/**
* 带数据反馈
*
* @return ErpResponse
*/
public static <T> LcResponse requestParamOk(T data) {
return LcResponse.builder()
.status(HttpStatus.HTTP_OK)
.message("请求成功!")
.data(data)
.build();
}
/**
* 报错信息反馈
*
* @return ErpResponse
*/
public static LcResponse requestError(String message) {
return LcResponse.builder()
.status(HttpStatus.HTTP_BAD_REQUEST)
.message(message)
.build();
}
}