fix:回传MES修改
This commit is contained in:
@@ -234,8 +234,14 @@ public class AutoSendZxToDjw {
|
||||
updateWrapper.eq("container_name", packagerelationList.get(0).getContainer_name());
|
||||
pdmBiSubpackagerelationMapper.update(null, updateWrapper);
|
||||
//推送MES
|
||||
JSONArray containerJsonArray = packagerelationList.stream().map(PdmBiSubpackagerelation::getContainer_name).collect(Collectors.toCollection(JSONArray::new));
|
||||
param.put("rows", containerJsonArray);
|
||||
JSONArray rows = new JSONArray();
|
||||
for (int i = 0; i < packagerelationList.size(); i++) {
|
||||
PdmBiSubpackagerelation sub = packagerelationList.get(i);
|
||||
JSONObject row = new JSONObject();
|
||||
row.put("ContainerName", sub.getContainer_name());
|
||||
rows.add(row);
|
||||
}
|
||||
param.put("rows", rows);
|
||||
param.put("num", packagerelationList.size());
|
||||
param.put("box_no", packagerelationList.get(0).getPackage_box_sn());
|
||||
param.put("box_weight", totalWeight);
|
||||
|
||||
@@ -6,9 +6,13 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
@@ -32,6 +36,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
@Autowired
|
||||
private IBstIvtBoxinfoService bstIvtBoxinfoService;
|
||||
|
||||
|
||||
/**
|
||||
* LMS的PDA操作AGV下卷,AGV称重完成后AGV称重信息发送MES
|
||||
*
|
||||
@@ -905,7 +910,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL2").getValue();
|
||||
String api = "CamstarApi/momBoxPackageSubmit";
|
||||
url = url + api;
|
||||
|
||||
@@ -923,6 +928,16 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
.body(String.valueOf(param))
|
||||
.execute().body();
|
||||
result = JSONObject.parseObject(resultMsg);
|
||||
IpdmBiSubpackagerelationService subpackagerelationService = SpringContextHolder.getBean(IpdmBiSubpackagerelationService.class);
|
||||
JSONArray array = result.getJSONArray("RTDAT");
|
||||
if (ObjectUtil.isNotEmpty(array)) {
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject row = array.getJSONObject(i);
|
||||
String ContainerName = row.getString("ContainerName");
|
||||
String AttributeValue = row.getString("AttributeValue");
|
||||
subpackagerelationService.update(new LambdaUpdateWrapper<PdmBiSubpackagerelation>().set(PdmBiSubpackagerelation::getNet_weight, AttributeValue).eq(PdmBiSubpackagerelation::getContainer_name, ContainerName));
|
||||
}
|
||||
}
|
||||
log.info("momBoxPackageSubmit接口输出参数为:-------------------" + result.toString());
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user