18188916393
2 years ago
6 changed files with 56 additions and 4 deletions
@ -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); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
Binary file not shown.
Loading…
Reference in new issue