feat: 下发任务等
This commit is contained in:
@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtMoveinv;
|
||||
import org.nl.wms.st.instor.service.dto.MoveInvPageParam;
|
||||
import org.nl.wms.st.instor.service.dto.MoveStockInfoDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 移库单据
|
||||
@@ -18,4 +21,11 @@ public interface IStIvtMoveinvService extends IService<StIvtMoveinv> {
|
||||
* @return
|
||||
*/
|
||||
IPage<StIvtMoveinv> moveStoragePage(IPage<StIvtMoveinv> pages, MoveInvPageParam param);
|
||||
|
||||
/**
|
||||
* 查询所有载具的库存
|
||||
* @param moveinvId 移库单id
|
||||
* @return
|
||||
*/
|
||||
List<MoveStockInfoDto> getMoveStockInfoByInvId(String moveinvId);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtMoveinvdtl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
@@ -13,4 +15,6 @@ import java.util.List;
|
||||
public interface IStIvtMoveinvdtlService extends IService<StIvtMoveinvdtl> {
|
||||
List<StIvtMoveinvdtl> getByMoveInvId(String moveinvId);
|
||||
List<JSONObject> getByMoveInvIdToObject(String moveinvId);
|
||||
|
||||
List<JSONObject> getOutBillDtl(Map whereJson);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtMoveinv;
|
||||
import org.nl.wms.st.instor.service.dto.MoveInvPageParam;
|
||||
import org.nl.wms.st.instor.service.dto.MoveStockInfoDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
@@ -11,4 +14,6 @@ import org.nl.wms.st.instor.service.dto.MoveInvPageParam;
|
||||
*/
|
||||
public interface StIvtMoveinvMapper extends BaseMapper<StIvtMoveinv> {
|
||||
IPage<StIvtMoveinv> moveStoragePageLeft(IPage<StIvtMoveinv> pages, MoveInvPageParam param);
|
||||
|
||||
List<MoveStockInfoDto> getMoveStockInfoByInvId(String moveinvId);
|
||||
}
|
||||
|
||||
@@ -81,4 +81,25 @@
|
||||
AND move.input_time <![CDATA[ <= ]]> #{param.end_time}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getMoveStockInfoByInvId" resultType="org.nl.wms.st.instor.service.dto.MoveStockInfoDto">
|
||||
SELECT
|
||||
DISTINCT(task.task_id) AS task_id,
|
||||
dtl.turnout_struct_code AS turnout_struct_code
|
||||
FROM
|
||||
ST_IVT_MoveInvDtl dtl
|
||||
INNER JOIN ST_IVT_MoveInv mst ON mst.moveinv_id = dtl.moveinv_id
|
||||
INNER JOIN SCH_BASE_Task task ON task.task_id = dtl.task_id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND mst.bill_status = '10'
|
||||
AND dtl.work_status = '01'
|
||||
AND task.task_status <![CDATA[ < ]]> '05'
|
||||
AND mst.is_delete = '0'
|
||||
AND task.is_delete = '0'
|
||||
<if test="moveinvId != null and moveinvId != ''">
|
||||
AND dtl.moveinv_id = #{moveinvId}
|
||||
</if>
|
||||
|
||||
order by turnout_struct_code DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtMoveinvdtl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
public interface StIvtMoveinvdtlMapper extends BaseMapper<StIvtMoveinvdtl> {
|
||||
List<JSONObject> getOutBillDtl(Map param);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,25 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtMoveinvdtlMapper">
|
||||
|
||||
<select id="getOutBillDtl" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
MoveInvDtl.*,
|
||||
mb.material_code,
|
||||
mb.material_name
|
||||
FROM
|
||||
ST_IVT_MoveInvDtl MoveInvDtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = MoveInvDtl.material_id
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="moveinv_id != null and moveinv_id != ''">
|
||||
AND MoveInvDtl.moveinv_id = #{moveinv_id}
|
||||
</if>
|
||||
<if test="moveinvdtl_id != null and moveinvdtl_id != ''">
|
||||
AND MoveInvDtl.moveinvdtl_id = #{moveinvdtl_id}
|
||||
</if>
|
||||
<if test="work_status != null and work_status != ''">
|
||||
AND MoveInvDtl.work_status <![CDATA[ <= ]]> #{work_status}
|
||||
</if>
|
||||
order by MoveInvDtl.seq_no
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -7,8 +7,11 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtMoveinvService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtMoveinv;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtMoveinvMapper;
|
||||
import org.nl.wms.st.instor.service.dto.MoveInvPageParam;
|
||||
import org.nl.wms.st.instor.service.dto.MoveStockInfoDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/2
|
||||
@@ -20,4 +23,9 @@ public class StIvtMoveinvImpl extends ServiceImpl<StIvtMoveinvMapper, StIvtMovei
|
||||
public IPage<StIvtMoveinv> moveStoragePage(IPage<StIvtMoveinv> pages, MoveInvPageParam param) {
|
||||
return this.baseMapper.moveStoragePageLeft(pages, param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MoveStockInfoDto> getMoveStockInfoByInvId(String moveinvId) {
|
||||
return this.baseMapper.getMoveStockInfoByInvId(moveinvId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import org.nl.common.utils.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
@@ -39,4 +40,9 @@ public class StIvtMoveinvdtlServiceImpl extends ServiceImpl<StIvtMoveinvdtlMappe
|
||||
}
|
||||
return CollectionUtils.mapList(getByMoveInvId(moveinvId), p -> (JSONObject) JSON.toJSON(p));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getOutBillDtl(Map whereJson) {
|
||||
return this.baseMapper.getOutBillDtl(whereJson);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,12 @@ package org.nl.b_lms.storage_manage.st.dao.mapper;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.StructattrQuerry;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
||||
import org.nl.wms.st.instor.service.dto.MoveInvPageParam;
|
||||
import org.nl.wms.st.instor.service.vo.MoveChooseMaterialVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -46,4 +49,8 @@ public interface StIvtStructattrMapper extends BaseMapper<StIvtStructattr> {
|
||||
List<StIvtStructattr> getAllOutVehicleStruct(JSONObject whereJson);
|
||||
|
||||
JSONArray getVehiclesStorage(List<String> idList);
|
||||
|
||||
IPage<MoveChooseMaterialVo> getStructIvtPage(IPage<MoveChooseMaterialVo> pages, MoveInvPageParam paramMap);
|
||||
|
||||
JSONArray getVehiclesStorageByCode(String code);
|
||||
}
|
||||
|
||||
@@ -580,5 +580,129 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="getStructIvtPage" resultType="org.nl.wms.st.instor.service.vo.MoveChooseMaterialVo">
|
||||
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="paramMap.in_stor_id != null and !paramMap.in_stor_id.isEmpty()">
|
||||
AND struct.stor_id IN
|
||||
<foreach collection="paramMap.in_stor_id" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.material_id != null and paramMap.material_id !=''">
|
||||
AND ivt2.material_id = #{paramMap.material_id}
|
||||
</if>
|
||||
<if test="paramMap.remark != null and paramMap.remark !=''">
|
||||
AND (mb.material_code LIKE '%${paramMap.remark}%' OR mb.material_name LIKE '%${paramMap.remark}%')
|
||||
</if>
|
||||
<if test="paramMap.ids != null and !paramMap.ids.isEmpty()">
|
||||
AND struct.storagevehicle_code IN
|
||||
<foreach collection="paramMap.ids" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.struct_code != null and paramMap.struct_code !=''">
|
||||
AND struct.struct_code LIKE '%${paramMap.struct_code}%'
|
||||
</if>
|
||||
<if test="paramMap.stor_id != null and paramMap.stor_id !=''">
|
||||
AND struct.stor_id = #{paramMap.stor_id}
|
||||
</if>
|
||||
<if test="paramMap.sect_id != null and paramMap.sect_id !=''">
|
||||
AND struct.sect_id = #{paramMap.sect_id}
|
||||
</if>
|
||||
<if test="paramMap.pcsn != null and paramMap.pcsn !=''">
|
||||
AND ivt2.pcsn LIKE '%${paramMap.pcsn}%'
|
||||
</if>
|
||||
<if test="paramMap.pcsns != null and !paramMap.pcsns.isEmpty()">
|
||||
AND ivt2.pcsn IN
|
||||
<foreach collection="paramMap.pcsns" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.sap_pcsn != null and paramMap.sap_pcsn !=''">
|
||||
AND sub.sap_pcsn LIKE '%${paramMap.sap_pcsn}%'
|
||||
</if>
|
||||
<if test="paramMap.sap_pcsns != null and !paramMap.sap_pcsns.isEmpty()">
|
||||
AND sub.sap_pcsn IN
|
||||
<foreach collection="paramMap.sap_pcsns" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.package_box_sn != null and paramMap.package_box_sn !=''">
|
||||
AND sub.package_box_sn LIKE '%${paramMap.package_box_sn}%'
|
||||
</if>
|
||||
<if test="paramMap.package_box_sns != null and !paramMap.package_box_sns.isEmpty()">
|
||||
AND sub.package_box_sn IN
|
||||
<foreach collection="paramMap.package_box_sns" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.sale_order_name != null and paramMap.sale_order_name !=''">
|
||||
AND sub.sale_order_name LIKE '%${paramMap.sale_order_name}%'
|
||||
</if>
|
||||
ORDER BY ivt2.struct_id
|
||||
</select>
|
||||
<select id="getVehiclesStorageByCode" resultType="com.alibaba.fastjson.JSONObject">
|
||||
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_id,
|
||||
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'
|
||||
<if test="code != null and code !=''">
|
||||
AND struct.storagevehicle_code = #{code}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -9,6 +9,8 @@ import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata.st.service.dto.EmptyVehicleParam;
|
||||
import org.nl.wms.basedata.st.service.vo.EmptyVehicleVo;
|
||||
import org.nl.wms.st.instor.service.dto.MoveInvPageParam;
|
||||
import org.nl.wms.st.instor.service.vo.MoveChooseMaterialVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -84,4 +86,14 @@ public interface StIvtStructattrService extends IService<StIvtStructattr> {
|
||||
JSONObject getAttributeByConditionsToObject(LambdaQueryWrapper<StIvtStructattr> structAttyLam, boolean flag);
|
||||
|
||||
JSONArray getVehiclesStorage(List<String> idList);
|
||||
|
||||
/**
|
||||
* 移库获取分页可移库的物料数据
|
||||
* @param param
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
IPage<MoveChooseMaterialVo> getStructIvtPage(MoveInvPageParam param, PageQuery page);
|
||||
|
||||
JSONArray getVehiclesStorageByCode(String code);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ import org.nl.b_lms.storage_manage.st.service.StIvtStructattrService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.CollectionUtils;
|
||||
import org.nl.wms.basedata.st.service.dto.EmptyVehicleParam;
|
||||
import org.nl.wms.basedata.st.service.vo.EmptyVehicleVo;
|
||||
import org.nl.wms.stat.service.vo.PastStructPageVo;
|
||||
import org.nl.wms.st.instor.service.dto.MoveInvPageParam;
|
||||
import org.nl.wms.st.instor.service.vo.MoveChooseMaterialVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -116,4 +116,16 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
||||
public JSONArray getVehiclesStorage(List<String> idList) {
|
||||
return this.baseMapper.getVehiclesStorage(idList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<MoveChooseMaterialVo> getStructIvtPage(MoveInvPageParam param, PageQuery page) {
|
||||
IPage<MoveChooseMaterialVo> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
pages = this.baseMapper.getStructIvtPage(pages, param);
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getVehiclesStorageByCode(String code) {
|
||||
return this.baseMapper.getVehiclesStorageByCode(code);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,9 +59,8 @@ public class HandMoveStorController {
|
||||
|
||||
@GetMapping("/getStructIvt")
|
||||
@Log("查询可分配库存")
|
||||
|
||||
public ResponseEntity<Object> getStructIvt(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(handMoveStorService.getStructIvt(whereJson, page), HttpStatus.OK);
|
||||
public ResponseEntity<Object> getStructIvt(MoveInvPageParam whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(handMoveStorService.getStructIvt(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getBoxIvt")
|
||||
@@ -73,7 +72,6 @@ public class HandMoveStorController {
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("移库单强制确认")
|
||||
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
handMoveStorService.confirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
@@ -88,7 +86,6 @@ public class HandMoveStorController {
|
||||
|
||||
@PostMapping("/handdown")
|
||||
@Log("移库单手动下发")
|
||||
|
||||
public ResponseEntity<Object> handdown(@RequestBody JSONObject whereJson) {
|
||||
handMoveStorService.handdown(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtMoveinv;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.st.instor.service.dto.MoveInvPageParam;
|
||||
import org.nl.wms.st.instor.service.vo.MoveChooseMaterialVo;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
@@ -48,7 +49,7 @@ public interface HandMoveStorService {
|
||||
* @param whereJson /
|
||||
* @return
|
||||
*/
|
||||
JSONArray getOutBillDtl(Map whereJson);
|
||||
List<JSONObject> getOutBillDtl(Map whereJson);
|
||||
|
||||
/**
|
||||
* 修改出库单
|
||||
@@ -70,7 +71,7 @@ public interface HandMoveStorService {
|
||||
* @param whereJson /
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getStructIvt(Map whereJson, Pageable page);
|
||||
IPage<MoveChooseMaterialVo> getStructIvt(MoveInvPageParam whereJson, PageQuery page);
|
||||
|
||||
JSONArray getBoxIvt(JSONArray whereJson);
|
||||
|
||||
|
||||
@@ -15,10 +15,23 @@ public class MoveInvPageParam implements Serializable {
|
||||
private String bill_code;
|
||||
private String stor_id;
|
||||
private List<String> stor_ids;
|
||||
private List<String> ids;
|
||||
private List<String> pcsns;
|
||||
private List<String> sap_pcsns;
|
||||
private List<String> package_box_sns;
|
||||
private List<String> in_stor_id;
|
||||
private String bill_status;
|
||||
private String material_code;
|
||||
private String bill_type;
|
||||
private String end_time;
|
||||
private String begin_time;
|
||||
private String create_mode;
|
||||
private String struct_code;
|
||||
private String remark;
|
||||
private String sect_id;
|
||||
private String package_box_sn;
|
||||
private String pcsn;
|
||||
private String sap_pcsn;
|
||||
private String sale_order_name;
|
||||
private String material_id;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.nl.wms.st.instor.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 移库库存信息
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/16
|
||||
*/
|
||||
@Data
|
||||
public class MoveStockInfoDto implements Serializable {
|
||||
/** 任务id */
|
||||
private String task_id;
|
||||
/** 转出仓位 */
|
||||
private String turnout_struct_code;
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -17,7 +18,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pdm.storagevehicleext.service.IMdPbStoragevehicleextService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtMoveinvService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtMoveinvdtlService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtMoveinv;
|
||||
@@ -32,11 +32,15 @@ import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.system.service.dict.ISysDictService;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.st.inbill.service.StorPublicService;
|
||||
import org.nl.wms.st.instor.service.HandMoveStorService;
|
||||
import org.nl.wms.st.instor.service.dto.MoveInvPageParam;
|
||||
import org.nl.wms.st.instor.service.dto.MoveStockInfoDto;
|
||||
import org.nl.wms.st.instor.service.vo.MoveChooseMaterialVo;
|
||||
import org.nl.wms.st.instor.task.HandMoveStorAcsTask;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -65,8 +69,10 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
* 任务表
|
||||
*/
|
||||
private final IschBaseTaskService taskService;
|
||||
/** 移库明细表 */
|
||||
private final IStIvtMoveinvdtlService moveinvdtlService;
|
||||
private final IMdPbStoragevehicleextService storagevehicleextService;
|
||||
private final ISysDictService dictService;
|
||||
|
||||
@Override
|
||||
public IPage<StIvtMoveinv> pageQuery(MoveInvPageParam param, PageQuery page) {
|
||||
@@ -423,13 +429,8 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getOutBillDtl(Map whereJson) {
|
||||
whereJson.put("flag", "2");
|
||||
JSONArray jo = WQL.getWO("QST_IVT_HANDMOVESTOR")
|
||||
.addParamMap((HashMap) whereJson)
|
||||
.process()
|
||||
.getResultJSONArray(0);
|
||||
return jo;
|
||||
public List<JSONObject> getOutBillDtl(Map whereJson) {
|
||||
return moveinvdtlService.getOutBillDtl(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -567,88 +568,59 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getStructIvt(Map whereJson, Pageable page) {
|
||||
HashMap<String, String> map = new HashMap<String, String>(whereJson);
|
||||
if (StrUtil.isNotEmpty(map.get("remark"))) {
|
||||
map.put("remark", "%" + map.get("remark") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("struct_code"))) {
|
||||
map.put("struct_code", "%" + map.get("struct_code") + "%");
|
||||
}
|
||||
|
||||
public IPage<MoveChooseMaterialVo> getStructIvt(MoveInvPageParam map, PageQuery page) {
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
|
||||
if (StrUtil.isNotEmpty(map.getPcsn())) {
|
||||
// 判断是否有空格
|
||||
String pcsn = MapUtil.getStr(map, "pcsn");
|
||||
String pcsn = map.getPcsn();
|
||||
|
||||
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[] pcsns = pcsn.split(" ");
|
||||
List<String> pcsnList = new ArrayList<>(Arrays.asList(pcsns));
|
||||
map.setPcsns(pcsnList);
|
||||
map.setPcsn("");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("sap_pcsn"))) {
|
||||
if (StrUtil.isNotEmpty(map.getSap_pcsn())) {
|
||||
// 判断是否有空格
|
||||
String sap_pcsn = MapUtil.getStr(map, "sap_pcsn");
|
||||
String sap_pcsn = map.getSap_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") + "%");
|
||||
List<String> sapList = new ArrayList<>(Arrays.asList(s));
|
||||
map.setSap_pcsns(sapList);
|
||||
map.setSap_pcsn("");
|
||||
}
|
||||
}
|
||||
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(map.get("package_box_sn"))) {
|
||||
if (StrUtil.isNotEmpty(map.getPackage_box_sn())) {
|
||||
// 判断是否有空格
|
||||
String package_box_sn = MapUtil.getStr(map, "package_box_sn");
|
||||
String package_box_sn = map.getPackage_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") + "%");
|
||||
|
||||
List<String> boxList = new ArrayList<>(Arrays.asList(s));
|
||||
map.setPackage_box_sns(boxList);
|
||||
map.setPackage_box_sn("");
|
||||
}
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(map.get("sale_order_name"))) {
|
||||
map.put("sale_order_name", "%" + map.get("sale_order_name") + "%");
|
||||
}
|
||||
|
||||
//获取人员对应的仓库
|
||||
UserStorServiceImpl userStorService = new UserStorServiceImpl();
|
||||
String in_stor_id = userStorService.getInStor();
|
||||
List<String> storIds = bsrealstorattrService.getStoreForUser(SecurityUtils.getCurrentUserId());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(in_stor_id)) {
|
||||
map.put("in_stor_id", in_stor_id);
|
||||
if (ObjectUtil.isNotEmpty(storIds)) {
|
||||
map.setIn_stor_id(storIds);
|
||||
}
|
||||
|
||||
JSONObject jo = WQL.getWO("QST_IVT_HANDMOVESTOR")
|
||||
.addParam("flag", "3")
|
||||
.addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ivt2.struct_id");
|
||||
return jo;
|
||||
return structattrService.getStructIvtPage(map, page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getBoxIvt(JSONArray whereJson) {
|
||||
JSONArray total_rows = new JSONArray();
|
||||
@@ -660,9 +632,7 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
}
|
||||
|
||||
for (String s : set) {
|
||||
JSONArray rows = WQL.getWO("QST_IVT_HANDMOVESTOR")
|
||||
.addParam("flag", "5")
|
||||
.addParam("storagevehicle_code", s).process().getResultJSONArray(0);
|
||||
JSONArray rows = structattrService.getVehiclesStorageByCode(s);
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject mater = rows.getJSONObject(i);
|
||||
total_rows.add(mater);
|
||||
@@ -674,38 +644,35 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void confirm(JSONObject form) {
|
||||
//明细表
|
||||
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_MoveInvDtl");
|
||||
//主表
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_MoveInv");
|
||||
//任务表
|
||||
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
|
||||
// 移库单id
|
||||
String moveinv_id = form.getString("moveinv_id");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
//查询主表信息
|
||||
JSONObject jo_mst = wo_mst.query("moveinv_id = '" + moveinv_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jo_mst)) {
|
||||
StIvtMoveinv moveOrder = moveinvService.getById(moveinv_id);
|
||||
if (ObjectUtil.isEmpty(moveOrder)) {
|
||||
throw new BadRequestException("未查到相关移库单");
|
||||
}
|
||||
//判断是否存在未确认状态的明细记录
|
||||
JSONObject task = wo_dtl.query("work_status ='02' and moveinv_id = '" + moveinv_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task)) {
|
||||
List<StIvtMoveinvdtl> moveTasks = moveinvdtlService.list(new LambdaUpdateWrapper<StIvtMoveinvdtl>()
|
||||
.eq(StIvtMoveinvdtl::getWork_status, "02")
|
||||
.eq(StIvtMoveinvdtl::getMoveinv_id, moveinv_id));
|
||||
if (moveTasks.size() > 0) {
|
||||
throw new BadRequestException("存在已下发未完成的移库任务,不允许强制确认!");
|
||||
}
|
||||
JSONArray ja = wo_dtl.query("moveinv_id='" + moveinv_id + "'").getResultJSONArray(0);
|
||||
List<JSONObject> ja = moveinvdtlService.getByMoveInvIdToObject(moveinv_id);
|
||||
for (int i = 0; i < ja.size(); i++) {
|
||||
JSONObject jo = ja.getJSONObject(i);
|
||||
JSONObject jo = ja.get(i);
|
||||
//删除任务
|
||||
HashMap<String, String> task_map = new HashMap<>();
|
||||
task_map.put("task_status", "07");
|
||||
task_map.put("update_optid", currentUserId + "");
|
||||
task_map.put("update_optname", nickName);
|
||||
task_map.put("update_time", now);
|
||||
wo_Task.update(task_map, "task_id='" + jo.getString("task_id") + "'");
|
||||
LambdaUpdateWrapper<SchBaseTask> taskUpLam = new LambdaUpdateWrapper<>();
|
||||
taskUpLam.set(SchBaseTask::getTask_status, "07")
|
||||
.set(SchBaseTask::getUpdate_optid, currentUserId)
|
||||
.set(SchBaseTask::getUpdate_optname, nickName)
|
||||
.set(SchBaseTask::getUpdate_time, now)
|
||||
.eq(SchBaseTask::getTask_id, jo.getString("task_id"));
|
||||
taskService.update(taskUpLam);
|
||||
//解锁起点点位、仓位,清除载具
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("lock_type", "1");
|
||||
@@ -730,29 +697,27 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
//更新移出库存
|
||||
jo.put("struct_id", jo.getString("turnout_struct_id"));
|
||||
jo.put("change_qty", jo.getDoubleValue("qty"));
|
||||
jo.put("bill_type_scode", jo_mst.getString("bill_type"));
|
||||
jo.put("bill_type_scode", moveOrder.getBill_type());
|
||||
jo.put("inv_id", jo.getString("moveinvdtl_id"));
|
||||
jo.put("bill_code", jo_mst.getString("bill_code"));
|
||||
jo.put("bill_code", moveOrder.getBill_code());
|
||||
jo.put("bill_table", "ST_IVT_MoveInv");
|
||||
storPublicService.IOStor(jo, "21");
|
||||
//更新移入库存
|
||||
jo.put("struct_id", jo.getString("turnin_struct_id"));
|
||||
jo.put("bill_type_scode", jo_mst.getString("bill_type"));
|
||||
jo.put("bill_type_scode", moveOrder.getBill_type());
|
||||
jo.put("inv_id", jo.getString("moveinvdtl_id"));
|
||||
jo.put("bill_code", jo_mst.getString("bill_code"));
|
||||
jo.put("bill_code", moveOrder.getBill_code());
|
||||
jo.put("bill_table", "ST_IVT_MoveInv");
|
||||
storPublicService.IOStor(jo, "33");
|
||||
//更新明细
|
||||
jo.put("work_status", "99");
|
||||
wo_dtl.update(jo);
|
||||
moveinvdtlService.updateById(jo.toJavaObject(StIvtMoveinvdtl.class));
|
||||
}
|
||||
HashMap<String, String> map_mst = new HashMap<>();
|
||||
map_mst.put("bill_status", "99");
|
||||
map_mst.put("confirm_optid", currentUserId + "");
|
||||
map_mst.put("confirm_optname", nickName);
|
||||
map_mst.put("confirm_time", now);
|
||||
//更新主表状态
|
||||
wo_mst.update(map_mst, "moveinv_id='" + moveinv_id + "'");
|
||||
moveOrder.setBill_status("99");
|
||||
moveOrder.setUpdate_optid(currentUserId);
|
||||
moveOrder.setUpdate_optname(nickName);
|
||||
moveOrder.setUpdate_time(now);
|
||||
moveinvService.updateById(moveOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -948,54 +913,48 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void handdown(JSONObject whereJson) {
|
||||
//移库单主表
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_MoveInv");
|
||||
//移库单明细表
|
||||
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_MoveInvDtl");
|
||||
//任务表
|
||||
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
//仓位表
|
||||
WQLObject wo_attr = WQLObject.getWQLObject("st_ivt_structattr");
|
||||
|
||||
HandMoveStorAcsTask handMoveStorAcsTask = new HandMoveStorAcsTask();
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
String moveinv_id = whereJson.getString("moveinv_id");
|
||||
String bill_type = whereJson.getString("bill_type");
|
||||
|
||||
//查询所有载具的库存
|
||||
JSONArray ja = WQL.getWO("QST_IVT_HANDMOVESTOR")
|
||||
.addParam("flag", "4")
|
||||
.addParam("moveinv_id", moveinv_id)
|
||||
.process().getResultJSONArray(0);
|
||||
if (ja.size() == 0) {
|
||||
List<MoveStockInfoDto> stockTaskInfo = moveinvService.getMoveStockInfoByInvId(moveinv_id);
|
||||
if (stockTaskInfo.size() == 0) {
|
||||
throw new BadRequestException("当前移库单无可下发任务!");
|
||||
}
|
||||
for (int i = 0; i < ja.size(); i++) {
|
||||
JSONObject jo = ja.getJSONObject(i);
|
||||
String task_id = jo.getString("task_id");
|
||||
|
||||
JSONObject task = wo_Task.query("task_id='" + task_id + "'").uniqueResult(0);
|
||||
task.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
wo_Task.update(task);
|
||||
|
||||
for (int i = 0; i < stockTaskInfo.size(); i++) {
|
||||
MoveStockInfoDto moveStockInfoDto = stockTaskInfo.get(i);
|
||||
String task_id = moveStockInfoDto.getTask_id();
|
||||
boolean update = taskService.update(new LambdaUpdateWrapper<SchBaseTask>()
|
||||
.set(SchBaseTask::getTask_status, TaskStatusEnum.START_AND_POINT.getCode())
|
||||
.eq(SchBaseTask::getTask_id, task_id));
|
||||
log.info("任务-{}更新情况:", task_id, update);
|
||||
// 下发任务
|
||||
JSONObject result = handMoveStorAcsTask.immediateNotifyAcs(task_id);
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
String status = result.getString("status");
|
||||
if ("200".equals(status)) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
// 下发成功
|
||||
//更新分配表
|
||||
map.put("is_issued", "1");
|
||||
map.put("work_status", "02");
|
||||
wo_dtl.update(map, "is_issued='0' and task_id='" + task.getString("task_id") + "'");
|
||||
LambdaUpdateWrapper<StIvtMoveinvdtl> moveDtlUpLam = new LambdaUpdateWrapper<>();
|
||||
moveDtlUpLam.set(StIvtMoveinvdtl::getIs_issued, "1")
|
||||
.set(StIvtMoveinvdtl::getWork_status, "02")
|
||||
.eq(StIvtMoveinvdtl::getIs_issued, "0")
|
||||
.eq(StIvtMoveinvdtl::getTask_id, task_id);
|
||||
moveinvdtlService.update(moveDtlUpLam);
|
||||
//更新任务为已下发
|
||||
map.put("task_status", "05");
|
||||
map.put("update_optid", currentUserId + "");
|
||||
map.put("update_optname", nickName);
|
||||
map.put("update_time", now);
|
||||
wo_Task.update(map, "is_delete ='0' and task_id='" + task_id + "'");
|
||||
LambdaUpdateWrapper<SchBaseTask> taskUpLam = new LambdaUpdateWrapper<>();
|
||||
taskUpLam.set(SchBaseTask::getTask_status, "05")
|
||||
.set(SchBaseTask::getUpdate_optid, currentUserId)
|
||||
.set(SchBaseTask::getUpdate_optname, nickName)
|
||||
.set(SchBaseTask::getUpdate_time, now)
|
||||
.eq(SchBaseTask::getIs_delete, "0")
|
||||
.eq(SchBaseTask::getTask_id, task_id);
|
||||
taskService.update(taskUpLam);
|
||||
} else {
|
||||
throw new BadRequestException("任务下发失败,请稍后重试!");
|
||||
}
|
||||
@@ -1003,14 +962,18 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
throw new BadRequestException("任务下发失败,请稍后重试!");
|
||||
}
|
||||
}
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("bill_status", "20");
|
||||
wo_mst.update(map, "moveinv_id='" + moveinv_id + "'");
|
||||
// 更新主表状态
|
||||
LambdaUpdateWrapper<StIvtMoveinv> moveInvUpLam = new LambdaUpdateWrapper<>();
|
||||
moveInvUpLam.set(StIvtMoveinv::getBill_code, "20")
|
||||
.eq(StIvtMoveinv::getMoveinv_id, moveinv_id);
|
||||
moveinvService.update(moveInvUpLam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getInvTypes() {
|
||||
//查询单据字段类型
|
||||
// List<Dict> list = dictService.list(new QueryWrapper<Dict>().select("max(value) AS CODE",
|
||||
// "max(label) AS NAME").like("code", "INV_TYPE").orderByAsc("value"));
|
||||
JSONArray ja = WQL.getWO("ST_PUB_QUERY_01")
|
||||
.addParam("flag", "4")
|
||||
.process()
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.nl.wms.st.instor.service.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 移库单库存物料选择
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/16
|
||||
*/
|
||||
@Data
|
||||
public class MoveChooseMaterialVo 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;
|
||||
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 String storagevehicle_id;
|
||||
private String storagevehicle_code;
|
||||
private String qty_unit_name;
|
||||
private String sale_order_name;
|
||||
private String customer_name;
|
||||
private String customer_description;
|
||||
private String sap_pcsn;
|
||||
}
|
||||
Reference in New Issue
Block a user