Sfoglia il codice sorgente

fix wxMerchant优化

release_toaliyun_real
winter 4 anni fa
parent
commit
51d2b3cf83
39 ha cambiato i file con 1120 aggiunte e 1047 eliminazioni
  1. +3
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java
  2. +15
    -5
      mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserBasicInfoController.java
  3. +201
    -0
      mallinkAdmin/src/main/resources/db/migration/V2022012000001__optimize.sql
  4. +1
    -1
      mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java
  5. +1
    -1
      mallinkCApi/src/main/java/com/iformall/controller/WxMerchantController.java
  6. +2
    -44
      mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java
  7. +1
    -5
      mallinkSchedule/src/main/java/com/iformall/schedule/DaliyAmountSchedule.java
  8. +4
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCouponOrder.java
  9. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java
  10. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxMerchantBUser.java
  11. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxShop.java
  12. +21
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantVo.java
  13. +4
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java
  14. +1
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxMerchantBUserMapper.java
  15. +7
    -15
      mallinkService/src/main/java/com/iformall/mapper/WxMerchantMapper.java
  16. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverMapper.java
  17. +1
    -31
      mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java
  18. +0
    -2
      mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java
  19. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java
  20. +6
    -5
      mallinkService/src/main/java/com/iformall/service/WxMerchantService.java
  21. +2
    -1
      mallinkService/src/main/java/com/iformall/service/WxRefundOrderService.java
  22. +3
    -1
      mallinkService/src/main/java/com/iformall/service/WxShopService.java
  23. +18
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  24. +23
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java
  25. +183
    -87
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java
  26. +22
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  27. +379
    -63
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  28. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantTradeDailyServiceImpl.java
  29. +14
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverServiceImpl.java
  30. +11
    -8
      mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java
  31. +11
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java
  32. +88
    -26
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml
  33. +10
    -0
      mallinkService/src/main/resources/mapper/WxMerchantBUserMapper.xml
  34. +57
    -404
      mallinkService/src/main/resources/mapper/WxMerchantMapper.xml
  35. +7
    -1
      mallinkService/src/main/resources/mapper/WxProfitSharingReceiverMapper.xml
  36. +1
    -297
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml
  37. +6
    -25
      mallinkService/src/main/resources/mapper/WxShopMapper.xml
  38. +3
    -3
      mallinkTTAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java
  39. +1
    -1
      mallinkTTCApi/src/main/java/com/iformall/controller/WxMerchantController.java

+ 3
- 3
mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java Vedi File

@@ -57,7 +57,7 @@ public class WxMerchantController extends BaseController {
if (null == wxMerchant) wxMerchant = new WxMerchant();
wxMerchant.updateTenantInfo(getTenantInfo());
wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC);
final PageInfo<WxMerchant> page = wxMerchantService.listVoAsPage(wxMerchant, pageNum, pageSize);
final PageInfo<WxMerchant> page = wxMerchantService.listVoAsPage(wxMerchant, pageNum, pageSize,true);
return new ResultData(page);
}

@@ -74,7 +74,7 @@ public class WxMerchantController extends BaseController {
if (null == wxMerchant) wxMerchant = new WxMerchant();
wxMerchant.updateTenantInfo(getTenantInfo());
wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC);
final PageInfo<WxMerchant> page = wxMerchantService.listVoAsPage2(wxMerchant, pageNum, pageSize);
final PageInfo<WxMerchant> page = wxMerchantService.listVoAsPage(wxMerchant, pageNum, pageSize,false);
return new ResultData(page);
}

