初始化

This commit is contained in:
liu
2025-07-14 00:26:16 +08:00
parent 260012612d
commit 8eeefc0aeb
8 changed files with 232 additions and 144 deletions

View File

@ -160,13 +160,6 @@
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-system</artifactId>
<version>2.1.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

View File

@ -1,12 +1,15 @@
package org.dromara.payment.channel.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.dromara.payment.channel.domain.BusChannelProduct;
import org.dromara.payment.channel.domain.bo.BusChannelProductBo;
import org.dromara.payment.channel.domain.vo.BusChannelProductVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.payment.merchant.domain.vo.BusMerchantProductVo;
import java.math.BigDecimal;
import java.util.List;
@ -30,6 +33,14 @@ public interface BusChannelProductMapper extends BaseMapperPlus<BusChannelProduc
List<BusChannelProductVo> selectAgentProInfos(Map map);
/**
* 查代理商产品页
* @param page
* @param wrapper
* @return
*/
Page<BusMerchantProductVo> selectProducts(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper wrapper);
/*
* @Param

View File

@ -22,6 +22,8 @@ import org.dromara.payment.channel.domain.vo.BusChannelProductVo;
import org.dromara.payment.channel.mapper.BusChannelProductMapper;
import org.dromara.payment.merchant.domain.BusMerchant;
import org.dromara.payment.merchant.mapper.BusMerchantMapper;
import org.dromara.payment.operator.domain.BusOperatorProduct;
import org.dromara.payment.operator.mapper.BusOperatorProductMapper;
import org.dromara.payment.sys.domain.SysSyd;
import org.dromara.payment.sys.mapper.SysSydMapper;
import org.dromara.payment.thirdPlatform.base.domain.SysThirdPlatform;
@ -54,6 +56,8 @@ public class BusMerchantProductServiceImpl extends BaseService implements IBusMe
private final BusChannelProductMapper busChannelProductMapper;
private final BusOperatorProductMapper busOperatorProductMapper;
private final BusMerchantMapper busMerchantMapper;
private final IXyjService xyjService;
@ -83,24 +87,44 @@ public class BusMerchantProductServiceImpl extends BaseService implements IBusMe
if(bo.getMerId() == null){
this.invalidationParamsException("企业ID不能为空");
}
BusMerchant busMerchant = busMerchantMapper.selectById(bo.getMerId());
//代理商编号
String agentNo = busMerchant.getAgentNo();
//运营商编号
String operatorNo = busMerchant.getOperatorNo();
QueryWrapper<BusMerchantProduct> lqw = Wrappers.query();
lqw.eq("t1.bus_type",bo.getBusType());
lqw.eq("t.mer_id",bo.getMerId());
lqw.eq("t3.pro_status",1);
lqw.eq("t1.pro_status",1);
if(!LoginHelper.isSuperAdmin()){
lqw.eq("t1.channel_id",LoginHelper.getBusId());
}
Page<BusMerchantProductVo> result = baseMapper.selBusMerProByTypeList(pageQuery.build(), lqw);
Page<BusMerchantProductVo> result = new Page<>();
//判断代理商编号是否都不为空
if(StringUtils.isNotBlank(agentNo)){
lqw.eq("t1.channel_no",agentNo);
lqw.eq("t1.op_no",operatorNo);
//查代理商的产品
result = busChannelProductMapper.selectProducts(pageQuery.build(), lqw);
result.getRecords().forEach(item->{
item.setUnId(IdUtil.getSnowflakeNextId()+"");
});
return TableDataInfo.build(result);
//判断运营商是否为空
}else if(StringUtils.isNotBlank(operatorNo)){
lqw.eq("t1.op_no",operatorNo);
//查运营商的产品
result = busOperatorProductMapper.selectProducts(pageQuery.build(), lqw);
result.getRecords().forEach(item->{
item.setUnId(IdUtil.getSnowflakeNextId()+"");
});
return TableDataInfo.build(result);
}
return new TableDataInfo<>(null,0);
// if(!LoginHelper.isSuperAdmin()){
// lqw.eq("t1.channel_id",LoginHelper.getBusId());
// }
// Page<BusMerchantProductVo> result = baseMapper.selBusMerProByTypeList(pageQuery.build(), lqw);
}
/**

View File

@ -82,9 +82,6 @@ public class BusMerchantServiceImpl extends BaseService implements IBusMerchantS
public TableDataInfo<BusMerchantVo> queryPageList(BusMerchantBo bo, PageQuery pageQuery) {
QueryWrapper<BusMerchant> lqw = Wrappers.query();
if (!LoginHelper.isSuperAdmin()){
lqw.between(bo.getStartTime() != null,"t.create_time",bo.getStartTime(),bo.getEndTime());
lqw.like(StringUtils.isNotEmpty(bo.getName()),"t.name",bo.getName());
lqw.like(StringUtils.isNotEmpty(bo.getNo()),"t.no",bo.getNo());
lqw.like(StringUtils.isNotEmpty(bo.getScaleName()),"s.name",bo.getScaleName());
if(bo.getIsProduct() != null && bo.getIsProduct() == 1){
lqw.eq("t.create_unit_id",LoginHelper.getBusId());
@ -94,6 +91,9 @@ public class BusMerchantServiceImpl extends BaseService implements IBusMerchantS
lqw.inSql("t.id","select distinct mer_id from bus_merchant_product tt where tt.syd_id ="+LoginHelper.getBusId());
}
}
lqw.between(bo.getStartTime() != null,"t.create_time",bo.getStartTime(),bo.getEndTime());
lqw.like(StringUtils.isNotEmpty(bo.getName()),"t.name",bo.getName());
lqw.like(StringUtils.isNotEmpty(bo.getNo()),"t.no",bo.getNo());
lqw.orderByDesc("t.create_time");
Page<BusMerchantVo> result = baseMapper.selectMerchantList(pageQuery.build(), lqw);

View File

@ -1,11 +1,14 @@
package org.dromara.payment.operator.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.dromara.payment.channel.domain.BusChannelProduct;
import org.dromara.payment.merchant.domain.BusMerchantProduct;
import org.dromara.payment.merchant.domain.vo.BusMerchantProductVo;
import org.dromara.payment.merchant.domain.vo.BusMerchantVo;
import org.dromara.payment.operator.domain.BusOperatorProduct;
import org.dromara.payment.operator.domain.bo.AllocOperatorProductBo;
@ -57,4 +60,6 @@ public interface BusOperatorProductMapper extends BaseMapperPlus<BusOperatorProd
* @return
*/
Page<BusOperatorProductVo> setingOpratorProductList(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper wrapper,@Param("opId") Long opId);
Page<BusMerchantProductVo> selectProducts(Page<Object> build, QueryWrapper<BusMerchantProduct> lqw);
}

