فهرست منبع

杰生重构 供应商

home 2 سال پیش
والد
کامیت
4f8bb93769

+ 2 - 2
hx-service-api/storage-restructure-api/src/main/java/com/fjhx/entity/supplier/Supplier.java

@@ -35,7 +35,7 @@ public class Supplier extends StorageBaseEntity {
     /**
      * 绑定用户账号
      */
-    private Long bindUserAccount;
+    private String bindUserAccount;
 
     /**
      * 物料类型
@@ -80,7 +80,7 @@ public class Supplier extends StorageBaseEntity {
     /**
      * 成立日期
      */
-    private Date establishDate;
+    private String establishDate;
 
     /**
      * 注册资本

+ 5 - 0
hx-service-api/storage-restructure-api/src/main/java/com/fjhx/params/supplier/SupplierPriceVo.java

@@ -14,4 +14,9 @@ import lombok.EqualsAndHashCode;
 @EqualsAndHashCode(callSuper = true)
 public class SupplierPriceVo extends SupplierPrice {
 
+    /**
+     * 备注
+     */
+    private String remarks;
+
 }

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

@@ -74,6 +74,13 @@ public class MaterialController {
         return R.success();
     }
 
+    /**
+     * 物料用途
+     */
+    @PostMapping("/getPurpose")
+    public R getPurpose() {
+        return R.success(materialService.getDistinctList(Material::getPurpose));
+    }
 
 }
 

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

@@ -1,7 +1,9 @@
 package com.fjhx.controller.supplier;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.params.FlowVo;
 import com.fjhx.params.supplier.SupplierPriceVo;
+import com.fjhx.service.flow.SupplierPriceUpdateFlow;
 import com.fjhx.service.supplier.SupplierPriceService;
 import org.springblade.core.tool.api.R;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,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;
 
 /**
@@ -27,6 +30,15 @@ public class SupplierPriceController {
     @Autowired
     private SupplierPriceService supplierPriceService;
 
+    @Autowired
+    private SupplierPriceUpdateFlow supplierPriceUpdateFlow;
+
+    @PostMapping("/list")
+    public R list(@RequestBody Map<String, String> condition) {
+        List<Map<String, Object>> result = supplierPriceService.getList(condition);
+        return R.success(result);
+    }
+
     @PostMapping("/page")
     public R page(@RequestBody Map<String, String> condition) {
         Page<Map<String, Object>> result = supplierPriceService.getPage(condition);
@@ -39,6 +51,18 @@ public class SupplierPriceController {
         return R.success();
     }
 
+    @PostMapping("/updateFlowCreate")
+    public R updateFlowCreate(@RequestBody SupplierPriceVo supplierPriceVo) {
+        supplierPriceUpdateFlow.create(supplierPriceVo);
+        return R.success();
+    }
+
+    @PostMapping("/updateFlowJump")
+    public R updateFlowJump(@RequestBody FlowVo flowVo) {
+        supplierPriceUpdateFlow.jump(flowVo);
+        return R.success();
+    }
+
     @PostMapping("/delete")
     public R delete(@RequestBody SupplierPriceVo supplierPriceVo) {
         supplierPriceService.delete(supplierPriceVo);

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

@@ -1,11 +1,12 @@
 package com.fjhx.mapper.supplier;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.entity.supplier.SupplierPrice;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -18,6 +19,8 @@ import java.util.Map;
  */
 public interface SupplierPriceMapper extends BaseMapper<SupplierPrice> {
 
+    List<Map<String, Object>> getList(@Param("ew") QueryWrapper<?> wrapper);
+
     Page<Map<String, Object>> getPage(@Param("page") Page<SupplierPrice> page, @Param("ew") QueryWrapper<?> wrapper);
 
 }

+ 10 - 2
hx-service/storage-restructure/src/main/java/com/fjhx/mapper/supplier/SupplierPriceMapper.xml

@@ -2,7 +2,15 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fjhx.mapper.supplier.SupplierPriceMapper">
 
+    <select id="getList" resultType="java.util.LinkedHashMap">
+        <include refid="selectPrice"/>
+    </select>
+
     <select id="getPage" resultType="java.util.LinkedHashMap">
+        <include refid="selectPrice"/>
+    </select>
+
+    <sql id="selectPrice">
         select sp.id,
                m.code            materialCode,
                m.name            materialName,
