巡检路线代码
This commit is contained in:
parent
b978556845
commit
452f449b96
@ -54,6 +54,11 @@ public class CheckingPointController {
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页查询巡检点列表", notes = "分页查询巡检点列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "xzCheckingRouteTaskId", value = "星纵-巡检路线的任务Id", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "checkingPointUserId", value = "巡检人员id", paramType = "query", required = false, dataType = "String"),
|
||||
|
||||
})
|
||||
@PostMapping(value = "/selectPage")
|
||||
public Result<IPage<CheckingPoint>> selectCheckingPointPage(@RequestBody ProjectSnQO projectSnQO) {
|
||||
Result<IPage<CheckingPoint>> result = new Result<>();
|
||||
|
||||
@ -45,7 +45,9 @@ public class CheckingPointInfoController {
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", required = true, paramType = "query", dataType = "string"),
|
||||
@ApiImplicitParam(name = "queryStr", value = "查询条件、多条件(巡检点、巡检位置、巡检人、巡检时间)", paramType = "query", dataType = "string"),
|
||||
@ApiImplicitParam(name = "pageNo", value = "当前页", paramType = "query", dataType = "int"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "页大小", paramType = "query", required = true, dataType = "int")
|
||||
@ApiImplicitParam(name = "pageSize", value = "页大小", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = "xzCheckingRouteTaskId", value = "星纵-巡检路线的任务Id", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "checkingPointUserId", value = "巡检人员id", paramType = "query", required = false, dataType = "String"),
|
||||
})
|
||||
public Result<IPage<CheckingPointInfo>> selectCheckingPointInfoPage(CheckingPointInfoPageDto dto) {
|
||||
Result<IPage<CheckingPointInfo>> result = new Result<>();
|
||||
|
||||
@ -18,7 +18,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* /**
|
||||
*
|
||||
* 巡检点表
|
||||
*
|
||||
* @author 邱平毅
|
||||
@ -60,6 +60,7 @@ public class CheckingPoint implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty("检查人员id列表")
|
||||
@TableField(value = "inspect_user_ids")
|
||||
@Deprecated
|
||||
private String inspectUserIds;
|
||||
|
||||
/**
|
||||
@ -170,7 +171,10 @@ public class CheckingPoint implements Serializable {
|
||||
@ApiModelProperty(value = "区域id")
|
||||
private java.lang.Long qualityRegionId;
|
||||
@ApiModelProperty(value = "合作单位ids")
|
||||
@Deprecated
|
||||
private java.lang.String enterpriseId;
|
||||
@ApiModelProperty(value = "最低巡检时长(分钟)")
|
||||
private java.lang.Integer minInspectTime;
|
||||
|
||||
/**
|
||||
* 创建人名称
|
||||
@ -180,6 +184,7 @@ public class CheckingPoint implements Serializable {
|
||||
private String createUserName;
|
||||
@ApiModelProperty("检查人名称")
|
||||
@TableField(exist = false)
|
||||
@Deprecated
|
||||
private String inspectUserNames;
|
||||
@ApiModelProperty("通知人名称")
|
||||
@TableField(exist = false)
|
||||
@ -189,6 +194,11 @@ public class CheckingPoint implements Serializable {
|
||||
private String regionName;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
@Deprecated
|
||||
private String enterpriseName;
|
||||
|
||||
@ApiModelProperty("巡检任务的巡检人是否巡检该巡检点")
|
||||
@TableField(exist = false)
|
||||
private String isInspectFromTask;
|
||||
|
||||
}
|
||||
|
||||
@ -138,6 +138,10 @@ public class CheckingPointInfo implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(value = "报警详情")
|
||||
private String alarmDetails;
|
||||
@ApiModelProperty(value = "星纵-巡检路线的任务id")
|
||||
private Long xzCheckingRouteTaskId;
|
||||
@ApiModelProperty(value = "巡检时长(分钟)")
|
||||
private java.lang.Integer inspectTime;
|
||||
|
||||
/**
|
||||
* 巡检点名称
|
||||
@ -167,4 +171,20 @@ public class CheckingPointInfo implements Serializable {
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "操作人")
|
||||
private java.lang.String operateName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "区域名称")
|
||||
private String regionName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "最低巡检时长(分钟)")
|
||||
private java.lang.Integer minInspectTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "路线名称")
|
||||
private java.lang.String routeName;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "任务名称")
|
||||
private java.lang.String itemName;
|
||||
|
||||
}
|
||||
|
||||
@ -27,4 +27,8 @@ public class CheckingPointInfoPageDto {
|
||||
private Integer status;
|
||||
@ApiModelProperty("巡检点名称")
|
||||
private String checkingPointName;
|
||||
@ApiModelProperty("星纵-巡检路线的任务Id")
|
||||
private String xzCheckingRouteTaskId;
|
||||
@ApiModelProperty("巡检人id")
|
||||
private String checkingPointUserId;
|
||||
}
|
||||
|
||||
@ -20,4 +20,9 @@ public class ProjectSnQO extends PageQO {
|
||||
private String projectSn;
|
||||
@ApiModelProperty("巡检点名称")
|
||||
private String checkingPointName;
|
||||
@ApiModelProperty("星纵-巡检路线的任务Id")
|
||||
private String xzCheckingRouteTaskId;
|
||||
@ApiModelProperty("巡检人id")
|
||||
private String checkingPointUserId;
|
||||
|
||||
}
|
||||
|
||||
@ -20,9 +20,8 @@ import java.util.Set;
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
@DataScope(includeTable = "enterprise_info")
|
||||
public interface CheckingPointInfoMapper extends BaseMapper<CheckingPointInfo> {
|
||||
IPage<CheckingPointInfo> selectCheckingPointInfoPage(@Param("dto") CheckingPointInfoPageDto dto, Page<?> objectPage);
|
||||
IPage<CheckingPointInfo> selectCheckingPointInfoPage(@Param("param") CheckingPointInfoPageDto dto, Page<?> objectPage);
|
||||
|
||||
List<CheckingPointInfo> selectAllList();
|
||||
|
||||
|
||||
@ -18,9 +18,8 @@ import java.util.List;
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
@DataScope(includeTable = "enterprise_info")
|
||||
public interface CheckingPointMapper extends BaseMapper<CheckingPoint> {
|
||||
IPage<CheckingPoint> selectCheckingPointPage(@Param("qo") ProjectSnQO projectSnQO, Page<?> objectPage);
|
||||
IPage<CheckingPoint> selectCheckingPointPage(@Param("param") ProjectSnQO projectSnQO, Page<?> objectPage);
|
||||
|
||||
List<CheckingPoint> getStartingListByFrequencyType(int type);
|
||||
|
||||
|
||||
@ -2,40 +2,55 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.checking.mapper.CheckingPointInfoMapper">
|
||||
<select id="selectCheckingPointInfoPage" resultType="com.zhgd.xmgl.modules.checking.entity.CheckingPointInfo">
|
||||
select cpi.*,
|
||||
select t.*,
|
||||
cp.checking_point_name checkingPointName,
|
||||
cp.position,
|
||||
su.real_name checkingPointUserName,
|
||||
(SELECT group_concat(nu.real_name)
|
||||
FROM system_user nu
|
||||
WHERE find_in_set(nu.user_id, cp.notice_user_ids)) noticeUserNames,
|
||||
uo.real_name operate_name
|
||||
from checking_point_info cpi
|
||||
inner join checking_point cp on cpi.checking_point_id = cp.id
|
||||
uo.real_name operate_name,
|
||||
cp.min_inspect_time,
|
||||
qr.region_name,
|
||||
xcr.route_name,
|
||||
xcrt.item_name
|
||||
from checking_point_info t
|
||||
inner join checking_point cp on t.checking_point_id = cp.id
|
||||
left join enterprise_info ei on find_in_set(ei.id,cp.enterprise_id)
|
||||
inner join system_user su on cpi.checking_point_user_id = su.user_id
|
||||
left join system_user uo on cpi.operate_id = uo.user_id
|
||||
where cp.project_sn = #{dto.projectSn}
|
||||
<if test="dto.queryStr != null and dto.queryStr != ''">
|
||||
and (cp.checking_point_name like concat('%', #{dto.queryStr}, '%')
|
||||
or cp.position like concat('%', #{dto.queryStr}, '%')
|
||||
or su.real_name like concat('%', #{dto.queryStr}, '%')
|
||||
or cpi.create_date like concat('%', #{dto.queryStr}, '%'))
|
||||
inner join system_user su on t.checking_point_user_id = su.user_id
|
||||
left join system_user uo on t.operate_id = uo.user_id
|
||||
left join quality_region qr on qr.id = cp.quality_region_id
|
||||
left join xz_checking_route_task xcrt on t.xz_checking_route_task_id = xcrt.id
|
||||
left join xz_checking_route xcr on xcrt.xz_checking_route_id = xcr.id
|
||||
left join xz_checking_route_to_point xcrtp on cp.id = xcrtp.checking_point_id and xcrtp.xz_checking_route_id =
|
||||
xcr.id
|
||||
where cp.project_sn = #{param.projectSn}
|
||||
<if test="param.queryStr != null and param.queryStr != ''">
|
||||
and (cp.checking_point_name like concat('%', #{param.queryStr}, '%')
|
||||
or cp.position like concat('%', #{param.queryStr}, '%')
|
||||
or su.real_name like concat('%', #{param.queryStr}, '%')
|
||||
or t.create_date like concat('%', #{param.queryStr}, '%'))
|
||||
</if>
|
||||
<if test="dto.status != null">
|
||||
and cpi.status = #{dto.status}
|
||||
<if test="param.status != null">
|
||||
and t.status = #{param.status}
|
||||
</if>
|
||||
<if test="dto.queryStartTime != null">
|
||||
and cpi.update_date >= #{dto.queryStartTime}
|
||||
<if test="param.queryStartTime != null">
|
||||
and t.update_date >= #{param.queryStartTime}
|
||||
</if>
|
||||
<if test="dto.queryEndTime != null">
|
||||
and cpi.update_date <![CDATA[<=]]> concat(date_format(#{dto.queryEndTime},'%Y-%m-%d'),' 23:59:59')
|
||||
<if test="param.queryEndTime != null">
|
||||
and t.update_date <![CDATA[<=]]> concat(date_format(#{param.queryEndTime},'%Y-%m-%d'),' 23:59:59')
|
||||
</if>
|
||||
<if test="dto.checkingPointName != null and dto.checkingPointName != ''">
|
||||
and cp.checking_point_name like concat('%',#{dto.checkingPointName},'%')
|
||||
<if test="param.checkingPointName != null and param.checkingPointName != ''">
|
||||
and cp.checking_point_name like concat('%',#{param.checkingPointName},'%')
|
||||
</if>
|
||||
group by cpi.id
|
||||
order by cpi.create_date desc
|
||||
<if test="param.checkingPointUserId != null and param.checkingPointUserId != ''">
|
||||
and t.checking_point_user_id = #{param.checkingPointUserId}
|
||||
</if>
|
||||
<if test="param.xzCheckingRouteTaskId != null and param.xzCheckingRouteTaskId != ''">
|
||||
and t.xz_checking_route_task_id = #{param.xzCheckingRouteTaskId}
|
||||
</if>
|
||||
group by t.id
|
||||
order by t.create_date desc
|
||||
</select>
|
||||
<select id="selectAllList" resultType="com.zhgd.xmgl.modules.checking.entity.CheckingPointInfo">
|
||||
select cpi.id,
|
||||
|
||||
@ -2,28 +2,46 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.checking.mapper.CheckingPointMapper">
|
||||
<select id="selectCheckingPointPage" resultType="com.zhgd.xmgl.modules.checking.entity.CheckingPoint">
|
||||
select cp.*,
|
||||
select t.*,
|
||||
su.real_name createUserName,
|
||||
(SELECT group_concat( iu.real_name ) FROM system_user iu WHERE find_in_set( iu.user_id, cp.inspect_user_ids ))
|
||||
(SELECT group_concat( iu.real_name ) FROM system_user iu WHERE find_in_set( iu.user_id, t.inspect_user_ids ))
|
||||
inspectUserNames,
|
||||
(SELECT group_concat( nu.real_name ) FROM system_user nu WHERE find_in_set( nu.user_id, cp.notice_user_ids ) )
|
||||
(SELECT group_concat( nu.real_name ) FROM system_user nu WHERE find_in_set( nu.user_id, t.notice_user_ids ) )
|
||||
noticeUserNames,
|
||||
group_concat( ei.enterprise_name ) as enterprise_name,
|
||||
<if test="param.xzCheckingRouteTaskId != null and param.xzCheckingRouteTaskId != ''">
|
||||
(select if(count(*) > 0,1,0) from checking_point_info where
|
||||
xz_checking_route_task_id=#{param.xzCheckingRouteTaskId} and checking_point_user_id =
|
||||
#{param.checkingPointUserId}) as isInspectFromTask,
|
||||
</if>
|
||||
qr.region_name
|
||||
from checking_point cp
|
||||
inner join system_user su on cp.create_user_id = su.user_id
|
||||
join enterprise_info ei on find_in_set(ei.id,cp.enterprise_id)
|
||||
join quality_region qr on qr.id=cp.quality_region_id
|
||||
from checking_point t
|
||||
inner join system_user su on t.create_user_id = su.user_id
|
||||
join enterprise_info ei on find_in_set(ei.id,t.enterprise_id)
|
||||
join quality_region qr on qr.id=t.quality_region_id
|
||||
<if test="param.xzCheckingRouteTaskId != null and param.xzCheckingRouteTaskId != ''">
|
||||
join xz_checking_route_task xcrt on xcrt.id = #{param.xzCheckingRouteTaskId}
|
||||
join xz_checking_route xcr on xcr.id=xcrt.xz_checking_route_id
|
||||
join xz_checking_route_to_point xcrtp on xcrtp.xz_checking_route_id=xcrt.xz_checking_route_id and
|
||||
t.id=xcrtp.checking_point_id
|
||||
</if>
|
||||
<where>
|
||||
<if test="qo.projectSn != null and qo.projectSn != ''">
|
||||
and cp.project_sn = #{qo.projectSn}
|
||||
<if test="param.projectSn != null and param.projectSn != ''">
|
||||
and t.project_sn = #{param.projectSn}
|
||||
</if>
|
||||
<if test="qo.checkingPointName != null and qo.checkingPointName != ''">
|
||||
and cp.checking_point_name like CONCAT(CONCAT('%', #{qo.checkingPointName}), '%')
|
||||
<if test="param.checkingPointName != null and param.checkingPointName != ''">
|
||||
and t.checking_point_name like CONCAT(CONCAT('%', #{param.checkingPointName}), '%')
|
||||
</if>
|
||||
</where>
|
||||
group by cp.id
|
||||
order by cp.create_date desc
|
||||
group by t.id
|
||||
<choose>
|
||||
<when test="param.xzCheckingRouteTaskId != null and param.xzCheckingRouteTaskId != ''">
|
||||
order by xcrtp.sort
|
||||
</when>
|
||||
<otherwise>
|
||||
order by t.create_date desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="getStartingListByFrequencyType" resultType="com.zhgd.xmgl.modules.checking.entity.CheckingPoint">
|
||||
|
||||
@ -0,0 +1,143 @@
|
||||
package com.zhgd.xmgl.modules.x.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRoute;
|
||||
import com.zhgd.xmgl.modules.x.service.IXzCheckingRouteService;
|
||||
|
||||
import org.simpleframework.xml.core.Validate;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 星纵-巡检路线
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/xzCheckingRoute")
|
||||
@Slf4j
|
||||
@Api(tags = "星纵-巡检路线相关Api")
|
||||
public class XzCheckingRouteController {
|
||||
@Autowired
|
||||
private IXzCheckingRouteService xzCheckingRouteService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页列表查询星纵-巡检路线信息", notes = "分页列表查询星纵-巡检路线信息", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
})
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<XzCheckingRoute>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
|
||||
return Result.success(xzCheckingRouteService.queryPageList(paramMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "列表查询星纵-巡检路线信息", notes = "列表查询星纵-巡检路线信息", httpMethod = "GET")
|
||||
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<XzCheckingRoute>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
|
||||
return Result.success(xzCheckingRouteService.queryList(paramMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param xzCheckingRoute
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加星纵-巡检路线信息", notes = "添加星纵-巡检路线信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<XzCheckingRoute> add(@RequestBody @Validate XzCheckingRoute xzCheckingRoute) {
|
||||
xzCheckingRouteService.add(xzCheckingRoute);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param xzCheckingRoute
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑星纵-巡检路线信息", notes = "编辑星纵-巡检路线信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<XzCheckingRoute> edit(@RequestBody XzCheckingRoute xzCheckingRoute) {
|
||||
xzCheckingRouteService.edit(xzCheckingRoute);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除星纵-巡检路线信息", notes = "删除星纵-巡检路线信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "星纵-巡检路线ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<XzCheckingRoute> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
|
||||
xzCheckingRouteService.delete(MapUtils.getString(map, "id"));
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询星纵-巡检路线信息", notes = "通过id查询星纵-巡检路线信息", httpMethod = "GET")
|
||||
@ApiImplicitParam(name = "id", value = "星纵-巡检路线ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<XzCheckingRoute> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
return Result.success(xzCheckingRouteService.queryById(id));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,147 @@
|
||||
package com.zhgd.xmgl.modules.x.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRouteTask;
|
||||
import com.zhgd.xmgl.modules.x.service.IXzCheckingRouteTaskService;
|
||||
|
||||
import org.simpleframework.xml.core.Validate;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 星纵-巡检路线的任务
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/xzCheckingRouteTask")
|
||||
@Slf4j
|
||||
@Api(tags = "星纵-巡检路线的任务相关Api")
|
||||
public class XzCheckingRouteTaskController {
|
||||
@Autowired
|
||||
private IXzCheckingRouteTaskService xzCheckingRouteTaskService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页列表查询星纵-巡检路线的任务信息", notes = "分页列表查询星纵-巡检路线的任务信息", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "date", value = "查询日期", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "checkingPointUserId", value = "巡检人员id", paramType = "query", required = false, dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<XzCheckingRouteTask>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
|
||||
return Result.success(xzCheckingRouteTaskService.queryPageList(paramMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "列表查询星纵-巡检路线的任务信息", notes = "列表查询星纵-巡检路线的任务信息", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "date", value = "查询日期", paramType = "query", required = false, dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<XzCheckingRouteTask>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
|
||||
return Result.success(xzCheckingRouteTaskService.queryList(paramMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param xzCheckingRouteTask
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加星纵-巡检路线的任务信息", notes = "添加星纵-巡检路线的任务信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<XzCheckingRouteTask> add(@RequestBody @Validate XzCheckingRouteTask xzCheckingRouteTask) {
|
||||
xzCheckingRouteTaskService.add(xzCheckingRouteTask);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param xzCheckingRouteTask
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑星纵-巡检路线的任务信息", notes = "编辑星纵-巡检路线的任务信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<XzCheckingRouteTask> edit(@RequestBody XzCheckingRouteTask xzCheckingRouteTask) {
|
||||
xzCheckingRouteTaskService.edit(xzCheckingRouteTask);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除星纵-巡检路线的任务信息", notes = "删除星纵-巡检路线的任务信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "星纵-巡检路线的任务ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<XzCheckingRouteTask> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
|
||||
xzCheckingRouteTaskService.delete(MapUtils.getString(map, "id"));
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询星纵-巡检路线的任务信息", notes = "通过id查询星纵-巡检路线的任务信息", httpMethod = "GET")
|
||||
@ApiImplicitParam(name = "id", value = "星纵-巡检路线的任务ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<XzCheckingRouteTask> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
return Result.success(xzCheckingRouteTaskService.queryById(id));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,137 @@
|
||||
package com.zhgd.xmgl.modules.x.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检路线
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("xz_checking_route")
|
||||
@ApiModel(value = "XzCheckingRoute实体类", description = "XzCheckingRoute")
|
||||
public class XzCheckingRoute implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* 路线名称
|
||||
*/
|
||||
@Excel(name = "路线名称", width = 15)
|
||||
@ApiModelProperty(value = "路线名称")
|
||||
private java.lang.String routeName;
|
||||
/**
|
||||
* 项目编号
|
||||
*/
|
||||
@Excel(name = "项目编号", width = 15)
|
||||
@ApiModelProperty(value = "项目编号")
|
||||
private java.lang.String projectSn;
|
||||
/**
|
||||
* 巡检id列表
|
||||
*/
|
||||
@Excel(name = "巡检id列表", width = 15)
|
||||
@ApiModelProperty(value = "巡检id列表")
|
||||
private java.lang.String inspectUserIds;
|
||||
/**
|
||||
* 通知人员id列表
|
||||
*/
|
||||
@Excel(name = "通知人员id列表", width = 15)
|
||||
@ApiModelProperty(value = "通知人员id列表")
|
||||
private java.lang.String noticeUserIds;
|
||||
/**
|
||||
* 检查次数
|
||||
*/
|
||||
@Excel(name = "检查次数", width = 15)
|
||||
@ApiModelProperty(value = "检查次数")
|
||||
private java.lang.Integer frequencyNum;
|
||||
/**
|
||||
* 检查频次类型,1次,2日,3周,4月,5年
|
||||
*/
|
||||
@Excel(name = "检查频次类型,1次,2日,3周,4月,5年", width = 15)
|
||||
@ApiModelProperty(value = "检查频次类型,1次,2日,3周,4月,5年")
|
||||
private java.lang.Integer frequencyType;
|
||||
/**
|
||||
* 检查开始时间
|
||||
*/
|
||||
@Excel(name = "检查开始时间", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "检查开始时间")
|
||||
private java.util.Date startTime;
|
||||
/**
|
||||
* 检查结束时间
|
||||
*/
|
||||
@Excel(name = "检查结束时间", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "检查结束时间")
|
||||
private java.util.Date endTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private java.util.Date createDate;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private java.util.Date updateDate;
|
||||
/**
|
||||
* 区域id
|
||||
*/
|
||||
@Excel(name = "区域id", width = 15)
|
||||
@ApiModelProperty(value = "区域id")
|
||||
private java.lang.Long qualityRegionId;
|
||||
/**
|
||||
* 企业ids
|
||||
*/
|
||||
@Excel(name = "企业ids", width = 15)
|
||||
@ApiModelProperty(value = "企业ids")
|
||||
private java.lang.String enterpriseId;
|
||||
|
||||
/**
|
||||
* 创建人名称
|
||||
*/
|
||||
@ApiModelProperty("创建人名称")
|
||||
@TableField(exist = false)
|
||||
private String createUserName;
|
||||
@ApiModelProperty("检查人名称")
|
||||
@TableField(exist = false)
|
||||
private String inspectUserNames;
|
||||
@ApiModelProperty("通知人名称")
|
||||
@TableField(exist = false)
|
||||
private String noticeUserNames;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "区域名称")
|
||||
private String regionName;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String enterpriseName;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "巡检路线包含的点")
|
||||
List<XzCheckingRouteToPoint> routeToPointList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package com.zhgd.xmgl.modules.x.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检路线的任务
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("xz_checking_route_task")
|
||||
@ApiModel(value = "XzCheckingRouteTask实体类", description = "XzCheckingRouteTask")
|
||||
public class XzCheckingRouteTask implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* 星纵-巡检路线id
|
||||
*/
|
||||
@Excel(name = "星纵-巡检路线id", width = 15)
|
||||
@ApiModelProperty(value = "星纵-巡检路线id")
|
||||
private java.lang.Long xzCheckingRouteId;
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
@Excel(name = "任务名称", width = 15)
|
||||
@ApiModelProperty(value = "任务名称")
|
||||
private java.lang.String itemName;
|
||||
/**
|
||||
* 检查序号
|
||||
*/
|
||||
@Excel(name = "检查序号", width = 15)
|
||||
@ApiModelProperty(value = "检查序号")
|
||||
private java.lang.Integer inspectOrder;
|
||||
/**
|
||||
* 检查频次类型,1次,2日,3周,4月,5年
|
||||
*/
|
||||
@Excel(name = "检查频次类型,1次,2日,3周,4月,5年", width = 15)
|
||||
@ApiModelProperty(value = "检查频次类型,1次,2日,3周,4月,5年")
|
||||
private java.lang.Integer frequencyType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private java.util.Date addTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "星纵-巡检路线")
|
||||
XzCheckingRoute xzCheckingRoute;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "某个巡检人信息")
|
||||
XzCheckingRouteTaskToInspectUser taskToInspectUser;
|
||||
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
package com.zhgd.xmgl.modules.x.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检任务和巡检人中间表
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("xz_checking_route_task_to_inspect_user")
|
||||
@ApiModel(value = "XzCheckingRouteTaskToInspectUser实体类", description = "XzCheckingRouteTaskToInspectUser")
|
||||
public class XzCheckingRouteTaskToInspectUser implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* 星纵-巡检路线的任务id
|
||||
*/
|
||||
@Excel(name = "星纵-巡检路线的任务id", width = 15)
|
||||
@ApiModelProperty(value = "星纵-巡检路线的任务id")
|
||||
private java.lang.Long xzCheckingRouteTaskId;
|
||||
/**
|
||||
* 巡检人id
|
||||
*/
|
||||
@Excel(name = "巡检人id", width = 15)
|
||||
@ApiModelProperty(value = "巡检人id")
|
||||
private java.lang.Long inspectUserId;
|
||||
/**
|
||||
* 是否巡检
|
||||
*/
|
||||
@Excel(name = "是否巡检", width = 15)
|
||||
@ApiModelProperty(value = "是否巡检")
|
||||
private java.lang.Integer isInspect;
|
||||
/**
|
||||
* 正常巡检点数量
|
||||
*/
|
||||
@Excel(name = "正常巡检点数量", width = 15)
|
||||
@ApiModelProperty(value = "正常巡检点数量")
|
||||
private java.lang.Integer normalCheckingPointNum;
|
||||
/**
|
||||
* 异常巡检点数量
|
||||
*/
|
||||
@Excel(name = "异常巡检点数量", width = 15)
|
||||
@ApiModelProperty(value = "异常巡检点数量")
|
||||
private java.lang.Integer abnormalCheckingPointNum;
|
||||
/**
|
||||
* 巡检点数量
|
||||
*/
|
||||
@Excel(name = "巡检点数量", width = 15)
|
||||
@ApiModelProperty(value = "巡检点数量")
|
||||
private java.lang.Integer checkingPointNum;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "巡检人名称")
|
||||
private java.lang.Integer inspectUserName;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "巡检状态:1未开始2进行中3已完成4已逾期")
|
||||
private java.lang.Integer inspectStatus;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package com.zhgd.xmgl.modules.x.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检路线和巡检点中间表
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("xz_checking_route_to_point")
|
||||
@ApiModel(value = "XzCheckingRouteToPoint实体类", description = "XzCheckingRouteToPoint")
|
||||
public class XzCheckingRouteToPoint implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Excel(name = "排序", width = 15)
|
||||
@ApiModelProperty(value = "排序")
|
||||
private java.lang.Integer sort;
|
||||
/**
|
||||
* 星纵-巡检路线id
|
||||
*/
|
||||
@Excel(name = "星纵-巡检路线id", width = 15)
|
||||
@ApiModelProperty(value = "星纵-巡检路线id")
|
||||
private java.lang.Long xzCheckingRouteId;
|
||||
/**
|
||||
* 巡检点表id
|
||||
*/
|
||||
@Excel(name = "巡检点表id", width = 15)
|
||||
@ApiModelProperty(value = "巡检点表id")
|
||||
private java.lang.Long checkingPointId;
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.zhgd.xmgl.modules.x.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRoute;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检路线
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface XzCheckingRouteMapper extends BaseMapper<XzCheckingRoute> {
|
||||
|
||||
List<XzCheckingRoute> queryList(@Param(Constants.WRAPPER) QueryWrapper<XzCheckingRoute> queryWrapper);
|
||||
|
||||
IPage<XzCheckingRoute> queryList(Page<XzCheckingRoute> page, @Param(Constants.WRAPPER) QueryWrapper<XzCheckingRoute> queryWrapper);
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.zhgd.xmgl.modules.x.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRouteTask;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检路线的任务
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface XzCheckingRouteTaskMapper extends BaseMapper<XzCheckingRouteTask> {
|
||||
|
||||
List<XzCheckingRouteTask> queryList(@Param(Constants.WRAPPER) QueryWrapper<XzCheckingRouteTask> queryWrapper);
|
||||
|
||||
IPage<XzCheckingRouteTask> queryList(Page<XzCheckingRouteTask> page, @Param(Constants.WRAPPER) QueryWrapper<XzCheckingRouteTask> queryWrapper);
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.zhgd.xmgl.modules.x.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRouteTaskToInspectUser;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检任务和巡检人中间表
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface XzCheckingRouteTaskToInspectUserMapper extends BaseMapper<XzCheckingRouteTaskToInspectUser> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.zhgd.xmgl.modules.x.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRouteToPoint;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检路线和巡检点中间表
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface XzCheckingRouteToPointMapper extends BaseMapper<XzCheckingRouteToPoint> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
<?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">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.x.mapper.XzCheckingRouteMapper">
|
||||
<sql id="selectTable">
|
||||
select t.*,
|
||||
(SELECT group_concat(iu.real_name) FROM system_user iu WHERE find_in_set(iu.user_id, t.inspect_user_ids))
|
||||
inspectUserNames,
|
||||
(SELECT group_concat(nu.real_name) FROM system_user nu WHERE find_in_set(nu.user_id, t.notice_user_ids))
|
||||
noticeUserNames,
|
||||
group_concat(ei.enterprise_name) as enterprise_name,
|
||||
qr.region_name
|
||||
from xz_checking_route as t
|
||||
join enterprise_info ei on find_in_set(ei.id, t.enterprise_id)
|
||||
join quality_region qr on qr.id = t.quality_region_id
|
||||
</sql>
|
||||
<select id="queryList" resultType="com.zhgd.xmgl.modules.x.entity.XzCheckingRoute">
|
||||
<include refid="selectTable">
|
||||
</include>
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,37 @@
|
||||
<?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">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.x.mapper.XzCheckingRouteTaskMapper">
|
||||
<resultMap id="queryListMap" type="com.zhgd.xmgl.modules.x.entity.XzCheckingRouteTask" autoMapping="true">
|
||||
<id column="id" property="id"/>
|
||||
<association property="xzCheckingRoute" javaType="com.zhgd.xmgl.modules.x.entity.XzCheckingRoute"
|
||||
autoMapping="true" columnPrefix="xcr_">
|
||||
<id column="id" property="id"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<select id="queryList" resultMap="queryListMap">
|
||||
select t.*,
|
||||
xcr.id as xcr_id,
|
||||
xcr.route_name as xcr_route_name,
|
||||
xcr.project_sn as xcr_project_sn,
|
||||
xcr.inspect_user_ids as xcr_inspect_user_ids,
|
||||
xcr.notice_user_ids as xcr_notice_user_ids,
|
||||
xcr.inspectUserNames as xcr_inspectUserNames,
|
||||
xcr.noticeUserNames as xcr_noticeUserNames,
|
||||
xcr.enterprise_name as xcr_enterprise_name,
|
||||
xcr.frequency_num as xcr_frequency_num,
|
||||
xcr.frequency_type as xcr_frequency_type,
|
||||
xcr.start_time as xcr_start_time,
|
||||
xcr.end_time as xcr_end_time,
|
||||
xcr.create_date as xcr_create_date,
|
||||
xcr.update_date as xcr_update_date,
|
||||
xcr.quality_region_id as xcr_quality_region_id,
|
||||
xcr.enterprise_id as xcr_enterprise_id,
|
||||
(select count(*) from xz_checking_route_to_point as xcrtp where
|
||||
t.xz_checking_route_id=xcrtp.xz_checking_route_id) as checkingPointNum
|
||||
from xz_checking_route_task as t
|
||||
join (<include refid="com.zhgd.xmgl.modules.x.mapper.XzCheckingRouteMapper.selectTable">
|
||||
</include>) as xcr on t.xz_checking_route_id = xcr.id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,4 @@
|
||||
<?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">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.x.mapper.XzCheckingRouteTaskToInspectUserMapper">
|
||||
</mapper>
|
||||
@ -0,0 +1,4 @@
|
||||
<?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">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.x.mapper.XzCheckingRouteToPointMapper">
|
||||
</mapper>
|
||||
@ -0,0 +1,30 @@
|
||||
package com.zhgd.xmgl.modules.x.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRoute;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检路线
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IXzCheckingRouteService extends IService<XzCheckingRoute> {
|
||||
|
||||
IPage<XzCheckingRoute> queryPageList(HashMap<String, Object> paramMap);
|
||||
|
||||
List<XzCheckingRoute> queryList(HashMap<String, Object> paramMap);
|
||||
|
||||
void add(XzCheckingRoute xzCheckingRoute);
|
||||
|
||||
void edit(XzCheckingRoute xzCheckingRoute);
|
||||
|
||||
void delete(String id);
|
||||
|
||||
XzCheckingRoute queryById(String id);
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.zhgd.xmgl.modules.x.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRouteTask;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检路线的任务
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IXzCheckingRouteTaskService extends IService<XzCheckingRouteTask> {
|
||||
|
||||
IPage<XzCheckingRouteTask> queryPageList(HashMap<String, Object> paramMap);
|
||||
|
||||
List<XzCheckingRouteTask> queryList(HashMap<String, Object> paramMap);
|
||||
|
||||
void add(XzCheckingRouteTask xzCheckingRouteTask);
|
||||
|
||||
void edit(XzCheckingRouteTask xzCheckingRouteTask);
|
||||
|
||||
void delete(String id);
|
||||
|
||||
XzCheckingRouteTask queryById(String id);
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.zhgd.xmgl.modules.x.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRouteTaskToInspectUser;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检任务和巡检人中间表
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IXzCheckingRouteTaskToInspectUserService extends IService<XzCheckingRouteTaskToInspectUser> {
|
||||
|
||||
IPage<XzCheckingRouteTaskToInspectUser> queryPageList(HashMap<String, Object> paramMap);
|
||||
|
||||
List<XzCheckingRouteTaskToInspectUser> queryList(HashMap<String, Object> paramMap);
|
||||
|
||||
void add(XzCheckingRouteTaskToInspectUser xzCheckingRouteTaskToInspectUser);
|
||||
|
||||
void edit(XzCheckingRouteTaskToInspectUser xzCheckingRouteTaskToInspectUser);
|
||||
|
||||
void delete(String id);
|
||||
|
||||
XzCheckingRouteTaskToInspectUser queryById(String id);
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.zhgd.xmgl.modules.x.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRouteToPoint;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检路线和巡检点中间表
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IXzCheckingRouteToPointService extends IService<XzCheckingRouteToPoint> {
|
||||
|
||||
IPage<XzCheckingRouteToPoint> queryPageList(HashMap<String, Object> paramMap);
|
||||
|
||||
List<XzCheckingRouteToPoint> queryList(HashMap<String, Object> paramMap);
|
||||
|
||||
void add(XzCheckingRouteToPoint xzCheckingRouteToPoint);
|
||||
|
||||
void edit(XzCheckingRouteToPoint xzCheckingRouteToPoint);
|
||||
|
||||
void delete(String id);
|
||||
|
||||
XzCheckingRouteToPoint queryById(String id);
|
||||
|
||||
}
|
||||
@ -0,0 +1,181 @@
|
||||
package com.zhgd.xmgl.modules.x.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRoute;
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRouteTask;
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRouteToPoint;
|
||||
import com.zhgd.xmgl.modules.x.mapper.XzCheckingRouteMapper;
|
||||
import com.zhgd.xmgl.modules.x.mapper.XzCheckingRouteTaskMapper;
|
||||
import com.zhgd.xmgl.modules.x.mapper.XzCheckingRouteToPointMapper;
|
||||
import com.zhgd.xmgl.modules.x.service.IXzCheckingRouteService;
|
||||
import com.zhgd.xmgl.util.DateUtils;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检路线
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class XzCheckingRouteServiceImpl extends ServiceImpl<XzCheckingRouteMapper, XzCheckingRoute> implements IXzCheckingRouteService {
|
||||
@Autowired
|
||||
private XzCheckingRouteMapper xzCheckingRouteMapper;
|
||||
@Autowired
|
||||
private XzCheckingRouteTaskMapper xzCheckingRouteTaskMapper;
|
||||
@Autowired
|
||||
private XzCheckingRouteToPointMapper xzCheckingRouteToPointMapper;
|
||||
|
||||
@Override
|
||||
public IPage<XzCheckingRoute> queryPageList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<XzCheckingRoute> queryWrapper = getQueryWrapper(paramMap);
|
||||
Page<XzCheckingRoute> page = PageUtil.getPage(paramMap);
|
||||
IPage<XzCheckingRoute> pageList = baseMapper.queryList(page, queryWrapper);
|
||||
pageList.setRecords(dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XzCheckingRoute> queryList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<XzCheckingRoute> queryWrapper = getQueryWrapper(paramMap);
|
||||
return dealList(baseMapper.queryList(queryWrapper));
|
||||
}
|
||||
|
||||
private QueryWrapper<XzCheckingRoute> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
String alias = "t.";
|
||||
QueryWrapper<XzCheckingRoute> queryWrapper = QueryGenerator.initPageQueryWrapper(XzCheckingRoute.class, paramMap, alias);
|
||||
queryWrapper.groupBy("t.id");
|
||||
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(XzCheckingRoute::getCreateDate));
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
private List<XzCheckingRoute> dealList(List<XzCheckingRoute> list) {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(XzCheckingRoute xzCheckingRoute) {
|
||||
xzCheckingRoute.setId(null);
|
||||
baseMapper.insert(xzCheckingRoute);
|
||||
saveRouteToPoint(xzCheckingRoute);
|
||||
saveTask(xzCheckingRoute);
|
||||
}
|
||||
|
||||
private void saveTask(XzCheckingRoute xzCheckingRoute) {
|
||||
if (xzCheckingRoute.getFrequencyType() == 1) {
|
||||
saveTaskItemRecord(xzCheckingRoute, "");
|
||||
} else if (xzCheckingRoute.getFrequencyType() == 2) {
|
||||
//天
|
||||
List<String> dayList = DateUtils.getDiffTimeDayList(DateUtil.formatDate(xzCheckingRoute.getStartTime()), DateUtil.formatDate(xzCheckingRoute.getEndTime()));
|
||||
if (dayList != null && dayList.size() > 0) {
|
||||
for (String day : dayList) {
|
||||
saveTaskItemRecord(xzCheckingRoute, day);
|
||||
}
|
||||
}
|
||||
} else if (xzCheckingRoute.getFrequencyType() == 3) {
|
||||
//周
|
||||
List<String> dayList = DateUtils.getDiffTimeWeekList(DateUtil.formatDate(xzCheckingRoute.getStartTime()), DateUtil.formatDate(xzCheckingRoute.getEndTime()));
|
||||
if (dayList != null && dayList.size() > 0) {
|
||||
for (String day : dayList) {
|
||||
saveTaskItemRecord(xzCheckingRoute, day);
|
||||
}
|
||||
}
|
||||
} else if (xzCheckingRoute.getFrequencyType() == 4) {
|
||||
//月
|
||||
List<String> dayList = DateUtils.getDiffTimeMonthList(DateUtil.formatDate(xzCheckingRoute.getStartTime()), DateUtil.formatDate(xzCheckingRoute.getEndTime()));
|
||||
if (dayList != null && dayList.size() > 0) {
|
||||
for (String day : dayList) {
|
||||
saveTaskItemRecord(xzCheckingRoute, day);
|
||||
}
|
||||
}
|
||||
} else if (xzCheckingRoute.getFrequencyType() == 5) {
|
||||
//年
|
||||
List<String> dayList = DateUtils.getDiffTimeYearList(DateUtil.formatDate(xzCheckingRoute.getStartTime()), DateUtil.formatDate(xzCheckingRoute.getEndTime()));
|
||||
if (dayList != null && dayList.size() > 0) {
|
||||
for (String day : dayList) {
|
||||
saveTaskItemRecord(xzCheckingRoute, day);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void saveTaskItemRecord(XzCheckingRoute route, String title) {
|
||||
for (int i = 0; i < route.getFrequencyNum(); i++) {
|
||||
XzCheckingRouteTask itemRecord = new XzCheckingRouteTask();
|
||||
itemRecord.setFrequencyType(route.getFrequencyType());
|
||||
itemRecord.setXzCheckingRouteId(route.getId());
|
||||
if (StringUtils.isNotEmpty(title)) {
|
||||
itemRecord.setItemName(title + "/第" + (i + 1) + "次");
|
||||
} else {
|
||||
itemRecord.setItemName("第" + (i + 1) + "次");
|
||||
}
|
||||
itemRecord.setInspectOrder(i);
|
||||
itemRecord.setAddTime(new Date());
|
||||
xzCheckingRouteTaskMapper.insert(itemRecord);
|
||||
}
|
||||
}
|
||||
|
||||
private void saveRouteToPoint(XzCheckingRoute xzCheckingRoute) {
|
||||
xzCheckingRouteToPointMapper.delete(new LambdaQueryWrapper<XzCheckingRouteToPoint>()
|
||||
.eq(XzCheckingRouteToPoint::getXzCheckingRouteId, xzCheckingRoute.getId()));
|
||||
List<XzCheckingRouteToPoint> routeToPointList = xzCheckingRoute.getRouteToPointList();
|
||||
if (CollUtil.isNotEmpty(routeToPointList)) {
|
||||
for (XzCheckingRouteToPoint to : routeToPointList) {
|
||||
to.setId(null);
|
||||
to.setXzCheckingRouteId(xzCheckingRoute.getId());
|
||||
xzCheckingRouteToPointMapper.insert(to);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(XzCheckingRoute xzCheckingRoute) {
|
||||
XzCheckingRoute oldXzCheckingRoute = baseMapper.selectById(xzCheckingRoute.getId());
|
||||
if (oldXzCheckingRoute == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.updateById(xzCheckingRoute);
|
||||
saveRouteToPoint(xzCheckingRoute);
|
||||
saveTask(xzCheckingRoute);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String id) {
|
||||
XzCheckingRoute xzCheckingRoute = baseMapper.selectById(id);
|
||||
if (xzCheckingRoute == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XzCheckingRoute queryById(String id) {
|
||||
XzCheckingRoute entity = getById(id);
|
||||
if (entity == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
List<XzCheckingRouteToPoint> xzCheckingRouteToPoints = xzCheckingRouteToPointMapper.selectList(new LambdaQueryWrapper<XzCheckingRouteToPoint>()
|
||||
.eq(XzCheckingRouteToPoint::getXzCheckingRouteId, id));
|
||||
entity.setRouteToPointList(xzCheckingRouteToPoints);
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package com.zhgd.xmgl.modules.x.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRouteTask;
|
||||
import com.zhgd.xmgl.modules.x.mapper.XzCheckingRouteTaskMapper;
|
||||
import com.zhgd.xmgl.modules.x.service.IXzCheckingRouteTaskService;
|
||||
import com.zhgd.xmgl.util.MapUtil;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检路线的任务
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class XzCheckingRouteTaskServiceImpl extends ServiceImpl<XzCheckingRouteTaskMapper, XzCheckingRouteTask> implements IXzCheckingRouteTaskService {
|
||||
@Autowired
|
||||
private XzCheckingRouteTaskMapper xzCheckingRouteTaskMapper;
|
||||
|
||||
@Override
|
||||
public IPage<XzCheckingRouteTask> queryPageList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<XzCheckingRouteTask> queryWrapper = getQueryWrapper(paramMap);
|
||||
Page<XzCheckingRouteTask> page = PageUtil.getPage(paramMap);
|
||||
IPage<XzCheckingRouteTask> pageList = baseMapper.queryList(page, queryWrapper);
|
||||
pageList.setRecords(dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XzCheckingRouteTask> queryList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<XzCheckingRouteTask> queryWrapper = getQueryWrapper(paramMap);
|
||||
return dealList(baseMapper.queryList(queryWrapper));
|
||||
}
|
||||
|
||||
private QueryWrapper<XzCheckingRouteTask> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
String alias = "t.";
|
||||
QueryWrapper<XzCheckingRouteTask> queryWrapper = QueryGenerator.initPageQueryWrapper(XzCheckingRouteTask.class, paramMap, alias);
|
||||
String checkingPointUserId = MapUtils.getString(paramMap, "checkingPointUserId");
|
||||
if (StrUtil.isNotBlank(checkingPointUserId)) {
|
||||
queryWrapper.apply("find_in_set({0},xcr.inspect_user_ids)", checkingPointUserId);
|
||||
}
|
||||
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(XzCheckingRouteTask::getId));
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
private List<XzCheckingRouteTask> dealList(List<XzCheckingRouteTask> list) {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(XzCheckingRouteTask xzCheckingRouteTask) {
|
||||
xzCheckingRouteTask.setId(null);
|
||||
baseMapper.insert(xzCheckingRouteTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(XzCheckingRouteTask xzCheckingRouteTask) {
|
||||
XzCheckingRouteTask oldXzCheckingRouteTask = baseMapper.selectById(xzCheckingRouteTask.getId());
|
||||
if (oldXzCheckingRouteTask == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.updateById(xzCheckingRouteTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String id) {
|
||||
XzCheckingRouteTask xzCheckingRouteTask = baseMapper.selectById(id);
|
||||
if (xzCheckingRouteTask == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XzCheckingRouteTask queryById(String id) {
|
||||
XzCheckingRouteTask entity = getById(id);
|
||||
if (entity == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package com.zhgd.xmgl.modules.x.service.impl;
|
||||
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRouteTaskToInspectUser;
|
||||
import com.zhgd.xmgl.modules.x.mapper.XzCheckingRouteTaskToInspectUserMapper;
|
||||
import com.zhgd.xmgl.modules.x.service.IXzCheckingRouteTaskToInspectUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检任务和巡检人中间表
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class XzCheckingRouteTaskToInspectUserServiceImpl extends ServiceImpl<XzCheckingRouteTaskToInspectUserMapper, XzCheckingRouteTaskToInspectUser> implements IXzCheckingRouteTaskToInspectUserService {
|
||||
@Autowired
|
||||
private XzCheckingRouteTaskToInspectUserMapper xzCheckingRouteTaskToInspectUserMapper;
|
||||
|
||||
@Override
|
||||
public IPage<XzCheckingRouteTaskToInspectUser> queryPageList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<XzCheckingRouteTaskToInspectUser> queryWrapper = getQueryWrapper(paramMap);
|
||||
Page<XzCheckingRouteTaskToInspectUser> page = PageUtil.getPage(paramMap);
|
||||
IPage<XzCheckingRouteTaskToInspectUser> pageList = this.page(page, queryWrapper);
|
||||
pageList.setRecords(dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XzCheckingRouteTaskToInspectUser> queryList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<XzCheckingRouteTaskToInspectUser> queryWrapper = getQueryWrapper(paramMap);
|
||||
return dealList(this.list(queryWrapper));
|
||||
}
|
||||
|
||||
private QueryWrapper<XzCheckingRouteTaskToInspectUser> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
String alias = "";
|
||||
QueryWrapper<XzCheckingRouteTaskToInspectUser> queryWrapper = QueryGenerator.initPageQueryWrapper(XzCheckingRouteTaskToInspectUser.class, paramMap, alias);
|
||||
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(XzCheckingRouteTaskToInspectUser::getId));
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
private List<XzCheckingRouteTaskToInspectUser> dealList(List<XzCheckingRouteTaskToInspectUser> list) {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(XzCheckingRouteTaskToInspectUser xzCheckingRouteTaskToInspectUser) {
|
||||
xzCheckingRouteTaskToInspectUser.setId(null);
|
||||
baseMapper.insert(xzCheckingRouteTaskToInspectUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(XzCheckingRouteTaskToInspectUser xzCheckingRouteTaskToInspectUser) {
|
||||
XzCheckingRouteTaskToInspectUser oldXzCheckingRouteTaskToInspectUser = baseMapper.selectById(xzCheckingRouteTaskToInspectUser.getId());
|
||||
if (oldXzCheckingRouteTaskToInspectUser == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.updateById(xzCheckingRouteTaskToInspectUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String id) {
|
||||
XzCheckingRouteTaskToInspectUser xzCheckingRouteTaskToInspectUser = baseMapper.selectById(id);
|
||||
if (xzCheckingRouteTaskToInspectUser == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XzCheckingRouteTaskToInspectUser queryById(String id) {
|
||||
XzCheckingRouteTaskToInspectUser entity = getById(id);
|
||||
if (entity == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package com.zhgd.xmgl.modules.x.service.impl;
|
||||
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.x.entity.XzCheckingRouteToPoint;
|
||||
import com.zhgd.xmgl.modules.x.mapper.XzCheckingRouteToPointMapper;
|
||||
import com.zhgd.xmgl.modules.x.service.IXzCheckingRouteToPointService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @Description: 星纵-巡检路线和巡检点中间表
|
||||
* @author: pds
|
||||
* @date: 2024-05-23
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class XzCheckingRouteToPointServiceImpl extends ServiceImpl<XzCheckingRouteToPointMapper, XzCheckingRouteToPoint> implements IXzCheckingRouteToPointService {
|
||||
@Autowired
|
||||
private XzCheckingRouteToPointMapper xzCheckingRouteToPointMapper;
|
||||
|
||||
@Override
|
||||
public IPage<XzCheckingRouteToPoint> queryPageList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<XzCheckingRouteToPoint> queryWrapper = getQueryWrapper(paramMap);
|
||||
Page<XzCheckingRouteToPoint> page = PageUtil.getPage(paramMap);
|
||||
IPage<XzCheckingRouteToPoint> pageList = this.page(page, queryWrapper);
|
||||
pageList.setRecords(dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XzCheckingRouteToPoint> queryList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<XzCheckingRouteToPoint> queryWrapper = getQueryWrapper(paramMap);
|
||||
return dealList(this.list(queryWrapper));
|
||||
}
|
||||
|
||||
private QueryWrapper<XzCheckingRouteToPoint> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
String alias = "";
|
||||
QueryWrapper<XzCheckingRouteToPoint> queryWrapper = QueryGenerator.initPageQueryWrapper(XzCheckingRouteToPoint.class, paramMap, alias);
|
||||
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(XzCheckingRouteToPoint::getId));
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
private List<XzCheckingRouteToPoint> dealList(List<XzCheckingRouteToPoint> list) {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(XzCheckingRouteToPoint xzCheckingRouteToPoint) {
|
||||
xzCheckingRouteToPoint.setId(null);
|
||||
baseMapper.insert(xzCheckingRouteToPoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(XzCheckingRouteToPoint xzCheckingRouteToPoint) {
|
||||
XzCheckingRouteToPoint oldXzCheckingRouteToPoint = baseMapper.selectById(xzCheckingRouteToPoint.getId());
|
||||
if (oldXzCheckingRouteToPoint == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.updateById(xzCheckingRouteToPoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String id) {
|
||||
XzCheckingRouteToPoint xzCheckingRouteToPoint = baseMapper.selectById(id);
|
||||
if (xzCheckingRouteToPoint == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XzCheckingRouteToPoint queryById(String id) {
|
||||
XzCheckingRouteToPoint entity = getById(id);
|
||||
if (entity == null) {
|
||||
throw new OpenAlertException("未找到对应实体");
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user