From 4ca8da41dfd1402e00f38585aaaeb0213e3172df Mon Sep 17 00:00:00 2001 From: ALEI_ALEI Date: Thu, 19 Dec 2024 18:19:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=81=8C=E6=BA=89=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=99=A8=E9=80=BB=E8=BE=91=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NgIrrigationControllersController.java | 110 ++++++++++++++++++ .../UserIrrigationRecordController.java | 27 ++++- .../domain/NgIrrigationControllers.java | 67 +++++++++++ .../domain/NgRechargeMachines.java | 8 +- .../domain/NgUserRechargeRecords.java | 13 +-- .../domain/UserConsumptionDetails.java | 8 +- .../domain/UserIrrigationRecord.java | 4 +- .../domain/dto/UserIrrigationRecordDto.java | 3 + .../mapper/NgIrrigationControllersMapper.java | 63 ++++++++++ .../INgIrrigationControllersService.java | 61 ++++++++++ .../service/IUserIrrigationRecordService.java | 8 ++ .../NgIrrigationControllersServiceImpl.java | 96 +++++++++++++++ .../impl/UserIrrigationRecordServiceImpl.java | 21 ++++ .../NgIrrigationControllersMapper.xml | 106 +++++++++++++++++ .../rechargecard/NgRechargeMachinesMapper.xml | 7 +- .../NgUserRechargeRecordsMapper.xml | 12 +- 16 files changed, 583 insertions(+), 31 deletions(-) create mode 100644 fastbee-open-api/src/main/java/com/fastbee/data/controller/userRecharge/NgIrrigationControllersController.java create mode 100644 fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgIrrigationControllers.java create mode 100644 fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/mapper/NgIrrigationControllersMapper.java create mode 100644 fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/INgIrrigationControllersService.java create mode 100644 fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/impl/NgIrrigationControllersServiceImpl.java create mode 100644 fastbee-service/fastbee-rechargecard-service/src/main/resources/mapper/rechargecard/NgIrrigationControllersMapper.xml diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/controller/userRecharge/NgIrrigationControllersController.java b/fastbee-open-api/src/main/java/com/fastbee/data/controller/userRecharge/NgIrrigationControllersController.java new file mode 100644 index 0000000..c486b70 --- /dev/null +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/userRecharge/NgIrrigationControllersController.java @@ -0,0 +1,110 @@ +package com.fastbee.data.controller.userRecharge; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.fastbee.common.annotation.Log; +import com.fastbee.common.core.controller.BaseController; +import com.fastbee.common.core.domain.AjaxResult; +import com.fastbee.common.enums.BusinessType; +import com.fastbee.rechargecard.domain.NgIrrigationControllers; +import com.fastbee.rechargecard.service.INgIrrigationControllersService; +import com.fastbee.common.utils.poi.ExcelUtil; +import com.fastbee.common.core.page.TableDataInfo; + +/** + * 灌溉控制器信息Controller + * + * @author kerwincui + * @date 2024-12-19 + */ +@RestController +@RequestMapping("/rechargecard/controllers") +@Api(tags = "灌溉控制器信息") +public class NgIrrigationControllersController extends BaseController +{ + @Autowired + private INgIrrigationControllersService ngIrrigationControllersService; + + /** + * 查询灌溉控制器信息列表 + */ + @PreAuthorize("@ss.hasPermi('rechargecard:controllers:list')") + @GetMapping("/list") + @ApiOperation("查询灌溉控制器信息列表") + public TableDataInfo list(NgIrrigationControllers ngIrrigationControllers) + { + startPage(); + List list = ngIrrigationControllersService.selectNgIrrigationControllersList(ngIrrigationControllers); + return getDataTable(list); + } + + /** + * 导出灌溉控制器信息列表 + */ + @ApiOperation("导出灌溉控制器信息列表") + @PreAuthorize("@ss.hasPermi('rechargecard:controllers:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, NgIrrigationControllers ngIrrigationControllers) + { + List list = ngIrrigationControllersService.selectNgIrrigationControllersList(ngIrrigationControllers); + ExcelUtil util = new ExcelUtil(NgIrrigationControllers.class); + util.exportExcel(response, list, "灌溉控制器信息数据"); + } + + /** + * 获取灌溉控制器信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('rechargecard:controllers:query')") + @GetMapping(value = "/{id}") + @ApiOperation("获取灌溉控制器信息详细信息") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(ngIrrigationControllersService.selectNgIrrigationControllersById(id)); + } + + /** + * 新增灌溉控制器信息 + */ + @PreAuthorize("@ss.hasPermi('rechargecard:controllers:add')") + @PostMapping + @ApiOperation("新增灌溉控制器信息") + public AjaxResult add(@RequestBody NgIrrigationControllers ngIrrigationControllers) + { + return toAjax(ngIrrigationControllersService.insertNgIrrigationControllers(ngIrrigationControllers)); + } + + /** + * 修改灌溉控制器信息 + */ + @PreAuthorize("@ss.hasPermi('rechargecard:controllers:edit')") + @PutMapping + @ApiOperation("修改灌溉控制器信息") + public AjaxResult edit(@RequestBody NgIrrigationControllers ngIrrigationControllers) + { + return toAjax(ngIrrigationControllersService.updateNgIrrigationControllers(ngIrrigationControllers)); + } + + /** + * 删除灌溉控制器信息 + */ + @PreAuthorize("@ss.hasPermi('rechargecard:controllers:remove')") + @DeleteMapping("/{ids}") + @ApiOperation("删除灌溉控制器信息") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(ngIrrigationControllersService.deleteNgIrrigationControllersByIds(ids)); + } +} diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/controller/userRecharge/UserIrrigationRecordController.java b/fastbee-open-api/src/main/java/com/fastbee/data/controller/userRecharge/UserIrrigationRecordController.java index 2581259..59ef354 100644 --- a/fastbee-open-api/src/main/java/com/fastbee/data/controller/userRecharge/UserIrrigationRecordController.java +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/userRecharge/UserIrrigationRecordController.java @@ -3,6 +3,7 @@ package com.fastbee.data.controller.userRecharge; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.fastbee.rechargecard.domain.dto.UserIrrigationRecordDto; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; @@ -65,12 +66,28 @@ public class UserIrrigationRecordController extends BaseController /** * 获取用户灌溉记录展示详细信息列表 */ - /*@PreAuthorize("@ss.hasPermi('rechargecard:record:query')") - @GetMapping(value = "/list/show/{cardNumber}") - @ApiOperation("获取灌溉记录详细信息") - public AjaxResult getShowInfo(@PathVariable("cardNumber") String cardNumber) + @PreAuthorize("@ss.hasPermi('rechargecard:record:list')") + @GetMapping("/list/show") + @ApiOperation("查询灌溉记录列表") + public TableDataInfo Showlist(UserIrrigationRecord userIrrigationRecord) { - return success(userIrrigationRecordService.selectUserIrrigationRecordListShowBycardNumber(cardNumber)); + startPage(); + List list = userIrrigationRecordService.selectUserIrrigationRecordShowList(userIrrigationRecord); + return getDataTable(list); + } + /** + * 获取用户灌溉记录展示详细信息列表 + */ + /*@PreAuthorize("@ss.hasPermi('rechargecard:record:list')") + @GetMapping("/list/show/{cardNumber}") + @ApiOperation("查询灌溉记录列表") + public TableDataInfo ShowlistByCardNumber(@PathVariable("cardNumber") String cardNumber) + { + startPage(); + UserIrrigationRecord userIrrigationRecord=new UserIrrigationRecord(); + userIrrigationRecord.setCardNumber(cardNumber); + List list = userIrrigationRecordService.selectUserIrrigationRecordShowList(userIrrigationRecord); + return getDataTable(list); }*/ /** diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgIrrigationControllers.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgIrrigationControllers.java new file mode 100644 index 0000000..58fa9f6 --- /dev/null +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgIrrigationControllers.java @@ -0,0 +1,67 @@ +package com.fastbee.rechargecard.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.fastbee.common.annotation.Excel; +import com.fastbee.common.core.domain.BaseEntity; + +/** + * 灌溉控制器信息对象 ng_irrigation_controllers + * + * @author kerwincui + * @date 2024-12-19 + */ +@ApiModel(value = "NgIrrigationControllers",description = "灌溉控制器信息 ng_irrigation_controllers") +@Data +@EqualsAndHashCode(callSuper = true) +public class NgIrrigationControllers extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Long id; + + /** 控制器编码 */ + @Excel(name = "控制器编码") + @ApiModelProperty("控制器编码") + private String serialNumber; + + /** 控制器名称 */ + @Excel(name = "控制器名称") + @ApiModelProperty("控制器名称") + private String controllerName; + + /** 控制器型号 */ + @Excel(name = "控制器型号") + @ApiModelProperty("控制器型号") + private String controllerModel; + + /** 安装日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "安装日期", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty("安装日期") + private Date installationDate; + + /** 控制器状态,0=开启,1=关闭,2=维护中 */ + @Excel(name = "控制器状态,0=开启,1=关闭,2=维护中") + @ApiModelProperty("控制器状态,0=开启,1=关闭,2=维护中") + private Integer status; + + /** 上次维护日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "上次维护日期", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty("上次维护日期") + private Date lastMaintenance; + + /** 区域码 */ + @Excel(name = "区域码") + @ApiModelProperty("区域码") + private String areaCode; + +} diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgRechargeMachines.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgRechargeMachines.java index c3edb47..d2b4a6a 100644 --- a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgRechargeMachines.java +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgRechargeMachines.java @@ -68,9 +68,9 @@ public class NgRechargeMachines extends BaseEntity @ApiModelProperty("联系电话") private String contactPhone; - /** 备注 */ - @Excel(name = "备注") - @ApiModelProperty("备注") - private String remark; + /** 充值机名称 */ + @Excel(name = "充值机名称") + @ApiModelProperty("充值机名称") + private String deviceName; } diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgUserRechargeRecords.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgUserRechargeRecords.java index 8cd924b..0e4ef61 100644 --- a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgUserRechargeRecords.java +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgUserRechargeRecords.java @@ -79,14 +79,9 @@ public class NgUserRechargeRecords extends BaseEntity @ApiModelProperty("充值状态,0=成功,1=失败") private Integer status; - /** 充值机id */ - @Excel(name = "充值机id") - @ApiModelProperty("充值机id") - private Long deviceId; - - /** 备注 */ - @Excel(name = "备注") - @ApiModelProperty("备注") - private String remark; + /** 充值机编码 */ + @Excel(name = "充值机编码") + @ApiModelProperty("充值机编码") + private String serialNumber; } diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/UserConsumptionDetails.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/UserConsumptionDetails.java index 0077f48..d28fd0e 100644 --- a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/UserConsumptionDetails.java +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/UserConsumptionDetails.java @@ -99,19 +99,19 @@ public class UserConsumptionDetails extends BaseEntity private BigDecimal billingPeriodDuration; /** 账单生成的日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS") @Excel(name = "账单生成的日期", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty("账单生成的日期") private Date billingDate; /** 开泵时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS") @Excel(name = "开泵时间", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty("开泵时间") private Date startTime; /** 关泵时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS") @Excel(name = "关泵时间", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty("关泵时间") private Date endTime; @@ -127,7 +127,7 @@ public class UserConsumptionDetails extends BaseEntity private Integer paymentMethod; /** 账单支付的时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS") @Excel(name = " 账单支付的时间", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty(" 账单支付的时间") private Date paymentTime; diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/UserIrrigationRecord.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/UserIrrigationRecord.java index 8138c34..96cd945 100644 --- a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/UserIrrigationRecord.java +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/UserIrrigationRecord.java @@ -74,13 +74,13 @@ public class UserIrrigationRecord extends BaseEntity private BigDecimal balance; /** 开泵时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS") @Excel(name = "开泵时间", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty("开泵时间") private Date startTime; /** 关泵时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS") @Excel(name = "关泵时间", width = 30, dateFormat = "yyyy-MM-dd") @ApiModelProperty("关泵时间") private Date endTime; diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/dto/UserIrrigationRecordDto.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/dto/UserIrrigationRecordDto.java index b57b06e..53a2d29 100644 --- a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/dto/UserIrrigationRecordDto.java +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/dto/UserIrrigationRecordDto.java @@ -2,6 +2,7 @@ package com.fastbee.rechargecard.domain.dto; import cn.hutool.core.date.DateTime; import com.fastbee.rechargecard.domain.UserIrrigationRecord; +import com.fasterxml.jackson.annotation.JsonFormat; import java.math.BigDecimal; import java.util.Date; @@ -13,6 +14,8 @@ public class UserIrrigationRecordDto public String deviceName; public String cardNumber; public BigDecimal flow; + @JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS") public Date startTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:MM:SS") public Date endTime; } diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/mapper/NgIrrigationControllersMapper.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/mapper/NgIrrigationControllersMapper.java new file mode 100644 index 0000000..19d8840 --- /dev/null +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/mapper/NgIrrigationControllersMapper.java @@ -0,0 +1,63 @@ +package com.fastbee.rechargecard.mapper; + +import java.util.List; +import com.fastbee.rechargecard.domain.NgIrrigationControllers; +import org.apache.ibatis.annotations.Mapper; + +/** + * 灌溉控制器信息Mapper接口 + * + * @author kerwincui + * @date 2024-12-19 + */ +@Mapper +public interface NgIrrigationControllersMapper +{ + /** + * 查询灌溉控制器信息 + * + * @param id 灌溉控制器信息主键 + * @return 灌溉控制器信息 + */ + public NgIrrigationControllers selectNgIrrigationControllersById(Long id); + + /** + * 查询灌溉控制器信息列表 + * + * @param ngIrrigationControllers 灌溉控制器信息 + * @return 灌溉控制器信息集合 + */ + public List selectNgIrrigationControllersList(NgIrrigationControllers ngIrrigationControllers); + + /** + * 新增灌溉控制器信息 + * + * @param ngIrrigationControllers 灌溉控制器信息 + * @return 结果 + */ + public int insertNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers); + + /** + * 修改灌溉控制器信息 + * + * @param ngIrrigationControllers 灌溉控制器信息 + * @return 结果 + */ + public int updateNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers); + + /** + * 删除灌溉控制器信息 + * + * @param id 灌溉控制器信息主键 + * @return 结果 + */ + public int deleteNgIrrigationControllersById(Long id); + + /** + * 批量删除灌溉控制器信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteNgIrrigationControllersByIds(Long[] ids); +} diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/INgIrrigationControllersService.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/INgIrrigationControllersService.java new file mode 100644 index 0000000..fe5f9f2 --- /dev/null +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/INgIrrigationControllersService.java @@ -0,0 +1,61 @@ +package com.fastbee.rechargecard.service; + +import java.util.List; +import com.fastbee.rechargecard.domain.NgIrrigationControllers; + +/** + * 灌溉控制器信息Service接口 + * + * @author kerwincui + * @date 2024-12-19 + */ +public interface INgIrrigationControllersService +{ + /** + * 查询灌溉控制器信息 + * + * @param id 灌溉控制器信息主键 + * @return 灌溉控制器信息 + */ + public NgIrrigationControllers selectNgIrrigationControllersById(Long id); + + /** + * 查询灌溉控制器信息列表 + * + * @param ngIrrigationControllers 灌溉控制器信息 + * @return 灌溉控制器信息集合 + */ + public List selectNgIrrigationControllersList(NgIrrigationControllers ngIrrigationControllers); + + /** + * 新增灌溉控制器信息 + * + * @param ngIrrigationControllers 灌溉控制器信息 + * @return 结果 + */ + public int insertNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers); + + /** + * 修改灌溉控制器信息 + * + * @param ngIrrigationControllers 灌溉控制器信息 + * @return 结果 + */ + public int updateNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers); + + /** + * 批量删除灌溉控制器信息 + * + * @param ids 需要删除的灌溉控制器信息主键集合 + * @return 结果 + */ + public int deleteNgIrrigationControllersByIds(Long[] ids); + + /** + * 删除灌溉控制器信息信息 + * + * @param id 灌溉控制器信息主键 + * @return 结果 + */ + public int deleteNgIrrigationControllersById(Long id); +} diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/IUserIrrigationRecordService.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/IUserIrrigationRecordService.java index 76705d4..5c828a6 100644 --- a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/IUserIrrigationRecordService.java +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/IUserIrrigationRecordService.java @@ -20,6 +20,14 @@ public interface IUserIrrigationRecordService */ //public List selectUserIrrigationRecordListShowBycardNumber(String cardNumber); + /** + * 查询展示灌溉记录列表 + * + * @param userIrrigationRecord 灌溉记录 + * @return 灌溉记录集合 + */ + public List selectUserIrrigationRecordShowList(UserIrrigationRecord userIrrigationRecord); + /** * 查询用户灌溉记录列表 * diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/impl/NgIrrigationControllersServiceImpl.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/impl/NgIrrigationControllersServiceImpl.java new file mode 100644 index 0000000..bcec343 --- /dev/null +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/impl/NgIrrigationControllersServiceImpl.java @@ -0,0 +1,96 @@ +package com.fastbee.rechargecard.service.impl; + +import java.util.List; +import com.fastbee.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.fastbee.rechargecard.mapper.NgIrrigationControllersMapper; +import com.fastbee.rechargecard.domain.NgIrrigationControllers; +import com.fastbee.rechargecard.service.INgIrrigationControllersService; + +/** + * 灌溉控制器信息Service业务层处理 + * + * @author kerwincui + * @date 2024-12-19 + */ +@Service +public class NgIrrigationControllersServiceImpl implements INgIrrigationControllersService +{ + @Autowired + private NgIrrigationControllersMapper ngIrrigationControllersMapper; + + /** + * 查询灌溉控制器信息 + * + * @param id 灌溉控制器信息主键 + * @return 灌溉控制器信息 + */ + @Override + public NgIrrigationControllers selectNgIrrigationControllersById(Long id) + { + return ngIrrigationControllersMapper.selectNgIrrigationControllersById(id); + } + + /** + * 查询灌溉控制器信息列表 + * + * @param ngIrrigationControllers 灌溉控制器信息 + * @return 灌溉控制器信息 + */ + @Override + public List selectNgIrrigationControllersList(NgIrrigationControllers ngIrrigationControllers) + { + return ngIrrigationControllersMapper.selectNgIrrigationControllersList(ngIrrigationControllers); + } + + /** + * 新增灌溉控制器信息 + * + * @param ngIrrigationControllers 灌溉控制器信息 + * @return 结果 + */ + @Override + public int insertNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers) + { + ngIrrigationControllers.setCreateTime(DateUtils.getNowDate()); + return ngIrrigationControllersMapper.insertNgIrrigationControllers(ngIrrigationControllers); + } + + /** + * 修改灌溉控制器信息 + * + * @param ngIrrigationControllers 灌溉控制器信息 + * @return 结果 + */ + @Override + public int updateNgIrrigationControllers(NgIrrigationControllers ngIrrigationControllers) + { + ngIrrigationControllers.setUpdateTime(DateUtils.getNowDate()); + return ngIrrigationControllersMapper.updateNgIrrigationControllers(ngIrrigationControllers); + } + + /** + * 批量删除灌溉控制器信息 + * + * @param ids 需要删除的灌溉控制器信息主键 + * @return 结果 + */ + @Override + public int deleteNgIrrigationControllersByIds(Long[] ids) + { + return ngIrrigationControllersMapper.deleteNgIrrigationControllersByIds(ids); + } + + /** + * 删除灌溉控制器信息信息 + * + * @param id 灌溉控制器信息主键 + * @return 结果 + */ + @Override + public int deleteNgIrrigationControllersById(Long id) + { + return ngIrrigationControllersMapper.deleteNgIrrigationControllersById(id); + } +} diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/impl/UserIrrigationRecordServiceImpl.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/impl/UserIrrigationRecordServiceImpl.java index 862ffd4..9c33b7d 100644 --- a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/impl/UserIrrigationRecordServiceImpl.java +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/impl/UserIrrigationRecordServiceImpl.java @@ -1,5 +1,6 @@ package com.fastbee.rechargecard.service.impl; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import com.fastbee.common.utils.DateUtils; @@ -28,6 +29,26 @@ public class UserIrrigationRecordServiceImpl implements IUserIrrigationRecordSer @Autowired private DeviceMapper deviceMapper; + @Override + public List selectUserIrrigationRecordShowList(UserIrrigationRecord userIrrigationRecord) { + List result=new ArrayList<>(); + List list=userIrrigationRecordMapper.selectUserIrrigationRecordList(userIrrigationRecord); + for(int i=0;i + + + + + + + + + + + + + + + + + + + + + select id, serial_number, controller_name, controller_model, installation_date, status, last_maintenance, area_code, remark, create_time, update_time, create_by, update_by from ng_irrigation_controllers + + + + + + + + insert into ng_irrigation_controllers + + serial_number, + controller_name, + controller_model, + installation_date, + status, + last_maintenance, + area_code, + remark, + create_time, + update_time, + create_by, + update_by, + + + #{serialNumber}, + #{controllerName}, + #{controllerModel}, + #{installationDate}, + #{status}, + #{lastMaintenance}, + #{areaCode}, + #{remark}, + #{createTime}, + #{updateTime}, + #{createBy}, + #{updateBy}, + + + + + update ng_irrigation_controllers + + serial_number = #{serialNumber}, + controller_name = #{controllerName}, + controller_model = #{controllerModel}, + installation_date = #{installationDate}, + status = #{status}, + last_maintenance = #{lastMaintenance}, + area_code = #{areaCode}, + remark = #{remark}, + create_time = #{createTime}, + update_time = #{updateTime}, + create_by = #{createBy}, + update_by = #{updateBy}, + + where id = #{id} + + + + delete from ng_irrigation_controllers where id = #{id} + + + + delete from ng_irrigation_controllers where id in + + #{id} + + + \ No newline at end of file diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/resources/mapper/rechargecard/NgRechargeMachinesMapper.xml b/fastbee-service/fastbee-rechargecard-service/src/main/resources/mapper/rechargecard/NgRechargeMachinesMapper.xml index 6a79058..d7d1659 100644 --- a/fastbee-service/fastbee-rechargecard-service/src/main/resources/mapper/rechargecard/NgRechargeMachinesMapper.xml +++ b/fastbee-service/fastbee-rechargecard-service/src/main/resources/mapper/rechargecard/NgRechargeMachinesMapper.xml @@ -19,10 +19,11 @@ + - select id, location, device_model, serial_number, area_code, installation_date, status, contact_person, contact_phone, remark, create_time, update_time, create_by, update_by from ng_recharge_machines + select id, location, device_model, serial_number, area_code, installation_date, status, contact_person, contact_phone, remark, create_time, update_time, create_by, update_by, device_name from ng_recharge_machines @@ -60,6 +62,7 @@ update_time, create_by, update_by, + device_name, #{location}, @@ -75,6 +78,7 @@ #{updateTime}, #{createBy}, #{updateBy}, + #{deviceName}, @@ -94,6 +98,7 @@ update_time = #{updateTime}, create_by = #{createBy}, update_by = #{updateBy}, + device_name = #{deviceName}, where id = #{id} diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/resources/mapper/rechargecard/NgUserRechargeRecordsMapper.xml b/fastbee-service/fastbee-rechargecard-service/src/main/resources/mapper/rechargecard/NgUserRechargeRecordsMapper.xml index b145330..8dda524 100644 --- a/fastbee-service/fastbee-rechargecard-service/src/main/resources/mapper/rechargecard/NgUserRechargeRecordsMapper.xml +++ b/fastbee-service/fastbee-rechargecard-service/src/main/resources/mapper/rechargecard/NgUserRechargeRecordsMapper.xml @@ -16,7 +16,7 @@ - + @@ -25,7 +25,7 @@ - select id, user_id, user_name, card_number, area_code, type, amount, balance, recharge_time, recharge_code, status, device_id, remark, create_time, update_time, create_by, update_by from ng_user_recharge_records + select id, user_id, user_name, card_number, area_code, type, amount, balance, recharge_time, recharge_code, status, serial_number, remark, create_time, update_time, create_by, update_by from ng_user_recharge_records @@ -63,7 +63,7 @@ recharge_time, recharge_code, status, - device_id, + serial_number, remark, create_time, update_time, @@ -81,7 +81,7 @@ #{rechargeTime}, #{rechargeCode}, #{status}, - #{deviceId}, + #{serialNumber}, #{remark}, #{createTime}, #{updateTime}, @@ -103,7 +103,7 @@ recharge_time = #{rechargeTime}, recharge_code = #{rechargeCode}, status = #{status}, - device_id = #{deviceId}, + serial_number = #{serialNumber}, remark = #{remark}, create_time = #{createTime}, update_time = #{updateTime}, From a6d4f1a12c3f08a44c729bd11926a5d8418b2858 Mon Sep 17 00:00:00 2001 From: mi9688 Date: Thu, 19 Dec 2024 18:54:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B0=B4=E6=B3=B5=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../consumer/DeviceOtherMsgConsumer.java | 82 ++++++------- .../data/controller/DeviceController.java | 24 +++- .../controller/DeviceOperationController.java | 1 + .../NgWaterPumpUsageRecordsController.java | 110 ++++++++++++++++++ .../waterele/MaGuangaiRecordController.java | 2 +- .../domain/NgWaterPumpUsageRecords.java | 50 ++++++++ .../mapper/NgWaterPumpUsageRecordsMapper.java | 63 ++++++++++ .../INgWaterPumpUsageRecordsService.java | 61 ++++++++++ .../NgWaterPumpUsageRecordsServiceImpl.java | 93 +++++++++++++++ .../NgWaterPumpUsageRecordsMapper.xml | 71 +++++++++++ 10 files changed, 510 insertions(+), 47 deletions(-) create mode 100644 fastbee-open-api/src/main/java/com/fastbee/data/controller/userRecharge/NgWaterPumpUsageRecordsController.java create mode 100644 fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgWaterPumpUsageRecords.java create mode 100644 fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/mapper/NgWaterPumpUsageRecordsMapper.java create mode 100644 fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/INgWaterPumpUsageRecordsService.java create mode 100644 fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/impl/NgWaterPumpUsageRecordsServiceImpl.java create mode 100644 fastbee-service/fastbee-rechargecard-service/src/main/resources/mapper/rechargecard/NgWaterPumpUsageRecordsMapper.xml diff --git a/fastbee-gateway/fastbee-mq/src/main/java/com/fastbee/mq/redischannel/consumer/DeviceOtherMsgConsumer.java b/fastbee-gateway/fastbee-mq/src/main/java/com/fastbee/mq/redischannel/consumer/DeviceOtherMsgConsumer.java index acdac77..1d86ae3 100644 --- a/fastbee-gateway/fastbee-mq/src/main/java/com/fastbee/mq/redischannel/consumer/DeviceOtherMsgConsumer.java +++ b/fastbee-gateway/fastbee-mq/src/main/java/com/fastbee/mq/redischannel/consumer/DeviceOtherMsgConsumer.java @@ -58,14 +58,14 @@ public class DeviceOtherMsgConsumer { reportMsg.put("code",0); reportMsg.put("msg","ok"); issueInstructionsProducer.receiveDataReportResponse(productId.toString(),serialNumber,JSONUtil.toJsonStr(reportMsg)); - } else if ( topic.endsWith("hzlink/info/reply")) { + } else if ( topic.endsWith("/info/reply")) { platformDataReportAckHandler(new String(data)); } else if (topic.endsWith("hzlink/cmd/down")) { platformCmdHandler(new String(data)); //回应 - } else if (topic.endsWith("hzlink/cmd/reply")) { + } else if (topic.endsWith("/cmd/reply")) { deviceCmdAckHandler(new String(data)); } otherMsgHandler.messageHandler(bo); @@ -81,45 +81,45 @@ public class DeviceOtherMsgConsumer { private void deviceDataReportHandler(String data){ System.err.println("mqtt接收到设备上报数据:"+ data); //回应 - - //解析 -// String jsonString = "{\"type\": \"waterEleData\", \"pakSn\": 123, \"data\": {\"workState\": 1, \"action\": \"startPump\", \"mcuSn\": \"MCU123456\", \"sumEle\": 5000, \"sumFlow\": 3000, \"insFlow\": 2.5, \"userSumFlow\": 1500, \"areaCode\": \"010\", \"cardId\": \"CARD12345678\", \"userBalance\": 100.0, \"userSumEle\": 3000, \"curEle\": 50, \"curFlow\": 200, \"insPower\": 2300}}"; - JSONObject entries = JSONUtil.parseObj(data); -// System.err.println("解析后:"+entries); - //获取帧标识 - String type = entries.getStr("type"); - //获取帧号 - Long pakSn = entries.getLong("pakSn"); - //获取数据 - JSONObject dataObj = entries.getJSONObject("data"); - //获取水泵状态0=关泵,1=开泵 - Integer workState = dataObj.getInt("workState"); - //获取动作 - String action = dataObj.getStr("action"); - //获取单片机编码 - String mcuSn = dataObj.getStr("mcuSn"); - //获取累计用电量 - Integer sumEle = dataObj.getInt("sumEle"); - //获取累计用水量 - Integer sumFlow = dataObj.getInt("sumFlow"); - //获取瞬时流量 - Double insFlow = dataObj.getDouble("insFlow"); - //当前用户累计用水量 - Integer userSumFlow = dataObj.getInt("userSumFlow"); - //获取区域号 - String areaCode = dataObj.getStr("areaCode"); - //获取卡号 - String cardId = dataObj.getStr("cardId"); - //获取用户余额 - Double userBalance = dataObj.getDouble("userBalance"); - //获取用户累计用电量 - Integer userSumEle = dataObj.getInt("userSumEle"); - //获取本次用电量 - Integer curEle = dataObj.getInt("curEle"); - //获取本次用水量 - Integer curFlow = dataObj.getInt("curFlow"); - //获取瞬时功率 - Integer insPower = dataObj.getInt("insPower"); +// +// //解析 +//// String jsonString = "{\"type\": \"waterEleData\", \"pakSn\": 123, \"data\": {\"workState\": 1, \"action\": \"startPump\", \"mcuSn\": \"MCU123456\", \"sumEle\": 5000, \"sumFlow\": 3000, \"insFlow\": 2.5, \"userSumFlow\": 1500, \"areaCode\": \"010\", \"cardId\": \"CARD12345678\", \"userBalance\": 100.0, \"userSumEle\": 3000, \"curEle\": 50, \"curFlow\": 200, \"insPower\": 2300}}"; +// JSONObject entries = JSONUtil.parseObj(data); +//// System.err.println("解析后:"+entries); +// //获取帧标识 +// String type = entries.getStr("type"); +// //获取帧号 +// Long pakSn = entries.getLong("pakSn"); +// //获取数据 +// JSONObject dataObj = entries.getJSONObject("data"); +// //获取水泵状态0=关泵,1=开泵 +// Integer workState = dataObj.getInt("workState"); +// //获取动作 +// String action = dataObj.getStr("action"); +// //获取单片机编码 +// String mcuSn = dataObj.getStr("mcuSn"); +// //获取累计用电量 +// Integer sumEle = dataObj.getInt("sumEle"); +// //获取累计用水量 +// Integer sumFlow = dataObj.getInt("sumFlow"); +// //获取瞬时流量 +// Double insFlow = dataObj.getDouble("insFlow"); +// //当前用户累计用水量 +// Integer userSumFlow = dataObj.getInt("userSumFlow"); +// //获取区域号 +// String areaCode = dataObj.getStr("areaCode"); +// //获取卡号 +// String cardId = dataObj.getStr("cardId"); +// //获取用户余额 +// Double userBalance = dataObj.getDouble("userBalance"); +// //获取用户累计用电量 +// Integer userSumEle = dataObj.getInt("userSumEle"); +// //获取本次用电量 +// Integer curEle = dataObj.getInt("curEle"); +// //获取本次用水量 +// Integer curFlow = dataObj.getInt("curFlow"); +// //获取瞬时功率 +// Integer insPower = dataObj.getInt("insPower"); } /** diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/controller/DeviceController.java b/fastbee-open-api/src/main/java/com/fastbee/data/controller/DeviceController.java index f77ab81..5a6fba0 100644 --- a/fastbee-open-api/src/main/java/com/fastbee/data/controller/DeviceController.java +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/DeviceController.java @@ -1,9 +1,12 @@ package com.fastbee.data.controller; +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; import com.fastbee.common.annotation.Log; import com.fastbee.common.constant.HttpStatus; import com.fastbee.common.core.controller.BaseController; import com.fastbee.common.core.domain.AjaxResult; +import com.fastbee.common.core.domain.AjaxResultPro; import com.fastbee.common.core.domain.entity.SysRole; import com.fastbee.common.core.domain.model.LoginUser; import com.fastbee.common.core.page.TableDataInfo; @@ -16,6 +19,7 @@ import com.fastbee.common.utils.poi.ExcelUtil; import com.fastbee.data.service.devicedetail.IDeviceDetailService; import com.fastbee.iot.domain.Device; import com.fastbee.iot.domain.JiankongDeviceParam; +import com.fastbee.iot.mapper.DeviceMapper; import com.fastbee.iot.model.DeviceAssignmentVO; import com.fastbee.iot.model.DeviceImportVO; import com.fastbee.iot.model.DeviceRelateUserInput; @@ -54,6 +58,8 @@ public class DeviceController extends BaseController { @Autowired private IDeviceService deviceService; @Autowired + private DeviceMapper deviceMapper; + @Autowired private IDeviceDetailService deviceDetailService; // @Lazy @Autowired @@ -508,11 +514,19 @@ public class DeviceController extends BaseController { */ @GetMapping("/getDeviceIsActivation") @ApiOperation("根据设备编号判断设备是否激活") - public AjaxResult getDeviceActivation(String serialNumber) { - Device device = deviceService.selectDeviceBySerialNumber(serialNumber); - if(device.getStatus().toString().equals("1")){ - return AjaxResult.success(false); + public AjaxResultPro getDeviceActivation(String serialNumber) { + List list = new LambdaQueryChainWrapper<>(deviceMapper) + .select(Device::getDeviceId, Device::getStatus) + .eq(Device::getSerialNumber, serialNumber) + .list(); + if(list.isEmpty()){ + return AjaxResultPro.success(204,"设备不存在!",null); } - return AjaxResult.success(true); + + Device device = list.get(0); + if(device.getStatus().toString().equals("1")){ + return AjaxResultPro.success(false); + } + return AjaxResultPro.success(true); } } diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/controller/DeviceOperationController.java b/fastbee-open-api/src/main/java/com/fastbee/data/controller/DeviceOperationController.java index b266e7d..2d484be 100644 --- a/fastbee-open-api/src/main/java/com/fastbee/data/controller/DeviceOperationController.java +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/DeviceOperationController.java @@ -50,6 +50,7 @@ public class DeviceOperationController { } else if (deviceOperationDTO.getOperationType().equals("100")) { param.put("cmd",100); Map data = new HashMap<>(); + //status:0关1开2停止 data.put("status",deviceOperationDTO.getOperationCode()); param.put("data",data); } diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/controller/userRecharge/NgWaterPumpUsageRecordsController.java b/fastbee-open-api/src/main/java/com/fastbee/data/controller/userRecharge/NgWaterPumpUsageRecordsController.java new file mode 100644 index 0000000..63f3099 --- /dev/null +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/userRecharge/NgWaterPumpUsageRecordsController.java @@ -0,0 +1,110 @@ +package com.fastbee.data.controller.userRecharge; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.fastbee.common.annotation.Log; +import com.fastbee.common.core.controller.BaseController; +import com.fastbee.common.core.domain.AjaxResult; +import com.fastbee.common.enums.BusinessType; +import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords; +import com.fastbee.rechargecard.service.INgWaterPumpUsageRecordsService; +import com.fastbee.common.utils.poi.ExcelUtil; +import com.fastbee.common.core.page.TableDataInfo; + +/** + * 水泵设备使用记录Controller + * + * @author kerwincui + * @date 2024-12-19 + */ +@RestController +@RequestMapping("/waterpump/records") +@Api(tags = "水泵设备使用记录") +public class NgWaterPumpUsageRecordsController extends BaseController +{ + @Autowired + private INgWaterPumpUsageRecordsService ngWaterPumpUsageRecordsService; + + /** + * 查询水泵设备使用记录列表 + */ +// @PreAuthorize("@ss.hasPermi('rechargecard:records:list')") + @GetMapping("/list") + @ApiOperation("查询水泵设备使用记录列表") + public TableDataInfo list(NgWaterPumpUsageRecords ngWaterPumpUsageRecords) + { + startPage(); + List list = ngWaterPumpUsageRecordsService.selectNgWaterPumpUsageRecordsList(ngWaterPumpUsageRecords); + return getDataTable(list); + } + + /** + * 导出水泵设备使用记录列表 + */ + @ApiOperation("导出水泵设备使用记录列表") + @PreAuthorize("@ss.hasPermi('rechargecard:records:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, NgWaterPumpUsageRecords ngWaterPumpUsageRecords) + { + List list = ngWaterPumpUsageRecordsService.selectNgWaterPumpUsageRecordsList(ngWaterPumpUsageRecords); + ExcelUtil util = new ExcelUtil(NgWaterPumpUsageRecords.class); + util.exportExcel(response, list, "水泵设备使用记录数据"); + } + + /** + * 获取水泵设备使用记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('rechargecard:records:query')") + @GetMapping(value = "/{id}") + @ApiOperation("获取水泵设备使用记录详细信息") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(ngWaterPumpUsageRecordsService.selectNgWaterPumpUsageRecordsById(id)); + } + + /** + * 新增水泵设备使用记录 + */ + @PreAuthorize("@ss.hasPermi('rechargecard:records:add')") + @PostMapping + @ApiOperation("新增水泵设备使用记录") + public AjaxResult add(@RequestBody NgWaterPumpUsageRecords ngWaterPumpUsageRecords) + { + return toAjax(ngWaterPumpUsageRecordsService.insertNgWaterPumpUsageRecords(ngWaterPumpUsageRecords)); + } + + /** + * 修改水泵设备使用记录 + */ + @PreAuthorize("@ss.hasPermi('rechargecard:records:edit')") + @PutMapping + @ApiOperation("修改水泵设备使用记录") + public AjaxResult edit(@RequestBody NgWaterPumpUsageRecords ngWaterPumpUsageRecords) + { + return toAjax(ngWaterPumpUsageRecordsService.updateNgWaterPumpUsageRecords(ngWaterPumpUsageRecords)); + } + + /** + * 删除水泵设备使用记录 + */ + @PreAuthorize("@ss.hasPermi('rechargecard:records:remove')") + @DeleteMapping("/{ids}") + @ApiOperation("删除水泵设备使用记录") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(ngWaterPumpUsageRecordsService.deleteNgWaterPumpUsageRecordsByIds(ids)); + } +} diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaGuangaiRecordController.java b/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaGuangaiRecordController.java index 28402bd..7b2fe0b 100644 --- a/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaGuangaiRecordController.java +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaGuangaiRecordController.java @@ -41,7 +41,7 @@ public class MaGuangaiRecordController extends BaseController /** * 查询灌溉记录列表 */ -@PreAuthorize("@ss.hasPermi('waterele:guangaiRecord:list')") +//@PreAuthorize("@ss.hasPermi('waterele:guangaiRecord:list')") @GetMapping("/list") @ApiOperation("查询灌溉记录列表") public TableDataInfo list(MaGuangaiRecord maGuangaiRecord) diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgWaterPumpUsageRecords.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgWaterPumpUsageRecords.java new file mode 100644 index 0000000..0e1cde6 --- /dev/null +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/domain/NgWaterPumpUsageRecords.java @@ -0,0 +1,50 @@ +package com.fastbee.rechargecard.domain; + +import java.io.Serializable; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.fastbee.common.annotation.Excel; +import com.fastbee.common.core.domain.BaseEntity; + +/** + * 水泵设备使用记录对象 ng_water_pump_usage_records + * + * @author kerwincui + * @date 2024-12-19 + */ +@ApiModel(value = "NgWaterPumpUsageRecords",description = "水泵设备使用记录 ng_water_pump_usage_records") +@Data +public class NgWaterPumpUsageRecords implements Serializable { +private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 开泵时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "开泵时间", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty("开泵时间") + private Date pumpStartTime; + + /** 关泵时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "关泵时间", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty("关泵时间") + private Date pumpStopTime; + + /** 设备编号 */ + @Excel(name = "设备编号") + @ApiModelProperty("设备编号") + private String deviceNumber; + + /** 报文内容 */ + @Excel(name = "报文内容") + @ApiModelProperty("报文内容") + private String messageContent; + +} diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/mapper/NgWaterPumpUsageRecordsMapper.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/mapper/NgWaterPumpUsageRecordsMapper.java new file mode 100644 index 0000000..8a801d7 --- /dev/null +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/mapper/NgWaterPumpUsageRecordsMapper.java @@ -0,0 +1,63 @@ +package com.fastbee.rechargecard.mapper; + +import java.util.List; +import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords; +import org.apache.ibatis.annotations.Mapper; + +/** + * 水泵设备使用记录Mapper接口 + * + * @author kerwincui + * @date 2024-12-19 + */ +@Mapper +public interface NgWaterPumpUsageRecordsMapper +{ + /** + * 查询水泵设备使用记录 + * + * @param id 水泵设备使用记录主键 + * @return 水泵设备使用记录 + */ + public NgWaterPumpUsageRecords selectNgWaterPumpUsageRecordsById(Long id); + + /** + * 查询水泵设备使用记录列表 + * + * @param ngWaterPumpUsageRecords 水泵设备使用记录 + * @return 水泵设备使用记录集合 + */ + public List selectNgWaterPumpUsageRecordsList(NgWaterPumpUsageRecords ngWaterPumpUsageRecords); + + /** + * 新增水泵设备使用记录 + * + * @param ngWaterPumpUsageRecords 水泵设备使用记录 + * @return 结果 + */ + public int insertNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords); + + /** + * 修改水泵设备使用记录 + * + * @param ngWaterPumpUsageRecords 水泵设备使用记录 + * @return 结果 + */ + public int updateNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords); + + /** + * 删除水泵设备使用记录 + * + * @param id 水泵设备使用记录主键 + * @return 结果 + */ + public int deleteNgWaterPumpUsageRecordsById(Long id); + + /** + * 批量删除水泵设备使用记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteNgWaterPumpUsageRecordsByIds(Long[] ids); +} diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/INgWaterPumpUsageRecordsService.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/INgWaterPumpUsageRecordsService.java new file mode 100644 index 0000000..b9ec2a7 --- /dev/null +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/INgWaterPumpUsageRecordsService.java @@ -0,0 +1,61 @@ +package com.fastbee.rechargecard.service; + +import java.util.List; +import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords; + +/** + * 水泵设备使用记录Service接口 + * + * @author kerwincui + * @date 2024-12-19 + */ +public interface INgWaterPumpUsageRecordsService +{ + /** + * 查询水泵设备使用记录 + * + * @param id 水泵设备使用记录主键 + * @return 水泵设备使用记录 + */ + public NgWaterPumpUsageRecords selectNgWaterPumpUsageRecordsById(Long id); + + /** + * 查询水泵设备使用记录列表 + * + * @param ngWaterPumpUsageRecords 水泵设备使用记录 + * @return 水泵设备使用记录集合 + */ + public List selectNgWaterPumpUsageRecordsList(NgWaterPumpUsageRecords ngWaterPumpUsageRecords); + + /** + * 新增水泵设备使用记录 + * + * @param ngWaterPumpUsageRecords 水泵设备使用记录 + * @return 结果 + */ + public int insertNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords); + + /** + * 修改水泵设备使用记录 + * + * @param ngWaterPumpUsageRecords 水泵设备使用记录 + * @return 结果 + */ + public int updateNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords); + + /** + * 批量删除水泵设备使用记录 + * + * @param ids 需要删除的水泵设备使用记录主键集合 + * @return 结果 + */ + public int deleteNgWaterPumpUsageRecordsByIds(Long[] ids); + + /** + * 删除水泵设备使用记录信息 + * + * @param id 水泵设备使用记录主键 + * @return 结果 + */ + public int deleteNgWaterPumpUsageRecordsById(Long id); +} diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/impl/NgWaterPumpUsageRecordsServiceImpl.java b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/impl/NgWaterPumpUsageRecordsServiceImpl.java new file mode 100644 index 0000000..6e5e2f8 --- /dev/null +++ b/fastbee-service/fastbee-rechargecard-service/src/main/java/com/fastbee/rechargecard/service/impl/NgWaterPumpUsageRecordsServiceImpl.java @@ -0,0 +1,93 @@ +package com.fastbee.rechargecard.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.fastbee.rechargecard.mapper.NgWaterPumpUsageRecordsMapper; +import com.fastbee.rechargecard.domain.NgWaterPumpUsageRecords; +import com.fastbee.rechargecard.service.INgWaterPumpUsageRecordsService; + +/** + * 水泵设备使用记录Service业务层处理 + * + * @author kerwincui + * @date 2024-12-19 + */ +@Service +public class NgWaterPumpUsageRecordsServiceImpl implements INgWaterPumpUsageRecordsService +{ + @Autowired + private NgWaterPumpUsageRecordsMapper ngWaterPumpUsageRecordsMapper; + + /** + * 查询水泵设备使用记录 + * + * @param id 水泵设备使用记录主键 + * @return 水泵设备使用记录 + */ + @Override + public NgWaterPumpUsageRecords selectNgWaterPumpUsageRecordsById(Long id) + { + return ngWaterPumpUsageRecordsMapper.selectNgWaterPumpUsageRecordsById(id); + } + + /** + * 查询水泵设备使用记录列表 + * + * @param ngWaterPumpUsageRecords 水泵设备使用记录 + * @return 水泵设备使用记录 + */ + @Override + public List selectNgWaterPumpUsageRecordsList(NgWaterPumpUsageRecords ngWaterPumpUsageRecords) + { + return ngWaterPumpUsageRecordsMapper.selectNgWaterPumpUsageRecordsList(ngWaterPumpUsageRecords); + } + + /** + * 新增水泵设备使用记录 + * + * @param ngWaterPumpUsageRecords 水泵设备使用记录 + * @return 结果 + */ + @Override + public int insertNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords) + { + return ngWaterPumpUsageRecordsMapper.insertNgWaterPumpUsageRecords(ngWaterPumpUsageRecords); + } + + /** + * 修改水泵设备使用记录 + * + * @param ngWaterPumpUsageRecords 水泵设备使用记录 + * @return 结果 + */ + @Override + public int updateNgWaterPumpUsageRecords(NgWaterPumpUsageRecords ngWaterPumpUsageRecords) + { + return ngWaterPumpUsageRecordsMapper.updateNgWaterPumpUsageRecords(ngWaterPumpUsageRecords); + } + + /** + * 批量删除水泵设备使用记录 + * + * @param ids 需要删除的水泵设备使用记录主键 + * @return 结果 + */ + @Override + public int deleteNgWaterPumpUsageRecordsByIds(Long[] ids) + { + return ngWaterPumpUsageRecordsMapper.deleteNgWaterPumpUsageRecordsByIds(ids); + } + + /** + * 删除水泵设备使用记录信息 + * + * @param id 水泵设备使用记录主键 + * @return 结果 + */ + @Override + public int deleteNgWaterPumpUsageRecordsById(Long id) + { + return ngWaterPumpUsageRecordsMapper.deleteNgWaterPumpUsageRecordsById(id); + } +} diff --git a/fastbee-service/fastbee-rechargecard-service/src/main/resources/mapper/rechargecard/NgWaterPumpUsageRecordsMapper.xml b/fastbee-service/fastbee-rechargecard-service/src/main/resources/mapper/rechargecard/NgWaterPumpUsageRecordsMapper.xml new file mode 100644 index 0000000..3610271 --- /dev/null +++ b/fastbee-service/fastbee-rechargecard-service/src/main/resources/mapper/rechargecard/NgWaterPumpUsageRecordsMapper.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + select id, pump_start_time, pump_stop_time, device_number, message_content from ng_water_pump_usage_records + + + + + + + + insert into ng_water_pump_usage_records + + pump_start_time, + pump_stop_time, + device_number, + message_content, + + + #{pumpStartTime}, + #{pumpStopTime}, + #{deviceNumber}, + #{messageContent}, + + + + + update ng_water_pump_usage_records + + pump_start_time = #{pumpStartTime}, + pump_stop_time = #{pumpStopTime}, + device_number = #{deviceNumber}, + message_content = #{messageContent}, + + where id = #{id} + + + + delete from ng_water_pump_usage_records where id = #{id} + + + + delete from ng_water_pump_usage_records where id in + + #{id} + + + \ No newline at end of file