Merge remote-tracking branch 'origin/master'

jni
18616268358 2 years ago
commit 6294e02b06

@ -7,10 +7,7 @@ import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.model.LineListModel;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.vo.LineIdVo;
import com.shxy.xymanager_common.vo.LineVo;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.UpdateLineVo;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.LineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -84,4 +81,18 @@ public class LineController extends BaseController {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
@ApiOperation(value = "线路杆塔通道查询", notes = "线路杆塔通道查询", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getLineAndGt")
@Log(title = "线路杆塔通道查询", type = "查询")
public ResponseReult<String> getLineAndGt(@RequestBody @Validated LineAndGtAndChannelVo vo) {
ServiceBody<String> serviceBody = lineService.getLineAndGt(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
}

@ -37,7 +37,7 @@ public class TerminalPhotoController extends BaseController {
@ApiOperation(value = "获取图片列表", notes = "获取图片列表接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getTerminalPhotoList")
@Log(title = "获取设备列表", type = "查询")
@Log(title = "获取图片列表", type = "查询")
public ResponseReult<TerminalPhotoListModel> getTerminalPhotoList(@RequestBody @Validated TerminalAndChannelIdAndTimeVo vo) {
ServiceBody<TerminalPhotoListModel> serviceBody = terminalPhotoService.getTerminalPhotoList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {

@ -47,7 +47,7 @@ public class TerminalScheduleRuleController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getSingleScheduleRule")
@Log(title = "获取单个任务规则", type = "查询")
public ResponseReult<TerminalScheduleRuleModel> getSingleScheduleRule(@RequestBody @Validated TerminalRuleIdVo vo) {
public ResponseReult<TerminalScheduleRuleModel> getSingleScheduleRule(@RequestBody @Validated ScheduleIdVo vo) {
ServiceBody<TerminalScheduleRuleModel> serviceBody = terminalScheduleRuleService.getSingleScheduleRule(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
@ -60,7 +60,7 @@ public class TerminalScheduleRuleController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/addSchelduleRuleList")
@Log(title = "添加任务规则列表", type = "新增")
public ResponseReult<String> addSchedulelRuleList(@RequestBody @Validated TerminalRuleListVo vo) {
public ResponseReult<String> addSchedulelRuleList(@RequestBody @Validated ScheduleListVo vo) {
ServiceBody<String> serviceBody = terminalScheduleRuleService.addSchedulelRuleList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
@ -73,7 +73,7 @@ public class TerminalScheduleRuleController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/updateSchelduleRule")
@Log(title = "修改任务规则", type = "修改")
public ResponseReult<String> updateSchelduleRule(@RequestBody @Validated TerminalRuleVo vo) {
public ResponseReult<String> updateSchelduleRule(@RequestBody @Validated UpdateScheduleListVo vo) {
ServiceBody<String> serviceBody = terminalScheduleRuleService.updateSchelduleRule(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
@ -86,7 +86,7 @@ public class TerminalScheduleRuleController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/deleteSchelduleRule")
@Log(title = "删除任务规则", type = "修改")
public ResponseReult<String> deleteSchelduleRule(@RequestBody @Validated TerminalRuleIdListVo vo) {
public ResponseReult<String> deleteSchelduleRule(@RequestBody @Validated ScheduleIdListVo vo) {
ServiceBody<String> serviceBody = terminalScheduleRuleService.deleteSchelduleRule(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());

@ -0,0 +1,23 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class ScheduleAndRuleDto implements Serializable {
private Integer id;
private String name;
private String remark;
private Integer status;
private List<ScheduleRuleDto> list;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,23 @@
package com.shxy.xymanager_common.dto;
import lombok.Data;
import java.io.Serializable;
import java.sql.Time;
import java.util.Date;
@Data
public class ScheduleRuleDto implements Serializable {
private Integer id;
private Integer scheduleId;
private Time startTime;
private Time endTime;
private Integer span;
private static final long serialVersionUID = 1L;
}

@ -28,8 +28,6 @@ public class TerminalPhoto implements Serializable {
private String path;
private Integer manualRequest;
private Date createTime;
private static final long serialVersionUID = 1L;

@ -3,21 +3,18 @@ package com.shxy.xymanager_common.entity;
import lombok.Data;
import java.io.Serializable;
import java.sql.Time;
import java.util.Date;
@Data
public class TerminalSchedule implements Serializable {
private Integer id;
private Integer termId;
private String name;
private Byte channelId;
private String remark;
private Byte hour;
private Byte minute;
private Integer presetId;
private Integer status;
private Date createTime;

@ -11,7 +11,7 @@ public class TerminalScheduleRule implements Serializable {
private Integer id;
private String name;
private Integer scheduleId;
private Time startTime;
@ -19,10 +19,6 @@ public class TerminalScheduleRule implements Serializable {
private Integer span;
private String remark;
private Integer status;
private Date createTime;
private Date updateTime;

@ -25,10 +25,10 @@ public class TerminalScheduleRuleListModel implements Serializable {
private int pagesize;
@ApiModelProperty(value = "时间任务列表", example = "[]")
private List<ScheduleRuleBean> list;
private List<ScheduleBean> list;
@Data
public static class ScheduleRuleBean {
public static class ScheduleBean {
@ApiModelProperty(value = "任务编号", example = "123456")
private Integer id;
@ -36,6 +36,22 @@ public class TerminalScheduleRuleListModel implements Serializable {
@ApiModelProperty(value = "任务名称", example = "123456")
private String name;
@ApiModelProperty(value = "备注", example = "erwsafsasa")
private String remark;
@ApiModelProperty(value = "时间任务详情列表", example = "erwsafsasa")
private List<ScheduleRuleBean> list;
}
@Data
public static class ScheduleRuleBean {
@ApiModelProperty(value = "任务详情编号", example = "123456")
private Integer id;
@ApiModelProperty(value = "任务规则编号", example = "123456")
private Integer scheduleId;
@ApiModelProperty(value = "间隔", example = "213")
private Integer span;
@ -44,9 +60,5 @@ public class TerminalScheduleRuleListModel implements Serializable {
@ApiModelProperty(value = "结束时间", example = "2022-06-08")
private Time endTime;
@ApiModelProperty(value = "备注", example = "erwsafsasa")
private String remark;
}
}

@ -21,16 +21,27 @@ public class TerminalScheduleRuleModel implements Serializable {
@ApiModelProperty(value = "任务名称", example = "123456")
private String name;
@ApiModelProperty(value = "间隔", example = "213")
private Integer span;
@ApiModelProperty(value = "备注", example = "erwsafsasa")
private String remark;
@ApiModelProperty(value = "开始时间", example = "2022-06-08")
private Time startTime;
@ApiModelProperty(value = "时间任务详情列表", example = "erwsafsasa")
private List<ScheduleRuleBean> list;
@ApiModelProperty(value = "结束时间", example = "2022-06-08")
private Time endTime;
@Data
public static class ScheduleRuleBean {
@ApiModelProperty(value = "任务详情编号", example = "123456")
private Integer id;
@ApiModelProperty(value = "备注", example = "erwsafsasa")
private String remark;
@ApiModelProperty(value = "任务规则编号", example = "123456")
private Integer scheduleId;
@ApiModelProperty(value = "间隔", example = "213")
private Integer span;
@ApiModelProperty(value = "开始时间", example = "2022-06-08")
private Time startTime;
@ApiModelProperty(value = "结束时间", example = "2022-06-08")
private Time endTime;
}
}

@ -0,0 +1,29 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
@Data
@ApiModel(value = "线路杆塔通道和时间查询", description = "线路杆塔通道和时间查询")
public class LineAndGtAndChannelVo {
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer dyid;
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer lineid;
@ApiModelProperty(value = "杆塔编号", example = "123455")
private Integer towerid;
@ApiModelProperty(value = "通道编号", example = "123455")
private Integer channelid;
@ApiModelProperty(value = "查询时间", example = "123455")
private Date time;
}

@ -17,7 +17,7 @@ public class RelateTerminalListRuleIdVo {
@NotNull(message = "规则编号不能缺少")
@ApiModelProperty(value = "规则编号", example = "123455")
private Integer ruleid;
private Integer scheduleid;
@NotNull(message = "装置列表不能缺少")
@ApiModelProperty(value = "装置通道编号列表", example = "123455")

@ -5,13 +5,12 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
@ApiModel(value = "任务规则编号列表", description = "任务规则编号列表描述")
public class TerminalRuleIdListVo {
public class ScheduleIdListVo {
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "任务规则对象数组", required = true, example = "A0001")
private List<TerminalRuleIdVo> list;
private List<ScheduleIdVo> list;
}

@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull;
@Data
@ApiModel(value = "任务规则编号对象", description = "任务规则编号对象描述")
public class TerminalRuleIdVo {
public class ScheduleIdVo {
@NotNull(message = "规则编号不能缺少")
@ApiModelProperty(value = "规则编号", example = "123455")

@ -0,0 +1,25 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@Data
@ApiModel(value = "任务规则对象", description = "任务规则对象列表描述")
public class ScheduleListVo {
@ApiModelProperty(value = "任务规则名称", example = "名称名称")
@NotBlank(message = "任务规则名称不能缺少")
private String name;
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "任务规则对象数组", required = true, example = "A0001")
private List<ScheduleRuleVo> list;
@ApiModelProperty(value = "备注", example = "型号型号")
private String remark;
}

@ -10,15 +10,8 @@ import java.sql.Time;
import java.util.List;
@Data
@ApiModel(value = "任务规则对象", description = "任务规则对象描述")
public class TerminalRuleVo {
@ApiModelProperty(value = "任务规则编号", example = "名称名称")
@NotBlank(message = "任务编号不能缺少")
private Integer id;
@ApiModelProperty(value = "任务规则名称", example = "名称名称")
@NotBlank(message = "任务规则名称不能缺少")
private String name;
@ApiModel(value = "任务规则对象详情", description = "任务规则对象详情描述")
public class ScheduleRuleVo {
@ApiModelProperty(value = "开始时间", example = "单位")
@NotBlank(message = "开始时间不能缺少")
@ -32,8 +25,5 @@ public class TerminalRuleVo {
@NotBlank(message = "时间间隔不能缺少")
private Integer span;
@ApiModelProperty(value = "备注", example = "型号型号")
@NotBlank(message = "时间间隔不能缺少")
private String remark;
}

@ -4,7 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

@ -1,18 +0,0 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@Data
@ApiModel(value = "任务规则对象列表", description = "任务规则对象列表描述")
public class TerminalRuleListVo {
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "任务规则对象数组", required = true, example = "A0001")
private List<TerminalRuleVo> list;
}

@ -0,0 +1,32 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@Data
@ApiModel(value = "修改任务规则对象", description = "修改任务规则对象描述")
public class UpdateScheduleListVo {
@ApiModelProperty(value = "任务规则编号", example = "任务规则编号")
@NotBlank(message = "任务规则编号不能缺少")
private Integer id;
@ApiModelProperty(value = "任务规则名称", example = "名称名称")
@NotBlank(message = "任务规则名称不能缺少")
private String name;
@NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "任务规则对象数组", required = true, example = "A0001")
private List<ScheduleRuleVo> list;
@ApiModelProperty(value = "备注", example = "型号型号")
private String remark;
// @ApiModelProperty(value = "任务规则状态", example = "名称名称")
// @NotBlank(message = "任务规则状态不能缺少")
// private Integer status;
}

@ -17,6 +17,8 @@ public interface LinesDao {
Lines selectByPrimaryKey(Integer id);
Lines selectLineAndGt(Integer id);
int updateByPrimaryKeySelective(@Param("data") Lines record, @Param("updateat") Date update);
int updateByPrimaryKey(Lines record);

@ -1,8 +1,20 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.dto.ScheduleAndRuleDto;
import com.shxy.xymanager_common.entity.TerminalSchedule;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface TerminalScheduleDao {
List<ScheduleAndRuleDto> selectAll(@Param("status") Integer status);
ScheduleAndRuleDto selectSingle(@Param("id") Integer id, @Param("status") Integer status);
int updateStatusById(@Param("list") List<TerminalSchedule> list, @Param("status") Integer status, @Param("updateat") Date update);
int deleteByPrimaryKey(Integer id);
int insert(TerminalSchedule record);

@ -10,13 +10,15 @@ public interface TerminalScheduleRuleDao {
int insertSelective(TerminalScheduleRule record);
int insertList(@Param("list") List<TerminalScheduleRule> record, @Param("status") Integer status, @Param("createat") Date create, @Param("updateat") Date update);
int insertList(@Param("list") List<TerminalScheduleRule> record, @Param("createat") Date create, @Param("updateat") Date update);
TerminalScheduleRule selectByPrimaryKey(Integer id);
List<TerminalScheduleRule> selectAll(@Param("status") Integer status);
int deleteById(@Param("list") List<TerminalScheduleRule> record, @Param("status") Integer status,@Param("updateat") Date update);
int deleteById(@Param("scheduleid") Integer id);
int updateByPrimaryKeySelective(@Param("data") TerminalScheduleRule record,@Param("updateat") Date update);

@ -112,7 +112,7 @@
<!-- </table>-->
<!-- <table tableName="terminal_schedulemapper"-->
<!-- <table tableName="terminal_schedule_mapper"-->
<!-- domainObjectName="TerminalScheduleMapper"-->
<!-- mapperName="TerminalScheduleMapperDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
@ -120,7 +120,7 @@
<!-- &lt;!&ndash; <property name="useActualColumnNames" value="false"/>&ndash;&gt;-->
<!-- </table>-->
<!-- <table tableName="terminal_schedulerule"-->
<!-- <table tableName="terminal_schedule_rule"-->
<!-- domainObjectName="TerminalScheduleRule"-->
<!-- mapperName="TerminalScheduleRuleDao"-->
<!-- enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->

@ -62,10 +62,8 @@
y.equip_name as equip_name,
y.display_name as display_name,
y.model as model
from `lines` x,
terminals y,
dy_level z
where z.id = x.dy_level_id and x.id = y.line_id and x.status = #{status} and y.status = #{status} and z.status = #{status}
from ((dy_level z join `lines` x on z.id = x.dy_level_id and x.status = #{status} and z.status = #{status})
join terminals y on x.id = y.line_id and y.status = #{status})
</select>

@ -74,32 +74,6 @@
</if>
</select>
<select id="selectAllAndChannelByTermid" resultMap="LineAndTerminalMap">
<!-- select-->
<!-- z.id as id,-->
<!-- z.name as name,-->
<!-- z.dy_value as dyvalue,-->
<!-- x.id as line_id,-->
<!-- x.name as line_name,-->
<!-- x.bs_manufacturer as bs_manufacturer,-->
<!-- y.id as term_id,-->
<!-- y.tower_id as tower_id,-->
<!-- y.cmdid as cmdid,-->
<!-- y.display_name as display_name,-->
<!-- k.id as channel_id,-->
<!-- k.channel_name as channel_name,-->
<!-- l.schedule_id as schedule_id-->
<!-- from `lines` x,-->
<!-- terminals y,-->
<!-- dy_level z,-->
<!-- terminal_channel_mapper j,-->
<!-- terminal_channels k,-->
<!-- terminal_schedulemapper l-->
<!-- where z.id = x.dy_level_id and x.id = y.line_id and j.term_id = y.id and j.channel_id = k.id and y.id = l.term_id and j.channel_id = l.channel_id-->
<!-- and x.status = #{status} and y.status = #{status} and z.status = #{status} and k.status = #{status}-->
<!-- <if test="termid != null">-->
<!-- and y.id = #{termid}-->
<!-- </if>-->
SELECT
z.id AS id,
z.name AS name,
@ -116,15 +90,13 @@
l.schedule_id AS schedule_id
FROM
(((((dy_level z
left JOIN `lines` x ON z.id = x.dy_level_id)
left JOIN terminals y ON x.id = y.line_id)
left JOIN `lines` x ON z.id = x.dy_level_id and z.status = #{status} and x.status = #{status})
left JOIN terminals y ON x.id = y.line_id and y.status = #{status})
left JOIN terminal_channel_mapper j ON j.term_id = y.id)
left JOIN terminal_channels k ON j.channel_id = k.id)
left JOIN terminal_schedulemapper l ON j.channel_id = l.channel_id)
where
x.status = #{status} and y.status = #{status} and z.status = #{status} and k.status = #{status}
left JOIN terminal_channels k ON j.channel_id = k.id and k.status = #{status})
left JOIN terminal_schedule_mapper l ON k.id = l.channel_id and l.term_id = y.id)
<if test="termid != null">
and y.id = #{termid}
where y.id = #{termid}
</if>
</select>

@ -12,12 +12,11 @@
<result column="photo_time" jdbcType="BIGINT" property="photoTime"/>
<result column="recv_time" jdbcType="BIGINT" property="recvTime"/>
<result column="path" jdbcType="VARCHAR" property="path"/>
<result column="manual_request" jdbcType="TINYINT" property="manualRequest"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
</resultMap>
<sql id="Base_Column_List">
id, term_id, channel_id, preset_id, width, height, file_size, photo_time, recv_time,
path, manual_request, create_time
path, create_time
</sql>
<select id="selectPhotoList" resultMap="BaseResultMap">
select
@ -62,12 +61,12 @@
insert into terminal_photos (id, term_id, channel_id,
preset_id, width, height,
file_size, photo_time, recv_time,
path, manual_request, create_time
path, create_time
)
values (#{id,jdbcType=BIGINT}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=INTEGER},
#{presetId,jdbcType=TINYINT}, #{width,jdbcType=INTEGER}, #{height,jdbcType=INTEGER},
#{fileSize,jdbcType=INTEGER}, #{photoTime,jdbcType=TIMESTAMP}, #{recvTime,jdbcType=TIMESTAMP},
#{path,jdbcType=VARCHAR}, #{manualRequest,jdbcType=TINYINT}, #{createTime,jdbcType=INTEGER}
#{path,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalPhoto">
@ -103,9 +102,6 @@
<if test="path != null">
path,
</if>
<if test="manualRequest != null">
manual_request,
</if>
<if test="createTime != null">
create_time,
</if>
@ -141,9 +137,6 @@
<if test="path != null">
#{path,jdbcType=VARCHAR},
</if>
<if test="manualRequest != null">
#{manualRequest,jdbcType=TINYINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=INTEGER},
</if>
@ -179,9 +172,6 @@
<if test="path != null">
path = #{path,jdbcType=VARCHAR},
</if>
<if test="manualRequest != null">
manual_request = #{manualRequest,jdbcType=TINYINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=INTEGER},
</if>
@ -199,7 +189,6 @@
photo_time = #{photoTime,jdbcType=TIMESTAMP},
recv_time = #{recvTime,jdbcType=TIMESTAMP},
path = #{path,jdbcType=VARCHAR},
manual_request = #{manualRequest,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>

@ -1,30 +1,71 @@
<?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.shxy.xymanager_dao.dao.TerminalScheduleDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalSchedule">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="term_id" jdbcType="INTEGER" property="termId" />
<result column="channel_id" jdbcType="TINYINT" property="channelId" />
<result column="hour" jdbcType="TINYINT" property="hour" />
<result column="minute" jdbcType="TINYINT" property="minute" />
<result column="preset_id" jdbcType="INTEGER" property="presetId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, term_id, channel_id, hour, minute, preset_id, create_time, update_time
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalSchedule">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<resultMap id="ScheduleAndRule" type="com.shxy.xymanager_common.dto.ScheduleAndRuleDto">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.ScheduleRuleDto">
<id column="ruleid" jdbcType="INTEGER" property="id"/>
<result column="schedule_id" jdbcType="INTEGER" property="scheduleId"/>
<result column="start_time" jdbcType="TIME" property="startTime"/>
<result column="end_time" jdbcType="TIME" property="endTime"/>
<result column="span" jdbcType="INTEGER" property="span"/>
</collection>
</resultMap>
<sql id="Base_Column_List">
id, name,remark,status,create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from terminal_schedule
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_schedule
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule">
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedule
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="ScheduleAndRule">
select
x.id as id,
x.name as name,
x.remark as remark,
x.status as status,
y.id as ruleid,
y.schedule_id as schedule_id,
y.start_time as start_time,
y.end_time as end_time,
y.span as span
from terminal_schedule x,
terminal_schedule_rule y
where y.schedule_id = x.id and x.status = #{status}
</select>
<select id="selectSingle" resultMap="ScheduleAndRule">
select
x.id as id,
x.name as name,
x.remark as remark,
x.status as status,
y.id as ruleid,
y.schedule_id as schedule_id,
y.start_time as start_time,
y.end_time as end_time,
y.span as span
from terminal_schedule x,
terminal_schedule_rule y
where y.schedule_id = x.id and x.status = #{status} and x.id = #{id}
</select>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule">
insert into terminal_schedule (id, term_id, channel_id,
hour, minute, preset_id,
create_time, update_time)
@ -32,89 +73,74 @@
#{hour,jdbcType=TINYINT}, #{minute,jdbcType=TINYINT}, #{presetId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule">
insert into terminal_schedule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="termId != null">
term_id,
</if>
<if test="channelId != null">
channel_id,
</if>
<if test="hour != null">
hour,
</if>
<if test="minute != null">
minute,
</if>
<if test="presetId != null">
preset_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="termId != null">
#{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
#{channelId,jdbcType=TINYINT},
</if>
<if test="hour != null">
#{hour,jdbcType=TINYINT},
</if>
<if test="minute != null">
#{minute,jdbcType=TINYINT},
</if>
<if test="presetId != null">
#{presetId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule">
update terminal_schedule
<set>
<if test="termId != null">
term_id = #{termId,jdbcType=INTEGER},
</if>
<if test="channelId != null">
channel_id = #{channelId,jdbcType=TINYINT},
</if>
<if test="hour != null">
hour = #{hour,jdbcType=TINYINT},
</if>
<if test="minute != null">
minute = #{minute,jdbcType=TINYINT},
</if>
<if test="presetId != null">
preset_id = #{presetId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule">
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule" keyProperty="id">
insert into terminal_schedule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
name,
</if>
<if test="remark != null">
remark,
</if>
<if test="status != null">
status,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name},
</if>
<if test="remark != null">
#{remark},
</if>
<if test="status != null">
#{status},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
</trim>
</insert>
<update id="updateStatusById">
update terminal_schedule
set status = #{status},
update_time = #{updateat}
where id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item.id}
</foreach>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule">
update terminal_schedule
<set>
<if test="name != null">
name = #{name},
</if>
<if test="remark != null">
remark = #{remark},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalSchedule">
update terminal_schedule
set term_id = #{termId,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=TINYINT},

@ -15,14 +15,14 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedulemapper
from terminal_schedule_mapper
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByChannelId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedulemapper
from terminal_schedule_mapper
where channel_id = #{channelid}
and term_id = #{termid}
</select>
@ -30,7 +30,7 @@
<select id="selectByTerminalBean" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedulemapper
from terminal_schedule_mapper
where
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
term_id = #{item.termid} and channel_id in
@ -41,7 +41,7 @@
</select>
<delete id="deleteByChannelId">
delete from terminal_schedulemapper
delete from terminal_schedule_mapper
where
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
term_id = #{item.termId} and channel_id = #{item.channelId}
@ -49,7 +49,7 @@
</delete>
<insert id="insertList" parameterType="java.util.List">
insert into terminal_schedulemapper
insert into terminal_schedule_mapper
(term_id,channel_id,schedule_id,create_time,update_time)
VALUES
<foreach collection="list" item="item" separator=",">
@ -59,7 +59,7 @@
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
insert into terminal_schedulemapper (id, term_id, channel_id,
insert into terminal_schedule_mapper (id, term_id, channel_id,
schedule_id, create_time, update_time
)
values (#{id,jdbcType=INTEGER}, #{termId,jdbcType=INTEGER}, #{channelId,jdbcType=TINYINT},
@ -67,7 +67,7 @@
)
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
insert into terminal_schedulemapper
insert into terminal_schedule_mapper
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
@ -110,7 +110,7 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
update terminal_schedulemapper
update terminal_schedule_mapper
<set>
<if test="termId != null">
term_id = #{termId,jdbcType=INTEGER},
@ -131,7 +131,7 @@
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleMapper">
update terminal_schedulemapper
update terminal_schedule_mapper
set term_id = #{termId,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=TINYINT},
schedule_id = #{scheduleId,jdbcType=INTEGER},

@ -3,33 +3,31 @@
<mapper namespace="com.shxy.xymanager_dao.dao.TerminalScheduleRuleDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalScheduleRule">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="schedule_id" jdbcType="INTEGER" property="scheduleId"/>
<result column="start_time" jdbcType="TIME" property="startTime"/>
<result column="end_time" jdbcType="TIME" property="endTime"/>
<result column="span" jdbcType="INTEGER" property="span"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, name, start_time, end_time, span, remark, status,create_time, update_time
id, schedule_id, start_time, end_time, span, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedulerule
from terminal_schedule_rule
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedulerule
from terminal_schedule_rule
where status = #{status}
</select>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule">
insert into terminal_schedulerule (id, name, start_time,
insert into terminal_schedule_rule (id, name, start_time,
end_time, span, remark,
create_time, update_time)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{startTime,jdbcType=TIME},
@ -38,17 +36,17 @@
</insert>
<insert id="insertList" parameterType="java.util.List">
insert into terminal_schedulerule
(name,start_time,end_time,span,remark,status,create_time,update_time)
insert into terminal_schedule_rule
(schedule_id,start_time,end_time,span,create_time,update_time)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.name},#{item.startTime},#{item.endTime},#{item.span},#{item.remark},#{status},#{createat},#{updateat})
(#{item.scheduleId},#{item.startTime},#{item.endTime},#{item.span},#{createat},#{updateat})
</foreach>
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule">
insert into terminal_schedulerule
insert into terminal_schedule_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
@ -103,18 +101,14 @@
</trim>
</insert>
<update id="deleteById">
update terminal_schedulerule
set status = #{status},
update_time = #{updateat}
where id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item.id}
</foreach>
</update>
<delete id="deleteById">
delete from terminal_schedule_rule
where schedule_id = #{scheduleid}
</delete>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule">
update terminal_schedulerule
update terminal_schedule_rule
<set>
<if test="data.name != null">
name = #{data.name,jdbcType=VARCHAR},
@ -138,7 +132,7 @@
where id = #{data.id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleRule">
update terminal_schedulerule
update terminal_schedule_rule
set name = #{name,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIME},
end_time = #{endTime,jdbcType=TIME},

@ -13,10 +13,7 @@ import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.LineListModel;
import com.shxy.xymanager_common.model.TerminalPhotoListModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.vo.LineIdVo;
import com.shxy.xymanager_common.vo.LineVo;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.UpdateLineVo;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.LinesDao;
import com.shxy.xymanager_service.service.LineService;
import lombok.extern.slf4j.Slf4j;
@ -129,5 +126,22 @@ public class LineServiceImpl implements LineService {
}
}
/**
* 线
*
* @param vo
* @return
*/
@Override
public ServiceBody<String> getLineAndGt(LineAndGtAndChannelVo vo) {
// Integer dyid = vo.getDyid();
// Integer lineid = vo.getLineid();
// Integer towerid = vo.getTowerid();
// vo.
// linesDao.selectByPrimaryKey()
return null;
}
}

@ -64,7 +64,11 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
DateTime enddateTime = MyDateUtils.endOfDay(time);
BigInteger start = MyDateUtils.TimeMillSecond2Second(begindateTime);
BigInteger end = MyDateUtils.TimeMillSecond2Second(enddateTime);
List<TerminalPhoto> list = terminalPhotoDao.selectPhotoList(vo.getTerminalid(), vo.getChannelid(), start, end);
boolean empty1 = CollectionUtil.isEmpty(vo.getChannelid());
List<TerminalPhoto> list = new ArrayList<>();
if (!empty1) {
list = terminalPhotoDao.selectPhotoList(vo.getTerminalid(), vo.getChannelid(), start, end);
}
boolean empty = CollectionUtil.isEmpty(list);
model.setTime(vo.getTime());
model.setNum(list.size());
@ -77,7 +81,6 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
photoBean.setChannelId(item.getChannelId());
photoBean.setFileSize(item.getFileSize());
photoBean.setHeight(item.getHeight());
photoBean.setManualRequest(item.getManualRequest());
photoBean.setPath(photoaddress + item.getPath());
photoBean.setId(item.getId());
photoBean.setTermId(item.getTermId());
@ -156,7 +159,6 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
photoBean.setChannelId(item.getChannelId());
photoBean.setFileSize(item.getFileSize());
photoBean.setHeight(item.getHeight());
photoBean.setManualRequest(item.getManualRequest());
photoBean.setPath(photoaddress + item.getPath());
photoBean.setId(item.getId());
photoBean.setTermId(item.getTermId());

@ -8,6 +8,8 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.ScheduleAndRuleDto;
import com.shxy.xymanager_common.entity.TerminalSchedule;
import com.shxy.xymanager_common.entity.TerminalScheduleMapper;
import com.shxy.xymanager_common.entity.TerminalScheduleRule;
import com.shxy.xymanager_common.enums.CommonStatus;
@ -18,14 +20,17 @@ import com.shxy.xymanager_common.model.TerminalScheduleRuleTimeListModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.TerminalScheduleDao;
import com.shxy.xymanager_dao.dao.TerminalScheduleMapperDao;
import com.shxy.xymanager_dao.dao.TerminalScheduleRuleDao;
import com.shxy.xymanager_service.service.TerminalScheduleRuleService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.validation.constraints.NotBlank;
import java.sql.Time;
import java.util.ArrayList;
import java.util.Date;
@ -38,6 +43,9 @@ import java.util.List;
@Slf4j
public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleService {
@Autowired
TerminalScheduleDao terminalScheduleDao;
@Autowired
TerminalScheduleRuleDao terminalScheduleRuleDao;
@ -55,12 +63,12 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize();
PageUtils.SetPage(pageindex, pagesize);
List<TerminalScheduleRule> list = terminalScheduleRuleDao.selectAll(CommonStatus.EFFECTIVE.value());
List<ScheduleAndRuleDto> list = terminalScheduleDao.selectAll(CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());
} else {
List<TerminalScheduleRuleListModel.ScheduleRuleBean> beans = BeanUtil.copyToList(list, TerminalScheduleRuleListModel.ScheduleRuleBean.class, CopyOptions.create().ignoreCase());
List<TerminalScheduleRuleListModel.ScheduleBean> beans = BeanUtil.copyToList(list, TerminalScheduleRuleListModel.ScheduleBean.class, CopyOptions.create().ignoreCase());
model.setList(beans);
}
PageInfo pageData = PageUtils.getPageData(list);
@ -83,19 +91,13 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
* @return
*/
@Override
public ServiceBody<TerminalScheduleRuleModel> getSingleScheduleRule(TerminalRuleIdVo vo) {
TerminalScheduleRule item = terminalScheduleRuleDao.selectByPrimaryKey(vo.getId());
if (BeanUtil.isEmpty(item)) {
public ServiceBody<TerminalScheduleRuleModel> getSingleScheduleRule(ScheduleIdVo vo) {
ScheduleAndRuleDto bean = terminalScheduleDao.selectSingle(vo.getId(), CommonStatus.EFFECTIVE.value());
if (BeanUtil.isEmpty(bean)) {
return Asserts.error("没有该对象");
} else {
TerminalScheduleRuleModel bean = new TerminalScheduleRuleModel();
bean.setId(item.getId());
bean.setName(item.getName());
bean.setStartTime(item.getStartTime());
bean.setEndTime(item.getEndTime());
bean.setSpan(item.getSpan());
bean.setRemark(item.getRemark());
return Asserts.success(bean);
TerminalScheduleRuleModel model = BeanUtil.copyProperties(bean, TerminalScheduleRuleModel.class);
return Asserts.success(model);
}
}
@ -106,22 +108,32 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
* @return
*/
@Override
public ServiceBody<String> addSchedulelRuleList(TerminalRuleListVo vo) {
ArrayList<TerminalScheduleRule> list = new ArrayList<>();
for (TerminalRuleVo item : vo.getList()) {
TerminalScheduleRule bean = new TerminalScheduleRule();
bean.setName(item.getName());
bean.setStartTime(item.getStartTime());
bean.setEndTime(item.getEndTime());
bean.setSpan(item.getSpan());
bean.setRemark(item.getRemark());
bean.setStatus(CommonStatus.EFFECTIVE.value());
list.add(bean);
}
@Transactional
public ServiceBody<String> addSchedulelRuleList(ScheduleListVo vo) {
Date date = new Date();
int i = terminalScheduleRuleDao.insertList(list, CommonStatus.EFFECTIVE.value(), date, date);
if (i != 0) {
return Asserts.success("录入成功");
TerminalSchedule terminalSchedule = new TerminalSchedule();
terminalSchedule.setName(vo.getName());
terminalSchedule.setRemark(vo.getRemark());
terminalSchedule.setStatus(CommonStatus.EFFECTIVE.value());
terminalSchedule.setCreateTime(date);
terminalSchedule.setUpdateTime(date);
int i1 = terminalScheduleDao.insertSelective(terminalSchedule);
if (i1 != 0) {
ArrayList<TerminalScheduleRule> list = new ArrayList<>();
for (ScheduleRuleVo item : vo.getList()) {
TerminalScheduleRule rule = new TerminalScheduleRule();
rule.setScheduleId(terminalSchedule.getId());
rule.setStartTime(item.getStartTime());
rule.setEndTime(item.getEndTime());
rule.setSpan(item.getSpan());
list.add(rule);
}
int i = terminalScheduleRuleDao.insertList(list, date, date);
if (i != 0) {
return Asserts.success("录入成功");
} else {
return Asserts.error("录入失败");
}
} else {
return Asserts.error("录入失败");
}
@ -134,16 +146,33 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
* @return
*/
@Override
public ServiceBody<String> updateSchelduleRule(TerminalRuleVo vo) {
TerminalScheduleRule bean = new TerminalScheduleRule();
bean.setId(vo.getId());
bean.setName(vo.getName());
bean.setStartTime(vo.getStartTime());
bean.setEndTime(vo.getEndTime());
bean.setSpan(vo.getSpan());
bean.setRemark(vo.getRemark());
bean.setStatus(CommonStatus.EFFECTIVE.value());
int i = terminalScheduleRuleDao.updateByPrimaryKeySelective(bean, new Date());
@Transactional
public ServiceBody<String> updateSchelduleRule(UpdateScheduleListVo vo) {
Integer scheduleid = vo.getId();
TerminalSchedule bean = terminalScheduleDao.selectByPrimaryKey(vo.getId());
if (BeanUtil.isEmpty(bean)) {
return Asserts.error("没有需要修改任务规则");
}
Date date = new Date();
TerminalSchedule schedule = new TerminalSchedule();
schedule.setName(vo.getName());
schedule.setRemark(vo.getRemark());
schedule.setUpdateTime(date);
terminalScheduleDao.updateByPrimaryKeySelective(schedule);
terminalScheduleRuleDao.deleteById(scheduleid);
ArrayList<TerminalScheduleRule> list = new ArrayList<>();
for (ScheduleRuleVo item : vo.getList()) {
TerminalScheduleRule rule = new TerminalScheduleRule();
rule.setScheduleId(scheduleid);
rule.setStartTime(item.getStartTime());
rule.setEndTime(item.getEndTime());
rule.setSpan(item.getSpan());
list.add(rule);
}
int i = terminalScheduleRuleDao.insertList(list, date, date);
if (i != 0) {
return Asserts.success("修改成功");
} else {
@ -159,9 +188,9 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
* @return
*/
@Override
public ServiceBody<String> deleteSchelduleRule(TerminalRuleIdListVo vo) {
List<TerminalScheduleRule> list = BeanUtil.copyToList(vo.getList(), TerminalScheduleRule.class);
int i = terminalScheduleRuleDao.deleteById(list, CommonStatus.DELETE.value(), new Date());
public ServiceBody<String> deleteSchelduleRule(ScheduleIdListVo vo) {
List<TerminalSchedule> list = BeanUtil.copyToList(vo.getList(), TerminalSchedule.class);
int i = terminalScheduleDao.updateStatusById(list, CommonStatus.DELETE.value(), new Date());
if (i != 0) {
return Asserts.success("删除成功");
} else {
@ -181,7 +210,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
ArrayList<TerminalScheduleMapper> list = new ArrayList<>();
List<RelateTerminalListRuleIdVo.Item> termBeanList = vo.getList();
Integer ruleid = vo.getRuleid();
Integer scheduleid = vo.getScheduleid();
List<TerminalScheduleMapper> mappers = terminalScheduleMapperDao.selectByTerminalBean(termBeanList);
boolean empty = CollectionUtil.isEmpty(mappers);
@ -192,7 +221,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
for (Integer id : item.getChannelidlist()) {
TerminalScheduleMapper record = new TerminalScheduleMapper();
record.setChannelId(id);
record.setScheduleId(ruleid);
record.setScheduleId(scheduleid);
record.setTermId(item.getTermid());
list.add(record);
}
@ -208,6 +237,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
/**
*
*
* @param vo
* @return
*/
@ -217,7 +247,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
TerminalScheduleMapper mapper = terminalScheduleMapperDao.selectByChannelId(vo.getChannelid(), vo.getTerminalid());
if (mapper == null) {
model.setList(new ArrayList<>());
}else {
} else {
Integer scheduleId = mapper.getScheduleId();
TerminalScheduleRule bean = terminalScheduleRuleDao.selectByPrimaryKey(scheduleId);
Time startTime = bean.getStartTime();

@ -3,10 +3,7 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.LineListModel;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.vo.LineIdVo;
import com.shxy.xymanager_common.vo.LineVo;
import com.shxy.xymanager_common.vo.PageVo;
import com.shxy.xymanager_common.vo.UpdateLineVo;
import com.shxy.xymanager_common.vo.*;
/**
* 线
@ -44,4 +41,12 @@ public interface LineService {
* @return
*/
ServiceBody<String> updateLine(UpdateLineVo vo);
/**
* 线
*
* @param vo
* @return
*/
ServiceBody<String> getLineAndGt(LineAndGtAndChannelVo vo);
}

@ -25,14 +25,14 @@ public interface TerminalScheduleRuleService {
* @param vo
* @return
*/
ServiceBody<TerminalScheduleRuleModel> getSingleScheduleRule(TerminalRuleIdVo vo);
ServiceBody<TerminalScheduleRuleModel> getSingleScheduleRule(ScheduleIdVo vo);
/**
*
*
* @return
*/
ServiceBody<String> addSchedulelRuleList(TerminalRuleListVo vo);
ServiceBody<String> addSchedulelRuleList(ScheduleListVo vo);
/**
*
@ -40,7 +40,7 @@ public interface TerminalScheduleRuleService {
* @param vo
* @return
*/
ServiceBody<String> updateSchelduleRule(TerminalRuleVo vo);
ServiceBody<String> updateSchelduleRule(UpdateScheduleListVo vo);
/**
*
@ -48,7 +48,7 @@ public interface TerminalScheduleRuleService {
* @param vo
* @return
*/
ServiceBody<String> deleteSchelduleRule(TerminalRuleIdListVo vo);
ServiceBody<String> deleteSchelduleRule(ScheduleIdListVo vo);
/**
*

Loading…
Cancel
Save