| @@ -107,7 +107,7 @@ public class TtPoiPlanController extends BaseController { | |||
| } | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("takeRate") | |||
| @GetMapping("takeRateList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| @@ -16,9 +16,11 @@ import com.iformall.domain.po.WxProfitSharingReceiver; | |||
| import com.iformall.domain.vo.WxMerchantTradeDetailVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import com.iformall.douyin.pay.enums.AppAddSubMerchantUrlType; | |||
| import com.iformall.enums.EnumAppPlat; | |||
| import com.iformall.enums.EnumMerchantStatus; | |||
| import com.iformall.enums.EnumPayWay; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -273,14 +275,14 @@ public class WxMerchantController extends BaseController { | |||
| return wxMerchantService.top(wxMerchant); | |||
| } | |||
| @ApiOperation("更新收款账户状态") | |||
| @PostMapping("useAccount") | |||
| @SystemControllerLog(description = "商户-更新收款账户状态") | |||
| public ResultData useAccount(@RequestBody WxProfitSharingReceiver wxProfitSharingReceiver) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::useAccount"); | |||
| wxProfitSharingReceiver.updateTenantInfo(getTenantInfo()); | |||
| return wxMerchantService.useAccount(wxProfitSharingReceiver); | |||
| } | |||
| // @ApiOperation("更新收款账户状态") | |||
| // @PostMapping("useAccount") | |||
| // @SystemControllerLog(description = "商户-更新收款账户状态") | |||
| // public ResultData useAccount(@RequestBody WxProfitSharingReceiver wxProfitSharingReceiver) { | |||
| // logger.debug("[" + getIpAddr() + "] WxMerchantController::useAccount"); | |||
| // wxProfitSharingReceiver.updateTenantInfo(getTenantInfo()); | |||
| // return wxMerchantService.useAccount(wxProfitSharingReceiver); | |||
| // } | |||
| @ApiOperation("查看是否存在商户名称相同记录") | |||
| @GetMapping("/hasMerchant") | |||
| @@ -362,6 +364,43 @@ public class WxMerchantController extends BaseController { | |||
| return wxProfitSharingReceiverService.updateTtReceiver(merchant,appInfo.getAppId(),payAcount.getApiKey()); | |||
| } | |||
| @ApiOperation("获取进件/余额页面") | |||
| @GetMapping("/getTtReceiverUrl") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData getTtReceiver(Long id,Integer urlType) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::getTtReceiver"); | |||
| if(urlType == null || id == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"请检查传递参数"); | |||
| } | |||
| WxMerchant merchant = wxMerchantService.selectById(id); | |||
| if(merchant == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请检查传递参数"); | |||
| } | |||
| AppAddSubMerchantUrlType anEnum = AppAddSubMerchantUrlType.getEnum(urlType); | |||
| if(anEnum == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请检查传递参数"); | |||
| } | |||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(getTenantInfo(), EnumAppPlat.TOUTIAO); | |||
| if(appInfo == null) { | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| WxPayAccount payAcount = payAccountService.getById(appInfo.getPayId()); | |||
| if(payAcount == null){ | |||
| return new ResultData(ErrorCode.APP_ID_NOT_FOUND); | |||
| } | |||
| if(anEnum.equals(AppAddSubMerchantUrlType.improt_URL)){ | |||
| return wxProfitSharingReceiverService.getTtReceiverImprotURL(merchant,appInfo.getAppId(),payAcount.getApiKey()); | |||
| }else if(anEnum.equals(AppAddSubMerchantUrlType.Balance_URL)){ | |||
| return wxProfitSharingReceiverService.getTtReceiverBalanceURL(merchant,appInfo.getAppId(),payAcount.getApiKey()); | |||
| }else{ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请检查传递参数"); | |||
| } | |||
| } | |||
| @ApiOperation("修改可用状态") | |||
| @GetMapping("/updateTtReceiverIsUse") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @@ -10,7 +10,6 @@ public interface WxProfitSharingReceiverMapper extends CommonMapper<WxProfitShar | |||
| WxProfitSharingReceiver findOne(WxProfitSharingReceiver wxProfitSharingReceiver); | |||
| List<Long> findMerchantIdList(WxProfitSharingReceiver wxProfitSharingReceiver); | |||
| } | |||
| @@ -147,7 +147,7 @@ public interface WxMerchantService { | |||
| ResultData top(WxMerchant wxMerchant); | |||
| ResultData useAccount(WxProfitSharingReceiver wxProfitSharingReceiver); | |||
| // ResultData useAccount(WxProfitSharingReceiver wxProfitSharingReceiver); | |||
| boolean hasMerchant(WxMerchant wxMerchant); | |||
| boolean hasMerchantEncode(WxMerchant wxMerchant); | |||
| @@ -919,31 +919,31 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| return new ResultData(Result.SUCCESS, "操作成功"); | |||
| } | |||
| @Override | |||
| public ResultData useAccount(WxProfitSharingReceiver wxProfitSharingReceiver) { | |||
| WxProfitSharingReceiver profitSharingReceiver = wxProfitSharingReceiverMapper.selectById(wxProfitSharingReceiver.getId()); | |||
| profitSharingReceiver.setIsUse(wxProfitSharingReceiver.getIsUse()); | |||
| profitSharingReceiver.setUpdateTime(new Date()); | |||
| wxProfitSharingReceiverMapper.updateById(profitSharingReceiver); | |||
| Long merchantId = profitSharingReceiver.getMerchantId(); | |||
| String accout = profitSharingReceiver.getReceiverAccount(); | |||
| WxMerchant wxMerchant = wxMerchantMapper.selectById(merchantId); | |||
| String linkPhone = wxMerchant.getLinkPhone(); | |||
| String merchantName = wxMerchant.getName(); | |||
| String tenantId = wxProfitSharingReceiver.getTenantId(); | |||
| if (StringUtils.isEmpty(linkPhone)) { | |||
| return new ResultData(Result.SUCCESS, "操作成功"); | |||
| } | |||
| //发信息 | |||
| Integer isUse = wxProfitSharingReceiver.getIsUse(); | |||
| Integer type = EnumMsgModel.ACCEPT_SHARING_ACCOUNT_NOTIFY_MANAGER.getCode(); | |||
| if (isUse.equals(EnumProfitSharingUse.NO.getCode())) { | |||
| type = EnumMsgModel.REJECT_SHARING_ACCOUNT_NOTIFY_MANAGER.getCode(); | |||
| } | |||
| wxProfitSharingReceiverService.sendMsg(linkPhone, accout, merchantName, null, type, wxMerchant); | |||
| return new ResultData(Result.SUCCESS, "操作成功"); | |||
| } | |||
| // @Override | |||
| // public ResultData useAccount(WxProfitSharingReceiver wxProfitSharingReceiver) { | |||
| // WxProfitSharingReceiver profitSharingReceiver = wxProfitSharingReceiverMapper.selectById(wxProfitSharingReceiver.getId()); | |||
| // profitSharingReceiver.setIsUse(wxProfitSharingReceiver.getIsUse()); | |||
| // profitSharingReceiver.setUpdateTime(new Date()); | |||
| // wxProfitSharingReceiverMapper.updateById(profitSharingReceiver); | |||
| // | |||
| // Long merchantId = profitSharingReceiver.getMerchantId(); | |||
| // String accout = profitSharingReceiver.getReceiverAccount(); | |||
| // WxMerchant wxMerchant = wxMerchantMapper.selectById(merchantId); | |||
| // String linkPhone = wxMerchant.getLinkPhone(); | |||
| // String merchantName = wxMerchant.getName(); | |||
| // String tenantId = wxProfitSharingReceiver.getTenantId(); | |||
| // if (StringUtils.isEmpty(linkPhone)) { | |||
| // return new ResultData(Result.SUCCESS, "操作成功"); | |||
| // } | |||
| // //发信息 | |||
| // Integer isUse = wxProfitSharingReceiver.getIsUse(); | |||
| // Integer type = EnumMsgModel.ACCEPT_SHARING_ACCOUNT_NOTIFY_MANAGER.getCode(); | |||
| // if (isUse.equals(EnumProfitSharingUse.NO.getCode())) { | |||
| // type = EnumMsgModel.REJECT_SHARING_ACCOUNT_NOTIFY_MANAGER.getCode(); | |||
| // } | |||
| // wxProfitSharingReceiverService.sendMsg(linkPhone, accout, merchantName, null, type, wxMerchant); | |||
| // return new ResultData(Result.SUCCESS, "操作成功"); | |||
| // } | |||
| @Override | |||
| public boolean hasMerchant(WxMerchant wxMerchant) { | |||
| @@ -999,6 +999,18 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| } | |||
| } | |||
| } | |||
| List<Long> isUseMerchantIds = new ArrayList<Long>(); | |||
| if(record.getIsUse() != null){ | |||
| WxProfitSharingReceiver wxProfitSharingReceiver = new WxProfitSharingReceiver(); | |||
| wxProfitSharingReceiver.updateTenantInfo(record); | |||
| wxProfitSharingReceiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_DOUYIN.getCode()); | |||
| wxProfitSharingReceiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode()); | |||
| wxProfitSharingReceiver.setPlat(EnumAppPlat.TOUTIAO.getCode()); | |||
| wxProfitSharingReceiver.setIsUse(EnumProfitSharingUse.YES.getCode()); | |||
| isUseMerchantIds = wxProfitSharingReceiverMapper.findMerchantIdList(wxProfitSharingReceiver); | |||
| } | |||
| List<Long> merchantIds = new ArrayList<Long>(); | |||
| String phone = StringUtils.trimToNull(record.getPhone()); | |||
| if (null != phone) { | |||
| @@ -1025,10 +1037,20 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| merchantIds.addAll(floorMerchantIds); | |||
| } | |||
| } | |||
| if(EnumProfitSharingUse.YES.getCode().equals(record.getIsUse())){ | |||
| if(merchantIds.size() > 0){ | |||
| merchantIds.retainAll(isUseMerchantIds); | |||
| }else{ | |||
| merchantIds.addAll(isUseMerchantIds); | |||
| } | |||
| } | |||
| if (merchantIds.size() > 0 ) { | |||
| record.setIds(merchantIds); | |||
| } | |||
| List<Long> noMerchantIds = new ArrayList<Long>(); | |||
| Integer rentShopType = record.getRentShopType(); | |||
| if (null != rentShopType) { | |||
| WxRentContract rentContractQ = new WxRentContract(); | |||
| @@ -1036,9 +1058,21 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| rentContractQ.setStatuss(EnumRentContractStatus.getValidStatus()); | |||
| List<Long> usedMerchantIds = wxRentContractMapper.getMerchantIdsByStatuss(rentContractQ); | |||
| if (null != usedMerchantIds && usedMerchantIds.size() >0 ) { | |||
| record.setNotInids(usedMerchantIds); | |||
| noMerchantIds.addAll(usedMerchantIds); | |||
| // record.setNotInids(usedMerchantIds); | |||
| } | |||
| } | |||
| if(EnumProfitSharingUse.NO.getCode().equals(record.getIsUse())){ | |||
| if(noMerchantIds.size() > 0){ | |||
| noMerchantIds.retainAll(isUseMerchantIds); | |||
| }else{ | |||
| noMerchantIds.addAll(isUseMerchantIds); | |||
| } | |||
| } | |||
| if(noMerchantIds.size() > 0){ | |||
| record.setNotInids(noMerchantIds); | |||
| } | |||
| } | |||
| @Override | |||
| @@ -125,8 +125,13 @@ | |||
| <include refid="dynamicWhereConditions"/> | |||
| limit 0,1 | |||
| </select> | |||
| <select id="findMerchantIdList" parameterType="com.iformall.domain.po.WxProfitSharingReceiver" resultType="Long"> | |||
| select `merchant_id` | |||
| from wx_profit_sharing_receiver | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -265,14 +265,14 @@ public class WxMerchantController extends BaseController { | |||
| return wxMerchantService.top(wxMerchant); | |||
| } | |||
| @ApiOperation("更新收款账户状态") | |||
| @PostMapping("useAccount") | |||
| @SystemControllerLog(description = "商户-更新收款账户状态") | |||
| public ResultData useAccount(@RequestBody WxProfitSharingReceiver wxProfitSharingReceiver) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::useAccount"); | |||
| wxProfitSharingReceiver.updateTenantInfo(getTenantInfo()); | |||
| return wxMerchantService.useAccount(wxProfitSharingReceiver); | |||
| } | |||
| // @ApiOperation("更新收款账户状态") | |||
| // @PostMapping("useAccount") | |||
| // @SystemControllerLog(description = "商户-更新收款账户状态") | |||
| // public ResultData useAccount(@RequestBody WxProfitSharingReceiver wxProfitSharingReceiver) { | |||
| // logger.debug("[" + getIpAddr() + "] WxMerchantController::useAccount"); | |||
| // wxProfitSharingReceiver.updateTenantInfo(getTenantInfo()); | |||
| // return wxMerchantService.useAccount(wxProfitSharingReceiver); | |||
| // } | |||
| @ApiOperation("查看是否存在商户名称相同记录") | |||
| @GetMapping("/hasMerchant") | |||