Merge branch 'master' of http://222.71.165.188:3000/ccongli/YX-SCM
# Conflicts: # yunxi-ui-admin-vue3/src/views/xxjj/enterpriseDetails/src/infopage2/company.vuepull/1/head
commit
07363e552f
@ -0,0 +1,14 @@
|
||||
package com.yunxi.scm.module.system.controller.admin.user.vo.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 公司部门人员")
|
||||
@Data
|
||||
public class UserDeptCompanyRespVO {
|
||||
private String id;
|
||||
private String label;
|
||||
private List<UserDeptCompanyRespVO> children;
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.yunxi.scm.module.xxjj.controller.admin.productlnventoryunit;
|
||||
|
||||
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.productlnventoryunit.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.productlnventoryunit.ProductLnventoryUnitDO;
|
||||
import com.yunxi.scm.module.xxjj.convert.productlnventoryunit.ProductLnventoryUnitConvert;
|
||||
import com.yunxi.scm.module.xxjj.service.productlnventoryunit.ProductLnventoryUnitService;
|
||||
|
||||
@Tag(name = "管理后台 - 商品表库存单位")
|
||||
@RestController
|
||||
@RequestMapping("/xxjj/product-lnventory-unit")
|
||||
@Validated
|
||||
public class ProductLnventoryUnitController {
|
||||
|
||||
@Resource
|
||||
private ProductLnventoryUnitService productLnventoryUnitService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建商品表库存单位")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:product-lnventory-unit:create')")
|
||||
public CommonResult<Long> createProductLnventoryUnit(@Valid @RequestBody ProductLnventoryUnitCreateReqVO createReqVO) {
|
||||
return success(productLnventoryUnitService.createProductLnventoryUnit(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新商品表库存单位")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:product-lnventory-unit:update')")
|
||||
public CommonResult<Boolean> updateProductLnventoryUnit(@Valid @RequestBody ProductLnventoryUnitUpdateReqVO updateReqVO) {
|
||||
productLnventoryUnitService.updateProductLnventoryUnit(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除商品表库存单位")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:product-lnventory-unit:delete')")
|
||||
public CommonResult<Boolean> deleteProductLnventoryUnit(@RequestParam("id") Long id) {
|
||||
productLnventoryUnitService.deleteProductLnventoryUnit(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得商品表库存单位")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:product-lnventory-unit:query')")
|
||||
public CommonResult<ProductLnventoryUnitRespVO> getProductLnventoryUnit(@RequestParam("id") Long id) {
|
||||
ProductLnventoryUnitDO productLnventoryUnit = productLnventoryUnitService.getProductLnventoryUnit(id);
|
||||
return success(ProductLnventoryUnitConvert.INSTANCE.convert(productLnventoryUnit));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得商品表库存单位列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:product-lnventory-unit:query')")
|
||||
public CommonResult<List<ProductLnventoryUnitRespVO>> getProductLnventoryUnitList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<ProductLnventoryUnitDO> list = productLnventoryUnitService.getProductLnventoryUnitList(ids);
|
||||
return success(ProductLnventoryUnitConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得商品表库存单位分页")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:product-lnventory-unit:query')")
|
||||
public CommonResult<PageResult<ProductLnventoryUnitRespVO>> getProductLnventoryUnitPage(@Valid ProductLnventoryUnitPageReqVO pageVO) {
|
||||
PageResult<ProductLnventoryUnitDO> pageResult = productLnventoryUnitService.getProductLnventoryUnitPage(pageVO);
|
||||
return success(ProductLnventoryUnitConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出商品表库存单位 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:product-lnventory-unit:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportProductLnventoryUnitExcel(@Valid ProductLnventoryUnitExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<ProductLnventoryUnitDO> list = productLnventoryUnitService.getProductLnventoryUnitList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<ProductLnventoryUnitExcelVO> datas = ProductLnventoryUnitConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "商品表库存单位.xls", "数据", ProductLnventoryUnitExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.yunxi.scm.module.xxjj.controller.admin.productlnventoryunit.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 ProductLnventoryUnitCreateReqVO extends ProductLnventoryUnitBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.yunxi.scm.module.xxjj.controller.admin.productlnventoryunit.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 ProductLnventoryUnitRespVO extends ProductLnventoryUnitBaseVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "27397")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.yunxi.scm.module.xxjj.controller.admin.productlnventoryunit.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 ProductLnventoryUnitUpdateReqVO extends ProductLnventoryUnitBaseVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "27397")
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.yunxi.scm.module.xxjj.controller.admin.subjectcontacts;
|
||||
|
||||
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.subjectcontacts.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.subjectcontacts.SubjectContactsDO;
|
||||
import com.yunxi.scm.module.xxjj.convert.subjectcontacts.SubjectContactsConvert;
|
||||
import com.yunxi.scm.module.xxjj.service.subjectcontacts.SubjectContactsService;
|
||||
|
||||
@Tag(name = "管理后台 - 主体联系人")
|
||||
@RestController
|
||||
@RequestMapping("/xxjj/subject-contacts")
|
||||
@Validated
|
||||
public class SubjectContactsController {
|
||||
|
||||
@Resource
|
||||
private SubjectContactsService subjectContactsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建主体联系人")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-contacts:create')")
|
||||
public CommonResult<Long> createSubjectContacts(@Valid @RequestBody SubjectContactsCreateReqVO createReqVO) {
|
||||
return success(subjectContactsService.createSubjectContacts(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新主体联系人")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-contacts:update')")
|
||||
public CommonResult<Boolean> updateSubjectContacts(@Valid @RequestBody SubjectContactsUpdateReqVO updateReqVO) {
|
||||
subjectContactsService.updateSubjectContacts(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除主体联系人")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-contacts:delete')")
|
||||
public CommonResult<Boolean> deleteSubjectContacts(@RequestParam("id") Long id) {
|
||||
subjectContactsService.deleteSubjectContacts(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得主体联系人")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-contacts:query')")
|
||||
public CommonResult<SubjectContactsRespVO> getSubjectContacts(@RequestParam("id") Long id) {
|
||||
SubjectContactsDO subjectContacts = subjectContactsService.getSubjectContacts(id);
|
||||
return success(SubjectContactsConvert.INSTANCE.convert(subjectContacts));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得主体联系人列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-contacts:query')")
|
||||
public CommonResult<List<SubjectContactsRespVO>> getSubjectContactsList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<SubjectContactsDO> list = subjectContactsService.getSubjectContactsList(ids);
|
||||
return success(SubjectContactsConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得主体联系人分页")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-contacts:query')")
|
||||
public CommonResult<PageResult<SubjectContactsRespVO>> getSubjectContactsPage(@Valid SubjectContactsPageReqVO pageVO) {
|
||||
PageResult<SubjectContactsDO> pageResult = subjectContactsService.getSubjectContactsPage(pageVO);
|
||||
return success(SubjectContactsConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出主体联系人 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-contacts:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportSubjectContactsExcel(@Valid SubjectContactsExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<SubjectContactsDO> list = subjectContactsService.getSubjectContactsList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<SubjectContactsExcelVO> datas = SubjectContactsConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "主体联系人.xls", "数据", SubjectContactsExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.yunxi.scm.module.xxjj.controller.admin.subjectcontacts.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 SubjectContactsCreateReqVO extends SubjectContactsBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.yunxi.scm.module.xxjj.controller.admin.subjectcontacts.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 SubjectContactsRespVO extends SubjectContactsBaseVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12197")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.yunxi.scm.module.xxjj.controller.admin.subjectcontacts.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 SubjectContactsUpdateReqVO extends SubjectContactsBaseVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12197")
|
||||
@NotNull(message = "主键id不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.yunxi.scm.module.xxjj.controller.admin.subjectrepresentative;
|
||||
|
||||
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.subjectrepresentative.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.subjectrepresentative.SubjectRepresentativeDO;
|
||||
import com.yunxi.scm.module.xxjj.convert.subjectrepresentative.SubjectRepresentativeConvert;
|
||||
import com.yunxi.scm.module.xxjj.service.subjectrepresentative.SubjectRepresentativeService;
|
||||
|
||||
@Tag(name = "管理后台 - 主体代表人")
|
||||
@RestController
|
||||
@RequestMapping("/xxjj/subject-representative")
|
||||
@Validated
|
||||
public class SubjectRepresentativeController {
|
||||
|
||||
@Resource
|
||||
private SubjectRepresentativeService subjectRepresentativeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建主体代表人")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-representative:create')")
|
||||
public CommonResult<Long> createSubjectRepresentative(@Valid @RequestBody SubjectRepresentativeCreateReqVO createReqVO) {
|
||||
return success(subjectRepresentativeService.createSubjectRepresentative(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新主体代表人")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-representative:update')")
|
||||
public CommonResult<Boolean> updateSubjectRepresentative(@Valid @RequestBody SubjectRepresentativeUpdateReqVO updateReqVO) {
|
||||
subjectRepresentativeService.updateSubjectRepresentative(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除主体代表人")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-representative:delete')")
|
||||
public CommonResult<Boolean> deleteSubjectRepresentative(@RequestParam("id") Long id) {
|
||||
subjectRepresentativeService.deleteSubjectRepresentative(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得主体代表人")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-representative:query')")
|
||||
public CommonResult<SubjectRepresentativeRespVO> getSubjectRepresentative(@RequestParam("id") Long id) {
|
||||
SubjectRepresentativeDO subjectRepresentative = subjectRepresentativeService.getSubjectRepresentative(id);
|
||||
return success(SubjectRepresentativeConvert.INSTANCE.convert(subjectRepresentative));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得主体代表人列表")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-representative:query')")
|
||||
public CommonResult<List<SubjectRepresentativeRespVO>> getSubjectRepresentativeList(@RequestParam("ids") Collection<Long> ids) {
|
||||
List<SubjectRepresentativeDO> list = subjectRepresentativeService.getSubjectRepresentativeList(ids);
|
||||
return success(SubjectRepresentativeConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得主体代表人分页")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-representative:query')")
|
||||
public CommonResult<PageResult<SubjectRepresentativeRespVO>> getSubjectRepresentativePage(@Valid SubjectRepresentativePageReqVO pageVO) {
|
||||
PageResult<SubjectRepresentativeDO> pageResult = subjectRepresentativeService.getSubjectRepresentativePage(pageVO);
|
||||
return success(SubjectRepresentativeConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出主体代表人 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('xxjj:subject-representative:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportSubjectRepresentativeExcel(@Valid SubjectRepresentativeExportReqVO exportReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<SubjectRepresentativeDO> list = subjectRepresentativeService.getSubjectRepresentativeList(exportReqVO);
|
||||
// 导出 Excel
|
||||
List<SubjectRepresentativeExcelVO> datas = SubjectRepresentativeConvert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "主体代表人.xls", "数据", SubjectRepresentativeExcelVO.class, datas);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.yunxi.scm.module.xxjj.controller.admin.subjectrepresentative.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 SubjectRepresentativeCreateReqVO extends SubjectRepresentativeBaseVO {
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.yunxi.scm.module.xxjj.controller.admin.subjectrepresentative.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 SubjectRepresentativeRespVO extends SubjectRepresentativeBaseVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21687")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.yunxi.scm.module.xxjj.controller.admin.subjectrepresentative.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 SubjectRepresentativeUpdateReqVO extends SubjectRepresentativeBaseVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21687")
|
||||
@NotNull(message = "主键id不能为空")
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.yunxi.scm.module.xxjj.convert.productlnventoryunit;
|
||||
|
||||
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.productlnventoryunit.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.productlnventoryunit.ProductLnventoryUnitDO;
|
||||
|
||||
/**
|
||||
* 商品表库存单位 Convert
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProductLnventoryUnitConvert {
|
||||
|
||||
ProductLnventoryUnitConvert INSTANCE = Mappers.getMapper(ProductLnventoryUnitConvert.class);
|
||||
|
||||
ProductLnventoryUnitDO convert(ProductLnventoryUnitCreateReqVO bean);
|
||||
|
||||
ProductLnventoryUnitDO convert(ProductLnventoryUnitUpdateReqVO bean);
|
||||
|
||||
ProductLnventoryUnitRespVO convert(ProductLnventoryUnitDO bean);
|
||||
|
||||
List<ProductLnventoryUnitRespVO> convertList(List<ProductLnventoryUnitDO> list);
|
||||
|
||||
PageResult<ProductLnventoryUnitRespVO> convertPage(PageResult<ProductLnventoryUnitDO> page);
|
||||
|
||||
List<ProductLnventoryUnitExcelVO> convertList02(List<ProductLnventoryUnitDO> list);
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.yunxi.scm.module.xxjj.convert.subjectcontacts;
|
||||
|
||||
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.subjectcontacts.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.subjectcontacts.SubjectContactsDO;
|
||||
|
||||
/**
|
||||
* 主体联系人 Convert
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
@Mapper
|
||||
public interface SubjectContactsConvert {
|
||||
|
||||
SubjectContactsConvert INSTANCE = Mappers.getMapper(SubjectContactsConvert.class);
|
||||
|
||||
SubjectContactsDO convert(SubjectContactsCreateReqVO bean);
|
||||
|
||||
SubjectContactsDO convert(SubjectContactsUpdateReqVO bean);
|
||||
|
||||
SubjectContactsRespVO convert(SubjectContactsDO bean);
|
||||
|
||||
List<SubjectContactsRespVO> convertList(List<SubjectContactsDO> list);
|
||||
|
||||
PageResult<SubjectContactsRespVO> convertPage(PageResult<SubjectContactsDO> page);
|
||||
|
||||
List<SubjectContactsExcelVO> convertList02(List<SubjectContactsDO> list);
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.yunxi.scm.module.xxjj.convert.subjectrepresentative;
|
||||
|
||||
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.subjectrepresentative.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.subjectrepresentative.SubjectRepresentativeDO;
|
||||
|
||||
/**
|
||||
* 主体代表人 Convert
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
@Mapper
|
||||
public interface SubjectRepresentativeConvert {
|
||||
|
||||
SubjectRepresentativeConvert INSTANCE = Mappers.getMapper(SubjectRepresentativeConvert.class);
|
||||
|
||||
SubjectRepresentativeDO convert(SubjectRepresentativeCreateReqVO bean);
|
||||
|
||||
SubjectRepresentativeDO convert(SubjectRepresentativeUpdateReqVO bean);
|
||||
|
||||
SubjectRepresentativeRespVO convert(SubjectRepresentativeDO bean);
|
||||
|
||||
List<SubjectRepresentativeRespVO> convertList(List<SubjectRepresentativeDO> list);
|
||||
|
||||
PageResult<SubjectRepresentativeRespVO> convertPage(PageResult<SubjectRepresentativeDO> page);
|
||||
|
||||
List<SubjectRepresentativeExcelVO> convertList02(List<SubjectRepresentativeDO> list);
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.yunxi.scm.module.xxjj.dal.mysql.productlnventoryunit;
|
||||
|
||||
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.productlnventoryunit.ProductLnventoryUnitDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.yunxi.scm.module.xxjj.controller.admin.productlnventoryunit.vo.*;
|
||||
|
||||
/**
|
||||
* 商品表库存单位 Mapper
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProductLnventoryUnitMapper extends BaseMapperX<ProductLnventoryUnitDO> {
|
||||
|
||||
default PageResult<ProductLnventoryUnitDO> selectPage(ProductLnventoryUnitPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ProductLnventoryUnitDO>()
|
||||
.likeIfPresent(ProductLnventoryUnitDO::getProductUnitName, reqVO.getProductUnitName())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getProuctId, reqVO.getProuctId())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getConversionRules1, reqVO.getConversionRules1())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getConversionRules2, reqVO.getConversionRules2())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getPackagingBarcode, reqVO.getPackagingBarcode())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getDimensionalUnit, reqVO.getDimensionalUnit())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getSizeInformation1, reqVO.getSizeInformation1())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getSizeInformation2, reqVO.getSizeInformation2())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getSizeInformation3, reqVO.getSizeInformation3())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getVolumeInformation, reqVO.getVolumeInformation())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getVolumeInformationUnit, reqVO.getVolumeInformationUnit())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getWeight, reqVO.getWeight())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getGrossWeight, reqVO.getGrossWeight())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getNetWeight, reqVO.getNetWeight())
|
||||
.betweenIfPresent(ProductLnventoryUnitDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ProductLnventoryUnitDO::getId));
|
||||
}
|
||||
|
||||
default List<ProductLnventoryUnitDO> selectList(ProductLnventoryUnitExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<ProductLnventoryUnitDO>()
|
||||
.likeIfPresent(ProductLnventoryUnitDO::getProductUnitName, reqVO.getProductUnitName())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getProuctId, reqVO.getProuctId())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getConversionRules1, reqVO.getConversionRules1())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getConversionRules2, reqVO.getConversionRules2())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getPackagingBarcode, reqVO.getPackagingBarcode())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getDimensionalUnit, reqVO.getDimensionalUnit())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getSizeInformation1, reqVO.getSizeInformation1())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getSizeInformation2, reqVO.getSizeInformation2())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getSizeInformation3, reqVO.getSizeInformation3())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getVolumeInformation, reqVO.getVolumeInformation())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getVolumeInformationUnit, reqVO.getVolumeInformationUnit())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getWeight, reqVO.getWeight())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getGrossWeight, reqVO.getGrossWeight())
|
||||
.eqIfPresent(ProductLnventoryUnitDO::getNetWeight, reqVO.getNetWeight())
|
||||
.betweenIfPresent(ProductLnventoryUnitDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ProductLnventoryUnitDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.yunxi.scm.module.xxjj.dal.mysql.subjectcontacts;
|
||||
|
||||
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.subjectcontacts.SubjectContactsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.yunxi.scm.module.xxjj.controller.admin.subjectcontacts.vo.*;
|
||||
|
||||
/**
|
||||
* 主体联系人 Mapper
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
@Mapper
|
||||
public interface SubjectContactsMapper extends BaseMapperX<SubjectContactsDO> {
|
||||
|
||||
default PageResult<SubjectContactsDO> selectPage(SubjectContactsPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<SubjectContactsDO>()
|
||||
.eqIfPresent(SubjectContactsDO::getBusinessId, reqVO.getBusinessId())
|
||||
.eqIfPresent(SubjectContactsDO::getBusinessType, reqVO.getBusinessType())
|
||||
.eqIfPresent(SubjectContactsDO::getContactsType, reqVO.getContactsType())
|
||||
.eqIfPresent(SubjectContactsDO::getAsteriskType, reqVO.getAsteriskType())
|
||||
.eqIfPresent(SubjectContactsDO::getMarkColor, reqVO.getMarkColor())
|
||||
.likeIfPresent(SubjectContactsDO::getName, reqVO.getName())
|
||||
.likeIfPresent(SubjectContactsDO::getCompanyName, reqVO.getCompanyName())
|
||||
.eqIfPresent(SubjectContactsDO::getPosition, reqVO.getPosition())
|
||||
.eqIfPresent(SubjectContactsDO::getMobile, reqVO.getMobile())
|
||||
.eqIfPresent(SubjectContactsDO::getPhone, reqVO.getPhone())
|
||||
.eqIfPresent(SubjectContactsDO::getEmaile, reqVO.getEmaile())
|
||||
.eqIfPresent(SubjectContactsDO::getAddress, reqVO.getAddress())
|
||||
.eqIfPresent(SubjectContactsDO::getAnnex, reqVO.getAnnex())
|
||||
.betweenIfPresent(SubjectContactsDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SubjectContactsDO::getId));
|
||||
}
|
||||
|
||||
default List<SubjectContactsDO> selectList(SubjectContactsExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<SubjectContactsDO>()
|
||||
.eqIfPresent(SubjectContactsDO::getBusinessId, reqVO.getBusinessId())
|
||||
.eqIfPresent(SubjectContactsDO::getBusinessType, reqVO.getBusinessType())
|
||||
.eqIfPresent(SubjectContactsDO::getContactsType, reqVO.getContactsType())
|
||||
.eqIfPresent(SubjectContactsDO::getAsteriskType, reqVO.getAsteriskType())
|
||||
.eqIfPresent(SubjectContactsDO::getMarkColor, reqVO.getMarkColor())
|
||||
.likeIfPresent(SubjectContactsDO::getName, reqVO.getName())
|
||||
.likeIfPresent(SubjectContactsDO::getCompanyName, reqVO.getCompanyName())
|
||||
.eqIfPresent(SubjectContactsDO::getPosition, reqVO.getPosition())
|
||||
.eqIfPresent(SubjectContactsDO::getMobile, reqVO.getMobile())
|
||||
.eqIfPresent(SubjectContactsDO::getPhone, reqVO.getPhone())
|
||||
.eqIfPresent(SubjectContactsDO::getEmaile, reqVO.getEmaile())
|
||||
.eqIfPresent(SubjectContactsDO::getAddress, reqVO.getAddress())
|
||||
.eqIfPresent(SubjectContactsDO::getAnnex, reqVO.getAnnex())
|
||||
.betweenIfPresent(SubjectContactsDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SubjectContactsDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.yunxi.scm.module.xxjj.dal.mysql.subjectrepresentative;
|
||||
|
||||
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.subjectrepresentative.SubjectRepresentativeDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.yunxi.scm.module.xxjj.controller.admin.subjectrepresentative.vo.*;
|
||||
|
||||
/**
|
||||
* 主体代表人 Mapper
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
@Mapper
|
||||
public interface SubjectRepresentativeMapper extends BaseMapperX<SubjectRepresentativeDO> {
|
||||
|
||||
default PageResult<SubjectRepresentativeDO> selectPage(SubjectRepresentativePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<SubjectRepresentativeDO>()
|
||||
.eqIfPresent(SubjectRepresentativeDO::getBusinessId, reqVO.getBusinessId())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getBusinessType, reqVO.getBusinessType())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getRepresentativeType, reqVO.getRepresentativeType())
|
||||
.likeIfPresent(SubjectRepresentativeDO::getName, reqVO.getName())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getIdCard, reqVO.getIdCard())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getIdCardStart, reqVO.getIdCardStart())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getIdCardEnd, reqVO.getIdCardEnd())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getDescription, reqVO.getDescription())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getIdCardPhoto1, reqVO.getIdCardPhoto1())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getIdCardPhoto2, reqVO.getIdCardPhoto2())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getIdCardPhoto3, reqVO.getIdCardPhoto3())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getAuthorizeFiles, reqVO.getAuthorizeFiles())
|
||||
.betweenIfPresent(SubjectRepresentativeDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SubjectRepresentativeDO::getId));
|
||||
}
|
||||
|
||||
default List<SubjectRepresentativeDO> selectList(SubjectRepresentativeExportReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<SubjectRepresentativeDO>()
|
||||
.eqIfPresent(SubjectRepresentativeDO::getBusinessId, reqVO.getBusinessId())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getBusinessType, reqVO.getBusinessType())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getRepresentativeType, reqVO.getRepresentativeType())
|
||||
.likeIfPresent(SubjectRepresentativeDO::getName, reqVO.getName())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getIdCard, reqVO.getIdCard())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getIdCardStart, reqVO.getIdCardStart())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getIdCardEnd, reqVO.getIdCardEnd())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getDescription, reqVO.getDescription())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getIdCardPhoto1, reqVO.getIdCardPhoto1())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getIdCardPhoto2, reqVO.getIdCardPhoto2())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getIdCardPhoto3, reqVO.getIdCardPhoto3())
|
||||
.eqIfPresent(SubjectRepresentativeDO::getAuthorizeFiles, reqVO.getAuthorizeFiles())
|
||||
.betweenIfPresent(SubjectRepresentativeDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SubjectRepresentativeDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.yunxi.scm.module.xxjj.service.productlnventoryunit;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.yunxi.scm.module.xxjj.controller.admin.productlnventoryunit.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.productlnventoryunit.ProductLnventoryUnitDO;
|
||||
import com.yunxi.scm.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 商品表库存单位 Service 接口
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
public interface ProductLnventoryUnitService {
|
||||
|
||||
/**
|
||||
* 创建商品表库存单位
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProductLnventoryUnit(@Valid ProductLnventoryUnitCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新商品表库存单位
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProductLnventoryUnit(@Valid ProductLnventoryUnitUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除商品表库存单位
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProductLnventoryUnit(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品表库存单位
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 商品表库存单位
|
||||
*/
|
||||
ProductLnventoryUnitDO getProductLnventoryUnit(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品表库存单位列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 商品表库存单位列表
|
||||
*/
|
||||
List<ProductLnventoryUnitDO> getProductLnventoryUnitList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得商品表库存单位分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 商品表库存单位分页
|
||||
*/
|
||||
PageResult<ProductLnventoryUnitDO> getProductLnventoryUnitPage(ProductLnventoryUnitPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得商品表库存单位列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 商品表库存单位列表
|
||||
*/
|
||||
List<ProductLnventoryUnitDO> getProductLnventoryUnitList(ProductLnventoryUnitExportReqVO exportReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.yunxi.scm.module.xxjj.service.productlnventoryunit;
|
||||
|
||||
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.productlnventoryunit.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.productlnventoryunit.ProductLnventoryUnitDO;
|
||||
import com.yunxi.scm.framework.common.pojo.PageResult;
|
||||
|
||||
import com.yunxi.scm.module.xxjj.convert.productlnventoryunit.ProductLnventoryUnitConvert;
|
||||
import com.yunxi.scm.module.xxjj.dal.mysql.productlnventoryunit.ProductLnventoryUnitMapper;
|
||||
|
||||
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 ProductLnventoryUnitServiceImpl implements ProductLnventoryUnitService {
|
||||
|
||||
@Resource
|
||||
private ProductLnventoryUnitMapper productLnventoryUnitMapper;
|
||||
|
||||
@Override
|
||||
public Long createProductLnventoryUnit(ProductLnventoryUnitCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
ProductLnventoryUnitDO productLnventoryUnit = ProductLnventoryUnitConvert.INSTANCE.convert(createReqVO);
|
||||
productLnventoryUnitMapper.insert(productLnventoryUnit);
|
||||
// 返回
|
||||
return productLnventoryUnit.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProductLnventoryUnit(ProductLnventoryUnitUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProductLnventoryUnitExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProductLnventoryUnitDO updateObj = ProductLnventoryUnitConvert.INSTANCE.convert(updateReqVO);
|
||||
productLnventoryUnitMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProductLnventoryUnit(Long id) {
|
||||
// 校验存在
|
||||
validateProductLnventoryUnitExists(id);
|
||||
// 删除
|
||||
productLnventoryUnitMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProductLnventoryUnitExists(Long id) {
|
||||
if (productLnventoryUnitMapper.selectById(id) == null) {
|
||||
throw exception(PRODUCT_LNVENTORY_UNIT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductLnventoryUnitDO getProductLnventoryUnit(Long id) {
|
||||
return productLnventoryUnitMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductLnventoryUnitDO> getProductLnventoryUnitList(Collection<Long> ids) {
|
||||
return productLnventoryUnitMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProductLnventoryUnitDO> getProductLnventoryUnitPage(ProductLnventoryUnitPageReqVO pageReqVO) {
|
||||
return productLnventoryUnitMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductLnventoryUnitDO> getProductLnventoryUnitList(ProductLnventoryUnitExportReqVO exportReqVO) {
|
||||
return productLnventoryUnitMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.yunxi.scm.module.xxjj.service.subjectcontacts;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.yunxi.scm.module.xxjj.controller.admin.subjectcontacts.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.subjectcontacts.SubjectContactsDO;
|
||||
import com.yunxi.scm.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 主体联系人 Service 接口
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
public interface SubjectContactsService {
|
||||
|
||||
/**
|
||||
* 创建主体联系人
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createSubjectContacts(@Valid SubjectContactsCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新主体联系人
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSubjectContacts(@Valid SubjectContactsUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除主体联系人
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSubjectContacts(Long id);
|
||||
|
||||
/**
|
||||
* 获得主体联系人
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 主体联系人
|
||||
*/
|
||||
SubjectContactsDO getSubjectContacts(Long id);
|
||||
|
||||
/**
|
||||
* 获得主体联系人列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 主体联系人列表
|
||||
*/
|
||||
List<SubjectContactsDO> getSubjectContactsList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得主体联系人分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 主体联系人分页
|
||||
*/
|
||||
PageResult<SubjectContactsDO> getSubjectContactsPage(SubjectContactsPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得主体联系人列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 主体联系人列表
|
||||
*/
|
||||
List<SubjectContactsDO> getSubjectContactsList(SubjectContactsExportReqVO exportReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.yunxi.scm.module.xxjj.service.subjectcontacts;
|
||||
|
||||
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.subjectcontacts.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.subjectcontacts.SubjectContactsDO;
|
||||
import com.yunxi.scm.framework.common.pojo.PageResult;
|
||||
|
||||
import com.yunxi.scm.module.xxjj.convert.subjectcontacts.SubjectContactsConvert;
|
||||
import com.yunxi.scm.module.xxjj.dal.mysql.subjectcontacts.SubjectContactsMapper;
|
||||
|
||||
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 SubjectContactsServiceImpl implements SubjectContactsService {
|
||||
|
||||
@Resource
|
||||
private SubjectContactsMapper subjectContactsMapper;
|
||||
|
||||
@Override
|
||||
public Long createSubjectContacts(SubjectContactsCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
SubjectContactsDO subjectContacts = SubjectContactsConvert.INSTANCE.convert(createReqVO);
|
||||
subjectContactsMapper.insert(subjectContacts);
|
||||
// 返回
|
||||
return subjectContacts.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSubjectContacts(SubjectContactsUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSubjectContactsExists(updateReqVO.getId());
|
||||
// 更新
|
||||
SubjectContactsDO updateObj = SubjectContactsConvert.INSTANCE.convert(updateReqVO);
|
||||
subjectContactsMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSubjectContacts(Long id) {
|
||||
// 校验存在
|
||||
validateSubjectContactsExists(id);
|
||||
// 删除
|
||||
subjectContactsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateSubjectContactsExists(Long id) {
|
||||
if (subjectContactsMapper.selectById(id) == null) {
|
||||
throw exception(SUBJECT_CONTACTS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SubjectContactsDO getSubjectContacts(Long id) {
|
||||
return subjectContactsMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SubjectContactsDO> getSubjectContactsList(Collection<Long> ids) {
|
||||
return subjectContactsMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SubjectContactsDO> getSubjectContactsPage(SubjectContactsPageReqVO pageReqVO) {
|
||||
return subjectContactsMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SubjectContactsDO> getSubjectContactsList(SubjectContactsExportReqVO exportReqVO) {
|
||||
return subjectContactsMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.yunxi.scm.module.xxjj.service.subjectrepresentative;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.yunxi.scm.module.xxjj.controller.admin.subjectrepresentative.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.subjectrepresentative.SubjectRepresentativeDO;
|
||||
import com.yunxi.scm.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 主体代表人 Service 接口
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
public interface SubjectRepresentativeService {
|
||||
|
||||
/**
|
||||
* 创建主体代表人
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createSubjectRepresentative(@Valid SubjectRepresentativeCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新主体代表人
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSubjectRepresentative(@Valid SubjectRepresentativeUpdateReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除主体代表人
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSubjectRepresentative(Long id);
|
||||
|
||||
/**
|
||||
* 获得主体代表人
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 主体代表人
|
||||
*/
|
||||
SubjectRepresentativeDO getSubjectRepresentative(Long id);
|
||||
|
||||
/**
|
||||
* 获得主体代表人列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 主体代表人列表
|
||||
*/
|
||||
List<SubjectRepresentativeDO> getSubjectRepresentativeList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得主体代表人分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 主体代表人分页
|
||||
*/
|
||||
PageResult<SubjectRepresentativeDO> getSubjectRepresentativePage(SubjectRepresentativePageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得主体代表人列表, 用于 Excel 导出
|
||||
*
|
||||
* @param exportReqVO 查询条件
|
||||
* @return 主体代表人列表
|
||||
*/
|
||||
List<SubjectRepresentativeDO> getSubjectRepresentativeList(SubjectRepresentativeExportReqVO exportReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.yunxi.scm.module.xxjj.service.subjectrepresentative;
|
||||
|
||||
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.subjectrepresentative.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.subjectrepresentative.SubjectRepresentativeDO;
|
||||
import com.yunxi.scm.framework.common.pojo.PageResult;
|
||||
|
||||
import com.yunxi.scm.module.xxjj.convert.subjectrepresentative.SubjectRepresentativeConvert;
|
||||
import com.yunxi.scm.module.xxjj.dal.mysql.subjectrepresentative.SubjectRepresentativeMapper;
|
||||
|
||||
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 SubjectRepresentativeServiceImpl implements SubjectRepresentativeService {
|
||||
|
||||
@Resource
|
||||
private SubjectRepresentativeMapper subjectRepresentativeMapper;
|
||||
|
||||
@Override
|
||||
public Long createSubjectRepresentative(SubjectRepresentativeCreateReqVO createReqVO) {
|
||||
// 插入
|
||||
SubjectRepresentativeDO subjectRepresentative = SubjectRepresentativeConvert.INSTANCE.convert(createReqVO);
|
||||
subjectRepresentativeMapper.insert(subjectRepresentative);
|
||||
// 返回
|
||||
return subjectRepresentative.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSubjectRepresentative(SubjectRepresentativeUpdateReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSubjectRepresentativeExists(updateReqVO.getId());
|
||||
// 更新
|
||||
SubjectRepresentativeDO updateObj = SubjectRepresentativeConvert.INSTANCE.convert(updateReqVO);
|
||||
subjectRepresentativeMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSubjectRepresentative(Long id) {
|
||||
// 校验存在
|
||||
validateSubjectRepresentativeExists(id);
|
||||
// 删除
|
||||
subjectRepresentativeMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateSubjectRepresentativeExists(Long id) {
|
||||
if (subjectRepresentativeMapper.selectById(id) == null) {
|
||||
throw exception(SUBJECT_REPRESENTATIVE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SubjectRepresentativeDO getSubjectRepresentative(Long id) {
|
||||
return subjectRepresentativeMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SubjectRepresentativeDO> getSubjectRepresentativeList(Collection<Long> ids) {
|
||||
return subjectRepresentativeMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SubjectRepresentativeDO> getSubjectRepresentativePage(SubjectRepresentativePageReqVO pageReqVO) {
|
||||
return subjectRepresentativeMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SubjectRepresentativeDO> getSubjectRepresentativeList(SubjectRepresentativeExportReqVO exportReqVO) {
|
||||
return subjectRepresentativeMapper.selectList(exportReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,263 @@
|
||||
package com.yunxi.scm.module.xxjj.service.productlnventoryunit;
|
||||
|
||||
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.productlnventoryunit.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.productlnventoryunit.ProductLnventoryUnitDO;
|
||||
import com.yunxi.scm.module.xxjj.dal.mysql.productlnventoryunit.ProductLnventoryUnitMapper;
|
||||
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 ProductLnventoryUnitServiceImpl} 的单元测试类
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
@Import(ProductLnventoryUnitServiceImpl.class)
|
||||
public class ProductLnventoryUnitServiceImplTest extends BaseDbUnitTest {
|
||||
|
||||
@Resource
|
||||
private ProductLnventoryUnitServiceImpl productLnventoryUnitService;
|
||||
|
||||
@Resource
|
||||
private ProductLnventoryUnitMapper productLnventoryUnitMapper;
|
||||
|
||||
@Test
|
||||
public void testCreateProductLnventoryUnit_success() {
|
||||
// 准备参数
|
||||
ProductLnventoryUnitCreateReqVO reqVO = randomPojo(ProductLnventoryUnitCreateReqVO.class);
|
||||
|
||||
// 调用
|
||||
Long productLnventoryUnitId = productLnventoryUnitService.createProductLnventoryUnit(reqVO);
|
||||
// 断言
|
||||
assertNotNull(productLnventoryUnitId);
|
||||
// 校验记录的属性是否正确
|
||||
ProductLnventoryUnitDO productLnventoryUnit = productLnventoryUnitMapper.selectById(productLnventoryUnitId);
|
||||
assertPojoEquals(reqVO, productLnventoryUnit);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateProductLnventoryUnit_success() {
|
||||
// mock 数据
|
||||
ProductLnventoryUnitDO dbProductLnventoryUnit = randomPojo(ProductLnventoryUnitDO.class);
|
||||
productLnventoryUnitMapper.insert(dbProductLnventoryUnit);// @Sql: 先插入出一条存在的数据
|
||||
// 准备参数
|
||||
ProductLnventoryUnitUpdateReqVO reqVO = randomPojo(ProductLnventoryUnitUpdateReqVO.class, o -> {
|
||||
o.setId(dbProductLnventoryUnit.getId()); // 设置更新的 ID
|
||||
});
|
||||
|
||||
// 调用
|
||||
productLnventoryUnitService.updateProductLnventoryUnit(reqVO);
|
||||
// 校验是否更新正确
|
||||
ProductLnventoryUnitDO productLnventoryUnit = productLnventoryUnitMapper.selectById(reqVO.getId()); // 获取最新的
|
||||
assertPojoEquals(reqVO, productLnventoryUnit);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateProductLnventoryUnit_notExists() {
|
||||
// 准备参数
|
||||
ProductLnventoryUnitUpdateReqVO reqVO = randomPojo(ProductLnventoryUnitUpdateReqVO.class);
|
||||
|
||||
// 调用, 并断言异常
|
||||
assertServiceException(() -> productLnventoryUnitService.updateProductLnventoryUnit(reqVO), PRODUCT_LNVENTORY_UNIT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteProductLnventoryUnit_success() {
|
||||
// mock 数据
|
||||
ProductLnventoryUnitDO dbProductLnventoryUnit = randomPojo(ProductLnventoryUnitDO.class);
|
||||
productLnventoryUnitMapper.insert(dbProductLnventoryUnit);// @Sql: 先插入出一条存在的数据
|
||||
// 准备参数
|
||||
Long id = dbProductLnventoryUnit.getId();
|
||||
|
||||
// 调用
|
||||
productLnventoryUnitService.deleteProductLnventoryUnit(id);
|
||||
// 校验数据不存在了
|
||||
assertNull(productLnventoryUnitMapper.selectById(id));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteProductLnventoryUnit_notExists() {
|
||||
// 准备参数
|
||||
Long id = randomLongId();
|
||||
|
||||
// 调用, 并断言异常
|
||||
assertServiceException(() -> productLnventoryUnitService.deleteProductLnventoryUnit(id), PRODUCT_LNVENTORY_UNIT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
||||
public void testGetProductLnventoryUnitPage() {
|
||||
// mock 数据
|
||||
ProductLnventoryUnitDO dbProductLnventoryUnit = randomPojo(ProductLnventoryUnitDO.class, o -> { // 等会查询到
|
||||
o.setProductUnitName(null);
|
||||
o.setProuctId(null);
|
||||
o.setConversionRules1(null);
|
||||
o.setConversionRules2(null);
|
||||
o.setPackagingBarcode(null);
|
||||
o.setDimensionalUnit(null);
|
||||
o.setSizeInformation1(null);
|
||||
o.setSizeInformation2(null);
|
||||
o.setSizeInformation3(null);
|
||||
o.setVolumeInformation(null);
|
||||
o.setVolumeInformationUnit(null);
|
||||
o.setWeight(null);
|
||||
o.setGrossWeight(null);
|
||||
o.setNetWeight(null);
|
||||
o.setCreateTime(null);
|
||||
});
|
||||
productLnventoryUnitMapper.insert(dbProductLnventoryUnit);
|
||||
// 测试 productUnitName 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setProductUnitName(null)));
|
||||
// 测试 prouctId 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setProuctId(null)));
|
||||
// 测试 conversionRules1 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setConversionRules1(null)));
|
||||
// 测试 conversionRules2 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setConversionRules2(null)));
|
||||
// 测试 packagingBarcode 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setPackagingBarcode(null)));
|
||||
// 测试 dimensionalUnit 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setDimensionalUnit(null)));
|
||||
// 测试 sizeInformation1 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setSizeInformation1(null)));
|
||||
// 测试 sizeInformation2 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setSizeInformation2(null)));
|
||||
// 测试 sizeInformation3 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setSizeInformation3(null)));
|
||||
// 测试 volumeInformation 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setVolumeInformation(null)));
|
||||
// 测试 volumeInformationUnit 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setVolumeInformationUnit(null)));
|
||||
// 测试 weight 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setWeight(null)));
|
||||
// 测试 grossWeight 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setGrossWeight(null)));
|
||||
// 测试 net weight 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setNetWeight(null)));
|
||||
// 测试 createTime 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setCreateTime(null)));
|
||||
// 准备参数
|
||||
ProductLnventoryUnitPageReqVO reqVO = new ProductLnventoryUnitPageReqVO();
|
||||
reqVO.setProductUnitName(null);
|
||||
reqVO.setProuctId(null);
|
||||
reqVO.setConversionRules1(null);
|
||||
reqVO.setConversionRules2(null);
|
||||
reqVO.setPackagingBarcode(null);
|
||||
reqVO.setDimensionalUnit(null);
|
||||
reqVO.setSizeInformation1(null);
|
||||
reqVO.setSizeInformation2(null);
|
||||
reqVO.setSizeInformation3(null);
|
||||
reqVO.setVolumeInformation(null);
|
||||
reqVO.setVolumeInformationUnit(null);
|
||||
reqVO.setWeight(null);
|
||||
reqVO.setGrossWeight(null);
|
||||
reqVO.setNetWeight(null);
|
||||
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||
|
||||
// 调用
|
||||
PageResult<ProductLnventoryUnitDO> pageResult = productLnventoryUnitService.getProductLnventoryUnitPage(reqVO);
|
||||
// 断言
|
||||
assertEquals(1, pageResult.getTotal());
|
||||
assertEquals(1, pageResult.getList().size());
|
||||
assertPojoEquals(dbProductLnventoryUnit, pageResult.getList().get(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
||||
public void testGetProductLnventoryUnitList() {
|
||||
// mock 数据
|
||||
ProductLnventoryUnitDO dbProductLnventoryUnit = randomPojo(ProductLnventoryUnitDO.class, o -> { // 等会查询到
|
||||
o.setProductUnitName(null);
|
||||
o.setProuctId(null);
|
||||
o.setConversionRules1(null);
|
||||
o.setConversionRules2(null);
|
||||
o.setPackagingBarcode(null);
|
||||
o.setDimensionalUnit(null);
|
||||
o.setSizeInformation1(null);
|
||||
o.setSizeInformation2(null);
|
||||
o.setSizeInformation3(null);
|
||||
o.setVolumeInformation(null);
|
||||
o.setVolumeInformationUnit(null);
|
||||
o.setWeight(null);
|
||||
o.setGrossWeight(null);
|
||||
o.setNetWeight(null);
|
||||
o.setCreateTime(null);
|
||||
});
|
||||
productLnventoryUnitMapper.insert(dbProductLnventoryUnit);
|
||||
// 测试 productUnitName 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setProductUnitName(null)));
|
||||
// 测试 prouctId 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setProuctId(null)));
|
||||
// 测试 conversionRules1 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setConversionRules1(null)));
|
||||
// 测试 conversionRules2 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setConversionRules2(null)));
|
||||
// 测试 packagingBarcode 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setPackagingBarcode(null)));
|
||||
// 测试 dimensionalUnit 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setDimensionalUnit(null)));
|
||||
// 测试 sizeInformation1 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setSizeInformation1(null)));
|
||||
// 测试 sizeInformation2 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setSizeInformation2(null)));
|
||||
// 测试 sizeInformation3 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setSizeInformation3(null)));
|
||||
// 测试 volumeInformation 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setVolumeInformation(null)));
|
||||
// 测试 volumeInformationUnit 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setVolumeInformationUnit(null)));
|
||||
// 测试 weight 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setWeight(null)));
|
||||
// 测试 grossWeight 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setGrossWeight(null)));
|
||||
// 测试 net weight 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setNetWeight(null)));
|
||||
// 测试 createTime 不匹配
|
||||
productLnventoryUnitMapper.insert(cloneIgnoreId(dbProductLnventoryUnit, o -> o.setCreateTime(null)));
|
||||
// 准备参数
|
||||
ProductLnventoryUnitExportReqVO reqVO = new ProductLnventoryUnitExportReqVO();
|
||||
reqVO.setProductUnitName(null);
|
||||
reqVO.setProuctId(null);
|
||||
reqVO.setConversionRules1(null);
|
||||
reqVO.setConversionRules2(null);
|
||||
reqVO.setPackagingBarcode(null);
|
||||
reqVO.setDimensionalUnit(null);
|
||||
reqVO.setSizeInformation1(null);
|
||||
reqVO.setSizeInformation2(null);
|
||||
reqVO.setSizeInformation3(null);
|
||||
reqVO.setVolumeInformation(null);
|
||||
reqVO.setVolumeInformationUnit(null);
|
||||
reqVO.setWeight(null);
|
||||
reqVO.setGrossWeight(null);
|
||||
reqVO.setNetWeight(null);
|
||||
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||
|
||||
// 调用
|
||||
List<ProductLnventoryUnitDO> list = productLnventoryUnitService.getProductLnventoryUnitList(reqVO);
|
||||
// 断言
|
||||
assertEquals(1, list.size());
|
||||
assertPojoEquals(dbProductLnventoryUnit, list.get(0));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,255 @@
|
||||
package com.yunxi.scm.module.xxjj.service.subjectcontacts;
|
||||
|
||||
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.subjectcontacts.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.subjectcontacts.SubjectContactsDO;
|
||||
import com.yunxi.scm.module.xxjj.dal.mysql.subjectcontacts.SubjectContactsMapper;
|
||||
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 SubjectContactsServiceImpl} 的单元测试类
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
@Import(SubjectContactsServiceImpl.class)
|
||||
public class SubjectContactsServiceImplTest extends BaseDbUnitTest {
|
||||
|
||||
@Resource
|
||||
private SubjectContactsServiceImpl subjectContactsService;
|
||||
|
||||
@Resource
|
||||
private SubjectContactsMapper subjectContactsMapper;
|
||||
|
||||
@Test
|
||||
public void testCreateSubjectContacts_success() {
|
||||
// 准备参数
|
||||
SubjectContactsCreateReqVO reqVO = randomPojo(SubjectContactsCreateReqVO.class);
|
||||
|
||||
// 调用
|
||||
Long subjectContactsId = subjectContactsService.createSubjectContacts(reqVO);
|
||||
// 断言
|
||||
assertNotNull(subjectContactsId);
|
||||
// 校验记录的属性是否正确
|
||||
SubjectContactsDO subjectContacts = subjectContactsMapper.selectById(subjectContactsId);
|
||||
assertPojoEquals(reqVO, subjectContacts);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateSubjectContacts_success() {
|
||||
// mock 数据
|
||||
SubjectContactsDO dbSubjectContacts = randomPojo(SubjectContactsDO.class);
|
||||
subjectContactsMapper.insert(dbSubjectContacts);// @Sql: 先插入出一条存在的数据
|
||||
// 准备参数
|
||||
SubjectContactsUpdateReqVO reqVO = randomPojo(SubjectContactsUpdateReqVO.class, o -> {
|
||||
o.setId(dbSubjectContacts.getId()); // 设置更新的 ID
|
||||
});
|
||||
|
||||
// 调用
|
||||
subjectContactsService.updateSubjectContacts(reqVO);
|
||||
// 校验是否更新正确
|
||||
SubjectContactsDO subjectContacts = subjectContactsMapper.selectById(reqVO.getId()); // 获取最新的
|
||||
assertPojoEquals(reqVO, subjectContacts);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateSubjectContacts_notExists() {
|
||||
// 准备参数
|
||||
SubjectContactsUpdateReqVO reqVO = randomPojo(SubjectContactsUpdateReqVO.class);
|
||||
|
||||
// 调用, 并断言异常
|
||||
assertServiceException(() -> subjectContactsService.updateSubjectContacts(reqVO), SUBJECT_CONTACTS_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteSubjectContacts_success() {
|
||||
// mock 数据
|
||||
SubjectContactsDO dbSubjectContacts = randomPojo(SubjectContactsDO.class);
|
||||
subjectContactsMapper.insert(dbSubjectContacts);// @Sql: 先插入出一条存在的数据
|
||||
// 准备参数
|
||||
Long id = dbSubjectContacts.getId();
|
||||
|
||||
// 调用
|
||||
subjectContactsService.deleteSubjectContacts(id);
|
||||
// 校验数据不存在了
|
||||
assertNull(subjectContactsMapper.selectById(id));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteSubjectContacts_notExists() {
|
||||
// 准备参数
|
||||
Long id = randomLongId();
|
||||
|
||||
// 调用, 并断言异常
|
||||
assertServiceException(() -> subjectContactsService.deleteSubjectContacts(id), SUBJECT_CONTACTS_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
||||
public void testGetSubjectContactsPage() {
|
||||
// mock 数据
|
||||
SubjectContactsDO dbSubjectContacts = randomPojo(SubjectContactsDO.class, o -> { // 等会查询到
|
||||
o.setBusinessId(null);
|
||||
o.setBusinessType(null);
|
||||
o.setContactsType(null);
|
||||
o.setAsteriskType(null);
|
||||
o.setMarkColor(null);
|
||||
o.setName(null);
|
||||
o.setCompanyName(null);
|
||||
o.setPosition(null);
|
||||
o.setMobile(null);
|
||||
o.setPhone(null);
|
||||
o.setEmaile(null);
|
||||
o.setAddress(null);
|
||||
o.setAnnex(null);
|
||||
o.setCreateTime(null);
|
||||
});
|
||||
subjectContactsMapper.insert(dbSubjectContacts);
|
||||
// 测试 businessId 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setBusinessId(null)));
|
||||
// 测试 businessType 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setBusinessType(null)));
|
||||
// 测试 contactsType 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setContactsType(null)));
|
||||
// 测试 asteriskType 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setAsteriskType(null)));
|
||||
// 测试 markColor 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setMarkColor(null)));
|
||||
// 测试 name 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setName(null)));
|
||||
// 测试 companyName 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setCompanyName(null)));
|
||||
// 测试 position 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setPosition(null)));
|
||||
// 测试 mobile 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setMobile(null)));
|
||||
// 测试 phone 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setPhone(null)));
|
||||
// 测试 emaile 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setEmaile(null)));
|
||||
// 测试 address 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setAddress(null)));
|
||||
// 测试 annex 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setAnnex(null)));
|
||||
// 测试 createTime 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setCreateTime(null)));
|
||||
// 准备参数
|
||||
SubjectContactsPageReqVO reqVO = new SubjectContactsPageReqVO();
|
||||
reqVO.setBusinessId(null);
|
||||
reqVO.setBusinessType(null);
|
||||
reqVO.setContactsType(null);
|
||||
reqVO.setAsteriskType(null);
|
||||
reqVO.setMarkColor(null);
|
||||
reqVO.setName(null);
|
||||
reqVO.setCompanyName(null);
|
||||
reqVO.setPosition(null);
|
||||
reqVO.setMobile(null);
|
||||
reqVO.setPhone(null);
|
||||
reqVO.setEmaile(null);
|
||||
reqVO.setAddress(null);
|
||||
reqVO.setAnnex(null);
|
||||
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||
|
||||
// 调用
|
||||
PageResult<SubjectContactsDO> pageResult = subjectContactsService.getSubjectContactsPage(reqVO);
|
||||
// 断言
|
||||
assertEquals(1, pageResult.getTotal());
|
||||
assertEquals(1, pageResult.getList().size());
|
||||
assertPojoEquals(dbSubjectContacts, pageResult.getList().get(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
||||
public void testGetSubjectContactsList() {
|
||||
// mock 数据
|
||||
SubjectContactsDO dbSubjectContacts = randomPojo(SubjectContactsDO.class, o -> { // 等会查询到
|
||||
o.setBusinessId(null);
|
||||
o.setBusinessType(null);
|
||||
o.setContactsType(null);
|
||||
o.setAsteriskType(null);
|
||||
o.setMarkColor(null);
|
||||
o.setName(null);
|
||||
o.setCompanyName(null);
|
||||
o.setPosition(null);
|
||||
o.setMobile(null);
|
||||
o.setPhone(null);
|
||||
o.setEmaile(null);
|
||||
o.setAddress(null);
|
||||
o.setAnnex(null);
|
||||
o.setCreateTime(null);
|
||||
});
|
||||
subjectContactsMapper.insert(dbSubjectContacts);
|
||||
// 测试 businessId 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setBusinessId(null)));
|
||||
// 测试 businessType 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setBusinessType(null)));
|
||||
// 测试 contactsType 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setContactsType(null)));
|
||||
// 测试 asteriskType 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setAsteriskType(null)));
|
||||
// 测试 markColor 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setMarkColor(null)));
|
||||
// 测试 name 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setName(null)));
|
||||
// 测试 companyName 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setCompanyName(null)));
|
||||
// 测试 position 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setPosition(null)));
|
||||
// 测试 mobile 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setMobile(null)));
|
||||
// 测试 phone 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setPhone(null)));
|
||||
// 测试 emaile 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setEmaile(null)));
|
||||
// 测试 address 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setAddress(null)));
|
||||
// 测试 annex 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setAnnex(null)));
|
||||
// 测试 createTime 不匹配
|
||||
subjectContactsMapper.insert(cloneIgnoreId(dbSubjectContacts, o -> o.setCreateTime(null)));
|
||||
// 准备参数
|
||||
SubjectContactsExportReqVO reqVO = new SubjectContactsExportReqVO();
|
||||
reqVO.setBusinessId(null);
|
||||
reqVO.setBusinessType(null);
|
||||
reqVO.setContactsType(null);
|
||||
reqVO.setAsteriskType(null);
|
||||
reqVO.setMarkColor(null);
|
||||
reqVO.setName(null);
|
||||
reqVO.setCompanyName(null);
|
||||
reqVO.setPosition(null);
|
||||
reqVO.setMobile(null);
|
||||
reqVO.setPhone(null);
|
||||
reqVO.setEmaile(null);
|
||||
reqVO.setAddress(null);
|
||||
reqVO.setAnnex(null);
|
||||
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||
|
||||
// 调用
|
||||
List<SubjectContactsDO> list = subjectContactsService.getSubjectContactsList(reqVO);
|
||||
// 断言
|
||||
assertEquals(1, list.size());
|
||||
assertPojoEquals(dbSubjectContacts, list.get(0));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,247 @@
|
||||
package com.yunxi.scm.module.xxjj.service.subjectrepresentative;
|
||||
|
||||
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.subjectrepresentative.vo.*;
|
||||
import com.yunxi.scm.module.xxjj.dal.dataobject.subjectrepresentative.SubjectRepresentativeDO;
|
||||
import com.yunxi.scm.module.xxjj.dal.mysql.subjectrepresentative.SubjectRepresentativeMapper;
|
||||
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 SubjectRepresentativeServiceImpl} 的单元测试类
|
||||
*
|
||||
* @author 长江云息
|
||||
*/
|
||||
@Import(SubjectRepresentativeServiceImpl.class)
|
||||
public class SubjectRepresentativeServiceImplTest extends BaseDbUnitTest {
|
||||
|
||||
@Resource
|
||||
private SubjectRepresentativeServiceImpl subjectRepresentativeService;
|
||||
|
||||
@Resource
|
||||
private SubjectRepresentativeMapper subjectRepresentativeMapper;
|
||||
|
||||
@Test
|
||||
public void testCreateSubjectRepresentative_success() {
|
||||
// 准备参数
|
||||
SubjectRepresentativeCreateReqVO reqVO = randomPojo(SubjectRepresentativeCreateReqVO.class);
|
||||
|
||||
// 调用
|
||||
Long subjectRepresentativeId = subjectRepresentativeService.createSubjectRepresentative(reqVO);
|
||||
// 断言
|
||||
assertNotNull(subjectRepresentativeId);
|
||||
// 校验记录的属性是否正确
|
||||
SubjectRepresentativeDO subjectRepresentative = subjectRepresentativeMapper.selectById(subjectRepresentativeId);
|
||||
assertPojoEquals(reqVO, subjectRepresentative);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateSubjectRepresentative_success() {
|
||||
// mock 数据
|
||||
SubjectRepresentativeDO dbSubjectRepresentative = randomPojo(SubjectRepresentativeDO.class);
|
||||
subjectRepresentativeMapper.insert(dbSubjectRepresentative);// @Sql: 先插入出一条存在的数据
|
||||
// 准备参数
|
||||
SubjectRepresentativeUpdateReqVO reqVO = randomPojo(SubjectRepresentativeUpdateReqVO.class, o -> {
|
||||
o.setId(dbSubjectRepresentative.getId()); // 设置更新的 ID
|
||||
});
|
||||
|
||||
// 调用
|
||||
subjectRepresentativeService.updateSubjectRepresentative(reqVO);
|
||||
// 校验是否更新正确
|
||||
SubjectRepresentativeDO subjectRepresentative = subjectRepresentativeMapper.selectById(reqVO.getId()); // 获取最新的
|
||||
assertPojoEquals(reqVO, subjectRepresentative);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateSubjectRepresentative_notExists() {
|
||||
// 准备参数
|
||||
SubjectRepresentativeUpdateReqVO reqVO = randomPojo(SubjectRepresentativeUpdateReqVO.class);
|
||||
|
||||
// 调用, 并断言异常
|
||||
assertServiceException(() -> subjectRepresentativeService.updateSubjectRepresentative(reqVO), SUBJECT_REPRESENTATIVE_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteSubjectRepresentative_success() {
|
||||
// mock 数据
|
||||
SubjectRepresentativeDO dbSubjectRepresentative = randomPojo(SubjectRepresentativeDO.class);
|
||||
subjectRepresentativeMapper.insert(dbSubjectRepresentative);// @Sql: 先插入出一条存在的数据
|
||||
// 准备参数
|
||||
Long id = dbSubjectRepresentative.getId();
|
||||
|
||||
// 调用
|
||||
subjectRepresentativeService.deleteSubjectRepresentative(id);
|
||||
// 校验数据不存在了
|
||||
assertNull(subjectRepresentativeMapper.selectById(id));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteSubjectRepresentative_notExists() {
|
||||
// 准备参数
|
||||
Long id = randomLongId();
|
||||
|
||||
// 调用, 并断言异常
|
||||
assertServiceException(() -> subjectRepresentativeService.deleteSubjectRepresentative(id), SUBJECT_REPRESENTATIVE_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
||||
public void testGetSubjectRepresentativePage() {
|
||||
// mock 数据
|
||||
SubjectRepresentativeDO dbSubjectRepresentative = randomPojo(SubjectRepresentativeDO.class, o -> { // 等会查询到
|
||||
o.setBusinessId(null);
|
||||
o.setBusinessType(null);
|
||||
o.setRepresentativeType(null);
|
||||
o.setName(null);
|
||||
o.setIdCard(null);
|
||||
o.setIdCardStart(null);
|
||||
o.setIdCardEnd(null);
|
||||
o.setDescription(null);
|
||||
o.setIdCardPhoto1(null);
|
||||
o.setIdCardPhoto2(null);
|
||||
o.setIdCardPhoto3(null);
|
||||
o.setAuthorizeFiles(null);
|
||||
o.setCreateTime(null);
|
||||
});
|
||||
subjectRepresentativeMapper.insert(dbSubjectRepresentative);
|
||||
// 测试 businessId 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setBusinessId(null)));
|
||||
// 测试 businessType 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setBusinessType(null)));
|
||||
// 测试 representativeType 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setRepresentativeType(null)));
|
||||
// 测试 name 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setName(null)));
|
||||
// 测试 idCard 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setIdCard(null)));
|
||||
// 测试 idCardStart 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setIdCardStart(null)));
|
||||
// 测试 idCardEnd 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setIdCardEnd(null)));
|
||||
// 测试 description 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setDescription(null)));
|
||||
// 测试 idCardPhoto1 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setIdCardPhoto1(null)));
|
||||
// 测试 idCardPhoto2 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setIdCardPhoto2(null)));
|
||||
// 测试 idCardPhoto3 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setIdCardPhoto3(null)));
|
||||
// 测试 authorizeFiles 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setAuthorizeFiles(null)));
|
||||
// 测试 createTime 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setCreateTime(null)));
|
||||
// 准备参数
|
||||
SubjectRepresentativePageReqVO reqVO = new SubjectRepresentativePageReqVO();
|
||||
reqVO.setBusinessId(null);
|
||||
reqVO.setBusinessType(null);
|
||||
reqVO.setRepresentativeType(null);
|
||||
reqVO.setName(null);
|
||||
reqVO.setIdCard(null);
|
||||
reqVO.setIdCardStart(null);
|
||||
reqVO.setIdCardEnd(null);
|
||||
reqVO.setDescription(null);
|
||||
reqVO.setIdCardPhoto1(null);
|
||||
reqVO.setIdCardPhoto2(null);
|
||||
reqVO.setIdCardPhoto3(null);
|
||||
reqVO.setAuthorizeFiles(null);
|
||||
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||
|
||||
// 调用
|
||||
PageResult<SubjectRepresentativeDO> pageResult = subjectRepresentativeService.getSubjectRepresentativePage(reqVO);
|
||||
// 断言
|
||||
assertEquals(1, pageResult.getTotal());
|
||||
assertEquals(1, pageResult.getList().size());
|
||||
assertPojoEquals(dbSubjectRepresentative, pageResult.getList().get(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
||||
public void testGetSubjectRepresentativeList() {
|
||||
// mock 数据
|
||||
SubjectRepresentativeDO dbSubjectRepresentative = randomPojo(SubjectRepresentativeDO.class, o -> { // 等会查询到
|
||||
o.setBusinessId(null);
|
||||
o.setBusinessType(null);
|
||||
o.setRepresentativeType(null);
|
||||
o.setName(null);
|
||||
o.setIdCard(null);
|
||||
o.setIdCardStart(null);
|
||||
o.setIdCardEnd(null);
|
||||
o.setDescription(null);
|
||||
o.setIdCardPhoto1(null);
|
||||
o.setIdCardPhoto2(null);
|
||||
o.setIdCardPhoto3(null);
|
||||
o.setAuthorizeFiles(null);
|
||||
o.setCreateTime(null);
|
||||
});
|
||||
subjectRepresentativeMapper.insert(dbSubjectRepresentative);
|
||||
// 测试 businessId 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setBusinessId(null)));
|
||||
// 测试 businessType 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setBusinessType(null)));
|
||||
// 测试 representativeType 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setRepresentativeType(null)));
|
||||
// 测试 name 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setName(null)));
|
||||
// 测试 idCard 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setIdCard(null)));
|
||||
// 测试 idCardStart 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setIdCardStart(null)));
|
||||
// 测试 idCardEnd 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setIdCardEnd(null)));
|
||||
// 测试 description 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setDescription(null)));
|
||||
// 测试 idCardPhoto1 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setIdCardPhoto1(null)));
|
||||
// 测试 idCardPhoto2 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setIdCardPhoto2(null)));
|
||||
// 测试 idCardPhoto3 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setIdCardPhoto3(null)));
|
||||
// 测试 authorizeFiles 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setAuthorizeFiles(null)));
|
||||
// 测试 createTime 不匹配
|
||||
subjectRepresentativeMapper.insert(cloneIgnoreId(dbSubjectRepresentative, o -> o.setCreateTime(null)));
|
||||
// 准备参数
|
||||
SubjectRepresentativeExportReqVO reqVO = new SubjectRepresentativeExportReqVO();
|
||||
reqVO.setBusinessId(null);
|
||||
reqVO.setBusinessType(null);
|
||||
reqVO.setRepresentativeType(null);
|
||||
reqVO.setName(null);
|
||||
reqVO.setIdCard(null);
|
||||
reqVO.setIdCardStart(null);
|
||||
reqVO.setIdCardEnd(null);
|
||||
reqVO.setDescription(null);
|
||||
reqVO.setIdCardPhoto1(null);
|
||||
reqVO.setIdCardPhoto2(null);
|
||||
reqVO.setIdCardPhoto3(null);
|
||||
reqVO.setAuthorizeFiles(null);
|
||||
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||
|
||||
// 调用
|
||||
List<SubjectRepresentativeDO> list = subjectRepresentativeService.getSubjectRepresentativeList(reqVO);
|
||||
// 断言
|
||||
assertEquals(1, list.size());
|
||||
assertPojoEquals(dbSubjectRepresentative, list.get(0));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface SubjectContactsVO {
|
||||
id: number
|
||||
businessId: number
|
||||
businessType: string
|
||||
contactsType: string
|
||||
asteriskType: string
|
||||
markColor: string
|
||||
name: string
|
||||
companyName: string
|
||||
position: string
|
||||
mobile: string
|
||||
phone: string
|
||||
emaile: string
|
||||
address: string
|
||||
annex: string
|
||||
}
|
||||
|
||||
// 查询主体联系人列表
|
||||
export const getSubjectContactsPage = async (params) => {
|
||||
return await request.get({ url: `/xxjj/subject-contacts/page`, params })
|
||||
}
|
||||
|
||||
// 查询主体联系人详情
|
||||
export const getSubjectContacts = async (id: number) => {
|
||||
return await request.get({ url: `/xxjj/subject-contacts/get?id=` + id })
|
||||
}
|
||||
|
||||
// 新增主体联系人
|
||||
export const createSubjectContacts = async (data: SubjectContactsVO) => {
|
||||
return await request.post({ url: `/xxjj/subject-contacts/create`, data })
|
||||
}
|
||||
|
||||
// 修改主体联系人
|
||||
export const updateSubjectContacts = async (data: SubjectContactsVO) => {
|
||||
return await request.put({ url: `/xxjj/subject-contacts/update`, data })
|
||||
}
|
||||
|
||||
// 删除主体联系人
|
||||
export const deleteSubjectContacts = async (id: number) => {
|
||||
return await request.delete({ url: `/xxjj/subject-contacts/delete?id=` + id })
|
||||
}
|
||||
|
||||
// 导出主体联系人 Excel
|
||||
export const exportSubjectContacts = async (params) => {
|
||||
return await request.download({ url: `/xxjj/subject-contacts/export-excel`, params })
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<el-card class="xy-card xy-margin-zero">
|
||||
<template #header>
|
||||
信用规则配置
|
||||
</template>
|
||||
<template #default>
|
||||
<el-form label-width="160px">
|
||||
<el-card class="xy-card-info">
|
||||
<template #header>
|
||||
<div class="xy-card-info-icona"></div><span class="xy-card-info-text">信用等级</span>
|
||||
</template>
|
||||
<template #default>
|
||||
<el-card class="xy-card xy-margin-zero">
|
||||
<template #default>
|
||||
<div style="padding: 16px;">
|
||||
<el-table :data="listA" :border="true" :stripe="true" :show-overflow-tooltip="true" class="xy-table">
|
||||
<el-table-column prop="k1" label="信用等级" />
|
||||
<el-table-column prop="k2" label="评定分数范围">
|
||||
<template #default="scope">
|
||||
{{ scope.row.k2a }} ~ {{ scope.row.k2b }} 分
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="k3" label="级别说明" />
|
||||
<el-table-column label="生效时间">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.k4a }}</span><span style="margin: 0px 5px;">至</span><span>{{ scope.row.k4b
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最后更新时间">
|
||||
<template #default="scope">
|
||||
<div>{{ scope.row.k5a }}</div>
|
||||
<div>{{ scope.row.k5b }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" text :icon="Edit">编辑</el-button>
|
||||
<el-button type="primary" text :icon="Delete">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button :style="{ width: '100%', margin: '10px 0px' }" :icon="Link">添加规则</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-card>
|
||||
</template>
|
||||
</el-card>
|
||||
<el-card class="xy-card-info">
|
||||
<template #header>
|
||||
<div class="xy-card-info-icona"></div><span class="xy-card-info-text">信用规则配置</span>
|
||||
</template>
|
||||
<template #default>
|
||||
</template>
|
||||
</el-card>
|
||||
<div :style="{ textAlign: 'center' }">
|
||||
<space><el-button type="primary">保存</el-button><el-button>返回</el-button></space>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="CreditRulesCfg">
|
||||
import { Link, Edit, Delete } from '@element-plus/icons-vue'
|
||||
|
||||
const listA: any = ref([
|
||||
{
|
||||
k1: '五星客户',
|
||||
k2a: '90',
|
||||
k2b: '100',
|
||||
k3: '',
|
||||
k4a: '2023-12-12',
|
||||
k4b: '2023-10-11',
|
||||
k5a: '康宁',
|
||||
k5b: '2023-08-23 23:26:08'
|
||||
},
|
||||
{
|
||||
k1: '四星客户',
|
||||
k2a: '80',
|
||||
k2b: '90',
|
||||
k3: '',
|
||||
k4a: '2023-12-12',
|
||||
k4b: '2023-10-11',
|
||||
k5a: '康宁',
|
||||
k5b: '2023-08-23 23:26:08'
|
||||
}
|
||||
])
|
||||
/** 信用规则配置初始化 **/
|
||||
onMounted(() => {
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '@/styles/cus.scss';
|
||||
</style>
|
@ -0,0 +1,242 @@
|
||||
<template>
|
||||
<el-card class="xy-card xy-margin-zero">
|
||||
<template #header>
|
||||
风控配置
|
||||
</template>
|
||||
<template #default>
|
||||
<el-form label-width="160px">
|
||||
<el-card class="xy-card-info">
|
||||
<template #header>
|
||||
<div class="xy-card-info-icona"></div><span class="xy-card-info-text">结算规则</span>
|
||||
</template>
|
||||
<template #default>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="压款方式" prop="k1">
|
||||
<el-radio-group>
|
||||
<el-radio label="1">无</el-radio>
|
||||
<el-radio label="2">按金额</el-radio>
|
||||
<el-radio label="3">按比例</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="默认压款比例" prop="k2">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input placeholder="最低">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="4" style="text-align: center;">
|
||||
至
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-input placeholder="最高">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保证金方式" prop="k3">
|
||||
<el-radio-group>
|
||||
<el-radio label="1">无</el-radio>
|
||||
<el-radio label="2">按金额</el-radio>
|
||||
<el-radio label="3">按比例</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="默认保证金比例" prop="k4">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input placeholder="最低">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="4" style="text-align: center;">
|
||||
至
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-input placeholder="最高">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="逾期利率" prop="k5">
|
||||
<el-radio-group>
|
||||
<el-radio label="1">按年化</el-radio>
|
||||
<el-radio label="2">按月化</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="默认逾期利率" prop="k6">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input placeholder="最低">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="4" style="text-align: center;">
|
||||
至
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-input placeholder="最高">
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-card>
|
||||
<el-card class="xy-card-info">
|
||||
<template #header>
|
||||
<div class="xy-card-info-icona"></div><span class="xy-card-info-text">账期规则</span>
|
||||
</template>
|
||||
<template #default>
|
||||
<el-card class="xy-card xy-margin-zero">
|
||||
<template #default>
|
||||
<div style="padding: 16px;">
|
||||
<el-table :data="listA" :border="true" :stripe="true" :show-overflow-tooltip="true" class="xy-table">
|
||||
<el-table-column prop="k1" label="信用等级" />
|
||||
<el-table-column prop="k2" label="合作方式" />
|
||||
<el-table-column prop="k3" label="资金额度" />
|
||||
<el-table-column prop="k4" label="规则说明" />
|
||||
<el-table-column label="生效时间">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.k5a }}</span><span style="margin: 0px 5px;">至</span><span>{{ scope.row.k5b
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最后更新时间">
|
||||
<template #default="scope">
|
||||
<div>{{ scope.row.k6a }}</div>
|
||||
<div>{{ scope.row.k6b }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" text :icon="Edit">编辑</el-button>
|
||||
<el-button type="primary" text :icon="Delete">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button :style="{ width: '100%', margin: '10px 0px' }" :icon="Link">添加规则</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-card>
|
||||
</template>
|
||||
</el-card>
|
||||
<el-card class="xy-card-info">
|
||||
<template #header>
|
||||
<div class="xy-card-info-icona"></div><span class="xy-card-info-text">客户黑名单</span>
|
||||
</template>
|
||||
<template #default>
|
||||
<el-card class="xy-card xy-margin-zero">
|
||||
<template #default>
|
||||
<div style="padding: 16px;">
|
||||
<el-table :data="listB" :border="true" :stripe="true" :show-overflow-tooltip="true" class="xy-table">
|
||||
<el-table-column prop="k1" label="客户名称" />
|
||||
<el-table-column prop="k2" label="黑名单类型" />
|
||||
<el-table-column prop="k3" label="附件" />
|
||||
<el-table-column prop="k4" label="归属人员" />
|
||||
<el-table-column label="生效时间">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.k5a }}</span><span style="margin: 0px 5px;">至</span><span>{{ scope.row.k5b
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最后更新时间">
|
||||
<template #default="scope">
|
||||
<div>{{ scope.row.k6a }}</div>
|
||||
<div>{{ scope.row.k6b }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" text :icon="Delete">申请解除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button :style="{ width: '100%', margin: '10px 0px' }" :icon="Link">添加客户</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-card>
|
||||
</template>
|
||||
</el-card>
|
||||
<div :style="{ textAlign: 'center' }">
|
||||
<space><el-button type="primary">保存</el-button><el-button>返回</el-button></space>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="RiskControlCfg">
|
||||
import { Link, Edit, Delete } from '@element-plus/icons-vue'
|
||||
|
||||
const listA: any = ref([
|
||||
{
|
||||
k1: '五星客户',
|
||||
k2: '买断',
|
||||
k3: '1000万元',
|
||||
k4: '先货后款',
|
||||
k5a: '2023-12-12',
|
||||
k5b: '2023-10-11',
|
||||
k6a: '康宁',
|
||||
k6b: '2023-08-23 23:26:08'
|
||||
},
|
||||
{
|
||||
k1: '四星客户',
|
||||
k2: '买断',
|
||||
k3: '800万元',
|
||||
k4: '先款后货',
|
||||
k5a: '2023-12-12',
|
||||
k5b: '2023-10-11',
|
||||
k6a: '康宁',
|
||||
k6b: '2023-08-23 23:26:08'
|
||||
}
|
||||
])
|
||||
|
||||
const listB: any = ref([
|
||||
{
|
||||
k1: '',
|
||||
k2: '违规',
|
||||
k3: '1000万元',
|
||||
k4: '康宁',
|
||||
k5a: '2023-12-12',
|
||||
k5b: '2023-10-11',
|
||||
k6a: '康宁',
|
||||
k6b: '2023-08-23 23:26:08'
|
||||
},
|
||||
{
|
||||
k1: '',
|
||||
k2: '违法',
|
||||
k3: '800万元',
|
||||
k4: '康宁',
|
||||
k5a: '2023-12-12',
|
||||
k5b: '2023-10-11',
|
||||
k6a: '康宁',
|
||||
k6b: '2023-08-23 23:26:08'
|
||||
}
|
||||
])
|
||||
/** 风控配置初始化 **/
|
||||
onMounted(() => {
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '@/styles/cus.scss';
|
||||
</style>
|
Loading…
Reference in new issue