فهرست منبع

供应商维护

home 2 سال پیش
والد
کامیت
8ba6157efc
15فایلهای تغییر یافته به همراه140 افزوده شده و 23 حذف شده
  1. 8 1
      hx-service-api/storage-restructure-api/src/main/java/com/fjhx/base/StorageBaseService.java
  2. 9 4
      hx-service/storage-restructure/src/main/java/com/fjhx/controller/material/MaterialController.java
  3. 10 5
      hx-service/storage-restructure/src/main/java/com/fjhx/controller/supplier/SupplierBankController.java
  4. 10 5
      hx-service/storage-restructure/src/main/java/com/fjhx/controller/supplier/SupplierContactsController.java
  5. 23 0
      hx-service/storage-restructure/src/main/java/com/fjhx/controller/supplier/SupplierController.java
  6. 11 4
      hx-service/storage-restructure/src/main/java/com/fjhx/controller/supplier/SupplierKeepController.java
  7. 6 0
      hx-service/storage-restructure/src/main/java/com/fjhx/mapper/material/MaterialMapper.java
  8. 10 0
      hx-service/storage-restructure/src/main/java/com/fjhx/mapper/material/MaterialMapper.xml
  9. 1 1
      hx-service/storage-restructure/src/main/java/com/fjhx/mapper/supplier/SupplierMapper.xml
  10. 4 0
      hx-service/storage-restructure/src/main/java/com/fjhx/service/common/CommonFileService.java
  11. 10 0
      hx-service/storage-restructure/src/main/java/com/fjhx/service/common/impl/CommonFileServiceImpl.java
  12. 3 0
      hx-service/storage-restructure/src/main/java/com/fjhx/service/material/MaterialService.java
  13. 6 0
      hx-service/storage-restructure/src/main/java/com/fjhx/service/material/impl/MaterialServiceImpl.java
  14. 3 0
      hx-service/storage-restructure/src/main/java/com/fjhx/service/supplier/SupplierKeepService.java
  15. 26 3
      hx-service/storage-restructure/src/main/java/com/fjhx/service/supplier/impl/SupplierKeepServiceImpl.java

+ 8 - 1
hx-service-api/storage-restructure-api/src/main/java/com/fjhx/base/StorageBaseService.java

@@ -73,13 +73,20 @@ public interface StorageBaseService<T> extends IService<T> {
     /**
      * 条件查询
      */
-    default List<T> list(SFunction<T, ?> column, Object val) {
+    default List<T> list(SFunction<T, ?> column, Long val) {
         return lambdaQuery().eq(column, val).list();
     }
 
     /**
      * 条件查询
      */
+    default List<T> list(SFunction<T, ?> column, List<Long> val) {
+        return lambdaQuery().in(column, val).list();
+    }
+
+    /**
+     * 条件查询
+     */
     default T getOne(SFunction<T, ?> column, Object val) {
         return lambdaQuery().eq(column, val).last("limit 1").one();
     }

+ 9 - 4
hx-service/storage-restructure/src/main/java/com/fjhx/controller/material/MaterialController.java

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -82,10 +83,14 @@ public class MaterialController {
         return R.success(materialService.getDistinctList(Material::getPurpose));
     }
 
-//    /**
-//     * 获取采购周期
-//     */
-//    @PostMapping("/get")
+    /**
+     * 获取通过供应商id获取物料
+     */
+    @PostMapping("/getMaterialBySupplierId")
+    public R getMaterialBySupplierId(Map<String, Long> condition) {
+        List<Map<String, Object>> result = materialService.getMaterialBySupplierId(condition.get("supplierId"));
+        return R.success(result);
+    }
 
 }
 

+ 10 - 5
hx-service/storage-restructure/src/main/java/com/fjhx/controller/supplier/SupplierBankController.java

@@ -1,18 +1,14 @@
 package com.fjhx.controller.supplier;
 
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.springblade.core.tool.api.R;
 import com.fjhx.entity.supplier.SupplierBank;
-import com.fjhx.params.supplier.SupplierBankVo;
 import com.fjhx.service.supplier.SupplierBankService;
+import org.springblade.core.tool.api.R;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Map;
-
 /**
  * <p>
  * 供应商收款账户 前端控制器
@@ -28,5 +24,14 @@ public class SupplierBankController {
     @Autowired
     private SupplierBankService supplierBankService;
 
+    /**
+     * 供应商收款账户详情
+     */
+    @PostMapping("/details")
+    public R details(@RequestBody SupplierBank supplierBank) {
+        supplierBank = supplierBankService.getOne(SupplierBank::getSupplierId, supplierBank.getId());
+        return R.success(supplierBank);
+    }
+
 }
 

