Browse Source

解决api 调用依赖

lijunping 2 years ago
parent
commit
1f285960f4
24 changed files with 695 additions and 84 deletions
  1. 9 0
      blade-service-api/blade-sales-part-api/pom.xml
  2. 34 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/dto/BrandFilesDTO.java
  3. 18 7
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjBrandDesc.java
  4. 122 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjBrandFiles.java
  5. 12 5
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjCorpsAttn.java
  6. 6 6
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjCorpsDesc.java
  7. 2 1
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/CorpsDescExportExcel.java
  8. 4 5
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/CorpsDescImportExcel.java
  9. 36 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/vo/BrandFilesVO.java
  10. 1 6
      blade-service-api/pom.xml
  11. 8 20
      blade-service/blade-sales-part/pom.xml
  12. 2 2
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/accountManagement/service/IAccountManagementService.java
  13. 130 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/brand/controller/BrandFilesController.java
  14. 43 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/brand/mapper/BrandFilesMapper.java
  15. 30 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/brand/mapper/BrandFilesMapper.xml
  16. 41 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/brand/service/IBrandFilesService.java
  17. 19 4
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/brand/service/impl/BrandDescServiceImpl.java
  18. 41 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/brand/service/impl/BrandFilesServiceImpl.java
  19. 15 6
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/controller/CorpsAttnController.java
  20. 22 9
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/controller/CorpsDescController.java
  21. 3 3
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/mapper/CorpsDescMapper.xml
  22. 10 2
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/ICorpsAttnService.java
  23. 82 4
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsAttnServiceImpl.java
  24. 5 4
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsDescServiceImpl.java

+ 9 - 0
blade-service-api/blade-sales-part-api/pom.xml

@@ -13,6 +13,15 @@
     <name>${project.artifactId}</name>
     <version>${bladex.project.version}</version>
 
+    <dependencies>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>trade-finance-api</artifactId>
+            <version>2.8.2.RELEASE</version>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
         <maven.compiler.target>8</maven.compiler.target>

+ 34 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/dto/BrandFilesDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.dto;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.salesPart.entity.PjBrandFiles;
+
+/**
+ * 配件批发品牌附件数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-04-23
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class BrandFilesDTO extends PjBrandFiles {
+	private static final long serialVersionUID = 1L;
+
+}

+ 18 - 7
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjBrandDesc.java

@@ -16,15 +16,15 @@
  */
 package org.springblade.salesPart.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
-import java.time.LocalDateTime;
-import java.io.Serializable;
-import java.util.Date;
-
-import lombok.Data;
-import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 配件批发品牌表实体类
@@ -54,6 +54,13 @@ public class PjBrandDesc implements Serializable {
 	*/
 		@ApiModelProperty(value = "创建人")
 		private Long createUser;
+
+	/**
+	 * 创建人名称
+	 */
+	@ApiModelProperty(value = "创建人名称")
+	private String createUserName;
+
 	/**
 	* 创建部门
 	*/
@@ -100,5 +107,9 @@ public class PjBrandDesc implements Serializable {
 		@ApiModelProperty(value = "品牌名称")
 		private String cname;
 
-
+	/**
+	 * 品牌附件
+	 */
+	@TableField(exist = false)
+	private List<PjBrandFiles> brandFilesList;
 }

+ 122 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjBrandFiles.java

@@ -0,0 +1,122 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 配件批发品牌附件实体类
+ *
+ * @author BladeX
+ * @since 2023-04-23
+ */
+@Data
+@TableName("pjpf_brand_files")
+@ApiModel(value = "BrandFiles对象", description = "BrandFiles对象")
+public class PjBrandFiles implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 主键
+	*/
+		@ApiModelProperty(value = "主键")
+		private Long id;
+	/**
+	* 主表id
+	*/
+		@ApiModelProperty(value = "主表id")
+		private Long pid;
+	/**
+	* 排序
+	*/
+		@ApiModelProperty(value = "排序")
+		private Integer sort;
+	/**
+	* 文件名
+	*/
+		@ApiModelProperty(value = "文件名")
+		private String fileName;
+	/**
+	* 文件地址
+	*/
+		@ApiModelProperty(value = "文件地址")
+		private String url;
+	/**
+	* 备注
+	*/
+		@ApiModelProperty(value = "备注")
+		private String remarks;
+	/**
+	* 版本
+	*/
+		@ApiModelProperty(value = "版本")
+		private String version;
+	/**
+	* 创建人
+	*/
+		@ApiModelProperty(value = "创建人")
+		private Long createUser;
+	/**
+	* 创建部门
+	*/
+		@ApiModelProperty(value = "创建部门")
+		private Long createDept;
+	/**
+	* 创建时间
+	*/
+		@ApiModelProperty(value = "创建时间")
+		private LocalDateTime createTime;
+	/**
+	* 修改人
+	*/
+		@ApiModelProperty(value = "修改人")
+		private Long updateUser;
+	/**
+	* 修改时间
+	*/
+		@ApiModelProperty(value = "修改时间")
+		private LocalDateTime updateTime;
+	/**
+	* 状态(0 正常 1停用)
+	*/
+		@ApiModelProperty(value = "状态(0 正常 1停用)")
+		private Integer status;
+	/**
+	* 是否已删除(0 否 1是)
+	*/
+		@ApiModelProperty(value = "是否已删除(0 否 1是)")
+		private Integer isDeleted;
+	/**
+	* 分类(1 主表  2 明细)
+	*/
+		@ApiModelProperty(value = "分类(1 主表  2 明细)")
+		private String type;
+	/**
+	* 是否主图(0 否,1 是)
+	*/
+		@ApiModelProperty(value = "是否主图(0 否,1 是)")
+		private Integer mainImage;
+
+
+}

