diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/ElectronicConsultationController.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/ElectronicConsultationController.java new file mode 100644 index 00000000..993efcb7 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/ElectronicConsultationController.java @@ -0,0 +1,102 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicconsultation.ElectronicConsultationDO; +import cn.iocoder.yudao.module.ea.convert.electronicconsultation.ElectronicConsultationConvert; +import cn.iocoder.yudao.module.ea.service.electronicconsultation.ElectronicConsultationService; + +@Tag(name = "管理后台 - 咨询档案") +@RestController +@RequestMapping("/ea/electronic-consultation") +@Validated +public class ElectronicConsultationController { + + @Resource + private ElectronicConsultationService electronicConsultationService; + + @PostMapping("/create") + @Operation(summary = "创建咨询档案") + @PreAuthorize("@ss.hasPermission('ea:electronic-consultation:create')") + public CommonResult createElectronicConsultation(@Valid @RequestBody ElectronicConsultationCreateReqVO createReqVO) { + return success(electronicConsultationService.createElectronicConsultation(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新咨询档案") + @PreAuthorize("@ss.hasPermission('ea:electronic-consultation:update')") + public CommonResult updateElectronicConsultation(@Valid @RequestBody ElectronicConsultationUpdateReqVO updateReqVO) { + electronicConsultationService.updateElectronicConsultation(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除咨询档案") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('ea:electronic-consultation:delete')") + public CommonResult deleteElectronicConsultation(@RequestParam("id") Long id) { + electronicConsultationService.deleteElectronicConsultation(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得咨询档案") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('ea:electronic-consultation:query')") + public CommonResult getElectronicConsultation(@RequestParam("id") Long id) { + ElectronicConsultationDO electronicConsultation = electronicConsultationService.getElectronicConsultation(id); + return success(ElectronicConsultationConvert.INSTANCE.convert(electronicConsultation)); + } + + @GetMapping("/list") + @Operation(summary = "获得咨询档案列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") + @PreAuthorize("@ss.hasPermission('ea:electronic-consultation:query')") + public CommonResult> getElectronicConsultationList(@RequestParam("ids") Collection ids) { + List list = electronicConsultationService.getElectronicConsultationList(ids); + return success(ElectronicConsultationConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @Operation(summary = "获得咨询档案分页") + @PreAuthorize("@ss.hasPermission('ea:electronic-consultation:query')") + public CommonResult> getElectronicConsultationPage(@Valid ElectronicConsultationPageReqVO pageVO) { + PageResult pageResult = electronicConsultationService.getElectronicConsultationPage(pageVO); + return success(ElectronicConsultationConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出咨询档案 Excel") + @PreAuthorize("@ss.hasPermission('ea:electronic-consultation:export')") + @OperateLog(type = EXPORT) + public void exportElectronicConsultationExcel(@Valid ElectronicConsultationExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = electronicConsultationService.getElectronicConsultationList(exportReqVO); + // 导出 Excel + List datas = ElectronicConsultationConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "咨询档案.xls", "数据", ElectronicConsultationExcelVO.class, datas); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationBaseVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationBaseVO.java new file mode 100644 index 00000000..2d69bcfa --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationBaseVO.java @@ -0,0 +1,81 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import javax.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +/** + * 咨询档案 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class ElectronicConsultationBaseVO { + + @Schema(description = "制单人 ") + private String createBy; + + @Schema(description = "业务实体 ") + private String company; + + @Schema(description = "所属部门 ") + private String systemDept; + + @Schema(description = "咨询编号 ", example = "17683") + private String consultationId; + + @Schema(description = "咨询类型 ", example = "1") + private String consultationType; + + @Schema(description = "咨询标题 ") + private String consultationTitle; + + @Schema(description = "咨询内容 ") + private String consultationContent; + + @Schema(description = "咨询人 ", example = "赵六") + private String consultorName; + + @Schema(description = "咨询时间 ") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime consultationTime; + + @Schema(description = "处理人员 ") + private String handler; + + @Schema(description = "处理日期 ") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime handleTime; + + @Schema(description = "处理结果 ") + private String handleResult; + + @Schema(description = "年度 ") + private String year; + + @Schema(description = "月份 ") + private String period; + + @Schema(description = "借阅状态 ", example = "2") + private String borrowStatus; + + @Schema(description = "归档时间 ") + private String recordTime; + + @Schema(description = "纸档位置 ") + private String position; + + @Schema(description = "完整性 ") + private Integer cherks; + + @Schema(description = "归档状态", example = "2") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationCreateReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationCreateReqVO.java new file mode 100644 index 00000000..3ef33f5c --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationCreateReqVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 咨询档案创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ElectronicConsultationCreateReqVO extends ElectronicConsultationBaseVO { + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationExcelVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationExcelVO.java new file mode 100644 index 00000000..fb15194d --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationExcelVO.java @@ -0,0 +1,84 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; + +import com.alibaba.excel.annotation.ExcelProperty; + +/** + * 咨询档案 Excel VO + * + * @author 芋道源码 + */ +@Data +public class ElectronicConsultationExcelVO { + + @ExcelProperty("主键 ") + private Long id; + + @ExcelProperty("制单人 ") + private String createBy; + + @ExcelProperty("创建日期 ") + private LocalDateTime createTime; + + @ExcelProperty("业务实体 ") + private String company; + + @ExcelProperty("所属部门 ") + private String systemDept; + + @ExcelProperty("咨询编号 ") + private String consultationId; + + @ExcelProperty("咨询类型 ") + private String consultationType; + + @ExcelProperty("咨询标题 ") + private String consultationTitle; + + @ExcelProperty("咨询内容 ") + private String consultationContent; + + @ExcelProperty("咨询人 ") + private String consultorName; + + @ExcelProperty("咨询时间 ") + private LocalDateTime consultationTime; + + @ExcelProperty("处理人员 ") + private String handler; + + @ExcelProperty("处理日期 ") + private LocalDateTime handleTime; + + @ExcelProperty("处理结果 ") + private String handleResult; + + @ExcelProperty("年度 ") + private String year; + + @ExcelProperty("月份 ") + private String period; + + @ExcelProperty("借阅状态 ") + private String borrowStatus; + + @ExcelProperty("归档时间 ") + private String recordTime; + + @ExcelProperty("纸档位置 ") + private String position; + + @ExcelProperty("完整性 ") + private Integer cherks; + + @ExcelProperty("归档状态") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationExportReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationExportReqVO.java new file mode 100644 index 00000000..e6807caa --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationExportReqVO.java @@ -0,0 +1,80 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import java.time.LocalDateTime; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 咨询档案 Excel 导出 Request VO,参数和 ElectronicConsultationPageReqVO 是一致的") +@Data +public class ElectronicConsultationExportReqVO { + + @Schema(description = "制单人 ") + private String createBy; + + @Schema(description = "创建日期 ") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "业务实体 ") + private String company; + + @Schema(description = "所属部门 ") + private String systemDept; + + @Schema(description = "咨询编号 ", example = "17683") + private String consultationId; + + @Schema(description = "咨询类型 ", example = "1") + private String consultationType; + + @Schema(description = "咨询标题 ") + private String consultationTitle; + + @Schema(description = "咨询内容 ") + private String consultationContent; + + @Schema(description = "咨询人 ", example = "赵六") + private String consultorName; + + @Schema(description = "咨询时间 ") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] consultationTime; + + @Schema(description = "处理人员 ") + private String handler; + + @Schema(description = "处理日期 ") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] handleTime; + + @Schema(description = "处理结果 ") + private String handleResult; + + @Schema(description = "年度 ") + private String year; + + @Schema(description = "月份 ") + private String period; + + @Schema(description = "借阅状态 ", example = "2") + private String borrowStatus; + + @Schema(description = "归档时间 ") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] recordTime; + + @Schema(description = "纸档位置 ") + private String position; + + @Schema(description = "完整性 ") + private Integer cherks; + + @Schema(description = "归档状态", example = "2") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationPageReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationPageReqVO.java new file mode 100644 index 00000000..2878be37 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationPageReqVO.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 咨询档案分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ElectronicConsultationPageReqVO extends PageParam { + + @Schema(description = "制单人 ") + private String createBy; + + @Schema(description = "创建日期 ") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "业务实体 ") + private String company; + + @Schema(description = "所属部门 ") + private String systemDept; + + @Schema(description = "咨询编号 ", example = "17683") + private String consultationId; + + @Schema(description = "咨询类型 ", example = "1") + private String consultationType; + + @Schema(description = "咨询标题 ") + private String consultationTitle; + + @Schema(description = "咨询内容 ") + private String consultationContent; + + @Schema(description = "咨询人 ", example = "赵六") + private String consultorName; + + @Schema(description = "咨询时间 ") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] consultationTime; + + @Schema(description = "处理人员 ") + private String handler; + + @Schema(description = "处理日期 ") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] handleTime; + + @Schema(description = "处理结果 ") + private String handleResult; + + @Schema(description = "年度 ") + private String year; + + @Schema(description = "月份 ") + private String period; + + @Schema(description = "借阅状态 ", example = "2") + private String borrowStatus; + + @Schema(description = "归档时间 ") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] recordTime; + + @Schema(description = "纸档位置 ") + private String position; + + @Schema(description = "完整性 ") + private Integer cherks; + + @Schema(description = "归档状态", example = "2") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationRespVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationRespVO.java new file mode 100644 index 00000000..2ed77f77 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 咨询档案 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ElectronicConsultationRespVO extends ElectronicConsultationBaseVO { + + @Schema(description = "主键 ", requiredMode = Schema.RequiredMode.REQUIRED, example = "19295") + private Long id; + + @Schema(description = "创建日期 ") + private LocalDateTime createTime; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationUpdateReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationUpdateReqVO.java new file mode 100644 index 00000000..1c096efa --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electronicconsultation/vo/ElectronicConsultationUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 咨询档案更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ElectronicConsultationUpdateReqVO extends ElectronicConsultationBaseVO { + + @Schema(description = "主键 ", requiredMode = Schema.RequiredMode.REQUIRED, example = "19295") + @NotNull(message = "主键 不能为空") + private Long id; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/ElectronicCustomerComplaintController.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/ElectronicCustomerComplaintController.java new file mode 100644 index 00000000..bb20690b --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/ElectronicCustomerComplaintController.java @@ -0,0 +1,102 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccustomercomplaint.ElectronicCustomerComplaintDO; +import cn.iocoder.yudao.module.ea.convert.electroniccustomercomplaint.ElectronicCustomerComplaintConvert; +import cn.iocoder.yudao.module.ea.service.electroniccustomercomplaint.ElectronicCustomerComplaintService; + +@Tag(name = "管理后台 - 客诉档案") +@RestController +@RequestMapping("/ea/electronic-customer-complaint") +@Validated +public class ElectronicCustomerComplaintController { + + @Resource + private ElectronicCustomerComplaintService electronicCustomerComplaintService; + + @PostMapping("/create") + @Operation(summary = "创建客诉档案") + @PreAuthorize("@ss.hasPermission('ea:electronic-customer-complaint:create')") + public CommonResult createElectronicCustomerComplaint(@Valid @RequestBody ElectronicCustomerComplaintCreateReqVO createReqVO) { + return success(electronicCustomerComplaintService.createElectronicCustomerComplaint(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新客诉档案") + @PreAuthorize("@ss.hasPermission('ea:electronic-customer-complaint:update')") + public CommonResult updateElectronicCustomerComplaint(@Valid @RequestBody ElectronicCustomerComplaintUpdateReqVO updateReqVO) { + electronicCustomerComplaintService.updateElectronicCustomerComplaint(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除客诉档案") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('ea:electronic-customer-complaint:delete')") + public CommonResult deleteElectronicCustomerComplaint(@RequestParam("id") Long id) { + electronicCustomerComplaintService.deleteElectronicCustomerComplaint(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得客诉档案") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('ea:electronic-customer-complaint:query')") + public CommonResult getElectronicCustomerComplaint(@RequestParam("id") Long id) { + ElectronicCustomerComplaintDO electronicCustomerComplaint = electronicCustomerComplaintService.getElectronicCustomerComplaint(id); + return success(ElectronicCustomerComplaintConvert.INSTANCE.convert(electronicCustomerComplaint)); + } + + @GetMapping("/list") + @Operation(summary = "获得客诉档案列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") + @PreAuthorize("@ss.hasPermission('ea:electronic-customer-complaint:query')") + public CommonResult> getElectronicCustomerComplaintList(@RequestParam("ids") Collection ids) { + List list = electronicCustomerComplaintService.getElectronicCustomerComplaintList(ids); + return success(ElectronicCustomerComplaintConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @Operation(summary = "获得客诉档案分页") + @PreAuthorize("@ss.hasPermission('ea:electronic-customer-complaint:query')") + public CommonResult> getElectronicCustomerComplaintPage(@Valid ElectronicCustomerComplaintPageReqVO pageVO) { + PageResult pageResult = electronicCustomerComplaintService.getElectronicCustomerComplaintPage(pageVO); + return success(ElectronicCustomerComplaintConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出客诉档案 Excel") + @PreAuthorize("@ss.hasPermission('ea:electronic-customer-complaint:export')") + @OperateLog(type = EXPORT) + public void exportElectronicCustomerComplaintExcel(@Valid ElectronicCustomerComplaintExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = electronicCustomerComplaintService.getElectronicCustomerComplaintList(exportReqVO); + // 导出 Excel + List datas = ElectronicCustomerComplaintConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "客诉档案.xls", "数据", ElectronicCustomerComplaintExcelVO.class, datas); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintBaseVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintBaseVO.java new file mode 100644 index 00000000..a85a7b40 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintBaseVO.java @@ -0,0 +1,81 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import javax.validation.constraints.*; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +/** + * 客诉档案 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class ElectronicCustomerComplaintBaseVO { + + @Schema(description = " 制单人") + private String createBy; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "所属部门", example = "李四") + private String deptName; + + @Schema(description = "客诉编号") + private String complaintCode; + + @Schema(description = "客户名称", example = "李四") + private String customerName; + + @Schema(description = "客户电话") + private String customerPhone; + + @Schema(description = "客诉时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime complaintTime; + + @Schema(description = "客诉类型", example = "1") + private String complaintType; + + @Schema(description = "客诉内容") + private String complaintContent; + + @Schema(description = "处理人") + private String handler; + + @Schema(description = "处理时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime handleTime; + + @Schema(description = "处理结果") + private String handleResult; + + @Schema(description = "年度") + private String year; + + @Schema(description = "月份") + private String period; + + @Schema(description = "借阅状态", example = "1") + private String borrowStatus; + + @Schema(description = "归档时间") + private String recordTime; + + @Schema(description = "纸档位置") + private String position; + + @Schema(description = "完整性") + private Integer cherks; + + @Schema(description = "归档状态", example = "2") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintCreateReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintCreateReqVO.java new file mode 100644 index 00000000..e06a3eb3 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintCreateReqVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 客诉档案创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ElectronicCustomerComplaintCreateReqVO extends ElectronicCustomerComplaintBaseVO { + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintExcelVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintExcelVO.java new file mode 100644 index 00000000..3d58a7a9 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintExcelVO.java @@ -0,0 +1,84 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; + +import com.alibaba.excel.annotation.ExcelProperty; + +/** + * 客诉档案 Excel VO + * + * @author 芋道源码 + */ +@Data +public class ElectronicCustomerComplaintExcelVO { + + @ExcelProperty("主键") + private Long id; + + @ExcelProperty(" 制单人") + private String createBy; + + @ExcelProperty("创建日期") + private LocalDateTime createTime; + + @ExcelProperty("业务实体") + private String company; + + @ExcelProperty("所属部门") + private String deptName; + + @ExcelProperty("客诉编号") + private String complaintCode; + + @ExcelProperty("客户名称") + private String customerName; + + @ExcelProperty("客户电话") + private String customerPhone; + + @ExcelProperty("客诉时间") + private LocalDateTime complaintTime; + + @ExcelProperty("客诉类型") + private String complaintType; + + @ExcelProperty("客诉内容") + private String complaintContent; + + @ExcelProperty("处理人") + private String handler; + + @ExcelProperty("处理时间") + private LocalDateTime handleTime; + + @ExcelProperty("处理结果") + private String handleResult; + + @ExcelProperty("年度") + private String year; + + @ExcelProperty("月份") + private String period; + + @ExcelProperty("借阅状态") + private String borrowStatus; + + @ExcelProperty("归档时间") + private String recordTime; + + @ExcelProperty("纸档位置") + private String position; + + @ExcelProperty("完整性") + private Integer cherks; + + @ExcelProperty("归档状态") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintExportReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintExportReqVO.java new file mode 100644 index 00000000..9e3b1ded --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintExportReqVO.java @@ -0,0 +1,80 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import java.time.LocalDateTime; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 客诉档案 Excel 导出 Request VO,参数和 ElectronicCustomerComplaintPageReqVO 是一致的") +@Data +public class ElectronicCustomerComplaintExportReqVO { + + @Schema(description = " 制单人") + private String createBy; + + @Schema(description = "创建日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "所属部门", example = "李四") + private String deptName; + + @Schema(description = "客诉编号") + private String complaintCode; + + @Schema(description = "客户名称", example = "李四") + private String customerName; + + @Schema(description = "客户电话") + private String customerPhone; + + @Schema(description = "客诉时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] complaintTime; + + @Schema(description = "客诉类型", example = "1") + private String complaintType; + + @Schema(description = "客诉内容") + private String complaintContent; + + @Schema(description = "处理人") + private String handler; + + @Schema(description = "处理时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] handleTime; + + @Schema(description = "处理结果") + private String handleResult; + + @Schema(description = "年度") + private String year; + + @Schema(description = "月份") + private String period; + + @Schema(description = "借阅状态", example = "1") + private String borrowStatus; + + @Schema(description = "归档时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] recordTime; + + @Schema(description = "纸档位置") + private String position; + + @Schema(description = "完整性") + private Integer cherks; + + @Schema(description = "归档状态", example = "2") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintPageReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintPageReqVO.java new file mode 100644 index 00000000..97f251e7 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintPageReqVO.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 客诉档案分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ElectronicCustomerComplaintPageReqVO extends PageParam { + + @Schema(description = " 制单人") + private String createBy; + + @Schema(description = "创建日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "所属部门", example = "李四") + private String deptName; + + @Schema(description = "客诉编号") + private String complaintCode; + + @Schema(description = "客户名称", example = "李四") + private String customerName; + + @Schema(description = "客户电话") + private String customerPhone; + + @Schema(description = "客诉时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] complaintTime; + + @Schema(description = "客诉类型", example = "1") + private String complaintType; + + @Schema(description = "客诉内容") + private String complaintContent; + + @Schema(description = "处理人") + private String handler; + + @Schema(description = "处理时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] handleTime; + + @Schema(description = "处理结果") + private String handleResult; + + @Schema(description = "年度") + private String year; + + @Schema(description = "月份") + private String period; + + @Schema(description = "借阅状态", example = "1") + private String borrowStatus; + + @Schema(description = "归档时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] recordTime; + + @Schema(description = "纸档位置") + private String position; + + @Schema(description = "完整性") + private Integer cherks; + + @Schema(description = "归档状态", example = "2") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintRespVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintRespVO.java new file mode 100644 index 00000000..e0da0c24 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 客诉档案 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ElectronicCustomerComplaintRespVO extends ElectronicCustomerComplaintBaseVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15970") + private Long id; + + @Schema(description = "创建日期") + private LocalDateTime createTime; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintUpdateReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintUpdateReqVO.java new file mode 100644 index 00000000..72caa89d --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccustomercomplaint/vo/ElectronicCustomerComplaintUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; + +@Schema(description = "管理后台 - 客诉档案更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ElectronicCustomerComplaintUpdateReqVO extends ElectronicCustomerComplaintBaseVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15970") + @NotNull(message = "主键不能为空") + private Long id; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electronicconsultation/ElectronicConsultationConvert.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electronicconsultation/ElectronicConsultationConvert.java new file mode 100644 index 00000000..7cc6f96f --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electronicconsultation/ElectronicConsultationConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.ea.convert.electronicconsultation; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicconsultation.ElectronicConsultationDO; + +/** + * 咨询档案 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface ElectronicConsultationConvert { + + ElectronicConsultationConvert INSTANCE = Mappers.getMapper(ElectronicConsultationConvert.class); + + ElectronicConsultationDO convert(ElectronicConsultationCreateReqVO bean); + + ElectronicConsultationDO convert(ElectronicConsultationUpdateReqVO bean); + + ElectronicConsultationRespVO convert(ElectronicConsultationDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electroniccustomercomplaint/ElectronicCustomerComplaintConvert.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electroniccustomercomplaint/ElectronicCustomerComplaintConvert.java new file mode 100644 index 00000000..455833c4 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electroniccustomercomplaint/ElectronicCustomerComplaintConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.ea.convert.electroniccustomercomplaint; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccustomercomplaint.ElectronicCustomerComplaintDO; + +/** + * 客诉档案 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface ElectronicCustomerComplaintConvert { + + ElectronicCustomerComplaintConvert INSTANCE = Mappers.getMapper(ElectronicCustomerComplaintConvert.class); + + ElectronicCustomerComplaintDO convert(ElectronicCustomerComplaintCreateReqVO bean); + + ElectronicCustomerComplaintDO convert(ElectronicCustomerComplaintUpdateReqVO bean); + + ElectronicCustomerComplaintRespVO convert(ElectronicCustomerComplaintDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electronicconsultation/ElectronicConsultationDO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electronicconsultation/ElectronicConsultationDO.java new file mode 100644 index 00000000..ba0aac8f --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electronicconsultation/ElectronicConsultationDO.java @@ -0,0 +1,133 @@ +package cn.iocoder.yudao.module.ea.dal.dataobject.electronicconsultation; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 咨询档案 DO + * + * @author 芋道源码 + */ +@TableName("electronic_consultation") +@KeySequence("electronic_consultation_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ElectronicConsultationDO extends BaseDO { + + /** + * 主键 + */ + @TableId + private Long id; + /** + * 制单人 + */ + private String createBy; + /** + * 业务实体id + */ + private Long companyId; + /** + * 业务实体 + */ + private String company; + /** + * 所属部门id + */ + private Long systemDeptId; + /** + * 所属部门 + */ + private String systemDept; + /** + * 咨询编号 + */ + private String consultationId; + /** + * 咨询类型 + */ + private String consultationType; + /** + * 咨询标题 + */ + private String consultationTitle; + /** + * 咨询内容 + */ + private String consultationContent; + /** + * 咨询人 + */ + private String consultorName; + /** + * 咨询者电话 + */ + private String consultorPhone; + /** + * 咨询者邮箱 + */ + private String consultorEmail; + /** + * 咨询时间 + */ + private LocalDateTime consultationTime; + /** + * 处理人员 + */ + private String handler; + /** + * 处理日期 + */ + private LocalDateTime handleTime; + /** + * 处理结果 + */ + private String handleResult; + /** + * 年度 + */ + private String year; + /** + * 月份 + */ + private String period; + /** + * 借阅状态 + */ + private String borrowStatus; + /** + * 归档时间 + */ + private String recordTime; + /** + * 纸档位置 + */ + private String position; + /** + * 完整性 + */ + private Integer cherks; + /** + * 归档id + */ + private Long recordId; + /** + * 用户id + */ + private Long userId; + /** + * 归档状态 + */ + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electroniccustomercomplaint/ElectronicCustomerComplaintDO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electroniccustomercomplaint/ElectronicCustomerComplaintDO.java new file mode 100644 index 00000000..24559e65 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electroniccustomercomplaint/ElectronicCustomerComplaintDO.java @@ -0,0 +1,129 @@ +package cn.iocoder.yudao.module.ea.dal.dataobject.electroniccustomercomplaint; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 客诉档案 DO + * + * @author 芋道源码 + */ +@TableName("electronic_customer_complaint") +@KeySequence("electronic_customer_complaint_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ElectronicCustomerComplaintDO extends BaseDO { + + /** + * 主键 + */ + @TableId + private Long id; + /** + * 制单人 + */ + private String createBy; + /** + * 业务实体id + */ + private Long companyId; + /** + * 业务实体 + */ + private String company; + /** + * 所属部门id + */ + private Long deptId; + /** + * 所属部门 + */ + private String deptName; + /** + * 客诉编号 + */ + private String complaintCode; + /** + * 客户名称 + */ + private String customerName; + /** + * 客户电话 + */ + private String customerPhone; + /** + * 客户邮箱 + */ + private String customerEmail; + /** + * 客诉时间 + */ + private LocalDateTime complaintTime; + /** + * 客诉类型 + */ + private String complaintType; + /** + * 客诉内容 + */ + private String complaintContent; + /** + * 处理人 + */ + private String handler; + /** + * 处理时间 + */ + private LocalDateTime handleTime; + /** + * 处理结果 + */ + private String handleResult; + /** + * 年度 + */ + private String year; + /** + * 月份 + */ + private String period; + /** + * 借阅状态 + */ + private String borrowStatus; + /** + * 归档时间 + */ + private String recordTime; + /** + * 纸档位置 + */ + private String position; + /** + * 完整性 + */ + private Integer cherks; + /** + * 用户id + */ + private Long userId; + /** + * 归档id + */ + private Long recordId; + /** + * 归档状态 + */ + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electronicconsultation/ElectronicConsultationMapper.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electronicconsultation/ElectronicConsultationMapper.java new file mode 100644 index 00000000..7c026c2a --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electronicconsultation/ElectronicConsultationMapper.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.ea.dal.mysql.electronicconsultation; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicconsultation.ElectronicConsultationDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation.vo.*; + +/** + * 咨询档案 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface ElectronicConsultationMapper extends BaseMapperX { + + default PageResult selectPage(ElectronicConsultationPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ElectronicConsultationDO::getCreateBy, reqVO.getCreateBy()) + .betweenIfPresent(ElectronicConsultationDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ElectronicConsultationDO::getCompany, reqVO.getCompany()) + .eqIfPresent(ElectronicConsultationDO::getSystemDept, reqVO.getSystemDept()) + .eqIfPresent(ElectronicConsultationDO::getConsultationId, reqVO.getConsultationId()) + .eqIfPresent(ElectronicConsultationDO::getConsultationType, reqVO.getConsultationType()) + .eqIfPresent(ElectronicConsultationDO::getConsultationTitle, reqVO.getConsultationTitle()) + .eqIfPresent(ElectronicConsultationDO::getConsultationContent, reqVO.getConsultationContent()) + .likeIfPresent(ElectronicConsultationDO::getConsultorName, reqVO.getConsultorName()) + .betweenIfPresent(ElectronicConsultationDO::getConsultationTime, reqVO.getConsultationTime()) + .eqIfPresent(ElectronicConsultationDO::getHandler, reqVO.getHandler()) + .betweenIfPresent(ElectronicConsultationDO::getHandleTime, reqVO.getHandleTime()) + .eqIfPresent(ElectronicConsultationDO::getHandleResult, reqVO.getHandleResult()) + .eqIfPresent(ElectronicConsultationDO::getYear, reqVO.getYear()) + .eqIfPresent(ElectronicConsultationDO::getPeriod, reqVO.getPeriod()) + .eqIfPresent(ElectronicConsultationDO::getBorrowStatus, reqVO.getBorrowStatus()) + .betweenIfPresent(ElectronicConsultationDO::getRecordTime, reqVO.getRecordTime()) + .eqIfPresent(ElectronicConsultationDO::getPosition, reqVO.getPosition()) + .eqIfPresent(ElectronicConsultationDO::getCherks, reqVO.getCherks()) + .eqIfPresent(ElectronicConsultationDO::getFileStatus, reqVO.getFileStatus()) + .orderByDesc(ElectronicConsultationDO::getId)); + } + + default List selectList(ElectronicConsultationExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(ElectronicConsultationDO::getCreateBy, reqVO.getCreateBy()) + .betweenIfPresent(ElectronicConsultationDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ElectronicConsultationDO::getCompany, reqVO.getCompany()) + .eqIfPresent(ElectronicConsultationDO::getSystemDept, reqVO.getSystemDept()) + .eqIfPresent(ElectronicConsultationDO::getConsultationId, reqVO.getConsultationId()) + .eqIfPresent(ElectronicConsultationDO::getConsultationType, reqVO.getConsultationType()) + .eqIfPresent(ElectronicConsultationDO::getConsultationTitle, reqVO.getConsultationTitle()) + .eqIfPresent(ElectronicConsultationDO::getConsultationContent, reqVO.getConsultationContent()) + .likeIfPresent(ElectronicConsultationDO::getConsultorName, reqVO.getConsultorName()) + .betweenIfPresent(ElectronicConsultationDO::getConsultationTime, reqVO.getConsultationTime()) + .eqIfPresent(ElectronicConsultationDO::getHandler, reqVO.getHandler()) + .betweenIfPresent(ElectronicConsultationDO::getHandleTime, reqVO.getHandleTime()) + .eqIfPresent(ElectronicConsultationDO::getHandleResult, reqVO.getHandleResult()) + .eqIfPresent(ElectronicConsultationDO::getYear, reqVO.getYear()) + .eqIfPresent(ElectronicConsultationDO::getPeriod, reqVO.getPeriod()) + .eqIfPresent(ElectronicConsultationDO::getBorrowStatus, reqVO.getBorrowStatus()) + .betweenIfPresent(ElectronicConsultationDO::getRecordTime, reqVO.getRecordTime()) + .eqIfPresent(ElectronicConsultationDO::getPosition, reqVO.getPosition()) + .eqIfPresent(ElectronicConsultationDO::getCherks, reqVO.getCherks()) + .eqIfPresent(ElectronicConsultationDO::getFileStatus, reqVO.getFileStatus()) + .orderByDesc(ElectronicConsultationDO::getId)); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electroniccustomercomplaint/ElectronicCustomerComplaintMapper.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electroniccustomercomplaint/ElectronicCustomerComplaintMapper.java new file mode 100644 index 00000000..a3c94c79 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electroniccustomercomplaint/ElectronicCustomerComplaintMapper.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.ea.dal.mysql.electroniccustomercomplaint; + +import java.util.*; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccustomercomplaint.ElectronicCustomerComplaintDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint.vo.*; + +/** + * 客诉档案 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface ElectronicCustomerComplaintMapper extends BaseMapperX { + + default PageResult selectPage(ElectronicCustomerComplaintPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ElectronicCustomerComplaintDO::getCreateBy, reqVO.getCreateBy()) + .betweenIfPresent(ElectronicCustomerComplaintDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ElectronicCustomerComplaintDO::getCompany, reqVO.getCompany()) + .likeIfPresent(ElectronicCustomerComplaintDO::getDeptName, reqVO.getDeptName()) + .eqIfPresent(ElectronicCustomerComplaintDO::getComplaintCode, reqVO.getComplaintCode()) + .likeIfPresent(ElectronicCustomerComplaintDO::getCustomerName, reqVO.getCustomerName()) + .eqIfPresent(ElectronicCustomerComplaintDO::getCustomerPhone, reqVO.getCustomerPhone()) + .betweenIfPresent(ElectronicCustomerComplaintDO::getComplaintTime, reqVO.getComplaintTime()) + .eqIfPresent(ElectronicCustomerComplaintDO::getComplaintType, reqVO.getComplaintType()) + .eqIfPresent(ElectronicCustomerComplaintDO::getComplaintContent, reqVO.getComplaintContent()) + .eqIfPresent(ElectronicCustomerComplaintDO::getHandler, reqVO.getHandler()) + .betweenIfPresent(ElectronicCustomerComplaintDO::getHandleTime, reqVO.getHandleTime()) + .eqIfPresent(ElectronicCustomerComplaintDO::getHandleResult, reqVO.getHandleResult()) + .eqIfPresent(ElectronicCustomerComplaintDO::getYear, reqVO.getYear()) + .eqIfPresent(ElectronicCustomerComplaintDO::getPeriod, reqVO.getPeriod()) + .eqIfPresent(ElectronicCustomerComplaintDO::getBorrowStatus, reqVO.getBorrowStatus()) + .betweenIfPresent(ElectronicCustomerComplaintDO::getRecordTime, reqVO.getRecordTime()) + .eqIfPresent(ElectronicCustomerComplaintDO::getPosition, reqVO.getPosition()) + .eqIfPresent(ElectronicCustomerComplaintDO::getCherks, reqVO.getCherks()) + .eqIfPresent(ElectronicCustomerComplaintDO::getFileStatus, reqVO.getFileStatus()) + .orderByDesc(ElectronicCustomerComplaintDO::getId)); + } + + default List selectList(ElectronicCustomerComplaintExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(ElectronicCustomerComplaintDO::getCreateBy, reqVO.getCreateBy()) + .betweenIfPresent(ElectronicCustomerComplaintDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ElectronicCustomerComplaintDO::getCompany, reqVO.getCompany()) + .likeIfPresent(ElectronicCustomerComplaintDO::getDeptName, reqVO.getDeptName()) + .eqIfPresent(ElectronicCustomerComplaintDO::getComplaintCode, reqVO.getComplaintCode()) + .likeIfPresent(ElectronicCustomerComplaintDO::getCustomerName, reqVO.getCustomerName()) + .eqIfPresent(ElectronicCustomerComplaintDO::getCustomerPhone, reqVO.getCustomerPhone()) + .betweenIfPresent(ElectronicCustomerComplaintDO::getComplaintTime, reqVO.getComplaintTime()) + .eqIfPresent(ElectronicCustomerComplaintDO::getComplaintType, reqVO.getComplaintType()) + .eqIfPresent(ElectronicCustomerComplaintDO::getComplaintContent, reqVO.getComplaintContent()) + .eqIfPresent(ElectronicCustomerComplaintDO::getHandler, reqVO.getHandler()) + .betweenIfPresent(ElectronicCustomerComplaintDO::getHandleTime, reqVO.getHandleTime()) + .eqIfPresent(ElectronicCustomerComplaintDO::getHandleResult, reqVO.getHandleResult()) + .eqIfPresent(ElectronicCustomerComplaintDO::getYear, reqVO.getYear()) + .eqIfPresent(ElectronicCustomerComplaintDO::getPeriod, reqVO.getPeriod()) + .eqIfPresent(ElectronicCustomerComplaintDO::getBorrowStatus, reqVO.getBorrowStatus()) + .betweenIfPresent(ElectronicCustomerComplaintDO::getRecordTime, reqVO.getRecordTime()) + .eqIfPresent(ElectronicCustomerComplaintDO::getPosition, reqVO.getPosition()) + .eqIfPresent(ElectronicCustomerComplaintDO::getCherks, reqVO.getCherks()) + .eqIfPresent(ElectronicCustomerComplaintDO::getFileStatus, reqVO.getFileStatus()) + .orderByDesc(ElectronicCustomerComplaintDO::getId)); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicconsultation/ElectronicConsultationService.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicconsultation/ElectronicConsultationService.java new file mode 100644 index 00000000..4e3613c2 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicconsultation/ElectronicConsultationService.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.ea.service.electronicconsultation; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicconsultation.ElectronicConsultationDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 咨询档案 Service 接口 + * + * @author 芋道源码 + */ +public interface ElectronicConsultationService { + + /** + * 创建咨询档案 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createElectronicConsultation(@Valid ElectronicConsultationCreateReqVO createReqVO); + + /** + * 更新咨询档案 + * + * @param updateReqVO 更新信息 + */ + void updateElectronicConsultation(@Valid ElectronicConsultationUpdateReqVO updateReqVO); + + /** + * 删除咨询档案 + * + * @param id 编号 + */ + void deleteElectronicConsultation(Long id); + + /** + * 获得咨询档案 + * + * @param id 编号 + * @return 咨询档案 + */ + ElectronicConsultationDO getElectronicConsultation(Long id); + + /** + * 获得咨询档案列表 + * + * @param ids 编号 + * @return 咨询档案列表 + */ + List getElectronicConsultationList(Collection ids); + + /** + * 获得咨询档案分页 + * + * @param pageReqVO 分页查询 + * @return 咨询档案分页 + */ + PageResult getElectronicConsultationPage(ElectronicConsultationPageReqVO pageReqVO); + + /** + * 获得咨询档案列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 咨询档案列表 + */ + List getElectronicConsultationList(ElectronicConsultationExportReqVO exportReqVO); + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicconsultation/ElectronicConsultationServiceImpl.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicconsultation/ElectronicConsultationServiceImpl.java new file mode 100644 index 00000000..b2819491 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electronicconsultation/ElectronicConsultationServiceImpl.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.ea.service.electronicconsultation; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import cn.iocoder.yudao.module.ea.controller.admin.electronicconsultation.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electronicconsultation.ElectronicConsultationDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.ea.convert.electronicconsultation.ElectronicConsultationConvert; +import cn.iocoder.yudao.module.ea.dal.mysql.electronicconsultation.ElectronicConsultationMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.ea.enums.ErrorCodeConstants.*; + +/** + * 咨询档案 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class ElectronicConsultationServiceImpl implements ElectronicConsultationService { + + @Resource + private ElectronicConsultationMapper electronicConsultationMapper; + + @Override + public Long createElectronicConsultation(ElectronicConsultationCreateReqVO createReqVO) { + // 插入 + ElectronicConsultationDO electronicConsultation = ElectronicConsultationConvert.INSTANCE.convert(createReqVO); + electronicConsultationMapper.insert(electronicConsultation); + // 返回 + return electronicConsultation.getId(); + } + + @Override + public void updateElectronicConsultation(ElectronicConsultationUpdateReqVO updateReqVO) { + // 校验存在 + validateElectronicConsultationExists(updateReqVO.getId()); + // 更新 + ElectronicConsultationDO updateObj = ElectronicConsultationConvert.INSTANCE.convert(updateReqVO); + electronicConsultationMapper.updateById(updateObj); + } + + @Override + public void deleteElectronicConsultation(Long id) { + // 校验存在 + validateElectronicConsultationExists(id); + // 删除 + electronicConsultationMapper.deleteById(id); + } + + private void validateElectronicConsultationExists(Long id) { + if (electronicConsultationMapper.selectById(id) == null) { + throw exception(ELECTRONIC_CONSULTATION_NOT_EXISTS); + } + } + + @Override + public ElectronicConsultationDO getElectronicConsultation(Long id) { + return electronicConsultationMapper.selectById(id); + } + + @Override + public List getElectronicConsultationList(Collection ids) { + return electronicConsultationMapper.selectBatchIds(ids); + } + + @Override + public PageResult getElectronicConsultationPage(ElectronicConsultationPageReqVO pageReqVO) { + return electronicConsultationMapper.selectPage(pageReqVO); + } + + @Override + public List getElectronicConsultationList(ElectronicConsultationExportReqVO exportReqVO) { + return electronicConsultationMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electroniccustomercomplaint/ElectronicCustomerComplaintService.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electroniccustomercomplaint/ElectronicCustomerComplaintService.java new file mode 100644 index 00000000..2127e88a --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electroniccustomercomplaint/ElectronicCustomerComplaintService.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.ea.service.electroniccustomercomplaint; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccustomercomplaint.ElectronicCustomerComplaintDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 客诉档案 Service 接口 + * + * @author 芋道源码 + */ +public interface ElectronicCustomerComplaintService { + + /** + * 创建客诉档案 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createElectronicCustomerComplaint(@Valid ElectronicCustomerComplaintCreateReqVO createReqVO); + + /** + * 更新客诉档案 + * + * @param updateReqVO 更新信息 + */ + void updateElectronicCustomerComplaint(@Valid ElectronicCustomerComplaintUpdateReqVO updateReqVO); + + /** + * 删除客诉档案 + * + * @param id 编号 + */ + void deleteElectronicCustomerComplaint(Long id); + + /** + * 获得客诉档案 + * + * @param id 编号 + * @return 客诉档案 + */ + ElectronicCustomerComplaintDO getElectronicCustomerComplaint(Long id); + + /** + * 获得客诉档案列表 + * + * @param ids 编号 + * @return 客诉档案列表 + */ + List getElectronicCustomerComplaintList(Collection ids); + + /** + * 获得客诉档案分页 + * + * @param pageReqVO 分页查询 + * @return 客诉档案分页 + */ + PageResult getElectronicCustomerComplaintPage(ElectronicCustomerComplaintPageReqVO pageReqVO); + + /** + * 获得客诉档案列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 客诉档案列表 + */ + List getElectronicCustomerComplaintList(ElectronicCustomerComplaintExportReqVO exportReqVO); + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electroniccustomercomplaint/ElectronicCustomerComplaintServiceImpl.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electroniccustomercomplaint/ElectronicCustomerComplaintServiceImpl.java new file mode 100644 index 00000000..fd5bc557 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electroniccustomercomplaint/ElectronicCustomerComplaintServiceImpl.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.ea.service.electroniccustomercomplaint; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import cn.iocoder.yudao.module.ea.controller.admin.electroniccustomercomplaint.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccustomercomplaint.ElectronicCustomerComplaintDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.ea.convert.electroniccustomercomplaint.ElectronicCustomerComplaintConvert; +import cn.iocoder.yudao.module.ea.dal.mysql.electroniccustomercomplaint.ElectronicCustomerComplaintMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.ea.enums.ErrorCodeConstants.*; + +/** + * 客诉档案 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class ElectronicCustomerComplaintServiceImpl implements ElectronicCustomerComplaintService { + + @Resource + private ElectronicCustomerComplaintMapper electronicCustomerComplaintMapper; + + @Override + public Long createElectronicCustomerComplaint(ElectronicCustomerComplaintCreateReqVO createReqVO) { + // 插入 + ElectronicCustomerComplaintDO electronicCustomerComplaint = ElectronicCustomerComplaintConvert.INSTANCE.convert(createReqVO); + electronicCustomerComplaintMapper.insert(electronicCustomerComplaint); + // 返回 + return electronicCustomerComplaint.getId(); + } + + @Override + public void updateElectronicCustomerComplaint(ElectronicCustomerComplaintUpdateReqVO updateReqVO) { + // 校验存在 + validateElectronicCustomerComplaintExists(updateReqVO.getId()); + // 更新 + ElectronicCustomerComplaintDO updateObj = ElectronicCustomerComplaintConvert.INSTANCE.convert(updateReqVO); + electronicCustomerComplaintMapper.updateById(updateObj); + } + + @Override + public void deleteElectronicCustomerComplaint(Long id) { + // 校验存在 + validateElectronicCustomerComplaintExists(id); + // 删除 + electronicCustomerComplaintMapper.deleteById(id); + } + + private void validateElectronicCustomerComplaintExists(Long id) { + if (electronicCustomerComplaintMapper.selectById(id) == null) { + throw exception(ELECTRONIC_CUSTOMER_COMPLAINT_NOT_EXISTS); + } + } + + @Override + public ElectronicCustomerComplaintDO getElectronicCustomerComplaint(Long id) { + return electronicCustomerComplaintMapper.selectById(id); + } + + @Override + public List getElectronicCustomerComplaintList(Collection ids) { + return electronicCustomerComplaintMapper.selectBatchIds(ids); + } + + @Override + public PageResult getElectronicCustomerComplaintPage(ElectronicCustomerComplaintPageReqVO pageReqVO) { + return electronicCustomerComplaintMapper.selectPage(pageReqVO); + } + + @Override + public List getElectronicCustomerComplaintList(ElectronicCustomerComplaintExportReqVO exportReqVO) { + return electronicCustomerComplaintMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/resources/mapper/electronicconsultation/ElectronicConsultationMapper.xml b/yudao-module-electronic/yudao-module-ea-biz/src/main/resources/mapper/electronicconsultation/ElectronicConsultationMapper.xml new file mode 100644 index 00000000..d8e3c8ef --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/resources/mapper/electronicconsultation/ElectronicConsultationMapper.xml @@ -0,0 +1,12 @@ + + + + + + +