Browse Source

//receiverApply

release_toaliyun_real
xhxu 3 years ago
parent
commit
e94f27a944
9 changed files with 107 additions and 22 deletions
  1. +44
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java
  2. +9
    -0
      mallinkAdmin/src/main/resources/db/migration/V2023042300001_profit_sharing_receiver_apply.sql
  3. +2
    -2
      mallinkSchedule/src/main/java/com/iformall/schedule/SharingReceiverApplySchedule.java
  4. +2
    -2
      mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiverApply.java
  5. +12
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java
  6. +3
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java
  7. +7
    -0
      mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverApplyService.java
  8. +18
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java
  9. +10
    -15
      mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml

+ 44
- 2
mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java View File

@@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.UnsupportedEncodingException;
@@ -66,7 +67,7 @@ public class WxProfitSharingReceiverApplyController extends BaseController {
})
@SystemControllerLog(description = "商户-列表")
public ResultData listVo(WxMerchantReceiverApplyVo receiver, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] WxMerchantController::listVo");
logger.debug("[" + getIpAddr() + "] merchantProfitSharingReceiver::listVo");
if (null == receiver) receiver = new WxMerchantReceiverApplyVo();
receiver.updateTenantInfo(getTenantInfo());

@@ -83,12 +84,17 @@ public class WxProfitSharingReceiverApplyController extends BaseController {
})
@SystemControllerLog(description = "商户-列表")
public ResultData tenantListVo(WxMerchantReceiverApplyVo receiver, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] WxMerchantController::tenantListVo");
logger.debug("[" + getIpAddr() + "] merchantProfitSharingReceiver::tenantListVo");
if (null == receiver) receiver = new WxMerchantReceiverApplyVo();
final PageInfo<WxMerchantReceiverApplyVo> page = wxProfitSharingReceiverApplyService.listVoAsPage(receiver, pageNum, pageSize);
return new ResultData(page);
}

/**
* 手动授权功能后, 手动更改状态
* @param receiverAdd
* @return
*/
@TenantIgnore
@ApiOperation("修改功能状态")
@PostMapping("/updateFunctionState")
@@ -127,4 +133,40 @@ public class WxProfitSharingReceiverApplyController extends BaseController {
return wxProfitSharingReceiverApplyService.handApplymentStates(receiverApply);
}

/**
* 手动授权功能后, 手动更改状态
* @param
* @return
*/
@TenantIgnore
@ApiOperation("删除")
@PostMapping("/del")
@SystemControllerLog(description = "修改")
public ResultData delReceiverApply(@RequestBody WxProfitSharingReceiverApply receiverApply) {
log.debug("[" + getIpAddr() + "] merchantProfitSharingReceiver::delReceiverApply");
if(receiverApply.getId() == null || receiverApply.getFunctionState() == null){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
WxProfitSharingReceiverApply delApply = wxProfitSharingReceiverApplyService.selectById(receiverApply.getId());
if(receiverApply == null){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "未找到进件数据");
}
if(!EnumSharingReceiverApplymentState.APPLYMENT_STATE_CANCELED.getCode().equals(receiverApply.getApplymentState())){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "已作废,才能删除");
}
return wxProfitSharingReceiverApplyService.updateDel(delApply);
}


@ApiOperation("分页列表接口")
@GetMapping("exportApply")
@SystemControllerLog(description = "商户-列表")
public void exportApply(WxMerchantReceiverApplyVo receiver, HttpServletRequest request, HttpServletResponse response) {
logger.debug("[" + getIpAddr() + "] merchantProfitSharingReceiver::exportApply");
if (null == receiver) receiver = new WxMerchantReceiverApplyVo();
receiver.updateTenantInfo(getTenantInfo());

wxProfitSharingReceiverApplyService.exportMerchantReceiverApply(request,response,receiver);
}

}

+ 9
- 0
mallinkAdmin/src/main/resources/db/migration/V2023042300001_profit_sharing_receiver_apply.sql View File

