This commit is contained in:
linfso 2025-01-01 15:03:42 +08:00
parent 5030c190ad
commit 9b462967e2
6 changed files with 86 additions and 17 deletions

View File

@ -105,6 +105,9 @@ public class EmisCommonController extends EmisBaseController
@Autowired
private ISysNoticeService sysNoticeService;
@Autowired
private IEmisWarehouseInBatchService emisWarehouseInBatchService;
@ -1020,6 +1023,20 @@ public class EmisCommonController extends EmisBaseController
}
}
@Log(title = "重新计算入仓重量状态", businessType = BusinessType.UPDATE)
@RequestMapping("/reCalcWareHouseInTotalInfo")
public void reCalcWareHouseInTotalInfo(String settleBillNo) {
try{
emisWarehouseInBatchService.reCalcWareHouseInTotalInfo(settleBillNo);
}
catch (Exception ex){
ex.printStackTrace();
}
}
/**
* 重新计算账单开票状态
* @param settleBillNo

View File

@ -63,10 +63,6 @@ public class EmisWarehouseIn extends BaseEntity
private String status;
/* 0-未入仓 1-已入仓 */
private String stockInFlag;
// --------- 扩展参数
private EmisWaybill waybillDetail;
/* 总件数 */
private Integer totalParcelQty;
/* 总体积 */
@ -74,7 +70,9 @@ public class EmisWarehouseIn extends BaseEntity
/* 总重量 */
private BigDecimal totalWeight;
// --------- 扩展参数
private EmisWaybill waybillDetail;
// 入仓批次信息
private List<EmisWarehouseInBatch> stockInBatchList;
}

View File

@ -88,5 +88,5 @@ public interface EmisWarehouseInMapper extends BaseMapper<EmisWarehouseIn>
public int changeUseStatusByUse(EmisWarehouseIn emisWarehouseIn);
public int updateHasStockInFlag(String inNo);
public int updateTotalWeightInfo(EmisWarehouseIn emisWarehouseIn);
}

View File