+ 10 - 5
hx-service/storage-restructure/src/main/java/com/fjhx/controller/supplier/SupplierContactsController.java

@@ -1,18 +1,14 @@
 package com.fjhx.controller.supplier;
 
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.springblade.core.tool.api.R;
 import com.fjhx.entity.supplier.SupplierContacts;
-import com.fjhx.params.supplier.SupplierContactsVo;
 import com.fjhx.service.supplier.SupplierContactsService;
+import org.springblade.core.tool.api.R;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Map;
-
 /**
  * <p>
  * 供应商联系人 前端控制器
@@ -28,5 +24,14 @@ public class SupplierContactsController {
     @Autowired
     private SupplierContactsService supplierContactsService;
 
+    /**
+     * 供应商联系信息详情
+     */
+    @PostMapping("/details")
+    public R details(@RequestBody SupplierContacts supplierContacts) {
+        supplierContacts = supplierContactsService.getOne(SupplierContacts::getSupplierId, supplierContacts.getId());
+        return R.success(supplierContacts);
+    }
+
 }
 

+ 23 - 0
hx-service/storage-restructure/src/main/java/com/fjhx/controller/supplier/SupplierController.java

@@ -1,8 +1,10 @@
 package com.fjhx.controller.supplier;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.entity.common.CommonFile;
 import com.fjhx.entity.supplier.Supplier;
 import com.fjhx.params.supplier.SupplierVo;
+import com.fjhx.service.common.CommonFileService;
 import com.fjhx.service.supplier.SupplierService;
 import org.springblade.core.tool.api.R;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,6 +31,9 @@ public class SupplierController {
     @Autowired
     private SupplierService supplierService;
 
+    @Autowired
+    private CommonFileService commonFileService;
+
     @PostMapping("/page")
     public R page(@RequestBody Map<String, String> condition) {
         Page<Map<String, Object>> result = supplierService.getPage(condition);
@@ -54,6 +59,24 @@ public class SupplierController {
     }
 
     /**
+     * 供应商其他资质
+     */
+    @PostMapping("/getOtherList")
+    public R getOtherList(@RequestBody Supplier supplier) {
+        List<CommonFile> commonFiles = commonFileService.fileList(supplier.getId());
+        return R.success(commonFiles);
+    }
+
+    /**
+     * 供应商详情
+     */
+    @PostMapping("/details")
+    public R details(@RequestBody Supplier supplier) {
+        supplier = supplierService.getById(supplier.getId());
+        return R.success(supplier);
+    }
+
+    /**
      * 供应商名称集合
      */
     @PostMapping("/getNameList")

+ 11 - 4
hx-service/storage-restructure/src/main/java/com/fjhx/controller/supplier/SupplierKeepController.java

@@ -1,17 +1,15 @@
 package com.fjhx.controller.supplier;
 
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.springblade.core.tool.api.R;
-import com.fjhx.entity.supplier.SupplierKeep;
 import com.fjhx.params.supplier.SupplierKeepVo;
 import com.fjhx.service.supplier.SupplierKeepService;
+import org.springblade.core.tool.api.R;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Map;
+import java.util.List;
 
 /**
  * <p>
@@ -28,5 +26,14 @@ public class SupplierKeepController {
     @Autowired
     private SupplierKeepService supplierKeepService;
 
+    /**
+     * 供应商维护记录列表
+     */
+    @PostMapping("/details")
+    public R details(@RequestBody SupplierKeepVo supplierKeepVo) {
+        List<SupplierKeepVo> result = supplierKeepService.getDetails(supplierKeepVo.getId());
+        return R.success(result);
+    }
+
 }
 

+ 6 - 0
hx-service/storage-restructure/src/main/java/com/fjhx/mapper/material/MaterialMapper.java

@@ -2,6 +2,10 @@ package com.fjhx.mapper.material;
 
 import com.fjhx.entity.material.Material;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -13,4 +17,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface MaterialMapper extends BaseMapper<Material> {
 
+    List<Map<String, Object>> getMaterialBySupplierId(@Param("supplierId") Long supplierId);
+
 }

+ 10 - 0
hx-service/storage-restructure/src/main/java/com/fjhx/mapper/material/MaterialMapper.xml

@@ -2,4 +2,14 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fjhx.mapper.material.MaterialMapper">
 
+    <select id="getMaterialBySupplierId" resultType="java.util.Map">
+        select m.id              materialId,
+               m.name            materialName,
+               m.code            materialCode,
+               m.safety_warn_day safetyWarnDay
+        from supplier_price sp
+                 inner join material m on sp.material_id = m.id
+        where sp.supplier_id = #{supplierId}
+    </select>
+
 </mapper>

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

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fjhx.mapper.supplier.SupplierMapper">
 
-    <select id="getPage" resultType="java.util.Map">
+    <select id="getPage" resultType="java.util.LinkedHashMap">
         select distinct s.id,
                         s.code supplierCoded,
                         s.name supplierName,

+ 4 - 0
hx-service/storage-restructure/src/main/java/com/fjhx/service/common/CommonFileService.java

@@ -27,4 +27,8 @@ public interface CommonFileService extends StorageBaseService<CommonFile> {
 
     void delete(List<Long> idList);
 
+    List<CommonFile> fileList(Long businessId);
+
+    Map<Long, List<CommonFile>> fileMap(List<Long> businessIdList);
+
 }

+ 10 - 0
hx-service/storage-restructure/src/main/java/com/fjhx/service/common/impl/CommonFileServiceImpl.java

@@ -88,4 +88,14 @@ public class CommonFileServiceImpl extends ServiceImpl<CommonFileMapper, CommonF
         remove(CommonFile::getBusinessId, idList);
     }
 
