Browse Source

opt:修改移库单对应wql

master
zds 1 month ago
parent
commit
d0857efff2
  1. 3
      lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/HandMoveStorService.java
  2. 4
      lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/dao/MoveStorDtl.java
  3. 22
      lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/dao/mapper/MoveStorDtlMapper.java
  4. 97
      lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/dao/mapper/MoveStorDtlMapper.xml
  5. 37
      lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/dto/BoxIvt.java
  6. 211
      lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/impl/HandMoveStorServiceImpl.java
  7. 188
      lms/nladmin-system/src/main/java/org/nl/wms/st/instor/wql/QST_IVT_HANDMOVESTOR.wql
  8. 4
      lms/nladmin-ui/src/views/wms/st/inStor/moveStor/AddDialog.vue
  9. 1
      lms/nladmin-ui/src/views/wms/st/inStor/moveStor/AddDtl.vue

3
lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/HandMoveStorService.java

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.st.instor.movestor.service.dao.MoveStor;
import org.nl.wms.st.instor.movestor.service.dto.BoxIvt;
import org.nl.wms.st.instor.movestor.service.dto.MoveStorDtlDto;
import org.nl.wms.st.instor.movestor.service.dto.MoveStorDtlQuery;
import org.nl.wms.st.instor.movestor.service.dto.MoveStorQuery;
@ -74,7 +75,7 @@ public interface HandMoveStorService extends IService<MoveStor> {
* @param whereJson
* @return
*/
JSONArray getBoxIvt(JSONArray whereJson);
List<BoxIvt> getBoxIvt(JSONArray whereJson);
/**
* 移库单强制确认

4
lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/dao/MoveStorDtl.java

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nl.wms.st.instor.movestor.service.dto.BoxIvt;
import java.io.Serializable;
@ -87,8 +88,7 @@ public class MoveStorDtl implements Serializable {
//备注
private String remark;
public void copyFrom(JSONObject source){
public void copyFrom(BoxIvt source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}

22
lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/dao/mapper/MoveStorDtlMapper.java

@ -1,13 +1,13 @@
package org.nl.wms.st.instor.movestor.service.dao.mapper;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.nl.wms.st.instor.movestor.service.dao.MoveStorDtl;
import org.nl.wms.st.instor.movestor.service.dto.BoxIvt;
import org.nl.wms.st.instor.movestor.service.dto.MoveStorDtlDto;
import org.nl.wms.st.instor.movestor.service.dto.MoveStorDtlQuery;
import java.util.HashSet;
import java.util.List;
/**
@ -23,5 +23,21 @@ public interface MoveStorDtlMapper extends BaseMapper<MoveStorDtl> {
* @param list
* @return
*/
JSONArray getBoxIvt(@Param("list") HashSet<String> list);
List<BoxIvt> getBoxIvt(List<String> list);
/**
* 查询载具内所有库存
* @param list
* @return
*/
List<BoxIvt> getStoragevehicleIvt(List<String> list);
/**
* 查询载具内所有库存
* @param query
* @return
*/
List<BoxIvt> getStoragevehicleIvtByPackageBoxSn(@Param("query")String query);
JSONObject getUnFinishCheckDtl(List<String> list);
}

97
lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/dao/mapper/MoveStorDtlMapper.xml

