提出字段
新增 列表接口
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.BaseQueryParam;
|
||||
import com.czg.EntryManager;
|
||||
import com.czg.annotation.Debounce;
|
||||
import com.czg.dto.req.AggregateMerchantDto;
|
||||
import com.czg.dto.resp.BankBranchDto;
|
||||
import com.czg.order.entity.ShopDirectMerchant;
|
||||
import com.czg.service.order.dto.AggregateMerchantVO;
|
||||
import com.czg.service.order.dto.MerchantQueryDTO;
|
||||
import com.czg.service.order.service.ShopDirectMerchantService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.task.EntryManagerTask;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -62,6 +66,14 @@ public class EntryManagerController {
|
||||
return CzgResult.success(EntryManager.queryBankBranchList(province, city, instId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取进件信息
|
||||
*/
|
||||
@GetMapping("list")
|
||||
public CzgResult<Page<ShopDirectMerchant>> getEntryList(MerchantQueryDTO queryParam) {
|
||||
return CzgResult.success(shopDirectMerchantService.getEntryList(queryParam));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取进件信息
|
||||
|
||||
@@ -35,6 +35,10 @@ public class ShopDirectMerchant implements Serializable {
|
||||
*/
|
||||
@Id
|
||||
private Long shopId;
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
private String shopName;
|
||||
|
||||
/**
|
||||
* 营业执照编号
|
||||
@@ -44,12 +48,24 @@ public class ShopDirectMerchant implements Serializable {
|
||||
* 支付宝账号
|
||||
*/
|
||||
private String alipayAccount;
|
||||
|
||||
/**
|
||||
* 商户编号(在当前系统唯一)
|
||||
*/
|
||||
private String merchantCode;
|
||||
/**
|
||||
* 【必填】
|
||||
* 商户类型
|
||||
* 0: 个体商户;
|
||||
* 1: 企业商户;
|
||||
* 3: 小微商户 暂不支持
|
||||
*/
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 【必填】
|
||||
* 商户简称--企业、个体必填
|
||||
*/
|
||||
private String shortName;
|
||||
/**
|
||||
* 商户基础信息
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,8 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
public class AggregateMerchantVO extends AggregateMerchantDto{
|
||||
|
||||
private String shopName;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
@@ -30,6 +32,24 @@ public class AggregateMerchantVO extends AggregateMerchantDto{
|
||||
* 支付宝账号
|
||||
*/
|
||||
private String alipayAccount;
|
||||
/**
|
||||
* 商户编号(在当前系统唯一)
|
||||
*/
|
||||
private String merchantCode;
|
||||
/**
|
||||
* 【必填】
|
||||
* 商户类型
|
||||
* 0: 个体商户;
|
||||
* 1: 企业商户;
|
||||
* 3: 小微商户 暂不支持
|
||||
*/
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 【必填】
|
||||
* 商户简称--企业、个体必填
|
||||
*/
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* 微信进件错误信息
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.czg.service.order.dto;
|
||||
|
||||
import com.czg.BaseQueryParam;
|
||||
import com.czg.utils.CzgStrUtils;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
||||
/**
|
||||
* 进件查询参数
|
||||
* @author ww
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class MerchantQueryDTO extends BaseQueryParam {
|
||||
|
||||
/**
|
||||
* 商户类型
|
||||
* 0: 个体商户;
|
||||
* 1: 企业商户;
|
||||
*/
|
||||
private String userType;
|
||||
/**
|
||||
* 店铺名称 模糊查询
|
||||
*/
|
||||
private String shopName;
|
||||
/**
|
||||
* 进件状态
|
||||
* {@link com.czg.PayCst.EntryStatus}
|
||||
* WAIT 待提交
|
||||
* INIT 待处理
|
||||
* AUDIT 待审核
|
||||
* SIGN 待签约
|
||||
* FINISH 已完成
|
||||
* REJECTED 失败
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 支付宝账号
|
||||
*/
|
||||
private String alipayAccount;
|
||||
|
||||
public String getUserType() {
|
||||
return CzgStrUtils.getStrOrNull(userType);
|
||||
}
|
||||
|
||||
public String getShopName() {
|
||||
return CzgStrUtils.getStrOrNull(shopName);
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return CzgStrUtils.getStrOrNull(status);
|
||||
}
|
||||
|
||||
public String getAlipayAccount() {
|
||||
return CzgStrUtils.getStrOrNull(alipayAccount);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.czg.service.order.mapper;
|
||||
|
||||
import com.czg.service.order.dto.MerchantQueryDTO;
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.order.entity.ShopDirectMerchant;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户进件 映射层。
|
||||
*
|
||||
@@ -11,4 +14,5 @@ import com.czg.order.entity.ShopDirectMerchant;
|
||||
*/
|
||||
public interface ShopDirectMerchantMapper extends BaseMapper<ShopDirectMerchant> {
|
||||
|
||||
List<ShopDirectMerchant> getEntryList(MerchantQueryDTO queryParam);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.czg.service.order.service;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.dto.req.AggregateMerchantDto;
|
||||
import com.czg.service.order.dto.AggregateMerchantVO;
|
||||
import com.czg.service.order.dto.MerchantQueryDTO;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.order.entity.ShopDirectMerchant;
|
||||
|
||||
@@ -22,6 +24,8 @@ public interface ShopDirectMerchantService extends IService<ShopDirectMerchant>
|
||||
*/
|
||||
JSONObject getInfoByImg(String url, String type) throws Exception;
|
||||
|
||||
|
||||
Page<ShopDirectMerchant> getEntryList(MerchantQueryDTO queryParam);
|
||||
/**
|
||||
* 获取进件信息
|
||||
*/
|
||||
|
||||
@@ -11,16 +11,22 @@ import com.czg.constants.ParamCodeCst;
|
||||
import com.czg.dto.req.*;
|
||||
import com.czg.order.entity.ShopDirectMerchant;
|
||||
import com.czg.service.order.dto.AggregateMerchantVO;
|
||||
import com.czg.service.order.dto.MerchantQueryDTO;
|
||||
import com.czg.service.order.mapper.ShopDirectMerchantMapper;
|
||||
import com.czg.service.order.service.ShopDirectMerchantService;
|
||||
import com.czg.system.service.SysParamsService;
|
||||
import com.czg.utils.FunUtils;
|
||||
import com.czg.utils.PageUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
@@ -50,6 +56,13 @@ public class ShopDirectMerchantServiceImpl extends ServiceImpl<ShopDirectMerchan
|
||||
return OcrUtils.getInfoByImg(aliOssKeys.get(ParamCodeCst.AliYun.ALI_SMS_KEY), aliOssKeys.get(ParamCodeCst.AliYun.ALI_SMS_SECRET), url, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<ShopDirectMerchant> getEntryList(MerchantQueryDTO queryParam) {
|
||||
PageHelper.startPage(queryParam.getPage(), queryParam.getSize());
|
||||
List<ShopDirectMerchant> entryList = mapper.getEntryList(queryParam);
|
||||
return PageUtil.convert(new PageInfo<>(entryList));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AggregateMerchantVO getEntry(Long shopId) {
|
||||
ShopDirectMerchant merchant = getById(shopId);
|
||||
@@ -75,6 +88,11 @@ public class ShopDirectMerchantServiceImpl extends ServiceImpl<ShopDirectMerchan
|
||||
merchant.setMerchantCode(reqDto.getMerchantCode());
|
||||
merchant.setLicenceNo(reqDto.getBusinessLicenceInfo().getLicenceNo());
|
||||
|
||||
MerchantBaseInfoDto merchantBaseInfo = reqDto.getMerchantBaseInfo();
|
||||
merchant.setAlipayAccount(merchantBaseInfo.getAlipayAccount());
|
||||
merchant.setUserType(merchantBaseInfo.getUserType());
|
||||
merchant.setShortName(merchantBaseInfo.getShortName());
|
||||
|
||||
merchant.setMerchantBaseInfo(JSONObject.toJSONString(reqDto.getMerchantBaseInfo()));
|
||||
merchant.setLegalPersonInfo(JSONObject.toJSONString(reqDto.getLegalPersonInfo()));
|
||||
merchant.setBusinessLicenceInfo(JSONObject.toJSONString(reqDto.getBusinessLicenceInfo()));
|
||||
@@ -120,6 +138,7 @@ public class ShopDirectMerchantServiceImpl extends ServiceImpl<ShopDirectMerchan
|
||||
AggregateMerchantVO vo = new AggregateMerchantVO();
|
||||
vo.setShopId(entity.getShopId());
|
||||
vo.setMerchantCode(entity.getMerchantCode());
|
||||
vo.setShopName(entity.getShopName());
|
||||
|
||||
// 解析JSON字段
|
||||
vo.setMerchantBaseInfo(JSONObject.parseObject(entity.getMerchantBaseInfo(), MerchantBaseInfoDto.class));
|
||||
@@ -129,6 +148,8 @@ public class ShopDirectMerchantServiceImpl extends ServiceImpl<ShopDirectMerchan
|
||||
vo.setSettlementInfo(JSONObject.parseObject(entity.getSettlementInfo(), SettlementInfoDto.class));
|
||||
|
||||
// 设置其他字段
|
||||
vo.setUserType(entity.getUserType());
|
||||
vo.setShortName(entity.getShortName());
|
||||
vo.setAlipayAccount(entity.getAlipayAccount());
|
||||
vo.setCreateTime(entity.getCreateTime());
|
||||
vo.setUpdateTime(entity.getUpdateTime());
|
||||
|
||||
@@ -4,4 +4,22 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.service.order.mapper.ShopDirectMerchantMapper">
|
||||
|
||||
<select id="getEntryList" resultType="com.czg.order.entity.ShopDirectMerchant">
|
||||
select merchant.*,shop.shop_name as shopName
|
||||
from tb_shop_direct_merchant merchant
|
||||
left join tb_shop_info shop on merchant.shop_id = shop.id
|
||||
where
|
||||
<if test="queryParam.userType != null">
|
||||
and merchant.user_type = #{queryParam.userType}
|
||||
</if>
|
||||
<if test="queryParam.shopName != null">
|
||||
and shop.shop_name like concat('%',#{queryParam.shopName},'%')
|
||||
</if>
|
||||
<if test="queryParam.status != null">
|
||||
and (merchant.wechat_status = #{queryParam.status} or merchant.alipay_status = #{queryParam.status})
|
||||
</if>
|
||||
<if test="queryParam.alipayAccount != null">
|
||||
and merchant.alipay_account like concat('%',#{queryParam.alipayAccount},'%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user