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

View File

@ -30,4 +30,16 @@
select * from user_face where user_id = #{faceId}; select * from user_face where user_id = #{faceId};
</select> </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> </mapper>