caozj 2 rokov pred
rodič
commit
22eecc844d
33 zmenil súbory, kde vykonal 1445 pridanie a 15 odobranie
  1. 24 0
      bladex/blade-common/src/main/java/org/springblade/common/utils/CodeUtil.java
  2. 47 0
      bladex/blade-common/src/main/java/org/springblade/common/utils/ListUtil.java
  3. 6 0
      hx-saas-project/saas-entity/src/main/java/com/fjhx/material/entity/Material.java
  4. 131 4
      hx-saas-project/saas-entity/src/main/java/com/fjhx/supplier/entity/Supplier.java
  5. 10 2
      hx-saas-project/saas-entity/src/main/java/com/fjhx/supplier/entity/SupplierBank.java
  6. 75 0
      hx-saas-project/saas-entity/src/main/java/com/fjhx/supplier/entity/SupplierContacts.java
  7. 76 0
      hx-saas-project/saas-entity/src/main/java/com/fjhx/supplier/entity/SupplierProblem.java
  8. 25 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/material/controller/MaterialController.java
  9. 18 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/material/mapper/MaterialMapper.java
  10. 33 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/material/mapper/MaterialMapper.xml
  11. 16 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/material/service/IMaterialService.java
  12. 20 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/material/service/impl/MaterialServiceImpl.java
  13. 14 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierBankController.java
  14. 55 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierContactsController.java
  15. 36 6
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierController.java
  16. 14 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierKeepController.java
  17. 13 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierPriceController.java
  18. 110 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierProblemController.java
  19. 32 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierContactsMapper.java
  20. 20 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierContactsMapper.xml
  21. 28 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.java
  22. 78 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml
  23. 38 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierProblemMapper.java
  24. 31 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierProblemMapper.xml
  25. 31 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/ISupplierContactsService.java
  26. 51 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/ISupplierProblemService.java
  27. 42 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/ISupplierService.java
  28. 34 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/impl/SupplierContactsServiceImpl.java
  29. 149 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/impl/SupplierProblemServiceImpl.java
  30. 180 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/impl/SupplierServiceImpl.java
  31. 2 1
      hx-service/storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml
  32. 1 1
      hx-service/storage/src/main/java/com/fjhx/supplier/service/impl/SupplierProblemServiceImpl.java
  33. 5 1
      hx-service/storage/src/main/java/com/fjhx/supplier/service/impl/SupplierServiceImpl.java

+ 24 - 0
bladex/blade-common/src/main/java/org/springblade/common/utils/CodeUtil.java

@@ -0,0 +1,24 @@
+package org.springblade.common.utils;
+
+import java.text.DecimalFormat;
+
+/**
+ * 编码生成工具类
+ * @Author:caozj
+ * @DATE:2022/7/13 11:17
+ */
+public class CodeUtil {
+
+    /**
+     * 生成供应商编码
+     * @param code
+     * @return
+     */
+    public static String generateWmsCode(String code){
+        DecimalFormat decimalFormat=new DecimalFormat("0000");
+        String codenew=code.substring(1);
+        int i=Integer.parseInt(codenew)+1;
+        String k=decimalFormat.format(i);
+        return "C"+k;
+    }
+}

+ 47 - 0
bladex/blade-common/src/main/java/org/springblade/common/utils/ListUtil.java

@@ -0,0 +1,47 @@
+package org.springblade.common.utils;
+
+import com.alibaba.cloud.commons.lang.StringUtils;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * list工具类
+ * @Author:caozj
+ * @DATE:2022/7/25 15:37
+ */
+public class ListUtil {
+
+    /**
+     * 计算条数
+     * @param list
+     * @return
+     */
+    public static Map<String, Integer> duplicateCheckingCount(List<String> list){
+        Map<String,Integer> map = new HashMap<>();
+        for (String string : list) {
+            if(map.containsKey(string)) {
+                map.put(string, map.get(string).intValue()+1);
+            }else {
+                map.put(string, new Integer(1));
+            }
+        }
+        return map;
+    }
+
+    /**
+     * 重复计算
+     * @param list
+     * @param eq
+     * @return
+     */
+    public static Boolean checkList(List<String> list,String eq){
+        for(String i:list){
+            if(!StringUtils.equals(i,eq)){
+                return false;
+            }
+        }
+        return true;
+    }
+}

+ 6 - 0
hx-saas-project/saas-entity/src/main/java/com/fjhx/material/entity/Material.java

@@ -115,4 +115,10 @@ public class Material extends BaseStockEntity {
 	@ApiModelProperty(value = "门幅")
 	@TableField(exist = false)
 	private Float width;
+
+	/**
+	 * 采购单价
+	 */
+	@TableField(exist = false)
+	private BigDecimal purchasePrice;
 }

+ 131 - 4
hx-saas-project/saas-entity/src/main/java/com/fjhx/supplier/entity/Supplier.java

@@ -16,13 +16,16 @@
  */
 package com.fjhx.supplier.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
-import java.time.LocalDateTime;
-import java.io.Serializable;
 
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+import com.fjhx.attachment.StockAttachment;
 import com.fjhx.base.BaseStockEntity;
 import lombok.Data;
