This commit is contained in:
邱贞招 2024-09-26 16:20:09 +08:00
parent 232a100586
commit c636b24ea2
9 changed files with 91 additions and 26 deletions

View File

@ -7,6 +7,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.RlUser; import com.ruoyi.common.core.domain.entity.RlUser;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.wx.vo.PrepayResponseVO; import com.ruoyi.common.utils.wx.vo.PrepayResponseVO;
import com.ruoyi.system.domain.device.RlDevice; import com.ruoyi.system.domain.device.RlDevice;
import com.ruoyi.system.domain.device.RlDeviceQuery; import com.ruoyi.system.domain.device.RlDeviceQuery;
@ -317,4 +318,19 @@ public class AppVerifyController extends BaseController
return AjaxResult.success(priceVO); return AjaxResult.success(priceVO);
} }
/**
* 根据用户编号获取详细信息
*/
@GetMapping(value = { "/{userId}" })
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
{
AjaxResult ajax = AjaxResult.success();
if (StringUtils.isNotNull(userId))
{
RlUser rlUser = rlUserService.selectUserById(userId);
ajax.put(AjaxResult.DATA_TAG, rlUser);
}
return ajax;
}
} }

View File

@ -10,4 +10,8 @@ public class RlAgentVO extends RlAgent{
/** 取消规则列表 */ /** 取消规则列表 */
private List<RlCancelRule> cancelRuleList; private List<RlCancelRule> cancelRuleList;
private String longitude;
private String latitude;
} }

View File

@ -65,4 +65,8 @@ public class RlOperatingArea extends BaseEntity
/** 运营结束时间 */ /** 运营结束时间 */
@Excel(name = "运营结束时间") @Excel(name = "运营结束时间")
private String areaTimeEnd; private String areaTimeEnd;
/** 代理商id */
@Excel(name = "代理商id")
private Long agentId;
} }

View File

@ -3,5 +3,5 @@ package com.ruoyi.system.domain.area;
import lombok.Data; import lombok.Data;
@Data @Data
public class RlOperatingAreaVO { public class RlOperatingAreaVO extends RlOperatingArea{
} }

View File

