add:新增需求
This commit is contained in:
@@ -94,4 +94,18 @@ public class StructattrController {
|
||||
public ResponseEntity<Object> unLockPoint(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(structattrService.unLockPoint(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/oneCreate")
|
||||
@Log("一键生成货位")
|
||||
public ResponseEntity<Object> oneCreate(@RequestBody JSONObject whereJson) {
|
||||
structattrService.oneCreate(whereJson);
|
||||
return new ResponseEntity<>( HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/blurQuery")
|
||||
@Log("校验前缀是否可用")
|
||||
public ResponseEntity<Object> blurQuery(@RequestBody JSONObject whereJson) {
|
||||
structattrService.blurQuery(whereJson);
|
||||
return new ResponseEntity<>( HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,4 +98,23 @@ public interface StructattrService {
|
||||
* @return
|
||||
*/
|
||||
JSONObject unLockPoint(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 一键生成货位
|
||||
* @param whereJson {
|
||||
* stor_id: 仓库id
|
||||
* sect_id: 库区id
|
||||
* prefix: 仓位前缀
|
||||
* num: 生成数量
|
||||
* }
|
||||
*/
|
||||
void oneCreate(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 校验前缀是否可用
|
||||
* @param whereJson {
|
||||
* prefix: 前缀
|
||||
* }
|
||||
*/
|
||||
void blurQuery(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -98,7 +98,9 @@ public class StorattrServiceImpl implements StorattrService {
|
||||
dto.setCreate_time(now);
|
||||
|
||||
//TODO
|
||||
dto.setSyscompanyid(18L);
|
||||
dto.setSyscompanyid(9L);
|
||||
dto.setSysdeptid(9L);
|
||||
dto.setSysownerid(9L);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_bsrealstorattr");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
|
||||
@@ -513,4 +513,160 @@ public class StructattrServiceImpl implements StructattrService {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void oneCreate(JSONObject whereJson) {
|
||||
// 仓位表
|
||||
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
|
||||
// 库区表
|
||||
WQLObject sectTab = WQLObject.getWQLObject("st_ivt_sectattr");
|
||||
// 点位表
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
// 仓库表
|
||||
WQLObject storTab = WQLObject.getWQLObject("st_ivt_bsrealstorattr");
|
||||
|
||||
// 判断库区是否是虚拟区
|
||||
JSONObject jsonSect = sectTab.query("sect_id = '" + whereJson.getString("sect_id") + "'").uniqueResult(0);
|
||||
|
||||
if (!jsonSect.getString("sect_type_attr").equals("09")) {
|
||||
throw new BadRequestException("所选库区必须是虚拟区!");
|
||||
}
|
||||
|
||||
/*
|
||||
* 判断此库区是否已经生成仓位
|
||||
*/
|
||||
JSONObject jsonAttr = attrTab.query("sect_id = '" + whereJson.getString("sect_id") + "' order by struct_code DESC").uniqueResult(0);
|
||||
|
||||
// 生成数量
|
||||
int createNum = whereJson.getIntValue("num");
|
||||
// 开始生成数
|
||||
int createNum_start = 1;
|
||||
// 前缀
|
||||
String prefix = whereJson.getString("prefix");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonAttr)) {
|
||||
String struct_code = jsonAttr.getString("struct_code");
|
||||
|
||||
// 第一个-的位置
|
||||
int firstIndex = struct_code.indexOf("-");
|
||||
// 第二个-的位置
|
||||
int secondIndex = struct_code.substring(firstIndex + 1).indexOf("-") + firstIndex;
|
||||
// 最大的仓位数
|
||||
String result = struct_code.substring(firstIndex + 1, secondIndex +1);
|
||||
|
||||
createNum += Integer.parseInt(result);
|
||||
|
||||
createNum_start += Integer.parseInt(result);
|
||||
|
||||
prefix = struct_code.substring(0, firstIndex);
|
||||
}
|
||||
|
||||
/*
|
||||
* 生成货位
|
||||
*/
|
||||
String now = DateUtil.now();
|
||||
for (int i = createNum_start; i <= createNum; i++) {
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("struct_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
|
||||
if (i < 10) {
|
||||
json.put("struct_code", prefix + "-"+"000"+i+"-01");
|
||||
json.put("struct_name", prefix + "排-"+"000"+i+"列-01层");
|
||||
|
||||
}else if (i >= 10 && i < 100) {
|
||||
json.put("struct_code", prefix + "-"+"00"+i+"-01");
|
||||
json.put("struct_name", prefix + "排-"+"00"+i+"列-01层");
|
||||
}else if (i >= 100 && i < 1000) {
|
||||
json.put("struct_code", prefix + "-"+"0"+i+"-01");
|
||||
json.put("struct_name", prefix + "排-"+"0"+i+"列-01层");
|
||||
} else {
|
||||
json.put("struct_code", prefix + "-"+i+"-01");
|
||||
json.put("struct_name", prefix + "排-"+i+"列-01层");
|
||||
}
|
||||
JSONObject jsonObject = storTab.query("stor_id = '"+whereJson.getString("stor_id")+"'").uniqueResult(0);
|
||||
JSONObject jsonObjec2 = sectTab.query("stor_id = '"+whereJson.getString("stor_id")+"' and sect_id = '"+whereJson.getString("sect_id")+"'").uniqueResult(0);
|
||||
|
||||
// 新增仓位
|
||||
json.put("simple_name", json.getString("struct_name"));
|
||||
json.put("sect_id", jsonObjec2.getString("sect_id"));
|
||||
json.put("sect_code", jsonObjec2.getString("sect_code"));
|
||||
json.put("sect_name", jsonObjec2.getString("sect_name"));
|
||||
json.put("stor_id", jsonObject.getString("stor_id"));
|
||||
json.put("stor_code", jsonObject.getString("stor_code"));
|
||||
json.put("stor_name", jsonObject.getString("stor_name"));
|
||||
json.put("lock_type", "1");
|
||||
json.put("row_num", 1);
|
||||
json.put("col_num", i);
|
||||
json.put("layer_num", 1);
|
||||
json.put("block_num", 1);
|
||||
json.put("in_order_seq", i);
|
||||
json.put("out_order_seq", i);
|
||||
json.put("in_empty_seq", i);
|
||||
json.put("out_empty_seq", i);
|
||||
json.put("create_id", "1");
|
||||
json.put("create_name", "管理员");
|
||||
json.put("create_time", now);
|
||||
json.put("material_height_type", 1);
|
||||
attrTab.insert(json);
|
||||
|
||||
// 新增点位
|
||||
JSONObject jsonPoint = new JSONObject();
|
||||
jsonPoint.put("point_id",IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonPoint.put("point_code", json.getString("struct_code"));
|
||||
jsonPoint.put("point_name", json.getString("struct_name"));
|
||||
jsonPoint.put("region_id", json.getString("sect_id"));
|
||||
jsonPoint.put("region_code", json.getString("sect_code"));
|
||||
jsonPoint.put("region_name", json.getString("sect_name"));
|
||||
jsonPoint.put("point_type", "2");
|
||||
jsonPoint.put("point_status", "1");
|
||||
jsonPoint.put("lock_type", "1");
|
||||
jsonPoint.put("vehicle_max_qty", 0);
|
||||
jsonPoint.put("vehicle_qty", 0);
|
||||
jsonPoint.put("block_num", 1);
|
||||
jsonPoint.put("row_num", 1);
|
||||
jsonPoint.put("col_num", 1);
|
||||
jsonPoint.put("layer_num", 1);
|
||||
jsonPoint.put("in_order_seq", 0);
|
||||
jsonPoint.put("out_order_seq", 0);
|
||||
jsonPoint.put("in_empty_seq", 0);
|
||||
jsonPoint.put("out_empty_seq", 0);
|
||||
jsonPoint.put("is_have_workder", "0");
|
||||
jsonPoint.put("is_used", "1");
|
||||
jsonPoint.put("source_id", json.get("struct_id"));
|
||||
jsonPoint.put("is_delete", "0");
|
||||
jsonPoint.put("create_id", "1");
|
||||
jsonPoint.put("create_name", "管理员");
|
||||
jsonPoint.put("create_time", now);
|
||||
pointTab.insert(jsonPoint);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blurQuery(JSONObject whereJson) {
|
||||
// 仓位表
|
||||
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
|
||||
|
||||
/*
|
||||
* 判断前缀是否存在
|
||||
*/
|
||||
List<JSONObject> attrList = attrTab.query("1 = 1").getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
// 截取第一个 - 之前的数据集合
|
||||
List<String> subStringList = attrList.stream()
|
||||
.filter(row -> row.getString("struct_code").contains("-"))
|
||||
.map(row -> row.getString("struct_code").substring(0, row.getString("struct_code").indexOf("-")))
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 判断是否有相同的前缀
|
||||
boolean is_like = subStringList.stream()
|
||||
.anyMatch(row -> row.equals(whereJson.getString("prefix")));
|
||||
|
||||
if (is_like) {
|
||||
throw new BadRequestException("此前缀已存在,请更换!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ public class StructivtServiceImpl implements StructivtService {
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page, String[] product_area, String[] ivt_flag) {
|
||||
String material = MapUtil.getStr(whereJson, "material");
|
||||
//哈哈哈哈哈222
|
||||
String struct = MapUtil.getStr(whereJson, "struct");
|
||||
String stor_id = MapUtil.getStr(whereJson, "stor_id");
|
||||
String sect_id = MapUtil.getStr(whereJson, "sect_id");
|
||||
@@ -58,12 +57,14 @@ public class StructivtServiceImpl implements StructivtService {
|
||||
String sale_order_name = MapUtil.getStr(whereJson, "sale_order_name");
|
||||
String ivt_status = MapUtil.getStr(whereJson, "ivt_status");
|
||||
String is_virtual = MapUtil.getStr(whereJson, "is_virtual");
|
||||
String sub_type = MapUtil.getStr(whereJson, "sub_type");
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("stor_id", stor_id);
|
||||
map.put("sect_id", sect_id);
|
||||
map.put("ivt_status", ivt_status);
|
||||
map.put("is_virtual", is_virtual);
|
||||
map.put("sub_type", sub_type);
|
||||
if (StrUtil.isNotEmpty(material)) {
|
||||
map.put("material", "%" + material + "%");
|
||||
}
|
||||
@@ -220,11 +221,13 @@ public class StructivtServiceImpl implements StructivtService {
|
||||
String is_virtual = MapUtil.getStr(whereJson, "is_virtual");
|
||||
String rein_flag = MapUtil.getStr(whereJson, "rein_flag");
|
||||
String ivt_status = MapUtil.getStr(whereJson, "ivt_status");
|
||||
String sub_type = MapUtil.getStr(whereJson, "sub_type");
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "2");
|
||||
map.put("stor_id", stor_id);
|
||||
map.put("is_virtual", is_virtual);
|
||||
map.put("ivt_status", ivt_status);
|
||||
map.put("sub_type", sub_type);
|
||||
if (StrUtil.isNotEmpty(material)) {
|
||||
map.put("material", "%" + material + "%");
|
||||
}
|
||||
@@ -295,6 +298,14 @@ public class StructivtServiceImpl implements StructivtService {
|
||||
mp.put("业务员", json.getString("sales_owner"));
|
||||
mp.put("入库日期", json.getString("instorage_time"));
|
||||
mp.put("生产日期", json.getString("date_of_production"));
|
||||
if ("1".equals(json.getString("sub_type"))) {
|
||||
mp.put("子卷状态", "正常");
|
||||
} else if ("2".equals(json.getString("sub_type"))) {
|
||||
mp.put("子卷状态", "临期");
|
||||
} else if ("3".equals(json.getString("sub_type"))) {
|
||||
mp.put("子卷状态", "超期");
|
||||
}
|
||||
mp.put("库龄", json.getString("stock_age"));
|
||||
mp.put("产品规格(幅宽)", String.format("%.0f", json.getDoubleValue("width")));
|
||||
mp.put("产品厚度", json.getString("thickness"));
|
||||
mp.put("单位面积重量", json.getString("mass_per_unit_area"));
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
输入.is_virtual TYPEAS s_string
|
||||
输入.rein_flag TYPEAS f_string
|
||||
输入.in_stor_id TYPEAS f_string
|
||||
输入.sub_type TYPEAS s_string
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
@@ -73,7 +74,16 @@
|
||||
case when plan.paper_tube_or_FRP = '1' then '纸管' when plan.paper_tube_or_FRP = '2' then 'FRP管' end AS paper_type,
|
||||
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_material when plan.paper_tube_or_FRP = '2' then plan.FRP_material end AS paper_code,
|
||||
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_description when plan.paper_tube_or_FRP = '2' then plan.FRP_description end AS paper_name,
|
||||
sub.box_weight
|
||||
sub.box_weight,
|
||||
CASE
|
||||
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '60'
|
||||
AND DATEDIFF( NOW(), sub.date_of_production ) <= '90' THEN '2'
|
||||
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
|
||||
|
||||
FROM
|
||||
ST_IVT_StructIvt ivt
|
||||
LEFT JOIN st_ivt_structattr attr ON ivt.struct_id = attr.struct_id
|
||||
@@ -134,6 +144,19 @@
|
||||
attr.stor_id = 输入.stor_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sub_type = "1"
|
||||
DATEDIFF( NOW(), sub.date_of_production ) <= '90'
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sub_type = "2"
|
||||
DATEDIFF( NOW(), sub.date_of_production ) > '60'
|
||||
AND DATEDIFF( NOW(), sub.date_of_production ) <= '90'
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sub_type = "3"
|
||||
DATEDIFF( NOW(), sub.date_of_production ) > '90'
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sect_id <> ""
|
||||
attr.sect_id = 输入.sect_id
|
||||
ENDOPTION
|
||||
@@ -205,7 +228,14 @@
|
||||
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_description when plan.paper_tube_or_FRP = '2' then plan.FRP_description end AS paper_name,
|
||||
sub.thickness_request,
|
||||
sub.box_weight,
|
||||
cust.sales_owner
|
||||
cust.sales_owner,
|
||||
CASE
|
||||
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '60'
|
||||
AND DATEDIFF( NOW(), sub.date_of_production ) <= '90' THEN '2'
|
||||
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
|
||||
FROM
|
||||
ST_IVT_StructIvt ivt
|
||||
LEFT JOIN st_ivt_structattr attr ON ivt.struct_id = attr.struct_id
|
||||
@@ -249,6 +279,19 @@
|
||||
ivt.pcsn like 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sub_type = "1"
|
||||
DATEDIFF( NOW(), sub.date_of_production ) <= '90'
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sub_type = "2"
|
||||
DATEDIFF( NOW(), sub.date_of_production ) > '60'
|
||||
AND DATEDIFF( NOW(), sub.date_of_production ) <= '90'
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sub_type = "3"
|
||||
DATEDIFF( NOW(), sub.date_of_production ) > '90'
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sap_pcsn <> ""
|
||||
sub.sap_pcsn like 输入.sap_pcsn
|
||||
ENDOPTION
|
||||
|
||||
Binary file not shown.
@@ -250,6 +250,8 @@ public class SubpackagerelationServiceImpl implements SubpackagerelationService
|
||||
mp.put("子卷的物性值2", json.getString("un_plan_product_property2"));
|
||||
mp.put("子卷的物性值3", json.getString("un_plan_product_property3"));
|
||||
mp.put("木箱料号", json.getString("box_type"));
|
||||
mp.put("内控标准抗拉下限", json.getString("standard_limit"));
|
||||
mp.put("生产实际抗拉值", json.getString("actual_value"));
|
||||
mp.put("长", json.getString("box_length"));
|
||||
mp.put("宽", json.getString("box_width"));
|
||||
mp.put("高", json.getString("box_high"));
|
||||
|
||||
@@ -74,18 +74,79 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
map.put("bill_type", (String) whereJson.get("bill_type"));
|
||||
map.put("create_mode", (String) whereJson.get("create_mode"));
|
||||
map.put("bill_status", (String) whereJson.get("bill_status"));
|
||||
|
||||
String bill_code = MapUtil.getStr(whereJson, "bill_code");
|
||||
String sap_pcsn = MapUtil.getStr(whereJson, "sap_pcsn");
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
String box_no = MapUtil.getStr(whereJson, "box_no");
|
||||
String vbeln = MapUtil.getStr(whereJson, "vbeln");
|
||||
|
||||
|
||||
if (!ObjectUtil.isEmpty(bill_code)) {
|
||||
map.put("bill_code", "%" + bill_code + "%");
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(sap_pcsn)) {
|
||||
map.put("sap_pcsn", "%" + sap_pcsn + "%");
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(pcsn)) {
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(pcsn)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = pcsn.split(" ");
|
||||
String pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("pcsn_in", "('"+pcsn_in+"')");
|
||||
} else {
|
||||
map.put("pcsn", "%" + pcsn + "%");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(sap_pcsn)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = sap_pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = sap_pcsn.split(" ");
|
||||
String sap_pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("sap_pcsn_in", "('"+sap_pcsn_in+"')");
|
||||
} else {
|
||||
map.put("sap_pcsn", "%" + sap_pcsn + "%");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(box_no)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = box_no.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = box_no.split(" ");
|
||||
String box_no_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("box_no_in", "('"+box_no_in+"')");
|
||||
} else {
|
||||
map.put("box_no", "%" + box_no + "%");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(vbeln)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = vbeln.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = vbeln.split(" ");
|
||||
String vbeln_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("vbeln_in", "('"+vbeln_in+"')");
|
||||
} else {
|
||||
map.put("vbeln", "%" + vbeln + "%");
|
||||
}
|
||||
}
|
||||
|
||||
String begin_time = (String) whereJson.get("begin_time");
|
||||
|
||||
if (!StrUtil.isEmpty(begin_time)) {
|
||||
|
||||
@@ -449,6 +449,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
String lock_type = from.getString("lock_type");
|
||||
//载具编码
|
||||
String storagevehicle_code = from.getString("storagevehicle_code");
|
||||
String is_overdue = from.getString("is_overdue");
|
||||
if (StrUtil.isEmpty(struct_id) && StrUtil.isEmpty(point_code)) {
|
||||
throw new BadRequestException("点位仓位更新出入参数异常!");
|
||||
}
|
||||
@@ -479,6 +480,10 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
map.put("vehicle_code", storagevehicle_code);
|
||||
map.put("point_status", "01");
|
||||
}
|
||||
if ("1".equals(from.getString("is_overdue")) && StrUtil.isNotEmpty(is_overdue)) {
|
||||
map.put("storagevehicle_code", storagevehicle_code);
|
||||
}
|
||||
|
||||
wo_Struct.update(map, "struct_id = '" + jo.getString("struct_id") + "'");
|
||||
wo_Point.update(map, "point_id = '" + jo.getString("point_id") + "'");
|
||||
} else {//锁定
|
||||
|
||||
@@ -41,6 +41,11 @@
|
||||
输入.in_stor_id TYPEAS f_string
|
||||
输入.in_layer_num TYPEAS f_string
|
||||
输入.box_height TYPEAS s_string
|
||||
输入.vbeln TYPEAS s_string
|
||||
输入.pcsn_in TYPEAS f_string
|
||||
输入.sap_pcsn_in TYPEAS f_string
|
||||
输入.vbeln_in TYPEAS f_string
|
||||
输入.box_no_in TYPEAS f_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -68,10 +73,12 @@
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT DISTINCT
|
||||
ios.*
|
||||
ios.*,
|
||||
IFNULL(dtl.vbeln,'') as vbeln
|
||||
FROM
|
||||
ST_IVT_IOStorInv ios
|
||||
LEFT JOIN st_ivt_iostorinvdis dis ON dis.iostorinv_id = ios.iostorinv_id
|
||||
LEFT JOIN st_ivt_iostorinvdtl dtl ON ios.iostorinv_id = dtl.iostorinv_id
|
||||
LEFT JOIN st_ivt_iostorinvdis dis ON dtl.iostorinvdtl_id = dis.iostorinvdtl_id
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = dis.pcsn
|
||||
WHERE
|
||||
ios.is_delete = '0'
|
||||
@@ -79,30 +86,62 @@
|
||||
ios.io_type = '0'
|
||||
AND ios.stor_id in 输入.in_stor_id
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
dis.box_no like 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_no_in <> ""
|
||||
dis.box_no IN 输入.box_no_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.vbeln <> ""
|
||||
dtl.vbeln like 输入.vbeln
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.vbeln_in <> ""
|
||||
dtl.vbeln IN 输入.vbeln_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.bill_code <> ""
|
||||
ios.bill_code like 输入.bill_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sap_pcsn <> ""
|
||||
sub.sap_pcsn like 输入.sap_pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sap_pcsn_in <> ""
|
||||
sub.sap_pcsn IN 输入.sap_pcsn_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn <> ""
|
||||
dis.pcsn like 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn_in <> ""
|
||||
dis.pcsn IN 输入.pcsn_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.stor_id <> ""
|
||||
ios.stor_id = 输入.stor_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.bill_type <> ""
|
||||
ios.bill_type = 输入.bill_type
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.create_mode <> ""
|
||||
ios.create_mode = 输入.create_mode
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.bill_status <> ""
|
||||
ios.bill_status = 输入.bill_status
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
ios.input_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
ios.input_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.st.instor.rest;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -9,7 +10,9 @@ import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@@ -82,4 +85,10 @@ public class ProductScrapController {
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/importExcel")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> importExcel(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
|
||||
return new ResponseEntity<>(productScrapService.importExcel(file, request),HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,10 @@ package org.nl.wms.st.instor.service;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ProductScrapService {
|
||||
@@ -65,4 +68,12 @@ public interface ProductScrapService {
|
||||
* @param whereJson /
|
||||
*/
|
||||
void onSubmit(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 导入excel
|
||||
* @param file : 文件
|
||||
* @param request post请求
|
||||
* @return
|
||||
*/
|
||||
ArrayList<JSONObject> importExcel(MultipartFile file, HttpServletRequest request);
|
||||
}
|
||||
|
||||
@@ -830,15 +830,62 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
if (StrUtil.isNotEmpty(map.get("struct_code"))) {
|
||||
map.put("struct_code", "%" + map.get("struct_code") + "%");
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
|
||||
// 判断是否有空格
|
||||
String pcsn = MapUtil.getStr(map, "pcsn");
|
||||
|
||||
boolean matches = pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = pcsn.split(" ");
|
||||
String pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("pcsn_in", "('"+pcsn_in+"')");
|
||||
map.put("pcsn", "");
|
||||
} else {
|
||||
map.put("pcsn", "%" + map.get("pcsn") + "%");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("sap_pcsn"))) {
|
||||
// 判断是否有空格
|
||||
String sap_pcsn = MapUtil.getStr(map, "sap_pcsn");
|
||||
|
||||
boolean matches = sap_pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = sap_pcsn.split(" ");
|
||||
String sap_pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("sap_pcsn_in", "('"+sap_pcsn_in+"')");
|
||||
map.put("sap_pcsn", "");
|
||||
} else {
|
||||
map.put("sap_pcsn", "%" + map.get("sap_pcsn") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("package_box_sn"))) {
|
||||
map.put("package_box_sn", "%" + map.get("package_box_sn") + "%");
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("package_box_sn"))) {
|
||||
// 判断是否有空格
|
||||
String package_box_sn = MapUtil.getStr(map, "package_box_sn");
|
||||
|
||||
boolean matches = package_box_sn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = package_box_sn.split(" ");
|
||||
String box_no_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("package_box_sn_in", "('"+box_no_in+"')");
|
||||
map.put("package_box_sn", "");
|
||||
} else {
|
||||
map.put("package_box_sn", "%" + map.get("package_box_sn") + "%");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(map.get("sale_order_name"))) {
|
||||
map.put("sale_order_name", "%" + map.get("sale_order_name") + "%");
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ 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 cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -28,7 +30,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -448,4 +454,69 @@ public class ProductScrapServiceImpl implements ProductScrapService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ArrayList<JSONObject> importExcel(MultipartFile file, HttpServletRequest request) {
|
||||
// 1.获取上传文件输入流
|
||||
InputStream inputStream = null;
|
||||
|
||||
try {
|
||||
inputStream = file.getInputStream();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
ExcelReader excelReader = ExcelUtil.getReader(inputStream);
|
||||
List<List<Object>> read = excelReader.read(1, excelReader.getRowCount());
|
||||
|
||||
// 获取此仓库的所有库存
|
||||
String stor_id = request.getParameter("stor_id");
|
||||
|
||||
UserStorServiceImpl userStorService = new UserStorServiceImpl();
|
||||
String in_stor_id = userStorService.getInStor();
|
||||
|
||||
List<JSONObject> ivtList = WQL.getWO("QST_IVT_HANDMOVESTOR")
|
||||
.addParam("flag", "3").addParam("stor_id", stor_id).addParam("in_stor_id",in_stor_id)
|
||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
// 循环获取的数据
|
||||
ArrayList<JSONObject> resultList = new ArrayList<>();
|
||||
for (int i = 0; i < read.size(); i++) {
|
||||
List list = read.get(i);
|
||||
|
||||
// pcsn
|
||||
String pcsn = list.get(0).toString();
|
||||
// sap批次号
|
||||
String sap_pcsn = list.get(1).toString();
|
||||
// 木箱号
|
||||
String box_no = list.get(2).toString();
|
||||
// 重量
|
||||
String qty = list.get(3).toString();
|
||||
|
||||
// 子卷号和批次号必须有一个不为空
|
||||
if (ObjectUtil.isEmpty(pcsn) && ObjectUtil.isEmpty(sap_pcsn)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 匹配库存
|
||||
List<JSONObject> oneList = ivtList.stream()
|
||||
.filter(row -> row.getString("pcsn").equals(pcsn) ||
|
||||
row.getString("sap_pcsn").equals(sap_pcsn)
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(oneList)) {
|
||||
JSONObject json = oneList.get(0);
|
||||
|
||||
// 匹配相同箱号的数据
|
||||
List<JSONObject> boxList = ivtList.stream()
|
||||
.filter(row -> row.getString("storagevehicle_code").equals(json.getString("storagevehicle_code")))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
resultList.addAll(boxList);
|
||||
}
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@
|
||||
输入.ids TYPEAS f_string
|
||||
输入.deptIds TYPEAS f_string
|
||||
输入.in_stor_id TYPEAS f_string
|
||||
输入.package_box_sn_in TYPEAS f_string
|
||||
输入.sap_pcsn_in TYPEAS f_string
|
||||
输入.pcsn_in TYPEAS f_string
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
@@ -188,33 +191,55 @@
|
||||
OPTION 输入.material_id <> ""
|
||||
ivt2.material_id = 输入.material_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.remark <> ""
|
||||
(mb.material_code like 输入.remark or mb.material_name like 输入.remark)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.ids <> ""
|
||||
struct.storagevehicle_code in (输入.ids)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.struct_code <> ""
|
||||
struct.struct_code like 输入.struct_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.stor_id <> ""
|
||||
struct.stor_id = 输入.stor_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sect_id <> ""
|
||||
struct.sect_id = 输入.sect_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn <> ""
|
||||
ivt2.pcsn like 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn_in <> ""
|
||||
ivt2.pcsn IN 输入.pcsn_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sap_pcsn <> ""
|
||||
sub.sap_pcsn like 输入.sap_pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sap_pcsn_in <> ""
|
||||
sub.sap_pcsn IN 输入.sap_pcsn_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.package_box_sn <> ""
|
||||
sub.package_box_sn like 输入.package_box_sn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.package_box_sn_in <> ""
|
||||
sub.package_box_sn IN 输入.package_box_sn_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sale_order_name <> ""
|
||||
sub.sale_order_name like 输入.sale_order_name
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.nl.wms.st.inbill.service.StorPublicService;
|
||||
import org.nl.wms.st.instor.service.HandMoveStorService;
|
||||
import org.nl.wms.st.instor.service.impl.HandMoveStorServiceImpl;
|
||||
import org.nl.wms.st.instor.task.HandMoveStorAcsTask;
|
||||
import org.nl.wms.st.returns.service.InAndOutReturnService;
|
||||
import org.nl.wms.st.returns.service.impl.InAndOutRetrunServiceImpl;
|
||||
import org.nl.wms.util.TranUtil;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -44,6 +45,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* PC端出入库新增
|
||||
@@ -58,6 +60,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
private final HandMoveStorService handMoveStorService;
|
||||
private final OutTask outTask;
|
||||
private final HandMoveStorAcsTask moveStorAcsTask;
|
||||
private final InAndOutReturnService inAndOutReturnService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> pageQuery(Map whereJson, Pageable page, String[] stor_id, String[] bill_status, String[] bill_type) {
|
||||
@@ -76,24 +79,87 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
if (StrUtil.isNotEmpty(map.get("is_upload"))) {
|
||||
map.put("is_upload", map.get("is_upload"));
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
|
||||
map.put("pcsn", "%" + map.get("pcsn") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("material_code"))) {
|
||||
map.put("material_code", "%" + map.get("material_code") + "%");
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("vbeln"))) {
|
||||
// 判断是否有空格
|
||||
String vbeln = MapUtil.getStr(map, "vbeln");
|
||||
|
||||
boolean matches = vbeln.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = vbeln.split(" ");
|
||||
String vbeln_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("vbeln_in", "('"+vbeln_in+"')");
|
||||
map.put("vbeln", "");
|
||||
} else {
|
||||
map.put("vbeln", "%" + map.get("vbeln") + "%");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("box_no"))) {
|
||||
// 判断是否有空格
|
||||
String box_no = MapUtil.getStr(map, "box_no");
|
||||
|
||||
boolean matches = box_no.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = box_no.split(" ");
|
||||
String box_no_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("box_no_in", "('"+box_no_in+"')");
|
||||
map.put("box_no", "");
|
||||
} else {
|
||||
map.put("box_no", "%" + map.get("box_no") + "%");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(map.get("width"))) {
|
||||
map.put("width", "%" + map.get("width") + "%");
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
|
||||
// 判断是否有空格
|
||||
String pcsn = MapUtil.getStr(map, "pcsn");
|
||||
|
||||
boolean matches = pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = pcsn.split(" ");
|
||||
String pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("pcsn_in", "('"+pcsn_in+"')");
|
||||
map.put("pcsn", "");
|
||||
} else {
|
||||
map.put("pcsn", "%" + map.get("pcsn") + "%");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("sap_pcsn"))) {
|
||||
// 判断是否有空格
|
||||
String sap_pcsn = MapUtil.getStr(map, "sap_pcsn");
|
||||
|
||||
boolean matches = sap_pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = sap_pcsn.split(" ");
|
||||
String sap_pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("sap_pcsn_in", "('"+sap_pcsn_in+"')");
|
||||
map.put("sap_pcsn", "");
|
||||
} else {
|
||||
map.put("sap_pcsn", "%" + map.get("sap_pcsn") + "%");
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(map.get("cust_code"))) {
|
||||
map.put("cust_code", "%" + map.get("cust_code") + "%");
|
||||
}
|
||||
@@ -151,23 +217,65 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
map.put("flag", "7");
|
||||
map.put("begin_time", MapUtil.getStr(whereJson, "begin_time"));
|
||||
map.put("end_time", MapUtil.getStr(whereJson, "end_time"));
|
||||
map.put("sap_pcsn", MapUtil.getStr(whereJson, "sap_pcsn"));
|
||||
map.put("stor_id", MapUtil.getStr(whereJson, "stor_id"));
|
||||
map.put("package_box_sn", MapUtil.getStr(whereJson, "package_box_sn"));
|
||||
map.put("canuse_qty", "0");
|
||||
|
||||
if (StrUtil.isNotEmpty(map.get("material_code"))) {
|
||||
map.put("material_code", "%" + map.get("material_code") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
|
||||
map.put("pcsn", "%" + map.get("pcsn") + "%");
|
||||
|
||||
// 空格查询
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
if (StrUtil.isNotEmpty(pcsn)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = pcsn.split(" ");
|
||||
String pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("pcsn_in", "('"+pcsn_in+"')");
|
||||
map.put("pcsn", "");
|
||||
} else {
|
||||
map.put("pcsn", "%" + pcsn + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("sap_pcsn"))) {
|
||||
map.put("sap_pcsn", "%" + map.get("sap_pcsn") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("package_box_sn"))) {
|
||||
map.put("package_box_sn", "%" + map.get("package_box_sn") + "%");
|
||||
|
||||
// 空格查询
|
||||
String sap_pcsn = MapUtil.getStr(whereJson, "sap_pcsn");
|
||||
if (StrUtil.isNotEmpty(sap_pcsn)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = sap_pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = sap_pcsn.split(" ");
|
||||
String sap_pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("sap_pcsn_in", "('"+sap_pcsn_in+"')");
|
||||
map.put("sap_pcsn", "");
|
||||
} else {
|
||||
map.put("sap_pcsn", "%" + sap_pcsn + "%");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
String package_box_sn = MapUtil.getStr(whereJson, "package_box_sn");
|
||||
if (StrUtil.isNotEmpty(package_box_sn)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = package_box_sn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = package_box_sn.split(" ");
|
||||
String package_box_sn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("box_no_in", "('"+package_box_sn_in+"')");
|
||||
map.put("box_no", "");
|
||||
} else {
|
||||
map.put("box_no", "%" + map.get("package_box_sn") + "%");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(map.get("width_standard"))) {
|
||||
map.put("width_standard", map.get("width_standard"));
|
||||
}
|
||||
@@ -733,24 +841,87 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
if (StrUtil.isNotEmpty(map.get("is_upload"))) {
|
||||
map.put("is_upload", map.get("is_upload"));
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
|
||||
map.put("pcsn", "%" + map.get("pcsn") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("material_code"))) {
|
||||
map.put("material_code", "%" + map.get("material_code") + "%");
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("vbeln"))) {
|
||||
// 判断是否有空格
|
||||
String vbeln = MapUtil.getStr(map, "vbeln");
|
||||
|
||||
boolean matches = vbeln.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = vbeln.split(" ");
|
||||
String vbeln_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("vbeln_in", "('"+vbeln_in+"')");
|
||||
map.put("vbeln", "");
|
||||
} else {
|
||||
map.put("vbeln", "%" + map.get("vbeln") + "%");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("box_no"))) {
|
||||
// 判断是否有空格
|
||||
String box_no = MapUtil.getStr(map, "box_no");
|
||||
|
||||
boolean matches = box_no.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = box_no.split(" ");
|
||||
String box_no_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("box_no_in", "('"+box_no_in+"')");
|
||||
map.put("box_no", "");
|
||||
} else {
|
||||
map.put("box_no", "%" + map.get("box_no") + "%");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(map.get("width"))) {
|
||||
map.put("width", "%" + map.get("width") + "%");
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
|
||||
// 判断是否有空格
|
||||
String pcsn = MapUtil.getStr(map, "pcsn");
|
||||
|
||||
boolean matches = pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = pcsn.split(" ");
|
||||
String pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("pcsn_in", "('"+pcsn_in+"')");
|
||||
map.put("pcsn", "");
|
||||
} else {
|
||||
map.put("pcsn", "%" + map.get("pcsn") + "%");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("sap_pcsn"))) {
|
||||
// 判断是否有空格
|
||||
String sap_pcsn = MapUtil.getStr(map, "sap_pcsn");
|
||||
|
||||
boolean matches = sap_pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = sap_pcsn.split(" ");
|
||||
String sap_pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("sap_pcsn_in", "('"+sap_pcsn_in+"')");
|
||||
map.put("sap_pcsn", "");
|
||||
} else {
|
||||
map.put("sap_pcsn", "%" + map.get("sap_pcsn") + "%");
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(map.get("cust_code"))) {
|
||||
map.put("cust_code", "%" + map.get("cust_code") + "%");
|
||||
}
|
||||
@@ -1108,6 +1279,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
dtl.put("is_issued", "0");
|
||||
dtl.put("plan_qty", ivt2.getDoubleValue("change_qty"));
|
||||
dtl.put("real_qty", ivt2.getDoubleValue("change_qty"));
|
||||
dtl.put("is_overdue", ivt2.getString("is_overdue"));
|
||||
dtl.put("instorage_time", ivt2.getString("instorage_time"));
|
||||
|
||||
// 如果所属仓位是虚拟区 则将分配明细状态变为生成
|
||||
JSONObject jsonSect = wo_sect.query("sect_id = '" + ivt2.getString("sect_id") + "'").uniqueResult(0);
|
||||
if (StrUtil.equals(jsonSect.getString("sect_type_attr"), "09")) {
|
||||
@@ -1115,6 +1289,12 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
} else {
|
||||
dtl.put("work_status", "00");
|
||||
}
|
||||
|
||||
// 判断是否超期
|
||||
if (ivt2.getString("is_overdue").equals("1")) {
|
||||
dtl.put("work_status", "01");
|
||||
}
|
||||
|
||||
wo_dis.insert(dtl);
|
||||
}
|
||||
//记录需锁定的仓位
|
||||
@@ -1167,6 +1347,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
dtl.put("is_issued", "0");
|
||||
dtl.put("plan_qty", jsonIvt.getDoubleValue("change_qty"));
|
||||
dtl.put("real_qty", jsonIvt.getDoubleValue("change_qty"));
|
||||
dtl.put("is_overdue", jsonIvt.getString("is_overdue"));
|
||||
dtl.put("instorage_time", jsonIvt.getString("instorage_time"));
|
||||
// 如果所属仓位是虚拟区 则将分配明细状态变为生成
|
||||
JSONObject jsonSect = wo_sect.query("sect_id = '" + jsonIvt.getString("sect_id") + "'").uniqueResult(0);
|
||||
if (StrUtil.equals(jsonSect.getString("sect_type_attr"), "09")) {
|
||||
@@ -1174,6 +1356,11 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
} else {
|
||||
dtl.put("work_status", "00");
|
||||
}
|
||||
|
||||
// 判断是否超期
|
||||
if (jsonIvt.getString("is_overdue").equals("1")) {
|
||||
dtl.put("work_status", "01");
|
||||
}
|
||||
wo_dis.insert(dtl);
|
||||
|
||||
//记录需锁定的仓位 (如果此明细有相同物料的且子卷号不能为空的则在最后一个明细分配完成后锁定仓位)
|
||||
@@ -1347,6 +1534,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
dtl.put("is_issued", "0");
|
||||
dtl.put("plan_qty", ivt2.getDoubleValue("change_qty"));
|
||||
dtl.put("real_qty", ivt2.getDoubleValue("change_qty"));
|
||||
dtl.put("instorage_time", ivt2.getString("instorage_time"));
|
||||
// 如果所属仓位是虚拟区 则将分配明细状态变为生成
|
||||
JSONObject jsonSect = wo_sect.query("sect_id = '" + ivt2.getString("sect_id") + "'").uniqueResult(0);
|
||||
if (StrUtil.equals(jsonSect.getString("sect_type_attr"), "09")) {
|
||||
@@ -1406,6 +1594,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
dtl.put("is_issued", "0");
|
||||
dtl.put("plan_qty", jsonIvt.getDoubleValue("change_qty"));
|
||||
dtl.put("real_qty", jsonIvt.getDoubleValue("change_qty"));
|
||||
dtl.put("instorage_time", jsonIvt.getString("instorage_time"));
|
||||
// 如果所属仓位是虚拟区 则将分配明细状态变为生成
|
||||
JSONObject jsonSect = wo_sect.query("sect_id = '" + jsonIvt.getString("sect_id") + "'").uniqueResult(0);
|
||||
if (StrUtil.equals(jsonSect.getString("sect_type_attr"), "09")) {
|
||||
@@ -4195,6 +4384,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
dtl.put("is_issued", "0");
|
||||
dtl.put("plan_qty", ivt.getDoubleValue("change_qty"));
|
||||
dtl.put("real_qty", ivt.getDoubleValue("change_qty"));
|
||||
dtl.put("instorage_time", ivt.getString("instorage_time"));
|
||||
// 如果所属仓位是虚拟区 则将分配明细状态变为生成
|
||||
JSONObject jsonSect = wo_sect.query("sect_id = '" + ivt.getString("sect_id") + "'").uniqueResult(0);
|
||||
if (StrUtil.equals(jsonSect.getString("sect_type_attr"), "09")) {
|
||||
@@ -4263,6 +4453,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
json.put("is_issued", "0");
|
||||
json.put("plan_qty", ivt.getDoubleValue("change_qty"));
|
||||
json.put("real_qty", ivt.getDoubleValue("change_qty"));
|
||||
json.put("instorage_time", ivt.getString("instorage_time"));
|
||||
// 如果所属仓位是虚拟区 则将分配明细状态变为生成
|
||||
JSONObject jsonSect = wo_sect.query("sect_id = '" + ivt.getString("sect_id") + "'").uniqueResult(0);
|
||||
if (StrUtil.equals(jsonSect.getString("sect_type_attr"), "09")) {
|
||||
@@ -4393,15 +4584,29 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
dis.put("inv_id", iostorinv_id);
|
||||
dis.put("bill_code", jo_mst.getString("bill_code"));
|
||||
dis.put("bill_table", "ST_IVT_IOStorInv");
|
||||
|
||||
if (dis.getString("is_overdue").equals("1")) {
|
||||
storPublicService.IOStor(dis, "12");
|
||||
} else {
|
||||
storPublicService.IOStor(dis, "21");
|
||||
}
|
||||
}
|
||||
//解锁起点
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("struct_id", dis.getString("struct_id"));
|
||||
from_start.put("lock_type", "1");
|
||||
from_start.put("is_overdue", dis.getString("is_overdue"));
|
||||
if (dis.getString("is_overdue").equals("1")) {
|
||||
from_start.put("storagevehicle_code", dis.getString("box_no"));
|
||||
} else {
|
||||
from_start.put("storagevehicle_code", "");
|
||||
}
|
||||
storPublicService.updateStructAndPoint(from_start);
|
||||
|
||||
if (dis.getString("is_overdue").equals("1")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//查询对应明细
|
||||
JSONObject dtl_jo = WQLObject.getWQLObject("st_ivt_iostorinvdtl").query("iostorinvdtl_id = '" + dis.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
// 更新子卷包装关系表 状态 - 3
|
||||
@@ -4459,7 +4664,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
}
|
||||
|
||||
JSONObject mst_row = mst_wql.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
||||
JSONArray dis_rows = dis_wql.query("iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
|
||||
JSONArray dis_rows = dis_wql.query("iostorinv_id = '" + iostorinv_id + "' and is_overdue = '0'").getResultJSONArray(0);
|
||||
|
||||
//生成手工入库单
|
||||
String new_iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
@@ -4485,8 +4690,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
jo_mst.put("update_optname", nickName);
|
||||
jo_mst.put("update_time", now);
|
||||
jo_mst.put("out_stor_id", out_jo.getString("stor_id"));
|
||||
mst_wql.insert(jo_mst);
|
||||
|
||||
double total_qty = 0.00;
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
//插入明细表
|
||||
String iostorinvdtl_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
@@ -4523,11 +4728,26 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
//插入分配表
|
||||
dis_wql.insert(dis_row);
|
||||
|
||||
total_qty = NumberUtil.add(total_qty,dis_row.getDoubleValue("plan_qty"));
|
||||
|
||||
//将包装关系中对应的记录状态改为包装
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("status", "1");
|
||||
WQLObject.getWQLObject("PDM_BI_SubPackageRelation").update(map, "package_box_SN = '" + dis_row.getString("box_no") + "' AND status = '3'");
|
||||
}
|
||||
|
||||
// 查询所有明细并计算实际重量
|
||||
List<JSONObject> dtlList = dtl_wql.query("iostorinv_id = '" + iostorinv_id + "'")
|
||||
.getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
double assign_qty = dtlList.stream()
|
||||
.map(row -> row.getDoubleValue("assign_qty"))
|
||||
.reduce(Double::sum).orElse(0.00);
|
||||
|
||||
jo_mst.put("detail_count", dis_rows.size());
|
||||
// jo_mst.put("total_qty", total_qty);
|
||||
jo_mst.put("total_qty", assign_qty);
|
||||
mst_wql.insert(jo_mst);
|
||||
}
|
||||
|
||||
/*if (out_jo.getString("bill_type").equals("1003")) {
|
||||
@@ -4547,7 +4767,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
if ("1003".equals(out_jo.getString("bill_type")) || "1006".equals(out_jo.getString("bill_type"))) {
|
||||
//如果为返检出库或者改切出库删除对应的包装关系
|
||||
JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
|
||||
JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "' and is_overdue = '0'").getResultJSONArray(0);
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
JSONObject dis_row = dis_rows.getJSONObject(i);
|
||||
String sect_code = dis_row.getString("sect_code");
|
||||
@@ -5106,6 +5326,15 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_IOStorInv");
|
||||
mstTab.update(whereJson);
|
||||
|
||||
// 回传sap
|
||||
JSONObject jsonMst = mstTab.query("iostorinv_id = '" + whereJson.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
|
||||
JSONArray jsonArr = new JSONArray();
|
||||
jsonArr.add(jsonMst);
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("rows", jsonArr);
|
||||
inAndOutReturnService.uploadSAP(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -61,6 +61,10 @@
|
||||
输入.storIds TYPEAS f_string
|
||||
输入.billStatuses TYPEAS f_string
|
||||
输入.billTypes TYPEAS f_string
|
||||
输入.pcsn_in TYPEAS f_string
|
||||
输入.sap_pcsn_in TYPEAS f_string
|
||||
输入.vbeln_in TYPEAS f_string
|
||||
输入.box_no_in TYPEAS f_string
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
@@ -125,6 +129,10 @@
|
||||
sub.sap_pcsn like 输入.sap_pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sap_pcsn_in <> ""
|
||||
sub.sap_pcsn IN 输入.sap_pcsn_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.cust_code <> ""
|
||||
(cu.cust_code like 输入.cust_code or
|
||||
cu.cust_simple_name like 输入.cust_code)
|
||||
@@ -134,6 +142,10 @@
|
||||
dis.pcsn like 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn_in <> ""
|
||||
dis.pcsn IN 输入.pcsn_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.is_upload <> ""
|
||||
ios.is_upload = 输入.is_upload
|
||||
ENDOPTION
|
||||
@@ -146,10 +158,22 @@
|
||||
dtl.vbeln like 输入.vbeln
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.vbeln_in <> ""
|
||||
dtl.vbeln IN 输入.vbeln_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.width <> ""
|
||||
dtl.width like 输入.width
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
dis.box_no like 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_no_in <> ""
|
||||
dis.box_no IN 输入.box_no_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.billTypes <> ""
|
||||
ios.bill_type in 输入.billTypes
|
||||
ENDOPTION
|
||||
@@ -222,6 +246,24 @@
|
||||
sub.sap_pcsn like 输入.sap_pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sap_pcsn_in <> ""
|
||||
sub.sap_pcsn IN 输入.sap_pcsn_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn_in <> ""
|
||||
dis.pcsn IN 输入.pcsn_in
|
||||
ENDOPTION
|
||||
|
||||
|
||||
OPTION 输入.vbeln_in <> ""
|
||||
dtl.vbeln IN 输入.vbeln_in
|
||||
ENDOPTION
|
||||
|
||||
|
||||
OPTION 输入.box_no_in <> ""
|
||||
dis.box_no IN 输入.box_no_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.cust_code <> ""
|
||||
(cu.cust_code like 输入.cust_code or
|
||||
cu.cust_simple_name like 输入.cust_code)
|
||||
@@ -736,14 +778,26 @@
|
||||
sub.sap_pcsn like 输入.sap_pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.package_box_sn <> ""
|
||||
sub.package_box_sn like 输入.package_box_sn
|
||||
OPTION 输入.sap_pcsn_in <> ""
|
||||
sub.sap_pcsn IN 输入.sap_pcsn_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
sub.package_box_sn like 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_no_in <> ""
|
||||
sub.package_box_sn IN 输入.box_no_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn <> ""
|
||||
ivt.pcsn like 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn_in <> ""
|
||||
ivt.pcsn IN 输入.pcsn_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
ivt.instorage_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
@@ -752,10 +806,6 @@
|
||||
ivt.instorage_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
attr.storagevehicle_code = 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.canuse_qty <> ""
|
||||
ivt.canuse_qty > 输入.canuse_qty
|
||||
ENDOPTION
|
||||
@@ -1102,6 +1152,20 @@
|
||||
point_code1 IN 输入.struct_codes
|
||||
AND task_status IN ('05','06')
|
||||
AND is_delete = '0'
|
||||
|
||||
UNION
|
||||
|
||||
SELECT
|
||||
point_code1
|
||||
FROM
|
||||
sch_base_task
|
||||
WHERE
|
||||
point_code1 IN 输入.struct_codes
|
||||
AND task_status IN ('07')
|
||||
AND is_delete = '0'
|
||||
AND task_type = '010503'
|
||||
AND DATEDIFF( NOW(), LEFT(update_time,10) ) <= 2
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -60,7 +60,10 @@
|
||||
attr.sect_code,
|
||||
attr.sect_name,
|
||||
attr.struct_name,
|
||||
attr.struct_code
|
||||
attr.struct_code,
|
||||
CASE
|
||||
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '90' THEN '1' ELSE '0'
|
||||
END AS is_overdue
|
||||
FROM
|
||||
ST_IVT_StructIvt ivt
|
||||
LEFT JOIN ST_IVT_StructAttr attr ON attr.struct_id = ivt.struct_id
|
||||
@@ -159,10 +162,14 @@
|
||||
attr.sect_code,
|
||||
attr.sect_name,
|
||||
attr.struct_name,
|
||||
attr.struct_code
|
||||
attr.struct_code,
|
||||
CASE
|
||||
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '90' THEN '1' ELSE '0'
|
||||
END AS is_overdue
|
||||
FROM
|
||||
ST_IVT_StructIvt ivt
|
||||
LEFT JOIN ST_IVT_StructAttr attr ON attr.struct_id = ivt.struct_id
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = ivt.pcsn
|
||||
WHERE
|
||||
ivt.quality_scode = '01'
|
||||
AND attr.lock_type = '1'
|
||||
|
||||
@@ -45,7 +45,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
|
||||
HashMap map = new HashMap<>(whereJson);
|
||||
String bill_code = MapUtil.getStr(whereJson, "bill_code");
|
||||
String box_no = MapUtil.getStr(whereJson, "box_no");
|
||||
String material_search = MapUtil.getStr(whereJson, "material_search");
|
||||
map.put("flag", "1");
|
||||
map.put("stor_id", MapUtil.getStr(whereJson, "stor_id"));
|
||||
@@ -55,19 +54,84 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
map.put("is_upload", MapUtil.getStr(whereJson, "is_upload"));
|
||||
map.put("begin_time", MapUtil.getStr(whereJson, "begin_time"));
|
||||
map.put("end_time", MapUtil.getStr(whereJson, "end_time"));
|
||||
map.put("pcsn", MapUtil.getStr(whereJson, "pcsn"));
|
||||
map.put("sap_pcsn", MapUtil.getStr(whereJson, "sap_pcsn"));
|
||||
map.put("is_writeoff", MapUtil.getStr(whereJson, "is_writeoff"));
|
||||
map.put("vbeln", MapUtil.getStr(whereJson, "vbeln"));
|
||||
|
||||
// 空格查询
|
||||
String vbeln = MapUtil.getStr(map, "vbeln");
|
||||
if (StrUtil.isNotEmpty(vbeln)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = vbeln.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = vbeln.split(" ");
|
||||
String vbeln_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("vbeln_in", "('"+vbeln_in+"')");
|
||||
map.put("vbeln", "");
|
||||
} else {
|
||||
map.put("vbeln", "%" + map.get("vbeln") + "%");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
String box_no = MapUtil.getStr(map, "box_no");
|
||||
if (StrUtil.isNotEmpty(box_no)) {
|
||||
// 判断是否有空格
|
||||
|
||||
boolean matches = box_no.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = box_no.split(" ");
|
||||
String box_no_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("box_no_in", "('"+box_no_in+"')");
|
||||
map.put("box_no", "");
|
||||
} else {
|
||||
map.put("box_no", "%" + map.get("box_no") + "%");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
String pcsn = MapUtil.getStr(map, "pcsn");
|
||||
if (StrUtil.isNotEmpty(pcsn)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = pcsn.split(" ");
|
||||
String pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("pcsn_in", "('"+pcsn_in+"')");
|
||||
map.put("pcsn", "");
|
||||
} else {
|
||||
map.put("pcsn", "%" + map.get("pcsn") + "%");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
String sap_pcsn = MapUtil.getStr(map, "sap_pcsn");
|
||||
if (StrUtil.isNotEmpty(sap_pcsn)) {
|
||||
// 判断是否有空格
|
||||
boolean matches = sap_pcsn.matches(".*\\s.*");
|
||||
|
||||
if (matches) {
|
||||
String[] s = sap_pcsn.split(" ");
|
||||
String sap_pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("sap_pcsn_in", "('"+sap_pcsn_in+"')");
|
||||
map.put("sap_pcsn", "");
|
||||
} else {
|
||||
map.put("sap_pcsn", "%" + map.get("sap_pcsn") + "%");
|
||||
}
|
||||
}
|
||||
|
||||
if (!ObjectUtil.isEmpty(bill_code)) {
|
||||
map.put("bill_code", "%" + bill_code + "%");
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(material_search)) {
|
||||
map.put("material_search", "%" + material_search + "%");
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(box_no)) {
|
||||
map.put("box_no", "%" + box_no + "%");
|
||||
}
|
||||
|
||||
//获取人员对应的仓库
|
||||
UserStorServiceImpl userStorService = new UserStorServiceImpl();
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
输入.ids TYPEAS f_string
|
||||
输入.box_no TYPEAS s_string
|
||||
输入.in_stor_id TYPEAS f_string
|
||||
输入.pcsn_in TYPEAS f_string
|
||||
输入.sap_pcsn_in TYPEAS f_string
|
||||
输入.vbeln_in TYPEAS f_string
|
||||
输入.box_no_in TYPEAS f_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -78,9 +82,15 @@
|
||||
INNER JOIN md_me_materialbase mb ON mb.material_id = dtl.material_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.vbeln <> ""
|
||||
dtl.vbeln = 输入.vbeln
|
||||
dtl.vbeln like 输入.vbeln
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.vbeln_in <> ""
|
||||
dtl.vbeln IN 输入.vbeln_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.material_search <> ""
|
||||
(
|
||||
mb.material_code like 输入.material_search
|
||||
@@ -101,14 +111,29 @@
|
||||
WHERE
|
||||
1=1
|
||||
OPTION 输入.pcsn <> ""
|
||||
dis.pcsn = 输入.pcsn
|
||||
dis.pcsn like 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn_in <> ""
|
||||
dis.pcsn IN 输入.pcsn_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sap_pcsn <> ""
|
||||
sub.sap_pcsn = 输入.sap_pcsn
|
||||
sub.sap_pcsn like 输入.sap_pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sap_pcsn_in <> ""
|
||||
sub.sap_pcsn IN 输入.sap_pcsn_in
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
dis.box_no like 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_no_in <> ""
|
||||
dis.box_no IN 输入.box_no_in
|
||||
ENDOPTION
|
||||
|
||||
GROUP BY
|
||||
iostorinv_id
|
||||
) b ON b.iostorinv_id = mst.iostorinv_id
|
||||
|
||||
@@ -295,6 +295,7 @@ public class OutBillQueryServiceImpl implements OutBillQueryService {
|
||||
mp.put("sap批次", json.getString("sap_pcsn"));
|
||||
mp.put("净重", json.getString("net_weight"));
|
||||
mp.put("单位", json.getString("qty_unit_name"));
|
||||
mp.put("管件类型", json.getString("paper_type"));
|
||||
mp.put("客户编码", json.getString("customer_name"));
|
||||
mp.put("发货客户名称", json.getString("customer_description"));
|
||||
if (ObjectUtil.isEmpty(json.getString("sale_order_name"))) {
|
||||
|
||||
@@ -136,6 +136,25 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="子卷状态">
|
||||
<el-select
|
||||
v-model="query.sub_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 200px;"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.SUB_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="库存类型">
|
||||
<el-select
|
||||
v-model="query.ivt_flag"
|
||||
@@ -221,6 +240,8 @@
|
||||
<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="sub_type" label="子卷状态" min-width="150" :formatter="formatSubType"/>
|
||||
<el-table-column prop="stock_age" label="库龄" min-width="100" />
|
||||
<el-table-column prop="paper_type" label="管件类型" min-width="150"/>
|
||||
<el-table-column prop="paper_code" label="管件编码" min-width="150"/>
|
||||
<el-table-column prop="paper_name" label="管件描述" min-width="250"/>
|
||||
@@ -292,7 +313,7 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Structivt',
|
||||
dicts: ['ST_QUALITY_SCODE', 'product_area', 'IS_OR_NOT'],
|
||||
dicts: ['ST_QUALITY_SCODE', 'product_area', 'IS_OR_NOT', 'SUB_TYPE'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, UploadDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
@@ -348,6 +369,9 @@ export default {
|
||||
return parseFloat(row[column.property]).toFixed(2)
|
||||
}
|
||||
},
|
||||
formatSubType(row) {
|
||||
return this.dict.label.SUB_TYPE[row.sub_type]
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
|
||||
@@ -42,14 +42,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属部门" prop="sysdeptid">
|
||||
<treeselect
|
||||
v-model="form.sysdeptid"
|
||||
:options="depts"
|
||||
:load-options="loadDepts"
|
||||
style="width: 200px"
|
||||
placeholder="选择部门"
|
||||
/>
|
||||
<el-form-item label="外部标识">
|
||||
<el-input v-model="form.ext_id" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -100,13 +94,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="外部标识">
|
||||
<el-input v-model="form.ext_id" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-form-item label="仓库类型" required>
|
||||
<el-col :span="4" />
|
||||
@@ -292,9 +279,6 @@ export default {
|
||||
stor_name: [
|
||||
{ required: true, message: '仓库名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
sysdeptid: [
|
||||
{ required: true, message: '所属部门不能为空', trigger: 'blur' }
|
||||
],
|
||||
stor_capacity: [
|
||||
{ required: false, message: '不能为空', trigger: 'blur' },
|
||||
{ validator: numberOne }
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-if="dialogShow"
|
||||
title="仓位信息"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
:before-close="handleClose"
|
||||
width="1100px"
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
>
|
||||
<el-form ref="form3" :model="formMst" :rules="rules" size="mini" label-width="130px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="所属库区:">
|
||||
<el-cascader
|
||||
placeholder="所属库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="仓位前缀:">
|
||||
<el-input v-model="formMst.prefix" placeholder="如:91、B21、C31等" size="mini" style="width: 210px" @blur="blurQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生成数量:">
|
||||
<el-input-number :precision="0" :step="1" :min="1" :max="90000" v-model="formMst.num" size="mini" :controls="false" style="width: 210px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" type="primary" :loading="loadingBut" @click="oneCreate">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||
import crudStructattr from '@/views/wms/basedata/st/struct/structattr'
|
||||
|
||||
export default {
|
||||
name: 'SunShowDialog',
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formMst: {
|
||||
stor_id: '',
|
||||
sect_id: '',
|
||||
prefix: '',
|
||||
num: 0
|
||||
},
|
||||
sects: [],
|
||||
dialogVisible: false,
|
||||
loadingBut: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudUserStor.getSect({ 'stor_id': '' }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$refs['form3'].resetFields()
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.formMst.stor_id = val[0]
|
||||
this.formMst.sect_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.formMst.sect_id = ''
|
||||
this.formMst.stor_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.formMst.stor_id = val[0]
|
||||
this.formMst.sect_id = val[1]
|
||||
}
|
||||
},
|
||||
oneCreate() {
|
||||
if (this.formMst.sect_id === '') {
|
||||
return this.crud.notify('库区不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
|
||||
if (this.formMst.prefix === '') {
|
||||
return this.crud.notify('前缀不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
|
||||
if (this.formMst.num === '') {
|
||||
return this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
this.loadingBut = true
|
||||
crudStructattr.oneCreate(this.formMst).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.close()
|
||||
this.crud.toQuery()
|
||||
this.loadingBut = false
|
||||
}).catch(() => {
|
||||
this.loadingBut = false
|
||||
})
|
||||
},
|
||||
blurQuery() {
|
||||
this.loadingBut = true
|
||||
crudStructattr.blurQuery({ 'prefix': this.formMst.prefix }).then(res => {
|
||||
this.crud.notify('可使用此前缀!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.loadingBut = false
|
||||
}).catch(() => {
|
||||
this.loadingBut = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -59,7 +59,18 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="openOneCreate"
|
||||
>
|
||||
一键生成
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
@@ -261,6 +272,8 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<OneCreateDialog :dialog-show.sync="openOneCreateDialog" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -271,6 +284,7 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import OneCreateDialog from '@/views/wms/basedata/st/struct/OneCreateDialog'
|
||||
import crudSectattr from '@/views/wms/basedata/st/sect/sectattr'
|
||||
import crudUserStor, { getSect } from '@/views/wms/basedata/st/userStor/userStor'
|
||||
/* import checkoutbill from "@/api/wms/st/core/outbill/checkoutbill";*/
|
||||
@@ -323,7 +337,7 @@ const defaultForm = {
|
||||
export default {
|
||||
name: 'Structattr',
|
||||
dicts: ['ST_HEIGHT_TYPE', 'is_used', 'd_lock_type', 'SCH_TASK_TYPE_DTL', 'placement_type'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, OneCreateDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -349,6 +363,7 @@ export default {
|
||||
}
|
||||
}
|
||||
return {
|
||||
openOneCreateDialog: false,
|
||||
sects: [],
|
||||
invtypelist: [],
|
||||
permission: {},
|
||||
@@ -413,6 +428,9 @@ export default {
|
||||
sectChange(val) {
|
||||
this.form.sect_id = val[1]
|
||||
},
|
||||
openOneCreate() {
|
||||
this.openOneCreateDialog = true
|
||||
},
|
||||
invtypeFormat(row) {
|
||||
for (const item of this.invtypelist) {
|
||||
if (item.code === row.inv_type) {
|
||||
|
||||
@@ -32,4 +32,20 @@ export function changeActive(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive }
|
||||
export function oneCreate(data) {
|
||||
return request({
|
||||
url: 'api/structattr/oneCreate',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function blurQuery(data) {
|
||||
return request({
|
||||
url: 'api/structattr/blurQuery',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive, oneCreate, blurQuery }
|
||||
|
||||
@@ -152,6 +152,16 @@
|
||||
>
|
||||
添加库存物料
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-arrow-down"
|
||||
size="mini"
|
||||
@click="Import"
|
||||
>
|
||||
物料信息导入
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
@@ -217,6 +227,7 @@
|
||||
</el-table>
|
||||
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged"/>
|
||||
<StructDiv ref="child" :dialog-show.sync="structShow" @tableChanged="structChanged"/>
|
||||
<UploadDialog :dialog-show.sync="viewShow" :stor-id="paramViewShow" @tableChanged="tableChanged"/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@@ -226,6 +237,7 @@ import AddDtl from '@/views/wms/st/inStor/productscrap/AddDtl'
|
||||
import productscrap from '@/views/wms/st/inStor/productscrap/productscrap'
|
||||
import StructDiv from '@/views/wms/pub/StructDialog'
|
||||
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||
import UploadDialog from '@/views/wms/st/inStor/productscrap/UploadDialog'
|
||||
|
||||
const defaultForm = {
|
||||
bill_code: '',
|
||||
@@ -243,7 +255,7 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { AddDtl, StructDiv },
|
||||
components: { AddDtl, StructDiv, UploadDialog },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
props: {
|
||||
dialogShow: {
|
||||
@@ -255,12 +267,14 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
viewShow: false,
|
||||
dtlShow: false,
|
||||
structShow: false,
|
||||
structShow2: false,
|
||||
flagnow: false,
|
||||
nowrow: {},
|
||||
nowindex: '',
|
||||
paramViewShow: '',
|
||||
storlist: [],
|
||||
invtypelist: [],
|
||||
storId: null,
|
||||
@@ -461,6 +475,13 @@ export default {
|
||||
this.form.tableData.splice(i, 1, this.form.tableData[i])
|
||||
}
|
||||
}
|
||||
},
|
||||
Import() {
|
||||
if (!this.form.stor_id) {
|
||||
return this.crud.notify('请先选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
this.paramViewShow = this.form.stor_id
|
||||
this.viewShow = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="导入Excel文件"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="400px"
|
||||
:show-close="true"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
class="upload-demo"
|
||||
action=""
|
||||
drag
|
||||
:on-exceed="is_one"
|
||||
:limit="1"
|
||||
:auto-upload="false"
|
||||
:multiple="false"
|
||||
:show-file-list="true"
|
||||
:on-change="uploadByJsqd"
|
||||
:file-list="fileList"
|
||||
accept=".xlsx,.xls"
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">只能上传Excel文件,且不超过10MB</div>
|
||||
</el-upload>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import productscrap from '@/views/wms/st/inStor/productscrap/productscrap'
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
|
||||
export default {
|
||||
name: 'UploadDialog',
|
||||
mixins: [crud()],
|
||||
components: {},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
},
|
||||
storId: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
file1: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
openParam: {
|
||||
handler(newValue, oldValue) {
|
||||
this.opendtlParam = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
is_one() {
|
||||
this.crud.notify('只能上传一个excel文件!', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
},
|
||||
// 文件校验方法
|
||||
beforeAvatarUpload(file) {
|
||||
// 不能导入大小超过2Mb的文件
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 文件发生改变就会触发的事件
|
||||
uploadByJsqd(file) {
|
||||
this.file1 = file
|
||||
},
|
||||
submit() {
|
||||
if (this.beforeAvatarUpload(this.file1)) {
|
||||
this.fileList.name = this.file1.name
|
||||
this.fileList.url = ''
|
||||
var formdata = new FormData()
|
||||
formdata.append('file', this.file1.raw)
|
||||
formdata.set('stor_id', this.storId)
|
||||
// excelImport:请求接口 formdata:传递参数
|
||||
productscrap.excelImport(formdata).then((res) => {
|
||||
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.$emit('tableChanged', res)
|
||||
this.$emit('update:dialogShow', false)
|
||||
})
|
||||
} else {
|
||||
this.crud.notify('文件过大,请上传小于10MB的文件〜', CRUD.NOTIFICATION_TYPE.WARNING)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -159,6 +159,7 @@
|
||||
<el-table-column prop="biz_date" label="业务日期" :min-width="flexWidth('biz_date',crud.data,'业务日期')"/>
|
||||
<el-table-column label="明细数" prop="detail_count" :min-width="flexWidth('detail_count',crud.data,'明细数')"/>
|
||||
<el-table-column label="总重量" prop="total_qty" :min-width="flexWidth('total_qty',crud.data,'总重量')"/>
|
||||
<el-table-column prop="ext_code" label="外部标识" :min-width="flexWidth('ext_code',crud.data,'外部标识')"/>
|
||||
<el-table-column prop="input_optname" label="创建人" :min-width="flexWidth('input_optname',crud.data,'创建人')"/>
|
||||
<el-table-column prop="input_time" label="创建日期" :min-width="flexWidth('input_time',crud.data,'创建日期')"/>
|
||||
<el-table-column prop="confirm_optname" label="确认人" :min-width="flexWidth('confirm_optname',crud.data,'确认人')"/>
|
||||
|
||||
@@ -59,4 +59,11 @@ export function onSubmit(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, getOutBillDtl, auditPass, auditOut, onSubmit }
|
||||
export function excelImport(data) {
|
||||
return request({
|
||||
url: 'api/productscrap/importExcel',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, getOutBillDtl, auditPass, auditOut, onSubmit, excelImport }
|
||||
|
||||
@@ -103,6 +103,24 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="交货单号">
|
||||
<el-input
|
||||
v-model="query.vbeln"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="交货单号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="木箱号">
|
||||
<el-input
|
||||
v-model="query.box_no"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="木箱号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="子卷号">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
@@ -217,6 +235,7 @@
|
||||
{{ fun(scope.row.total_qty) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交货单" align="center" prop="vbeln" width="150px" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="制单人" align="center" prop="input_optname" />
|
||||
<el-table-column label="制单时间" align="center" prop="input_time" width="150" />
|
||||
|
||||
@@ -256,6 +256,8 @@
|
||||
<el-table-column show-overflow-tooltip prop="plan_qty" label="出库重量" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_code" width="150px" label="仓位编码" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_name" width="150px" label="仓位名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="is_overdue" width="150px" label="是否超期" align="center" :formatter="formatOverdue"/>
|
||||
<el-table-column show-overflow-tooltip prop="instorage_time" width="150px" label="入库时间" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="task_code" width="150px" label="任务号" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="point_code" width="150px" label="出库点" align="center" />
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
@@ -282,7 +284,7 @@ export default {
|
||||
name: 'DivDialog',
|
||||
components: { PointDialog, StructIvt },
|
||||
mixins: [crud()],
|
||||
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'work_status', 'is_usable'],
|
||||
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used', 'work_status', 'is_usable', 'IS_OR_NOT'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
@@ -387,6 +389,9 @@ export default {
|
||||
ivt_levelFormat(row, column) {
|
||||
return this.dict.label.ST_IVT_LEVEL[row.ivt_level]
|
||||
},
|
||||
formatOverdue(row, column) {
|
||||
return this.dict.label.IS_OR_NOT[row.is_overdue]
|
||||
},
|
||||
is_activeFormat(row, column) {
|
||||
return this.dict.label.is_usable[row.is_active]
|
||||
},
|
||||
|
||||
@@ -166,7 +166,9 @@
|
||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column prop="struct_code" label="仓位" align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="sect_name" label="区域" align="center" show-overflow-tooltip />
|
||||
<!-- <el-table-column prop="next_point_code" label="目的位置" align="center" />-->
|
||||
<el-table-column show-overflow-tooltip prop="instorage_time" width="150px" label="入库时间" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="is_overdue" width="150px" label="是否超期" align="center" :formatter="formatOverdue"/>
|
||||
<!-- <el-table-column prop="next_point_code" label="目的位置" align="center" />-->
|
||||
<!-- <el-table-column prop="task_code" label="任务号" align="center" />-->
|
||||
<!-- <el-table-column prop="task_type" label="任务类型" align="center" width="150px" :formatter="taskdtl_typeFormat" />-->
|
||||
<el-table-column prop="task_status" label="状态" align="center" width="110px" :formatter="task_statusFormat" />
|
||||
@@ -187,7 +189,7 @@ export default {
|
||||
name: 'ViewDialog',
|
||||
components: { },
|
||||
mixins: [crud()],
|
||||
dicts: ['io_bill_status', 'work_status', 'task_status', 'SCH_TASK_TYPE_DTL','ST_INV_OUT_TYPE', 'INANDOUT_BILL_TYPE'],
|
||||
dicts: ['io_bill_status', 'work_status', 'task_status', 'SCH_TASK_TYPE_DTL','ST_INV_OUT_TYPE', 'INANDOUT_BILL_TYPE', 'IS_OR_NOT'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
@@ -246,6 +248,9 @@ export default {
|
||||
taskdtl_typeFormat(row) {
|
||||
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
|
||||
},
|
||||
formatOverdue(row, column) {
|
||||
return this.dict.label.IS_OR_NOT[row.is_overdue]
|
||||
},
|
||||
task_statusFormat(row) {
|
||||
return this.dict.label.task_status[row.task_status]
|
||||
},
|
||||
|
||||
@@ -104,6 +104,15 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="木箱号">
|
||||
<el-input
|
||||
v-model="query.box_no"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="木箱号"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="子卷批次">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
|
||||
Reference in New Issue
Block a user