Browse Source

fix card

release_toaliyun_real
lin 3 years ago
parent
commit
693c96cf64
9 changed files with 83 additions and 10 deletions
  1. +4
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCouponOrder.java
  3. +1
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java
  4. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java
  5. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java
  6. +36
    -7
      mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java
  7. +5
    -0
      mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
  8. +17
    -2
      mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml
  9. +12
    -0
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml

+ 4
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxCardInfo.java View File

@@ -36,9 +36,12 @@ public class WxCardInfo extends TenantEntity {
private Long couponId;
@io.swagger.annotations.ApiModelProperty(value = "购买用户ID", name = "cUserId")
private Long cUserId;
@TableField(exist = false)
private List<Long> cUserIdList;
@io.swagger.annotations.ApiModelProperty(value = "持有用户ID", name = "cUserId")
private Long ownerUserId;
@TableField(exist = false)
private List<Long> ownerUserIdList;
@io.swagger.annotations.ApiModelProperty(value="微信订单号-购买类储值卡时的订单号",name="transactionId")
private String transactionId;
@io.swagger.annotations.ApiModelProperty(value="面额总金额",name="amount")


+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCouponOrder.java View File

@@ -54,6 +54,8 @@ public class WxCouponOrder extends TenantEntity {
private Date expiredTime;
@io.swagger.annotations.ApiModelProperty(value = "状态:0-待使用 1-已核销 2-已过期 3-已作废 4-卡使用中 5-卡已过期 6-卡已用完 7-卡已线下退款 100-预核销", name = "couponOrderStatus")
private Integer couponOrderStatus;
@TableField(exist = false)
private List<Integer> couponOrderStatusList;
@io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createDate")
private Date createDate;
@io.swagger.annotations.ApiModelProperty(value = "创建时间数值,供查询优化用", name = "createDateTimes")


+ 1
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java View File

@@ -17,6 +17,7 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> {
WxCouponOrder selectById(@Param("id")Long id,@Param("tenantId")String tenantId);
List<WxCouponOrder> findList(WxCouponOrder wxCouponOrder);
List<Long> findIdList(WxCouponOrder wxCouponOrder);

List<WxCouponOrder> findListOfOrderedByDate(Map dateMap);
List<WxCouponOrder> findListOfVerifiedByDate(Map dateMap);


+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java View File

@@ -46,6 +46,7 @@ public interface WxCUserBasicInfoService {
PageInfo<WxCUserBasicInfo> listAsPage(WxCUserBasicInfo record, Integer pageIndex, Integer pageSize);
List<WxCUserBasicInfo> listPhoneAndNameByIds(WxCUserBasicInfo record);
List<Long> findIdList(WxCUserBasicInfo record);

Map<Long,WxCUserBasicInfo> getUserMap(TenantEntity tenantEntity, List<Long> cUserIdList);
/**


+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java View File

@@ -1333,5 +1333,10 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
}
return null;
}

@Override
public List<Long> findIdList(WxCUserBasicInfo record) {
return wxCUserBasicInfoMapper.findIdList(record);
}
}


+ 36
- 7
mallinkService/src/main/java/com/iformall/service/impl/WxCardInfoServiceImpl.java View File

@@ -1,5 +1,6 @@
package com.iformall.service.impl;

import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.common.IdWorker;
@@ -16,6 +17,7 @@ import com.iformall.domain.vo.WxCouponPasswordVo;
import com.iformall.enums.EnumCardInfoType;
import com.iformall.enums.EnumCouponPasswordStatus;
import com.iformall.enums.EnumCouponPasswordSupport;
import com.iformall.enums.EnumCouponType;
import com.iformall.enums.EnumYesOrNo;
import com.iformall.mapper.WxCardInfoMapper;
import com.iformall.mapper.WxCouponChannelMapper;
@@ -77,7 +79,7 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {

@Override
public PageInfo<WxCardVo> listAsPage(WxCardVo record, Integer pageIndex, Integer pageSize) {
handleCouponOnlineEndDate(record);
handleQueryParam(record);
PageInfo<WxCardInfo> cardInfoPage = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardInfoMapper.findList(record));
PageInfo<WxCardVo> pageInfo = new PageInfo<WxCardVo>();
pageInfo.setList(handleToCardVoList(cardInfoPage.getList(),record));
@@ -88,7 +90,7 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {
return pageInfo;
}
private List<WxCardVo> handleToCardVoList(List<WxCardInfo> list,TenantEntity tenantEntity) {
private List<WxCardVo> handleToCardVoList(List<WxCardInfo> list,WxCardVo record) {
if (null != list && list.size() > 0) {
List<Long> couponIdList = new ArrayList<Long>();
List<Long> userIdList = new ArrayList<Long>();
@@ -112,7 +114,7 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {
Map<Long,WxCoupon> couponMap = new HashMap<Long,WxCoupon>();
if (couponIdList.size() > 0 ) {
WxCoupon couponQ = new WxCoupon();
couponQ.updateTenantInfo(tenantEntity);
couponQ.updateTenantInfo(record);
couponQ.setIds(couponIdList);
List<WxCoupon> couponList = wxCouponMapper.findList(couponQ);
if (null != couponList && couponList.size() > 0) {
@@ -127,7 +129,7 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {
if (userIdList.size() > 0) {
WxCUserBasicInfo cUserBasicInfoQ = new WxCUserBasicInfo();
cUserBasicInfoQ.setIds(userIdList);
cUserBasicInfoQ.setFinalTenantId(tenantEntity.getFinalTenantId());
cUserBasicInfoQ.setFinalTenantId(record.getFinalTenantId());
List<WxCUserBasicInfo> cuserList = wxCUserBasicInfoService.listPhoneAndNameByIds(cUserBasicInfoQ);
if (null != cuserList) {
for (int i = 0 ; i < cuserList.size() ; i++) {
@@ -140,7 +142,7 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {
Map<Long,WxCouponOrder> couponOrderMap = new HashMap<Long,WxCouponOrder>();
if (cardIdList.size() > 0 ) {
WxCouponOrder couponOrderQ = new WxCouponOrder();
couponOrderQ.updateTenantInfo(tenantEntity);
couponOrderQ.updateTenantInfo(record);
couponOrderQ.setIds(cardIdList);
List<WxCouponOrder> couponOrderList = wxCouponOrderMapper.findList(couponOrderQ);
if (null != couponOrderList) {
@@ -228,14 +230,14 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {

@Override
public void exportData(WxCardVo record, HttpServletRequest request, HttpServletResponse response) {
handleCouponOnlineEndDate(record);
handleQueryParam(record);
List<WxCardInfo> cardInfoList = wxCardInfoMapper.findList(record);
List<WxCardVo> list = this.handleToCardVoList(cardInfoList,record);
excelService.exportExcel(list, null, "卡订单", WxCardVo.class, "卡订单.xlsx", response, false);

}

private void handleCouponOnlineEndDate(WxCardVo record){
private void handleQueryParam(WxCardVo record){
if (null != record.getCouponOnlineStartDate() || null != record.getCouponOnlineEndDate() ) {
WxCouponChannel wxCouponChannelQ = new WxCouponChannel();
wxCouponChannelQ.updateTenantInfo(record);
@@ -248,6 +250,33 @@ public class WxCardInfoServiceImpl implements WxCardInfoService {
record.setCouponIdList(ccIds);
}
}
if ((null != record.getStatusS() && record.getStatusS().size() > 0 ) || null != record.getStatus()) {
WxCouponOrder couponOrderQ = new WxCouponOrder();
couponOrderQ.updateTenantInfo(record);
couponOrderQ.setCouponOrderStatusList(record.getStatusS());
couponOrderQ.setCouponOrderStatus(record.getStatus());
couponOrderQ.setCouponType(EnumCouponType.CARD_MULTIMCH.getCode());
List<Long> orderIdList = wxCouponOrderMapper.findIdList(couponOrderQ);
if (null != orderIdList && orderIdList.size() > 0 ) {
record.setIds(orderIdList);
}else {
record.setId(-999L);
}
}
if (StringUtils.isNotBlank(record.getOuPhone()) || StringUtils.isNotBlank(record.getOnickName())) {
WxCUserBasicInfo userQ = new WxCUserBasicInfo();
userQ.setFinalTenantId(record.getFinalTenantId());
userQ.setPhone(StringUtils.trimToNull(record.getOuPhone()));
userQ.setNickName(StringUtils.trimToNull(record.getOnickName()));
List<Long> userIdList = wxCUserBasicInfoService.findIdList(userQ);
if (null != userIdList && userIdList.size() > 0 ) {
record.setOwnerUserIdList(userIdList);
}else {
record.setId(-999L);
}
}
}

@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})


+ 5
- 0
mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml View File

@@ -101,6 +101,11 @@
<if test=" null != name ">
and wcubi.`name` like concat('%', #{name},'%')
</if>
<if test=" null != nickName ">
and wcubi.`nick_name` like concat('%', #{nickName},'%')
</if>
<if test=" null != startTime and null != endTime">
and wcubi.`create_date` between #{startTime} and #{endTime}
</if>


+ 17
- 2
mallinkService/src/main/resources/mapper/WxCardInfoMapper.xml View File

@@ -85,8 +85,11 @@
<if test=" null != couponPassword">
and `coupon_password` like concat('%',#{couponPassword},'%')
</if>
<if test=" null != startdate and null!=enddate">
and `create_date` between #{startdate} and #{enddate}
<if test=" null != startdate ">
and `create_date` &gt;= #{startdate}
</if>
<if test=" null != enddate">
and `create_date` &lt;= #{enddate}
</if>
<if test=" null != couponPasswordIdList ">
and coupon_password_id in
@@ -100,6 +103,18 @@
#{cidItem}
</foreach>
</if>
<if test=" null != cUserIdList ">
and c_user_id in
<foreach collection="cUserIdList" index="index" item="cuidItem" open="(" separator="," close=")">
#{cuidItem}
</foreach>
</if>
<if test=" null != ownerUserIdList ">
and owner_user_id in
<foreach collection="ownerUserIdList" index="index" item="ouidItem" open="(" separator="," close=")">
#{ouidItem}
</foreach>
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">


+ 12
- 0
mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml View File

@@ -151,6 +151,13 @@
and `shipping_status` = #{shippingStatus}
</if>

<if test=" null != couponOrderStatusList ">
and coupon_order_status in
<foreach collection="couponOrderStatusList" index="index" item="cosidItem" open="(" separator="," close=")">
#{cosidItem}
</foreach>
</if>

<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
@@ -169,6 +176,11 @@
<include refid="dynamicWhereConditions" />
</select>
<select id="findIdList" parameterType="com.iformall.domain.po.WxCouponOrder" resultType="Long">
select id from wx_coupon_order
<include refid="dynamicWhereConditions" />
</select>
<select id="findListOfVerifiedByDateForBUser" parameterType="map" resultMap="BaseResultMap">
select co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.b_merchant_id,co.b_tenant_id,co.order_id,co.expired_time,
co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.verify_type,co.verify_remark,co.pay_vendor,co.pay_version,


Loading…
Cancel
Save