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

pull/16/head
TianYu 2023-05-23 11:27:26 +08:00
commit ec8c740a3b
10 changed files with 107 additions and 39 deletions

View File

@ -1,9 +1,11 @@
package cn.iocoder.yudao.module.shop.response.order;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
@ -85,6 +87,8 @@ public class StoreOrderDetailInfoResponse implements Serializable {
private String payType;
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@Schema(description = "订单状态0待发货1待收货2已收货待评价3已完成")

View File

@ -52,6 +52,8 @@ import cn.iocoder.yudao.module.shop.utils.RedisUtil;
import cn.iocoder.yudao.module.shop.vo.order.LogisticsResultVo;
import cn.iocoder.yudao.module.shop.vo.order.StoreDateRangeSqlPram;
import cn.iocoder.yudao.module.shop.vo.order.StoreOrderInfoOldVo;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import com.alipay.api.AlipayApiException;
import com.alipay.api.internal.util.AlipaySignature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -147,6 +149,8 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
@Autowired
private WxMpService wxMpService;
private DeptApi deptApi;
/**
* PC
*
@ -1360,6 +1364,12 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
private RechargeOrderDO initializeOrder(OrderContentRequest request, String code, MemberUserRespDTO user, PromoterDTO promoterDTO) {
Long tenantId = TenantContextHolder.getTenantId();
Long deptId = promoterDTO.getDeptId();
if(deptId==null){
DeptRespDTO deptRespDTO = deptApi.findParentDept(tenantId);
deptId = deptRespDTO.getId();
}
RechargeOrderDO orderDO = new RechargeOrderDO();
List<OrderContentRequest.OrderInfo> orderInfos = request.getOrderInfos();
orderDO.setOrderId(code);

View File

@ -107,11 +107,7 @@ public class RechargeGearServiceImpl implements RechargeGearService {
List<RechargeGearDO> rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.<RechargeGearDO>lambdaQuery()
.eq(RechargeGearDO::getDeleted, 0));
List<RechargeGearRespVO> rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS);
RechargeOrderDO orderDO = orderMapper.selectOne(Wrappers.<RechargeOrderDO>lambdaQuery().eq(RechargeOrderDO::getUid, loginUser.getId())
.eq(RechargeOrderDO::getPaid,1)
.last("LIMIT 1"));
if (Objects.nonNull(orderDO)) {
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, orderDO.getId()));
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getUserId, loginUser.getId()));
Map<Long, List<PhoneRecordDO>> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId));
rechargeGearRespVOS.forEach(vo -> {
List<PhoneRecordDO> infoDOS1 = collect.get(vo.getId());
@ -121,7 +117,6 @@ public class RechargeGearServiceImpl implements RechargeGearService {
vo.setIsExist("0");
}
});
}
return rechargeGearRespVOS;
}
@ -130,11 +125,7 @@ public class RechargeGearServiceImpl implements RechargeGearService {
List<RechargeGearDO> rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.<RechargeGearDO>lambdaQuery()
.eq(RechargeGearDO::getDeleted, 0));
List<RechargeGearRespVO> rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS);
RechargeOrderDO orderDO = orderMapper.selectOne(Wrappers.<RechargeOrderDO>lambdaQuery().eq(RechargeOrderDO::getUserPhone, phone)
.eq(RechargeOrderDO::getPaid,1)
.last("LIMIT 1"));
if (Objects.nonNull(orderDO)) {
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, orderDO.getId()));
List<PhoneRecordDO> infoDOS = phoneRecordMapper.selectList(Wrappers.<PhoneRecordDO>lambdaQuery().eq(PhoneRecordDO::getPhone, phone));
Map<Long, List<PhoneRecordDO>> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId));
rechargeGearRespVOS.forEach(vo -> {
List<PhoneRecordDO> infoDOS1 = collect.get(vo.getId());
@ -144,7 +135,6 @@ public class RechargeGearServiceImpl implements RechargeGearService {
vo.setIsExist("0");
}
});
}
return rechargeGearRespVOS;
}

View File

@ -33,6 +33,7 @@
left join system_dept d on d.id = a.dept_id
<include refid="baseWhere">
</include>
order by a.pay_time desc
</select>
<select id="findListPage" resultType="cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO">
select

View File

@ -116,7 +116,7 @@ public class AppUserController {
List<UserSpreadBannerVO> list = new ArrayList<>();
UserSpreadBannerVO userSpreadBannerVO = new UserSpreadBannerVO();
userSpreadBannerVO.setId(1);
userSpreadBannerVO.setPic("http://192.168.1.147:48080/admin-api/infra/file/4/get/431efea27162d536d35f7b3c0b844ede98a6ba58f4fd72ac7181e7ee5ebae77a.jpg");
userSpreadBannerVO.setPic("http://image.cyywl.top/431efea27162d536d35f7b3c0b844ede98a6ba58f4fd72ac7181e7ee5ebae77a.jpg");
userSpreadBannerVO.setTitle("推广背景图");
list.add(userSpreadBannerVO);
return CommonResult.success(list);

View File

@ -48,6 +48,18 @@ public interface DeptApi {
*/
void validateDeptList(Collection<Long> ids);
/**
* <pre>
* <b>findParentDept</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/5/23 09:38
* @param :
* @return
* </pre>
*/
DeptRespDTO findParentDept(Long tenantId);
/**
* Map
*

View File

@ -38,6 +38,22 @@ public class DeptApiImpl implements DeptApi {
List<DeptDO> depts = deptService.getDeptList(new DeptListReqVO());
return DeptConvert.INSTANCE.convertList03(depts);
}
/**
* <pre>
* <b>findParentDept</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/5/23 09:38
* @return
* </pre>
*/
@Override
public DeptRespDTO findParentDept(Long tenantId) {
DeptDO deptDO = deptService.findParentDept(tenantId );
return DeptConvert.INSTANCE.convert03(deptDO);
}
@Override
public void validateDeptList(Collection<Long> ids) {
deptService.validateDeptList(ids);

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.service.dept;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO;
@ -54,6 +55,18 @@ public interface DeptService {
*/
List<DeptDO> getDeptList(DeptListReqVO reqVO);
/**
* <pre>
* <b>findParentDept</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/5/23 09:40
* @param tenantId:
* @return
* </pre>
*/
DeptDO findParentDept(Long tenantId);
/**
*
*

View File

@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO;
@ -13,6 +14,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.dept.DeptMapper;
import cn.iocoder.yudao.module.system.enums.dept.DeptIdEnum;
import cn.iocoder.yudao.module.system.mq.producer.dept.DeptProducer;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
@ -152,6 +154,26 @@ public class DeptServiceImpl implements DeptService {
return deptMapper.selectList(reqVO);
}
/**
* <pre>
* <b>findParentDept</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/5/23 09:40
* @param tenantId :
* @return
* </pre>
*/
@Override
public DeptDO findParentDept(Long tenantId) {
List<DeptDO> deptDOs = deptMapper.selectList(Wrappers.lambdaQuery(DeptDO.class).eq(DeptDO::getParentId,DeptIdEnum.ROOT.getId()).eq(DeptDO::getTenantId,tenantId));
if(deptDOs!=null && deptDOs.size() > 0){
return deptDOs.get(0);
}
return null;
}
@Override
public List<DeptDO> getDeptListByParentIdFromCache(Long parentId, boolean recursive) {
if (parentId == null) {

View File

@ -151,8 +151,8 @@ wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-sta
database: 16 # 数据库索引
password: cyywl123.. # 密码,建议生产环境开启
# 公众号配置(必填)
app-id: wx041349c6f39b268b
secret: 5abee519483bc9f8cb37ce280e814bd0
app-id: wx7e503d9cded34c07
secret: 31883ca14e2cbac8610d30f8f945ee47
# 存储配置,解决 AccessToken 的跨节点的共享
config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis会自动从 Spring 中获取
@ -168,16 +168,16 @@ wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-sta
pay:
one:
enabled: true
app-id: wxb1826c88da21d81e
mch-id: 1641993417
app-id: wx7e503d9cded34c07
mch-id: 1641073271
mch-key: qdn2I7Cmx4JeiKOt2CDjiu6UHgLTsOsM
apiv3-key: cyywl666666cyywl888888cyywl66666
apiv3-key: cyywl123456cyywl654321cyywl12345
private-cert-path: classpath:/1/apiclient_cert.pem
private-key-path: classpath:/1/apiclient_key.pem
key-path: classpath:/1/apiclient_cert.p12
cert-serial-no: 58FDB503F92B6C0E258C9940BB726C2BF6022E56
notify-url: http://api.cyywl.top/app-api/pay/wxpay/pay_notify
refund-notify-url: http://api.cyywl.top/app-api/pay/wxpay/refund_notify
cert-serial-no: 7F76A4ADC52CA0B440C4E5698F8A5CD1633A0FCD
notify-url: http://api.cyywl.top/admin-api/notify/wxpay/pay_notify
refund-notify-url: http://api.cyywl.top/admin-api/notify/wxpay/refund_notify
two:
enabled: true
app-id: wxb1826c88da21d81e