-import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -88,7 +91,7 @@ public class Supplier extends BaseStockEntity {
 	* 创建日期
 	*/
 	@ApiModelProperty(value = "创建日期")
-	private LocalDateTime establishDate;
+	private Date establishDate;
 	/**
 	* 注册资本
 	*/
@@ -130,5 +133,129 @@ public class Supplier extends BaseStockEntity {
 	@ApiModelProperty(value = "营业执照")
 	private String businessLicense;
 
+	/**
+	 * 联系人
+	 */
+	@TableField(exist = false)
+	private List<SupplierContacts> contactsList;
+
+	/**
+	 * 文件列表
+	 */
+	@TableField(exist = false)
+	private List<StockAttachment> attr;
+
+	/**
+	 * 维护记录
+	 */
+	@TableField(exist = false)
+	private List<SupplierKeep> keepList;
+
+	/**
+	 * 账户信息
+	 */
+	@TableField(exist = false)
+	private List<SupplierBank> bankList;
+
+
+	/**
+	 * 问题反馈条数
+	 */
+	@TableField(exist = false)
+	private Integer warningCount;
+
+	/**
+	 * 问题反馈类型总条数
+	 */
+	@TableField(exist = false)
+	private Integer warningTypeCount;
+
+	/**
+	 * 物料类型名称
+	 */
+	@TableField(exist = false)
+	private String categoryName;
+
+	/**
+	 * 物料类型名称
+	 */
+	@TableField(exist = false)
+	private String materialName;
+
+	/**
+	 * 物料分类名称
+	 */
+	@TableField(exist = false)
+	private String materialCategoryName;
+
+	/**
+	 * 分类条数
+	 */
+	@TableField(exist = false)
+	private Integer CategoryCount;
 
+	/**
+	 * 物料分类ID
+	 */
+	@TableField(exist = false)
+	private String materialCategoryId;
+
+	/**
+	 * 工艺类型 (枚举定义:0=直喷,1=热转,2=打纸,3=墨水,4=其他)
+	 */
+	@TableField(exist = false)
+	private Integer technologyType;
+
+	/**
+	 * 物料用途
+	 */
+	@TableField(exist = false)
+	private String purpose;
+
+	/**
+	 * 采购占比
+	 */
+	@TableField(exist = false)
+	private BigDecimal purProportion;
+	/**
+	 * 总金额
+	 */
+	@TableField(exist = false)
+	private String sumMoney;
+
+	/**
+	 * 去年金额
+	 */
+	@TableField(exist = false)
+	private String lastYearMoney;
+
+	/**
+	 * 今年金额
+	 */
+	@TableField(exist = false)
+	private String yearMoney;
+
+	/**
+	 * 上个月金额
+	 */
+	@TableField(exist = false)
+	private String lastMonthMoney;
+
+	/**
+	 * 本月金额
+	 */
+	@TableField(exist = false)
+	private String monthMoney;
+
+	/**
+	 * 条数
+	 */
+	@TableField(exist = false)
+	private Integer count;
+
+	/**
+	 * 金额
+	 */
+	@TableField(exist = false)
+	private BigDecimal money;
 }

+ 10 - 2
hx-saas-project/saas-entity/src/main/java/com/fjhx/supplier/entity/SupplierBank.java

@@ -42,6 +42,10 @@ public class SupplierBank extends BaseStockEntity {
 	private static final long serialVersionUID = 1L;
 
 	/**
+	 * 供应商ID
+	 */
+	private String supplierId;
+	/**
 	* 账户名称
 	*/
 	@ApiModelProperty(value = "账户名称")
@@ -55,14 +59,18 @@ public class SupplierBank extends BaseStockEntity {
 	* 开户行
 	*/
 	@ApiModelProperty(value = "开户行")
-	@TableField("OpenBank")
 	private String openBank;
 	/**
 	* 账号
 	*/
 	@ApiModelProperty(value = "账号")
-	@TableField("BankAccout")
 	private String bankAccout;
 
 
+	/**
+	 * 状态
+	 */
+	private Integer status;
+
+
 }

+ 75 - 0
hx-saas-project/saas-entity/src/main/java/com/fjhx/supplier/entity/SupplierContacts.java

@@ -0,0 +1,75 @@
+/*
+ *      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 com.fjhx.supplier.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+import com.fjhx.base.BaseStockEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ * 供应商联系人实体类
+ *
+ * @author BladeX
+ * @since 2022-07-25
+ */
+@Data
+@TableName("stock_supplier_contacts")
+@ApiModel(value = "SupplierContacts对象", description = "供应商联系人")
+public class SupplierContacts extends BaseStockEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 供应商ID
+	 */
+	private String supplierId;
+
+	/**
+	* 联系人
+	*/
+	@ApiModelProperty(value = "联系人")
+	private String linkMen;
+	/**
+	* 手机
+	*/
+	@ApiModelProperty(value = "手机")
+	private String mobile;
+	/**
+	* 电话
+	*/
+	@ApiModelProperty(value = "电话")
+	private String telephone;
+	/**
+	* 邮箱
+	*/
+	@ApiModelProperty(value = "邮箱")
+	private String email;
+	/**
+	* 传真
+	*/
+	@ApiModelProperty(value = "传真")
+	private String fax;
+
+
+}

+ 76 - 0
hx-saas-project/saas-entity/src/main/java/com/fjhx/supplier/entity/SupplierProblem.java

@@ -0,0 +1,76 @@
+/*
+ *      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 com.fjhx.supplier.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import java.util.List;
+
+import com.fjhx.attachment.StockAttachment;
+import com.fjhx.base.BaseStockEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 供应商面料问题反馈表实体类
+ *
+ * @author BladeX
+ * @since 2022-07-25
+ */
+@Data
+@TableName("stock_supplier_problem")
+public class SupplierProblem extends BaseStockEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 供应商ID
+	*/
+	@ApiModelProperty(value = "供应商ID")
+	private String supplierId;
+	/**
+	* 物料ID
+	*/
+	@ApiModelProperty(value = "物料ID")
+	private String materialId;
+	/**
+	* 问题条数
+	*/
+	@ApiModelProperty(value = "问题条数")
+	private Integer problemTypeCount;
+	/**
+	* 问题类型  逗号分隔
+	*/
+	@ApiModelProperty(value = "问题类型  逗号分隔")
+	private String problemType;
+	/**
+	* 备注信息
+	*/
+	@ApiModelProperty(value = "备注信息")
+	private String remark;
+
+	/**
+	 * 文件合集
+	 */
+	@TableField(exist = false)
+	private List<StockAttachment> attr;
+}

+ 25 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/material/controller/MaterialController.java

@@ -71,6 +71,31 @@ public class MaterialController extends BladeController {
 		return R.count(count);
 	}
 
+
+	/**
+	 * 主营价格列表
+	 *
+	 * @param condition 查询条件
+	 * @return
+	 */
+	@PostMapping("/price/list")
+	public R getPriceList(@RequestBody Map<String, Object> condition) {
+		ListPageMap.getListPageMap(condition);
+		List<Material> list = materialService.getPriceList(condition);
+		return R.list(list);
+	}
+
+	/**
+	 * 主营价格列表-总条数
+	 *
+	 * @param condition 查询条件
+	 * @return
+	 */
+	@PostMapping("/price/list/count")
+	public R getPriceListCount(@RequestBody Map<String, Object> condition) {
+		Integer count = materialService.getPriceListCount(condition);
+		return R.count(count);
+	}
 	/**
 	 * 详情
 	 */

