| @@ -3,6 +3,7 @@ package com.iformall.controller; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.dto.WxMerchantDto; | |||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| import com.iformall.enums.EnumMerchantPublic; | import com.iformall.enums.EnumMerchantPublic; | ||||
| @@ -36,12 +37,12 @@ public class WxMerchantController extends BaseController { | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData list(@ModelAttribute WxMerchantVo wxMerchant, Integer pageNum, Integer pageSize) { | |||||
| public ResultData list(@ModelAttribute WxMerchantDto wxMerchantDto, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::list"); | logger.debug("[" + getIpAddr() + "] WxMerchantController::list"); | ||||
| if (null == wxMerchant) wxMerchant = new WxMerchantVo(); | |||||
| wxMerchant.setMerchantStatus(EnumMerchantStatus.VALID.getCode()); | |||||
| wxMerchant.setIsPublic(EnumMerchantPublic.PUBLIC.getCode()); | |||||
| return new ResultData(wxMerchantService.listAsPageCVo(wxMerchant, pageNum, pageSize)); | |||||
| if (null == wxMerchantDto) wxMerchantDto = new WxMerchantDto(); | |||||
| wxMerchantDto.setMerchantStatus(EnumMerchantStatus.VALID.getCode()); | |||||
| wxMerchantDto.setIsPublic(EnumMerchantPublic.PUBLIC.getCode()); | |||||
| return new ResultData(wxMerchantService.listAsPageCVo(wxMerchantDto, pageNum, pageSize)); | |||||
| } | } | ||||
| @ApiOperation("根据code查询接口") | @ApiOperation("根据code查询接口") | ||||
| @@ -0,0 +1,48 @@ | |||||
| package com.iformall.domain.dto; | |||||
| import lombok.Data; | |||||
| @Data | |||||
| public class WxMerchantDto { | |||||
| private static final long serialVersionUID = 6687964942922444531L; | |||||
| protected Long id; | |||||
| /** 发券商户信息 */ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="name") | |||||
| private String merchantName; | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户联系方式",name="linkPhone") | |||||
| private String merchantLinkPhone; | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户状态1可用0停用",name="status") | |||||
| private Integer merchantStatus; | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户业态",name="businessId") | |||||
| private Integer businessId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户子业态",name="subBusinessId") | |||||
| private Integer subBusinessId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber") | |||||
| private String shopNumber; | |||||
| @io.swagger.annotations.ApiModelProperty(value="楼座号",name="building") | |||||
| private Integer building; | |||||
| @io.swagger.annotations.ApiModelProperty(value="楼层号",name="floor") | |||||
| private Integer floor; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "是否显示在C端", name = "show") | |||||
| private Integer isPublic; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "品牌名称", name = "brandName") | |||||
| private String brandName; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "店面类型", name = "shopType") | |||||
| private Integer shopType; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "客服电话", name = "linkLinePhone") | |||||
| private String linkLinePhone; | |||||
| } | |||||
| @@ -2,6 +2,7 @@ package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.dto.WxMerchantDto; | |||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| @@ -11,7 +12,7 @@ import java.util.Map; | |||||
| public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | ||||
| List<WxMerchant> findList(WxMerchant wxMerchant); | List<WxMerchant> findList(WxMerchant wxMerchant); | ||||
| List<WxMerchantVo> findListCVo(WxMerchantVo wxMerchantVo); | |||||
| List<WxMerchantVo> findListCVo(WxMerchantDto wxMerchantDto); | |||||
| WxMerchantVo getMerchantByCode(HashMap<String, String> params); | WxMerchantVo getMerchantByCode(HashMap<String, String> params); | ||||
| WxMerchant queryMerchantByMerchantIdOfSharingReceiver(WxMerchant wxMerchant); | WxMerchant queryMerchantByMerchantIdOfSharingReceiver(WxMerchant wxMerchant); | ||||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.dto.WxMerchantDto; | |||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxProfitSharingReceiver; | import com.iformall.domain.po.WxProfitSharingReceiver; | ||||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | import com.iformall.domain.vo.WxMerchantSimpleVo; | ||||
| @@ -27,7 +28,7 @@ public interface WxMerchantService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize); | PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize); | ||||
| PageInfo<WxMerchantVo> listAsPageCVo(WxMerchantVo record, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<WxMerchantVo> listAsPageCVo(WxMerchantDto record, Integer pageIndex, Integer pageSize); | |||||
| /** | /** | ||||
| * 根据code查询 | * 根据code查询 | ||||
| * | * | ||||
| @@ -8,6 +8,7 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.dto.WxMerchantDto; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.msg.MailMsg; | import com.iformall.domain.po.msg.MailMsg; | ||||
| import com.iformall.domain.vo.*; | import com.iformall.domain.vo.*; | ||||
| @@ -793,10 +794,10 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| result.put("depositDetail", StringUtils.isNotEmpty(depositDetail.toString()) ? depositDetail.toString() : " "); | result.put("depositDetail", StringUtils.isNotEmpty(depositDetail.toString()) ? depositDetail.toString() : " "); | ||||
| result.put("otherDetail", StringUtils.isNotEmpty(otherDetail.toString()) ? otherDetail.toString() : " "); | result.put("otherDetail", StringUtils.isNotEmpty(otherDetail.toString()) ? otherDetail.toString() : " "); | ||||
| WxMerchantVo wxMerchantVo = new WxMerchantVo(); | |||||
| wxMerchantVo.setId(wxBillAll.getMerchantId()); | |||||
| List<WxMerchantVo> listCVo = wxMerchantMapper.findListCVo(wxMerchantVo); | |||||
| wxMerchantVo = listCVo.get(0); | |||||
| WxMerchantDto wxMerchantDto = new WxMerchantDto(); | |||||
| wxMerchantDto.setId(wxBillAll.getMerchantId()); | |||||
| List<WxMerchantVo> listCVo = wxMerchantMapper.findListCVo(wxMerchantDto); | |||||
| WxMerchantVo wxMerchantVo = listCVo.get(0); | |||||
| result.put("merchant", wxMerchantVo.getMerchantName()); | result.put("merchant", wxMerchantVo.getMerchantName()); | ||||
| WxShopVo wxShopVo = wxMerchantVo.getShopVoList().stream() | WxShopVo wxShopVo = wxMerchantVo.getShopVoList().stream() | ||||
| .filter(s -> StringUtils.isNotEmpty(s.getLinkPhone()) || StringUtils.isNotEmpty(s.getLinkPerson())).findFirst().orElse(null); | .filter(s -> StringUtils.isNotEmpty(s.getLinkPhone()) || StringUtils.isNotEmpty(s.getLinkPerson())).findFirst().orElse(null); | ||||
| @@ -8,6 +8,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.dto.WxMerchantDto; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | import com.iformall.domain.vo.WxMerchantSimpleVo; | ||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| @@ -108,7 +109,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| @Override | @Override | ||||
| public PageInfo<WxMerchantVo> listAsPageCVo(WxMerchantVo record, Integer pageIndex, Integer pageSize) { | |||||
| public PageInfo<WxMerchantVo> listAsPageCVo(WxMerchantDto record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.findListCVo(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.findListCVo(record)); | ||||
| } | } | ||||
| @@ -612,7 +613,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| @Override | @Override | ||||
| public WxMerchantVo findMerchantById(Long id) { | public WxMerchantVo findMerchantById(Long id) { | ||||
| WxMerchantVo merchant = new WxMerchantVo(); | |||||
| WxMerchantDto merchant = new WxMerchantDto(); | |||||
| merchant.setId(id); | merchant.setId(id); | ||||
| List<WxMerchantVo> listCVo = wxMerchantMapper.findListCVo(merchant); | List<WxMerchantVo> listCVo = wxMerchantMapper.findListCVo(merchant); | ||||
| return listCVo.isEmpty() ? new WxMerchantVo() : listCVo.get(0); | return listCVo.isEmpty() ? new WxMerchantVo() : listCVo.get(0); | ||||
| @@ -8,6 +8,7 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.dto.WxMerchantDto; | |||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxPayAccount; | import com.iformall.domain.po.WxPayAccount; | ||||
| @@ -194,9 +195,9 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv | |||||
| } | } | ||||
| private void sendMsgByType(Integer type, Long merchantId, String account, String tenantId) { | private void sendMsgByType(Integer type, Long merchantId, String account, String tenantId) { | ||||
| WxMerchantVo wxMerchantVo = new WxMerchantVo(); | |||||
| wxMerchantVo.setId(merchantId); | |||||
| List<WxMerchantVo> listCVo = wxMerchantMapper.findListCVo(wxMerchantVo); | |||||
| WxMerchantDto wxMerchantDto = new WxMerchantDto(); | |||||
| wxMerchantDto.setId(merchantId); | |||||
| List<WxMerchantVo> listCVo = wxMerchantMapper.findListCVo(wxMerchantDto); | |||||
| if (listCVo.isEmpty()) { | if (listCVo.isEmpty()) { | ||||
| logger.info("更新商户分账账户发短信时未找到商户:" + merchantId); | logger.info("更新商户分账账户发短信时未找到商户:" + merchantId); | ||||
| return; | return; | ||||
| @@ -328,7 +328,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <select id="findListCVo" parameterType="com.iformall.domain.vo.WxMerchantVo" resultMap="MerchantVoResultMap"> | |||||
| <select id="findListCVo" parameterType="com.iformall.domain.dto.WxMerchantDto" resultMap="MerchantVoResultMap"> | |||||
| select | select | ||||
| <include refid="allMerchantVoColumns"/> | <include refid="allMerchantVoColumns"/> | ||||
| FROM wx_merchant m | FROM wx_merchant m | ||||