Browse Source

修改送空托盘的逻辑,增加跟acs交互的接口

master
18188916393 2 years ago
parent
commit
695a50f416
  1. 33
      wms/hd/nladmin-system/src/main/java/org/nl/wms/common/PointUpdateUtil.java
  2. 8
      wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java
  3. 6
      wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java
  4. 10
      wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java
  5. 3
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java
  6. BIN
      wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls

33
wms/hd/nladmin-system/src/main/java/org/nl/wms/common/PointUpdateUtil.java

@ -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);
}
}
}

8
wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java

@ -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);
}
}

6
wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java

@ -40,6 +40,12 @@ public interface WmsToAcsService {
* @return
*/
Map<String, Object> action(JSONArray arr);
/**
* 下发动作信号
* @param arr
* @return
*/
Map<String, Object> queryPointStatus(JSONArray arr);
}

10
wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java

@ -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);
}
}

3
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java

@ -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:

BIN
wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls

Binary file not shown.
Loading…
Cancel
Save