| @@ -9,13 +9,15 @@ import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxProfitSharingReceiver; | |||
| import com.iformall.domain.po.WxScoreRules; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.WxBusinessDataVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeDetailVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import com.iformall.enums.EnumCreditLockedStatus; | |||
| import com.iformall.service.QrCodeService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxScoreRulesService; | |||
| import com.iformall.utils.DateUtils; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @@ -26,6 +28,10 @@ import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.math.BigDecimal; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @@ -106,12 +112,6 @@ public class WxMerchantController extends BaseController { | |||
| public ResultData findById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::findById"); | |||
| WxMerchant wxMerchant = wxMerchantService.getById(id); | |||
| if (wxMerchant.getCreditLocked() != null) { | |||
| WxScoreRules scoreRules = wxScoreRulesService.getScoreRules(getTenantId()); | |||
| if (scoreRules != null && scoreRules.getCreditLocked().equals(EnumCreditLockedStatus.CLOSE.getCode())) { | |||
| wxMerchant.setCreditLocked(EnumCreditLockedStatus.CLOSE.getCode()); | |||
| } | |||
| } | |||
| return new ResultData(wxMerchant); | |||
| } | |||
| @@ -201,12 +201,6 @@ public class WxMerchantController extends BaseController { | |||
| public ResultData updateMerchantLevel(@RequestBody WxMerchant wxMerchant) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::updateMerchantLevel"); | |||
| wxMerchant.setTenantId(getTenantId()); | |||
| if (wxMerchant.getCreditLocked() != null) { | |||
| WxScoreRules scoreRules = wxScoreRulesService.getScoreRules(getTenantId()); | |||
| if (scoreRules != null && scoreRules.getCreditLocked().equals(EnumCreditLockedStatus.CLOSE.getCode())) { | |||
| wxMerchant.setCreditLocked(EnumCreditLockedStatus.CLOSE.getCode()); | |||
| } | |||
| } | |||
| return wxMerchantService.updateMerchantLevel(wxMerchant); | |||
| } | |||
| @@ -281,4 +275,28 @@ public class WxMerchantController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("商户会员消费明细列表接口") | |||
| @GetMapping("userTradeDetailList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "商户-商户会员消费明细列表接口") | |||
| public ResultData userTradeDetailList(@ModelAttribute WxMerchant wxMerchant, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::list"); | |||
| if (null == wxMerchant) wxMerchant = new WxMerchant(); | |||
| wxMerchant.setTenantId(getTenantId()); | |||
| final PageInfo<WxMerchantTradeDetailVo> page = wxMerchantService.userTradeDetailList(wxMerchant, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("导出商户会员消费分页列表") | |||
| @GetMapping("exportUserTradeDetailList") | |||
| @SystemControllerLog(description = "导出商户会员消费分页列表") | |||
| public void exportUserTradeList(@ModelAttribute WxMerchant wxMerchant,HttpServletRequest request, HttpServletResponse response) throws Exception{ | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::exportUserTradeDetailList"); | |||
| if (null == wxMerchant) wxMerchant = new WxMerchant(); | |||
| wxMerchant.setTenantId(getTenantId()); | |||
| wxMerchantService.exportUserTradeList(wxMerchant, request,response); | |||
| } | |||
| } | |||
| @@ -11,10 +11,14 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.dto.WxCUserBasicInfoFilterDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.UserTradeRecordVo; | |||
| import com.iformall.enums.EnumAssignTagsTrigger; | |||
| import com.iformall.enums.EnumCouponOrderStatus; | |||
| import com.iformall.enums.EnumCouponStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.DateUtils; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| @@ -33,6 +37,7 @@ import java.io.BufferedInputStream; | |||
| import java.io.File; | |||
| import java.io.FileOutputStream; | |||
| import java.io.IOException; | |||
| import java.math.BigDecimal; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @@ -75,6 +80,9 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| @Autowired | |||
| private AsyncTask asyncTask; | |||
| @Autowired | |||
| private ExcelService excelService; | |||
| private void setUserInfoLevel(WxCUserBasicInfo info) { | |||
| if (info.getPoins() == null || info.getPoins() == 0) { | |||
| @@ -241,6 +249,43 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| return new ResultData(Result.SUCCESS, "查询成功", page); | |||
| } | |||
| @ApiOperation("导出根据userId查询交易记录接口") | |||
| @GetMapping("/exportOrderCouponByUserId") | |||
| @ApiImplicitParam(name = "userId", value = "userId", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "会员管理-userId查询交易记录") | |||
| public void exportOrderCouponByUserId(HttpServletRequest request, HttpServletResponse response,Long userId) { | |||
| logger.debug("[" + getIpAddr() + "] WxCUserBasicInfoController::exportOrderCouponByUserId"); | |||
| WxCouponOrder corder = new WxCouponOrder(); | |||
| corder.setCUserId(userId); | |||
| corder.setTenantId(getTenantId()); | |||
| corder.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||
| PageInfo<WxCouponOrder> page = wxCouponOrderService.listAsPage(corder, 1, Integer.MAX_VALUE); | |||
| if (page.getSize() > 0) { | |||
| List<WxCouponOrder> list = page.getList(); | |||
| for (WxCouponOrder c : list) { | |||
| WxCoupon coupon = wxCouponService.getById(c.getCouponId()); | |||
| c.setCouponName(coupon.getTitle()); | |||
| c.setSalePrice(coupon.getPrice()); | |||
| } | |||
| List<UserTradeRecordVo> datalist = new ArrayList<>(); | |||
| for (WxCouponOrder wxCouponOrder:list) { | |||
| UserTradeRecordVo userTradeRecordVo = new UserTradeRecordVo(); | |||
| userTradeRecordVo.setCouponName(wxCouponOrder.getCouponName()); | |||
| BigDecimal b = new BigDecimal(wxCouponOrder.getSalePrice()); | |||
| userTradeRecordVo.setPrice(b.divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP).toString()); | |||
| b = new BigDecimal(wxCouponOrder.getCouponPrice()); | |||
| userTradeRecordVo.setSale(b.divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP).toString()); | |||
| userTradeRecordVo.setStatus(EnumCouponOrderStatus.getEnum(wxCouponOrder.getCouponOrderStatus()).getMessage()); | |||
| userTradeRecordVo.setTradeTime(DateUtils.formatDateTime(wxCouponOrder.getCreateDate())); | |||
| datalist.add(userTradeRecordVo); | |||
| } | |||
| excelService.exportExcel(datalist, null, "会员交易记录", UserTradeRecordVo.class, "会员交易记录.xlsx", response, false); | |||
| } | |||
| } | |||
| @ApiOperation("会员记录导出总数") | |||
| @GetMapping("/exportDataCount") | |||
| @SystemControllerLog(description = "会员管理-会员记录导出总数") | |||
| @@ -0,0 +1,29 @@ | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (963, '商户会员消费列表', 2, 'Y', NULL, 1, NULL, NULL, 'merchantConsumeList', 'icon-xiaofeijilu', 0, 963); | |||
| DROP TABLE IF EXISTS `mall_sale_type` ; | |||
| CREATE TABLE `mall_sale_type` ( | |||
| `id` bigint(64) NOT NULL, | |||
| `name` varchar(32) DEFAULT NULL COMMENT '销售类型', | |||
| `type` tinyint(2) DEFAULT NULL COMMENT '资源类型1:尊享全能版 2:尊享营销版 3.速享版', | |||
| `period` tinyint(2) DEFAULT NULL COMMENT '有效期(单位月)', | |||
| `menus` json DEFAULT NULL COMMENT '菜单列表', | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE `id_UNIQUE` USING BTREE (`id`) comment '' | |||
| ) ENGINE=`InnoDB` ROW_FORMAT=DYNAMIC COMMENT='系统销售表' CHECKSUM=0 DELAY_KEY_WRITE=0; | |||
| INSERT INTO `mall_sale_type` | |||
| (`id`,`name`, `type`, `period`, `menus`) | |||
| VALUES | |||
| (1, '尊享全能版', 1, 12, | |||
| '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 201, 202, 203, 204, 205, 206, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 651, 661, 662, 663, 671, 672, 673,674, 675, 681, 682, 683, 684, 685, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 952, 961, 962,963, 965, 966, 967, 968, 1001, 1002, 1003, 1004]' | |||
| ), | |||
| (2, '尊享营销版', 2, 12, | |||
| '[1, 2, 4, 5, 6, 7, 8, 9, 10, 50, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 961]' | |||
| ), | |||
| (3, '速享版', 3, 1, | |||
| '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 641, 642, 643, 644, 645, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932]' | |||
| ) | |||
| ; | |||
| @@ -0,0 +1 @@ | |||
| update mall_permission set module_color='#ad368a',module_color_num='173,54,138' where name = '招商管理'; | |||
| @@ -7,6 +7,8 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxMall; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxScoreRules; | |||
| import com.iformall.enums.EnumCreditLockedStatus; | |||
| import com.iformall.enums.EnumMerchantBUserStatus; | |||
| import com.iformall.enums.EnumMerchantStatus; | |||
| import com.iformall.service.*; | |||
| @@ -50,6 +52,8 @@ public class WxMerchantBUserController extends BaseController { | |||
| @Autowired | |||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||
| @Autowired | |||
| private WxScoreRulesService wxScoreRulesService; | |||
| @ApiOperation("查寻当bUser详情接口") | |||
| @GetMapping("/detail") | |||
| @@ -72,6 +76,11 @@ public class WxMerchantBUserController extends BaseController { | |||
| return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); | |||
| } | |||
| resultMap.put("creditLocked", merchant.getCreditLocked()); | |||
| WxScoreRules scoreRules = wxScoreRulesService.getCreditRules(user.getTenantId()); | |||
| if (scoreRules.getCreditLocked().equals(EnumCreditLockedStatus.CLOSE.getCode())) { | |||
| resultMap.put("creditLocked", EnumCreditLockedStatus.CLOSE.getCode()); | |||
| } | |||
| resultMap.put("phone", user.getPhone()); | |||
| resultMap.put("name", user.getName()); | |||
| resultMap.put("merchant_name", merchant.getName()); | |||
| @@ -81,7 +90,6 @@ public class WxMerchantBUserController extends BaseController { | |||
| resultMap.put("tenant_id",merchant.getTenantId()); | |||
| resultMap.put("merchant_id",merchant.getId()); | |||
| resultMap.put("is_admin",merchant.getIsAdmin()); | |||
| resultMap.put("creditLocked", merchant.getCreditLocked()); | |||
| resultMap.put("businessId", merchant.getBusinessId()); | |||
| String mid = null; | |||
| @@ -52,6 +52,9 @@ public class WxMerchantController extends BaseController { | |||
| @PostMapping("/updateAccount") | |||
| public ResultData addAccount(@RequestBody WxMerchant wxMerchant) { | |||
| log.debug("[" + getIpAddr() + "] merchantProfitSharingReceiver::addAccount"); | |||
| if (!hasPermission()) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION); | |||
| } | |||
| if (wxMerchant.getId() == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户ID不能为空"); | |||
| } | |||
| @@ -76,6 +79,9 @@ public class WxMerchantController extends BaseController { | |||
| @ApiImplicitParam(name = "id", value = "商户分账账户ID", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData deleteByReceiverId(@ModelAttribute WxProfitSharingReceiver receiver) { | |||
| log.debug("[" + getIpAddr() + "] WxMerchantController::deleteByReceiverId"); | |||
| if (!hasPermission()) { | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION); | |||
| } | |||
| if (receiver.getId() == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户分账账户ID不能为空"); | |||
| } | |||
| @@ -87,16 +93,17 @@ public class WxMerchantController extends BaseController { | |||
| @GetMapping("/permitModifiy") | |||
| public ResultData permitModifiy() { | |||
| log.debug("[" + getIpAddr() + "] WxMerchantController::permitModifiy"); | |||
| boolean has = hasPermission(); | |||
| return new ResultData(has); | |||
| } | |||
| public boolean hasPermission() { | |||
| WxMerchantBUser user = getUser(); | |||
| WxBuser buser = getBuser(); | |||
| WxMerchant merchant = new WxMerchant(); | |||
| merchant.setId(user.getMerchantId()); | |||
| WxMerchant wxMerchant = wxMerchantService.findOne(merchant); | |||
| if (wxMerchant == null) { | |||
| return new ResultData(false); | |||
| } | |||
| boolean has = buser.getPhone().equals(wxMerchant.getLinkPhone()); | |||
| return new ResultData(has); | |||
| return wxMerchant != null && buser.getPhone().equals(wxMerchant.getLinkPhone()); | |||
| } | |||
| } | |||
| @@ -131,6 +131,13 @@ public class WxMerchant extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "结束时间", name = "endTime") | |||
| private transient Date endtime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "昵称", name = "userName") | |||
| private transient String userName; | |||
| @io.swagger.annotations.ApiModelProperty(value = "联系方式", name = "phone") | |||
| private transient String phone; | |||
| @io.swagger.annotations.ApiModelProperty(value = "卷名称", name = "couponName") | |||
| private transient String couponName; | |||
| public String getShopsStr() { | |||
| if (shopVos != null && shopVos.size() > 0) { | |||
| return String.join("\n", | |||
| @@ -0,0 +1,24 @@ | |||
| package com.iformall.domain.vo; | |||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||
| import lombok.Data; | |||
| import java.io.Serializable; | |||
| @Data | |||
| public class UserTradeRecordVo implements Serializable{ | |||
| private static final long serialVersionUID = 1L; | |||
| @Excel(name="优惠券名称",width = 20,orderNum = "1") | |||
| private String couponName; | |||
| //@Excel(name="交易门店",width = 20,orderNum = "2") | |||
| private String shopName; | |||
| @Excel(name="价格",width = 20,orderNum = "2") | |||
| private String sale; | |||
| @Excel(name="面额",width = 20,orderNum = "3") | |||
| private String price; | |||
| @Excel(name="卷状态",width = 20,orderNum = "4") | |||
| private String status; | |||
| @Excel(name="交易时间",width = 20,orderNum = "5") | |||
| private String tradeTime; | |||
| } | |||
| @@ -0,0 +1,45 @@ | |||
| package com.iformall.domain.vo; | |||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.util.Date; | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxMerchantTradeDetailVo extends BaseEntity { | |||
| @Excel(name="会员昵称",width = 20,orderNum = "1") | |||
| @io.swagger.annotations.ApiModelProperty(value = "会员昵称", name = "userName") | |||
| protected String userName; | |||
| @Excel(name="手机号码",width = 20,orderNum = "2") | |||
| @io.swagger.annotations.ApiModelProperty(value = "手机号码", name = "phone") | |||
| private String phone; | |||
| @Excel(name="核销券名称",width = 20,orderNum = "3") | |||
| @io.swagger.annotations.ApiModelProperty(value = "券名称", name = "couponName") | |||
| private String couponName; | |||
| @Excel(name="券价格",width = 20,orderNum = "4") | |||
| @io.swagger.annotations.ApiModelProperty(value = "券价格", name = "couponSale") | |||
| private Integer couponSale; | |||
| @Excel(name="券面额",width = 20,orderNum = "5") | |||
| @io.swagger.annotations.ApiModelProperty(value = "核销券面额", name = "couponPrice") | |||
| private Integer couponPrice; | |||
| @Excel(name="消费金额",width = 20,orderNum = "6") | |||
| @io.swagger.annotations.ApiModelProperty(value = "消费金额", name = "tradeAmt") | |||
| private Integer tradeAmt; | |||
| @io.swagger.annotations.ApiModelProperty(value = "交易时间", name = "tradeDate") | |||
| private Date tradeDate; | |||
| @Excel(name="交易时间",width = 20,orderNum = "7") | |||
| @io.swagger.annotations.ApiModelProperty(value = "交易时间", name = "tradeDate") | |||
| private Date tradeDateStr; | |||
| } | |||
| @@ -9,6 +9,7 @@ import lombok.ToString; | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxMerchantTradeVo extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "商户id", name = "merchantId") | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value = "封面图", name = "cover") | |||
| @@ -3,6 +3,7 @@ package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.dto.WxMerchantDto; | |||
| import com.iformall.domain.vo.WxMerchantTradeDetailVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| @@ -30,5 +31,7 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | |||
| List<WxMerchantTradeVo> userTradeList(WxMerchant wxMerchant); | |||
| List<WxMerchantTradeDetailVo> userTradeDetailList(WxMerchant wxMerchant); | |||
| } | |||
| @@ -3,11 +3,14 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxMerchantDto; | |||
| import com.iformall.domain.po.WxBillOtherDeposit; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxProfitSharingReceiver; | |||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeDetailVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| @@ -19,6 +22,18 @@ import java.util.Optional; | |||
| * @author gongbiao | |||
| */ | |||
| public interface WxMerchantService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxMerchantTradeDetailVo> userTradeDetailList(WxMerchant record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| @@ -29,6 +44,13 @@ public interface WxMerchantService { | |||
| */ | |||
| PageInfo<WxMerchantTradeVo> userTradeList(WxMerchant record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @return | |||
| */ | |||
| void exportUserTradeList(@ModelAttribute WxMerchant record, HttpServletRequest request, HttpServletResponse response); | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| @@ -704,7 +704,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| String bankCardId = payAccountBill.getBankCardId(); | |||
| String bankAccountName = payAccountBill.getBankAccountName(); | |||
| result.put("accountNumber", StringUtils.isNotEmpty(bankCardId) ? bankCardId : " "); | |||
| result.put("accountName", StringUtils.isNotEmpty(bankAccountName) ? bankCardId : " "); | |||
| result.put("accountName", StringUtils.isNotEmpty(bankAccountName) ? bankAccountName : " "); | |||
| } else { | |||
| result.put("accountNumber", " "); | |||
| result.put("accountName", " "); | |||
| @@ -11,6 +11,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxMerchantDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeDetailVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import com.iformall.enums.*; | |||
| @@ -32,7 +33,6 @@ import javax.servlet.http.HttpServletResponse; | |||
| import java.util.*; | |||
| import java.util.stream.Collectors; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @@ -745,4 +745,15 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| public PageInfo<WxMerchantTradeVo> userTradeList(WxMerchant record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.userTradeList(record)); | |||
| } | |||
| @Override | |||
| public void exportUserTradeList(WxMerchant record,HttpServletRequest request, HttpServletResponse response) { | |||
| List<WxMerchantTradeDetailVo> datalist = wxMerchantMapper.userTradeDetailList(record); | |||
| excelService.exportExcel(datalist, null, "商户会员消费列表", WxMerchantTradeDetailVo.class, "商户会员消费列表.xlsx", response, false); | |||
| } | |||
| @Override | |||
| public PageInfo<WxMerchantTradeDetailVo> userTradeDetailList(WxMerchant record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.userTradeDetailList(record)); | |||
| } | |||
| } | |||
| @@ -190,7 +190,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| } | |||
| //更新商户数据 | |||
| updateMerchantCreditLocked(record); | |||
| //updateMerchantCreditLocked(record); | |||
| } | |||
| @Override | |||
| @@ -474,5 +474,28 @@ | |||
| </if> | |||
| </select> | |||
| <select id="userTradeDetailList" parameterType="com.iformall.domain.po.WxMerchant" resultType="com.iformall.domain.vo.WxMerchantTradeDetailVo"> | |||
| select c.`nick_name` 'userName',c.`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_coupon_merchant cm on(cm.product_id=co.id) | |||
| inner join wx_c_user_basic_info c on(o.c_user_id=c.id) | |||
| where o.coupon_order_status=1 and o.tenant_id=#{tenantId} | |||
| <if test=" null != id "> | |||
| and cm.`merchant_id` = #{id} | |||
| </if> | |||
| <if test=" null != userName "> | |||
| and c.`nick_name` like concat('%', #{userName},'%') | |||
| </if> | |||
| <if test=" null != phone "> | |||
| and c.`phone` like concat('%', #{phone},'%') | |||
| </if> | |||
| <if test=" null != couponName "> | |||
| and co.`title` like concat('%', #{couponName},'%') | |||
| </if> | |||
| order by o.create_date desc | |||
| </select> | |||
| </mapper> | |||
| @@ -509,6 +509,14 @@ | |||
| <if test=" null != pointType "> | |||
| and s.`point_type` = #{pointType} | |||
| </if> | |||
| <if test=" null != shopNumber and '' != shopNumber "> | |||
| and s.shop_number = #{shopNumber} | |||
| </if> | |||
| <if test=" null != building and '' != building "> | |||
| and b.building_name like concat('%', #{building},'%') | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </select> | |||