| | |
| | | /pipIrr-platform/downloadTemp/ |
| | | /pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu3rdTest/ |
| | | /logs/*.* |
| | | logs/ |
| | | logs/ |
| | | ### IntelliJ IDEA ### |
| | | .idea/ |
| | |
| | | .sts4-cache |
| | | |
| | | ### IntelliJ IDEA ### |
| | | .idea |
| | | .idea/ |
| | | *.iws |
| | | *.iml |
| | | *.ipr |
| | |
| | | * @return |
| | | */ |
| | | List<VoIntake> getGroupIntakesList(Long groupId); |
| | | |
| | | /** |
| | | * 根据轮灌组名称统计记录数 |
| | | * @param groupCode 轮灌组名称 |
| | | * @return 匹配的记录数 |
| | | */ |
| | | int countByGroupCode(@Param("groupCode") String groupCode); |
| | | |
| | | /** |
| | | * 根据轮灌组名称统计记录数(排除指定ID) |
| | | * @param groupCode 轮灌组名称 |
| | | * @param excludeId 需要排除的轮灌组ID |
| | | * @return 匹配的记录数 |
| | | */ |
| | | int countByGroupCodeExcludeId(@Param("groupCode") String groupCode, @Param("excludeId") Long excludeId); |
| | | } |
| | |
| | | INNER JOIN pr_controller con ON con.intakeId = gi.intake_id |
| | | WHERE gi.group_id = #{groupId} |
| | | </select> |
| | | |
| | | <!--根据轮灌组名称统计记录数--> |
| | | <select id="countByGroupCode" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) |
| | | FROM ir_irrigate_group |
| | | WHERE group_code = #{groupCode} |
| | | AND deleted = 0 |
| | | </select> |
| | | |
| | | <!--根据轮灌组名称统计记录数(排除指定ID)--> |
| | | <select id="countByGroupCodeExcludeId" resultType="java.lang.Integer"> |
| | | SELECT COUNT(*) |
| | | FROM ir_irrigate_group |
| | | WHERE group_code = #{groupCode} |
| | | AND id != #{excludeId} |
| | | AND deleted = 0 |
| | | </select> |
| | | </mapper> |
| | |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | // 先判断表内是否存在相同的 groupCode |
| | | if (irrigateGroupSv.existsByGroupCode(po.getGroupCode())) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.GROUP_CODE_ALREADY_EXISTS.getMessage()); |
| | | } |
| | | |
| | | Map map_result = irrigateGroupSv.addIrrigateGroup(po); |
| | | if(map_result.get("success").equals(false)) { |
| | |
| | | if(po.getGroupId() == null) { |
| | | return BaseResponseUtils.buildErrorMsg("轮灌组ID不能为空"); |
| | | } |
| | | |
| | | // 先判断表内是否存在相同的 groupCode(排除当前正在修改的记录) |
| | | if (irrigateGroupSv.existsByGroupCodeExcludeId(po.getGroupCode(), po.getGroupId())) { |
| | | return BaseResponseUtils.buildFail(IrrigateResultCode.GROUP_CODE_ALREADY_EXISTS.getMessage()); |
| | | } |
| | | |
| | | Map map_result = irrigateGroupSv.updateIrrigateGroup(po); |
| | | if(map_result.get("success").equals(false)) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据轮灌组名称查询是否存在(添加轮灌组时使用) |
| | | * @param groupCode 轮灌组名称 |
| | | * @return 是否存在 |
| | | */ |
| | | public boolean existsByGroupCode(String groupCode) { |
| | | if (groupCode == null || "".equals(groupCode.trim())) { |
| | | return false; |
| | | } |
| | | return irIrrigateGroupMapper.countByGroupCode(groupCode) > 0; |
| | | } |
| | | |
| | | /** |
| | | * 根据轮灌组名称查询是否存在(修改轮灌组时使用,排除当前ID) |
| | | * @param groupCode 轮灌组名称 |
| | | * @param excludeId 需要排除的ID |
| | | * @return 是否存在 |
| | | */ |
| | | public boolean existsByGroupCodeExcludeId(String groupCode, Long excludeId) { |
| | | if (groupCode == null || "".equals(groupCode.trim())) { |
| | | return false; |
| | | } |
| | | return irIrrigateGroupMapper.countByGroupCodeExcludeId(groupCode, excludeId) > 0; |
| | | } |
| | | |
| | | /** |
| | | * 删除轮灌组与农户管理 |
| | | * @param id |
| | | * @return |
| | |
| | | GROUP_ADD_UNIT_FAIL(30006, "轮灌组添加灌溉单元失败"), |
| | | GROUP_DELETE_UNIT_FAIL(30007, "轮灌组移除灌溉单元失败"), |
| | | UPDATE_GROUP_BIND_UNIT_FAIL(30008, "修改轮灌组绑定的灌溉单元失败"), |
| | | GROUP_CODE_ALREADY_EXISTS(30009, "轮灌组名称已存在"), |
| | | |
| | | /** |
| | | * 作物 |
| | |
| | | * @return |
| | | */ |
| | | public QueryResultVo<List<VoOpenCloseValve>> getOpenCloseValveReports_history(OpenCloseValveQO qo) { |
| | | qo.completionTimeNoEmpty() ; |
| | | //下面由completionTimeNoEmpty()改为completionTime()原因, |
| | | //开关阀记录中开阀时间和关阀时间有时不会同时有值,可能其中任一个是null值,如果用时间条件查询,则这样的记录就查不出来了。 |
| | | //如果要缩小所查询记录的范围(数量),则可从记录ID上设备一个范围。 |
| | | //qo.completionTimeNoEmpty() ; |
| | | qo.completionTime() ; |
| | | |
| | | |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo); |
| | | Long itemTotal = rmOpenCloseValveHistoryMapper.getOpenCloseValveReportsCount_history(params); |
| | |
| | | |
| | | |
| | | public void completionTime(){ |
| | | if(timeStart_open != null && timeStart_open.trim().equals("")) { |
| | | if(timeStart_open != null && !timeStart_open.trim().equals("")) { |
| | | timeStart_open = timeStart_open + " 00:00:00"; |
| | | } |
| | | if(timeStop_open != null && timeStop_open.trim().equals("")) { |
| | | if(timeStop_open != null && !timeStop_open.trim().equals("")) { |
| | | timeStop_open = timeStop_open + " 23:59:59"; |
| | | } |
| | | |
| | | if(timeStart_close != null && timeStart_close.trim().equals("")) { |
| | | if(timeStart_close != null && !timeStart_close.trim().equals("")) { |
| | | timeStart_close = timeStart_close + " 00:00:00"; |
| | | } |
| | | if(timeStop_close != null && timeStop_close.trim().equals("")) { |
| | | if(timeStop_close != null && !timeStop_close.trim().equals("")) { |
| | | timeStop_close = timeStop_close + " 23:59:59"; |
| | | } |
| | | } |
| | |
| | | // 计算下一组的开始时间 |
| | | LocalDateTime LocalscheduleStartTime = scheduleStartTime.toInstant().atZone(ZoneId.systemDefault()) .toLocalDateTime(); |
| | | LocalscheduleStartTime = LocalscheduleStartTime.plusMinutes(schedule.getDuration()); |
| | | LocalscheduleStartTime = LocalscheduleStartTime.minusMinutes(2); |
| | | scheduleStartTime = Date.from(LocalscheduleStartTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | } |
| | | |