@ -24,7 +24,7 @@
order by movedtl.seq_no
</select>
<select id="getBoxIvt" resultType="com.alibaba.fastjson.JSONArray" parameterType="java.util.HashSet">
<select id="getBoxIvt" resultType="org.nl.wms.st.instor.movestor.service.dto.BoxIvt">
SELECT
ivt2.stockrecord_id,
ivt2.material_id,
@ -45,7 +45,8 @@
mu.unit_name AS qty_unit_name,
sub.sale_order_name,
sub.customer_name,
sub.customer_description
sub.customer_description,
'01' as work_status
FROM
st_ivt_structattr struct
INNER JOIN ST_IVT_StructIvt ivt2 ON struct.struct_id = ivt2.struct_id
@ -61,4 +62,96 @@
</foreach>
</if>
</select>
<select id="getStoragevehicleIvt" resultType="org.nl.wms.st.instor.movestor.service.dto.BoxIvt">
SELECT
ivt2.stockrecord_id,
ivt2.material_id,
ivt2.pcsn,
ivt2.quality_scode,
ivt2.qty_unit_id,
mu.unit_name AS qty_unit_name,
ivt2.ivt_qty AS qty,
mb.material_code,
mb.material_name,
struct.struct_id AS turnout_struct_id,
struct.struct_code AS turnout_struct_code,
struct.struct_name AS turnout_struct_name,
struct.sect_id AS turnout_sect_id,
struct.sect_name AS turnout_sect_name,
struct.sect_code AS turnout_sect_code,
struct.storagevehicle_code,
point.point_code AS start_point_code
FROM
st_ivt_structattr struct
INNER JOIN ST_IVT_StructIvt ivt2 ON struct.struct_id = ivt2.struct_id
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt2.material_id
LEFT JOIN SCH_BASE_Point point ON point.source_id = struct.struct_id
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = mb.base_unit_id
WHERE
1 = 1
AND struct.lock_type = '1'
AND IFNULL(struct.storagevehicle_code,'') != ''
<if test="list != null">
AND struct.storagevehicle_code in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="getStoragevehicleIvtByPackageBoxSn" resultType="org.nl.wms.st.instor.movestor.service.dto.BoxIvt">
SELECT
ivt2.stockrecord_id,
ivt2.material_id,
ivt2.pcsn,
ivt2.quality_scode,
ivt2.qty_unit_id,
ivt2.ivt_qty AS qty,
mb.material_code,
mb.material_name,
struct.struct_id AS turnout_struct_id,
struct.struct_code AS turnout_struct_code,
struct.struct_name AS turnout_struct_name,
struct.sect_id AS turnout_sect_id,
struct.sect_name AS turnout_sect_name,
struct.sect_code AS turnout_sect_code,
struct.storagevehicle_id,
struct.storagevehicle_code,
mu.unit_name AS qty_unit_name,
sub.sale_order_name,
sub.customer_name,
sub.customer_description,
sub.sap_pcsn
FROM
st_ivt_structattr struct
INNER JOIN ST_IVT_StructIvt ivt2 ON struct.struct_id = ivt2.struct_id
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt2.material_id
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = ivt2.qty_unit_id
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = ivt2.pcsn AND sub.package_box_sn = struct.storagevehicle_code
WHERE
1 = 1
AND struct.lock_type = '1'
<if test="query != null">
sub.package_box_sn = #{query}
</if>
</select>
<select id="getUnFinishCheckDtl" resultType="com.alibaba.fastjson.JSONObject">
SELECT
dtl.*
FROM
st_ivt_checkdtl dtl
LEFT JOIN st_ivt_checkmst mst ON mst.check_id = dtl.check_id
WHERE
mst.is_delete = '0'
and dtl.status not in ('3','5','99')
<if test="list != null">
AND dtl.storagevehicle_code in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</if>
limit 1
</select>
</mapper>

37
lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/dto/BoxIvt.java

@ -0,0 +1,37 @@
package org.nl.wms.st.instor.movestor.service.dto;
import lombok.Data;
import java.io.Serializable;
/**
* @author: zds
* @date: 2024-09-27
* @description:
*/
@Data
public class BoxIvt implements Serializable {
private String stockrecord_id;
private String material_id;
private String pcsn;
private String quality_scode;
private String qty_unit_id;
private String qty_unit_name;
private String qty;
private String material_code;
private String material_name;
private String turnout_struct_id;
private String turnout_struct_code;
private String turnout_struct_name;
private String turnout_sect_id;
private String turnout_sect_name;
private String turnout_sect_code;
private Double storagevehicle_id;
private String storagevehicle_code;
private String sale_order_name;
private String customer_name;
private String customer_description;
private String work_status;
private String start_point_code;
private String sap_pcsn;
}

211
lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/impl/HandMoveStorServiceImpl.java

