pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/CommonV202404.java
@@ -253,20 +253,21 @@ } /** * 0x00:正常刷卡开泵/阀用水 * 0x01:平台远程开泵/阀用水 * 0x02:用户远程开泵/阀用水 * 0x03:测试卡, * 1个HEX * 0x01:正常刷卡开泵/阀用水 * 0x02:平台远程开泵/阀用水 * 0x08:用户远程开泵/阀用水 * 0x0b:巡检卡, * 0x04:其它 * @param type * @return */ public static String openValveType(byte type){ return switch (type) { case 0 -> "刷卡开阀"; case 1 -> "中心站开阀"; case 2 -> "用户远程开阀"; case 3 -> "测试卡开阀"; case 1 -> "刷卡开阀"; case 2 -> "中心站开阀"; case 8 -> "用户远程开阀"; case 11 -> "巡检卡开阀"; case 4 -> "其它开阀"; default -> "未知"; }; @@ -281,10 +282,10 @@ */ public static byte openType2P206V1(byte type){ return switch (type) { case 0 -> (byte)1 ; case 1 -> (byte)3 ; case 2 -> (byte)8 ; case 3 -> (byte)11 ; case 1 -> (byte)1 ; case 2 -> (byte)3 ; case 8 -> (byte)8 ; case 11 -> (byte)11 ; default -> (byte)-1; }; } pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_84_Up.java
@@ -134,6 +134,10 @@ index += 5 ; GlParse.parseAlarmAndState(bs, index, cdData) ;//四个字节 index += 4 ; cdData.price = ByteUtil.BCD2Int_LE(bs, index, index + 1)/100.0 ; } } pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlParse.java
@@ -287,6 +287,10 @@ index += 2 ; GlParse.parseAlarmAndState(bs, index, cdData) ;//四个字节 index += 4 ; cdData.price = ByteUtil.BCD2Int_LE(bs, index, index + 1)/100.0 ; } /** * 分析功能93、A3数据 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd84Vo.java
@@ -20,6 +20,7 @@ public Double eleTotalAmount ;//电表累计电量,单位0.01度 public Double moneyRemainUser ;//用户剩余金额, 单位0.01元 public Double waterRemainUser ;//用户剩余水量, 单位0.01m3 public Double price ;//水价 public String comName ;//命令名称 @@ -63,6 +64,9 @@ sb.append(" 用户剩余水量 : ") ; sb.append(waterRemainUser == null?"未知":waterRemainUser) ; sb.append("\n") ; sb.append(" 水价 : ") ; sb.append(price == null?"未知":price) ; sb.append("\n") ; return sb.toString() + super.toString() ; } pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/DataCd85Vo.java
@@ -25,6 +25,7 @@ public Double thisWater ;//本次使用水量, 单位0.01立方米 public Double thisMoney ;//本次使用金额, 单位0.0001元 public Integer thisDuration;//本次使用时间长, 单位:分钟 public Double price ;//水价 public String comName ;//命令名称 @@ -84,6 +85,9 @@ sb.append(" 本次使用时间长 : ") ; sb.append(thisDuration == null?"未知": thisDuration) ; sb.append("\n") ; sb.append(" 水价 : ") ; sb.append(price == null?"未知":price) ; sb.append("\n") ; return sb.toString() + super.toString() ; } pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmOpenCloseValveLast.java
@@ -333,7 +333,7 @@ this.clThisAmount = null; this.clThisMoney = null; this.clThisTime = null; this.clPrice = null; this.clPrice = cdData.price; this.clOpenDt = null; this.closeDt = null; @@ -355,7 +355,7 @@ this.clThisAmount = cdData.thisWater; this.clThisMoney = cdData.thisMoney; this.clThisTime = cdData.thisDuration; this.clPrice = null; this.clPrice = cdData.price; this.clOrderNo = cdData.orderNo; this.clEleTotalAmount = cdData.eleTotalAmount; this.clWaterRemainUser = cdData.waterRemain; @@ -463,7 +463,7 @@ this.clThisMoney = cdData.thisMoney; this.clThisTime = cdData.thisDuration; this.clThisEle = cdData.thisEle; this.clPrice = null; this.clPrice = cdData.price; this.clOpenDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.startDt); this.closeDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.endDt) ; pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/command/CommandSv.java
@@ -47,6 +47,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; @@ -258,6 +259,7 @@ * @param automaticClose * @return */ @Transactional(rollbackFor = Exception.class) public Map planedOpenTimedClose(AutomaticClose automaticClose, Long planId, Byte operatetype, Date startTime, Integer duration) { Long intakeId = automaticClose.getIntakeId(); Long vcId = automaticClose.getVcId(); @@ -687,6 +689,7 @@ * @param operatetype * @return */ @Transactional(rollbackFor = Exception.class) public Map closeWx(ValveClose valve, Long planId, Byte operatetype) { String rtuAddr = valve.getRtuAddr(); String vcNum = valve.getVcNum(); pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanCtrl.java
@@ -61,7 +61,7 @@ * @return */ @PostMapping(path = "createPlan", consumes = MediaType.APPLICATION_JSON_VALUE) @Transactional(rollbackFor = Exception.class) //@Transactional(rollbackFor = Exception.class) public BaseResponse<Boolean> createPlan(@RequestBody @Valid IrrigatePlan planAndSchedule, BindingResult bindingResult){ if(bindingResult != null && bindingResult.hasErrors()){ return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); @@ -193,7 +193,7 @@ * @return */ @PostMapping(path = "publishPlan", consumes = MediaType.APPLICATION_JSON_VALUE) @Transactional(rollbackFor = Exception.class) //@Transactional(rollbackFor = Exception.class) public BaseResponse<Boolean> publishPlan(@RequestBody @Valid PlanSimple planSimple, BindingResult bindingResult){ if(bindingResult != null && bindingResult.hasErrors()){ return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); @@ -315,7 +315,7 @@ * @return */ @PostMapping(path = "terminatePlan", consumes = MediaType.APPLICATION_JSON_VALUE) @Transactional(rollbackFor = Exception.class) //@Transactional(rollbackFor = Exception.class) public BaseResponse<Boolean> terminatePlan(@RequestBody @Valid PlanSimple planSimple, BindingResult bindingResult){ if(bindingResult != null && bindingResult.hasErrors()){ return BaseResponseUtils.buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanSv.java
@@ -19,6 +19,7 @@ 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 java.time.LocalDateTime; import java.time.ZoneId; @@ -72,6 +73,7 @@ * @param po * @return */ @Transactional(rollbackFor = Exception.class) public Long addIrrigatePlan(IrIrrigatePlan po) { irrigatePlanMapper.insert(po); return po.getId(); @@ -82,6 +84,7 @@ * @param planSimple * @return */ @Transactional(rollbackFor = Exception.class) public Map deletePlan(PlanSimple planSimple) { Long planId = planSimple.getPlanId(); Long operatorId = planSimple.getOperatorId(); @@ -184,7 +187,7 @@ planStopTime = Date.from(stopTime.atZone(ZoneId.systemDefault()).toInstant()); // 根据计划ID更新计划信息(起止时间、计划状态) if(irrigatePlanMapper.updatePlanTimes(planStartTime, planStopTime, planId) == 0) { if(this.updatePlanTimes(planStartTime, planStopTime, planId) == 0) { Map map = new HashMap<>(); map.put("success", false); map.put("msg", "计划信息更新失败"); @@ -200,7 +203,7 @@ if(scheduleStartTime == null) { scheduleStartTime = planStartTime; } updateScheduleStartTime(schedule.getScheduleId(), scheduleStartTime); this.updateScheduleStartTime(schedule.getScheduleId(), scheduleStartTime); // 计算下一组的开始时间 LocalDateTime LocalscheduleStartTime = scheduleStartTime.toInstant().atZone(ZoneId.systemDefault()) .toLocalDateTime(); @@ -308,6 +311,7 @@ * @param po * @return */ @Transactional(rollbackFor = Exception.class) public Integer updatePlan(IrIrrigatePlan po) { return irrigatePlanMapper.updateByPrimaryKeySelective(po); } @@ -371,6 +375,7 @@ * @param po * @return */ @Transactional(rollbackFor = Exception.class) public Long addPlanOperate(IrPlanOperate po) { irPlanOperateMapper.insert(po); return po.getId(); @@ -381,6 +386,7 @@ * @param po * @return */ @Transactional(rollbackFor = Exception.class) public Long addIrrigateSchedule(IrIrrigateSchedule po) { irIrrigateScheduleMapper.insert(po); return po.getId(); @@ -391,6 +397,7 @@ * @param planId * @return */ @Transactional(rollbackFor = Exception.class) public Integer terminateSchedule(Long planId) { return irIrrigateScheduleMapper.terminateSchedule(planId); } @@ -418,6 +425,7 @@ * @param po * @return */ @Transactional(rollbackFor = Exception.class) public Long addPlanSchedule(IrPlanSchedule po) { irPlanScheduleMapper.insert(po); return po.getId(); @@ -429,6 +437,7 @@ * @param startTime * @return */ @Transactional(rollbackFor = Exception.class) public Integer updateScheduleStartTime(Long scheduleId, Date startTime) { return irIrrigateScheduleMapper.updateScheduleStartTime(scheduleId, startTime); } @@ -516,4 +525,11 @@ return planDetails; } @Transactional(rollbackFor = Exception.class) private Integer updatePlanTimes(Date planStartTime, Date planEndTime, Long planId){ return irrigatePlanMapper.updatePlanTimes(planStartTime, planEndTime, planId); } }