Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@@ -8,6 +9,7 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.st.outbill.service.dto.AllBoxInfoDto;
|
||||
import org.nl.wms.st.outbill.service.dto.OutBillTaskParam;
|
||||
import org.nl.wms.st.outbill.service.dto.OutManageParam;
|
||||
import org.nl.wms.st.outbill.service.dto.OutTaskQueryDisDto;
|
||||
import org.nl.wms.st.outbill.service.vo.OutBillTaskVo;
|
||||
import org.nl.wms.st.outbill.service.vo.OutManageExportVo;
|
||||
import org.nl.wms.stat.service.dto.InBillPageParam;
|
||||
@@ -115,5 +117,13 @@ public interface IStIvtIostorinvdisService extends IService<StIvtIostorinvdis> {
|
||||
List<OutManageExportVo> getOutManageExportData(OutManageParam paramMap);
|
||||
|
||||
List<AllBoxInfoDto> getAllBoxWeightAndDtlId();
|
||||
|
||||
List<AllBoxInfoDto> getBoxInfoByInvId(String iostorinvId);
|
||||
|
||||
List<AllBoxInfoDto> getAllBoxInfoByInvId(String iostorinvId);
|
||||
|
||||
JSONArray getBillInfosByConditions(OutTaskQueryDisDto disDto);
|
||||
|
||||
List<JSONObject> getTasking(String iostorinvId);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ 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.StIvtIostorinvdtl;
|
||||
import org.nl.wms.st.outbill.service.dto.GenOrUnDtlDto;
|
||||
import org.nl.wms.st.outbill.service.dto.OutBillDtlQueryParam;
|
||||
import org.nl.wms.st.outbill.service.vo.OutBillDtlVo;
|
||||
|
||||
@@ -91,4 +92,6 @@ public interface IStIvtIostorinvdtlService extends IService<StIvtIostorinvdtl> {
|
||||
* @return
|
||||
*/
|
||||
List<StIvtIostorinvdtl> getBillDtlByInvId(String id);
|
||||
|
||||
List<JSONObject> getGeneratedAndUnallocatedDtls(GenOrUnDtlDto dto);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdis;
|
||||
import org.nl.wms.st.outbill.service.dto.AllBoxInfoDto;
|
||||
import org.nl.wms.st.outbill.service.dto.OutBillTaskParam;
|
||||
import org.nl.wms.st.outbill.service.dto.OutManageParam;
|
||||
import org.nl.wms.st.outbill.service.dto.OutTaskQueryDisDto;
|
||||
import org.nl.wms.st.outbill.service.vo.OutBillTaskVo;
|
||||
import org.nl.wms.st.outbill.service.vo.OutManageExportVo;
|
||||
import org.nl.wms.stat.service.dto.InBillPageParam;
|
||||
@@ -100,4 +101,12 @@ public interface StIvtIostorinvdisMapper extends BaseMapper<StIvtIostorinvdis> {
|
||||
List<OutManageExportVo> getOutManageExportData(@Param("paramMap") OutManageParam paramMap);
|
||||
|
||||
List<AllBoxInfoDto> getAllBoxWeightAndDtlId();
|
||||
|
||||
List<AllBoxInfoDto> getBoxInfoByInvId(String iostorinvId);
|
||||
|
||||
List<AllBoxInfoDto> getAllBoxInfoByInvId(String iostorinvId);
|
||||
|
||||
JSONArray getBillInfosByConditions(@Param("paramMap") OutTaskQueryDisDto disDto);
|
||||
|
||||
List<JSONObject> getTasking(String iostorinvId);
|
||||
}
|
||||
|
||||
@@ -1252,6 +1252,89 @@
|
||||
and ios.is_delete = '0'
|
||||
GROUP BY dtl.iostorinvdtl_id
|
||||
</select>
|
||||
<select id="getBoxInfoByInvId" resultType="org.nl.wms.st.outbill.service.dto.AllBoxInfoDto">
|
||||
SELECT
|
||||
SUM(dis.real_qty) AS qty,
|
||||
dis.box_no,
|
||||
MAX(mater.material_name) AS material_name
|
||||
FROM
|
||||
ST_IVT_IOStorInvDis dis
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = dis.material_id
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="iostorinvId != null and iostorinvId != ''">
|
||||
AND dis.iostorinv_id = #{iostorinvId}
|
||||
</if>
|
||||
group by dis.box_no
|
||||
</select>
|
||||
<select id="getAllBoxInfoByInvId" resultType="org.nl.wms.st.outbill.service.dto.AllBoxInfoDto">
|
||||
SELECT
|
||||
count(*) AS num,
|
||||
sum(dis.real_qty) AS qty
|
||||
FROM
|
||||
ST_IVT_IOStorInvDis dis
|
||||
WHERE
|
||||
1 = 1
|
||||
|
||||
<if test="iostorinvId != null and iostorinvId != ''">
|
||||
AND dis.iostorinv_id = #{iostorinvId}
|
||||
</if>
|
||||
|
||||
group by dis.struct_id
|
||||
</select>
|
||||
<select id="getBillInfosByConditions" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
dis.*,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
task.task_code,
|
||||
task.task_status,
|
||||
task.task_type,
|
||||
point.point_code AS start_point_code,
|
||||
point2.source_id,
|
||||
point2.point_code
|
||||
FROM
|
||||
ST_IVT_IOStorInvDis dis
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = dis.material_id
|
||||
LEFT JOIN SCH_BASE_Task task ON task.task_id = dis.task_id AND task.is_delete = '0' and task.vehicle_code = dis.storagevehicle_code
|
||||
LEFT JOIN SCH_BASE_Point point ON point.source_id = dis.struct_id
|
||||
LEFT JOIN SCH_BASE_Point point2 ON point2.point_id = dis.point_id
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="paramMap.iostorinvdtl_id != null and paramMap.iostorinvdtl_id != ''">
|
||||
AND dis.iostorinvdtl_id = #{paramMap.iostorinvdtl_id}
|
||||
</if>
|
||||
<if test="paramMap.task_id != null and paramMap.task_id != ''">
|
||||
AND dis.task_id = #{paramMap.task_id}
|
||||
</if>
|
||||
<if test="paramMap.iostorinv_id != null and paramMap.iostorinv_id != ''">
|
||||
AND dis.iostorinv_id = #{paramMap.iostorinv_id}
|
||||
</if>
|
||||
<if test="paramMap.iostorinvdis_id != null and paramMap.iostorinvdis_id != ''">
|
||||
AND dis.iostorinvdis_id = #{paramMap.iostorinvdis_id}
|
||||
</if>
|
||||
<if test="paramMap.is_issued != null and paramMap.is_issued != ''">
|
||||
AND dis.is_issued = #{paramMap.is_issued}
|
||||
</if>
|
||||
<if test="paramMap.struct_id != null and paramMap.struct_id != ''">
|
||||
AND dis.struct_id = #{paramMap.struct_id}
|
||||
</if>
|
||||
<if test="paramMap.bill_status != null and paramMap.bill_status != ''">
|
||||
AND dis.work_status <![CDATA[ <= ]]> #{paramMap.bill_status}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getTasking" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
dis.*
|
||||
FROM
|
||||
ST_IVT_IOStorInvDis dis
|
||||
LEFT JOIN SCH_BASE_Task task ON task.task_id = dis.task_id AND task.is_delete = '0' and task.vehicle_code = dis.storagevehicle_code
|
||||
WHERE
|
||||
task.task_status <![CDATA[ <> ]]> '07'
|
||||
<if test="iostorinvId != null and iostorinvId != ''">
|
||||
AND dis.iostorinv_id = #{iostorinvId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
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.apache.ibatis.annotations.Param;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl;
|
||||
import org.nl.wms.st.outbill.service.dto.GenOrUnDtlDto;
|
||||
import org.nl.wms.st.outbill.service.dto.OutBillDtlQueryParam;
|
||||
import org.nl.wms.st.outbill.service.vo.OutBillDtlVo;
|
||||
|
||||
@@ -22,4 +24,6 @@ public interface StIvtIostorinvdtlMapper extends BaseMapper<StIvtIostorinvdtl> {
|
||||
JSONArray selectIoDtl(@Param("billCode") String id, @Param("openFlag") String openFlag);
|
||||
|
||||
List<OutBillDtlVo> getOutBillDtl(@Param("param") OutBillDtlQueryParam param);
|
||||
|
||||
List<JSONObject> getGeneratedAndUnallocatedDtls(@Param("param") GenOrUnDtlDto dto);
|
||||
}
|
||||
|
||||
@@ -101,4 +101,51 @@
|
||||
</if>
|
||||
order by iosdtl.box_no,iosdtl.pcsn
|
||||
</select>
|
||||
<select id="getGeneratedAndUnallocatedDtls" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
iosdtl.*,
|
||||
ios.bill_code,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
mb.material_spec,
|
||||
mb.material_model,
|
||||
(case when IFNULL(record2.sap_pcsn,'') = '' then sub.sap_pcsn else record2.sap_pcsn end) AS sap_pcsn
|
||||
FROM
|
||||
ST_IVT_IOStorInvDtl iosdtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = iosdtl.material_id
|
||||
LEFT JOIN ST_IVT_IOStorInv ios ON ios.iostorinv_id = iosdtl.iostorinv_id
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = iosdtl.pcsn AND sub.package_box_sn =
|
||||
iosdtl.box_no
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
record.bill_code,
|
||||
record.container_name,
|
||||
record.package_box_sn,
|
||||
record.sap_pcsn,
|
||||
COUNT( * ) AS num
|
||||
FROM
|
||||
pdm_bi_subpackagerelationrecord record
|
||||
GROUP BY
|
||||
record.bill_code,
|
||||
record.container_name,
|
||||
record.sap_pcsn,
|
||||
record.package_box_sn
|
||||
) record2 ON (record2.container_name = iosdtl.pcsn AND ios.bill_code = record2.bill_code AND
|
||||
record2.package_box_sn = iosdtl.box_no)
|
||||
WHERE
|
||||
1=1
|
||||
<if test="param.iostorinv_id != null and param.iostorinv_id != ''">
|
||||
AND iosdtl.iostorinv_id = #{param.iostorinv_id}
|
||||
</if>
|
||||
<if test="param.iostorinvdtl_id != null and param.iostorinvdtl_id != ''">
|
||||
AND iosdtl.iostorinvdtl_id = #{param.iostorinvdtl_id}
|
||||
</if>
|
||||
<if test="param.bill_status != null and param.bill_status != ''">
|
||||
AND iosdtl.bill_status = #{param.bill_status}
|
||||
</if>
|
||||
<if test="param.unassign_flag != null and param.unassign_flag != ''">
|
||||
AND iosdtl.unassign_qty > 0
|
||||
</if>
|
||||
order by iosdtl.box_no,iosdtl.pcsn
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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;
|
||||
@@ -26,6 +27,7 @@ import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.st.outbill.service.dto.AllBoxInfoDto;
|
||||
import org.nl.wms.st.outbill.service.dto.OutBillTaskParam;
|
||||
import org.nl.wms.st.outbill.service.dto.OutManageParam;
|
||||
import org.nl.wms.st.outbill.service.dto.OutTaskQueryDisDto;
|
||||
import org.nl.wms.st.outbill.service.vo.OutBillTaskVo;
|
||||
import org.nl.wms.st.outbill.service.vo.OutManageExportVo;
|
||||
import org.nl.wms.stat.service.dto.InBillPageParam;
|
||||
@@ -346,4 +348,24 @@ public class StIvtIostorinvdisServiceImpl extends ServiceImpl<StIvtIostorinvdisM
|
||||
public List<AllBoxInfoDto> getAllBoxWeightAndDtlId() {
|
||||
return stIvtIostorinvdisMapper.getAllBoxWeightAndDtlId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AllBoxInfoDto> getBoxInfoByInvId(String iostorinvId) {
|
||||
return stIvtIostorinvdisMapper.getBoxInfoByInvId(iostorinvId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AllBoxInfoDto> getAllBoxInfoByInvId(String iostorinvId) {
|
||||
return stIvtIostorinvdisMapper.getAllBoxInfoByInvId(iostorinvId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getBillInfosByConditions(OutTaskQueryDisDto disDto) {
|
||||
return stIvtIostorinvdisMapper.getBillInfosByConditions(disDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getTasking(String iostorinvId) {
|
||||
return stIvtIostorinvdisMapper.getTasking(iostorinvId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.nl.b_lms.storage_manage.md.service.MdPbMeasureunitService;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.st.outbill.service.dto.GenOrUnDtlDto;
|
||||
import org.nl.wms.st.outbill.service.dto.OutBillDtlQueryParam;
|
||||
import org.nl.wms.st.outbill.service.vo.OutBillDtlVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -330,6 +331,11 @@ public class StIvtIostorinvdtlServiceImpl extends ServiceImpl<StIvtIostorinvdtlM
|
||||
return list(lam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getGeneratedAndUnallocatedDtls(GenOrUnDtlDto dto) {
|
||||
return stIvtIostorinvdtlMapper.getGeneratedAndUnallocatedDtls(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 组织分配明细所需数据
|
||||
* @param dtlDao: 明细实体类
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
package org.nl.b_lms.storage_manage.md.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 运输公司基本信息表
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/3
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("MD_CS_CustomerBase")
|
||||
public class MdCsCustomerBase implements Serializable {
|
||||
/** 客户标识 */
|
||||
/**
|
||||
* 防止精度丢失
|
||||
*/
|
||||
@TableId
|
||||
private String cust_id;
|
||||
|
||||
/**
|
||||
* 客户编码
|
||||
*/
|
||||
private String cust_code;
|
||||
|
||||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
private String cust_name;
|
||||
|
||||
/**
|
||||
* 业务员
|
||||
*/
|
||||
private String sales_owner;
|
||||
|
||||
/**
|
||||
* 客户简称
|
||||
*/
|
||||
private String cust_simple_name;
|
||||
|
||||
/**
|
||||
* 国家
|
||||
*/
|
||||
private String country;
|
||||
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 传真
|
||||
*/
|
||||
private String faxnumber;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String webSite;
|
||||
|
||||
/**
|
||||
* 法人代表
|
||||
*/
|
||||
private String jurid_name;
|
||||
|
||||
/**
|
||||
* 税务登记号
|
||||
*/
|
||||
private String tax_no;
|
||||
|
||||
/**
|
||||
* 工商注册号
|
||||
*/
|
||||
private String register_no;
|
||||
|
||||
/**
|
||||
* 经营许可证号
|
||||
*/
|
||||
private String manage_lice_no;
|
||||
|
||||
/**
|
||||
* 营业执照
|
||||
*/
|
||||
private String busi_char_name;
|
||||
|
||||
/**
|
||||
* 行政区划
|
||||
*/
|
||||
private String area_id;
|
||||
|
||||
/**
|
||||
* 邮政编码
|
||||
*/
|
||||
private String zip_code;
|
||||
|
||||
/**
|
||||
* 公司电话
|
||||
*/
|
||||
private String corp_tele_no;
|
||||
|
||||
/**
|
||||
* 公司地址
|
||||
*/
|
||||
private String corp_address;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_optid;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_optname;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 启用时间
|
||||
*/
|
||||
private String is_used_time;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 外部标识
|
||||
*/
|
||||
private String ext_id;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 分类标识
|
||||
*/
|
||||
private String class_id;
|
||||
|
||||
/**
|
||||
* 分类编码
|
||||
*/
|
||||
private String class_code;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
private String class_name;
|
||||
|
||||
/**
|
||||
* 子卷打印模板号
|
||||
*/
|
||||
private String zj_print_no;
|
||||
|
||||
/**
|
||||
* 包装打印模板号
|
||||
*/
|
||||
private String bz_print_no;
|
||||
|
||||
/**
|
||||
* 送货单打印模板号
|
||||
*/
|
||||
private String shd_print_no;
|
||||
|
||||
/**
|
||||
* 送货单明细数
|
||||
*/
|
||||
private Integer shd_dtl_num;
|
||||
|
||||
/**
|
||||
* 是否自动贴标
|
||||
*/
|
||||
private String is_auto_table;
|
||||
|
||||
/**
|
||||
* 内标打印模版
|
||||
*/
|
||||
private String bz_print_within;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.nl.b_lms.storage_manage.md.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.storage_manage.md.dao.MdCsCustomerBase;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/3
|
||||
*/
|
||||
public interface MdCsCustomerBaseMapper extends BaseMapper<MdCsCustomerBase> {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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.md.dao.mapper.MdCsCustomerBaseMapper">
|
||||
</mapper>
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.nl.b_lms.storage_manage.md.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.storage_manage.md.dao.MdCsCustomerBase;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/3
|
||||
*/
|
||||
public interface IMdCsCustomerBaseService extends IService<MdCsCustomerBase> {
|
||||
/**
|
||||
* 通过客户编码获取客户信息
|
||||
* @param custCode
|
||||
* @return
|
||||
*/
|
||||
MdCsCustomerBase getByCode(String custCode);
|
||||
}
|
||||
@@ -8,4 +8,10 @@ import org.nl.b_lms.storage_manage.md.dao.MdCsTransportationBase;
|
||||
* @Date: 2025/7/3
|
||||
*/
|
||||
public interface IMdCsTransportationBaseService extends IService<MdCsTransportationBase> {
|
||||
/**
|
||||
* 根据code获取物流公司
|
||||
* @param transCode
|
||||
* @return
|
||||
*/
|
||||
MdCsTransportationBase getByCode(String transCode);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package org.nl.b_lms.storage_manage.md.service.impl;
|
||||
|
||||
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.md.dao.MdCsCustomerBase;
|
||||
import org.nl.b_lms.storage_manage.md.dao.mapper.MdCsCustomerBaseMapper;
|
||||
import org.nl.b_lms.storage_manage.md.service.IMdCsCustomerBaseService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/3
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MdCsCustomerBaseServiceImpl extends ServiceImpl<MdCsCustomerBaseMapper, MdCsCustomerBase> implements IMdCsCustomerBaseService {
|
||||
@Override
|
||||
public MdCsCustomerBase getByCode(String custCode) {
|
||||
LambdaQueryWrapper<MdCsCustomerBase> lam = new QueryWrapper<MdCsCustomerBase>().lambda();
|
||||
lam.eq(MdCsCustomerBase::getCust_code, custCode);
|
||||
return getOne(lam);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.b_lms.storage_manage.md.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.md.dao.MdCsTransportationBase;
|
||||
@@ -14,4 +15,10 @@ import org.springframework.stereotype.Service;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MdCsTransportationBaseServiceImpl extends ServiceImpl<MdCsTransportationBaseMapper, MdCsTransportationBase> implements IMdCsTransportationBaseService {
|
||||
@Override
|
||||
public MdCsTransportationBase getByCode(String transCode) {
|
||||
LambdaQueryWrapper<MdCsTransportationBase> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(MdCsTransportationBase::getCust_code, transCode);
|
||||
return getOne(lam);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.nl.wms.basedata.st.service.dto.ProductStoreDownDto;
|
||||
import org.nl.wms.basedata.st.service.dto.ProductStoreParam;
|
||||
import org.nl.wms.basedata.st.service.vo.ProductStoreVo;
|
||||
import org.nl.wms.st.outbill.service.dto.StockMaterialQueryParam;
|
||||
import org.nl.wms.st.outbill.service.vo.OutBillTaskVo;
|
||||
import org.nl.wms.st.outbill.service.vo.StockMaterialVo;
|
||||
import org.nl.wms.stat.service.dto.PastStructPageParam;
|
||||
import org.nl.wms.stat.service.vo.PastStructPageVo;
|
||||
@@ -46,5 +47,5 @@ public interface StIvtStructivtMapper extends BaseMapper<StIvtStructivt> {
|
||||
|
||||
JSONArray getOutBillDis2(Map param);
|
||||
|
||||
JSONArray getOutBillTask(Map param);
|
||||
List<OutBillTaskVo> getOutBillTask(Map param);
|
||||
}
|
||||
|
||||
@@ -880,7 +880,7 @@
|
||||
</if>
|
||||
order by dis.box_no,dis.pcsn
|
||||
</select>
|
||||
<select id="getOutBillTask" resultType="com.alibaba.fastjson.JSONObject">
|
||||
<select id="getOutBillTask" resultType="org.nl.wms.st.outbill.service.vo.OutBillTaskVo">
|
||||
SELECT
|
||||
dis.*,
|
||||
mater.material_code,
|
||||
|
||||
@@ -23,4 +23,6 @@ public interface StIvtSectattrService extends IService<StIvtSectattr> {
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> getByIdsObject(List<String> ids);
|
||||
|
||||
StIvtSectattr getByCode(String sectCode);
|
||||
}
|
||||
|
||||
@@ -34,4 +34,9 @@ public class StIvtSectattrServiceImpl extends ServiceImpl<StIvtSectattrMapper, S
|
||||
}
|
||||
return CollectionUtils.mapList(ids, sect -> (JSONObject) JSON.toJSON(sect));
|
||||
}
|
||||
|
||||
@Override
|
||||
public StIvtSectattr getByCode(String sectCode) {
|
||||
return getOne(new LambdaQueryWrapper<StIvtSectattr>().eq(StIvtSectattr::getSect_code, sectCode));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ 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.check.service.dto.QueryPageParam;
|
||||
import org.nl.wms.st.instor.service.CheckService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -33,8 +34,8 @@ public class CheckController {
|
||||
|
||||
@GetMapping("/getDtlView")
|
||||
@Log("查询盘点单明细详情")
|
||||
public ResponseEntity<Object> getDtlView(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(checkService.getDtlView(whereJson, page), HttpStatus.OK);
|
||||
public ResponseEntity<Object> getDtlView(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(checkService.getDtlView(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getExceptionDispose")
|
||||
@@ -78,8 +79,8 @@ public class CheckController {
|
||||
|
||||
@GetMapping("/getStructIvt")
|
||||
@Log("查询可盘点库存")
|
||||
public ResponseEntity<Object> getStructIvt(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(checkService.getStructIvt(whereJson, page), HttpStatus.OK);
|
||||
public ResponseEntity<Object> getStructIvt(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(checkService.getStructIvt(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
|
||||
@@ -167,6 +167,16 @@ public class StIvtCheckdtl implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private String material_name;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String struct_code;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String sect_code;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String process_optname;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String date_of_production;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,9 +3,13 @@ package org.nl.wms.st.instor.check.service.dao.mapper;
|
||||
|
||||
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.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
||||
import org.nl.wms.st.instor.check.service.dao.StIvtCheckMst;
|
||||
import org.nl.wms.st.instor.check.service.dao.StIvtCheckdtl;
|
||||
import org.nl.wms.st.instor.check.service.dto.CheckStructIvt;
|
||||
import org.nl.wms.st.instor.check.service.dto.QueryPageParam;
|
||||
import org.nl.wms.st.outbill.service.dto.OutBillQueryPageParam;
|
||||
|
||||
import java.util.List;
|
||||
@@ -23,4 +27,16 @@ public interface StIvtCheckMstMapper extends BaseMapper<StIvtCheckMst> {
|
||||
List<String> recordQuery(List<String> ids);
|
||||
|
||||
IPage<StIvtCheckdtl> getExceptionDispose(IPage<StIvtIostorinv> pages, OutBillQueryPageParam paramMap);
|
||||
|
||||
List<StIvtCheckdtl> getOutBillDtl2(@Param("paramMap") QueryPageParam paramMap);
|
||||
|
||||
IPage<PdmBiSubpackagerelation> getDtlView(IPage<PdmBiSubpackagerelation> pages, @Param("paramMap") QueryPageParam paramMap);
|
||||
|
||||
IPage<CheckStructIvt> getStructIvt(IPage<CheckStructIvt> pages, @Param("paramMap") QueryPageParam paramMap);
|
||||
|
||||
List<StIvtCheckdtl> getOutBillDtl22(@Param("paramMap") QueryPageParam paramMap);
|
||||
|
||||
List<StIvtCheckdtl> getOutBillDtl222(@Param("paramMap") QueryPageParam paramMap);
|
||||
|
||||
List<StIvtCheckdtl> getOutBillDtl(@Param("paramMap") QueryPageParam paramMap);
|
||||
}
|
||||
|
||||
@@ -36,4 +36,301 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getOutBillDtl2" resultType="org.nl.wms.st.instor.check.service.dao.StIvtCheckdtl" >
|
||||
SELECT
|
||||
CheckDtl.checkdtl_id,
|
||||
CheckDtl.check_id,
|
||||
CheckDtl.check_code,
|
||||
CheckDtl.seq_no,
|
||||
CheckDtl.sect_id,
|
||||
CheckDtl.sect_name,
|
||||
CheckDtl.struct_id,
|
||||
CheckDtl.struct_name,
|
||||
CheckDtl.checkpoint_id,
|
||||
CheckDtl.storagevehicle_id,
|
||||
CheckDtl.storagevehicle_code,
|
||||
CheckDtl.material_id,
|
||||
ROUND(CheckDtl.base_qty,3) AS base_qty,
|
||||
CheckDtl.qty_unit_id,
|
||||
CheckDtl.qty_unit_name,
|
||||
CheckDtl.STATUS,
|
||||
CheckDtl.is_down,
|
||||
CheckDtl.fac_qty,
|
||||
CheckDtl.check_result,
|
||||
CheckDtl.check_optid,
|
||||
CheckDtl.check_optname,
|
||||
CheckDtl.check_time,
|
||||
CheckDtl.is_process,
|
||||
CheckDtl.process_type,
|
||||
CheckDtl.process_optid,
|
||||
CheckDtl.process_time,
|
||||
CheckDtl.remark,
|
||||
struct.struct_code,
|
||||
struct.sect_code,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
user1.person_name AS process_optname
|
||||
FROM
|
||||
ST_IVT_CheckDtl CheckDtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = CheckDtl.material_id
|
||||
LEFT JOIN st_ivt_structattr struct ON struct.struct_id = CheckDtl.struct_id
|
||||
LEFT JOIN sys_user user1 ON user1.user_id = CheckDtl.process_optid
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="paramMap.check_id != null and paramMap.check_id !=''">
|
||||
AND CheckDtl.check_id = #{paramMap.check_id}
|
||||
</if>
|
||||
<if test="paramMap.checkdtl_id != null and paramMap.checkdtl_id !=''">
|
||||
AND CheckDtl.checkdtl_id = #{paramMap.checkdtl_id}
|
||||
</if>
|
||||
<if test="paramMap.status != null and paramMap.status !=''">
|
||||
AND CheckDtl.status <![CDATA[ <= ]]> #{paramMap.status}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getDtlView" resultType="org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation">
|
||||
SELECT
|
||||
sub.*
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN st_ivt_structattr attr ON ivt.struct_id = attr.struct_id
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON ivt.pcsn = sub.container_name AND sub.package_box_sn = attr.storagevehicle_code
|
||||
WHERE
|
||||
1=1
|
||||
<if test="paramMap.pcsn != null and paramMap.pcsn !=''">
|
||||
AND ivt.pcsn like '%${paramMap.pcsn}%'
|
||||
</if>
|
||||
<if test="paramMap.sap_pcsn != null and paramMap.sap_pcsn !=''">
|
||||
AND sub.sap_pcsn like '%${paramMap.sap_pcsn}%'
|
||||
</if>
|
||||
<if test="paramMap.box_no != null and paramMap.box_no !=''">
|
||||
AND sub.package_box_sn = #{paramMap.box_no}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getStructIvt" resultType="org.nl.wms.st.instor.check.service.dto.CheckStructIvt">
|
||||
SELECT
|
||||
struct.sect_id,
|
||||
MAX(struct.sect_code) AS sect_code,
|
||||
MAX(struct.sect_name) AS sect_name,
|
||||
MAX(struct.struct_id) AS struct_id,
|
||||
MAX(struct.struct_code) AS struct_code,
|
||||
MAX(struct.struct_name) AS struct_name,
|
||||
MAX(struct.storagevehicle_code) AS storagevehicle_code,
|
||||
MAX(mb.material_id) AS material_id,
|
||||
MAX(mb.material_name) AS material_name,
|
||||
MAX(mb.material_code) AS material_code,
|
||||
'1' AS base_qty,
|
||||
'0' AS fac_qty,
|
||||
'箱' AS qty_unit_name,
|
||||
'1585604690706567168' AS measure_unit_id
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN st_ivt_structattr struct ON ivt.struct_id = struct.struct_id
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt.material_id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND struct.lock_type = '1'
|
||||
AND IFNULL(struct.storagevehicle_code,'') <![CDATA[ <> ]]> ''
|
||||
|
||||
<if test="paramMap.struct_code != null and paramMap.struct_code !=''">
|
||||
AND struct.struct_code like '%${paramMap.struct_code}%'
|
||||
</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.box_no != null and paramMap.box_no !=''">
|
||||
AND struct.storagevehicle_code = #{paramMap.box_no}
|
||||
</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>
|
||||
group by ivt.struct_id
|
||||
</select>
|
||||
|
||||
<select id="getOutBillDtl22" resultType="org.nl.wms.st.instor.check.service.dao.StIvtCheckdtl">
|
||||
SELECT
|
||||
CheckDtl.checkdtl_id,
|
||||
CheckDtl.check_id,
|
||||
CheckDtl.check_code,
|
||||
CheckDtl.seq_no,
|
||||
CheckDtl.sect_id,
|
||||
CheckDtl.sect_name,
|
||||
CheckDtl.struct_id,
|
||||
CheckDtl.struct_name,
|
||||
CheckDtl.checkpoint_id,
|
||||
CheckDtl.storagevehicle_id,
|
||||
CheckDtl.storagevehicle_code,
|
||||
CheckDtl.material_id,
|
||||
ROUND(CheckDtl.base_qty,3) AS base_qty,
|
||||
CheckDtl.qty_unit_id,
|
||||
CheckDtl.qty_unit_name,
|
||||
CheckDtl.STATUS,
|
||||
CheckDtl.is_down,
|
||||
CheckDtl.fac_qty,
|
||||
CheckDtl.check_result,
|
||||
CheckDtl.check_optid,
|
||||
CheckDtl.check_optname,
|
||||
CheckDtl.check_time,
|
||||
CheckDtl.is_process,
|
||||
CheckDtl.process_type,
|
||||
CheckDtl.process_optid,
|
||||
CheckDtl.process_time,
|
||||
CheckDtl.remark,
|
||||
struct.struct_code,
|
||||
struct.sect_code,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
user1.person_name AS process_optname,
|
||||
sub.date_of_production
|
||||
FROM
|
||||
ST_IVT_CheckDtl CheckDtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = CheckDtl.material_id
|
||||
LEFT JOIN st_ivt_structattr struct ON struct.struct_id = CheckDtl.struct_id
|
||||
LEFT JOIN sys_user user1 ON user1.user_id = CheckDtl.process_optid
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
MIN(date_of_production) AS date_of_production,
|
||||
package_box_sn
|
||||
FROM
|
||||
pdm_bi_subpackagerelation
|
||||
WHERE
|
||||
1=1
|
||||
group by package_box_sn
|
||||
) sub ON sub.package_box_sn = CheckDtl.storagevehicle_code
|
||||
WHERE
|
||||
CheckDtl.status <![CDATA[ <> ]]> '1'
|
||||
|
||||
<if test="paramMap.check_id != null and paramMap.check_id !=''">
|
||||
AND CheckDtl.check_id = #{paramMap.check_id}
|
||||
</if>
|
||||
order by CheckDtl.seq_no
|
||||
</select>
|
||||
|
||||
<select id="getOutBillDtl222" resultType="org.nl.wms.st.instor.check.service.dao.StIvtCheckdtl">
|
||||
SELECT
|
||||
CheckDtl.checkdtl_id,
|
||||
CheckDtl.check_id,
|
||||
CheckDtl.check_code,
|
||||
CheckDtl.seq_no,
|
||||
CheckDtl.sect_id,
|
||||
CheckDtl.sect_name,
|
||||
CheckDtl.struct_id,
|
||||
CheckDtl.struct_name,
|
||||
CheckDtl.checkpoint_id,
|
||||
CheckDtl.storagevehicle_id,
|
||||
CheckDtl.storagevehicle_code,
|
||||
CheckDtl.material_id,
|
||||
ROUND(CheckDtl.base_qty,3) AS base_qty,
|
||||
CheckDtl.qty_unit_id,
|
||||
CheckDtl.qty_unit_name,
|
||||
CheckDtl.STATUS,
|
||||
CheckDtl.is_down,
|
||||
CheckDtl.fac_qty,
|
||||
CheckDtl.check_result,
|
||||
CheckDtl.check_optid,
|
||||
CheckDtl.check_optname,
|
||||
CheckDtl.check_time,
|
||||
CheckDtl.is_process,
|
||||
CheckDtl.process_type,
|
||||
CheckDtl.process_optid,
|
||||
CheckDtl.process_time,
|
||||
CheckDtl.remark,
|
||||
struct.struct_code,
|
||||
struct.sect_code,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
user1.person_name AS process_optname,
|
||||
sub.date_of_production
|
||||
FROM
|
||||
ST_IVT_CheckDtl CheckDtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = CheckDtl.material_id
|
||||
LEFT JOIN st_ivt_structattr struct ON struct.struct_id = CheckDtl.struct_id
|
||||
LEFT JOIN sys_user user1 ON user1.user_id = CheckDtl.process_optid
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
MIN(date_of_production) AS date_of_production,
|
||||
package_box_sn
|
||||
FROM
|
||||
pdm_bi_subpackagerelation
|
||||
WHERE
|
||||
1=1
|
||||
group by package_box_sn
|
||||
) sub ON sub.package_box_sn = CheckDtl.storagevehicle_code
|
||||
WHERE
|
||||
CheckDtl.status = '1'
|
||||
<if test="paramMap.check_id != null and paramMap.check_id !=''">
|
||||
AND CheckDtl.check_id = #{paramMap.check_id}
|
||||
</if>
|
||||
order by CheckDtl.seq_no
|
||||
</select>
|
||||
|
||||
<select id="getOutBillDtl" resultType="org.nl.wms.st.instor.check.service.dao.StIvtCheckdtl">
|
||||
SELECT
|
||||
CheckDtl.checkdtl_id,
|
||||
CheckDtl.check_id,
|
||||
CheckDtl.check_code,
|
||||
CheckDtl.seq_no,
|
||||
CheckDtl.sect_id,
|
||||
CheckDtl.sect_name,
|
||||
CheckDtl.struct_id,
|
||||
CheckDtl.struct_name,
|
||||
CheckDtl.checkpoint_id,
|
||||
CheckDtl.storagevehicle_id,
|
||||
CheckDtl.storagevehicle_code,
|
||||
CheckDtl.material_id,
|
||||
ROUND(CheckDtl.base_qty,3) AS base_qty,
|
||||
CheckDtl.qty_unit_id,
|
||||
CheckDtl.qty_unit_name,
|
||||
CheckDtl.STATUS,
|
||||
CheckDtl.is_down,
|
||||
CheckDtl.fac_qty,
|
||||
CheckDtl.check_result,
|
||||
CheckDtl.check_optid,
|
||||
CheckDtl.check_optname,
|
||||
CheckDtl.check_time,
|
||||
CheckDtl.is_process,
|
||||
CheckDtl.process_type,
|
||||
CheckDtl.process_optid,
|
||||
CheckDtl.process_time,
|
||||
CheckDtl.remark,
|
||||
struct.struct_code,
|
||||
struct.sect_code,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
user1.person_name AS process_optname,
|
||||
sub.date_of_production
|
||||
FROM
|
||||
ST_IVT_CheckDtl CheckDtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = CheckDtl.material_id
|
||||
LEFT JOIN st_ivt_structattr struct ON struct.struct_id = CheckDtl.struct_id
|
||||
LEFT JOIN sys_user user1 ON user1.user_id = CheckDtl.process_optid
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
MIN(date_of_production) AS date_of_production,
|
||||
package_box_sn
|
||||
FROM
|
||||
pdm_bi_subpackagerelation
|
||||
WHERE
|
||||
1=1
|
||||
group by package_box_sn
|
||||
) sub ON sub.package_box_sn = CheckDtl.storagevehicle_code
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="paramMap.check_id != null and paramMap.check_id !=''">
|
||||
AND CheckDtl.check_id = #{paramMap.check_id}
|
||||
</if>
|
||||
<if test="paramMap.checkdtl_id != null and paramMap.checkdtl_id !=''">
|
||||
AND CheckDtl.checkdtl_id = #{paramMap.checkdtl_id}
|
||||
</if>
|
||||
<if test="paramMap.status != null and paramMap.status !=''">
|
||||
AND CheckDtl.status <![CDATA[ <= ]]> #{paramMap.status}
|
||||
</if>
|
||||
order by CheckDtl.seq_no
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package org.nl.wms.st.instor.check.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 出库任务分配明细
|
||||
*
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/4
|
||||
*/
|
||||
@Data
|
||||
public class CheckStructIvt implements Serializable {
|
||||
private String sect_id;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
private String sect_code;
|
||||
|
||||
/**
|
||||
* 出入单明细标识
|
||||
*/
|
||||
private String sect_name;
|
||||
|
||||
/**
|
||||
* 库区标识
|
||||
*/
|
||||
private String struct_id;
|
||||
|
||||
/**
|
||||
* 库区编码
|
||||
*/
|
||||
private String struct_code;
|
||||
|
||||
/**
|
||||
* 库区名称
|
||||
*/
|
||||
private String struct_name;
|
||||
|
||||
/**
|
||||
* 仓位标识
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 仓位编码
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 仓位名称
|
||||
*/
|
||||
private String material_name;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String measure_unit_id;
|
||||
|
||||
/**
|
||||
* 品质类型
|
||||
*/
|
||||
private String qty_unit_name;
|
||||
|
||||
/**
|
||||
* 计划数量
|
||||
*/
|
||||
private BigDecimal base_qty;
|
||||
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
private BigDecimal fac_qty;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.nl.wms.st.instor.check.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/18
|
||||
*/
|
||||
@Data
|
||||
public class QueryPageParam implements Serializable {
|
||||
private String check_id;
|
||||
private String checkdtl_id;
|
||||
private String status;
|
||||
|
||||
private String box_no;
|
||||
|
||||
|
||||
private String pcsn;
|
||||
|
||||
private String sap_pcsn;
|
||||
|
||||
private String struct_code;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String stor_id;
|
||||
|
||||
private String sect_id;
|
||||
}
|
||||
@@ -4,13 +4,16 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.st.instor.check.service.dao.StIvtCheckMst;
|
||||
import org.nl.wms.st.instor.check.service.dao.StIvtCheckdtl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.nl.wms.st.instor.check.service.dto.CheckStructIvt;
|
||||
import org.nl.wms.st.instor.check.service.dto.QueryPageParam;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface CheckService extends IService<StIvtCheckMst> {
|
||||
@@ -30,7 +33,7 @@ public interface CheckService extends IService<StIvtCheckMst> {
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> getDtlView(Map whereJson, Pageable page);
|
||||
IPage<PdmBiSubpackagerelation> getDtlView(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
@@ -61,9 +64,9 @@ public interface CheckService extends IService<StIvtCheckMst> {
|
||||
* @param whereJson /
|
||||
* @return
|
||||
*/
|
||||
JSONArray getOutBillDtl(Map whereJson);
|
||||
List<StIvtCheckdtl> getOutBillDtl(Map whereJson);
|
||||
|
||||
JSONArray getOutBillDtl2(Map whereJson);
|
||||
List<StIvtCheckdtl> getOutBillDtl2(Map whereJson);
|
||||
|
||||
/**
|
||||
* 修改出库单
|
||||
@@ -78,7 +81,7 @@ public interface CheckService extends IService<StIvtCheckMst> {
|
||||
* @param whereJson /
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getStructIvt(Map whereJson, Pageable page);
|
||||
IPage<CheckStructIvt> getStructIvt(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 出库单强制确认
|
||||
@@ -102,7 +105,7 @@ public interface CheckService extends IService<StIvtCheckMst> {
|
||||
* @param response
|
||||
* @throws IOException
|
||||
*/
|
||||
void download(JSONArray rows, HttpServletResponse response) throws IOException;
|
||||
void download( List<StIvtCheckdtl> rows, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 处理确认
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.st.instor.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -12,10 +13,10 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -24,15 +25,15 @@ import org.nl.modules.common.utils.FileUtil;
|
||||
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.wms.basedata.st.service.impl.UserStorServiceImpl;
|
||||
import org.nl.wms.st.instor.check.service.dao.StIvtCheckMst;
|
||||
import org.nl.wms.st.instor.check.service.dao.StIvtCheckdtl;
|
||||
import org.nl.wms.st.instor.check.service.dao.mapper.StIvtCheckMstMapper;
|
||||
import org.nl.wms.st.instor.check.service.dao.mapper.StIvtCheckdtlMapper;
|
||||
import org.nl.wms.st.instor.check.service.dto.CheckStructIvt;
|
||||
import org.nl.wms.st.instor.check.service.dto.QueryPageParam;
|
||||
import org.nl.wms.st.instor.service.CheckService;
|
||||
import org.nl.wms.st.outbill.service.dto.OutBillQueryPageParam;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
@@ -95,25 +96,18 @@ public class CheckServiceImpl extends ServiceImpl<StIvtCheckMstMapper, StIvtChec
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getDtlView(Map whereJson, Pageable page) {
|
||||
public IPage<PdmBiSubpackagerelation> getDtlView(Map whereJson, PageQuery page) {
|
||||
String box_no = MapUtil.getStr(whereJson, "box_no");
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
String sap_pcsn = MapUtil.getStr(whereJson, "sap_pcsn");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("box_no", box_no);
|
||||
map.put("flag", "9");
|
||||
QueryPageParam param = new QueryPageParam();
|
||||
param.setBox_no(box_no);
|
||||
param.setPcsn(pcsn);
|
||||
param.setSap_pcsn(sap_pcsn);
|
||||
IPage<PdmBiSubpackagerelation> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
return stIvtCheckMstMapper.getDtlView(pages, param);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(pcsn)) {
|
||||
map.put("pcsn", "%" + pcsn + "%");
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(sap_pcsn)) {
|
||||
map.put("sap_pcsn", "%" + sap_pcsn + "%");
|
||||
}
|
||||
|
||||
JSONObject json = WQL.getWO("QST_IVT_CHECK").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "sub.container_name ASC");
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -204,38 +198,38 @@ public class CheckServiceImpl extends ServiceImpl<StIvtCheckMstMapper, StIvtChec
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getOutBillDtl(Map whereJson) {
|
||||
public List<StIvtCheckdtl> getOutBillDtl(Map whereJson) {
|
||||
String type = MapUtil.getStr(whereJson, "type");
|
||||
|
||||
JSONArray jo = new JSONArray();
|
||||
QueryPageParam param = new QueryPageParam();
|
||||
if (ObjectUtil.isNotEmpty(type)) {
|
||||
if (StrUtil.equals(type, "1")) {
|
||||
// 1-已盘点
|
||||
whereJson.put("flag", "22");
|
||||
jo = WQL.getWO("QST_IVT_CHECK").addParamMap((HashMap) whereJson).process().getResultJSONArray(0);
|
||||
String check_id = MapUtil.getStr(whereJson, "check_id");
|
||||
param.setCheck_id(check_id);
|
||||
return stIvtCheckMstMapper.getOutBillDtl22(param);
|
||||
} else {
|
||||
// 1-未盘点
|
||||
whereJson.put("flag", "222");
|
||||
jo = WQL.getWO("QST_IVT_CHECK").addParamMap((HashMap) whereJson).process().getResultJSONArray(0);
|
||||
String check_id = MapUtil.getStr(whereJson, "check_id");
|
||||
param.setCheck_id(check_id);
|
||||
return stIvtCheckMstMapper.getOutBillDtl222(param);
|
||||
}
|
||||
} else {
|
||||
whereJson.put("flag", "2");
|
||||
jo = WQL.getWO("QST_IVT_CHECK")
|
||||
.addParamMap((HashMap) whereJson)
|
||||
.process()
|
||||
.getResultJSONArray(0);
|
||||
String check_id = MapUtil.getStr(whereJson, "check_id");
|
||||
String checkdtl_id = MapUtil.getStr(whereJson, "checkdtl_id");
|
||||
String status = MapUtil.getStr(whereJson, "status");
|
||||
param.setCheck_id(check_id);
|
||||
param.setStatus(status);
|
||||
param.setCheckdtl_id(checkdtl_id);
|
||||
return stIvtCheckMstMapper.getOutBillDtl(param);
|
||||
}
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getOutBillDtl2(Map whereJson) {
|
||||
whereJson.put("flag", "8");
|
||||
JSONArray jo = WQL.getWO("QST_IVT_CHECK")
|
||||
.addParamMap((HashMap) whereJson)
|
||||
.process()
|
||||
.getResultJSONArray(0);
|
||||
return jo;
|
||||
public List<StIvtCheckdtl> getOutBillDtl2(Map whereJson) {
|
||||
ObjectMapper Om = new ObjectMapper();
|
||||
QueryPageParam param = Om.convertValue(whereJson,QueryPageParam.class);
|
||||
return stIvtCheckMstMapper.getOutBillDtl2(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -286,21 +280,23 @@ public class CheckServiceImpl extends ServiceImpl<StIvtCheckMstMapper, StIvtChec
|
||||
}
|
||||
|
||||
@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") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("box_no"))) {
|
||||
map.put("box_no", "%" + map.get("box_no") + "%");
|
||||
}
|
||||
JSONObject jo = WQL.getWO("QST_IVT_CHECK")
|
||||
.addParam("flag", "3")
|
||||
.addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "struct.struct_code");
|
||||
return jo;
|
||||
public IPage<CheckStructIvt> getStructIvt(Map whereJson, PageQuery page) {
|
||||
String box_no = MapUtil.getStr(whereJson, "box_no");
|
||||
String struct_code = MapUtil.getStr(whereJson, "struct_code");
|
||||
String remark = MapUtil.getStr(whereJson, "remark");
|
||||
String stor_id = MapUtil.getStr(whereJson, "stor_id");
|
||||
String sect_id = MapUtil.getStr(whereJson, "sect_id");
|
||||
|
||||
QueryPageParam param = new QueryPageParam();
|
||||
param.setBox_no(box_no);
|
||||
param.setStruct_code(struct_code);
|
||||
param.setRemark(remark);
|
||||
param.setSect_id(sect_id);
|
||||
param.setStor_id(stor_id);
|
||||
|
||||
|
||||
IPage<CheckStructIvt> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
return stIvtCheckMstMapper.getStructIvt(pages, param);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -430,12 +426,13 @@ public class CheckServiceImpl extends ServiceImpl<StIvtCheckMstMapper, StIvtChec
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(JSONArray rows, HttpServletResponse response) throws IOException {
|
||||
public void download( List<StIvtCheckdtl> rows, HttpServletResponse response) throws IOException {
|
||||
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
|
||||
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject jo = rows.getJSONObject(i);
|
||||
StIvtCheckdtl row = rows.get(i);
|
||||
JSONObject jo = (JSONObject) JSONObject.toJSON(row);
|
||||
|
||||
String storagevehicle_code = jo.getString("storagevehicle_code");
|
||||
JSONObject jsonSub = subTab.query("package_box_sn = '" + storagevehicle_code + "'").uniqueResult(0);
|
||||
|
||||
@@ -1,338 +0,0 @@
|
||||
[交易说明]
|
||||
交易名: 基础点位分页查询
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.status TYPEAS s_string
|
||||
输入.check_code TYPEAS s_string
|
||||
输入.create_mode TYPEAS s_string
|
||||
输入.check_type TYPEAS s_string
|
||||
输入.stor_id TYPEAS s_string
|
||||
输入.check_id TYPEAS s_string
|
||||
输入.work_status TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.material_id TYPEAS s_string
|
||||
输入.quality_scode TYPEAS s_string
|
||||
输入.pcsn TYPEAS s_string
|
||||
输入.sap_pcsn TYPEAS s_string
|
||||
输入.ivt_level TYPEAS s_string
|
||||
输入.is_active TYPEAS s_string
|
||||
输入.sect_id TYPEAS s_string
|
||||
输入.moveinvdtl_id TYPEAS s_string
|
||||
输入.struct_id TYPEAS s_string
|
||||
输入.is_issued TYPEAS s_string
|
||||
输入.remark TYPEAS s_string
|
||||
输入.task_id TYPEAS s_string
|
||||
输入.struct_code TYPEAS s_string
|
||||
输入.ids TYPEAS f_string
|
||||
输入.storagevehicle_code TYPEAS s_string
|
||||
输入.box_no TYPEAS s_string
|
||||
输入.deptIds TYPEAS f_string
|
||||
输入.in_stor_id TYPEAS f_string
|
||||
输入.check_id_in TYPEAS f_string
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
CheckDtl.*,
|
||||
struct.struct_code,
|
||||
struct.sect_code,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
user1.person_name AS process_optname,
|
||||
sub.date_of_production
|
||||
FROM
|
||||
ST_IVT_CheckDtl CheckDtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = CheckDtl.material_id
|
||||
LEFT JOIN st_ivt_structattr struct ON struct.struct_id = CheckDtl.struct_id
|
||||
LEFT JOIN sys_user user1 ON user1.user_id = CheckDtl.process_optid
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
MIN(date_of_production) AS date_of_production,
|
||||
package_box_sn
|
||||
FROM
|
||||
pdm_bi_subpackagerelation
|
||||
WHERE
|
||||
1=1
|
||||
group by package_box_sn
|
||||
) sub ON sub.package_box_sn = CheckDtl.storagevehicle_code
|
||||
WHERE
|
||||
1 = 1
|
||||
OPTION 输入.check_id <> ""
|
||||
CheckDtl.check_id = 输入.check_id
|
||||
ENDOPTION
|
||||
OPTION 输入.checkdtl_id <> ""
|
||||
CheckDtl.checkdtl_id = 输入.checkdtl_id
|
||||
ENDOPTION
|
||||
OPTION 输入.status <> ""
|
||||
CheckDtl.status <= 输入.status
|
||||
ENDOPTION
|
||||
order by CheckDtl.seq_no
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "22"
|
||||
QUERY
|
||||
SELECT
|
||||
CheckDtl.*,
|
||||
struct.struct_code,
|
||||
struct.sect_code,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
user1.person_name AS process_optname,
|
||||
sub.date_of_production
|
||||
FROM
|
||||
ST_IVT_CheckDtl CheckDtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = CheckDtl.material_id
|
||||
LEFT JOIN st_ivt_structattr struct ON struct.struct_id = CheckDtl.struct_id
|
||||
LEFT JOIN sys_user user1 ON user1.user_id = CheckDtl.process_optid
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
MIN(date_of_production) AS date_of_production,
|
||||
package_box_sn
|
||||
FROM
|
||||
pdm_bi_subpackagerelation
|
||||
WHERE
|
||||
1=1
|
||||
group by package_box_sn
|
||||
) sub ON sub.package_box_sn = CheckDtl.storagevehicle_code
|
||||
WHERE
|
||||
CheckDtl.status <> '1'
|
||||
OPTION 输入.check_id <> ""
|
||||
CheckDtl.check_id = 输入.check_id
|
||||
ENDOPTION
|
||||
|
||||
order by CheckDtl.seq_no
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "222"
|
||||
QUERY
|
||||
SELECT
|
||||
CheckDtl.*,
|
||||
struct.struct_code,
|
||||
struct.sect_code,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
user1.person_name AS process_optname,
|
||||
sub.date_of_production
|
||||
FROM
|
||||
ST_IVT_CheckDtl CheckDtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = CheckDtl.material_id
|
||||
LEFT JOIN st_ivt_structattr struct ON struct.struct_id = CheckDtl.struct_id
|
||||
LEFT JOIN sys_user user1 ON user1.user_id = CheckDtl.process_optid
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
MIN(date_of_production) AS date_of_production,
|
||||
package_box_sn
|
||||
FROM
|
||||
pdm_bi_subpackagerelation
|
||||
WHERE
|
||||
1=1
|
||||
group by package_box_sn
|
||||
) sub ON sub.package_box_sn = CheckDtl.storagevehicle_code
|
||||
WHERE
|
||||
CheckDtl.status = '1'
|
||||
OPTION 输入.check_id <> ""
|
||||
CheckDtl.check_id = 输入.check_id
|
||||
ENDOPTION
|
||||
|
||||
order by CheckDtl.seq_no
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
struct.sect_id,
|
||||
MAX(struct.sect_code) AS sect_code,
|
||||
MAX(struct.sect_name) AS sect_name,
|
||||
MAX(struct.struct_id) AS struct_id,
|
||||
MAX(struct.struct_code) AS struct_code,
|
||||
MAX(struct.struct_name) AS struct_name,
|
||||
MAX(struct.storagevehicle_code) AS storagevehicle_code,
|
||||
MAX(mb.material_id) AS material_id,
|
||||
MAX(mb.material_name) AS material_name,
|
||||
MAX(mb.material_code) AS material_code,
|
||||
'1' AS base_qty,
|
||||
'0' AS fac_qty,
|
||||
'箱' AS qty_unit_name,
|
||||
'1585604690706567168' AS measure_unit_id
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN st_ivt_structattr struct ON ivt.struct_id = struct.struct_id
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt.material_id
|
||||
WHERE
|
||||
1 = 1
|
||||
AND struct.lock_type = '1'
|
||||
AND IFNULL(struct.storagevehicle_code,'') <> ''
|
||||
|
||||
OPTION 输入.remark <> ""
|
||||
(mb.material_code like 输入.remark or mb.material_name like 输入.remark)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.struct_code <> ""
|
||||
struct.struct_code like 输入.struct_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
struct.storagevehicle_code like 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.stor_id <> ""
|
||||
struct.stor_id = 输入.stor_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sect_id <> ""
|
||||
struct.sect_id = 输入.sect_id
|
||||
ENDOPTION
|
||||
|
||||
group by ivt.struct_id
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "8"
|
||||
QUERY
|
||||
SELECT
|
||||
CheckDtl.checkdtl_id,
|
||||
CheckDtl.check_id,
|
||||
CheckDtl.check_code,
|
||||
CheckDtl.seq_no,
|
||||
CheckDtl.sect_id,
|
||||
CheckDtl.sect_name,
|
||||
CheckDtl.struct_id,
|
||||
CheckDtl.struct_name,
|
||||
CheckDtl.checkpoint_id,
|
||||
CheckDtl.storagevehicle_id,
|
||||
CheckDtl.storagevehicle_code,
|
||||
CheckDtl.material_id,
|
||||
ROUND(CheckDtl.base_qty,3) AS base_qty,
|
||||
CheckDtl.qty_unit_id,
|
||||
CheckDtl.qty_unit_name,
|
||||
CheckDtl.STATUS,
|
||||
CheckDtl.is_down,
|
||||
CheckDtl.fac_qty,
|
||||
CheckDtl.check_result,
|
||||
CheckDtl.check_optid,
|
||||
CheckDtl.check_optname,
|
||||
CheckDtl.check_time,
|
||||
CheckDtl.is_process,
|
||||
CheckDtl.process_type,
|
||||
CheckDtl.process_optid,
|
||||
CheckDtl.process_time,
|
||||
CheckDtl.remark,
|
||||
struct.struct_code,
|
||||
struct.sect_code,
|
||||
mb.material_code,
|
||||
mb.material_name,
|
||||
user1.person_name AS process_optname
|
||||
FROM
|
||||
ST_IVT_CheckDtl CheckDtl
|
||||
LEFT JOIN md_me_materialbase mb ON mb.material_id = CheckDtl.material_id
|
||||
LEFT JOIN st_ivt_structattr struct ON struct.struct_id = CheckDtl.struct_id
|
||||
LEFT JOIN sys_user user1 ON user1.user_id = CheckDtl.process_optid
|
||||
WHERE
|
||||
1 = 1
|
||||
OPTION 输入.check_id <> ""
|
||||
CheckDtl.check_id = 输入.check_id
|
||||
ENDOPTION
|
||||
OPTION 输入.checkdtl_id <> ""
|
||||
CheckDtl.checkdtl_id = 输入.checkdtl_id
|
||||
ENDOPTION
|
||||
OPTION 输入.status <> ""
|
||||
CheckDtl.status <= 输入.status
|
||||
ENDOPTION
|
||||
order by CheckDtl.seq_no
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "9"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
sub.*
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN st_ivt_structattr attr ON ivt.struct_id = attr.struct_id
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON ivt.pcsn = sub.container_name AND sub.package_box_sn = attr.storagevehicle_code
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
sub.package_box_sn = 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn <> ""
|
||||
ivt.pcsn like 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sap_pcsn <> ""
|
||||
sub.sap_pcsn like 输入.sap_pcsn
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "10"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
dtl.*,
|
||||
mater.material_code,
|
||||
mater.material_name
|
||||
FROM
|
||||
ST_IVT_CheckDtl dtl
|
||||
LEFT JOIN md_me_materialbase mater ON dtl.material_id = mater.material_id
|
||||
WHERE
|
||||
dtl.check_result = '2'
|
||||
and dtl.status in ('4','5')
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
dtl.storagevehicle_code like 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.check_code <> ""
|
||||
dtl.check_code = 输入.check_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
@@ -11,6 +11,8 @@ import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.system.service.dict.ISysDictService;
|
||||
import org.nl.wms.st.outbill.service.CheckOutBillService;
|
||||
import org.nl.wms.st.outbill.service.dto.*;
|
||||
import org.nl.wms.st.outbill.service.vo.OutBillDtlVo;
|
||||
import org.nl.wms.st.outbill.service.vo.OutBillTaskVo;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -139,4 +141,35 @@ public class CheckOutBillController {
|
||||
checkOutBillService.importExcel(file, request);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/moneySubmit")
|
||||
@Log("发货信息保存")
|
||||
public ResponseEntity<Object> moneySubmit(@RequestBody JSONObject whereJson) {
|
||||
checkOutBillService.moneySubmit(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getDisNum")
|
||||
@Log("获取分配明细条数")
|
||||
public ResponseEntity<Object> getDisNum(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(checkOutBillService.getDisNum(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@Log("下载发货单Excel")
|
||||
@GetMapping(value = "/downloadExcel")
|
||||
public ResponseEntity<Object> downloadExcel(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
|
||||
checkOutBillService.downloadExcel(response, whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/finishTask")
|
||||
@Log("出库任务手动完成")
|
||||
public ResponseEntity<Object> finishTask(@RequestBody OutBillTaskVo whereJson) {
|
||||
checkOutBillService.finishTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
@PostMapping("/issueTask")
|
||||
@Log("出库任务下发")
|
||||
public ResponseEntity<Object> issueTask(@RequestBody JSONObject whereJson) {
|
||||
checkOutBillService.issueTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public interface CheckOutBillService {
|
||||
* @param whereJson /
|
||||
* @return
|
||||
*/
|
||||
JSONArray getOutBillTask(Map whereJson);
|
||||
List<OutBillTaskVo> getOutBillTask(Map whereJson);
|
||||
|
||||
/**
|
||||
* 更新是否超期
|
||||
@@ -89,4 +89,43 @@ public interface CheckOutBillService {
|
||||
* @param request 请求头
|
||||
*/
|
||||
void importExcel(MultipartFile file, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 保存发货信息
|
||||
* @param whereJson
|
||||
*/
|
||||
void moneySubmit(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 获取分配明细条数
|
||||
* @param whereJson
|
||||
* @return
|
||||
*/
|
||||
JSONObject getDisNum(Map whereJson);
|
||||
|
||||
/**
|
||||
* 打印 -> 下载发货单excel
|
||||
* @param response
|
||||
* @param whereJson
|
||||
*/
|
||||
void downloadExcel(HttpServletResponse response, Map whereJson) throws IOException;
|
||||
|
||||
/**
|
||||
* 出库任务手动完成
|
||||
* @param whereJson
|
||||
*/
|
||||
void finishTask(OutBillTaskVo whereJson);
|
||||
/**
|
||||
* 出库单强制确认(只确认单据用-虚拟区的更新库存)
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void confirmOrder(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 出库任务下发
|
||||
*
|
||||
* @param whereJson /
|
||||
*/
|
||||
void issueTask(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 木箱信息VO
|
||||
* @see org.nl.wms.st.outbill.service.impl.CheckOutBillServiceImpl#exportExcel(org.nl.wms.st.outbill.service.dto.OutManageParam, javax.servlet.http.HttpServletResponse)
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/3
|
||||
*/
|
||||
@@ -13,4 +14,8 @@ import java.io.Serializable;
|
||||
public class AllBoxInfoDto implements Serializable {
|
||||
private Double box_weight;
|
||||
private String iostorinvdtl_id;
|
||||
private String qty;
|
||||
private String box_no;
|
||||
private String num;
|
||||
private String material_name;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.nl.wms.st.outbill.service.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 获取生成和未分配的明细的请求参数
|
||||
* QST_IVT_CHECKOUTBILL -> flag:2
|
||||
*
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/4
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GenOrUnDtlDto implements Serializable {
|
||||
private String iostorinv_id;
|
||||
private String iostorinvdtl_id;
|
||||
private String bill_status;
|
||||
private String unassign_flag;
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package org.nl.wms.st.outbill.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 出库任务分配明细
|
||||
*
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/4
|
||||
*/
|
||||
@Data
|
||||
public class OutTaskDisDto implements Serializable {
|
||||
private String iostorinvdis_id;
|
||||
|
||||
/**
|
||||
* 出入单标识
|
||||
*/
|
||||
private String iostorinv_id;
|
||||
|
||||
/**
|
||||
* 出入单明细标识
|
||||
*/
|
||||
private String iostorinvdtl_id;
|
||||
|
||||
/**
|
||||
* 明细序号
|
||||
*/
|
||||
private BigDecimal seq_no;
|
||||
|
||||
/**
|
||||
* 库区标识
|
||||
*/
|
||||
private String sect_id;
|
||||
|
||||
/**
|
||||
* 库区编码
|
||||
*/
|
||||
private String sect_code;
|
||||
|
||||
/**
|
||||
* 库区名称
|
||||
*/
|
||||
private String sect_name;
|
||||
|
||||
/**
|
||||
* 仓位标识
|
||||
*/
|
||||
private String struct_id;
|
||||
|
||||
/**
|
||||
* 仓位编码
|
||||
*/
|
||||
private String struct_code;
|
||||
|
||||
/**
|
||||
* 仓位名称
|
||||
*/
|
||||
private String struct_name;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
/**
|
||||
* 品质类型
|
||||
*/
|
||||
private String quality_scode;
|
||||
|
||||
/**
|
||||
* 执行状态
|
||||
*/
|
||||
private String work_status;
|
||||
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private String task_id;
|
||||
|
||||
/**
|
||||
* 存储载具标识
|
||||
*/
|
||||
private String storagevehicle_id;
|
||||
|
||||
/**
|
||||
* 存储载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 是否已下发
|
||||
*/
|
||||
private String is_issued;
|
||||
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
/**
|
||||
* 数量计量单位名称
|
||||
*/
|
||||
private String qty_unit_name;
|
||||
|
||||
/**
|
||||
* 计划数量
|
||||
*/
|
||||
private BigDecimal plan_qty;
|
||||
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
private BigDecimal real_qty;
|
||||
|
||||
/**
|
||||
* 出入点位标识
|
||||
*/
|
||||
private String point_id;
|
||||
|
||||
/**
|
||||
* 箱号
|
||||
*/
|
||||
private String box_no;
|
||||
|
||||
/**
|
||||
* 是否超期
|
||||
*/
|
||||
private String is_overdue;
|
||||
|
||||
/**
|
||||
* 入库时间
|
||||
*/
|
||||
private String instorage_time;
|
||||
|
||||
/**
|
||||
* 是否回传
|
||||
*/
|
||||
private String is_upload;
|
||||
private String material_code;
|
||||
private String material_name;
|
||||
private String task_code;
|
||||
private String task_status;
|
||||
private String task_type;
|
||||
private String start_point_code;
|
||||
private String source_id;
|
||||
private String point_code;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.nl.wms.st.outbill.service.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 查询出库任务的dto(参数)
|
||||
* <p>QST_IVT_CHECKOUTBILL 》》 flag:55</p>
|
||||
*
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/4
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OutTaskQueryDisDto implements Serializable {
|
||||
private String iostorinvdtl_id;
|
||||
private String task_id;
|
||||
private String iostorinv_id;
|
||||
private String iostorinvdis_id;
|
||||
private String is_issued;
|
||||
private String struct_id;
|
||||
private String bill_status;
|
||||
}
|
||||
@@ -1,32 +1,59 @@
|
||||
package org.nl.wms.st.outbill.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelWriter;
|
||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||
import com.alibaba.excel.write.metadata.fill.FillWrapper;
|
||||
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.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelationrecord;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IPdmBiSubpackagerelationrecordService;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.TwoOutTask;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvdisService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvdtlService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdis;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvMapper;
|
||||
import org.nl.b_lms.storage_manage.md.dao.MdCsCustomerBase;
|
||||
import org.nl.b_lms.storage_manage.md.dao.MdCsTransportationBase;
|
||||
import org.nl.b_lms.storage_manage.md.service.IMdCsCustomerBaseService;
|
||||
import org.nl.b_lms.storage_manage.md.service.IMdCsTransportationBaseService;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtBsrealstorattr;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtSectattr;
|
||||
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtStructivtMapper;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtBsrealstorattrService;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtSectattrService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.StringDealUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.FileUtil;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.st.inbill.service.StorPublicService;
|
||||
import org.nl.wms.st.outbill.service.CheckOutBillService;
|
||||
import org.nl.wms.st.outbill.service.dto.*;
|
||||
import org.nl.wms.st.outbill.service.vo.OutBillDtlVo;
|
||||
@@ -39,12 +66,15 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
@@ -67,6 +97,20 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
private StIvtStructivtMapper stIvtStructivtMapper;
|
||||
@Autowired
|
||||
private IMdCsTransportationBaseService mdCsTransportationBaseService;
|
||||
@Autowired
|
||||
private IMdCsCustomerBaseService csCustomerBaseService;
|
||||
@Autowired
|
||||
private ISysParamService sysParamService;
|
||||
@Autowired
|
||||
private IpdmBiSubpackagerelationService subpackagerelationService;
|
||||
@Autowired
|
||||
private IPdmBiSubpackagerelationrecordService subpackagerelationrecordService;
|
||||
@Autowired
|
||||
private StorPublicService storPublicService;
|
||||
@Autowired
|
||||
private StIvtSectattrService stIvtSectattrService;
|
||||
@Autowired
|
||||
private IschBaseTaskService ischBaseTaskService;
|
||||
|
||||
@Override
|
||||
public List<OutBillDtlVo> getOutBillDtl(OutBillDtlQueryParam param) {
|
||||
@@ -151,12 +195,12 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getOutBillTask(Map whereJson) {
|
||||
public List<OutBillTaskVo> getOutBillTask(Map whereJson) {
|
||||
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||
if ("true".equals(map.get("checked"))) {
|
||||
map.put("task_status", "99");
|
||||
}
|
||||
JSONArray jo = new JSONArray();
|
||||
List<OutBillTaskVo> jo = new ArrayList<>();
|
||||
if (map.containsKey("iostorinvdtl_id")) {
|
||||
jo = stIvtStructivtMapper.getOutBillTask(map);
|
||||
}
|
||||
@@ -302,7 +346,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
String estimated_freight = list.get(5).toString();
|
||||
|
||||
// 更新主表
|
||||
jsonMst.setTrans_code( ObjectUtil.isNotEmpty(trans) ? trans.getCust_code() : "" );
|
||||
jsonMst.setTrans_code(ObjectUtil.isNotEmpty(trans) ? trans.getCust_code() : "");
|
||||
jsonMst.setOrder_number(order_number);
|
||||
jsonMst.setCar_type(car_type);
|
||||
jsonMst.setOther_freight(new BigDecimal(other_freight));
|
||||
@@ -311,8 +355,848 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moneySubmit(JSONObject whereJson) {
|
||||
stIvtIostorinvService.updateById(whereJson.toJavaObject(StIvtIostorinv.class));
|
||||
// todo: 回传SAP
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDisNum(Map whereJson) {
|
||||
List<AllBoxInfoDto> dtlArr = iostorinvdisService.getBoxInfoByInvId(MapUtil.getStr(whereJson, "iostorinv_id"));
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("num", dtlArr.size());
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadExcel(HttpServletResponse response, Map whereJson) throws IOException {
|
||||
StIvtIostorinv jsonMst = stIvtIostorinvService.getById(MapUtil.getStr(whereJson, "iostorinv_id"));
|
||||
String cust_code = jsonMst.getCust_code();
|
||||
MdCsCustomerBase jsonCust = csCustomerBaseService.getByCode(cust_code);
|
||||
String bill_type = jsonMst.getBill_type();
|
||||
|
||||
int j = Integer.parseInt((String) whereJson.get("j"));
|
||||
|
||||
HashMap<String, Object> oneMap = new HashMap<>();
|
||||
// 2.获取输出流
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
String code_template = "";
|
||||
int shd_dtl_num = 0; // 送货单明细数
|
||||
|
||||
// 调拨发货单
|
||||
if (StrUtil.equals(bill_type, OutBillTypeEnum.TRANSFER_OUT.getCode()) || StrUtil.equals(bill_type, OutBillTypeEnum.MANUAL_OUT.getCode())) {
|
||||
shd_dtl_num = 44;
|
||||
//1.获取系统参数模板地址
|
||||
code_template = sysParamService.findByCode("allot_order").getValue();
|
||||
|
||||
// 5.单组填充
|
||||
StIvtIostorinvdtl jsonDtl = iostorinvdtlService.getOne(new LambdaQueryWrapper<StIvtIostorinvdtl>()
|
||||
.eq(StIvtIostorinvdtl::getIostorinv_id, jsonMst.getIostorinv_id()), false);
|
||||
if (ObjectUtil.isNotEmpty(jsonDtl) && StrUtil.equals(bill_type, OutBillTypeEnum.TRANSFER_OUT.getCode())) {
|
||||
// 调拨单号
|
||||
oneMap.put("vbeln", jsonMst.getBill_code());
|
||||
// 调出仓库
|
||||
oneMap.put("out_stor", jsonMst.getStor_code());
|
||||
// 调入仓库
|
||||
StIvtBsrealstorattr jsonStor = bsrealstorattrService.getById(jsonMst.getOut_stor_id());
|
||||
oneMap.put("in_stor", jsonStor.getStor_code());
|
||||
|
||||
}
|
||||
String pageNow = String.valueOf(j + 1); // 页码
|
||||
oneMap.put("page", pageNow + "/" + MapUtil.getStr(whereJson, "pageNum"));
|
||||
oneMap.put("consignee", jsonMst.getConsignee()); // 收货单位
|
||||
oneMap.put("receiver", jsonMst.getReceiver()); // 收货人
|
||||
String receiptaddress = jsonMst.getReceiptaddress();
|
||||
oneMap.put("receiptaddress", receiptaddress); // 收货地址
|
||||
oneMap.put("receiptphone", jsonMst.getReceiptphone()); // 收货人联系电话
|
||||
// 物流公司
|
||||
MdCsTransportationBase jsonTran = mdCsTransportationBaseService.getByCode(jsonMst.getTrans_code());
|
||||
if (ObjectUtil.isNotEmpty(jsonTran)) {
|
||||
oneMap.put("logisticscompany", jsonTran.getCust_name());
|
||||
}
|
||||
oneMap.put("drivername", jsonMst.getDrivername()); // 司机
|
||||
oneMap.put("carno", jsonMst.getCarno()); // 车牌号
|
||||
oneMap.put("driverphone", jsonMst.getDriverphone()); // 司机联系电话
|
||||
// 总箱数
|
||||
List<AllBoxInfoDto> jsonAllBox = iostorinvdisService.getAllBoxInfoByInvId(MapUtil.getStr(whereJson, "iostorinv_id"));
|
||||
oneMap.put("all_box", jsonAllBox.size());
|
||||
// 总毛重
|
||||
double all_box_qty = 0;
|
||||
for (AllBoxInfoDto allBox : jsonAllBox) {
|
||||
all_box_qty = NumberUtil.add(all_box_qty, Double.parseDouble(allBox.getQty()));
|
||||
}
|
||||
oneMap.put("all_box_qty", NumberUtil.round(all_box_qty, 2).toString());
|
||||
oneMap.put("deliveryaddress", jsonMst.getDeliveryaddress()); // 送货方地址
|
||||
oneMap.put("deliveryname", jsonMst.getDeliveryname()); // 送货方联系人
|
||||
oneMap.put("deliveryphone", jsonMst.getDeliveryphone()); // 送货方联系电话
|
||||
oneMap.put("contractno", jsonMst.getContractno()); // 合同号
|
||||
} else {
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonCust)) {
|
||||
shd_dtl_num = 44;
|
||||
//1.根据出入库主表中 收货单位 查询客户表中的模板路径
|
||||
code_template = sysParamService.findByCode("PRINT_TEMPLE").getValue();
|
||||
} else {
|
||||
shd_dtl_num = jsonCust.getShd_dtl_num();
|
||||
|
||||
if (ObjectUtil.isEmpty(shd_dtl_num)) {
|
||||
throw new BadRequestException("客户编码:" + cust_code + ",送货单明细数未配置,请先去配置!");
|
||||
}
|
||||
//1.根据出入库主表中 收货单位 查询客户表中的模板路径
|
||||
code_template = jsonCust.getShd_print_no();
|
||||
|
||||
if (StrUtil.isEmpty(code_template)) {
|
||||
throw new BadRequestException("客户编码:" + cust_code + ",送货单打印模板号未配置,请先去配置!");
|
||||
}
|
||||
}
|
||||
StIvtIostorinvdtl jsonDtl = iostorinvdtlService.getOne(new LambdaQueryWrapper<StIvtIostorinvdtl>()
|
||||
.eq(StIvtIostorinvdtl::getIostorinv_id, jsonMst.getIostorinv_id()), false);
|
||||
if (ObjectUtil.isNotEmpty(jsonDtl)) {
|
||||
// 送货单号
|
||||
oneMap.put("vbeln", jsonDtl.getVbeln());
|
||||
// 订单号
|
||||
String source_bill_code = jsonDtl.getSource_bill_code();
|
||||
if (ObjectUtil.isNotEmpty(source_bill_code)) {
|
||||
try {
|
||||
oneMap.put("order_no", source_bill_code.substring(0, source_bill_code.indexOf("-")));
|
||||
} catch (Exception e) {
|
||||
oneMap.put("order_no", source_bill_code);
|
||||
}
|
||||
}
|
||||
}
|
||||
String pageNow = String.valueOf(j + 1); // 页码
|
||||
oneMap.put("page", pageNow + "/" + MapUtil.getStr(whereJson, "pageNum"));
|
||||
oneMap.put("consignee", jsonMst.getConsignee()); // 收货单位
|
||||
oneMap.put("receiver", jsonMst.getReceiver()); // 收货人
|
||||
String receiptaddress = jsonMst.getReceiptaddress();
|
||||
/* StrBuilder strBuilder = new StrBuilder(receiptaddress);
|
||||
|
||||
if (receiptaddress.length() > 10) {
|
||||
strBuilder.insert(11,"\n");
|
||||
}*/
|
||||
oneMap.put("receiptaddress", receiptaddress); // 收货地址
|
||||
oneMap.put("receiptphone", jsonMst.getReceiptphone()); // 收货人联系电话
|
||||
// 物流公司
|
||||
MdCsTransportationBase jsonTran = mdCsTransportationBaseService.getByCode(jsonMst.getTrans_code());
|
||||
if (ObjectUtil.isNotEmpty(jsonTran)) {
|
||||
oneMap.put("logisticscompany", jsonTran.getCust_name());
|
||||
}
|
||||
oneMap.put("drivername", jsonMst.getDrivername()); // 司机
|
||||
oneMap.put("carno", jsonMst.getCarno()); // 车牌号
|
||||
oneMap.put("driverphone", jsonMst.getDriverphone()); // 司机联系电话
|
||||
// 总箱数
|
||||
List<AllBoxInfoDto> jsonAllBox = iostorinvdisService.getAllBoxInfoByInvId(MapUtil.getStr(whereJson, "iostorinv_id"));
|
||||
oneMap.put("all_box", jsonAllBox.size());
|
||||
// 总毛重
|
||||
double all_box_qty = 0;
|
||||
for (AllBoxInfoDto allBox : jsonAllBox) {
|
||||
all_box_qty = NumberUtil.add(all_box_qty, Double.parseDouble(allBox.getQty()));
|
||||
}
|
||||
oneMap.put("all_box_qty", NumberUtil.round(all_box_qty, 2).toString());
|
||||
oneMap.put("deliveryaddress", jsonMst.getDeliveryaddress()); // 送货方地址
|
||||
oneMap.put("deliveryname", jsonMst.getDeliveryname()); // 送货方联系人
|
||||
oneMap.put("deliveryphone", jsonMst.getDeliveryphone()); // 送货方联系电话
|
||||
oneMap.put("contractno", jsonMst.getContractno()); // 合同号
|
||||
}
|
||||
|
||||
// 6.多组填充
|
||||
List<AllBoxInfoDto> dtlArr = iostorinvdisService.getBoxInfoByInvId(MapUtil.getStr(whereJson, "iostorinv_id"));
|
||||
|
||||
if (shd_dtl_num > dtlArr.size()) {
|
||||
double all_qty = 0;
|
||||
String order_no = "";
|
||||
ArrayList<HashMap<String, Object>> flData = new ArrayList<>();
|
||||
WriteSheet sheet = EasyExcel.writerSheet().build();
|
||||
double all_real = 0; // 总毛总
|
||||
for (int i = 0; i < dtlArr.size(); i++) {
|
||||
AllBoxInfoDto json = dtlArr.get(i);
|
||||
PdmBiSubpackagerelation jsonSub = subpackagerelationService.getOne(new LambdaQueryWrapper<PdmBiSubpackagerelation>()
|
||||
.eq(PdmBiSubpackagerelation::getPackage_box_sn, json.getBox_no()), false);
|
||||
if (ObjectUtil.isEmpty(jsonSub)) {
|
||||
throw new BadRequestException("没有查询到子卷包装");
|
||||
}
|
||||
order_no = jsonSub.getSale_order_name();
|
||||
|
||||
// 规格: 厚度*幅宽
|
||||
String material_spec = jsonSub.getThickness_request() + "*" + jsonSub.getWidth_standard();
|
||||
// 箱号
|
||||
String box_no = json.getBox_no();
|
||||
String sub_box_no = "";
|
||||
if (ObjectUtil.isNotEmpty(box_no)) {
|
||||
try {
|
||||
sub_box_no = box_no.substring(box_no.lastIndexOf("@") + 1, box_no.length());
|
||||
} catch (Exception e) {
|
||||
sub_box_no = box_no;
|
||||
}
|
||||
}
|
||||
|
||||
HashMap<String, Object> mapFL = new HashMap<>();
|
||||
// 明细
|
||||
// String date_of_production = jsonSub.getString("date_of_production").replaceAll("[[\\s-:punct:]]", "");
|
||||
// mapFL.put("date_of_production", date_of_production); // 批号 : 子卷包装生产日期
|
||||
mapFL.put("material_name", json.getMaterial_name());
|
||||
mapFL.put("material_spec", material_spec);
|
||||
// mapFL.put("qty_unit_name", "KG");
|
||||
mapFL.put("box_no", sub_box_no);
|
||||
mapFL.put("qty", NumberUtil.round(json.getQty(), 1).doubleValue()); // 净重
|
||||
if (ObjectUtil.isNotEmpty(jsonSub.getReal_weight())) {
|
||||
mapFL.put("real_weight", NumberUtil.round(jsonSub.getBox_weight(), 1).doubleValue()); // 毛重
|
||||
all_real = NumberUtil.add(String.valueOf(all_real), jsonSub.getBox_weight().toString()).doubleValue();
|
||||
} else {
|
||||
mapFL.put("real_weight", NumberUtil.round(jsonSub.getBox_weight(), 1).doubleValue()); // 毛重
|
||||
all_real = NumberUtil.add(String.valueOf(all_real), jsonSub.getBox_weight().toString()).doubleValue();
|
||||
}
|
||||
|
||||
flData.add(mapFL);
|
||||
all_qty = NumberUtil.add(String.valueOf(all_qty), json.getQty()).doubleValue();
|
||||
}
|
||||
// 订单号
|
||||
/* if (ObjectUtil.isNotEmpty(order_no)) {
|
||||
oneMap.put("order_no",order_no.substring(0,order_no.indexOf("-")));
|
||||
}*/
|
||||
ExcelWriter workBook = EasyExcel.write(outputStream, null).withTemplate(code_template).build();
|
||||
|
||||
oneMap.put("all_qty", NumberUtil.round(all_qty, 1)); // 合计
|
||||
oneMap.put("all_real", NumberUtil.round(all_real, 1)); // 总毛重
|
||||
workBook.fill(oneMap, sheet);
|
||||
workBook.fill(new FillWrapper("data", flData), sheet);
|
||||
workBook.finish();
|
||||
} else {
|
||||
|
||||
double div = NumberUtil.div(dtlArr.size(), shd_dtl_num);
|
||||
double ceil = Math.ceil(div);
|
||||
Integer integer = Integer.valueOf(String.valueOf(NumberUtil.round(ceil, 0)));
|
||||
|
||||
double all_qty = 0;
|
||||
double all_real = 0;
|
||||
String order_no = "";
|
||||
ArrayList<HashMap<String, Object>> flData = new ArrayList<>();
|
||||
for (int i = j * shd_dtl_num; i < (j + 1) * shd_dtl_num; i++) {
|
||||
if (i == dtlArr.size()) {
|
||||
break;
|
||||
}
|
||||
|
||||
AllBoxInfoDto json = dtlArr.get(i);
|
||||
PdmBiSubpackagerelation jsonSub = subpackagerelationService.getOne(new LambdaQueryWrapper<PdmBiSubpackagerelation>()
|
||||
.eq(PdmBiSubpackagerelation::getPackage_box_sn, json.getBox_no()), false);
|
||||
if (ObjectUtil.isEmpty(jsonSub)) {
|
||||
throw new BadRequestException("没有查询到子卷包装");
|
||||
}
|
||||
order_no = jsonSub.getSale_order_name();
|
||||
|
||||
// 规格: 厚度*幅宽
|
||||
String material_spec = jsonSub.getThickness_request() + "*" + jsonSub.getWidth_standard();
|
||||
// 箱号
|
||||
String box_no = json.getBox_no();
|
||||
String sub_box_no = "";
|
||||
if (ObjectUtil.isNotEmpty(box_no)) {
|
||||
try {
|
||||
sub_box_no = box_no.substring(box_no.lastIndexOf("@") + 1, box_no.length());
|
||||
} catch (Exception e) {
|
||||
sub_box_no = box_no;
|
||||
}
|
||||
}
|
||||
|
||||
HashMap<String, Object> mapFL = new HashMap<>();
|
||||
// 明细
|
||||
// String date_of_production = jsonSub.getString("date_of_production").replaceAll("[[\\s-:punct:]]", "");
|
||||
// mapFL.put("date_of_production", date_of_production); // 批号 : 子卷包装生产日期
|
||||
mapFL.put("material_name", json.getMaterial_name());
|
||||
mapFL.put("material_spec", material_spec);
|
||||
// mapFL.put("qty_unit_name", "KG");
|
||||
mapFL.put("box_no", sub_box_no);
|
||||
mapFL.put("qty", NumberUtil.round(json.getQty(), 1).doubleValue());
|
||||
if (ObjectUtil.isNotEmpty(jsonSub.getReal_weight())) {
|
||||
mapFL.put("real_weight", NumberUtil.round(jsonSub.getBox_weight(), 1).doubleValue()); // 毛重
|
||||
all_real = NumberUtil.add(String.valueOf(all_real), jsonSub.getBox_weight().toString()).doubleValue();
|
||||
} else {
|
||||
mapFL.put("real_weight", NumberUtil.round(jsonSub.getBox_weight(), 1).doubleValue()); // 毛重
|
||||
all_real = NumberUtil.add(String.valueOf(all_real), jsonSub.getBox_weight().toString()).doubleValue();
|
||||
}
|
||||
flData.add(mapFL);
|
||||
|
||||
// 计算合计重量
|
||||
all_qty = NumberUtil.add(String.valueOf(all_qty), json.getQty()).doubleValue();
|
||||
|
||||
}
|
||||
// 订单号
|
||||
ExcelWriter workBook = EasyExcel.write(outputStream, null).withTemplate(code_template).build();
|
||||
oneMap.put("all_qty", NumberUtil.round(all_qty, 1)); // 合计
|
||||
oneMap.put("all_real", NumberUtil.round(all_real, 1)); // 总毛重
|
||||
WriteSheet sheet = EasyExcel.writerSheet(0).build();
|
||||
workBook.fill(oneMap, sheet);
|
||||
workBook.fill(new FillWrapper("data", flData), sheet);
|
||||
workBook.finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishTask(OutBillTaskVo whereJson) {
|
||||
// hint: 根据明细去完成
|
||||
// 查询任务对应的分配明细 (任务可能为空)
|
||||
JSONArray disJsonArr = iostorinvdisService.getBillInfosByConditions(OutTaskQueryDisDto.builder()
|
||||
.task_id(whereJson.getTask_id())
|
||||
.build());
|
||||
// 获取一个数据
|
||||
JSONObject demoDis = disJsonArr.getJSONObject(0);
|
||||
// 获取出库单据
|
||||
StIvtIostorinv jo_mst = stIvtIostorinvService.getById(demoDis.getString("iostorinv_id"));
|
||||
String iostorinv_id = jo_mst.getIostorinv_id();
|
||||
for (int i = 0; i < disJsonArr.size(); i++) {
|
||||
JSONObject dis = disJsonArr.getJSONObject(i);
|
||||
|
||||
double plan_qty = dis.getDoubleValue("plan_qty");
|
||||
double real_qty = dis.getDoubleValue("real_qty");
|
||||
//未出部分,按取消分配处理
|
||||
if (Double.compare(real_qty, plan_qty) != 0) {
|
||||
dis.put("change_qty", plan_qty - real_qty);
|
||||
dis.put("bill_type_scode", jo_mst.getBill_type());
|
||||
dis.put("inv_id", iostorinv_id);
|
||||
dis.put("bill_code", jo_mst.getBill_code());
|
||||
dis.put("bill_table", "ST_IVT_IOStorInv");
|
||||
storPublicService.IOStor(dis, "12");
|
||||
}
|
||||
//更新已出库重量
|
||||
if (real_qty != 0) {
|
||||
dis.put("change_qty", real_qty);
|
||||
dis.put("bill_type_scode", jo_mst.getBill_type());
|
||||
dis.put("inv_id", iostorinv_id);
|
||||
dis.put("bill_code", jo_mst.getBill_code());
|
||||
dis.put("bill_table", "ST_IVT_IOStorInv");
|
||||
|
||||
if (jo_mst.getIs_overdue().equals("1")) {
|
||||
if (dis.getString("is_overdue").equals("1")) {
|
||||
storPublicService.IOStor(dis, "12");
|
||||
} else {
|
||||
storPublicService.IOStor(dis, "21");
|
||||
}
|
||||
} else {
|
||||
storPublicService.IOStor(dis, "21");
|
||||
}
|
||||
}
|
||||
// 更新分配明细执行状态为 - 99
|
||||
iostorinvdisService.update(new LambdaUpdateWrapper<StIvtIostorinvdis>()
|
||||
.set(StIvtIostorinvdis::getWork_status, "99")
|
||||
.eq(StIvtIostorinvdis::getIostorinvdis_id, dis.getString("iostorinvdis_id")));
|
||||
if (jo_mst.getIs_overdue().equals("1") && dis.getString("is_overdue").equals("1")) {
|
||||
continue;
|
||||
}
|
||||
// 更新子卷包装关系表 状态 - 3
|
||||
JSONObject jsonSub = subpackagerelationService.getObj(new LambdaQueryWrapper<PdmBiSubpackagerelation>()
|
||||
.eq(PdmBiSubpackagerelation::getContainer_name, dis.getString("pcsn"))
|
||||
.eq(PdmBiSubpackagerelation::getPackage_box_sn, dis.getString("box_no"))
|
||||
.eq(PdmBiSubpackagerelation::getStatus, "2"), p -> (JSONObject) JSON.toJSON(p));
|
||||
//查询对应的包装关系出入库记录表
|
||||
if (ObjectUtil.isEmpty(jsonSub)) {
|
||||
jsonSub = subpackagerelationrecordService.getObj(new LambdaQueryWrapper<PdmBiSubpackagerelationrecord>()
|
||||
.eq(PdmBiSubpackagerelationrecord::getContainer_name, dis.getString("pcsn"))
|
||||
.eq(PdmBiSubpackagerelationrecord::getPackage_box_sn, dis.getString("box_no"))
|
||||
.eq(PdmBiSubpackagerelationrecord::getStatus, "2")
|
||||
.eq(PdmBiSubpackagerelationrecord::getBill_code, jo_mst.getBill_code()), p -> (JSONObject) JSON.toJSON(p));
|
||||
}
|
||||
if (ObjectUtil.isEmpty(jsonSub)) {
|
||||
throw new BadRequestException("此子卷不存在或不为入库状态:" + dis.getString("pcsn"));
|
||||
|
||||
}
|
||||
// 如果是拆分入库则将包装关系改为生成状态
|
||||
if (IOSEnum.OUT_TYPE.code("拆箱出库").equals(jo_mst.getBill_type()) || (IOSEnum.OUT_TYPE.code("手工出库").equals(jo_mst.getBill_type()))) {
|
||||
jsonSub.put("status", "0");
|
||||
} else {
|
||||
jsonSub.put("status", "3");
|
||||
}
|
||||
// 分拣出库
|
||||
if (jo_mst.getBill_type().equals("1011")) {
|
||||
// 更新子卷包装净重
|
||||
double net_weight = NumberUtil.sub(jsonSub.getDoubleValue("net_weight"), plan_qty);
|
||||
jsonSub.put("net_weight", net_weight);
|
||||
|
||||
if (net_weight <= 0) {
|
||||
jsonSub.put("status", "3");
|
||||
} else {
|
||||
jsonSub.put("status", "2");
|
||||
}
|
||||
}
|
||||
subpackagerelationService.updateById(jsonSub.toJavaObject(PdmBiSubpackagerelation.class));
|
||||
|
||||
// 改切出库、返检出库
|
||||
// 如果为返检出库或者改切出库删除对应的包装关系
|
||||
if ("1003".equals(jo_mst.getBill_type()) || "1006".equals(jo_mst.getBill_type())) {
|
||||
List<StIvtIostorinvdis> disRows = iostorinvdisService.list(new LambdaQueryWrapper<StIvtIostorinvdis>()
|
||||
.eq(StIvtIostorinvdis::getIostorinv_id, iostorinv_id)
|
||||
.eq(StIvtIostorinvdis::getBox_no, jsonSub.getString("package_box_sn"))
|
||||
.eq(jo_mst.getIs_overdue().equals("1"), StIvtIostorinvdis::getIs_overdue, "0"));
|
||||
|
||||
for (StIvtIostorinvdis disRow : disRows) {
|
||||
StIvtSectattr sect_jo = stIvtSectattrService.getByCode(disRow.getSect_code());
|
||||
if (ObjectUtil.isEmpty(sect_jo)) {
|
||||
throw new BadRequestException("未查询到对应的库区!");
|
||||
}
|
||||
//如果是虚拟区的出库,直接把包装关系删除;如果为立库的包装关系,将解绑删除标识置为1。当发货区解绑时,删除包装关系
|
||||
String pcsn = disRow.getPcsn();
|
||||
if ("09".equals(sect_jo.getSect_type_attr())) {
|
||||
subpackagerelationService.remove(new LambdaQueryWrapper<PdmBiSubpackagerelation>()
|
||||
.eq(PdmBiSubpackagerelation::getContainer_name, pcsn));
|
||||
} else {
|
||||
LambdaUpdateWrapper<PdmBiSubpackagerelation> subUpLam = new LambdaUpdateWrapper<>();
|
||||
subUpLam.set(PdmBiSubpackagerelation::getNeed_delete, "1")
|
||||
.eq(PdmBiSubpackagerelation::getContainer_name, pcsn);
|
||||
subpackagerelationService.update(subUpLam);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 解锁起点
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("struct_id", dis.getString("struct_id"));
|
||||
from_start.put("lock_type", "1");
|
||||
from_start.put("is_overdue", dis.getString("is_overdue"));
|
||||
|
||||
if (jo_mst.getIs_overdue().equals("1")) {
|
||||
if (dis.getString("is_overdue").equals("1")) {
|
||||
from_start.put("storagevehicle_code", dis.getString("box_no"));
|
||||
} else {
|
||||
from_start.put("storagevehicle_code", "");
|
||||
}
|
||||
} else {
|
||||
from_start.put("storagevehicle_code", "");
|
||||
}
|
||||
if (jo_mst.getBill_type().equals("1011")) {
|
||||
// 判断此木箱下的所有子卷净重是否为0,如果为0则清空载具
|
||||
List<JSONObject> packageList = subpackagerelationService.getSubInfoByBoxNosToObject(
|
||||
Stream.of(jsonSub.getString("package_box_sn")).collect(Collectors.toList())
|
||||
);
|
||||
|
||||
boolean is_zero = packageList.stream()
|
||||
.allMatch(row -> row.getDoubleValue("net_weight") <= 0);
|
||||
|
||||
if (is_zero) {
|
||||
from_start.put("storagevehicle_code", "");
|
||||
} else {
|
||||
from_start.put("bill_type", "1011");
|
||||
from_start.put("storagevehicle_code", jsonSub.getString("package_box_sn"));
|
||||
}
|
||||
}
|
||||
|
||||
storPublicService.updateStructAndPoint(from_start);
|
||||
//插入包装关系出入库记录表
|
||||
jsonSub.put("bill_code", jo_mst.getBill_code());
|
||||
jsonSub.put("bill_id", jo_mst.getIostorinv_id());
|
||||
jsonSub.put("bill_type", jo_mst.getBill_type());
|
||||
jsonSub.put("io_type", "1");
|
||||
jsonSub.put("insert_time", DateUtil.now());
|
||||
jsonSub.put("record_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
subpackagerelationrecordService.save(jsonSub.toJavaObject(PdmBiSubpackagerelationrecord.class));
|
||||
}
|
||||
|
||||
LambdaUpdateWrapper<SchBaseTask> taskLam = new LambdaUpdateWrapper<>();
|
||||
taskLam.set(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||
.set(SchBaseTask::getFinished_type, "01")
|
||||
.set(SchBaseTask::getUpdate_optid, SecurityUtils.getCurrentUserId() + "")
|
||||
.set(SchBaseTask::getUpdate_optname, SecurityUtils.getCurrentNickName())
|
||||
.set(SchBaseTask::getUpdate_time, DateUtil.now())
|
||||
.eq(SchBaseTask::getTask_id, whereJson.getTask_id());
|
||||
//更新任务为完成
|
||||
ischBaseTaskService.update(taskLam);
|
||||
|
||||
// 查询此任务下所有的分配明细
|
||||
List<StIvtIostorinvdis> disArr = iostorinvdisService.list(new LambdaQueryWrapper<StIvtIostorinvdis>()
|
||||
.eq(StIvtIostorinvdis::getTask_id, whereJson.getTask_id()));
|
||||
for (int i = 0; i < disArr.size(); i++) {
|
||||
StIvtIostorinvdis json = disArr.get(i);
|
||||
// 更新分配明细为完成
|
||||
json.setWork_status("99");
|
||||
iostorinvdisService.updateById(json);
|
||||
|
||||
// 判断此明细下是否还有未完成的分配明细
|
||||
StIvtIostorinvdtl jsonDtl = iostorinvdtlService.getById(json.getIostorinvdtl_id());
|
||||
List<StIvtIostorinvdis> disArr2 = iostorinvdisService.list(new LambdaQueryWrapper<StIvtIostorinvdis>()
|
||||
.eq(StIvtIostorinvdis::getIostorinvdtl_id, jsonDtl.getIostorinvdtl_id())
|
||||
.ne(StIvtIostorinvdis::getWork_status, "99"));
|
||||
if (ObjectUtil.isEmpty(disArr2)) {
|
||||
// 更新明细为完成
|
||||
jsonDtl.setBill_status("99");
|
||||
iostorinvdtlService.updateById(jsonDtl);
|
||||
}
|
||||
}
|
||||
|
||||
//判断是否还有未完成的明细
|
||||
List<StIvtIostorinvdtl> ja = iostorinvdtlService.list(new LambdaQueryWrapper<StIvtIostorinvdtl>()
|
||||
.ne(StIvtIostorinvdtl::getBill_status, "99")
|
||||
.eq(StIvtIostorinvdtl::getIostorinv_id, disArr.get(0).getIostorinv_id()));
|
||||
if (ja.size() == 0) {
|
||||
this.confirmOrder((JSONObject) JSONObject.toJSON(jo_mst));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void confirmOrder(JSONObject form) {
|
||||
String iostorinv_id = form.getString("iostorinv_id");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
//查询主表信息
|
||||
StIvtIostorinv jo_mst = stIvtIostorinvService.getById(iostorinv_id);
|
||||
if (ObjectUtil.isEmpty(jo_mst)) {
|
||||
throw new BadRequestException("未查到相关出库单");
|
||||
}
|
||||
|
||||
//判断分配明细中是否有未生成状态的分配明细
|
||||
List<StIvtIostorinvdis> disArr = iostorinvdisService.list(new LambdaQueryWrapper<StIvtIostorinvdis>()
|
||||
.eq(StIvtIostorinvdis::getIostorinv_id, iostorinv_id)
|
||||
.eq(StIvtIostorinvdis::getWork_status, "00"));
|
||||
if (ObjectUtil.isNotEmpty(disArr)) {
|
||||
throw new BadRequestException("有未生成状态的分配明细,不允许强制确认");
|
||||
}
|
||||
|
||||
// 查询是否有未完成的任务
|
||||
List<JSONObject> isTaskEmp = iostorinvdisService.getTasking(iostorinv_id);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(isTaskEmp)) {
|
||||
// 拼接字符串
|
||||
String box_no = isTaskEmp.stream()
|
||||
.map(row -> row.getString("box_no"))
|
||||
.distinct()
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
throw new BadRequestException("请先完成载具对应的出库任务:" + box_no);
|
||||
}
|
||||
|
||||
//查询生成和未分配完的明细
|
||||
List<JSONObject> dtls = iostorinvdtlService.getGeneratedAndUnallocatedDtls(GenOrUnDtlDto.builder()
|
||||
.bill_status("50")
|
||||
.iostorinv_id(iostorinv_id)
|
||||
.build());
|
||||
|
||||
if (dtls.size() != 0) {
|
||||
for (int i = 0; i < dtls.size(); i++) {
|
||||
JSONObject dtl = dtls.get(i);
|
||||
//更新明细状态
|
||||
LambdaUpdateWrapper<StIvtIostorinvdtl> dtlUpLam = new LambdaUpdateWrapper<>();
|
||||
dtlUpLam.set(StIvtIostorinvdtl::getBill_status, "99")
|
||||
.eq(StIvtIostorinvdtl::getIostorinvdtl_id, dtl.getString("iostorinvdtl_id"));
|
||||
iostorinvdtlService.update(dtlUpLam);
|
||||
}
|
||||
}
|
||||
|
||||
LambdaUpdateWrapper<StIvtIostorinv> invUpLam = new LambdaUpdateWrapper<>();
|
||||
invUpLam.set(StIvtIostorinv::getBill_code, "99")
|
||||
.set(StIvtIostorinv::getConfirm_optid, currentUserId)
|
||||
.set(StIvtIostorinv::getConfirm_optname, nickName)
|
||||
.set(StIvtIostorinv::getConfirm_time, now)
|
||||
.eq(StIvtIostorinv::getIostorinv_id, iostorinv_id);
|
||||
stIvtIostorinvService.update(invUpLam);
|
||||
|
||||
|
||||
//查询需要更新库存的分配记录
|
||||
JSONArray diss = iostorinvdisService.getBillInfosByConditions(OutTaskQueryDisDto.builder()
|
||||
.iostorinv_id(iostorinv_id)
|
||||
.build());
|
||||
for (int i = 0; i < diss.size(); i++) {
|
||||
JSONObject dis = diss.getJSONObject(i);
|
||||
// 判断是否是主存区的仓位, 是否发超期 todo: 编码固定
|
||||
if ("ZC01,ZZ01".contains(dis.getString("sect_code"))) {
|
||||
|
||||
if (jo_mst.getIs_overdue().equals("1")) {
|
||||
// 不发超期
|
||||
if (!dis.getString("is_overdue").equals("1")) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
double plan_qty = dis.getDoubleValue("plan_qty");
|
||||
double real_qty = dis.getDoubleValue("real_qty");
|
||||
//未出部分,按取消分配处理
|
||||
if (Double.compare(real_qty, plan_qty) != 0) {
|
||||
dis.put("change_qty", plan_qty - real_qty);
|
||||
dis.put("bill_type_scode", jo_mst.getBill_type());
|
||||
dis.put("inv_id", iostorinv_id);
|
||||
dis.put("bill_code", jo_mst.getBill_code());
|
||||
dis.put("bill_table", "ST_IVT_IOStorInv");
|
||||
storPublicService.IOStor(dis, "12");
|
||||
}
|
||||
//更新已出库重量
|
||||
if (real_qty != 0) {
|
||||
dis.put("change_qty", real_qty);
|
||||
dis.put("bill_type_scode", jo_mst.getBill_type());
|
||||
dis.put("inv_id", iostorinv_id);
|
||||
dis.put("bill_code", jo_mst.getBill_code());
|
||||
dis.put("bill_table", "ST_IVT_IOStorInv");
|
||||
|
||||
if (jo_mst.getIs_overdue().equals("1")) {
|
||||
if (dis.getString("is_overdue").equals("1")) {
|
||||
storPublicService.IOStor(dis, "12");
|
||||
} else {
|
||||
storPublicService.IOStor(dis, "21");
|
||||
}
|
||||
} else {
|
||||
storPublicService.IOStor(dis, "21");
|
||||
}
|
||||
}
|
||||
|
||||
// 更新分配明细执行状态为 - 99
|
||||
StIvtIostorinvdis jsonDis = iostorinvdisService.getOne(new LambdaQueryWrapper<StIvtIostorinvdis>()
|
||||
.eq(StIvtIostorinvdis::getIostorinvdis_id, dis.getString("iostorinvdis_id")));
|
||||
jsonDis.setWork_status("99");
|
||||
iostorinvdisService.updateById(jsonDis);
|
||||
|
||||
if (jo_mst.getIs_overdue().equals("1")) {
|
||||
if (dis.getString("is_overdue").equals("1")) {
|
||||
// 解锁起点
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("struct_id", dis.getString("struct_id"));
|
||||
from_start.put("lock_type", "1");
|
||||
from_start.put("is_overdue", dis.getString("is_overdue"));
|
||||
from_start.put("storagevehicle_code", dis.getString("box_no"));
|
||||
storPublicService.updateStructAndPoint(from_start);
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// 更新子卷包装关系表 状态 - 3
|
||||
JSONObject jsonSub = subpackagerelationService.getObj(new LambdaQueryWrapper<PdmBiSubpackagerelation>()
|
||||
.eq(PdmBiSubpackagerelation::getContainer_name, dis.getString("pcsn"))
|
||||
.eq(PdmBiSubpackagerelation::getPackage_box_sn, dis.getString("box_no"))
|
||||
.eq(PdmBiSubpackagerelation::getStatus, "2"), p -> (JSONObject) JSON.toJSON(p));
|
||||
//查询对应的包装关系出入库记录表
|
||||
if (ObjectUtil.isEmpty(jsonSub)) {
|
||||
jsonSub = subpackagerelationrecordService.getObj(new LambdaQueryWrapper<PdmBiSubpackagerelationrecord>()
|
||||
.eq(PdmBiSubpackagerelationrecord::getContainer_name, dis.getString("pcsn"))
|
||||
.eq(PdmBiSubpackagerelationrecord::getPackage_box_sn, dis.getString("box_no"))
|
||||
.eq(PdmBiSubpackagerelationrecord::getStatus, "2")
|
||||
.eq(PdmBiSubpackagerelationrecord::getBill_code, jo_mst.getBill_code()), p -> (JSONObject) JSON.toJSON(p));
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonSub)) {
|
||||
throw new BadRequestException("此子卷不存在或不为入库状态:" + dis.getString("pcsn"));
|
||||
|
||||
}
|
||||
// 如果是拆分入库则将包装关系改为生成状态
|
||||
if ("1005".equals(jo_mst.getBill_type()) || ("1009".equals(jo_mst.getBill_type()))) {
|
||||
jsonSub.put("status", "0");
|
||||
} else {
|
||||
jsonSub.put("status", "3");
|
||||
}
|
||||
|
||||
if (jo_mst.getBill_type().equals("1011")) {
|
||||
// 更新子卷包装净重
|
||||
double net_weight = NumberUtil.sub(jsonSub.getDoubleValue("net_weight"), plan_qty);
|
||||
jsonSub.put("net_weight",net_weight);
|
||||
|
||||
if (net_weight <= 0) {
|
||||
jsonSub.put("status","3");
|
||||
} else {
|
||||
jsonSub.put("status","2");
|
||||
}
|
||||
}
|
||||
subpackagerelationService.updateById(jsonSub.toJavaObject(PdmBiSubpackagerelation.class));
|
||||
|
||||
// 解锁起点
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("struct_id", dis.getString("struct_id"));
|
||||
from_start.put("lock_type", "1");
|
||||
from_start.put("is_overdue", dis.getString("is_overdue"));
|
||||
|
||||
if (jo_mst.getIs_overdue().equals("1")) {
|
||||
if (dis.getString("is_overdue").equals("1")) {
|
||||
from_start.put("storagevehicle_code", dis.getString("box_no"));
|
||||
} else {
|
||||
from_start.put("storagevehicle_code", "");
|
||||
}
|
||||
} else {
|
||||
from_start.put("storagevehicle_code", "");
|
||||
}
|
||||
|
||||
if (jo_mst.getBill_type().equals("1011")) {
|
||||
// 判断此木箱下的所有子卷净重是否为0,如果为0则清空载具
|
||||
List<JSONObject> packageList = subpackagerelationService.getSubInfoByBoxNosToObject(
|
||||
Stream.of(jsonSub.getString("package_box_sn")).collect(Collectors.toList())
|
||||
);
|
||||
boolean is_zero = packageList.stream()
|
||||
.allMatch(row -> row.getDoubleValue("net_weight") <= 0);
|
||||
|
||||
if (is_zero) {
|
||||
from_start.put("storagevehicle_code", "");
|
||||
} else {
|
||||
from_start.put("bill_type","1011");
|
||||
from_start.put("storagevehicle_code", jsonSub.getString("package_box_sn"));
|
||||
}
|
||||
}
|
||||
|
||||
storPublicService.updateStructAndPoint(from_start);
|
||||
|
||||
//插入包装关系出入库记录表
|
||||
jsonSub.put("bill_code", jo_mst.getBill_code());
|
||||
jsonSub.put("bill_id", jo_mst.getIostorinv_id());
|
||||
jsonSub.put("bill_type", jo_mst.getBill_type());
|
||||
jsonSub.put("io_type", "1");
|
||||
jsonSub.put("insert_time", DateUtil.now());
|
||||
jsonSub.put("record_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
subpackagerelationrecordService.save(jsonSub.toJavaObject(PdmBiSubpackagerelationrecord.class));
|
||||
|
||||
// 更新对应任务为完成
|
||||
SchBaseTask jsonTask = ischBaseTaskService.getOne(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getTask_id, jsonDis.getTask_id())
|
||||
.lt(SchBaseTask::getTask_status, "07"), false);
|
||||
if (ObjectUtil.isNotEmpty(jsonTask)) {
|
||||
jsonTask.setTask_status(TaskStatusEnum.FINISHED.getCode());
|
||||
ischBaseTaskService.updateById(jsonTask);
|
||||
}
|
||||
|
||||
}
|
||||
StIvtIostorinv out_jo = stIvtIostorinvService.getById(iostorinv_id);
|
||||
if ("1004".equals(out_jo.getBill_type())) {
|
||||
//调拨出库自动生成调拨入库单
|
||||
|
||||
//校验主表状态为生成
|
||||
if (!"99".equals(out_jo.getBill_status())) {
|
||||
throw new BadRequestException("主表状态必须为完成!");
|
||||
}
|
||||
|
||||
List<JSONObject> dis_rows = iostorinvdisService.listObjs(new LambdaQueryWrapper<StIvtIostorinvdis>()
|
||||
.eq(StIvtIostorinvdis::getIostorinv_id, iostorinv_id)
|
||||
.eq(jo_mst.getIs_overdue().equals("1"), StIvtIostorinvdis::getIs_overdue, "0"), p -> (JSONObject) JSON.toJSON(p));
|
||||
|
||||
//生成手工入库单
|
||||
String new_iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
String bill_code = CodeUtil.getNewCode("IO_CODE");
|
||||
jo_mst.setIostorinv_id(new_iostorinv_id);
|
||||
jo_mst.setBill_code(bill_code);
|
||||
jo_mst.setIo_type("0");
|
||||
jo_mst.setBill_type("0004");
|
||||
jo_mst.setBuss_type(jo_mst.getBill_type().substring(0, 4));
|
||||
//查询移入仓库的信息
|
||||
StIvtBsrealstorattr in_stor = bsrealstorattrService.getById(out_jo.getOut_stor_id());
|
||||
if (ObjectUtil.isEmpty(in_stor)) {
|
||||
throw new BadRequestException("未查询到对应的移入仓库信息!");
|
||||
}
|
||||
jo_mst.setStor_id(in_stor.getStor_id());
|
||||
jo_mst.setStor_code(in_stor.getStor_code());
|
||||
jo_mst.setStor_name(in_stor.getStor_name());
|
||||
jo_mst.setBill_status("30");
|
||||
jo_mst.setInput_optid(currentUserId);
|
||||
jo_mst.setInput_optname(nickName);
|
||||
jo_mst.setInput_time(now);
|
||||
jo_mst.setUpdate_optid(currentUserId);
|
||||
jo_mst.setUpdate_optname(nickName);
|
||||
jo_mst.setUpdate_time(now);
|
||||
jo_mst.setOut_stor_id(in_stor.getStor_id());
|
||||
|
||||
double total_qty = 0.00;
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
//插入明细表
|
||||
String iostorinvdtl_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
JSONObject dis_row = dis_rows.get(i);
|
||||
//查询对应的出库单明细
|
||||
StIvtIostorinvdtl dtl_row = iostorinvdtlService.getById(dis_row.getString("iostorinvdtl_id"));
|
||||
dis_row.put("iostorinvdtl_id", iostorinvdtl_id);
|
||||
dis_row.put("iostorinv_id", new_iostorinv_id);
|
||||
dis_row.put("seq_no", i + 1);
|
||||
dis_row.put("bill_status", "30");
|
||||
dis_row.put("real_qty", "0");
|
||||
dis_row.put("vbeln", dtl_row.getVbeln());
|
||||
dis_row.put("source_billdtl_id", dtl_row.getIostorinvdtl_id());
|
||||
// dis_row.put("source_bill_type", mst_row.getString("bill_type"));
|
||||
dis_row.put("source_bill_type", out_jo.getBill_type());
|
||||
dis_row.put("source_bill_code", dtl_row.getSource_bill_code());
|
||||
dis_row.put("source_bill_table", "ST_IVT_IOStorInvDtl");
|
||||
dis_row.put("assign_qty", dis_row.getString("plan_qty"));
|
||||
dis_row.put("unassign_qty", "0");
|
||||
//插入调拨明细表
|
||||
iostorinvdisService.save(dis_row.toJavaObject(StIvtIostorinvdis.class));
|
||||
dis_row.put("iostorinvdis_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
dis_row.put("seq_no", 1);
|
||||
dis_row.put("sect_id", "");
|
||||
dis_row.put("sect_code", "");
|
||||
dis_row.put("sect_name", "");
|
||||
dis_row.put("struct_id", "");
|
||||
dis_row.put("struct_code", "");
|
||||
dis_row.put("struct_name", "");
|
||||
dis_row.put("work_status", "00");
|
||||
dis_row.put("real_qty", "0");
|
||||
dis_row.put("point_id", "");
|
||||
dis_row.put("task_id", "");
|
||||
//插入分配表
|
||||
iostorinvdtlService.save(dis_row.toJavaObject(StIvtIostorinvdtl.class));
|
||||
total_qty = NumberUtil.add(total_qty,dis_row.getDoubleValue("plan_qty"));
|
||||
|
||||
//将包装关系中对应的记录状态改为包装
|
||||
LambdaUpdateWrapper<PdmBiSubpackagerelation> subUpLam = new LambdaUpdateWrapper<>();
|
||||
subUpLam.set(PdmBiSubpackagerelation::getStatus, "1")
|
||||
.eq(PdmBiSubpackagerelation::getPackage_box_sn, dis_row.getString("box_no"))
|
||||
.eq(PdmBiSubpackagerelation::getStatus, "3");
|
||||
subpackagerelationService.update(subUpLam);
|
||||
}
|
||||
|
||||
// 查询所有明细并计算实际重量
|
||||
List<StIvtIostorinvdtl> dtlList = iostorinvdtlService.getBillDtlByInvId(iostorinv_id);
|
||||
|
||||
double assign_qty = dtlList.stream()
|
||||
.map(row -> row.getAssign_qty().doubleValue())
|
||||
.reduce(Double::sum).orElse(0.00);
|
||||
|
||||
jo_mst.setDetail_count(BigDecimal.valueOf(dis_rows.size()));
|
||||
// jo_mst.put("total_qty", total_qty);
|
||||
jo_mst.setTotal_qty(BigDecimal.valueOf(assign_qty));
|
||||
stIvtIostorinvService.save(jo_mst);
|
||||
}
|
||||
|
||||
if ("1003".equals(out_jo.getBill_type()) || "1006".equals(out_jo.getBill_type())) {
|
||||
//如果为返检出库或者改切出库删除对应的包装关系
|
||||
List<JSONObject> dis_rows = iostorinvdisService.listObjs(new LambdaQueryWrapper<StIvtIostorinvdis>()
|
||||
.eq(StIvtIostorinvdis::getIostorinv_id, iostorinv_id)
|
||||
.eq(jo_mst.getIs_overdue().equals("1"), StIvtIostorinvdis::getIs_overdue, "0"), p -> (JSONObject) JSON.toJSON(p));
|
||||
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
JSONObject dis_row = dis_rows.get(i);
|
||||
String sect_code = dis_row.getString("sect_code");
|
||||
StIvtSectattr sect_jo = stIvtSectattrService.getByCode(sect_code);
|
||||
if (ObjectUtil.isEmpty(sect_jo)) {
|
||||
throw new BadRequestException("未查询到对应的库区!");
|
||||
}
|
||||
//如果是虚拟区的出库,直接把包装关系删除;如果为立库的包装关系,将解绑删除标识置为1。当发货区解绑时,删除包装关系
|
||||
String pcsn = dis_row.getString("pcsn");
|
||||
if ("09".equals(sect_jo.getSect_type_attr())) {
|
||||
subpackagerelationService.remove(new LambdaQueryWrapper<PdmBiSubpackagerelation>()
|
||||
.eq(PdmBiSubpackagerelation::getContainer_name, pcsn));
|
||||
} else {
|
||||
LambdaUpdateWrapper<PdmBiSubpackagerelation> subUpLam = new LambdaUpdateWrapper<>();
|
||||
subUpLam.set(PdmBiSubpackagerelation::getNeed_delete, "1")
|
||||
.eq(PdmBiSubpackagerelation::getContainer_name, pcsn);
|
||||
subpackagerelationService.update(subUpLam);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void issueTask(JSONObject whereJson) {
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
SchBaseTask jsonTask = ischBaseTaskService.getById(whereJson.getString("task_id"));
|
||||
|
||||
// 调用出库任务类下发任务
|
||||
new TwoOutTask().immediateNotifyAcs(jsonTask.getTask_id());
|
||||
|
||||
// 更新任务状态为下发
|
||||
jsonTask.setTask_status(TaskStatusEnum.ISSUE.getCode());
|
||||
jsonTask.setUpdate_optid(currentUserId);
|
||||
jsonTask.setUpdate_optname(nickName);
|
||||
jsonTask.setUpdate_time(now);
|
||||
ischBaseTaskService.updateById(jsonTask);
|
||||
}
|
||||
|
||||
private void doLikeOrInParam(OutManageParam paramMap) {
|
||||
if (StrUtil.isNotEmpty(paramMap.getVbeln())){
|
||||
if (StrUtil.isNotEmpty(paramMap.getVbeln())) {
|
||||
// 判断是否有空格
|
||||
boolean matches = paramMap.getVbeln().matches(".*\\s.*");
|
||||
List<String> vbelnList = new ArrayList<>();
|
||||
@@ -323,7 +1207,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
paramMap.setVbeln("");
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotEmpty(paramMap.getBox_no())){
|
||||
if (StrUtil.isNotEmpty(paramMap.getBox_no())) {
|
||||
// 判断是否有空格
|
||||
boolean matches = paramMap.getBox_no().matches(".*\\s.*");
|
||||
List<String> boxList = new ArrayList<>();
|
||||
@@ -334,7 +1218,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
paramMap.setBox_no("");
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotEmpty(paramMap.getPcsn())){
|
||||
if (StrUtil.isNotEmpty(paramMap.getPcsn())) {
|
||||
// 判断是否有空格
|
||||
boolean matches = paramMap.getPcsn().matches(".*\\s.*");
|
||||
List<String> pcsnList = new ArrayList<>();
|
||||
@@ -345,7 +1229,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
paramMap.setPcsn("");
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotEmpty(paramMap.getSap_pcsn())){
|
||||
if (StrUtil.isNotEmpty(paramMap.getSap_pcsn())) {
|
||||
// 判断是否有空格
|
||||
boolean matches = paramMap.getSap_pcsn().matches(".*\\s.*");
|
||||
List<String> pcsnList = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user