@ -52,6 +52,13 @@ public interface IEmisWarehouseInBatchService
*/
public int updateEmisWarehouseInBatch(EmisWarehouseInBatch emisWarehouseInBatch);
/**
* 重新计算总重量和总体积
* @param inNo
*/
public void reCalcWareHouseInTotalInfo(String inNo);
/**
* 批量删除进仓单批次
*

View File

@ -134,17 +134,50 @@ public class EmisWarehouseInBatchServiceImpl extends EmisBaseService implements
}
// 重新计算入仓状态
this.reCalcWareHouseIn(emisWarehouseInBatch.getInNo());
this.reCalcWareHouseInTotalInfo(emisWarehouseInBatch.getInNo());
return 1;
}
// 重新计算总重量,总件数,总体积
private void reCalcWareHouseIn(String inNo){
EmisWarehouseIn emisWarehouseIn=emisWarehouseInMapper.selectEmisWarehouseInByInNo(inNo);
@Override
public void reCalcWareHouseInTotalInfo(String inNo){
// 获取入库列表
List<EmisWarehouseInBatch> batchList=emisWarehouseInBatchMapper.selectInBatchListByInNo(inNo);
// 累加数据
BigDecimal totalAllWeight = BigDecimal.ZERO;
BigDecimal totalAllVolume = BigDecimal.ZERO;
Integer totalAllParcelQty = 0;
if(!CollectionUtils.isEmpty(batchList)){
for (EmisWarehouseInBatch emisWarehouseInBatch:batchList) {
BigDecimal billWeight=emisWarehouseInBatch.getBillWeight();
BigDecimal totalVolume=emisWarehouseInBatch.getTotalVolume();
Integer parcelQty=emisWarehouseInBatch.getParcelQty();
if(billWeight!=null) {
totalAllWeight = totalAllWeight.add(billWeight);
}
if(totalVolume!=null) {
totalAllVolume = totalAllVolume.add(totalVolume);
}
if(parcelQty!=null) {
totalAllParcelQty = totalAllParcelQty+parcelQty;
}
}
}
EmisWarehouseIn emisWarehouseIn = new EmisWarehouseIn();
emisWarehouseIn.setTotalWeight(totalAllWeight);
emisWarehouseIn.setTotalVolume(totalAllVolume);
emisWarehouseIn.setTotalParcelQty(totalAllParcelQty);
emisWarehouseIn.setInNo(inNo);
// 更新入库状态
emisWarehouseInMapper.updateHasStockInFlag(inNo);
emisWarehouseInMapper.updateTotalWeightInfo(emisWarehouseIn);
}
/**

View File

@ -18,6 +18,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="usedStatus" column="used_status" />
<result property="status" column="status" />
<result property="stockInFlag" column="stock_in_flag" />
<result property="totalParcelQty" column="total_parcel_qty" />
<result property="totalVolume" column="total_volume" />
<result property="totalWeight" column="total_weight" />
</resultMap>
@ -40,11 +43,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectEmisWarehouseInVo">
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, stock_in_flag, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_warehouse_in
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, stock_in_flag, total_parcel_qty, total_volume, total_weight, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_warehouse_in
</sql>
<select id="selectEmisWarehouseInListByOms" parameterType="EmisWarehouseIn" resultMap="EmisWarehouseInResult">
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, stock_in_flag, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, stock_in_flag, total_parcel_qty, total_volume, total_weight, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_warehouse_in a
<where>
del_flag='0'
@ -112,7 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectEmisWarehouseInList" parameterType="EmisWarehouseIn" resultMap="EmisWarehouseInResult">
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, stock_in_flag, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, stock_in_flag, total_parcel_qty, total_volume, total_weight, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_warehouse_in a
<where>
del_flag='0'
@ -226,13 +229,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectEmisWarehouseInById" parameterType="Long" resultMap="EmisWarehouseInResult">
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, stock_in_flag, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, stock_in_flag, total_parcel_qty, total_volume, total_weight, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_warehouse_in a
where a.id = #{id}
</select>
<select id="selectEmisWarehouseInByInNo" parameterType="String" resultMap="EmisWarehouseInResult">
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, stock_in_flag, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
select id, serial_no, in_no, order_sn, bill_code, customer_code, customer_name, entry_date, confirm_status, confirm_date, used_status, status, stock_in_flag, total_parcel_qty, total_volume, total_weight, remark, tenant_id, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_warehouse_in a
where a.in_no = #{inNo} limit 1
</select>
@ -252,6 +255,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="usedStatus != null and usedStatus != ''">used_status,</if>
<if test="status != null and status != ''">status,</if>
<if test="stockInFlag != null and stockInFlag != ''">stock_in_flag,</if>
<if test="totalParcelQty != null">total_parcel_qty,</if>
<if test="totalVolume != null">total_volume,</if>
<if test="totalWeight != null">total_weight,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
@ -275,6 +281,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="usedStatus != null and usedStatus != ''">#{usedStatus},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="stockInFlag != null and stockInFlag != ''">#{stockInFlag},</if>
<if test="totalParcelQty != null">#{totalParcelQty},</if>
<if test="totalVolume != null">#{totalVolume},</if>
<if test="totalWeight != null">#{totalWeight},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
@ -302,6 +311,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="usedStatus != null and usedStatus != ''">used_status = #{usedStatus},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="stockInFlag != null and stockInFlag != ''">stock_in_flag = #{stockInFlag},</if>
<if test="totalParcelQty != null">total_parcel_qty = #{totalParcelQty},</if>
<if test="totalVolume != null">total_volume = #{totalVolume},</if>
<if test="totalWeight != null">total_weight = #{totalWeight},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
@ -339,8 +351,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where in_no = #{inNo}
</update>
<update id="updateHasStockInFlag" parameterType="String">
update emis_warehouse_in set stock_in_flag = '1' where in_no = #{inNo}
<update id="updateTotalWeightInfo" parameterType="EmisWarehouseIn">
update emis_warehouse_in
set stock_in_flag = '1',total_parcel_qty=#{totalParcelQty},total_volume=#{totalVolume},total_weight=#{totalWeight}
where in_no = #{inNo}
</update>
<update id="useInNo" parameterType="EmisWarehouseIn">