From 41a63e5fdf71654b576026e76533a69e352ece07 Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Tue, 12 Mar 2024 11:46:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=B1=BB=E5=9E=8B=E5=8F=8A?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xinelu/common/constant/Constants.java | 8 + .../TaskPartitionDictController.java | 4 +- .../tasktypedict/TaskTypeDictController.java | 96 ++++++++++++ .../xinelu/manage/domain/agency/Agency.java | 10 ++ .../taskpartitiondict/TaskPartitionDict.java | 6 +- .../domain/tasktypedict/TaskTypeDict.java | 76 ++++++++++ .../tasktypedict/TaskTypeDictMapper.java | 62 ++++++++ .../impl/TaskPartitionDictServiceImpl.java | 8 + .../tasktypedict/ITaskTypeDictService.java | 61 ++++++++ .../impl/TaskTypeDictServiceImpl.java | 99 +++++++++++++ .../tasktypedict/TaskTypeDictMapper.xml | 140 ++++++++++++++++++ 11 files changed, 566 insertions(+), 4 deletions(-) create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/controller/tasktypedict/TaskTypeDictController.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/domain/tasktypedict/TaskTypeDict.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/mapper/tasktypedict/TaskTypeDictMapper.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/service/tasktypedict/ITaskTypeDictService.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/service/tasktypedict/impl/TaskTypeDictServiceImpl.java create mode 100644 postdischarge-manage/src/main/resources/mapper/manage/tasktypedict/TaskTypeDictMapper.xml diff --git a/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java b/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java index 358ea4db..f1ab143d 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/constant/Constants.java @@ -179,5 +179,13 @@ public class Constants { */ public static final String SERVICE_MODE_ENCODING = "SME"; + /** + * 服务方式编码 + */ + public static final String TASK_TYPE_CODE = "TTC"; + /** + * 服务方式编码 + */ + public static final String TASK_PARTITION_CODE = "TPC"; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/taskpartitiondict/TaskPartitionDictController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/taskpartitiondict/TaskPartitionDictController.java index 340b4778..df21c00e 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/taskpartitiondict/TaskPartitionDictController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/taskpartitiondict/TaskPartitionDictController.java @@ -64,7 +64,7 @@ public class TaskPartitionDictController extends BaseController { */ @PreAuthorize("@ss.hasPermi('system:partition:add')") @Log(title = "任务细分字典", businessType = BusinessType.INSERT) - @PostMapping + @PostMapping("/add") public AjaxResult add(@RequestBody TaskPartitionDict taskPartitionDict) { return toAjax(taskPartitionDictService.insertTaskPartitionDict(taskPartitionDict)); } @@ -74,7 +74,7 @@ public class TaskPartitionDictController extends BaseController { */ @PreAuthorize("@ss.hasPermi('system:partition:edit')") @Log(title = "任务细分字典", businessType = BusinessType.UPDATE) - @PutMapping + @PutMapping("/edit") public AjaxResult edit(@RequestBody TaskPartitionDict taskPartitionDict) { return toAjax(taskPartitionDictService.updateTaskPartitionDict(taskPartitionDict)); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/tasktypedict/TaskTypeDictController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/tasktypedict/TaskTypeDictController.java new file mode 100644 index 00000000..ec645f1a --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/tasktypedict/TaskTypeDictController.java @@ -0,0 +1,96 @@ +package com.xinelu.manage.controller.tasktypedict; + +import com.xinelu.common.annotation.Log; +import com.xinelu.common.core.controller.BaseController; +import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.page.TableDataInfo; +import com.xinelu.common.enums.BusinessType; +import com.xinelu.common.utils.poi.ExcelUtil; +import com.xinelu.manage.domain.tasktypedict.TaskTypeDict; +import com.xinelu.manage.service.tasktypedict.ITaskTypeDictService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 任务类型字典Controller + * + * @author xinelu + * @date 2024-03-11 + */ +@RestController +@RequestMapping("/system/taskType") +public class TaskTypeDictController extends BaseController { + @Resource + private ITaskTypeDictService taskTypeDictService; + + /** + * 查询任务类型字典列表 + */ + @PreAuthorize("@ss.hasPermi('system:taskType:list')") + @GetMapping("/list") + public TableDataInfo list(TaskTypeDict taskTypeDict) { + startPage(); + List list = taskTypeDictService.selectTaskTypeDictList(taskTypeDict); + return getDataTable(list); + } + + @GetMapping("/selectTaskTypeList") + public AjaxResult selectTaskTypeList(TaskTypeDict taskTypeDict) { + return AjaxResult.success(taskTypeDictService.selectTaskTypeDictList(taskTypeDict)); + } + + /** + * 导出任务类型字典列表 + */ + @PreAuthorize("@ss.hasPermi('system:taskType:export')") + @Log(title = "任务类型字典", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TaskTypeDict taskTypeDict) { + List list = taskTypeDictService.selectTaskTypeDictList(taskTypeDict); + ExcelUtil util = new ExcelUtil(TaskTypeDict.class); + util.exportExcel(response, list, "任务类型字典数据"); + } + + /** + * 获取任务类型字典详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:taskType:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(taskTypeDictService.selectTaskTypeDictById(id)); + } + + /** + * 新增任务类型字典 + */ + @PreAuthorize("@ss.hasPermi('system:taskType:add')") + @Log(title = "任务类型字典", businessType = BusinessType.INSERT) + @PostMapping("/add") + public AjaxResult add(@RequestBody TaskTypeDict taskTypeDict) { + return toAjax(taskTypeDictService.insertTaskTypeDict(taskTypeDict)); + } + + /** + * 修改任务类型字典 + */ + @PreAuthorize("@ss.hasPermi('system:taskType:edit')") + @Log(title = "任务类型字典", businessType = BusinessType.UPDATE) + @PutMapping("/edit") + public AjaxResult edit(@RequestBody TaskTypeDict taskTypeDict) { + return toAjax(taskTypeDictService.updateTaskTypeDict(taskTypeDict)); + } + + /** + * 删除任务类型字典 + */ + @PreAuthorize("@ss.hasPermi('system:taskType:remove')") + @Log(title = "任务类型字典", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(taskTypeDictService.deleteTaskTypeDictByIds(ids)); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/agency/Agency.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/agency/Agency.java index 28933814..ff526989 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/agency/Agency.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/agency/Agency.java @@ -149,6 +149,16 @@ public class Agency extends BaseEntity { @Excel(name = "机构排序") private Integer agencySort; + /** + * 机构经度(横坐标) + */ + private String longitude; + + /** + * 机构纬度(纵坐标) + */ + private String latitude; + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/taskpartitiondict/TaskPartitionDict.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/taskpartitiondict/TaskPartitionDict.java index eaa228ca..bc262300 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/taskpartitiondict/TaskPartitionDict.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/taskpartitiondict/TaskPartitionDict.java @@ -12,6 +12,8 @@ import lombok.NoArgsConstructor; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +import java.sql.Time; +import java.time.LocalTime; import java.util.Date; /** @@ -72,9 +74,9 @@ public class TaskPartitionDict extends BaseEntity { * 执行时间,格式:HH:mm */ @ApiModelProperty(value = "执行时间,格式:HH:mm") - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "HH:mm") @Excel(name = "执行时间,格式:HH:mm", width = 30, dateFormat = "yyyy-MM-dd") - private Date executionTime; + private LocalTime executionTime; /** * 任务细分排序 diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/tasktypedict/TaskTypeDict.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/tasktypedict/TaskTypeDict.java new file mode 100644 index 00000000..a73b3ade --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/tasktypedict/TaskTypeDict.java @@ -0,0 +1,76 @@ +package com.xinelu.manage.domain.tasktypedict; + +import com.xinelu.common.annotation.Excel; +import com.xinelu.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 任务类型字典对象 task_type_dict + * + * @author xinelu + * @date 2024-03-11 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "任务类型字典对象", description = "task_type_dict") +public class TaskTypeDict extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键id + */ + private Long id; + + /** + * 任务类型名称 + */ + @ApiModelProperty(value = "任务类型名称") + @Excel(name = "任务类型名称") + private String taskTypeName; + + /** + * 任务类型编码 + */ + @ApiModelProperty(value = "任务类型编码") + @Excel(name = "任务类型编码") + private String taskTypeCode; + + /** + * 任务类型排序 + */ + @ApiModelProperty(value = "任务类型排序") + @Excel(name = "任务类型排序") + private Integer taskTypeSort; + + /** + * 任务类型备注 + */ + @ApiModelProperty(value = "任务类型备注") + @Excel(name = "任务类型备注") + private String taskTypeRemark; + + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("taskTypeName", getTaskTypeName()) + .append("taskTypeCode", getTaskTypeCode()) + .append("taskTypeSort", getTaskTypeSort()) + .append("taskTypeRemark", getTaskTypeRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/tasktypedict/TaskTypeDictMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/tasktypedict/TaskTypeDictMapper.java new file mode 100644 index 00000000..36374dfb --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/tasktypedict/TaskTypeDictMapper.java @@ -0,0 +1,62 @@ +package com.xinelu.manage.mapper.tasktypedict; + +import com.xinelu.manage.domain.tasktypedict.TaskTypeDict; + +import java.util.List; + + +/** + * 任务类型字典Mapper接口 + * + * @author xinelu + * @date 2024-03-11 + */ +public interface TaskTypeDictMapper { + /** + * 查询任务类型字典 + * + * @param id 任务类型字典主键 + * @return 任务类型字典 + */ + public TaskTypeDict selectTaskTypeDictById(Long id); + + /** + * 查询任务类型字典列表 + * + * @param taskTypeDict 任务类型字典 + * @return 任务类型字典集合 + */ + public List selectTaskTypeDictList(TaskTypeDict taskTypeDict); + + /** + * 新增任务类型字典 + * + * @param taskTypeDict 任务类型字典 + * @return 结果 + */ + public int insertTaskTypeDict(TaskTypeDict taskTypeDict); + + /** + * 修改任务类型字典 + * + * @param taskTypeDict 任务类型字典 + * @return 结果 + */ + public int updateTaskTypeDict(TaskTypeDict taskTypeDict); + + /** + * 删除任务类型字典 + * + * @param id 任务类型字典主键 + * @return 结果 + */ + public int deleteTaskTypeDictById(Long id); + + /** + * 批量删除任务类型字典 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTaskTypeDictByIds(Long[] ids); +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/taskpartitiondict/impl/TaskPartitionDictServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/taskpartitiondict/impl/TaskPartitionDictServiceImpl.java index bf5e053b..f3ce189b 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/taskpartitiondict/impl/TaskPartitionDictServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/taskpartitiondict/impl/TaskPartitionDictServiceImpl.java @@ -1,6 +1,9 @@ package com.xinelu.manage.service.taskpartitiondict.impl; +import com.xinelu.common.constant.Constants; import com.xinelu.common.utils.DateUtils; +import com.xinelu.common.utils.SecurityUtils; +import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; import com.xinelu.manage.domain.taskpartitiondict.TaskPartitionDict; import com.xinelu.manage.mapper.taskpartitiondict.TaskPartitionDictMapper; import com.xinelu.manage.service.taskpartitiondict.ITaskPartitionDictService; @@ -20,6 +23,8 @@ import java.util.List; public class TaskPartitionDictServiceImpl implements ITaskPartitionDictService { @Resource private TaskPartitionDictMapper taskPartitionDictMapper; + @Resource + private GenerateSystemCodeUtil generateSystemCodeUtil; /** * 查询任务细分字典 @@ -51,7 +56,9 @@ public class TaskPartitionDictServiceImpl implements ITaskPartitionDictService { */ @Override public int insertTaskPartitionDict(TaskPartitionDict taskPartitionDict) { + taskPartitionDict.setTaskPartitionCode(Constants.TASK_PARTITION_CODE + generateSystemCodeUtil.generateSystemCode(Constants.TASK_PARTITION_CODE)); taskPartitionDict.setCreateTime(DateUtils.getNowDate()); + taskPartitionDict.setCreateBy(SecurityUtils.getUsername()); return taskPartitionDictMapper.insertTaskPartitionDict(taskPartitionDict); } @@ -64,6 +71,7 @@ public class TaskPartitionDictServiceImpl implements ITaskPartitionDictService { @Override public int updateTaskPartitionDict(TaskPartitionDict taskPartitionDict) { taskPartitionDict.setUpdateTime(DateUtils.getNowDate()); + taskPartitionDict.setUpdateBy(SecurityUtils.getUsername()); return taskPartitionDictMapper.updateTaskPartitionDict(taskPartitionDict); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/tasktypedict/ITaskTypeDictService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/tasktypedict/ITaskTypeDictService.java new file mode 100644 index 00000000..0604939c --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/tasktypedict/ITaskTypeDictService.java @@ -0,0 +1,61 @@ +package com.xinelu.manage.service.tasktypedict; + +import com.xinelu.manage.domain.tasktypedict.TaskTypeDict; + +import java.util.List; + +/** + * 任务类型字典Service接口 + * + * @author xinelu + * @date 2024-03-11 + */ +public interface ITaskTypeDictService { + /** + * 查询任务类型字典 + * + * @param id 任务类型字典主键 + * @return 任务类型字典 + */ + TaskTypeDict selectTaskTypeDictById(Long id); + + /** + * 查询任务类型字典列表 + * + * @param taskTypeDict 任务类型字典 + * @return 任务类型字典集合 + */ + List selectTaskTypeDictList(TaskTypeDict taskTypeDict); + + /** + * 新增任务类型字典 + * + * @param taskTypeDict 任务类型字典 + * @return 结果 + */ + int insertTaskTypeDict(TaskTypeDict taskTypeDict); + + /** + * 修改任务类型字典 + * + * @param taskTypeDict 任务类型字典 + * @return 结果 + */ + int updateTaskTypeDict(TaskTypeDict taskTypeDict); + + /** + * 批量删除任务类型字典 + * + * @param ids 需要删除的任务类型字典主键集合 + * @return 结果 + */ + int deleteTaskTypeDictByIds(Long[] ids); + + /** + * 删除任务类型字典信息 + * + * @param id 任务类型字典主键 + * @return 结果 + */ + int deleteTaskTypeDictById(Long id); +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/tasktypedict/impl/TaskTypeDictServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/tasktypedict/impl/TaskTypeDictServiceImpl.java new file mode 100644 index 00000000..d530578e --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/tasktypedict/impl/TaskTypeDictServiceImpl.java @@ -0,0 +1,99 @@ +package com.xinelu.manage.service.tasktypedict.impl; + +import com.xinelu.common.constant.Constants; +import com.xinelu.common.utils.DateUtils; +import com.xinelu.common.utils.SecurityUtils; +import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; +import com.xinelu.manage.domain.tasktypedict.TaskTypeDict; +import com.xinelu.manage.mapper.tasktypedict.TaskTypeDictMapper; +import com.xinelu.manage.service.tasktypedict.ITaskTypeDictService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + + +/** + * 任务类型字典Service业务层处理 + * + * @author xinelu + * @date 2024-03-11 + */ +@Service +public class TaskTypeDictServiceImpl implements ITaskTypeDictService { + @Resource + private TaskTypeDictMapper taskTypeDictMapper; + @Resource + private GenerateSystemCodeUtil generateSystemCodeUtil; + + /** + * 查询任务类型字典 + * + * @param id 任务类型字典主键 + * @return 任务类型字典 + */ + @Override + public TaskTypeDict selectTaskTypeDictById(Long id) { + return taskTypeDictMapper.selectTaskTypeDictById(id); + } + + /** + * 查询任务类型字典列表 + * + * @param taskTypeDict 任务类型字典 + * @return 任务类型字典 + */ + @Override + public List selectTaskTypeDictList(TaskTypeDict taskTypeDict) { + return taskTypeDictMapper.selectTaskTypeDictList(taskTypeDict); + } + + /** + * 新增任务类型字典 + * + * @param taskTypeDict 任务类型字典 + * @return 结果 + */ + @Override + public int insertTaskTypeDict(TaskTypeDict taskTypeDict) { + taskTypeDict.setTaskTypeCode(Constants.TASK_TYPE_CODE + generateSystemCodeUtil.generateSystemCode(Constants.TASK_TYPE_CODE)); + taskTypeDict.setCreateTime(DateUtils.getNowDate()); + taskTypeDict.setCreateBy(SecurityUtils.getUsername()); + return taskTypeDictMapper.insertTaskTypeDict(taskTypeDict); + } + + /** + * 修改任务类型字典 + * + * @param taskTypeDict 任务类型字典 + * @return 结果 + */ + @Override + public int updateTaskTypeDict(TaskTypeDict taskTypeDict) { + taskTypeDict.setUpdateTime(DateUtils.getNowDate()); + taskTypeDict.setUpdateBy(SecurityUtils.getUsername()); + return taskTypeDictMapper.updateTaskTypeDict(taskTypeDict); + } + + /** + * 批量删除任务类型字典 + * + * @param ids 需要删除的任务类型字典主键 + * @return 结果 + */ + @Override + public int deleteTaskTypeDictByIds(Long[] ids) { + return taskTypeDictMapper.deleteTaskTypeDictByIds(ids); + } + + /** + * 删除任务类型字典信息 + * + * @param id 任务类型字典主键 + * @return 结果 + */ + @Override + public int deleteTaskTypeDictById(Long id) { + return taskTypeDictMapper.deleteTaskTypeDictById(id); + } +} diff --git a/postdischarge-manage/src/main/resources/mapper/manage/tasktypedict/TaskTypeDictMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/tasktypedict/TaskTypeDictMapper.xml new file mode 100644 index 00000000..cb78a349 --- /dev/null +++ b/postdischarge-manage/src/main/resources/mapper/manage/tasktypedict/TaskTypeDictMapper.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + select id, + task_type_name, + task_type_code, + task_type_sort, + task_type_remark, + create_by, + create_time, + update_by, + update_time + from task_type_dict + + + + + + + + insert into task_type_dict + + task_type_name, + + task_type_code, + + task_type_sort, + + task_type_remark, + + create_by, + + create_time, + + update_by, + + update_time, + + + + #{taskTypeName}, + + #{taskTypeCode}, + + #{taskTypeSort}, + + #{taskTypeRemark}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + + + + + update task_type_dict + + task_type_name = + #{taskTypeName}, + + task_type_code = + #{taskTypeCode}, + + task_type_sort = + #{taskTypeSort}, + + task_type_remark = + #{taskTypeRemark}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + + where id = #{id} + + + + delete + from task_type_dict + where id = #{id} + + + + delete from task_type_dict where id in + + #{id} + + + \ No newline at end of file