|
|
@@ -5,6 +5,7 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import cn.hutool.core.thread.ThreadUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSONArray;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
@@ -113,7 +114,7 @@ public class TblBagController extends BaseController {
|
|
|
if(((JSONObject)item2).getStr("type").equals("cabinet")){
|
|
|
((JSONObject) item2).put("location",item.getDictValue());
|
|
|
cabinetMap.put( item.getDictLabel(),(JSONObject)item2);
|
|
|
- cabinetMap2.put(((JSONObject) item2).getStr("cabinetType"),(JSONObject)item2);
|
|
|
+ cabinetMap2.put(((JSONObject) item2).getStr("wdcode"),(JSONObject)item2);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -124,6 +125,28 @@ public class TblBagController extends BaseController {
|
|
|
TblBagBo bo1 =new TblBagBo();
|
|
|
bo1.getParams().put("remark","");
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ if(cabinetMap!=null && cabinetMap.size()>0) {
|
|
|
+ ThreadUtil.execAsync(()->{
|
|
|
+ try {
|
|
|
+ List<JSONObject> cabinetList = new ArrayList<>();
|
|
|
+ cabinetMap.keySet().forEach(i->{
|
|
|
+ JSONObject c = cabinetMap.get(i);
|
|
|
+ if(c.getStr("location")!=null&&c.getStr("wdcode")!=null){
|
|
|
+ c.put("deviceId", c.getStr("code"));
|
|
|
+ c.put("stationId", c.getStr("wdcode"));
|
|
|
+ c.put("deviceType", "cabinet");
|
|
|
+ cabinetList.add(c);
|
|
|
+ }
|
|
|
+ } );
|
|
|
+
|
|
|
+ SPlatUtils.SysDevice(cabinetList);
|
|
|
+ }catch (Exception e){
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("remark","");
|
|
|
queryWrapper.in("id", ids);
|
|
|
@@ -134,7 +157,7 @@ public class TblBagController extends BaseController {
|
|
|
bagList.forEach(item->{
|
|
|
if(cabinetMap2.containsKey(item.getDeviceId().toString())){
|
|
|
JSONObject json = new JSONObject();
|
|
|
- json.put("deviceId",item.getDeviceId());
|
|
|
+ json.put("deviceId" ,cabinetMap2.get(item.getDeviceId()).getStr("code"));
|
|
|
json.put("cpCode",item.getCpCode());
|
|
|
json.put("waybillNo",item.getWaybillNo());
|
|
|
json.put("scTime",item.getScTime());
|
|
|
@@ -153,8 +176,9 @@ public class TblBagController extends BaseController {
|
|
|
BeanUtils.copyProperties(item, item1);
|
|
|
SpringUtils.getBean(ITblBagService.class).updateByBo(item1);
|
|
|
});
|
|
|
+ return R.ok();
|
|
|
}
|
|
|
}
|
|
|
- return R.ok();
|
|
|
+ return R.fail("同步失败");
|
|
|
}
|
|
|
}
|