View File

@ -3,13 +3,10 @@ package org.dromara.payment.worker.service.impl;
import com.tencentcloudapi.common.profile.ClientProfile;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.dromara.common.core.constant.MpContants;
import org.dromara.common.core.exception.base.BaseException;
import org.dromara.common.core.service.BaseService;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.json.utils.JsonUtils;
import org.dromara.common.redis.utils.RedisUtils;
import org.dromara.payment.worker.domain.SysUnitDomain;
import org.dromara.payment.worker.domain.ThirdConf;
import org.dromara.payment.worker.service.IIdCardAndOtherService;
import org.dromara.system.api.RemoteConfigService;

View File

@ -5,6 +5,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="org.dromara.payment.channel.mapper.BusChannelProductMapper">
<!--查询代理商的产品信息 -->
<select id="selectProducts" resultType="org.dromara.payment.merchant.domain.vo.BusMerchantProductVo">
SELECT
t2.id,
t3.id pro_id,
t3.NO pro_no,
t4.NO syd_no,
t4.gsmc service_name,
t1.bus_type,
t1.service_charge cost_service_charge,
t2.service_charge,
t1.charge_mode,
t1.settlement_style,
t1.max_month,
t1.invoice_type,
t1.invoice_items,
t2.pro_status,
t4.id syd_id,
t4.NO syd_no
FROM
bus_channel_product t1
LEFT JOIN bus_merchant_product t2 ON t2.pro_id = t1.pro_id AND t2.channel_id = t1.channel_id
LEFT JOIN sys_syd_product t3 ON t3.id = t1.pro_id
LEFT JOIN sys_syd t4 ON t4.id = t1.syd_id
${ew.getCustomSqlSegment}
</select>
<!--查询代理商的产品信息 -->
<select id="selectAgentProInfos" parameterType="map" resultType="org.dromara.payment.channel.domain.vo.BusChannelProductVo">

View File

@ -4,6 +4,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.payment.operator.mapper.BusOperatorProductMapper">
<!--查询代理商的产品信息 -->
<select id="selectProducts" resultType="org.dromara.payment.merchant.domain.vo.BusMerchantProductVo">
SELECT
t2.id,
t3.id pro_id,
t3.NO pro_no,
t4.NO syd_no,
t4.gsmc service_name,
t1.bus_type,
t1.service_charge cost_service_charge,
t2.service_charge,
t1.charge_mode,
t1.settlement_style,
t1.max_month,
t1.invoice_type,
t1.invoice_items,
t2.pro_status,
t4.id syd_id,
t4.NO syd_no
FROM
bus_operator_product t1
LEFT JOIN bus_merchant_product t2 ON t2.pro_id = t1.pro_id AND t2.channel_id = t1.channel_id
LEFT JOIN sys_syd_product t3 ON t3.id = t1.pro_id
LEFT JOIN sys_syd t4 ON t4.id = t1.syd_id
${ew.getCustomSqlSegment}
</select>
<insert id="allocOperatorProduct">
INSERT INTO `bus_operator_product` (
`syd_id`,