Forráskód Böngészése

增加根据wcs物料类型查询wms产品方法

k 2 éve
szülő
commit
7ebd66d5b6

+ 25 - 16
warewms-base/src/main/java/com/ruoyi/base/service/IBaseSkuService.java

@@ -1,68 +1,77 @@
 package com.ruoyi.base.service;
 
 import java.util.List;
+
 import com.ruoyi.base.domain.BaseSku;
 
 /**
  * 物料信息Service接口
- * 
+ *
  * @author andy
  * @date 2022-02-21
  */
-public interface IBaseSkuService 
-{
+public interface IBaseSkuService {
     /**
      * 查询物料信息
-     * 
+     *
      * @param customerId 物料信息主键
      * @return 物料信息
      */
-     BaseSku selectBaseSkuByCustomerId(String customerId,String sku);
+    BaseSku selectBaseSkuByCustomerId(String customerId, String sku);
 
     /**
      * 查询物料信息列表
-     * 
+     *
      * @param baseSku 物料信息
      * @return 物料信息集合
      */
-     List<BaseSku> selectBaseSkuList(BaseSku baseSku);
+    List<BaseSku> selectBaseSkuList(BaseSku baseSku);
+
+    /**
+     * 根据Wcs物料类型查询
+     *
+     * @param materialType
+     * @return
+     */
+    BaseSku selectBaseSkuByMaterialType(String materialType);
 
     /**
      * 新增物料信息
-     * 
+     *
      * @param baseSku 物料信息
      * @return 结果
      */
-     int insertBaseSku(BaseSku baseSku);
+    int insertBaseSku(BaseSku baseSku);
 
     /**
      * 修改物料信息
-     * 
+     *
      * @param baseSku 物料信息
      * @return 结果
      */
-     int updateBaseSku(BaseSku baseSku);
+    int updateBaseSku(BaseSku baseSku);
 
     /**
      * 批量删除物料信息
-     * 
+     *
      * @param skus 需要删除的物料信息主键集合
      * @return 结果
      */
-     int deleteBaseSkuBySkus(String[] skus);
+    int deleteBaseSkuBySkus(String[] skus);
 
     /**
      * 删除物料信息信息
-     * 
+     *
      * @param customerId 物料信息主键
      * @return 结果
      */
-     int deleteBaseSkuByCustomerId(String customerId);
+    int deleteBaseSkuByCustomerId(String customerId);
 
     /**
      * 物料类型查询物料
+     *
      * @param list
      * @return
      */
-     List<BaseSku> selectBaseSkuBySkuTypeList(List<String> list);
+    List<BaseSku> selectBaseSkuBySkuTypeList(List<String> list);
 }

+ 16 - 8
warewms-base/src/main/java/com/ruoyi/base/service/impl/BaseSkuServiceImpl.java

@@ -10,19 +10,19 @@ import com.ruoyi.base.service.IBaseSkuService;
 
 /**
  * 物料信息Service业务层处理
- * 
+ *
  * @author andy
  * @date 2022-02-21
  */
 @Service
-public class BaseSkuServiceImpl implements IBaseSkuService 
+public class BaseSkuServiceImpl implements IBaseSkuService
 {
     @Autowired
     private BaseSkuMapper baseSkuMapper;
 
     /**
      * 查询物料信息
-     * 
+     *
      * @param customerId 物料信息主键
      * @return 物料信息
      */
@@ -34,7 +34,7 @@ public class BaseSkuServiceImpl implements IBaseSkuService
 
     /**
      * 查询物料信息列表
-     * 
+     *
      * @param baseSku 物料信息
      * @return 物料信息
      */
@@ -44,9 +44,17 @@ public class BaseSkuServiceImpl implements IBaseSkuService
         return baseSkuMapper.selectBaseSkuList(baseSku);
     }
 
+    @Override
+    public BaseSku selectBaseSkuByMaterialType(String materialType) {
+        BaseSku baseSku = new BaseSku();
+        baseSku.setDesc2(materialType);
+        List<BaseSku> baseSkus = this.selectBaseSkuList(baseSku);
+        return baseSkus.get(0);
+    }
+
     /**
      * 新增物料信息
-     * 
+     *
      * @param baseSku 物料信息
      * @return 结果
      */
@@ -60,7 +68,7 @@ public class BaseSkuServiceImpl implements IBaseSkuService
 
     /**
      * 修改物料信息
-     * 
+     *
      * @param baseSku 物料信息
      * @return 结果
      */
@@ -73,7 +81,7 @@ public class BaseSkuServiceImpl implements IBaseSkuService
 
     /**
      * 批量删除物料信息
-     * 
+     *
      * @param skus 需要删除的物料信息主键
      * @return 结果
      */
@@ -85,7 +93,7 @@ public class BaseSkuServiceImpl implements IBaseSkuService
 
     /**
      * 删除物料信息信息
-     * 
+     *
      * @param customerId 物料信息主键
      * @return 结果
      */

+ 6 - 5
warewms-base/src/main/resources/mapper/base/BaseSkuMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.base.mapper.BaseSkuMapper">
-    
+
     <resultMap type="BaseSku" id="BaseSkuResult">
         <result property="customerId"    column="customer_id"    />
         <result property="sku"    column="sku"    />
@@ -70,20 +70,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         b.qc_check, b.create_by, b.create_time, b.update_by, b.update_time, b.remark
         from base_sku b
         left join base_sku_type sk on b.sku_type = sk.item_code
-        <where>  
+        <where>
             <if test="customerId != null  and customerId != ''"> and customer_id = #{customerId}</if>
             <if test="sku != null  and sku != ''"> and sku like concat('%', #{sku}, '%')</if>
             <if test="skuType != null  and skuType != ''"> and sku_type = #{skuType}</if>
             <if test="activeFlag != null  and activeFlag != ''"> and active_flag = #{activeFlag}</if>
+            <if test="desc2 != null  and desc2 != ''"> and desc2 = #{desc2}</if>
         </where>
         order by create_time desc
     </select>
-    
+
     <select id="selectBaseSkuByCustomerId" parameterType="String" resultMap="BaseSkuResult">
         <include refid="selectBaseSkuVo"/>
         where customer_id = #{customerId} and sku = #{sku}
     </select>
-        
+
     <insert id="insertBaseSku" parameterType="BaseSku">
         insert into base_sku
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -270,4 +271,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
         and active_flag = 'Y'
     </select>
-</mapper>
+</mapper>