+ 12 - 5
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjCorpsAttn.java

@@ -16,14 +16,14 @@
  */
 package org.springblade.salesPart.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
-import java.io.Serializable;
-import java.util.Date;
-
-import lombok.Data;
-import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
 
 /**
  * 配件批发客户明细联系人实体类
@@ -119,5 +119,12 @@ public class PjCorpsAttn implements Serializable {
 	@ApiModelProperty(value = "所属公司名称")
 	private String salesCompanyName;
 
+	@TableField(exist = false)
+	private String deptId;
+
+	@TableField(exist = false)
+	private String roleId;
 
+	@TableField(exist = false)
+	private String postId;
 }

+ 6 - 6
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjCorpsDesc.java

@@ -16,18 +16,17 @@
  */
 package org.springblade.salesPart.entity;
 
-import java.math.BigDecimal;
-
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
-import lombok.Data;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
 /**
  * 配件批发客户实体类
  *
@@ -197,4 +196,5 @@ public class PjCorpsDesc implements Serializable {
 	@ApiModelProperty(value = "客户附件")
 	@TableField(exist = false)
 	private List<PjCorpsFiles> corpsFilesList;
+
 }

+ 2 - 1
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/CorpsDescExportExcel.java

@@ -6,6 +6,7 @@ import com.alibaba.excel.annotation.write.style.ContentRowHeight;
 import com.alibaba.excel.annotation.write.style.HeadRowHeight;
 import lombok.Data;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 
 /**
@@ -15,7 +16,7 @@ import java.math.BigDecimal;
 @ColumnWidth(25)
 @HeadRowHeight(20)
 @ContentRowHeight(18)
-public class CorpsDescExportExcel {
+public class CorpsDescExportExcel implements Serializable {
 
 	private static final long serialVersionUID = 1L;
 

+ 4 - 5
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/CorpsDescImportExcel.java

@@ -6,6 +6,7 @@ import com.alibaba.excel.annotation.write.style.ContentRowHeight;
 import com.alibaba.excel.annotation.write.style.HeadRowHeight;
 import lombok.Data;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 
 /**
@@ -15,9 +16,7 @@ import java.math.BigDecimal;
 @ColumnWidth(25)
 @HeadRowHeight(20)
 @ContentRowHeight(18)
-public class CorpsDescImportExcel {
-
-	private static final long serialVersionUID = 1L;
+public class CorpsDescImportExcel implements Serializable {
 
 	/**
 	 * 客户名称
@@ -25,7 +24,7 @@ public class CorpsDescImportExcel {
 	@ExcelProperty(value = "客户名称")
 	private String cname;
 
-	@ExcelProperty("客户分类(必填)")
+	@ExcelProperty(value = "客户分类(必填)")
 	private String type;
 
 	/**
@@ -38,7 +37,7 @@ public class CorpsDescImportExcel {
 	 * 发货仓库
 	 */
 	@ExcelProperty(value = "发货仓库")
