rev:一期超重木箱通知飞书

This commit is contained in:
2024-08-06 14:02:06 +08:00
parent 1fd76c3924
commit 50a4a5aaa2
3 changed files with 23 additions and 6 deletions

View File

@@ -317,6 +317,9 @@ public class PdmBiSubpackagerelation extends Model<PdmBiSubpackagerelation> {
/** 物料类型 */
private String material_type;
/** 是否放行 */
private String is_pass;
/**
* 纸管规格
*/

View File

@@ -8,9 +8,14 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
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.ios.enums.IOSEnum;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.WQL;
@@ -223,9 +228,17 @@ public class ProductInstorServiceImpl implements ProductInstorService {
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
wmsToAcsService.action(rows);
// 将木箱重量告知飞书
notifyMes(sub_jo);
throw new BadRequestException("重量不合格!系统重量浮动超过" + weight_sys + "KG,当前木称重重量:" + real_weight);
//判断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("请等待放行!");
}
}
}
//判断是该包装计划是否存在长宽高
@@ -663,7 +676,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
}
param.put("UserList", UserList);
// 标签code
param.put("Code", "ctp_AA65DNXr3svo");
param.put("Code", "AAq00SOHd1wrK");
// 组织标签内容
JSONObject content = new JSONObject();
@@ -671,10 +684,11 @@ public class ProductInstorServiceImpl implements ProductInstorService {
double real_weight = NumberUtil.round(sub_jo.getDoubleValue("real_weight"), 2).doubleValue();
content.put("title", "【LMS通知】木箱超重警告");
content.put("Message", "木箱号:" + sub_jo.getString("package_box_sn") + ",系统木箱重量:" + box_weight + "KG,实际木箱重量:" + real_weight + "KG");
content.put("Message", "木箱超重!系统木箱重量:" + box_weight + "KG,实际木箱重量:" + real_weight + "KG");
content.put("MXNum", sub_jo.getString("package_box_sn"));
param.put("card", content);
// 调用mes接口
lmsToMesService.proudDayData(param);
lmsToMesService.sendSalesIvtMsgParam(param);
}
}