+ 18 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/material/mapper/MaterialMapper.java

@@ -48,4 +48,22 @@ public interface MaterialMapper extends BaseMapper<Material> {
      */
     @TenantIgnore
     Integer getListCount(Map<String, Object> condition);
+
+    /**
+     * 主营价格-列表
+     *
+     * @param condition
+     * @return
+     */
+    @TenantIgnore
+    List<Material> getPriceList(Map<String, Object> condition);
+
+    /**
+     * 主营价格列表-总条数
+     *
+     * @param condition
+     * @return
+     */
+    @TenantIgnore
+    Integer getPriceListCount(Map<String, Object> condition);
 }

+ 33 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/material/mapper/MaterialMapper.xml

@@ -24,6 +24,11 @@
         <result column="stock_standard" property="stockStandard"/>
         <result column="purpose" property="purpose"/>
         <result column="technology_type" property="technologyType"/>
+
+        <result column="unit_weight" property="unitWeight"/>
+        <result column="width" property="width"/>
+        <result column="purchasePrice" property="purchasePrice"/>
+
     </resultMap>
 
     <select id="getList" resultMap="materialResultMap">
@@ -48,6 +53,34 @@
         LEFT JOIN stock_material_extend t3 ON t1.id = t3.material_id
         <include refid="list_condition"/>
     </select>
