This commit is contained in:
linfso 2024-06-20 00:13:05 +08:00
parent 3e03f11bf0
commit a8aad02f92
3 changed files with 27 additions and 9 deletions

View File

@ -69,9 +69,16 @@ public interface EmisWarehouseInMapper extends BaseMapper<EmisWarehouseIn>
public int deleteEmisWarehouseInByIds(Long[] ids); public int deleteEmisWarehouseInByIds(Long[] ids);
/** /**
* 改变使用状态 * 改变未使用状态
* @param emisWarehouseIn * @param emisWarehouseIn
* @return * @return
*/ */
public int changeUseStatus(EmisWarehouseIn emisWarehouseIn); public int changeUseStatusByUnUse(EmisWarehouseIn emisWarehouseIn);
/**
* 改变未使用状态
* @param emisWarehouseIn
* @return
*/
public int changeUseStatusByUse(EmisWarehouseIn emisWarehouseIn);
} }

View File

@ -449,8 +449,7 @@ public class EmisBaseService {
if(oldWarehouseInNoArr.length>0){ if(oldWarehouseInNoArr.length>0){
for (String oldInNo:oldWarehouseInNoArr) { for (String oldInNo:oldWarehouseInNoArr) {
emisWarehouseIn.setInNo(oldInNo); emisWarehouseIn.setInNo(oldInNo);
emisWarehouseIn.setUsedStatus("0"); emisWarehouseInMapper.changeUseStatusByUnUse(emisWarehouseIn);
emisWarehouseInMapper.changeUseStatus(emisWarehouseIn);
} }
} }
@ -465,8 +464,7 @@ public class EmisBaseService {
if(newWarehouseInNoNoArr.length>0){ if(newWarehouseInNoNoArr.length>0){
for (String newInNo:newWarehouseInNoNoArr) { for (String newInNo:newWarehouseInNoNoArr) {
emisWarehouseIn.setInNo(newInNo); emisWarehouseIn.setInNo(newInNo);
emisWarehouseIn.setUsedStatus("1"); emisWarehouseInMapper.changeUseStatusByUse(emisWarehouseIn);
emisWarehouseInMapper.changeUseStatus(emisWarehouseIn);
} }
} }

View File

@ -146,15 +146,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</update> </update>
<update id="changeUseStatus" parameterType="EmisWarehouseIn"> <update id="changeUseStatusByUse" parameterType="EmisWarehouseIn">
update emis_warehouse_in update emis_warehouse_in
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="usedStatus != null and usedStatus != ''">used_status = #{usedStatus},</if> bill_code = #{billCode},
used_status ='1',
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if> <if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
</trim> </trim>
where bill_code = #{billCode} and in_no = #{inNo} where in_no = #{inNo}
</update>
<update id="changeUseStatusByUnUse" parameterType="EmisWarehouseIn">
update emis_warehouse_in
<trim prefix="SET" suffixOverrides=",">
bill_code =null,
used_status ='0',
<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 in_no = #{inNo}
</update> </update>