优化
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
输入.pcsn TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.weigh_status TYPEAS s_string
|
||||
输入.status TYPEAS s_string
|
||||
输入.available TYPEAS s_string
|
||||
|
||||
@@ -193,6 +194,7 @@
|
||||
pcsn,
|
||||
status,
|
||||
available,
|
||||
weigh_status,
|
||||
MAX(inputtime) AS inputtime
|
||||
FROM
|
||||
VWmsInventory
|
||||
@@ -217,7 +219,10 @@
|
||||
OPTION 输入.available <> ""
|
||||
available = 输入.available
|
||||
ENDOPTION
|
||||
group by material_code,material_name,available,pcsn,status,pallet_code
|
||||
OPTION 输入.weigh_status <> ""
|
||||
weigh_status = 输入.weigh_status
|
||||
ENDOPTION
|
||||
group by material_code,material_name,available,pcsn,status,pallet_code,weigh_status
|
||||
order by material_code,pcsn
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
|
||||
@@ -9,10 +9,10 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.security.service.dto.JwtUserDto;
|
||||
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.pda.exception.PdaRequestException;
|
||||
import org.nl.pda.st.in.service.HandNewMaterialService;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
@@ -51,27 +51,27 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
WQLObject task_wql = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
WQLObject point_wql = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
if (ObjectUtil.isEmpty(jsonObject.get("storagevehicle_code"))) {
|
||||
throw new BadRequestException("输入的载具号不能为空!");
|
||||
throw new PdaRequestException("输入的载具号不能为空!");
|
||||
}
|
||||
String storagevehicle_code = (String) jsonObject.get("storagevehicle_code");
|
||||
String flag = (String) jsonObject.get("option");
|
||||
|
||||
JSONObject vehicle_jo = vehicle_wql.query("storagevehicle_code = '" + storagevehicle_code + "' AND is_delete = '0' AND is_used = '1'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(vehicle_jo)) {
|
||||
throw new BadRequestException("该载具不存在!");
|
||||
throw new PdaRequestException("该载具不存在!");
|
||||
}
|
||||
|
||||
//查询是否存在未完成的任务
|
||||
JSONObject task_jo = task_wql.query("vehicle_code = '" + storagevehicle_code + "' AND is_delete = '0' AND task_status < '99'").uniqueResult(0);
|
||||
if (!ObjectUtil.isEmpty(task_jo)) {
|
||||
throw new BadRequestException("该载具存在未完成的任务!");
|
||||
throw new PdaRequestException("该载具存在未完成的任务!");
|
||||
}
|
||||
|
||||
//查询该载具是否存在组盘记录
|
||||
if (!flag.equals("5")) {
|
||||
JSONArray mater_rows = bucket_wql.query("storagevehicle_code = '" + vehicle_jo.getString("storagevehicle_code") + "' AND status IN ('03','02')").getResultJSONArray(0);
|
||||
if (mater_rows.size() > 0) {
|
||||
throw new BadRequestException("请选择空托盘!");
|
||||
throw new PdaRequestException("请选择空托盘!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,28 +82,28 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
case "1":
|
||||
case "2":
|
||||
if (!ObjectUtil.isEmpty(point_jo)) {
|
||||
throw new BadRequestException("该载具存在点位上!");
|
||||
throw new PdaRequestException("该载具存在点位上!");
|
||||
}
|
||||
//校验载具为塑料托盘
|
||||
if (!vehicle_jo.getString("storagevehicle_type").equals("20")) {
|
||||
throw new BadRequestException("必须使用塑料托盘!");
|
||||
throw new PdaRequestException("必须使用塑料托盘!");
|
||||
}
|
||||
break;
|
||||
case "3":
|
||||
//校验载具为塑料托盘
|
||||
if (!vehicle_jo.getString("storagevehicle_type").equals("10")) {
|
||||
throw new BadRequestException("必须使用铁托盘!");
|
||||
throw new PdaRequestException("必须使用铁托盘!");
|
||||
}
|
||||
String point_code2 = (String) jsonObject.get("point_code");
|
||||
if (!ObjectUtil.isEmpty(point_jo) && !point_jo.getString("point_code").equals(point_code2)) {
|
||||
throw new BadRequestException("该载具存在别的点位上!");
|
||||
throw new PdaRequestException("该载具存在别的点位上!");
|
||||
}
|
||||
break;
|
||||
case "4":
|
||||
case "7":
|
||||
String point_code = (String) jsonObject.get("point_code");
|
||||
if (!ObjectUtil.isEmpty(point_jo) && !point_jo.getString("point_code").equals(point_code)) {
|
||||
throw new BadRequestException("该载具存在别的点位上!");
|
||||
throw new PdaRequestException("该载具存在别的点位上!");
|
||||
}
|
||||
break;
|
||||
case "5":
|
||||
@@ -126,7 +126,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
WQLObject mater_wql = WQLObject.getWQLObject("md_me_materialbase");
|
||||
WQLObject unit_wql = WQLObject.getWQLObject("md_pb_measureunit");
|
||||
if (ObjectUtil.isEmpty(jsonObject.get("bucket_code"))) {
|
||||
throw new BadRequestException("桶码不能为空!");
|
||||
throw new PdaRequestException("桶码不能为空!");
|
||||
}
|
||||
String bucket_code = (String) jsonObject.get("bucket_code");
|
||||
String flag = (String) jsonObject.get("option");
|
||||
@@ -165,48 +165,48 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
bucket_jo.put("qty_unit_id", mater_jo.getString("base_unit_id"));
|
||||
bucket_jo.put("qty_unit_name", unit_jo.getString("unit_name"));
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("桶二维码数据有误!");
|
||||
throw new PdaRequestException("桶二维码数据有误!");
|
||||
}
|
||||
/*if (!bill.get("pcsn").equals(bucket_jo.getString("pcsn"))) {
|
||||
throw new BadRequestException("单据批次和桶批次不同!");
|
||||
throw new PdaRequestException("单据批次和桶批次不同!");
|
||||
}*/
|
||||
} else {
|
||||
if (!bucket_jo.getString("storagevehicle_type").equals("01") && !bucket_jo.getString("storagevehicle_type").equals("02")) {
|
||||
throw new BadRequestException("桶类型必须为原料桶或辅料桶!");
|
||||
throw new PdaRequestException("桶类型必须为原料桶或辅料桶!");
|
||||
}
|
||||
if (!bucket_jo.getString("status").equals("01")) {
|
||||
throw new BadRequestException("桶状态必须为生成!");
|
||||
throw new PdaRequestException("桶状态必须为生成!");
|
||||
}
|
||||
/*if (!bill.get("material_id").equals(bucket_jo.getString("material_id"))) {
|
||||
throw new BadRequestException("单据物料和桶物料不同!");
|
||||
throw new PdaRequestException("单据物料和桶物料不同!");
|
||||
}
|
||||
if (!bill.get("pcsn").equals(bucket_jo.getString("pcsn"))) {
|
||||
throw new BadRequestException("单据批次和桶批次不同!");
|
||||
throw new PdaRequestException("单据批次和桶批次不同!");
|
||||
}*/
|
||||
}
|
||||
break;
|
||||
case "2":
|
||||
if (ObjectUtil.isEmpty(bucket_jo)) {
|
||||
throw new BadRequestException("未查询到桶相关信息");
|
||||
throw new PdaRequestException("未查询到桶相关信息");
|
||||
}
|
||||
if (!bucket_jo.getString("storagevehicle_type").equals("02")) {
|
||||
throw new BadRequestException("桶类型必须为辅料桶!");
|
||||
throw new PdaRequestException("桶类型必须为辅料桶!");
|
||||
}
|
||||
if (!bucket_jo.getString("status").equals("01")) {
|
||||
throw new BadRequestException("桶状态必须为生成!");
|
||||
throw new PdaRequestException("桶状态必须为生成!");
|
||||
}
|
||||
break;
|
||||
case "5":
|
||||
if (ObjectUtil.isEmpty(bucket_jo)) {
|
||||
throw new BadRequestException("未查询到桶相关信息");
|
||||
throw new PdaRequestException("未查询到桶相关信息");
|
||||
}
|
||||
if (!bucket_jo.getString("status").equals("01")) {
|
||||
throw new BadRequestException("桶状态必须为生成!");
|
||||
throw new PdaRequestException("桶状态必须为生成!");
|
||||
}
|
||||
boolean is_rf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.RF.getCode(), bucket_jo.getString("material_id"), null);
|
||||
//桶内物料必须为软废;
|
||||
if (!is_rf) {
|
||||
throw new BadRequestException("桶内物料不为软废!");
|
||||
throw new PdaRequestException("桶内物料不为软废!");
|
||||
}
|
||||
bucket_jo.put("is_new", "1");
|
||||
break;
|
||||
@@ -214,31 +214,31 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
case "4":
|
||||
case "6":
|
||||
if (ObjectUtil.isEmpty(bucket_jo)) {
|
||||
throw new BadRequestException("未查询到桶相关信息");
|
||||
throw new PdaRequestException("未查询到桶相关信息");
|
||||
}
|
||||
if (!bucket_jo.getString("status").equals("01")) {
|
||||
throw new BadRequestException("桶状态必须为生成!");
|
||||
throw new PdaRequestException("桶状态必须为生成!");
|
||||
}
|
||||
boolean is_pgf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), bucket_jo.getString("material_id"), null);
|
||||
//桶内物料必须为PG粉;
|
||||
if (!is_pgf) {
|
||||
throw new BadRequestException("桶内物料不为PG粉!");
|
||||
throw new PdaRequestException("桶内物料不为PG粉!");
|
||||
}
|
||||
break;
|
||||
case "7":
|
||||
if (ObjectUtil.isEmpty(bucket_jo)) {
|
||||
throw new BadRequestException("未查询到桶相关信息");
|
||||
throw new PdaRequestException("未查询到桶相关信息");
|
||||
}
|
||||
if (!bucket_jo.getString("status").equals("01")) {
|
||||
throw new BadRequestException("桶状态必须为生成!");
|
||||
throw new PdaRequestException("桶状态必须为生成!");
|
||||
}
|
||||
is_rf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.RF.getCode(), bucket_jo.getString("material_id"), null);
|
||||
//桶内物料必须为软废;
|
||||
if (!is_rf) {
|
||||
throw new BadRequestException("桶内物料不为软废!");
|
||||
throw new PdaRequestException("桶内物料不为软废!");
|
||||
}
|
||||
if (!bucket_jo.getString("is_active").equals("1")) {
|
||||
throw new BadRequestException("桶内物料必须可用!");
|
||||
throw new PdaRequestException("桶内物料必须可用!");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -274,7 +274,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
HashMap<String, String> vehicle = (HashMap<String, String>) jsonObject.get("vehicle");
|
||||
HashMap<String, String> source_bill = (HashMap<String, String>) jsonObject.get("bill");
|
||||
if (ObjectUtil.isEmpty(vehicle)) {
|
||||
throw new BadRequestException("载具不能为空,请点击查询载具是否可用!");
|
||||
throw new PdaRequestException("载具不能为空,请点击查询载具是否可用!");
|
||||
}
|
||||
HashMap<String, String> point = new HashMap<>();
|
||||
String flag = (String) jsonObject.get("option");
|
||||
@@ -289,32 +289,32 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
if (flag.equals("3") || flag.equals("4") || flag.equals("7")) {
|
||||
point = (HashMap<String, String>) jsonObject.get("point");
|
||||
if (ObjectUtil.isEmpty(point)){
|
||||
throw new BadRequestException("点位不能为空,请点击查询点位是否可用!");
|
||||
throw new PdaRequestException("点位不能为空,请点击查询点位是否可用!");
|
||||
}
|
||||
JSONObject vehicle_jo = vehicle_wql.query("storagevehicle_code = '" + storagevehicle_code + "' AND is_delete = '0' AND is_used = '1'").uniqueResult(0);
|
||||
//校验载具为塑料托盘
|
||||
if (flag.equals("3")){
|
||||
if (!vehicle_jo.getString("storagevehicle_type").equals("10")) {
|
||||
throw new BadRequestException("必须使用铁托盘!");
|
||||
throw new PdaRequestException("必须使用铁托盘!");
|
||||
}
|
||||
}
|
||||
//查询该载具是否存在组盘记录
|
||||
JSONArray mater_rows = bucket_wql.query("storagevehicle_code = '" + vehicle_jo.getString("storagevehicle_code") + "' AND status IN ('03','02')").getResultJSONArray(0);
|
||||
if (mater_rows.size() > 0) {
|
||||
throw new BadRequestException("请选择空托盘!");
|
||||
throw new PdaRequestException("请选择空托盘!");
|
||||
}
|
||||
JSONObject point_jo = point_wql.query("vehicle_code = '" + storagevehicle_code + "'").uniqueResult(0);
|
||||
if (!ObjectUtil.isEmpty(point_jo) && !point_jo.getString("point_code").equals(point.get("point_code"))) {
|
||||
throw new BadRequestException("该载具存在别的点位上!");
|
||||
throw new PdaRequestException("该载具存在别的点位上!");
|
||||
}
|
||||
//查询是否存在未完成的任务
|
||||
JSONObject task_jo = task_wql.query("vehicle_code = '" + storagevehicle_code + "' AND is_delete = '0' AND task_status < '99'").uniqueResult(0);
|
||||
if (!ObjectUtil.isEmpty(task_jo)) {
|
||||
throw new BadRequestException("该载具存在未完成的任务!");
|
||||
throw new PdaRequestException("该载具存在未完成的任务!");
|
||||
}
|
||||
JSONObject start_point = point_wql.query("point_code = '" + point.get("point_code") + "'").uniqueResult(0);
|
||||
if (!start_point.getString("lock_type").equals("00")) {
|
||||
throw new BadRequestException("该点位已被锁定!");
|
||||
throw new PdaRequestException("该点位已被锁定!");
|
||||
}
|
||||
}
|
||||
//插入主表
|
||||
@@ -348,7 +348,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
}
|
||||
JSONObject jo_now = WQL.getWO("QPADST_IN_SERVICE").addParam("flag", "11").addParam("storagevehicle_code", storagevehicle_code).process().uniqueResult(0);
|
||||
if(jo_now!=null){
|
||||
throw new BadRequestException("该载具"+storagevehicle_code+"已存在未完成的出入库单!");
|
||||
throw new PdaRequestException("该载具"+storagevehicle_code+"已存在未完成的出入库单!");
|
||||
}
|
||||
JSONObject mst_jo = new JSONObject();
|
||||
String bill_code = CodeUtil.getNewCode("IO_CODE");
|
||||
@@ -393,20 +393,20 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
JSONObject bucket_jo = bucket_wql.query("bucketunique = '" + row.get("bucketunique") + "' AND material_id = '" + row.get("material_id") + "' AND pcsn = '" + row.get("pcsn") + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(bucket_jo)) {
|
||||
throw new BadRequestException("桶号:"+row.get("bucketunique")+"查不到对应物料批次记录!");
|
||||
throw new PdaRequestException("桶号:"+row.get("bucketunique")+"查不到对应物料批次记录!");
|
||||
}
|
||||
|
||||
if (!ObjectUtil.isEmpty(bucket_jo) && !bucket_jo.getString("status").equals("01")) {
|
||||
//如果为软废采购入库,判断是否为新加,不是新加的不需要判断是否组盘
|
||||
if (!flag.equals("5") && row.containsKey("is_new") && row.get("is_new").equals("0")) {
|
||||
throw new BadRequestException("桶" + bucket_jo.getString("bucketunique") + "已经组盘!");
|
||||
throw new PdaRequestException("桶" + bucket_jo.getString("bucketunique") + "已经组盘!");
|
||||
}
|
||||
}
|
||||
|
||||
if (flag.equals("1")) {
|
||||
if (StrUtil.isNotEmpty(material_id) && StrUtil.isNotEmpty(pcsn)) {
|
||||
if (!row.get("material_id").equals(material_id) || !pcsn.equals(row.get("pcsn"))) {
|
||||
throw new BadRequestException("存在不同物料、批次的明细!");
|
||||
throw new PdaRequestException("存在不同物料、批次的明细!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -416,7 +416,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
boolean is_pgf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), bucket_jo.getString("material_id"), null);
|
||||
//桶内物料必须为PG粉;
|
||||
if (!is_pgf) {
|
||||
throw new BadRequestException("桶内物料不为PG粉!");
|
||||
throw new PdaRequestException("桶内物料不为PG粉!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
boolean is_rf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.RF.getCode(), bucket_jo.getString("material_id"), null);
|
||||
//桶内物料必须为软废;
|
||||
if (!is_rf) {
|
||||
throw new BadRequestException("桶内物料不为软废!");
|
||||
throw new PdaRequestException("桶内物料不为软废!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
boolean is_pgf = materialbaseService.isAlongMaterType(MaterOptTypeEnum.PGF.getCode(), bucket_jo.getString("material_id"), null);
|
||||
//桶内物料必须为PG粉;
|
||||
if (!is_pgf) {
|
||||
throw new BadRequestException("桶内物料不为PG粉!");
|
||||
throw new PdaRequestException("桶内物料不为PG粉!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
if (flag.equals("7")) {
|
||||
//判断软废是否可用
|
||||
if (!bucket_now.getString("is_active").equals("1")) {
|
||||
throw new BadRequestException(bucket_now.getString("bucketunique") + "桶,软废不可用!");
|
||||
throw new PdaRequestException(bucket_now.getString("bucketunique") + "桶,软废不可用!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,28 +547,28 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
String source_bill_code = (String) bill.get("source_bill_code");
|
||||
String source_billdtl_id = (String) bill.get("source_billdtl_id");
|
||||
if (!source_billdtl_id.equals(source_bill.get("source_billdtl_id"))) {
|
||||
throw new BadRequestException("关联单据不同!");
|
||||
throw new PdaRequestException("关联单据不同!");
|
||||
}
|
||||
JSONObject receive_mst_jo = receive_mst.query("receive_code = '" + source_bill_code + "'").uniqueResult(0);
|
||||
JSONObject receive_dtl_jo = receive_dtl.query("receivedtl_id = '" + source_billdtl_id + "'").uniqueResult(0);
|
||||
if (!bill.get("material_id").equals(row.get("material_id")) || !bill.get("pcsn").equals(row.get("pcsn"))) {
|
||||
throw new BadRequestException("单据物料批次和桶物料批次不同!");
|
||||
throw new PdaRequestException("单据物料批次和桶物料批次不同!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(receive_mst_jo) || ObjectUtil.isEmpty(receive_dtl_jo)) {
|
||||
throw new BadRequestException("传入的收货单信息有误!");
|
||||
throw new PdaRequestException("传入的收货单信息有误!");
|
||||
}
|
||||
if (receive_mst_jo.getString("status").equals("99") || receive_mst_jo.getString("is_delete").equals("1")) {
|
||||
throw new BadRequestException("该到货通知单:" + source_bill_code + "已完成或删除");
|
||||
throw new PdaRequestException("该到货通知单:" + source_bill_code + "已完成或删除");
|
||||
}
|
||||
if (receive_dtl_jo.getString("status").equals("99")) {
|
||||
throw new BadRequestException("收货单明细已完成!");
|
||||
throw new PdaRequestException("收货单明细已完成!");
|
||||
}
|
||||
double unin = receive_dtl_jo.getDouble("receive_qty")-receive_dtl_jo.getDouble("instor_qty");
|
||||
if (unin <= 0) {
|
||||
throw new BadRequestException("收货明细未入库数为0!");
|
||||
throw new PdaRequestException("收货明细未入库数为0!");
|
||||
}
|
||||
if(bucket_now.getDouble("storage_qty") > unin){
|
||||
throw new BadRequestException("当前组盘入库数"+bucket_now.getDouble("storage_qty")+"大于收货明细未入库数"+unin+"!");
|
||||
throw new PdaRequestException("当前组盘入库数"+bucket_now.getDouble("storage_qty")+"大于收货明细未入库数"+unin+"!");
|
||||
}
|
||||
bucket_now.put("source_billdtl_id", bill.get("source_billdtl_id"));
|
||||
bucket_now.put("source_bill_type", bill.get("source_bill_type"));
|
||||
@@ -592,7 +592,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
//查询该单据是否存在
|
||||
JSONObject pro_jo = WQLObject.getWQLObject("PCS_IF_PurchaseOrderProc").query("id = '" + row.get("source_billdtl_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(pro_jo)){
|
||||
throw new BadRequestException("采购订单数据发生变化,请重新选择选择明细生成入库单!");
|
||||
throw new PdaRequestException("采购订单数据发生变化,请重新选择选择明细生成入库单!");
|
||||
}
|
||||
HashMap<String, String> proc_map = new HashMap<>();
|
||||
proc_map.put("proc_status", "02");
|
||||
@@ -722,11 +722,11 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
public Map<String, Object> findVehicle(Map<String, String> jsonObject, HttpContext ctx) {
|
||||
String bucket_code = jsonObject.get("bucket_code");
|
||||
if (StrUtil.isEmpty(bucket_code)) {
|
||||
throw new BadRequestException("桶码不能为空!");
|
||||
throw new PdaRequestException("桶码不能为空!");
|
||||
}
|
||||
JSONObject bucket_jo = WQLObject.getWQLObject("md_pb_bucketrecord").query("bucketunique = '" + bucket_code + "' AND status = '01'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(bucket_jo)) {
|
||||
throw new BadRequestException("未查询到相关桶信息!");
|
||||
throw new PdaRequestException("未查询到相关桶信息!");
|
||||
}
|
||||
JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_id = '" + bucket_jo.getString("material_id") + "'").uniqueResult(0);
|
||||
String material_code = mater_jo.getString("material_code");
|
||||
@@ -741,7 +741,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
map.put("material_id", mater_jo.getString("material_id"));
|
||||
String max_quantity = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MAX_QUANTITY").getValue();
|
||||
if (StrUtil.isEmpty(max_quantity)){
|
||||
throw new BadRequestException("未设置满托盘桶数'MAX_QUANTITY'系统参数");
|
||||
throw new PdaRequestException("未设置满托盘桶数'MAX_QUANTITY'系统参数");
|
||||
}
|
||||
map.put("max_quantity", max_quantity);
|
||||
JSONObject vehicle_rows = WQL.getWO("QPADST_IN_SERVICE").addParamMap(map).pageQuery(ctx, "seq_no,bucket_num");
|
||||
@@ -760,13 +760,13 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
WQLObject vehicle_wql = WQLObject.getWQLObject("MD_PB_StorageVehicleInfo");
|
||||
WQLObject bucket_wql = WQLObject.getWQLObject("MD_PB_BucketRecord");
|
||||
if (ObjectUtil.isEmpty(jsonObject.get("point_code"))) {
|
||||
throw new BadRequestException("输入点位不能为空!");
|
||||
throw new PdaRequestException("输入点位不能为空!");
|
||||
}
|
||||
String point_code = (String) jsonObject.get("point_code");
|
||||
|
||||
JSONObject point_jo = point_wql.query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_jo)) {
|
||||
throw new BadRequestException("未查询到相关点位信息!");
|
||||
throw new PdaRequestException("未查询到相关点位信息!");
|
||||
}
|
||||
String vehicle_code = point_jo.getString("vehicle_code");
|
||||
|
||||
@@ -776,13 +776,13 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
vehicle = vehicle_wql.query("storagevehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
|
||||
if (!vehicle.getString("storagevehicle_type").equals("10")) {
|
||||
throw new BadRequestException("请选择铁托盘!");
|
||||
throw new PdaRequestException("请选择铁托盘!");
|
||||
}
|
||||
|
||||
//获取桶信息
|
||||
JSONArray rows = bucket_wql.query("storagevehicle_code = '" + vehicle_code + "' AND status IN ('01','02','03')").getResultJSONArray(0);
|
||||
if (rows.size() > 0) {
|
||||
throw new BadRequestException("点位上不为空载具!");
|
||||
throw new PdaRequestException("点位上不为空载具!");
|
||||
}
|
||||
}
|
||||
JSONObject returnjo = new JSONObject();
|
||||
@@ -798,21 +798,21 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
public Map<String, Object> needVehicle(Map jsonObject) {
|
||||
WQLObject point_wql = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
if (ObjectUtil.isEmpty(jsonObject.get("point"))) {
|
||||
throw new BadRequestException("点位不能为空!");
|
||||
throw new PdaRequestException("点位不能为空!");
|
||||
}
|
||||
String point = (String) jsonObject.get("point");
|
||||
|
||||
JSONObject point_jo = point_wql.query("point_code = '" + point + "'").uniqueResult(0);
|
||||
if (!StrUtil.isEmpty(point_jo.getString("storagevehicle_code"))) {
|
||||
throw new BadRequestException("该点位上存在载具!");
|
||||
throw new PdaRequestException("该点位上存在载具!");
|
||||
}
|
||||
if (!point_jo.getString("lock_type").equals("00")) {
|
||||
throw new BadRequestException("该点位已被锁定!");
|
||||
throw new PdaRequestException("该点位已被锁定!");
|
||||
}
|
||||
|
||||
JSONObject start_point = point_wql.query("point_status = '01' AND lock_type = '00' AND is_used = '1' AND is_delete = '0' AND area_type = '27'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(start_point)) {
|
||||
throw new BadRequestException("暂无空托盘!");
|
||||
throw new PdaRequestException("暂无空托盘!");
|
||||
}
|
||||
|
||||
//创建任务
|
||||
@@ -836,7 +836,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
mapnow.put("task_status", "02");
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(mapnow, "taskdtl_id = '" + task_id + "'");
|
||||
} else {
|
||||
throw new BadRequestException("任务下发失败:" + result.getString("message"));
|
||||
throw new PdaRequestException("任务下发失败:" + result.getString("message"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -851,7 +851,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, Object> queryLKvehicle(Map jsonObject) {
|
||||
if (ObjectUtil.isEmpty(jsonObject.get("lk_vehicle"))) {
|
||||
throw new BadRequestException("立库载具码不能为空!");
|
||||
throw new PdaRequestException("立库载具码不能为空!");
|
||||
}
|
||||
String lk_vehicle = (String) jsonObject.get("lk_vehicle");
|
||||
JSONArray rows = WQL.getWO("QPADST_IN_SERVICE").addParam("flag", "3").addParam("storagevehicle_code", lk_vehicle).process().getResultJSONArray(0);
|
||||
@@ -878,10 +878,10 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, Object> askVehicle(Map jsonObject) {
|
||||
if (ObjectUtil.isEmpty(jsonObject.get("point"))) {
|
||||
throw new BadRequestException("点位不能为空!");
|
||||
throw new PdaRequestException("点位不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(jsonObject.get("vehicle_row"))) {
|
||||
throw new BadRequestException("选择载具不能为空!");
|
||||
throw new PdaRequestException("选择载具不能为空!");
|
||||
}
|
||||
|
||||
String point_code = (String) jsonObject.get("point");
|
||||
@@ -908,7 +908,7 @@ public class HandNewMaterialServiceImpl implements HandNewMaterialService {
|
||||
mapnow.put("task_status", "02");
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(mapnow, "taskdtl_id = '" + task_id + "'");
|
||||
} else {
|
||||
throw new BadRequestException("任务下发失败:" + result.getString("message"));
|
||||
throw new PdaRequestException("任务下发失败:" + result.getString("message"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.pda.exception.PdaRequestException;
|
||||
import org.nl.pda.st.instor.service.InStorService;
|
||||
@@ -374,7 +373,7 @@ public class InStorServiceImpl implements InStorService {
|
||||
mapnow.put("task_status", "02");
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(mapnow, "taskdtl_id = '" + task_id + "'");
|
||||
} else {
|
||||
throw new BadRequestException("任务下发失败:" + result.getString("message"));
|
||||
throw new PdaRequestException("任务下发失败:" + result.getString("message"));
|
||||
}
|
||||
}
|
||||
JSONObject returnjo = new JSONObject();
|
||||
@@ -514,10 +513,10 @@ public class InStorServiceImpl implements InStorService {
|
||||
mapup.put("update_time",now);
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(mapup,"taskdtl_id='"+taskdtl_id+"'");
|
||||
}else{
|
||||
throw new BadRequestException("任务下发失败,请稍后重试!");
|
||||
throw new PdaRequestException("任务下发失败,请稍后重试!");
|
||||
}
|
||||
}else{
|
||||
throw new BadRequestException("任务下发失败,请稍后重试!");
|
||||
throw new PdaRequestException("任务下发失败,请稍后重试!");
|
||||
}
|
||||
}else {
|
||||
throw new PdaRequestException("载具:"+storagevehicle_code_in+"存在未完成的任务!");
|
||||
@@ -887,10 +886,10 @@ public class InStorServiceImpl implements InStorService {
|
||||
mapup.put("update_time",now);
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(mapup,"taskdtl_id='"+taskdtl_id+"'");
|
||||
}else{
|
||||
throw new BadRequestException("任务下发失败,请稍后重试!");
|
||||
throw new PdaRequestException("任务下发失败,请稍后重试!");
|
||||
}
|
||||
}else{
|
||||
throw new BadRequestException("任务下发失败,请稍后重试!");
|
||||
throw new PdaRequestException("任务下发失败,请稍后重试!");
|
||||
}
|
||||
}
|
||||
String storagevehicle_code = jodtl.getString("storagevehicle_code");
|
||||
@@ -909,10 +908,10 @@ public class InStorServiceImpl implements InStorService {
|
||||
mapup.put("update_time",now);
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(mapup,"taskdtl_id='"+taskdtl_id+"'");
|
||||
}else{
|
||||
throw new BadRequestException("任务下发失败,请稍后重试!");
|
||||
throw new PdaRequestException("任务下发失败,请稍后重试!");
|
||||
}
|
||||
}else{
|
||||
throw new BadRequestException("任务下发失败,请稍后重试!");
|
||||
throw new PdaRequestException("任务下发失败,请稍后重试!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.system.service.UserService;
|
||||
import org.nl.modules.system.service.dto.UserDto;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
@@ -484,12 +483,12 @@ public class HandCleanOutIvtServiceImpl implements HandCleanOutIvtService {
|
||||
//查询主表信息
|
||||
JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jo_mst)) {
|
||||
throw new BadRequestException("未查到相关出库单");
|
||||
throw new PdaRequestException("未查到相关出库单");
|
||||
}
|
||||
//判断是否存在未确认状态的分配记录
|
||||
JSONObject task = wo_dis.query("work_status <>'99' and iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task)) {
|
||||
throw new BadRequestException("存在未确认状态的出库分配记录,不允许强制确认!");
|
||||
throw new PdaRequestException("存在未确认状态的出库分配记录,不允许强制确认!");
|
||||
}
|
||||
//查询生成和未分配完的明细
|
||||
JSONArray dtls = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
||||
|
||||
@@ -10,7 +10,6 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.system.service.UserService;
|
||||
import org.nl.modules.system.service.dto.UserDto;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
@@ -452,7 +451,7 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
||||
String type = jsonObject.get("type");
|
||||
String bill_type= "";
|
||||
if (StrUtil.isEmpty(type)){
|
||||
throw new BadRequestException("单据类型不能为空!");
|
||||
throw new PdaRequestException("单据类型不能为空!");
|
||||
}
|
||||
if (StrUtil.equals(type,"1")){
|
||||
bill_type ="010301";
|
||||
@@ -464,11 +463,11 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
||||
|
||||
JSONObject vehicleObj = WQLObject.getWQLObject("MD_PB_StorageVehicleInfo").query("storagevehicle_code='" + storagevehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(vehicleObj)) {
|
||||
throw new BadRequestException("载具号为【'" + storagevehicle_code + "'】未找到!");
|
||||
throw new PdaRequestException("载具号为【'" + storagevehicle_code + "'】未找到!");
|
||||
}
|
||||
JSONObject pointObj = WQLObject.getWQLObject("sch_base_point").query("point_code='" + point_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(pointObj)) {
|
||||
throw new BadRequestException("站点为未找到!请输入正确的站点");
|
||||
throw new PdaRequestException("站点为未找到!请输入正确的站点");
|
||||
}
|
||||
String area_type = pointObj.getString("area_type");
|
||||
String bucketunique = jsonObject.get("bucketunique");
|
||||
@@ -483,7 +482,7 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
||||
String is_active = bucketObj.getString("is_active");
|
||||
//根据物料查询计量单位
|
||||
if (StrUtil.isEmpty(material_id)) {
|
||||
throw new BadRequestException("物料标识不能为空!");
|
||||
throw new PdaRequestException("物料标识不能为空!");
|
||||
}
|
||||
|
||||
boolean is_yl = this.materialbaseService.isAlongMaterType(MaterOptTypeEnum.YL.getCode(), material_id, (String)null);
|
||||
@@ -491,7 +490,7 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
||||
|
||||
if (is_fl || is_yl) {
|
||||
if (!StrUtil.equals(quality_scode,"01")){
|
||||
throw new BadRequestException("原辅料品质类型必须为合格!");
|
||||
throw new PdaRequestException("原辅料品质类型必须为合格!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -502,42 +501,42 @@ public class HandPFOutIvtServiceImpl implements HandPFOutIvtService {
|
||||
|
||||
//判断【仓位属性表】和【点位基础表】,点位、托盘,记录是否存在,不存在提示错误;
|
||||
if (StrUtil.isEmpty(storagevehicle_code)) {
|
||||
throw new BadRequestException("托盘编码不能为空!");
|
||||
throw new PdaRequestException("托盘编码不能为空!");
|
||||
}
|
||||
JSONObject attrrow = structAttr_table.query("storagevehicle_code='" + storagevehicle_code + "' and lock_type='00'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(attrrow)) {
|
||||
throw new BadRequestException("仓位属性表没有该载具,或者改载具的点位是锁定状态!");
|
||||
throw new PdaRequestException("仓位属性表没有该载具,或者改载具的点位是锁定状态!");
|
||||
}
|
||||
|
||||
JSONObject pointrow = point_table.query("vehicle_code='" + storagevehicle_code + "' and lock_type='00'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(pointrow)) {
|
||||
throw new BadRequestException("点位表没有该载具,或者改载具的点位是锁定状态!");
|
||||
throw new PdaRequestException("点位表没有该载具,或者改载具的点位是锁定状态!");
|
||||
}
|
||||
|
||||
if (!"22,23,24".contains(pointrow.getString("area_type"))){
|
||||
throw new BadRequestException("该载具不在配粉工位上!");
|
||||
throw new PdaRequestException("该载具不在配粉工位上!");
|
||||
}
|
||||
|
||||
//3、查询【仓位库存表】,判断仓位、物料批次、品质类型、库存等级、是否可用的库存是否存在,不存在提示错误,同时判断库存可用量是否满足出库重量,不满足提示错误;
|
||||
String struct_id = attrrow.getString("struct_id");
|
||||
JSONObject ivtjo = ivt_table.query("struct_id='" + struct_id + "' and material_id='" + material_id + "' and quality_scode='" + quality_scode + "' and pcsn ='" + pcsn + "' and ivt_level='" + ivt_level + "' and is_active='"+is_active+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(ivtjo)) {
|
||||
throw new BadRequestException("该物料的库存信息找不到!");
|
||||
throw new PdaRequestException("该物料的库存信息找不到!");
|
||||
}
|
||||
String canuse_qty = ivtjo.getString("canuse_qty");
|
||||
BigDecimal ivtflag = NumberUtil.sub(canuse_qty, out_qty);
|
||||
if (ivtflag.doubleValue() < 0) {
|
||||
throw new BadRequestException("库存的可用数量小于出库数量!");
|
||||
throw new PdaRequestException("库存的可用数量小于出库数量!");
|
||||
}
|
||||
//4、 查询【桶记录表】,判断桶号、物料批次、品质类型、库存等级、是否可用的库存是否存在,不存在提示错误,同时判断库存可用量是否满足出库重量,不满足提示错误;
|
||||
JSONObject bucketjo = bucket_table.query("bucketunique='" + bucketunique + "' and material_id ='" + material_id + "' and quality_scode ='" + quality_scode + "' and pcsn ='" + pcsn + "' and ivt_level='" + ivt_level + "' and is_active='"+is_active+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(bucketjo)) {
|
||||
throw new BadRequestException("该物料的桶信息查询不到!");
|
||||
throw new PdaRequestException("该物料的桶信息查询不到!");
|
||||
}
|
||||
String storage_qty = bucketjo.getString("storage_qty");
|
||||
BigDecimal bucketflag = NumberUtil.sub(storage_qty, out_qty);
|
||||
if (bucketflag.doubleValue() < 0) {
|
||||
throw new BadRequestException("桶记录的数量小于出库数量!");
|
||||
throw new PdaRequestException("桶记录的数量小于出库数量!");
|
||||
}
|
||||
//插入主表,明细表,分配表,分配明细表
|
||||
JSONObject invrow = new JSONObject();
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.system.service.UserService;
|
||||
import org.nl.modules.system.service.dto.UserDto;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
@@ -483,12 +482,12 @@ public class HandReturnOutIvtServiceImpl implements HandReturnOutIvtService {
|
||||
//查询主表信息
|
||||
JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jo_mst)) {
|
||||
throw new BadRequestException("未查到相关出库单");
|
||||
throw new PdaRequestException("未查到相关出库单");
|
||||
}
|
||||
//判断是否存在未确认状态的分配记录
|
||||
JSONObject task = wo_dis.query("work_status <>'99' and iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task)) {
|
||||
throw new BadRequestException("存在未确认状态的出库分配记录,不允许强制确认!");
|
||||
throw new PdaRequestException("存在未确认状态的出库分配记录,不允许强制确认!");
|
||||
}
|
||||
//查询生成和未分配完的明细
|
||||
JSONArray dtls = WQL.getWO("QST_IVT_CHECKOUTBILL")
|
||||
|
||||
@@ -9,7 +9,6 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.ext.lk.service.WmsToLkService;
|
||||
import org.nl.modules.security.service.dto.JwtUserDto;
|
||||
import org.nl.pda.exception.PdaRequestException;
|
||||
@@ -200,7 +199,7 @@ public class EmptyVehicleServiceImpl implements EmptyVehicleService {
|
||||
mapnow.put("task_status", "02");
|
||||
wo_Task.update(mapnow, "taskdtl_id = '" + taskdtl_id + "'");
|
||||
} else {
|
||||
throw new BadRequestException("任务下发失败:" + result.getString("message"));
|
||||
throw new PdaRequestException("任务下发失败:" + result.getString("message"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -309,7 +308,7 @@ public class EmptyVehicleServiceImpl implements EmptyVehicleService {
|
||||
mapnow.put("task_status", "02");
|
||||
wo_Task.update(mapnow, "taskdtl_id = '" + taskdtl_id + "'");
|
||||
} else {
|
||||
throw new BadRequestException("任务下发失败:" + result.getString("message"));
|
||||
throw new PdaRequestException("任务下发失败:" + result.getString("message"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ public class LibraryqueryServiceImpl implements LibraryqueryService {
|
||||
if (ObjectUtil.isNotEmpty(pcsn)) {
|
||||
map.put("pcsn","%"+pcsn+"%" );
|
||||
}
|
||||
map.put("weigh_status", MapUtil.getStr(whereJson,"weigh_status"));
|
||||
map.put("begin_time", MapUtil.getStr(whereJson,"begin_time"));
|
||||
map.put("end_time", MapUtil.getStr(whereJson,"end_time"));
|
||||
map.put("status", MapUtil.getStr(whereJson,"status"));
|
||||
@@ -136,6 +137,7 @@ public class LibraryqueryServiceImpl implements LibraryqueryService {
|
||||
map.put("begin_time", MapUtil.getStr(whereJson,"begin_time"));
|
||||
map.put("end_time", MapUtil.getStr(whereJson,"end_time"));
|
||||
map.put("status", MapUtil.getStr(whereJson,"status"));
|
||||
map.put("weigh_status", MapUtil.getStr(whereJson,"weigh_status"));
|
||||
map.put("available", MapUtil.getStr(whereJson,"available"));
|
||||
|
||||
JSONArray rows = WQL.getWO("QLK01").setDbname("dataSource2").addParamMap(map).process().getResultJSONArray(0);
|
||||
@@ -164,6 +166,7 @@ public class LibraryqueryServiceImpl implements LibraryqueryService {
|
||||
}else{
|
||||
dtl_map.put("是否可用", "不可用");
|
||||
}
|
||||
dtl_map.put("称重状态", jo.getString("weigh_status"));
|
||||
dtl_map.put("入库时间", jo.getString("inputtime"));
|
||||
list.add(dtl_map);
|
||||
}
|
||||
|
||||
@@ -145,18 +145,17 @@
|
||||
sum(PURCHASE.QTY_ZT) AS notqty,
|
||||
sum(PURCHASE.QTY_HT) AS sumqty,
|
||||
PURCHASE.VBILLCODE AS receive_code,
|
||||
mater.material_code,
|
||||
mater.material_name
|
||||
PURCHASE.ITEM_CODE as material_code,
|
||||
PURCHASE.ITEM_NAME as material_name
|
||||
FROM
|
||||
PURCHASE_CONTRACT_VIEW PURCHASE
|
||||
INNER JOIN md_me_materialbase mater ON PURCHASE.ITEM_ID = mater.ext_id
|
||||
where
|
||||
STATUSFLAG = '3'
|
||||
AND DEL_FLAG = '0'
|
||||
PURCHASE.STATUSFLAG = '3'
|
||||
AND PURCHASE.DEL_FLAG = '0'
|
||||
OPTION 输入.material_id <> ""
|
||||
mater.material_id = 输入.material_id
|
||||
PURCHASE.ITEM_ID = 输入.material_id
|
||||
ENDOPTION
|
||||
GROUP BY PURCHASE.ITEM_ID,PURCHASE.VBILLCODE
|
||||
GROUP BY PURCHASE.ITEM_ID,PURCHASE.VBILLCODE, PURCHASE.ITEM_CODE, PURCHASE.ITEM_NAME
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -425,13 +425,19 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
@Override
|
||||
public JSONArray query3(Map whereJson) {
|
||||
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||
|
||||
WQLObject mater_wql = WQLObject.getWQLObject("md_me_materialbase");
|
||||
String material_id = map.get("material_id");
|
||||
|
||||
String ext_id = "";
|
||||
if(StrUtil.isNotEmpty(material_id)){
|
||||
JSONObject mater_jo = mater_wql.query("is_delete='0' and material_id = '" + material_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(mater_jo)) {
|
||||
ext_id = mater_jo.getString("ext_id");
|
||||
}
|
||||
}
|
||||
JSONArray ja = WQL.getWO("QL_ERP")
|
||||
.setDbname("dataSource1")
|
||||
.addParam("flag", "6")
|
||||
.addParam("material_id", material_id)
|
||||
.addParam("material_id", ext_id)
|
||||
.process().getResultJSONArray(0);
|
||||
return ja;
|
||||
}
|
||||
|
||||
@@ -22,15 +22,16 @@
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column show-overflow-tooltip prop="pallet_code" label="托盘"/>
|
||||
<el-table-column show-overflow-tooltip prop="barrelcode" label="桶号"/>
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码"/>
|
||||
<el-table-column show-overflow-tooltip prop="pcsn" label="批号"/>
|
||||
<el-table-column show-overflow-tooltip prop="weight" label="重量" :formatter="crud.formatNum3"/>
|
||||
<el-table-column show-overflow-tooltip prop="status" label="品质类型" :formatter="formatStatus"/>
|
||||
<el-table-column show-overflow-tooltip prop="available" label="是否可用" :formatter="formatIsUsable"/>
|
||||
<el-table-column show-overflow-tooltip prop="ordernum" label="序号"/>
|
||||
<el-table-column show-overflow-tooltip prop="inputtime" label="入库时间"/>
|
||||
<el-table-column prop="pallet_code" label="托盘" min-width="120px" />
|
||||
<el-table-column prop="barrelcode" label="桶号" min-width="150" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="150" />
|
||||
<el-table-column prop="pcsn" label="批号" min-width="120" />
|
||||
<el-table-column prop="weight" label="重量" :formatter="crud.formatNum3" min-width="120" />
|
||||
<el-table-column prop="status" label="品质类型" :formatter="formatStatus" min-width="120" />
|
||||
<el-table-column prop="available" label="是否可用" :formatter="formatIsUsable" min-width="120" />
|
||||
<el-table-column prop="weigh_status" label="称重状态" min-width="120" />
|
||||
<el-table-column prop="ordernum" label="序号" min-width="120" />
|
||||
<el-table-column prop="inputtime" label="入库时间" min-width="150" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
</div>
|
||||
|
||||
@@ -77,6 +77,25 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="称重状态">
|
||||
<el-select
|
||||
v-model="query.weigh_status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 210px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.weigh_status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -106,18 +125,19 @@
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" :max-height="590" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="pallet_code" label="托盘" width="120px">
|
||||
<el-table-column prop="pallet_code" label="托盘" min-width="120px">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="queryDtl(scope.row)">{{ scope.row.pallet_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码" />
|
||||
<el-table-column prop="material_name" label="物料名称" />
|
||||
<el-table-column prop="pcsn" label="批号" />
|
||||
<el-table-column prop="weight" label="重量" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="status" label="品质类型" :formatter="formatStatus"/>
|
||||
<el-table-column prop="available" label="是否可用" :formatter="formatIsUsable"/>
|
||||
<el-table-column prop="inputtime" label="入库时间" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="150" />
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="150" />
|
||||
<el-table-column prop="pcsn" label="批号" min-width="120" />
|
||||
<el-table-column prop="weight" label="重量" :formatter="crud.formatNum3" min-width="120" />
|
||||
<el-table-column prop="status" label="品质类型" :formatter="formatStatus" min-width="120" />
|
||||
<el-table-column prop="available" label="是否可用" :formatter="formatIsUsable" min-width="120"/>
|
||||
<el-table-column prop="weigh_status" label="称重状态" min-width="120"/>
|
||||
<el-table-column prop="inputtime" label="入库时间" min-width="150" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
@@ -141,7 +161,7 @@ import { downloadFile } from '@/utils'
|
||||
const defaultForm = { agvaddr: null }
|
||||
export default {
|
||||
name: 'Libraryquery',
|
||||
dicts: ['is_usable', 'ST_QUALITY_SCODE'],
|
||||
dicts: ['is_usable', 'ST_QUALITY_SCODE', 'weigh_status'],
|
||||
components: { QueryDtlDialog, pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
|
||||
@@ -104,7 +104,6 @@ export default {
|
||||
report.query4().then(res => {
|
||||
this.XLList = res
|
||||
})
|
||||
this.queryStruct()
|
||||
},
|
||||
/**
|
||||
* 接受父组件传值
|
||||
|
||||
@@ -103,7 +103,6 @@ export default {
|
||||
report.query4().then(res => {
|
||||
this.XLList = res
|
||||
})
|
||||
this.queryStruct()
|
||||
},
|
||||
/**
|
||||
* 接受父组件传值
|
||||
|
||||
@@ -100,7 +100,6 @@ export default {
|
||||
report.query4().then(res => {
|
||||
this.XLList = res
|
||||
})
|
||||
this.queryStruct()
|
||||
},
|
||||
/**
|
||||
* 接受父组件传值
|
||||
|
||||
@@ -52,7 +52,8 @@
|
||||
<el-table-column v-if="col.prop !== 'first'" :prop="col.prop" :label="col.label" width="120px" />
|
||||
<el-table-column v-if="col.prop === 'first'" :prop="col.prop" :label="col.label" width="120px" fixed>
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="open2(scope.$index, scope.row)">{{ scope.row.first }}</el-link>
|
||||
<span v-show="!isshow(scope.row)">{{ scope.row.first }}</span>
|
||||
<el-link v-show="isshow(scope.row)" type="warning" @click="open2(scope.$index, scope.row)">{{ scope.row.first }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
@@ -183,6 +184,17 @@ export default {
|
||||
this.structshow3 = true
|
||||
}
|
||||
},
|
||||
isshow(row) {
|
||||
if (row.first === '库存现存量') {
|
||||
return true
|
||||
} else if (row.first === '待检入库量') {
|
||||
return true
|
||||
} else if (row.first === '合同在途') {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user