修改送空托盘的逻辑,增加跟acs交互的接口
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package org.nl.wms.common;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
|
||||
public class PointUpdateUtil {
|
||||
public static void updatePoint(JSONArray arr) {
|
||||
WmsToAcsServiceImpl wmsToAcsServiceImpl = new WmsToAcsServiceImpl();
|
||||
String isConnect = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("IS_CONNECT_ACS").getValue();
|
||||
if (StrUtil.equals("0", isConnect)) {
|
||||
return;
|
||||
}
|
||||
JSONObject joo = wmsToAcsServiceImpl.queryPointStatus(arr);
|
||||
JSONArray pointarr = joo.getJSONArray("data");
|
||||
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
|
||||
for (int i = 0; i < pointarr.size(); i++) {
|
||||
JSONObject pointjo = pointarr.getJSONObject(i);
|
||||
String point_status = "0" + pointjo.getString("move");
|
||||
String device_code = pointjo.getString("device_code");
|
||||
pointjo.put("point_status", point_status);
|
||||
JSONObject pointObj = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0);
|
||||
pointObj.put("point_status", point_status);
|
||||
pointTable.update(pointObj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -64,5 +64,13 @@ public class WmsToAcsController {
|
||||
return new ResponseEntity<>(wmsToAcsService.action(arr), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryPointStatus")
|
||||
@Log("查询点位状态")
|
||||
@ApiOperation("查询点位状态")
|
||||
public ResponseEntity<Object> queryPointStatus(@RequestBody Map whereJson) {
|
||||
JSONArray arr = JSONArray.parseArray(JSON.toJSONString(whereJson.get("data")));
|
||||
return new ResponseEntity<>(wmsToAcsService.queryPointStatus(arr), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -40,6 +40,12 @@ public interface WmsToAcsService {
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> action(JSONArray arr);
|
||||
/**
|
||||
* 下发动作信号
|
||||
* @param arr
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> queryPointStatus(JSONArray arr);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -40,9 +40,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
return AcsUtil.notifyAcs(api, arr);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String format = DateUtil.format(new Date(), "yyyy-MM-dd");
|
||||
System.out.println(format);
|
||||
@Override
|
||||
public JSONObject queryPointStatus(JSONArray arr) {
|
||||
String api = "api/wms/querydevice";
|
||||
return AcsUtil.notifyAcs(api, arr);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -212,7 +212,8 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
|
||||
// 压制工序
|
||||
case YZGX:
|
||||
vehicle_type = VehicleTypeEnum.GTP.getCode();
|
||||
start_area = AreaEnum.CYHJ.getCode();
|
||||
start_area = AreaEnum.KGTDDQ.getCode();
|
||||
|
||||
break;
|
||||
//烧制工序
|
||||
case SZGX:
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user