add:异常口、退货口入库流程
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 移库单据
|
||||
@@ -9,4 +14,18 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtMoveinv;
|
||||
* @Date: 2025/7/2
|
||||
*/
|
||||
public interface IStIvtMoveinvService extends IService<StIvtMoveinv> {
|
||||
/**
|
||||
* 分页查询
|
||||
* @param pages
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
IPage<StIvtMoveinv> moveStoragePage(IPage<StIvtMoveinv> pages, MoveInvPageParam param);
|
||||
|
||||
/**
|
||||
* 查询所有载具的库存
|
||||
* @param moveinvId 移库单id
|
||||
* @return
|
||||
*/
|
||||
List<MoveStockInfoDto> getMoveStockInfoByInvId(String moveinvId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
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
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
public interface IStIvtMoveinvdtlService extends IService<StIvtMoveinvdtl> {
|
||||
List<StIvtMoveinvdtl> getByMoveInvId(String moveinvId);
|
||||
List<JSONObject> getByMoveInvIdToObject(String moveinvId);
|
||||
|
||||
List<JSONObject> getOutBillDtl(Map whereJson);
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 衣裤单据
|
||||
* 移库单据
|
||||
*
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/2
|
||||
@@ -13,6 +15,7 @@ import lombok.Data;
|
||||
@TableName("st_ivt_moveinv")
|
||||
public class StIvtMoveinv {
|
||||
/** 移库单标识 */
|
||||
@TableId
|
||||
private String moveinv_id;
|
||||
/** 单据编号 */
|
||||
private String bill_code;
|
||||
@@ -64,5 +67,7 @@ public class StIvtMoveinv {
|
||||
private String syscompanyid;
|
||||
/***/
|
||||
private String is_delete;
|
||||
@TableField(exist = false)
|
||||
private String id;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 移库单明细表实体类
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
@Data
|
||||
@TableName("st_ivt_moveinvdtl")
|
||||
public class StIvtMoveinvdtl implements Serializable {
|
||||
/**
|
||||
* 移库单明细标识
|
||||
*/
|
||||
@TableId
|
||||
private String moveinvdtl_id;
|
||||
|
||||
/**
|
||||
* 移库单标识
|
||||
*/
|
||||
private String moveinv_id;
|
||||
|
||||
/**
|
||||
* 明细序号
|
||||
*/
|
||||
private BigDecimal seq_no;
|
||||
|
||||
/**
|
||||
* 转出库区标识
|
||||
*/
|
||||
private String turnout_sect_id;
|
||||
|
||||
/**
|
||||
* 转出库区编码
|
||||
*/
|
||||
private String turnout_sect_code;
|
||||
|
||||
/**
|
||||
* 转出库区名称
|
||||
*/
|
||||
private String turnout_sect_name;
|
||||
|
||||
/**
|
||||
* 转出仓位标识
|
||||
*/
|
||||
private String turnout_struct_id;
|
||||
|
||||
/**
|
||||
* 转出仓位编码
|
||||
*/
|
||||
private String turnout_struct_code;
|
||||
|
||||
/**
|
||||
* 转出仓位名称
|
||||
*/
|
||||
private String turnout_struct_name;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 品质类型
|
||||
*/
|
||||
private String quality_scode = "00";
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
/**
|
||||
* 数量计量单位名称
|
||||
*/
|
||||
private String qty_unit_name;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal qty;
|
||||
|
||||
/**
|
||||
* 转入库区标识
|
||||
*/
|
||||
private String turnin_sect_id;
|
||||
|
||||
/**
|
||||
* 转入库区编码
|
||||
*/
|
||||
private String turnin_sect_code;
|
||||
|
||||
/**
|
||||
* 转入库区名称
|
||||
*/
|
||||
private String turnin_sect_name;
|
||||
|
||||
/**
|
||||
* 转入仓位标识
|
||||
*/
|
||||
private String turnin_struct_id;
|
||||
|
||||
/**
|
||||
* 转入仓位编码
|
||||
*/
|
||||
private String turnin_struct_code;
|
||||
|
||||
/**
|
||||
* 转入仓位名称
|
||||
*/
|
||||
private String turnin_struct_name;
|
||||
|
||||
/**
|
||||
* 执行状态
|
||||
*/
|
||||
private String work_status = "01";
|
||||
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private String task_id;
|
||||
|
||||
/**
|
||||
* 存储载具标识
|
||||
*/
|
||||
private String storagevehicle_id;
|
||||
|
||||
/**
|
||||
* 存储载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 是否已下发
|
||||
*/
|
||||
private String is_issued = "0";
|
||||
|
||||
/**
|
||||
* 来源单据明细标识
|
||||
*/
|
||||
private String source_billdtl_id;
|
||||
|
||||
/**
|
||||
* 来源单据类型
|
||||
*/
|
||||
private String source_bill_type;
|
||||
|
||||
/**
|
||||
* 来源单编号
|
||||
*/
|
||||
private String source_bill_code;
|
||||
|
||||
/**
|
||||
* 来源单表名
|
||||
*/
|
||||
private String source_bill_table;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
@@ -1,11 +1,19 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper;
|
||||
|
||||
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
|
||||
* @Date: 2025/7/2
|
||||
*/
|
||||
public interface StIvtMoveinvMapper extends BaseMapper<StIvtMoveinv> {
|
||||
IPage<StIvtMoveinv> moveStoragePageLeft(IPage<StIvtMoveinv> pages, MoveInvPageParam param);
|
||||
|
||||
List<MoveStockInfoDto> getMoveStockInfoByInvId(String moveinvId);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,105 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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.StIvtMoveinvMapper">
|
||||
<select id="moveStoragePageLeft"
|
||||
resultType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtMoveinv">
|
||||
SELECT
|
||||
move.moveinv_id AS id,
|
||||
move.moveinv_id,
|
||||
move.bill_code,
|
||||
move.buss_type,
|
||||
move.bill_type,
|
||||
move.biz_date,
|
||||
move.stor_id,
|
||||
move.stor_code,
|
||||
move.stor_name,
|
||||
move.total_qty,
|
||||
move.detail_count,
|
||||
move.bill_status,
|
||||
move.remark,
|
||||
move.create_mode,
|
||||
move.input_optid,
|
||||
move.input_optname,
|
||||
move.input_time,
|
||||
move.update_optid,
|
||||
move.update_optname,
|
||||
move.update_time,
|
||||
move.confirm_optid,
|
||||
move.confirm_optname,
|
||||
move.confirm_time,
|
||||
move.confirm_info,
|
||||
move.sysdeptid,
|
||||
move.syscompanyid,
|
||||
move.is_delete
|
||||
FROM
|
||||
ST_IVT_MoveInv move
|
||||
inner join (
|
||||
SELECT
|
||||
movedtl.moveinv_id
|
||||
FROM
|
||||
st_ivt_moveinvdtl movedtl
|
||||
INNER JOIN md_me_materialbase mb ON mb.material_id = movedtl.material_id
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="param.material_code != null and param.material_code != ''">
|
||||
AND (mb.material_code LIKE '%${param.material_code}%'
|
||||
OR mb.material_name LIKE '%${param.material_code}%')
|
||||
</if>
|
||||
GROUP BY movedtl.moveinv_id
|
||||
) dtl2 on dtl2.moveinv_id = move.moveinv_id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND move.is_delete = '0'
|
||||
<if test="param.stor_ids != null and !param.stor_ids.isEmpty()">
|
||||
AND move.stor_id IN
|
||||
<foreach collection="param.stor_ids" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.bill_code != null and param.bill_code != ''">
|
||||
AND move.bill_code LIKE '%${param.bill_code}%'
|
||||
</if>
|
||||
<if test="param.buss_type != null and param.buss_type != ''">
|
||||
AND move.buss_type LIKE '%${param.buss_type}%'
|
||||
</if>
|
||||
<if test="param.bill_type != null and param.bill_type != ''">
|
||||
AND move.bill_type = #{param.bill_type}
|
||||
</if>
|
||||
<if test="param.stor_id != null and param.stor_id != ''">
|
||||
AND move.stor_id = #{param.stor_id}
|
||||
</if>
|
||||
<if test="param.create_mode != null and param.create_mode != ''">
|
||||
AND move.create_mode = #{param.create_mode}
|
||||
</if>
|
||||
<if test="param.bill_status != null and param.bill_status != ''">
|
||||
AND move.bill_status = #{param.bill_status}
|
||||
</if>
|
||||
<if test="param.begin_time != null and param.begin_time != ''">
|
||||
AND move.input_time <![CDATA[ >= ]]> #{param.begin_time}
|
||||
</if>
|
||||
<if test="param.end_time != null and param.end_time != ''">
|
||||
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>
|
||||
|
||||
@@ -0,0 +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);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>
|
||||
@@ -1,12 +1,17 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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
|
||||
@@ -14,4 +19,13 @@ import org.springframework.stereotype.Service;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class StIvtMoveinvImpl extends ServiceImpl<StIvtMoveinvMapper, StIvtMoveinv> implements IStIvtMoveinvService {
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
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.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtMoveinvdtlService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtMoveinvdtl;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtMoveinvdtlMapper;
|
||||
import org.nl.common.utils.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class StIvtMoveinvdtlServiceImpl extends ServiceImpl<StIvtMoveinvdtlMapper, StIvtMoveinvdtl> implements IStIvtMoveinvdtlService {
|
||||
@Override
|
||||
public List<StIvtMoveinvdtl> getByMoveInvId(String moveinvId) {
|
||||
if (ObjectUtil.isEmpty(moveinvId)) {
|
||||
return null;
|
||||
}
|
||||
LambdaQueryWrapper<StIvtMoveinvdtl> lam = new QueryWrapper<StIvtMoveinvdtl>().lambda();
|
||||
lam.eq(StIvtMoveinvdtl::getMoveinv_id, moveinvId);
|
||||
return list(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getByMoveInvIdToObject(String moveinvId) {
|
||||
if (ObjectUtil.isEmpty(moveinvId)) {
|
||||
return null;
|
||||
}
|
||||
return CollectionUtils.mapList(getByMoveInvId(moveinvId), p -> (JSONObject) JSON.toJSON(p));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getOutBillDtl(Map whereJson) {
|
||||
return this.baseMapper.getOutBillDtl(whereJson);
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class MaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialBaseMapper,MdMeMaterialBase> implements MaterialbaseService {
|
||||
public class MaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialBaseMapper, MdMeMaterialBase> implements MaterialbaseService {
|
||||
private final ClassstandardService classstandardService;
|
||||
private final MdMeMaterialBaseMapper mdMeMaterialBaseMapper;
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package org.nl.b_lms.storage_manage.st.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 仓库物流日表实体类
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
@Data
|
||||
public class StIvtIostordaily implements Serializable {
|
||||
/**
|
||||
* 仓库日表标识
|
||||
*/
|
||||
@TableId
|
||||
private String stordaily_id;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
private String stor_code;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String stor_name;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
private String sect_date;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 品质类型
|
||||
*/
|
||||
private String quality_scode = "01";
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 期初数
|
||||
*/
|
||||
private BigDecimal start_num;
|
||||
|
||||
/**
|
||||
* 入库数
|
||||
*/
|
||||
private BigDecimal in_num;
|
||||
|
||||
/**
|
||||
* 出库数
|
||||
*/
|
||||
private BigDecimal out_num;
|
||||
|
||||
/**
|
||||
* 其它加
|
||||
*/
|
||||
private BigDecimal more_num;
|
||||
|
||||
/**
|
||||
* 其它减
|
||||
*/
|
||||
private BigDecimal less_num;
|
||||
|
||||
/**
|
||||
* 期末数
|
||||
*/
|
||||
private BigDecimal end_num;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package org.nl.b_lms.storage_manage.st.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
@Data
|
||||
public class StIvtStructivtflow implements Serializable {
|
||||
/**
|
||||
* 记录标识
|
||||
*/
|
||||
@TableId
|
||||
private String change_id;
|
||||
|
||||
/**
|
||||
* 仓位标识
|
||||
*/
|
||||
private String struct_id;
|
||||
|
||||
/**
|
||||
* 仓位编码
|
||||
*/
|
||||
private String struct_code;
|
||||
|
||||
/**
|
||||
* 仓位名称
|
||||
*/
|
||||
private String struct_name;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 品质类型
|
||||
*/
|
||||
private String quality_scode;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String bill_type_scode;
|
||||
|
||||
/**
|
||||
* 单据标识
|
||||
*/
|
||||
private String inv_id;
|
||||
|
||||
/**
|
||||
* 单据编号
|
||||
*/
|
||||
private String bill_code;
|
||||
|
||||
/**
|
||||
* 单据表名
|
||||
*/
|
||||
private String bill_table;
|
||||
|
||||
/**
|
||||
* 变动类型
|
||||
*/
|
||||
private String change_type_scode;
|
||||
|
||||
/**
|
||||
* 变动时间
|
||||
*/
|
||||
private String change_time;
|
||||
|
||||
/**
|
||||
* 变动人
|
||||
*/
|
||||
private String change_person_id;
|
||||
|
||||
/**
|
||||
* 变动人姓名
|
||||
*/
|
||||
private String change_person_name;
|
||||
|
||||
/**
|
||||
* 变动数
|
||||
*/
|
||||
private BigDecimal change_qty;
|
||||
|
||||
/**
|
||||
* 结存数量
|
||||
*/
|
||||
private BigDecimal result_qty;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.nl.b_lms.storage_manage.st.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtIostordaily;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
public interface StIvtIostordailyMapper extends BaseMapper<StIvtIostordaily> {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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.st.dao.mapper.StIvtIostordailyMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,10 +1,14 @@
|
||||
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;
|
||||
|
||||
@@ -43,4 +47,10 @@ public interface StIvtStructattrMapper extends BaseMapper<StIvtStructattr> {
|
||||
List<StIvtStructattr> getOutVehicleRowStructattr(JSONObject whereJson);
|
||||
|
||||
List<StIvtStructattr> getAllOutVehicleStruct(JSONObject whereJson);
|
||||
|
||||
JSONArray getVehiclesStorage(List<String> idList);
|
||||
|
||||
IPage<MoveChooseMaterialVo> getStructIvtPage(IPage<MoveChooseMaterialVo> pages, MoveInvPageParam paramMap);
|
||||
|
||||
JSONArray getVehiclesStorageByCode(String code);
|
||||
}
|
||||
|
||||
@@ -543,5 +543,166 @@
|
||||
|
||||
|
||||
</select>
|
||||
<select id="getVehiclesStorage" 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'
|
||||
AND IFNULL(struct.storagevehicle_code,'') <![CDATA[ <> ]]> ''
|
||||
<if test="idList != null and !idList.isEmpty()">
|
||||
AND struct.storagevehicle_code IN
|
||||
<foreach collection="idList" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</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>
|
||||
|
||||
@@ -48,4 +48,8 @@ public interface StIvtStructivtMapper extends BaseMapper<StIvtStructivt> {
|
||||
JSONArray getOutBillDis2(Map param);
|
||||
|
||||
List<OutBillTaskVo> getOutBillTask(Map param);
|
||||
|
||||
JSONObject getStorageMaterialInfo(JSONObject map);
|
||||
|
||||
JSONObject getStorageInfoByStrId(String structId);
|
||||
}
|
||||
|
||||
@@ -919,4 +919,50 @@
|
||||
AND task.task_status = #{task_status}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getStorageMaterialInfo" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
ivt.*
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id
|
||||
WHERE
|
||||
1=1
|
||||
<if test="struct_id != '' and struct_id != null">
|
||||
AND ivt.struct_id = #{struct_id}
|
||||
</if>
|
||||
<if test="material_id != '' and material_id != null">
|
||||
AND ivt.material_id = #{material_id}
|
||||
</if>
|
||||
<if test="pcsn != '' and pcsn != null">
|
||||
AND ivt.pcsn = #{pcsn}
|
||||
</if>
|
||||
<if test="quality_scode != '' and quality_scode != null">
|
||||
AND ivt.quality_scode = #{quality_scode}
|
||||
</if>
|
||||
<if test="storagevehicle_code != '' and storagevehicle_code != null">
|
||||
AND attr.storagevehicle_code = #{storagevehicle_code}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getStorageInfoByStrId" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
struct.struct_id,
|
||||
struct.struct_name,
|
||||
struct.struct_code,
|
||||
struct.sect_id,
|
||||
struct.sect_name,
|
||||
struct.stor_id,
|
||||
struct.stor_code,
|
||||
struct.stor_name,
|
||||
sect.sect_code
|
||||
FROM
|
||||
ST_IVT_StructAttr struct
|
||||
left join ST_IVT_SectAttr sect on sect.sect_id=struct.sect_id
|
||||
WHERE
|
||||
struct.is_delete = '0'
|
||||
AND struct.is_used = '1'
|
||||
AND sect.is_used='1'
|
||||
<if test="structId != '' and structId != null">
|
||||
AND struct.struct_id = #{structId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.nl.b_lms.storage_manage.st.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructivtflow;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
public interface StIvtStructivtflowMapper extends BaseMapper<StIvtStructivtflow> {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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.st.dao.mapper.StIvtStructivtflowMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.nl.b_lms.storage_manage.st.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtIostordaily;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
public interface StIvtIostordailyService extends IService<StIvtIostordaily> {
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.b_lms.storage_manage.st.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -8,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;
|
||||
|
||||
@@ -28,10 +31,18 @@ public interface StIvtStructattrService extends IService<StIvtStructattr> {
|
||||
|
||||
/**
|
||||
* 根据仓位编码获取仓位属性
|
||||
* @param structCodes
|
||||
* @param structCodes 仓位编码数组
|
||||
* @return
|
||||
*/
|
||||
List<StIvtStructattr> getAttributeByCodes(List<String> structCodes);
|
||||
|
||||
/**
|
||||
* 根据仓位编码获取仓位属性
|
||||
* @param structCode 仓位编码
|
||||
* @param flag {@code true}多条报错 or {@code false}多条获取第一条
|
||||
* @return
|
||||
*/
|
||||
StIvtStructattr getAttributeByCode(String structCode, Boolean flag);
|
||||
/**
|
||||
* 根据仓位编码获取仓位属性
|
||||
* @param structCodes
|
||||
@@ -73,4 +84,16 @@ public interface StIvtStructattrService extends IService<StIvtStructattr> {
|
||||
* @return JSONObject
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -72,4 +72,13 @@ public interface StIvtStructivtService extends IService<StIvtStructivt> {
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> getAllInventorys(InventoryQueryParam param);
|
||||
|
||||
JSONObject getStorageMaterialInfo(JSONObject map);
|
||||
|
||||
/**
|
||||
* 通过仓位id获取仓位数据
|
||||
* @param structId
|
||||
* @return
|
||||
*/
|
||||
JSONObject getStorageInfoByStrId(String structId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.nl.b_lms.storage_manage.st.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructivtflow;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
public interface StIvtStructivtflowService extends IService<StIvtStructivtflow> {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.nl.b_lms.storage_manage.st.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtIostordaily;
|
||||
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtIostordailyMapper;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtIostordailyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class StIvtIostordailyServiceImpl extends ServiceImpl<StIvtIostordailyMapper, StIvtIostordaily> implements StIvtIostordailyService {
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package org.nl.b_lms.storage_manage.st.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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;
|
||||
@@ -14,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;
|
||||
@@ -62,6 +63,16 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
||||
return list(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StIvtStructattr getAttributeByCode(String structCode, Boolean flag) {
|
||||
if (ObjectUtil.isEmpty(structCode)) {
|
||||
return null;
|
||||
}
|
||||
LambdaQueryWrapper<StIvtStructattr> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(StIvtStructattr::getStruct_code, structCode);
|
||||
return getOne(lam, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getAttributeByCodesToObject(List<String> structCodes) {
|
||||
if (structCodes.size() == 0) {
|
||||
@@ -100,4 +111,21 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
||||
}
|
||||
return (JSONObject) JSON.toJSON(attributeByConditions);
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,4 +78,14 @@ public class StIvtStructivtServiceImpl extends ServiceImpl<StIvtStructivtMapper,
|
||||
public List<JSONObject> getAllInventorys(InventoryQueryParam param) {
|
||||
return stIvtStructivtMapper.getAllInventorys(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getStorageMaterialInfo(JSONObject map) {
|
||||
return stIvtStructivtMapper.getStorageMaterialInfo(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getStorageInfoByStrId(String structId) {
|
||||
return stIvtStructivtMapper.getStorageInfoByStrId(structId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.nl.b_lms.storage_manage.st.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructivtflow;
|
||||
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtStructivtflowMapper;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtStructivtflowService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class StIvtStructivtflowServiceImpl extends ServiceImpl<StIvtStructivtflowMapper, StIvtStructivtflow> implements StIvtStructivtflowService {
|
||||
}
|
||||
@@ -6,44 +6,61 @@ import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.md.dao.MdMeMaterialBase;
|
||||
import org.nl.b_lms.storage_manage.md.service.MaterialbaseService;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtIostordaily;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructivt;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructivtflow;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtIostordailyService;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtStructattrService;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtStructivtService;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtStructivtflowService;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.st.inbill.service.StorPublicService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* PC端出入库新增
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class StorPublicServiceImpl implements StorPublicService {
|
||||
|
||||
/** 货位库存表 */
|
||||
@Autowired
|
||||
private StIvtStructivtService structivtService;
|
||||
@Autowired
|
||||
private MaterialbaseService materialbaseService;
|
||||
@Autowired
|
||||
private StIvtStructivtflowService stIvtStructivtflowService;
|
||||
@Autowired
|
||||
private StIvtIostordailyService stIvtIostordailyService;
|
||||
@Autowired
|
||||
private StIvtStructattrService structattrService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
void createStor(JSONObject from) {
|
||||
// 货位库存表
|
||||
WQLObject wql_StructIvt = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
||||
// 查询货位信息
|
||||
JSONObject jo = WQL.getWO("ST_PUB_QUERY_01")
|
||||
.addParam("flag", "1")
|
||||
.addParam("id", from.getString("struct_id"))
|
||||
.process().uniqueResult(0);
|
||||
JSONObject jo = structivtService.getStorageInfoByStrId(from.getString("struct_id"));
|
||||
if (jo == null) {
|
||||
throw new BadRequestException("仓位不存在或者未启用:" + from.getString("struct_id"));
|
||||
}
|
||||
// 查询物料信息
|
||||
JSONObject jo_WMSMaterial = WQL.getWO("ST_PUB_QUERY_01")
|
||||
.addParam("flag", "2")
|
||||
.addParam("material_id", from.getString("material_id"))
|
||||
.process()
|
||||
.uniqueResult(0);
|
||||
MdMeMaterialBase jo_WMSMaterial = materialbaseService.getOne(new LambdaUpdateWrapper<MdMeMaterialBase>()
|
||||
.eq(MdMeMaterialBase::getMaterial_id, from.getString("material_id"))
|
||||
.eq(MdMeMaterialBase::getIs_used, "1")
|
||||
.eq(MdMeMaterialBase::getIs_delete, "0"));
|
||||
if (ObjectUtil.isEmpty(jo_WMSMaterial)) {
|
||||
throw new BadRequestException("物料不存在或者未启用:" + from.getString("material_id"));
|
||||
}
|
||||
@@ -53,7 +70,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
from.put("stor_id", jo.getString("stor_id"));
|
||||
from.put("stor_name", jo.getString("stor_name"));
|
||||
from.put("instorage_time", DateUtil.now());
|
||||
wql_StructIvt.insert(from);
|
||||
structivtService.save(from.toJavaObject(StIvtStructivt.class));
|
||||
// 更新库存变动日志
|
||||
from.put("result_qty", from.getDoubleValue("ivt_qty"));
|
||||
from.put("stor_code", jo.getString("stor_code"));
|
||||
@@ -62,10 +79,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
void createStructIvtFlow(JSONObject from) {
|
||||
// 仓位库存变动记录表
|
||||
WQLObject wql_StructIvtFlow = WQLObject.getWQLObject("ST_IVT_StructIvtFlow");
|
||||
// 库区物流日表
|
||||
WQLObject wql_IOSectDaily = WQLObject.getWQLObject("ST_IVT_IOStorDaily");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
@@ -76,8 +90,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
|
||||
String change_type_scode = from.getString("change_type_scode");
|
||||
String bill_code = from.getString("bill_code");
|
||||
|
||||
wql_StructIvtFlow.insert(from);
|
||||
stIvtStructivtflowService.save(from.toJavaObject(StIvtStructivtflow.class));
|
||||
//拆拼盘不汇总到日表,库存变动记录还是要有记录
|
||||
if (bill_code.startsWith("YK") || bill_code.startsWith("CPP")) {
|
||||
return;
|
||||
@@ -85,22 +98,25 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
if ("22,23,33,21,24,25,34".contains(change_type_scode)) {
|
||||
String sect_date = DateUtil.today();
|
||||
// 出查询更新条件
|
||||
String sql_where = "stor_id = '" + from.getString("stor_id") +
|
||||
"' and sect_date = '" + sect_date +
|
||||
"' and material_id = '" + from.getString("material_id") +
|
||||
"' and pcsn = '" + from.getString("pcsn") +
|
||||
"' and quality_scode = '" + from.getString("quality_scode") + "'";
|
||||
JSONObject jo = wql_IOSectDaily.query(sql_where).uniqueResult(0);
|
||||
LambdaQueryWrapper<StIvtIostordaily> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(StIvtIostordaily::getStor_id, from.getString("stor_id"))
|
||||
.eq(StIvtIostordaily::getSect_date, sect_date)
|
||||
.eq(StIvtIostordaily::getMaterial_id, from.getString("material_id"))
|
||||
.eq(StIvtIostordaily::getPcsn, from.getString("pcsn"))
|
||||
.eq(StIvtIostordaily::getQuality_scode, from.getString("quality_scode"));
|
||||
StIvtIostordaily jo = stIvtIostordailyService.getOne(lam);
|
||||
if (jo == null) {// 新增
|
||||
String sql_where_before = "stor_id = '" + from.getString("stor_id") +
|
||||
"' and material_id = '" + from.getString("material_id") +
|
||||
"' and pcsn = '" + from.getString("pcsn") +
|
||||
"' and quality_scode = '" + from.getString("quality_scode") + "'";
|
||||
JSONObject jo_before = wql_IOSectDaily.query(sql_where_before, "sect_date desc").uniqueResult(0);
|
||||
LambdaQueryWrapper<StIvtIostordaily> lam2 = new LambdaQueryWrapper<>();
|
||||
lam2.eq(StIvtIostordaily::getStor_id, from.getString("stor_id"))
|
||||
.eq(StIvtIostordaily::getMaterial_id, from.getString("material_id"))
|
||||
.eq(StIvtIostordaily::getPcsn, from.getString("pcsn"))
|
||||
.eq(StIvtIostordaily::getQuality_scode, from.getString("quality_scode"))
|
||||
.orderByDesc(StIvtIostordaily::getSect_date);
|
||||
StIvtIostordaily jo_before = stIvtIostordailyService.getOne(lam2, false);
|
||||
if (jo_before == null) {
|
||||
from.put("start_num", "0");
|
||||
} else {
|
||||
from.put("start_num", jo_before.getDoubleValue("end_num"));
|
||||
from.put("start_num", jo_before.getEnd_num().doubleValue());
|
||||
}
|
||||
from.put("sect_date", sect_date);
|
||||
if ("22,33".contains(change_type_scode)) {
|
||||
@@ -129,24 +145,24 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
from.put("less_num", from.getDoubleValue("change_qty"));
|
||||
}
|
||||
|
||||
from.put("stordaily_id", IdUtil.getSnowflake(1, 1).nextId() + "");
|
||||
wql_IOSectDaily.insert(from);
|
||||
from.put("stordaily_id", org.nl.common.utils.IdUtil.getStringId());
|
||||
stIvtIostordailyService.save(from.toJavaObject(StIvtIostordaily.class));
|
||||
} else {// 更新
|
||||
HashMap<String, String> map = new HashMap<String, String>();
|
||||
StIvtIostordaily updateDaily = new StIvtIostordaily();
|
||||
if ("22,33".contains(change_type_scode)) {
|
||||
map.put("in_num", (from.getDoubleValue("change_qty") + jo.getDoubleValue("in_num")) + "");
|
||||
map.put("end_num", (from.getDoubleValue("change_qty") + jo.getDoubleValue("end_num")) + "");
|
||||
updateDaily.setIn_num(BigDecimal.valueOf((from.getDoubleValue("change_qty") + jo.getIn_num().doubleValue())));
|
||||
updateDaily.setEnd_num(BigDecimal.valueOf((from.getDoubleValue("change_qty") + jo.getEnd_num().doubleValue())));
|
||||
} else if ("21,25,34".contains(change_type_scode)) {
|
||||
map.put("out_num", (from.getDoubleValue("change_qty") + jo.getDoubleValue("out_num")) + "");
|
||||
map.put("end_num", (jo.getDoubleValue("end_num") - from.getDoubleValue("change_qty")) + "");
|
||||
updateDaily.setOut_num(BigDecimal.valueOf((from.getDoubleValue("change_qty") + jo.getOut_num().doubleValue())));
|
||||
updateDaily.setEnd_num(BigDecimal.valueOf((jo.getEnd_num().doubleValue() - from.getDoubleValue("change_qty"))));
|
||||
} else if ("24".contains(change_type_scode)) {
|
||||
map.put("less_num", (from.getDoubleValue("change_qty") + jo.getDoubleValue("less_num")) + "");
|
||||
map.put("end_num", (jo.getDoubleValue("end_num") - from.getDoubleValue("change_qty")) + "");
|
||||
updateDaily.setLess_num(BigDecimal.valueOf(from.getDoubleValue("change_qty") + jo.getLess_num().doubleValue()));
|
||||
updateDaily.setEnd_num(BigDecimal.valueOf(jo.getEnd_num().doubleValue() - from.getDoubleValue("change_qty")));
|
||||
} else if ("23".contains(change_type_scode)) {
|
||||
map.put("more_num", (from.getDoubleValue("change_qty") + jo.getDoubleValue("more_num")) + "");
|
||||
map.put("end_num", (from.getDoubleValue("change_qty") + jo.getDoubleValue("end_num")) + "");
|
||||
updateDaily.setMore_num(BigDecimal.valueOf(from.getDoubleValue("change_qty") + jo.getMore_num().doubleValue()));
|
||||
updateDaily.setEnd_num(BigDecimal.valueOf(from.getDoubleValue("change_qty") + jo.getEnd_num().doubleValue()));
|
||||
}
|
||||
wql_IOSectDaily.update(map, sql_where);
|
||||
stIvtIostordailyService.update(updateDaily, lam);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,14 +170,12 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void IOStor(JSONObject from, String change_type_scode) {
|
||||
// 仓位库存表
|
||||
WQLObject wql = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
||||
String struct_id_In = "";
|
||||
String material_id_In = "";
|
||||
String pcsn_In = "";
|
||||
String struct_id_In;
|
||||
String material_id_In;
|
||||
String pcsn_In;
|
||||
String storagevehicle_code = from.getString("storagevehicle_code");
|
||||
String quality_scode_In = "";
|
||||
double change_qty = 0;
|
||||
String quality_scode_In;
|
||||
double change_qty;
|
||||
if (ObjectUtil.isEmpty(from)) {
|
||||
throw new BadRequestException("输入from异常,请检查");
|
||||
}
|
||||
@@ -189,20 +203,12 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
if (change_qty <= 0) {
|
||||
throw new BadRequestException("变动数异常,请检查");
|
||||
}
|
||||
/*"struct_id = '" + struct_id_In +
|
||||
"' and material_id = '" + material_id_In +
|
||||
"' and pcsn = '" + pcsn_In +
|
||||
"' and quality_scode = '" + quality_scode_In + "'";*/
|
||||
// 查询条件
|
||||
StringBuffer sql_where = new StringBuffer("struct_id = '");
|
||||
sql_where.append(struct_id_In);
|
||||
sql_where.append("' and material_id = '");
|
||||
sql_where.append(material_id_In);
|
||||
sql_where.append("' and pcsn = '");
|
||||
sql_where.append(pcsn_In);
|
||||
sql_where.append("' and quality_scode = '");
|
||||
sql_where.append(quality_scode_In);
|
||||
sql_where.append("'");
|
||||
LambdaQueryWrapper<StIvtStructivt> sql_where = new LambdaQueryWrapper<>();
|
||||
sql_where.eq(StIvtStructivt::getStruct_id, struct_id_In)
|
||||
.eq(StIvtStructivt::getMaterial_id, material_id_In)
|
||||
.eq(StIvtStructivt::getPcsn, pcsn_In)
|
||||
.eq(StIvtStructivt::getQuality_scode, quality_scode_In);
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
@@ -216,7 +222,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
}
|
||||
}
|
||||
// 获取仓位物料信息
|
||||
JSONObject jo_in = WQL.getWO("QST_IVT_STORPUBLIC").addParamMap(map).process().uniqueResult(0);
|
||||
JSONObject jo_in = structivtService.getStorageMaterialInfo(map);
|
||||
switch (change_type_scode) {
|
||||
case "11": //11加冻结、减可用:出库分配、移库移出
|
||||
if (jo_in != null) {
|
||||
@@ -232,8 +238,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
if (Double.compare(ivt_num_now, ivt_qty) != 0) {
|
||||
throw new BadRequestException("输入数据异常,请检查");
|
||||
}
|
||||
|
||||
wql.update(jo_in, "stockrecord_id='" + jo_in.getString("stockrecord_id") + "'");
|
||||
structivtService.updateById(jo_in.toJavaObject(StIvtStructivt.class));
|
||||
} else {
|
||||
throw new BadRequestException(pcsn_In + "子卷仓位库存异常,请检查");
|
||||
}
|
||||
@@ -251,7 +256,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
if (jo_in.getDoubleValue("frozen_qty") < 0) {
|
||||
throw new BadRequestException("库存冻结数异常,请联系管理员分析处理单据!");
|
||||
}
|
||||
wql.update(jo_in, "stockrecord_id='" + jo_in.getString("stockrecord_id") + "'");
|
||||
structivtService.updateById(jo_in.toJavaObject(StIvtStructivt.class));
|
||||
} else {
|
||||
throw new BadRequestException(pcsn_In + "子卷仓位库存异常,请检查");
|
||||
}
|
||||
@@ -272,7 +277,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
if (jo_in.getDoubleValue("frozen_qty") < 0) {
|
||||
throw new BadRequestException("冻结数不允许为负数!");
|
||||
}
|
||||
wql.update(jo_in, "stockrecord_id='" + jo_in.getString("stockrecord_id") + "'");
|
||||
structivtService.updateById(jo_in.toJavaObject(StIvtStructivt.class));
|
||||
} else {
|
||||
throw new BadRequestException(pcsn_In + "子卷仓位库存异常,请检查");
|
||||
}
|
||||
@@ -287,7 +292,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
if (Double.compare(ivt_num_now, ivt_qty) != 0) {
|
||||
throw new BadRequestException("输入数据异常,请检查");
|
||||
}
|
||||
wql.update(jo_in, "stockrecord_id='" + jo_in.getString("stockrecord_id") + "'");
|
||||
structivtService.updateById(jo_in.toJavaObject(StIvtStructivt.class));
|
||||
} else {
|
||||
from.put("canuse_qty", "0");
|
||||
from.put("ivt_qty", change_qty);
|
||||
@@ -309,7 +314,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
if (jo_in.getDoubleValue("canuse_qty") < 0) {
|
||||
throw new BadRequestException("可用数不允许为负数!");
|
||||
}
|
||||
wql.update(jo_in, "stockrecord_id='" + jo_in.getString("stockrecord_id") + "'");
|
||||
structivtService.updateById(jo_in.toJavaObject(StIvtStructivt.class));
|
||||
} else {
|
||||
from.put("canuse_qty", change_qty);
|
||||
from.put("ivt_qty", change_qty);
|
||||
@@ -335,7 +340,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
if (jo_in.getDoubleValue("canuse_qty") < 0) {
|
||||
throw new BadRequestException("可用数不允许为负数!");
|
||||
}
|
||||
wql.update(jo_in, "stockrecord_id='" + jo_in.getString("stockrecord_id") + "'");
|
||||
structivtService.updateById(jo_in.toJavaObject(StIvtStructivt.class));
|
||||
} else {
|
||||
throw new BadRequestException(pcsn_In + "子卷仓位库存异常,请检查");
|
||||
}
|
||||
@@ -343,7 +348,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
case "31": //31加待入:入库分配、移库移入
|
||||
if (jo_in != null) {
|
||||
jo_in.put("warehousing_qty", jo_in.getDoubleValue("warehousing_qty") + change_qty);
|
||||
wql.update(jo_in, "stockrecord_id='" + jo_in.getString("stockrecord_id") + "'");
|
||||
structivtService.updateById(jo_in.toJavaObject(StIvtStructivt.class));
|
||||
} else {
|
||||
from.put("canuse_qty", "0");
|
||||
from.put("ivt_qty", "0");
|
||||
@@ -358,7 +363,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
if (jo_in.getDoubleValue("warehousing_qty") < 0) {
|
||||
throw new BadRequestException("待入数不允许为负数!");
|
||||
}
|
||||
wql.update(jo_in, "stockrecord_id='" + jo_in.getString("stockrecord_id") + "'");
|
||||
structivtService.updateById(jo_in.toJavaObject(StIvtStructivt.class));
|
||||
} else {
|
||||
throw new BadRequestException(pcsn_In + "子卷仓位库存异常,请检查");
|
||||
}
|
||||
@@ -377,7 +382,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
if (jo_in.getDoubleValue("warehousing_qty") < 0) {
|
||||
throw new BadRequestException("待入数不允许为负数!");
|
||||
}
|
||||
wql.update(jo_in, "stockrecord_id='" + jo_in.getString("stockrecord_id") + "'");
|
||||
structivtService.updateById(jo_in.toJavaObject(StIvtStructivt.class));
|
||||
} else {
|
||||
throw new BadRequestException(pcsn_In + "子卷仓位库存异常,请检查");
|
||||
}
|
||||
@@ -399,7 +404,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
if (jo_in.getDoubleValue("canuse_qty") < 0) {
|
||||
throw new BadRequestException("可用数不允许为负数!");
|
||||
}
|
||||
wql.update(jo_in, "stockrecord_id='" + jo_in.getString("stockrecord_id") + "'");
|
||||
structivtService.updateById(jo_in.toJavaObject(StIvtStructivt.class));
|
||||
} else {
|
||||
throw new BadRequestException(pcsn_In + "子卷仓位库存异常,请检查");
|
||||
}
|
||||
@@ -409,7 +414,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
}
|
||||
if (jo_in != null) {
|
||||
if (jo_in.getDoubleValue("ivt_qty") == 0 && jo_in.getDoubleValue("canuse_qty") == 0 && jo_in.getDoubleValue("warehousing_qty") == 0) {
|
||||
wql.delete(sql_where.toString());
|
||||
structivtService.remove(sql_where);
|
||||
}
|
||||
// 更新库存变动日志
|
||||
jo_in.put("result_qty", jo_in.getDoubleValue("ivt_qty"));
|
||||
@@ -420,10 +425,7 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
jo_in.put("bill_table", from.getString("bill_table"));
|
||||
jo_in.put("change_qty", from.getString("change_qty"));
|
||||
// 查询货位信息
|
||||
JSONObject jo = WQL.getWO("ST_PUB_QUERY_01")
|
||||
.addParam("flag", "1")
|
||||
.addParam("id", from.getString("struct_id"))
|
||||
.process().uniqueResult(0);
|
||||
JSONObject jo = structivtService.getStorageInfoByStrId(from.getString("struct_id"));
|
||||
if (jo == null) {
|
||||
throw new BadRequestException("仓位不存在或者未启用:" + from.getString("struct_id"));
|
||||
}
|
||||
@@ -570,12 +572,6 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
|
||||
@Override
|
||||
public void updateStructAndPointTwo(JSONObject from) {
|
||||
//货位表
|
||||
WQLObject wo_Struct = WQLObject.getWQLObject("ST_IVT_StructAttr");
|
||||
//点位表
|
||||
WQLObject wo_Point = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
//载具表
|
||||
WQLObject wo_Storage = WQLObject.getWQLObject("MD_PB_StorageVehicleInfo");
|
||||
String struct_id = from.getString("struct_id");
|
||||
String point_code = from.getString("point_code");
|
||||
//锁定类型
|
||||
@@ -589,49 +585,44 @@ public class StorPublicServiceImpl implements StorPublicService {
|
||||
if (StrUtil.isEmpty(lock_type)) {
|
||||
throw new BadRequestException("点位仓位更新出入参数异常!");
|
||||
}
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
if ("1".equals(lock_type)) {//解锁
|
||||
map.put("lock_type", lock_type);
|
||||
map.put("task_code", "");
|
||||
map.put("inv_type", "");
|
||||
map.put("inv_id", "");
|
||||
map.put("inv_code", "");
|
||||
map.put("point_status", "1");
|
||||
map.put("storagevehicle_code", "");
|
||||
map.put("vehicle_code", "");
|
||||
LambdaUpdateWrapper<StIvtStructattr> saUpLam = new LambdaUpdateWrapper<>();
|
||||
if ("1".equals(lock_type)) {
|
||||
//解锁
|
||||
saUpLam.set(StIvtStructattr::getLock_type, lock_type)
|
||||
.set(StIvtStructattr::getTask_code, "")
|
||||
.set(StIvtStructattr::getInv_type, "")
|
||||
.set(StIvtStructattr::getInv_id, "")
|
||||
.set(StIvtStructattr::getInv_code, "")
|
||||
.set(StIvtStructattr::getStoragevehicle_code, "");
|
||||
if (from.containsKey("is_free") && !"1".equals(from.getString("is_free")) && StrUtil.isNotEmpty(storagevehicle_code)) {
|
||||
map.put("storagevehicle_code", storagevehicle_code);
|
||||
map.put("storagevehicle_qty", "1");
|
||||
map.put("vehicle_code", storagevehicle_code);
|
||||
map.put("point_status", "01");
|
||||
saUpLam.set(StIvtStructattr::getStoragevehicle_code, storagevehicle_code)
|
||||
.set(StIvtStructattr::getStoragevehicle_qty, "1");
|
||||
}
|
||||
if ("1".equals(from.getString("is_overdue")) && StrUtil.isNotEmpty(is_overdue)) {
|
||||
map.put("storagevehicle_code", storagevehicle_code);
|
||||
saUpLam.set(StIvtStructattr::getStoragevehicle_code, storagevehicle_code);
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(from.getString("bill_type"))) {
|
||||
if (from.getString("bill_type").equals("1011")){
|
||||
map.put("storagevehicle_code", storagevehicle_code);
|
||||
saUpLam.set(StIvtStructattr::getStoragevehicle_code, storagevehicle_code);
|
||||
}
|
||||
}
|
||||
|
||||
wo_Struct.update(map, "struct_id = '" + struct_id + "'");
|
||||
} else {//锁定
|
||||
map.put("lock_type", lock_type);
|
||||
map.put("taskdtl_type", from.getString("task_type"));
|
||||
map.put("taskdtl_id", from.getString("task_id"));
|
||||
map.put("task_code", from.getString("task_code"));
|
||||
map.put("inv_type", from.getString("inv_type"));
|
||||
map.put("inv_id", from.getString("inv_id"));
|
||||
map.put("inv_code", from.getString("inv_code"));
|
||||
} else {
|
||||
//锁定
|
||||
saUpLam.set(StIvtStructattr::getLock_type, lock_type)
|
||||
.set(StIvtStructattr::getTaskdtl_type, from.getString("task_type"))
|
||||
.set(StIvtStructattr::getTaskdtl_id, from.getString("task_id"))
|
||||
.set(StIvtStructattr::getTask_code, from.getString("task_code"))
|
||||
.set(StIvtStructattr::getInv_type, from.getString("inv_type"))
|
||||
.set(StIvtStructattr::getInv_id, from.getString("inv_id"))
|
||||
.set(StIvtStructattr::getInv_code, from.getString("inv_code"));
|
||||
if (StrUtil.isNotEmpty(storagevehicle_code)) {
|
||||
map.put("storagevehicle_code", storagevehicle_code);
|
||||
map.put("storagevehicle_qty", "1");
|
||||
map.put("vehicle_code", storagevehicle_code);
|
||||
map.put("point_status", "01");
|
||||
saUpLam.set(StIvtStructattr::getStoragevehicle_code, storagevehicle_code)
|
||||
.set(StIvtStructattr::getStoragevehicle_qty, "1");
|
||||
}
|
||||
}
|
||||
wo_Struct.update(map, "struct_id = '" + struct_id + "'");
|
||||
saUpLam.eq(StIvtStructattr::getStruct_id, struct_id);
|
||||
structattrService.update(saUpLam);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,8 +4,11 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.st.instor.service.HandMoveStorService;
|
||||
import org.nl.wms.st.instor.service.dto.MoveInvPageParam;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -23,20 +26,17 @@ public class HandMoveStorController {
|
||||
|
||||
@GetMapping
|
||||
@Log("查询手工移库单")
|
||||
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(handMoveStorService.pageQuery(whereJson, page), HttpStatus.OK);
|
||||
public ResponseEntity<Object> query(MoveInvPageParam param, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(handMoveStorService.pageQuery(param, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getOutBillDtl")
|
||||
@Log("查询移库单")
|
||||
|
||||
public ResponseEntity<Object> getOutBillDtl(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(handMoveStorService.getOutBillDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("删除移库单")
|
||||
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
handMoveStorService.deleteAll(ids);
|
||||
@@ -45,25 +45,22 @@ public class HandMoveStorController {
|
||||
|
||||
@PutMapping
|
||||
@Log("修改移库单")
|
||||
|
||||
public ResponseEntity<Object> update(@RequestBody Map whereJson) {
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
|
||||
handMoveStorService.update(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping()
|
||||
@Log("新增移库单")
|
||||
|
||||
public ResponseEntity<Object> insertDtl(@RequestBody Map whereJson) {
|
||||
public ResponseEntity<Object> insertDtl(@RequestBody JSONObject whereJson) {
|
||||
handMoveStorService.insertDtl(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@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")
|
||||
@@ -75,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);
|
||||
@@ -90,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);
|
||||
|
||||
@@ -2,19 +2,25 @@ package org.nl.wms.st.instor.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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;
|
||||
import java.util.Map;
|
||||
|
||||
public interface HandMoveStorService {
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param param 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> pageQuery(Map whereJson, Pageable page);
|
||||
IPage<StIvtMoveinv> pageQuery(MoveInvPageParam param, PageQuery page);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
@@ -28,7 +34,7 @@ public interface HandMoveStorService {
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void insertDtl(Map whereJson);
|
||||
void insertDtl(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 新增出库单2
|
||||
@@ -43,14 +49,14 @@ public interface HandMoveStorService {
|
||||
* @param whereJson /
|
||||
* @return
|
||||
*/
|
||||
JSONArray getOutBillDtl(Map whereJson);
|
||||
List<JSONObject> getOutBillDtl(Map whereJson);
|
||||
|
||||
/**
|
||||
* 修改出库单
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void update(Map whereJson);
|
||||
void update(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 全部取消
|
||||
@@ -65,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);
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.nl.wms.st.instor.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
@Data
|
||||
public class MoveInvPageParam implements Serializable {
|
||||
private String buss_type;
|
||||
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;
|
||||
}
|
||||
@@ -8,22 +8,39 @@ import cn.hutool.core.util.StrUtil;
|
||||
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;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
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.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;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtMoveinvdtl;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtBsrealstorattrService;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtStructattrService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
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.task.EmpMoveTask;
|
||||
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;
|
||||
@@ -39,82 +56,66 @@ import java.util.*;
|
||||
@Slf4j
|
||||
public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
private final StorPublicService storPublicService;
|
||||
/** 移库主表 */
|
||||
/**
|
||||
* 移库主表
|
||||
*/
|
||||
private final IStIvtMoveinvService moveinvService;
|
||||
private final StIvtBsrealstorattrService bsrealstorattrService;
|
||||
/**
|
||||
* 仓位属性表
|
||||
*/
|
||||
private final StIvtStructattrService structattrService;
|
||||
/**
|
||||
* 任务表
|
||||
*/
|
||||
private final IschBaseTaskService taskService;
|
||||
/** 移库明细表 */
|
||||
private final IStIvtMoveinvdtlService moveinvdtlService;
|
||||
private final IMdPbStoragevehicleextService storagevehicleextService;
|
||||
private final ISysDictService dictService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
|
||||
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||
map.put("flag", "1");
|
||||
if (StrUtil.isNotEmpty(map.get("bill_code"))) {
|
||||
map.put("bill_code", "%" + map.get("bill_code") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("material_code"))) {
|
||||
map.put("material_code", "%" + map.get("material_code") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("buss_type"))) {
|
||||
map.put("buss_type", whereJson.get("buss_type") + "%");
|
||||
}
|
||||
|
||||
//获取人员对应的仓库
|
||||
UserStorServiceImpl userStorService = new UserStorServiceImpl();
|
||||
String in_stor_id = userStorService.getInStor();
|
||||
|
||||
if (ObjectUtil.isNotEmpty(in_stor_id)) {
|
||||
map.put("in_stor_id", in_stor_id);
|
||||
}
|
||||
|
||||
JSONObject jo = WQL.getWO("QST_IVT_HANDMOVESTOR").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "bill_code desc");
|
||||
return jo;
|
||||
public IPage<StIvtMoveinv> pageQuery(MoveInvPageParam param, PageQuery page) {
|
||||
List<String> storeForUser = bsrealstorattrService.getStoreForUser(SecurityUtils.getCurrentUserId());
|
||||
param.setStor_ids(storeForUser);
|
||||
IPage<StIvtMoveinv> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
pages = moveinvService.moveStoragePage(pages, param);
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_MoveInv");
|
||||
|
||||
for (Long moveinv_id : ids) {
|
||||
JSONObject jo_mst = wo_mst.query("moveinv_id='" + moveinv_id + "'").uniqueResult(0);
|
||||
|
||||
if (jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
this.deleteByIdTwo(moveinv_id + "");
|
||||
}
|
||||
this.deleteByIdTwo(moveinv_id + "");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 主表标记删除、明细删除
|
||||
* 通过moveinv_id删除明细,还原库存等操作(二期)
|
||||
*
|
||||
* @param moveinv_id
|
||||
* @param moveinv_id 主表id
|
||||
*/
|
||||
public void deleteByIdTwo(String moveinv_id) {
|
||||
//明细表
|
||||
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_MoveInvDtl");
|
||||
//主表
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_MoveInv");
|
||||
//任务表
|
||||
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
//仓位表
|
||||
WQLObject wo_Attr = WQLObject.getWQLObject("st_ivt_structattr");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("is_delete", "1");
|
||||
map.put("update_optid", currentUserId + "");
|
||||
map.put("update_optname", nickName);
|
||||
map.put("update_time", now);
|
||||
JSONObject jo_mst = wo_mst.query("moveinv_id='" + moveinv_id + "'").uniqueResult(0);
|
||||
JSONArray ja = wo_dtl.query("moveinv_id='" + moveinv_id + "'").getResultJSONArray(0);
|
||||
LambdaUpdateWrapper<StIvtMoveinv> invUpLam = new LambdaUpdateWrapper<>();
|
||||
invUpLam.set(StIvtMoveinv::getIs_delete, "1")
|
||||
.set(StIvtMoveinv::getUpdate_optid, currentUserId)
|
||||
.set(StIvtMoveinv::getUpdate_optname, nickName)
|
||||
.set(StIvtMoveinv::getUpdate_time, now);
|
||||
StIvtMoveinv jo_mst = moveinvService.getById(moveinv_id);
|
||||
List<JSONObject> ja = moveinvdtlService.getByMoveInvIdToObject(moveinv_id);
|
||||
String point_code2 = "";
|
||||
for (int i = 0; i < ja.size(); i++) {
|
||||
JSONObject jo = ja.getJSONObject(i);
|
||||
//删除任务
|
||||
HashMap<String, String> task_map = new HashMap<>();
|
||||
task_map.put("is_delete", "1");
|
||||
point_code2 = wo_Task.query("task_id = '" + jo.getString("task_id") + "'").uniqueResult(0).getString("point_code2");
|
||||
wo_Task.update(task_map, "task_id='" + jo.getString("task_id") + "'");
|
||||
JSONObject jo = ja.get(i);
|
||||
//删除任务 todo: 是否需要判空
|
||||
SchBaseTask taskObj = taskService.getById(jo.getString("task_id"));
|
||||
point_code2 = taskObj.getPoint_code2();
|
||||
taskObj.setIs_delete("1");
|
||||
taskService.updateById(taskObj);
|
||||
//解锁起点点位、仓位
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("lock_type", "1");
|
||||
@@ -129,47 +130,41 @@ 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", jo_mst.getBill_type());
|
||||
jo.put("inv_id", jo.getString("moveinvdtl_id"));
|
||||
jo.put("bill_code", jo_mst.getString("bill_code"));
|
||||
jo.put("bill_code", jo_mst.getBill_code());
|
||||
jo.put("bill_table", "ST_IVT_MoveInv");
|
||||
storPublicService.IOStor(jo, "12");
|
||||
//更新移入库存
|
||||
jo.put("struct_id", jo.getString("turnin_struct_id"));
|
||||
jo.put("bill_type_scode", jo_mst.getString("bill_type"));
|
||||
jo.put("bill_type_scode", jo_mst.getBill_type());
|
||||
jo.put("inv_id", jo.getString("moveinvdtl_id"));
|
||||
jo.put("bill_code", jo_mst.getString("bill_code"));
|
||||
jo.put("bill_code", jo_mst.getBill_code());
|
||||
jo.put("bill_table", "ST_IVT_MoveInv");
|
||||
storPublicService.IOStor(jo, "32");
|
||||
//删除明细
|
||||
wo_dtl.delete("moveinvdtl_id='" + jo.getString("moveinvdtl_id") + "'");
|
||||
moveinvdtlService.removeById(jo.getString("moveinvdtl_id"));
|
||||
}
|
||||
//更新主表
|
||||
wo_mst.update(map, "moveinv_id='" + moveinv_id + "'");
|
||||
invUpLam.eq(StIvtMoveinv::getMoveinv_id, moveinv_id);
|
||||
moveinvService.update(invUpLam);
|
||||
// 更新移入仓位
|
||||
|
||||
JSONObject jsonAttr = wo_Attr.query("struct_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
jsonAttr.put("storagevehicle_code", "");
|
||||
wo_Attr.update(jsonAttr);
|
||||
StIvtStructattr attribute = structattrService.getAttributeByCode(point_code2, true);
|
||||
attribute.setStoragevehicle_code("");
|
||||
structattrService.updateById(attribute);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void insertDtl(Map map) {
|
||||
String bill_type = MapUtil.getStr(map, "bill_type");
|
||||
|
||||
|
||||
public void insertDtl(JSONObject map) {
|
||||
if (ObjectUtil.isNotEmpty(map.get("tableData"))) {
|
||||
//主表
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_MoveInv");
|
||||
ArrayList<Map> rows = (ArrayList<Map>) map.get("tableData");
|
||||
JSONArray arrayTwo = MapUtil.get(map, "tableData", JSONArray.class);
|
||||
JSONArray arrayTwo = map.getJSONArray("tableData");
|
||||
map.remove("tableData");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
String moveinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
String moveinv_id = org.nl.common.utils.IdUtil.getStringId();
|
||||
String bill_code = CodeUtil.getNewCode("MOVE_CODE");
|
||||
String biz_date = (String) map.get("biz_date");
|
||||
biz_date = biz_date.substring(0, 10);
|
||||
@@ -189,22 +184,18 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
Long deptId = SecurityUtils.getDeptId();
|
||||
map.put("sysdeptid", deptId);
|
||||
map.put("syscompanyid", deptId);
|
||||
JSONObject jo_mst = JSONObject.parseObject(JSON.toJSONString(map));
|
||||
JSONObject jo_mst = map;
|
||||
|
||||
//调用明细处理方法 -- 如果是二期移库则调用 insertDtlByRows2
|
||||
JSONObject ret = new JSONObject();
|
||||
if (jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
ret = this.insertDtlByRows2(jo_mst, arrayTwo);
|
||||
}
|
||||
JSONObject ret = this.insertDtlByRows2(jo_mst, arrayTwo);
|
||||
|
||||
map.put("detail_count", ret.getString("detail_count"));
|
||||
map.put("total_qty", ret.getString("total_qty"));
|
||||
wo_mst.insert(map);
|
||||
moveinvService.save(map.toJavaObject(StIvtMoveinv.class));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject queryEmp(JSONObject whereJson) {
|
||||
whereJson.put("flag", "21");
|
||||
@@ -313,16 +304,6 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
JSONObject insertDtlByRows2(JSONObject jo_mst, JSONArray rows) {
|
||||
//明细表
|
||||
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_MoveInvDtl");
|
||||
//主表
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_MoveInv");
|
||||
//任务表
|
||||
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
//点位表
|
||||
WQLObject wo_Point = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
//载具扩展属性
|
||||
WQLObject extTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
|
||||
//定义返回数据
|
||||
JSONObject ret = new JSONObject();
|
||||
|
||||
@@ -332,42 +313,32 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
//定义需要需要插入的库存集合
|
||||
HashMap<String, JSONObject> Struct_map = new HashMap<String, JSONObject>();
|
||||
StringBuffer ids = new StringBuffer();
|
||||
HashMap<String, JSONObject> Struct_map = new HashMap<>();
|
||||
List<String> idList = new ArrayList<>();
|
||||
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);
|
||||
idList.add(storagevehicle_code);
|
||||
}
|
||||
ids.append("'");
|
||||
//查询所有载具的库存
|
||||
JSONArray ja = WQL.getWO("QST_IVT_HANDMOVESTOR")
|
||||
.addParam("flag", "33")
|
||||
.addParam("ids", ids.toString())
|
||||
.process().getResultJSONArray(0);
|
||||
JSONArray ja = structattrService.getVehiclesStorage(idList);
|
||||
if (ja.size() == 0) {
|
||||
throw new BadRequestException("当前所有载具无可移库库存!");
|
||||
}
|
||||
double total_qty = 0;
|
||||
for (int i = 0; i < ja.size(); i++) {
|
||||
JSONObject jo = ja.getJSONObject(i);
|
||||
String moveinvdtl_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
String moveinvdtl_id = org.nl.common.utils.IdUtil.getStringId();
|
||||
total_qty = total_qty + jo.getDoubleValue("qty");
|
||||
jo.put("moveinvdtl_id", moveinvdtl_id);
|
||||
jo.put("moveinv_id", jo_mst.getString("moveinv_id"));
|
||||
jo.put("seq_no", (i + 1) + "");
|
||||
jo.put("work_status", "01");
|
||||
jo.put("is_issued", "0");
|
||||
JSONObject row = (JSONObject) Struct_map.get(jo.getString("storagevehicle_code"));
|
||||
JSONObject row = Struct_map.get(jo.getString("storagevehicle_code"));
|
||||
String turnin_struct_id = row.getString("turnin_struct_id");
|
||||
jo.put("turnin_sect_id", row.getString("turnin_sect_id"));
|
||||
jo.put("turnin_sect_code", row.getString("turnin_sect_code"));
|
||||
@@ -378,30 +349,31 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
//查询移入点位 - 如果是二期的就不用查询
|
||||
|
||||
//判断是否已生成过了任务,无未生成则插入任务
|
||||
JSONObject task = wo_Task.query("is_delete = '0' and task_status='04' and point_code1 ='" + jo.getString("turnout_struct_code") + "'").uniqueResult(0);
|
||||
if (task != null || "0".equals(is_task)) {
|
||||
SchBaseTask entity = taskService.getOne(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getIs_delete, "0")
|
||||
.eq(SchBaseTask::getTask_status, "04")
|
||||
.eq(SchBaseTask::getPoint_code1, jo.getString("turnout_struct_code")));
|
||||
JSONObject task = ObjectUtil.isNotEmpty(entity) ? JSON.parseObject(JSON.toJSONString(entity)) : new JSONObject();
|
||||
if (entity != null || "0".equals(is_task)) {
|
||||
jo.put("task_id", task.getString("task_id"));
|
||||
} else {
|
||||
task = new JSONObject();
|
||||
// 创建任务
|
||||
String task_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
String task_code = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
|
||||
task.put("task_id", task_id);
|
||||
task.put("task_code", task_code);
|
||||
if(jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
task.put("task_type", "010709");
|
||||
}
|
||||
// 立库转库任务
|
||||
task.put("task_type", "010709");
|
||||
task.put("acs_task_type", "7");
|
||||
task.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
task.put("point_code1", jo.getString("turnout_struct_code"));
|
||||
if(jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
task.put("point_code2", row.getString("turnin_struct_code"));
|
||||
}
|
||||
task.put("point_code2", row.getString("turnin_struct_code"));
|
||||
task.put("vehicle_code", jo.getString("storagevehicle_code"));
|
||||
// 查询木箱对应载具
|
||||
JSONObject jsonExt = extTab.query("pcsn = '" + jo.getString("storagevehicle_code") + "'").uniqueResult(0);
|
||||
JSONObject jsonExt = storagevehicleextService.getOneByPcsnToObject(jo.getString("storagevehicle_code"));
|
||||
if (ObjectUtil.isEmpty(jsonExt)) {
|
||||
throw new BadRequestException("此木箱对应载具不存在!"+jo.getString("storagevehicle_code"));
|
||||
throw new BadRequestException("此木箱对应载具不存在!" + jo.getString("storagevehicle_code"));
|
||||
}
|
||||
task.put("vehicle_code2", jsonExt.getString("storagevehicle_code"));
|
||||
task.put("handle_class", HandMoveStorAcsTask.class.getName());
|
||||
@@ -414,12 +386,11 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
task.put("update_optname", nickName);
|
||||
task.put("update_time", now);
|
||||
task.put("priority", "1");
|
||||
wo_Task.insert(task);
|
||||
taskService.save(task.toJavaObject(SchBaseTask.class));
|
||||
jo.put("task_id", task_id);
|
||||
}
|
||||
//插入明细表
|
||||
wo_dtl.insert(jo);
|
||||
|
||||
moveinvdtlService.save(jo.toJavaObject(StIvtMoveinvdtl.class));
|
||||
//更新移出库存
|
||||
jo.put("struct_id", jo.getString("turnout_struct_id"));
|
||||
jo.put("change_qty", jo.getDoubleValue("qty"));
|
||||
@@ -445,17 +416,12 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
from_start.put("taskdtl_type", task.getString("taskdtl_type"));
|
||||
from_start.put("taskdtl_id", task.getString("taskdtl_id"));
|
||||
from_start.put("task_code", task.getString("task_code"));
|
||||
|
||||
if(jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
storPublicService.updateStructAndPointTwo(from_start);
|
||||
}
|
||||
storPublicService.updateStructAndPointTwo(from_start);
|
||||
|
||||
//锁定终点点位、仓位
|
||||
from_start.put("struct_id", turnin_struct_id);
|
||||
from_start.put("lock_type", "7");
|
||||
if(jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
storPublicService.updateStructAndPointTwo(from_start);
|
||||
}
|
||||
storPublicService.updateStructAndPointTwo(from_start);
|
||||
}
|
||||
ret.put("total_qty", total_qty);
|
||||
ret.put("detail_count", ja.size());
|
||||
@@ -463,51 +429,35 @@ 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
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(Map whereJson) {
|
||||
//主表
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_MoveInv");
|
||||
|
||||
public void update(JSONObject whereJson) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
String moveinv_id = (String) whereJson.get("moveinv_id");
|
||||
String moveinv_id = whereJson.getString("moveinv_id");
|
||||
//查询主表
|
||||
JSONObject jo_mst = wo_mst.query("moveinv_id='" + moveinv_id + "'").uniqueResult(0);
|
||||
|
||||
StIvtMoveinv jo_mst = moveinvService.getById(moveinv_id);
|
||||
//调用删除明细,还原库存方法
|
||||
if (jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
this.deleteByIdTwo(moveinv_id + "");
|
||||
}
|
||||
this.deleteByIdTwo(moveinv_id);
|
||||
|
||||
//获取明细
|
||||
ArrayList<Map> rows = (ArrayList<Map>) whereJson.get("tableData");
|
||||
JSONArray arrayTwo = MapUtil.get(whereJson, "tableData", JSONArray.class);
|
||||
JSONArray arrayTwo = whereJson.getJSONArray("tableData");
|
||||
|
||||
//调用明细处理方法
|
||||
JSONObject ret ;
|
||||
if (jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
ret = this.insertDtlByRows2(jo_mst, arrayTwo);
|
||||
jo_mst.put("remark", whereJson.get("remark"));
|
||||
jo_mst.put("biz_date", whereJson.get("biz_date"));
|
||||
jo_mst.put("detail_count", ret.getString("detail_count"));
|
||||
jo_mst.put("total_qty", ret.getString("total_qty"));
|
||||
jo_mst.put("update_optid", currentUserId + "");
|
||||
jo_mst.put("update_optname", nickName);
|
||||
jo_mst.put("update_time", now);
|
||||
//更新主表
|
||||
wo_mst.update(jo_mst);
|
||||
}
|
||||
JSONObject ret = this.insertDtlByRows2((JSONObject) JSON.toJSON(jo_mst), arrayTwo);
|
||||
jo_mst.setRemark(whereJson.getString("remark"));
|
||||
jo_mst.setBiz_date(whereJson.getString("biz_date"));
|
||||
jo_mst.setDetail_count(ret.getString("detail_count"));
|
||||
jo_mst.setTotal_qty(ret.getString("total_qty"));
|
||||
jo_mst.setUpdate_optid(currentUserId);
|
||||
jo_mst.setUpdate_optname(nickName);
|
||||
jo_mst.setUpdate_time(now);
|
||||
moveinvService.updateById(jo_mst);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -618,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();
|
||||
@@ -711,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);
|
||||
@@ -725,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");
|
||||
@@ -781,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
|
||||
@@ -999,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("任务下发失败,请稍后重试!");
|
||||
}
|
||||
@@ -1054,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