feat: 库存变更、移库管理新增、删除、修改
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 移库单据
|
||||
@@ -9,4 +11,11 @@ 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);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
public interface IStIvtMoveinvdtlService extends IService<StIvtMoveinvdtl> {
|
||||
List<StIvtMoveinvdtl> getByMoveInvId(String moveinvId);
|
||||
List<JSONObject> getByMoveInvIdToObject(String moveinvId);
|
||||
}
|
||||
@@ -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,14 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/2
|
||||
*/
|
||||
public interface StIvtMoveinvMapper extends BaseMapper<StIvtMoveinv> {
|
||||
IPage<StIvtMoveinv> moveStoragePageLeft(IPage<StIvtMoveinv> pages, MoveInvPageParam param);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,84 @@
|
||||
<?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>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtMoveinvdtl;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/15
|
||||
*/
|
||||
public interface StIvtMoveinvdtlMapper extends BaseMapper<StIvtMoveinvdtl> {
|
||||
}
|
||||
@@ -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.ios.service.iostorInv.dao.mapper.StIvtMoveinvdtlMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,10 +1,12 @@
|
||||
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.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -14,4 +16,8 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* @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));
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package org.nl.b_lms.storage_manage.md.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.storage_manage.md.dao.MdMeMaterialBase;
|
||||
import org.nl.wms.basedata.master.service.dto.MaterialbaseDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -14,7 +15,7 @@ import java.util.Map;
|
||||
* @description 服务接口
|
||||
* @date 2021-12-07
|
||||
**/
|
||||
public interface MaterialbaseService {
|
||||
public interface MaterialbaseService extends IService<MdMeMaterialBase> {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.md.dao.MdMeMaterialBase;
|
||||
@@ -43,7 +44,7 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class MaterialbaseServiceImpl 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,5 +1,6 @@
|
||||
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 org.apache.ibatis.annotations.Param;
|
||||
@@ -43,4 +44,6 @@ public interface StIvtStructattrMapper extends BaseMapper<StIvtStructattr> {
|
||||
List<StIvtStructattr> getOutVehicleRowStructattr(JSONObject whereJson);
|
||||
|
||||
List<StIvtStructattr> getAllOutVehicleStruct(JSONObject whereJson);
|
||||
|
||||
JSONArray getVehiclesStorage(List<String> idList);
|
||||
}
|
||||
|
||||
@@ -543,5 +543,42 @@
|
||||
|
||||
|
||||
</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>
|
||||
|
||||
</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;
|
||||
@@ -28,10 +29,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 +82,6 @@ public interface StIvtStructattrService extends IService<StIvtStructattr> {
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject getAttributeByConditionsToObject(LambdaQueryWrapper<StIvtStructattr> structAttyLam, boolean flag);
|
||||
|
||||
JSONArray getVehiclesStorage(List<String> idList);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -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,9 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
||||
}
|
||||
return (JSONObject) JSON.toJSON(attributeByConditions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getVehiclesStorage(List<String> idList) {
|
||||
return this.baseMapper.getVehiclesStorage(idList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,16 +45,14 @@ 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);
|
||||
}
|
||||
|
||||
@@ -2,19 +2,24 @@ 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.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 +33,7 @@ public interface HandMoveStorService {
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void insertDtl(Map whereJson);
|
||||
void insertDtl(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 新增出库单2
|
||||
@@ -50,7 +55,7 @@ public interface HandMoveStorService {
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void update(Map whereJson);
|
||||
void update(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 全部取消
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
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 String bill_status;
|
||||
private String material_code;
|
||||
private String bill_type;
|
||||
private String end_time;
|
||||
private String begin_time;
|
||||
private String create_mode;
|
||||
}
|
||||
@@ -8,14 +8,27 @@ 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.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.pdm.storagevehicleext.service.IMdPbStoragevehicleextService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtMoveinvService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtMoveinvdtlService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtMoveinv;
|
||||
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;
|
||||
@@ -23,7 +36,7 @@ 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.task.HandMoveStorAcsTask;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -39,82 +52,64 @@ 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;
|
||||
|
||||
@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 +124,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 +178,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 +298,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 +307,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 +343,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 +380,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 +410,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());
|
||||
@@ -474,40 +434,29 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
|
||||
@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
|
||||
@@ -638,7 +587,7 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
String[] s = pcsn.split(" ");
|
||||
String pcsn_in = String.join("','", Arrays.asList(s));
|
||||
|
||||
map.put("pcsn_in", "('"+pcsn_in+"')");
|
||||
map.put("pcsn_in", "('" + pcsn_in + "')");
|
||||
map.put("pcsn", "");
|
||||
} else {
|
||||
map.put("pcsn", "%" + map.get("pcsn") + "%");
|
||||
@@ -656,7 +605,7 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
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_in", "('" + sap_pcsn_in + "')");
|
||||
map.put("sap_pcsn", "");
|
||||
} else {
|
||||
map.put("sap_pcsn", "%" + map.get("sap_pcsn") + "%");
|
||||
@@ -674,7 +623,7 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
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_in", "('" + box_no_in + "')");
|
||||
map.put("package_box_sn", "");
|
||||
} else {
|
||||
map.put("package_box_sn", "%" + map.get("package_box_sn") + "%");
|
||||
|
||||
Reference in New Issue
Block a user