+    <select id="getPriceList" resultMap="materialResultMap">
+        SELECT
+            t1.price AS purchasePrice,
+            t2.*
+        FROM
+            stock_supplier_price t1
+        LEFT JOIN stock_material t2 ON t1.material_id = t2.id
+        <include refid="price_list_condition"/>
+        ORDER BY create_time DESC
+        <include refid="com.fjhx.house.mapper.HouseMapper.sql_limit"/>
+    </select>
+    <select id="getPriceListCount" resultType="java.lang.Integer">
+        SELECT
+            count(1)
+        FROM
+        stock_supplier_price t1
+        LEFT JOIN stock_material t2 ON t1.material_id = t2.id
+        <include refid="price_list_condition"/>
+    </select>
+    <sql id="price_list_condition">
+        <where>
+            t1.is_delete = 0
+            AND t1.supplier_id = #{supplierId}
+            <if test="search neq null and search neq '' ">
+                AND ((INSTR(t2.`name`, #{search}) > 0) OR (INSTR(t2.`code`, #{search}) > 0) )
+            </if>
+        </where>
+    </sql>
     <sql id="list_condition">
         <where>
             t1.is_delete = 0

+ 16 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/material/service/IMaterialService.java

@@ -63,4 +63,20 @@ public interface IMaterialService extends IService<Material> {
      * @return
      */
     Integer getListCount(Map<String, Object> condition);
+
+    /**
+     * 主营价格列表
+     *
+     * @param condition
+     * @return
+     */
+    List<Material> getPriceList(Map<String, Object> condition);
+
+    /**
+     * 主营价格列表-总条数
+     *
+     * @param condition
+     * @return
+     */
+    Integer getPriceListCount(Map<String, Object> condition);
 }

+ 20 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/material/service/impl/MaterialServiceImpl.java

@@ -125,4 +125,24 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
     public Integer getListCount(Map<String, Object> condition) {
         return baseMapper.getListCount(condition);
     }
+
+    /**
+     * 主营价格列表
+     * @param condition
+     * @return
+     */
+    @Override
+    public List<Material> getPriceList(Map<String, Object> condition) {
+        return baseMapper.getPriceList(condition);
+    }
+
+    /**
+     * 主营价格列表条数
+     * @param condition
+     * @return
+     */
+    @Override
+    public Integer getPriceListCount(Map<String, Object> condition) {
+        return baseMapper.getPriceListCount(condition);
+    }
 }

+ 14 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierBankController.java

@@ -16,14 +16,20 @@
  */
 package com.fjhx.supplier.controller;
 
+import com.fjhx.supplier.entity.SupplierBank;
+import com.fjhx.supplier.entity.SupplierContacts;
 import com.fjhx.supplier.service.ISupplierBankService;
 import io.swagger.annotations.Api;
 import lombok.AllArgsConstructor;
 
 import org.springblade.common.constant.ApiConstant;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.tool.api.R;
 import org.springframework.web.bind.annotation.*;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.List;
+
 /**
  * 供应商收款账户 控制器
  *
@@ -38,5 +44,13 @@ public class SupplierBankController extends BladeController {
 
 	private final ISupplierBankService supplierBankService;
 
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	public R<SupplierBank> detail(SupplierBank supplierBank) {
+		List<SupplierBank> list = supplierBankService.list(Condition.getQueryWrapper(supplierBank));
+		return R.list(list);
+	}
 
 }

+ 55 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierContactsController.java

@@ -0,0 +1,55 @@
+/*
+ *      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 com.fjhx.supplier.controller;
+
+import com.fjhx.supplier.entity.SupplierBank;
+import com.fjhx.supplier.entity.SupplierContacts;
+import com.fjhx.supplier.service.ISupplierContactsService;
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+
+import org.springblade.common.constant.ApiConstant;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.*;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.List;
+
+/**
+ * 供应商联系人 控制器
+ *
+ * @author BladeX
+ * @since 2022-07-25
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping(ApiConstant.Project.SAAS_STORAGE_REQUEST_PREFIX+"/suppliercontacts")
+@Api(value = "供应商联系人", tags = "供应商联系人接口")
+public class SupplierContactsController extends BladeController {
+
+	private final ISupplierContactsService supplierContactsService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	public R<SupplierContacts> detail(SupplierContacts supplierContacts) {
+		List<SupplierContacts> list = supplierContactsService.list(Condition.getQueryWrapper(supplierContacts));
+		return R.list(list);
+	}
+}

+ 36 - 6
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierController.java

@@ -19,17 +19,20 @@ package com.fjhx.supplier.controller;
 import com.fjhx.supplier.entity.Supplier;
 import com.fjhx.supplier.service.ISupplierService;
 import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
 import javax.validation.Valid;
 
 import org.springblade.common.constant.ApiConstant;
+import org.springblade.common.utils.ListPageMap;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springframework.web.bind.annotation.*;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * 供应商 控制器
  *
@@ -45,6 +48,30 @@ public class SupplierController extends BladeController {
 	private final ISupplierService supplierService;
 
 	/**
+	 * 列表
+	 * @param condition
+	 * @return
+	 */
+	@PostMapping("/list")
+	public R list(@RequestBody Map<String, Object> condition){
+		ListPageMap.getListPageMap(condition);
+		List<Supplier> result = supplierService.getList(condition);
+		return R.success(result);
+	}
+
+	/**
+	 * 列表条数
+	 * @param condition
+	 * @return
+	 */
+	@PostMapping("/list/count")
+	public R listCount(@RequestBody Map<String, Object> condition){
+		ListPageMap.getListPageMap(condition);
+		Integer count = supplierService.getListCount(condition);
+		return R.success(count);
+	}
+
+	/**
 	 * 详情
 	 */
 	@GetMapping("/detail")
@@ -59,7 +86,8 @@ public class SupplierController extends BladeController {
 	 */
 	@PostMapping("/save")
 	public R save(@Valid @RequestBody Supplier supplier) {
-		return R.status(supplierService.save(supplier));
+		supplierService.addSupplier(supplier);
+		return R.success();
 	}
 
 	/**
@@ -67,15 +95,17 @@ public class SupplierController extends BladeController {
 	 */
 	@PostMapping("/update")
 	public R update(@Valid @RequestBody Supplier supplier) {
-		return R.status(supplierService.updateById(supplier));
+		supplierService.editSupplier(supplier);
+		return R.success();
 	}
 
 	/**
 	 * 删除 供应商
 	 */
-	@PostMapping("/remove")
-	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(supplierService.removeByIds(Func.toLongList(ids)));
+	@GetMapping("/remove")
+	public R remove(@RequestParam String id) {
+		supplierService.delSupplier(id);
+		return R.success();
 	}
 
 	

+ 14 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierKeepController.java

@@ -16,14 +16,20 @@
  */
 package com.fjhx.supplier.controller;
 
+import com.fjhx.supplier.entity.SupplierContacts;
+import com.fjhx.supplier.entity.SupplierKeep;
 import com.fjhx.supplier.service.ISupplierKeepService;
 import io.swagger.annotations.Api;
 import lombok.AllArgsConstructor;
 
 import org.springblade.common.constant.ApiConstant;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.tool.api.R;
 import org.springframework.web.bind.annotation.*;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.List;
+
 /**
  * 供应商维护记录 控制器
  *
@@ -39,5 +45,13 @@ public class SupplierKeepController extends BladeController {
 	private final ISupplierKeepService supplierKeepService;
 
 
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	public R<SupplierKeep> detail(SupplierKeep supplierKeep) {
+		List<SupplierKeep> list = supplierKeepService.list(Condition.getQueryWrapper(supplierKeep));
+		return R.list(list);
+	}
 	
 }

+ 13 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierPriceController.java

@@ -16,14 +16,19 @@
  */
 package com.fjhx.supplier.controller;
 
+import com.fjhx.supplier.entity.Supplier;
+import com.fjhx.supplier.entity.SupplierPrice;
 import com.fjhx.supplier.service.ISupplierPriceService;
 import io.swagger.annotations.Api;
 import lombok.AllArgsConstructor;
 
 import org.springblade.common.constant.ApiConstant;
+import org.springblade.core.tool.api.R;
 import org.springframework.web.bind.annotation.*;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import javax.validation.Valid;
+
 /**
  * 供应商价格 控制器
  *
@@ -39,5 +44,13 @@ public class SupplierPriceController extends BladeController {
 	private final ISupplierPriceService supplierPriceService;
 
 
+	/**
+	 * 新增 供应商价格
+	 */
+	@PostMapping("/save")
+	public R save(@Valid @RequestBody SupplierPrice supplierPrice) {
+		supplierPrice.setCreate();
+		return R.status(supplierPriceService.save(supplierPrice));
+	}
 	
 }

+ 110 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierProblemController.java

@@ -0,0 +1,110 @@
+/*
+ *      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 com.fjhx.supplier.controller;
+
+import com.fjhx.supplier.entity.SupplierProblem;
+import com.fjhx.supplier.service.ISupplierProblemService;
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+
+import org.springblade.common.constant.ApiConstant;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.*;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.Map;
+
+/**
+ * 供应商面料问题反馈表 控制器
+ *
+ * @author BladeX
+ * @since 2022-07-25
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping(ApiConstant.Project.SAAS_STORAGE_REQUEST_PREFIX+"/supplierproblem")
+@Api(value = "供应商面料问题反馈表", tags = "供应商面料问题反馈表接口")
+public class SupplierProblemController extends BladeController {
+
+	private final ISupplierProblemService supplierProblemService;
+
+	/**
+	 * 添加
+	 * @param supplierProblem
+	 * @return
+	 */
+	@PostMapping("/add")
+	public R add(@RequestBody SupplierProblem supplierProblem){
+		supplierProblemService.add(supplierProblem);
+		return R.success();
+	}
+
+	/**
+	 * 修改
+	 * @param supplierProblem
+	 * @return
+	 */
+	@PostMapping("/edit")
+	public R edit(@RequestBody SupplierProblem supplierProblem){
+		supplierProblemService.edit(supplierProblem);
+		return R.success();
+	}
+
+	/**
+	 * 删除
+	 * @param supplierProblem
+	 * @return
+	 */
+	@PostMapping("/delete")
+	public R delete(@RequestBody SupplierProblem supplierProblem){
+		supplierProblemService.delete(supplierProblem);
+		return R.success();
+	}
+
+	/**
+	 * 详情
+	 * @param id
+	 * @return
+	 */
+	@GetMapping("/detail")
+	public R detail(@RequestParam("id")String id){
+		SupplierProblem data = supplierProblemService.detail(id);
+		return R.success(data);
+	}
+
+	/**
+	 * 面料问题反馈统计
+	 * @param id
+	 * @return
+	 */
+	@GetMapping("/statisticsProblem")
+	public R statisticsProblem(@RequestParam("id")String id){
+		Map<String, Integer> map = supplierProblemService.statisticsProblem(id);
+		return R.success(map);
+	}
+	/**
+	 * 面料问题反馈统计条数
+	 * @param id
+	 * @return
+	 */
+	@GetMapping("/statisticsProblemCount")
+	public R statisticsProblemCount(@RequestParam("id")String id){
+		Integer count = supplierProblemService.statisticsProblemCount(id);
+		return R.success(count);
+	}
+	
+}

+ 32 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierContactsMapper.java

@@ -0,0 +1,32 @@
+/*
+ *      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 com.fjhx.supplier.mapper;
+
+import com.fjhx.supplier.entity.SupplierContacts;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+
+/**
+ * 供应商联系人 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-07-25
+ */
+public interface SupplierContactsMapper extends BaseMapper<SupplierContacts> {
+
+
+}

+ 20 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierContactsMapper.xml

@@ -0,0 +1,20 @@
+<?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.fjhx.supplier.mapper.SupplierContactsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="supplierContactsResultMap" type="com.fjhx.supplier.entity.SupplierContacts">
+        <id column="id" property="id"/>
+        <result column="is_delete" property="isDelete"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="create_user" property="createUser"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="link_men" property="linkMen"/>
+        <result column="mobile" property="mobile"/>
+        <result column="telephone" property="telephone"/>
+        <result column="email" property="email"/>
+        <result column="fax" property="fax"/>
+    </resultMap>
+
+</mapper>

+ 28 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.java

@@ -19,6 +19,10 @@ package com.fjhx.supplier.mapper;
 import com.fjhx.supplier.entity.Supplier;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.tenant.annotation.TenantIgnore;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * 供应商 Mapper 接口
@@ -28,4 +32,28 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
  */
 public interface SupplierMapper extends BaseMapper<Supplier> {
 
+    /**
+     * 列表
+     *
+     * @param condition
+     * @return
+     */
+    @TenantIgnore
+    List<Supplier> getList(Map<String, Object> condition);
+
+    /**
+     * 列表-总条数
+     *
+     * @param condition
+     * @return
+     */
+    @TenantIgnore
+    Integer getListCount(Map<String, Object> condition);
+
+    /**
+     * 物料分类分组查询
+     * @return
+     */
+    @TenantIgnore
+    List<Supplier> getGroupByCategory();
 }

+ 78 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml

@@ -30,4 +30,82 @@
         <result column="business_license" property="businessLicense"/>
     </resultMap>
 
+    <select id="getList" resultType="com.fjhx.supplier.entity.Supplier">
+        SELECT
+            t1.*,
+            t3.`code`,
+            t3.technology_type AS technologyType,
+            t3.purpose AS purpose,
+            t4.`name` AS materialCategoryName,
+            t4.id,
+            ( <include refid="warningCount_filed"/> ) AS warningCount,
+            ( <include refid="warningTypeCount_filed"/>) AS warningTypeCount,
+            ( <include refid="categoryName_filed"/> ) AS categoryName
+        FROM
+            stock_supplier t1
+        LEFT JOIN stock_supplier_price t2 ON t1.id = t2.supplier_id
+        LEFT JOIN stock_material t3 ON t2.material_id = t3.`id`
+        LEFT JOIN stock_material_category t4 ON t3.category_id = t4.`id`
+        <include refid="list_condition"/>
+        GROUP BY
+            t1.ID
+        ORDER BY
+            t1.create_time DESC
+        <include refid="com.fjhx.house.mapper.HouseMapper.sql_limit"/>
+    </select>
+    <select id="getListCount" resultType="java.lang.Integer">
+        SELECT
+            count(1)
+        FROM
+        (
+        SELECT
+            count(1)
+        FROM
+            stock_supplier t1
+        LEFT JOIN stock_supplier_price t2 ON t1.id = t2.supplier_id
+        LEFT JOIN stock_material t3 ON t2.material_id = t3.`id`
+        LEFT JOIN stock_material_category t4 ON t3.category_id = t4.`id`
+        <include refid="list_condition"/>
+        GROUP BY
+        t1.ID
+        )AS a
+    </select>
+    <select id="getGroupByCategory"  resultType="com.fjhx.supplier.entity.Supplier">
+        SELECT
+            count( 1 ) AS CategoryCount,
+            t3.technology_type AS TechnologyType
+        FROM
+            stock_supplier t1
+        LEFT JOIN stock_supplier_price t2 ON t1.id = t2.supplier_id
+        LEFT JOIN stock_material t3 ON t2.material_id = t3.`id`
+        WHERE
+            t3.technology_type IS NOT NULL
+            AND t1.is_delete = 0
+        GROUP BY
+            t3.technology_type
+    </select>
+    <sql id="warningCount_filed">
+        SELECT count( 1 ) FROM stock_supplier_problem WHERE supplier_id = t1.id
+    </sql>
+    <sql id="warningTypeCount_filed">
+        SELECT SUM( problem_type_count ) FROM stock_supplier_problem WHERE supplier_id = t1.id
+    </sql>
+    <sql id="categoryName_filed">
+        SELECT `name` FROM stock_material_category WHERE `id` = t1.category_id
+    </sql>
+    <sql id="list_condition">
+        <where>
+            t1.is_delete = 0
+            AND t1.CategoryCode NOT IN ("02.","02.003.")
+            <if test="search neq null and search neq '' ">
+                AND ((INSTR(t1.`name`, #{search}) > 0) OR (INSTR(t1.`code`, #{search}) > 0) )
+            </if>
+            <if test="technologyType neq null and technologyType neq '' ">
+                AND t3.technology_type = #{technologyType}
+            </if>
+            <if test="purpose neq null and purpose neq '' ">
+                AND INSTR( t3.purpose, #{purpose} ) > 0
+            </if>
+        </where>
+    </sql>
 </mapper>

+ 38 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierProblemMapper.java

@@ -0,0 +1,38 @@
+/*
+ *      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 com.fjhx.supplier.mapper;
+
+import com.fjhx.supplier.entity.SupplierProblem;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.core.tenant.annotation.TenantIgnore;
+
+/**
+ * 供应商面料问题反馈表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-07-25
+ */
+public interface SupplierProblemMapper extends BaseMapper<SupplierProblem> {
+
+    /**
+     * 获取所有类型
+     * @param id
+     * @return
+     */
+    @TenantIgnore
+    String getGroupConcatType(String id);
+}

+ 31 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierProblemMapper.xml

@@ -0,0 +1,31 @@
+<?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.fjhx.supplier.mapper.SupplierProblemMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="supplierProblemResultMap" type="com.fjhx.supplier.entity.SupplierProblem">
+        <id column="ID" property="id"/>
+        <result column="is_delete" property="isDelete"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="create_user" property="createUser"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="supplier_id" property="supplierId"/>
+        <result column="material_id" property="materialId"/>
+        <result column="problem_type_count" property="problemTypeCount"/>
+        <result column="problem_type" property="problemType"/>
+        <result column="remark" property="remark"/>
+    </resultMap>
+
+
+    <select id="getGroupConcatType" resultType="java.lang.String">
+        SELECT
+            GROUP_CONCAT( problem_type )
+        FROM
+            stock_supplier_problem
+        WHERE
+            is_delete = 0
+            AND supplier_id = #{id}
+    </select>
+
+</mapper>

+ 31 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/ISupplierContactsService.java

@@ -0,0 +1,31 @@
+/*
+ *      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 com.fjhx.supplier.service;
+
+import com.fjhx.supplier.entity.SupplierContacts;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 供应商联系人 服务类
+ *
+ * @author BladeX
+ * @since 2022-07-25
+ */
+public interface ISupplierContactsService extends IService<SupplierContacts> {
+
+}

+ 51 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/ISupplierProblemService.java

@@ -0,0 +1,51 @@
+/*
+ *      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 com.fjhx.supplier.service;
+
+import com.fjhx.supplier.entity.SupplierProblem;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Map;
+
+/**
+ * 供应商面料问题反馈表 服务类
+ *
+ * @author BladeX
+ * @since 2022-07-25
+ */
+public interface ISupplierProblemService extends IService<SupplierProblem> {
+    void add(SupplierProblem supplierProblem);
+
+    void edit(SupplierProblem supplierProblem);
+
+    void delete(SupplierProblem supplierProblem);
+
+    SupplierProblem detail(String id);
+    /**
+     * 问题反馈统计
+     * @param supplierId
+     * @return
+     */
+    Map<String,Integer> statisticsProblem(String supplierId);
+
+    /**
+     * 问题反馈条数
+     * @param supplierId
+     * @return
+     */
+    Integer statisticsProblemCount(String supplierId);
+}

+ 42 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/ISupplierService.java

@@ -19,6 +19,9 @@ package com.fjhx.supplier.service;
 import com.fjhx.supplier.entity.Supplier;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * 供应商 服务类
  *
@@ -27,4 +30,43 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ISupplierService extends IService<Supplier> {
 
+    /**
+     * 添加
+     * @param supplier
+     */
+    void addSupplier(Supplier supplier);
+
+    /**
+     * 修改
+     * @param supplier
+     */
+    void editSupplier(Supplier supplier);
+
+    /**
+     * 修改
+     * @param id
+     */
+    void delSupplier(String  id);
+
+    /**
+     * 列表
+     *
+     * @param condition
+     * @return
+     */
+    List<Supplier> getList(Map<String, Object> condition);
+
+    /**
+     * 列表-总条数
+     *
+     * @param condition
+     * @return
+     */
+    Integer getListCount(Map<String, Object> condition);
+
+    /**
+     * 统计物料分类
+     * @return
+     */
+    List<Supplier> statisticsClassify();
 }

+ 34 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/impl/SupplierContactsServiceImpl.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 com.fjhx.supplier.service.impl;
+
+import com.fjhx.supplier.entity.SupplierContacts;
+import com.fjhx.supplier.mapper.SupplierContactsMapper;
+import com.fjhx.supplier.service.ISupplierContactsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 供应商联系人 服务实现类
+ *
+ * @author BladeX
+ * @since 2022-07-25
+ */
+@Service
+public class SupplierContactsServiceImpl extends ServiceImpl<SupplierContactsMapper, SupplierContacts> implements ISupplierContactsService {
+
+}

+ 149 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/impl/SupplierProblemServiceImpl.java

@@ -0,0 +1,149 @@
+/*
+ *      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 com.fjhx.supplier.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fjhx.attachment.StockAttachment;
+import com.fjhx.attachment.enums.AttachmentTypeEnum;
+import com.fjhx.attachment.service.StockAttachmentService;
+import com.fjhx.supplier.entity.SupplierProblem;
+import com.fjhx.supplier.mapper.SupplierProblemMapper;
+import com.fjhx.supplier.service.ISupplierProblemService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.common.utils.ListUtil;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.tool.utils.CollectionUtil;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+/**
+ * 供应商面料问题反馈表 服务实现类
+ *
+ * @author BladeX
+ * @since 2022-07-25
+ */
+@Service
+public class SupplierProblemServiceImpl extends ServiceImpl<SupplierProblemMapper, SupplierProblem> implements ISupplierProblemService {
+
+    @Autowired
+    private StockAttachmentService stockAttachmentService;
+    /**
+     * 保存
+     * @param supplierProblem
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void add(SupplierProblem supplierProblem) {
+        if(StringUtil.isEmpty(supplierProblem.getProblemType())){
+            throw new ServiceException("参数异常");
+        }
+        //保存数据
+        supplierProblem.setCreate();
+        supplierProblem.setProblemTypeCount(Arrays.asList(supplierProblem.getProblemType().split(",")).size());
+        save(supplierProblem);
+        List<StockAttachment> attr = supplierProblem.getAttr();
+        if(CollectionUtil.isNotEmpty(attr)){
+            for(StockAttachment s:attr){
+                s.setBusiId(supplierProblem.getId());
+                s.setBusiType(AttachmentTypeEnum.TYPE_ONE.getKey());
+                s.setCreatedTime(new Date());
+            }
+        }
+        stockAttachmentService.saveBatch(attr);
+    }
+
+    /**
+     * 修改
+     * @param supplierProblem
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void edit(SupplierProblem supplierProblem) {
+        if(StringUtil.isEmpty(supplierProblem.getId())){
+            throw new ServiceException("参数异常");
+        }
+        supplierProblem.setUpdate();
+        updateById(supplierProblem);
+        List<StockAttachment> attr = supplierProblem.getAttr();
+        if(CollectionUtil.isNotEmpty(attr)){
+            //清空文件重新添加
+            stockAttachmentService.remove(Wrappers.<StockAttachment>query().lambda().eq(StockAttachment::getBusiId,supplierProblem.getId()));
+            for(StockAttachment s:attr){
+                s.setBusiId(supplierProblem.getId());
+                s.setBusiType(AttachmentTypeEnum.TYPE_ONE.getKey());
+            }
+        }
+        stockAttachmentService.saveBatch(attr);
+    }
+
+    /**
+     * 删除
+     * @param supplierProblem
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void delete(SupplierProblem supplierProblem) {
+        removeById(supplierProblem.getId());
+        stockAttachmentService.remove(Wrappers.<StockAttachment>query().lambda().eq(StockAttachment::getBusiId,supplierProblem.getId()));
+    }
+
+    /**
+     * 详情
+     * @param id
+     * @return
+     */
+    @Override
+    public SupplierProblem detail(String id) {
+        SupplierProblem vo = getById(id);
+        if(ObjectUtil.isNotEmpty(vo)){
+            vo.setAttr(stockAttachmentService.getListByBusi(id));
+        }
+        return vo;
+    }
+
+    /**
+     * 面料问题反馈
+     * @param supplierId
+     * @return
+     */
+    @Override
+    public Map<String, Integer> statisticsProblem(String supplierId) {
+        String count = baseMapper.getGroupConcatType(supplierId);
+        Map<String,Integer> map = new HashMap<>();
+        if(StringUtils.isNotEmpty(count)){
+            List<String> list = Arrays.asList(count.split(","));
+            map = ListUtil.duplicateCheckingCount(list);
+        }
+        return map;
+    }
+
+    /**
+     * 面料问题反馈条数
+     * @param supplierId
+     * @return
+     */
+    @Override
+    public Integer statisticsProblemCount(String supplierId) {
+        return baseMapper.selectCount(Wrappers.<SupplierProblem>query().lambda().eq(SupplierProblem::getSupplierId,supplierId));
+    }
+}

+ 180 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/impl/SupplierServiceImpl.java

@@ -16,11 +16,34 @@
  */
 package com.fjhx.supplier.service.impl;
 
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fjhx.attachment.StockAttachment;
+import com.fjhx.attachment.enums.AttachmentTypeEnum;
+import com.fjhx.attachment.service.StockAttachmentService;
 import com.fjhx.supplier.entity.Supplier;
+import com.fjhx.supplier.entity.SupplierBank;
+import com.fjhx.supplier.entity.SupplierContacts;
+import com.fjhx.supplier.entity.SupplierKeep;
 import com.fjhx.supplier.mapper.SupplierMapper;
+import com.fjhx.supplier.service.ISupplierBankService;
+import com.fjhx.supplier.service.ISupplierContactsService;
+import com.fjhx.supplier.service.ISupplierKeepService;
 import com.fjhx.supplier.service.ISupplierService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.common.utils.CodeUtil;
+import org.springblade.core.tool.utils.CollectionUtil;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.system.user.entity.User;
+import org.springblade.system.user.feign.IUserClient;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.text.ParseException;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 供应商 服务实现类
@@ -31,5 +54,162 @@ import org.springframework.stereotype.Service;
 @Service
 public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> implements ISupplierService {
 
+    @Autowired
+    private StockAttachmentService stockAttachmentService;
+
+    @Autowired
+    private ISupplierContactsService supplierContactsService;
+
+    @Autowired
+    private ISupplierBankService supplierBankService;
+
+    @Autowired
+    private ISupplierKeepService supplierKeepService;
+
+    @Autowired
+    private IUserClient iUserClient;
+    /**
+     * 添加
+     * @param supplier
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void addSupplier(Supplier supplier) {
+        supplier.setCreate();
+        //生成code
+        if(StringUtil.isEmpty(supplier.getCode())){
+            Supplier sCode = getOne(Wrappers.<Supplier>query().lambda().orderByDesc(Supplier::getCode).last("limit 1"));
+            if(ObjectUtil.isEmpty(sCode)){
+                supplier.setCode("C001");
+            }else{
+                supplier.setCode(sCode.getCode()==null?"c001": CodeUtil.generateWmsCode(sCode.getCode()));
+            }
+        }
+        //生成用户
+        User user = new User();
+        user.setPassword("123456");
+        user.setAccount(supplier.getCode());
+        user.setName(supplier.getName());
+        user.setRealName(supplier.getName());
+        iUserClient.saveUser(user);
+        supplier.setBingdUserId(String.valueOf(user.getId()));
+        save(supplier);
+        //保存文件
+        List<StockAttachment> attr = supplier.getAttr();
+        if(CollectionUtil.isNotEmpty(attr)){
+            for(StockAttachment s:attr){
+                s.setBusiId(supplier.getId());
+                s.setBusiType(AttachmentTypeEnum.TYPE_TWO.getKey());
+                s.setCreatedTime(new Date());
+            }
+            stockAttachmentService.saveBatch(attr);
+        }
+        //保存联系人
+        List<SupplierContacts> contactsList = supplier.getContactsList();
+        if(CollectionUtil.isNotEmpty(contactsList)){
+            contactsList.forEach((entity) ->{entity.setCreate();entity.setSupplierId(supplier.getId());});
+            supplierContactsService.saveBatch(contactsList);
+        }
+        //保存账户信息
+        List<SupplierBank> bankList = supplier.getBankList();
+        if(CollectionUtil.isNotEmpty(bankList)){
+            bankList.forEach((entity) ->{entity.setCreate();entity.setSupplierId(supplier.getId());});
+            supplierBankService.saveBatch(bankList);
+        }
+        //保存维护记录
+        List<SupplierKeep> keepList = supplier.getKeepList();
+        if(CollectionUtil.isNotEmpty(keepList)){
+            keepList.forEach((entity) ->{entity.setCreate();entity.setSupplierId(supplier.getId());});
+            supplierKeepService.saveBatch(keepList);
+        }
+    }
+
+    /**
+     * 修改
+     * @param supplier
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void editSupplier(Supplier supplier) {
+        supplier.setUpdate();
+        updateById(supplier);
+        //清空操作重新赋值
+        //保存文件
+        List<StockAttachment> attr = supplier.getAttr();
+        if(CollectionUtil.isNotEmpty(attr)){
+            stockAttachmentService.remove(Wrappers.<StockAttachment>query().lambda().eq(StockAttachment::getBusiId,supplier.getId()));
+            for(StockAttachment s:attr){
+                s.setBusiId(supplier.getId());
+                s.setBusiType(AttachmentTypeEnum.TYPE_TWO.getKey());
+                s.setCreatedTime(new Date());
+            }
+            stockAttachmentService.saveBatch(attr);
+        }
+        //保存联系人
+        List<SupplierContacts> contactsList = supplier.getContactsList();
+        if(CollectionUtil.isNotEmpty(contactsList)){
+            supplierContactsService.remove(Wrappers.<SupplierContacts>query().lambda().eq(SupplierContacts::getSupplierId,supplier.getId()));
+            contactsList.forEach((entity) ->{entity.setCreate();entity.setSupplierId(supplier.getId());});
+            supplierContactsService.saveBatch(contactsList);
+        }
+        //保存账户信息
+        List<SupplierBank> bankList = supplier.getBankList();
+        if(CollectionUtil.isNotEmpty(bankList)){
+            supplierBankService.remove(Wrappers.<SupplierBank>query().lambda().eq(SupplierBank::getSupplierId,supplier.getId()));
+            bankList.forEach((entity) ->{entity.setCreate();entity.setSupplierId(supplier.getId());});
+            supplierBankService.saveBatch(bankList);
+        }
+        //保存维护记录
+        List<SupplierKeep> keepList = supplier.getKeepList();
+        if(CollectionUtil.isNotEmpty(keepList)){
+            supplierKeepService.remove(Wrappers.<SupplierKeep>query().lambda().eq(SupplierKeep::getSupplierId,supplier.getId()));
+            keepList.forEach((entity) ->{entity.setCreate();entity.setSupplierId(supplier.getId());});
+            supplierKeepService.saveBatch(keepList);
+        }
+    }
+
+    /**
+     * 删除
+     * @param id
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void delSupplier(String id) {
+        removeById(id);
+        stockAttachmentService.remove(Wrappers.<StockAttachment>query().lambda().eq(StockAttachment::getBusiId,id));
+        supplierContactsService.remove(Wrappers.<SupplierContacts>query().lambda().eq(SupplierContacts::getSupplierId,id));
+        supplierBankService.remove(Wrappers.<SupplierBank>query().lambda().eq(SupplierBank::getSupplierId,id));
+        supplierKeepService.remove(Wrappers.<SupplierKeep>query().lambda().eq(SupplierKeep::getSupplierId,id));
+    }
+
+    /**
+     * 列表
+     * @param condition
+     * @return
+     * @throws ParseException
+     */
+    @Override
+    public List<Supplier> getList(Map<String, Object> condition){
+        return baseMapper.getList(condition);
+    }
+
+    /**
+     * 列表条数
+     * @param condition
+     * @return
+     */
+    @Override
+    public Integer getListCount(Map<String, Object> condition) {
+        return baseMapper.getListCount(condition);
+    }
+
+    /**
+     * 统计物料分类
+     * @return
+     */
+    @Override
+    public List<Supplier> statisticsClassify() {
+        return baseMapper.getGroupByCategory();
+    }
 
 }

+ 2 - 1
hx-service/storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml

@@ -89,6 +89,7 @@
             AND t1.IsDelete = 0
         GROUP BY
             t3.TechnologyType
+        ORDER BY t3.TechnologyType ASC
     </select>
     <select id="getSuById" resultType="com.fjhx.entity.supplier.Supplier">
         SELECT
@@ -144,7 +145,7 @@
             t1.`id` = #{id}
         GROUP BY
             t2.MaterialCode
-        ORDER BY t2.CreatedTime DESC
+        ORDER BY SUM( t2.TotalAmount ) DESC
         <include refid="sql_limit"/>
     </select>
     <select id="getSuPurMaterialAnalyseCount" resultType="java.lang.Integer">

+ 1 - 1
hx-service/storage/src/main/java/com/fjhx/supplier/service/impl/SupplierProblemServiceImpl.java

@@ -65,7 +65,7 @@ public class SupplierProblemServiceImpl extends ServiceImpl<SupplierProblemMappe
         }
         //保存数据
         supplierProblemVo.setCreatedTime(new Date());
-        supplierProblemVo.setProblemTypeCount(String.valueOf(Arrays.asList("1,2,3,4".split(",")).size()));
+        supplierProblemVo.setProblemTypeCount(String.valueOf(Arrays.asList(supplierProblemVo.getProblemType().split(",")).size()));
         save(supplierProblemVo);
         List<StockAttachment> attr = supplierProblemVo.getAttr();
         if(CollectionUtil.isNotEmpty(attr)){

+ 5 - 1
hx-service/storage/src/main/java/com/fjhx/supplier/service/impl/SupplierServiceImpl.java

@@ -266,7 +266,11 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
                 .map(Supplier::getMoney)
                 .reduce(BigDecimal.ZERO,BigDecimal::add);
         for(Supplier s:list){
-            s.setPurProportion(s.getMoney().divide(totalMoney,2,BigDecimal.ROUND_HALF_UP));
+            if(s.getMoney().compareTo(BigDecimal.ZERO)==0||totalMoney.compareTo(BigDecimal.ZERO)==0){
+                s.setPurProportion(BigDecimal.ZERO);
+            }else{
+                s.setPurProportion(s.getMoney().divide(totalMoney,2,BigDecimal.ROUND_HALF_UP));
+            }
         }
         return list;
     }