add:acs同步接口:设备数量.缓存线位置关系

This commit is contained in:
zhangzhiqiang
2023-03-27 09:01:36 +08:00
parent ae1e6076b2
commit 78b3a3e16f
7 changed files with 78 additions and 12 deletions

View File

@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
@@ -74,8 +75,25 @@ public class AcsToWmsController {
@PostMapping("/feedDeviceQty")
@Log("向wms反馈设备实时数量")
@ApiOperation("向wms反馈设备实时数量")
public ResponseEntity<Object> feedDeviceRealQty(@RequestBody List<JSONObject> param) {
acsToWmsService.feedDevQty(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/feedcachelineVe")
@Log("向wms反馈缓存载具信息")
@ApiOperation("向wms反馈缓存载具信息")
public ResponseEntity<Object> feedcachelineVe(@RequestBody JSONObject param) {
acsToWmsService.feedcachelineVe(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/feedOrderRealQty")
@Log("向wms反订单实施数量")
@Log("向wms反实施数量")
@ApiOperation("向wms反订单实施数量")
public ResponseEntity<Object> feedOrderRealQty(@RequestBody String string) {
return new ResponseEntity<>(acsToWmsService.feedOrderRealQty(string), HttpStatus.OK);

View File

@@ -2,6 +2,7 @@ package org.nl.wms.ext.acs.service;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
import java.util.Map;
public interface AcsToWmsService {
@@ -49,11 +50,17 @@ public interface AcsToWmsService {
/**
* ACS给WMS下发工单强制完成状态
* @param string
* @return
*/
Map<String, Object> orderStatus(JSONObject param);
/**
* 设备实时数量
* @param param
* @return
*/
void feedDevQty(List<JSONObject> param);
/**
* ACS给WMS反馈设备状态状态
* @param string
@@ -61,6 +68,13 @@ public interface AcsToWmsService {
*/
Map<String, Object> feedDeviceStatusType(String string);
/**
* acs反馈缓存线载具对应关系
* 缓存线变化时候全部反馈
* @param param{""cacheline_code":"xxx","param":"01_zj001,02_zj002,...""}
*/
void feedcachelineVe(JSONObject param);
/**
* ACS给WMS反馈订单实时数量
* @param string

View File

@@ -9,13 +9,14 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.anno.Log;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.enums.AcsTaskEnum;
import org.nl.common.utils.MapOf;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.pda.service.CacheLineHandService;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.service.TaskService;
import org.nl.wms.sch.service.dto.TaskDto;
@@ -23,19 +24,21 @@ import org.nl.wms.sch.service.dto.TaskDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@RequiredArgsConstructor
@Slf4j
public class AcsToWmsServiceImpl implements AcsToWmsService {
@Autowired
private TaskService taskService;
@Autowired
private AgvInstService agvInstService;
private final TaskService taskService;
private final AgvInstService agvInstService;
private final CacheLineHandService cacheLineHandService;
@Override
public Map<String, Object> apply(JSONObject jsonObject) {
@@ -243,6 +246,37 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return result;
}
@Override
public void feedDevQty(List<JSONObject> param) {
WQLObject deviceTab = WQLObject.getWQLObject("pdm_bi_device");
if (CollectionUtils.isEmpty(param)){
return;
}
for (JSONObject item : param) {
String deviceCode = item.getString("device_code");
String qty = item.getString("qty");
deviceTab.update(MapOf.of("deviceinstor_qty",qty),"device_code = '"+deviceCode+"'");
}
}
@Override
public void feedcachelineVe(JSONObject param) {
WQLObject positionTab = WQLObject.getWQLObject("sch_cacheline_position");
//{""cacheline_code":"xxx","param":"01_zj001,02_zj002,...""}
if (param == null|| StringUtils.isEmpty(param.getString("cacheline_code")) || StringUtils.isEmpty(param.getString("param"))){
return;
}
String cachelineCode = param.getString("cacheline_code");
String cacheVehicle = param.getString("param");
String[] collect = cacheVehicle.split(",");
for (String positionVehicle : collect) {
String[] s = positionVehicle.split("_");
positionTab.update(MapOf.of("position_code",s[0],"Vehicle_code",s[1]),"cacheline_code = '"+cachelineCode+"'");
}
//更新缓存线及缓存线载具表对应关系
cacheLineHandService.cacheLineMaterSync();
}
@Override
public Map<String, Object> feedOrderRealQty(String string) {
JSONObject result = new JSONObject();

View File

@@ -220,9 +220,9 @@ public class ProduceWorkorderServiceImpl implements ProduceWorkorderService {
if (param == null || param.size()==0){
return;
}
String sql = param.stream().collect(Collectors.joining("','"));
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String sql = param.stream().collect(Collectors.joining("','"));
WQLObject wo = WQLObject.getWQLObject("PDM_produce_workOrder");
wo.update(MapOf.of("workorder_status", WorkerOrderEnum.SEND.getCode()
,"update_id", currentUserId,"update_name"

View File

@@ -106,7 +106,7 @@ public class CacheLineHandController{
@ApiOperation("缓存线物料盘点")
public CommonResult<JSONArray> cacheLineMaterCheck(@RequestBody JSONObject param) {
log.info("海亮缓存线手持服务 [缓存线物料盘点] 接口被请求, 请求参数-{}", param);
return RestBusinessTemplate.execute(cacheLineHandService::cacheLineMaterCheck);
return null;
}
@PostMapping("/instOperation")

View File

@@ -107,12 +107,12 @@ public interface CacheLineHandService{
Map<String,Object> instPageQuery(Map<String,String> param, Pageable page);
/**
* 缓存线盘点
* 缓存线位置关系同步
*
* @author gbx
* @date 2023/3/24
*/
JSONArray cacheLineMaterCheck();
JSONArray cacheLineMaterSync(JSONObject );
/**
* 缓存线料箱条码查询料箱信息

View File

@@ -168,7 +168,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
}
@Override
public JSONArray cacheLineMaterCheck() {
public JSONArray cacheLineMaterSync() {
WQLObject positionTab = WQLObject.getWQLObject("sch_cacheline_position");
JSONArray positionArr = positionTab.query("is_delete = '0'").getResultJSONArray(0);
// 缓存线位置表