Merge branch 'master' into master_merge
# Conflicts: # lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java # lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java # lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java
This commit is contained in:
@@ -296,7 +296,7 @@ public class StructivtServiceImpl implements StructivtService {
|
||||
mp.put("客户名称", json.getString("customer_description"));
|
||||
mp.put("销售订单", json.getString("sale_order_name"));
|
||||
mp.put("业务员", json.getString("sales_owner"));
|
||||
mp.put("入库日期", json.getString("instorage_time"));
|
||||
mp.put("入库日期", json.getString("confirm_time"));
|
||||
mp.put("生产日期", json.getString("date_of_production"));
|
||||
if ("1".equals(json.getString("sub_type"))) {
|
||||
mp.put("子卷状态", "正常");
|
||||
@@ -312,6 +312,7 @@ public class StructivtServiceImpl implements StructivtService {
|
||||
mp.put("净重", json.getString("net_weight"));
|
||||
mp.put("毛重", json.getString("box_weight"));
|
||||
mp.put("长度", json.getString("length"));
|
||||
mp.put("接头数", json.getString("joint_type"));
|
||||
mp.put("计划外分切的子卷", json.getString("is_un_plan_production"));
|
||||
mp.put("子卷的物性值1", json.getString("un_plan_product_property1"));
|
||||
mp.put("子卷的物性值2", json.getString("un_plan_product_property2"));
|
||||
|
||||
@@ -90,7 +90,9 @@
|
||||
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '90' THEN '3'
|
||||
END
|
||||
END AS sub_type,
|
||||
DATEDIFF( NOW(), sub.date_of_production ) AS stock_age
|
||||
DATEDIFF( NOW(), sub.date_of_production ) AS stock_age,
|
||||
sub.joint_type,
|
||||
dis.confirm_time
|
||||
|
||||
FROM
|
||||
ST_IVT_StructIvt ivt
|
||||
@@ -114,6 +116,20 @@
|
||||
WHERE
|
||||
plan1.is_delete = '0'
|
||||
GROUP BY container_name) plan ON plan.container_name = sub.container_name
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
MIN( mst.confirm_time ) AS confirm_time,
|
||||
dis.pcsn
|
||||
FROM
|
||||
st_ivt_iostorinvdis dis
|
||||
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
WHERE
|
||||
mst.io_type = '0'
|
||||
AND mst.bill_type = '0001'
|
||||
AND mst.is_delete = '0'
|
||||
GROUP BY
|
||||
dis.pcsn
|
||||
) dis ON dis.pcsn = ivt.pcsn
|
||||
|
||||
WHERE
|
||||
1 = 1
|
||||
@@ -243,7 +259,9 @@
|
||||
WHEN DATEDIFF( NOW(), sub.date_of_production ) <= '90' THEN '1'
|
||||
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '90' THEN '3'
|
||||
END AS sub_type,
|
||||
DATEDIFF( NOW(), ivt.instorage_time ) AS stock_age
|
||||
DATEDIFF( NOW(), ivt.instorage_time ) AS stock_age,
|
||||
sub.joint_type,
|
||||
dis.confirm_time
|
||||
FROM
|
||||
ST_IVT_StructIvt ivt
|
||||
LEFT JOIN st_ivt_structattr attr ON ivt.struct_id = attr.struct_id
|
||||
@@ -267,6 +285,20 @@
|
||||
WHERE
|
||||
plan1.is_delete = '0'
|
||||
GROUP BY container_name) plan ON plan.container_name = sub.container_name
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
MIN( mst.confirm_time ) AS confirm_time,
|
||||
dis.pcsn
|
||||
FROM
|
||||
st_ivt_iostorinvdis dis
|
||||
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
WHERE
|
||||
mst.io_type = '0'
|
||||
AND mst.bill_type = '0001'
|
||||
AND mst.is_delete = '0'
|
||||
GROUP BY
|
||||
dis.pcsn
|
||||
) dis ON dis.pcsn = ivt.pcsn
|
||||
WHERE
|
||||
1 = 1
|
||||
and attr.stor_id in 输入.in_stor_id
|
||||
|
||||
@@ -140,5 +140,9 @@ public class WmsToAcsController {
|
||||
return new ResponseEntity<>(wmsToAcsService.getTubeMsg(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/queryBoxWeigh")
|
||||
@Log(value = "查询木箱毛重", isInterfaceLog = true, interfaceLogType = InterfaceLogType.LMS_TO_ACS)
|
||||
public ResponseEntity<Object> querydeviceOne(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(wmsToAcsService.queryBoxWeigh(jo), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,6 +147,10 @@ public interface WmsToAcsService {
|
||||
|
||||
JSONObject getTubeMsg(JSONObject jo);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询木箱重量
|
||||
* @param jo 、
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject queryBoxWeigh(JSONObject jo);
|
||||
}
|
||||
|
||||
@@ -474,4 +474,47 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
arr.add(whereJson);
|
||||
return AcsUtil.notifyAcs(api, arr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject queryBoxWeigh(JSONObject jo) {
|
||||
String api = "api/wms/querydevice";
|
||||
//判断是否连接ACS系统
|
||||
String isConnect = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_connect_acs").getValue();
|
||||
JSONObject result = new JSONObject();
|
||||
if (StrUtil.equals("0", isConnect)) {
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "查询失败,未连接ACS!");
|
||||
result.put("data", new JSONArray());
|
||||
return result;
|
||||
}
|
||||
|
||||
String product_area = "LK";
|
||||
|
||||
String acs_url = URLEnum.find(product_area);
|
||||
if (StrUtil.isEmpty(acs_url)) {
|
||||
log.info(product_area);
|
||||
throw new BadRequestException("未查询到区域对应的acs地址!");
|
||||
}
|
||||
|
||||
String url = acs_url + api;
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(String.valueOf(jo.getJSONArray("data")))
|
||||
.execute().body();
|
||||
result = JSONObject.parseObject(resultMsg);
|
||||
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
//网络不通
|
||||
System.out.println(msg);
|
||||
result.put("status", HttpStatus.BAD_REQUEST);
|
||||
result.put("message", "网络不通,操作失败!");
|
||||
result.put("data", new JSONArray());
|
||||
}
|
||||
//acs抛异常这里
|
||||
if (!StrUtil.equals(result.getString("status"), "200")) {
|
||||
throw new BadRequestException("操作失败:" + result.getString("message"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,12 @@ public class ProductInstorController {
|
||||
return new ResponseEntity<>(productInstorService.boxQuery(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/weighCheck")
|
||||
@Log("称重校验")
|
||||
public ResponseEntity<Object> weighCheck(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(productInstorService.weighCheck(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("手持生产入库确认")
|
||||
|
||||
|
||||
@@ -22,4 +22,6 @@ public interface ProductInstorService {
|
||||
JSONObject bale(JSONObject whereJson);
|
||||
|
||||
JSONObject abnormalOut(JSONObject whereJson);
|
||||
|
||||
JSONObject weighCheck(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ public class PrintServiceImpl implements PrintService {
|
||||
+ box_jo.getString("customer_description") + ","
|
||||
+ box_jo.getString("thickness") + ","
|
||||
+ box_jo.getString("mass_per_unit_area") + ","
|
||||
+ box_jo.getString("length") + ","
|
||||
+ NumberUtil.round(box_jo.getString("length"), 2) + ","
|
||||
+ box_jo.getString("box_type") + ","
|
||||
+ box_jo.getString("sap_pcsn") + ","
|
||||
+ box_jo.getString("box_length") + ","
|
||||
@@ -295,7 +295,7 @@ public class PrintServiceImpl implements PrintService {
|
||||
+ box_jo.getString("customer_description") + ","
|
||||
+ box_jo.getString("thickness") + ","
|
||||
+ box_jo.getString("mass_per_unit_area") + ","
|
||||
+ box_jo.getString("length") + ","
|
||||
+ NumberUtil.round(box_jo.getString("length"), 2) + ","
|
||||
+ box_jo.getString("box_type") + ","
|
||||
+ box_jo.getString("sap_pcsn") + ","
|
||||
+ box_jo.getString("box_length") + ","
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.pda.st.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -17,6 +18,7 @@ import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.ext.acs.service.impl.AcsToWmsServiceImpl;
|
||||
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||
import org.nl.wms.pda.st.service.ProductInstorService;
|
||||
@@ -55,6 +57,8 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
|
||||
private final RedissonClient redissonClient;
|
||||
|
||||
private final WmsToAcsService wmsToAcsService;
|
||||
|
||||
@Override
|
||||
public JSONObject boxQuery(JSONObject whereJson) {
|
||||
String box_no = whereJson.getString("box_no");
|
||||
@@ -540,4 +544,49 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject weighCheck(JSONObject whereJson) {
|
||||
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
|
||||
JSONObject jo = new JSONObject();
|
||||
|
||||
String point_code = whereJson.getString("point_code");
|
||||
String box_no = whereJson.getString("box_no");
|
||||
|
||||
if (ObjectUtil.isEmpty(point_code)) {
|
||||
throw new BadRequestException("点位不能为空!");
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(box_no)) {
|
||||
throw new BadRequestException("木箱号不能为空!");
|
||||
}
|
||||
|
||||
// 组织数据
|
||||
JSONArray paramArr = new JSONArray();
|
||||
JSONObject paramJson = new JSONObject();
|
||||
paramJson.put("device_code", point_code);
|
||||
paramArr.add(paramJson);
|
||||
|
||||
// 调用接口
|
||||
whereJson.put("data", paramArr);
|
||||
JSONObject jsonObject = wmsToAcsService.queryBoxWeigh(whereJson);
|
||||
|
||||
JSONObject data = jsonObject.getJSONArray("data").getJSONObject(0);
|
||||
double weight_now = NumberUtil.div(data.getDoubleValue("weight"), 10);
|
||||
|
||||
// 获取系统参数
|
||||
double weight_sys = Double.parseDouble(SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("weight_sys").getValue());
|
||||
|
||||
// 查询子卷包装关系
|
||||
JSONObject jsonSub = subTab.query("package_box_sn = '" + box_no + "'").uniqueResult(0);
|
||||
double box_weight = jsonSub.getDoubleValue("box_weight");
|
||||
|
||||
if (NumberUtil.sub(box_weight, weight_sys) <= weight_now && NumberUtil.add(box_weight, weight_sys) >= weight_now) {
|
||||
jo.put("message", "重量合格!当前称重重量:"+weight_now);
|
||||
} else {
|
||||
jo.put("message", "重量不合格!当前称重重量:"+weight_now);
|
||||
}
|
||||
|
||||
return jo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_DeliveryPointIvt");
|
||||
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
|
||||
|
||||
String task_id = taskObj.getString("task_id");
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
@@ -111,6 +112,15 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
|
||||
if ("010507".equals(jsonTask.getString("task_type"))) {
|
||||
double weight = taskObj.getDoubleValue("weight");
|
||||
|
||||
// 更新子卷包装实际重量
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("real_weight",weight);
|
||||
subTab.update(param,"package_box_sn ='"+jsonTask.getString("vehicle_code")+"'");
|
||||
}
|
||||
|
||||
//只有输送入的时候才调用MES
|
||||
if ("010402".equals(jsonTask.getString("task_type"))) {
|
||||
//调用MES接口,通知MES运输中
|
||||
|
||||
@@ -239,7 +239,8 @@
|
||||
<el-table-column prop="ivt_qty" label="库存数" :formatter="rounding"/>
|
||||
<el-table-column prop="warehousing_qty" label="待入数" :formatter="rounding"/>
|
||||
<el-table-column prop="unit_name" label="计量单位"/>
|
||||
<el-table-column prop="instorage_time" label="入库时间" min-width="150"/>
|
||||
<el-table-column prop="confirm_time" label="入库时间" min-width="150"/>
|
||||
<el-table-column prop="joint_type" label="接头数" min-width="150"/>
|
||||
<el-table-column prop="sub_type" label="子卷状态" min-width="150" :formatter="formatSubType"/>
|
||||
<el-table-column prop="stock_age" label="生产时长(天)" min-width="120" />
|
||||
<el-table-column prop="paper_type" label="管件类型" min-width="150"/>
|
||||
|
||||
Reference in New Issue
Block a user