-	private String deliveryWarehouseName;
+	private String delivery;
 	/**
 	 * 商城价格
 	 */

+ 36 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/vo/BrandFilesVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.vo;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.salesPart.entity.PjBrandFiles;
+
+/**
+ * 配件批发品牌附件视图实体类
+ *
+ * @author BladeX
+ * @since 2023-04-23
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "BrandFilesVO对象", description = "BrandFilesVO对象")
+public class BrandFilesVO extends PjBrandFiles {
+	private static final long serialVersionUID = 1L;
+
+}

+ 1 - 6
blade-service-api/pom.xml

@@ -70,12 +70,7 @@
             <artifactId>blade-core-auto</artifactId>
             <scope>provided</scope>
         </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>easyexcel-core</artifactId>
-            <version>3.1.1</version>
-            <scope>compile</scope>
-        </dependency>
+
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>easyexcel-core</artifactId>

+ 8 - 20
blade-service/blade-sales-part/pom.xml

@@ -11,6 +11,7 @@
 
     <artifactId>blade-sales-part</artifactId>
 
+
     <dependencies>
         <dependency>
             <groupId>org.springblade</groupId>
@@ -26,18 +27,6 @@
         </dependency>
         <dependency>
             <groupId>org.springblade</groupId>
-            <artifactId>blade-system-api</artifactId>
-            <version>2.8.2.RELEASE</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.springblade</groupId>
-            <artifactId>blade-purchase-sales-api</artifactId>
-            <version>2.8.2.RELEASE</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.springblade</groupId>
             <artifactId>blade-user-api</artifactId>
             <version>2.8.2.RELEASE</version>
             <scope>compile</scope>
@@ -48,20 +37,19 @@
             <version>2.8.2.RELEASE</version>
             <scope>compile</scope>
         </dependency>
-        <dependency>
+          <dependency>
             <groupId>org.springblade</groupId>
-            <artifactId>blade-sales-part-api</artifactId>
-            <version>2.8.2.RELEASE</version>
-        </dependency>
-        <dependency>
-            <groupId>io.minio</groupId>
-            <artifactId>minio</artifactId>
+            <artifactId>blade-starter-excel</artifactId>
         </dependency>
         <dependency>
             <groupId>org.springblade</groupId>
-            <artifactId>blade-starter-excel</artifactId>
+            <artifactId>blade-sales-part-api</artifactId>
+            <version>2.8.2.RELEASE</version>
+            <scope>compile</scope>
         </dependency>
 
+
+
     </dependencies>
 
     <properties>

+ 2 - 2
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/accountManagement/service/IAccountManagementService.java

@@ -16,10 +16,10 @@
  */
 package org.springblade.salesPart.accountManagement.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
 import org.springblade.salesPart.entity.PjAccountManagement;
 import org.springblade.salesPart.vo.AccountManagementVO;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 
 /**
  * 配件批发账户管理表 服务类

+ 130 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/brand/controller/BrandFilesController.java

@@ -0,0 +1,130 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.brand.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.salesPart.brand.service.IBrandFilesService;
+import org.springblade.salesPart.entity.PjBrandFiles;
+import org.springblade.salesPart.vo.BrandFilesVO;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+
+/**
+ *  配件批发品牌附件控制器
+ *
+ * @author BladeX
+ * @since 2023-04-23
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/brandfiles")
+@Api(value = "", tags = "接口")
+public class BrandFilesController extends BladeController {
+
+	private final IBrandFilesService brandFilesService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入brandFiles")
+	public R<PjBrandFiles> detail(PjBrandFiles brandFiles) {
+		PjBrandFiles detail = brandFilesService.getOne(Condition.getQueryWrapper(brandFiles));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入brandFiles")
+	public R<IPage<PjBrandFiles>> list(PjBrandFiles brandFiles, Query query) {
+		IPage<PjBrandFiles> pages = brandFilesService.page(Condition.getPage(query), Condition.getQueryWrapper(brandFiles));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入brandFiles")
+	public R<IPage<BrandFilesVO>> page(BrandFilesVO brandFiles, Query query) {
+		IPage<BrandFilesVO> pages = brandFilesService.selectBrandFilesPage(Condition.getPage(query), brandFiles);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入brandFiles")
+	public R save(@Valid @RequestBody PjBrandFiles brandFiles) {
+		return R.status(brandFilesService.save(brandFiles));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入brandFiles")
+	public R update(@Valid @RequestBody PjBrandFiles brandFiles) {
+		if (brandFiles.getId() == null) {
+			return R.data(500, "请选择要删除的数据", "error");
+		}
+		brandFiles.setIsDeleted(1);
+		return R.status(brandFilesService.updateById(brandFiles));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入brandFiles")
+	public R submit(@Valid @RequestBody PjBrandFiles brandFiles) {
+		return R.status(brandFilesService.saveOrUpdate(brandFiles));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(brandFilesService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 43 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/brand/mapper/BrandFilesMapper.java

@@ -0,0 +1,43 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.brand.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.salesPart.entity.PjBrandFiles;
+import org.springblade.salesPart.vo.BrandFilesVO;
+
+import java.util.List;
+
+/**
+ *  配件批发品牌附件Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-04-23
+ */
+public interface BrandFilesMapper extends BaseMapper<PjBrandFiles> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param brandFilesVO
+	 * @return
+	 */
+	List<BrandFilesVO> selectBrandFilesPage(IPage page, BrandFilesVO brandFilesVO);
+
+}