+    @Override
+    public List<CommonFile> fileList(Long businessId) {
+        return list(CommonFile::getBusinessId, businessId);
+    }
+
+    @Override
+    public Map<Long, List<CommonFile>> fileMap(List<Long> businessId) {
+        return list(CommonFile::getBusinessId, businessId).stream().collect(Collectors.groupingBy(CommonFile::getBusinessId));
+    }
+
 }

+ 3 - 0
hx-service/storage-restructure/src/main/java/com/fjhx/service/material/MaterialService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.base.StorageBaseService;
 import com.fjhx.entity.material.Material;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -22,4 +23,6 @@ public interface MaterialService extends StorageBaseService<Material> {
 
     void setDelayPeriod(Map<String, Integer> condition);
 
+    List<Map<String, Object>> getMaterialBySupplierId(Long supplierId);
+
 }

+ 6 - 0
hx-service/storage-restructure/src/main/java/com/fjhx/service/material/impl/MaterialServiceImpl.java

@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -56,4 +57,9 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
         update(Wrappers.<Material>lambdaUpdate().set(Material::getDelayPeriod, value));
     }
 
+    @Override
+    public List<Map<String, Object>> getMaterialBySupplierId(Long supplierId) {
+        return baseMapper.getMaterialBySupplierId(supplierId);
+    }
+
 }

+ 3 - 0
hx-service/storage-restructure/src/main/java/com/fjhx/service/supplier/SupplierKeepService.java

@@ -5,6 +5,7 @@ import com.fjhx.entity.supplier.SupplierKeep;
 import com.fjhx.params.supplier.SupplierKeepVo;
 import com.fjhx.base.StorageBaseService;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -25,4 +26,6 @@ public interface SupplierKeepService extends StorageBaseService<SupplierKeep> {
 
     void delete(SupplierKeepVo supplierKeepVo);
 
+    List<SupplierKeepVo> getDetails(Long id);
+
 }

+ 26 - 3
hx-service/storage-restructure/src/main/java/com/fjhx/service/supplier/impl/SupplierKeepServiceImpl.java

@@ -1,17 +1,23 @@
 package com.fjhx.service.supplier.impl;
 
+import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fjhx.utils.WrapperUtil;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.entity.common.CommonFile;
 import com.fjhx.entity.supplier.SupplierKeep;
-import com.fjhx.params.supplier.SupplierKeepVo;
 import com.fjhx.mapper.supplier.SupplierKeepMapper;
+import com.fjhx.params.supplier.SupplierKeepVo;
+import com.fjhx.service.common.CommonFileService;
 import com.fjhx.service.supplier.SupplierKeepService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.utils.WrapperUtil;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -24,6 +30,9 @@ import java.util.Map;
 @Service
 public class SupplierKeepServiceImpl extends ServiceImpl<SupplierKeepMapper, SupplierKeep> implements SupplierKeepService {
 
+    @Autowired
+    private CommonFileService commonFileService;
+
     @Override
     public Page<SupplierKeep> getPage(Map<String, String> condition) {
 
@@ -51,4 +60,18 @@ public class SupplierKeepServiceImpl extends ServiceImpl<SupplierKeepMapper, Sup
         removeById(supplierKeepVo.getId());
     }
 
+    @Override
+    public List<SupplierKeepVo> getDetails(Long id) {
+
+        List<SupplierKeep> list = list(SupplierKeep::getSupplierId, id);
+
+        return list.stream().map(item -> {
+            SupplierKeepVo supplierKeepVo = BeanUtil.toBean(item, SupplierKeepVo.class);
+            List<CommonFile> commonFileList = commonFileService.fileList(supplierKeepVo.getFileLinkedId());
+            supplierKeepVo.setFileList(commonFileList);
+            return supplierKeepVo;
+        }).collect(Collectors.toList());
+
+    }
+
 }