diff --git a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalScheduleRuleController.java b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalScheduleRuleController.java index 8864a9c..1c17a5a 100644 --- a/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalScheduleRuleController.java +++ b/xymanager_admin/src/main/java/com/shxy/xymanager_admin/controller/TerminalScheduleRuleController.java @@ -148,4 +148,17 @@ public class TerminalScheduleRuleController extends BaseController { } } + @ApiOperation(value = "根据requestid查询时间表下发状态", notes = "根据requestid查询时间表下发状态", httpMethod = "POST") + @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) + @RequestMapping("/getCmaSchelduleUpload") + @Log(title = "根据requestid查询时间表下发状态", type = "查询") + public ResponseReult getCmaSchelduleUpload(@RequestBody @Validated RequestIdListVo vo) { + ServiceBody serviceBody = terminalScheduleRuleService.checkScheldule(vo); + if (serviceBody.getCode() == ServiceStatus.SUCCESS) { + return ResponseReult.success(serviceBody.getData()); + } else { + return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg()); + } + } + } diff --git a/xymanager_admin/src/test/java/com/shxy/xymanager_admin/XymanagerAdminApplicationTests.java b/xymanager_admin/src/test/java/com/shxy/xymanager_admin/XymanagerAdminApplicationTests.java index 1a2c3d2..d9720c3 100644 --- a/xymanager_admin/src/test/java/com/shxy/xymanager_admin/XymanagerAdminApplicationTests.java +++ b/xymanager_admin/src/test/java/com/shxy/xymanager_admin/XymanagerAdminApplicationTests.java @@ -1,11 +1,18 @@ package com.shxy.xymanager_admin; +import com.shxy.xymanager_common.entity.TerminalSchedulesTemp; +import com.shxy.xymanager_common.enums.CommonStatus; +import com.shxy.xymanager_common.model.TerminalScheduleRuleTimeListModel; import com.shxy.xymanager_common.util.SaltUtil; import com.shxy.xymanager_dao.dao.*; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + @SpringBootTest class XymanagerAdminApplicationTests { @@ -22,6 +29,9 @@ class XymanagerAdminApplicationTests { @Autowired private TerminalPhotoDao terminalPhotoDao; + + @Autowired + private TerminalSchedulesTempDao terminalSchedulesTempDao; @Test void contextLoads() { @@ -101,7 +111,7 @@ class XymanagerAdminApplicationTests { //1.获取随机盐 - String salt = SaltUtil.getSalt(8); +// String salt = SaltUtil.getSalt(8); //2.将随机盐保存到数据 // user.setSalt(salt); //3.明文密码进行md5 + salt + hash散列 @@ -110,6 +120,17 @@ class XymanagerAdminApplicationTests { // System.out.println(""); // user.setPassword(MD5.toHex()); // userDao.save(user); + + ArrayList requestidlist = new ArrayList<>(); + requestidlist.add(1); + requestidlist.add(2); + requestidlist.add(3); + + + List terminalSchedulesTemps = terminalSchedulesTempDao.updateStatusByRequestIdList(requestidlist, CommonStatus.EFFECTIVE.value(), new Date()); + System.out.println(terminalSchedulesTemps.toArray()); + + } } diff --git a/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/RequestIdListVo.java b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/RequestIdListVo.java new file mode 100644 index 0000000..1eeb3e9 --- /dev/null +++ b/xymanager_common/src/main/java/com/shxy/xymanager_common/vo/RequestIdListVo.java @@ -0,0 +1,18 @@ +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.List; + +@Data +@ApiModel(value = "查询Cma结果requestid的Vo", description = "查询Cma结果requestid的Vo") +public class RequestIdListVo { + + @NotNull(message = "查询编号不能缺少") + @ApiModelProperty(value = "查询编号", example = "123455") + private List list; + +} diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/RequestResultsDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/RequestResultsDao.java index 4fd6e29..dd64e12 100644 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/RequestResultsDao.java +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/RequestResultsDao.java @@ -3,12 +3,16 @@ package com.shxy.xymanager_dao.dao; import com.shxy.xymanager_common.entity.RequestResults; import org.apache.ibatis.annotations.Param; +import java.util.List; + public interface RequestResultsDao { RequestResults selectByPrimaryKey(Integer id); RequestResults selectByRequestId(@Param("requestId") Integer id); + List selectByRequestIdList(@Param("list") List id); + int updateByPrimaryKeySelective(RequestResults record); int updateByPrimaryKeyWithBLOBs(RequestResults record); diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesDao.java index ea1ab41..d8a9006 100644 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesDao.java +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesDao.java @@ -22,6 +22,8 @@ public interface TerminalSchedulesDao { List selectByTerminalBean(@Param("list") List list); + int updateList(List record); + int updateByPrimaryKeySelective(TerminalSchedules record); int updateByPrimaryKey(TerminalSchedules record); diff --git a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesTempDao.java b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesTempDao.java index ed2659e..369ab17 100644 --- a/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesTempDao.java +++ b/xymanager_dao/src/main/java/com/shxy/xymanager_dao/dao/TerminalSchedulesTempDao.java @@ -11,7 +11,7 @@ public interface TerminalSchedulesTempDao { List selectByTermAndChannel(@Param("list") List list, @Param("status") Integer status); - TerminalSchedulesTemp selectByRequestId(@Param("list") List id, @Param("status") Integer status); + List selectByRequestId(@Param("list") List id, @Param("status") Integer status); int deleteByPrimaryKey(Integer id); @@ -25,5 +25,7 @@ public interface TerminalSchedulesTempDao { int updateByPrimaryKeySelective(TerminalSchedulesTemp record); + int updateStatusByRequestIdList(@Param("list") List id, @Param("status") Integer status,@Param("updateat") Date updateat); + int updateByPrimaryKey(TerminalSchedulesTemp record); } \ No newline at end of file diff --git a/xymanager_dao/src/main/resources/generatorConfig.xml b/xymanager_dao/src/main/resources/generatorConfig.xml index 8fc48fe..ea9413e 100644 --- a/xymanager_dao/src/main/resources/generatorConfig.xml +++ b/xymanager_dao/src/main/resources/generatorConfig.xml @@ -112,7 +112,7 @@ - + diff --git a/xymanager_dao/src/main/resources/mappers/RequestResultsDao.xml b/xymanager_dao/src/main/resources/mappers/RequestResultsDao.xml index 4896058..b5916c8 100644 --- a/xymanager_dao/src/main/resources/mappers/RequestResultsDao.xml +++ b/xymanager_dao/src/main/resources/mappers/RequestResultsDao.xml @@ -20,13 +20,10 @@ - + update request_results diff --git a/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml index bd7550d..6bdc0c4 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalChannelsDao.xml @@ -127,7 +127,7 @@ 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 and k.status = #{status}) - left JOIN terminal_schedules l ON k.id = l.channel_id and l.term_id = y.id) + left JOIN terminal_schedule l ON k.id = l.channel_id and l.term_id = y.id) where y.id = #{termid} diff --git a/xymanager_dao/src/main/resources/mappers/TerminalPhotoDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalPhotoDao.xml index c2fc389..cf46c45 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalPhotoDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalPhotoDao.xml @@ -148,7 +148,7 @@ tscr.start_time startTime, end_time endTime, span - from terminal_schedules tm left join schedule_details tscr on tm.schedule_id = tscr.schedule_id + from terminal_schedule tm left join schedule_details tscr on tm.schedule_id = tscr.schedule_id left join terminals t on tm.term_id=t.id where tm.term_id = #{termId} and tm.channel_id = #{channel} diff --git a/xymanager_dao/src/main/resources/mappers/TerminalScheduleTempDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalScheduleTempDao.xml index cb084ab..e264266 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalScheduleTempDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalScheduleTempDao.xml @@ -118,6 +118,24 @@ + + update terminal_schedules_temp + + + status = #{status}, + + + update_time = #{updateat}, + + + + where request_id in + + #{id} + + + + update terminal_schedules_temp diff --git a/xymanager_dao/src/main/resources/mappers/TerminalSchedulesDao.xml b/xymanager_dao/src/main/resources/mappers/TerminalSchedulesDao.xml index 582e419..e22cc3f 100644 --- a/xymanager_dao/src/main/resources/mappers/TerminalSchedulesDao.xml +++ b/xymanager_dao/src/main/resources/mappers/TerminalSchedulesDao.xml @@ -15,14 +15,14 @@ @@ -30,7 +30,7 @@ - delete from terminal_schedules + delete from terminal_schedule where term_id = #{item.termId} and channel_id = #{item.channelId} @@ -49,7 +49,7 @@ - insert into terminal_schedules + insert into terminal_schedule (term_id,channel_id,schedule_id,create_time,update_time) VALUES @@ -59,7 +59,7 @@ - insert into terminal_schedules (id, term_id, channel_id, + insert into terminal_schedule (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 into terminal_schedules + insert into terminal_schedule id, @@ -110,7 +110,7 @@ - update terminal_schedules + update terminal_schedule term_id = #{termId,jdbcType=INTEGER}, @@ -130,8 +130,18 @@ where id = #{id,jdbcType=INTEGER} + + update terminal_schedule + set term_id = #{termId,jdbcType=INTEGER}, + channel_id = #{channelId,jdbcType=TINYINT}, + schedule_id = #{scheduleId,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=INTEGER} + + - update terminal_schedules + update terminal_schedule set term_id = #{termId,jdbcType=INTEGER}, channel_id = #{channelId,jdbcType=TINYINT}, schedule_id = #{scheduleId,jdbcType=INTEGER}, diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalScheduleRuleServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalScheduleRuleServiceImpl.java index c0ef59b..af26fe6 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalScheduleRuleServiceImpl.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/TerminalScheduleRuleServiceImpl.java @@ -225,80 +225,80 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ public ServiceBody relateSchelduleRule(RelateTerminalListRuleIdVo vo) { GetModel model = new GetModel(); - List list = terminalSchedulesTempDao.selectByTermAndChannel(vo.getList(), CommonStatus.DELETE.value()); - if (CollectionUtil.isNotEmpty(list)) { - - return Asserts.error("有装置时间尚未下发成功"); - } - List termlist = vo.getList(); - - Integer scheduleid = vo.getScheduleid(); - List temps = new ArrayList<>(); - List termidlist = new ArrayList<>(); - for (RelateTerminalListRuleIdVo.Items item : termlist) { - termidlist.add(item.getTermid()); - List channelidlist = item.getChannelidlist(); - for (Integer it : channelidlist) { - TerminalSchedulesTemp temp = new TerminalSchedulesTemp(); - temp.setTermId(item.getTermid()); - temp.setScheduleId(scheduleid); - temp.setChannelId(it); - temps.add(temp); - } - } - Date date = new Date(); - int i = terminalSchedulesTempDao.insertList(temps, CommonStatus.EFFECTIVE.value(), date, date); - - List terminalsList = terminalsDao.selectByIdList(vo.getList(), CommonStatus.EFFECTIVE.value()); - - if (CollectionUtil.isEmpty(termidlist)) { - return Asserts.error("没有该装置"); - } - ScheduleAndRuleDto dto = schedulesDao.selectSingle(scheduleid, CommonStatus.EFFECTIVE.value()); - List dtoList = dto.getList(); - if (CollectionUtil.isEmpty(dtoList)) { - return Asserts.error("没有该拍照时间规则"); - } - - StringBuffer timestr = new StringBuffer(); - for (int j = 0; j < dtoList.size(); j++) { - TerminalPhotosTimeModel.PhotosTimeBean bean = new TerminalPhotosTimeModel.PhotosTimeBean(); - Integer span = dtoList.get(j).getSpan(); - Date startTime = dtoList.get(j).getStartTime(); - Short startHour = Short.parseShort(MyDateUtils.parseHourAndMinute(startTime).split("/")[0]); - Short startMin = Short.parseShort(MyDateUtils.parseHourAndMinute(startTime).split("/")[1]); - - - Date endTime = dtoList.get(j).getEndTime(); - Short endTimeHour = Short.parseShort(MyDateUtils.parseHourAndMinute(endTime).split("/")[0]); - Short endTimeMin = Short.parseShort(MyDateUtils.parseHourAndMinute(endTime).split("/")[1]); - - Integer span1 = -1; - Integer span2 = -1; - if (span / 60 > 0) { - span1 = (span / 60); - span2 = (span % 60); - } else if (span < 60) { - span1 = 0; - span2 = span; - } - String string = "--hour1=" + startHour + "\t" + "--min1=" + startMin + "\t" + "--preset1=255 --hour2=" + endTimeHour + "\t" + "--min2=" + endTimeMin + "\t" - + "--preset2=255 --hour3=" + span1 + "\t" + "--min3=" + span2 + "\t" + "--preset3=255"; - timestr.append(string); - } - for (int x = 0; x < terminalsList.size(); x++) { - ChannelAndTermDto channelAndTermDto = terminalsList.get(x); - String cmd = Constants.CMD + "schedule --flag=1 --cmdid=" + channelAndTermDto.getCmdid() + "\t" + "--channel=" + channelAndTermDto.getChannelid() + "\t" + - timestr.toString(); - ProcessExecUtils.exec(cmd); - } +// List list = terminalSchedulesTempDao.selectByTermAndChannel(vo.getList(), CommonStatus.DELETE.value()); +// if (CollectionUtil.isNotEmpty(list)) { +// +// return Asserts.error("有装置时间尚未下发成功"); +// } +// List termlist = vo.getList(); +// +// Integer scheduleid = vo.getScheduleid(); +// List temps = new ArrayList<>(); +// List termidlist = new ArrayList<>(); +// for (RelateTerminalListRuleIdVo.Items item : termlist) { +// termidlist.add(item.getTermid()); +// List channelidlist = item.getChannelidlist(); +// for (Integer it : channelidlist) { +// TerminalSchedulesTemp temp = new TerminalSchedulesTemp(); +// temp.setTermId(item.getTermid()); +// temp.setScheduleId(scheduleid); +// temp.setChannelId(it); +// temps.add(temp); +// } +// } +// Date date = new Date(); +// int i = terminalSchedulesTempDao.insertList(temps, CommonStatus.EFFECTIVE.value(), date, date); +// +// List terminalsList = terminalsDao.selectByIdList(vo.getList(), CommonStatus.EFFECTIVE.value()); +// +// if (CollectionUtil.isEmpty(termidlist)) { +// return Asserts.error("没有该装置"); +// } +// ScheduleAndRuleDto dto = schedulesDao.selectSingle(scheduleid, CommonStatus.EFFECTIVE.value()); +// List dtoList = dto.getList(); +// if (CollectionUtil.isEmpty(dtoList)) { +// return Asserts.error("没有该拍照时间规则"); +// } +// +// StringBuffer timestr = new StringBuffer(); +// for (int j = 0; j < dtoList.size(); j++) { +// TerminalPhotosTimeModel.PhotosTimeBean bean = new TerminalPhotosTimeModel.PhotosTimeBean(); +// Integer span = dtoList.get(j).getSpan(); +// Date startTime = dtoList.get(j).getStartTime(); +// Short startHour = Short.parseShort(MyDateUtils.parseHourAndMinute(startTime).split("/")[0]); +// Short startMin = Short.parseShort(MyDateUtils.parseHourAndMinute(startTime).split("/")[1]); +// +// +// Date endTime = dtoList.get(j).getEndTime(); +// Short endTimeHour = Short.parseShort(MyDateUtils.parseHourAndMinute(endTime).split("/")[0]); +// Short endTimeMin = Short.parseShort(MyDateUtils.parseHourAndMinute(endTime).split("/")[1]); +// +// Integer span1 = -1; +// Integer span2 = -1; +// if (span / 60 > 0) { +// span1 = (span / 60); +// span2 = (span % 60); +// } else if (span < 60) { +// span1 = 0; +// span2 = span; +// } +// String string = "--hour1=" + startHour + "\t" + "--min1=" + startMin + "\t" + "--preset1=255 --hour2=" + endTimeHour + "\t" + "--min2=" + endTimeMin + "\t" +// + "--preset2=255 --hour3=" + span1 + "\t" + "--min3=" + span2 + "\t" + "--preset3=255"; +// timestr.append(string); +// } +// for (int x = 0; x < terminalsList.size(); x++) { +// ChannelAndTermDto channelAndTermDto = terminalsList.get(x); +// String cmd = Constants.CMD + "schedule --flag=1 --cmdid=" + channelAndTermDto.getCmdid() + "\t" + "--channel=" + channelAndTermDto.getChannelid() + "\t" + +// timestr.toString(); +// ProcessExecUtils.exec(cmd); +// } model.setRequestId(Integer.parseInt(Constants.REQUEST_ID.toString())); Constants.REQUEST_ID.addAndGet(1); - if (i != 0) { +// if (i != 0) { return Asserts.success(model); - } else { - return Asserts.error("关联失败"); - } +// } else { +// return Asserts.error("关联失败"); +// } } @@ -308,46 +308,49 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ * @param vo * @return */ + @Override @Transactional - public ServiceBody checkScheldule(RelateTerminalListRuleIdVo vo) { - Integer requestid = 0; - ArrayList intlist = new ArrayList<>(); - RequestResults results = requestResultsDao.selectByRequestId(1); - /* - * 如果下发成功 - * 1,将临时表中的数据状态改成1下发成功状态 - * 2,将装置关联拍照时间正式表改为临时表的对应状态 - * 3,将装置自身detial表插入新数据 - * */ - if (results != null) { - TerminalSchedulesTemp record = new TerminalSchedulesTemp(); - record.setStatus(CommonStatus.EFFECTIVE.value()); - record.setRequestId(requestid); - terminalSchedulesTempDao.updateByPrimaryKeySelective(record); - } - - ArrayList id = new ArrayList<>(); - TerminalSchedulesTemp temp1 = terminalSchedulesTempDao.selectByRequestId(id, CommonStatus.EFFECTIVE.value()); - - TerminalSchedules record = new TerminalSchedules(); - record.setChannelId(temp1.getChannelId()); - record.setScheduleId(temp1.getScheduleId()); - record.setTermId(temp1.getTermId()); - terminalSchedulesDao.updateByPrimaryKeySelective(record);//将实际的拍照时间表规则从临时表更新到正式表中 - -// terminalScheduleDetailsDao.deleteByPrimaryKey();//根据装置编号和通道编号删除之前对应的实际拍照时间表详情 - - ArrayList record1 = new ArrayList<>(); - terminalScheduleDetailsDao.insertList(record1);//插入新的对应的拍照时间表规则详情 - - int i = requestResultsDao.updateByPrimaryKey(new RequestResults());//根据requestid将结果表中的状态修改为已下发 -//end - - if (i != 0) { + public ServiceBody checkScheldule(RequestIdListVo vo) { +// /* +// * 当定时任务或者用户主动查询下发状态时 +// * */ +// List requestidlist = vo.getList(); +// List resultsList = requestResultsDao.selectByRequestIdList(requestidlist); +// /* +// * 如果下发成功 +// * 1,将临时表中的数据状态改成1下发成功状态 +// * 2,将装置关联拍照时间正式表改为临时表的对应状态 +// * 3,将装置自身detial表插入新数据 +// * */ +// if (CollectionUtil.isEmpty(resultsList)) { +// return Asserts.success("尚未查询到下发数据"); +// } +// terminalSchedulesTempDao.updateStatusByRequestIdList(requestidlist, CommonStatus.EFFECTIVE.value(), new Date()); +// +// List terminalSchedulesTemps = terminalSchedulesTempDao.selectByRequestId(requestidlist, CommonStatus.EFFECTIVE.value()); +// +// ArrayList terminalSchedules = new ArrayList<>(); +// for (TerminalSchedulesTemp item : terminalSchedulesTemps) { +// TerminalSchedules record = new TerminalSchedules(); +// record.setChannelId(item.getChannelId()); +// record.setScheduleId(item.getScheduleId()); +// record.setTermId(item.getTermId()); +// } +// terminalSchedulesDao.updateList(terminalSchedules);//将实际的拍照时间表规则从临时表更新到正式表中 +// +//// terminalScheduleDetailsDao.deleteByPrimaryKey();//根据装置编号和通道编号删除之前对应的实际拍照时间表详情 +// +// ArrayList record1 = new ArrayList<>(); +// terminalScheduleDetailsDao.insertList(record1);//插入新的对应的拍照时间表规则详情 +// +// int i = requestResultsDao.updateByPrimaryKey(new RequestResults());//根据requestid将结果表中的状态修改为已下发 +////end + +// if (i != 0) { return Asserts.success("下发成功"); - } else { - return Asserts.error("关联失败"); - } +// } else { +// return Asserts.error("关联失败"); +// } } @@ -359,45 +362,45 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ */ @Transactional public ServiceBody getSchedule(RelateTerminalListRuleIdVo vo) { - GetModel model = new GetModel(); - Integer requestid = 0; - ArrayList intlist = new ArrayList<>(); - RequestResults results = requestResultsDao.selectByRequestId(1); - /* - * 如果下发成功 - * 1,将临时表中的数据状态改成1下发成功状态 - * 2,将装置关联拍照时间正式表改为临时表的对应状态 - * 3,将装置自身detial表插入新数据 - * */ - if (results != null) { - TerminalSchedulesTemp record = new TerminalSchedulesTemp(); - record.setStatus(CommonStatus.EFFECTIVE.value()); - record.setRequestId(requestid); - terminalSchedulesTempDao.updateByPrimaryKeySelective(record); - } - - ArrayList id = new ArrayList<>(); - TerminalSchedulesTemp temp1 = terminalSchedulesTempDao.selectByRequestId(id, CommonStatus.EFFECTIVE.value()); - - TerminalSchedules record = new TerminalSchedules(); - record.setChannelId(temp1.getChannelId()); - record.setScheduleId(temp1.getScheduleId()); - record.setTermId(temp1.getTermId()); - terminalSchedulesDao.updateByPrimaryKeySelective(record);//将实际的拍照时间表规则从临时表更新到正式表中 - - terminalScheduleDetailsDao.deleteByPrimaryKey(0);//根据装置编号和通道编号删除之前对应的实际拍照时间表详情 - - ArrayList record1 = new ArrayList<>(); - terminalScheduleDetailsDao.insertList(record1);//插入新的对应的拍照时间表规则详情 - - int i = requestResultsDao.updateByPrimaryKey(new RequestResults());//根据requestid将结果表中的状态修改为已下发 -//end - - if (i != 0) { - return Asserts.success(model); - } else { - return Asserts.error("关联失败"); - } +// GetModel model = new GetModel(); +// Integer requestid = 0; +// ArrayList intlist = new ArrayList<>(); +// RequestResults results = requestResultsDao.selectByRequestId(1); +// /* +// * 如果下发成功 +// * 1,将临时表中的数据状态改成1下发成功状态 +// * 2,将装置关联拍照时间正式表改为临时表的对应状态 +// * 3,将装置自身detial表插入新数据 +// * */ +// if (results != null) { +// TerminalSchedulesTemp record = new TerminalSchedulesTemp(); +// record.setStatus(CommonStatus.EFFECTIVE.value()); +// record.setRequestId(requestid); +// terminalSchedulesTempDao.updateByPrimaryKeySelective(record); +// } +// +// ArrayList id = new ArrayList<>(); +// TerminalSchedulesTemp temp1 = terminalSchedulesTempDao.selectByRequestId(id, CommonStatus.EFFECTIVE.value()); +// +// TerminalSchedules record = new TerminalSchedules(); +// record.setChannelId(temp1.getChannelId()); +// record.setScheduleId(temp1.getScheduleId()); +// record.setTermId(temp1.getTermId()); +// terminalSchedulesDao.updateByPrimaryKeySelective(record);//将实际的拍照时间表规则从临时表更新到正式表中 +// +// terminalScheduleDetailsDao.deleteByPrimaryKey(0);//根据装置编号和通道编号删除之前对应的实际拍照时间表详情 +// +// ArrayList record1 = new ArrayList<>(); +// terminalScheduleDetailsDao.insertList(record1);//插入新的对应的拍照时间表规则详情 +// +// int i = requestResultsDao.updateByPrimaryKey(new RequestResults());//根据requestid将结果表中的状态修改为已下发 +////end + +// if (i != 0) { + return Asserts.success(null); +// } else { +// return Asserts.error("关联失败"); +// } } /** diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalScheduleRuleService.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalScheduleRuleService.java index dd56988..3ebde13 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalScheduleRuleService.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/service/TerminalScheduleRuleService.java @@ -59,6 +59,14 @@ public interface TerminalScheduleRuleService { */ ServiceBody relateSchelduleRule(RelateTerminalListRuleIdVo vo); + /** + * 查询规则下发状态 + * + * @param vo + * @return + */ + ServiceBody checkScheldule(RequestIdListVo vo); + /** * 获取通道的规则时间表 * @param vo