+ 30 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/brand/mapper/BrandFilesMapper.xml

@@ -0,0 +1,30 @@
+<?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="org.springblade.salesPart.brand.mapper.BrandFilesMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="brandFilesResultMap" type="org.springblade.salesPart.entity.PjBrandFiles">
+        <id column="id" property="id"/>
+        <result column="pid" property="pid"/>
+        <result column="sort" property="sort"/>
+        <result column="file_name" property="fileName"/>
+        <result column="url" property="url"/>
+        <result column="remarks" property="remarks"/>
+        <result column="version" property="version"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="type" property="type"/>
+        <result column="main_image" property="mainImage"/>
+    </resultMap>
+
+
+    <select id="selectBrandFilesPage" resultMap="brandFilesResultMap">
+        select * from pjpf_brand_files where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/brand/service/IBrandFilesService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.brand.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.salesPart.entity.PjBrandFiles;
+import org.springblade.salesPart.vo.BrandFilesVO;
+
+/**
+ *  配件批发品牌附件服务类
+ *
+ * @author BladeX
+ * @since 2023-04-23
+ */
+public interface IBrandFilesService extends IService<PjBrandFiles> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param brandFiles
+	 * @return
+	 */
+	IPage<BrandFilesVO> selectBrandFilesPage(IPage<BrandFilesVO> page, BrandFilesVO brandFiles);
+
+}

+ 19 - 4
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/brand/service/impl/BrandDescServiceImpl.java

@@ -17,14 +17,19 @@
 package org.springblade.salesPart.brand.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.AllArgsConstructor;
 import org.springblade.core.secure.utils.AuthUtil;
-import org.springblade.salesPart.entity.PjBrandDesc;
-import org.springblade.salesPart.vo.BrandDescVO;
+import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.salesPart.brand.mapper.BrandDescMapper;
 import org.springblade.salesPart.brand.service.IBrandDescService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.salesPart.brand.service.IBrandFilesService;
+import org.springblade.salesPart.entity.PjBrandDesc;
+import org.springblade.salesPart.entity.PjBrandFiles;
+import org.springblade.salesPart.vo.BrandDescVO;
+import org.springblade.system.user.feign.IUserClient;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 
 import java.util.Date;
 
@@ -35,8 +40,12 @@ import java.util.Date;
  * @since 2023-04-24
  */
 @Service
