Authored by caoyan

寄存转现货

... ... @@ -101,8 +101,10 @@ public interface StorageDepositMapper {
StorageDeposit selectByNewOrderCode(@Param("uid")Integer uid, @Param("depositCode")String depositCode, @Param("newOrderCode") Long newOrderCode);
int updateValidStatus(@Param("id")Integer id);
int updateValidStatus(@Param("id")Integer id, @Param("status") Integer status, @Param("preStatus")Integer preStatus);
int updateSellLock(@Param("id")Integer id, @Param("sellLock")Integer sellLock, @Param("preSellLock")Integer preSellLock);
int updateToNotBindShelfCode(@Param("id")Integer id, @Param("status") Integer status, @Param("preStatus")Integer preStatus);
}
\ No newline at end of file
... ...
... ... @@ -273,10 +273,10 @@
limit 1
</select>
<update id="updateValidStatus" parameterType="java.lang.Integer">
<update id="updateValidStatus">
update storage_deposit
set del_status=0, update_time = unix_timestamp(now()), new_order_code = 0
where id=#{id} and del_status=1
set del_status=0, update_time = unix_timestamp(now()), new_order_code = 0, status=#{status}
where id=#{id} and del_status=1 and status=#{preStatus}
</update>
<update id="updateSellLock">
... ... @@ -287,4 +287,10 @@
AND del_status = 0
</update>
<update id="updateToNotBindShelfCode">
update storage_deposit
set shelf_code='', del_status=0, update_time = unix_timestamp(now()), new_order_code = 0, status=#{status}
where id=#{id} and del_status=1 and status=#{preStatus}
</update>
</mapper>
\ No newline at end of file
... ...
... ... @@ -856,8 +856,13 @@ public class DepositServiceImpl implements DepositService {
if(num > 0) {
//找到寄存转现货前的寄存记录
StorageDeposit oldDeposit = storageDepositMapper.selectByNewOrderCode(uid, depositCode, deposit.getOrderCode());
//还原,将新订单号清空
num = storageDepositMapper.updateValidStatus(oldDeposit.getId());
if(deposit.getStatus().equals(StorageDepositStatusEnum.WAITING_QUERY.getCode())) {//待拣货状态
//还原,将新订单号清空
num = storageDepositMapper.updateValidStatus(oldDeposit.getId(), StorageDepositStatusEnum.HAS_IN.getCode(), StorageDepositStatusEnum.HAS_IN.getCode());
}else if(deposit.getStatus().equals(StorageDepositStatusEnum.WAITING_OUT.getCode()) //待出库
|| deposit.getStatus().equals(StorageDepositStatusEnum.HAS_OUT.getCode())){//已发货
num = storageDepositMapper.updateToNotBindShelfCode(oldDeposit.getId(), StorageDepositStatusEnum.WAITING_IN.getCode(), StorageDepositStatusEnum.HAS_IN.getCode());
}
}
//清缓存
... ...