@@ -240,7 +240,7 @@ public class WxMerchantController extends BaseController {
@SystemControllerLog(description = "商户-查询")
public ResultData findMerchantById(Long id) {
logger.debug("[" + getIpAddr() + "] WxMerchantController::findMerchantById");
WxMerchantVo wxMerchant = wxMerchantService.findMerchantById(id);
WxMerchantVo wxMerchant = wxMerchantService.findMerchantById(getTenantInfo(),id);
return new ResultData(wxMerchant);
}



+ 15
- 5
mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserBasicInfoController.java Vedi File

@@ -17,6 +17,7 @@ import com.iformall.domain.vo.UserTradeRecordVo;
import com.iformall.enums.EnumAssignTagsTrigger;
import com.iformall.enums.EnumCouponOrderStatus;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxCouponMerchantMapper;
import com.iformall.mapper.WxMerchantMapper;
import com.iformall.service.*;
import com.iformall.utils.Constant;
@@ -91,6 +92,9 @@ public class WxCUserBasicInfoController extends BaseController {

@Autowired
private WxCreditHistoryService wxCreditHistoryService;
@Autowired
WxCouponMerchantMapper wxCouponMerchantMapper;

private void updateLevelParam(WxCUserBasicInfo info) {
List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantInfo(ifParentUpdateTenantInfo());
@@ -301,11 +305,17 @@ public class WxCUserBasicInfoController extends BaseController {
c.setSalePrice(coupon.getPrice());

if(c.getCouponId() != null) {
HashMap<String, String> param = new HashMap<>();
param.put("id", c.getCouponId() + "");
WxMerchant w = wxMerchantMapper.findByTrade(param);
if (w != null)
c.setMerchantName(w.getName());
List<Long> couponIds = new ArrayList<Long>();
couponIds.add(c.getCouponId());
List<Long> merchantIds = wxCouponMerchantMapper.findMerchantByProductIds(corder.getTenantId(), couponIds);
if (null != merchantIds && merchantIds.size() > 0 ) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("ids", merchantIds);
WxMerchant w = wxMerchantMapper.findByTrade(param);
if (w != null) {
c.setMerchantName(w.getName());
}
}
}
}
}


+ 201
- 0
mallinkAdmin/src/main/resources/db/migration/V2022012000001__optimize.sql Vedi File

@@ -0,0 +1,201 @@
alter table wx_coupon_order_0 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_1 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_2 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_3 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_4 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_5 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_6 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_7 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_8 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_9 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_10 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_11 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_12 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_13 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_14 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_15 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_16 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_17 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_18 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_19 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_20 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_21 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_22 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_23 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_24 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_25 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_26 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_27 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_28 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_29 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_30 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_31 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_32 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_33 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_34 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_35 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_36 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_37 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_38 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_39 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_40 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_41 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_42 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_43 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_44 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_45 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_46 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_47 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_48 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_49 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_50 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_51 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_52 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_53 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_54 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_55 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_56 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_57 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_58 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_59 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_60 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_61 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_62 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_63 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_64 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_65 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_66 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_67 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_68 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_69 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_70 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_71 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_72 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_73 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_74 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_75 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_76 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_77 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_78 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_79 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_80 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_81 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_82 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_83 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_84 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_85 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_86 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_87 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_88 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_89 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_90 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_91 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_92 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_93 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_94 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_95 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_96 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_97 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_98 add column b_merchant_id bigint(20) AFTER `b_user_id`;
alter table wx_coupon_order_99 add column b_merchant_id bigint(20) AFTER `b_user_id`;

UPDATE wx_coupon_order_0 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_1 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_2 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_3 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_4 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_5 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_6 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_7 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_8 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_9 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_10 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_11 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_12 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_13 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_14 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_15 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_16 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_17 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_18 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_19 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_20 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_21 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_22 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_23 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_24 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_25 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_26 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_27 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_28 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_29 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_30 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_31 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_32 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_33 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_34 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_35 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_36 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_37 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_38 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_39 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_40 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_41 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_42 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_43 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_44 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_45 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_46 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_47 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_48 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_49 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_50 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_51 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_52 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_53 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_54 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_55 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_56 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_57 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_58 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_59 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_60 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_61 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_62 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_63 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_64 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_65 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_66 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_67 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_68 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_69 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_70 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_71 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_72 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_73 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_74 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_75 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_76 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_77 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_78 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_79 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_80 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_81 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_82 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_83 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_84 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_85 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_86 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_87 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_88 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_89 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_90 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_91 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_92 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_93 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_94 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_95 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_96 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_97 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_98 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;
UPDATE wx_coupon_order_99 co, wx_merchant_b_user bu SET co.`b_merchant_id` = bu.`merchant_id` WHERE co.`b_user_id` = bu.`id`;

+ 1
- 1
mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java Vedi File

@@ -73,7 +73,7 @@ public class WxRefundOrderController extends BaseController {
appinfo = wxAppinfoService.getList(appinfo).get(0);
// WxAppinfo appinfo = getAppInfo(bUser.getAppId());
try {
ResultData rd = wxRefundOrderService.createRefundOrder(appinfo, couponOrderId, EnumPayType.PAY_B_REFUND, bUser.getId(), null);
ResultData rd = wxRefundOrderService.createRefundOrder(appinfo, couponOrderId, EnumPayType.PAY_B_REFUND, bUser, null);
return rd;
} catch (MallinkException e) {
logger.error(e.getMessage());


+ 1
- 1
mallinkCApi/src/main/java/com/iformall/controller/WxMerchantController.java Vedi File

@@ -43,7 +43,7 @@ public class WxMerchantController extends BaseController {
wxMerchantDto.updateTenantInfo(getTenantInfo());
wxMerchantDto.setMerchantStatus(EnumMerchantStatus.VALID.getCode());
wxMerchantDto.setIsPublic(EnumMerchantPublic.PUBLIC.getCode());
return new ResultData(wxMerchantService.listAsPageCVo(wxMerchantDto, pageNum, pageSize));
return new ResultData(wxMerchantService.listAsPageCVo(wxMerchantDto, pageNum, pageSize,true));
}

@ApiOperation("根据code查询接口")


+ 2
- 44
mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java Vedi File

@@ -1213,50 +1213,7 @@ public class PosServiceImpl implements PosService {
throw new MallinkException(ErrorCode.POS_COUPON_REFUND_ERROR.getCode(), errMessage);
}

/**
* 预核销
* @param buUserId
* @param couponOrderCVo
* @param posOrderId
*/
private void doPreVerify(WxCouponOrderCVo couponOrderCVo, Long buUserId, Long posOrderId) {
int num = 0;
// 1. insert posOrderId
PosCouponOrderVerify posCouponOrderVerify = new PosCouponOrderVerify();
posCouponOrderVerify.updateTenantInfo(couponOrderCVo);
posCouponOrderVerify.setCouponOrderId(couponOrderCVo.getId());
posCouponOrderVerify.setPosOrderId(posOrderId);
posCouponOrderVerify.setOrderFrom(EnumOrderFrom.POS.getCode());
posCouponOrderVerify.setState(EnumEnableType.Enable.getCode());
posCouponOrderVerify.setCreateDate(new Date());
posCouponOrderVerify.setUpdateDate(new Date());
try {
posCouponOrderVerifyService.saveOrUpdate(posCouponOrderVerify);
} catch (Exception e) {
logger.error("db failed: couponOrder-" + couponOrderCVo.getId() + ", e:" + e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage());
}

// 2. update couponOrder
try {
WxCouponOrder couponOrder = new WxCouponOrder();
couponOrder.setId(couponOrderCVo.getId());
couponOrder.updateTenantInfo(couponOrderCVo);
couponOrder.setCouponOrderStatus(EnumCouponOrderStatus.POS_PRE_VERIFY.getCode());
couponOrder.setBUserId(buUserId);
couponOrder.setVerifyType(EnumCouponVerifyType.VERIFY_POS_PAY.getCode());
couponOrder.setUpdateDate(new Date());
num = couponOrderMapper.updateVerifyCouponOrder(couponOrder);
} catch (Exception e) {
logger.error("db failed: couponOrder-" + couponOrderCVo.getId() + ", e:" + e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage());
}
if (num != 1) {
logger.error("预核销异常:updatete num " + num);
throw new MallinkException(ErrorCode.VERIFY_ERROR.getCode(), "updatete num " + num);
}
logger.info("预核销已完成: " + couponOrderCVo.getId());
}

/**
* 预核销回退
@@ -1344,6 +1301,7 @@ public class PosServiceImpl implements PosService {
couponOrder.setCouponOrderStatus(EnumCouponOrderStatus.POS_PRE_VERIFY.getCode());
}
couponOrder.setBUserId(buUserId);
couponOrder.setBMerchantId(merchantId);
couponOrder.setUpdateDate(curDate);
if (couponOrderCVo.getBUserId() == null) {
num = couponOrderMapper.updateVerifyCouponOrder(couponOrder);


+ 1
- 5
mallinkSchedule/src/main/java/com/iformall/schedule/DaliyAmountSchedule.java Vedi File

@@ -99,11 +99,7 @@ public class DaliyAmountSchedule {
dateMap.put("endDate", endDate);
dateMap.put("merchantId", merchant.getId());
dateMap.put("tenantId", merchant.getTenantId());
WxMerchantBUser merchantBUserQ = new WxMerchantBUser();
merchantBUserQ.updateTenantInfo(merchant);
merchantBUserQ.setMerchantId(merchant.getId());
List<Long> bUserIds = wxMerchantBUserMapper.findIdList(merchantBUserQ);
dateMap.put("bUserIdList", bUserIds);
dateMap.put("bMerchantId", merchant.getId());
list = wxCouponOrderMapper.findListOfVerifiedByDate(dateMap);
if (null != list && list.size() > 0) {
logger.info("\nfind " + list.size() + " coupon order from " + startDate + " to " + endDate);


+ 4
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCouponOrder.java Vedi File

@@ -36,6 +36,10 @@ public class WxCouponOrder extends TenantEntity {
private Long bUserId;
@TableField(exist = false)
private List<Long> bUserIdList;
@io.swagger.annotations.ApiModelProperty(value = "操作券B端小程序用户商户ID", name = "bMerchantId")
private Long bMerchantId;
@TableField(exist = false)
private List<Long> bMerchantIdList;
@io.swagger.annotations.ApiModelProperty(value = "操作券A端用户ID", name = "aUserId")
private Long aUserId;
@io.swagger.annotations.ApiModelProperty(value = "用户订单ID", name = "orderId")


+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java Vedi File

@@ -27,6 +27,9 @@ import java.util.stream.Collectors;
public class WxMerchant extends TenantEntity {

protected Long id;
@TableField(exist = false)
private List<Long> notInids;

@TableField(exist = false)
private List<Long> userids;


+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxMerchantBUser.java Vedi File

@@ -21,6 +21,8 @@ public class WxMerchantBUser extends TenantEntity {

@io.swagger.annotations.ApiModelProperty(value = "B端用户手机号", name = "phone")
private String phone;
@TableField(exist = false)
private String phoneLike;
@io.swagger.annotations.ApiModelProperty(value = "", name = "userPwd")
private String userPwd;
@io.swagger.annotations.ApiModelProperty(value = "商户id", name = "merchantId")


+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxShop.java Vedi File

@@ -33,6 +33,9 @@ public class WxShop extends TenantEntity {

@TableField(exist = false)
private String merchantName;
@TableField(exist = false)
private String floorForRule;


@Excel(name="类型",width = 20,orderNum = "1",


+ 21
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantVo.java Vedi File

@@ -1,6 +1,7 @@
package com.iformall.domain.vo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.base.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -97,4 +98,24 @@ public class WxMerchantVo extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value = "置顶时间", name = "topTime")
private Date topTime;
public void initByMerchant(WxMerchant m) {
this.id = m.getId();
this.merchantImgUrl = m.getImgUrl();
this.merchantName = m.getName();
this.merchantEncode = m.getEncode();
this.merchantLinkPhone = m.getLinkPhone();
this.merchantStatus = m.getStatus();
this.businessId = m.getBusinessId();
this.isPublic = m.getIsPublic();
this.email = m.getEmail();
this.title = m.getTitle();
this.coverPicture = m.getCoverPicture();
this.subBusinessId = m.getSubBusinessId();
this.shopType = m.getShopType();
this.introduction = m.getIntroduction();
this.actionDesc = m.getActionDesc();
this.linkLinePhone = m.getLinkLinePhone();
this.topTime = m.getTopTime();
}
}

+ 4
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java Vedi File

@@ -98,5 +98,9 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> {
Integer findWriteOffCount(WxCouponOrder wxCouponOrder);

List<WxCouponOrder> findGoodsList(WxCouponOrderBVo record);
List<Map> findMerchantUserTradeList(Map<String,Object> params);
List<WxCouponOrder> findUserTradeList(WxCouponOrder wxCouponOrder);

}

+ 1
- 0
mallinkService/src/main/java/com/iformall/mapper/WxMerchantBUserMapper.java Vedi File

@@ -9,6 +9,7 @@ public interface WxMerchantBUserMapper extends CommonMapper<WxMerchantBUser, Lon

List<WxMerchantBUser> findList(WxMerchantBUser wxMerchantBUser);
List<Long> findIdList(WxMerchantBUser wxMerchantBUser);
List<Long> findMerchantIdList(WxMerchantBUser wxMerchantBUser);
List<WxMerchantBUser> findSimpleList(WxMerchantBUser wxMerchantBUser);


+ 7
- 15
mallinkService/src/main/java/com/iformall/mapper/WxMerchantMapper.java Vedi File

@@ -20,10 +20,8 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> {
List<WxMerchant> findIdNameList(WxMerchant wxMerchant);
List<WxMerchantVo> findListCVo(WxMerchantDto wxMerchantDto);
WxMerchantVo getMerchantByCode(HashMap<String, String> params);

WxMerchant queryMerchantByMerchantIdOfSharingReceiver(WxMerchant wxMerchant);
List<WxMerchant> findListCVo(WxMerchantDto wxMerchantDto);
WxMerchant getMerchantByCode(HashMap<String, String> params);

List<WxMerchant> findQrcodeEmptyList();

@@ -32,17 +30,11 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> {
int hasMerchant(WxMerchant wxMerchant);
int hasMerchantEncode(WxMerchant wxMerchant);

List<WxMerchant> findListVo(WxMerchant record);

void updateCreditLocked(WxMerchant wxMerchant);

List<WxMerchantTradeVo> userTradeList(WxMerchant wxMerchant);

List<WxMerchantTradeDetailVo> userTradeDetailList(WxMerchant wxMerchant);
List<WxMerchant> userTradeMerchantList(WxMerchant wxMerchant);

WxMerchant findByTrade(HashMap<String, String> params);

List<WxMerchant> findListVo2(WxMerchant record);
WxMerchant findByTrade(Map<String, Object> params);

List<WxMerchant> getMerchantList(WxMerchant wxMerchant);
@@ -58,8 +50,8 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> {

int recordedAmount(WxMerchant record);

List<Map<String, Object>> findMerchantByShop(@Param("shopId")Long shopId);
List<Map<String, Object>> detailByShopId(@Param("tenantInfo")TenantEntity tenantInfo,@Param("shopId") Long shopId);
Map<String, Object> detailShopMerchantById(@Param("tenantInfo")TenantEntity tenantInfo,@Param("id") Long id);
Map<String,Object> findShopMerchant(@Param("id")Long id);

}

+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverMapper.java Vedi File

@@ -8,7 +8,7 @@ public interface WxProfitSharingReceiverMapper extends CommonMapper<WxProfitShar

List<WxProfitSharingReceiver> findList(WxProfitSharingReceiver wxProfitSharingReceiver);
WxProfitSharingReceiver findOne(WxProfitSharingReceiver wxProfitSharingReceiver);



+ 1
- 31
mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java Vedi File

@@ -16,36 +16,12 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long>

List<WxRentContract> findList(WxRentContract wxRentContract);

//List<Map<String,Object>> queryRentContractData(WxRentContract wxRentContract);

//int queryRentContractWaitSignStatus(WxRentContract wxRentContract);

//int queryRentContractEndSoonStatus(WxRentContract wxRentContract);

//int queryRentContractPaidStatus(WxRentContract wxRentContract);

int queryRentContractCountByStatus(WxRentContract wxRentContract);
//int queryRentContractEndStatus(WxRentContract wxRentContract);

//int updateRentContractEndSoonStatus(WxRentContract wxRentContract);

//int updateRentContractPaidStatus(WxRentContract wxRentContract);

//int updateRentContractEndStatus(WxRentContract wxRentContract);

//void updateRentWaitSignStatus(WxRentContract wxRentContract);

//void updateRentInvalidStatus(WxRentContract wxRentContract);

//List<WxRentContract> getRentContractList(WxRentContract wxRentContract);

void updateStatusForUnsign(WxRentContract wxRentContract);

void updateApplyStatus(WxRentContract wxRentContract);

//List<WxRentContract> getRentInvalidList(WxRentContract wxRentContract);

void updateStatus(WxRentContract wxRentContract);

long queryOweCount(WxRentContract wxRentContract);
@@ -54,23 +30,16 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long>

int selectRentContractCountByShopId(@Param("tenantId") String tenantId,@Param("parentTenantId") String parentTenantId,@Param("shopId") Long shopId,@Param("id") Long id);

//void updateInvalidContract(WxRentContract record);

List<WxRentContract> selectRentContractByMerchantId(WxRentContract wxRentContract);

List<WxRentContract> selectRentContractByShopId(@Param("tenantId") String tenantId,@Param("parentTenantId") String parentTenantId,@Param("shopId") Long shopId,@Param("status") Integer status);

//List<WxRentContract> selectRentContractByShopIds(@Param("shopIds") Collection<Long> shopIds,@Param("shopIdsRegexp") String shopIdsRegexp,@Param("tenantId") String tenantId,@Param("parentTenantId") String parentTenantId);

int hasContractNumber(WxRentContract wxRentContract);

//Integer getShopType(WxRentContract wxRentContract);

List<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo record);

WxRentContract getByBill(WxBillRent billRent);

//int selectContractCountByShopId(WxRentContract wxRentContract);
int getShopCountMax();

List<Map<String,Object>> queryContractByBus(WxBusiness wxBusiness);
@@ -89,4 +58,5 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long>
List<Map<String, Object>> findRentByShop(@Param("shopId")Long shopId);

List<Map<String, Object>> currentValidByMerchantId(WxRentContract rentContract);
}

+ 0
- 2
mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java Vedi File

@@ -35,8 +35,6 @@ public interface WxShopMapper extends CommonMapper<WxShop, String> {

List<WxShopVo> findListWithMerchantMap(WxShop record);

List<WxShopVo> findShopVoList(@Param("merchantId") Long merchantId);

Long getCountByWxShop(WxShop wxShop);

List<Map<String,Object>> rentRateHistory(Map<String, Object> params);


+ 2
- 0
mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java Vedi File

@@ -222,5 +222,7 @@ public interface WxCouponOrderService {
List<WxCouponOrderCVo> findAvailCouponOrder(TenantEntity tenantEntity,Long cUserId,Long merchantId,Long posOrderId);
PageInfo<WxMerchantTradeDetailVo> userTradeDetailList(WxMerchant wxMerchant,Date startTime,Date endTime,Integer pageIndex,Integer pageSize);
}

+ 6
- 5
mallinkService/src/main/java/com/iformall/service/WxMerchantService.java Vedi File

@@ -66,7 +66,8 @@ public interface WxMerchantService {
List<WxMerchant> queryIdAndNames(WxMerchant record);
PageInfo<WxMerchantVo> listAsPageCVo(WxMerchantDto record, Integer pageIndex, Integer pageSize);
PageInfo<WxMerchantVo> listAsPageCVo(WxMerchantDto wxMerchantDto, Integer pageIndex, Integer pageSize,boolean hasShop);
/**
* 根据code查询
*
@@ -136,7 +137,7 @@ public interface WxMerchantService {

ResultData updateMerchantLevel(WxMerchant wxMerchant);

WxMerchantVo findMerchantById(Long id);
WxMerchantVo findMerchantById(TenantEntity tenantEntity,Long id);

WxMerchant findOne(WxMerchant wxMerchant);

@@ -153,13 +154,11 @@ public interface WxMerchantService {

Optional<WxMerchant> findByName(String name);

PageInfo<WxMerchant> listVoAsPage(WxMerchant wxMerchant, Integer pageNum, Integer pageSize);
PageInfo<WxMerchant> listVoAsPage(WxMerchant wxMerchant, Integer pageNum, Integer pageSize,boolean hasRentContractInfo);
List<WxMerchantVo> findMerchantVoList(Long couponId,TenantEntity tenantEntity,boolean hasShop);
Map<Long,List<WxMerchantVo>> findCouponMerchantVoList(List<Long> couponIds,TenantEntity tenantEntity,boolean hasShop);

PageInfo<WxMerchant> listVoAsPage2(WxMerchant wxMerchant, Integer pageNum, Integer pageSize);

List<WxMerchant> getMerchantList(WxMerchant wxMerchant);

void disableMerchat(Long id);
@@ -182,5 +181,7 @@ public interface WxMerchantService {
Map<String,Object> findMerchantByShop(Long shopId);

Map<String, Object> detailByShopId(TenantEntity tenantInfo, Long shopId);
List<Long> getFloorBuildMerchantIds(TenantEntity tenantEntity,String floorRule,Long building,Long floor,Integer merchantShopDel,Integer shopDel ) ;

}

+ 2
- 1
mallinkService/src/main/java/com/iformall/service/WxRefundOrderService.java Vedi File

@@ -3,6 +3,7 @@ package com.iformall.service;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxAppinfo;
import com.iformall.domain.po.WxMerchantBUser;
import com.iformall.domain.po.WxRefundOrder;
import com.iformall.enums.EnumPayType;
import com.iformall.enums.EnumPayWay;
@@ -20,7 +21,7 @@ public interface WxRefundOrderService {
* @param bUserId b端退款Id,auto,admin,self可为null
* @return
*/
ResultData createRefundOrder(WxAppinfo appInfo, Long couponOrderId, EnumPayType payType, Long bUserId, Long aUserId);
ResultData createRefundOrder(WxAppinfo appInfo, Long couponOrderId, EnumPayType payType, WxMerchantBUser bUser, Long aUserId);

/**
* 创建退款订单


+ 3
- 1
mallinkService/src/main/java/com/iformall/service/WxShopService.java Vedi File

@@ -93,5 +93,7 @@ public interface WxShopService {
* @param merchantId
* @return
*/
Map<Long,List<WxShopVo>> findMerchantShopVoList(TenantEntity tenantEntity, List<Long> merchantIds);
Map<Long,List<WxShopVo>> findMerchantShopVoListMap(TenantEntity tenantEntity, List<Long> merchantIds);
List<WxShopVo> findMerchantShopVoList(TenantEntity tenantEntity,Long merchantId);
}

+ 18
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Vedi File

@@ -28,6 +28,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

@@ -49,24 +50,31 @@ public class WxBillAllServiceImpl implements WxBillAllService {
@Autowired
WxBillAllMapper wxBillAllMapper;

@Lazy
@Autowired
WxBillDailyService wxBillDailyService;

@Lazy
@Autowired
WxBillDepositService wxBillDepositService;

@Lazy
@Autowired
WxBillPropertyDepositService wxBillPropertyDepositService;

@Lazy
@Autowired
WxBillPropertyService wxBillPropertyService;

@Lazy
@Autowired
WxBillRentService wxBillRentService;

@Lazy
@Autowired
WxBillOtherService wxBillOtherService;

@Lazy
@Autowired
WxBillOtherDepositService wxBillOtherDepositService;

@@ -97,6 +105,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
@Autowired
MqBaseProducer mqBaseProducer;

@Lazy
@Autowired
WxBillActionService wxBillActionService;

@@ -107,7 +116,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
WxMallMapper wxMallMapper;

@Autowired
WxMerchantMapper wxMerchantMapper;
WxMerchantService wxMerchantService;

@Autowired
private String fmUploadDir;
@@ -124,14 +133,18 @@ public class WxBillAllServiceImpl implements WxBillAllService {
@Autowired
StringRedisTemplate stringRedisTemplate;

@Lazy
@Autowired
WxBillSettleRecordService wxBillSettleRecordService;

@Lazy
@Autowired
WxBillSettleService wxBillSettleService;

@Autowired
WxBillSettleRecordMapper wxBillSettleRecordMapper;
@Lazy
@Autowired
WxPayAccountBillService wxPayAccountBillService;

@@ -843,7 +856,9 @@ public class WxBillAllServiceImpl implements WxBillAllService {

WxMerchantDto wxMerchantDto = new WxMerchantDto();
wxMerchantDto.setId(wxBillAll.getMerchantId());
List<WxMerchantVo> listCVo = wxMerchantMapper.findListCVo(wxMerchantDto);
wxMerchantDto.updateTenantInfo(wxMall);
PageInfo<WxMerchantVo> pageInfo = wxMerchantService.listAsPageCVo(wxMerchantDto,1,1,true);
List<WxMerchantVo> listCVo = pageInfo.getList();
WxMerchantVo wxMerchantVo = listCVo.get(0);
result.put("merchant", wxMerchantVo.getMerchantName());
WxShopVo wxShopVo = wxMerchantVo.getShopVoList().stream()
@@ -904,7 +919,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
// q.setTenantInfo(wxBillSettle);
WxMall wxMall = wxMallMapper.getByTenantInfo(wxBillSettle);
result.put("mall", wxMall.getName());
result.put("merchant", wxMerchantMapper.selectById(wxBillSettle.getMerchantId()).getName());
result.put("merchant", wxMerchantService.selectById(wxBillSettle.getMerchantId()).getName());
result.put("num", wxBillSettle.getSettleNumber());
result.put("cdate", DateUtils.format(wxBillSettle.getCreatetime()));



+ 23
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java Vedi File

@@ -47,8 +47,14 @@ public class WxChartServiceImpl implements WxChartDataService {
WxShopMapper wxShopMapper;
@Autowired
WxBillRentMapper wxBillRentMapper;
@Lazy
@Autowired
WxMerchantService wxMerchantService;
@Autowired
WxMerchantMapper wxMerchantMapper;
@Autowired
WxMerchantTradeDailyMapper wxMerchantTradeDailyMapper;
@Autowired
@@ -646,20 +652,34 @@ public class WxChartServiceImpl implements WxChartDataService {
*/
private ResultData getBusiness(TenantEntity tenantEntity,Map<String, String> paramsMap){
Map<String,Long> resultMap = new LinkedMap();
Map<Integer,String> bussnessNameMap = new HashMap<Integer,String>();
List<WxBusiness> businessList = wxBusinessService.findList(new WxBusiness());
for (WxBusiness b:businessList) {
resultMap.put(b.getTitle(),0l);
bussnessNameMap.put(b.getId(), b.getTitle());
}
Map<String,Object> query = new HashedMap();
query.put("tenantId",tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
query.put("parentTenantId",tenantEntity.getParentTenantId());
}
query.put("id",paramsMap.get("id"));
query.put("buildingId",paramsMap.get("buildingId"));
String floorId = paramsMap.get("id");
String buildingId = paramsMap.get("buildingId");
Long building = null;
if (!StringUtils.isBlank(buildingId)) {
building = Long.parseLong(buildingId);
}
Long floor = null;
if (!StringUtils.isBlank(floorId)) {
floor = Long.parseLong(floorId);
}
List<Long> merchantIds = wxMerchantService.getFloorBuildMerchantIds(tenantEntity, null, building, floor, 0, 0);
if (null != merchantIds) {
query.put("ids", merchantIds);
}
List<Map<String,Object>> mapList = wxMerchantMapper.findBusByFloorId(query);
for (Map<String,Object> map:mapList) {
resultMap.put((String)map.get("btitle"),(Long)map.get("count"));
resultMap.put(bussnessNameMap.get((Integer)map.get("bid")),(Long)map.get("count"));
}
return new ResultData(resultMap);
}


+ 183
- 87
mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java Vedi File

@@ -280,11 +280,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
if (pageIndex == null || pageSize == null) {
List<WxCouponOrder> list;
if (isVerified) {
WxMerchantBUser merchantBUserQ = new WxMerchantBUser();
merchantBUserQ.updateTenantInfo(wxMerchant);
merchantBUserQ.setMerchantId(wxMerchant.getId());
List<Long> bUserIds = wxMerchantBUserMapper.findIdList(merchantBUserQ);
dateMap.put("bUserIdList", bUserIds);
dateMap.put("bMerchantId", wxMerchant.getId());
list = wxCouponOrderMapper.findListOfVerifiedByDate(dateMap);
}else {
dateMap.put("startDateTimes", startDate.getTime());
@@ -329,13 +325,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
dateMap.put("tenantId",tenantEntity.getTenantId());
dateMap.put("startDate", startDate);
dateMap.put("endDate", endDate);
WxMerchantBUser merchantBUserQ = new WxMerchantBUser();
merchantBUserQ.updateTenantInfo(tenantEntity);
merchantBUserQ.setMerchantId(merchantId);
List<Long> bUserIds = wxMerchantBUserMapper.findIdList(merchantBUserQ);
dateMap.put("bUserIdList", bUserIds);
dateMap.put("bMerchantId", merchantId);
PageInfo<WxCouponOrder> couponOrderPage = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() ->wxCouponOrderMapper.findListOfVerifiedByDateForBUser(dateMap));
PageInfo<WxCouponOrderBVo> pageInfo = new PageInfo<WxCouponOrderBVo>();
pageInfo.setList(handleToCouponOrderBVoList(tenantEntity,couponOrderPage.getList(),false,false));
@@ -850,56 +840,71 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
private List<WxCouponOrderBVo> handleQueryResult(List<WxCouponOrder> list,TenantEntity tenantEntity) {
if (null != list && list.size() > 0) {
WxMerchant merchantQ = new WxMerchant();
merchantQ.updateTenantInfo(tenantEntity);
List<WxMerchant> merchantList = wxMerchantMapper.findIdNameList(merchantQ);
Map<Long,String> merchantNameMap = new HashMap<Long,String>();
if (null != merchantList) {
for (int i = 0 ; i < merchantList.size() ; i ++) {
WxMerchant m = merchantList.get(i);
merchantNameMap.put(m.getId(), m.getName());
}
}
WxCoupon couponQ = new WxCoupon();
couponQ.updateTenantInfo(tenantEntity);
List<WxCoupon> couponList = wxCouponMapper.findTenantSimpleList(couponQ);
Map<Long,WxCoupon> couponMap = new HashMap<Long,WxCoupon>();
if (null != couponList) {
for (int i = 0 ; i < couponList.size() ; i ++) {
WxCoupon c = couponList.get(i);
couponMap.put(c.getId(), c);
}
}
List<WxMerchantProductVo> merchantProductVos = wxCouponMerchantMapper.findMerchantProduct(tenantEntity.getTenantId(), null);
Map<Long,Long> merchantProductIdMap = new HashMap<Long,Long>();
if (null != merchantProductVos) {
for (int i = 0 ; i < merchantProductVos.size(); i ++) {
WxMerchantProductVo mp = merchantProductVos.get(i);
if (mp.getMc() > 1) {
merchantProductIdMap.put(mp.getProductId(), -999L);
}else {
merchantProductIdMap.put(mp.getProductId(), mp.getMerchantId());
}
}
}
//循环list,获取 cUserId
//循环list,获取 cUserId
List<Long> cUserIdList = new ArrayList<Long>();
List<Long> bUserIdList = new ArrayList<Long>();
List<Long> merchantIdList = new ArrayList<Long>();
List<Long> couponIdList = new ArrayList<Long>();
for (int i = 0 ; i < list.size() ; i ++ ) {
WxCouponOrder bo = list.get(i);
Long cusrid = bo.getcUserId();
if (null != cusrid && (!cUserIdList.contains(cusrid))) {
cUserIdList.add(cusrid);
}
Long busrid = bo.getBUserId();
if (null != busrid && (!bUserIdList.contains(busrid))) {
bUserIdList.add(busrid);
Long bmerchantId = bo.getBMerchantId();
if (null != bmerchantId && (!merchantIdList.contains(bmerchantId))) {
merchantIdList.add(bmerchantId);
}
Long couponId = bo.getCouponId();
if (null != couponId && (!couponIdList.contains(couponId))) {
couponIdList.add(couponId);
}
}
Map<Long,String> merchantNameMap = new HashMap<Long,String>();
if (null != merchantIdList && merchantIdList.size() > 0 ) {
WxMerchant merchantQ = new WxMerchant();
merchantQ.updateTenantInfo(tenantEntity);
merchantQ.setIds(merchantIdList);;
List<WxMerchant> merchantList = wxMerchantMapper.findIdNameList(merchantQ);
if (null != merchantList) {
for (int i = 0 ; i < merchantList.size() ; i ++) {
WxMerchant m = merchantList.get(i);
merchantNameMap.put(m.getId(), m.getName());
}
}
}
Map<Long,WxCoupon> couponMap = new HashMap<Long,WxCoupon>();
if (null != couponIdList && couponIdList.size() > 0 ) {
WxCoupon couponQ = new WxCoupon();
couponQ.updateTenantInfo(tenantEntity);
couponQ.setIds(couponIdList);
List<WxCoupon> couponList = wxCouponMapper.findTenantSimpleList(couponQ);
if (null != couponList) {
for (int i = 0 ; i < couponList.size() ; i ++) {
WxCoupon c = couponList.get(i);
couponMap.put(c.getId(), c);
}
}
}
Map<Long,Long> merchantProductIdMap = new HashMap<Long,Long>();
if (null != merchantIdList && merchantIdList.size() > 0 ) {
List<WxMerchantProductVo> merchantProductVos = wxCouponMerchantMapper.findMerchantProduct(tenantEntity.getTenantId(), merchantIdList);
if (null != merchantProductVos) {
for (int i = 0 ; i < merchantProductVos.size(); i ++) {
WxMerchantProductVo mp = merchantProductVos.get(i);
if (mp.getMc() > 1) {
merchantProductIdMap.put(mp.getProductId(), -999L);
}else {
merchantProductIdMap.put(mp.getProductId(), mp.getMerchantId());
}
}
}
}
Map<Long,WxCUserBasicInfo> cUserMap = new HashMap<Long,WxCUserBasicInfo>();
if (cUserIdList.size() > 0) {
WxCUserBasicInfo cUserBasicInfoQ = new WxCUserBasicInfo();
@@ -914,20 +919,6 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
}
}
Map<Long,Long> buserMerchantIdMap = new HashMap<Long,Long>();
if (bUserIdList.size() > 0 ) {
WxMerchantBUser merchantBUserQ = new WxMerchantBUser();
merchantBUserQ.setIds(bUserIdList);
merchantBUserQ.updateTenantInfo(tenantEntity);
List<WxMerchantBUser> busrlist = wxMerchantBUserMapper.findMerchantIdListByIds(merchantBUserQ);
if (null != busrlist ) {
for (int i = 0 ; i < busrlist.size() ; i ++) {
WxMerchantBUser buser = busrlist.get(i);
buserMerchantIdMap.put(buser.getId(), buser.getMerchantId());
}
}
}

List<WxCouponOrderBVo> retList = new ArrayList<WxCouponOrderBVo>();
for (int i = 0 ; i < list.size() ; i ++) {
@@ -975,9 +966,9 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
co.setUserNickName(basicInfo.getNickName());
}
Long buserMechantId = buserMerchantIdMap.get(co.getBUserId());
if (null != buserMechantId) {
co.setVerifyMerchantName(merchantNameMap.get(buserMechantId));
Long bMechantId = co.getBMerchantId();
if (null != bMechantId) {
co.setVerifyMerchantName(merchantNameMap.get(bMechantId));
}
//co.setChannelType();)
@@ -1145,16 +1136,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
wxCouponOrder.setId(-999L);
return;
}
WxMerchantBUser merchantBUserQ = new WxMerchantBUser();
merchantBUserQ.setMerchantIds(merchantIds);
List<Long> bUserIdList = wxMerchantBUserMapper.findIdList(merchantBUserQ);
if (null == bUserIdList || bUserIdList.size() <= 0 ){
//throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"核销商户下查询不到员工信息.");
wxCouponOrder.setId(-999L);
return;
}
wxCouponOrder.setBUserIdList(bUserIdList);
wxCouponOrder.setBMerchantIdList(merchantIds);
}
}
@@ -1303,6 +1285,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
try {
couponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); //1核销
couponOrder.setBUserId(bUser==null?0l:bUser.getId());
couponOrder.setBMerchantId(bUser==null?0l:bUser.getMerchantId());
couponOrder.setVerifyType(couponVerifyType.getCode());
if(EnumCouponVerifyType.VERIFY_B.equals(couponVerifyType)
&& StringUtils.isNotBlank(couponOrder.getVerifyRemark())){
@@ -2585,6 +2568,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
try {
couponOrder.setCouponOrderStatus(EnumCouponOrderStatus.POS_PRE_VERIFY.getCode()); //预核销
couponOrder.setBUserId(bUser.getId());
couponOrder.setBMerchantId(bUser.getMerchantId());;
couponOrder.setVerifyType(EnumCouponVerifyType.VERIFY_B.getCode());
couponOrder.setVerifyRemark(EnumCouponVerifyType.VERIFY_B_10.getMessage());
couponOrder.setUpdateDate(new Date());
@@ -2620,6 +2604,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
try {
couponOrder.setCouponOrderStatus(EnumCouponOrderStatus.POS_PRE_VERIFY.getCode()); //预核销
couponOrder.setBUserId(bUser.getId());
couponOrder.setBMerchantId(bUser.getMerchantId());
couponOrder.setVerifyType(EnumCouponVerifyType.VERIFY_B.getCode());
couponOrder.setVerifyRemark(EnumCouponVerifyType.VERIFY_B_10.getMessage());
couponOrder.setUpdateDate(new Date());
@@ -2698,6 +2683,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
WxCouponOrder updateCouponOrder = new WxCouponOrder();
updateCouponOrder.setId(couponOrderId);
updateCouponOrder.setBUserId(bUser.getId());
updateCouponOrder.setBMerchantId(bUser.getMerchantId());
updateCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode());
updateCouponOrder.setUpdateDate(new Date());
updateCouponOrder.setPayVendor(payWay.getCode());
@@ -2758,13 +2744,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
private Integer findWriteOffCount(WxCouponOrder wxCouponOrder) {
if (null != wxCouponOrder.getMerchantId()) {
WxMerchantBUser merchantBUserQ = new WxMerchantBUser();
merchantBUserQ.updateTenantInfo(wxCouponOrder);
merchantBUserQ.setMerchantId(wxCouponOrder.getMerchantId());
List<Long> buserIds = wxMerchantBUserMapper.findIdList(merchantBUserQ);
if (null != buserIds && buserIds.size() > 0) {
wxCouponOrder.setBUserIdList(buserIds);
}
wxCouponOrder.setBMerchantId(wxCouponOrder.getMerchantId());
}
return wxCouponOrderMapper.findWriteOffCount(wxCouponOrder);
}
@@ -3027,5 +3007,121 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
}
return cvo;
}

@Override
public PageInfo<WxMerchantTradeDetailVo> userTradeDetailList(WxMerchant wxMerchant,Date startTime,Date endTime,Integer pageIndex,Integer pageSize) {
WxCouponOrder wxCouponOrderQ = new WxCouponOrder();
wxCouponOrderQ.updateTenantInfo(wxMerchant);
wxCouponOrderQ.setStartTime(startTime);
wxCouponOrderQ.setEndTime(endTime);
WxMerchantBUser buserQ = new WxMerchantBUser();
buserQ.updateTenantInfo(wxMerchant);
buserQ.setMerchantId(wxMerchant.getId());
buserQ.setStatus(0);
List<Long> buserIdList = wxMerchantBUserMapper.findIdList(buserQ);
if ( null == buserIdList || buserIdList.size() <= 0 ) {
return null;
}
wxCouponOrderQ.setBUserIdList(buserIdList);
PageInfo<WxCouponOrder> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findUserTradeList(wxCouponOrderQ));
PageInfo<WxMerchantTradeDetailVo> retPageInfo = new PageInfo<WxMerchantTradeDetailVo>();
retPageInfo.setPageNum(pageInfo.getPageNum());
retPageInfo.setPageSize(pageInfo.getPageSize());
retPageInfo.setPages(pageInfo.getPages());
retPageInfo.setTotal(pageInfo.getTotal());
retPageInfo.setList(couponOrderListToTradeDetailVoList(wxMerchant,pageInfo.getList()));
return retPageInfo;
}
private List<WxMerchantTradeDetailVo> couponOrderListToTradeDetailVoList(TenantEntity tenantEntity,List<WxCouponOrder> couponOrderList) {
if (null == couponOrderList || couponOrderList.size() <=0 ) {
return null;
}
List<Long> couponIdList = new ArrayList<Long>();
List<Long> cUserIdList = new ArrayList<Long>();
for (int i = 0 ; i < couponOrderList.size() ; i++ ) {
WxCouponOrder co = couponOrderList.get(i);
if (null != co) {
if (null != co.getCouponId() && (!couponIdList.contains(co.getCouponId()))) {
couponIdList.add(co.getCouponId());
}
if (null != co.getCUserId() && (!cUserIdList.contains(co.getCUserId()))) {
cUserIdList.add(co.getCUserId());
}
}
}
Map<Long,WxCoupon> couponMap = new HashMap<Long,WxCoupon>();
if (couponIdList.size() > 0 ) {
WxCoupon couponQ = new WxCoupon();
couponQ.updateTenantInfo(tenantEntity);
couponQ.setIds(couponIdList);
List<WxCoupon> couponList = wxCouponMapper.findTenantSimpleList(couponQ);
if (null != couponList) {
for (int i = 0 ; i < couponList.size(); i ++) {
WxCoupon c = couponList.get(i);
if (null != c) {
couponMap.put(c.getId(), c);
}
}
}
}
Map<Long,WxCUserBasicInfo> cUserMap = new HashMap<Long,WxCUserBasicInfo>();
if (cUserIdList.size() > 0 ) {
WxCUserBasicInfo cuserQ = new WxCUserBasicInfo();
cuserQ.setFinalTenantId(tenantEntity.getFinalTenantId());
cuserQ.setIds(couponIdList);
List<WxCUserBasicInfo> cuserList = wxCUserBasicInfoMapper.findListPhoneAndNameByIds(cuserQ);
if (null != cuserList) {
for (int i = 0 ; i < cuserList.size(); i ++) {
WxCUserBasicInfo u = cuserList.get(i);
if (null != u) {
cUserMap.put(u.getId(), u);
}
}
}
}
List<WxMerchantTradeDetailVo> volist = new ArrayList<WxMerchantTradeDetailVo>();
for (int i = 0 ; i < couponOrderList.size() ; i++ ) {
WxCouponOrder co = couponOrderList.get(i);
if (null != co) {
WxMerchantTradeDetailVo vo = toMerchantTradeDetailVo(co,couponMap,cUserMap);
if (null != vo ) {
volist.add(vo);
}
}
}
if (volist.size() <=0 ) {
return null;
}
return volist;
}
private WxMerchantTradeDetailVo toMerchantTradeDetailVo(WxCouponOrder co,Map<Long,WxCoupon> couponMap,Map<Long,WxCUserBasicInfo> cUserMap) {
if (null == co) {
return null;
}
WxMerchantTradeDetailVo vo = new WxMerchantTradeDetailVo();
vo.setTradeDate(co.getCreateDate());
if (null != co.getCUserId()) {
WxCUserBasicInfo user = cUserMap.get(co.getCUserId());
if (null != user) {
String name = user.getName();
if (StringUtils.isBlank(name)) {
name = user.getNickName();
}
vo.setUserName(name);
vo.setPhone(user.getPhone());
}
}
if (null != co.getCouponId()) {
WxCoupon coupon = couponMap.get(co.getCouponId());
if (null != coupon) {
vo.setCouponName(coupon.getTitle());
vo.setCouponSale(coupon.getSalePrice());
vo.setCouponPrice(coupon.getPrice());
vo.setTradeAmt(coupon.getPrice());
}
}
return vo;
}
}

+ 22
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java Vedi File

@@ -32,6 +32,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
@@ -59,15 +60,19 @@ public class WxCouponServiceImpl implements WxCouponService {
@Autowired
WxMerchantMapper wxMerchantMapper;

@Lazy
@Autowired
WxCouponChannelService wxCouponChannelService;

@Lazy
@Autowired
WxCouponSendService wxCouponSendService;

@Lazy
@Autowired
WxOrderService wxOrderService;

@Lazy
@Autowired
WxScreenAdService wxScreenAdService;

@@ -107,6 +112,9 @@ public class WxCouponServiceImpl implements WxCouponService {
@Autowired
@Qualifier("couponChannelRedisTemplate")
RedisTemplate<String, PageInfo<WxCouponChannelVo>> cdRedisTemplate;
@Autowired
WxProfitSharingReceiverMapper wxProfitSharingReceiverMapper;

@Override
public ResultData list(TenantEntity tenantEntity,WxCoupon wxCoupon, Integer pageNum, Integer pageSize) {
@@ -391,10 +399,20 @@ public class WxCouponServiceImpl implements WxCouponService {
Long id = jsonObject.getLong("id");
WxMerchant wxMerchant = new WxMerchant();
wxMerchant.setId(id);
WxMerchant merchant = wxMerchantMapper.queryMerchantByMerchantIdOfSharingReceiver(wxMerchant);
if (merchant.getId() == null) {
flag = true;
sb.append("[").append(merchant.getName()).append("]");
WxMerchant merchant = wxMerchantMapper.selectById(id);
if (null == merchant) {
flag = true;
sb.append("[未查询到商户信息]");
}else {
WxProfitSharingReceiver wxProfitSharingReceiverQ = new WxProfitSharingReceiver();
wxProfitSharingReceiverQ.updateTenantInfo(record);
wxProfitSharingReceiverQ.setStatus(0);
wxProfitSharingReceiverQ.setMerchantId(id);
WxProfitSharingReceiver receiver = wxProfitSharingReceiverMapper.findOne(wxProfitSharingReceiverQ);
if (null == receiver || receiver.getId() == null) {
flag = true;
sb.append("[").append(merchant.getName()).append("]");
}
}
}
if (flag) {


+ 379
- 63
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java Vedi File

@@ -26,6 +26,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
@@ -68,9 +69,11 @@ public class WxMerchantServiceImpl implements WxMerchantService {
@Autowired
WxCouponMapper wxCouponMapper;

@Lazy
@Autowired
WxCouponService wxCouponService;

@Lazy
@Autowired
WxProfitSharingReceiverService wxProfitSharingReceiverService;

@@ -86,9 +89,11 @@ public class WxMerchantServiceImpl implements WxMerchantService {
@Autowired
WxCouponMerchantMapper wxCouponMerchantMapper;

@Lazy
@Autowired
WxRentContractService wxRentContractService;

@Lazy
@Autowired
WxLevelConfigService wxLevelConfigService;

@@ -101,12 +106,15 @@ public class WxMerchantServiceImpl implements WxMerchantService {
@Autowired
WxProfitSharingReceiverMapper wxProfitSharingReceiverMapper;

@Lazy
@Autowired
WxPropertyContractService wxPropertyContractService;

@Lazy
@Autowired
WxMallService wxMallService;

@Lazy
@Autowired
WxShopService wxShopService;

@@ -116,8 +124,22 @@ public class WxMerchantServiceImpl implements WxMerchantService {
@Autowired
TtUserFollowMapper ttUserFollowMapper;

@Lazy
@Autowired
private QrCodeService qrCodeService;
@Autowired
WxBusinessMapper wxBusinessMapper;
@Autowired
WxCouponOrderMapper wxCouponOrderMapper;
@Lazy
@Autowired
WxCouponOrderService wxCouponOrderService;
@Autowired
WxBrandMapper wxBrandMapper;

@Override
public PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) {
@@ -128,17 +150,95 @@ public class WxMerchantServiceImpl implements WxMerchantService {
public List<WxMerchant> queryIdAndNames (WxMerchant record) {
return wxMerchantMapper.findIdNameList(record);
}


@Override
public PageInfo<WxMerchantVo> listAsPageCVo(WxMerchantDto record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.findListCVo(record));
public WxMerchantVo getMerchantInfo(HashMap<String, String> params) {
WxMerchant merchant = wxMerchantMapper.getMerchantByCode(params);
if (null == merchant) {
return null;
}
WxBusiness bussiness = null;
if (null != merchant.getBusinessId()) {
bussiness = wxBusinessMapper.selectById(merchant.getBusinessId());
}
List<WxShopVo> shopVoList = wxShopService.findMerchantShopVoList(merchant,merchant.getId());
return merchantToVo(merchant,bussiness,shopVoList);
}

@Override
public WxMerchantVo getMerchantInfo(HashMap<String, String> params) {
return wxMerchantMapper.getMerchantByCode(params);
public PageInfo<WxMerchantVo> listAsPageCVo(WxMerchantDto wxMerchantDto, Integer pageIndex, Integer pageSize,boolean hasShop) {
if (null != wxMerchantDto.getBuilding() || null != wxMerchantDto.getFloor()) {
List<Long> merchantIds = getFloorBuildMerchantIds(wxMerchantDto, null, wxMerchantDto.getBuilding(), wxMerchantDto.getFloor(), null, null);
wxMerchantDto.setIds(merchantIds);
}
PageInfo<WxMerchant> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.findListCVo(wxMerchantDto));
PageInfo<WxMerchantVo> retPageInfo = new PageInfo<WxMerchantVo>();
retPageInfo.setPageNum(pageInfo.getPageNum());
retPageInfo.setPageSize(pageInfo.getPageSize());
retPageInfo.setPages(pageInfo.getPages());
retPageInfo.setTotal(pageInfo.getTotal());
retPageInfo.setList(toVoList(wxMerchantDto,pageInfo.getList(),hasShop));
return retPageInfo;
}
private List<WxMerchantVo> toVoList(TenantEntity tenantEntity,List<WxMerchant> merchantList,boolean hasShop) {
if (null == merchantList || merchantList.size() <= 0 ) {
return null;
}
List<WxBusiness> bussinessList = wxBusinessMapper.findListAll();
Map<Integer,WxBusiness> bussinessMap = new HashMap<Integer,WxBusiness>();
if (null != bussinessList) {
for (int i = 0 ; i < bussinessList.size() ; i ++) {
WxBusiness bu = bussinessList.get(i);
bussinessMap.put(bu.getId() ,bu);
}
}
Map<Long, List<WxShopVo>> merchantShopMap = null;
if (hasShop) {
List<Long> merchantIds = new ArrayList<Long>();
for (int i = 0 ; i < merchantList.size() ; i ++) {
WxMerchant m = merchantList.get(i);
if (!merchantIds.contains(m.getId())) {
merchantIds.add(m.getId());
}
}
if (merchantIds.size() > 0 ) {
merchantShopMap = wxShopService.findMerchantShopVoListMap(tenantEntity, merchantIds);
}
}
List<WxMerchantVo> retList = new ArrayList<WxMerchantVo>();
for (int i = 0 ; i < merchantList.size() ; i ++) {
WxMerchant m = merchantList.get(i);
WxBusiness bussiness = null;
if (null != m.getBusinessId()) {
bussiness = bussinessMap.get(m.getBusinessId());
}
List<WxShopVo> shopVoList = null;
if (hasShop && null != merchantShopMap) {
shopVoList = merchantShopMap.get(m.getId());
}
WxMerchantVo vo = merchantToVo(m, bussiness, shopVoList);
if (null != vo ) {
retList.add(vo);
}
}
return retList;
}
private WxMerchantVo merchantToVo(WxMerchant m ,WxBusiness bussiness,List<WxShopVo> shopVoList) {
if (null == m) {
return null;
}
WxMerchantVo vo = new WxMerchantVo();
vo.initByMerchant(m);
if (null != bussiness) {
vo.setBusinessName(bussiness.getTitle());
}
if (null != shopVoList && shopVoList.size() > 0 ) {
vo.setShopVoList(shopVoList);
}
return vo;
}

@Override
@@ -739,10 +839,15 @@ public class WxMerchantServiceImpl implements WxMerchantService {
}

@Override
public WxMerchantVo findMerchantById(Long id) {
public WxMerchantVo findMerchantById(TenantEntity tenantEntity,Long id) {
WxMerchantDto merchant = new WxMerchantDto();
merchant.setId(id);
List<WxMerchantVo> listCVo = wxMerchantMapper.findListCVo(merchant);
merchant.updateTenantInfo(merchant);
PageInfo<WxMerchantVo> page = listAsPageCVo(merchant,1,1,true);
if (null == page) {
return null;
}
List<WxMerchantVo> listCVo = page.getList();
return listCVo.isEmpty() ? new WxMerchantVo() : listCVo.get(0);
}

@@ -772,7 +877,7 @@ public class WxMerchantServiceImpl implements WxMerchantService {
}

//商铺信息
m.setShopVos(wxShopMapper.findShopVoList(m.getId()));
m.setShopVos(wxShopService.findMerchantShopVoList(m,m.getId()));

//店员信息
WxMerchantBUser wxMerchantBUser = new WxMerchantBUser();
@@ -857,50 +962,229 @@ public class WxMerchantServiceImpl implements WxMerchantService {
return Optional.empty();
}

private void initQueryParam(WxMerchant record,boolean hasRentContractInfo,Map<Long,WxRentContract> merchantRentMap) {
if (hasRentContractInfo) {
WxRentContract wxRentContractQ = new WxRentContract();
wxRentContractQ.updateTenantInfo(record);
List<Integer> statusList = new ArrayList<Integer>();
statusList.add(2);
statusList.add(3);
statusList.add(4);
wxRentContractQ.setStatuss(statusList);
List<WxRentContract> rentList = wxRentContractMapper.findList(wxRentContractQ);
if (null != rentList) {
for (int i = 0 ; i < rentList.size(); i++) {
WxRentContract contract = rentList.get(i);
if (null != contract && null != contract.getMerchantId()) {
merchantRentMap.put(contract.getMerchantId(), contract);
}
}
}
}
List<Long> merchantIds = new ArrayList<Long>();
String phone = StringUtils.trimToNull(record.getPhone());
if (null != phone) {
WxMerchantBUser buserQ = new WxMerchantBUser();
buserQ.setPhoneLike(phone);
buserQ.setStatus(0);
List<Long> userMerchantIds = wxMerchantBUserMapper.findMerchantIdList(buserQ);
if (null == userMerchantIds || userMerchantIds.size() <=0 ) {
record.setId(-999L);
return;
}else {
merchantIds.addAll(userMerchantIds);
}
}
String floorRule = StringUtils.trimToNull(record.getFloorForRule());
Long building = record.getBuilding();
Long floor = record.getFloor();
List<Long> floorMerchantIds = getFloorBuildMerchantIds(record, floorRule, building, floor, 0, 0);
if (null != floorMerchantIds) {
merchantIds.retainAll(floorMerchantIds);
}
if (merchantIds.size() > 0 ) {
record.setIds(merchantIds);
}
Integer rentShopType = record.getRentShopType();
if (null != rentShopType) {
WxRentContract rentContractQ = new WxRentContract();
rentContractQ.updateTenantInfo(record);
rentContractQ.setStatuss(EnumRentContractStatus.getValidStatus());
List<Long> usedMerchantIds = wxRentContractMapper.getMerchantIdsByStatuss(rentContractQ);
if (null != usedMerchantIds && usedMerchantIds.size() >0 ) {
record.setNotInids(usedMerchantIds);
}
}
}
@Override
public PageInfo<WxMerchant> listVoAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) {
PageHelper.startPage(pageIndex, pageSize);
List<WxMerchant> merchants = wxMerchantMapper.findListVo(record);
for (WxMerchant merchant : merchants) {
if (record.getRentShopType() != null) {
List<Map<String, Object>> shops = new ArrayList<>();
WxMerchantShop wxMerchantShop = new WxMerchantShop();
wxMerchantShop.setMerchantId(merchant.getId());
wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode());
List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop);
for (WxMerchantShop merchantShop : wxMerchantShopList) {
WxShop shop = new WxShop();
shop.setId(merchantShop.getShopId());
List<Map<String, Object>> shoplist = wxShopMapper.findListMap(shop);
if (shoplist.size() > 0) {
shops.add(shoplist.get(0));
public List<Long> getFloorBuildMerchantIds(TenantEntity tenantEntity,String floorRule,Long building,Long floor,Integer merchantShopDel,Integer shopDel ) {
if (null != floorRule || null != building || null != floor) {
List<Long> floorMerchantIds = null;
WxShop shopQ = new WxShop();
if (null != shopDel) {
shopQ.setIsDel(shopDel);
}
shopQ.updateTenantInfo(tenantEntity);
if (null != floorRule) {
shopQ.setFloorForRule(floorRule);
}
if (null != building) {
shopQ.setBuilding(building);
}
if (null != floor) {
shopQ.setFloor(floor);
}
List<Long> shopIds = wxShopMapper.findIdList(shopQ);
if (null == shopIds || shopIds.size() <= 0) {
floorMerchantIds = new ArrayList<Long>();
floorMerchantIds.add(-999L);
return floorMerchantIds;
}
WxMerchantShop merchantShopQ = new WxMerchantShop();
if (null != merchantShopDel) {
merchantShopQ.setIsDel(merchantShopDel);
}
merchantShopQ.updateTenantInfo(tenantEntity);
merchantShopQ.setShopIdList(shopIds);
floorMerchantIds = wxMerchantShopMapper.findMerchantIdList(merchantShopQ);
if (null == floorMerchantIds || floorMerchantIds.size() <= 0) {
floorMerchantIds = new ArrayList<Long>();
floorMerchantIds.add(-999L);
return floorMerchantIds;
}
}
return null;
}
@Override
public PageInfo<WxMerchant> listVoAsPage(WxMerchant record, Integer pageIndex, Integer pageSize,boolean hasRentContractInfo) {
Map<Long,WxRentContract> merchantRentMap = new HashMap<Long,WxRentContract>();
initQueryParam(record,hasRentContractInfo, merchantRentMap);
PageInfo<WxMerchant> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.findList(record));
if (null != pageInfo && null != pageInfo.getList()) {
for (WxMerchant merchant : pageInfo.getList()) {
if (hasRentContractInfo) {
WxRentContract contract = merchantRentMap.get(merchant.getId());
if (null != contract) {
merchant.setRentalStartDate(contract.getRentalStartDate());
merchant.setRentalEndDate(contract.getRentalEndDate());
}
}
if (record.getRentShopType() != null) {
List<Map<String, Object>> shops = new ArrayList<>();
WxMerchantShop wxMerchantShop = new WxMerchantShop();
wxMerchantShop.setMerchantId(merchant.getId());
wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode());
List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop);
for (WxMerchantShop merchantShop : wxMerchantShopList) {
WxShop shop = new WxShop();
shop.setId(merchantShop.getShopId());
List<Map<String, Object>> shoplist = wxShopMapper.findListMap(shop);
if (shoplist.size() > 0) {
shops.add(shoplist.get(0));
}
}
merchant.setShoplist(shops);
}
merchant.setShoplist(shops);
}

WxRentContract rc = new WxRentContract();
rc.setMerchantId(merchant.getId());
rc.setTenantId(merchant.getTenantId());
List<WxRentContract> rentContractList = wxRentContractMapper.findList(rc);
if(CollectionUtils.isEmpty(rentContractList)){
merchant.setHasContract(EnumHasContract.NO.getCode());
}else{
merchant.setHasContract(EnumHasContract.HAS.getCode());
WxRentContract rc = new WxRentContract();
rc.setMerchantId(merchant.getId());
rc.setTenantId(merchant.getTenantId());
List<WxRentContract> rentContractList = wxRentContractMapper.findList(rc);
if(CollectionUtils.isEmpty(rentContractList)){
merchant.setHasContract(EnumHasContract.NO.getCode());
}else{
merchant.setHasContract(EnumHasContract.HAS.getCode());
}
}
}
PageInfo<WxMerchant> pageInfo = new PageInfo<>(merchants);
return pageInfo;
}
return pageInfo;
}

@Override
public PageInfo<WxMerchantTradeVo> userTradeList(WxMerchant record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.userTradeList(record));
PageInfo<WxMerchant> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.userTradeMerchantList(record));
PageInfo<WxMerchantTradeVo> retPageInfo = new PageInfo<WxMerchantTradeVo>();
retPageInfo.setPageNum(pageInfo.getPageNum());
retPageInfo.setPageSize(pageInfo.getPageSize());
retPageInfo.setPages(pageInfo.getPages());
retPageInfo.setTotal(pageInfo.getTotal());
retPageInfo.setList(toMerchantTradeVoList(record,pageInfo.getList(),record.getStarttime(),record.getEndtime()));
return retPageInfo;
}
private List<WxMerchantTradeVo> toMerchantTradeVoList(TenantEntity tenantEntity,List<WxMerchant> merchantList,Date startTime,Date endTime) {
if (null == merchantList || merchantList.size() <=0 ) {
return null;
}
List<Long> merchantIds = new ArrayList<Long>();
for (int i = 0 ; i < merchantList.size();i++) {
WxMerchant m = merchantList.get(i);
if (null != m) {
if (!merchantIds.contains(m.getId())) {
merchantIds.add(m.getId());
}
}
}
Map<Long,Map> merchantTradeMap = new HashMap<Long,Map>();
if (merchantIds.size() > 0 ) {
Map param = new HashMap();
param.put("tenantId", tenantEntity.getTenantId());
param.put("parentTenantId", tenantEntity.getParentTenantId());
param.put("starttime", startTime);
param.put("endtime", endTime);
param.put("bMerchantIdList", merchantIds);
List<Map> tradeList = wxCouponOrderMapper.findMerchantUserTradeList(param);
if (null != tradeList && tradeList.size() > 0 ) {
for (int i = 0 ; i < tradeList.size(); i ++) {
Map<String,Object> map = tradeList.get(i);
if (null != map) {
merchantTradeMap.put((Long)map.get("bMerchantId"), map);
}
}
}
}
List<WxMerchantTradeVo> retList = new ArrayList<>();
for (int i = 0 ; i < merchantList.size();i++) {
WxMerchant m = merchantList.get(i);
if (null != m) {
WxMerchantTradeVo vo = new WxMerchantTradeVo();
vo.setId(m.getId());
vo.setCover(m.getImgUrl());
vo.setMerchantName(m.getName());
vo.setLinkName(m.getLinkPerson());
Map tradeMap = merchantTradeMap.get(m.getId());
if (null != tradeMap) {
Integer consumeCount = (Integer)tradeMap.get("consumeCount");
vo.setConsumeCount(consumeCount==null?0:consumeCount);
Integer consumeCountP = (Integer)tradeMap.get("consumeCountP");
vo.setConsumeCountP(consumeCountP==null?0:consumeCountP);
Integer tradeAmt = (Integer)tradeMap.get("tradeAmt");
vo.setTradeAmt(tradeAmt==null?0:tradeAmt);
}
retList.add(vo);;
}
}
if(retList.size() <= 0) {
return null;
}
return retList;
}

@Override
public void exportUserTradeList(WxMerchant record,HttpServletRequest request, HttpServletResponse response) {
List<WxMerchantTradeDetailVo> datalist = wxMerchantMapper.userTradeDetailList(record);
PageInfo<WxMerchantTradeDetailVo> pageInfo = wxCouponOrderService.userTradeDetailList(record,record.getStarttime(),record.getEndtime(),1,10000);
List<WxMerchantTradeDetailVo> datalist = null;
if (null == pageInfo || null == pageInfo.getList()) {
datalist = new ArrayList<WxMerchantTradeDetailVo>();
}else {
datalist = pageInfo.getList();
}
datalist.stream().forEach(e->{
if(e.getTradeDate() != null) {
e.setTradeDateStr(DateUtils.formatDateTime(e.getTradeDate()));
@@ -918,7 +1202,7 @@ public class WxMerchantServiceImpl implements WxMerchantService {

@Override
public PageInfo<WxMerchantTradeDetailVo> userTradeDetailList(WxMerchant record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.userTradeDetailList(record));
return wxCouponOrderService.userTradeDetailList(record,record.getStarttime(),record.getEndtime(),pageIndex,pageSize);
}
@Override
@@ -953,7 +1237,7 @@ public class WxMerchantServiceImpl implements WxMerchantService {
Map<Long,List<WxShopVo>> merchantShopVoList = null;
if (hasShop) {
merchantShopVoList = wxShopService.findMerchantShopVoList(tenantEntity,merchantIds);
merchantShopVoList = wxShopService.findMerchantShopVoListMap(tenantEntity,merchantIds);
}
Map<Long,List<WxMerchantVo>> retMap = new HashMap<Long,List<WxMerchantVo>>();
@@ -997,7 +1281,7 @@ public class WxMerchantServiceImpl implements WxMerchantService {
vo.setSubBusinessId(m.getSubBusinessId());
vo.setParameter(cm.getParameter());
vo.setLinkLinePhone(m.getLinkLinePhone());
if (hasShop) {
if (hasShop && null != merchantShopVoList) {
vo.setShopVoList(merchantShopVoList.get(vo.getId()));
}
return vo;
@@ -1014,14 +1298,6 @@ public class WxMerchantServiceImpl implements WxMerchantService {
return null;
}

@Override
public PageInfo<WxMerchant> listVoAsPage2(WxMerchant record, Integer pageIndex, Integer pageSize) {
PageHelper.startPage(pageIndex, pageSize);
List<WxMerchant> merchants = wxMerchantMapper.findListVo2(record);
PageInfo<WxMerchant> pageInfo = new PageInfo<>(merchants);
return pageInfo;
}

@Override
public List<WxMerchant> getMerchantList(WxMerchant wxMerchant) {
return wxMerchantMapper.getMerchantList(wxMerchant);
@@ -1229,22 +1505,62 @@ public class WxMerchantServiceImpl implements WxMerchantService {

@Override
public Map<String, Object> findMerchantByShop(Long shopId) {
List<Map<String, Object>> merchantByShop = wxMerchantMapper.findMerchantByShop(shopId);
if(merchantByShop != null && merchantByShop.size() > 0){
return merchantByShop.get(0);
}
return null;
return getShopMerchantMap(shopId,1);
}

private Map<String, Object> getShopMerchantMap(Long shopId,int type) {
WxShop shop = wxShopMapper.selectById(shopId);
if (null == shop) {
return null;
}
WxMerchantShop merchantShopQ = new WxMerchantShop();
merchantShopQ.setShopId(shopId);
merchantShopQ.setIsDel(0);
List<WxMerchantShop> merchantShopList = wxMerchantShopMapper.findList(merchantShopQ);
if (null == merchantShopList || merchantShopList.size() <= 0 ) {
return null;
}
WxMerchantShop ms = merchantShopList.get(0);
Long merchantId = ms.getMerchantId();
Map<String,Object> merchantMap = null;
if (1== type) {
merchantMap = wxMerchantMapper.findShopMerchant(merchantId);
}else if (2== type) {
merchantMap = wxMerchantMapper.detailShopMerchantById(ms,merchantId);
}
if (null == merchantMap) {
return null;
}
Long brandId = (Long)merchantMap.get("brand");
if (null != brandId) {
WxBrand brand = wxBrandMapper.selectById(brandId);
if (null != brand) {
merchantMap.put("brandName", brand.getName());
}
}
Integer businessId = (Integer)merchantMap.get("business_id");
if (null != businessId) {
WxBusiness business = wxBusinessMapper.selectById(brandId);
if (null != business) {
merchantMap.put("businessTitle", business.getTitle());
}
}
WxMerchantCorp wxMerchantCorpQ = new WxMerchantCorp();
wxMerchantCorpQ.setMerchantId(merchantId);
List<WxMerchantCorp> clist = wxMerchantCorpMapper.findList(wxMerchantCorpQ);
if (null != clist && clist.size() >0 ) {
WxMerchantCorp mc = clist.get(0);
merchantMap.put("corpPapersRegisterNumber", mc.getCorpPapersRegisterNumber());
merchantMap.put("corpPapersAddress", mc.getCorpPapersAddress());
}
return merchantMap;
}
@Override
public Map<String, Object> detailByShopId(TenantEntity tenantInfo, Long shopId) {
List<Map<String, Object>> merchants = wxMerchantMapper.detailByShopId(tenantInfo,shopId);
if(merchants != null && merchants.size() > 0){
return merchants.get(0);
}
return null;
return getShopMerchantMap(shopId,2);
}


}

+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantTradeDailyServiceImpl.java Vedi File

@@ -47,7 +47,7 @@ public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyServ
ExcelService excelService;

@Autowired
WxShopMapper wxShopMapper;
WxShopService wxShopService;


@Override
@@ -186,7 +186,7 @@ public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyServ

list.stream().forEach(m -> {
//商铺信息
m.setShopVos(wxShopMapper.findShopVoList(m.getMerchantId()));
m.setShopVos(wxShopService.findMerchantShopVoList(m,m.getMerchantId()));
});
//商铺信息



+ 14
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverServiceImpl.java Vedi File

@@ -25,6 +25,7 @@ import com.iformall.mq.MqBaseProducer;
import com.iformall.pay.WxPayment;
import com.iformall.pay.WxProfitSharing;
import com.iformall.pay.WxProfitSharingReceiverP;
import com.iformall.service.WxMerchantService;
import com.iformall.service.WxProfitSharingReceiverService;
import com.iformall.service.pay.PayServiceFactory;
import com.iformall.service.pay.service.share.entity.ShareAccountResult;
@@ -35,6 +36,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import java.util.Date;
@@ -63,8 +65,11 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv
WxAppinfoMapper wxAppinfoMapper;
@Autowired
WxPayAccountMapper wxPayAccountMapper;
@Lazy
@Autowired
WxMerchantMapper wxMerchantMapper;
WxMerchantService wxMerchantService;
@Autowired
private MqBaseProducer mqBaseProducer;
@@ -169,8 +174,14 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv
private void sendMsgByType(Integer type, Long merchantId, String account, TenantEntity tenantEntity) {
WxMerchantDto wxMerchantDto = new WxMerchantDto();
wxMerchantDto.setId(merchantId);
List<WxMerchantVo> listCVo = wxMerchantMapper.findListCVo(wxMerchantDto);
if (listCVo.isEmpty()) {
wxMerchantDto.updateTenantInfo(tenantEntity);
PageInfo<WxMerchantVo> pageInfo = wxMerchantService.listAsPageCVo(wxMerchantDto,1,1,false);
if (null == pageInfo) {
logger.info("更新商户分账账户发短信时未找到商户:" + merchantId);
return;
}
List<WxMerchantVo> listCVo = pageInfo.getList();
if (null == listCVo || listCVo.isEmpty()) {
logger.info("更新商户分账账户发短信时未找到商户:" + merchantId);
return;
}


+ 11
- 8
mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java Vedi File

@@ -124,7 +124,7 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {

@Override
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
public ResultData createRefundOrder(WxAppinfo appInfo, Long couponOrderId, EnumPayType payType, Long bUserId, Long aUserId) {
public ResultData createRefundOrder(WxAppinfo appInfo, Long couponOrderId, EnumPayType payType, WxMerchantBUser bUser, Long aUserId) {
WxCouponOrder wxCouponOrder = wxCouponOrderMapper.selectById(couponOrderId,appInfo.getTenantId());
if (wxCouponOrder == null) {
logger.error("券ID不存在:" + couponOrderId);
@@ -137,15 +137,15 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {
}

if (payType == EnumPayType.PAY_B_REFUND) {
logger.info("B端发起退款: bUserId-" + bUserId);
if (bUserId == null || bUserId == 0) {
logger.error("B端用户不存在:" + bUserId);
logger.info("B端发起退款: bUserId-" + bUser);
if (bUser == null || bUser.getId() == 0) {
logger.error("B端用户不存在:" + bUser);
throw new MallinkException(ErrorCode.USER_IS_EMPTY);
}
// B端用户退款检查一下商户
WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectById(bUserId);
WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectById(bUser.getId());
if (wxMerchantBUser == null) {
logger.error("操作员ID不存在:" + bUserId);
logger.error("操作员ID不存在:" + bUser.getId());
throw new MallinkException(ErrorCode.REFUND_ORDER_BUSER_IS_NULL);
}
if (!isMerchantOrder(wxOrder, wxMerchantBUser.getMerchantId())) {
@@ -222,7 +222,7 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {
rOrder.setPayVendor(wxOrder.getPayVendor());
rOrder.setCUserId(wxOrder.getCUserId());
if (payType == EnumPayType.PAY_B_REFUND) {
rOrder.setDetail("["+bUserId+"]B端管理员操作退款"); //B端发起退款后存B端用户ID在此
rOrder.setDetail("["+bUser.getId()+"]B端管理员操作退款"); //B端发起退款后存B端用户ID在此
}else if (payType == EnumPayType.PAY_ADMIN_REFUND) {
rOrder.setDetail("["+aUserId+"]A端管理员操作退款");
} else if (payType == EnumPayType.PAY_AUTO_REFUND) {
@@ -252,14 +252,17 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {
wxCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_INVALID.getCode()); //3退款,券作废
}
if (payType == EnumPayType.PAY_B_REFUND) {
wxCouponOrder.setBUserId(bUserId);
wxCouponOrder.setBUserId(bUser.getId());
wxCouponOrder.setAUserId(payType.getCode().longValue());
wxCouponOrder.setBMerchantId(bUser.getMerchantId());
} else if (payType == EnumPayType.PAY_ADMIN_REFUND) {
wxCouponOrder.setBUserId(payType.getCode().longValue());
wxCouponOrder.setAUserId(aUserId);
wxCouponOrder.setBMerchantId(0L);
} else {
wxCouponOrder.setBUserId(payType.getCode().longValue());
wxCouponOrder.setAUserId(payType.getCode().longValue());
wxCouponOrder.setBMerchantId(0L);
}
wxCouponOrder.setUpdateDate(currentDate);
try {


+ 11
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java Vedi File

@@ -273,7 +273,7 @@ public class WxShopServiceImpl implements WxShopService {
}

@Override
public Map<Long,List<WxShopVo>> findMerchantShopVoList(TenantEntity tenantEntity, List<Long> merchantIds) {
public Map<Long,List<WxShopVo>> findMerchantShopVoListMap(TenantEntity tenantEntity, List<Long> merchantIds) {
Map<Long,String> floorMap = wxMallFloorService.getFloorMap(tenantEntity);
Map<Long,String> buildingMap = wxMallBuildingService.getBuildingMap(tenantEntity);
List<Long> shopIds = wxMerchantShopMapper.findShopIds(merchantIds);
@@ -292,9 +292,10 @@ public class WxShopServiceImpl implements WxShopService {
WxMerchantShop merchantShopQ = new WxMerchantShop();
merchantShopQ.updateTenantInfo(tenantEntity);
merchantShopQ.setMerchantIds(merchantIds);
merchantShopQ.setIsDel(0);
List<WxMerchantShop> merchantShops = wxMerchantShopMapper.findList(merchantShopQ);
if (null == merchantShops) {
return null;
return retMap;
}
for (int i = 0 ; i < merchantShops.size(); i ++) {
WxMerchantShop ms = merchantShops.get(i);
@@ -312,4 +313,12 @@ public class WxShopServiceImpl implements WxShopService {
}
return retMap;
}
@Override
public List<WxShopVo> findMerchantShopVoList(TenantEntity tenantEntity,Long merchantId) {
List<Long> merchantIds = new ArrayList<Long>();
merchantIds.add(merchantId);
Map<Long,List<WxShopVo>> map = findMerchantShopVoListMap(tenantEntity, merchantIds);
return map.get(merchantId);
}
}

+ 88
- 26
mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml Vedi File

@@ -10,6 +10,7 @@
<result column="c_user_id" jdbcType="BIGINT" property="cUserId" />
<result column="owner_id" jdbcType="BIGINT" property="ownerId" />
<result column="b_user_id" jdbcType="BIGINT" property="bUserId" />
<result column="b_merchant_id" jdbcType="BIGINT" property="bMerchantId" />
<result column="a_user_id" jdbcType="BIGINT" property="aUserId" />
<result column="order_id" jdbcType="BIGINT" property="orderId" />
<result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime" />
@@ -37,7 +38,7 @@
</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`coupon_type`,`c_user_id`,`owner_id`,`b_user_id`,`order_id`,`expired_time`,`coupon_order_status`,`create_date`,`update_date`,`coupon_price`, `auto_refund`,
`id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`coupon_type`,`c_user_id`,`owner_id`,`b_user_id`,`b_merchant_id`,`order_id`,`expired_time`,`coupon_order_status`,`create_date`,`update_date`,`coupon_price`, `auto_refund`,
`verify_type`,`verify_remark`,`pay_vendor`,`send_merchant_id`,`send_merchant_user_id`,`compose_order_type`,`compose_order_id`,`parent_coupon_order_id`,`coupon_number`,
`freight_price`,`shipping_type`,`shipping_address`,`shipping_status`,`delivery_info`,`subsidy`
</sql>
@@ -70,6 +71,10 @@
<if test=" null != bUserId ">
and `b_user_id` = #{bUserId}
</if>
<if test=" null != bMerchantId ">
and `b_merchant_id` = #{bMerchantId}
</if>

<if test=" null != aUserId ">
and `a_user_id` = #{aUserId}
@@ -154,17 +159,14 @@
</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.order_id,co.expired_time,
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.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.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`
from wx_coupon_order co
where co.tenant_id = #{tenantId}
AND co.coupon_order_status = '1'
<if test=" null != bUserIdList ">
and co.b_user_id in
<foreach collection="bUserIdList" index="index" item="bUserIdItem" open="(" separator="," close=")">
#{bUserIdItem}
</foreach>
<if test=" null != bMerchantId ">
and co.b_merchant_id = #{bMerchantId}
</if>
<if test="startDate != null">
AND co.update_date &gt; #{startDate,jdbcType=TIMESTAMP}
@@ -176,7 +178,7 @@
</select>
<select id="findListOfOrderedByDateForBUser" 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.order_id,co.expired_time,
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.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.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`
from wx_coupon_order co
@@ -200,6 +202,9 @@
update wx_coupon_order
set `coupon_order_status` = #{couponOrderStatus},
`b_user_id` = #{bUserId},
<if test=" null != bMerchantId">
`b_merchant_id` = #{bMerchantId},
</if>
`update_date` = #{updateDate},
`verify_type` = #{verifyType}
<if test=" null != verifyRemark">
@@ -221,6 +226,9 @@
update wx_coupon_order
set `coupon_order_status` = #{couponOrderStatus},
`b_user_id` = #{bUserId},
<if test=" null != bMerchantId">
`b_merchant_id` = #{bMerchantId},
</if>
`update_date` = #{updateDate},
`verify_type` = #{verifyType}
<if test=" null != verifyRemark">
@@ -248,6 +256,9 @@
update wx_coupon_order
set `coupon_order_status` = #{couponOrderStatus},
`b_user_id` = #{bUserId},
<if test=" null != bMerchantId">
`b_merchant_id` = #{bMerchantId},
</if>
`update_date` = #{updateDate},
`verify_type` = #{verifyType}
<if test=" null != verifyRemark">
@@ -270,6 +281,7 @@
update wx_coupon_order
set `coupon_order_status` = #{couponOrderStatus},
`b_user_id` = null,
`b_merchant_id` = null,
`update_date` = #{updateDate},
`verify_type` = null
where id=#{id}
@@ -684,7 +696,7 @@
</select>

<select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" 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.expired_time,co.coupon_order_status,co.order_id,
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.expired_time,co.coupon_order_status,co.order_id,
co.create_date,co.update_date,co.coupon_price, co.verify_type, co.verify_remark,co.pay_vendor,
co.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`,co.send_merchant_id,co.subsidy
FROM wx_coupon_order co where co.`tenant_id` = #{tenantId}
@@ -755,10 +767,10 @@
</foreach>
</if>
<if test=" null != bUserIdList">
and co.b_user_id in
<foreach collection="bUserIdList" index="index" item="bUserIdItem" open="(" separator="," close=")">
#{bUserIdItem}
<if test=" null != bMerchantIdList">
and co.b_merchant_id in
<foreach collection="bMerchantIdList" index="index" item="bMerchantIdItem" open="(" separator="," close=")">
#{bMerchantIdItem}
</foreach>
</if>
@@ -768,7 +780,7 @@
</select>
<select id="findDetailOfAdmin" parameterType="java.util.HashMap" 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,
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.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.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`,co.subsidy
FROM wx_coupon_order co
@@ -778,7 +790,7 @@

<select id="findGoodsList" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" 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.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.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.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`
FROM wx_coupon_order co
@@ -843,7 +855,7 @@
</select>

<select id="findListOfOrderedByDate" 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,
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.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.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`
from wx_coupon_order co
@@ -864,17 +876,14 @@
</select>

<select id="findListOfVerifiedByDate" 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,
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.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.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`
from wx_coupon_order co
where co.coupon_order_status = '1'
and co.tenant_id = #{tenantId}
<if test=" null != bUserIdList">
and co.b_user_id in
<foreach collection="bUserIdList" index="index" item="bUserIdItem" open="(" separator="," close=")">
#{bUserIdItem}
</foreach>
<if test=" null != bMerchantId">
AND co.b_merchant_id = #{bMerchantId}
</if>
<if test="startDate != null">
AND co.update_date &gt; #{startDate,jdbcType=TIMESTAMP}
@@ -926,7 +935,7 @@

<select id="findDetailOfCUser" parameterType="java.util.HashMap" 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.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.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.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.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`
from wx_coupon_order co
where co.id = #{id} and co.tenant_id = #{tenantId}
@@ -934,7 +943,7 @@

<select id="findCouponOrderForPos" parameterType="java.util.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.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.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.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.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`
from wx_coupon_order co
where co.c_user_id = #{cUserId}
@@ -1021,7 +1030,7 @@

<select id="findCardDetailOfCUser" parameterType="java.util.HashMap" 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.order_id,co.expired_time,co.coupon_order_status,
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.order_id,co.expired_time,co.coupon_order_status,
co.create_date,co.update_date,co.coupon_price
from wx_coupon_order co where co.id = #{id} and co.tenant_id = #{tenantId}
</select>
@@ -1057,12 +1066,65 @@
<if test=" null != endTime ">
AND co.update_date &lt;= #{endTime}
</if>
<if test=" null != bUserIdList">
<if test=" null != bMerchantId">
AND co.b_merchant_id = #{bMerchantId}
</if>
</select>
<select id="findMerchantUserTradeList" parameterType="map" resultType="map">
select count(co.b_merchant_id) AS consumeCountP,count(DISTINCT co.b_merchant_id) AS consumeCount,sum(co.coupon_price) AS tradeAmt, co.b_merchant_id as bMerchantId from
wx_coupon_order co
WHERE co.coupon_order_status = 1 and co.b_merchant_id is not null and co.b_merchant_id > 0
<if test=" null != tenantId and '' != tenantId">
and co.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and co.`parent_tenant_id` = #{parentTenantId}
</if>
<if test="starttime != null">
and co.create_date &gt;= #{starttime}
</if>
<if test="endtime != null">
and co.create_date &lt;= #{endtime}
</if>
<if test=" null != bMerchantId">
AND co.b_merchant_id = #{bMerchantId}
</if>
<if test=" null != bMerchantIdList">
and co.b_merchant_id in
<foreach collection="bMerchantIdList" index="index" item="bMerchantIdItem" open="(" separator="," close=")">
#{bMerchantIdItem}
</foreach>
</if>
group by co.b_merchant_id
</select>
<select id="findUserTradeList" parameterType="com.iformall.domain.po.WxCouponOrder" resultMap="BaseResultMap">
select co.create_date,co.coupon_id,co.c_user_id
from wx_coupon_order co
WHERE co.coupon_order_status=1
<if test=" null != tenantId and '' != tenantId">
and co.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and co.`parent_tenant_id` = #{parentTenantId}
</if>
<if test="startTime != null">
and co.create_date &gt;= #{startTime}
</if>
<if test="endTime != null">
and co.create_date &lt;= #{endTime}
</if>
<if test=" null != bUserIdList">
and co.b_user_id in
<foreach collection="bUserIdList" index="index" item="bUserIdItem" open="(" separator="," close=")">
#{bUserIdItem}
</foreach>
</if>
<if test=" null != sortColumns">order by ${sortColumns}</if>
<if test=" null == sortColumns">order by co.create_date desc</if>
</select>

</mapper>

+ 10
- 0
mallinkService/src/main/resources/mapper/WxMerchantBUserMapper.xml Vedi File

@@ -38,6 +38,10 @@
<if test=" null != phone ">
and `phone` = #{phone}
</if>
<if test=" null != phoneLike ">
and `phone` like concat('%', #{phoneLike},'%')
</if>

<if test=" null != userPwd ">
and `user_pwd` like concat('%', #{userPwd},'%')
@@ -108,6 +112,12 @@
</foreach>
</if>
</select>
<select id="findMerchantIdList" parameterType="com.iformall.domain.po.WxMerchantBUser" resultType="Long">
select distinct merchant_id
from wx_merchant_b_user
<include refid="dynamicWhereConditions"/>
</select>
<select id="findIdList" parameterType="com.iformall.domain.po.WxMerchantBUser" resultType="Long">
select id


+ 57
- 404
mallinkService/src/main/resources/mapper/WxMerchantMapper.xml Vedi File

@@ -54,12 +54,6 @@
m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.credit_locked,m.credit_locked,m.entry_amount,m.cash_out_count,m.cash_out_last_time
</sql>
<sql id="allColumnsVo">
m.`id`,m.`tenant_id`,m.`parent_tenant_id`,m.`img_url`,m.`name`,m.`encode`,m.`link_phone`,m.`create_date`,m.`update_date`,m.`car_vendor_type`,m.`car_params`,m.`status`,m.`link_person`,
m.`business_id`,m.`business_types`,m.`sub_business_id`,m.`shop_type`,m.`brand`,m.`type`,m.`is_public`,m.email,m.`title`,m.`cover_picture`,m.`is_admin`,m.`bill_setting`,m.`qr_code`,m.`tt_qr_code`,
m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,r.rental_start_date,r.rental_end_date,m.entry_amount,m.cash_out_number,m.cash_out_count,m.cash_out_last_time
</sql>
<sql id="dynamicWhereConditions">
where m.is_del = 0

@@ -92,7 +86,13 @@
<if test=" null != linkPerson and ''!=linkPerson ">
and m.`link_person` like concat('%', #{linkPerson},'%')
</if>

<if test=" null != createDate ">
and m.`create_date` = #{createDate}
</if>
<if test=" null != updateDate ">
and m.`update_date` = #{updateDate}
</if>
<if test="starttime != null">
and m.create_date &gt;= #{starttime}
</if>
@@ -107,6 +107,9 @@
<if test=" null != businessId ">
and m.`business_id` = #{businessId}
</if>
<if test=" null != businessForRule and '' != businessForRule ">
and m.business_id in (${businessForRule}) and m.is_del=0
</if>

<if test=" null != businessTypes ">
and JSON_CONTAINS(m.business_types,JSON_OBJECT('id', #{businessTypes}))
@@ -152,47 +155,18 @@
<if test=" null != creditLocked ">
and m.`credit_locked` = #{creditLocked}
</if>
<if test=" null != rentShopType ">
and m.id not in(
select merchant_id from wx_rent_contract where rent_shop_type=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and merchant_id is not null and status in(1,2,3,4)
)
</if>
<if test=" null != ids ">
and m.id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test="(null != floorForRule and '' != floorForRule) or (null != businessForRule and '' != businessForRule)">
and m.id in(
select ms.merchant_id from (select merchant_id,shop_id from wx_merchant_shop where is_del=0) ms
inner join wx_merchant m on ms.merchant_id = m.id
inner join wx_shop s on s.id=ms.shop_id
where s.is_del=0
<if test=" null != tenantId and '' != tenantId">
and m.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and m.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != businessForRule and '' != businessForRule ">
and m.business_id in (${businessForRule})
</if>
<if test=" null != floorForRule and '' != floorForRule ">
and s.`floor` in (${floorForRule})
</if>
)
</if>
<if test=" null != notInids ">
and m.id not in
<foreach collection="notInids" index="index" item="notInIdItem" open="(" separator="," close=")">
#{notInIdItem}
</foreach>
</if>
<if test=" null != sortColumns">order by ${sortColumns}</if>
</sql>

@@ -215,268 +189,30 @@
<include refid="dynamicWhereConditions"/>
</select>

<select id="findListVo" parameterType="com.iformall.domain.po.WxMerchant" resultMap="BaseResultMap">
select
<include refid="allColumnsVo"/>
from wx_merchant m left join (select merchant_id,rental_start_date,rental_end_date from wx_rent_contract
where 1=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and status in(2,3,4)) r
on m.id=r.merchant_id
<include refid="dynamicWhereConditionsVo"/>
<if test=" null != sortColumns">order by ${sortColumns}</if>
</select>

<select id="findListVo2" parameterType="com.iformall.domain.po.WxMerchant" resultMap="BaseResultMap">
select distinct m.* from wx_merchant m
left join wx_merchant_b_user wmbu on wmbu.merchant_id = m.id
<include refid="dynamicWhereConditionsVo"/>

<if test=" null != phone and ''!=phone ">
and wmbu.`phone` like concat('%', #{phone},'%')
and wmbu.`status` = 0
</if>

<if test=" null != sortColumns">order by ${sortColumns}</if>

</select>

<select id="getMerchantByEncode" parameterType="String" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_merchant m where m.encode = #{encode}
</select>
<sql id="dataRule">
<if test="(null != floorForRule and '' != floorForRule) or (null != businessForRule and '' != businessForRule)">
and m.id in(
select ms.merchant_id from (select merchant_id,shop_id from wx_merchant_shop where is_del=0) ms
inner join wx_merchant m on ms.merchant_id = m.id
inner join wx_shop s on s.id=ms.shop_id
where s.is_del=0
<if test=" null != tenantId and '' != tenantId">
and m.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and m.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != businessForRule and '' != businessForRule ">
and m.business_id in (${businessForRule})
</if>
<if test=" null != floorForRule and '' != floorForRule ">
and s.`floor` in (${floorForRule})
</if>
)
</if>
</sql>
<sql id="dynamicWhereConditionsVo">
where m.is_del = 0
<if test=" null != id ">
and m.`id` = #{id}
</if>

<select id="getMerchantByCode" parameterType="java.util.Map" resultMap="BaseResultMap">
select <include refid="allColumns"/>
FROM wx_merchant m where md5(m.`id`) = #{merchantCode}
<if test=" null != tenantId and '' != tenantId">
and m.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and m.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != imgUrl ">
and m.`img_url` like concat('%', #{imgUrl},'%')
</if>
<if test=" null != name and '' != name ">
and m.`name` like concat('%', #{name},'%')
</if>

<if test=" null != encode and '' != encode ">
and m.`encode` like concat('%', #{encode},'%')
</if>
<if test=" null != linkPhone and '' != linkPhone ">
and m.`link_phone` like concat('%', #{linkPhone},'%')
</if>
<if test=" null != createDate ">
and m.`create_date` = #{createDate}
</if>
<if test=" null != updateDate ">
and m.`update_date` = #{updateDate}
</if>
<if test=" null != carVendorType ">
and m.`car_vendor_type` = #{carVendorType}
</if>
<if test=" null != businessId ">
and m.`business_id` = #{businessId}
</if>
<if test=" null != subBusinessId ">
and m.`sub_business_id` = #{subBusinessId}
</if>
<if test=" null != carParams ">
and m.`car_params` like concat('%', #{carParams},'%')
</if>
<if test=" null != status ">
and m.`status` = #{status}
</if>
<if test=" null != linkPerson ">
and m.`link_person` = #{linkPerson}
</if>
<if test=" null != type ">
and m.`type` = #{type}
</if>
<if test=" null != isPublic ">
and m.`is_public` = #{isPublic}
</if>
<if test=" null != email ">
and m.`email` = #{email}
</if>
<if test=" null != isAdmin ">
and m.`is_admin` = #{isAdmin}
</if>
<if test=" null != mark ">
<if test="mark == 0" >
and (m.`mark` is null or m.`mark` &lt;&gt; 1)
</if>
<if test="mark == 1" >
and m.`mark` = 1
</if>
</if>
<if test=" null != isDel ">
and m.`is_del` = #{isDel}
</if>
<if test=" null != brand ">
and m.`brand` = #{brand}
</if>
<if test=" null != rentShopType ">
and m.id not in(
select merchant_id from wx_rent_contract where rent_shop_type=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and merchant_id is not null and status in(1,2,3,4,8)
)
</if>
<if test=" null != ids ">
and m.id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != building or null != floor">
and m.id in(
select ms.merchant_id from (select merchant_id,shop_id from wx_merchant_shop where is_del=0) ms
inner join wx_merchant m on ms.merchant_id = m.id
inner join wx_shop s on s.id=ms.shop_id
where s.is_del=0
<if test=" null != building ">
and s.`building`= #{building}
</if>
<if test=" null != floor">
and s.`floor` = #{floor}
</if>
)

</if>
<include refid="dataRule"/>

</sql>
<sql id="allMerchantVoColumns">
distinct m.id,m.img_url,m.name,m.encode,m.link_phone,m.status,m.business_id,
m.is_public,m.email,m.title,m.cover_picture,m.sub_business_id,
m.shop_type,m.introduction,m.action_desc,bu.title as business_name,m.link_line_phone,m.top_time
</sql>
<select id="getMerchantByCode" parameterType="java.util.Map" resultMap="MerchantVoResultMap">
select
<include refid="allMerchantVoColumns"/>
FROM wx_merchant m
left join wx_business bu on bu.id = m.business_id
<where>
<if test=" null != tenantId and '' != tenantId">
and m.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and m.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != status ">
and m.`status` = #{status}
</if>
<if test=" null != merchantCode ">
and md5(m.`id`) = #{merchantCode}
</if>
</where>
</select>
<resultMap id="MerchantVoResultMap" type="com.iformall.domain.vo.WxMerchantVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl"/>
<result column="name" jdbcType="VARCHAR" property="merchantName"/>
<result column="encode" jdbcType="VARCHAR" property="merchantEncode"/>
<result column="link_phone" jdbcType="VARCHAR" property="merchantLinkPhone"/>
<result column="status" jdbcType="VARCHAR" property="merchantStatus"/>
<result column="business_id" jdbcType="INTEGER" property="businessId"/>
<result column="sub_business_id" jdbcType="INTEGER" property="subBusinessId"/>
<result column="is_public" jdbcType="INTEGER" property="isPublic"/>
<result column="email" jdbcType="VARCHAR" property="email"/>
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="cover_picture" jdbcType="VARCHAR" property="coverPicture"/>
<result column="shop_type" jdbcType="VARCHAR" property="shopType"/>
<result column="brand_name" jdbcType="VARCHAR" property="brandName"/>
<result column="brand_img" jdbcType="VARCHAR" property="brandImg"/>
<result column="summary" jdbcType="VARCHAR" property="summary"/>
<result column="business_name" jdbcType="VARCHAR" property="businessName"/>

<result column="introduction" jdbcType="VARCHAR" property="introduction"/>
<result column="action_desc" jdbcType="VARCHAR" property="actionDesc"/>
<result column="link_line_phone" property="linkLinePhone"/>
<result column="top_time" property="topTime"/>

<collection column="{merchantId=id}" property="shopVoList"
ofType="com.iformall.domain.vo.WxShopVo"
javaType="java.util.List"
select="com.iformall.mapper.WxShopMapper.findShopVoList">
</collection>
</resultMap>

<select id="findListCVo" parameterType="com.iformall.domain.dto.WxMerchantDto" resultMap="MerchantVoResultMap">
<select id="findListCVo" parameterType="com.iformall.domain.dto.WxMerchantDto" resultMap="BaseResultMap">
select
<include refid="allMerchantVoColumns"/>
FROM wx_merchant m
<if test=" null != building or null != floor ">
join wx_merchant_shop ms on ms.merchant_id=m.id
join wx_shop s on ms.shop_id=s.id
<if test=" null != building">
and s.building = #{building}
</if>
<if test=" null != floor ">
and s.floor = #{floor}
</if>
</if>
left join wx_business bu on bu.id = m.business_id
where 1=1 and m.is_del=0
<include refid="allColumns"/>
FROM wx_merchant m where m.is_del=0
<if test=" null != tenantId and '' != tenantId">
and m.`tenant_id` = #{tenantId}
</if>
@@ -510,57 +246,49 @@
<if test=" null != id">
and m.`id` = #{id}
</if>
<if test=" null != ids ">
and m.id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
order by m.top_time desc
</select>
<select id="queryMerchantByMerchantIdOfSharingReceiver" resultType="com.iformall.domain.po.WxMerchant"
parameterType="com.iformall.domain.po.WxMerchant">
select m.name,psr.id from wx_merchant m
left join (select * from wx_profit_sharing_receiver where status=0) psr on m.id=psr.merchant_id
where m.id=#{id}
</select>

<select id="findQrcodeEmptyList" resultMap="BaseResultMap">
select * from wx_merchant where (qr_code is null or tt_qr_code is null);
select <include refid="allColumns"/> from wx_merchant where (qr_code is null or tt_qr_code is null);
</select>

<select id="findBusByFloorId" resultType="hashmap" parameterType="hashmap">
select count(distinct m.id) count,b.id bid,b.`title` btitle from wx_merchant m
left join wx_merchant_shop ms on(m.id = ms.merchant_id)
left join wx_shop s on(ms.shop_id = s.id)
left join wx_mall_floor f on(s.floor = f.id)
left join wx_mall_building mb on(f.building_id = mb.id)
left join wx_business b on(m.business_id = b.id)
where 1=1
<if test=" null != id">
and f.id = #{id}
</if>
<if test=" null != buildingId">
and mb.id = #{buildingId}
</if>
select count(distinct m.id) count,m.business_id bid
from wx_merchant m
where m.status = 1 and m.is_del = 0
<if test=" null != tenantId and '' != tenantId">
and m.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and m.`parent_tenant_id` = #{parentTenantId}
</if>
and s.is_del = 0
and ms.is_del = 0
and m.status = 1
and m.is_del = 0
<if test=" null != ids ">
and m.id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
group by m.business_id
</select>
<select id="hasMerchant" parameterType="com.iformall.domain.po.WxMerchant" resultType="int">
select count(*) from wx_merchant where `name`=#{name} and status=#{status}
select count(1) from wx_merchant where `name`=#{name} and status=#{status}
<if test=" null != id">
and `id` != #{id}
</if>
</select>

<select id="hasMerchantEncode" parameterType="com.iformall.domain.po.WxMerchant" resultType="int">
select count(*) from wx_merchant where `encode`=#{encode}
select count(1) from wx_merchant where `encode`=#{encode}
<if test=" null != id">
and `id` != #{id}
</if>
@@ -570,34 +298,10 @@
update wx_merchant set credit_locked = #{creditLocked} where tenant_id = #{tenantId}
</update>

<select id="userTradeList" parameterType="com.iformall.domain.po.WxMerchant" resultType="com.iformall.domain.vo.WxMerchantTradeVo">
SELECT m.id, m.`img_url` cover, m.`name` merchantName,m.`encode` merchantEncode, m.`link_person` linkName,
ifnull(consume.consumeCount,0) consumeCount,ifnull(consume.consumeCountP,0) as consumeCountP,
ifnull(consume.tradeAmt,0) tradeAmt
<select id="userTradeMerchantList" parameterType="com.iformall.domain.po.WxMerchant" resultMap="BaseResultMap">
SELECT m.id, m.`img_url` , m.`name` ,m.`encode` , m.`link_person`
FROM wx_merchant m
left join (select count(co.c_user_id) AS consumeCountP,
count(DISTINCT co.c_user_id) AS consumeCount,sum(co.coupon_price) AS tradeAmt, m.id as merchant_id from
wx_coupon_order co
left join (select m.id,mbu.id as b_user_id from wx_merchant m
left join wx_merchant_b_user mbu on m.id=mbu.merchant_id where mbu.status=0) m
on co.b_user_id=m.b_user_id
WHERE co.coupon_order_status = 1
<if test=" null != tenantId and '' != tenantId">
and co.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and co.`parent_tenant_id` = #{parentTenantId}
</if>
<if test="starttime != null">
and co.create_date &gt;= #{starttime}
</if>
<if test="endtime != null">
and co.create_date &lt;= #{endtime}
</if>
group by m.id
) consume on consume.merchant_id=m.id
where m.status=1
where m.status=1
<if test=" null != name and ''!=name ">
and `name` like concat('%', #{name},'%')
</if>
@@ -611,54 +315,18 @@
<if test=" null != sortColumns">order by ${sortColumns}</if>
</select>

<select id="userTradeDetailList" parameterType="com.iformall.domain.po.WxMerchant" resultType="com.iformall.domain.vo.WxMerchantTradeDetailVo">
select cb.`name` 'userName',cb.`phone`,co.title couponName,co.`sale_price` couponSale ,co.price couponPrice,
co.price tradeAmt,o.create_date tradeDate
from wx_coupon_order o
left join wx_coupon co on(o.`coupon_id`=co.id)
left join wx_c_user_basic_info cb on o.c_user_id=cb.id
where o.coupon_order_status=1
<if test=" null != tenantId and '' != tenantId">
and o.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and o.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != id ">
and o.b_user_id in(
select id from wx_merchant_b_user where status=0 and merchant_id=#{id}
)
</if>
<if test=" null != userName and '' != userName ">
and cb.`name` like concat('%', #{userName},'%')
</if>
<if test=" null != phone and '' != phone">
and cb.`phone` like concat('%', #{phone},'%')
</if>
<if test=" null != couponName and '' != couponName">
and co.`title` like concat('%', #{couponName},'%')
</if>
<if test="starttime != null">
and o.create_date &gt;= #{starttime}
</if>
<if test="endtime != null">
and o.create_date &lt;= #{endtime}
</if>
<if test=" null != sortColumns">order by ${sortColumns}</if>
<if test=" null == sortColumns">order by o.create_date desc</if>

</select>

<select id="findByTrade" parameterType="java.util.Map" resultMap="BaseResultMap">
select * from wx_merchant where id in(
select merchant_id from wx_coupon_merchant where product_id=#{id}
)limit 1
select <include refid="allColumns"/> from wx_merchant where
id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
limit 1
</select>


<select id="getMerchantList" parameterType="com.iformall.domain.po.WxMerchant" resultMap="BaseResultMap">
select * from wx_merchant where 1=1 and is_del=0 and status=1
select <include refid="allColumns"/> from wx_merchant where is_del=0 and status=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
@@ -692,42 +360,27 @@
</update>


<select id="findMerchantByShop" parameterType="Long" resultType="hashmap">
<select id="findShopMerchant" parameterType="Long" resultType="hashmap">
select
m.`id`,m.`tenant_id`,m.`parent_tenant_id`,m.`img_url`,m.`name`,m.`encode`,m.`link_phone`,m.`create_date`,m.`update_date`,m.`car_vendor_type`,m.`car_params`,m.`status`,m.`link_person`,
m.`business_id`,m.`business_types`,m.`sub_business_id`,m.`shop_type`,m.`brand`,m.`type`,m.`is_public`,m.email,m.`title`,m.`cover_picture`,m.`is_admin`,m.`bill_setting`,m.`qr_code`,m.`tt_qr_code`,
m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.credit_locked,m.credit_locked,
b.name brandName,bu.title businessTitle,mc.corp_papers_register_number corpPapersRegisterNumber,mc.corp_papers_address corpPapersAddress
from wx_shop s
left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0
left join wx_merchant m on ms.merchant_id=m.id
left join wx_brand b on m.brand = b.id
left join wx_business bu on m.business_id = bu.id
left join wx_merchant_corp mc on mc.merchant_id = m.id
where s.`id` = #{shopId}
m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.credit_locked,m.credit_locked
from wx_merchant m where m.id = #{id}
</select>

<select id="detailByShopId" parameterType="hashmap" resultType="hashmap">
<select id="detailShopMerchantById" parameterType="hashmap" resultType="hashmap">
select
m.`id`,m.`tenant_id` tenantId,m.`parent_tenant_id` parentTenantId,m.`img_url`,m.`name`,m.`encode`,m.`link_phone`,m.`create_date`,m.`update_date`,
m.`car_vendor_type`,m.`car_params`,m.`status`,m.`link_person`,
m.`business_id`,m.`business_types`,m.`sub_business_id`,m.`shop_type`,m.`brand`,m.`type`,m.`is_public`,m.email,m.`title`,m.`cover_picture`,m.`is_admin`,m.`bill_setting`,m.`qr_code`,m.`tt_qr_code`,
m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.credit_locked,m.credit_locked,
b.name brandName,bu.title businessTitle,mc.corp_papers_register_number corpPapersRegisterNumber,mc.corp_papers_address corpPapersAddress
from wx_merchant m
left join wx_merchant_shop ms on ms.merchant_id = m.id and ms.is_del = 0
left join wx_shop s on s.id = ms.shop_id
left join wx_brand b on m.brand = b.id
left join wx_business bu on m.business_id = bu.id
left join wx_merchant_corp mc on mc.merchant_id = m.id
where m.is_del = 0
m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.credit_locked,m.credit_locked
from wx_merchant m where m.id = #{id} and m.is_del = 0
<if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">
and m.`tenant_id` = #{tenantInfo.tenantId}
</if>
<if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId">
and m.`parent_tenant_id` = #{tenantInfo.parentTenantId}
</if>
and s.`id` = #{shopId}
</select>

</mapper>

+ 7
- 1
mallinkService/src/main/resources/mapper/WxProfitSharingReceiverMapper.xml Vedi File

@@ -109,7 +109,13 @@
<include refid="dynamicWhereConditions"/>
</select>
<select id="findOne" parameterType="com.iformall.domain.po.WxProfitSharingReceiver" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_profit_sharing_receiver
<include refid="dynamicWhereConditions"/>
limit 0,1
</select>


+ 1
- 297
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml Vedi File

@@ -222,85 +222,6 @@
<include refid="dynamicWhereConditions"/>
</select>

<!-- 需要修改 -->
<!-- <select id="queryRentContractData" resultType="hashmap" parameterType="com.iformall.domain.po.WxRentContract">
select rc.id,rc.merchant_name merchantName,rc.rental_start_date rentalStartDate,rc.rental_end_date rentalEndDate,rc.`status`,
rc.price,rc.contract_number contractNumber,s.shop_number shopNumber,f.floor_name floorName,b.building_name buildingName,
rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate,rc.merchant_id merchantId,rc.type,
rc.start_date startDate,rc.end_date endDate,br.`name` brandName,rc.apply_status applyStatus,rc.bank_name
bankName,rc.rent_shop_type rentShopType,rc.fix_start_date fixStartDate,rc.fix_end_date fixEndDate
,rc.business_type businessType,rc.adjust_period adjustPeriod,rc.rent_info rentInfo, rc.file_names
fileNames,rc.price_unit,rc.subject_name subjectName,rc.`rent_input_way` rentInputWay,rc.`adjust_ratio_way`
adjustRatioWay,rc.bus_discount_ratio,rc.bus_discount_time
from wx_rent_contract rc
left join wx_shop s on rc.shop_id=s.id
left join wx_mall_floor f on s.floor=f.id
left join wx_mall_building b on s.building=b.id
left join wx_brand br on rc.brand=br.id
<where>
<if test=" null != tenantId and '' != tenantId">
and rc.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and rc.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != merchantName and merchantName!=''">and rc.`merchant_name` like concat('%',#{merchantName},'%')</if>
<if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==1">
and json_extract(rc.rent_info,'$[*].shopNumber') like concat('%',#{shopNumber},'%')
</if>
<if test=" null != shopNumber and shopNumber!='' and null != rentShopType and rentShopType==2">
and s.`shop_number` like concat('%',#{shopNumber},'%')
</if>
<if test=" null != status ">and rc.`status` = #{status}</if>
<if test=" null != shopId">and rc.`shop_id` = #{shopId}</if>
<if test=" null != type ">and rc.`type` = #{type}</if>
<if test=" null != rentShopType ">and rc.`rent_shop_type` = #{rentShopType}</if>
<if test=" null != applyStatus ">and rc.`apply_status` = #{applyStatus}</if>
<if test=" null != building and ''!= building">and b.id = #{building}</if>
<if test=" null != floor and ''!= floor">and f.id = #{floor}</if>
<if test=" null != operationType ">and `operation_type` = #{operationType}</if>
<if test=" null != businessForRule and '' != businessForRule ">
and rc.business_id in (${businessForRule})
</if>
<if test="null != rentShopType and 1 == rentShopType and null != floorForRule and '' != floorForRule ">
and rc.`id` in
<foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")">
select id from wx_rent_contract where 1=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and json_unquote(json_extract(json_extract(rent_info,'$[*].shopId'),concat('$[',#{idx},']'))) in(select
id from wx_shop where 1=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and floor in (${floorForRule}))
</foreach>
</if>
<if test="null != rentShopType and 2 == rentShopType and null != floorForRule and '' != floorForRule ">
and rc.shop_id in (select id from wx_shop where 1=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and floor in (${floorForRule}))
</if>
<if test=" null != merchantId">and rc.`merchant_id` = #{merchantId}</if>
</where>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
<if test=" null == sortColumns"> order by rc.createtime desc,rc.id desc </if>

</select> -->

<select id="queryRentContractCountByStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract">
select count(1) from wx_rent_contract where status=#{status}
<if test=" null != tenantId and '' != tenantId">
@@ -313,97 +234,6 @@

</select>

<!-- <select id="queryRentContractWaitSignStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract">
select count(id) from wx_rent_contract where status=#{status}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != rentShopType ">
and rent_shop_type = #{rentShopType}
</if>
</select> -->

<!-- <select id="queryRentContractEndSoonStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract">
select count(id) from wx_rent_contract where status=4
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if>
</select> -->

<!-- <select id="queryRentContractPaidStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract">
select count(id) from wx_rent_contract where status in (2,3,4)
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if>
</select> -->

<!-- <select id="queryRentContractEndStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract">
select count(id) from wx_rent_contract where status!=0 and status!=1 and status!=6 and status!=7 and rental_end_date &lt;now()
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if>

</select> -->

<!-- <update id="updateRentContractEndSoonStatus" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=#{status} where status not in(0,1,5,6,7,8)
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and DATEDIFF(rental_end_date,now()) &lt;= 30 and rental_end_date > now()
</update> -->

<!-- <update id="updateRentContractPaidStatus" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=#{status} where status not in(0,1,5,6,7,8)
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and rental_start_date &lt;= now() and rental_end_date >= now()
</update> -->

<!-- <update id="updateRentContractEndStatus" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=#{status} where status not in(0,1,5,6,7,8)
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and rental_end_date &lt;now()
</update> -->

<!-- <update id="updateRentWaitSignStatus" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=#{status} where status not in(0,5,6,7)
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and merchant_id is null
</update> -->

<update id="updateApplyStatus" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract
set apply_status=#{applyStatus}
@@ -416,48 +246,6 @@
update wx_rent_contract set status=#{status} where id=#{id}
</update>

<!-- <update id="updateRentInvalidStatus" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=#{status} where shop_id in (
select s.shop_id from (SELECT shop_id FROM wx_rent_contract WHERE status in(2,3,4)
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
)s) and status in(0,1) and status!=7 and rent_shop_type=2
</update> -->


<!-- <select id="getRentContractList" parameterType="com.iformall.domain.po.WxRentContract"
resultType="com.iformall.domain.po.WxRentContract">
select s.shop_id,s.shop_number,s.building_name building, s.floor_name floor,s.build_area,rc.* from (
select s.id shop_id,ms.merchant_id,s.shop_number,b.building_name,f.floor_name,s.build_area,s.floor,s.building
from wx_shop s
left join wx_mall_building b on s.building=b.id
left join wx_mall_floor f on s.floor=f.id
left join wx_merchant_shop ms on s.id=ms.shop_id
where ms.is_del=0) s
inner join (select * from wx_rent_contract where status in(2,3,4)) rc on s.merchant_id=rc.merchant_id
where 1=1
<if test=" null != tenantId and '' != tenantId">
and rc.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and rc.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != shopNumber and ''!=shopNumber">
and s.shop_number like concat('%', #{shopNumber},'%')
</if>
<if test=" null != floor and ''!=floor">
and s.floor = #{floor}
</if>
<if test=" null != building and ''!=building">
and s.building = #{building}
</if>
order by rc.id desc
</select> -->

<select id="updateStatusForUnsign" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=1 where status=2 and merchant_id is null
<if test=" null != tenantId and '' != tenantId">
@@ -468,25 +256,6 @@
</if>
</select>

<!-- <select id="getRentInvalidList" parameterType="com.iformall.domain.po.WxRentContract"
resultType="com.iformall.domain.po.WxRentContract">
select id from wx_rent_contract where shop_id in (
select s.shop_id from (SELECT shop_id FROM wx_rent_contract WHERE status in(2,3,4)
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
)s) and status in(0,1) and status!=7 and apply_status=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
</select> -->

<select id="queryOweCount" parameterType="com.iformall.domain.po.WxRentContract" resultType="Long">
select count(1) from wx_rent_contract r,wx_bill_rent b
where b.rent_contract_id = r.id and b.status = 1 and r.id = #{id}
@@ -527,20 +296,6 @@
<if test=" null != status ">and status=#{status} and status!=7</if>
</select>

<!-- <update id="updateInvalidContract" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=#{status}
where 1=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and id in(select r.id from (
select id from wx_rent_contract where json_contains(json_extract(rent_info,'$[*].shopId'),concat('"',${shopId},'"'))
and rent_shop_type=1 and status in(0,1) and status!=7)r)
</update> -->

<select id="selectRentContractByMerchantId" parameterType="com.iformall.domain.po.WxRentContract"
resultType="com.iformall.domain.po.WxRentContract">
select <include refid="allColumns"/> from wx_rent_contract
@@ -576,13 +331,6 @@
</where>
</select>

<!-- <select id="getShopType" parameterType="com.iformall.domain.po.WxRentContract" resultType="int">
select s.type
from wx_rent_contract r
left join wx_shop s on(s.id = r.`shop_id`)
where r.id = #{id}
</select> -->

<resultMap id="contractMap" type="com.iformall.domain.vo.WxRentPropertyContractVo">
<id column="id" property="id"/>
<result column="tenant_id" property="tenantId"/>
@@ -712,56 +460,12 @@
where m.business_id = #{id} and c.price is not null and c.`rental_start_date` is not null and c.`rental_end_date` is not null
</select>
<!-- <select id="selectRentContractByShopIds" resultType="com.iformall.domain.po.WxRentContract">
SELECT rc.id,rc.rental_start_date,rc.rental_end_date,rc.`shop_id`,rc.`rent_shop_type`,rc.`rent_info` FROM
`wx_rent_contract` rc
WHERE rc.`status` IN (2,3,4) AND status!=7
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
AND ( (rc.`rent_shop_type`=2 AND rc.`shop_id` IN
<foreach collection="shopIds" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
)
OR (rc.`rent_shop_type`=1 AND rc.`rent_info` REGEXP #{shopIdsRegexp})
)
</select> -->

<!-- <select id="selectContractCountByShopId" parameterType="com.iformall.domain.po.WxRentContract" resultType="int">
SELECT count(*)
FROM wx_rent_contract
WHERE `status` = #{status} AND status!=7
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
AND (
`rent_shop_type` = 1 AND
json_contains(json_extract(rent_info, '$[*].shopId'), concat('"', #{shopId}, '"'))
OR
`rent_shop_type` = 2 AND `shop_id` = #{shopId}
)
</select> -->

<!-- <select id="getContractByMerchant" resultType="com.iformall.domain.po.WxRentContract" parameterType="com.iformall.domain.po.WxRentContract">
select * from wx_rent_contract where merchant_id = #{merchantId} and status=3
</select> -->
<select id="getCanApplyCount" resultType="Integer" parameterType="Long">
select count(1) from wx_rent_contract where id != #{id} and (status=1 or (status=10 and apply_status=3) )
</select>

<select id="getMerchantIdsByStatuss" resultType="Long" parameterType="com.iformall.domain.po.WxRentContract">
select distinct merchant_id from wx_rent_contract where 1=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
select distinct merchant_id from wx_rent_contract where `tenant_id` = #{tenantId} and merchant_id is not null
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>


+ 6
- 25
mallinkService/src/main/resources/mapper/WxShopMapper.xml Vedi File

@@ -129,6 +129,10 @@
<if test=" null != pointType ">
and `point_type` = #{pointType}
</if>
<if test=" null != floorForRule and '' != floorForRule ">
and `floor` in (${floorForRule})
</if>

<if test=" null != ids ">
and id in
@@ -599,37 +603,14 @@
and id != #{id}
</if>
</select>
<resultMap id="ShopVoResultMap" type="com.iformall.domain.vo.WxShopVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="addr" jdbcType="VARCHAR" property="addr"/>
<result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
<result column="building_name" jdbcType="VARCHAR" property="buildingName"/>
<result column="floor_name" jdbcType="VARCHAR" property="floorName"/>
<result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
<result column="manager_phone" jdbcType="VARCHAR" property="linkPhone"/>
<result column="manager" jdbcType="VARCHAR" property="linkPerson"/>
</resultMap>


<resultMap id="rentRate" type="com.iformall.domain.vo.WxShopRentRateVo">
<result column="xTime" property="xTime"/>
<result column="rate" property="rate"/>
</resultMap>
<select id="findShopVoList" parameterType="java.util.Map" resultMap="ShopVoResultMap">
select s.id,s.shop_number,b.building_name,f.floor_name,s.addr,s.baidu_poi,s.manager_phone,s.manager
from wx_shop s
left join wx_merchant_shop ms on ms.shop_id=s.id
left join wx_merchant m on ms.merchant_id=m.id
left join wx_mall_building b on s.building=b.id
left join wx_mall_floor f on s.floor=f.id
where s.is_del=0 and ms.is_del=0
and m.id=#{merchantId}
</select>

<select id="getCountByWxShop" parameterType="com.iformall.domain.po.WxShop" resultType="Long">
select count(*) from wx_shop w where w.is_del=0
select count(1) from wx_shop w where w.is_del=0
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
@@ -734,7 +715,7 @@


<select id="newFindShopVoList" parameterType="java.util.Map" resultType="com.iformall.domain.vo.WxShopVo">
select id,shop_number shopNumber,img_url imgUrl,addr,building,floor
select id,shop_number shopNumber,img_url imgUrl,addr,building,floor,baidu_poi baiduPoi,manager_phone linkPhone,manager linkPerson
from wx_shop
where is_del=0
<if test=" null != tenantId and '' != tenantId">


+ 3
- 3
mallinkTTAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java Vedi File

@@ -59,7 +59,7 @@ public class WxMerchantController extends BaseController {
if (null == wxMerchant) wxMerchant = new WxMerchant();
wxMerchant.updateTenantInfo(getTenantInfo());
wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC);
final PageInfo<WxMerchant> page = wxMerchantService.listVoAsPage(wxMerchant, pageNum, pageSize);
final PageInfo<WxMerchant> page = wxMerchantService.listVoAsPage(wxMerchant, pageNum, pageSize,false);
return new ResultData(page);
}

@@ -76,7 +76,7 @@ public class WxMerchantController extends BaseController {
if (null == wxMerchant) wxMerchant = new WxMerchant();
wxMerchant.updateTenantInfo(getTenantInfo());
wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC);
final PageInfo<WxMerchant> page = wxMerchantService.listVoAsPage2(wxMerchant, pageNum, pageSize);
final PageInfo<WxMerchant> page = wxMerchantService.listVoAsPage(wxMerchant, pageNum, pageSize,false);
return new ResultData(page);
}

@@ -242,7 +242,7 @@ public class WxMerchantController extends BaseController {
@SystemControllerLog(description = "商户-查询")
public ResultData findMerchantById(Long id) {
logger.debug("[" + getIpAddr() + "] WxMerchantController::findMerchantById");
WxMerchantVo wxMerchant = wxMerchantService.findMerchantById(id);
WxMerchantVo wxMerchant = wxMerchantService.findMerchantById(getTenantInfo(),id);
return new ResultData(wxMerchant);
}



+ 1
- 1
mallinkTTCApi/src/main/java/com/iformall/controller/WxMerchantController.java Vedi File

@@ -46,7 +46,7 @@ public class WxMerchantController extends BaseController {
wxMerchantDto.updateTenantInfo(getParentTenantInfo());
wxMerchantDto.setMerchantStatus(EnumMerchantStatus.VALID.getCode());
wxMerchantDto.setIsPublic(EnumMerchantPublic.PUBLIC.getCode());
return new ResultData(wxMerchantService.listAsPageCVo(wxMerchantDto, pageNum, pageSize));
return new ResultData(wxMerchantService.listAsPageCVo(wxMerchantDto, pageNum, pageSize,true));
}

@ApiOperation("分页列表接口")


Caricamento…
Annulla
Salva