@@ -12,9 +20,9 @@
                sp.price,
                m.safety_warn_day safetyWarnDay
         from supplier_price sp
-                 inner join supplier s on sp.material_id = s.id
+                 inner join supplier s on sp.supplier_id = s.id
                  inner join material m on sp.material_id = m.id
             ${ew.customSqlSegment}
-    </select>
+    </sql>
 
 </mapper>

+ 46 - 0
hx-service/storage-restructure/src/main/java/com/fjhx/service/flow/SupplierPriceUpdateFlow.java

@@ -0,0 +1,46 @@
+package com.fjhx.service.flow;
+
+import com.fjhx.entity.supplier.SupplierPrice;
+import com.fjhx.params.FlowVo;
+import com.fjhx.params.supplier.SupplierPriceVo;
+import com.fjhx.service.supplier.SupplierPriceService;
+import com.fjhx.utils.ExampleAbstract;
+import com.fjhx.utils.FlowConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 供应商价格维护修改审批
+ */
+@Service
+public class SupplierPriceUpdateFlow {
+
+    @Autowired
+    private SupplierPriceService supplierPriceService;
+
+    private FlowConstructor getFlowConstructor() {
+        return FlowConstructor.init(new ExampleAbstract() {
+
+            @Override
+            public String getCode() {
+                return "js_supplierPriceUpdate";
+            }
+
+            @Override
+            public void end() {
+                SupplierPrice supplierPrice = getCacheData(SupplierPrice.class);
+                supplierPriceService.updateById(supplierPrice);
+            }
+
+        });
+    }
+
+    public void create(SupplierPriceVo supplierPriceVo) {
+        getFlowConstructor().create(supplierPriceVo.getId(), "价格维护", supplierPriceVo.getRemarks(), supplierPriceVo);
+    }
+
+    public void jump(FlowVo flowVo) {
+        getFlowConstructor().jump(flowVo);
+    }
+
+}

+ 4 - 1
hx-service/storage-restructure/src/main/java/com/fjhx/service/supplier/SupplierPriceService.java

@@ -1,10 +1,11 @@
 package com.fjhx.service.supplier;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.base.StorageBaseService;
 import com.fjhx.entity.supplier.SupplierPrice;
 import com.fjhx.params.supplier.SupplierPriceVo;
-import com.fjhx.base.StorageBaseService;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -17,6 +18,8 @@ import java.util.Map;
  */
 public interface SupplierPriceService extends StorageBaseService<SupplierPrice> {
 
+    List<Map<String, Object>> getList(Map<String, String> condition);
+
     Page<Map<String, Object>> getPage(Map<String, String> condition);
 
     void add(SupplierPriceVo supplierPriceVo);

+ 17 - 7
hx-service/storage-restructure/src/main/java/com/fjhx/service/supplier/impl/SupplierPriceServiceImpl.java

@@ -10,6 +10,7 @@ import com.fjhx.service.supplier.SupplierPriceService;
 import com.fjhx.utils.WrapperUtil;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -24,14 +25,14 @@ import java.util.Map;
 public class SupplierPriceServiceImpl extends ServiceImpl<SupplierPriceMapper, SupplierPrice> implements SupplierPriceService {
 
     @Override
-    public Page<Map<String, Object>> getPage(Map<String, String> condition) {
-
-        QueryWrapper<?> wrapper = WrapperUtil.init(condition)
-                .keyword("m.name", "m.code")
-                .eq("s.id", "supplierId")
-                .createTimeDesc()
-                .getWrapper();
+    public List<Map<String, Object>> getList(Map<String, String> condition) {
+        QueryWrapper<?> wrapper = getWrapper(condition);
+        return baseMapper.getList(wrapper);
+    }
 
+    @Override
+    public Page<Map<String, Object>> getPage(Map<String, String> condition) {
+        QueryWrapper<?> wrapper = getWrapper(condition);
         return baseMapper.getPage(createPage(condition), wrapper);
     }
 
@@ -50,4 +51,13 @@ public class SupplierPriceServiceImpl extends ServiceImpl<SupplierPriceMapper, S
         removeById(supplierPriceVo.getId());
     }
 
+    private QueryWrapper<?> getWrapper(Map<String, String> condition) {
+        return WrapperUtil.init(condition)
+                .keyword("m.name", "m.code", "s.name")
+                .eq("s.id", "supplierId")
+                .notDelete("sp")
+                .createTimeDesc()
+                .getWrapper();
+    }
+
 }