+@AllArgsConstructor
 public class BrandDescServiceImpl extends ServiceImpl<BrandDescMapper, PjBrandDesc> implements IBrandDescService {
 
+	private final IUserClient userClient;//获取用户信息
+	private final IBrandFilesService brandFilesService;
+
 	/**
 	 * 获取账户管理详情
 	 *
@@ -46,6 +55,12 @@ public class BrandDescServiceImpl extends ServiceImpl<BrandDescMapper, PjBrandDe
 	@Override
 	public PjBrandDesc getMessageById(PjBrandDesc brandDesc) {
 		PjBrandDesc detail = baseMapper.selectById(brandDesc.getId());
+
+		if (ObjectUtil.isNotEmpty(detail.getCreateUser())){
+			detail.setCreateUserName(userClient.userInfoById(detail.getCreateUser()).getData().getRealName());
+		}
+		//获取附件
+		detail.setBrandFilesList(brandFilesService.list(new QueryWrapper<PjBrandFiles>().eq("pid", detail.getId()).eq("is_deleted", 0)));
 		return detail;
 	}
 

+ 41 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/brand/service/impl/BrandFilesServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.brand.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.salesPart.brand.mapper.BrandFilesMapper;
+import org.springblade.salesPart.brand.service.IBrandFilesService;
+import org.springblade.salesPart.entity.PjBrandFiles;
+import org.springblade.salesPart.vo.BrandFilesVO;
+import org.springframework.stereotype.Service;
+
+/**
+ *  配件批发品牌附件服务实现类
+ *
+ * @author BladeX
+ * @since 2023-04-23
+ */
+@Service
+public class BrandFilesServiceImpl extends ServiceImpl<BrandFilesMapper, PjBrandFiles> implements IBrandFilesService {
+
+	@Override
+	public IPage<BrandFilesVO> selectBrandFilesPage(IPage<BrandFilesVO> page, BrandFilesVO brandFiles) {
+		return page.setRecords(baseMapper.selectBrandFilesPage(page, brandFiles));
+	}
+
+}

+ 15 - 6
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/controller/CorpsAttnController.java

@@ -16,23 +16,23 @@
  */
 package org.springblade.salesPart.corps.controller;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
-import javax.validation.Valid;
-
+import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.salesPart.corps.service.ICorpsAttnService;
 import org.springblade.salesPart.entity.PjCorpsAttn;
 import org.springblade.salesPart.vo.CorpsAttnVO;
 import org.springframework.web.bind.annotation.*;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.salesPart.corps.service.ICorpsAttnService;
-import org.springblade.core.boot.ctrl.BladeController;
+
+import javax.validation.Valid;
 
 /**
  * 配件批发客户明细联系人 控制器
@@ -126,5 +126,14 @@ public class CorpsAttnController extends BladeController {
 		return R.status(corpsAttnService.removeByIds(Func.toLongList(ids)));
 	}
 
+	/**
+	 * 创建用户
+	 */
+	@PostMapping("/user")
+	@ApiOperationSupport(order = 9)
+	@ApiOperation(value = "创建用户", notes = "传入corpsAttn")
+	public R user(@RequestBody PjCorpsAttn corpsAttn) {
+		return corpsAttnService.createUser(corpsAttn);
+	}
 
 }

+ 22 - 9
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/controller/CorpsDescController.java

@@ -17,17 +17,15 @@
 package org.springblade.salesPart.corps.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
-
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.Valid;
-
+import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
@@ -37,6 +35,7 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.CollectionUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.salesPart.corps.service.ICorpsDescService;
 import org.springblade.salesPart.corps.service.ICorpsTypeDescService;
 import org.springblade.salesPart.corps.service.ICorpsTypeService;
 import org.springblade.salesPart.entity.PjCorpsDesc;
@@ -47,11 +46,10 @@ import org.springblade.salesPart.excel.CorpsDescImportExcel;
 import org.springblade.salesPart.excel.SupplierImportExcel;
 import org.springblade.salesPart.vo.CorpsDescVO;
 import org.springframework.web.bind.annotation.*;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.salesPart.corps.service.ICorpsDescService;
