取消规则

This commit is contained in:
邱贞招 2024-09-26 09:24:11 +08:00
parent 7578ab49fd
commit b153ffd2e5
10 changed files with 65 additions and 21 deletions

View File

@ -1,7 +1,13 @@
package com.ruoyi.system.domain.agent; package com.ruoyi.system.domain.agent;
import com.ruoyi.system.domain.cancelRule.RlCancelRule;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class RlAgentVO extends RlAgent{ public class RlAgentVO extends RlAgent{
/** 取消规则列表 */
private List<RlCancelRule> cancelRuleList;
} }

View File

@ -40,4 +40,7 @@ public class RlCancelRule extends BaseEntity
@Excel(name = "超过多少小时以上") @Excel(name = "超过多少小时以上")
private Integer afterOutTime; private Integer afterOutTime;
/** 代理商id */
private Long agentId;
} }

View File

@ -1,6 +1,7 @@
package com.ruoyi.system.mapper; package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.agent.RlAgent; import com.ruoyi.system.domain.agent.RlAgent;
import com.ruoyi.system.domain.agent.RlAgentVO;
import java.util.List; import java.util.List;
@ -18,7 +19,7 @@ public interface RlAgentMapper
* @param agentId 代理商主键 * @param agentId 代理商主键
* @return 代理商 * @return 代理商
*/ */
public RlAgent selectRlAgentByAgentId(Long agentId); public RlAgentVO selectRlAgentByAgentId(Long agentId);
/** /**
* 根据城市id查询代理商 * 根据城市id查询代理商
@ -26,7 +27,7 @@ public interface RlAgentMapper
* @param cityId 城市id * @param cityId 城市id
* @return 代理商 * @return 代理商
*/ */
public RlAgent selectRlAgentByCityId(Long cityId); public RlAgentVO selectRlAgentByCityId(Long cityId);
/** /**
* 查询代理商列表 * 查询代理商列表

View File

@ -59,4 +59,12 @@ public interface RlCancelRuleMapper
* @return 结果 * @return 结果
*/ */
public int deleteRlCancelRuleByCancalIds(Long[] cancalIds); public int deleteRlCancelRuleByCancalIds(Long[] cancalIds);
/**
* 根据代理商id查询取消规则列表
*
* @param agentId 代理商id
* @return 取消规则集合
*/
List<RlCancelRule> selectRlCancelRuleListByAgentId(Long agentId);
} }

View File

@ -1,6 +1,7 @@
package com.ruoyi.system.service; package com.ruoyi.system.service;
import com.ruoyi.system.domain.agent.RlAgent; import com.ruoyi.system.domain.agent.RlAgent;
import com.ruoyi.system.domain.agent.RlAgentVO;
import java.util.List; import java.util.List;
@ -18,7 +19,7 @@ public interface IRlAgentService
* @param agentId 代理商主键 * @param agentId 代理商主键
* @return 代理商 * @return 代理商
*/ */
public RlAgent selectRlAgentByAgentId(Long agentId); public RlAgentVO selectRlAgentByAgentId(Long agentId);
/** /**
* 根据城市id查询代理商 * 根据城市id查询代理商
@ -26,7 +27,7 @@ public interface IRlAgentService
* @param cityId 城市id * @param cityId 城市id
* @return 代理商 * @return 代理商
*/ */
public RlAgent selectRlAgentByCityId(Long cityId); public RlAgentVO selectRlAgentByCityId(Long cityId);
/** /**
* 查询代理商列表 * 查询代理商列表

View File

@ -28,6 +28,14 @@ public interface IRlCancelRuleService
*/ */
public List<RlCancelRule> selectRlCancelRuleList(RlCancelRule rlCancelRule); public List<RlCancelRule> selectRlCancelRuleList(RlCancelRule rlCancelRule);
/**
* 根据代理商id查询取消规则列表
*
* @param agentId 代理商id
* @return 取消规则集合
*/
List<RlCancelRule> selectRlCancelRuleListByAgentId(Long agentId);
/** /**
* 新增取消规则 * 新增取消规则
* *

View File

@ -1,8 +1,11 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import com.ruoyi.system.domain.agent.RlAgent; import com.ruoyi.system.domain.agent.RlAgent;
import com.ruoyi.system.domain.agent.RlAgentVO;
import com.ruoyi.system.domain.cancelRule.RlCancelRule;
import com.ruoyi.system.mapper.RlAgentMapper; import com.ruoyi.system.mapper.RlAgentMapper;
import com.ruoyi.system.service.IRlAgentService; import com.ruoyi.system.service.IRlAgentService;
import com.ruoyi.system.service.IRlCancelRuleService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -20,6 +23,9 @@ public class RlAgentServiceImpl implements IRlAgentService
@Resource @Resource
private RlAgentMapper rlAgentMapper; private RlAgentMapper rlAgentMapper;
@Resource
private IRlCancelRuleService cancelRuleService;
/** /**
* 查询代理商 * 查询代理商
* *
@ -27,9 +33,12 @@ public class RlAgentServiceImpl implements IRlAgentService
* @return 代理商 * @return 代理商
*/ */
@Override @Override
public RlAgent selectRlAgentByAgentId(Long agentId) public RlAgentVO selectRlAgentByAgentId(Long agentId)
{ {
return rlAgentMapper.selectRlAgentByAgentId(agentId); RlAgentVO rlAgentVO = rlAgentMapper.selectRlAgentByAgentId(agentId);
List<RlCancelRule> rlCancelRules = cancelRuleService.selectRlCancelRuleListByAgentId(rlAgentVO.getAgentId());
rlAgentVO.setCancelRuleList(rlCancelRules);
return rlAgentVO;
} }
@ -40,9 +49,12 @@ public class RlAgentServiceImpl implements IRlAgentService
* @return 代理商 * @return 代理商
*/ */
@Override @Override
public RlAgent selectRlAgentByCityId(Long cityId) public RlAgentVO selectRlAgentByCityId(Long cityId)
{ {
return rlAgentMapper.selectRlAgentByCityId(cityId); RlAgentVO rlAgentVO = rlAgentMapper.selectRlAgentByCityId(cityId);
List<RlCancelRule> rlCancelRules = cancelRuleService.selectRlCancelRuleListByAgentId(rlAgentVO.getAgentId());
rlAgentVO.setCancelRuleList(rlCancelRules);
return rlAgentVO;
} }

