This commit is contained in:
linfso 2024-06-19 22:44:32 +08:00
parent 15891edbcb
commit 6e67a0b187
5 changed files with 85 additions and 5 deletions

View File

@ -67,6 +67,7 @@ public class EmisWarehouseInController extends EmisBaseController
public TableDataInfo listSimple(EmisWarehouseIn emisWarehouseIn)
{
startPage();
emisWarehouseIn.setUsedStatus("0");
List<EmisWarehouseIn> list = emisWarehouseInService.selectEmisWarehouseInList(emisWarehouseIn);
return getDataTable(list);
}

View File

@ -67,4 +67,11 @@ public interface EmisWarehouseInMapper extends BaseMapper<EmisWarehouseIn>
* @return 结果
*/
public int deleteEmisWarehouseInByIds(Long[] ids);
/**
* 改变使用状态
* @param emisWarehouseIn
* @return
*/
public int changeUseStatus(EmisWarehouseIn emisWarehouseIn);
}

View File

@ -152,11 +152,16 @@ public class EmisBaseService {
@Autowired
private EmisSiteSettleRecordMapper emisSiteSettleRecordMapper;
@Autowired
private EmisWarehouseInMapper emisWarehouseInMapper;
@Autowired
RedissonService redissonService;
/**
* 判断获取主单号
* @param billCode
@ -428,6 +433,47 @@ public class EmisBaseService {
}
/**
* 占用进仓单号
* @param oldWarehouseInNo 历史占用
* @param newWarehouseInNo 新占用
*/
public void useWarehouseInNo(String billCode,String oldWarehouseInNo,String newWarehouseInNo){
// 解除历史占用
if(!StringUtils.isEmpty(oldWarehouseInNo)){
EmisWarehouseIn emisWarehouseIn = new EmisWarehouseIn();
emisWarehouseIn.setBillCode(billCode);
String[] oldWarehouseInNoArr = oldWarehouseInNo.split(",");
if(oldWarehouseInNoArr.length>0){
for (String oldInNo:oldWarehouseInNoArr) {
emisWarehouseIn.setInNo(oldInNo);
emisWarehouseIn.setUsedStatus("0");
emisWarehouseInMapper.changeUseStatus(emisWarehouseIn);
}
}
}
// 占用新单号
if(!StringUtils.isEmpty(newWarehouseInNo)){
EmisWarehouseIn emisWarehouseIn = new EmisWarehouseIn();
emisWarehouseIn.setBillCode(billCode);
String[] newWarehouseInNoNoArr = newWarehouseInNo.split(",");
if(newWarehouseInNoNoArr.length>0){
for (String newInNo:newWarehouseInNoNoArr) {
emisWarehouseIn.setInNo(newInNo);
emisWarehouseIn.setUsedStatus("1");
emisWarehouseInMapper.changeUseStatus(emisWarehouseIn);
}
}
}
}
/**
* 发送短息
* @param emisSmsSendRecord

View File

@ -888,6 +888,14 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
}
}
// 占用进仓单号
if(!StringUtils.isEmpty(emisWaybillSave.getWarehouseInNo())) {
String warehouseInNo = WaybillHelper.formatQueryValue(emisWaybillSave.getWarehouseInNo());
useWarehouseInNo("",warehouseInNo);
}
// 插入揽收记录
ScanInfo scanInfo = new ScanInfo();
List<Map<String,Object>> scanDataList = new ArrayList<>();

View File

@ -32,14 +32,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="serialNo != null and serialNo != ''"> and serial_no like concat('%', #{serialNo}, '%')</if>
<if test="inNo != null and inNo != ''"> and in_no like concat('%', #{inNo}, '%')</if>
<if test="orderSn != null and orderSn != ''"> and order_sn like concat('%', #{orderSn}, '%')</if>
<if test="billCode != null and billCode != ''"> and bill_code like concat('%', #{billCode}, '%')</if>
<if test="customerCode != null and customerCode != ''"> and customer_code like concat('%', #{customerCode}, '%')</if>
<if test="billCode != null and billCode != ''"> and bill_code=#{billCode}</if>
<if test="customerCode != null and customerCode != ''"> and customer_code=#{customerCode}</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="entryDate != null "> and entry_date = #{entryDate}</if>
<if test="confirmStatus != null and confirmStatus != ''"> and confirm_status like concat('%', #{confirmStatus}, '%')</if>
<if test="confirmStatus != null and confirmStatus != ''"> and confirm_status=#{confirmStatus}</if>
<if test="confirmDate != null "> and confirm_date = #{confirmDate}</if>
<if test="usedStatus != null and usedStatus != ''"> and used_status like concat('%', #{usedStatus}, '%')</if>
<if test="status != null and status != ''"> and status like concat('%', #{status}, '%')</if>
<if test="usedStatus != null and usedStatus != ''"> and used_status= #{usedStatus}</if>
<if test="status != null and status != ''"> and status=#{status}</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="tenantId != null and tenantId != ''"> and tenant_id like concat('%', #{tenantId}, '%')</if>
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
@ -136,6 +136,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<update id="changeUseStatus" parameterType="EmisWarehouseIn">
update emis_warehouse_in
<trim prefix="SET" suffixOverrides=",">
<if test="usedStatus != null and usedStatus != ''">used_status = #{usedStatus},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim>
where bill_code = #{billCode} and in_no = #{inNo}
</update>
<update id="useInNo" parameterType="EmisWarehouseIn">
update emis_warehouse_in set used_status='1'
where bill_code = #{billCode} and in_no = #{inNo}
</update>
<delete id="deleteEmisWarehouseInById" parameterType="Long">
delete from emis_warehouse_in where id = #{id}
</delete>