# Conflicts:
#	yunxi-ui-admin-vue3/src/views/xxjj/enterpriseDetails/src/infopage2/company.vue
pull/1/head
杨世强 1 year ago
commit 07363e552f

@ -8,6 +8,7 @@ import com.yunxi.scm.module.system.controller.admin.user.vo.user.*;
import com.yunxi.scm.module.system.convert.dept.DeptConvert; import com.yunxi.scm.module.system.convert.dept.DeptConvert;
import com.yunxi.scm.module.system.convert.user.UserConvert; import com.yunxi.scm.module.system.convert.user.UserConvert;
import com.yunxi.scm.module.system.dal.dataobject.dept.DeptDO; import com.yunxi.scm.module.system.dal.dataobject.dept.DeptDO;
import com.yunxi.scm.module.system.dal.dataobject.enterprise.EnterpriseDO;
import com.yunxi.scm.module.system.dal.dataobject.user.AdminUserDO; import com.yunxi.scm.module.system.dal.dataobject.user.AdminUserDO;
import com.yunxi.scm.module.system.service.dept.DeptService; import com.yunxi.scm.module.system.service.dept.DeptService;
import com.yunxi.scm.module.system.service.user.AdminUserService; import com.yunxi.scm.module.system.service.user.AdminUserService;
@ -205,4 +206,42 @@ public class UserController {
list.sort(Comparator.comparing(AdminUserDO::getId)); list.sort(Comparator.comparing(AdminUserDO::getId));
return success(UserConvert.INSTANCE.convertList04(list)); return success(UserConvert.INSTANCE.convertList04(list));
} }
@GetMapping("/getUserDeptCompanyListuser")
@Operation(summary = "获取公司部门人员树", description = "只包含被开启的部门人员,主要用于前端的下拉选项")
public CommonResult<List<UserDeptCompanyRespVO>> getUserDeptCompanyListuser() {
//查询所属公司信息
AdminUserDO adminUserDO = userService.getUser(SecurityFrameworkUtils.getLoginUserId());
EnterpriseDO enterpriseDO = adminUserDO.getEnterprise();
UserDeptCompanyRespVO userDeptCompanyRespVO = new UserDeptCompanyRespVO();
userDeptCompanyRespVO.setId("1-" + enterpriseDO.getId());
userDeptCompanyRespVO.setLabel(enterpriseDO.getName());
List<UserDeptCompanyRespVO> list1 = new ArrayList<>();
//查询公司下的部门
DeptListReqVO deptListReqVO = new DeptListReqVO();
deptListReqVO.setEnterpriseId(enterpriseDO.getId());
List<DeptDO> deptDOList = deptService.getDeptList(deptListReqVO);
for (DeptDO deptDO : deptDOList) {
UserDeptCompanyRespVO userDeptCompanyRespVO2 = new UserDeptCompanyRespVO();
userDeptCompanyRespVO2.setId("2-" + deptDO.getId());
userDeptCompanyRespVO2.setLabel(deptDO.getName());
List<UserDeptCompanyRespVO> list2 = new ArrayList<>();
//查询部门下的人员
UserRespVO reqVO = new UserRespVO();
reqVO.setDeptId(deptDO.getId());
List<AdminUserDO> userDOList = userService.getselectuser(reqVO);
for (AdminUserDO user : userDOList) {
UserDeptCompanyRespVO userDeptCompanyRespVO3 = new UserDeptCompanyRespVO();
userDeptCompanyRespVO3.setId("3-" + user.getId());
userDeptCompanyRespVO3.setLabel(user.getNickname());
list2.add(userDeptCompanyRespVO3);
}
userDeptCompanyRespVO2.setChildren(list2);
list1.add(userDeptCompanyRespVO2);
}
userDeptCompanyRespVO.setChildren(list1);
List<UserDeptCompanyRespVO> list = new ArrayList<>();
list.add(userDeptCompanyRespVO);
return success(list);
}
} }

@ -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;
}

@ -91,6 +91,7 @@ public interface ErrorCodeConstants {
ErrorCode PRODUCT_LABEL_NOT_EXISTS = new ErrorCode(1003004028, "商品标签不存在"); ErrorCode PRODUCT_LABEL_NOT_EXISTS = new ErrorCode(1003004028, "商品标签不存在");
ErrorCode PRODUCT_MODIFICATION_NOT_EXISTS = new ErrorCode(1003004029, "批量修改单不存在"); ErrorCode PRODUCT_MODIFICATION_NOT_EXISTS = new ErrorCode(1003004029, "批量修改单不存在");
ErrorCode PRODUCT_BOM_NOT_EXISTS = new ErrorCode(1003004030, "商品BOM管理不存在"); ErrorCode PRODUCT_BOM_NOT_EXISTS = new ErrorCode(1003004030, "商品BOM管理不存在");
ErrorCode PRODUCT_LNVENTORY_UNIT_NOT_EXISTS = new ErrorCode(1003004031, "商品表库存单位不存在");
/** /**
* 使 1-005-000-000 * 使 1-005-000-000
*/ */
@ -107,4 +108,9 @@ public interface ErrorCodeConstants {
// ========== 跟进报告管理 TODO 补充编号 ========== // ========== 跟进报告管理 TODO 补充编号 ==========
ErrorCode SUBJECT_FOLLOW_REPORT_NOT_EXISTS = new ErrorCode(1005000004, "跟进报告管理不存在"); ErrorCode SUBJECT_FOLLOW_REPORT_NOT_EXISTS = new ErrorCode(1005000004, "跟进报告管理不存在");
// ========== 主体联系人 TODO 补充编号 ==========
ErrorCode SUBJECT_CONTACTS_NOT_EXISTS = new ErrorCode(1005000005, "主体联系人不存在");
// ========== 主体代表人 TODO 补充编号 ==========
ErrorCode SUBJECT_REPRESENTATIVE_NOT_EXISTS = new ErrorCode(1005000006, "主体代表人不存在");
} }

@ -14,6 +14,9 @@ import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MON
@ToString(callSuper = true) @ToString(callSuper = true)
public class ContractPageReqVO extends PageParam { public class ContractPageReqVO extends PageParam {
@Schema(description = "合同名称/编号", example = "xxx项目/10001")
private String content;
@Schema(description = "合同状态", example = "1") @Schema(description = "合同状态", example = "1")
private String contractStatus; private String contractStatus;
@ -32,7 +35,6 @@ public class ContractPageReqVO extends PageParam {
@Schema(description = "合同简称") @Schema(description = "合同简称")
private String contractShortName; private String contractShortName;
@Schema(description = "供应商/客户名称") @Schema(description = "供应商/客户名称")
private Long subject; private Long subject;
@ -63,4 +65,10 @@ public class ContractPageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;
/* ====================contract_info 表字段=========================== */
@Schema(description = "配送方式", example = "2")
private String deliveryMethod;
@Schema(description = "运输方式", example = "2")
private String modeTransport;
} }

@ -99,4 +99,12 @@ public class ProductController {
ExcelUtils.write(response, "商品.xls", "数据", ProductExcelVO.class, datas); ExcelUtils.write(response, "商品.xls", "数据", ProductExcelVO.class, datas);
} }
@GetMapping("/productPage")
@Operation(summary = "获得商品分页")
@PreAuthorize("@ss.hasPermission('xxjj:product:query1')")
public CommonResult<PageResult<ProductRespVO>> getProductPageList(@Valid ProductPageReqVO pageVO) {
PageResult<ProductDO> pageResult = productService.ProductPageList1(pageVO);
return success(ProductConvert.INSTANCE.convertPage(pageResult));
}
} }

@ -1,5 +1,6 @@
package com.yunxi.scm.module.xxjj.controller.admin.product.vo; package com.yunxi.scm.module.xxjj.controller.admin.product.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
@ -287,4 +288,33 @@ public class ProductBaseVO {
@Schema(description = "预留字段6") @Schema(description = "预留字段6")
private String reservedFields6; private String reservedFields6;
@TableField(exist = false)
private Integer ctaeId;
@TableField(exist = false)
private String categoryName;
@TableField(exist = false)
private String brandName;
@Schema(description = "生命周期")
private String lifeCycle;
@Schema(description = "销售状态")
private String salesStatus;
//首选供应商
@TableField(exist = false)
private String supplierName;
//首选类目
@TableField(exist = false)
private String parameterName;
@Schema(description = "更新时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime updateTime;
@TableField(exist = false)
private String nickname;
} }

@ -303,4 +303,9 @@ public class ProductExcelVO {
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
@Schema(description = "生命周期")
private String lifeCycle;
@Schema(description = "销售状态")
private String salesStatus;
} }

@ -1,5 +1,6 @@
package com.yunxi.scm.module.xxjj.controller.admin.product.vo; package com.yunxi.scm.module.xxjj.controller.admin.product.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -277,4 +278,20 @@ public class ProductExportReqVO {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] updateTime; private LocalDateTime[] updateTime;
@Schema(description = "生命周期")
private String lifeCycle;
@Schema(description = "销售状态")
private String salesStatus;
//首选供应商
@TableField(exist = false)
private String supplierName;
//首选类目
@TableField(exist = false)
private String parameterName;
@TableField(exist = false)
private String nickname;
} }

@ -1,5 +1,6 @@
package com.yunxi.scm.module.xxjj.controller.admin.product.vo; package com.yunxi.scm.module.xxjj.controller.admin.product.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -142,7 +143,8 @@ public class ProductPageReqVO extends PageParam {
private String salesAllowOverchargingRatio; private String salesAllowOverchargingRatio;
@Schema(description = "销售时间开始") @Schema(description = "销售时间开始")
private LocalDateTime salesStart; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] salesStart;
@Schema(description = "销售时间结束") @Schema(description = "销售时间结束")
private LocalDateTime salesEnd; private LocalDateTime salesEnd;
@ -278,4 +280,30 @@ public class ProductPageReqVO extends PageParam {
@Schema(description = "更新时间") @Schema(description = "更新时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] updateTime; private LocalDateTime[] updateTime;
@Schema(description = "生命周期")
private String lifeCycle;
@Schema(description = "销售状态")
private String salesStatus;
//首选供应商
@TableField(exist = false)
private String supplierName;
//首选类目
@TableField(exist = false)
private String parameterName;
@TableField(exist = false)
private String nickname;
@TableField(exist = false)
private String categoryName;
@TableField(exist = false)
private String brandName;
} }

@ -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,59 @@
package com.yunxi.scm.module.xxjj.controller.admin.productlnventoryunit.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
/**
* Base VO VO 使
* VO Swagger
*/
@Data
public class ProductLnventoryUnitBaseVO {
@Schema(description = "单位名称", example = "李四")
private String productUnitName;
@Schema(description = "商品id", example = "21653")
private Long prouctId;
@Schema(description = "换算规则1")
private String conversionRules1;
@Schema(description = "换算规则2")
private String conversionRules2;
@Schema(description = "包装条码")
private String packagingBarcode;
@Schema(description = "尺寸单位1厘米cm 2米m")
private String dimensionalUnit;
@Schema(description = "尺寸信息1")
private Object sizeInformation1;
@Schema(description = "尺寸信息2")
private Object sizeInformation2;
@Schema(description = "尺寸信息3")
private Object sizeInformation3;
@Schema(description = "体积信息")
private Object volumeInformation;
@Schema(description = "体积单位1立方厘米cm 2立方米m")
private String volumeInformationUnit;
@Schema(description = "重量单位1克 2千克 3")
private String weight;
@Schema(description = "毛重")
private Object grossWeight;
@Schema(description = "净重")
private Object netWeight;
}

