diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java index f3de71afe..a7d198499 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProfitSharingReceiverApplyController.java @@ -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 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); + } + } diff --git a/mallinkAdmin/src/main/resources/db/migration/V2023042300001_profit_sharing_receiver_apply.sql b/mallinkAdmin/src/main/resources/db/migration/V2023042300001_profit_sharing_receiver_apply.sql new file mode 100644 index 000000000..188b68744 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V2023042300001_profit_sharing_receiver_apply.sql @@ -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`; + diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/SharingReceiverApplySchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/SharingReceiverApplySchedule.java index 89b703276..b505db7fa 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/SharingReceiverApplySchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/SharingReceiverApplySchedule.java @@ -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 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 needSyncList = wxProfitSharingReceiverApplyMapper.findListByVerifyResult(receiverApply); if(!needSyncList.isEmpty()){ 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 cf52ab34b..2af763e76 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiverApply.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxProfitSharingReceiverApply.java @@ -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; diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java index fae3bfec1..7c8ce2288 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantReceiverApplyVo.java @@ -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") diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java index 33271765c..9401e19be 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxProfitSharingReceiverApplyMapper.java @@ -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 findListVo(WxMerchantReceiverApplyVo receiver); + + int updateDelById(@Param("id") Long id); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverApplyService.java b/mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverApplyService.java index e527001e6..cb9ea1f36 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverApplyService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxProfitSharingReceiverApplyService.java @@ -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 listVoAsPage(WxMerchantReceiverApplyVo receiver, Integer pageNum, Integer pageSize); + + ResultData updateDel(WxProfitSharingReceiverApply delApply); + + void exportMerchantReceiverApply(HttpServletRequest request, HttpServletResponse response, WxMerchantReceiverApplyVo receiver); } 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 6baf29f04..58247d618 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingReceiverApplyServiceImpl.java @@ -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 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 listVo = wxProfitSharingReceiverApplyMapper.findListVo(receiver); + excelService.exportExcel(listVo,null,"商户号管理",WxMerchantReceiverApplyVo.class,"商户号管理.xlsx",response,false); + } + //------------------------------------------------------------------------------------------------------------------ diff --git a/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml b/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml index 803e1376e..a277a6e10 100644 --- a/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxProfitSharingReceiverApplyMapper.xml @@ -50,8 +50,6 @@ - - @@ -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` - where 1 = 1 + where `is_del` = 0 and `id` = #{id} @@ -121,10 +119,6 @@ and `verify_result` = #{verifyResult} - - and `status` = #{status} - - and `applyment_state` in @@ -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} @@ -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 and m.`name` like concat('%', #{merchantName},'%') @@ -238,11 +232,12 @@ and wpsra.`verify_result` = #{verifyResult} - - and wpsra.`status` = #{status} - - order by wpsra.`update_time` desc + + + + update wx_profit_sharing_receiver_apply set is_del = 1, update_time=now() where id = #{id} +