联调
This commit is contained in:
parent
232a100586
commit
c636b24ea2
|
@ -7,6 +7,7 @@ import com.ruoyi.common.core.controller.BaseController;
|
|||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.RlUser;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.wx.vo.PrepayResponseVO;
|
||||
import com.ruoyi.system.domain.device.RlDevice;
|
||||
import com.ruoyi.system.domain.device.RlDeviceQuery;
|
||||
|
@ -317,4 +318,19 @@ public class AppVerifyController extends BaseController
|
|||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,4 +10,8 @@ public class RlAgentVO extends RlAgent{
|
|||
|
||||
/** 取消规则列表 */
|
||||
private List<RlCancelRule> cancelRuleList;
|
||||
|
||||
private String longitude;
|
||||
|
||||
private String latitude;
|
||||
}
|
||||
|
|
|
@ -65,4 +65,8 @@ public class RlOperatingArea extends BaseEntity
|
|||
/** 运营结束时间 */
|
||||
@Excel(name = "运营结束时间")
|
||||
private String areaTimeEnd;
|
||||
|
||||
/** 代理商id */
|
||||
@Excel(name = "代理商id")
|
||||
private Long agentId;
|
||||
}
|
||||
|
|
|
@ -3,5 +3,5 @@ package com.ruoyi.system.domain.area;
|
|||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RlOperatingAreaVO {
|
||||
public class RlOperatingAreaVO extends RlOperatingArea{
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
|
|||
|
||||
|
||||
import com.ruoyi.system.domain.area.RlOperatingArea;
|
||||
import com.ruoyi.system.domain.area.RlOperatingAreaVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -21,6 +22,14 @@ public interface RlOperatingAreaMapper
|
|||
*/
|
||||
public RlOperatingArea selectRlOperatingAreaByAreaId(Long areaId);
|
||||
|
||||
/**
|
||||
* 查询运营区
|
||||
*
|
||||
* @param agentId 运营区主键
|
||||
* @return 运营区
|
||||
*/
|
||||
public RlOperatingAreaVO selectRlOperatingAreaByAgentId(Long agentId);
|
||||
|
||||
/**
|
||||
* 查询运营区列表
|
||||
*
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ruoyi.system.service;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.area.RlOperatingArea;
|
||||
import com.ruoyi.system.domain.area.RlOperatingAreaVO;
|
||||
|
||||
/**
|
||||
* 运营区Service接口
|
||||
|
@ -19,6 +20,14 @@ public interface IRlOperatingAreaService
|
|||
*/
|
||||
public RlOperatingArea selectRlOperatingAreaByAreaId(Long areaId);
|
||||
|
||||
/**
|
||||
* 根据代理商id查询运营区
|
||||
*
|
||||
* @param agentId 运营区主键
|
||||
* @return 运营区
|
||||
*/
|
||||
public RlOperatingAreaVO selectRlOperatingAreaByAgentId(Long agentId);
|
||||
|
||||
/**
|
||||
* 查询运营区列表
|
||||
*
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
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.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.mapper.RlAgentMapper;
|
||||
import com.ruoyi.system.service.IRlAgentService;
|
||||
import com.ruoyi.system.service.IRlCancelRuleService;
|
||||
import com.ruoyi.system.service.IRlOperatingAreaService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
@ -26,6 +30,9 @@ public class RlAgentServiceImpl implements IRlAgentService
|
|||
@Resource
|
||||
private IRlCancelRuleService cancelRuleService;
|
||||
|
||||
@Resource
|
||||
private IRlOperatingAreaService areaService;
|
||||
|
||||
/**
|
||||
* 查询代理商
|
||||
*
|
||||
|
@ -36,9 +43,21 @@ public class RlAgentServiceImpl implements IRlAgentService
|
|||
public RlAgentVO selectRlAgentByAgentId(Long 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());
|
||||
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)
|
||||
{
|
||||
RlAgentVO rlAgentVO = rlAgentMapper.selectRlAgentByCityId(cityId);
|
||||
List<RlCancelRule> rlCancelRules = cancelRuleService.selectRlCancelRuleListByAgentId(rlAgentVO.getAgentId());
|
||||
rlAgentVO.setCancelRuleList(rlCancelRules);
|
||||
if(ObjectUtil.isNull(rlAgentVO)){
|
||||
throw new RuntimeException("代理商不存在");
|
||||
}
|
||||
getAgentInfo(rlAgentVO);
|
||||
return rlAgentVO;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
|
|||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.system.domain.area.RlOperatingArea;
|
||||
import com.ruoyi.system.domain.area.RlOperatingAreaVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.RlOperatingAreaMapper;
|
||||
import com.ruoyi.system.service.IRlOperatingAreaService;
|
||||
|
@ -33,6 +34,18 @@ public class RlOperatingAreaServiceImpl implements IRlOperatingAreaService
|
|||
return rlOperatingAreaMapper.selectRlOperatingAreaByAreaId(areaId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运营区
|
||||
*
|
||||
* @param agentId 运营区主键
|
||||
* @return 运营区
|
||||
*/
|
||||
@Override
|
||||
public RlOperatingAreaVO selectRlOperatingAreaByAgentId(Long agentId)
|
||||
{
|
||||
return rlOperatingAreaMapper.selectRlOperatingAreaByAgentId(agentId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运营区列表
|
||||
*
|
||||
|
|
|
@ -3,24 +3,8 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.RlOperatingAreaMapper">
|
||||
|
||||
<resultMap type="RlOperatingArea" id="RlOperatingAreaResult">
|
||||
<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>
|
||||
|
||||
<resultMap type="RlOperatingAreaVO" id="RlOperatingAreaResult" autoMapping="true" />
|
||||
|
||||
<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
|
||||
|
@ -28,7 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectRlOperatingAreaList" parameterType="RlOperatingArea" resultMap="RlOperatingAreaResult">
|
||||
<include refid="selectRlOperatingAreaVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<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="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>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectRlOperatingAreaByAreaId" parameterType="Long" resultMap="RlOperatingAreaResult">
|
||||
<include refid="selectRlOperatingAreaVo"/>
|
||||
where area_id = #{areaId}
|
||||
</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 into rl_operating_area
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -111,9 +100,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<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=")">
|
||||
#{areaId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue
Block a user