@ -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,73 @@
package com.yunxi.scm.module.xxjj.controller.admin.productlnventoryunit.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yunxi.scm.framework.excel.core.annotations.DictFormat;
import com.yunxi.scm.framework.excel.core.convert.DictConvert;
/**
* Excel VO
*
* @author
*/
@Data
public class ProductLnventoryUnitExcelVO {
@ExcelProperty("编号")
private Long id;
@ExcelProperty("单位名称")
private String productUnitName;
@ExcelProperty("商品id")
private Long prouctId;
@ExcelProperty("换算规则1")
private String conversionRules1;
@ExcelProperty("换算规则2")
private String conversionRules2;
@ExcelProperty("包装条码")
private String packagingBarcode;
@ExcelProperty(value = "尺寸单位1厘米cm 2米m", converter = DictConvert.class)
@DictFormat("dimensional_unit") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
private String dimensionalUnit;
@ExcelProperty("尺寸信息1")
private Object sizeInformation1;
@ExcelProperty("尺寸信息2")
private Object sizeInformation2;
@ExcelProperty("尺寸信息3")
private Object sizeInformation3;
@ExcelProperty("体积信息")
private Object volumeInformation;
@ExcelProperty(value = "体积单位1立方厘米cm 2立方米m", converter = DictConvert.class)
@DictFormat("volume_information_unit") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
private String volumeInformationUnit;
@ExcelProperty(value = "重量单位1克 2千克 3", converter = DictConvert.class)
@DictFormat("product_weight") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中
private String weight;
@ExcelProperty("毛重")
private Object grossWeight;
@ExcelProperty("净重")
private Object netWeight;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

@ -0,0 +1,62 @@
package com.yunxi.scm.module.xxjj.controller.admin.productlnventoryunit.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import java.time.LocalDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 商品表库存单位 Excel 导出 Request VO参数和 ProductLnventoryUnitPageReqVO 是一致的")
@Data
public class ProductLnventoryUnitExportReqVO {
@Schema(description = "单位名称", example = "李四")
private String productUnitName;
@Schema(description = "商品id", example = "21653")
private Long prouctId;
@Schema(description = "换算规则1")
private String conversionRules1;
@Schema(description = "换算规则2")
private String conversionRules2;
@Schema(description = "包装条码")
private String packagingBarcode;
@Schema(description = "尺寸单位1厘米cm 2米m")
private String dimensionalUnit;
@Schema(description = "尺寸信息1")
private Object sizeInformation1;
@Schema(description = "尺寸信息2")
private Object sizeInformation2;
@Schema(description = "尺寸信息3")
private Object sizeInformation3;
@Schema(description = "体积信息")
private Object volumeInformation;
@Schema(description = "体积单位1立方厘米cm 2立方米m")
private String volumeInformationUnit;
@Schema(description = "重量单位1克 2千克 3")
private String weight;
@Schema(description = "毛重")
private Object grossWeight;
@Schema(description = "净重")
private Object netWeight;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -0,0 +1,64 @@
package com.yunxi.scm.module.xxjj.controller.admin.productlnventoryunit.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 商品表库存单位分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductLnventoryUnitPageReqVO extends PageParam {
@Schema(description = "单位名称", example = "李四")
private String productUnitName;
@Schema(description = "商品id", example = "21653")
private Long prouctId;
@Schema(description = "换算规则1")
private String conversionRules1;
@Schema(description = "换算规则2")
private String conversionRules2;
@Schema(description = "包装条码")
private String packagingBarcode;
@Schema(description = "尺寸单位1厘米cm 2米m")
private String dimensionalUnit;
@Schema(description = "尺寸信息1")
private Object sizeInformation1;
@Schema(description = "尺寸信息2")
private Object sizeInformation2;
@Schema(description = "尺寸信息3")
private Object sizeInformation3;
@Schema(description = "体积信息")
private Object volumeInformation;
@Schema(description = "体积单位1立方厘米cm 2立方米m")
private String volumeInformationUnit;
@Schema(description = "重量单位1克 2千克 3")
private String weight;
@Schema(description = "毛重")
private Object grossWeight;
@Schema(description = "净重")
private Object netWeight;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -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;
}

@ -1,5 +1,8 @@
package com.yunxi.scm.module.xxjj.controller.admin.subjectbasic.vo; package com.yunxi.scm.module.xxjj.controller.admin.subjectbasic.vo;
import com.yunxi.scm.module.system.dal.dataobject.businesswarehouse.BusinessWarehouseDO;
import com.yunxi.scm.module.xxjj.dal.dataobject.subjectcontacts.SubjectContactsDO;
import com.yunxi.scm.module.xxjj.dal.dataobject.subjectrepresentative.SubjectRepresentativeDO;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
@ -208,12 +211,21 @@ public class SubjectBasicBaseVO {
@Schema(description = "合作方式(0买断 1联营)") @Schema(description = "合作方式(0买断 1联营)")
private String collaborationMethod; private String collaborationMethod;
private String settlementCycle;
private LocalDateTime settlementStartDate;
private String settlementDate;
private String commissionType;
private String defaultCommissionRatio;
private String commissionCalculationBase;
private String customizeCommissionRule;
@Schema(description = "结算方式(0:先货后款 1先款后货)") @Schema(description = "结算方式(0:先货后款 1先款后货)")
private String settlementMethod; private String settlementMethod;
@Schema(description = "账期") @Schema(description = "账期")
private String accountPeriod; private String accountPeriod;
@Schema(description = "预付比例")
private String advanceRatio;
@Schema(description = "压款方式(0无 1按金额 2按比例)") @Schema(description = "压款方式(0无 1按金额 2按比例)")
private String underpaymentMethod; private String underpaymentMethod;
@ -271,6 +283,14 @@ public class SubjectBasicBaseVO {
@Schema(description = "完税证明超时限制") @Schema(description = "完税证明超时限制")
private Long taxPaymentCertificate; private Long taxPaymentCertificate;
@Schema(description = "联系人列表")
private List<SubjectContactsDO> subjectContactsDOList;
@Schema(description = "代表人信息列表")
private List<SubjectRepresentativeDO> subjectRepresentativeDOList;
@Schema(description = "业务线信息列表")
private List<BusinessWarehouseDO> businessWarehouseDOList;
@Schema(description = "客户类型") @Schema(description = "客户类型")
private String customType; private String customType;

@ -202,6 +202,9 @@ public class SubjectBasicExcelVO {
@ExcelProperty("账期") @ExcelProperty("账期")
private String accountPeriod; private String accountPeriod;
@ExcelProperty("预付比例")
private String advanceRatio;
@ExcelProperty("压款方式(0无 1按金额 2按比例)") @ExcelProperty("压款方式(0无 1按金额 2按比例)")
private String underpaymentMethod; private String underpaymentMethod;

@ -181,12 +181,23 @@ public class SubjectBasicExportReqVO {
@Schema(description = "合作方式(0买断 1联营)") @Schema(description = "合作方式(0买断 1联营)")
private String collaborationMethod; private String collaborationMethod;
private String settlementCycle;
private LocalDateTime settlementStartDate;
private String settlementDate;
private String commissionType;
private String defaultCommissionRatio;
private String commissionCalculationBase;
private String customizeCommissionRule;
@Schema(description = "结算方式(0:先货后款 1先款后货)") @Schema(description = "结算方式(0:先货后款 1先款后货)")
private String settlementMethod; private String settlementMethod;
@Schema(description = "账期") @Schema(description = "账期")
private String accountPeriod; private String accountPeriod;
@Schema(description = "预付比例")
private String advanceRatio;
@Schema(description = "压款方式(0无 1按金额 2按比例)") @Schema(description = "压款方式(0无 1按金额 2按比例)")
private String underpaymentMethod; private String underpaymentMethod;

@ -186,12 +186,23 @@ public class SubjectBasicPageReqVO extends PageParam {
@Schema(description = "合作方式(0买断 1联营)") @Schema(description = "合作方式(0买断 1联营)")
private String collaborationMethod; private String collaborationMethod;
private String settlementCycle;
private LocalDateTime settlementStartDate;
private String settlementDate;
private String commissionType;
private String defaultCommissionRatio;
private String commissionCalculationBase;
private String customizeCommissionRule;
@Schema(description = "结算方式(0:先货后款 1先款后货)") @Schema(description = "结算方式(0:先货后款 1先款后货)")
private String settlementMethod; private String settlementMethod;
@Schema(description = "账期") @Schema(description = "账期")
private String accountPeriod; private String accountPeriod;
@Schema(description = "预付比例")
private String advanceRatio;
@Schema(description = "压款方式(0无 1按金额 2按比例)") @Schema(description = "压款方式(0无 1按金额 2按比例)")
private String underpaymentMethod; private String underpaymentMethod;

@ -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,57 @@
package com.yunxi.scm.module.xxjj.controller.admin.subjectcontacts.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
/**
* Base VO VO 使
* VO Swagger
*/
@Data
public class SubjectContactsBaseVO {
@Schema(description = "业务id", requiredMode = Schema.RequiredMode.REQUIRED, example = "18892")
@NotNull(message = "业务id不能为空")
private Long businessId;
@Schema(description = "业务类型(0客户 1供应商 2服务商)", example = "2")
private String businessType;
@Schema(description = "联系人类型(0默认 1联系人)", example = "1")
private String contactsType;
@Schema(description = "是否星标(0否 1是)", example = "1")
private String asteriskType;
@Schema(description = "标记颜色")
private String markColor;
@Schema(description = "姓名", example = "张三")
private String name;
@Schema(description = "公司", example = "王五")
private String companyName;
@Schema(description = "职务")
private String position;
@Schema(description = "手机")
private String mobile;
@Schema(description = "电话")
private String phone;
@Schema(description = "邮箱")
private String emaile;
@Schema(description = "地址")
private String address;
@Schema(description = "附件")
private String annex;
}

@ -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,64 @@
package com.yunxi.scm.module.xxjj.controller.admin.subjectcontacts.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* Excel VO
*
* @author
*/
@Data
public class SubjectContactsExcelVO {
@ExcelProperty("主键id")
private Long id;
@ExcelProperty("业务id")
private Long businessId;
@ExcelProperty("业务类型(0客户 1供应商 2服务商)")
private String businessType;
@ExcelProperty("联系人类型(0默认 1联系人)")
private String contactsType;
@ExcelProperty("是否星标(0否 1是)")
private String asteriskType;
@ExcelProperty("标记颜色")
private String markColor;
@ExcelProperty("姓名")
private String name;
@ExcelProperty("公司")
private String companyName;
@ExcelProperty("职务")
private String position;
@ExcelProperty("手机")
private String mobile;
@ExcelProperty("电话")
private String phone;
@ExcelProperty("邮箱")
private String emaile;
@ExcelProperty("地址")
private String address;
@ExcelProperty("附件")
private String annex;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

@ -0,0 +1,59 @@
package com.yunxi.scm.module.xxjj.controller.admin.subjectcontacts.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import java.time.LocalDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 主体联系人 Excel 导出 Request VO参数和 SubjectContactsPageReqVO 是一致的")
@Data
public class SubjectContactsExportReqVO {
@Schema(description = "业务id", example = "18892")
private Long businessId;
@Schema(description = "业务类型(0客户 1供应商 2服务商)", example = "2")
private String businessType;
@Schema(description = "联系人类型(0默认 1联系人)", example = "1")
private String contactsType;
@Schema(description = "是否星标(0否 1是)", example = "1")
private String asteriskType;
@Schema(description = "标记颜色")
private String markColor;
@Schema(description = "姓名", example = "张三")
private String name;
@Schema(description = "公司", example = "王五")
private String companyName;
@Schema(description = "职务")
private String position;
@Schema(description = "手机")
private String mobile;
@Schema(description = "电话")
private String phone;
@Schema(description = "邮箱")
private String emaile;
@Schema(description = "地址")
private String address;
@Schema(description = "附件")
private String annex;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -0,0 +1,61 @@
package com.yunxi.scm.module.xxjj.controller.admin.subjectcontacts.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 主体联系人分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SubjectContactsPageReqVO extends PageParam {
@Schema(description = "业务id", example = "18892")
private Long businessId;
@Schema(description = "业务类型(0客户 1供应商 2服务商)", example = "2")
private String businessType;
@Schema(description = "联系人类型(0默认 1联系人)", example = "1")
private String contactsType;
@Schema(description = "是否星标(0否 1是)", example = "1")
private String asteriskType;
@Schema(description = "标记颜色")
private String markColor;
@Schema(description = "姓名", example = "张三")
private String name;
@Schema(description = "公司", example = "王五")
private String companyName;
@Schema(description = "职务")
private String position;
@Schema(description = "手机")
private String mobile;
@Schema(description = "电话")
private String phone;
@Schema(description = "邮箱")
private String emaile;
@Schema(description = "地址")
private String address;
@Schema(description = "附件")
private String annex;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -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,61 @@
package com.yunxi.scm.module.xxjj.controller.admin.subjectrepresentative.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* Base VO VO 使
* VO Swagger
*/
@Data
public class SubjectRepresentativeBaseVO {
@Schema(description = "业务id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14287")
@NotNull(message = "业务id不能为空")
private Long businessId;
@Schema(description = "业务类型(0客户 1供应商 2服务商)", example = "1")
private String businessType;
@Schema(description = "代表人类型(0法定代表人 1代办人 1实控人 1担保人)", example = "1")
private String representativeType;
@Schema(description = "姓名", example = "赵六")
private String name;
@Schema(description = "身份证号")
private String idCard;
@Schema(description = "证件有效时间开始")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime idCardStart;
@Schema(description = "证件有效时间结束")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime idCardEnd;
@Schema(description = "描述", example = "随便")
private String description;
@Schema(description = "证件照正面")
private String idCardPhoto1;
@Schema(description = "证件照反面")
private String idCardPhoto2;
@Schema(description = "手持证件照")
private String idCardPhoto3;
@Schema(description = "授权/证明文件")
private String authorizeFiles;
}

@ -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,63 @@
package com.yunxi.scm.module.xxjj.controller.admin.subjectrepresentative.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* Excel VO
*
* @author
*/
@Data
public class SubjectRepresentativeExcelVO {
@ExcelProperty("主键id")
private Long id;
@ExcelProperty("业务id")
private Long businessId;
@ExcelProperty("业务类型(0客户 1供应商 2服务商)")
private String businessType;
@ExcelProperty("代表人类型(0法定代表人 1代办人 1实控人 1担保人)")
private String representativeType;
@ExcelProperty("姓名")
private String name;
@ExcelProperty("身份证号")
private String idCard;
@ExcelProperty("证件有效时间开始")
private LocalDateTime idCardStart;
@ExcelProperty("证件有效时间结束")
private LocalDateTime idCardEnd;
@ExcelProperty("描述")
private String description;
@ExcelProperty("证件照正面")
private String idCardPhoto1;
@ExcelProperty("证件照反面")
private String idCardPhoto2;
@ExcelProperty("手持证件照")
private String idCardPhoto3;
@ExcelProperty("授权/证明文件")
private String authorizeFiles;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

@ -0,0 +1,56 @@
package com.yunxi.scm.module.xxjj.controller.admin.subjectrepresentative.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import java.time.LocalDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 主体代表人 Excel 导出 Request VO参数和 SubjectRepresentativePageReqVO 是一致的")
@Data
public class SubjectRepresentativeExportReqVO {
@Schema(description = "业务id", example = "14287")
private Long businessId;
@Schema(description = "业务类型(0客户 1供应商 2服务商)", example = "1")
private String businessType;
@Schema(description = "代表人类型(0法定代表人 1代办人 1实控人 1担保人)", example = "1")
private String representativeType;
@Schema(description = "姓名", example = "赵六")
private String name;
@Schema(description = "身份证号")
private String idCard;
@Schema(description = "证件有效时间开始")
private LocalDateTime idCardStart;
@Schema(description = "证件有效时间结束")
private LocalDateTime idCardEnd;
@Schema(description = "描述", example = "随便")
private String description;
@Schema(description = "证件照正面")
private String idCardPhoto1;
@Schema(description = "证件照反面")
private String idCardPhoto2;
@Schema(description = "手持证件照")
private String idCardPhoto3;
@Schema(description = "授权/证明文件")
private String authorizeFiles;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -0,0 +1,58 @@
package com.yunxi.scm.module.xxjj.controller.admin.subjectrepresentative.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yunxi.scm.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.yunxi.scm.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 主体代表人分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SubjectRepresentativePageReqVO extends PageParam {
@Schema(description = "业务id", example = "14287")
private Long businessId;
@Schema(description = "业务类型(0客户 1供应商 2服务商)", example = "1")
private String businessType;
@Schema(description = "代表人类型(0法定代表人 1代办人 1实控人 1担保人)", example = "1")
private String representativeType;
@Schema(description = "姓名", example = "赵六")
private String name;
@Schema(description = "身份证号")
private String idCard;
@Schema(description = "证件有效时间开始")
private LocalDateTime idCardStart;
@Schema(description = "证件有效时间结束")
private LocalDateTime idCardEnd;
@Schema(description = "描述", example = "随便")
private String description;
@Schema(description = "证件照正面")
private String idCardPhoto1;
@Schema(description = "证件照反面")
private String idCardPhoto2;
@Schema(description = "手持证件照")
private String idCardPhoto3;
@Schema(description = "授权/证明文件")
private String authorizeFiles;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -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);
}

@ -1,6 +1,7 @@
package com.yunxi.scm.module.xxjj.dal.dataobject.product; package com.yunxi.scm.module.xxjj.dal.dataobject.product;
import com.sun.xml.bind.v2.TODO; import com.sun.xml.bind.v2.TODO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -417,4 +418,32 @@ public class ProductDO extends BaseDO {
*/ */
@TableField(exist = false) @TableField(exist = false)
private String updaterName; private String updaterName;
@TableField(exist = false)
private Integer ctaeId;
@TableField(exist = false)
private String categoryName;
@TableField(exist = false)
private String brandName;
@Schema(description = "生命周期")
private String lifeCycle;
@Schema(description = "销售状态")
private String salesStatus;
//首选供应商
@TableField(exist = false)
private String supplierName;
//首选类目
@TableField(exist = false)
private String parameterName;
private LocalDateTime updateTime;
@TableField(exist = false)
private String nickname;
} }

@ -0,0 +1,93 @@
package com.yunxi.scm.module.xxjj.dal.dataobject.productlnventoryunit;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.yunxi.scm.framework.mybatis.core.dataobject.BaseDO;
/**
* DO
*
* @author
*/
@TableName("xxjj_product_lnventory_unit")
@KeySequence("xxjj_product_lnventory_unit_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProductLnventoryUnitDO extends BaseDO {
/**
*
*/
@TableId
private Long id;
/**
*
*/
private String productUnitName;
/**
* id
*/
private Long prouctId;
/**
* 1
*/
private String conversionRules1;
/**
* 2
*/
private String conversionRules2;
/**
*
*/
private String packagingBarcode;
/**
* 1cm 2m
*
* {@link TODO dimensional_unit }
*/
private String dimensionalUnit;
/**
* 1
*/
private Object sizeInformation1;
/**
* 2
*/
private Object sizeInformation2;
/**
* 3
*/
private Object sizeInformation3;
/**
*
*/
private Object volumeInformation;
/**
* 1cm 2m
*
* {@link TODO volume_information_unit }
*/
private String volumeInformationUnit;
/**
* 1 2 3
*
* {@link TODO product_weight }
*/
private String weight;
/**
*
*/
private Object grossWeight;
/**
*
*/
private Object netWeight;
}

@ -262,6 +262,19 @@ public class SubjectBasicDO extends BaseDO {
* (0 1) * (0 1)
*/ */
private String collaborationMethod; private String collaborationMethod;
private String settlementCycle;
private LocalDateTime settlementStartDate;
private String settlementDate;
private String commissionType;
private String defaultCommissionRatio;
private String commissionCalculationBase;
private String customizeCommissionRule;
/** /**
* (0: 1) * (0: 1)
*/ */
@ -270,6 +283,12 @@ public class SubjectBasicDO extends BaseDO {
* *
*/ */
private String accountPeriod; private String accountPeriod;
/**
*
*/
private String advanceRatio;
/** /**
* (0 1 2) * (0 1 2)
*/ */

@ -0,0 +1,83 @@
package com.yunxi.scm.module.xxjj.dal.dataobject.subjectcontacts;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.yunxi.scm.framework.mybatis.core.dataobject.BaseDO;
/**
* DO
*
* @author
*/
@TableName("xxjj_subject_contacts")
@KeySequence("xxjj_subject_contacts_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SubjectContactsDO extends BaseDO {
/**
* id
*/
@TableId
private Long id;
/**
* id
*/
private Long businessId;
/**
* (0 1 2)
*/
private String businessType;
/**
* (0 1)
*/
private String contactsType;
/**
* (0 1)
*/
private String asteriskType;
/**
*
*/
private String markColor;
/**
*
*/
private String name;
/**
*
*/
private String companyName;
/**
*
*/
private String position;
/**
*
*/
private String mobile;
/**
*
*/
private String phone;
/**
*
*/
private String emaile;
/**
*
*/
private String address;
/**
*
*/
private String annex;
}

@ -0,0 +1,81 @@
package com.yunxi.scm.module.xxjj.dal.dataobject.subjectrepresentative;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.yunxi.scm.framework.mybatis.core.dataobject.BaseDO;
/**
* DO
*
* @author
*/
@TableName("xxjj_subject_representative")
@KeySequence("xxjj_subject_representative_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SubjectRepresentativeDO extends BaseDO {
/**
* id
*/
@TableId
private Long id;
/**
* id
*/
private Long businessId;
/**
* (0 1 2)
*/
private String businessType;
/**
* (0 1 1 1)
*/
private String representativeType;
/**
*
*/
private String name;
/**
*
*/
private String idCard;
/**
*
*/
private LocalDateTime idCardStart;
/**
*
*/
private LocalDateTime idCardEnd;
/**
*
*/
private String description;
/**
*
*/
private String idCardPhoto1;
/**
*
*/
private String idCardPhoto2;
/**
*
*/
private String idCardPhoto3;
/**
* /
*/
private String authorizeFiles;
}

@ -1,14 +1,26 @@
package com.yunxi.scm.module.xxjj.dal.mysql.contract; package com.yunxi.scm.module.xxjj.dal.mysql.contract;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.query.MPJLambdaQueryWrapper;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.yunxi.scm.framework.common.pojo.PageResult; import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.framework.mybatis.core.query.LambdaQueryWrapperX; import com.yunxi.scm.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yunxi.scm.framework.mybatis.core.mapper.BaseMapperX; import com.yunxi.scm.framework.mybatis.core.mapper.BaseMapperX;
import com.yunxi.scm.framework.mybatis.core.util.MyBatisUtils;
import com.yunxi.scm.module.xxjj.controller.admin.contract.vo.contract.ContractExportReqVO; import com.yunxi.scm.module.xxjj.controller.admin.contract.vo.contract.ContractExportReqVO;
import com.yunxi.scm.module.xxjj.controller.admin.contract.vo.contract.ContractPageReqVO; import com.yunxi.scm.module.xxjj.controller.admin.contract.vo.contract.ContractPageReqVO;
import com.yunxi.scm.module.xxjj.dal.dataobject.contract.ContractDO; import com.yunxi.scm.module.xxjj.dal.dataobject.contract.ContractDO;
import com.yunxi.scm.module.xxjj.dal.dataobject.contract.ContractInfoDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* Mapper * Mapper
@ -18,6 +30,37 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface ContractMapper extends BaseMapperX<ContractDO> { public interface ContractMapper extends BaseMapperX<ContractDO> {
// 查询列表 (暂时弃用: 主子表存在相同字段时,查询报错)
// IPage<ContractDO> queryList(@Param("page") IPage<ContractDO> page, @Param(Constants.WRAPPER) Wrapper<ContractDO> wrapper);
default PageResult<ContractDO> queryList(ContractPageReqVO reqVO) {
IPage<ContractDO> mpPage = MyBatisUtils.buildPage(reqVO);
String content = reqVO.getContent();
LocalDateTime[] declarationTime = reqVO.getDeclarationTime();
// 初始化变量: 防止between空指针异常
declarationTime = Optional.ofNullable(declarationTime).orElse(new LocalDateTime[]{null,null,null});
LocalDateTime[] createTime = reqVO.getCreateTime();
createTime = Optional.ofNullable(createTime).orElse(new LocalDateTime[]{null,null,null});
MPJLambdaWrapper<ContractDO> wrapperJ = new MPJLambdaWrapper<ContractDO>()
.selectAll(ContractDO.class)
.select(ContractInfoDO::getCurrency, ContractInfoDO::getDeliveryMethod)
.selectAssociation(ContractInfoDO.class, ContractDO::getContractInfoDO)
.leftJoin(ContractInfoDO.class, ContractInfoDO::getContractId, ContractDO::getId)
.eq(StringUtils.isNotBlank(reqVO.getContractStatus()), ContractDO::getContractStatus, reqVO.getContractStatus())
.eq(StringUtils.isNotBlank(reqVO.getContractType()), ContractDO::getContractType, reqVO.getContractType())
.eq(reqVO.getSubject() != null, ContractDO::getSubject, reqVO.getSubject())
.eq(StringUtils.isNotBlank(reqVO.getContractNo()), ContractDO::getContractNo, reqVO.getContractNo())
.eq(StringUtils.isNotBlank(reqVO.getBusinessType()), ContractDO::getBusinessType, reqVO.getBusinessType())
.like(StringUtils.isNotBlank(reqVO.getContractShortName()), ContractDO::getContractShortName, reqVO.getContractShortName())
.between( declarationTime.length == 2, ContractDO::getDeclarationTime, declarationTime[0],declarationTime[1])
.between( createTime.length == 2, ContractDO::getCreateTime, createTime[0],createTime[1])
.and(StringUtils.isNotBlank(content), qw -> qw.like(ContractDO::getContractNumber, content).or().like(ContractDO::getContractName, content))
.eq(StringUtils.isNotBlank(reqVO.getDeliveryMethod()), ContractInfoDO::getDeliveryMethod, reqVO.getDeliveryMethod())
.eq(StringUtils.isNotBlank(reqVO.getModeTransport()), ContractInfoDO::getModeTransport, reqVO.getModeTransport());
selectJoinPage(mpPage, ContractDO.class, wrapperJ);
return new PageResult<>(mpPage.getRecords(), mpPage.getTotal());
}
default PageResult<ContractDO> selectPage(ContractPageReqVO reqVO) { default PageResult<ContractDO> selectPage(ContractPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ContractDO>() return selectPage(reqVO, new LambdaQueryWrapperX<ContractDO>()
.eqIfPresent(ContractDO::getContractStatus, reqVO.getContractStatus()) .eqIfPresent(ContractDO::getContractStatus, reqVO.getContractStatus())

@ -2,12 +2,14 @@ package com.yunxi.scm.module.xxjj.dal.mysql.product;
import java.util.*; import java.util.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yunxi.scm.framework.common.pojo.PageResult; import com.yunxi.scm.framework.common.pojo.PageResult;
import com.yunxi.scm.framework.mybatis.core.query.LambdaQueryWrapperX; import com.yunxi.scm.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yunxi.scm.framework.mybatis.core.mapper.BaseMapperX; import com.yunxi.scm.framework.mybatis.core.mapper.BaseMapperX;
import com.yunxi.scm.module.xxjj.dal.dataobject.product.ProductDO; import com.yunxi.scm.module.xxjj.dal.dataobject.product.ProductDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import com.yunxi.scm.module.xxjj.controller.admin.product.vo.*; import com.yunxi.scm.module.xxjj.controller.admin.product.vo.*;
import org.apache.ibatis.annotations.Param;
/** /**
* Mapper * Mapper
@ -200,4 +202,5 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
.orderByDesc(ProductDO::getId)); .orderByDesc(ProductDO::getId));
} }
IPage<ProductDO> productDoListpage(IPage<ProductDO> page, @Param("reqVO") ProductPageReqVO reqVO);
} }

@ -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));
}
}

@ -1,5 +1,8 @@
package com.yunxi.scm.module.xxjj.service.contract; package com.yunxi.scm.module.xxjj.service.contract;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yunxi.scm.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yunxi.scm.framework.mybatis.core.util.MyBatisUtils;
import com.yunxi.scm.module.xxjj.controller.admin.contract.vo.contract.ContractCreateReqVO; import com.yunxi.scm.module.xxjj.controller.admin.contract.vo.contract.ContractCreateReqVO;
import com.yunxi.scm.module.xxjj.controller.admin.contract.vo.contract.ContractExportReqVO; import com.yunxi.scm.module.xxjj.controller.admin.contract.vo.contract.ContractExportReqVO;
import com.yunxi.scm.module.xxjj.controller.admin.contract.vo.contract.ContractPageReqVO; import com.yunxi.scm.module.xxjj.controller.admin.contract.vo.contract.ContractPageReqVO;
@ -84,8 +87,8 @@ public class ContractServiceImpl implements ContractService {
} }
@Override @Override
public PageResult<ContractDO> getContractPage(ContractPageReqVO pageReqVO) { public PageResult<ContractDO> getContractPage(ContractPageReqVO reqVO) {
return contractMapper.selectPage(pageReqVO); return contractMapper.queryList(reqVO);
} }
@Override @Override

@ -67,4 +67,10 @@ public interface ProductService {
*/ */
List<ProductDO> getProductList(ProductExportReqVO exportReqVO); List<ProductDO> getProductList(ProductExportReqVO exportReqVO);
/**
*
* @param
* @return
*/
PageResult<ProductDO> ProductPageList1(ProductPageReqVO reqVO);
} }

@ -1,5 +1,7 @@
package com.yunxi.scm.module.xxjj.service.product; package com.yunxi.scm.module.xxjj.service.product;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yunxi.scm.module.system.dal.dataobject.user.AdminUserDO; import com.yunxi.scm.module.system.dal.dataobject.user.AdminUserDO;
import com.yunxi.scm.module.system.service.user.AdminUserService; import com.yunxi.scm.module.system.service.user.AdminUserService;
import com.yunxi.scm.module.xxjj.dal.dataobject.subjectbasic.SubjectBasicDO; import com.yunxi.scm.module.xxjj.dal.dataobject.subjectbasic.SubjectBasicDO;
@ -100,4 +102,11 @@ public class ProductServiceImpl implements ProductService {
return productMapper.selectList(exportReqVO); return productMapper.selectList(exportReqVO);
} }
@Override
public PageResult<ProductDO> ProductPageList1(ProductPageReqVO reqVO) {
IPage<ProductDO> page =new Page<>(reqVO.getPageNo(),reqVO.getPageSize());
productMapper.productDoListpage(page,reqVO);
return new PageResult<>(page.getRecords(),page.getTotal());
}
} }

@ -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);
}
}

@ -55,7 +55,7 @@ public class SubjectFollowReportServiceImpl implements SubjectFollowReportServic
private void validateSubjectFollowReportExists(Long id) { private void validateSubjectFollowReportExists(Long id) {
if (subjectFollowReportMapper.selectById(id) == null) { if (subjectFollowReportMapper.selectById(id) == null) {
//throw exception(SUBJECT_FOLLOW_REPORT_NOT_EXISTS); throw exception(SUBJECT_FOLLOW_REPORT_NOT_EXISTS);
} }
} }

@ -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);
}
}

@ -1,12 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yunxi.scm.module.xxjj.dal.mysql.contract.ContractMapper"> <mapper namespace="com.yunxi.scm.module.xxjj.dal.mysql.contract.ContractMapper">
<!-- ${ew.customSqlSegment} 参考: https://blog.csdn.net/lovoo/article/details/129489751 -->
<!-- <!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/ 文档可见https://www.iocoder.cn/MyBatis/x-plugins/
--> -->
<!-- 定义结果集映射 -->
<resultMap id="contractMap" type="ContractDO">
<association property="contractInfoDO" javaType="ContractInfoDO" />
<!-- <association property="contractInfoDO" javaType="ContractInfoDO">-->
<!-- <id column="ciId" property="id" />-->
<!-- </association>-->
</resultMap>
<!-- 分页关联查询 -->
<select id="queryList" resultMap="contractMap">
SELECT
c.*,
ci.*
FROM
xxjj_contract c
LEFT JOIN xxjj_contract_info ci ON c.id = ci.contract_id
where ${ew.SqlSegment}
</select>
</mapper> </mapper>

@ -9,46 +9,77 @@
文档可见https://www.iocoder.cn/MyBatis/x-plugins/ 文档可见https://www.iocoder.cn/MyBatis/x-plugins/
--> -->
<select id="queryProductList" resultType="com.yunxi.scm.module.xxjj.dal.dataobject.product.ProductDO"> <select id="productDoListpage" resultType="com.yunxi.scm.module.xxjj.dal.dataobject.product.ProductDO">
SELECT SELECT
a.*, a.*,
b.id AS ctaeId, b.id AS ctaeId,
b.category_name, b.category_name AS categoryName, -- 分类
c.brand_name, c.brand_name AS brandName,
z.life_cycle, d.parameter_name AS parameterName, -- 类目
z.sales_status e.name AS supplierName,
f.nickname AS nickname
FROM FROM
xxjj_product a xxjj_product a
LEFT JOIN xxjj_product_category b ON a.product_type_id=b.id AND b.deleted=0 LEFT JOIN xxjj_product_category b ON a.product_type_id = b.id
LEFT JOIN xxjj_product_brand c ON a.brand_id=c.id AND c.deleted=0 AND b.deleted = '0'
LEFT JOIN xxjj_product_supply z ON a.id=z.product_id AND z.deleted=0 LEFT JOIN xxjj_product_brand c ON a.brand_id = c.id
WHERE AND c.deleted = '0' -- 品牌
a.deleted=0 LEFT JOIN xxjj_product_parameter d ON a.area_category=d.id
LEFT JOIN xxjj_subject_basic e ON a.first_supplier_id=e.id
LEFT JOIN system_users f ON a.creator=f.id
<where> <where>
a.deleted=0
<if test="reqVO.name != null and reqVO.name !=''"> <if test="reqVO.name != null and reqVO.name !=''">
a.name LIKE CONCAT('%',#{name},'%') AND a.name LIKE CONCAT('%',#{reqVO.name},'%')
</if> </if>
<if test="reqVO.code != null and reqVO.code !=''"> <if test="reqVO.code != null and reqVO.code !=''">
a.code LIKE CONCAT('%',#{code},'%') AND a.code LIKE CONCAT('%',#{reqVO.code},'%')
</if> </if>
<if test="reqVO.productStatus != null and reqVO.productStatus !=''"> <if test="reqVO.productStatus != null and reqVO.productStatus !=''">
a.product_status LIKE CONCAT('%',#{productStatus},'%') AND a.product_status LIKE CONCAT('%',#{reqVO.productStatus},'%')
</if> </if>
<if test="reqVO.productType != null and reqVO.productType !=''"> <if test="reqVO.productType != null and reqVO.productType !=''">
a.product_type LIKE CONCAT('%',#{productType},'%') AND a.product_type LIKE CONCAT('%',#{reqVO.productType},'%')
</if> </if>
<if test="reqVO.inventoryType != null and reqVO.inventoryType !=''"> <if test="reqVO.inventoryType != null and reqVO.inventoryType !=''">
a.inventory_type LIKE CONCAT('%',#{inventoryType},'%') AND a.inventory_type LIKE CONCAT('%',#{reqVO.inventoryType},'%')
</if> </if>
<if test="reqVO.shortName != null and reqVO.shortName !=''"> <if test="reqVO.shortName != null and reqVO.shortName !=''">
a.short_name LIKE CONCAT('%',#{shortName},'%') AND a.short_name LIKE CONCAT('%',#{reqVO.shortName},'%')
</if> </if>
<if test="reqVO.startDate != null and reqVO.endDate != null"> <if test="reqVO.createTime != null and reqVO.createTime != null">
AND a.update_time &gt; #{reqVO} AND a.update_time &lt;= #{reqVO} AND a.create_time &gt; #{reqVO.createTime[0]} AND a.create_time &lt;= #{reqVO.createTime[1]}
</if>
<if test="reqVO.salesStart != null and reqVO.salesStart != null">
AND a.sales_start &gt; #{reqVO.salesStart[0]} AND a.sales_start &lt;= #{reqVO.salesStart[1]}
</if>
<if test="reqVO.updateTime != null and reqVO.updateTime != null">
AND a.update_time &gt; #{reqVO.updateTime[0]} AND a.update_time &lt;= #{reqVO.updateTime[1]}
</if>
<if test="reqVO.categoryName != null and reqVO.categoryName !=''">
AND b.category_name LIKE CONCAT('%',#{reqVO.categoryName},'%')
</if>
<if test="reqVO.deliveryType != null and reqVO.deliveryType !=''">
AND a.delivery_type LIKE CONCAT('%',#{reqVO.deliveryType},'%')
</if>
<if test="reqVO.purchaseMode != null and reqVO.purchaseMode !=''">
AND a.purchase_mode LIKE CONCAT('%',#{reqVO.purchaseMode},'%')
</if>
<if test="reqVO.nickname != null and reqVO.nickname !=''">
AND a.nickname LIKE CONCAT('%',#{reqVO.nickname},'%')
</if>
<if test="reqVO.lifeCycle != null and reqVO.lifeCycle !=''">
AND a.life_cycle LIKE CONCAT('%',#{reqVO.lifeCycle},'%')
</if>
<if test="reqVO.parameterName != null and reqVO.parameterName !=''">.
AND d.parameter_name LIKE CONCAT('%',#{reqVO.parameterName},'%')
</if>
<if test="reqVO.brandName != null and reqVO.brandName !=''">
AND c.brand_name LIKE CONCAT('%',#{reqVO.brandName},'%')
</if>
<if test="reqVO.supplierName != null and reqVO.supplierName !=''">
AND e.name LIKE CONCAT('%',#{reqVO.supplierName},'%')
</if> </if>
</where> </where>
GROUP BY GROUP BY
a.id a.id

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yunxi.scm.module.xxjj.dal.mysql.productlnventoryunit.ProductLnventoryUnitMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yunxi.scm.module.xxjj.dal.mysql.subjectcontacts.SubjectContactsMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yunxi.scm.module.xxjj.dal.mysql.subjectrepresentative.SubjectRepresentativeMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

@ -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));
}
}

@ -74,3 +74,7 @@ export const updateUserStatus = (id: number, status: number) => {
export const getSimpleUserList = (): Promise<UserVO[]> => { export const getSimpleUserList = (): Promise<UserVO[]> => {
return request.get({ url: '/system/user/list-all-simple' }) return request.get({ url: '/system/user/list-all-simple' })
} }
// 获取公司部门人员树
export const getUserDeptCompanyListuser = (): Promise<UserVO[]> => {
return request.get({ url: '/system/user/getUserDeptCompanyListuser' })
}

@ -118,3 +118,8 @@ export const deleteProduct = async (id: number) => {
export const exportProduct = async (params) => { export const exportProduct = async (params) => {
return await request.download({ url: `/xxjj/product/export-excel`, params }) return await request.download({ url: `/xxjj/product/export-excel`, params })
} }
// 查询商品列表
export const getProductPage1 = async (params) => {
return await request.get({ url: `/xxjj/product/productPage`, params })
}

@ -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 })
}

@ -227,11 +227,18 @@ export enum DICT_TYPE {
MANAGE_INVENTORY = 'manage_inventory', //管理库存 MANAGE_INVENTORY = 'manage_inventory', //管理库存
TRANSPORT_TEMPERATURE = 'transport_temperature', //温层 TRANSPORT_TEMPERATURE = 'transport_temperature', //温层
OUTPUT_TAX_RATE = 'output_tax_rate', //商品进销税率 OUTPUT_TAX_RATE = 'output_tax_rate', //商品进销税率
representative_type = 'representative_type', //商品进销税率
paymentMethod = 'payment_method', //商品进销税率
bankDeposit = 'bankDeposit', //商品进销税率
settlementDate = 'settlementDate', //商品进销税率
commissionCalculationBase = 'commissionCalculationBase',
DELIVERY_TYPE = 'delivery_type', // 配送方式 DELIVERY_TYPE = 'delivery_type', // 配送方式
UNIT_TYPE = 'unit_type', //单位类型 UNIT_TYPE = 'unit_type', //单位类型
SOURCE = 'source' , //单位来源 SOURCE = 'source' , //单位来源
UNIT_STATUS = 'unit_status', //单位状态 UNIT_STATUS = 'unit_status', //单位状态
LIFE_CYCLE = 'life_cycle' ,//生命周期
SALES_STATUS = 'sales_status', //商品表销售状态
DELIVETRY_TYPE = 'delivery_type', //配送方式
// ============= CONTRACT 模块================= // ============= CONTRACT 模块=================
CONTRACT_STATUS = 'contract_status', // 合同状态 CONTRACT_STATUS = 'contract_status', // 合同状态
@ -247,5 +254,5 @@ export enum DICT_TYPE {
CONTRACT_BIDDING_STATUS = 'contract_bidding_status', // 合同招投标状态 CONTRACT_BIDDING_STATUS = 'contract_bidding_status', // 合同招投标状态
CONTRACT_LONGTERM_STATUS = 'contract_longterm_status', // 合同长协 CONTRACT_LONGTERM_STATUS = 'contract_longterm_status', // 合同长协
} }

@ -28,8 +28,8 @@
</el-form-item> --> </el-form-item> -->
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="合同简称" prop="contractShortname"> <el-form-item label="合同简称" prop="contractShortName">
<el-input v-model="queryParams.contractShortname" placeholder="合同简称/英文名" clearable <el-input v-model="queryParams.contractShortName" placeholder="合同简称/英文名" clearable
@keyup.enter="handleQuery" style="width: 100%;" /> @keyup.enter="handleQuery" style="width: 100%;" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -46,7 +46,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="合同类型" prop="contractType"> <el-form-item label="合同类型" prop="contractType">
<el-select v-model="queryParams.contractType" placeholder="合同状态" clearable style="width: 100%;"> <el-select v-model="queryParams.contractType" placeholder="合同状态" style="width: 100%;" clearable>
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.CONTRACT_TYPE)" :key="dict.value" <el-option v-for="dict in getStrDictOptions(DICT_TYPE.CONTRACT_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value" /> :label="dict.label" :value="dict.value" />
</el-select> </el-select>
@ -79,7 +79,8 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="配送方式" prop="deliveryMethod"> <el-form-item label="配送方式" prop="deliveryMethod">
<el-select v-model="queryParams.deliveryMethod" placeholder="配送方式" style="width: 100%;"> <el-select v-model="queryParams.deliveryMethod" placeholder="配送方式" style="width: 100%;"
clearable>
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.CONTRACT_DELIVERY_METHOD)" <el-option v-for="dict in getIntDictOptions(DICT_TYPE.CONTRACT_DELIVERY_METHOD)"
:key="dict.value" :label="dict.label" :value="dict.value" /> :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select> </el-select>
@ -87,7 +88,8 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="运输方式" prop="modeTransport"> <el-form-item label="运输方式" prop="modeTransport">
<el-select v-model="queryParams.modeTransport" placeholder="运输方式" style="width: 100%;"> <el-select v-model="queryParams.modeTransport" placeholder="运输方式" style="width: 100%;"
clearable>
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.CONTRACT_MODE_TRANSPORT)" <el-option v-for="dict in getIntDictOptions(DICT_TYPE.CONTRACT_MODE_TRANSPORT)"
:key="dict.value" :label="dict.label" :value="dict.value" /> :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select> </el-select>
@ -99,7 +101,8 @@
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="更新时间" prop="updateTime">
<el-date-picker v-model="queryParams.updateTime" value-format="YYYY-MM-DD HH:mm:ss" <el-date-picker v-model="queryParams.updateTime" value-format="YYYY-MM-DD HH:mm:ss"
type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" class="!w-240px" /> :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" class="!w-240px"
clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -110,11 +113,12 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="申报时间" prop="declarationTime"> <el-form-item label="申报时间" prop="declarationTime">
<el-date-picker v-model="queryParams.declarationTime" value-format="YYYY-MM-DD HH:mm:ss" <el-date-picker v-model="queryParams.declarationTime" value-format="YYYY-MM-DD HH:mm:ss"
type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" class="!w-240px" /> type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" class="!w-240px"
clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<DateRange name="declarationTime" @change-range="changeDateRange" /> <DateRange name="declarationTime" @change-range="changeDateRange" />
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -136,7 +140,7 @@ const props = defineProps({
isShow: Boolean isShow: Boolean
}) })
const emit = defineEmits(['doClose','doSearch']) const emit = defineEmits(['doClose', 'doSearch'])
const queryFormRef = ref() const queryFormRef = ref()
@ -175,7 +179,7 @@ const changeDateRange = (obj) => {
/** 搜索按钮操作 */ /** 搜索按钮操作 */
const handleQuery = () => { const handleQuery = () => {
console.log(queryParams); console.log(queryParams);
// emit('doSearch', queryParams) emit('doSearch', queryParams)
} }

@ -153,7 +153,7 @@ const { t } = useI18n() // 国际化
const loading = ref(true) // const loading = ref(true) //
const total = ref(0) // const total = ref(0) //
const list = ref([]) // const list = ref([]) //
const queryParams = reactive({ let queryParams: any = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
content: null, content: null,
@ -246,9 +246,12 @@ let showFilterDrawer = ref(false);
const toggleShowDrawerFilter = (isshow: boolean) => { const toggleShowDrawerFilter = (isshow: boolean) => {
showFilterDrawer.value = isshow; showFilterDrawer.value = isshow;
} }
//
const doDrawerFilterSearch = (params: Object) => { const doDrawerFilterSearch = (params: Object) => {
queryParams = params; queryParams = params;
getList() getList()
showFilterDrawer.value = false;
} }

@ -33,7 +33,7 @@
</el-row> </el-row>
<el-row> <el-row>
<!-- 表格 --> <!-- 表格 -->
<el-table stripe :border="true" style="width: 1500px;height: 100%;margin:20px 0;" v-loading="loading" :data="list"> <el-table stripe :border="true" style="width: 1500px;height: 100%;margin:20px 0;" v-loading="loading" :data="data1">
<el-table-column fixed="left" type="selection" /> <el-table-column fixed="left" type="selection" />
<el-table-column fixed="left" label="业务线名称" width="150" > <el-table-column fixed="left" label="业务线名称" width="150" >
<template #default="scope"> <template #default="scope">
@ -79,53 +79,75 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { defineEmits,defineProps,ref } from 'vue';
const props = defineProps({
data1: {
type: Array,
required: true,
},
treeId: {
type: Object,
required: true,
},
});
console.log(props.treeId);
const handleClick = () => {
// emit('grandparentEvent', 'Hello from grandchild component');
};
// const loading = ref(true) // // const loading = ref(true) //
const total = ref(5) // const total = ref('') //
const queryParams = reactive({ const queryParams = ref({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
// username: undefined, username: undefined,
// mobile: undefined, mobile: undefined,
// status: undefined, status: undefined,
// status1: undefined, status1: undefined,
// deptId: undefined, deptId: undefined,
// createTime: [] createTime: []
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
/** 查询列表 */ // const filteredData = computed(() => {
// const getList = async () => { // //
// loading.value = true // const { username, status, createTime } = queryParams.value;
// try { // return props.data1.filter((item:any) => {
// const data = await UserApi.getUserPage(queryParams) // //
// list.value = data.list // return (
// total.value = data.total // (username === undefined || item.username.includes(username)) &&
// } finally { // (status === undefined || item.status === status) &&
// loading.value = false // //
// } // // ...
// } // //
// (createTime.length === 0 ||
// (item.createTime >= createTime[0] && item.createTime <= createTime[1]))
// );
// });
// });
/** 搜索按钮操作 */
const handleQuery = () => { const handleQuery = () => {
queryParams.pageNo = 1 queryParams.value.pageNo = 1;
// getList() };
}
/** 重置按钮操作 */
const resetQuery = () => { const resetQuery = () => {
queryFormRef.value?.resetFields() queryParams.value = {
handleQuery() pageNo: 1,
} pageSize: 10,
username: undefined,
status: undefined,
createTime: [],
};
};
const list = ref([ // const list = ref([
{k1:'康宁',k1b:'1001011',k2:'商品经理',k2b:'商品部',k3:'再生资源事业部-销售组',k3b:'济钢城市矿产',k4:'废钢、废铝',k4b:'济钢城市矿产',k6:'15896345652',k7:'2023-09-09 18:24:00',k8:'30'}, // {k1:'',k1b:'1001011',k2:'',k2b:'',k3:'-',k3b:'',k4:'',k4b:'',k6:'15896345652',k7:'2023-09-09 18:24:00',k8:'30'},
{k1:'康宁',k1b:'2001011',k2:'商品经理',k2b:'商品部',k3:'再生资源事业部-销售组',k3b:'济钢城市矿产',k4:'废钢、废铝',k4b:'济钢城市矿产',k6:'15896345652',k7:'2023-09-09 18:24:00',k8:'30'}, // {k1:'',k1b:'2001011',k2:'',k2b:'',k3:'-',k3b:'',k4:'',k4b:'',k6:'15896345652',k7:'2023-09-09 18:24:00',k8:'30'},
{k1:'康宁',k1b:'3001011',k2:'商品经理',k2b:'商品部',k3:'再生资源事业部-销售组',k3b:'济钢城市矿产',k4:'废钢、废铝',k4b:'济钢城市矿产',k6:'15896345652',k7:'2023-09-09 18:24:00',k8:'30'}, // {k1:'',k1b:'3001011',k2:'',k2b:'',k3:'-',k3b:'',k4:'',k4b:'',k6:'15896345652',k7:'2023-09-09 18:24:00',k8:'30'},
]) // // ]) //
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

@ -1,142 +1,101 @@
<template> <template>
<el-card style="margin-top:20px" class="item-card"> <el-card style="margin-top:20px" class="item-card">
<template #header> <template #header>
<div class="designation"> <div class="designation">
<span></span> <span></span>
{{ `title.label` }} {{ companydata.k3b }}
</div> </div>
</template> </template>
<!-- 搜索 --> <!-- 搜索 -->
<el-form <el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
class="-mb-15px" <el-row>
:model="queryParams" <el-col>
ref="queryFormRef" <el-form-item prop="username">
:inline="true" <el-input v-model="queryParams.username" placeholder="分支机构编号/名称/负责人" clearable @keyup.enter="handleQuery" class="!w-240px" />
label-width="68px"
>
<el-row>
<el-col >
<el-form-item prop="username">
<el-input
v-model="queryParams.username"
placeholder="分支机构编号/名称/负责人"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select <el-select v-model="queryParams.status" placeholder="状态选项" clearable class="!w-240px">
v-model="queryParams.status" <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
placeholder="状态选项"
clearable
class="!w-240px"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="createTime"> <el-form-item prop="createTime">
<el-date-picker <el-date-picker v-model="queryParams.createTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" start-placeholder="" end-placeholder="" class="!w-240px" />
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange"
start-placeholder="请选择"
end-placeholder="最后登录时间"
class="!w-240px"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleQuery"><Icon icon="ep:search" />查询</el-button> <el-button type="primary" @click="handleQuery">
<el-button @click="resetQuery"><Icon icon="ep:refresh" />重置</el-button> <Icon icon="ep:search" />查询
</el-button>
<el-button @click="resetQuery">
<Icon icon="ep:refresh" />重置
</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<!-- 表格 --> <!-- 表格 -->
<el-table stripe :border="true" style="width: 1500px;height: 100%;margin-top:20px;" v-loading="loading" :data="list" > <el-table stripe :border="true" style="width: 1500px;height: 100%;margin-top:20px;" v-loading="loading" :data="companydata">
<el-table-column fixed="left" type="selection" /> <el-table-column fixed="left" type="selection" />
<el-table-column fixed="left" label="分支机构名称" width="250" key="name" prop="name" > <el-table-column fixed="left" label="分支机构名称" width="250" key="name" prop="k1">
<div style="display:flex;align-items:center;"> <template #default="scope">
<img style="width:40px; border-radius: 100%;margin:0 5px" src="../../../../assets/imgs/logo.png" alt="" /> <div style="display:flex;align-items:center;">
<p>{{123}}</p> <img style="width:40px; border-radius: 100%;margin:0 5px" src="" alt="" />
</div> <p>{{scope.row.k1}}</p>
</el-table-column> </div>
<el-table-column </template>
label="法定代表"
width="150"
sortable
align="center"
prop="legalPersonName"
:show-overflow-tooltip="true"
/>
<el-table-column label="联系电话" align="center" prop="enterprisePhone" width="120" />
<el-table-column label="邮箱" width="200px" prop="email" key="status1"/>
<el-table-column label="包含业务线" align="center" prop="businessName" width="120" /> </el-table-column>
<el-table-column label="关联员工" align="center" prop="mobile" width="120" /> <el-table-column label="法定代表" width="150" sortable align="center" prop="k1" :show-overflow-tooltip="true" />
<el-table-column label="状态" sortable align="center" prop="enterpriseStatus" width="120" /> <el-table-column label="联系电话" align="center" prop="k6" width="120" />
<el-table-column <el-table-column label="邮箱" width="200px" prop="k6" key="status1" />
label="更新时间"
align="center" <el-table-column label="包含业务线" align="center" prop="k4" width="120" />
prop="updateTime" <el-table-column label="关联员工" align="center" prop="k2" width="120" />
:formatter="dateFormatter" <el-table-column label="状态" sortable align="center" prop="k8" width="120" />
width="150px" <el-table-column label="更新时间" align="center" prop="k7" :formatter="dateFormatter" width="180" sortable />
sortable <el-table-column fixed="right" label="操作" align="center" width="120">
/> <template #default="scope">
<el-table-column fixed="right" label="操作" align="center" width="120"> <el-button type="primary" link @click="handleDelete(scope.row.id)" v-hasPermi="['system:tenant:delete']">
<template #default="scope"> <a>详情</a>
<el-button </el-button>
type="primary" </template>
link </el-table-column>
@click="handleDelete(scope.row.id)" </el-table>
v-hasPermi="['system:tenant:delete']" <Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize" @pagination="getList" />
> </el-card>
<a>详情</a>
</el-button>
</template>
</el-table-column>
</el-table>
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
// import { defineProps, ref } from 'vue' //props
const props = defineProps({
companydata: {
type: Array,
required: true,
},
treeId:{
type: Object,
required: true,
}
});
console.log(props.treeId);
console.log(props.companydata)
const activeName = ref('first') //
const deptName = ref('') const deptName = ref('')
/** 初始化 */
// onMounted( () => {
// })
const drawer = ref(false) // const drawer = ref(false) //
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const loading = ref(true) // const loading = ref(false) //
const total = ref(0) // const total = ref(0) //
const list = ref([]) // // const list = ref([]) //
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@ -164,6 +123,7 @@ const queryFormRef = ref() // 搜索的表单
/** 搜索按钮操作 */ /** 搜索按钮操作 */
const handleQuery = () => { const handleQuery = () => {
queryParams.pageNo = 1 queryParams.pageNo = 1
} }
/** 重置按钮操作 */ /** 重置按钮操作 */
@ -172,21 +132,17 @@ const resetQuery = () => {
handleQuery() handleQuery()
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() // const formRef = ref()
const openForm = (type: string, id?: number) => { // const openForm = (type: string, id?: number) => {
formRef.value.open(type, id) // formRef.value.open(type, id)
} // }
/** 用户导入 */ /** 用户导入 */
const importFormRef = ref() // const importFormRef = ref()
const handleImport = () => { // const handleImport = () => {
importFormRef.value.open() // importFormRef.value.open()
} // }
/** 初始化 */ /** 初始化 */
onMounted(() => { onMounted(() => {
@ -214,7 +170,6 @@ onMounted(() => {
} }
</style> </style>
<style scoped> <style scoped>
.el-table--border .el-table__cell { .el-table--border .el-table__cell {
border-right: none; border-right: none;
} }

@ -10,13 +10,13 @@
<!-- 表格分页 --> <!-- 表格分页 -->
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="业务线" name="first"> <el-tab-pane label="业务线" name="first">
<Businesspage /> <Businesspage :data1="data1" :treeId="treeId" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="仓库列表" name="second"> <el-tab-pane label="仓库列表" name="second">
<Warehousepage /> <Warehousepage :data2="data2" :treeId="treeId"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="员工列表" name="third"> <el-tab-pane label="员工列表" name="third">
<Staffpage /> <Staffpage :data3="data3" :treeId="treeId"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-card> </el-card>
@ -40,6 +40,27 @@ import Warehousepage from './warehousepage.vue'
const activeName = ref('first') // const activeName = ref('first') //
const deptName = ref('') const deptName = ref('')
import { defineProps, ref } from 'vue' //props
const props = defineProps({
data1: {
type: Array,
required: true,
},
data2: {
type: Array,
required: true,
},
data3: {
type: Array,
required: true,
},
treeId:{
type: Object,
required: true,
}
});
// console.log(props.treeId)
/** 初始化 */ /** 初始化 */

@ -24,21 +24,15 @@
<el-col :span="21" :xs="24"> <el-col :span="21" :xs="24">
<!-- 根据不同数据导入不同右侧页面 --> <!-- 根据不同数据导入不同右侧页面 -->
<div v-if="queryParams.deptId==100"> <div v-if="queryParams.deptId==100">
<Filiale/> <Filiale :data1="group1" :data2="group2" :data3="group3" :treeId='queryParams' />
</div > </div>
<div v-else-if="queryParams.deptId==101"> <div v-else-if="queryParams.deptId==101">
<Company/> <Company :companydata='listdata' :treeId='queryParams' />
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<!-- 添加或修改用户对话框 -->
<UserForm ref="formRef" @success="getList" />
<!-- 用户导入对话框 -->
<UserImportForm ref="importFormRef" @success="getList" />
<!-- 分配角色 -->
<UserAssignRoleForm ref="assignRoleFormRef" @success="getList" />
</el-card> </el-card>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -50,19 +44,129 @@ import download from '@/utils/download'
import { CommonStatusEnum } from '@/utils/constants' import { CommonStatusEnum } from '@/utils/constants'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { ref } from 'vue' import { ref } from 'vue'
import { List } from 'echarts'
defineOptions({ name: 'SystemUser' }) defineOptions({ name: 'SystemUser' })
import { Filter } from '@element-plus/icons-vue' import { Filter } from '@element-plus/icons-vue'
import { ElTree } from 'element-plus' import { ElTree } from 'element-plus'
import * as DeptApi from '@/api/system/dept' import * as DeptApi from '@/api/system/dept'
import { defaultProps, handleTree } from '@/utils/tree' import { defaultProps, handleTree } from '@/utils/tree'
// defineOptions({ name: 'SystemUserDeptTree' }) import { log } from 'console'
const activeName = ref('first') // const activeName = ref('first') //
const deptName = ref('') const deptName = ref('')
const deptList = ref<Tree[]>([]) // const deptList = ref<Tree[]>([]) //
const treeRef = ref<InstanceType<typeof ElTree>>() const treeRef = ref<InstanceType<typeof ElTree>>()
////////////////////
const tablelist: any = ref([
{
k1: '康宁',
k1b: '1001011',
k2: '商品经理',
k2b: '商品部',
k3: '再生资源事业部-销售组',
k3b: '济钢城市矿产',
k4: '废钢、废铝',
k4b: '济钢城市矿产',
k6: '15896345652',
k7: '2023-09-09 18:24:00',
k8: '30'
},
{
k1: '康宁',
k1b: '2001011',
k2: '商品经理',
k2b: '商品部',
k3: '再生资源事业部-销售组',
k3b: '济钢城市矿产',
k4: '废钢、废铝',
k4b: '济钢城市矿产',
k6: '15896345652',
k7: '2023-09-09 18:24:00',
k8: '30'
},
{
k1: '康宁',
k1b: '3001011',
k2: '商品经理',
k2b: '商品部',
k3: '再生资源事业部-销售组',
k3b: '济钢城市矿产',
k4: '废钢、废铝',
k4b: '济钢城市矿产',
k6: '15896345652',
k7: '2023-09-09 18:24:00',
k8: '30'
}
]) //
//
const listdata: any = ref('')
///////////////
const tablelists: any = ref([
[{
k1: '康宁',
k1b: '1001011',
k2: '商品经理',
k2b: '商品部',
k3: '再生资源事业部-销售组',
k3b: '济钢城市矿产',
k4: '废钢、废铝',
k4b: '济钢城市矿产',
k6: '15896345652',
k7: '2023-09-09 18:24:00',
k8: '30'
}],
[{
k1: '康宁',
k1b: '2001022',
k2: '商品经理',
k2b: '商品部',
k3: '再生资源事业部-销售组',
k3b: '济钢城市矿产',
k4: '废钢、废铝',
k4b: '济钢城市矿产',
k6: '15896345652',
k7: '2023-09-09 18:24:00',
k8: '30'
}],
[{
k1: '康宁',
k1b: '3001033',
k2: '商品经理',
k2b: '商品部',
k3: '再生资源事业部-销售组',
k3b: '济钢城市矿产',
k4: '废钢、废铝',
k4b: '济钢城市矿产',
k6: '15896345652',
k7: '2023-09-09 18:24:00',
k8: '30'
}],
]) //
const group1:any = ref([]);
const group2:any = ref([]);
const group3:any = ref([]);
/** 处理部门被点击 */
const handleDeptNodeClick = async (row) => {
console.log('------------')
queryParams.deptId = row.id
console.log( queryParams.deptId );
listdata.value = [...tablelist.value]
group1.value=[...tablelists.value[0]]
group2.value=[...tablelists.value[1]]
group3.value=[...tablelists.value[2]]
// console.log(' group1.value', group1.value);
// console.log(' group2.value', group2.value);
// console.log(' group3.value', group3.value);
}
/** 获得部门树 */ /** 获得部门树 */
const getTree = async () => { const getTree = async () => {
const res = await DeptApi.getSimpleDeptList() const res = await DeptApi.getSimpleDeptList()
@ -76,12 +180,6 @@ const filterNode = (name: string, data: Tree) => {
return data.name.includes(name) return data.name.includes(name)
} }
/** 处理部门被点击 */
const handleNodeClick = async (row: { [key: string]: any }) => {
emits('node-click', row)
}
const emits = defineEmits(['node-click'])
/** 监听deptName */ /** 监听deptName */
watch(deptName, (val) => { watch(deptName, (val) => {
treeRef.value!.filter(val) treeRef.value!.filter(val)
@ -160,19 +258,6 @@ const resetQuery = () => {
handleQuery() handleQuery()
} }
/** 处理部门被点击 */
const handleDeptNodeClick = async (row) => {
console.log('------------');
queryParams.deptId = row.id
console.log(queryParams.deptId);
await getList()
}
/** 初始化 */ /** 初始化 */
onMounted(() => { onMounted(() => {
getList() getList()

@ -40,7 +40,7 @@
</el-row> </el-row>
<el-row> <el-row>
<!-- 表格 --> <!-- 表格 -->
<el-table stripe :border="true" style="width: 1500px;height: 100%;margin:20px 0;" v-loading="loading" :data="list"> <el-table stripe :border="true" style="width: 1500px;height: 100%;margin:20px 0;" v-loading="loading" :data="data3">
<el-table-column fixed="left" type="selection" /> <el-table-column fixed="left" type="selection" />
<el-table-column fixed="left" sortable label="姓名" width="150" > <el-table-column fixed="left" sortable label="姓名" width="150" >
<template #default="scope"> <template #default="scope">
@ -132,6 +132,19 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref } from 'vue'
const props = defineProps({
data3: {
type: Array,
required: true,
},
treeId: {
type: Object,
required: true,
},
});
console.log(props.treeId);
// const loading = ref(true) // // const loading = ref(true) //
const total = ref(5) // const total = ref(5) //
const queryParams = reactive({ const queryParams = reactive({
@ -171,12 +184,12 @@ const resetQuery = () => {
} }
const list = ref([ // const list = ref([
{k1:'康宁',k1b:'1001011',k2:'商品经理',k2b:'商品部',k3:'再生资源事业部-销售组',k3b:'济钢城市矿产',k4:'废钢、废铝',k4b:'济钢城市矿产',k6:'15896345652',k7:'2023-09-09 18:24:00'}, // {k1:'',k1b:'1001011',k2:'',k2b:'',k3:'-',k3b:'',k4:'',k4b:'',k6:'15896345652',k7:'2023-09-09 18:24:00'},
{k1:'康宁',k1b:'2001011',k2:'商品经理',k2b:'商品部',k3:'再生资源事业部-销售组',k3b:'济钢城市矿产',k4:'废钢、废铝',k4b:'济钢城市矿产',k6:'15896345652',k7:'2023-09-09 18:24:00'}, // {k1:'',k1b:'2001011',k2:'',k2b:'',k3:'-',k3b:'',k4:'',k4b:'',k6:'15896345652',k7:'2023-09-09 18:24:00'},
{k1:'康宁',k1b:'3001011',k2:'商品经理',k2b:'商品部',k3:'再生资源事业部-销售组',k3b:'济钢城市矿产',k4:'废钢、废铝',k4b:'济钢城市矿产',k6:'15896345652',k7:'2023-09-09 18:24:00'}, // {k1:'',k1b:'3001011',k2:'',k2b:'',k3:'-',k3b:'',k4:'',k4b:'',k6:'15896345652',k7:'2023-09-09 18:24:00'},
]) // // ]) //
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

@ -33,7 +33,7 @@
</el-row> </el-row>
<el-row> <el-row>
<!-- 表格 --> <!-- 表格 -->
<el-table stripe :border="true" style="width: 1500px;height: 100%;margin:20px 0;" v-loading="loading" :data="list"> <el-table stripe :border="true" style="width: 1500px;height: 100%;margin:20px 0;" v-loading="loading" :data="data2">
<el-table-column fixed="left" type="selection" /> <el-table-column fixed="left" type="selection" />
<el-table-column fixed="left" label="仓库名称" width="150" > <el-table-column fixed="left" label="仓库名称" width="150" >
<template #default="scope"> <template #default="scope">
@ -78,6 +78,17 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref } from 'vue'
const props = defineProps({
data2: {
type: Array,
required: true,
},
treeId: {
type: Object,
required: true,
},
});
console.log(props.treeId);
// const loading = ref(true) // // const loading = ref(true) //
const total = ref(5) // const total = ref(5) //
@ -118,12 +129,12 @@ const resetQuery = () => {
} }
const list = ref([ // const list = ref([
{k1:'康宁',k1b:'1001011',k2:'商品经理',k2b:'商品部',k3:'再生资源事业部-销售组',k3b:'济钢城市矿产',k4:'废钢、废铝',k4b:'济钢城市矿产',k6:'15896345652',k7:'2023-09-09 18:24:00',k8:'30'}, // {k1:'',k1b:'1001011',k2:'',k2b:'',k3:'-',k3b:'',k4:'',k4b:'',k6:'15896345652',k7:'2023-09-09 18:24:00',k8:'30'},
{k1:'康宁',k1b:'2001011',k2:'商品经理',k2b:'商品部',k3:'再生资源事业部-销售组',k3b:'济钢城市矿产',k4:'废钢、废铝',k4b:'济钢城市矿产',k6:'15896345652',k7:'2023-09-09 18:24:00',k8:'30'}, // {k1:'',k1b:'2001011',k2:'',k2b:'',k3:'-',k3b:'',k4:'',k4b:'',k6:'15896345652',k7:'2023-09-09 18:24:00',k8:'30'},
{k1:'康宁',k1b:'3001011',k2:'商品经理',k2b:'商品部',k3:'再生资源事业部-销售组',k3b:'济钢城市矿产',k4:'废钢、废铝',k4b:'济钢城市矿产',k6:'15896345652',k7:'2023-09-09 18:24:00',k8:'30'}, // {k1:'',k1b:'3001011',k2:'',k2b:'',k3:'-',k3b:'',k4:'',k4b:'',k6:'15896345652',k7:'2023-09-09 18:24:00',k8:'30'},
]) // // ]) //
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

@ -110,12 +110,18 @@
</el-table-column> </el-table-column>
<el-table-column label="商品简称" align="center" prop="shortName" width="150px" /> <el-table-column label="商品简称" align="center" prop="shortName" width="150px" />
<el-table-column label="商品规格" align="center" prop="spec" width="150px" /> <el-table-column label="商品规格" align="center" prop="spec" width="150px" />
<el-table-column label="首选供应商" align="center" prop="1" width="150px" sortable/> <el-table-column label="首选供应商" align="center" prop="supplierName" width="150px" sortable/>
<el-table-column label="商品条码" align="center" prop="barCode" width="150px" sortable/> <el-table-column label="商品条码" align="center" prop="barCode" width="150px" sortable/>
<el-table-column label="配送方式" align="center" prop="deliveryType" width="150px" sortable/> <el-table-column label="配送方式" align="center" prop="deliveryType" width="150px" sortable>
<el-table-column label="关联商品分类id" align="center" prop="productTypeId" width="150px" sortable/> <template #default="scope">
<el-table-column label="商品类目" align="center" prop="areaCategory" width="150px" /> <dict-tag :type="DICT_TYPE.DELIVETRY_TYPE" :value="scope.row.deliveryType" />
</template>
</el-table-column>
<!-- <el-table-column label="关联商品分类id" align="center" prop="productTypeId" width="150px" sortable/> -->
<el-table-column label="关联商品分类id" align="center" prop="categoryName" width="150px" sortable/>
<el-table-column label="商品类目" align="center" prop="parameterName" width="150px" />
<el-table-column label="采购模式" align="center" prop="purchaseMode" width="150px" sortable> <el-table-column label="采购模式" align="center" prop="purchaseMode" width="150px" sortable>
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.PURCHASE_WAY" :value="scope.row.purchaseMode" /> <dict-tag :type="DICT_TYPE.PURCHASE_WAY" :value="scope.row.purchaseMode" />
@ -127,17 +133,26 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="品牌id" align="center" prop="brandId" width="150px" /> <!-- <el-table-column label="品牌id" align="center" prop="brandId" width="150px" /> -->
<el-table-column label="生命周期" align="center" prop="1" width="150px" /> <el-table-column label="品牌" align="center" prop="brandName" width="150px" />
<el-table-column label="销售状态" align="center" prop="1" width="150px" sortable/> <el-table-column label="生命周期" align="center" prop="lifeCycle" width="150px" >
<template #default="scope">
<dict-tag :type="DICT_TYPE.LIFE_CYCLE" :value="scope.row.lifeCycle" />
</template>
</el-table-column>
<el-table-column label="销售状态" align="center" prop="salesStatus" width="150px" sortable>
<template #default="scope">
<dict-tag :type="DICT_TYPE.SALES_STATUS" :value="scope.row.salesStatus" />
</template>
</el-table-column>
<!-- <el-table-column label="更新者" align="center" prop="updater" width="150px" /> <!-- <el-table-column label="更新者" align="center" prop="updater" width="150px" />
<el-table-column label="更新时间" align="center" prop="updateTime" :formatter="dateFormatter" width="150px" /> --> <el-table-column label="更新时间" align="center" prop="updateTime" :formatter="dateFormatter" width="150px" /> -->
<el-table-column label="更新时间" align="center" prop="updateTime" width="150px"> <el-table-column label="更新时间" align="center" prop="updateTime" width="150px">
<template #default="scope"> <template #default="scope">
<el-row> <el-row>
<el-col :span="24">{{ scope.row.updater }}</el-col> <el-col :span="24">{{ scope.row.nickname }}</el-col>
<el-col :span="24" style="font-size: 12px;color: #999999;"> <el-col :span="24" style="font-size: 12px;color: #999999;">
{{ dayjs(scope.row.updateTime).format('YYYY-MM-DD HH:mm:ss') }} {{ dayjs(scope.row.updateTime).format('YYYY-MM-DD HH:mm:ss') }}
</el-col> </el-col>
@ -204,9 +219,16 @@ let queryParams: any = reactive({
spec: null, spec: null,
inventoryType: null, inventoryType: null,
brandId: null, brandId: null,
brandName: null,
lifeCycle: null,
salesStatus: null,
supplierName: null,
nickname: null,
area: null, area: null,
productTypeId: null, productTypeId: null,
categoryName: null,
areaCategory: null, areaCategory: null,
parameterName: null,
dangerousFlag: null, dangerousFlag: null,
importedFlag: null, importedFlag: null,
firstSupplierId: null, firstSupplierId: null,
@ -292,7 +314,8 @@ const handleSelectionChange = (val) => {
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
try { try {
const data = await ProductApi.getProductPage(queryParams) // const data = await ProductApi.getProductPage(queryParams)
const data = await ProductApi.getProductPage1(queryParams)
list.value = data.list list.value = data.list
total.value = data.total total.value = data.total
} finally { } finally {

@ -37,8 +37,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="商品分类" prop="calssify"> <el-form-item label="商品分类" prop="categoryName">
<el-input v-model="queryParams.shortName1" placeholder="请输入商品分类" clearable <el-input v-model="queryParams.categoryName" placeholder="请输入商品分类" clearable
@keyup.enter="handleQuery" style="width: 100%;" /> @keyup.enter="handleQuery" style="width: 100%;" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -46,22 +46,22 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="商品品牌" prop="brandId"> <el-form-item label="商品品牌" prop="brandName">
<el-input v-model="queryParams.shortName1" placeholder="请输入商品品牌" clearable <el-input v-model="queryParams.brandName" placeholder="请输入商品品牌" clearable
@keyup.enter="handleQuery" style="width: 100%;" /> @keyup.enter="handleQuery" style="width: 100%;" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="商品类目" prop="areaCategory"> <el-form-item label="商品类目" prop="parameterName">
<el-input v-model="queryParams.areaCategory" placeholder="请输入商品类目" clearable <el-input v-model="queryParams.parameterName" placeholder="请输入商品类目" clearable
@keyup.enter="handleQuery" style="width: 100%;" /> @keyup.enter="handleQuery" style="width: 100%;" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="首选供应商" prop="inventoryType"> <el-form-item label="首选供应商" prop="supplierName">
<el-input v-model="queryParams.shortName1" placeholder="请输入首选供应商" clearable <el-input v-model="queryParams.supplierName" placeholder="请输入首选供应商" clearable
@keyup.enter="handleQuery" style="width: 100%;" /> @keyup.enter="handleQuery" style="width: 100%;" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -76,8 +76,8 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="商品来源" prop="inventoryType1"> <el-form-item label="商品来源(未完成)" prop="inventoryType1">
<el-select v-model="queryParams.inventoryType1" placeholder="请选择" style="width: 100%;"> <el-select v-model="queryParams.inventoryType1" placeholder="请选择(未完成)" style="width: 100%;">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.DELIVERY_TYPE1)" :key="dict.value" <el-option v-for="dict in getIntDictOptions(DICT_TYPE.DELIVERY_TYPE1)" :key="dict.value"
:label="dict.label" :value="dict.value" /> :label="dict.label" :value="dict.value" />
</el-select> </el-select>
@ -121,8 +121,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="归属人员" prop="creator"> <el-form-item label="归属人员(未完成)" prop="creator">
<el-select v-model="queryParams.creator" placeholder="请选择" style="width: 100%;"> <el-select v-model="queryParams.creator" placeholder="请选择(未完成)" style="width: 100%;">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.creator)" :key="dict.value" <el-option v-for="dict in getIntDictOptions(DICT_TYPE.creator)" :key="dict.value"
:label="dict.label" :value="dict.value" /> :label="dict.label" :value="dict.value" />
</el-select> </el-select>
@ -155,7 +155,7 @@
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="lifeCycle" label="生命周期" > <el-form-item prop="lifeCycle" label="生命周期(未完成)" >
<el-checkbox v-model="queryParams.lifeCycle" label="新品" /> <el-checkbox v-model="queryParams.lifeCycle" label="新品" />
<el-checkbox v-model="queryParams.lifeCycle" label="正常" /> <el-checkbox v-model="queryParams.lifeCycle" label="正常" />
<el-checkbox v-model="queryParams.lifeCycle" label="停够" /> <el-checkbox v-model="queryParams.lifeCycle" label="停够" />
@ -170,7 +170,7 @@
<template #footer> <template #footer>
<div class="xy-footer"> <div class="xy-footer">
<el-button type="primary" :icon="Search" @click="handleQuery"></el-button> <el-button type="primary" :icon="Search" @click="handleQuery"></el-button>
<el-button :icon="RefreshLeft">重置</el-button> <el-button :icon="RefreshLeft" @click="resetQuery" >重置</el-button>
</div> </div>
</template> </template>
</el-drawer> </el-drawer>
@ -194,6 +194,12 @@ const doClose = () => {
const handleQuery = () => { const handleQuery = () => {
emit('doSearch', queryParams) emit('doSearch', queryParams)
} }
/** 重置按钮操作 */
const resetQuery = () => {
// queryFormRef.value.resetFields()
handleQuery()
}
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@ -283,7 +289,12 @@ const queryParams = reactive({
reservedFields5: null, reservedFields5: null,
reservedFields6: null, reservedFields6: null,
createTime: [], createTime: [],
updateTime: [] updateTime: [],
categoryName: null,
brandName: null,
parameterName: null,
supplierName: null,
lifeCycle: null,
}) })
</script> </script>

@ -0,0 +1,478 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-row :gutter="20">
<!-- 左侧部门树 -->
<el-col :span="8" :xs="24">
<ContentWrap class="h-1/1">
<DeptTree @node-click="handleDeptNodeClick" />
</ContentWrap>
</el-col>
<el-col :span="16" :xs="24">
<!-- 搜索 -->
<ContentWrap>
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="用户名称" prop="username">
<el-input
v-model="queryParams.username"
placeholder="请输入用户名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="手机号码" prop="mobile">
<el-input
v-model="queryParams.mobile"
placeholder="请输入手机号码"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="用户状态"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" />搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" />重置</el-button>
<!-- <el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['system:user:create']"
>
<Icon icon="ep:plus" /> 新增
</el-button>
<el-button
type="warning"
plain
@click="handleImport"
v-hasPermi="['system:user:import']"
>
<Icon icon="ep:upload" /> 导入
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['system:user:export']"
>
<Icon icon="ep:download" />导出
</el-button> -->
</el-form-item>
</el-form>
</ContentWrap>
<ContentWrap>
<el-table v-loading="loading" :data="list" @current-change="clickChange">
<el-table-column align="center" width="40px">
<template #default="scope">
<el-radio v-model="tableRadio" :label="scope.row">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column label="用户编号" align="center" key="id" prop="id" />
<el-table-column
label="用户名称"
align="center"
prop="username"
:show-overflow-tooltip="true"
/>
<el-table-column
label="用户昵称"
align="center"
prop="nickname"
:show-overflow-tooltip="true"
/>
<el-table-column
label="部门"
align="center"
key="deptName"
prop="dept.name"
:show-overflow-tooltip="true"
/>
<el-table-column label="手机号码" align="center" prop="mobile" width="120" />
<el-table-column label="状态" key="status">
<template #default="scope">
<el-switch
v-model="scope.row.status"
:active-value="0"
:inactive-value="1"
@change="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180"
/>
<!-- <el-table-column label="操作" align="center" width="160">
<template #default="scope">
<div class="flex items-center justify-center">
<el-button
type="primary"
link
@click="openForm('update', scope.row.id)"
v-hasPermi="['system:user:update']"
>
<Icon icon="ep:edit" />修改
</el-button>
<el-dropdown
@command="(command) => handleCommand(command, scope.row)"
v-hasPermi="[
'system:user:delete',
'system:user:update-password',
'system:permission:assign-user-role'
]"
>
<el-button type="primary" link><Icon icon="ep:d-arrow-right" /> 更多</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item
command="handleDelete"
v-if="checkPermi(['system:user:delete'])"
>
<Icon icon="ep:delete" />删除
</el-dropdown-item>
<el-dropdown-item
command="handleResetPwd"
v-if="checkPermi(['system:user:update-password'])"
>
<Icon icon="ep:key" />重置密码
</el-dropdown-item>
<el-dropdown-item
command="handleRole"
v-if="checkPermi(['system:permission:assign-user-role'])"
>
<Icon icon="ep:circle-check" />分配角色
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</template>
</el-table-column> -->
</el-table>
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
</el-col>
</el-row>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script lang="ts" setup>
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { checkPermi } from '@/utils/permission'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { CommonStatusEnum } from '@/utils/constants'
import * as UserApi from '@/api/system/user'
import DeptTree from '@/views/system/user/DeptTree.vue'
defineOptions({ name: 'SystemUser' })
const message = useMessage() //
const { t } = useI18n() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
username: undefined,
mobile: undefined,
status: undefined,
deptId: undefined,
createTime: []
})
const tableRadio = ref(null)
const clickChange = (item) => {
tableRadio.value = item
}
const queryFormRef = ref() //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await UserApi.getUserPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields()
handleQuery()
}
/** 处理部门被点击 */
const handleDeptNodeClick = async (row) => {
queryParams.deptId = row.id
await getList()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 修改用户状态 */
const handleStatusChange = async (row: UserApi.UserVO) => {
try {
//
const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
await message.confirm('确认要"' + text + '""' + row.username + '"用户吗?')
//
await UserApi.updateUserStatus(row.id, row.status)
//
await getList()
} catch {
//
row.status =
row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
}
}
/** 导出按钮操作 */
const exportLoading = ref(false)
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await UserApi.exportUser(queryParams)
download.excel(data, '用户数据.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 操作分发 */
const handleCommand = (command: string, row: UserApi.UserVO) => {
switch (command) {
case 'handleDelete':
handleDelete(row.id)
break
case 'handleResetPwd':
handleResetPwd(row)
break
case 'handleRole':
handleRole(row)
break
default:
break
}
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await UserApi.deleteUser(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 重置密码 */
const handleResetPwd = async (row: UserApi.UserVO) => {
try {
//
const result = await message.prompt(
'请输入"' + row.username + '"的新密码',
t('common.reminder')
)
const password = result.value
//
await UserApi.resetUserPwd(row.id, password)
message.success('修改成功,新密码是:' + password)
} catch {}
}
/** 分配角色 */
const assignRoleFormRef = ref()
const handleRole = (row: UserApi.UserVO) => {
assignRoleFormRef.value.open(row)
}
/** 打开弹窗 */
const open = async () => {
getList()
dialogVisible.value = true
dialogTitle.value = t('action.' + 'create')
formType.value = 'create'
//
}
defineExpose({ open }) // open
/** 初始化 */
onMounted(() => {
getList()
})
const emit = defineEmits(['success']) // success
const submitForm = async () => {
console.log('4444444', tableRadio);
if(tableRadio.value == null){
message.error('请选择人员')
return
}
formLoading.value = true
try {
dialogVisible.value = false
emit('confirm', tableRadio.value);
} finally {
formLoading.value = false
}
}
</script>
<!--
<script setup lang="ts" name="BusinessWarehouse">
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import * as BusinessWarehouseApi from '@/api/xxjj/businessWarehouse'
const message = useMessage() //
const { t } = useI18n() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
businessCode: null,
name: null,
businessSimple: null,
businessLogo: null,
parentId: null,
type: null,
status: null,
institutionNum: null,
employeeNum: null,
industry: null,
city: null,
establishDate: [],
belongUserId: null,
brandName: null,
phone: null,
diffFlag: null,
fax: null,
url: null,
description: null,
createTime: []
})
const queryFormRef = ref() //
const multipleSelection = ref()
const handleSelectionChange = (val) => {
multipleSelection.value = val
}
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await BusinessWarehouseApi.getBusinessWarehousePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
</script>
<style lang="scss">
.xy-table thead {
color: #1D2129;
}
.xy-table thead th.el-table__cell {
background-color: #F7F8FA;
}
.xy-table.is-scrolling-left th.el-table-fixed-column--left {
background-color: #F7F8FA;
}
</style>
-->

@ -0,0 +1,185 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<!-- 搜索工作栏 -->
<el-row>
<el-col :span="24">
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-row>
<el-col :span="21">
<el-form-item label="" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入业务线名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<!-- <el-button type="primary" link :icon="Filter" @click="doShowDrawerFilterA(true)"></el-button> -->
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-col>
</el-row>
<el-row>
<el-col :span="24" style="margin: 10px 0px;">
<!-- 列表 -->
<el-table v-loading="loading" :data="list" :border="true" :stripe="true" :show-overflow-tooltip="true"
class="xy-table" @selection-change="handleSelectionChange" >
<el-table-column fixed type="selection" width="40px" />
<el-table-column label="业务线名称" fixed align="center" prop="name" width="150px"/>
<el-table-column label="类型" align="center" prop="type" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.BUSINESS_TYPE" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" width="150px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CLASS_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="描述" align="center" prop="description" width="200px"/>
<el-table-column
label="更新时间"
align="center"
prop="updateTime"
:formatter="dateFormatter"
width="150px"
/>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts" name="BusinessWarehouse">
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import * as BusinessWarehouseApi from '@/api/xxjj/businessWarehouse'
const message = useMessage() //
const { t } = useI18n() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
businessCode: null,
name: null,
businessSimple: null,
businessLogo: null,
parentId: null,
type: null,
status: null,
institutionNum: null,
employeeNum: null,
industry: null,
city: null,
establishDate: [],
belongUserId: null,
brandName: null,
phone: null,
diffFlag: null,
fax: null,
url: null,
description: null,
createTime: []
})
const queryFormRef = ref() //
const multipleSelection = ref()
const handleSelectionChange = (val) => {
multipleSelection.value = val
}
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await BusinessWarehouseApi.getBusinessWarehousePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
const emit = defineEmits(['success']) // success
const submitForm = async () => {
console.log('4444444', multipleSelection);
if(multipleSelection.value == undefined || multipleSelection.value.length < 1){
message.error(t('common.createSuccess'))
return
}
//
formLoading.value = true
try {
dialogVisible.value = false
//
emit('confirm', multipleSelection);
} finally {
formLoading.value = false
}
}
/** 打开弹窗 */
const open = async () => {
getList()
dialogVisible.value = true
dialogTitle.value = t('action.' + 'create')
formType.value = 'create'
//
}
defineExpose({ open }) // open
</script>
<style lang="scss">
.xy-table thead {
color: #1D2129;
}
.xy-table thead th.el-table__cell {
background-color: #F7F8FA;
}
.xy-table.is-scrolling-left th.el-table-fixed-column--left {
background-color: #F7F8FA;
}
</style>

@ -0,0 +1,154 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<!-- <el-form-item label="业务id" prop="businessId">
<el-input v-model="formData.businessId" placeholder="请输入业务id" />
</el-form-item> -->
<!-- <el-form-item label="业务类型(0客户 1供应商 2服务商)" prop="businessType">
<el-select v-model="formData.businessType" placeholder="请选择业务类型(0客户 1供应商 2服务商)">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item> -->
<el-form-item label="联系人类型" prop="contactsType">
<el-select v-model="formData.contactsType" placeholder="请选择联系人类型">
<el-option label="默认" value="1" />
<el-option label="联系人" value="2" />
</el-select>
</el-form-item>
<!-- <el-form-item label="是否星标" prop="asteriskType">
<el-select v-model="formData.asteriskType" placeholder="请选择是否星标">
<el-option label="否" value="0" />
<el-option label="是" value="1" />
</el-select>
</el-form-item> -->
<!-- <el-form-item label="标记颜色" prop="markColor">
<el-input v-model="formData.markColor" placeholder="请输入标记颜色" />
</el-form-item> -->
<el-form-item label="姓名" prop="name">
<el-input v-model="formData.name" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="公司" prop="companyName">
<el-input v-model="formData.companyName" placeholder="请输入公司" />
</el-form-item>
<el-form-item label="职务" prop="position">
<el-input v-model="formData.position" placeholder="请输入职务" />
</el-form-item>
<el-form-item label="手机" prop="mobile">
<el-input v-model="formData.mobile" placeholder="请输入手机" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="formData.phone" placeholder="请输入电话" />
</el-form-item>
<el-form-item label="邮箱" prop="emaile">
<el-input v-model="formData.emaile" placeholder="请输入邮箱" />
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input v-model="formData.address" placeholder="请输入地址" />
</el-form-item>
<el-form-item label="附件">
<UploadFile v-model="formData.annex" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData:any = ref({
id: undefined,
businessId: undefined,
businessType: undefined,
contactsType: undefined,
asteriskType: undefined,
markColor: undefined,
name: undefined,
companyName: undefined,
position: undefined,
mobile: undefined,
phone: undefined,
emaile: undefined,
address: undefined,
editIndex: undefined,
annex: undefined
})
const formRules = reactive({
name: [{ required: true, message: '业务id不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
const editIndex = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, index: number, row?: any) => {
if(index != undefined){
editIndex.value = index
}
debugger
resetForm()
if(row != undefined){
formData.value = row
}
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return
//
formLoading.value = true
try {
const data = formData.value
data.editIndex = editIndex;
dialogVisible.value = false
//
emit('confirm', data);
} finally {
formLoading.value = false
editIndex.value = undefined
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
businessId: undefined,
businessType: undefined,
contactsType: undefined,
asteriskType: undefined,
markColor: undefined,
name: undefined,
companyName: undefined,
position: undefined,
mobile: undefined,
phone: undefined,
emaile: undefined,
address: undefined,
editIndex: undefined,
annex: undefined
}
formRef.value?.resetFields()
}
</script>

@ -0,0 +1,128 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="代表人类型" prop="representativeType">
<el-select v-model="formData.representativeType" placeholder="请选择代表人类型" :disabled="true">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.representative_type)" :key="dict.value" :label="dict.label" :value="dict.value.toString()" />
</el-select>
</el-form-item>
<el-form-item label="证件照正面" prop="idCardPhoto1">
<UploadImg v-model="formData.idCardPhoto1" />
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="formData.name" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="formData.idCard" placeholder="请输入身份证号" />
</el-form-item>
<el-form-item label="证件有效期" prop="idCard">
<el-date-picker v-model="formData.defaultTimeOperate" type="daterange" start-placeholder="" end-placeholder=""
:default-time="formData.defaultTimeOperate" />
</el-form-item>
<el-form-item label="描述" prop="description">
<el-input v-model="formData.description" type="textarea" placeholder="请输入任务描述" />
</el-form-item>
<el-form-item label="证件照反面" prop="idCardPhoto2">
<UploadImg v-model="formData.idCardPhoto2" />
</el-form-item>
<el-form-item label="手持证件照" prop="idCardPhoto3">
<UploadImg v-model="formData.idCardPhoto3" />
</el-form-item>
<el-form-item label="授权/证明文件" prop="authorizeFiles">
<UploadFile v-model="formData.authorizeFiles" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import * as SubjectFollowReportApi from '@/api/xxjj/subjectFollowReport'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
businessId: undefined,
businessType: undefined,
representativeType: undefined,
representativeTypeName: undefined,
idCardPhoto1: undefined,
idCardPhoto2: undefined,
idCardPhoto3: undefined,
followTime: undefined,
name: undefined,
idCard: undefined,
defaultTimeOperate: undefined,
description: undefined,
authorizeFiles: undefined,
})
const formRules = reactive({
name: [{ required: true, message: '业务id不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (row?: any) => {
formData.value = row
dialogVisible.value = true
dialogTitle.value = t('action.' + 'create')
formType.value = 'create'
//
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return
//
formLoading.value = true
try {
const data = formData.value as unknown as SubjectFollowReportApi.SubjectFollowReportVO
dialogVisible.value = false
//
emit('confirm', data);
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
businessId: undefined,
businessType: undefined,
representativeTypeName: undefined,
representativeType: undefined,
idCardPhoto1: undefined,
idCardPhoto2: undefined,
idCardPhoto3: undefined,
followTime: undefined,
name: undefined,
idCard: undefined,
defaultTimeOperate: undefined,
description: undefined,
authorizeFiles: undefined,
}
formRef.value?.resetFields()
}
</script>

@ -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>

@ -0,0 +1,255 @@
<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>
<div>
<el-form-item label="信用等级:" prop="k1">
<div style="width: 100%;">
<el-radio-group>
<el-radio label="1">一星客户</el-radio>
<el-radio label="2">二星客户</el-radio>
<el-radio label="3">三星客户</el-radio>
<el-radio label="4">四星客户</el-radio>
<el-radio label="5">五星客户</el-radio>
</el-radio-group>
</div>
<div style="width: 50%;color: #999999;border-bottom: solid 1px #999999;">设置客户的信用评级</div>
</el-form-item>
</div>
<div>
<el-form-item label="开启自动评级:" prop="k1">
<div style="width: 100%;">
<el-radio-group>
<el-radio label="1">开启</el-radio>
<el-radio label="2">关闭</el-radio>
</el-radio-group>
</div>
<div style="width: 50%;color: #999999;border-bottom: solid 1px #999999;">开启后系统会根据信用规则自动定期进行评级</div>
</el-form-item>
</div>
</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>
<div>
<el-form-item label="应收款项限制:">
<div style="width: 100%;">
<div style="float: left;">应收款项超过</div>
<div style="float: left;"><el-input style="width:80px;margin: 0px 5px;" placeholder="输入金额" />
</div>
<div style="float: left;">万元开启预警超过</div>
<div style="float: left;"><el-input style="width:80px;margin: 0px 5px;" placeholder="输入金额" /></div>
<div style="float: left;">万元禁止下单</div>
</div>
<div style="width: 50%; color: #999999;border-bottom: solid 1px #999999;">
修改后立即生效后续交易按照新规则执行
</div>
</el-form-item>
</div>
<div>
<el-form-item label="订单量限制:">
<div style="width: 100%;">
<div style="float: left;"><el-input style="width:160px;margin: 0px 5px;" placeholder="最低"><template
#append></template></el-input>
</div>
<div style="float: left;"></div>
<div style="float: left;"><el-input style="width:160px;margin: 0px 5px;" placeholder="最高"><template
#append></template></el-input></div>
</div>
<div style="width: 50%; color: #999999;border-bottom: solid 1px #999999;">
同时存在的订单量
</div>
</el-form-item>
</div>
<div>
<el-form-item label="应收款项逾期限制:">
<div style="width: 100%;">
<div style="float: left;">应收款项临近账期</div>
<div style="float: left;"><el-input style="width:160px;margin: 0px 5px;" placeholder="最高"><template
#append></template></el-input>
</div>
<div style="float: left;">开启临期预警超期1天开启逾期预警应收款项逾期超过</div>
<div style="float: left;"><el-input style="width:80px;margin: 0px 5px;" placeholder="输入天数"></el-input>
</div>
<div style="float: left;">禁止下单</div>
</div>
<div style="width: 50%; color: #999999;border-bottom: solid 1px #999999;">
修改后立即生效后续交易按照新规则执行
</div>
</el-form-item>
</div>
<div>
<el-form-item label="完税证明超时限制:">
<div style="width: 100%;">
<div style="float: left;">完税证明超过每月10号开启催促预警完税证明超过每月15号</div>
<div style="float: left;"><el-input style="width:80px;margin: 0px 5px;" placeholder="输入天数"></el-input>
</div>
<div style="float: left;">开启超期超过</div>
<div style="float: left;"><el-input style="width:80px;margin: 0px 5px;" placeholder="输入天数"></el-input>
</div>
<div style="float: left;">禁止下单</div>
</div>
<div style="width: 50%; color: #999999;border-bottom: solid 1px #999999;">
修改后立即生效后续交易按照新规则执行
</div>
</el-form-item>
</div>
</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 label="生效时间">
<template #default="scope">
<span>{{ scope.row.k2a }}</span><span style="margin: 0px 5px;"></span><span>{{ scope.row.k2b
}}</span>
</template>
</el-table-column>
<el-table-column prop="k3" label="库存单位" />
<el-table-column label="销售单位" prop="k4"></el-table-column>
<el-table-column label="最小订货量" prop="k5"></el-table-column>
<el-table-column label="最大订货量" prop="k6"></el-table-column>
<el-table-column label="订货倍数" prop="k7"></el-table-column>
<el-table-column label="允许超收比例" prop="k8"></el-table-column>
<el-table-column label="起订金额(¥)" prop="k9"></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>
<el-table-column prop="k3" label="配送方式" />
<el-table-column prop="k4" label="运输方式">
</el-table-column>
<el-table-column label="承运商" prop="k5"></el-table-column>
<el-table-column label="生效时间">
<template #default="scope">
<span>{{ scope.row.k6a }}</span><span style="margin: 0px 5px;"></span><span>{{ scope.row.k6b
}}</span>
</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>
<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="ServiceCfg">
import { Link, Edit, Delete } from '@element-plus/icons-vue'
const listA: any = ref([
{
k1: '',
k2a: '2023-12-12',
k2b: '2023-10-11',
k3: '',
k4: '',
k5: '',
k6: '',
k7: '',
k8: '',
k9: ''
},
{
k1: '',
k2a: '2023-12-12',
k2b: '2023-10-11',
k3: '',
k4: '',
k5: '',
k6: '',
k7: '',
k8: '',
k9: ''
}
])
const listB: any = ref([
{
k1: '仓库名称',
k2: '默认',
k3: '仓配',
k4: '公路',
k5: '',
k6a: '2023-12-12',
k6b: '2023-10-11'
},
{
k1: '仓库名称',
k2: '--',
k3: '仓配',
k4: '铁路',
k5: '',
k6a: '2023-12-12',
k6b: '2023-10-11'
},
{
k1: '仓库名称',
k2: '--',
k3: '仓配',
k4: '空运',
k5: '',
k6a: '2023-12-12',
k6b: '2023-10-11'
}
])
/** 业务配置初始化 **/
onMounted(() => {
})
</script>
<style lang="scss">
@import '@/styles/cus.scss';
</style>

@ -42,9 +42,21 @@
<el-form-item label="关联客户" prop="businessId"> <el-form-item label="关联客户" prop="businessId">
<el-input v-model="formData.businessId" placeholder="请输入客户" /> <el-input v-model="formData.businessId" placeholder="请输入客户" />
</el-form-item> </el-form-item>
<el-form-item label="负责人员" prop="responsible">
<el-input v-model="formData.responsible" placeholder="请输入负责人员" /> <el-form-item prop="responsible" label="负责人员">
<el-input
v-model="formData.responsibleName"
placeholder="归属人员" disabled
class="input-with-select"
>
<template #append>
<el-button :icon="search" @click="openForm4()" />
</template>
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="参与人员" prop="partake"> <el-form-item label="参与人员" prop="partake">
<el-input v-model="formData.partake" placeholder="请输入参与人员" /> <el-input v-model="formData.partake" placeholder="请输入参与人员" />
</el-form-item> </el-form-item>
@ -83,9 +95,11 @@
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
</template> </template>
</Dialog> </Dialog>
<BelonePeopleList ref="BelonePeopleFormformRef" @confirm="handleConfirm4" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import * as SubjectFollowManagementApi from '@/api/xxjj/subjectFollowManagement' import * as SubjectFollowManagementApi from '@/api/xxjj/subjectFollowManagement'
import BelonePeopleList from '../BelonePeopleList.vue'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -103,6 +117,7 @@ const formData = ref({
startTime: undefined, startTime: undefined,
endTime: undefined, endTime: undefined,
responsible: undefined, responsible: undefined,
responsibleName: undefined,
partake: undefined, partake: undefined,
mark: undefined, mark: undefined,
urgency: undefined, urgency: undefined,
@ -114,7 +129,15 @@ const formRules = reactive({
businessId: [{ required: true, message: '业务id不能为空', trigger: 'blur' }] businessId: [{ required: true, message: '业务id不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
const handleConfirm4=(selectData) =>{
console.log('已选择并传递的数据',selectData);
formData.value.responsible = selectData.id;
formData.value.responsibleName = selectData.nickname;
}
const BelonePeopleFormformRef = ref()
const openForm4 = () => {
BelonePeopleFormformRef.value.open()
}
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
dialogVisible.value = true dialogVisible.value = true
@ -172,6 +195,7 @@ const resetForm = () => {
startTime: undefined, startTime: undefined,
endTime: undefined, endTime: undefined,
responsible: undefined, responsible: undefined,
responsibleName: undefined,
partake: undefined, partake: undefined,
mark: undefined, mark: undefined,
urgency: undefined, urgency: undefined,

@ -0,0 +1,157 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="业务id" prop="businessId">
<el-input v-model="formData.businessId" placeholder="请输入业务id" />
</el-form-item>
<el-form-item label="业务类型(0客户 1供应商 2服务商)" prop="businessType">
<el-select v-model="formData.businessType" placeholder="请选择业务类型(0客户 1供应商 2服务商)">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="联系人类型(0默认 1联系人)" prop="contactsType">
<el-select v-model="formData.contactsType" placeholder="请选择联系人类型(0默认 1联系人)">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="是否星标(0否 1是)" prop="asteriskType">
<el-select v-model="formData.asteriskType" placeholder="请选择是否星标(0否 1是)">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="标记颜色" prop="markColor">
<el-input v-model="formData.markColor" placeholder="请输入标记颜色" />
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="formData.name" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="公司" prop="companyName">
<el-input v-model="formData.companyName" placeholder="请输入公司" />
</el-form-item>
<el-form-item label="职务" prop="position">
<el-input v-model="formData.position" placeholder="请输入职务" />
</el-form-item>
<el-form-item label="手机" prop="mobile">
<el-input v-model="formData.mobile" placeholder="请输入手机" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="formData.phone" placeholder="请输入电话" />
</el-form-item>
<el-form-item label="邮箱" prop="emaile">
<el-input v-model="formData.emaile" placeholder="请输入邮箱" />
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input v-model="formData.address" placeholder="请输入地址" />
</el-form-item>
<el-form-item label="附件">
<UploadFile v-model="formData.annex" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import * as SubjectContactsApi from '@/api/xxjj/subjectContacts'
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
businessId: undefined,
businessType: undefined,
contactsType: undefined,
asteriskType: undefined,
markColor: undefined,
name: undefined,
companyName: undefined,
position: undefined,
mobile: undefined,
phone: undefined,
emaile: undefined,
address: undefined,
annex: undefined
})
const formRules = reactive({
businessId: [{ required: true, message: '业务id不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await SubjectContactsApi.getSubjectContacts(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return
//
formLoading.value = true
try {
const data = formData.value as unknown as SubjectContactsApi.SubjectContactsVO
if (formType.value === 'create') {
await SubjectContactsApi.createSubjectContacts(data)
message.success(t('common.createSuccess'))
} else {
await SubjectContactsApi.updateSubjectContacts(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
businessId: undefined,
businessType: undefined,
contactsType: undefined,
asteriskType: undefined,
markColor: undefined,
name: undefined,
companyName: undefined,
position: undefined,
mobile: undefined,
phone: undefined,
emaile: undefined,
address: undefined,
annex: undefined
}
formRef.value?.resetFields()
}
</script>

@ -0,0 +1,310 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="业务id" prop="businessId">
<el-input
v-model="queryParams.businessId"
placeholder="请输入业务id"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="业务类型(0客户 1供应商 2服务商)" prop="businessType">
<el-select
v-model="queryParams.businessType"
placeholder="请选择业务类型(0客户 1供应商 2服务商)"
clearable
class="!w-240px"
>
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="联系人类型(0默认 1联系人)" prop="contactsType">
<el-select
v-model="queryParams.contactsType"
placeholder="请选择联系人类型(0默认 1联系人)"
clearable
class="!w-240px"
>
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="是否星标(0否 1是)" prop="asteriskType">
<el-select
v-model="queryParams.asteriskType"
placeholder="请选择是否星标(0否 1是)"
clearable
class="!w-240px"
>
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="标记颜色" prop="markColor">
<el-input
v-model="queryParams.markColor"
placeholder="请输入标记颜色"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="公司" prop="companyName">
<el-input
v-model="queryParams.companyName"
placeholder="请输入公司"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="职务" prop="position">
<el-input
v-model="queryParams.position"
placeholder="请输入职务"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="手机" prop="mobile">
<el-input
v-model="queryParams.mobile"
placeholder="请输入手机"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入电话"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="邮箱" prop="emaile">
<el-input
v-model="queryParams.emaile"
placeholder="请输入邮箱"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input
v-model="queryParams.address"
placeholder="请输入地址"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['xxjj:subject-contacts:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['xxjj:subject-contacts:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="序号" type="index" width="70px" />
<el-table-column label="主键id" align="center" prop="id" width="150px"/>
<el-table-column label="业务id" align="center" prop="businessId" width="150px"/>
<el-table-column label="业务类型(0客户 1供应商 2服务商)" align="center" prop="businessType" width="150px"/>
<el-table-column label="联系人类型(0默认 1联系人)" align="center" prop="contactsType" width="150px"/>
<el-table-column label="是否星标(0否 1是)" align="center" prop="asteriskType" width="150px"/>
<el-table-column label="标记颜色" align="center" prop="markColor" width="150px"/>
<el-table-column label="姓名" align="center" prop="name" width="150px"/>
<el-table-column label="公司" align="center" prop="companyName" width="150px"/>
<el-table-column label="职务" align="center" prop="position" width="150px"/>
<el-table-column label="手机" align="center" prop="mobile" width="150px"/>
<el-table-column label="电话" align="center" prop="phone" width="150px"/>
<el-table-column label="邮箱" align="center" prop="emaile" width="150px"/>
<el-table-column label="地址" align="center" prop="address" width="150px"/>
<el-table-column label="附件" align="center" prop="annex" width="150px"/>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="150px"
/>
<el-table-column label="操作" align="center" width="150px">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['xxjj:subject-contacts:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['xxjj:subject-contacts:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<SubjectContactsForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts" name="SubjectContacts">
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as SubjectContactsApi from '@/api/xxjj/subjectContacts'
import SubjectContactsForm from './SubjectContactsForm.vue'
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
businessId: null,
businessType: null,
contactsType: null,
asteriskType: null,
markColor: null,
name: null,
companyName: null,
position: null,
mobile: null,
phone: null,
emaile: null,
address: null,
annex: null,
createTime: []
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await SubjectContactsApi.getSubjectContactsPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SubjectContactsApi.deleteSubjectContacts(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SubjectContactsApi.exportSubjectContacts(queryParams)
download.excel(data, '主体联系人.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>

@ -48,7 +48,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, defineExpose } from 'vue' import { ref, defineExpose } from 'vue'
import { Search , Close } from '@element-plus/icons-vue' import { Search , Close } from '@element-plus/icons-vue'
import * as UserApi from '@/api/system/user'
import { defineProps, defineEmits } from 'vue' import { defineProps, defineEmits } from 'vue'
const props = defineProps(['selectedData']) // const props = defineProps(['selectedData']) //
@ -92,55 +92,12 @@ let handleCheckChange = (data: any, checked: boolean) => {
// //
let initAdd = () => { let initAdd = async () => {
openDialog.value = true openDialog.value = true
treeData.value = await UserApi.getUserDeptCompanyListuser()
// //
treeData.value = [
{
label: 'xx公司',
id: '1',
children: [
{
label: '董事长',
id: '1-1',
},
{
label: '技术部',
id: '1-2',
children: [
{
label: '工程师1',
id: '1-2-1',
},
{
label: '工程师2',
id: '1-2-2',
},
],
},
{
label: '生产部',
id: '1-3',
children: [
{
label: '演示员',
id: '1-3-1',
},
{
label: '机加工',
id: '1-3-2',
children: [
{
label: '演示员2',
id: '1-3-2-1',
},
],
},
],
},
],
},
]
} }
////使 emit ////使 emit
@ -148,6 +105,7 @@ let confirmBind = () => {
console.log('-------'); console.log('-------');
// //
const selectedData = hasSelectionList.value; const selectedData = hasSelectionList.value;
debugger
// 使 emit // 使 emit
emit('confirm', selectedData); emit('confirm', selectedData);

@ -22,10 +22,7 @@
<el-date-picker v-model="formData.endTime" type="datetime" value-format="x" format="YYYY/MM/DD HH:mm" placeholder="选择结束时间" /> <el-date-picker v-model="formData.endTime" type="datetime" value-format="x" format="YYYY/MM/DD HH:mm" placeholder="选择结束时间" />
</el-form-item> </el-form-item>
<el-form-item label="关联客户" prop="businessId"> <el-form-item label="关联客户" prop="businessId">
<el-select <el-select v-model="formData.businessId" @click="openDialog" placeholder="请输入客户" />
v-model="formData.businessId" @click="openDialog" placeholder="请输入客户"
/>
<!-- <el-input v-model="formData.businessId" @click="openDialog" placeholder="请输入客户" /> -->
<Shuttle :selectedData.sync="formData.businessId" @confirm="handleConfirm" ref="shuttleRef" /> <Shuttle :selectedData.sync="formData.businessId" @confirm="handleConfirm" ref="shuttleRef" />
</el-form-item> </el-form-item>
@ -110,7 +107,7 @@ const formRules = reactive({
const formRef = ref() // Ref const formRef = ref() // Ref
const handleConfirm=(selectData) =>{ const handleConfirm=(selectData) =>{
console.log('已选择并传递的数据',selectData); console.log('已选择并传递的数据',selectData);
// //
formData.businessId=selectData; formData.businessId=selectData;
console.log(formData.businessId); console.log(formData.businessId);

Loading…
Cancel
Save