fix:异常入库
This commit is contained in:
@@ -162,7 +162,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
//判断明细数组中箱号与扫码的箱子是否一致,不一致让客户重新扫码
|
||||
if (ObjectUtil.isNotEmpty(package_box_sn)) {
|
||||
if (!box_no.equals(package_box_sn)) {
|
||||
throw new BadRequestException("扫码箱号:"+box_no+"与明细数据中箱号:"+package_box_sn+"不一致,请重新扫码操作!");
|
||||
throw new BadRequestException("扫码箱号:" + box_no + "与明细数据中箱号:" + package_box_sn + "不一致,请重新扫码操作!");
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < box_rows.size(); i++) {
|
||||
@@ -216,36 +216,39 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
double box_weight = sub_jo.getDoubleValue("box_weight");
|
||||
// 木箱实称重重量
|
||||
double real_weight = sub_jo.getDoubleValue("real_weight");
|
||||
|
||||
if (ObjectUtil.isEmpty(sub_jo.getString("real_weight"))) {
|
||||
throw new BadRequestException("请先进行木箱称重校验!");
|
||||
//一楼是否异常
|
||||
String one_exc_param = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("one_exc_param").getValue();
|
||||
if (!"1".equals(one_exc_param)) {
|
||||
if (ObjectUtil.isEmpty(sub_jo.getString("real_weight"))) {
|
||||
throw new BadRequestException("请先进行木箱称重校验!");
|
||||
}
|
||||
}
|
||||
|
||||
// 判断木箱毛重是否超标
|
||||
if (NumberUtil.sub(box_weight, weight_sys) <= real_weight && NumberUtil.add(box_weight, weight_sys) >= real_weight) {
|
||||
} else {
|
||||
//调用ACS让对应蜂鸣器报警
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("code", "to_command");
|
||||
param.put("product_area", "LK");
|
||||
param.put("value", "99");
|
||||
param.put("device_code", point_code);
|
||||
JSONArray rows = new JSONArray();
|
||||
rows.add(param);
|
||||
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||
wmsToAcsService.action(rows);
|
||||
if (!"1".equals(one_exc_param)) {
|
||||
//调用ACS让对应蜂鸣器报警
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("code", "to_command");
|
||||
param.put("product_area", "LK");
|
||||
param.put("value", "99");
|
||||
param.put("device_code", point_code);
|
||||
JSONArray rows = new JSONArray();
|
||||
rows.add(param);
|
||||
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||
wmsToAcsService.action(rows);
|
||||
|
||||
//判断is_pass是否为空,如果为空则通知飞书,不为空判断:为0则不允许通过,为1则允许
|
||||
if (ObjectUtil.isEmpty(sub_jo.getString("is_pass")) || sub_jo.getString("is_pass").equals(IOSEnum.IS_NOTANDYES.code("否")) ) {
|
||||
// 通知飞书
|
||||
notifyMes(sub_jo);
|
||||
throw new BadRequestException("重量不合格!系统重量浮动超过" + weight_sys + "KG,当前木箱称重重量:" + real_weight + ",已通知飞书处理!");
|
||||
} else {
|
||||
if (sub_jo.getString("is_pass").equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
throw new BadRequestException("请等待放行!");
|
||||
//判断is_pass是否为空,如果为空则通知飞书,不为空判断:为0则不允许通过,为1则允许
|
||||
if (ObjectUtil.isEmpty(sub_jo.getString("is_pass")) || sub_jo.getString("is_pass").equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
// 通知飞书
|
||||
notifyMes(sub_jo);
|
||||
throw new BadRequestException("重量不合格!系统重量浮动超过" + weight_sys + "KG,当前木箱称重重量:" + real_weight + ",已通知飞书处理!");
|
||||
} else {
|
||||
if (sub_jo.getString("is_pass").equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
throw new BadRequestException("请等待放行!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//判断是该包装计划是否存在长宽高
|
||||
@@ -371,7 +374,9 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
|
||||
form.put("vehicle_code", box_no);
|
||||
form.put("task_type", "010507");
|
||||
cutConveyorTask.createTask(form);
|
||||
if (!"1".equals(one_exc_param)) {
|
||||
cutConveyorTask.createTask(form);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* 如果有实际重量则需要判断重量是否超标
|
||||
@@ -413,13 +418,13 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
.uniqueResult(0);
|
||||
|
||||
if ("XN01".equals(jsonObject.getString("sect_code"))) {
|
||||
whereJson.put("sect_id","1712667908095741952");
|
||||
whereJson.put("sect_id", "1712667908095741952");
|
||||
}
|
||||
if ("XN02".equals(jsonObject.getString("sect_code"))) {
|
||||
whereJson.put("sect_id","1760184056861036544");
|
||||
whereJson.put("sect_id", "1760184056861036544");
|
||||
}
|
||||
if ("TH01".equals(jsonObject.getString("sect_code"))) {
|
||||
whereJson.put("sect_id","1760183817781514240");
|
||||
whereJson.put("sect_id", "1760183817781514240");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -686,7 +691,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
JSONObject data = jsonObject.getJSONArray("data").getJSONObject(0);
|
||||
double weight_now = NumberUtil.div(data.getDoubleValue("weight"), 10);
|
||||
if (data.getDoubleValue("weight") <= 0) {
|
||||
throw new BadRequestException("当前称重重量有误,请检查!当前称重重量为【"+weight_now+"】");
|
||||
throw new BadRequestException("当前称重重量有误,请检查!当前称重重量为【" + weight_now + "】");
|
||||
}
|
||||
|
||||
// 获取系统参数1
|
||||
|
||||
Reference in New Issue
Block a user