|
|
|
@ -149,15 +149,35 @@ public class ZbFactoryDataServiceImpl implements IZbFactoryDataService {
|
|
|
|
|
return Resp.fail(400, "发车单信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//2023-09-30 00:20:00查询入库单对应的所有包件
|
|
|
|
|
// QueryWrapper<ZbOrderPackageEntity> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
|
// queryWrapper1.eq("receipt_id",receiptId);
|
|
|
|
|
// List<ZbOrderPackageEntity> details = orderPackageService.list(queryWrapper1);
|
|
|
|
|
|
|
|
|
|
//查询拼接body
|
|
|
|
|
JSONArray detailsArray = new JSONArray(); |
|
|
|
|
JSONObject detailObject = new JSONObject(); |
|
|
|
|
detailObject.put("lineNo",orderPackageEntity.getLineNo()); |
|
|
|
|
detailObject.put("packageCode",orderPackageEntity.getPackageCode()); |
|
|
|
|
detailObject.put("inventoryStatus","已入库"); |
|
|
|
|
detailObject.put("inventoryStatus",orderPackageEntity.getInventoryStatus()); |
|
|
|
|
detailObject.put("qty",orderPackageEntity.getPlanQty()); |
|
|
|
|
detailObject.put("scanFlag",1); |
|
|
|
|
JSONArray detailsArray = new JSONArray(); |
|
|
|
|
detailsArray.add(detailObject); |
|
|
|
|
// for(ZbOrderPackageEntity entity:details){
|
|
|
|
|
// String packageCode = entity.getPackageCode();
|
|
|
|
|
// if(unitNo.equals(packageCode)){
|
|
|
|
|
// entity.setRukuScanStatus(1);
|
|
|
|
|
// orderPackageService.updateById(entity);
|
|
|
|
|
// }
|
|
|
|
|
// JSONObject detailObject = new JSONObject();
|
|
|
|
|
// detailObject.put("lineNo",entity.getLineNo());
|
|
|
|
|
// detailObject.put("packageCode",packageCode);
|
|
|
|
|
// detailObject.put("inventoryStatus",entity.getInventoryStatus());
|
|
|
|
|
// detailObject.put("qty",entity.getPlanQty());
|
|
|
|
|
// detailObject.put("scanFlag",entity.getRukuScanStatus());
|
|
|
|
|
// detailsArray.add(detailObject);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
JSONObject result = new JSONObject(); |
|
|
|
|
result.put("taskCode",receiptEntity.getTaskCode()); |
|
|
|
|
result.put("companyCode",receiptEntity.getCompanyCode()); |
|
|
|
@ -165,6 +185,7 @@ public class ZbFactoryDataServiceImpl implements IZbFactoryDataService {
|
|
|
|
|
result.put("inWmsTime",operationTime); |
|
|
|
|
result.put("orderType",receiptEntity.getOrderType()); |
|
|
|
|
result.put("bizCode",CommonUtil.getUUID()); |
|
|
|
|
result.put("details",detailsArray); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
@ -181,15 +202,18 @@ public class ZbFactoryDataServiceImpl implements IZbFactoryDataService {
|
|
|
|
|
log.info("################### secretkey={}",zbFactoryProperties.getSecretkey()); |
|
|
|
|
log.info("################### signMethod={}","md5"); |
|
|
|
|
String body = result.toJSONString(); |
|
|
|
|
log.info(">################### 格式化之前 body={}",body); |
|
|
|
|
String s = body.replaceAll("\\s+", ""); |
|
|
|
|
log.info(">################### 格式化之后 body={}",s); |
|
|
|
|
String sign = QmSignUntil.signTopRequest(params, zbFactoryProperties.getSecretkey(), "md5", s); |
|
|
|
|
|
|
|
|
|
String url = getZbUrl(zbFactoryProperties.getUrl()+"/api/edi/ots/in?",params,sign); |
|
|
|
|
R r = sendZbFactoryData(url, s, 1, unitNo); |
|
|
|
|
log.info("################### url={}",url); |
|
|
|
|
R r = sendZbFactoryData(url, body, 1, unitNo); |
|
|
|
|
|
|
|
|
|
return r; |
|
|
|
|
}catch (Exception e){ |
|
|
|
|
log.error("#################handleStatusData: 推送失败",e); |
|
|
|
|
log.error("#################handleStatusData by zb: 推送失败 {}",e.getMessage()); |
|
|
|
|
return R.fail(500,"推送失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -206,7 +230,7 @@ public class ZbFactoryDataServiceImpl implements IZbFactoryDataService {
|
|
|
|
|
array[0] = key; |
|
|
|
|
array[1] = value; |
|
|
|
|
if (areNotEmpty(array)) { |
|
|
|
|
stringBuilder.append(key).append("=").append(value); |
|
|
|
|
stringBuilder.append(key).append("=").append(value).append("&"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
stringBuilder.append("sign=").append(sign); |
|
|
|
@ -259,9 +283,11 @@ public class ZbFactoryDataServiceImpl implements IZbFactoryDataService {
|
|
|
|
|
|
|
|
|
|
private R sendZbFactoryData(String url, String data, Integer type,String refCode) throws NoSuchAlgorithmException { |
|
|
|
|
|
|
|
|
|
log.info("##############sendZbFactoryData 发送数据: {}", data); |
|
|
|
|
|
|
|
|
|
//处理逻辑
|
|
|
|
|
log.info("##############sendZbFactoryData url: {}", url); |
|
|
|
|
log.info("##############sendZbFactoryData 发送数据: {}", data); |
|
|
|
|
|
|
|
|
|
String result = HttpRequest.post(url) |
|
|
|
|
.header("Content-Type", "application/json") |
|
|
|
|
.body(data).timeout(5 * 1000) |
|
|
|
|