View File

@ -44,6 +44,18 @@ public class RlCancelRuleServiceImpl implements IRlCancelRuleService
return rlCancelRuleMapper.selectRlCancelRuleList(rlCancelRule); return rlCancelRuleMapper.selectRlCancelRuleList(rlCancelRule);
} }
/**
* 根据代理商id查询取消规则列表
*
* @param agentId 代理商id
* @return 取消规则集合
*/
@Override
public List<RlCancelRule> selectRlCancelRuleListByAgentId(Long agentId)
{
return rlCancelRuleMapper.selectRlCancelRuleListByAgentId(agentId);
}
/** /**
* 新增取消规则 * 新增取消规则
* *

View File

@ -4,19 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.RlAgentMapper"> <mapper namespace="com.ruoyi.system.mapper.RlAgentMapper">
<resultMap type="RlAgent" id="RlAgentResult"> <resultMap type="RlAgentVO" id="RlAgentResult" autoMapping="true" />
<result property="agentId" column="agent_id" />
<result property="name" column="name" />
<result property="servicePhone" column="service_phone" />
<result property="dispatchFee" column="dispatch_fee" />
<result property="deliveryFee" column="delivery_fee" />
<result property="cityId" column="city_id" />
<result property="contact" column="contact" />
<result property="phone" column="phone" />
<result property="sysUserid" column="sys_userid" />
<result property="payChannel" column="pay_channel" />
<result property="isFreeCar" column="is_free_car" />
</resultMap>
<sql id="selectRlAgentVo"> <sql id="selectRlAgentVo">
select agent_id, name, service_phone, dispatch_fee, delivery_fee, city_id, contact, phone, sys_userid, pay_channel, is_free_car from rl_agent select agent_id, name, service_phone, dispatch_fee, delivery_fee, city_id, contact, phone, sys_userid, pay_channel, is_free_car from rl_agent

View File

@ -21,6 +21,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectRlCancelRuleListByAgentId" parameterType="RlCancelRule" resultMap="RlCancelRuleResult">
<include refid="selectRlCancelRuleVo"/>
where agent_id = #{agentId}
</select>
<select id="selectRlCancelRuleByCancalId" parameterType="Long" resultMap="RlCancelRuleResult"> <select id="selectRlCancelRuleByCancalId" parameterType="Long" resultMap="RlCancelRuleResult">
<include refid="selectRlCancelRuleVo"/> <include refid="selectRlCancelRuleVo"/>
where cancal_id = #{cancalId} where cancal_id = #{cancalId}