diff --git a/fastbee-open-api/pom.xml b/fastbee-open-api/pom.xml index dcead11..d06b295 100644 --- a/fastbee-open-api/pom.xml +++ b/fastbee-open-api/pom.xml @@ -34,6 +34,14 @@ fastbee-ruleEngine 3.8.5 + + com.fastbee + fastbee-xunjian-service + + + com.fastbee + fastbee-waterele-service + diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaCardinfoController.java b/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaCardinfoController.java new file mode 100644 index 0000000..f5ab845 --- /dev/null +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaCardinfoController.java @@ -0,0 +1,110 @@ +package com.fastbee.data.controller.waterele; + +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.waterele.domain.MaCardinfo; +import com.fastbee.waterele.service.IMaCardinfoService; +import com.fastbee.common.utils.poi.ExcelUtil; +import com.fastbee.common.core.page.TableDataInfo; + +/** + * 卡记录Controller + * + * @author kerwincui + * @date 2024-08-12 + */ +@RestController +@RequestMapping("/waterele/cardinfo") +@Api(tags = "卡记录") +public class MaCardinfoController extends BaseController +{ + @Autowired + private IMaCardinfoService maCardinfoService; + +/** + * 查询卡记录列表 + */ +@PreAuthorize("@ss.hasPermi('waterele:cardinfo:list')") +@GetMapping("/list") +@ApiOperation("查询卡记录列表") + public TableDataInfo list(MaCardinfo maCardinfo) + { + startPage(); + List list = maCardinfoService.selectMaCardinfoList(maCardinfo); + return getDataTable(list); + } + + /** + * 导出卡记录列表 + */ + @ApiOperation("导出卡记录列表") + @PreAuthorize("@ss.hasPermi('waterele:cardinfo:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, MaCardinfo maCardinfo) + { + List list = maCardinfoService.selectMaCardinfoList(maCardinfo); + ExcelUtil util = new ExcelUtil(MaCardinfo.class); + util.exportExcel(response, list, "卡记录数据"); + } + + /** + * 获取卡记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('waterele:cardinfo:query')") + @GetMapping(value = "/{id}") + @ApiOperation("获取卡记录详细信息") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(maCardinfoService.selectMaCardinfoById(id)); + } + + /** + * 新增卡记录 + */ + @PreAuthorize("@ss.hasPermi('waterele:cardinfo:add')") + @PostMapping + @ApiOperation("新增卡记录") + public AjaxResult add(@RequestBody MaCardinfo maCardinfo) + { + return toAjax(maCardinfoService.insertMaCardinfo(maCardinfo)); + } + + /** + * 修改卡记录 + */ + @PreAuthorize("@ss.hasPermi('waterele:cardinfo:edit')") + @PutMapping + @ApiOperation("修改卡记录") + public AjaxResult edit(@RequestBody MaCardinfo maCardinfo) + { + return toAjax(maCardinfoService.updateMaCardinfo(maCardinfo)); + } + + /** + * 删除卡记录 + */ + @PreAuthorize("@ss.hasPermi('waterele:cardinfo:remove')") + @DeleteMapping("/{ids}") + @ApiOperation("删除卡记录") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(maCardinfoService.deleteMaCardinfoByIds(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 new file mode 100644 index 0000000..2721716 --- /dev/null +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaGuangaiRecordController.java @@ -0,0 +1,111 @@ +package com.fastbee.data.controller.waterele; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.fastbee.waterele.domain.MaGuangaiRecord; +import com.fastbee.waterele.service.IMaGuangaiRecordService; +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.common.utils.poi.ExcelUtil; +import com.fastbee.common.core.page.TableDataInfo; + +/** + * 灌溉记录Controller + * + * @author kerwincui + * @date 2024-08-12 + */ +@RestController +@RequestMapping("/waterele/guangaiRecord") +@Api(tags = "灌溉记录") +public class MaGuangaiRecordController extends BaseController +{ + @Autowired + private IMaGuangaiRecordService maGuangaiRecordService; + +/** + * 查询灌溉记录列表 + */ +@PreAuthorize("@ss.hasPermi('waterele:guangaiRecord:list')") +@GetMapping("/list") +@ApiOperation("查询灌溉记录列表") + public TableDataInfo list(MaGuangaiRecord maGuangaiRecord) + { + startPage(); + List list + = maGuangaiRecordService.selectMaGuangaiRecordList(maGuangaiRecord); + return getDataTable(list); + } + + /** + * 导出灌溉记录列表 + */ + @ApiOperation("导出灌溉记录列表") + @PreAuthorize("@ss.hasPermi('waterele:guangaiRecord:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, MaGuangaiRecord maGuangaiRecord) + { + List list = maGuangaiRecordService.selectMaGuangaiRecordList(maGuangaiRecord); + ExcelUtil util = new ExcelUtil(MaGuangaiRecord.class); + util.exportExcel(response, list, "灌溉记录数据"); + } + + /** + * 获取灌溉记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('waterele:guangaiRecord:query')") + @GetMapping(value = "/{id}") + @ApiOperation("获取灌溉记录详细信息") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(maGuangaiRecordService.selectMaGuangaiRecordById(id)); + } + + /** + * 新增灌溉记录 + */ + @PreAuthorize("@ss.hasPermi('waterele:guangaiRecord:add')") + @PostMapping + @ApiOperation("新增灌溉记录") + public AjaxResult add(@RequestBody MaGuangaiRecord maGuangaiRecord) + { + return toAjax(maGuangaiRecordService.insertMaGuangaiRecord(maGuangaiRecord)); + } + + /** + * 修改灌溉记录 + */ + @PreAuthorize("@ss.hasPermi('waterele:guangaiRecord:edit')") + @PutMapping + @ApiOperation("修改灌溉记录") + public AjaxResult edit(@RequestBody MaGuangaiRecord maGuangaiRecord) + { + return toAjax(maGuangaiRecordService.updateMaGuangaiRecord(maGuangaiRecord)); + } + + /** + * 删除灌溉记录 + */ + @PreAuthorize("@ss.hasPermi('waterele:guangaiRecord:remove')") + @DeleteMapping("/{ids}") + @ApiOperation("删除灌溉记录") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(maGuangaiRecordService.deleteMaGuangaiRecordByIds(ids)); + } +} diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaRechargerecordController.java b/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaRechargerecordController.java new file mode 100644 index 0000000..a83be33 --- /dev/null +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaRechargerecordController.java @@ -0,0 +1,110 @@ +package com.fastbee.data.controller.waterele; + +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.waterele.domain.MaRechargerecord; +import com.fastbee.waterele.service.IMaRechargerecordService; +import com.fastbee.common.utils.poi.ExcelUtil; +import com.fastbee.common.core.page.TableDataInfo; + +/** + * 充值记录Controller + * + * @author kerwincui + * @date 2024-08-12 + */ +@RestController +@RequestMapping("/waterele/rechargerecord") +@Api(tags = "充值记录") +public class MaRechargerecordController extends BaseController +{ + @Autowired + private IMaRechargerecordService maRechargerecordService; + +/** + * 查询充值记录列表 + */ +@PreAuthorize("@ss.hasPermi('waterele:rechargerecord:list')") +@GetMapping("/list") +@ApiOperation("查询充值记录列表") + public TableDataInfo list(MaRechargerecord maRechargerecord) + { + startPage(); + List list = maRechargerecordService.selectMaRechargerecordList(maRechargerecord); + return getDataTable(list); + } + + /** + * 导出充值记录列表 + */ + @ApiOperation("导出充值记录列表") + @PreAuthorize("@ss.hasPermi('waterele:rechargerecord:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, MaRechargerecord maRechargerecord) + { + List list = maRechargerecordService.selectMaRechargerecordList(maRechargerecord); + ExcelUtil util = new ExcelUtil(MaRechargerecord.class); + util.exportExcel(response, list, "充值记录数据"); + } + + /** + * 获取充值记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('waterele:rechargerecord:query')") + @GetMapping(value = "/{id}") + @ApiOperation("获取充值记录详细信息") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(maRechargerecordService.selectMaRechargerecordById(id)); + } + + /** + * 新增充值记录 + */ + @PreAuthorize("@ss.hasPermi('waterele:rechargerecord:add')") + @PostMapping + @ApiOperation("新增充值记录") + public AjaxResult add(@RequestBody MaRechargerecord maRechargerecord) + { + return toAjax(maRechargerecordService.insertMaRechargerecord(maRechargerecord)); + } + + /** + * 修改充值记录 + */ + @PreAuthorize("@ss.hasPermi('waterele:rechargerecord:edit')") + @PutMapping + @ApiOperation("修改充值记录") + public AjaxResult edit(@RequestBody MaRechargerecord maRechargerecord) + { + return toAjax(maRechargerecordService.updateMaRechargerecord(maRechargerecord)); + } + + /** + * 删除充值记录 + */ + @PreAuthorize("@ss.hasPermi('waterele:rechargerecord:remove')") + @DeleteMapping("/{ids}") + @ApiOperation("删除充值记录") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(maRechargerecordService.deleteMaRechargerecordByIds(ids)); + } +} diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaWatereleRecordController.java b/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaWatereleRecordController.java new file mode 100644 index 0000000..bcf8a61 --- /dev/null +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/waterele/MaWatereleRecordController.java @@ -0,0 +1,110 @@ +package com.fastbee.data.controller.waterele; + +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.waterele.domain.MaWatereleRecord; +import com.fastbee.waterele.service.IMaWatereleRecordService; +import com.fastbee.common.utils.poi.ExcelUtil; +import com.fastbee.common.core.page.TableDataInfo; + +/** + * 水电双计数据记录Controller + * + * @author kerwincui + * @date 2024-08-12 + */ +@RestController +@RequestMapping("/waterele/watereleRecord") +@Api(tags = "水电双计数据记录") +public class MaWatereleRecordController extends BaseController +{ + @Autowired + private IMaWatereleRecordService maWatereleRecordService; + +/** + * 查询水电双计数据记录列表 + */ +@PreAuthorize("@ss.hasPermi('waterele:watereleRecord:list')") +@GetMapping("/list") +@ApiOperation("查询水电双计数据记录列表") + public TableDataInfo list(MaWatereleRecord maWatereleRecord) + { + startPage(); + List list = maWatereleRecordService.selectMaWatereleRecordList(maWatereleRecord); + return getDataTable(list); + } + + /** + * 导出水电双计数据记录列表 + */ + @ApiOperation("导出水电双计数据记录列表") + @PreAuthorize("@ss.hasPermi('waterele:watereleRecord:export')") + @PostMapping("/export") + public void export(HttpServletResponse response, MaWatereleRecord maWatereleRecord) + { + List list = maWatereleRecordService.selectMaWatereleRecordList(maWatereleRecord); + ExcelUtil util = new ExcelUtil(MaWatereleRecord.class); + util.exportExcel(response, list, "水电双计数据记录数据"); + } + + /** + * 获取水电双计数据记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('waterele:watereleRecord:query')") + @GetMapping(value = "/{id}") + @ApiOperation("获取水电双计数据记录详细信息") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(maWatereleRecordService.selectMaWatereleRecordById(id)); + } + + /** + * 新增水电双计数据记录 + */ + @PreAuthorize("@ss.hasPermi('waterele:watereleRecord:add')") + @PostMapping + @ApiOperation("新增水电双计数据记录") + public AjaxResult add(@RequestBody MaWatereleRecord maWatereleRecord) + { + return toAjax(maWatereleRecordService.insertMaWatereleRecord(maWatereleRecord)); + } + + /** + * 修改水电双计数据记录 + */ + @PreAuthorize("@ss.hasPermi('waterele:watereleRecord:edit')") + @PutMapping + @ApiOperation("修改水电双计数据记录") + public AjaxResult edit(@RequestBody MaWatereleRecord maWatereleRecord) + { + return toAjax(maWatereleRecordService.updateMaWatereleRecord(maWatereleRecord)); + } + + /** + * 删除水电双计数据记录 + */ + @PreAuthorize("@ss.hasPermi('waterele:watereleRecord:remove')") + @DeleteMapping("/{ids}") + @ApiOperation("删除水电双计数据记录") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(maWatereleRecordService.deleteMaWatereleRecordByIds(ids)); + } +} diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/controller/xunjian/XjInspectionNoteController.java b/fastbee-open-api/src/main/java/com/fastbee/data/controller/xunjian/XjInspectionNoteController.java new file mode 100644 index 0000000..23c5443 --- /dev/null +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/xunjian/XjInspectionNoteController.java @@ -0,0 +1,91 @@ +package com.fastbee.data.controller.xunjian; + +import com.fastbee.common.annotation.Log; +import com.fastbee.common.core.controller.BaseController; +import com.fastbee.common.core.domain.AjaxResult; +import com.fastbee.common.core.page.TableDataInfo; +import com.fastbee.common.enums.BusinessType; +import com.fastbee.common.utils.poi.ExcelUtil; +import com.fastbee.xunjian.domain.XjInspectionNote; +import com.fastbee.xunjian.service.IXjInspectionNoteService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 巡检注意事项Controller + * + * @author kenlixunjian + * @date 2023-08-23 + */ +@RestController +@RequestMapping("/inspection/note") +public class XjInspectionNoteController extends BaseController { + @Autowired + private IXjInspectionNoteService klxjInspectionNoteService; + + /** + * 查询巡检注意事项列表 + */ + @PreAuthorize("@ss.hasPermi('inspection:note:list')") + @GetMapping("/list") + public TableDataInfo list(XjInspectionNote klxjInspectionNote) { + startPage(); + List list = klxjInspectionNoteService.selectXjInspectionNoteList(klxjInspectionNote); + return getDataTable(list); + } + + /** + * 导出巡检注意事项列表 + */ + @PreAuthorize("@ss.hasPermi('inspection:note:export')") + @Log(title = "巡检注意事项", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, XjInspectionNote klxjInspectionNote) { + List list = klxjInspectionNoteService.selectXjInspectionNoteList(klxjInspectionNote); + ExcelUtil util = new ExcelUtil(XjInspectionNote.class); + util.exportExcel(response, list, "巡检注意事项数据"); + } + + /** + * 获取巡检注意事项详细信息 + */ + @PreAuthorize("@ss.hasPermi('inspection:note:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(klxjInspectionNoteService.selectXjInspectionNoteById(id)); + } + + /** + * 新增巡检注意事项 + */ + @PreAuthorize("@ss.hasPermi('inspection:note:add')") + @Log(title = "巡检注意事项", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody XjInspectionNote klxjInspectionNote) { + return toAjax(klxjInspectionNoteService.insertXjInspectionNote(klxjInspectionNote)); + } + + /** + * 修改巡检注意事项 + */ + @PreAuthorize("@ss.hasPermi('inspection:note:edit')") + @Log(title = "巡检注意事项", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody XjInspectionNote klxjInspectionNote) { + return toAjax(klxjInspectionNoteService.updateXjInspectionNote(klxjInspectionNote)); + } + + /** + * 删除巡检注意事项 + */ + @PreAuthorize("@ss.hasPermi('inspection:note:remove')") + @Log(title = "巡检注意事项", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(klxjInspectionNoteService.deleteXjInspectionNoteByIds(ids)); + } +} diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/controller/xunjian/XjInspectionRecordsController.java b/fastbee-open-api/src/main/java/com/fastbee/data/controller/xunjian/XjInspectionRecordsController.java new file mode 100644 index 0000000..7cf6712 --- /dev/null +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/xunjian/XjInspectionRecordsController.java @@ -0,0 +1,99 @@ +package com.fastbee.data.controller.xunjian; + +import com.fastbee.common.annotation.Log; +import com.fastbee.common.core.controller.BaseController; +import com.fastbee.common.core.domain.AjaxResult; +import com.fastbee.common.core.page.TableDataInfo; +import com.fastbee.common.enums.BusinessType; +import com.fastbee.common.utils.poi.ExcelUtil; +import com.fastbee.xunjian.domain.XjInspectionRecords; +import com.fastbee.xunjian.service.IXjInspectionRecordsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 记录Controller + * + * @author kenlixunjian + * @date 2023-08-04 + */ +@RestController +@RequestMapping("/inspection/records") +public class XjInspectionRecordsController extends BaseController +{ + @Autowired + private IXjInspectionRecordsService klxjInspectionRecordsService; + + /** + * 查询记录列表 + */ + @PreAuthorize("@ss.hasPermi('inspection:records:list')") + @GetMapping("/list") + public TableDataInfo list(XjInspectionRecords klxjInspectionRecords) + { + startPage(); + List list = klxjInspectionRecordsService.selectXjInspectionRecordsList(klxjInspectionRecords); + return getDataTable(list); + } + + + /** + * 导出记录列表 + */ + @PreAuthorize("@ss.hasPermi('inspection:records:export')") + @Log(title = "记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, XjInspectionRecords klxjInspectionRecords) + { + List list = klxjInspectionRecordsService.selectXjInspectionRecordsList(klxjInspectionRecords); + ExcelUtil util = new ExcelUtil(XjInspectionRecords.class); + util.exportExcel(response, list, "记录数据"); + } + + /** + * 获取记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('inspection:records:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(klxjInspectionRecordsService.selectXjInspectionRecordsById(id)); + } + + /** + * 新增记录 + */ + @PreAuthorize("@ss.hasPermi('inspection:records:add')") + @Log(title = "记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody XjInspectionRecords klxjInspectionRecords) + { + return toAjax(klxjInspectionRecordsService.insertXjInspectionRecords(klxjInspectionRecords)); + } + + /** + * 修改记录 + */ + @PreAuthorize("@ss.hasPermi('inspection:records:edit')") + @Log(title = "记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody XjInspectionRecords klxjInspectionRecords) + { + return toAjax(klxjInspectionRecordsService.updateXjInspectionRecords(klxjInspectionRecords)); + } + + /** + * 删除记录 + */ + @PreAuthorize("@ss.hasPermi('inspection:records:remove')") + @Log(title = "记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(klxjInspectionRecordsService.deleteXjInspectionRecordsByIds(ids)); + } +} diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/controller/xunjian/XjInspectionRoutesController.java b/fastbee-open-api/src/main/java/com/fastbee/data/controller/xunjian/XjInspectionRoutesController.java new file mode 100644 index 0000000..1038dcc --- /dev/null +++ b/fastbee-open-api/src/main/java/com/fastbee/data/controller/xunjian/XjInspectionRoutesController.java @@ -0,0 +1,117 @@ +package com.fastbee.data.controller.xunjian; + +import com.fastbee.common.annotation.Log; +import com.fastbee.common.core.controller.BaseController; +import com.fastbee.common.core.domain.AjaxResult; +import com.fastbee.common.core.page.TableDataInfo; +import com.fastbee.common.enums.BusinessType; +import com.fastbee.common.utils.poi.ExcelUtil; +import com.fastbee.xunjian.domain.XjInspectionRoutes; +import com.fastbee.xunjian.service.IXjInspectionRoutesService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 巡检路线Controller + * + * @author kenlixunjian + * @date 2023-08-04 + */ +@RestController +@RequestMapping("/inspection/routes") +public class XjInspectionRoutesController extends BaseController +{ + @Autowired + private IXjInspectionRoutesService klxjInspectionRoutesService; + + /** + * 查询巡检路线列表 + */ + @PreAuthorize("@ss.hasPermi('inspection:routes:list')") + @GetMapping("/list") + public TableDataInfo list(XjInspectionRoutes klxjInspectionRoutes) + { + startPage(); + List list = klxjInspectionRoutesService.selectXjInspectionRoutesList(klxjInspectionRoutes); + return getDataTable(list); + } + + /** + * 导出巡检路线列表 + */ + @PreAuthorize("@ss.hasPermi('inspection:routes:export')") + @Log(title = "巡检路线", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, XjInspectionRoutes klxjInspectionRoutes) { + List list = klxjInspectionRoutesService.selectXjInspectionRoutesList(klxjInspectionRoutes); + ExcelUtil util = new ExcelUtil(XjInspectionRoutes.class); + util.exportExcel(response, list, "巡检路线数据"); + } + + + + + /** + * 获取巡检路线详细信息 + */ + @PreAuthorize("@ss.hasPermi('inspection:routes:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(klxjInspectionRoutesService.selectXjInspectionRoutesById(id)); + } + + + @Log(title = "用户管理", businessType = BusinessType.IMPORT) + @PreAuthorize("@ss.hasPermi('inspection:routes:import')") + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { + ExcelUtil util = new ExcelUtil(XjInspectionRoutes.class); + List userList = util.importExcel(file.getInputStream()); + String operName = getUsername(); + String message = klxjInspectionRoutesService.importData(userList, updateSupport, operName); + return success(message); + } + + @PostMapping("/importTemplate") + public void importTemplate(HttpServletResponse response) { + ExcelUtil util = new ExcelUtil(XjInspectionRoutes.class); + util.importTemplateExcel(response, "巡检对象数据"); + } + + /** + * 新增巡检路线 + */ + @PreAuthorize("@ss.hasPermi('inspection:routes:add')") + @Log(title = "巡检路线", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody XjInspectionRoutes klxjInspectionRoutes) { + return toAjax(klxjInspectionRoutesService.insertXjInspectionRoutes(klxjInspectionRoutes)); + } + + /** + * 修改巡检路线 + */ + @PreAuthorize("@ss.hasPermi('inspection:routes:edit')") + @Log(title = "巡检路线", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody XjInspectionRoutes klxjInspectionRoutes) + { + return toAjax(klxjInspectionRoutesService.updateXjInspectionRoutes(klxjInspectionRoutes)); + } + + /** + * 删除巡检路线 + */ + @PreAuthorize("@ss.hasPermi('inspection:routes:remove')") + @Log(title = "巡检路线", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(klxjInspectionRoutesService.deleteXjInspectionRoutesByIds(ids)); + } +} diff --git a/fastbee-service/fastbee-waterele-service/pom.xml b/fastbee-service/fastbee-waterele-service/pom.xml new file mode 100644 index 0000000..798380a --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/pom.xml @@ -0,0 +1,28 @@ + + + + fastbee-service + com.fastbee + 3.8.5 + + 4.0.0 + + fastbee-waterele-service + + + 水电双计系统模块 + + + + + + + com.fastbee + fastbee-common + + + + + \ No newline at end of file diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/domain/MaCardinfo.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/domain/MaCardinfo.java new file mode 100644 index 0000000..fecc503 --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/domain/MaCardinfo.java @@ -0,0 +1,58 @@ +package com.fastbee.waterele.domain; + +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; + +/** + * 卡记录对象 ma_cardinfo + * + * @author kerwincui + * @date 2024-08-12 + */ +@ApiModel(value = "MaCardinfo",description = "卡记录 ma_cardinfo") +@Data +@EqualsAndHashCode(callSuper = true) +public class MaCardinfo extends BaseEntity + { +private static final long serialVersionUID = 1L; + + /** 序号 */ + private Long id; + + /** 卡编号 */ + @Excel(name = "卡编号") + @ApiModelProperty("卡编号") + private String cardNum; + + /** 区域号 */ + @Excel(name = "区域号") + @ApiModelProperty("区域号") + private String areaCode; + + /** 卡ID */ + @Excel(name = "卡ID") + @ApiModelProperty("卡ID") + private String cardId; + + /** 地址信息 */ + @Excel(name = "地址信息") + @ApiModelProperty("地址信息") + private String addressInfo; + + /** 卡类型 */ + @Excel(name = "卡类型") + @ApiModelProperty("卡类型") + private Integer cardtype; + + /** mcuSn */ + @Excel(name = "mcuSn") + @ApiModelProperty("mcuSn") + private String mcusn; + +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/domain/MaGuangaiRecord.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/domain/MaGuangaiRecord.java new file mode 100644 index 0000000..798f307 --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/domain/MaGuangaiRecord.java @@ -0,0 +1,76 @@ +package com.fastbee.waterele.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.fastbee.common.annotation.Excel; +import com.fastbee.common.core.domain.BaseEntity; + +/** + * 灌溉记录对象 ma_guangai_record + * + * @author kerwincui + * @date 2024-08-12 + */ +@ApiModel(value = "MaGuangaiRecord",description = "灌溉记录 ma_guangai_record") +@Data +@EqualsAndHashCode(callSuper = true) +public class MaGuangaiRecord extends BaseEntity + { +private static final long serialVersionUID = 1L; + + /** 序号 */ + private Long id; + + /** 设备编号 */ + @Excel(name = "设备编号") + @ApiModelProperty("设备编号") + private String devSn; + + /** 开泵时间 */ + @Excel(name = "开泵时间") + @ApiModelProperty("开泵时间") + private Long startTime; + + /** 关泵时间 */ + @Excel(name = "关泵时间") + @ApiModelProperty("关泵时间") + private Long endTime; + + /** 灌溉最新上报时间 */ + @Excel(name = "灌溉最新上报时间") + @ApiModelProperty("灌溉最新上报时间") + private Long lastTime; + + /** 卡编号 */ + @Excel(name = "卡编号") + @ApiModelProperty("卡编号") + private String cardId; + + /** 区域号 */ + @Excel(name = "区域号") + @ApiModelProperty("区域号") + private String areaCode; + + /** 卡内余额 */ + @Excel(name = "卡内余额") + @ApiModelProperty("卡内余额") + private String userBalance; + + /** 本次用水量 */ + @Excel(name = "本次用水量") + @ApiModelProperty("本次用水量") + private String curFlow; + + /** 本次用电量 */ + @Excel(name = "本次用电量") + @ApiModelProperty("本次用电量") + private String curEle; + + /** 灌溉状态 */ + @Excel(name = "灌溉状态") + @ApiModelProperty("灌溉状态") + private Integer status; + +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/domain/MaRechargerecord.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/domain/MaRechargerecord.java new file mode 100644 index 0000000..aa62def --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/domain/MaRechargerecord.java @@ -0,0 +1,58 @@ +package com.fastbee.waterele.domain; + +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; + +/** + * 充值记录对象 ma_rechargerecord + * + * @author kerwincui + * @date 2024-08-12 + */ +@ApiModel(value = "MaRechargerecord",description = "充值记录 ma_rechargerecord") +@Data +@EqualsAndHashCode(callSuper = true) +public class MaRechargerecord extends BaseEntity + { +private static final long serialVersionUID = 1L; + + /** 序号 */ + private Long id; + + /** 余额 */ + @Excel(name = "余额") + @ApiModelProperty("余额") + private String balance; + + /** 充值金额 */ + @Excel(name = "充值金额") + @ApiModelProperty("充值金额") + private String investval; + + /** 卡编号 */ + @Excel(name = "卡编号") + @ApiModelProperty("卡编号") + private String cardNum; + + /** 区域号 */ + @Excel(name = "区域号") + @ApiModelProperty("区域号") + private String areaCode; + + /** 卡ID */ + @Excel(name = "卡ID") + @ApiModelProperty("卡ID") + private String cardId; + + /** mcuSn */ + @Excel(name = "mcuSn") + @ApiModelProperty("mcuSn") + private String mcusn; + +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/domain/MaWatereleRecord.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/domain/MaWatereleRecord.java new file mode 100644 index 0000000..9847879 --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/domain/MaWatereleRecord.java @@ -0,0 +1,113 @@ +package com.fastbee.waterele.domain; + +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; + +/** + * 水电双计数据记录对象 ma_waterele_record + * + * @author kerwincui + * @date 2024-08-12 + */ +@ApiModel(value = "MaWatereleRecord",description = "水电双计数据记录 ma_waterele_record") +@Data +@EqualsAndHashCode(callSuper = true) +public class MaWatereleRecord extends BaseEntity + { +private static final long serialVersionUID = 1L; + + /** 序号 */ + private Long id; + + /** 设备编号 */ + @Excel(name = "设备编号") + @ApiModelProperty("设备编号") + private String devSn; + + /** 工作状态:0=关泵,1=开泵 */ + @Excel(name = "工作状态:0=关泵,1=开泵") + @ApiModelProperty("工作状态:0=关泵,1=开泵") + private Integer workstate; + + /** 本次用水量(m³) */ + @Excel(name = "本次用水量(m³)") + @ApiModelProperty("本次用水量(m³)") + private String usersumflow; + + /** 本次用电量(度) */ + @Excel(name = "本次用电量(度)") + @ApiModelProperty("本次用电量(度)") + private String usersumele; + + /** 用户余额(元) */ + @Excel(name = "用户余额(元)") + @ApiModelProperty("用户余额(元)") + private String userbalance; + + /** 累计用水量(m³) */ + @Excel(name = "累计用水量(m³)") + @ApiModelProperty("累计用水量(m³)") + private String sumflow; + + /** 累计用电量(度) */ + @Excel(name = "累计用电量(度)") + @ApiModelProperty("累计用电量(度)") + private String sumele; + + /** 单片机编号 */ + @Excel(name = "单片机编号") + @ApiModelProperty("单片机编号") + private String mcusn; + + /** 瞬时电量 */ + @Excel(name = "瞬时电量") + @ApiModelProperty("瞬时电量") + private String inspower; + + /** 瞬时流量(m³/s) */ + @Excel(name = "瞬时流量(m³/s)") + @ApiModelProperty("瞬时流量(m³/s)") + private String insflow; + + /** 当前累计用水量(m³) */ + @Excel(name = "当前累计用水量(m³)") + @ApiModelProperty("当前累计用水量(m³)") + private String curflow; + + /** 当前累计用电量(度) */ + @Excel(name = "当前累计用电量(度)") + @ApiModelProperty("当前累计用电量(度)") + private String curele; + + /** 流量计累计水量(m³) */ + @Excel(name = "流量计累计水量(m³)") + @ApiModelProperty("流量计累计水量(m³)") + private String metersum; + + /** 流量计瞬时流量(m³/s) */ + @Excel(name = "流量计瞬时流量(m³/s)") + @ApiModelProperty("流量计瞬时流量(m³/s)") + private String meterins; + + /** 卡编号 */ + @Excel(name = "卡编号") + @ApiModelProperty("卡编号") + private String cardid; + + /** 区域号 */ + @Excel(name = "区域号") + @ApiModelProperty("区域号") + private String areacode; + + /** 当前动作 */ + @Excel(name = "当前动作") + @ApiModelProperty("当前动作") + private String action; + +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/mapper/MaCardinfoMapper.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/mapper/MaCardinfoMapper.java new file mode 100644 index 0000000..003955c --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/mapper/MaCardinfoMapper.java @@ -0,0 +1,61 @@ +package com.fastbee.waterele.mapper; + +import java.util.List; +import com.fastbee.waterele.domain.MaCardinfo; + +/** + * 卡记录Mapper接口 + * + * @author kerwincui + * @date 2024-08-12 + */ +public interface MaCardinfoMapper +{ + /** + * 查询卡记录 + * + * @param id 卡记录主键 + * @return 卡记录 + */ + public MaCardinfo selectMaCardinfoById(Long id); + + /** + * 查询卡记录列表 + * + * @param maCardinfo 卡记录 + * @return 卡记录集合 + */ + public List selectMaCardinfoList(MaCardinfo maCardinfo); + + /** + * 新增卡记录 + * + * @param maCardinfo 卡记录 + * @return 结果 + */ + public int insertMaCardinfo(MaCardinfo maCardinfo); + + /** + * 修改卡记录 + * + * @param maCardinfo 卡记录 + * @return 结果 + */ + public int updateMaCardinfo(MaCardinfo maCardinfo); + + /** + * 删除卡记录 + * + * @param id 卡记录主键 + * @return 结果 + */ + public int deleteMaCardinfoById(Long id); + + /** + * 批量删除卡记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMaCardinfoByIds(Long[] ids); +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/mapper/MaGuangaiRecordMapper.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/mapper/MaGuangaiRecordMapper.java new file mode 100644 index 0000000..ba7ab7f --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/mapper/MaGuangaiRecordMapper.java @@ -0,0 +1,62 @@ +package com.fastbee.waterele.mapper; + +import com.fastbee.waterele.domain.MaGuangaiRecord; + +import java.util.List; + +/** + * 灌溉记录Mapper接口 + * + * @author kerwincui + * @date 2024-08-12 + */ +public interface MaGuangaiRecordMapper +{ + /** + * 查询灌溉记录 + * + * @param id 灌溉记录主键 + * @return 灌溉记录 + */ + public MaGuangaiRecord selectMaGuangaiRecordById(Long id); + + /** + * 查询灌溉记录列表 + * + * @param maGuangaiRecord 灌溉记录 + * @return 灌溉记录集合 + */ + public List selectMaGuangaiRecordList(MaGuangaiRecord maGuangaiRecord); + + /** + * 新增灌溉记录 + * + * @param maGuangaiRecord 灌溉记录 + * @return 结果 + */ + public int insertMaGuangaiRecord(MaGuangaiRecord maGuangaiRecord); + + /** + * 修改灌溉记录 + * + * @param maGuangaiRecord 灌溉记录 + * @return 结果 + */ + public int updateMaGuangaiRecord(MaGuangaiRecord maGuangaiRecord); + + /** + * 删除灌溉记录 + * + * @param id 灌溉记录主键 + * @return 结果 + */ + public int deleteMaGuangaiRecordById(Long id); + + /** + * 批量删除灌溉记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMaGuangaiRecordByIds(Long[] ids); +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/mapper/MaRechargerecordMapper.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/mapper/MaRechargerecordMapper.java new file mode 100644 index 0000000..644470a --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/mapper/MaRechargerecordMapper.java @@ -0,0 +1,61 @@ +package com.fastbee.waterele.mapper; + +import java.util.List; +import com.fastbee.waterele.domain.MaRechargerecord; + +/** + * 充值记录Mapper接口 + * + * @author kerwincui + * @date 2024-08-12 + */ +public interface MaRechargerecordMapper +{ + /** + * 查询充值记录 + * + * @param id 充值记录主键 + * @return 充值记录 + */ + public MaRechargerecord selectMaRechargerecordById(Long id); + + /** + * 查询充值记录列表 + * + * @param maRechargerecord 充值记录 + * @return 充值记录集合 + */ + public List selectMaRechargerecordList(MaRechargerecord maRechargerecord); + + /** + * 新增充值记录 + * + * @param maRechargerecord 充值记录 + * @return 结果 + */ + public int insertMaRechargerecord(MaRechargerecord maRechargerecord); + + /** + * 修改充值记录 + * + * @param maRechargerecord 充值记录 + * @return 结果 + */ + public int updateMaRechargerecord(MaRechargerecord maRechargerecord); + + /** + * 删除充值记录 + * + * @param id 充值记录主键 + * @return 结果 + */ + public int deleteMaRechargerecordById(Long id); + + /** + * 批量删除充值记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMaRechargerecordByIds(Long[] ids); +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/mapper/MaWatereleRecordMapper.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/mapper/MaWatereleRecordMapper.java new file mode 100644 index 0000000..55a5084 --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/mapper/MaWatereleRecordMapper.java @@ -0,0 +1,61 @@ +package com.fastbee.waterele.mapper; + +import java.util.List; +import com.fastbee.waterele.domain.MaWatereleRecord; + +/** + * 水电双计数据记录Mapper接口 + * + * @author kerwincui + * @date 2024-08-12 + */ +public interface MaWatereleRecordMapper +{ + /** + * 查询水电双计数据记录 + * + * @param id 水电双计数据记录主键 + * @return 水电双计数据记录 + */ + public MaWatereleRecord selectMaWatereleRecordById(Long id); + + /** + * 查询水电双计数据记录列表 + * + * @param maWatereleRecord 水电双计数据记录 + * @return 水电双计数据记录集合 + */ + public List selectMaWatereleRecordList(MaWatereleRecord maWatereleRecord); + + /** + * 新增水电双计数据记录 + * + * @param maWatereleRecord 水电双计数据记录 + * @return 结果 + */ + public int insertMaWatereleRecord(MaWatereleRecord maWatereleRecord); + + /** + * 修改水电双计数据记录 + * + * @param maWatereleRecord 水电双计数据记录 + * @return 结果 + */ + public int updateMaWatereleRecord(MaWatereleRecord maWatereleRecord); + + /** + * 删除水电双计数据记录 + * + * @param id 水电双计数据记录主键 + * @return 结果 + */ + public int deleteMaWatereleRecordById(Long id); + + /** + * 批量删除水电双计数据记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteMaWatereleRecordByIds(Long[] ids); +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/IMaCardinfoService.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/IMaCardinfoService.java new file mode 100644 index 0000000..2107f79 --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/IMaCardinfoService.java @@ -0,0 +1,61 @@ +package com.fastbee.waterele.service; + +import java.util.List; +import com.fastbee.waterele.domain.MaCardinfo; + +/** + * 卡记录Service接口 + * + * @author kerwincui + * @date 2024-08-12 + */ +public interface IMaCardinfoService +{ + /** + * 查询卡记录 + * + * @param id 卡记录主键 + * @return 卡记录 + */ + public MaCardinfo selectMaCardinfoById(Long id); + + /** + * 查询卡记录列表 + * + * @param maCardinfo 卡记录 + * @return 卡记录集合 + */ + public List selectMaCardinfoList(MaCardinfo maCardinfo); + + /** + * 新增卡记录 + * + * @param maCardinfo 卡记录 + * @return 结果 + */ + public int insertMaCardinfo(MaCardinfo maCardinfo); + + /** + * 修改卡记录 + * + * @param maCardinfo 卡记录 + * @return 结果 + */ + public int updateMaCardinfo(MaCardinfo maCardinfo); + + /** + * 批量删除卡记录 + * + * @param ids 需要删除的卡记录主键集合 + * @return 结果 + */ + public int deleteMaCardinfoByIds(Long[] ids); + + /** + * 删除卡记录信息 + * + * @param id 卡记录主键 + * @return 结果 + */ + public int deleteMaCardinfoById(Long id); +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/IMaGuangaiRecordService.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/IMaGuangaiRecordService.java new file mode 100644 index 0000000..60b24ea --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/IMaGuangaiRecordService.java @@ -0,0 +1,61 @@ +package com.fastbee.waterele.service; + +import java.util.List; +import com.fastbee.waterele.domain.MaGuangaiRecord; + +/** + * 灌溉记录Service接口 + * + * @author kerwincui + * @date 2024-08-12 + */ +public interface IMaGuangaiRecordService +{ + /** + * 查询灌溉记录 + * + * @param id 灌溉记录主键 + * @return 灌溉记录 + */ + public MaGuangaiRecord selectMaGuangaiRecordById(Long id); + + /** + * 查询灌溉记录列表 + * + * @param maGuangaiRecord 灌溉记录 + * @return 灌溉记录集合 + */ + public List selectMaGuangaiRecordList(MaGuangaiRecord maGuangaiRecord); + + /** + * 新增灌溉记录 + * + * @param maGuangaiRecord 灌溉记录 + * @return 结果 + */ + public int insertMaGuangaiRecord(MaGuangaiRecord maGuangaiRecord); + + /** + * 修改灌溉记录 + * + * @param maGuangaiRecord 灌溉记录 + * @return 结果 + */ + public int updateMaGuangaiRecord(MaGuangaiRecord maGuangaiRecord); + + /** + * 批量删除灌溉记录 + * + * @param ids 需要删除的灌溉记录主键集合 + * @return 结果 + */ + public int deleteMaGuangaiRecordByIds(Long[] ids); + + /** + * 删除灌溉记录信息 + * + * @param id 灌溉记录主键 + * @return 结果 + */ + public int deleteMaGuangaiRecordById(Long id); +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/IMaRechargerecordService.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/IMaRechargerecordService.java new file mode 100644 index 0000000..f62b8c5 --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/IMaRechargerecordService.java @@ -0,0 +1,61 @@ +package com.fastbee.waterele.service; + +import java.util.List; +import com.fastbee.waterele.domain.MaRechargerecord; + +/** + * 充值记录Service接口 + * + * @author kerwincui + * @date 2024-08-12 + */ +public interface IMaRechargerecordService +{ + /** + * 查询充值记录 + * + * @param id 充值记录主键 + * @return 充值记录 + */ + public MaRechargerecord selectMaRechargerecordById(Long id); + + /** + * 查询充值记录列表 + * + * @param maRechargerecord 充值记录 + * @return 充值记录集合 + */ + public List selectMaRechargerecordList(MaRechargerecord maRechargerecord); + + /** + * 新增充值记录 + * + * @param maRechargerecord 充值记录 + * @return 结果 + */ + public int insertMaRechargerecord(MaRechargerecord maRechargerecord); + + /** + * 修改充值记录 + * + * @param maRechargerecord 充值记录 + * @return 结果 + */ + public int updateMaRechargerecord(MaRechargerecord maRechargerecord); + + /** + * 批量删除充值记录 + * + * @param ids 需要删除的充值记录主键集合 + * @return 结果 + */ + public int deleteMaRechargerecordByIds(Long[] ids); + + /** + * 删除充值记录信息 + * + * @param id 充值记录主键 + * @return 结果 + */ + public int deleteMaRechargerecordById(Long id); +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/IMaWatereleRecordService.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/IMaWatereleRecordService.java new file mode 100644 index 0000000..fa80dbf --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/IMaWatereleRecordService.java @@ -0,0 +1,61 @@ +package com.fastbee.waterele.service; + +import java.util.List; +import com.fastbee.waterele.domain.MaWatereleRecord; + +/** + * 水电双计数据记录Service接口 + * + * @author kerwincui + * @date 2024-08-12 + */ +public interface IMaWatereleRecordService +{ + /** + * 查询水电双计数据记录 + * + * @param id 水电双计数据记录主键 + * @return 水电双计数据记录 + */ + public MaWatereleRecord selectMaWatereleRecordById(Long id); + + /** + * 查询水电双计数据记录列表 + * + * @param maWatereleRecord 水电双计数据记录 + * @return 水电双计数据记录集合 + */ + public List selectMaWatereleRecordList(MaWatereleRecord maWatereleRecord); + + /** + * 新增水电双计数据记录 + * + * @param maWatereleRecord 水电双计数据记录 + * @return 结果 + */ + public int insertMaWatereleRecord(MaWatereleRecord maWatereleRecord); + + /** + * 修改水电双计数据记录 + * + * @param maWatereleRecord 水电双计数据记录 + * @return 结果 + */ + public int updateMaWatereleRecord(MaWatereleRecord maWatereleRecord); + + /** + * 批量删除水电双计数据记录 + * + * @param ids 需要删除的水电双计数据记录主键集合 + * @return 结果 + */ + public int deleteMaWatereleRecordByIds(Long[] ids); + + /** + * 删除水电双计数据记录信息 + * + * @param id 水电双计数据记录主键 + * @return 结果 + */ + public int deleteMaWatereleRecordById(Long id); +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/impl/MaCardinfoServiceImpl.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/impl/MaCardinfoServiceImpl.java new file mode 100644 index 0000000..b7c1613 --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/impl/MaCardinfoServiceImpl.java @@ -0,0 +1,96 @@ +package com.fastbee.waterele.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.waterele.mapper.MaCardinfoMapper; +import com.fastbee.waterele.domain.MaCardinfo; +import com.fastbee.waterele.service.IMaCardinfoService; + +/** + * 卡记录Service业务层处理 + * + * @author kerwincui + * @date 2024-08-12 + */ +@Service +public class MaCardinfoServiceImpl implements IMaCardinfoService +{ + @Autowired + private MaCardinfoMapper maCardinfoMapper; + + /** + * 查询卡记录 + * + * @param id 卡记录主键 + * @return 卡记录 + */ + @Override + public MaCardinfo selectMaCardinfoById(Long id) + { + return maCardinfoMapper.selectMaCardinfoById(id); + } + + /** + * 查询卡记录列表 + * + * @param maCardinfo 卡记录 + * @return 卡记录 + */ + @Override + public List selectMaCardinfoList(MaCardinfo maCardinfo) + { + return maCardinfoMapper.selectMaCardinfoList(maCardinfo); + } + + /** + * 新增卡记录 + * + * @param maCardinfo 卡记录 + * @return 结果 + */ + @Override + public int insertMaCardinfo(MaCardinfo maCardinfo) + { + maCardinfo.setCreateTime(DateUtils.getNowDate()); + return maCardinfoMapper.insertMaCardinfo(maCardinfo); + } + + /** + * 修改卡记录 + * + * @param maCardinfo 卡记录 + * @return 结果 + */ + @Override + public int updateMaCardinfo(MaCardinfo maCardinfo) + { + maCardinfo.setUpdateTime(DateUtils.getNowDate()); + return maCardinfoMapper.updateMaCardinfo(maCardinfo); + } + + /** + * 批量删除卡记录 + * + * @param ids 需要删除的卡记录主键 + * @return 结果 + */ + @Override + public int deleteMaCardinfoByIds(Long[] ids) + { + return maCardinfoMapper.deleteMaCardinfoByIds(ids); + } + + /** + * 删除卡记录信息 + * + * @param id 卡记录主键 + * @return 结果 + */ + @Override + public int deleteMaCardinfoById(Long id) + { + return maCardinfoMapper.deleteMaCardinfoById(id); + } +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/impl/MaGuangaiRecordServiceImpl.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/impl/MaGuangaiRecordServiceImpl.java new file mode 100644 index 0000000..8e2e4b8 --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/impl/MaGuangaiRecordServiceImpl.java @@ -0,0 +1,96 @@ +package com.fastbee.waterele.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.waterele.mapper.MaGuangaiRecordMapper; +import com.fastbee.waterele.domain.MaGuangaiRecord; +import com.fastbee.waterele.service.IMaGuangaiRecordService; + +/** + * 灌溉记录Service业务层处理 + * + * @author kerwincui + * @date 2024-08-12 + */ +@Service +public class MaGuangaiRecordServiceImpl implements IMaGuangaiRecordService +{ + @Autowired + private MaGuangaiRecordMapper maGuangaiRecordMapper; + + /** + * 查询灌溉记录 + * + * @param id 灌溉记录主键 + * @return 灌溉记录 + */ + @Override + public MaGuangaiRecord selectMaGuangaiRecordById(Long id) + { + return maGuangaiRecordMapper.selectMaGuangaiRecordById(id); + } + + /** + * 查询灌溉记录列表 + * + * @param maGuangaiRecord 灌溉记录 + * @return 灌溉记录 + */ + @Override + public List selectMaGuangaiRecordList(MaGuangaiRecord maGuangaiRecord) + { + return maGuangaiRecordMapper.selectMaGuangaiRecordList(maGuangaiRecord); + } + + /** + * 新增灌溉记录 + * + * @param maGuangaiRecord 灌溉记录 + * @return 结果 + */ + @Override + public int insertMaGuangaiRecord(MaGuangaiRecord maGuangaiRecord) + { + maGuangaiRecord.setCreateTime(DateUtils.getNowDate()); + return maGuangaiRecordMapper.insertMaGuangaiRecord(maGuangaiRecord); + } + + /** + * 修改灌溉记录 + * + * @param maGuangaiRecord 灌溉记录 + * @return 结果 + */ + @Override + public int updateMaGuangaiRecord(MaGuangaiRecord maGuangaiRecord) + { + maGuangaiRecord.setUpdateTime(DateUtils.getNowDate()); + return maGuangaiRecordMapper.updateMaGuangaiRecord(maGuangaiRecord); + } + + /** + * 批量删除灌溉记录 + * + * @param ids 需要删除的灌溉记录主键 + * @return 结果 + */ + @Override + public int deleteMaGuangaiRecordByIds(Long[] ids) + { + return maGuangaiRecordMapper.deleteMaGuangaiRecordByIds(ids); + } + + /** + * 删除灌溉记录信息 + * + * @param id 灌溉记录主键 + * @return 结果 + */ + @Override + public int deleteMaGuangaiRecordById(Long id) + { + return maGuangaiRecordMapper.deleteMaGuangaiRecordById(id); + } +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/impl/MaRechargerecordServiceImpl.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/impl/MaRechargerecordServiceImpl.java new file mode 100644 index 0000000..a1e3b04 --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/impl/MaRechargerecordServiceImpl.java @@ -0,0 +1,96 @@ +package com.fastbee.waterele.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.waterele.mapper.MaRechargerecordMapper; +import com.fastbee.waterele.domain.MaRechargerecord; +import com.fastbee.waterele.service.IMaRechargerecordService; + +/** + * 充值记录Service业务层处理 + * + * @author kerwincui + * @date 2024-08-12 + */ +@Service +public class MaRechargerecordServiceImpl implements IMaRechargerecordService +{ + @Autowired + private MaRechargerecordMapper maRechargerecordMapper; + + /** + * 查询充值记录 + * + * @param id 充值记录主键 + * @return 充值记录 + */ + @Override + public MaRechargerecord selectMaRechargerecordById(Long id) + { + return maRechargerecordMapper.selectMaRechargerecordById(id); + } + + /** + * 查询充值记录列表 + * + * @param maRechargerecord 充值记录 + * @return 充值记录 + */ + @Override + public List selectMaRechargerecordList(MaRechargerecord maRechargerecord) + { + return maRechargerecordMapper.selectMaRechargerecordList(maRechargerecord); + } + + /** + * 新增充值记录 + * + * @param maRechargerecord 充值记录 + * @return 结果 + */ + @Override + public int insertMaRechargerecord(MaRechargerecord maRechargerecord) + { + maRechargerecord.setCreateTime(DateUtils.getNowDate()); + return maRechargerecordMapper.insertMaRechargerecord(maRechargerecord); + } + + /** + * 修改充值记录 + * + * @param maRechargerecord 充值记录 + * @return 结果 + */ + @Override + public int updateMaRechargerecord(MaRechargerecord maRechargerecord) + { + maRechargerecord.setUpdateTime(DateUtils.getNowDate()); + return maRechargerecordMapper.updateMaRechargerecord(maRechargerecord); + } + + /** + * 批量删除充值记录 + * + * @param ids 需要删除的充值记录主键 + * @return 结果 + */ + @Override + public int deleteMaRechargerecordByIds(Long[] ids) + { + return maRechargerecordMapper.deleteMaRechargerecordByIds(ids); + } + + /** + * 删除充值记录信息 + * + * @param id 充值记录主键 + * @return 结果 + */ + @Override + public int deleteMaRechargerecordById(Long id) + { + return maRechargerecordMapper.deleteMaRechargerecordById(id); + } +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/impl/MaWatereleRecordServiceImpl.java b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/impl/MaWatereleRecordServiceImpl.java new file mode 100644 index 0000000..9f9cdb0 --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/java/com/fastbee/waterele/service/impl/MaWatereleRecordServiceImpl.java @@ -0,0 +1,96 @@ +package com.fastbee.waterele.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.waterele.mapper.MaWatereleRecordMapper; +import com.fastbee.waterele.domain.MaWatereleRecord; +import com.fastbee.waterele.service.IMaWatereleRecordService; + +/** + * 水电双计数据记录Service业务层处理 + * + * @author kerwincui + * @date 2024-08-12 + */ +@Service +public class MaWatereleRecordServiceImpl implements IMaWatereleRecordService +{ + @Autowired + private MaWatereleRecordMapper maWatereleRecordMapper; + + /** + * 查询水电双计数据记录 + * + * @param id 水电双计数据记录主键 + * @return 水电双计数据记录 + */ + @Override + public MaWatereleRecord selectMaWatereleRecordById(Long id) + { + return maWatereleRecordMapper.selectMaWatereleRecordById(id); + } + + /** + * 查询水电双计数据记录列表 + * + * @param maWatereleRecord 水电双计数据记录 + * @return 水电双计数据记录 + */ + @Override + public List selectMaWatereleRecordList(MaWatereleRecord maWatereleRecord) + { + return maWatereleRecordMapper.selectMaWatereleRecordList(maWatereleRecord); + } + + /** + * 新增水电双计数据记录 + * + * @param maWatereleRecord 水电双计数据记录 + * @return 结果 + */ + @Override + public int insertMaWatereleRecord(MaWatereleRecord maWatereleRecord) + { + maWatereleRecord.setCreateTime(DateUtils.getNowDate()); + return maWatereleRecordMapper.insertMaWatereleRecord(maWatereleRecord); + } + + /** + * 修改水电双计数据记录 + * + * @param maWatereleRecord 水电双计数据记录 + * @return 结果 + */ + @Override + public int updateMaWatereleRecord(MaWatereleRecord maWatereleRecord) + { + maWatereleRecord.setUpdateTime(DateUtils.getNowDate()); + return maWatereleRecordMapper.updateMaWatereleRecord(maWatereleRecord); + } + + /** + * 批量删除水电双计数据记录 + * + * @param ids 需要删除的水电双计数据记录主键 + * @return 结果 + */ + @Override + public int deleteMaWatereleRecordByIds(Long[] ids) + { + return maWatereleRecordMapper.deleteMaWatereleRecordByIds(ids); + } + + /** + * 删除水电双计数据记录信息 + * + * @param id 水电双计数据记录主键 + * @return 结果 + */ + @Override + public int deleteMaWatereleRecordById(Long id) + { + return maWatereleRecordMapper.deleteMaWatereleRecordById(id); + } +} diff --git a/fastbee-service/fastbee-waterele-service/src/main/resources/mapper/waterele/MaCardinfoMapper.xml b/fastbee-service/fastbee-waterele-service/src/main/resources/mapper/waterele/MaCardinfoMapper.xml new file mode 100644 index 0000000..9239384 --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/resources/mapper/waterele/MaCardinfoMapper.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + select id, card_num, area_code, card_id, address_info, cardType, mcuSn, create_time, update_time from ma_cardinfo + + + + + + + + insert into ma_cardinfo + + card_num, + area_code, + card_id, + address_info, + cardType, + mcuSn, + create_time, + update_time, + + + #{cardNum}, + #{areaCode}, + #{cardId}, + #{addressInfo}, + #{cardtype}, + #{mcusn}, + #{createTime}, + #{updateTime}, + + + + + update ma_cardinfo + + card_num = #{cardNum}, + area_code = #{areaCode}, + card_id = #{cardId}, + address_info = #{addressInfo}, + cardType = #{cardtype}, + mcuSn = #{mcusn}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from ma_cardinfo where id = #{id} + + + + delete from ma_cardinfo where id in + + #{id} + + + \ No newline at end of file diff --git a/fastbee-service/fastbee-waterele-service/src/main/resources/mapper/waterele/MaGuangaiRecordMapper.xml b/fastbee-service/fastbee-waterele-service/src/main/resources/mapper/waterele/MaGuangaiRecordMapper.xml new file mode 100644 index 0000000..9d1959c --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/resources/mapper/waterele/MaGuangaiRecordMapper.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + select id, dev_sn, start_time, end_time, last_time, card_id, area_code, user_balance, cur_flow, cur_ele, status, create_time, update_time from ma_guangai_record + + + + + + + + insert into ma_guangai_record + + dev_sn, + start_time, + end_time, + last_time, + card_id, + area_code, + user_balance, + cur_flow, + cur_ele, + status, + create_time, + update_time, + + + #{devSn}, + #{startTime}, + #{endTime}, + #{lastTime}, + #{cardId}, + #{areaCode}, + #{userBalance}, + #{curFlow}, + #{curEle}, + #{status}, + #{createTime}, + #{updateTime}, + + + + + update ma_guangai_record + + dev_sn = #{devSn}, + start_time = #{startTime}, + end_time = #{endTime}, + last_time = #{lastTime}, + card_id = #{cardId}, + area_code = #{areaCode}, + user_balance = #{userBalance}, + cur_flow = #{curFlow}, + cur_ele = #{curEle}, + status = #{status}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from ma_guangai_record where id = #{id} + + + + delete from ma_guangai_record where id in + + #{id} + + + \ No newline at end of file diff --git a/fastbee-service/fastbee-waterele-service/src/main/resources/mapper/waterele/MaRechargerecordMapper.xml b/fastbee-service/fastbee-waterele-service/src/main/resources/mapper/waterele/MaRechargerecordMapper.xml new file mode 100644 index 0000000..bbf392f --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/resources/mapper/waterele/MaRechargerecordMapper.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + select id, balance, investVal, card_num, area_code, card_id, mcuSn, create_time, update_time from ma_rechargerecord + + + + + + + + insert into ma_rechargerecord + + balance, + investVal, + card_num, + area_code, + card_id, + mcuSn, + create_time, + update_time, + + + #{balance}, + #{investval}, + #{cardNum}, + #{areaCode}, + #{cardId}, + #{mcusn}, + #{createTime}, + #{updateTime}, + + + + + update ma_rechargerecord + + balance = #{balance}, + investVal = #{investval}, + card_num = #{cardNum}, + area_code = #{areaCode}, + card_id = #{cardId}, + mcuSn = #{mcusn}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from ma_rechargerecord where id = #{id} + + + + delete from ma_rechargerecord where id in + + #{id} + + + \ No newline at end of file diff --git a/fastbee-service/fastbee-waterele-service/src/main/resources/mapper/waterele/MaWatereleRecordMapper.xml b/fastbee-service/fastbee-waterele-service/src/main/resources/mapper/waterele/MaWatereleRecordMapper.xml new file mode 100644 index 0000000..06f3aab --- /dev/null +++ b/fastbee-service/fastbee-waterele-service/src/main/resources/mapper/waterele/MaWatereleRecordMapper.xml @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, dev_sn, workState, userSumFlow, userSumEle, userBalance, sumFlow, sumEle, mcuSn, insPower, insFlow, curFlow, curEle, meterSum, meterIns, cardId, areaCode, action, create_time, update_time from ma_waterele_record + + + + + + + + insert into ma_waterele_record + + dev_sn, + workState, + userSumFlow, + userSumEle, + userBalance, + sumFlow, + sumEle, + mcuSn, + insPower, + insFlow, + curFlow, + curEle, + meterSum, + meterIns, + cardId, + areaCode, + action, + create_time, + update_time, + + + #{devSn}, + #{workstate}, + #{usersumflow}, + #{usersumele}, + #{userbalance}, + #{sumflow}, + #{sumele}, + #{mcusn}, + #{inspower}, + #{insflow}, + #{curflow}, + #{curele}, + #{metersum}, + #{meterins}, + #{cardid}, + #{areacode}, + #{action}, + #{createTime}, + #{updateTime}, + + + + + update ma_waterele_record + + dev_sn = #{devSn}, + workState = #{workstate}, + userSumFlow = #{usersumflow}, + userSumEle = #{usersumele}, + userBalance = #{userbalance}, + sumFlow = #{sumflow}, + sumEle = #{sumele}, + mcuSn = #{mcusn}, + insPower = #{inspower}, + insFlow = #{insflow}, + curFlow = #{curflow}, + curEle = #{curele}, + meterSum = #{metersum}, + meterIns = #{meterins}, + cardId = #{cardid}, + areaCode = #{areacode}, + action = #{action}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from ma_waterele_record where id = #{id} + + + + delete from ma_waterele_record where id in + + #{id} + + + \ No newline at end of file diff --git a/fastbee-service/fastbee-xunjian-service/pom.xml b/fastbee-service/fastbee-xunjian-service/pom.xml new file mode 100644 index 0000000..3d6a8d0 --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/pom.xml @@ -0,0 +1,28 @@ + + + + fastbee-service + com.fastbee + 3.8.5 + + 4.0.0 + + fastbee-xunjian-service + + + 巡检系统模块 + + + + + + + com.fastbee + fastbee-common + + + + + \ No newline at end of file diff --git a/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/domain/XjInspectionNote.java b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/domain/XjInspectionNote.java new file mode 100644 index 0000000..a7e0782 --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/domain/XjInspectionNote.java @@ -0,0 +1,90 @@ +package com.fastbee.xunjian.domain; + +import com.fastbee.common.annotation.Excel; +import com.fastbee.common.core.domain.BaseEntity; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 巡检注意事项对象 xj_inspection_note + * + * @author + * @date 2023-08-23 + */ +@Data +public class XjInspectionNote extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $column.columnComment + */ + private Long id; + /** + * 工程对象类型 + */ + @Excel(name = "工程对象类型") + private String engineeringObjectType; + /** + * 标题 + */ + @Excel(name = "标题") + private String title; + + /** + * 注意事项 + */ + @Excel(name = "注意事项") + private String content; + + /** + * 项目id + */ + @Excel(name = "项目id") + private Long projectId; + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("title", getTitle()) + .append("content", getContent()) + .append("projectId", getProjectId()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .append("updateBy", getUpdateBy()) + .toString(); + } +} diff --git a/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/domain/XjInspectionRecords.java b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/domain/XjInspectionRecords.java new file mode 100644 index 0000000..1820973 --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/domain/XjInspectionRecords.java @@ -0,0 +1,262 @@ +package com.fastbee.xunjian.domain; + +import com.fastbee.common.annotation.Excel; +import com.fastbee.common.core.domain.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + + +/** + * 记录对象 klxj_inspection_records + * + * @author kenlixunjian + * @date 2023-08-04 + */ + +@Data +public class XjInspectionRecords extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private Long id; + + /** + * 名称 + */ + @Excel(name = "名称") + private String name; + private String personnelsOrTasksOrRecords; + //查询开始时间 + private String chaxunBeginTime; + //查询结束时间 + private String chaxunEndTime; + //点位集合 + private String routesIds; + /** + * 任务id + */ + @Excel(name = "任务id") + private Long inspectionTaskId; + + /** + * 计划id + */ + @Excel(name = "计划id") + private Long inspectionPlanId; + + /** + * 开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date startTime; + + /** + * 终止时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "终止时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date endTime; + + /** 执行人 */ + @Excel(name = "执行人") + private Long inspectionPersonnelId; + + /** 点位id */ + @Excel(name = "点位id") + private Long inspectionRouteId; + + /** 完成状态 */ + @Excel(name = "完成状态") + private String recordStatus; + + /** 异常状态 */ + @Excel(name = "异常状态") + private String abnormalStatus; + + /** 经纬度 */ + @Excel(name = "经纬度") + private String latAndLong; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** + * 备注 + */ + @Excel(name = "备注") + private String remarks; + private String abnormalType; + /** + * 行政区域码 + */ + @Excel(name = "行政区域码") + private String quyuma; + + /** + * 项目id + */ + @Excel(name = "项目id") + private Long projectId; + + /** + * 班组id + */ + @Excel(name = "班组id") + private Long groupId; + + + public XjInspectionRoutes route; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getInspectionTaskId() { + return inspectionTaskId; + } + + public void setInspectionTaskId(Long inspectionTaskId) { + this.inspectionTaskId = inspectionTaskId; + } + + public Long getInspectionPlanId() { + return inspectionPlanId; + } + + public void setInspectionPlanId(Long inspectionPlanId) { + this.inspectionPlanId = inspectionPlanId; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Long getInspectionPersonnelId() { + return inspectionPersonnelId; + } + + public void setInspectionPersonnelId(Long inspectionPersonnelId) { + this.inspectionPersonnelId = inspectionPersonnelId; + } + + public Long getInspectionRouteId() { + return inspectionRouteId; + } + + public void setInspectionRouteId(Long inspectionRouteId) { + this.inspectionRouteId = inspectionRouteId; + } + + public String getRecordStatus() { + return recordStatus; + } + + public void setRecordStatus(String recordStatus) { + this.recordStatus = recordStatus; + } + + public String getAbnormalStatus() { + return abnormalStatus; + } + + public void setAbnormalStatus(String abnormalStatus) { + this.abnormalStatus = abnormalStatus; + } + + public String getLatAndLong() { + return latAndLong; + } + + public void setLatAndLong(String latAndLong) { + this.latAndLong = latAndLong; + } + + public String getPicture() { + return picture; + } + + public void setPicture(String picture) { + this.picture = picture; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getQuyuma() { + return quyuma; + } + + public void setQuyuma(String quyuma) { + this.quyuma = quyuma; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("inspectionTaskId", getInspectionTaskId()) + .append("inspectionPlanId", getInspectionPlanId()) + .append("startTime", getStartTime()) + .append("endTime", getEndTime()) + .append("inspectionPersonnelId", getInspectionPersonnelId()) + .append("inspectionRouteId", getInspectionRouteId()) + .append("recordStatus", getRecordStatus()) + .append("abnormalStatus", getAbnormalStatus()) + .append("latAndLong", getLatAndLong()) + .append("picture", getPicture()) + .append("remarks", getRemarks()) + .append("quyuma", getQuyuma()) + .append("projectId", getProjectId()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .append("updateBy", getUpdateBy()) + .toString(); + } +} diff --git a/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/domain/XjInspectionRoutes.java b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/domain/XjInspectionRoutes.java new file mode 100644 index 0000000..6543d5f --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/domain/XjInspectionRoutes.java @@ -0,0 +1,227 @@ +package com.fastbee.xunjian.domain; + +import com.fastbee.common.annotation.Excel; +import com.fastbee.common.core.domain.BaseEntity; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.List; + +/** + * 巡检路线对象 klxj_inspection_routes + * + * @author kenlixunjian + * @date 2023-08-04 + */ +@Data +public class XjInspectionRoutes extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private Long id; + private String abnormalType; + + /** + * 名称 + */ + @Excel(name = "名称") + private String name; + + /** + * 点线类型(1点2线) + */ + @Excel(name = "点线类型(1点2线)") + private String dotLineType; + + /** + * 工程对象类型 + */ + @Excel(name = "工程对象类型") + private String engineeringObjectType; + + /** + * 工程对象id + */ + @Excel(name = "工程对象Id") + private Long engineeringObjectId; + + + /** + * 注意事项ids + */ + private String inspectionNoteIds; + + private List inspectionNote; + + /** + * 项目id + */ + @Excel(name = "项目id") + private Long projectId; + + /** + * 经纬度 + */ + @Excel(name = "经纬度", prompt = "以,隔开") + private String latAndLong; + + /** + * 位置 + */ + @Excel(name = "位置") + private String position; + + /** + * 范围(单位m) + */ + @Excel(name = "巡检距离") + private String range; + /** + * 编码 + */ + @Excel(name = "绑定二维码编码") + private String qrCodeSn; + + /** + * 范围线 + */ +// @Excel(name = "范围线") + private String rangeArea; + + /** + * 二维码 + */ +// @Excel(name = "二维码") + private Long qrCodeId; + + /** + * 行政区域码 + */ +// @Excel(name = "行政区域码") + private String quyuma; + + private String recordStatus = "0"; + private Long recordId; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDotLineType() { + return dotLineType; + } + + public void setDotLineType(String dotLineType) { + this.dotLineType = dotLineType; + } + + public String getEngineeringObjectType() { + return engineeringObjectType; + } + + public void setEngineeringObjectType(String engineeringObjectType) { + this.engineeringObjectType = engineeringObjectType; + } + + public Long getEngineeringObjectId() { + return engineeringObjectId; + } + + public void setEngineeringObjectId(Long engineeringObjectId) { + this.engineeringObjectId = engineeringObjectId; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public String getLatAndLong() { + return latAndLong; + } + + public void setLatAndLong(String latAndLong) { + this.latAndLong = latAndLong; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public String getRange() { + return range; + } + + public void setRange(String range) { + this.range = range; + } + + public String getRangeArea() { + return rangeArea; + } + + public void setRangeArea(String rangeArea) { + this.rangeArea = rangeArea; + } + + public Long getQrCodeId() { + return qrCodeId; + } + + public void setQrCodeId(Long qrCodeId) { + this.qrCodeId = qrCodeId; + } + + public String getQuyuma() { + return quyuma; + } + + public void setQuyuma(String quyuma) { + this.quyuma = quyuma; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("dotLineType", getDotLineType()) + .append("engineeringObjectType", getEngineeringObjectType()) + .append("engineeringObjectId", getEngineeringObjectId()) + .append("projectId", getProjectId()) + .append("latAndLong", getLatAndLong()) + .append("position", getPosition()) + .append("range", getRange()) + .append("rangeArea", getRangeArea()) + .append("qrCodeId", getQrCodeId()) + .append("quyuma", getQuyuma()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .append("updateBy", getUpdateBy()) + .toString(); + } +} diff --git a/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/mapper/XjInspectionNoteMapper.java b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/mapper/XjInspectionNoteMapper.java new file mode 100644 index 0000000..9805272 --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/mapper/XjInspectionNoteMapper.java @@ -0,0 +1,62 @@ +package com.fastbee.xunjian.mapper; + + +import com.fastbee.xunjian.domain.XjInspectionNote; + +import java.util.List; + +/** + * 巡检注意事项Mapper接口 + * + * @author kenlixunjian + * @date 2023-08-23 + */ +public interface XjInspectionNoteMapper { + /** + * 查询巡检注意事项 + * + * @param id 巡检注意事项主键 + * @return 巡检注意事项 + */ + public XjInspectionNote selectXjInspectionNoteById(Long id); + + /** + * 查询巡检注意事项列表 + * + * @param XjInspectionNote 巡检注意事项 + * @return 巡检注意事项集合 + */ + public List selectXjInspectionNoteList(XjInspectionNote XjInspectionNote); + + /** + * 新增巡检注意事项 + * + * @param XjInspectionNote 巡检注意事项 + * @return 结果 + */ + public int insertXjInspectionNote(XjInspectionNote XjInspectionNote); + + /** + * 修改巡检注意事项 + * + * @param XjInspectionNote 巡检注意事项 + * @return 结果 + */ + public int updateXjInspectionNote(XjInspectionNote XjInspectionNote); + + /** + * 删除巡检注意事项 + * + * @param id 巡检注意事项主键 + * @return 结果 + */ + public int deleteXjInspectionNoteById(Long id); + + /** + * 批量删除巡检注意事项 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteXjInspectionNoteByIds(Long[] ids); +} diff --git a/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/mapper/XjInspectionRecordsMapper.java b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/mapper/XjInspectionRecordsMapper.java new file mode 100644 index 0000000..33af0e3 --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/mapper/XjInspectionRecordsMapper.java @@ -0,0 +1,70 @@ +package com.fastbee.xunjian.mapper; + +import com.fastbee.xunjian.domain.XjInspectionRecords; +import org.apache.ibatis.annotations.Mapper; + +import java.util.HashMap; +import java.util.List; + +/** + * 记录Mapper接口 + * + * @author kenlixunjian + * @date 2023-08-04 + */ +@Mapper +public interface XjInspectionRecordsMapper { + /** + * 查询记录 + * + * @param id 记录主键 + * @return 记录 + */ + public XjInspectionRecords selectXjInspectionRecordsById(Long id); + + /** + * 查询记录列表 + * + * @param XjInspectionRecords 记录 + * @return 记录集合 + */ + public List selectXjInspectionRecordsList(XjInspectionRecords XjInspectionRecords); + + +// List selectListByRoutesIds(KlxjInspectiontargetGroup klxjInspectiontargetGroup); + /** + * 新增记录 + * + * @param XjInspectionRecords 记录 + * @return 结果 + */ + public int insertXjInspectionRecords(XjInspectionRecords XjInspectionRecords); + + /** + * 修改记录 + * + * @param XjInspectionRecords 记录 + * @return 结果 + */ + public int updateXjInspectionRecords(XjInspectionRecords XjInspectionRecords); + + /** + * 删除记录 + * + * @param id 记录主键 + * @return 结果 + */ + public int deleteXjInspectionRecordsById(Long id); + + /** + * 批量删除记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteXjInspectionRecordsByIds(Long[] ids); + + List getInspectionTasksYichangCountByParmas(HashMap params); + + +} diff --git a/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/mapper/XjInspectionRoutesMapper.java b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/mapper/XjInspectionRoutesMapper.java new file mode 100644 index 0000000..a96c7f9 --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/mapper/XjInspectionRoutesMapper.java @@ -0,0 +1,68 @@ +package com.fastbee.xunjian.mapper; + +import com.fastbee.xunjian.domain.XjInspectionRoutes; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 巡检路线Mapper接口 + * + * @author kenlixunjian + * @date 2023-08-04 + */ +@Mapper +public interface XjInspectionRoutesMapper { + /** + * 查询巡检路线 + * + * @param id 巡检路线主键 + * @return 巡检路线 + */ + public XjInspectionRoutes selectXjInspectionRoutesById(Long id); + + /** + * 查询巡检路线列表 + * + * @param XjInspectionRoutes 巡检路线 + * @return 巡检路线集合 + */ + public List selectXjInspectionRoutesList(XjInspectionRoutes XjInspectionRoutes); + + /** + * 新增巡检路线 + * + * @param XjInspectionRoutes 巡检路线 + * @return 结果 + */ + public int insertXjInspectionRoutes(XjInspectionRoutes XjInspectionRoutes); + + /** + * 修改巡检路线 + * + * @param XjInspectionRoutes 巡检路线 + * @return 结果 + */ + public int updateXjInspectionRoutes(XjInspectionRoutes XjInspectionRoutes); + + /** + * 删除巡检路线 + * + * @param id 巡检路线主键 + * @return 结果 + */ + public int deleteXjInspectionRoutesById(Long id); + + /** + * 批量删除巡检路线 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteXjInspectionRoutesByIds(Long[] ids); + + XjInspectionRoutes selectXjInspectionRoutesByName(@Param("name") String name); + + XjInspectionRoutes selectXjInspectionRoutesByQrSn(String qrSn); +} diff --git a/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/IXjInspectionNoteService.java b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/IXjInspectionNoteService.java new file mode 100644 index 0000000..f2d1384 --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/IXjInspectionNoteService.java @@ -0,0 +1,62 @@ +package com.fastbee.xunjian.service; + + +import com.fastbee.xunjian.domain.XjInspectionNote; + +import java.util.List; + +/** + * 巡检注意事项Service接口 + * + * @author kenlixunjian + * @date 2023-08-23 + */ +public interface IXjInspectionNoteService { + /** + * 查询巡检注意事项 + * + * @param id 巡检注意事项主键 + * @return 巡检注意事项 + */ + public XjInspectionNote selectXjInspectionNoteById(Long id); + + /** + * 查询巡检注意事项列表 + * + * @param XjInspectionNote 巡检注意事项 + * @return 巡检注意事项集合 + */ + public List selectXjInspectionNoteList(XjInspectionNote XjInspectionNote); + + /** + * 新增巡检注意事项 + * + * @param XjInspectionNote 巡检注意事项 + * @return 结果 + */ + public int insertXjInspectionNote(XjInspectionNote XjInspectionNote); + + /** + * 修改巡检注意事项 + * + * @param XjInspectionNote 巡检注意事项 + * @return 结果 + */ + public int updateXjInspectionNote(XjInspectionNote XjInspectionNote); + + /** + * 批量删除巡检注意事项 + * + * @param ids 需要删除的巡检注意事项主键集合 + * @return 结果 + */ + public int deleteXjInspectionNoteByIds(Long[] ids); + + /** + * 删除巡检注意事项信息 + * + * @param id 巡检注意事项主键 + * @return 结果 + */ + public int deleteXjInspectionNoteById(Long id); +} diff --git a/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/IXjInspectionRecordsService.java b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/IXjInspectionRecordsService.java new file mode 100644 index 0000000..740bb2f --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/IXjInspectionRecordsService.java @@ -0,0 +1,66 @@ +package com.fastbee.xunjian.service; + + +import com.fastbee.xunjian.domain.XjInspectionRecords; + +import java.util.HashMap; +import java.util.List; + +/** + * 记录Service接口 + * + * @author kenlixunjian + * @date 2023-08-04 + */ +public interface IXjInspectionRecordsService { + /** + * 查询记录 + * + * @param id 记录主键 + * @return 记录 + */ + public XjInspectionRecords selectXjInspectionRecordsById(Long id); + + /** + * 查询记录列表 + * + * @param XjInspectionRecords 记录 + * @return 记录集合 + */ + public List selectXjInspectionRecordsList(XjInspectionRecords XjInspectionRecords); + + /** + * 新增记录 + * + * @param XjInspectionRecords 记录 + * @return 结果 + */ + public int insertXjInspectionRecords(XjInspectionRecords XjInspectionRecords); + + /** + * 修改记录 + * + * @param XjInspectionRecords 记录 + * @return 结果 + */ + public int updateXjInspectionRecords(XjInspectionRecords XjInspectionRecords); + + /** + * 批量删除记录 + * + * @param ids 需要删除的记录主键集合 + * @return 结果 + */ + public int deleteXjInspectionRecordsByIds(Long[] ids); + + /** + * 删除记录信息 + * + * @param id 记录主键 + * @return 结果 + */ + public int deleteXjInspectionRecordsById(Long id); + + List getInspectionTasksYichangCountByParmas(HashMap params); + +} diff --git a/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/IXjInspectionRoutesService.java b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/IXjInspectionRoutesService.java new file mode 100644 index 0000000..7916f7f --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/IXjInspectionRoutesService.java @@ -0,0 +1,69 @@ +package com.fastbee.xunjian.service; + + +import com.fastbee.xunjian.domain.XjInspectionRoutes; + +import java.util.List; + +/** + * 巡检路线Service接口 + * + * @author kenlixunjian + * @date 2023-08-04 + */ +public interface IXjInspectionRoutesService { + /** + * 查询巡检路线 + * + * @param id 巡检路线主键 + * @return 巡检路线 + */ + public XjInspectionRoutes selectXjInspectionRoutesById(Long id); + + /** + * 查询巡检路线列表 + * + * @param XjInspectionRoutes 巡检路线 + * @return 巡检路线集合 + */ + public List selectXjInspectionRoutesList(XjInspectionRoutes XjInspectionRoutes); + + /** + * 新增巡检路线 + * + * @param XjInspectionRoutes 巡检路线 + * @return 结果 + */ + public int insertXjInspectionRoutes(XjInspectionRoutes XjInspectionRoutes); + + /** + * 修改巡检路线 + * + * @param XjInspectionRoutes 巡检路线 + * @return 结果 + */ + public int updateXjInspectionRoutes(XjInspectionRoutes XjInspectionRoutes); + + /** + * 批量删除巡检路线 + * + * @param ids 需要删除的巡检路线主键集合 + * @return 结果 + */ + public int deleteXjInspectionRoutesByIds(Long[] ids); + + /** + * 删除巡检路线信息 + * + * @param id 巡检路线主键 + * @return 结果 + */ + public int deleteXjInspectionRoutesById(Long id); + + String importData(List userList, boolean updateSupport, String operName); + + XjInspectionRoutes selectXjInspectionRoutesByQrSn(String qrSn); + + + +} diff --git a/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/impl/XjInspectionNoteServiceImpl.java b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/impl/XjInspectionNoteServiceImpl.java new file mode 100644 index 0000000..255447b --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/impl/XjInspectionNoteServiceImpl.java @@ -0,0 +1,90 @@ +package com.fastbee.xunjian.service.impl; + +import com.fastbee.common.utils.DateUtils; +import com.fastbee.xunjian.domain.XjInspectionNote; +import com.fastbee.xunjian.service.IXjInspectionNoteService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.fastbee.xunjian.mapper.XjInspectionNoteMapper; + +import java.util.List; + +/** + * 巡检注意事项Service业务层处理 + * + * @author kenlixunjian + * @date 2023-08-23 + */ +@Service +public class XjInspectionNoteServiceImpl implements IXjInspectionNoteService { + @Autowired + private XjInspectionNoteMapper XjInspectionNoteMapper; + + /** + * 查询巡检注意事项 + * + * @param id 巡检注意事项主键 + * @return 巡检注意事项 + */ + @Override + public XjInspectionNote selectXjInspectionNoteById(Long id) { + return XjInspectionNoteMapper.selectXjInspectionNoteById(id); + } + + /** + * 查询巡检注意事项列表 + * + * @param XjInspectionNote 巡检注意事项 + * @return 巡检注意事项 + */ + @Override + public List selectXjInspectionNoteList(XjInspectionNote XjInspectionNote) { + return XjInspectionNoteMapper.selectXjInspectionNoteList(XjInspectionNote); + } + + /** + * 新增巡检注意事项 + * + * @param XjInspectionNote 巡检注意事项 + * @return 结果 + */ + @Override + public int insertXjInspectionNote(XjInspectionNote XjInspectionNote) { + XjInspectionNote.setCreateTime(DateUtils.getNowDate()); + return XjInspectionNoteMapper.insertXjInspectionNote(XjInspectionNote); + } + + /** + * 修改巡检注意事项 + * + * @param XjInspectionNote 巡检注意事项 + * @return 结果 + */ + @Override + public int updateXjInspectionNote(XjInspectionNote XjInspectionNote) { + XjInspectionNote.setUpdateTime(DateUtils.getNowDate()); + return XjInspectionNoteMapper.updateXjInspectionNote(XjInspectionNote); + } + + /** + * 批量删除巡检注意事项 + * + * @param ids 需要删除的巡检注意事项主键 + * @return 结果 + */ + @Override + public int deleteXjInspectionNoteByIds(Long[] ids) { + return XjInspectionNoteMapper.deleteXjInspectionNoteByIds(ids); + } + + /** + * 删除巡检注意事项信息 + * + * @param id 巡检注意事项主键 + * @return 结果 + */ + @Override + public int deleteXjInspectionNoteById(Long id) { + return XjInspectionNoteMapper.deleteXjInspectionNoteById(id); + } +} diff --git a/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/impl/XjInspectionRecordsServiceImpl.java b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/impl/XjInspectionRecordsServiceImpl.java new file mode 100644 index 0000000..37326dd --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/impl/XjInspectionRecordsServiceImpl.java @@ -0,0 +1,249 @@ +package com.fastbee.xunjian.service.impl; + +import cn.hutool.core.date.DateUtil; +import com.fastbee.common.utils.DateUtils; +import com.fastbee.common.utils.SecurityUtils; +import com.fastbee.xunjian.domain.XjInspectionRecords; +import com.fastbee.xunjian.mapper.XjInspectionRecordsMapper; +import com.fastbee.xunjian.service.IXjInspectionRecordsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.HashMap; +import java.util.List; + +/** + * 记录Service业务层处理 + * + * @author kenlixunjian + * @date 2023-08-04 + */ +@Service +public class XjInspectionRecordsServiceImpl implements IXjInspectionRecordsService { + @Autowired + private XjInspectionRecordsMapper XjInspectionRecordsMapper; + + /** + * 查询记录 + * + * @param id 记录主键 + * @return 记录 + */ + @Override + public XjInspectionRecords selectXjInspectionRecordsById(Long id) { + XjInspectionRecords XjInspectionRecords = XjInspectionRecordsMapper.selectXjInspectionRecordsById(id); + return XjInspectionRecords; + } + + /** + * 查询记录列表 + * + * @param XjInspectionRecords 记录 + * @return 记录 + */ + @Override + public List selectXjInspectionRecordsList(XjInspectionRecords XjInspectionRecords) { +// try { +// if (SecurityUtils.getLoginUser().getUser().isZuzhang()) { +// KlxjInspectionPersonnels klxjInspectionPersonnels = SecurityUtils.getLoginUser().getPersonnels(); +// if (klxjInspectionPersonnels != null) { +// XjInspectionRecords.setGroupId(klxjInspectionPersonnels.getGroupId()); +// } +// } else if (SecurityUtils.getLoginUser().getUser().isXunjianyuan()) { +// KlxjInspectionPersonnels klxjInspectionPersonnels = SecurityUtils.getLoginUser().getPersonnels(); +// if (klxjInspectionPersonnels != null) { +// XjInspectionRecords.setInspectionPersonnelId(klxjInspectionPersonnels.getId()); +// } +// } +// } catch (Exception a) { +// } + List XjInspectionRecords1 = + XjInspectionRecordsMapper.selectXjInspectionRecordsList(XjInspectionRecords); + +// for (XjInspectionRecords inspectionRecords : XjInspectionRecords1) { +// List list = inspectionEventsService.selectKlxjInspectionEventsList(new KlxjInspectionEvents() {{ +// setInspectionRecordId(inspectionRecords.getId()); +// }}); +// if (list != null && list.size() > 0) { +// inspectionRecords.setAbnormalType(list.get(0).getAbnormalType()); +// } +// } + + return XjInspectionRecords1; + } + + /** + * 新增记录 + * + * @param XjInspectionRecords 记录 + * @return 结果 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public int insertXjInspectionRecords(XjInspectionRecords XjInspectionRecords) { + XjInspectionRecords.setCreateTime(DateUtils.getNowDate()); +// //执行人 +// KlxjInspectionPersonnels klxjInspectionPersonnels = +// inspectionPersonnelsService.selectKlxjInspectionPersonnelsById(XjInspectionRecords.getInspectionPersonnelId()); +// XjInspectionRecords.setGroupId(klxjInspectionPersonnels.getGroupId()); +// if (XjInspectionRecords.getInspectionRouteId() != null) { +// KlxjInspectionTasks klxjInspectionTasks = new KlxjInspectionTasks(); +// klxjInspectionTasks.setParams(new HashMap() {{ +// put("taskTime", DateUtil.date().toString()); +// }}); +// klxjInspectionTasks.setInspectionPersonnelId(XjInspectionRecords.getInspectionPersonnelId()); +// List klxjInspectionTasks1 = inspectionTasksService.selectKlxjInspectionTasksList(klxjInspectionTasks); +// if (klxjInspectionTasks1 != null) { +// for (KlxjInspectionTasks inspectionTasks : klxjInspectionTasks1) { +// if (XjInspectionRecords.getInspectionTaskId() != null && XjInspectionRecords.getInspectionTaskId() != 0) { +// break; +// } +// for (KlxjInspectionRoutes klxjInspectionRoutes : inspectionTasks.getInspectionRouteList()) { +// if (klxjInspectionRoutes.getId().equals(XjInspectionRecords.getInspectionRouteId())) { +// XjInspectionRecords.setInspectionPlanId(inspectionTasks.getInspectionPlanId()); +// XjInspectionRecords.setInspectionTaskId(inspectionTasks.getId()); +// break; +// } +// } +// } +// } +// } +// if (XjInspectionRecords.getInspectionTaskId() != null && XjInspectionRecords.getInspectionTaskId() != 0) { +// KlxjInspectionTasks klxjInspectionTasks = inspectionTasksService.selectKlxjInspectionTasksById(XjInspectionRecords.getInspectionTaskId()); +// +// +// if (klxjInspectionTasks != null && klxjInspectionTasks.getInspectionRouteIds() != null && !klxjInspectionTasks.getInspectionRouteIds().equals("")) { +// +// List collect = klxjInspectionTasks.getCompletedInspectionRouteList().stream().map(t -> t.getId()).collect(Collectors.toList()); +// if (!collect.contains(XjInspectionRecords.getInspectionRouteId())) { +// String completedInspectionRouteIds = klxjInspectionTasks.getCompletedInspectionRouteIds() == null || klxjInspectionTasks.getCompletedInspectionRouteIds().equals("") +// ? "" + XjInspectionRecords.getInspectionRouteId() +// : klxjInspectionTasks.getCompletedInspectionRouteIds() + "," + XjInspectionRecords.getInspectionRouteId(); +// klxjInspectionTasks.setCompletedInspectionRouteIds(completedInspectionRouteIds); +// if (!klxjInspectionTasks.getTaskStatus().equals("4")) { +// if (klxjInspectionTasks.getInspectionRouteIds().split(",").length == klxjInspectionTasks.getCompletedInspectionRouteIds().split(",").length) { +// klxjInspectionTasks.setTaskStatus("3"); +// } else { +// klxjInspectionTasks.setTaskStatus("2"); +// } +// } +// } +// inspectionTasksService.updateKlxjInspectionTasks(klxjInspectionTasks); +// } +// } + return XjInspectionRecordsMapper.insertXjInspectionRecords(XjInspectionRecords); + } + + /** + * 修改记录 + * + * @param XjInspectionRecords 记录 + * @return 结果 + */ + @Override + public int updateXjInspectionRecords(XjInspectionRecords XjInspectionRecords) { + XjInspectionRecords.setUpdateTime(DateUtils.getNowDate()); +// KlxjInspectionPersonnels klxjInspectionPersonnels = inspectionPersonnelsService.selectKlxjInspectionPersonnelsById(XjInspectionRecords.getInspectionPersonnelId()); +// XjInspectionRecords.setGroupId(klxjInspectionPersonnels.getGroupId()); +// if (XjInspectionRecords.getInspectionRouteId() != null) { +// KlxjInspectionTasks klxjInspectionTasks = new KlxjInspectionTasks(); +// klxjInspectionTasks.setParams(new HashMap() {{ +// put("taskTime", DateUtil.date().toString()); +// }}); +// klxjInspectionTasks.setInspectionPersonnelId(XjInspectionRecords.getInspectionPersonnelId()); +// List klxjInspectionTasks1 = inspectionTasksService.selectKlxjInspectionTasksList(klxjInspectionTasks); +// if (klxjInspectionTasks1 != null) { +// for (KlxjInspectionTasks inspectionTasks : klxjInspectionTasks1) { +// if (XjInspectionRecords.getInspectionTaskId() != null && XjInspectionRecords.getInspectionTaskId() != 0) { +// break; +// } +// for (KlxjInspectionRoutes klxjInspectionRoutes : inspectionTasks.getInspectionRouteList()) { +// if (klxjInspectionRoutes.getId().equals(XjInspectionRecords.getInspectionRouteId())) { +// XjInspectionRecords.setInspectionPlanId(inspectionTasks.getInspectionPlanId()); +// XjInspectionRecords.setInspectionTaskId(inspectionTasks.getId()); +// break; +// } +// } +// } +// } +// } +// if (XjInspectionRecords.getInspectionTaskId() != null && XjInspectionRecords.getInspectionTaskId() != 0) { +// KlxjInspectionTasks klxjInspectionTasks = inspectionTasksService.selectKlxjInspectionTasksById(XjInspectionRecords.getInspectionTaskId()); +// +// +// if (klxjInspectionTasks != null && klxjInspectionTasks.getInspectionRouteIds() != null && !klxjInspectionTasks.getInspectionRouteIds().equals("")) { +// +// List collect = klxjInspectionTasks.getCompletedInspectionRouteList().stream().map(t -> t.getId()).collect(Collectors.toList()); +// if (!collect.contains(XjInspectionRecords.getInspectionRouteId())) { +// klxjInspectionTasks.setCompletedInspectionRouteIds(klxjInspectionTasks.getCompletedInspectionRouteIds() == null +// ? "" + XjInspectionRecords.getInspectionRouteId() +// : klxjInspectionTasks.getCompletedInspectionRouteIds() + "," + XjInspectionRecords.getInspectionRouteId()); +// if (!klxjInspectionTasks.getTaskStatus().equals("4")) { +// if (klxjInspectionTasks.getCompletedInspectionRouteIds().split(",").length == klxjInspectionTasks.getCompletedInspectionRouteIds().split(",").length) { +// klxjInspectionTasks.setTaskStatus("3"); +// } else { +// klxjInspectionTasks.setTaskStatus("2"); +// } +// } +// } +// inspectionTasksService.updateKlxjInspectionTasks(klxjInspectionTasks); +// } +// } + return XjInspectionRecordsMapper.updateXjInspectionRecords(XjInspectionRecords); + } + + /** + * 批量删除记录 + * + * @param ids 需要删除的记录主键 + * @return 结果 + */ + @Override + public int deleteXjInspectionRecordsByIds(Long[] ids) { + return XjInspectionRecordsMapper.deleteXjInspectionRecordsByIds(ids); + } + + /** + * 删除记录信息 + * + * @param id 记录主键 + * @return 结果 + */ + @Override + public int deleteXjInspectionRecordsById(Long id) { + return XjInspectionRecordsMapper.deleteXjInspectionRecordsById(id); + } + + @Override + public List getInspectionTasksYichangCountByParmas(HashMap params) { + return XjInspectionRecordsMapper.getInspectionTasksYichangCountByParmas(params); + } + +// @Override +// public List listByGroupName(KlxjInspectiontargetGroup +// klxjInspectiontargetGroup) { +// KlxjInspectiontargetGroup klxjInspectiontargetGroup1 = +// klxjInspectiontargetGroupMapper.selectByName(klxjInspectiontargetGroup.getName()); +// if(null == klxjInspectiontargetGroup1){ +// return new ArrayList(); +// } +// if(StringUtils.isEmpty(klxjInspectiontargetGroup1.getRoutesIds())){ +// return new ArrayList(); +// } +// klxjInspectiontargetGroup.setRoutesIds(klxjInspectiontargetGroup1.getRoutesIds()); +// if(StringUtils.isEmpty(klxjInspectiontargetGroup.getEndTime())){ +// klxjInspectiontargetGroup.setEndTime(DateUtils.getTime()); +// } +// if(StringUtils.isEmpty(klxjInspectiontargetGroup.getBeginTime())){ +// Calendar calendar = Calendar.getInstance(); +// int year = calendar.get(Calendar.YEAR); +//// calendar.add(Calendar.DATE,-30); +//// Date beginDate = calendar.getTime(); +// klxjInspectiontargetGroup.setBeginTime(year + "-01-01 00:00:00"); +// } +// PageUtils.startPage(); +// List XjInspectionRecords = XjInspectionRecordsMapper.selectListByRoutesIds(klxjInspectiontargetGroup); +// return XjInspectionRecords; +// } +} diff --git a/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/impl/XjInspectionRoutesServiceImpl.java b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/impl/XjInspectionRoutesServiceImpl.java new file mode 100644 index 0000000..1182c0e --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/java/com/fastbee/xunjian/service/impl/XjInspectionRoutesServiceImpl.java @@ -0,0 +1,831 @@ +package com.fastbee.xunjian.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONArray; +import cn.hutool.json.JSONObject; +import com.fastbee.common.exception.ServiceException; +import com.fastbee.common.utils.DateUtils; +import com.fastbee.common.utils.StringUtils; +import com.fastbee.xunjian.domain.XjInspectionNote; +import com.fastbee.xunjian.domain.XjInspectionRoutes; +import com.fastbee.xunjian.mapper.XjInspectionRoutesMapper; +import com.fastbee.xunjian.service.IXjInspectionNoteService; +import com.fastbee.xunjian.service.IXjInspectionRoutesService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.stream.Collectors; + + +/** + * 巡检路线Service业务层处理 + * + * @author kenlixunjian + * @date 2023-08-04 + */ +@Service +public class XjInspectionRoutesServiceImpl implements IXjInspectionRoutesService { + @Autowired + private XjInspectionRoutesMapper XjInspectionRoutesMapper; +// @Autowired +// private KlxjQrCodeMapper klxjQrCodeMapper; + + private static final Logger log = LoggerFactory.getLogger(XjInspectionRoutesServiceImpl.class); + + @Autowired + private IXjInspectionNoteService iXjInspectionNoteService; + +// @Autowired +// private ISysConfigService configService; +// +// @Autowired +// private ISysDictTypeService dictTypeService; + + /** + * 查询巡检路线 + * + * @param id 巡检路线主键 + * @return 巡检路线 + */ + @Override + public XjInspectionRoutes selectXjInspectionRoutesById(Long id) { + XjInspectionRoutes XjInspectionRoutes = XjInspectionRoutesMapper.selectXjInspectionRoutesById(id); + + if (XjInspectionRoutes.getInspectionNoteIds() != null && !XjInspectionRoutes.getInspectionNoteIds().equals("")) { + XjInspectionNote xjInspectionNote = new XjInspectionNote(); +// XjInspectionNote.setParams(new HashMap() {{ +// put("ids", XjInspectionRoutes.getInspectionNoteIds()); +// }}); + List XjInspectionNotes = + iXjInspectionNoteService.selectXjInspectionNoteList(xjInspectionNote); + XjInspectionRoutes.setInspectionNote(XjInspectionNotes); + } + + return XjInspectionRoutes; + } + + /** + * 查询巡检路线列表 + * + * @param XjInspectionRoutes 巡检路线 + * @return 巡检路线 + */ + @Override + public List selectXjInspectionRoutesList(XjInspectionRoutes XjInspectionRoutes) { + List XjInspectionRoutes1 = XjInspectionRoutesMapper.selectXjInspectionRoutesList(XjInspectionRoutes); + return XjInspectionRoutes1; + } + + + /** + * 新增巡检路线 + * + * @param XjInspectionRoutes 巡检路线 + * @return 结果 + */ + @Override + public int insertXjInspectionRoutes(XjInspectionRoutes XjInspectionRoutes) { + XjInspectionRoutes.setCreateTime(DateUtils.getNowDate()); +// if (XjInspectionRoutes.getQrCodeId() != null && XjInspectionRoutes.getQrCodeId() != 0) { +// KlxjQrCode klxjQrCode = klxjQrCodeMapper.selectKlxjQrCodeById(XjInspectionRoutes.getQrCodeId()); +// if (selectXjInspectionRoutesByQrSn(klxjQrCode.getCodeSn()) != null) { +// throw new RuntimeException("二维码已被绑定"); +// } +// XjInspectionRoutes.setQrCodeSn(klxjQrCode.getCodeSn()); +// } +// if (XjInspectionRoutes.getEngineeringObjectType() != null && XjInspectionRoutes.getEngineeringObjectId() != null && XjInspectionRoutes.getEngineeringObjectId() != 0L) { +// KlxjEngineeringVo klxjEngineeringVo = new KlxjEngineeringVo(); +// klxjEngineeringVo.setEngineeringObjectType(XjInspectionRoutes.getEngineeringObjectType()); +// klxjEngineeringVo.setEngineeringObjectId(XjInspectionRoutes.getEngineeringObjectId().toString()); +// Object engineeringData = getEngineeringData(klxjEngineeringVo); +// setRouteDataByEngineeringObjectId(XjInspectionRoutes, klxjEngineeringVo, engineeringData); +// } + return XjInspectionRoutesMapper.insertXjInspectionRoutes(XjInspectionRoutes); + } + +// private void setRouteDataByEngineeringObjectId(XjInspectionRoutes XjInspectionRoutes, KlxjEngineeringVo klxjEngineeringVo, Object engineeringData) { +//// switch (EngineeringObjectType.getName(klxjEngineeringVo.getEngineeringObjectType())) { +//// case SHUIZHA_TYPE: +//// +//// BaseSluiceInfo baseSluiceInfo = BeanUtil.toBean(engineeringData, BaseSluiceInfo.class); +//// if (baseSluiceInfo != null) { +//// XjInspectionRoutes.setName(baseSluiceInfo.getName()); +//// XjInspectionRoutes.setQuyuma(baseSluiceInfo.getRegion()); +//// XjInspectionRoutes.setPosition(baseSluiceInfo.getPosition()); +//// ArrayList list = new ArrayList<>(); +//// if (StringUtils.isNotEmpty(baseSluiceInfo.getLatitude()) || StringUtils.isNotEmpty(baseSluiceInfo.getLongitude())) { +//// list.add(baseSluiceInfo.getLongitude()); +//// list.add(baseSluiceInfo.getLatitude()); +//// } +//// String str = "{\"geometry\":{\"coordinates\":" + list.toString() + ",\"type\":\"Point\"},\"type\":\"Feature\",\"properties\":{\"altitude\":\"0\",\"textDisplayStyle\":\"0\",\"iconStyle\":\"33\"}}"; +//// XjInspectionRoutes.setLatAndLong(str); +//// } +//// break; +//// case BENGFANG_TYPE: +//// BasePumpHouseInfo basePumpHouseInfo = BeanUtil.toBean(engineeringData, BasePumpHouseInfo.class); +//// if (basePumpHouseInfo != null) { +//// XjInspectionRoutes.setName(basePumpHouseInfo.getName()); +//// XjInspectionRoutes.setQuyuma(basePumpHouseInfo.getRegion()); +//// XjInspectionRoutes.setPosition(basePumpHouseInfo.getPosition()); +//// ArrayList list = new ArrayList<>(); +//// if (StringUtils.isNotEmpty(basePumpHouseInfo.getLatitude()) || StringUtils.isNotEmpty(basePumpHouseInfo.getLongitude())) { +//// list.add(basePumpHouseInfo.getLongitude()); +//// list.add(basePumpHouseInfo.getLatitude()); +//// } +//// String str = "{\"geometry\":{\"coordinates\":" + list.toString() + ",\"type\":\"Point\"},\"type\":\"Feature\",\"properties\":{\"altitude\":\"0\",\"textDisplayStyle\":\"0\",\"iconStyle\":\"33\"}}"; +//// XjInspectionRoutes.setLatAndLong(str); +//// } +//// +//// break; +//// case SHUIKU_TYPE: +//// BaseReservoirInfo baseReservoirInfo = BeanUtil.toBean(engineeringData, BaseReservoirInfo.class); +//// if (baseReservoirInfo != null) { +//// XjInspectionRoutes.setName(baseReservoirInfo.getName()); +//// XjInspectionRoutes.setQuyuma(baseReservoirInfo.getRegion()); +//// XjInspectionRoutes.setPosition(baseReservoirInfo.getPosition()); +//// ArrayList list = new ArrayList<>(); +//// if (StringUtils.isNotEmpty(baseReservoirInfo.getLatitude()) || StringUtils.isNotEmpty(baseReservoirInfo.getLongitude())) { +//// list.add(baseReservoirInfo.getLongitude()); +//// list.add(baseReservoirInfo.getLatitude()); +//// } +//// String str = "{\"geometry\":{\"coordinates\":" + list.toString() + ",\"type\":\"Point\"},\"type\":\"Feature\",\"properties\":{\"altitude\":\"0\",\"textDisplayStyle\":\"0\",\"iconStyle\":\"33\"}}"; +//// XjInspectionRoutes.setLatAndLong(str); +//// } +//// break; +//// case DUCAO_TYPE: +//// KlAqueduct klAqueduct = BeanUtil.toBean(engineeringData, KlAqueduct.class); +//// if (klAqueduct != null) { +//// XjInspectionRoutes.setName(klAqueduct.getName()); +//// XjInspectionRoutes.setPosition(klAqueduct.getPosition()); +//// ArrayList list = new ArrayList<>(); +//// if (StringUtils.isNotEmpty(klAqueduct.getLongLat())) { +//// list.addAll(Arrays.asList(klAqueduct.getLongLat().split(","))); +//// } +//// String str = "{\"geometry\":{\"coordinates\":" + list.toString() + ",\"type\":\"Point\"},\"type\":\"Feature\",\"properties\":{\"altitude\":\"0\",\"textDisplayStyle\":\"0\",\"iconStyle\":\"33\"}}"; +//// XjInspectionRoutes.setLatAndLong(str); +//// } +//// break; +//// } +// } + + // private void getRange(HhReachInfo hhReachInfo, Map mapparse, int type) { +// +// List> features = (List>) mapparse.get("features"); +// ArrayList list1 = new ArrayList<>(); +// if (features != null && features.size() > 0) { +// for (Map feature : features) { +// ArrayList list = new ArrayList<>(); +// ArrayList listfan = new ArrayList<>(); +// ArrayList listdata = new ArrayList<>(); +// Map geometry = (Map) feature.get("geometry"); +// List> coordinates = (List>) geometry.get("coordinates"); +// for (int i = 1; i < coordinates.size(); i++) { +// List objects1 = (List) Convert.toList(coordinates.get(i - 1)); +// List objects2 = (List) Convert.toList(coordinates.get(i)); +// BigDecimal long1 = objects1.get(0); +// BigDecimal lat1 = objects1.get(1); +// BigDecimal long2 = objects2.get(0); +// BigDecimal lat2 = objects2.get(1); +// if (long1 != null && lat1 != null && lat2 != null && long2 != null) { +// if (long2.compareTo(long1) == 0 || lat2.compareTo(lat1) == 0) { +// BigDecimal longdata = long2; +// BigDecimal latdata = lat2; +// BigDecimal longdatafan = long2; +// BigDecimal latdatafan = lat2; +// +// BigDecimal lomglat = new BigDecimal(0.00001); +// BigDecimal num = lomglat.multiply(new BigDecimal(type)).setScale(12, RoundingMode.FLOOR); +// if (i == 1) { +// BigDecimal longdata1 = long1; +// BigDecimal latdata1 = lat1; +// BigDecimal longdata1fan = long1; +// BigDecimal latdata1fan = lat1; +// if (long2.compareTo(long1) == 0) { +// if (lat2.compareTo(lat1) > 0) { +// longdata1 = long1.subtract(num); +// longdata1fan = long1.add(num); +// } else if (lat2.compareTo(lat1) < 0) { +// longdata1 = long1.add(num); +// longdata1fan = long1.subtract(num); +// } +// } +// if (lat2.compareTo(lat1) == 0) { +// if (long2.compareTo(long1) > 0) { +// latdata1 = lat1.add(num); +// latdata1fan = lat1.subtract(num); +// } else if (long2.compareTo(long1) < 0) { +// latdata1 = lat1.subtract(num); +// latdata1fan = lat1.add(num); +// } +// } +// ArrayList newlist = new ArrayList<>(); +// ArrayList newlistfan = new ArrayList<>(); +// newlistfan.add(longdata1fan); +// newlistfan.add(latdata1fan); +// listfan.add(newlist); +// newlist.add(longdata1); +// newlist.add(latdata1); +// list.add(newlist); +// } +// +// if (long2.compareTo(long1) == 0) { +// if (lat2.compareTo(lat1) > 0) { +// longdata = long2.subtract(num); +// longdatafan = long2.add(num); +// } else if (lat2.compareTo(lat1) < 0) { +// longdata = long2.add(num); +// longdatafan = long2.subtract(num); +// } +// } +// if (lat2.compareTo(lat1) == 0) { +// if (long2.compareTo(long1) > 0) { +// latdata = lat2.add(num); +// latdatafan = lat2.subtract(num); +// } else if (long2.compareTo(long1) < 0) { +// latdata = lat2.subtract(num); +// latdatafan = lat2.add(num); +// } +// } +// ArrayList newlist = new ArrayList<>(); +// ArrayList newlistfan = new ArrayList<>(); +// newlist.add(longdata); +// newlist.add(latdata); +// newlistfan.add(longdatafan); +// newlistfan.add(latdatafan); +// listfan.add(newlistfan); +// list.add(newlist); +// +// } else { +// isSanjiaoxing(type, list, listfan, i, long1, lat1, long2, lat2); +// } +// } +// +// } +// ArrayList oneSemicircle = new ArrayList<>(); +// ArrayList twoSemicircle = new ArrayList<>(); +// if (list.size() > 0 && listfan.size() > 0) { +// oneSemicircle = getSemicircle(list.get(0), coordinates.get(0), type, true); +// twoSemicircle = getSemicircle(list.get(list.size() - 1), coordinates.get(coordinates.size() - 1), type, false); +// } +// Collections.reverse(listfan); +// listdata.addAll(oneSemicircle); +// listdata.addAll(list); +// listdata.addAll(twoSemicircle); +// listdata.addAll(listfan); +// String str = "{\"type\": \"Feature\",\"properties\": {\"type\": \"polyline\",\"style\": {\"color\": \"#ff0000\", \"opacity\": 0.5,\"outline\": true,\"clampToGround\": true},\"group\": \"默认分组\"},\"geometry\": {\"type\": \"LineString\",\"coordinates\": " + listdata + "} }"; +// Map newparse = (Map) JSON.parse(str); +//// features.add(newparse); //在原有内容上添加 +//// mapparse.put("features",features); +// list1.add(newparse); +// } +// } +// +// +// mapparse.put("features", list1); +// if (type == 1000) { +// hhReachInfo.setRange1000(mapparse.toString()); +// } else if (type == 5000) { +// hhReachInfo.setRange5000(mapparse.toString()); +// } else if (type == 10000) { +// hhReachInfo.setRange10000(mapparse.toString()); +// } +// } + private ArrayList getSemicircle(ArrayList arrayList, List strings, int type, boolean flag) { + BigDecimal long1 = (BigDecimal) arrayList.get(0); + List objects1 = (List) Convert.toList(strings); + BigDecimal long2 = objects1.get(0); + BigDecimal lat1 = (BigDecimal) arrayList.get(1); + BigDecimal lat2 = objects1.get(1); + BigDecimal angle = new BigDecimal(0); + BigDecimal lomglat = new BigDecimal(0.00001); + BigDecimal num = lomglat.multiply(new BigDecimal(type)).setScale(8, RoundingMode.FLOOR); + ArrayList data = new ArrayList<>(); + // 平行于经纬度 + if (long2.compareTo(long1) == 0 || lat2.compareTo(lat1) == 0) { + if (long2.compareTo(long1) == 0) { + if (lat2.compareTo(lat1) > 0) { + angle = flag ? new BigDecimal(90) : new BigDecimal(270); + + } + if (lat2.compareTo(lat1) < 0) { + angle = flag ? new BigDecimal(270) : new BigDecimal(90); + } + } + + if (lat2.compareTo(lat1) == 0) { + if (long2.compareTo(long1) > 0) { + angle = flag ? new BigDecimal(360) : new BigDecimal(180); + + } + if (long2.compareTo(long1) < 0) { + angle = flag ? new BigDecimal(180) : new BigDecimal(360); + } + } + + } else { + +// double degrees = Math.acos((a*a + b*b -c*c)/(2.0*a*b)); +// // 用角度表示的角 +// Math.toDegrees(degrees); + + if (long2.compareTo(long1) > 0 && lat2.compareTo(lat1) > 0) { + BigDecimal c = lat2.subtract(lat1); + BigDecimal b = long2.subtract(long1); + BigDecimal a = num; + double degrees = getjiaodu(c, b, a); + if (flag) { + angle = new BigDecimal((180 + degrees - 180) < 0 ? 360.0 + (180 + degrees - 180) : 180 + degrees - 180).setScale(12, RoundingMode.FLOOR); + } else { + angle = new BigDecimal(180 + degrees).setScale(12, RoundingMode.FLOOR); + } + //右下画 + } else if (long2.compareTo(long1) > 0 && lat2.compareTo(lat1) < 0) { + BigDecimal c = lat1.subtract(lat2); + BigDecimal b = num; + BigDecimal a = long2.subtract(long1); + double degrees = getjiaodu(c, b, a); + if (flag) { + angle = new BigDecimal((180 - degrees - 180) < 0 ? 360.0 + (180 - degrees - 180) : 180 - degrees - 180).setScale(12, RoundingMode.FLOOR); + } else { + angle = new BigDecimal(180 - degrees).setScale(12, RoundingMode.FLOOR); + } + //左上画 + } else if (long2.compareTo(long1) < 0 && lat2.compareTo(lat1) > 0) { + BigDecimal c = lat2.subtract(lat1); + BigDecimal b = num; + BigDecimal a = long1.subtract(long2); + double degrees = getjiaodu(c, b, a); + if (flag) { + angle = new BigDecimal((360.0 - degrees - 180) < 0 ? 360.0 + (360.0 - degrees - 180) : 360.0 - degrees - 180).setScale(12, RoundingMode.FLOOR); + } else { + angle = new BigDecimal(360.0 - degrees).setScale(12, RoundingMode.FLOOR); + } + //坐下画 + } else if (long2.compareTo(long1) < 0 && lat2.compareTo(lat1) < 0) { + BigDecimal c = lat1.subtract(lat2); + BigDecimal b = num; + BigDecimal a = long1.subtract(long2); + double degrees = getjiaodu(c, b, a); + if (flag) { + angle = new BigDecimal((degrees - 180) < 0 ? 360.0 + (degrees - 180) : degrees - 180).setScale(12, RoundingMode.FLOOR); + } else { + angle = new BigDecimal(degrees).setScale(12, RoundingMode.FLOOR); + } + } + + + } + + +// x1 = x0 + r * cos(a0 * π/180) +// y1 = y0 + r * sin(a0 * π/180) + if (angle.compareTo(new BigDecimal(0)) > 0) { + for (int i = 1; i < 17; i++) { + BigDecimal newangle = angle.subtract(new BigDecimal(i * 10)); + newangle = newangle.compareTo(BigDecimal.ZERO) < 1 ? (new BigDecimal(360)).add(newangle) : newangle; + BigDecimal longdata = long2.add(num.multiply(BigDecimal.valueOf(Math.cos(Double.valueOf(String.valueOf(newangle)) * Math.PI / 180.0))).setScale(12, RoundingMode.FLOOR)); + BigDecimal latdata = lat2.add(num.multiply(BigDecimal.valueOf(Math.sin(Double.valueOf(String.valueOf(newangle)) * Math.PI / 180.0))).setScale(12, RoundingMode.FLOOR)); + ArrayList newlist = new ArrayList<>(); + newlist.add(longdata); + newlist.add(latdata); + data.add(newlist); + } + } + + + return data; + } + + private double getjiaodu(BigDecimal c, BigDecimal b, BigDecimal a) { + + //a2+b2-c2* / 2*ab + BigDecimal aa = a.multiply(a); + BigDecimal bb = b.multiply(b); + BigDecimal cc = b.multiply(c); + BigDecimal abc = aa.add(bb).subtract(cc); + BigDecimal ab2 = (new BigDecimal(2.0)).multiply(a).multiply(b); + BigDecimal divide = abc.divide(ab2, 26, RoundingMode.FLOOR); + double degrees = Math.toDegrees(Math.acos(new Double(String.valueOf(divide)))); + return degrees; + } + + private void isSanjiaoxing(int type, ArrayList list, ArrayList listfan, int i, BigDecimal long1, BigDecimal lat1, BigDecimal long2, BigDecimal lat2) { + BigDecimal subtract = long2.subtract(long1); + BigDecimal subtract1 = lat2.subtract(lat1); + BigDecimal mu = new BigDecimal(100000000); + BigDecimal longabs = subtract.abs().multiply(mu).setScale(0, RoundingMode.FLOOR); + BigDecimal latabs = subtract1.abs().multiply(mu).setScale(0, RoundingMode.FLOOR); + //斜边的长度 + BigDecimal sqrt = BigDecimal.valueOf(Math.sqrt(Math.pow(Double.valueOf(String.valueOf(longabs)), 2) + Math.pow(Double.valueOf(String.valueOf(latabs)), 2))).setScale(8, RoundingMode.FLOOR); + //米数 + BigDecimal lomglat = new BigDecimal(0.00001); + //1千米的经纬度度数 + BigDecimal multiply = lomglat.multiply(new BigDecimal(type)).setScale(8, RoundingMode.FLOOR); + // + BigDecimal bizhi = multiply.divide(sqrt, 12, RoundingMode.FLOOR); + BigDecimal longnum = bizhi.multiply(longabs).setScale(8, RoundingMode.FLOOR); + BigDecimal latnum = bizhi.multiply(latabs).setScale(8, RoundingMode.FLOOR); +// break; + ArrayList newlist = new ArrayList<>(); + ArrayList newlistfan = new ArrayList<>(); + //右上画 + if (long2.compareTo(long1) > 0 && lat2.compareTo(lat1) > 0) { + if (i == 1) { + ArrayList listone = new ArrayList<>(); + listone.add(long1.subtract(latnum)); + listone.add(lat1.add(longnum)); + list.add(listone); + ArrayList listonefan = new ArrayList<>(); + listonefan.add(long1.add(latnum)); + listonefan.add(lat1.subtract(longnum)); + listfan.add(listonefan); + } + newlist.add(long2.subtract(latnum)); + newlist.add(lat2.add(longnum)); + newlistfan.add(long2.add(latnum)); + newlistfan.add(lat2.subtract(longnum)); + //右下画 + } else if (long2.compareTo(long1) > 0 && lat2.compareTo(lat1) < 0) { + if (i == 1) { + ArrayList listone = new ArrayList<>(); + listone.add(long1.add(latnum)); + listone.add(lat1.add(longnum)); + list.add(listone); + + ArrayList listonefan = new ArrayList<>(); + listonefan.add(long1.subtract(latnum)); + listonefan.add(lat1.subtract(longnum)); + listfan.add(listonefan); + } + newlist.add(long2.add(latnum)); + newlist.add(lat2.add(longnum)); + newlistfan.add(long2.subtract(latnum)); + newlistfan.add(lat2.subtract(longnum)); + //左上画 + } else if (long2.compareTo(long1) < 0 && lat2.compareTo(lat1) > 0) { + if (i == 1) { + ArrayList listone = new ArrayList<>(); + listone.add(long1.subtract(latnum)); + listone.add(lat1.subtract(longnum)); + list.add(listone); + ArrayList listonefan = new ArrayList<>(); + listonefan.add(long1.add(latnum)); + listonefan.add(lat1.add(longnum)); + listfan.add(listonefan); + } + newlist.add(long2.subtract(latnum)); + newlist.add(lat2.subtract(longnum)); + newlistfan.add(long2.add(latnum)); + newlistfan.add(lat2.add(longnum)); + //坐下画 + } else if (long2.compareTo(long1) < 0 && lat2.compareTo(lat1) < 0) { + if (i == 1) { + ArrayList listone = new ArrayList<>(); + listone.add(long1.add(latnum)); + listone.add(lat1.subtract(longnum)); + list.add(listone); + ArrayList listonefan = new ArrayList<>(); + listonefan.add(long1.subtract(latnum)); + listonefan.add(lat1.add(longnum)); + listfan.add(listonefan); + } + newlist.add(long2.add(latnum)); + newlist.add(lat2.subtract(longnum)); + newlistfan.add(long2.subtract(latnum)); + newlistfan.add(lat2.add(longnum)); + } + listfan.add(newlistfan); + list.add(newlist); + } + + /** + * 修改巡检路线 + * + * @param XjInspectionRoutes 巡检路线 + * @return 结果 + */ + @Override + public int updateXjInspectionRoutes(XjInspectionRoutes XjInspectionRoutes) { + XjInspectionRoutes.setUpdateTime(DateUtils.getNowDate()); +// if (XjInspectionRoutes.getQrCodeId() != null && XjInspectionRoutes.getQrCodeId() != 0) { +// KlxjQrCode klxjQrCode = klxjQrCodeMapper.selectKlxjQrCodeById(XjInspectionRoutes.getQrCodeId()); +// XjInspectionRoutes XjInspectionRoutes1 = selectXjInspectionRoutesByQrSn(klxjQrCode.getCodeSn()); +// if (XjInspectionRoutes1 != null && !XjInspectionRoutes1.getId().equals(XjInspectionRoutes.getId())) { +// throw new RuntimeException("二维码已被绑定"); +// } +// XjInspectionRoutes.setQrCodeSn(klxjQrCode.getCodeSn()); +// } +// if (XjInspectionRoutes.getEngineeringObjectType() != null && XjInspectionRoutes.getEngineeringObjectId() != null && XjInspectionRoutes.getEngineeringObjectId() != 0L) { +// KlxjEngineeringVo klxjEngineeringVo = new KlxjEngineeringVo(); +// klxjEngineeringVo.setEngineeringObjectType(XjInspectionRoutes.getEngineeringObjectType()); +// klxjEngineeringVo.setEngineeringObjectId(XjInspectionRoutes.getEngineeringObjectId().toString()); +// Object engineeringData = getEngineeringData(klxjEngineeringVo); +// setRouteDataByEngineeringObjectId(XjInspectionRoutes, klxjEngineeringVo, engineeringData); +// } + return XjInspectionRoutesMapper.updateXjInspectionRoutes(XjInspectionRoutes); + } + + /** + * 批量删除巡检路线 + * + * @param ids 需要删除的巡检路线主键 + * @return 结果 + */ + @Override + public int deleteXjInspectionRoutesByIds(Long[] ids) { + return XjInspectionRoutesMapper.deleteXjInspectionRoutesByIds(ids); + } + + /** + * 删除巡检路线信息 + * + * @param id 巡检路线主键 + * @return 结果 + */ + @Override + public int deleteXjInspectionRoutesById(Long id) { + return XjInspectionRoutesMapper.deleteXjInspectionRoutesById(id); + } + + @Override + public String importData(List userList, boolean updateSupport, String operName) { + if (StringUtils.isNull(userList) || userList.size() == 0) { + throw new ServiceException("导入巡检对象数据不能为空!"); + } + int successNum = 0; + int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + List collect = userList.stream().filter(t -> t.getQrCodeSn() != null && !t.getQrCodeSn().equals("")).map(t -> t.getQrCodeSn()).collect(Collectors.toList()); + Map idmap = new HashMap<>(); +// if (collect != null && collect.size() > 0) { +// List qrCodeSn = klxjQrCodeMapper.selectKlxjQrCodeList(new KlxjQrCode() {{ +// setParams(new HashMap() {{ +// put("qrCodeSns", collect); +// }}); +// }}); +// idmap = qrCodeSn.stream().collect(Collectors.toMap(t -> t.getCodeSn(), t -> t.getId(), (key1, key2) -> key2)); +// } + HashMap> EngineeringMap = new HashMap<>(); + +// KlxjEngineeringVo klxjEngineeringVo = new KlxjEngineeringVo(); +// klxjEngineeringVo.setEngineeringObjectType(SHUIZHA_TYPE.getType()); +// List shuizhaList = getEngineeringList(klxjEngineeringVo); +//// Map collect1 = ; +// EngineeringMap.put(SHUIZHA_TYPE.getType(), shuizhaList); +// klxjEngineeringVo.setEngineeringObjectType(BENGFANG_TYPE.getType()); +// List bengfangList = getEngineeringList(klxjEngineeringVo); +//// Map collect1 = ; +// EngineeringMap.put(BENGFANG_TYPE.getType(), bengfangList); +// klxjEngineeringVo.setEngineeringObjectType(SHUIKU_TYPE.getType()); +// List shuikuList = getEngineeringList(klxjEngineeringVo); +//// Map collect1 = ; +// EngineeringMap.put(SHUIKU_TYPE.getType(), shuikuList); +// klxjEngineeringVo.setEngineeringObjectType(DUCAO_TYPE.getType()); +// List ducaoList = getEngineeringList(klxjEngineeringVo); +//// Map collect1 = ; +// EngineeringMap.put(DUCAO_TYPE.getType(), ducaoList); +// +// +// for (XjInspectionRoutes user : userList) { +// try { +// user.setQrCodeId(idmap.get(user.getQrCodeSn())); +// // 验证是否存在这个用户 +// XjInspectionRoutes u = XjInspectionRoutesMapper.selectXjInspectionRoutesByName(user.getName()); +// if (StringUtils.isNull(u)) { +// if (StringUtils.isNotEmpty(user.getEngineeringObjectType())) { +// if (EngineeringMap.get(user.getEngineeringObjectType()) != null) { +// if ((user.getEngineeringObjectId() == null && StringUtils.isNotEmpty(user.getName())) || user.getEngineeringObjectId() == 0L && StringUtils.isNotEmpty(user.getName())) { +// switch (EngineeringObjectType.getName(user.getEngineeringObjectType())) { +// case SHUIZHA_TYPE: +// List objects = EngineeringMap.get(user.getEngineeringObjectType()); +// for (Object t : objects) { +// BaseSluiceInfo basePumpHouseInfo = BeanUtil.toBean(t, BaseSluiceInfo.class); +// if (basePumpHouseInfo.getName().contains(user.getName())) { +// user.setEngineeringObjectId(basePumpHouseInfo.getId()); +// break; +// } +// } +// break; +// case BENGFANG_TYPE: +// List objects1 = EngineeringMap.get(user.getEngineeringObjectType()); +// for (Object t : objects1) { +// BasePumpHouseInfo basePumpHouseInfo = BeanUtil.toBean(t, BasePumpHouseInfo.class); +// if (basePumpHouseInfo.getName().contains(user.getName())) { +// user.setEngineeringObjectId(basePumpHouseInfo.getId()); +// } +// } +// +// break; +// case SHUIKU_TYPE: +// List objects2 = EngineeringMap.get(user.getEngineeringObjectType()); +// for (Object t : objects2) { +// BaseReservoirInfo basePumpHouseInfo = BeanUtil.toBean(t, BaseReservoirInfo.class); +// if (basePumpHouseInfo.getName().contains(user.getName())) { +// user.setEngineeringObjectId(basePumpHouseInfo.getId()); +// } +// } +// +// break; +// case DUCAO_TYPE: +// List objects3 = EngineeringMap.get(user.getEngineeringObjectType()); +// for (Object t : objects3) { +// KlAqueduct basePumpHouseInfo = BeanUtil.toBean(t, KlAqueduct.class); +// if (basePumpHouseInfo.getName().contains(user.getName())) { +// user.setEngineeringObjectId(basePumpHouseInfo.getId()); +// } +// } +// break; +// } +// } +// } +// } +// user.setCreateBy(operName); +// this.insertXjInspectionRoutes(user); +// successNum++; +// successMsg.append("
" + successNum + "、水库 " + user.getName() + " 导入成功"); +// } else if (updateSupport) { +// +// if (StringUtils.isNotEmpty(user.getEngineeringObjectType())) { +// if (EngineeringMap.get(user.getEngineeringObjectType()) != null) { +// if (u.getEngineeringObjectId() != null && !u.getEngineeringObjectId().equals(0L) && (user.getEngineeringObjectId() == null || user.getEngineeringObjectId() == 0L)) { +// user.setEngineeringObjectId(u.getEngineeringObjectId()); +// } +// if ((user.getEngineeringObjectId() == null && StringUtils.isNotEmpty(user.getName())) || user.getEngineeringObjectId() == 0L && StringUtils.isNotEmpty(user.getName())) { +// switch (EngineeringObjectType.getName(user.getEngineeringObjectType())) { +// case SHUIZHA_TYPE: +// List objects = EngineeringMap.get(user.getEngineeringObjectType()); +// for (Object t : objects) { +// BaseSluiceInfo basePumpHouseInfo = BeanUtil.toBean(t, BaseSluiceInfo.class); +// if (basePumpHouseInfo.getName().contains(user.getName())) { +// user.setEngineeringObjectId(basePumpHouseInfo.getId()); +// break; +// } +// } +// break; +// case BENGFANG_TYPE: +// List objects1 = EngineeringMap.get(user.getEngineeringObjectType()); +// for (Object t : objects1) { +// BasePumpHouseInfo basePumpHouseInfo = BeanUtil.toBean(t, BasePumpHouseInfo.class); +// if (basePumpHouseInfo.getName().contains(user.getName())) { +// user.setEngineeringObjectId(basePumpHouseInfo.getId()); +// } +// } +// +// break; +// case SHUIKU_TYPE: +// List objects2 = EngineeringMap.get(user.getEngineeringObjectType()); +// for (Object t : objects2) { +// BaseReservoirInfo basePumpHouseInfo = BeanUtil.toBean(t, BaseReservoirInfo.class); +// if (basePumpHouseInfo.getName().contains(user.getName())) { +// user.setEngineeringObjectId(basePumpHouseInfo.getId()); +// } +// } +// +// break; +// case DUCAO_TYPE: +// List objects3 = EngineeringMap.get(user.getEngineeringObjectType()); +// for (Object t : objects3) { +// KlAqueduct basePumpHouseInfo = BeanUtil.toBean(t, KlAqueduct.class); +// if (basePumpHouseInfo.getName().contains(user.getName())) { +// user.setEngineeringObjectId(basePumpHouseInfo.getId()); +// } +// } +// break; +// } +// } +// } +// } +// +// +// user.setUpdateBy(operName); +// user.setId(u.getId()); +// this.updateXjInspectionRoutes(user); +// successNum++; +// successMsg.append("
" + successNum + "、水库 " + user.getName() + " 更新成功"); +// } else { +// failureNum++; +// failureMsg.append("
" + failureNum + "、水库 " + user.getName() + " 已存在"); +// } +// } catch (Exception e) { +// failureNum++; +// String msg = "
" + failureNum + "、水库 " + user.getName() + " 导入失败:"; +// failureMsg.append(msg + e.getMessage()); +// log.error(msg, e); +// } +// } +// if (failureNum > 0) { +// failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); +// throw new ServiceException(failureMsg.toString()); +// } else { +// successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); +// } + return ""; + } + + @Override + public XjInspectionRoutes selectXjInspectionRoutesByQrSn(String qrSn) { + XjInspectionRoutes XjInspectionRoutes = XjInspectionRoutesMapper.selectXjInspectionRoutesByQrSn(qrSn); + if (XjInspectionRoutes != null && XjInspectionRoutes.getInspectionNoteIds() != null && !XjInspectionRoutes.getInspectionNoteIds().equals("")) { + XjInspectionNote XjInspectionNote = new XjInspectionNote(); + XjInspectionNote.setParams(new HashMap() {{ + put("ids", XjInspectionRoutes.getInspectionNoteIds()); + }}); + List XjInspectionNotes = iXjInspectionNoteService.selectXjInspectionNoteList(XjInspectionNote); + XjInspectionRoutes.setInspectionNote(XjInspectionNotes); + } + return XjInspectionRoutes; + } + +// @Override +// public List getEngineeringList(KlxjEngineeringVo klxjEngineeringVo) { +// +// if (!StringUtils.isNotEmpty(klxjEngineeringVo.getEngineeringObjectType())) { +// throw new RuntimeException("工程类型不能为空"); +// } +// JSONObject formMap = new JSONObject(); +// String ip = configService.selectConfigByKey("kenli.ip"); +// String username = configService.selectConfigByKey("kenli.user"); +// String password = configService.selectConfigByKey("kenli.password"); +// formMap.set("username", username); +// formMap.set("password", password); +// String body = HttpUtil.createPost(ip + "/login").body(formMap.toString()).execute().body(); +// JSONObject jsonObject = new JSONObject(body); +// if (jsonObject.get("code").toString().equals("200")) { +// String token = jsonObject.get("token").toString(); +// String Bearer = "Bearer " + token; +// List engineering_object_type +// = dictTypeService.selectDictDataByType("engineering_object_type"); +// if (engineering_object_type +// != null) { +// Map collect = engineering_object_type.stream().collect(Collectors.toMap(t -> t.getDictValue(), t -> t)); +// SysDictData sysDictData = collect.get(klxjEngineeringVo.getEngineeringObjectType()); +// JSONObject map = new JSONObject(); +// map.set("pageSize", 99999); +// map.set("pageNum", 1); +// HashMap headers = new HashMap<>(); +// headers.put("Authorization", Bearer); +// String body1 = HttpUtil.createGet(ip + sysDictData.getParam() + "list").headerMap(headers, false).form(map).execute().body(); +// Object rows = new JSONObject(body1).get("rows"); +// if (rows != null) { +// JSONArray dataList = new JSONArray(rows.toString()); +// return dataList.toBean(List.class); +// } +// +// } +// } +// return new ArrayList<>(); +// } + +// @Override +// public Object getEngineeringData(KlxjEngineeringVo klxjEngineeringVo) { +// if (!StringUtils.isNotEmpty(klxjEngineeringVo.getEngineeringObjectType())) { +// throw new RuntimeException("工程类型不能为空"); +// } +// JSONObject formMap = new JSONObject(); +// String ip = configService.selectConfigByKey("kenli.ip"); +// String username = configService.selectConfigByKey("kenli.user"); +// String password = configService.selectConfigByKey("kenli.password"); +// formMap.set("username", username); +// formMap.set("password", password); +// String body = HttpUtil.createPost(ip + "/login").body(formMap.toString()).execute().body(); +// JSONObject jsonObject = new JSONObject(body); +// if (jsonObject.get("code").toString().equals("200")) { +// String token = jsonObject.get("token").toString(); +// String Bearer = "Bearer " + token; +// List engineering_object_type +// = dictTypeService.selectDictDataByType("engineering_object_type"); +// if (engineering_object_type +// != null) { +// Map collect = engineering_object_type.stream().collect(Collectors.toMap(t -> t.getDictValue(), t -> t)); +// SysDictData sysDictData = collect.get(klxjEngineeringVo.getEngineeringObjectType()); +// HashMap headers = new HashMap<>(); +// headers.put("Authorization", Bearer); +// String body1 = HttpUtil.createGet(ip + sysDictData.getParam() + klxjEngineeringVo.getEngineeringObjectId()).headerMap(headers, false).execute().body(); +// JSONObject data = new JSONObject(body1).getJSONObject("data"); +// if (data != null) { +// switch (EngineeringObjectType.getName(klxjEngineeringVo.getEngineeringObjectType())) { +// case SHUIZHA_TYPE: +// return data.toBean(BaseSluiceInfo.class); +// case BENGFANG_TYPE: +// return data.toBean(BasePumpHouseInfo.class); +// case SHUIKU_TYPE: +// return data.toBean(BaseReservoirInfo.class); +// case DUCAO_TYPE: +// return data.toBean(KlAqueduct.class); +// } +// } +// } +// } +// return null; +// } + + +} diff --git a/fastbee-service/fastbee-xunjian-service/src/main/resources/mapper/xunjian/XjInspectionNoteMapper.xml b/fastbee-service/fastbee-xunjian-service/src/main/resources/mapper/xunjian/XjInspectionNoteMapper.xml new file mode 100644 index 0000000..7458c57 --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/resources/mapper/xunjian/XjInspectionNoteMapper.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + select * + from xj_inspection_note + + + + + + + + insert into xj_inspection_note + + title, + content, + project_id, + create_by, + create_time, + update_time, + update_by, + engineering_object_type, + + + #{title}, + #{content}, + #{projectId}, + #{createBy}, + #{createTime}, + #{updateTime}, + #{updateBy}, + #{engineeringObjectType}, + + + + + update xj_inspection_note + + title = #{title}, + content = #{content}, + project_id = #{projectId}, + create_by = #{createBy}, + create_time = #{createTime}, + update_time = #{updateTime}, + update_by = #{updateBy}, + engineering_object_type = #{engineeringObjectType}, + + where id = #{id} + + + + delete + from xj_inspection_note + where id = #{id} + + + + delete from xj_inspection_note where id in + + #{id} + + + diff --git a/fastbee-service/fastbee-xunjian-service/src/main/resources/mapper/xunjian/XjInspectionRecordsMapper.xml b/fastbee-service/fastbee-xunjian-service/src/main/resources/mapper/xunjian/XjInspectionRecordsMapper.xml new file mode 100644 index 0000000..e06c7cd --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/resources/mapper/xunjian/XjInspectionRecordsMapper.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select * + from xj_inspection_records + + + + + + + + + insert into xj_inspection_records + + name, + inspection_task_id, + inspection_plan_id, + start_time, + end_time, + inspection_personnel_id, + inspection_route_id, + record_status, + abnormal_status, + lat_and_long, + picture, + remarks, + quyuma, + project_id, + create_by, + create_time, + update_time, + update_by, + group_id, + + + #{name}, + #{inspectionTaskId}, + #{inspectionPlanId}, + #{startTime}, + #{endTime}, + #{inspectionPersonnelId}, + #{inspectionRouteId}, + #{recordStatus}, + #{abnormalStatus}, + #{latAndLong}, + #{picture}, + #{remarks}, + #{quyuma}, + #{projectId}, + #{createBy}, + #{createTime}, + #{updateTime}, + #{updateBy}, + #{groupId}, + + + + + + update xj_inspection_records + + name = #{name}, + inspection_task_id = #{inspectionTaskId}, + inspection_plan_id = #{inspectionPlanId}, + start_time = #{startTime}, + end_time = #{endTime}, + inspection_personnel_id = #{inspectionPersonnelId}, + inspection_route_id = #{inspectionRouteId}, + record_status = #{recordStatus}, + abnormal_status = #{abnormalStatus}, + lat_and_long = #{latAndLong}, + picture = #{picture}, + remarks = #{remarks}, + quyuma = #{quyuma}, + project_id = #{projectId}, + create_by = #{createBy}, + create_time = #{createTime}, + update_time = #{updateTime}, + update_by = #{updateBy}, + group_id = #{groupId}, + + where id = #{id} + + + + delete from xj_inspection_records where id = #{id} + + + + delete from xj_inspection_records where id in + + #{id} + + + + + diff --git a/fastbee-service/fastbee-xunjian-service/src/main/resources/mapper/xunjian/XjInspectionRoutesMapper.xml b/fastbee-service/fastbee-xunjian-service/src/main/resources/mapper/xunjian/XjInspectionRoutesMapper.xml new file mode 100644 index 0000000..22431e0 --- /dev/null +++ b/fastbee-service/fastbee-xunjian-service/src/main/resources/mapper/xunjian/XjInspectionRoutesMapper.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select * + from xj_inspection_routes + + + + + + + + + + + insert into xj_inspection_routes + + name, + qr_code_sn, + dot_line_type, + engineering_object_type, + engineering_object_id, + project_id, + lat_and_long, + position, + `range`, + range_area, + qr_code_id, + quyuma, + create_by, + create_time, + update_time, + update_by, + inspection_note_ids, + + + #{name}, + #{qrCodeSn}, + #{dotLineType}, + #{engineeringObjectType}, + #{engineeringObjectId}, + #{projectId}, + #{latAndLong}, + #{position}, + #{range}, + #{rangeArea}, + #{qrCodeId}, + #{quyuma}, + #{createBy}, + #{createTime}, + #{updateTime}, + #{updateBy}, + #{inspectionNoteIds}, + + + + update xj_inspection_routes + + inspection_note_ids = #{inspectionNoteIds}, + name = #{name}, + dot_line_type = #{dotLineType}, + engineering_object_type = #{engineeringObjectType}, + engineering_object_id = #{engineeringObjectId}, + project_id = #{projectId}, + lat_and_long = #{latAndLong}, + position = #{position}, + `range` = #{range}, + range_area = #{rangeArea}, + qr_code_id = #{qrCodeId}, + quyuma = #{quyuma}, + create_by = #{createBy}, + create_time = #{createTime}, + update_time = #{updateTime}, + update_by = #{updateBy}, + qr_code_sn = #{qrCodeSn}, + + where id = #{id} + + + delete + from xj_inspection_routes + where id = #{id} + + + + delete from xj_inspection_routes where id in + + #{id} + + + diff --git a/fastbee-service/pom.xml b/fastbee-service/pom.xml index a76ddc7..d58df8a 100644 --- a/fastbee-service/pom.xml +++ b/fastbee-service/pom.xml @@ -15,6 +15,8 @@ fastbee-iot-service fastbee-system-service + fastbee-xunjian-service + fastbee-waterele-service diff --git a/pom.xml b/pom.xml index dfd3a9d..6fc0965 100644 --- a/pom.xml +++ b/pom.xml @@ -263,7 +263,18 @@ fastbee-system-service ${fastbee.version} - + + + com.fastbee + fastbee-xunjian-service + ${fastbee.version} + + + + com.fastbee + fastbee-waterele-service + ${fastbee.version} + com.fastbee