From 40bb8cd80227db8780532d369a97805cde56e1b3 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 24 Aug 2022 10:00:26 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=B7=A5=E4=BD=9C=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E3=80=91=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=92=8C=E5=AD=97=E6=AE=B5=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/WorkdiaryServiceTypeDTO.java | 6 +- .../WorkdiaryServiceQueryFormDTO.java | 10 ++ .../dto/result/WorkdiaryServiceRecordDTO.java | 2 +- .../WorkdiaryServiceRecordController.java | 129 ++++++++++++++++-- .../WorkdiaryServiceTypeController.java | 43 ------ .../entity/WorkdiaryServiceRecordEntity.java | 2 +- .../entity/WorkdiaryServiceTypeEntity.java | 4 +- .../db/migration/workdiary_service.sql | 6 +- .../mapper/WorkdiaryServiceTypeDao.xml | 2 +- 9 files changed, 136 insertions(+), 68 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/workdiaryservice/WorkdiaryServiceQueryFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/WorkdiaryServiceTypeDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/WorkdiaryServiceTypeDTO.java index c392df375b..4f8c936bf7 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/WorkdiaryServiceTypeDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/WorkdiaryServiceTypeDTO.java @@ -29,17 +29,17 @@ public class WorkdiaryServiceTypeDTO implements Serializable { /** * 服务类型 */ - private String serviceType; + private Short serviceType; /** * 服务类型名称 */ - private String serviceName; + private String serviceTypeName; /** * 是否启用。0:禁用,1:启用 */ - private Integer enabled; + private Short enabled; /** * 删除标识 0.未删除 1.已删除 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/workdiaryservice/WorkdiaryServiceQueryFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/workdiaryservice/WorkdiaryServiceQueryFormDTO.java new file mode 100644 index 0000000000..28d967b175 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/workdiaryservice/WorkdiaryServiceQueryFormDTO.java @@ -0,0 +1,10 @@ +package com.epmet.dto.form.workdiaryservice; + +import lombok.Data; + +@Data +public class WorkdiaryServiceQueryFormDTO { + + + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/WorkdiaryServiceRecordDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/WorkdiaryServiceRecordDTO.java index 4cf60df0d2..825c4e76e3 100755 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/WorkdiaryServiceRecordDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/WorkdiaryServiceRecordDTO.java @@ -29,7 +29,7 @@ public class WorkdiaryServiceRecordDTO implements Serializable { /** * 服务类型 */ - private String serviceType; + private Short serviceType; /** * 单位ID diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkdiaryServiceRecordController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkdiaryServiceRecordController.java index 2ca6537d09..fc8fea3b39 100755 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkdiaryServiceRecordController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkdiaryServiceRecordController.java @@ -9,9 +9,13 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.WorkdiaryServiceTypeDTO; +import com.epmet.dto.form.workdiaryservice.WorkdiaryServiceQueryFormDTO; import com.epmet.dto.result.WorkdiaryServiceRecordDTO; +import com.epmet.entity.WorkdiaryServiceTypeExcel; import com.epmet.excel.WorkdiaryServiceRecordExcel; import com.epmet.service.WorkdiaryServiceRecordService; +import com.epmet.service.WorkdiaryServiceTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -27,56 +31,153 @@ import java.util.Map; * @since v1.0.0 2022-08-23 */ @RestController -@RequestMapping("workdiaryServiceRecord") +@RequestMapping("workdiaryService") public class WorkdiaryServiceRecordController { @Autowired private WorkdiaryServiceRecordService workdiaryServiceRecordService; - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = workdiaryServiceRecordService.page(params); + @Autowired + private WorkdiaryServiceTypeService workdiaryServiceTypeService; + + /** + * 记录-分页 + * @param params + * @return + */ + @RequestMapping("/record/page") + public Result> recordPage(@RequestBody WorkdiaryServiceQueryFormDTO input){ + PageData page = workdiaryServiceRecordService.page(null); return new Result>().ok(page); } - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ + /** + * 记录-单条 + * @param id + * @return + */ + @RequestMapping(value = "/record/{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result recordGet(@PathVariable("id") String id){ WorkdiaryServiceRecordDTO data = workdiaryServiceRecordService.get(id); return new Result().ok(data); } + /** + * 记录-保存 + * @return + */ @NoRepeatSubmit - @PostMapping("save") - public Result save(@RequestBody WorkdiaryServiceRecordDTO dto){ + @PostMapping("/record/save") + public Result recordSave(@RequestBody WorkdiaryServiceRecordDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); workdiaryServiceRecordService.save(dto); return new Result(); } + /** + * 记录-更新 + * @param + * @return + */ @NoRepeatSubmit - @PostMapping("update") - public Result update(@RequestBody WorkdiaryServiceRecordDTO dto){ + @PostMapping("/record/update") + public Result recordUpdate(@RequestBody WorkdiaryServiceRecordDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); workdiaryServiceRecordService.update(dto); return new Result(); } - @PostMapping("delete") - public Result delete(@RequestBody String[] ids){ + /** + * 记录-删除 + * @return + */ + @PostMapping("/record/delete") + public Result recordDelete(@RequestBody String[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); workdiaryServiceRecordService.delete(ids); return new Result(); } - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + /** + * 记录-导出 + * @return + */ + @GetMapping("/record/export") + public void recordExport(@RequestParam Map params, HttpServletResponse response) throws Exception { List list = workdiaryServiceRecordService.list(params); ExcelUtils.exportExcelToTarget(response, null, list, WorkdiaryServiceRecordExcel.class); } + /** + * 服务类型-分页 + * @return + */ + @RequestMapping("/serviceType/page") + public Result> serviceTypePage(@RequestParam Map params){ + PageData page = workdiaryServiceTypeService.page(params); + return new Result>().ok(page); + } + + /** + * 服务类型-单条 + * @return + */ + @RequestMapping(value = "/serviceType/{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result serviceTypeGet(@PathVariable("id") String id){ + WorkdiaryServiceTypeDTO data = workdiaryServiceTypeService.get(id); + return new Result().ok(data); + } + + /** + * 服务类型-保存 + * @return + */ + @NoRepeatSubmit + @PostMapping("/serviceType/save") + public Result serviceTypeSave(@RequestBody WorkdiaryServiceTypeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + workdiaryServiceTypeService.save(dto); + return new Result(); + } + + /** + * 服务类型-更新 + * @return + */ + @NoRepeatSubmit + @PostMapping("/serviceType/update") + public Result serviceTypeUpdate(@RequestBody WorkdiaryServiceTypeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + workdiaryServiceTypeService.update(dto); + return new Result(); + } + + /** + * 服务类型-删除 + * @return + */ + @PostMapping("/serviceType/delete") + public Result serviceTypeDelete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + workdiaryServiceTypeService.delete(ids); + return new Result(); + } + + /** + * 服务类型-导出 + * @return + */ + @GetMapping("/serviceType/export") + public void serviceTypeExport(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = workdiaryServiceTypeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, WorkdiaryServiceTypeExcel.class); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkdiaryServiceTypeController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkdiaryServiceTypeController.java index 7ec0167414..8d473d494b 100755 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkdiaryServiceTypeController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkdiaryServiceTypeController.java @@ -31,52 +31,9 @@ import java.util.Map; @RequestMapping("workdiaryServiceType") public class WorkdiaryServiceTypeController { - @Autowired - private WorkdiaryServiceTypeService workdiaryServiceTypeService; - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = workdiaryServiceTypeService.page(params); - return new Result>().ok(page); - } - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) - public Result get(@PathVariable("id") String id){ - WorkdiaryServiceTypeDTO data = workdiaryServiceTypeService.get(id); - return new Result().ok(data); - } - @NoRepeatSubmit - @PostMapping("save") - public Result save(@RequestBody WorkdiaryServiceTypeDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - workdiaryServiceTypeService.save(dto); - return new Result(); - } - - @NoRepeatSubmit - @PostMapping("update") - public Result update(@RequestBody WorkdiaryServiceTypeDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - workdiaryServiceTypeService.update(dto); - return new Result(); - } - - @PostMapping("delete") - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - workdiaryServiceTypeService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = workdiaryServiceTypeService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, WorkdiaryServiceTypeExcel.class); - } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/WorkdiaryServiceRecordEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/WorkdiaryServiceRecordEntity.java index 50b5bb7bab..35ea3e19dd 100755 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/WorkdiaryServiceRecordEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/WorkdiaryServiceRecordEntity.java @@ -29,7 +29,7 @@ public class WorkdiaryServiceRecordEntity extends BaseEpmetEntity { /** * 服务类型 */ - private String serviceType; + private Short serviceType; /** * 单位ID diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/WorkdiaryServiceTypeEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/WorkdiaryServiceTypeEntity.java index 3a7464aa7b..2f3258503b 100755 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/WorkdiaryServiceTypeEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/WorkdiaryServiceTypeEntity.java @@ -29,12 +29,12 @@ public class WorkdiaryServiceTypeEntity extends BaseEpmetEntity { /** * 服务类型 */ - private String serviceType; + private Short serviceType; /** * 服务类型名称 */ - private String serviceName; + private String serviceTypeName; /** * 是否启用。0:禁用,1:启用 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/workdiary_service.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/workdiary_service.sql index 809e8078cf..ebb1138369 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/workdiary_service.sql +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/workdiary_service.sql @@ -3,7 +3,7 @@ CREATE TABLE `workdiary_service_record` ( `ID` varchar(64) NOT NULL COMMENT '主键', `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', - `SERVICE_TYPE` varchar(32) NOT NULL COMMENT '服务类型', + `SERVICE_TYPE` tinyint(1) NOT NULL COMMENT '服务类型', `AGENCY_ID` varchar(32) NOT NULL COMMENT '单位ID', `GRID_ID` varchar(32) NOT NULL COMMENT '网格ID', `ORG_ID_PATH` varchar(255) NOT NULL COMMENT '组织ID path', @@ -31,8 +31,8 @@ CREATE TABLE `workdiary_service_type` ( `ID` varchar(64) NOT NULL COMMENT '主键', `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', - `SERVICE_TYPE` varchar(32) NOT NULL COMMENT '服务类型', - `SERVICE_NAME` varchar(32) NOT NULL COMMENT '服务类型名称', + `SERVICE_TYPE` tinyint(1) NOT NULL COMMENT '服务类型', + `SERVICE_TYPE_NAME` varchar(32) NOT NULL COMMENT '服务类型名称', `ENABLED` tinyint(1) NOT NULL COMMENT '是否启用。0:禁用,1:启用', `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', `REVISION` int(11) NOT NULL COMMENT '乐观锁', diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/WorkdiaryServiceTypeDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/WorkdiaryServiceTypeDao.xml index 5679d1cb91..d3fd24730d 100755 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/WorkdiaryServiceTypeDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/WorkdiaryServiceTypeDao.xml @@ -7,7 +7,7 @@ - +