新增满意度表后端
This commit is contained in:
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:47:53 CST 2026
|
||||
#Thu Jan 15 09:17:56 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-common
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:49:25 CST 2026
|
||||
#Thu Jan 15 09:20:00 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-banner
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:26 CST 2026
|
||||
#Thu Jan 15 09:18:37 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-biz-data-permission
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:18 CST 2026
|
||||
#Thu Jan 15 09:18:25 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-biz-dict
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:49:24 CST 2026
|
||||
#Thu Jan 15 09:19:59 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-biz-error-code
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:05 CST 2026
|
||||
#Thu Jan 15 09:18:09 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-biz-operatelog
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:49:44 CST 2026
|
||||
#Thu Jan 15 09:20:22 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-biz-pay
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:17 CST 2026
|
||||
#Thu Jan 15 09:18:23 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-biz-sms
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:28 CST 2026
|
||||
#Thu Jan 15 09:18:41 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-biz-social
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:36 CST 2026
|
||||
#Thu Jan 15 09:18:51 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-biz-tenant
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:38 CST 2026
|
||||
#Thu Jan 15 09:18:53 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-excel
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:49:09 CST 2026
|
||||
#Thu Jan 15 09:19:37 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-file
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:30 CST 2026
|
||||
#Thu Jan 15 09:18:43 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-job
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:49:39 CST 2026
|
||||
#Thu Jan 15 09:20:16 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-monitor
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:32 CST 2026
|
||||
#Thu Jan 15 09:18:46 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-mq
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:08 CST 2026
|
||||
#Thu Jan 15 09:18:12 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-mybatis
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:49:27 CST 2026
|
||||
#Thu Jan 15 09:20:03 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-protection
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:10 CST 2026
|
||||
#Thu Jan 15 09:18:14 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-redis
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:21 CST 2026
|
||||
#Thu Jan 15 09:18:30 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-security
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:12 CST 2026
|
||||
#Thu Jan 15 09:18:17 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-test
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:48:02 CST 2026
|
||||
#Thu Jan 15 09:18:06 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-spring-boot-starter-web
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:47:58 CST 2026
|
||||
#Thu Jan 15 09:18:02 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-module-infra-api
|
||||
|
||||
@@ -18,7 +18,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:14+0800",
|
||||
date = "2026-01-15T09:19:44+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class CodegenConvertImpl implements CodegenConvert {
|
||||
|
||||
@@ -12,7 +12,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:14+0800",
|
||||
date = "2026-01-15T09:19:43+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class ConfigConvertImpl implements ConfigConvert {
|
||||
|
||||
@@ -10,7 +10,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:14+0800",
|
||||
date = "2026-01-15T09:19:44+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class DataSourceConfigConvertImpl implements DataSourceConfigConvert {
|
||||
|
||||
@@ -11,7 +11,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:14+0800",
|
||||
date = "2026-01-15T09:19:43+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class FileConfigConvertImpl implements FileConfigConvert {
|
||||
|
||||
@@ -9,7 +9,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:14+0800",
|
||||
date = "2026-01-15T09:19:44+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class FileConvertImpl implements FileConvert {
|
||||
|
||||
@@ -12,7 +12,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:14+0800",
|
||||
date = "2026-01-15T09:19:43+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class JobConvertImpl implements JobConvert {
|
||||
|
||||
@@ -10,7 +10,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:14+0800",
|
||||
date = "2026-01-15T09:19:44+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class JobLogConvertImpl implements JobLogConvert {
|
||||
|
||||
@@ -11,7 +11,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:14+0800",
|
||||
date = "2026-01-15T09:19:43+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class ApiAccessLogConvertImpl implements ApiAccessLogConvert {
|
||||
|
||||
@@ -11,7 +11,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:14+0800",
|
||||
date = "2026-01-15T09:19:44+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class ApiErrorLogConvertImpl implements ApiErrorLogConvert {
|
||||
|
||||
@@ -11,7 +11,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:14+0800",
|
||||
date = "2026-01-15T09:19:44+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class RedisConvertImpl implements RedisConvert {
|
||||
|
||||
@@ -12,7 +12,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:14+0800",
|
||||
date = "2026-01-15T09:19:43+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class TestDemoConvertImpl implements TestDemoConvert {
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:49:22 CST 2026
|
||||
#Thu Jan 15 09:19:56 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-module-infra-biz
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:49:45 CST 2026
|
||||
#Thu Jan 15 09:20:23 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-module-pay-api
|
||||
|
||||
@@ -15,7 +15,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:48+0800",
|
||||
date = "2026-01-15T09:20:27+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class PayAppConvertImpl implements PayAppConvert {
|
||||
|
||||
@@ -12,7 +12,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:48+0800",
|
||||
date = "2026-01-15T09:20:27+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class PayChannelConvertImpl implements PayChannelConvert {
|
||||
|
||||
@@ -12,7 +12,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:48+0800",
|
||||
date = "2026-01-15T09:20:27+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class PayMerchantConvertImpl implements PayMerchantConvert {
|
||||
|
||||
@@ -19,7 +19,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:48+0800",
|
||||
date = "2026-01-15T09:20:27+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class PayOrderConvertImpl implements PayOrderConvert {
|
||||
|
||||
@@ -19,7 +19,7 @@ import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2026-01-14T17:49:49+0800",
|
||||
date = "2026-01-15T09:20:27+0800",
|
||||
comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_131 (Oracle Corporation)"
|
||||
)
|
||||
public class PayRefundConvertImpl implements PayRefundConvert {
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:49:55 CST 2026
|
||||
#Thu Jan 15 09:20:34 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-module-pay-biz
|
||||
|
||||
@@ -181,4 +181,5 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode CARD_NOT_EXISTS = new ErrorCode(1002024014, "就诊卡不存在");
|
||||
ErrorCode BLACKLIST_NOT_EXISTS = new ErrorCode(1002024015, "黑名单不存在");
|
||||
ErrorCode INFO_NOT_EXISTS = new ErrorCode(1002024016, "用户信息不存在");
|
||||
ErrorCode MYD_NOT_EXISTS = new ErrorCode(1002024017, "满意度不存在");
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
// TODO 待办:请将下面的错误码复制到 joju-module-system-api 模块的 ErrorCodeConstants 类中。注意,请给“TODO 补充编号”设置一个错误码编号!!!
|
||||
// ========== 用户信息 TODO 补充编号 ==========
|
||||
// ErrorCode INFO_NOT_EXISTS = new ErrorCode(TODO 补充编号, "用户信息不存在");
|
||||
// ========== 满意度 TODO 补充编号 ==========
|
||||
// ErrorCode MYD_NOT_EXISTS = new ErrorCode(TODO 补充编号, "满意度不存在");
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Wed Jan 14 17:47:56 CST 2026
|
||||
#Thu Jan 15 09:18:00 CST 2026
|
||||
version=2.0.0-beta
|
||||
groupId=com.jojubanking.boot
|
||||
artifactId=joju-module-system-api
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.myd;
|
||||
|
||||
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.annotations.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.jojubanking.boot.framework.common.pojo.PageResult;
|
||||
import com.jojubanking.boot.framework.common.pojo.CommonResult;
|
||||
import static com.jojubanking.boot.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.jojubanking.boot.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.jojubanking.boot.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.jojubanking.boot.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.jojubanking.boot.module.system.controller.admin.myd.vo.*;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.myd.mydDO;
|
||||
import com.jojubanking.boot.module.system.convert.myd.mydConvert;
|
||||
import com.jojubanking.boot.module.system.service.myd.mydService;
|
||||
|
||||
@Api(tags = "管理后台 - 满意度")
|
||||
@RestController
|
||||
@RequestMapping("/system/myd")
|
||||
@Validated
|
||||
public class mydController {
|
||||
|
||||
@Resource
|
||||
private mydService mydService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@ApiOperation("创建满意度")
|
||||
@PreAuthorize("@ss.hasPermission('system:myd:create')")
|
||||
public CommonResult<Integer> createmyd(@Valid @RequestBody mydCreateReqVO createReqVO) {
|
||||
return success(mydService.createmyd(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@ApiOperation("更新满意度")
|
||||
@PreAuthorize("@ss.hasPermission('system:myd:update')")
|
||||
public CommonResult<Boolean> updatemyd(@Valid @RequestBody mydUpdateReqVO updateReqVO) {
|
||||
mydService.updatemyd(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除满意度")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:myd:delete')")
|
||||
public CommonResult<Boolean> deletemyd(@RequestParam("id") Integer id) {
|
||||
mydService.deletemyd(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得满意度")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:myd:query')")
|
||||
public CommonResult<mydRespVO> getmyd(@RequestParam("id") Integer id) {
|
||||
mydDO myd = mydService.getmyd(id);
|
||||
return success(mydConvert.INSTANCE.convert(myd));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("获得满意度列表")
|
||||
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
||||
@PreAuthorize("@ss.hasPermission('system:myd:query')")
|
||||
public CommonResult<List<mydRespVO>> getmydList(@RequestParam("ids") Collection<Integer> ids) {
|
||||
List<mydDO> list = mydService.getmydList(ids);
|
||||
return success(mydConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ApiOperation("获得满意度分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:myd:query')")
|
||||
public CommonResult<PageResult<mydRespVO>> getmydPage(@Valid mydPageReqVO pageVO) {
|
||||
PageResult<mydDO> pageResult = mydService.getmydPage(pageVO);
|
||||
return success(mydConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ApiOperation("导出满意度 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:myd:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportmydExcel(@Valid mydExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<mydDO> list = mydService.getmydList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<mydExcelVO> datas = mydConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "满意度.xls", "数据", mydExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.myd.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 满意度 Base VO,提供给添加、修改、详细的子 VO 使用
|
||||
* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
|
||||
*/
|
||||
@Data
|
||||
public class mydBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "评价表名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty(value = "是否显示", required = true)
|
||||
@NotNull(message = "是否显示不能为空")
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.myd.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 满意度创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class mydCreateReqVO extends mydBaseVO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.myd.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.jojubanking.boot.framework.excel.core.annotations.DictFormat;
|
||||
import com.jojubanking.boot.framework.excel.core.convert.DictConvert;
|
||||
|
||||
|
||||
/**
|
||||
* 满意度 Excel VO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class mydExcelVO {
|
||||
|
||||
@ExcelProperty("表id")
|
||||
private Integer id;
|
||||
|
||||
@ExcelProperty("评价表名")
|
||||
private String name;
|
||||
|
||||
@ExcelProperty("地址")
|
||||
private String address;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ExcelProperty(value = "是否显示", converter = DictConvert.class)
|
||||
@DictFormat("infra_boolean_string") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.myd.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel(value = "管理后台 - 满意度 Excel 导出 Request VO", description = "参数和 mydPageReqVO 是一致的")
|
||||
@Data
|
||||
public class mydExportReqVO {
|
||||
|
||||
@ApiModelProperty(value = "评价表名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] createTime;
|
||||
|
||||
@ApiModelProperty(value = "是否显示")
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.myd.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ApiModel("管理后台 - 满意度分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class mydPageReqVO extends PageParam {
|
||||
|
||||
@ApiModelProperty(value = "评价表名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] createTime;
|
||||
|
||||
@ApiModelProperty(value = "是否显示")
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.myd.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@ApiModel("管理后台 - 满意度 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class mydRespVO extends mydBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "表id", required = true)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.jojubanking.boot.module.system.controller.admin.myd.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.annotations.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@ApiModel("管理后台 - 满意度更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class mydUpdateReqVO extends mydBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "表id", required = true)
|
||||
@NotNull(message = "表id不能为空")
|
||||
private Integer id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.jojubanking.boot.module.system.convert.myd;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.jojubanking.boot.framework.common.pojo.PageResult;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import com.jojubanking.boot.module.system.controller.admin.myd.vo.*;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.myd.mydDO;
|
||||
|
||||
/**
|
||||
* 满意度 Convert
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Mapper
|
||||
public interface mydConvert {
|
||||
|
||||
mydConvert INSTANCE = Mappers.getMapper(mydConvert.class);
|
||||
|
||||
mydDO convert(mydCreateReqVO bean);
|
||||
|
||||
mydDO convert(mydUpdateReqVO bean);
|
||||
|
||||
mydRespVO convert(mydDO bean);
|
||||
|
||||
List<mydRespVO> convertList(List<mydDO> list);
|
||||
|
||||
PageResult<mydRespVO> convertPage(PageResult<mydDO> page);
|
||||
|
||||
List<mydExcelVO> convertList02(List<mydDO> list);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.jojubanking.boot.module.system.dal.dataobject.myd;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.jojubanking.boot.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 满意度 DO
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@TableName("myd")
|
||||
@KeySequence("myd_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class mydDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 表id
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 评价表名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.jojubanking.boot.module.system.dal.mysql.myd;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.jojubanking.boot.framework.common.pojo.PageResult;
|
||||
import com.jojubanking.boot.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.jojubanking.boot.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.myd.mydDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.jojubanking.boot.module.system.controller.admin.myd.vo.*;
|
||||
|
||||
/**
|
||||
* 满意度 Mapper
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Mapper
|
||||
public interface mydMapper extends BaseMapperX<mydDO> {
|
||||
|
||||
default PageResult<mydDO> selectPage(mydPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<mydDO>()
|
||||
.likeIfPresent(mydDO::getName, reqVO.getName())
|
||||
.eqIfPresent(mydDO::getAddress, reqVO.getAddress())
|
||||
.betweenIfPresent(mydDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(mydDO::getDeleted, reqVO.getDeleted())
|
||||
.orderByDesc(mydDO::getId));
|
||||
}
|
||||
|
||||
default List<mydDO> selectList(mydExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<mydDO>()
|
||||
.likeIfPresent(mydDO::getName, reqVO.getName())
|
||||
.eqIfPresent(mydDO::getAddress, reqVO.getAddress())
|
||||
.betweenIfPresent(mydDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(mydDO::getDeleted, reqVO.getDeleted())
|
||||
.orderByDesc(mydDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.jojubanking.boot.module.system.service.myd;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.jojubanking.boot.module.system.controller.admin.myd.vo.*;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.myd.mydDO;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 满意度 Service 接口
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
public interface mydService {
|
||||
|
||||
/**
|
||||
* 创建满意度
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createmyd(@Valid mydCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新满意度
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatemyd(@Valid mydUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除满意度
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletemyd(Integer id);
|
||||
|
||||
/**
|
||||
* 获得满意度
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 满意度
|
||||
*/
|
||||
mydDO getmyd(Integer id);
|
||||
|
||||
/**
|
||||
* 获得满意度列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 满意度列表
|
||||
*/
|
||||
List<mydDO> getmydList(Collection<Integer> ids);
|
||||
|
||||
/**
|
||||
* 获得满意度分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 满意度分页
|
||||
*/
|
||||
PageResult<mydDO> getmydPage(mydPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得满意度列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 满意度列表
|
||||
*/
|
||||
List<mydDO> getmydList(mydExportReqVO exportReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.jojubanking.boot.module.system.service.myd;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import com.jojubanking.boot.module.system.controller.admin.myd.vo.*;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.myd.mydDO;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageResult;
|
||||
|
||||
import com.jojubanking.boot.module.system.convert.myd.mydConvert;
|
||||
import com.jojubanking.boot.module.system.dal.mysql.myd.mydMapper;
|
||||
|
||||
import static com.jojubanking.boot.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.jojubanking.boot.module.system.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 满意度 Service 实现类
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class mydServiceImpl implements mydService {
|
||||
|
||||
@Resource
|
||||
private mydMapper mydMapper;
|
||||
|
||||
@Override
|
||||
public Integer createmyd(mydCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
mydDO myd = mydConvert.INSTANCE.convert(createReqVO);
|
||||
mydMapper.insert(myd);
|
||||
// 返回
|
||||
return myd.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatemyd(mydUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
this.validatemydExists(updateReqVO.getId());
|
||||
// 更新
|
||||
mydDO updateObj = mydConvert.INSTANCE.convert(updateReqVO);
|
||||
mydMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletemyd(Integer id) {
|
||||
// 校验存在
|
||||
this.validatemydExists(id);
|
||||
// 删除
|
||||
mydMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatemydExists(Integer id) {
|
||||
if (mydMapper.selectById(id) == null) {
|
||||
throw exception(MYD_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public mydDO getmyd(Integer id) {
|
||||
return mydMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<mydDO> getmydList(Collection<Integer> ids) {
|
||||
return mydMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<mydDO> getmydPage(mydPageReqVO pageReqVO) {
|
||||
return mydMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<mydDO> getmydList(mydExportReqVO exportReqVO) {
|
||||
return mydMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jojubanking.boot.module.system.dal.mysql.myd.mydMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.jojubanking.boot.module.system.service.myd;
|
||||
|
||||
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.jojubanking.boot.framework.test.core.ut.BaseDbUnitTest;
|
||||
|
||||
import com.jojubanking.boot.module.system.controller.admin.myd.vo.*;
|
||||
import com.jojubanking.boot.module.system.dal.dataobject.myd.mydDO;
|
||||
import com.jojubanking.boot.module.system.dal.mysql.myd.mydMapper;
|
||||
import com.jojubanking.boot.framework.common.pojo.PageResult;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.hutool.core.util.RandomUtil.*;
|
||||
import static com.jojubanking.boot.module.system.enums.ErrorCodeConstants.*;
|
||||
import static com.jojubanking.boot.framework.test.core.util.AssertUtils.*;
|
||||
import static com.jojubanking.boot.framework.test.core.util.RandomUtils.*;
|
||||
import static com.jojubanking.boot.framework.common.util.object.ObjectUtils.*;
|
||||
import static com.jojubanking.boot.framework.common.util.date.DateUtils.*;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
/**
|
||||
* {@link mydServiceImpl} 的单元测试类
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Import(mydServiceImpl.class)
|
||||
public class mydServiceImplTest extends BaseDbUnitTest {
|
||||
|
||||
@Resource
|
||||
private mydServiceImpl mydService;
|
||||
|
||||
@Resource
|
||||
private mydMapper mydMapper;
|
||||
|
||||
@Test
|
||||
public void testCreatemyd_success() {
|
||||
// 准备参数
|
||||
mydCreateReqVO reqVO = randomPojo(mydCreateReqVO.class);
|
||||
|
||||
// 调用
|
||||
Integer mydId = mydService.createmyd(reqVO);
|
||||
// 断言
|
||||
assertNotNull(mydId);
|
||||
// 校验记录的属性是否正确
|
||||
mydDO myd = mydMapper.selectById(mydId);
|
||||
assertPojoEquals(reqVO, myd);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdatemyd_success() {
|
||||
// mock 数据
|
||||
mydDO dbmyd = randomPojo(mydDO.class);
|
||||
mydMapper.insert(dbmyd);// @Sql: 先插入出一条存在的数据
|
||||
// 准备参数
|
||||
mydUpdateReqVO reqVO = randomPojo(mydUpdateReqVO.class, o -> {
|
||||
o.setId(dbmyd.getId()); // 设置更新的 ID
|
||||
});
|
||||
|
||||
// 调用
|
||||
mydService.updatemyd(reqVO);
|
||||
// 校验是否更新正确
|
||||
mydDO myd = mydMapper.selectById(reqVO.getId()); // 获取最新的
|
||||
assertPojoEquals(reqVO, myd);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdatemyd_notExists() {
|
||||
// 准备参数
|
||||
mydUpdateReqVO reqVO = randomPojo(mydUpdateReqVO.class);
|
||||
|
||||
// 调用, 并断言异常
|
||||
assertServiceException(() -> mydService.updatemyd(reqVO), MYD_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeletemyd_success() {
|
||||
// mock 数据
|
||||
mydDO dbmyd = randomPojo(mydDO.class);
|
||||
mydMapper.insert(dbmyd);// @Sql: 先插入出一条存在的数据
|
||||
// 准备参数
|
||||
Integer id = dbmyd.getId();
|
||||
|
||||
// 调用
|
||||
mydService.deletemyd(id);
|
||||
// 校验数据不存在了
|
||||
assertNull(mydMapper.selectById(id));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeletemyd_notExists() {
|
||||
// 准备参数
|
||||
Integer id = randomInteger();
|
||||
|
||||
// 调用, 并断言异常
|
||||
assertServiceException(() -> mydService.deletemyd(id), MYD_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
||||
public void testGetmydPage() {
|
||||
// mock 数据
|
||||
mydDO dbmyd = randomPojo(mydDO.class, o -> { // 等会查询到
|
||||
o.setName(null);
|
||||
o.setAddress(null);
|
||||
o.setCreateTime(null);
|
||||
o.setDeleted(null);
|
||||
});
|
||||
mydMapper.insert(dbmyd);
|
||||
// 测试 name 不匹配
|
||||
mydMapper.insert(cloneIgnoreId(dbmyd, o -> o.setName(null)));
|
||||
// 测试 address 不匹配
|
||||
mydMapper.insert(cloneIgnoreId(dbmyd, o -> o.setAddress(null)));
|
||||
// 测试 createTime 不匹配
|
||||
mydMapper.insert(cloneIgnoreId(dbmyd, o -> o.setCreateTime(null)));
|
||||
// 测试 deleted 不匹配
|
||||
mydMapper.insert(cloneIgnoreId(dbmyd, o -> o.setDeleted(null)));
|
||||
// 准备参数
|
||||
mydPageReqVO reqVO = new mydPageReqVO();
|
||||
reqVO.setName(null);
|
||||
reqVO.setAddress(null);
|
||||
reqVO.setCreateTime((new Date[]{}));
|
||||
reqVO.setDeleted(null);
|
||||
|
||||
// 调用
|
||||
PageResult<mydDO> pageResult = mydService.getmydPage(reqVO);
|
||||
// 断言
|
||||
assertEquals(1, pageResult.getTotal());
|
||||
assertEquals(1, pageResult.getList().size());
|
||||
assertPojoEquals(dbmyd, pageResult.getList().get(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
||||
public void testGetmydList() {
|
||||
// mock 数据
|
||||
mydDO dbmyd = randomPojo(mydDO.class, o -> { // 等会查询到
|
||||
o.setName(null);
|
||||
o.setAddress(null);
|
||||
o.setCreateTime(null);
|
||||
o.setDeleted(null);
|
||||
});
|
||||
mydMapper.insert(dbmyd);
|
||||
// 测试 name 不匹配
|
||||
mydMapper.insert(cloneIgnoreId(dbmyd, o -> o.setName(null)));
|
||||
// 测试 address 不匹配
|
||||
mydMapper.insert(cloneIgnoreId(dbmyd, o -> o.setAddress(null)));
|
||||
// 测试 createTime 不匹配
|
||||
mydMapper.insert(cloneIgnoreId(dbmyd, o -> o.setCreateTime(null)));
|
||||
// 测试 deleted 不匹配
|
||||
mydMapper.insert(cloneIgnoreId(dbmyd, o -> o.setDeleted(null)));
|
||||
// 准备参数
|
||||
mydExportReqVO reqVO = new mydExportReqVO();
|
||||
reqVO.setName(null);
|
||||
reqVO.setAddress(null);
|
||||
reqVO.setCreateTime((new Date[]{}));
|
||||
reqVO.setDeleted(null);
|
||||
|
||||
// 调用
|
||||
List<mydDO> list = mydService.getmydList(reqVO);
|
||||
// 断言
|
||||
assertEquals(1, list.size());
|
||||
assertPojoEquals(dbmyd, list.get(0));
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user