Merge branch 'feature/mall_product' of http://117.33.142.185:3000/zenghuapei/cyywl_server into feature/mall_product

pull/2/head
js199000126 2023-05-25 18:12:11 +08:00
commit 656f0a6d50
8 changed files with 43 additions and 9 deletions

View File

@ -147,7 +147,7 @@ public class WxPayNotifyController {
//删除提报记录
phoneRecordService.deletePhoneGear(orderDO.getOrderId());
//删除本地提报记录
phoneRecordService.deletePhoneRecord(orderDO.getId());
phoneRecordService.deletePhoneGearByOrderId(orderDO.getId());
// 修改订单状态
// 写入
response.setStatus(HttpServletResponse.SC_OK);

View File

@ -1227,7 +1227,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
log.error("删除提报记录异常{}", e);
}
//删除本地提报记录
phoneRecordService.deletePhoneRecord(orderDO.getId());
phoneRecordService.deletePhoneGearByOrderId(orderDO.getId());
// 表示退款
} else {
// 表示支付

View File

@ -36,6 +36,7 @@ public interface PhoneRecordService {
*/
void deletePhoneRecord(Long id);
/**
*
*
@ -90,6 +91,16 @@ public interface PhoneRecordService {
* </pre>
*/
Boolean deletePhoneGear(String orderId);
/**
* <pre>
* <b>deletePhoneGear</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/5/24 12:44
* @return
* </pre>
*/
Boolean deletePhoneGearByOrderId(Long orderId);
/**
* <pre>
* <b>insertPhone</b>

View File

@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import java.util.*;
@ -76,12 +77,26 @@ public class PhoneRecordServiceImpl implements PhoneRecordService {
// 校验存在
validatePhoneRecordExists(id);
// 删除
phoneRecordMapper.delete(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, id));
phoneRecordMapper.deleteById(id);;
}
@Override
public Boolean deletePhoneGearByOrderId(Long orderId) {
log.info("-------------------------orderId{}",orderId);
List<PhoneRecordDO> recordDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, orderId));
log.info("-------------------------recordDOS{},{}",recordDOS,recordDOS.size());
if (!CollectionUtils.isEmpty(recordDOS)) {
recordDOS.forEach(e->{
e.setDeleted(Boolean.TRUE);
int i = phoneRecordMapper.updateById(e);
log.info("-------------------------i{}---------------------",i);
});
}
return null;
}
private void validatePhoneRecordExists(Long id) {
PhoneRecordDO phoneRecordDO = phoneRecordMapper.selectOne(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, id));
if (phoneRecordDO == null) {
if (phoneRecordMapper.selectById(id) == null) {
throw exception(PHONE_RECORD_NOT_EXISTS);
}
}

View File

@ -2,12 +2,15 @@ package cn.iocoder.yudao.module.shop.service.recharge;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO;
import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderInfoMapper;
import cn.iocoder.yudao.module.shop.request.member.RefundRequest;
import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -44,6 +47,10 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
private RechargeOrderMapper rechargeOrderMapper;
@Resource
private RechargeOrderInfoMapper infoMapper;
@Resource
private MemberUserApi userService;
@Resource
private PhoneRecordService phoneRecordService;
@Override
public Long createRechargeOrder(RechargeOrderCreateReqVO createReqVO) {
@ -151,7 +158,8 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
MemberHeadResponse response = new MemberHeadResponse();
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
Assert.notNull(loginUser, "登录失效,请重新登录!");
List<RechargeOrderDO> orderDOS = rechargeOrderMapper.selectList(Wrappers.<RechargeOrderDO>lambdaQuery().eq(RechargeOrderDO::getUid, loginUser.getId()).eq(RechargeOrderDO::getPaid, 1));
MemberUserRespDTO user = userService.getUser(loginUser.getId());
List<RechargeOrderDO> orderDOS = rechargeOrderMapper.selectList(Wrappers.<RechargeOrderDO>lambdaQuery().eq(RechargeOrderDO::getUserPhone, user.getMobile()).eq(RechargeOrderDO::getPaid, 1));
if (!CollectionUtils.isEmpty(orderDOS)) {
BigDecimal amount = new BigDecimal("0");
for (RechargeOrderDO orderDO : orderDOS) {

View File

@ -14,7 +14,7 @@
FROM
eb_shipping_templates_free
where
temp_id = #{tempId, jdbcType=INTEGER}
temp_id = #{tempId, jdbcType=INTEGER} AND `status` = true
GROUP BY
`uniqid`
ORDER BY id ASC

View File

@ -14,7 +14,7 @@
FROM
eb_shipping_templates_no_delivery
where
temp_id = #{tempId, jdbcType=INTEGER}
temp_id = #{tempId, jdbcType=INTEGER} AND `status` = true
GROUP BY
`uniqid`
ORDER BY id ASC

View File

@ -14,7 +14,7 @@
FROM
eb_shipping_templates_region
where
temp_id = #{tempId, jdbcType=INTEGER}
temp_id = #{tempId, jdbcType=INTEGER} AND `status` = true
GROUP BY
`uniqid`
ORDER BY id ASC