@ -23,6 +23,8 @@ import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.modules.wql.util.WqlUtil;
import org.nl.wms.basedata.master.structattr.service.dao.Structattr;
import org.nl.wms.basedata.master.structattr.service.dao.mapper.StructattrMapper;
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
import org.nl.wms.sch.manage.TaskStatusEnum;
@ -34,6 +36,7 @@ import org.nl.wms.st.instor.movestor.service.dao.MoveStor;
import org.nl.wms.st.instor.movestor.service.dao.MoveStorDtl;
import org.nl.wms.st.instor.movestor.service.dao.mapper.MoveStorDtlMapper;
import org.nl.wms.st.instor.movestor.service.dao.mapper.MoveStorMapper;
import org.nl.wms.st.instor.movestor.service.dto.BoxIvt;
import org.nl.wms.st.instor.movestor.service.dto.MoveStorDtlDto;
import org.nl.wms.st.instor.movestor.service.dto.MoveStorDtlQuery;
import org.nl.wms.st.instor.movestor.service.dto.MoveStorQuery;
@ -45,7 +48,6 @@ import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
/**
* PC端出入库新增
@ -67,6 +69,9 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
private MoveStorMapper moveStorMapper;
@Autowired
private MoveStorDtlMapper moveStorDtlMapper;
@Autowired
private StructattrMapper structattrMapper;
@Override
public IPage<MoveStor> pageQuery(MoveStorQuery whereJson, PageQuery page) {
@ -358,13 +363,10 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
if (ObjectUtil.isEmpty(jsonMove)) {
throw new BadRequestException("没有可用暂存位");
}
// 组织明细
JSONArray jsonIvt = WQL.getWO("QST_IVT_HANDMOVESTOR").addParam("flag", "35").addParam("package_box_sn", json.getString("storagevehicle_code")).process().getResultJSONArray(0);
List<JSONObject> collect = jsonIvt.stream().map(row -> (JSONObject) row).collect(Collectors.toList());
collect.forEach(row -> {
row.put("wrok_status", "10");
List<BoxIvt> jsonIvt = moveStorDtlMapper.getStoragevehicleIvtByPackageBoxSn(json.getString("storagevehicle_code"));
jsonIvt.forEach(boxIvt -> {
JSONObject row = (JSONObject) JSONObject.toJSON(boxIvt);
row.put("wrok_status", "01");
row.put("turnin_sect_id", jsonMove.getString("sect_id"));
row.put("turnin_sect_code", jsonMove.getString("sect_code"));
row.put("turnin_sect_name", jsonMove.getString("sect_name"));
@ -473,34 +475,26 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
String now = DateUtil.now();
//定义需要需要插入的库存集合
HashMap<String, JSONObject> Struct_map = new HashMap<String, JSONObject>();
StringBuffer ids = new StringBuffer();
for (int i = 0; i < rows.size(); i++) {
JSONObject row = rows.getJSONObject(i);
String storagevehicle_code = row.getString("storagevehicle_code");
if (i == 0) {
ids.append("'");
}
if (!Struct_map.containsKey(storagevehicle_code)) {
Struct_map.put(storagevehicle_code, row);
}
if (i != 0) {
ids.append("','");
}
ids.append(storagevehicle_code);
}
ids.append("'");
Set<String> set = Struct_map.keySet();
if(set.size() == 0){
throw new BadRequestException("当前移库明细载具集合为空!");
}
//查询所有载具的库存
JSONArray ja = WQL.getWO("QST_IVT_HANDMOVESTOR")
.addParam("flag", "33")
.addParam("ids", ids.toString())
.process().getResultJSONArray(0);
List<BoxIvt> ja = moveStorDtlMapper.getStoragevehicleIvt(new ArrayList<String>(set));
if (ja.size() == 0) {
throw new BadRequestException("当前所有载具无可移库库存!");
}
double total_qty = 0;
for (int i = 0; i < ja.size(); i++) {
MoveStorDtl jo = new MoveStorDtl();
jo.copyFrom(ja.getJSONObject(i));
jo.copyFrom(ja.get(i));
//累加明细数量
total_qty = total_qty + jo.getQty();
@ -525,7 +519,7 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
throw new BadRequestException(row.getString("turnin_struct_code") + "仓位数据异常,找不到对应点位!");
}
//判断是否已生成过了任务,未生成则插入任务
JSONObject task = wo_Task.query("is_delete = '0' and task_status<'05' and point_code1='" + ja.getJSONObject(i).getString("start_point_code") + "'").uniqueResult(0);
JSONObject task = wo_Task.query("is_delete = '0' and task_status<'05' and point_code1='" + ja.get(i).getStart_point_code() + "'").uniqueResult(0);
if (task != null) {
jo.setTask_id(task.getString("task_id"));
} else {
@ -539,7 +533,7 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
task.put("task_type", "010505");
task.put("acs_task_type", "7");
task.put("task_status", TaskStatusEnum.SURE_START.getCode());
task.put("point_code1", ja.getJSONObject(i).getString("start_point_code"));
task.put("point_code1", ja.get(i).getStart_point_code());
task.put("point_code2", point.getString("point_code"));
task.put("vehicle_code", jo.getStoragevehicle_code());
task.put("handle_class", HandMoveStorAcsTask.class.getName());
@ -644,34 +638,26 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
String now = DateUtil.now();
//定义需要需要插入的库存集合
HashMap<String, JSONObject> Struct_map = new HashMap<String, JSONObject>();
StringBuffer ids = new StringBuffer();
for (int i = 0; i < rows.size(); i++) {
JSONObject row = rows.getJSONObject(i);
String storagevehicle_code = row.getString("storagevehicle_code");
if (i == 0) {
ids.append("'");
}
if (!Struct_map.containsKey(storagevehicle_code)) {
Struct_map.put(storagevehicle_code, row);
}
if (i != 0) {
ids.append("','");
}
ids.append(storagevehicle_code);
}
ids.append("'");
Set<String> set = Struct_map.keySet();
if(set.size() == 0){
throw new BadRequestException("当前移库明细载具集合为空!");
}
//查询所有载具的库存
JSONArray ja = WQL.getWO("QST_IVT_HANDMOVESTOR")
.addParam("flag", "33")
.addParam("ids", ids.toString())
.process().getResultJSONArray(0);
List<BoxIvt> ja = moveStorDtlMapper.getStoragevehicleIvt(new ArrayList<String>(set));
if (ja.size() == 0) {
throw new BadRequestException("当前所有载具无可移库库存!");
}
double total_qty = 0;
for (int i = 0; i < ja.size(); i++) {
MoveStorDtl jodtl = new MoveStorDtl();
jodtl.copyFrom(ja.getJSONObject(i));
jodtl.copyFrom(ja.get(i));
//累加数量
total_qty = total_qty + jodtl.getQty();
@ -921,12 +907,12 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
}
@Override
public JSONArray getBoxIvt(JSONArray whereJson) {
public List<BoxIvt> getBoxIvt(JSONArray whereJson) {
HashSet<String> set = new HashSet<>();
for (int i = 0; i < whereJson.size(); i++) {
set.add(whereJson.getJSONObject(i).getString("storagevehicle_code"));
}
return moveStorDtlMapper.getBoxIvt(set);
return moveStorDtlMapper.getBoxIvt(new ArrayList<String>(set));
}
@Override
@ -1152,49 +1138,51 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
/*
* 将所有盘点位上的木箱生成移库单并下发任务
*/
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr"); // 仓位表
LambdaQueryWrapper<Structattr> queryWrapper = new LambdaQueryWrapper<Structattr>();
queryWrapper.eq(ObjectUtil.isNotEmpty(RegionTypeEnum.PD01.getId()), Structattr::getSect_id, RegionTypeEnum.PD01.getId())
.eq(Structattr::getIs_used, "1")
.gt(Structattr::getIs_delete, "0")
.ne( Structattr::getStoragevehicle_code,"")
.isNotNull(Structattr::getStoragevehicle_code)
.orderByAsc(Structattr::getBlock_num)
.orderByDesc(Structattr::getBlock_num);//neededit out_order_seq DESC
List<Structattr> boxArr = structattrMapper.selectList(queryWrapper);
// 1.找出所有需要盘点的移库的木箱
JSONArray boxArr = attrTab.query("sect_id = '" + RegionTypeEnum.PD01.getId() + "' and IFNULL(storagevehicle_code,'') <> '' and is_used = '1' and is_delete = '0' order by block_num ASC,out_order_seq DESC").getResultJSONArray(0);
if (ObjectUtil.isEmpty(boxArr)) {
//JSONArray boxArr = attrTab.query("sect_id = '" + RegionTypeEnum.PD01.getId() + "' and IFNULL(storagevehicle_code,'') <> '' and is_used = '1' and is_delete = '0' order by block_num ASC,out_order_seq DESC").getResultJSONArray(0);
if (boxArr.size()==0) {
throw new BadRequestException("没有需要盘点回库的木箱!");
}
// 2.判断是否有被锁定的木箱
boolean is_lock = boxArr.stream().map(row -> (JSONObject) row)
.anyMatch(row -> !StrUtil.equals(row.getString("lock_type"), "1"));
queryWrapper.ne(Structattr::getLock_type,"1");
Integer lock_size = structattrMapper.selectCount(queryWrapper);
//boolean is_lock = boxArr.stream().map(row -> (JSONObject) row).anyMatch(row -> !StrUtil.equals(row.getString("lock_type"), "1"));
if (is_lock) {
if (lock_size>0) {
throw new BadRequestException("木箱存在被锁定,请检查!");
}
/* for (int i = 0; i < boxArr.size(); i++) {
JSONObject json = boxArr.getJSONObject(i);
// 3.判断木箱是否存在未完成的盘点单
WQL.getWO("QST_IVT_HANDMOVESTOR").addParam("flag", "8").addParam("storagevehicle_code",json.getString("storagevehicle_code"));
}*/
// 3.判断木箱是否存在未完成的盘点单
boxArr.forEach(row -> {
JSONObject json = WQL.getWO("QST_IVT_HANDMOVESTOR").addParam("flag", "8").addParam("storagevehicle_code", ((JSONObject) row).getString("storagevehicle_code")).process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(json)) {
throw new BadRequestException("此木箱的盘点单据未完成:" + json.getString("storagevehicle_code"));
}
});
HashSet<String> set = new HashSet<>();
for (int i = 0; i < boxArr.size(); i++) {
set.add(boxArr.get(i).getStoragevehicle_code());
}
JSONObject checkDtl = moveStorDtlMapper.getUnFinishCheckDtl(new ArrayList<>(set));
if (ObjectUtil.isNotEmpty(checkDtl)) {
throw new BadRequestException("此木箱的盘点单据未完成:" + checkDtl.getString("storagevehicle_code"));
}
// 4.生成移库单
for (int i = 0; i < boxArr.size(); i++) {
JSONObject json = boxArr.getJSONObject(i);
Structattr json = boxArr.get(i);
// 找一个移入仓位
RawAssistIStorService rawAssistIStorService = SpringContextHolder.getBean(RawAssistIStorService.class);
JSONObject moveParamIn = new JSONObject();
moveParamIn.put("box_no", json.getString("storagevehicle_code"));
moveParamIn.put("box_no", json.getStoragevehicle_code());
moveParamIn.put("sect_id", RegionTypeEnum.ZC01.getId());
moveParamIn.put("layer_num", json.getString("layer_num"));
moveParamIn.put("layer_num", json.getLayer_num());
JSONObject jsonMoveIn = rawAssistIStorService.autoDisMove(moveParamIn);
if (ObjectUtil.isEmpty(jsonMoveIn)) {
@ -1212,17 +1200,17 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
jsonMst.put("is_task", "1");
JSONArray dtlArr = new JSONArray(); // 明细
// 组织明细
JSONArray jsonIvt = WQL.getWO("QST_IVT_HANDMOVESTOR").addParam("flag", "35").addParam("package_box_sn", json.getString("storagevehicle_code")).process().getResultJSONArray(0);
jsonIvt.forEach(row -> {
((JSONObject) row).put("wrok_status", "10");
((JSONObject) row).put("turnin_sect_id", jsonMoveIn.getString("sect_id"));
((JSONObject) row).put("turnin_sect_code", jsonMoveIn.getString("sect_code"));
((JSONObject) row).put("turnin_sect_name", jsonMoveIn.getString("sect_name"));
((JSONObject) row).put("turnin_struct_id", jsonMoveIn.getString("struct_id"));
((JSONObject) row).put("turnin_struct_code", jsonMoveIn.getString("struct_code"));
((JSONObject) row).put("turnin_struct_name", jsonMoveIn.getString("struct_name"));
List<BoxIvt> jsonIvt = moveStorDtlMapper.getStoragevehicleIvtByPackageBoxSn(json.getStoragevehicle_code());
jsonIvt.forEach(boxIvt -> {
JSONObject row = (JSONObject) JSONObject.toJSON(boxIvt);
row.put("wrok_status", "01");
row.put("turnin_sect_id", jsonMoveIn.getString("sect_id"));
row.put("turnin_sect_code", jsonMoveIn.getString("sect_code"));
row.put("turnin_sect_name", jsonMoveIn.getString("sect_name"));
row.put("turnin_struct_id", jsonMoveIn.getString("struct_id"));
row.put("turnin_struct_code", jsonMoveIn.getString("struct_code"));
row.put("turnin_struct_name", jsonMoveIn.getString("struct_name"));
dtlArr.add(row);
});
@ -1243,8 +1231,8 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
String placement_type = whereJson.getString("placement_type");
CheckOutBillServiceImpl bean = SpringContextHolder.getBean(CheckOutBillServiceImpl.class);
JSONArray jsonLockArr = new JSONArray();
//JSONArray jsonLockArr = new JSONArray();
List<Structattr> jsonLockArr = new ArrayList<>();
if (StrUtil.equals(placement_type, "01")) {
/*
* 双通
@ -1290,9 +1278,20 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
throw new BadRequestException("仓位:" + error + "被锁定且未下发任务,无法生成任务!");
}
// 查询被阻挡需要移库的货位
isNumMap.put("flag", "6");
jsonLockArr = WQL.getWO("QST_IVT_HANDMOVESTOR").addParamMap(isNumMap).process().getResultJSONArray(0);
// 查询被阻挡需要移库的货位structattrMapper
//isNumMap.put("block_num", whereJson.getString("block_num"));
//isNumMap.put("row_num", whereJson.getString("row_num"));
//isNumMap.put("out_order_seq", whereJson.getString("out_order_seq"));
LambdaQueryWrapper<Structattr> queryWrapper = new LambdaQueryWrapper<Structattr>();
queryWrapper.eq(ObjectUtil.isNotEmpty(whereJson.getString("block_num")), Structattr::getBlock_num, whereJson.getString("block_num"))
.eq(ObjectUtil.isNotEmpty(whereJson.getString("row_num")), Structattr::getBlock_num, whereJson.getString("row_num"))//neededit
.gt(ObjectUtil.isNotEmpty(whereJson.getString("out_order_seq")), Structattr::getBlock_num, whereJson.getString("out_order_seq"))//neededit
.ne( Structattr::getStoragevehicle_code,"")
.isNotNull(Structattr::getStoragevehicle_code)
.orderByDesc(Structattr::getBlock_num);//neededit out_order_seq
jsonLockArr = structattrMapper.selectList(queryWrapper);
//isNumMap.put("flag", "6");
//jsonLockArr = WQL.getWO("QST_IVT_HANDMOVESTOR").addParamMap(isNumMap).process().getResultJSONArray(0);
} else if (rightNumArr.size() < leftNumArr.size()) {
/*
@ -1317,9 +1316,17 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
}
// 查询被阻挡需要移库的货位
isNumMap.put("flag", "7");
jsonLockArr = WQL.getWO("QST_IVT_HANDMOVESTOR").addParamMap(isNumMap).process().getResultJSONArray(0);
//isNumMap.put("flag", "7");
//jsonLockArr = WQL.getWO("QST_IVT_HANDMOVESTOR").addParamMap(isNumMap).process().getResultJSONArray(0);
LambdaQueryWrapper<Structattr> queryWrapper = new LambdaQueryWrapper<Structattr>();
queryWrapper.eq(ObjectUtil.isNotEmpty(whereJson.getString("block_num")), Structattr::getBlock_num, whereJson.getString("block_num"))
.eq(ObjectUtil.isNotEmpty(whereJson.getString("row_num")), Structattr::getBlock_num, whereJson.getString("row_num"))//neededit
.lt(ObjectUtil.isNotEmpty(whereJson.getString("out_order_seq")), Structattr::getBlock_num, whereJson.getString("out_order_seq"))//neededit
.ne( Structattr::getStoragevehicle_code,"")
.isNotNull(Structattr::getStoragevehicle_code)
.orderByAsc(Structattr::getBlock_num);//neededit out_order_seq
jsonLockArr = structattrMapper.selectList(queryWrapper);
} else {
/*
* 默认从右边开始
@ -1343,8 +1350,17 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
}
// 查询被阻挡需要移库的货位
isNumMap.put("flag", "7");
jsonLockArr = WQL.getWO("QST_IVT_HANDMOVESTOR").addParamMap(isNumMap).process().getResultJSONArray(0);
//isNumMap.put("flag", "7");
//jsonLockArr = WQL.getWO("QST_IVT_HANDMOVESTOR").addParamMap(isNumMap).process().getResultJSONArray(0);
LambdaQueryWrapper<Structattr> queryWrapper = new LambdaQueryWrapper<Structattr>();
queryWrapper.eq(ObjectUtil.isNotEmpty(whereJson.getString("block_num")), Structattr::getBlock_num, whereJson.getString("block_num"))
.eq(ObjectUtil.isNotEmpty(whereJson.getString("row_num")), Structattr::getBlock_num, whereJson.getString("row_num"))//neededit
.lt(ObjectUtil.isNotEmpty(whereJson.getString("out_order_seq")), Structattr::getBlock_num, whereJson.getString("out_order_seq"))//neededit
.ne( Structattr::getStoragevehicle_code,"")
.isNotNull(Structattr::getStoragevehicle_code)
.orderByAsc(Structattr::getBlock_num);//neededit out_order_seq
jsonLockArr = structattrMapper.selectList(queryWrapper);
}
} else if (StrUtil.equals(placement_type, "02")) {
@ -1373,8 +1389,16 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
}
// 查询被阻挡需要移库的货位
isNumMap.put("flag", "6");
jsonLockArr = WQL.getWO("QST_IVT_HANDMOVESTOR").addParamMap(isNumMap).process().getResultJSONArray(0);
//isNumMap.put("flag", "6");
//jsonLockArr = WQL.getWO("QST_IVT_HANDMOVESTOR").addParamMap(isNumMap).process().getResultJSONArray(0);
LambdaQueryWrapper<Structattr> queryWrapper = new LambdaQueryWrapper<Structattr>();
queryWrapper.eq(ObjectUtil.isNotEmpty(whereJson.getString("block_num")), Structattr::getBlock_num, whereJson.getString("block_num"))
.eq(ObjectUtil.isNotEmpty(whereJson.getString("row_num")), Structattr::getBlock_num, whereJson.getString("row_num"))//neededit
.gt(ObjectUtil.isNotEmpty(whereJson.getString("out_order_seq")), Structattr::getBlock_num, whereJson.getString("out_order_seq"))//neededit
.ne( Structattr::getStoragevehicle_code,"")
.isNotNull(Structattr::getStoragevehicle_code)
.orderByDesc(Structattr::getBlock_num);//neededit out_order_seq
jsonLockArr = structattrMapper.selectList(queryWrapper);
} else if (StrUtil.equals(placement_type, "03")) {
/*
@ -1404,8 +1428,17 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
}
// 查询被阻挡需要移库的货位
isNumMap.put("flag", "7");
jsonLockArr = WQL.getWO("QST_IVT_HANDMOVESTOR").addParamMap(isNumMap).process().getResultJSONArray(0);
//isNumMap.put("flag", "7");
//jsonLockArr = WQL.getWO("QST_IVT_HANDMOVESTOR").addParamMap(isNumMap).process().getResultJSONArray(0);
LambdaQueryWrapper<Structattr> queryWrapper = new LambdaQueryWrapper<Structattr>();
queryWrapper.eq(ObjectUtil.isNotEmpty(whereJson.getString("block_num")), Structattr::getBlock_num, whereJson.getString("block_num"))
.eq(ObjectUtil.isNotEmpty(whereJson.getString("row_num")), Structattr::getBlock_num, whereJson.getString("row_num"))//neededit
.lt(ObjectUtil.isNotEmpty(whereJson.getString("out_order_seq")), Structattr::getBlock_num, whereJson.getString("out_order_seq"))//neededit
.ne( Structattr::getStoragevehicle_code,"")
.isNotNull(Structattr::getStoragevehicle_code)
.orderByAsc(Structattr::getBlock_num);//neededit out_order_seq
jsonLockArr = structattrMapper.selectList(queryWrapper);
}
/*

188
lms/nladmin-system/src/main/java/org/nl/wms/st/instor/wql/QST_IVT_HANDMOVESTOR.wql

@ -188,193 +188,5 @@
ENDQUERY
ENDIF
IF 输入.flag = "33"
QUERY
SELECT
ivt2.stockrecord_id,
ivt2.material_id,
ivt2.pcsn,
ivt2.quality_scode,
ivt2.qty_unit_id,
mu.unit_name AS qty_unit_name,
ivt2.ivt_qty AS qty,
mb.material_code,
mb.material_name,
struct.struct_id AS turnout_struct_id,
struct.struct_code AS turnout_struct_code,
struct.struct_name AS turnout_struct_name,
struct.sect_id AS turnout_sect_id,
struct.sect_name AS turnout_sect_name,
struct.sect_code AS turnout_sect_code,
struct.storagevehicle_code,
point.point_code AS start_point_code
FROM
st_ivt_structattr struct
INNER JOIN ST_IVT_StructIvt ivt2 ON struct.struct_id = ivt2.struct_id
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt2.material_id
LEFT JOIN SCH_BASE_Point point ON point.source_id = struct.struct_id
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = mb.base_unit_id
WHERE
1 = 1
AND struct.lock_type = '1'
AND IFNULL(struct.storagevehicle_code,'') <> ''
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 <> ""
ivt2.stor_id = 输入.stor_id
ENDOPTION
OPTION 输入.sect_id <> ""
struct.sect_id = 输入.sect_id
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "35"
QUERY
SELECT
ivt2.stockrecord_id,
ivt2.material_id,
ivt2.pcsn,
ivt2.quality_scode,
ivt2.qty_unit_id,
ivt2.ivt_qty AS qty,
mb.material_code,
mb.material_name,
struct.struct_id AS turnout_struct_id,
struct.struct_code AS turnout_struct_code,
struct.struct_name AS turnout_struct_name,
struct.sect_id AS turnout_sect_id,
struct.sect_name AS turnout_sect_name,
struct.sect_code AS turnout_sect_code,
struct.storagevehicle_id,
struct.storagevehicle_code,
mu.unit_name AS qty_unit_name,
sub.sale_order_name,
sub.customer_name,
sub.customer_description,
sub.sap_pcsn
FROM
st_ivt_structattr struct
INNER JOIN ST_IVT_StructIvt ivt2 ON struct.struct_id = ivt2.struct_id
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt2.material_id
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = ivt2.qty_unit_id
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = ivt2.pcsn AND sub.package_box_sn = struct.storagevehicle_code
WHERE
1 = 1
AND struct.lock_type = '1'
OPTION 输入.package_box_sn <> ""
sub.package_box_sn = 输入.package_box_sn
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "5"
QUERY
SELECT
ivt2.stockrecord_id,
ivt2.material_id,
ivt2.pcsn,
ivt2.quality_scode,
ivt2.qty_unit_id,
ivt2.ivt_qty AS qty,
mb.material_code,
mb.material_name,
struct.struct_id AS turnout_struct_id,
struct.struct_code AS turnout_struct_code,
struct.struct_name AS turnout_struct_name,
struct.sect_id AS turnout_sect_id,
struct.sect_name AS turnout_sect_name,
struct.sect_code AS turnout_sect_code,
struct.storagevehicle_id,
struct.storagevehicle_code,
mu.unit_name AS qty_unit_name,
sub.sale_order_name,
sub.customer_name,
sub.customer_description
FROM
st_ivt_structattr struct
INNER JOIN ST_IVT_StructIvt ivt2 ON struct.struct_id = ivt2.struct_id
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt2.material_id
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = ivt2.qty_unit_id
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = ivt2.pcsn
WHERE
1 = 1
AND struct.lock_type = '1'
OPTION 输入.storagevehicle_code <> ""
struct.storagevehicle_code = 输入.storagevehicle_code
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "6"
QUERY
SELECT
attr.*
FROM
st_ivt_structattr attr
WHERE
attr.lock_type = '1'
AND attr.block_num = 输入.block_num
AND attr.row_num = 输入.row_num
AND attr.out_order_seq > 输入.out_order_seq
AND IFNULL( attr.storagevehicle_code, '' ) <> ''
order by attr.out_order_seq DESC
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "7"
QUERY
SELECT
attr.*
FROM
st_ivt_structattr attr
WHERE
attr.lock_type = '1'
AND attr.block_num = 输入.block_num
AND attr.row_num = 输入.row_num
AND attr.out_order_seq < 输入.out_order_seq
AND IFNULL( attr.storagevehicle_code, '' ) <> ''
order by attr.out_order_seq ASC
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "8"
QUERY
SELECT
dtl.*
FROM
st_ivt_checkdtl dtl
LEFT JOIN st_ivt_checkmst mst ON mst.check_id = dtl.check_id
WHERE
mst.is_delete = '0'
and dtl.status not in ('3','5','99')
OPTION 输入.storagevehicle_code <> ""
dtl.storagevehicle_code = 输入.storagevehicle_code
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF

4
lms/nladmin-ui/src/views/wms/st/inStor/moveStor/AddDialog.vue

@ -409,7 +409,7 @@ export default {
}
if (!this.flagnow) {
this.$set(item, 'edit', false)
this.$set(item, 'work_status', '10')
this.$set(item, 'work_status', '01')
this.$set(item, 'turnin_sect_id', '')
this.$set(item, 'turnin_struct_id', '')
this.$set(item, 'turnin_sect_code', '')
@ -420,7 +420,7 @@ export default {
}
} else {
this.$set(item, 'edit', false)
this.$set(item, 'work_status', '10')
this.$set(item, 'work_status', '01')
this.$set(item, 'turnin_sect_id', '')
this.$set(item, 'turnin_struct_id', '')
this.$set(item, 'turnin_sect_code', '')

1
lms/nladmin-ui/src/views/wms/st/inStor/moveStor/AddDtl.vue

@ -207,7 +207,6 @@ export default {
this.crud.toQuery()
},
submit() {
debugger
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')

Loading…
Cancel
Save