Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhangzhiqiang
2023-05-22 16:58:53 +08:00
7 changed files with 524 additions and 17 deletions

View File

@@ -57,4 +57,11 @@ public interface WmsToAcsService {
* @return
*/
Map<String, Object> replaceDevice(JSONArray arr);
/**
* 变更设备电气信号
* @param arr
* @return
*/
Map<String, Object> action(JSONArray arr);
}

View File

@@ -97,4 +97,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService{
return AcsUtil.notifyAcs(api, arr);
}
@Override
public Map<String, Object> action(JSONArray arr) {
String api = "api/wms/action";
return AcsUtil.notifyAcs(api, arr);
}
}

View File

@@ -240,6 +240,15 @@ public class CacheLineHandController {
return new ResponseEntity<>(cacheLineHandService.deleteBox(param), HttpStatus.OK);
}
@PostMapping("/check")
@Log("修改缓存线盘点状态")
@ApiOperation("修改缓存线盘点状态")
public ResponseEntity<Object> check(@RequestBody JSONObject param) {
log.info("海亮缓存线手持服务 [盘点] 接口被请求, 请求参数-{}", param);
cacheLineHandService.check(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/agvInBoxExceptionQuery")
@Log("AGV入箱异常-查询")
@ApiOperation("AGV入箱异常-查询")

View File

@@ -251,7 +251,7 @@ public interface CacheLineHandService{
* @author gbx
* @date 2023/3/24
*/
CommonResult<JSONObject> cacheLineExcepOpt(JSONObject param);
JSONObject cacheLineExcepOpt(JSONObject param);
/**
* 倒料操作
@@ -292,4 +292,11 @@ public interface CacheLineHandService{
* @param param
*/
JSONObject deleteBox(JSONObject param);
/**
* 删除箱子
*
* @param param
*/
void check(JSONObject param);
}

View File

@@ -692,27 +692,19 @@ public class CacheLineHandServiceImpl implements CacheLineHandService {
*/
@Override
@Transactional(rollbackFor = Exception.class)
public CommonResult<JSONObject> cacheLineExcepOpt(JSONObject param) {
public JSONObject cacheLineExcepOpt(JSONObject param) {
// 缓存线编码
String wcsdevice_code = param.getString("wcsdevice_code");
// opt_type 1-暂停、2-启动,默认为1暂停
String type = StatusEnum.PAUSE_CACHELINE.getCode();
String opt_type = param.getString("opt_type");
if (StatusEnum.START_CACHELINE.getCode().equals(opt_type)) {
type = "0";
}
JSONArray jsonArray = new JSONArray();
JSONObject jsonObject = new JSONObject();
//下发接收的恢复是0暂停是1
jsonObject.put("type", type);
jsonObject.put("type", opt_type);
//缓存线编码
jsonObject.put("wcsdevice_code", wcsdevice_code);
jsonArray.add(jsonObject);
try {
return RestBusinessTemplate.execute(() -> AcsUtil.notifyAcs("api/wms/puaseCacheLine", jsonArray));
} catch (NullPointerException e) {
throw new BadRequestException(e.toString());
}
jsonObject.put("device_code", wcsdevice_code);
AcsUtil.notifyAcs("api/wms/puaseCacheLine", jsonObject);
JSONObject result = new JSONObject();
result.put("message", "操作成功!");
return result;
}
/**
@@ -895,4 +887,31 @@ public class CacheLineHandServiceImpl implements CacheLineHandService {
}
return res;
}
@Override
public void check(JSONObject param) {
String option = param.getString("option");
if (StrUtil.isEmpty(option)) {
throw new BadRequestException("缺少关键参数option");
}
String device_code = param.getString("device_code");
String code = "";
if (option.equals("0")) {
code = "to_start_checking";
}
if (option.equals("1")) {
code = "to_check_finish";
}
String value = "1";
JSONObject jo = new JSONObject();
jo.put("device_code", device_code);
jo.put("code", code);
jo.put("value", value);
JSONArray ja = new JSONArray();
ja.add(jo);
wmsToAcsService.action(ja);
}
}

View File

@@ -30,6 +30,6 @@
</if>
</where>
ORDER BY
scp.cacheline_code, scp.layer_num, scp.positionorder_no, scp.cache_line_no
scp.cacheline_code, scp.layer_num desc, scp.positionorder_no, scp.cache_line_no
</select>
</mapper>