From e9adb6d4775ec381f273867e356b4a85e8d55b24 Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 26 Oct 2022 18:39:55 +0800 Subject: [PATCH] //merchantapply --- ...xProfitSharingReceiverApplyController.java | 130 ++++++++++++++++++ .../V2022102600001__add_wx_receicer_apply.sql | 3 + .../com/iformall/domain/po/WxMerchant.java | 2 +- .../po/WxProfitSharingReceiverApply.java | 6 + .../domain/vo/WxMerchantReceiverApplyVo.java | 89 ++++++++++++ ...numSharingReceiverApplyFunctionStatus.java | 37 +++++ .../WxProfitSharingReceiverApplyMapper.java | 3 + .../WxProfitSharingReceiverApplyService.java | 5 + ...ProfitSharingReceiverApplyServiceImpl.java | 23 ++++ .../WxProfitSharingReceiverApplyMapper.xml | 75 +++++++++- 10 files changed, 371 insertions(+), 2 deletions(-) create mode 100644 mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java create mode 100644 mallinkAdmin/src/main/resources/db/migration/V2022102600001__add_wx_receicer_apply.sql create mode 100644 mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java create mode 100644 mallinkService/src/main/java/com/iformall/enums/EnumSharingReceiverApplyFunctionStatus.java diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java new file mode 100644 index 000000000..1dac1cc4d --- /dev/null +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java @@ -0,0 +1,130 @@ +package com.iformall.controller.basic; + +import com.alibaba.fastjson.JSON; +import com.github.pagehelper.PageInfo; +import com.iformall.annotation.SystemControllerLog; +import com.iformall.annotation.TenantIgnore; +import com.iformall.common.ErrorCode; +import com.iformall.common.ResultData; +import com.iformall.controller.base.BaseController; +import com.iformall.domain.po.WxMerchant; +import com.iformall.domain.po.WxProfitSharingReceiver; +import com.iformall.domain.po.WxProfitSharingReceiverApply; +import com.iformall.domain.po.base.BaseEntity; +import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.vo.WxMerchantReceiverApplyVo; +import com.iformall.douyin.pay.enums.MerchantImportStatus; +import com.iformall.enums.*; +import com.iformall.exception.MallinkException; +import com.iformall.file.aliyun.AliyunOSS; +import com.iformall.service.WxMerchantService; +import com.iformall.service.WxProfitSharingReceiverApplyService; +import com.iformall.service.WxProfitSharingReceiverService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayInputStream; +import java.io.UnsupportedEncodingException; +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping("/api/sharingReceiverApply") +@Api(description = "进件相关接口") +@Slf4j +public class WxProfitSharingReceiverApplyController extends BaseController { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + private WxProfitSharingReceiverApplyService wxProfitSharingReceiverApplyService; + + @Autowired + private WxProfitSharingReceiverService wxProfitSharingReceiverService; + + @Autowired + private WxMerchantService wxMerchantService; + + @Autowired + private AliyunOSS aliyunOSS; + + @ApiOperation("分页列表接口") + @GetMapping("listVo") + @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 listVo(WxMerchantReceiverApplyVo receiver, Integer pageNum, Integer pageSize) { + logger.debug("[" + getIpAddr() + "] WxMerchantController::listVo"); + if (null == receiver) receiver = new WxMerchantReceiverApplyVo(); + receiver.updateTenantInfo(getTenantInfo()); + + final PageInfo page = wxProfitSharingReceiverApplyService.listVoAsPage(receiver, pageNum, pageSize); + return new ResultData(page); + } + + @TenantIgnore + @ApiOperation("分页列表接口") + @GetMapping("tenantListVo") + @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 tenantListVo(WxMerchantReceiverApplyVo receiver, Integer pageNum, Integer pageSize) { + logger.debug("[" + getIpAddr() + "] WxMerchantController::tenantListVo"); + if (null == receiver) receiver = new WxMerchantReceiverApplyVo(); + final PageInfo page = wxProfitSharingReceiverApplyService.listVoAsPage(receiver, pageNum, pageSize); + return new ResultData(page); + } + + @TenantIgnore + @ApiOperation("修改功能状态") + @PostMapping("/updateFunctionState") + @SystemControllerLog(description = "修改") + public ResultData updateFunctionState(@RequestBody WxProfitSharingReceiverApply receiverAdd) { + log.debug("[" + getIpAddr() + "] merchantProfitSharingReceiver::updateFunctionState"); + if(receiverAdd.getId() == null || receiverAdd.getFunctionState() == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); + } + WxProfitSharingReceiverApply receiverApply = wxProfitSharingReceiverApplyService.selectById(receiverAdd.getId()); + if(receiverApply == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到进件数据"); + } + if(!EnumSharingReceiverApplymentState.APPLYMENT_STATE_FINISHED.getCode().equals(receiverApply.getApplymentState())){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "进件还未完成"); + } + receiverAdd.updateTenantInfo(receiverApply); + return wxProfitSharingReceiverApplyService.updateFunctionState(receiverAdd); + } + + @TenantIgnore + @ApiOperation("刷新审核状态") + @GetMapping("/syncApplymentStates") + @SystemControllerLog(description = "刷新") + public ResultData syncApplymentStates(Long id) { + log.debug("[" + getIpAddr() + "] merchantProfitSharingReceiver::syncApplymentStates"); + if(id == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "ID不能为空"); + } + + WxProfitSharingReceiverApply receiverApply = wxProfitSharingReceiverApplyService.findResultStateById(id); + if(receiverApply == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到进件数据"); + } + + return wxProfitSharingReceiverApplyService.handApplymentStates(receiverApply); + } + +} diff --git a/mallinkAdmin/src/main/resources/db/migration/V2022102600001__add_wx_receicer_apply.sql b/mallinkAdmin/src/main/resources/db/migration/V2022102600001__add_wx_receicer_apply.sql new file mode 100644 index 000000000..d2ef06d49 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V2022102600001__add_wx_receicer_apply.sql @@ -0,0 +1,3 @@ +ALTER TABLE `mallink`.`wx_profit_sharing_receiver_apply` +ADD COLUMN `function_state` smallint(1) COMMENT '功能开通状态' AFTER `applyment_state_desc`, +ADD COLUMN `function_state_desc` varchar(255) COMMENT '功能开通状态描述' AFTER `function_state`; \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java index 1b76d5037..650f72dd4 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java @@ -112,7 +112,7 @@ public class WxMerchant extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "是否显示在C端", name = "isPublic") private Integer isPublic; - @io.swagger.annotations.ApiModelProperty(value = "是否显示在广场", name = "isPrivate") + @io.swagger.annotations.ApiModelProperty(value = "是否保密", name = "isPrivate") private Integer isPrivate; @Excel(name = "待缴提醒", width = 20, orderNum = "10") diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiverApply.java b/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiverApply.java index ccb6ea77f..cf52ab34b 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiverApply.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiverApply.java @@ -81,6 +81,12 @@ public class WxProfitSharingReceiverApply extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="申请状态描述",name="applymentStateDesc") private String applymentStateDesc; + + @io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverApplyFunctionStatus 功能开通状态",name="functionState") + private Integer functionState; + @io.swagger.annotations.ApiModelProperty(value="功能开通状态描述",name="functionStateDesc") + private String functionStateDesc; + @io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverSignState 签约状态",name="signState") private Integer signState; @io.swagger.annotations.ApiModelProperty(value="签约链接",name="signUrl") diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java new file mode 100644 index 000000000..3f6af3465 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java @@ -0,0 +1,89 @@ +package com.iformall.domain.vo; + +import com.iformall.domain.po.base.TenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.util.Date; + +@Data +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +public class WxMerchantReceiverApplyVo extends TenantEntity { + + private Long merchantId; + + @io.swagger.annotations.ApiModelProperty(value="商户名",name="merchantName") + private String merchantName; + @io.swagger.annotations.ApiModelProperty(value="商户联系人",name="linkPhone") + private String merchantlinkPerson; + @io.swagger.annotations.ApiModelProperty(value="商户联系方式",name="linkPhone") + private String merchantLinkPhone; + @io.swagger.annotations.ApiModelProperty(value="商户状态1可用0停用",name="status") + private Integer merchantStatus; + + private Long applyId; + private String outRequestNo; + private Integer plat; + + @io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverOrganizationType 主体类型",name="organizationType") + private Integer organizationType; + @io.swagger.annotations.ApiModelProperty(value="营业执照名称",name="businessName") + private String businessName; + @io.swagger.annotations.ApiModelProperty(value="营业执照法人",name="businessLegalPerson") + private String businessLegalPerson; + @io.swagger.annotations.ApiModelProperty(value="商户简称",name="businessShortName") + private String businessShortName; + + @io.swagger.annotations.ApiModelProperty(value="超管姓名",name="contactName") + private String contactName; + @io.swagger.annotations.ApiModelProperty(value="超管手机",name="contactPhone") + private String contactPhone; + @io.swagger.annotations.ApiModelProperty(value="超管邮箱",name="contactEmail") + private String contactEmail; + + @io.swagger.annotations.ApiModelProperty(value="微信支付申请单号",name="applymentId") + private String applymentId; + @io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverApplymentState 申请状态",name="applymentState") + private Integer applymentState; + @io.swagger.annotations.ApiModelProperty(value="申请状态描述",name="applymentStateDesc") + private String applymentStateDesc; + + @io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverApplyFunctionStatus 功能开通状态",name="functionState") + private Integer functionState; + @io.swagger.annotations.ApiModelProperty(value="功能开通状态描述",name="functionStateDesc") + private String functionStateDesc; + + @io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverSignState 签约状态",name="signState") + private Integer signState; + @io.swagger.annotations.ApiModelProperty(value="签约链接",name="signUrl") + private String signUrl; + @io.swagger.annotations.ApiModelProperty(value="电商平台二级商户号",name="subMchid") + private String subMchid; + @io.swagger.annotations.ApiModelProperty(value="汇款账户验证信息",name="accountValidation") + private String accountValidation; + @io.swagger.annotations.ApiModelProperty(value="驳回原因详情",name="auditDetail") + private String auditDetail; + @io.swagger.annotations.ApiModelProperty(value="法人验证链接",name="legalValidationUrl") + private String legalValidationUrl; + @io.swagger.annotations.ApiModelProperty(value="法人验证链接二维码",name="legalValidationQrcode") + private String legalValidationQrcode; + + @io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverVerifyResult 修改收款帐号 申请状态",name="verifyResult") + private Integer verifyResult; + @io.swagger.annotations.ApiModelProperty(value="汇款验证失败原因",name="verifyFailReason") + private String verifyFailReason; + + @io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverApplyStatus",name="status") + private Integer status; + + @io.swagger.annotations.ApiModelProperty(value="",name="createTime") + private Date createTime; + @io.swagger.annotations.ApiModelProperty(value="",name="updateTime") + private Date updateTime; + + + + +} diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumSharingReceiverApplyFunctionStatus.java b/mallinkService/src/main/java/com/iformall/enums/EnumSharingReceiverApplyFunctionStatus.java new file mode 100644 index 000000000..164dd4717 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/enums/EnumSharingReceiverApplyFunctionStatus.java @@ -0,0 +1,37 @@ +package com.iformall.enums; + +/** + * luozukai + */ +public enum EnumSharingReceiverApplyFunctionStatus { + + wait(0, "待开通/不需要开通"), + ing(1, "开通中"), + FINISH(2, "开通完成"), + ; + + public static EnumSharingReceiverApplyFunctionStatus getEnum(Integer code) { + for (EnumSharingReceiverApplyFunctionStatus value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + private Integer code; + private String message; + + EnumSharingReceiverApplyFunctionStatus(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java index 6a0e161f4..33271765c 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java @@ -3,6 +3,7 @@ package com.iformall.mapper; import com.iformall.common.CommonMapper; import com.iformall.domain.po.WxProfitSharingReceiver; import com.iformall.domain.po.WxProfitSharingReceiverApply; +import com.iformall.domain.vo.WxMerchantReceiverApplyVo; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -16,4 +17,6 @@ public interface WxProfitSharingReceiverApplyMapper extends CommonMapper findListByVerifyResult(WxProfitSharingReceiverApply apply); WxProfitSharingReceiverApply findResultStateById(@Param("id") Long id); + + List findListVo(WxMerchantReceiverApplyVo receiver); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverApplyService.java b/mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverApplyService.java index dc54c07dc..e527001e6 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverApplyService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverApplyService.java @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; import com.iformall.common.ResultData; import com.iformall.domain.po.WxProfitSharingReceiverApply; import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.vo.WxMerchantReceiverApplyVo; import com.iformall.enums.EnumAppPlat; public interface WxProfitSharingReceiverApplyService { @@ -35,4 +36,8 @@ public interface WxProfitSharingReceiverApplyService { ResultData handVerifyResult(WxProfitSharingReceiverApply apply); + ResultData updateFunctionState(WxProfitSharingReceiverApply receiverAdd); + + + PageInfo listVoAsPage(WxMerchantReceiverApplyVo receiver, Integer pageNum, Integer pageSize); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java index fa32485eb..bc44ea9c9 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java @@ -15,6 +15,7 @@ import com.iformall.common.IdWorker; import com.iformall.common.ResultData; import com.iformall.domain.po.*; import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.vo.WxMerchantReceiverApplyVo; import com.iformall.enums.*; import com.iformall.exception.MallinkException; import com.iformall.mapper.WxProfitSharingReceiverApplyMapper; @@ -143,6 +144,10 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR receiverApplyUpd.setApplymentId((String) result.data); receiverApplyUpd.setApplymentState(EnumSharingReceiverApplymentState.APPLYMENT_STATE_SUBMIT.getCode()); receiverApplyUpd.setApplymentStateDesc(EnumSharingReceiverApplymentState.APPLYMENT_STATE_SUBMIT.getMessage()); + if(receiverApply.getFunctionState() == null){ + receiverApplyUpd.setFunctionState(EnumSharingReceiverApplyFunctionStatus.wait.getCode()); + receiverApplyUpd.setFunctionStateDesc(EnumSharingReceiverApplyFunctionStatus.wait.getMessage()); + } receiverApplyUpd.setSignUrl(""); receiverApplyUpd.setAuditDetail("[]"); receiverApplyUpd.setUpdateTime(new Date()); @@ -265,6 +270,24 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR } } + @Override + public ResultData updateFunctionState(WxProfitSharingReceiverApply receiverAdd) { + WxProfitSharingReceiverApply applyUpd = new WxProfitSharingReceiverApply(); + applyUpd.setId(receiverAdd.getId()); + applyUpd.updateTenantInfo(receiverAdd); + applyUpd.setFunctionState(receiverAdd.getFunctionState()); + if(StringUtils.isNotBlank(receiverAdd.getFunctionStateDesc())){ + applyUpd.setFunctionStateDesc(receiverAdd.getFunctionStateDesc()); + } + wxProfitSharingReceiverApplyMapper.updateById(applyUpd); + return new ResultData(); + } + + @Override + public PageInfo listVoAsPage(WxMerchantReceiverApplyVo receiver, Integer pageNum, Integer pageSize) { + return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxProfitSharingReceiverApplyMapper.findListVo(receiver)); + } + //------------------------------------------------------------------------------------------------------------------ diff --git a/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml b/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml index 6c1927873..0d2d5e64a 100644 --- a/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml @@ -36,6 +36,8 @@ + + @@ -60,7 +62,7 @@ `id_holder_type`,`id_doc_type`,`authorize_letter`,`authorize_letter_copy`,`id_card_info`,`id_doc_info`, `owner`,`ubo_info_list`,`account_info`,`contact_info`,`sales_scene_info`,`settlement_info`, `merchant_shortname`,`service_phone`,`sales_info`,`qualifications`,`addition_info`,`business_addition_pics`,`business_addition_desc`, - `applyment_id`,`applyment_state`,`applyment_state_desc`,`sign_state`,`sign_url`, + `applyment_id`,`applyment_state`,`applyment_state_desc`,`function_state`,`function_state_desc`,`sign_state`,`sign_url`, `sub_mchid`,`account_validation`,`audit_detail`,`legal_validation_url`,`legal_validation_qrcode`, `verify_result`,`verify_fail_reason`,`status`,`create_time`,`update_time` @@ -103,6 +105,10 @@ and `applyment_state` = #{applymentState} + + and `function_state` = #{functionState} + + and `sign_state` = #{signState} @@ -161,5 +167,72 @@ from wx_profit_sharing_receiver_apply + + +