@@ -0,0 +1,9 @@
ALTER TABLE `mallink`.`wx_profit_sharing_receiver_apply`
ADD COLUMN `is_del` smallint(1) NOT NULL DEFAULT 0 AFTER `update_time`;

update `mallink`.`wx_profit_sharing_receiver_apply` set `is_del` = `status`;

--上线后执行
ALTER TABLE `mallink`.`wx_profit_sharing_receiver_apply`
DROP COLUMN `status`;


+ 2
- 2
mallinkSchedule/src/main/java/com/iformall/schedule/SharingReceiverApplySchedule.java View File

@@ -31,7 +31,7 @@ public class SharingReceiverApplySchedule {
@Scheduled(cron = "0 22 */1 * * ?")// 每小时的22分钟
public void handApplymentStatesSchedule() {
WxProfitSharingReceiverApply receiverApply = new WxProfitSharingReceiverApply();
receiverApply.setStatus(EnumSharingReceiverApplyStatus.PROFIT_RECEIVER_APPLY_STATUS_VALID.getCode());
// receiverApply.setStatus(EnumSharingReceiverApplyStatus.PROFIT_RECEIVER_APPLY_STATUS_VALID.getCode());
receiverApply.setApplymentStates(EnumSharingReceiverApplymentState.getNeedSyncList());
List<WxProfitSharingReceiverApply> needSyncList = wxProfitSharingReceiverApplyMapper.findListByApplymentState(receiverApply);
if(!needSyncList.isEmpty()){
@@ -52,7 +52,7 @@ public class SharingReceiverApplySchedule {
@Scheduled(cron = "0 22 11,17 * * ?")// 每天上午11点下午17点的22分钟
public void handVerifyResultSchedule() {
WxProfitSharingReceiverApply receiverApply = new WxProfitSharingReceiverApply();
receiverApply.setStatus(EnumSharingReceiverApplyStatus.PROFIT_RECEIVER_APPLY_STATUS_VALID.getCode());
// receiverApply.setStatus(EnumSharingReceiverApplyStatus.PROFIT_RECEIVER_APPLY_STATUS_VALID.getCode());
receiverApply.setVerifyResult(EnumSharingReceiverVerifyResult.VERIFYING.getCode());
List<WxProfitSharingReceiverApply> needSyncList = wxProfitSharingReceiverApplyMapper.findListByVerifyResult(receiverApply);
if(!needSyncList.isEmpty()){


+ 2
- 2
mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiverApply.java View File

@@ -107,8 +107,8 @@ public class WxProfitSharingReceiverApply extends TenantEntity {
@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="EnumSharingReceiverApplyStatus",name="status")
// private Integer status;

@io.swagger.annotations.ApiModelProperty(value="",name="createTime")
private Date createTime;


+ 12
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java View File

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

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.iformall.domain.po.base.TenantEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -14,12 +15,14 @@ public class WxMerchantReceiverApplyVo extends TenantEntity {

private Long merchantId;

@Excel(name="商户名称",width = 20,orderNum = "1")
@io.swagger.annotations.ApiModelProperty(value="商户名",name="merchantName")
private String merchantName;
@io.swagger.annotations.ApiModelProperty(value="商户联系人",name="merchantlinkPerson")
private String merchantlinkPerson;
@io.swagger.annotations.ApiModelProperty(value="商户联系方式",name="merchantLinkPhone")
private String merchantLinkPhone;
@Excel(name="商户状态",width = 20,orderNum = "2",replace = {"正常_1", "停用_0"})
@io.swagger.annotations.ApiModelProperty(value="商户状态1可用0停用",name="merchantStatus")
private Integer merchantStatus;

@@ -29,15 +32,19 @@ public class WxMerchantReceiverApplyVo extends TenantEntity {

@io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverOrganizationType 主体类型",name="organizationType")
private Integer organizationType;
@Excel(name="营业执照名称",width = 20,orderNum = "4")
@io.swagger.annotations.ApiModelProperty(value="营业执照名称",name="businessName")
private String businessName;
@Excel(name="法人姓名",width = 20,orderNum = "5")
@io.swagger.annotations.ApiModelProperty(value="营业执照法人",name="businessLegalPerson")
private String businessLegalPerson;
@io.swagger.annotations.ApiModelProperty(value="商户简称",name="businessShortName")
private String businessShortName;

@Excel(name="超管姓名",width = 20,orderNum = "6")
@io.swagger.annotations.ApiModelProperty(value="超管姓名",name="contactName")
private String contactName;
@Excel(name="超管手机号",width = 20,orderNum = "7")
@io.swagger.annotations.ApiModelProperty(value="超管手机",name="contactPhone")
private String contactPhone;
@io.swagger.annotations.ApiModelProperty(value="超管邮箱",name="contactEmail")
@@ -45,11 +52,15 @@ public class WxMerchantReceiverApplyVo extends TenantEntity {

@io.swagger.annotations.ApiModelProperty(value="微信支付申请单号",name="applymentId")
private String applymentId;
@Excel(name="进件状态",width = 20,orderNum = "8",replace = {"编辑中_1", "提交审核成功_11", "资料效验中_2", "审核中_3", "已驳回_4",
"待账户验证_5", "待签约_6", "功能开通中_7", "完成_8", "已冻结_9", "已作废_10"})
@io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverApplymentState 申请状态",name="applymentState")
private Integer applymentState;
@Excel(name="进件状态描述",width = 20,orderNum = "9")
@io.swagger.annotations.ApiModelProperty(value="申请状态描述",name="applymentStateDesc")
private String applymentStateDesc;

@Excel(name="功能开通状态",width = 20,orderNum = "10",replace = {"开通中_1", "未开通_0", "已开通_2"})
@io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverApplyFunctionStatus 功能开通状态",name="functionState")
private Integer functionState;
@io.swagger.annotations.ApiModelProperty(value="功能开通状态描述",name="functionStateDesc")
@@ -59,6 +70,7 @@ public class WxMerchantReceiverApplyVo extends TenantEntity {
private Integer signState;
@io.swagger.annotations.ApiModelProperty(value="签约链接",name="signUrl")
private String signUrl;
@Excel(name="商户号",width = 20,orderNum = "3")
@io.swagger.annotations.ApiModelProperty(value="电商平台二级商户号",name="subMchid")
private String subMchid;
@io.swagger.annotations.ApiModelProperty(value="汇款账户验证信息",name="accountValidation")


+ 3
- 0
mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java View File

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

import com.iformall.common.CommonMapper;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxProfitSharingReceiver;
import com.iformall.domain.po.WxProfitSharingReceiverApply;
import com.iformall.domain.vo.WxMerchantReceiverApplyVo;
@@ -19,4 +20,6 @@ public interface WxProfitSharingReceiverApplyMapper extends CommonMapper<WxProfi
WxProfitSharingReceiverApply findResultStateById(@Param("id") Long id);

List<WxMerchantReceiverApplyVo> findListVo(WxMerchantReceiverApplyVo receiver);

int updateDelById(@Param("id") Long id);
}

+ 7
- 0
mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverApplyService.java View File

@@ -7,6 +7,9 @@ import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxMerchantReceiverApplyVo;
import com.iformall.enums.EnumAppPlat;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public interface WxProfitSharingReceiverApplyService {

/**
@@ -40,4 +43,8 @@ public interface WxProfitSharingReceiverApplyService {


PageInfo<WxMerchantReceiverApplyVo> listVoAsPage(WxMerchantReceiverApplyVo receiver, Integer pageNum, Integer pageSize);

ResultData updateDel(WxProfitSharingReceiverApply delApply);

void exportMerchantReceiverApply(HttpServletRequest request, HttpServletResponse response, WxMerchantReceiverApplyVo receiver);
}

+ 18
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java View File

@@ -27,6 +27,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;


@@ -50,6 +52,9 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR
@Autowired
WxPayAccountService wxPayAccountService;

@Autowired
ExcelService excelService;

@Override
public PageInfo<WxProfitSharingReceiverApply> listAsPage(WxProfitSharingReceiverApply record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxProfitSharingReceiverApplyMapper.findList(record));
@@ -71,7 +76,7 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR
receiverApply.updateTenantInfo(tenantEntity);
receiverApply.setMerchantId(merchantId);
receiverApply.setPlat(plat.getCode());
receiverApply.setStatus(EnumSharingReceiverApplyStatus.PROFIT_RECEIVER_APPLY_STATUS_VALID.getCode());
// receiverApply.setStatus(EnumSharingReceiverApplyStatus.PROFIT_RECEIVER_APPLY_STATUS_VALID.getCode());
return wxProfitSharingReceiverApplyMapper.selectOne(new QueryWrapper<>(receiverApply));
}

@@ -282,6 +287,18 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR
return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxProfitSharingReceiverApplyMapper.findListVo(receiver));
}

@Override
public ResultData updateDel(WxProfitSharingReceiverApply delApply) {
wxProfitSharingReceiverApplyMapper.updateDelById(delApply.getId());
return new ResultData();
}

@Override
public void exportMerchantReceiverApply(HttpServletRequest request, HttpServletResponse response, WxMerchantReceiverApplyVo receiver) {
List<WxMerchantReceiverApplyVo> listVo = wxProfitSharingReceiverApplyMapper.findListVo(receiver);
excelService.exportExcel(listVo,null,"商户号管理",WxMerchantReceiverApplyVo.class,"商户号管理.xlsx",response,false);
}


//------------------------------------------------------------------------------------------------------------------



+ 10
- 15
mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml View File

@@ -50,8 +50,6 @@
<result column="verify_result" jdbcType="INTEGER" property="verifyResult" />
<result column="verify_fail_reason" jdbcType="VARCHAR" property="verifyFailReason" />

<result column="status" jdbcType="INTEGER" property="status" />

<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
@@ -64,11 +62,11 @@
`merchant_shortname`,`service_phone`,`sales_info`,`qualifications`,`addition_info`,`business_addition_pics`,`business_addition_desc`,
`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`
`verify_result`,`verify_fail_reason`,`create_time`,`update_time`
</sql>

<sql id="dynamicWhereConditions">
where 1 = 1
where `is_del` = 0
<if test=" null != id ">
and `id` = #{id}
@@ -121,10 +119,6 @@
and `verify_result` = #{verifyResult}
</if>

<if test=" null != status ">
and `status` = #{status}
</if>

<if test=" null != applymentStates ">
and `applyment_state` in
<foreach collection="applymentStates" index="index" item="idItem" open="(" separator="," close=")">
@@ -153,7 +147,7 @@
`id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`plat`,`out_request_no`,
`applyment_id`,`applyment_state`,`applyment_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`
`verify_result`,`verify_fail_reason`,`create_time`,`update_time`
from wx_profit_sharing_receiver_apply
where `id` = #{id}
</select>
@@ -186,10 +180,10 @@
wpsra.`account_validation` as accountValidation,wpsra.`audit_detail` as auditDetail,
wpsra.`legal_validation_url` as legalValidationUrl,wpsra.`legal_validation_qrcode` as legalValidationQrcode,
wpsra.`verify_result` as verifyResult,wpsra.`verify_fail_reason` as verifyFailReason,
wpsra.`status` as status,wpsra.`create_time` as createTime,wpsra.`update_time` as updateTime
wpsra.`create_time` as createTime,wpsra.`update_time` as updateTime
from wx_profit_sharing_receiver_apply wpsra
left join wx_merchant m on wpsra.merchant_id = m.id and m.is_del = 0
where m.`is_private` = 0
where wpsra.is_del = 0 and m.`is_private` = 0
<if test=" null != merchantName and ''!=merchantName ">
and m.`name` like concat('%', #{merchantName},'%')
</if>
@@ -238,11 +232,12 @@
and wpsra.`verify_result` = #{verifyResult}
</if>

<if test=" null != status ">
and wpsra.`status` = #{status}
</if>

order by wpsra.`update_time` desc
</select>


<update id="updateDelById" parameterType="Long">
update wx_profit_sharing_receiver_apply set is_del = 1, update_time=now() where id = #{id}
</update>
</mapper>

Loading…
Cancel
Save