diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/SubjectFollowManagementController.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/SubjectFollowManagementController.java new file mode 100644 index 0000000..78a4e43 --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/SubjectFollowManagementController.java @@ -0,0 +1,102 @@ +package com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement; + +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 com.yunxi.scm.framework.common.pojo.PageResult; +import com.yunxi.scm.framework.common.pojo.CommonResult; +import static com.yunxi.scm.framework.common.pojo.CommonResult.success; + +import com.yunxi.scm.framework.excel.core.util.ExcelUtils; + +import com.yunxi.scm.framework.operatelog.core.annotations.OperateLog; +import static com.yunxi.scm.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement.vo.*; +import com.yunxi.scm.module.xxjj.dal.dataobject.subjectfollowmanagement.SubjectFollowManagementDO; +import com.yunxi.scm.module.xxjj.convert.subjectfollowmanagement.SubjectFollowManagementConvert; +import com.yunxi.scm.module.xxjj.service.subjectfollowmanagement.SubjectFollowManagementService; + +@Tag(name = "管理后台 - 主体跟进管理") +@RestController +@RequestMapping("/xxjj/subject-follow-management") +@Validated +public class SubjectFollowManagementController { + + @Resource + private SubjectFollowManagementService subjectFollowManagementService; + + @PostMapping("/create") + @Operation(summary = "创建主体跟进管理") + @PreAuthorize("@ss.hasPermission('xxjj:subject-follow-management:create')") + public CommonResult createSubjectFollowManagement(@Valid @RequestBody SubjectFollowManagementCreateReqVO createReqVO) { + return success(subjectFollowManagementService.createSubjectFollowManagement(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新主体跟进管理") + @PreAuthorize("@ss.hasPermission('xxjj:subject-follow-management:update')") + public CommonResult updateSubjectFollowManagement(@Valid @RequestBody SubjectFollowManagementUpdateReqVO updateReqVO) { + subjectFollowManagementService.updateSubjectFollowManagement(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除主体跟进管理") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('xxjj:subject-follow-management:delete')") + public CommonResult deleteSubjectFollowManagement(@RequestParam("id") Long id) { + subjectFollowManagementService.deleteSubjectFollowManagement(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得主体跟进管理") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('xxjj:subject-follow-management:query')") + public CommonResult getSubjectFollowManagement(@RequestParam("id") Long id) { + SubjectFollowManagementDO subjectFollowManagement = subjectFollowManagementService.getSubjectFollowManagement(id); + return success(SubjectFollowManagementConvert.INSTANCE.convert(subjectFollowManagement)); + } + + @GetMapping("/list") + @Operation(summary = "获得主体跟进管理列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") + @PreAuthorize("@ss.hasPermission('xxjj:subject-follow-management:query')") + public CommonResult> getSubjectFollowManagementList(@RequestParam("ids") Collection ids) { + List list = subjectFollowManagementService.getSubjectFollowManagementList(ids); + return success(SubjectFollowManagementConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @Operation(summary = "获得主体跟进管理分页") + @PreAuthorize("@ss.hasPermission('xxjj:subject-follow-management:query')") + public CommonResult> getSubjectFollowManagementPage(@Valid SubjectFollowManagementPageReqVO pageVO) { + PageResult pageResult = subjectFollowManagementService.getSubjectFollowManagementPage(pageVO); + return success(SubjectFollowManagementConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出主体跟进管理 Excel") + @PreAuthorize("@ss.hasPermission('xxjj:subject-follow-management:export')") + @OperateLog(type = EXPORT) + public void exportSubjectFollowManagementExcel(@Valid SubjectFollowManagementExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = subjectFollowManagementService.getSubjectFollowManagementList(exportReqVO); + // 导出 Excel + List datas = SubjectFollowManagementConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "主体跟进管理.xls", "数据", SubjectFollowManagementExcelVO.class, datas); + } + +} diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementBaseVO.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementBaseVO.java new file mode 100644 index 0000000..694a4e5 --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementBaseVO.java @@ -0,0 +1,64 @@ +package com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement.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 com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +/** + * 主体跟进管理 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class SubjectFollowManagementBaseVO { + + @Schema(description = "业务id", requiredMode = Schema.RequiredMode.REQUIRED, example = "10252") + @NotNull(message = "业务id不能为空") + private Long businessId; + + @Schema(description = "代表人类型(0:客户 1:供应商 2:服务商)", example = "2") + private String businessType; + + @Schema(description = "任务标题") + private String title; + + @Schema(description = "身份证号") + private String idCard; + + @Schema(description = "开始时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime startTime; + + @Schema(description = "结束时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime endTime; + + @Schema(description = "负责人员") + private String responsible; + + @Schema(description = "参与人员") + private String partake; + + @Schema(description = "标记颜色") + private String mark; + + @Schema(description = "紧要程度(0:重要 1:紧急 2:普通 3:较低)") + private String urgency; + + @Schema(description = "提醒类型(0:准时提醒 1:提前5分钟 2:提前15分钟 3:提前30分钟 4:提前1小时)", example = "1") + private String remindType; + + @Schema(description = "任务描述", example = "你猜") + private String description; + + @Schema(description = "附件") + private String annex; + +} diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementCreateReqVO.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementCreateReqVO.java new file mode 100644 index 0000000..b643d89 --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementCreateReqVO.java @@ -0,0 +1,14 @@ +package com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement.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 SubjectFollowManagementCreateReqVO extends SubjectFollowManagementBaseVO { + +} diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementExcelVO.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementExcelVO.java new file mode 100644 index 0000000..b63e8bd --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementExcelVO.java @@ -0,0 +1,66 @@ +package com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement.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 SubjectFollowManagementExcelVO { + + @ExcelProperty("主键id") + private Long id; + + @ExcelProperty("业务id") + private Long businessId; + + @ExcelProperty("代表人类型(0:客户 1:供应商 2:服务商)") + private String businessType; + + @ExcelProperty("任务标题") + private String title; + + @ExcelProperty("身份证号") + private String idCard; + + @ExcelProperty("开始时间") + private LocalDateTime startTime; + + @ExcelProperty("结束时间") + private LocalDateTime endTime; + + @ExcelProperty("负责人员") + private String responsible; + + @ExcelProperty("参与人员") + private String partake; + + @ExcelProperty("标记颜色") + private String mark; + + @ExcelProperty("紧要程度(0:重要 1:紧急 2:普通 3:较低)") + private String urgency; + + @ExcelProperty("提醒类型(0:准时提醒 1:提前5分钟 2:提前15分钟 3:提前30分钟 4:提前1小时)") + private String remindType; + + @ExcelProperty("任务描述") + private String description; + + @ExcelProperty("附件") + private String annex; + + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementExportReqVO.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementExportReqVO.java new file mode 100644 index 0000000..78f0c3e --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementExportReqVO.java @@ -0,0 +1,61 @@ +package com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunxi.scm.framework.common.pojo.PageParam; +import java.time.LocalDateTime; +import org.springframework.format.annotation.DateTimeFormat; + +import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 主体跟进管理 Excel 导出 Request VO,参数和 SubjectFollowManagementPageReqVO 是一致的") +@Data +public class SubjectFollowManagementExportReqVO { + + @Schema(description = "业务id", example = "10252") + private Long businessId; + + @Schema(description = "代表人类型(0:客户 1:供应商 2:服务商)", example = "2") + private String businessType; + + @Schema(description = "任务标题") + private String title; + + @Schema(description = "身份证号") + private String idCard; + + @Schema(description = "开始时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] startTime; + + @Schema(description = "结束时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] endTime; + + @Schema(description = "负责人员") + private String responsible; + + @Schema(description = "参与人员") + private String partake; + + @Schema(description = "标记颜色") + private String mark; + + @Schema(description = "紧要程度(0:重要 1:紧急 2:普通 3:较低)") + private String urgency; + + @Schema(description = "提醒类型(0:准时提醒 1:提前5分钟 2:提前15分钟 3:提前30分钟 4:提前1小时)", example = "1") + private String remindType; + + @Schema(description = "任务描述", example = "你猜") + private String description; + + @Schema(description = "附件") + private String annex; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementPageReqVO.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementPageReqVO.java new file mode 100644 index 0000000..cb90c0c --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementPageReqVO.java @@ -0,0 +1,63 @@ +package com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.yunxi.scm.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.yunxi.scm.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 SubjectFollowManagementPageReqVO extends PageParam { + + @Schema(description = "业务id", example = "10252") + private Long businessId; + + @Schema(description = "代表人类型(0:客户 1:供应商 2:服务商)", example = "2") + private String businessType; + + @Schema(description = "任务标题") + private String title; + + @Schema(description = "身份证号") + private String idCard; + + @Schema(description = "开始时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] startTime; + + @Schema(description = "结束时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] endTime; + + @Schema(description = "负责人员") + private String responsible; + + @Schema(description = "参与人员") + private String partake; + + @Schema(description = "标记颜色") + private String mark; + + @Schema(description = "紧要程度(0:重要 1:紧急 2:普通 3:较低)") + private String urgency; + + @Schema(description = "提醒类型(0:准时提醒 1:提前5分钟 2:提前15分钟 3:提前30分钟 4:提前1小时)", example = "1") + private String remindType; + + @Schema(description = "任务描述", example = "你猜") + private String description; + + @Schema(description = "附件") + private String annex; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementRespVO.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementRespVO.java new file mode 100644 index 0000000..9dccb52 --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementRespVO.java @@ -0,0 +1,19 @@ +package com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement.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 SubjectFollowManagementRespVO extends SubjectFollowManagementBaseVO { + + @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23298") + private Long id; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + private LocalDateTime createTime; + +} diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementUpdateReqVO.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementUpdateReqVO.java new file mode 100644 index 0000000..8c90f94 --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/controller/admin/subjectfollowmanagement/vo/SubjectFollowManagementUpdateReqVO.java @@ -0,0 +1,18 @@ +package com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement.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 SubjectFollowManagementUpdateReqVO extends SubjectFollowManagementBaseVO { + + @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23298") + @NotNull(message = "主键id不能为空") + private Long id; + +} diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/convert/subjectfollowmanagement/SubjectFollowManagementConvert.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/convert/subjectfollowmanagement/SubjectFollowManagementConvert.java new file mode 100644 index 0000000..013a9dc --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/convert/subjectfollowmanagement/SubjectFollowManagementConvert.java @@ -0,0 +1,34 @@ +package com.yunxi.scm.module.xxjj.convert.subjectfollowmanagement; + +import java.util.*; + +import com.yunxi.scm.framework.common.pojo.PageResult; + +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; +import com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement.vo.*; +import com.yunxi.scm.module.xxjj.dal.dataobject.subjectfollowmanagement.SubjectFollowManagementDO; + +/** + * 主体跟进管理 Convert + * + * @author 长江云息 + */ +@Mapper +public interface SubjectFollowManagementConvert { + + SubjectFollowManagementConvert INSTANCE = Mappers.getMapper(SubjectFollowManagementConvert.class); + + SubjectFollowManagementDO convert(SubjectFollowManagementCreateReqVO bean); + + SubjectFollowManagementDO convert(SubjectFollowManagementUpdateReqVO bean); + + SubjectFollowManagementRespVO convert(SubjectFollowManagementDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/dal/dataobject/subjectfollowmanagement/SubjectFollowManagementDO.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/dal/dataobject/subjectfollowmanagement/SubjectFollowManagementDO.java new file mode 100644 index 0000000..8d0423e --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/dal/dataobject/subjectfollowmanagement/SubjectFollowManagementDO.java @@ -0,0 +1,85 @@ +package com.yunxi.scm.module.xxjj.dal.dataobject.subjectfollowmanagement; + +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 com.yunxi.scm.framework.mybatis.core.dataobject.BaseDO; + +/** + * 主体跟进管理 DO + * + * @author 长江云息 + */ +@TableName("xxjj_subject_follow_management") +@KeySequence("xxjj_subject_follow_management_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SubjectFollowManagementDO extends BaseDO { + + /** + * 主键id + */ + @TableId + private Long id; + /** + * 业务id + */ + private Long businessId; + /** + * 代表人类型(0:客户 1:供应商 2:服务商) + */ + private String businessType; + /** + * 任务标题 + */ + private String title; + /** + * 身份证号 + */ + private String idCard; + /** + * 开始时间 + */ + private LocalDateTime startTime; + /** + * 结束时间 + */ + private LocalDateTime endTime; + /** + * 负责人员 + */ + private String responsible; + /** + * 参与人员 + */ + private String partake; + /** + * 标记颜色 + */ + private String mark; + /** + * 紧要程度(0:重要 1:紧急 2:普通 3:较低) + */ + private String urgency; + /** + * 提醒类型(0:准时提醒 1:提前5分钟 2:提前15分钟 3:提前30分钟 4:提前1小时) + */ + private String remindType; + /** + * 任务描述 + */ + private String description; + /** + * 附件 + */ + private String annex; + +} diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/dal/mysql/subjectfollowmanagement/SubjectFollowManagementMapper.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/dal/mysql/subjectfollowmanagement/SubjectFollowManagementMapper.java new file mode 100644 index 0000000..c85b1d3 --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/dal/mysql/subjectfollowmanagement/SubjectFollowManagementMapper.java @@ -0,0 +1,58 @@ +package com.yunxi.scm.module.xxjj.dal.mysql.subjectfollowmanagement; + +import java.util.*; + +import com.yunxi.scm.framework.common.pojo.PageResult; +import com.yunxi.scm.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.yunxi.scm.framework.mybatis.core.mapper.BaseMapperX; +import com.yunxi.scm.module.xxjj.dal.dataobject.subjectfollowmanagement.SubjectFollowManagementDO; +import org.apache.ibatis.annotations.Mapper; +import com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement.vo.*; + +/** + * 主体跟进管理 Mapper + * + * @author 长江云息 + */ +@Mapper +public interface SubjectFollowManagementMapper extends BaseMapperX { + + default PageResult selectPage(SubjectFollowManagementPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(SubjectFollowManagementDO::getBusinessId, reqVO.getBusinessId()) + .eqIfPresent(SubjectFollowManagementDO::getBusinessType, reqVO.getBusinessType()) + .eqIfPresent(SubjectFollowManagementDO::getTitle, reqVO.getTitle()) + .eqIfPresent(SubjectFollowManagementDO::getIdCard, reqVO.getIdCard()) + .betweenIfPresent(SubjectFollowManagementDO::getStartTime, reqVO.getStartTime()) + .betweenIfPresent(SubjectFollowManagementDO::getEndTime, reqVO.getEndTime()) + .eqIfPresent(SubjectFollowManagementDO::getResponsible, reqVO.getResponsible()) + .eqIfPresent(SubjectFollowManagementDO::getPartake, reqVO.getPartake()) + .eqIfPresent(SubjectFollowManagementDO::getMark, reqVO.getMark()) + .eqIfPresent(SubjectFollowManagementDO::getUrgency, reqVO.getUrgency()) + .eqIfPresent(SubjectFollowManagementDO::getRemindType, reqVO.getRemindType()) + .eqIfPresent(SubjectFollowManagementDO::getDescription, reqVO.getDescription()) + .eqIfPresent(SubjectFollowManagementDO::getAnnex, reqVO.getAnnex()) + .betweenIfPresent(SubjectFollowManagementDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(SubjectFollowManagementDO::getId)); + } + + default List selectList(SubjectFollowManagementExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(SubjectFollowManagementDO::getBusinessId, reqVO.getBusinessId()) + .eqIfPresent(SubjectFollowManagementDO::getBusinessType, reqVO.getBusinessType()) + .eqIfPresent(SubjectFollowManagementDO::getTitle, reqVO.getTitle()) + .eqIfPresent(SubjectFollowManagementDO::getIdCard, reqVO.getIdCard()) + .betweenIfPresent(SubjectFollowManagementDO::getStartTime, reqVO.getStartTime()) + .betweenIfPresent(SubjectFollowManagementDO::getEndTime, reqVO.getEndTime()) + .eqIfPresent(SubjectFollowManagementDO::getResponsible, reqVO.getResponsible()) + .eqIfPresent(SubjectFollowManagementDO::getPartake, reqVO.getPartake()) + .eqIfPresent(SubjectFollowManagementDO::getMark, reqVO.getMark()) + .eqIfPresent(SubjectFollowManagementDO::getUrgency, reqVO.getUrgency()) + .eqIfPresent(SubjectFollowManagementDO::getRemindType, reqVO.getRemindType()) + .eqIfPresent(SubjectFollowManagementDO::getDescription, reqVO.getDescription()) + .eqIfPresent(SubjectFollowManagementDO::getAnnex, reqVO.getAnnex()) + .betweenIfPresent(SubjectFollowManagementDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(SubjectFollowManagementDO::getId)); + } + +} diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/service/subjectfollowmanagement/SubjectFollowManagementService.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/service/subjectfollowmanagement/SubjectFollowManagementService.java new file mode 100644 index 0000000..811695f --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/service/subjectfollowmanagement/SubjectFollowManagementService.java @@ -0,0 +1,70 @@ +package com.yunxi.scm.module.xxjj.service.subjectfollowmanagement; + +import java.util.*; +import javax.validation.*; +import com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement.vo.*; +import com.yunxi.scm.module.xxjj.dal.dataobject.subjectfollowmanagement.SubjectFollowManagementDO; +import com.yunxi.scm.framework.common.pojo.PageResult; + +/** + * 主体跟进管理 Service 接口 + * + * @author 长江云息 + */ +public interface SubjectFollowManagementService { + + /** + * 创建主体跟进管理 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createSubjectFollowManagement(@Valid SubjectFollowManagementCreateReqVO createReqVO); + + /** + * 更新主体跟进管理 + * + * @param updateReqVO 更新信息 + */ + void updateSubjectFollowManagement(@Valid SubjectFollowManagementUpdateReqVO updateReqVO); + + /** + * 删除主体跟进管理 + * + * @param id 编号 + */ + void deleteSubjectFollowManagement(Long id); + + /** + * 获得主体跟进管理 + * + * @param id 编号 + * @return 主体跟进管理 + */ + SubjectFollowManagementDO getSubjectFollowManagement(Long id); + + /** + * 获得主体跟进管理列表 + * + * @param ids 编号 + * @return 主体跟进管理列表 + */ + List getSubjectFollowManagementList(Collection ids); + + /** + * 获得主体跟进管理分页 + * + * @param pageReqVO 分页查询 + * @return 主体跟进管理分页 + */ + PageResult getSubjectFollowManagementPage(SubjectFollowManagementPageReqVO pageReqVO); + + /** + * 获得主体跟进管理列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 主体跟进管理列表 + */ + List getSubjectFollowManagementList(SubjectFollowManagementExportReqVO exportReqVO); + +} diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/service/subjectfollowmanagement/SubjectFollowManagementServiceImpl.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/service/subjectfollowmanagement/SubjectFollowManagementServiceImpl.java new file mode 100644 index 0000000..5430f6a --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/java/com/yunxi/scm/module/xxjj/service/subjectfollowmanagement/SubjectFollowManagementServiceImpl.java @@ -0,0 +1,82 @@ +package com.yunxi.scm.module.xxjj.service.subjectfollowmanagement; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement.vo.*; +import com.yunxi.scm.module.xxjj.dal.dataobject.subjectfollowmanagement.SubjectFollowManagementDO; +import com.yunxi.scm.framework.common.pojo.PageResult; + +import com.yunxi.scm.module.xxjj.convert.subjectfollowmanagement.SubjectFollowManagementConvert; +import com.yunxi.scm.module.xxjj.dal.mysql.subjectfollowmanagement.SubjectFollowManagementMapper; + +import static com.yunxi.scm.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.yunxi.scm.module.xxjj.enums.ErrorCodeConstants.*; + +/** + * 主体跟进管理 Service 实现类 + * + * @author 长江云息 + */ +@Service +@Validated +public class SubjectFollowManagementServiceImpl implements SubjectFollowManagementService { + + @Resource + private SubjectFollowManagementMapper subjectFollowManagementMapper; + + @Override + public Long createSubjectFollowManagement(SubjectFollowManagementCreateReqVO createReqVO) { + // 插入 + SubjectFollowManagementDO subjectFollowManagement = SubjectFollowManagementConvert.INSTANCE.convert(createReqVO); + subjectFollowManagementMapper.insert(subjectFollowManagement); + // 返回 + return subjectFollowManagement.getId(); + } + + @Override + public void updateSubjectFollowManagement(SubjectFollowManagementUpdateReqVO updateReqVO) { + // 校验存在 + validateSubjectFollowManagementExists(updateReqVO.getId()); + // 更新 + SubjectFollowManagementDO updateObj = SubjectFollowManagementConvert.INSTANCE.convert(updateReqVO); + subjectFollowManagementMapper.updateById(updateObj); + } + + @Override + public void deleteSubjectFollowManagement(Long id) { + // 校验存在 + validateSubjectFollowManagementExists(id); + // 删除 + subjectFollowManagementMapper.deleteById(id); + } + + private void validateSubjectFollowManagementExists(Long id) { + if (subjectFollowManagementMapper.selectById(id) == null) { + throw exception(SUBJECT_FOLLOW_MANAGEMENT_NOT_EXISTS); + } + } + + @Override + public SubjectFollowManagementDO getSubjectFollowManagement(Long id) { + return subjectFollowManagementMapper.selectById(id); + } + + @Override + public List getSubjectFollowManagementList(Collection ids) { + return subjectFollowManagementMapper.selectBatchIds(ids); + } + + @Override + public PageResult getSubjectFollowManagementPage(SubjectFollowManagementPageReqVO pageReqVO) { + return subjectFollowManagementMapper.selectPage(pageReqVO); + } + + @Override + public List getSubjectFollowManagementList(SubjectFollowManagementExportReqVO exportReqVO) { + return subjectFollowManagementMapper.selectList(exportReqVO); + } + +} diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/resources/mapper/subjectfollowmanagement/SubjectFollowManagementMapper.xml b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/resources/mapper/subjectfollowmanagement/SubjectFollowManagementMapper.xml new file mode 100644 index 0000000..3066e8d --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/main/resources/mapper/subjectfollowmanagement/SubjectFollowManagementMapper.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/test/java/com/yunxi/scm/module/xxjj/service/subjectfollowmanagement/SubjectFollowManagementServiceImplTest.java b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/test/java/com/yunxi/scm/module/xxjj/service/subjectfollowmanagement/SubjectFollowManagementServiceImplTest.java new file mode 100644 index 0000000..e4ad144 --- /dev/null +++ b/yunxi-module-xxjj/yunxi-module-xxjj-biz/src/test/java/com/yunxi/scm/module/xxjj/service/subjectfollowmanagement/SubjectFollowManagementServiceImplTest.java @@ -0,0 +1,255 @@ +package com.yunxi.scm.module.xxjj.service.subjectfollowmanagement; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.mock.mockito.MockBean; + +import javax.annotation.Resource; + +import com.yunxi.scm.framework.test.core.ut.BaseDbUnitTest; + +import com.yunxi.scm.module.xxjj.controller.admin.subjectfollowmanagement.vo.*; +import com.yunxi.scm.module.xxjj.dal.dataobject.subjectfollowmanagement.SubjectFollowManagementDO; +import com.yunxi.scm.module.xxjj.dal.mysql.subjectfollowmanagement.SubjectFollowManagementMapper; +import com.yunxi.scm.framework.common.pojo.PageResult; + +import javax.annotation.Resource; +import org.springframework.context.annotation.Import; +import java.util.*; +import java.time.LocalDateTime; + +import static cn.hutool.core.util.RandomUtil.*; +import static com.yunxi.scm.module.xxjj.enums.ErrorCodeConstants.*; +import static com.yunxi.scm.framework.test.core.util.AssertUtils.*; +import static com.yunxi.scm.framework.test.core.util.RandomUtils.*; +import static com.yunxi.scm.framework.common.util.date.LocalDateTimeUtils.*; +import static com.yunxi.scm.framework.common.util.object.ObjectUtils.*; +import static com.yunxi.scm.framework.common.util.date.DateUtils.*; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.*; + +/** + * {@link SubjectFollowManagementServiceImpl} 的单元测试类 + * + * @author 长江云息 + */ +@Import(SubjectFollowManagementServiceImpl.class) +public class SubjectFollowManagementServiceImplTest extends BaseDbUnitTest { + + @Resource + private SubjectFollowManagementServiceImpl subjectFollowManagementService; + + @Resource + private SubjectFollowManagementMapper subjectFollowManagementMapper; + + @Test + public void testCreateSubjectFollowManagement_success() { + // 准备参数 + SubjectFollowManagementCreateReqVO reqVO = randomPojo(SubjectFollowManagementCreateReqVO.class); + + // 调用 + Long subjectFollowManagementId = subjectFollowManagementService.createSubjectFollowManagement(reqVO); + // 断言 + assertNotNull(subjectFollowManagementId); + // 校验记录的属性是否正确 + SubjectFollowManagementDO subjectFollowManagement = subjectFollowManagementMapper.selectById(subjectFollowManagementId); + assertPojoEquals(reqVO, subjectFollowManagement); + } + + @Test + public void testUpdateSubjectFollowManagement_success() { + // mock 数据 + SubjectFollowManagementDO dbSubjectFollowManagement = randomPojo(SubjectFollowManagementDO.class); + subjectFollowManagementMapper.insert(dbSubjectFollowManagement);// @Sql: 先插入出一条存在的数据 + // 准备参数 + SubjectFollowManagementUpdateReqVO reqVO = randomPojo(SubjectFollowManagementUpdateReqVO.class, o -> { + o.setId(dbSubjectFollowManagement.getId()); // 设置更新的 ID + }); + + // 调用 + subjectFollowManagementService.updateSubjectFollowManagement(reqVO); + // 校验是否更新正确 + SubjectFollowManagementDO subjectFollowManagement = subjectFollowManagementMapper.selectById(reqVO.getId()); // 获取最新的 + assertPojoEquals(reqVO, subjectFollowManagement); + } + + @Test + public void testUpdateSubjectFollowManagement_notExists() { + // 准备参数 + SubjectFollowManagementUpdateReqVO reqVO = randomPojo(SubjectFollowManagementUpdateReqVO.class); + + // 调用, 并断言异常 + assertServiceException(() -> subjectFollowManagementService.updateSubjectFollowManagement(reqVO), SUBJECT_FOLLOW_MANAGEMENT_NOT_EXISTS); + } + + @Test + public void testDeleteSubjectFollowManagement_success() { + // mock 数据 + SubjectFollowManagementDO dbSubjectFollowManagement = randomPojo(SubjectFollowManagementDO.class); + subjectFollowManagementMapper.insert(dbSubjectFollowManagement);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbSubjectFollowManagement.getId(); + + // 调用 + subjectFollowManagementService.deleteSubjectFollowManagement(id); + // 校验数据不存在了 + assertNull(subjectFollowManagementMapper.selectById(id)); + } + + @Test + public void testDeleteSubjectFollowManagement_notExists() { + // 准备参数 + Long id = randomLongId(); + + // 调用, 并断言异常 + assertServiceException(() -> subjectFollowManagementService.deleteSubjectFollowManagement(id), SUBJECT_FOLLOW_MANAGEMENT_NOT_EXISTS); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetSubjectFollowManagementPage() { + // mock 数据 + SubjectFollowManagementDO dbSubjectFollowManagement = randomPojo(SubjectFollowManagementDO.class, o -> { // 等会查询到 + o.setBusinessId(null); + o.setBusinessType(null); + o.setTitle(null); + o.setIdCard(null); + o.setStartTime(null); + o.setEndTime(null); + o.setResponsible(null); + o.setPartake(null); + o.setMark(null); + o.setUrgency(null); + o.setRemindType(null); + o.setDescription(null); + o.setAnnex(null); + o.setCreateTime(null); + }); + subjectFollowManagementMapper.insert(dbSubjectFollowManagement); + // 测试 businessId 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setBusinessId(null))); + // 测试 businessType 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setBusinessType(null))); + // 测试 title 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setTitle(null))); + // 测试 idCard 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setIdCard(null))); + // 测试 startTime 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setStartTime(null))); + // 测试 endTime 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setEndTime(null))); + // 测试 responsible 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setResponsible(null))); + // 测试 partake 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setPartake(null))); + // 测试 mark 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setMark(null))); + // 测试 urgency 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setUrgency(null))); + // 测试 remindType 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setRemindType(null))); + // 测试 description 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setDescription(null))); + // 测试 annex 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setAnnex(null))); + // 测试 createTime 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setCreateTime(null))); + // 准备参数 + SubjectFollowManagementPageReqVO reqVO = new SubjectFollowManagementPageReqVO(); + reqVO.setBusinessId(null); + reqVO.setBusinessType(null); + reqVO.setTitle(null); + reqVO.setIdCard(null); + reqVO.setStartTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + reqVO.setEndTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + reqVO.setResponsible(null); + reqVO.setPartake(null); + reqVO.setMark(null); + reqVO.setUrgency(null); + reqVO.setRemindType(null); + reqVO.setDescription(null); + reqVO.setAnnex(null); + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + + // 调用 + PageResult pageResult = subjectFollowManagementService.getSubjectFollowManagementPage(reqVO); + // 断言 + assertEquals(1, pageResult.getTotal()); + assertEquals(1, pageResult.getList().size()); + assertPojoEquals(dbSubjectFollowManagement, pageResult.getList().get(0)); + } + + @Test + @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 + public void testGetSubjectFollowManagementList() { + // mock 数据 + SubjectFollowManagementDO dbSubjectFollowManagement = randomPojo(SubjectFollowManagementDO.class, o -> { // 等会查询到 + o.setBusinessId(null); + o.setBusinessType(null); + o.setTitle(null); + o.setIdCard(null); + o.setStartTime(null); + o.setEndTime(null); + o.setResponsible(null); + o.setPartake(null); + o.setMark(null); + o.setUrgency(null); + o.setRemindType(null); + o.setDescription(null); + o.setAnnex(null); + o.setCreateTime(null); + }); + subjectFollowManagementMapper.insert(dbSubjectFollowManagement); + // 测试 businessId 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setBusinessId(null))); + // 测试 businessType 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setBusinessType(null))); + // 测试 title 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setTitle(null))); + // 测试 idCard 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setIdCard(null))); + // 测试 startTime 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setStartTime(null))); + // 测试 endTime 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setEndTime(null))); + // 测试 responsible 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setResponsible(null))); + // 测试 partake 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setPartake(null))); + // 测试 mark 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setMark(null))); + // 测试 urgency 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setUrgency(null))); + // 测试 remindType 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setRemindType(null))); + // 测试 description 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setDescription(null))); + // 测试 annex 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setAnnex(null))); + // 测试 createTime 不匹配 + subjectFollowManagementMapper.insert(cloneIgnoreId(dbSubjectFollowManagement, o -> o.setCreateTime(null))); + // 准备参数 + SubjectFollowManagementExportReqVO reqVO = new SubjectFollowManagementExportReqVO(); + reqVO.setBusinessId(null); + reqVO.setBusinessType(null); + reqVO.setTitle(null); + reqVO.setIdCard(null); + reqVO.setStartTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + reqVO.setEndTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + reqVO.setResponsible(null); + reqVO.setPartake(null); + reqVO.setMark(null); + reqVO.setUrgency(null); + reqVO.setRemindType(null); + reqVO.setDescription(null); + reqVO.setAnnex(null); + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); + + // 调用 + List list = subjectFollowManagementService.getSubjectFollowManagementList(reqVO); + // 断言 + assertEquals(1, list.size()); + assertPojoEquals(dbSubjectFollowManagement, list.get(0)); + } + +} diff --git a/yunxi-ui-admin-vben/src/api/xxjj/subjectFollowManagement/index.ts b/yunxi-ui-admin-vben/src/api/xxjj/subjectFollowManagement/index.ts new file mode 100644 index 0000000..bef04d1 --- /dev/null +++ b/yunxi-ui-admin-vben/src/api/xxjj/subjectFollowManagement/index.ts @@ -0,0 +1,31 @@ +import { defHttp } from '@/utils/http/axios' + +// 查询主体跟进管理列表 +export function getSubjectFollowManagementPage(params) { + return defHttp.get({ url: '/xxjj/subject-follow-management/page', params }) +} + +// 查询主体跟进管理详情 +export function getSubjectFollowManagement(id: number) { + return defHttp.get({ url: '/xxjj/subject-follow-management/get?id=' + id }) +} + +// 新增主体跟进管理 +export function createSubjectFollowManagement(data) { + return defHttp.post({ url: '/xxjj/subject-follow-management/create', data }) +} + +// 修改主体跟进管理 +export function updateSubjectFollowManagement(data) { + return defHttp.put({ url: '/xxjj/subject-follow-management/update', data }) +} + +// 删除主体跟进管理 +export function deleteSubjectFollowManagement(id: number) { + return defHttp.delete({ url: '/xxjj/subject-follow-management/delete?id=' + id }) +} + +// 导出主体跟进管理 Excel +export function exportSubjectFollowManagement(params) { + return defHttp.download({ url: '/xxjj/subject-follow-management/export-excel', params }, '主体跟进管理.xls') +} diff --git a/yunxi-ui-admin-vben/src/views/xxjj/subjectFollowManagement/SubjectFollowManagementModal.vue b/yunxi-ui-admin-vben/src/views/xxjj/subjectFollowManagement/SubjectFollowManagementModal.vue new file mode 100644 index 0000000..bd974c0 --- /dev/null +++ b/yunxi-ui-admin-vben/src/views/xxjj/subjectFollowManagement/SubjectFollowManagementModal.vue @@ -0,0 +1,57 @@ + + diff --git a/yunxi-ui-admin-vben/src/views/xxjj/subjectFollowManagement/index.vue b/yunxi-ui-admin-vben/src/views/xxjj/subjectFollowManagement/index.vue new file mode 100644 index 0000000..55d6e37 --- /dev/null +++ b/yunxi-ui-admin-vben/src/views/xxjj/subjectFollowManagement/index.vue @@ -0,0 +1,92 @@ + + diff --git a/yunxi-ui-admin-vben/src/views/xxjj/subjectFollowManagement/subjectFollowManagement.data.ts b/yunxi-ui-admin-vben/src/views/xxjj/subjectFollowManagement/subjectFollowManagement.data.ts new file mode 100644 index 0000000..345ca81 --- /dev/null +++ b/yunxi-ui-admin-vben/src/views/xxjj/subjectFollowManagement/subjectFollowManagement.data.ts @@ -0,0 +1,397 @@ +import { BasicColumn, FormSchema, useRender } from '@/components/Table' +import { DICT_TYPE, getDictOptions } from '@/utils/dict' +import { getListSimpleUsers } from '@/api/system/user' + +export const columns: BasicColumn[] = [ + { + title: '主键id', + dataIndex: 'id', + width: 160 + }, + { + title: '业务id', + dataIndex: 'businessId', + width: 160 + }, + { + title: '代表人类型(0:客户 1:供应商 2:服务商)', + dataIndex: 'businessType', + width: 160 + }, + { + title: '任务标题', + dataIndex: 'title', + width: 160 + }, + { + title: '身份证号', + dataIndex: 'idCard', + width: 160 + }, + { + title: '开始时间', + dataIndex: 'startTime', + width: 180, + customRender: ({ text }) => { + return useRender.renderDate(text) + } + }, + { + title: '结束时间', + dataIndex: 'endTime', + width: 180, + customRender: ({ text }) => { + return useRender.renderDate(text) + } + }, + { + title: '负责人员', + dataIndex: 'responsible', + width: 160 + }, + { + title: '参与人员', + dataIndex: 'partake', + width: 160 + }, + { + title: '标记颜色', + dataIndex: 'mark', + width: 160 + }, + { + title: '紧要程度(0:重要 1:紧急 2:普通 3:较低)', + dataIndex: 'urgency', + width: 160 + }, + { + title: '提醒类型(0:准时提醒 1:提前5分钟 2:提前15分钟 3:提前30分钟 4:提前1小时)', + dataIndex: 'remindType', + width: 160 + }, + { + title: '任务描述', + dataIndex: 'description', + width: 160 + }, + { + title: '附件', + dataIndex: 'annex', + width: 160 + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180, + customRender: ({ text }) => { + return useRender.renderDate(text) + } + }, +] + +export const searchFormSchema: FormSchema[] = [ + /* { + label: '业务id', + field: 'businessId', + component: 'Input', + colProps: { span: 4 } + }, */ + { + label: '代表人类型', + field: 'businessType', + component: 'Select', + componentProps: { + options: [], + hidden: true, + }, + defaultValue: '0', + show: false, + colProps: { span: 4 } + }, + { + label: '任务标题', + field: 'title', + component: 'Input', + colProps: { span: 4 } + }, + { + label: '客户分类', + field: 'calssify', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.CUSTOMER_CALSSIFY) + }, + colProps: { span: 4 } + }, + { + label: '行业分类', + field: 'industryClassify', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.industryClassify) + }, + colProps: { span: 4 } + }, + { + label: '企业性质', + field: 'enterpriseNature', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.enterpriseNature) + }, + colProps: { span: 4 } + }, + /* { + label: '身份证号', + field: 'idCard', + component: 'Input', + colProps: { span: 4 } + }, + { + label: '开始时间', + field: 'startTime', + component: 'RangePicker', + colProps: { span: 4 } + }, + { + label: '结束时间', + field: 'endTime', + component: 'RangePicker', + colProps: { span: 4 } + }, + { + label: '负责人员', + field: 'responsible', + component: 'Input', + colProps: { span: 4 } + }, + { + label: '参与人员', + field: 'partake', + component: 'Input', + colProps: { span: 4 } + }, + { + label: '标记颜色', + field: 'mark', + component: 'Input', + colProps: { span: 4 } + }, + { + label: '紧要程度(0:重要 1:紧急 2:普通 3:较低)', + field: 'urgency', + component: 'Input', + colProps: { span: 4 } + }, + { + label: '提醒类型(0:准时提醒 1:提前5分钟 2:提前15分钟 3:提前30分钟 4:提前1小时)', + field: 'remindType', + component: 'Select', + componentProps: { + options: [] + }, + colProps: { span: 4 } + }, + { + label: '任务描述', + field: 'description', + colProps: { span: 4 } + }, + { + label: '附件', + field: 'annex', + colProps: { span: 4 } + }, + { + label: '创建时间', + field: 'createTime', + component: 'RangePicker', + colProps: { span: 4 } + }, */ +] + +export const createFormSchema: FormSchema[] = [ + { + label: '编号', + field: 'id', + show: false, + component: 'Input' + }, + { + label: '代表人类型(0:客户 1:供应商 2:服务商)', + field: 'businessType', + component: 'Select', + defaultValue: '0', + show: false, + componentProps: { + options:[] + } + }, + { + label: '任务标题', + field: 'title', + required: true, + component: 'Input' + }, + { + label: '开始时间', + field: 'startTime', + required: true, + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + }, + }, + { + label: '结束时间', + field: 'endTime', + required: true, + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + }, + }, + { + label: '关联客户', + field: 'businessId', + required: true, + component: 'ApiTreeSelect', + componentProps: { + api: () => getListSimpleUsers(), + parentLabel: '主类目', + fieldNames: { + label: 'name', + key: 'id', + value: 'id', + }, + handleTree: 'id', + }, + }, + { + label: '负责人员', + field: 'responsible', + component: 'Input' + }, + { + label: '参与人员', + field: 'partake', + component: 'Input' + }, + { + label: '标记颜色', + field: 'mark', + component: 'Input' + }, + { + label: '紧要程度(0:重要 1:紧急 2:普通 3:较低)', + field: 'urgency', + component: 'Input' + }, + { + label: '提醒类型(0:准时提醒 1:提前5分钟 2:提前15分钟 3:提前30分钟 4:提前1小时)', + field: 'remindType', + component: 'Select', + componentProps: { + options:[] + } + }, + { + label: '任务描述', + field: 'description', + component: 'InputTextArea' + }, + { + label: '附件', + field: 'annex', + component: 'FileUpload', + componentProps: { + fileType: 'image', + maxCount: 1 + } + }, +] + +export const updateFormSchema: FormSchema[] = [ + { + label: '编号', + field: 'id', + show: false, + component: 'Input' + }, + { + label: '业务id', + field: 'businessId', + required: true, + component: 'Input' + }, + { + label: '代表人类型(0:客户 1:供应商 2:服务商)', + field: 'businessType', + component: 'Select', + componentProps: { + options:[] + } + }, + { + label: '任务标题', + field: 'title', + component: 'Input' + }, + { + label: '身份证号', + field: 'idCard', + component: 'Input' + }, + { + label: '开始时间', + field: 'startTime', + component: 'DatePicker' + }, + { + label: '结束时间', + field: 'endTime', + component: 'DatePicker' + }, + { + label: '负责人员', + field: 'responsible', + component: 'Input' + }, + { + label: '参与人员', + field: 'partake', + component: 'Input' + }, + { + label: '标记颜色', + field: 'mark', + component: 'Input' + }, + { + label: '紧要程度(0:重要 1:紧急 2:普通 3:较低)', + field: 'urgency', + component: 'Input' + }, + { + label: '提醒类型(0:准时提醒 1:提前5分钟 2:提前15分钟 3:提前30分钟 4:提前1小时)', + field: 'remindType', + component: 'Select', + componentProps: { + options:[] + } + }, + { + label: '任务描述', + field: 'description', + component: 'InputTextArea' + }, + { + label: '附件', + field: 'annex', + component: 'Upload' + }, +]