-import org.springblade.core.boot.ctrl.BladeController;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -247,7 +245,8 @@ public class CorpsDescController extends BladeController {
 	@ApiOperation(value = "下载客户模板")
 	public void corpsExport(HttpServletResponse response) {
 		List<CorpsDescImportExcel> list = new ArrayList<>();
-		ExcelUtil.export(response, "下载模板-客户资料", "导入数据表", list, CorpsDescImportExcel.class);
+		System.out.println(response);
+		ExcelUtil.export(response, "下载模板客户资料", "导入数据表", list, CorpsDescImportExcel.class);
 	}
 
 	/**
@@ -274,4 +273,18 @@ public class CorpsDescController extends BladeController {
 		List<SupplierImportExcel> list = new ArrayList<>();
 		ExcelUtil.export(response, "导入模板-供应商资料", "导入数据表", list, SupplierImportExcel.class);
 	}
+
+	/**
+	 * 启用禁用
+	 */
+	@GetMapping("/updateEnableOrNot")
+	@ApiOperationSupport(order = 13)
+	@ApiOperation(value = "启用禁用", notes = "传入corpsDesc")
+	public R updateEnableOrNot(PjCorpsDesc corpsDesc){
+		if (corpsDesc.getId() == null){
+			return R.fail(500, "请选择数据");
+		}
+		boolean status = corpsDescService.updateById(corpsDesc);
+		return R.status(status);
+	}
 }

+ 3 - 3
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/mapper/CorpsDescMapper.xml

@@ -71,13 +71,13 @@
         <if test="corpsDesc.tenantId!=null and corpsDesc.tenantId != ''">
             and tenant_id = #{corpsDesc.tenantId}
         </if>
-        <if test="corpsDesc.createUser!=null">
+        <if test="corpsDesc.createUser!=null and corpsDesc.createUser != ''">
             and create_user = #{corpsDesc.createUser}
         </if>
-        <if test="corpsDesc.updateUser!=null">
+        <if test="corpsDesc.updateUser!=null and corpsDesc.updateUser != ''">
             and update_user = #{corpsDesc.updateUser}
         </if>
-        <if test="corpsDesc.status!=null">
+        <if test="corpsDesc.status!=null and corpsDesc.status != ''">
             and status = #{corpsDesc.status}
         </if>
         <if test='corpsDesc.typeList !=null and corpsDesc.typeList.size>0'>

+ 10 - 2
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/ICorpsAttnService.java

@@ -16,10 +16,11 @@
  */
 package org.springblade.salesPart.corps.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.core.tool.api.R;
 import org.springblade.salesPart.entity.PjCorpsAttn;
 import org.springblade.salesPart.vo.CorpsAttnVO;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 
 /**
  * 配件批发客户明细联系人 服务类
@@ -38,4 +39,11 @@ public interface ICorpsAttnService extends IService<PjCorpsAttn> {
 	 */
 	IPage<CorpsAttnVO> selectCorpsAttnPage(IPage<CorpsAttnVO> page, CorpsAttnVO corpsAttn);
 
+	/**
+	 * 创建用户
+	 *
+	 * @param corpsAttn
+	 * @return
+	 */
+	R createUser(PjCorpsAttn corpsAttn);
 }

+ 82 - 4
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsAttnServiceImpl.java

@@ -16,13 +16,23 @@
  */
 package org.springblade.salesPart.corps.service.impl;
 
-import org.springblade.salesPart.entity.PjCorpsAttn;
-import org.springblade.salesPart.vo.CorpsAttnVO;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import io.seata.spring.annotation.GlobalTransactional;
+import lombok.AllArgsConstructor;
+import org.springblade.client.constant.LandConstant;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.salesPart.corps.mapper.CorpsAttnMapper;
 import org.springblade.salesPart.corps.service.ICorpsAttnService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.salesPart.entity.PjCorpsAttn;
+import org.springblade.salesPart.vo.CorpsAttnVO;
+import org.springblade.system.user.entity.User;
+import org.springblade.system.user.feign.IUserClient;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 配件批发客户明细联系人 服务实现类
@@ -31,11 +41,79 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
  * @since 2023-04-21
  */
 @Service
