初始化
This commit is contained in:
@ -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>
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 = 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);
|
||||
|
||||
Page<BusMerchantProductVo> result = baseMapper.selBusMerProByTypeList(pageQuery.build(), lqw);
|
||||
result.getRecords().forEach(item->{
|
||||
item.setUnId(IdUtil.getSnowflakeNextId()+"");
|
||||
});
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -152,76 +176,76 @@ public class BusMerchantProductServiceImpl extends BaseService implements IBusMe
|
||||
@Transactional
|
||||
public Boolean insertByBo(JSONObject map) {
|
||||
|
||||
String boListStr = map.getString("boList");
|
||||
Long bus_type = map.getLong("busType");
|
||||
Long mer_id = map.getLong("merId");
|
||||
String merNo = map.getString("merNo");
|
||||
if(bus_type == null){
|
||||
this.invalidationParamsException("业务类型不能为空");
|
||||
}
|
||||
if(mer_id == null){
|
||||
this.invalidationParamsException("企业ID不能为空");
|
||||
}
|
||||
String boListStr = map.getString("boList");
|
||||
Long bus_type = map.getLong("busType");
|
||||
Long mer_id = map.getLong("merId");
|
||||
String merNo = map.getString("merNo");
|
||||
if(bus_type == null){
|
||||
this.invalidationParamsException("业务类型不能为空");
|
||||
}
|
||||
if(mer_id == null){
|
||||
this.invalidationParamsException("企业ID不能为空");
|
||||
}
|
||||
|
||||
if(StringUtils.isEmpty(merNo)){
|
||||
this.invalidationParamsException("企业编码不能为空");
|
||||
}
|
||||
if(StringUtils.isEmpty(boListStr)){
|
||||
this.invalidationParamsException("请先配置产品");
|
||||
}
|
||||
boListStr = map.getJSONArray("boList").toJSONString();
|
||||
Map paraMap = new HashMap();
|
||||
paraMap.put("channel_no", LoginHelper.getNo());
|
||||
paraMap.put("bus_type",bus_type);
|
||||
List<BusChannelProductVo> agentList = this.busChannelProductMapper.selectAgentProInfos(paraMap);
|
||||
if(agentList.size() == 0){
|
||||
this.invalidationParamsException("当前代理商未配置产品");
|
||||
}
|
||||
List<BusMerchantProductBo> voList = JSONUtil.toList(boListStr, BusMerchantProductBo.class);
|
||||
List<BusMerchantProduct> insertList = new ArrayList();
|
||||
for(BusMerchantProductBo vo :voList){
|
||||
SysSyd sysSyd = sydMapper.selectSysSydById(vo.getSydId());
|
||||
log.info("sydId:"+sysSyd.getId()+"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
SysThirdPlatform sysThirdPlatform = thirdPlatformMapper.selectThirdAppInfo(sysSyd.getId());
|
||||
log.info("sysThirdPlatform:"+sysThirdPlatform.getPlatformName());
|
||||
if (ObjectUtils.isNotEmpty(sysThirdPlatform)&&sysThirdPlatform.getPlatformName().equals("薪遇见")){
|
||||
if(StringUtils.isEmpty(boListStr)){
|
||||
this.invalidationParamsException("请先配置产品");
|
||||
}
|
||||
boListStr = map.getJSONArray("boList").toJSONString();
|
||||
Map paraMap = new HashMap();
|
||||
paraMap.put("channel_no", LoginHelper.getNo());
|
||||
paraMap.put("bus_type",bus_type);
|
||||
List<BusChannelProductVo> agentList = this.busChannelProductMapper.selectAgentProInfos(paraMap);
|
||||
if(agentList.size() == 0){
|
||||
this.invalidationParamsException("当前代理商未配置产品");
|
||||
}
|
||||
List<BusMerchantProductBo> voList = JSONUtil.toList(boListStr, BusMerchantProductBo.class);
|
||||
List<BusMerchantProduct> insertList = new ArrayList();
|
||||
for(BusMerchantProductBo vo :voList){
|
||||
SysSyd sysSyd = sydMapper.selectSysSydById(vo.getSydId());
|
||||
log.info("sydId:"+sysSyd.getId()+"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
SysThirdPlatform sysThirdPlatform = thirdPlatformMapper.selectThirdAppInfo(sysSyd.getId());
|
||||
log.info("sysThirdPlatform:"+sysThirdPlatform.getPlatformName());
|
||||
if (ObjectUtils.isNotEmpty(sysThirdPlatform)&&sysThirdPlatform.getPlatformName().equals("薪遇见")){
|
||||
BusMerchant busMerchant = busMerchantMapper.selectById(mer_id);
|
||||
xyjService.addMerchant(busMerchant,vo.getSydId());
|
||||
}
|
||||
BusChannelProductVo agentVo = agentList.stream().filter(t -> t.getProNo().equals(vo.getProNo())).findFirst().orElse(null);
|
||||
if(agentVo == null){
|
||||
this.invalidationParamsException("产品编码"+vo.getProNo()+"未配置");
|
||||
}
|
||||
vo.setSydId(agentVo.getSydId());
|
||||
vo.setSydNo(agentVo.getSydNo());
|
||||
vo.setProId(agentVo.getProId());
|
||||
vo.setOpId(agentVo.getOpId());
|
||||
vo.setOpNo(agentVo.getOpNo());
|
||||
vo.setMerId(mer_id);
|
||||
vo.setMerNo(merNo);
|
||||
vo.setChannelId(agentVo.getChannelId());
|
||||
vo.setChannelNo(agentVo.getChannelNo());
|
||||
vo.setMaxMonth(agentVo.getMaxMonth());
|
||||
BusChannelProductVo agentVo = agentList.stream().filter(t -> t.getProNo().equals(vo.getProNo())).findFirst().orElse(null);
|
||||
if(agentVo == null){
|
||||
this.invalidationParamsException("产品编码"+vo.getProNo()+"未配置");
|
||||
}
|
||||
vo.setSydId(agentVo.getSydId());
|
||||
vo.setSydNo(agentVo.getSydNo());
|
||||
vo.setProId(agentVo.getProId());
|
||||
vo.setOpId(agentVo.getOpId());
|
||||
vo.setOpNo(agentVo.getOpNo());
|
||||
vo.setMerId(mer_id);
|
||||
vo.setMerNo(merNo);
|
||||
vo.setChannelId(agentVo.getChannelId());
|
||||
vo.setChannelNo(agentVo.getChannelNo());
|
||||
vo.setMaxMonth(agentVo.getMaxMonth());
|
||||
// vo.setInvoiceItems(agentVo.getInvoiceItems());
|
||||
vo.setCostServiceCharge(agentVo.getServiceCharge());
|
||||
vo.setCostServiceCharge(agentVo.getServiceCharge());
|
||||
|
||||
// ValidatorUtils.validate(vo, AddGroup.class);
|
||||
if(vo.getServiceCharge() != null && vo.getServiceCharge().compareTo(vo.getCostServiceCharge()) < 0){
|
||||
vo.setServiceCharge(vo.getCostServiceCharge());
|
||||
}
|
||||
vo.setBusType(bus_type);
|
||||
vo.setMerId(mer_id);
|
||||
if(vo.getId() != null){
|
||||
vo.setMdyServiceCharge(vo.getServiceCharge());
|
||||
vo.setServiceCharge(null);
|
||||
BusMerchantProduct update = MapstructUtils.convert(vo, BusMerchantProduct.class);
|
||||
insertList.add(update);
|
||||
}else{
|
||||
BusMerchantProduct add = MapstructUtils.convert(vo, BusMerchantProduct.class);
|
||||
insertList.add(add);
|
||||
}
|
||||
if(vo.getServiceCharge() != null && vo.getServiceCharge().compareTo(vo.getCostServiceCharge()) < 0){
|
||||
vo.setServiceCharge(vo.getCostServiceCharge());
|
||||
}
|
||||
vo.setBusType(bus_type);
|
||||
vo.setMerId(mer_id);
|
||||
if(vo.getId() != null){
|
||||
vo.setMdyServiceCharge(vo.getServiceCharge());
|
||||
vo.setServiceCharge(null);
|
||||
BusMerchantProduct update = MapstructUtils.convert(vo, BusMerchantProduct.class);
|
||||
insertList.add(update);
|
||||
}else{
|
||||
BusMerchantProduct add = MapstructUtils.convert(vo, BusMerchantProduct.class);
|
||||
insertList.add(add);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
this.baseMapper.insertOrUpdateBatch(insertList);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -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,15 +91,18 @@ 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);
|
||||
|
||||
result.getRecords().forEach(item->{
|
||||
item.setPayPassword(null);
|
||||
if(item.getCreateUnitId() != null && item.getCreateUnitId().equals(LoginHelper.getBusId())){
|
||||
item.setIsCanSetScale(1);
|
||||
}
|
||||
item.setPayPassword(null);
|
||||
if(item.getCreateUnitId() != null && item.getCreateUnitId().equals(LoginHelper.getBusId())){
|
||||
item.setIsCanSetScale(1);
|
||||
}
|
||||
});
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
@ -219,7 +219,7 @@ public class BusMerchantServiceImpl extends BaseService implements IBusMerchantS
|
||||
|
||||
boolean flag = false;
|
||||
try{
|
||||
flag = baseMapper.insert(add) > 0;
|
||||
flag = baseMapper.insert(add) > 0;
|
||||
}catch (Exception e){
|
||||
if( e instanceof DuplicateKeyException){
|
||||
bo.setNo(LoginHelper.getNo()+"-"+this.getMerNo());
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -1,10 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<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">
|
||||
@ -28,26 +56,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<!-- 代理商分配代理商 查询代理商产品列表 -->
|
||||
<select id="selectAgentProList" parameterType="org.dromara.payment.channel.domain.bo.BusChannelProductBo" resultType="org.dromara.payment.channel.domain.vo.BusChannelProductVo">
|
||||
SELECT
|
||||
t2.id,
|
||||
t3.no pro_no,
|
||||
t4.no syd_no,
|
||||
t4.gsmc serviceName,
|
||||
t1.service_charge cost_service_charge,
|
||||
t1.bus_type,
|
||||
t2.service_charge,
|
||||
t1.charge_mode,
|
||||
t1.settlement_style,
|
||||
t1.max_month,
|
||||
t1.invoice_type,
|
||||
t1.invoice_items,
|
||||
t2.pro_status
|
||||
t2.id,
|
||||
t3.no pro_no,
|
||||
t4.no syd_no,
|
||||
t4.gsmc serviceName,
|
||||
t1.service_charge cost_service_charge,
|
||||
t1.bus_type,
|
||||
t2.service_charge,
|
||||
t1.charge_mode,
|
||||
t1.settlement_style,
|
||||
t1.max_month,
|
||||
t1.invoice_type,
|
||||
t1.invoice_items,
|
||||
t2.pro_status
|
||||
FROM
|
||||
bus_channel_product t1
|
||||
LEFT JOIN bus_channel_product t2 ON t1.pro_id = t2.pro_id and t2.channel_id = #{bo.chId}
|
||||
LEFT JOIN sys_syd_product t3 ON t1.pro_id = t3.id
|
||||
LEFT JOIN sys_syd t4 ON t1.syd_id = t4.id
|
||||
bus_channel_product t1
|
||||
LEFT JOIN bus_channel_product t2 ON t1.pro_id = t2.pro_id and t2.channel_id = #{bo.chId}
|
||||
LEFT JOIN sys_syd_product t3 ON t1.pro_id = t3.id
|
||||
LEFT JOIN sys_syd t4 ON t1.syd_id = t4.id
|
||||
where t1.channel_id = #{bo.channelId} and t3.pro_status = 1 and t1.pro_status = 1
|
||||
<if test="bo.busType != null"> and t1.bus_type = #{bo.busType} </if>
|
||||
<if test="bo.busType != null"> and t1.bus_type = #{bo.busType} </if>
|
||||
|
||||
</select>
|
||||
|
||||
@ -87,7 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selMinChargeFromChannelProByAgentInfo" parameterType="map" resultType="java.math.BigDecimal" >
|
||||
select min(t.service_charge) from bus_channel_product t inner join sys_syd_product t3 ON t.pro_id = t3.id where t.channel_no like concat(#{channelNo},'%') and t.bus_type = #{busType} and pro_no = #{proNo} and t.pro_status = 1 and t3.pro_status = 1
|
||||
and t.channel_id in (select id from bus_channel t1 where t1.p_id = #{channelId})
|
||||
and t.channel_id in (select id from bus_channel t1 where t1.p_id = #{channelId})
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
@ -1,9 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
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`,
|
||||
@ -32,19 +62,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
`bus_type`,
|
||||
`no`,
|
||||
`id`,
|
||||
#{item.opNo},
|
||||
#{item.opId},
|
||||
#{item.opNo},
|
||||
#{item.opId},
|
||||
`service_charge`,
|
||||
#{item.serviceCharge},
|
||||
#{item.serviceCharge},
|
||||
`charge_mode`,
|
||||
`settlement_style`,
|
||||
`max_month`,
|
||||
`invoice_type`,
|
||||
`invoice_items`,
|
||||
#{createTime},
|
||||
#{createBy},
|
||||
#{createTime},
|
||||
#{createBy}
|
||||
#{createTime},
|
||||
#{createBy},
|
||||
#{createTime},
|
||||
#{createBy}
|
||||
FROM
|
||||
sys_syd_product
|
||||
WHERE
|
||||
@ -73,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
`create_by`
|
||||
) values
|
||||
<foreach collection="products" item="item" index="index" separator="," >
|
||||
(#{item.sydId},#{item.sydNo},#{item.busType},#{item.proNo},#{item.proId},#{item.opNo},#{item.opId},#{item.costServiceCharge},#{item.serviceCharge},#{item.chargeMode},
|
||||
(#{item.sydId},#{item.sydNo},#{item.busType},#{item.proNo},#{item.proId},#{item.opNo},#{item.opId},#{item.costServiceCharge},#{item.serviceCharge},#{item.chargeMode},
|
||||
#{item.settlementStyle},#{item.maxMonth},#{item.invoiceType},#{item.invoiceItems},#{item.proStatus},#{item.createTime},#{item.createBy})
|
||||
</foreach>
|
||||
|
||||
@ -84,11 +114,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
|
||||
<!-- <update id="updateChannelProCostCharge" parameterType="map">-->
|
||||
<!-- <foreach collection="proList" item="item" index="index" separator="," >-->
|
||||
<!-- update bus_channel_product set cost_service_charge = #{item.cost_service_charge} where op_id =#{item.op_id} and pro_id= #{item.pro_id} and up_is_op = 1-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </update>-->
|
||||
<!-- <update id="updateChannelProCostCharge" parameterType="map">-->
|
||||
<!-- <foreach collection="proList" item="item" index="index" separator="," >-->
|
||||
<!-- update bus_channel_product set cost_service_charge = #{item.cost_service_charge} where op_id =#{item.op_id} and pro_id= #{item.pro_id} and up_is_op = 1-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </update>-->
|
||||
|
||||
<update id="updateChannelProCostCharge" parameterType="map">
|
||||
UPDATE bus_channel_product
|
||||
@ -111,26 +141,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<!-- 给运营商设置产品查询 -->
|
||||
<select id="setingOpratorProductList" resultType="org.dromara.payment.operator.domain.vo.BusOperatorProductVo">
|
||||
|
||||
SELECT
|
||||
t.id,
|
||||
t.id proId,
|
||||
t.NO proNo,
|
||||
t2.NO sydNo,
|
||||
t2.id sydId,
|
||||
t2.gsmc sydName,
|
||||
t.service_charge costServiceCharge,
|
||||
t1.service_charge ,
|
||||
t.settlement_style,
|
||||
t.charge_mode,
|
||||
t.max_month,
|
||||
t.invoice_type,
|
||||
t.invoice_items,
|
||||
t1.pro_status
|
||||
FROM
|
||||
sys_syd_product t
|
||||
LEFT JOIN bus_operator_product t1 ON t.id = t1.pro_id and t1.op_id = #{opId}
|
||||
LEFT JOIN sys_syd t2 ON t.syd_id = t2.id
|
||||
${ew.getCustomSqlSegment}
|
||||
SELECT
|
||||
t.id,
|
||||
t.id proId,
|
||||
t.NO proNo,
|
||||
t2.NO sydNo,
|
||||
t2.id sydId,
|
||||
t2.gsmc sydName,
|
||||
t.service_charge costServiceCharge,
|
||||
t1.service_charge ,
|
||||
t.settlement_style,
|
||||
t.charge_mode,
|
||||
t.max_month,
|
||||
t.invoice_type,
|
||||
t.invoice_items,
|
||||
t1.pro_status
|
||||
FROM
|
||||
sys_syd_product t
|
||||
LEFT JOIN bus_operator_product t1 ON t.id = t1.pro_id and t1.op_id = #{opId}
|
||||
LEFT JOIN sys_syd t2 ON t.syd_id = t2.id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user