修改sql

This commit is contained in:
qjq
2024-12-04 10:19:59 +08:00
parent 58eed54945
commit d742eabbcf
3 changed files with 15 additions and 9 deletions

View File

@ -110,4 +110,5 @@ public interface CardMapper extends BaseMapperX<CardDO> {
.reduce(BigDecimal.ZERO, BigDecimal::add);
}
int udpateEXit(@Param("orderIds") Collection<Long> orderIds,@Param("exit") Integer exit,@Param("num")String num);
}

View File

@ -389,10 +389,7 @@ public class BillingServiceImpl implements BillingService {
//设置同意人
updateObj.setSystemId(SecurityFrameworkUtils.getLoginUserId());
//拒绝就把锁住的订单释放掉
LambdaUpdateWrapper<CardDO> wrapper = new LambdaUpdateWrapper<>();
wrapper.in(CardDO::getId, orderIds);
wrapper.set(CardDO::getBillingExist, BillingStatusEnum.BILLING_INVOICING_IS_COMPLETE.getCode());
cardMapper.update(null, wrapper);
cardMapper.udpateEXit(orderIds,BillingStatusEnum.BILLING_INVOICING_IS_COMPLETE.getCode(),null);
}else{
//开票回拒
if(StrUtil.isBlank(updateObj.getRefuseDetails())){
@ -401,11 +398,7 @@ public class BillingServiceImpl implements BillingService {
updateObj.setStatus(BillingStatusEnum.BILLING_INVOICING_REJECTION.getCode());
updateObj.setRefuseTime(LocalDateTime.now());
//拒绝就把锁住的订单释放掉
LambdaUpdateWrapper<CardDO> wrapper = new LambdaUpdateWrapper<>();
wrapper.in(CardDO::getId, orderIds);
wrapper.set(CardDO::getBillingExist, BillingStatusEnum.BILLING_INVOICING_REJECTION.getCode());
wrapper.set(CardDO::getBillingNum,null);
cardMapper.update(null, wrapper);
cardMapper.udpateEXit(orderIds,BillingStatusEnum.BILLING_INVOICING_REJECTION.getCode(),"true");
}
billingMapper.updateById(updateObj);
}

View File

@ -30,4 +30,16 @@
select * from user_face where user_id = #{faceId};
</select>
<update id="udpateEXit">
UPDATE member_card
SET billing_exist = #{exit}
<if test="num != null and num != ''">
, billing_num = NULL
</if>
WHERE user_id IN
<foreach collection="orderIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>