+@AllArgsConstructor
 public class CorpsAttnServiceImpl extends ServiceImpl<CorpsAttnMapper, PjCorpsAttn> implements ICorpsAttnService {
 
+	private final IUserClient userClient;
+
 	@Override
 	public IPage<CorpsAttnVO> selectCorpsAttnPage(IPage<CorpsAttnVO> page, CorpsAttnVO corpsAttn) {
 		return page.setRecords(baseMapper.selectCorpsAttnPage(page, corpsAttn));
 	}
 
+	/**
+	 * 创建用户
+	 *
+	 * @param corpsAttn
+	 * @return
+	 */
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class)
+	public R createUser(PjCorpsAttn corpsAttn) {
+		PjCorpsAttn attn = baseMapper.selectById(corpsAttn.getId());
+
+		User user = new User();
+		user.setTenantId(AuthUtil.getTenantId());
+		user.setAccount(attn.getTel());
+		user.setName(attn.getCname());
+		user.setRealName(attn.getCname());
+		user.setUserType(4);
+		user.setPhone(attn.getTel());
+		user.setRoleId(corpsAttn.getRoleId());
+		user.setDeptId(corpsAttn.getDeptId());
+		user.setPostId(corpsAttn.getPostId());
+
+		if (ObjectUtil.isNotEmpty(attn.getUserId())) {
+
+			R<User> userR = userClient.userInfoById(attn.getUserId());
+			if (ObjectUtil.isNotEmpty(userR.getData())){
+				user.setId(attn.getUserId());
+				R<Boolean> result = userClient.updateUser(user);
+
+				if (!result.isSuccess()) {
+					throw new ServiceException(result.getMsg());
+				}
+			}else {
+				user.setPassword(LandConstant.USER_PASSWORD);
+				R<Boolean> result = userClient.saveUser(user);
+				if (!result.isSuccess()) {
+					throw new ServiceException(result.getMsg());
+				}
+
+				R<User> userTemp = userClient.userByAccount(AuthUtil.getTenantId(), attn.getTel());
+				if (!userTemp.isSuccess()) {
+					throw new ServiceException(userTemp.getMsg());
+				}
+				attn.setUserId(userTemp.getData().getId());
+				baseMapper.updateById(attn);
+			}
+
+		} else {
+			user.setPassword(LandConstant.USER_PASSWORD);
+			R<Boolean> result = userClient.saveUser(user);
+			if (!result.isSuccess()) {
+				throw new ServiceException(result.getMsg());
+			}
+
+			R<User> userTemp = userClient.userByAccount(AuthUtil.getTenantId(), attn.getTel());
+			if (!userTemp.isSuccess()) {
+				throw new ServiceException(userTemp.getMsg());
+			}
+			attn.setUserId(userTemp.getData().getId());
+			baseMapper.updateById(attn);
+		}
+		return R.success("操作成功");
+	}
+
 }

+ 5 - 4
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/corps/service/impl/CorpsDescServiceImpl.java

@@ -193,7 +193,7 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 	@Override
 	@Transactional
 	public R importUser(List<CorpsDescImportExcel> data) {
-		try {
+		/*try {
 			if (CollectionUtils.isEmpty(data)) {
 				throw new SecurityException("导入数据不能为空");
 			}
@@ -218,14 +218,14 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 					corpsDesc.setCreditLimit(e.getCreditLimit());
 					corpsDesc.setUseCreditLimit(e.getUseCreditLimit());
 
-					/*if (StringUtil.isNotBlank(e.getCompanyName())) {
+					*//*if (StringUtil.isNotBlank(e.getCompanyName())) {
 						org.springblade.client.entity.CorpsDesc company = baseMapper.selectCorpsDescCname(e.getCompanyName(), AuthUtil.getTenantId());
 						if (ObjectUtil.isNotEmpty(company)) {
 							corpsDesc.setBelongtocompany(String.valueOf(company.getId()));
 						} else {
 							throw new SecurityException("请输入正确的所属公司");
 						}
-					}*/
+					}*//*
 
 					corpsDesc.setCorpsTypeId(String.valueOf(corpsType.getId()));
 					corpsDesc.setCorpType("KH");
@@ -268,7 +268,8 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
 
 		} catch (Exception exception) {
 			throw new SecurityException("请检查导入数据" + exception.getMessage());
-		}
+		}*/
+		return null;
 	}
 
 	/**