@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.area.RlOperatingArea; import com.ruoyi.system.domain.area.RlOperatingArea;
import com.ruoyi.system.domain.area.RlOperatingAreaVO;
import java.util.List; import java.util.List;
@ -21,6 +22,14 @@ public interface RlOperatingAreaMapper
*/ */
public RlOperatingArea selectRlOperatingAreaByAreaId(Long areaId); public RlOperatingArea selectRlOperatingAreaByAreaId(Long areaId);
/**
* 查询运营区
*
* @param agentId 运营区主键
* @return 运营区
*/
public RlOperatingAreaVO selectRlOperatingAreaByAgentId(Long agentId);
/** /**
* 查询运营区列表 * 查询运营区列表
* *

View File

@ -2,6 +2,7 @@ package com.ruoyi.system.service;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.area.RlOperatingArea; import com.ruoyi.system.domain.area.RlOperatingArea;
import com.ruoyi.system.domain.area.RlOperatingAreaVO;
/** /**
* 运营区Service接口 * 运营区Service接口
@ -19,6 +20,14 @@ public interface IRlOperatingAreaService
*/ */
public RlOperatingArea selectRlOperatingAreaByAreaId(Long areaId); public RlOperatingArea selectRlOperatingAreaByAreaId(Long areaId);
/**
* 根据代理商id查询运营区
*
* @param agentId 运营区主键
* @return 运营区
*/
public RlOperatingAreaVO selectRlOperatingAreaByAgentId(Long agentId);
/** /**
* 查询运营区列表 * 查询运营区列表
* *

View File

@ -1,11 +1,15 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import cn.hutool.core.util.ObjectUtil;
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.agent.RlAgentVO;
import com.ruoyi.system.domain.area.RlOperatingArea;
import com.ruoyi.system.domain.area.RlOperatingAreaVO;
import com.ruoyi.system.domain.cancelRule.RlCancelRule; 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 com.ruoyi.system.service.IRlCancelRuleService;
import com.ruoyi.system.service.IRlOperatingAreaService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -26,6 +30,9 @@ public class RlAgentServiceImpl implements IRlAgentService
@Resource @Resource
private IRlCancelRuleService cancelRuleService; private IRlCancelRuleService cancelRuleService;
@Resource
private IRlOperatingAreaService areaService;
/** /**
* 查询代理商 * 查询代理商
* *
@ -36,9 +43,21 @@ public class RlAgentServiceImpl implements IRlAgentService
public RlAgentVO selectRlAgentByAgentId(Long agentId) public RlAgentVO selectRlAgentByAgentId(Long agentId)
{ {
RlAgentVO rlAgentVO = rlAgentMapper.selectRlAgentByAgentId(agentId); RlAgentVO rlAgentVO = rlAgentMapper.selectRlAgentByAgentId(agentId);
if(ObjectUtil.isNull(rlAgentVO)){
throw new RuntimeException("代理商不存在");
}
getAgentInfo(rlAgentVO);
return rlAgentVO;
}
private void getAgentInfo(RlAgentVO rlAgentVO) {
List<RlCancelRule> rlCancelRules = cancelRuleService.selectRlCancelRuleListByAgentId(rlAgentVO.getAgentId()); List<RlCancelRule> rlCancelRules = cancelRuleService.selectRlCancelRuleListByAgentId(rlAgentVO.getAgentId());
rlAgentVO.setCancelRuleList(rlCancelRules); rlAgentVO.setCancelRuleList(rlCancelRules);
return rlAgentVO; RlOperatingAreaVO rlOperatingArea = areaService.selectRlOperatingAreaByAgentId(rlAgentVO.getAgentId());
if(ObjectUtil.isNotNull(rlOperatingArea)){
rlAgentVO.setLongitude(rlOperatingArea.getLongitude());
rlAgentVO.setLatitude(rlOperatingArea.getLatitude());
}
} }
@ -52,8 +71,10 @@ public class RlAgentServiceImpl implements IRlAgentService
public RlAgentVO selectRlAgentByCityId(Long cityId) public RlAgentVO selectRlAgentByCityId(Long cityId)
{ {
RlAgentVO rlAgentVO = rlAgentMapper.selectRlAgentByCityId(cityId); RlAgentVO rlAgentVO = rlAgentMapper.selectRlAgentByCityId(cityId);
List<RlCancelRule> rlCancelRules = cancelRuleService.selectRlCancelRuleListByAgentId(rlAgentVO.getAgentId()); if(ObjectUtil.isNull(rlAgentVO)){
rlAgentVO.setCancelRuleList(rlCancelRules); throw new RuntimeException("代理商不存在");
}
getAgentInfo(rlAgentVO);
return rlAgentVO; return rlAgentVO;
} }

View File

@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.area.RlOperatingArea; import com.ruoyi.system.domain.area.RlOperatingArea;
import com.ruoyi.system.domain.area.RlOperatingAreaVO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.RlOperatingAreaMapper; import com.ruoyi.system.mapper.RlOperatingAreaMapper;
import com.ruoyi.system.service.IRlOperatingAreaService; import com.ruoyi.system.service.IRlOperatingAreaService;
@ -33,6 +34,18 @@ public class RlOperatingAreaServiceImpl implements IRlOperatingAreaService
return rlOperatingAreaMapper.selectRlOperatingAreaByAreaId(areaId); return rlOperatingAreaMapper.selectRlOperatingAreaByAreaId(areaId);
} }
/**
* 查询运营区
*
* @param agentId 运营区主键
* @return 运营区
*/
@Override
public RlOperatingAreaVO selectRlOperatingAreaByAgentId(Long agentId)
{
return rlOperatingAreaMapper.selectRlOperatingAreaByAgentId(agentId);
}
/** /**
* 查询运营区列表 * 查询运营区列表
* *

View File

@ -3,24 +3,8 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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.RlOperatingAreaMapper"> <mapper namespace="com.ruoyi.system.mapper.RlOperatingAreaMapper">
<resultMap type="RlOperatingArea" id="RlOperatingAreaResult"> <resultMap type="RlOperatingAreaVO" id="RlOperatingAreaResult" autoMapping="true" />
<result property="areaId" column="area_id" />
<result property="areaName" column="area_name" />
<result property="boundary" column="boundary" />
<result property="boundaryStr" column="boundary_str" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="status" column="status" />
<result property="areaTime" column="area_time" />
<result property="areaOutOutage" column="area_out_outage" />
<result property="areaOutDispatch" column="area_out_dispatch" />
<result property="agreement" column="agreement" />
<result property="areaTimeStart" column="area_time_start" />
<result property="areaTimeEnd" column="area_time_end" />
</resultMap>
<sql id="selectRlOperatingAreaVo"> <sql id="selectRlOperatingAreaVo">
select area_id, area_name, boundary, boundary_str, longitude, latitude, create_by, create_time, status, area_time, area_out_outage, area_out_dispatch, agreement, area_time_start, area_time_end from rl_operating_area select area_id, area_name, boundary, boundary_str, longitude, latitude, create_by, create_time, status, area_time, area_out_outage, area_out_dispatch, agreement, area_time_start, area_time_end from rl_operating_area
@ -28,7 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRlOperatingAreaList" parameterType="RlOperatingArea" resultMap="RlOperatingAreaResult"> <select id="selectRlOperatingAreaList" parameterType="RlOperatingArea" resultMap="RlOperatingAreaResult">
<include refid="selectRlOperatingAreaVo"/> <include refid="selectRlOperatingAreaVo"/>
<where> <where>
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if> <if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
<if test="boundary != null and boundary != ''"> and boundary = #{boundary}</if> <if test="boundary != null and boundary != ''"> and boundary = #{boundary}</if>
<if test="boundaryStr != null and boundaryStr != ''"> and boundary_str = #{boundaryStr}</if> <if test="boundaryStr != null and boundaryStr != ''"> and boundary_str = #{boundaryStr}</if>
@ -43,12 +27,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="areaTimeEnd != null and areaTimeEnd != ''"> and area_time_end = #{areaTimeEnd}</if> <if test="areaTimeEnd != null and areaTimeEnd != ''"> and area_time_end = #{areaTimeEnd}</if>
</where> </where>
</select> </select>
<select id="selectRlOperatingAreaByAreaId" parameterType="Long" resultMap="RlOperatingAreaResult"> <select id="selectRlOperatingAreaByAreaId" parameterType="Long" resultMap="RlOperatingAreaResult">
<include refid="selectRlOperatingAreaVo"/> <include refid="selectRlOperatingAreaVo"/>
where area_id = #{areaId} where area_id = #{areaId}
</select> </select>
<select id="selectRlOperatingAreaByAgentId" parameterType="Long" resultMap="RlOperatingAreaResult">
<include refid="selectRlOperatingAreaVo"/>
where agent_id = #{agentId}
</select>
<insert id="insertRlOperatingArea" parameterType="RlOperatingArea" useGeneratedKeys="true" keyProperty="areaId"> <insert id="insertRlOperatingArea" parameterType="RlOperatingArea" useGeneratedKeys="true" keyProperty="areaId">
insert into rl_operating_area insert into rl_operating_area
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -111,9 +100,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteRlOperatingAreaByAreaIds" parameterType="String"> <delete id="deleteRlOperatingAreaByAreaIds" parameterType="String">
delete from rl_operating_area where area_id in delete from rl_operating_area where area_id in
<foreach item="areaId" collection="array" open="(" separator="," close=")"> <foreach item="areaId" collection="array" open="(" separator="," close=")">
#{areaId} #{areaId}
</foreach> </foreach>
</delete> </delete>
</mapper> </mapper>