Преглед на файлове

Merge remote-tracking branch 'origin/master_huangjunjie'

13660505945 преди 1 месец
родител
ревизия
54c28d0b01

+ 1 - 1
src/main/java/com/jsh/erp/controller/pda/PdaController.java

@@ -276,7 +276,7 @@ public class PdaController extends BaseController {
 
     @PostMapping("/inventoryInquiry")
     @ApiOperation("存货查询-商品存货查询")
-    public TableDataInfo inventoryInquiry(@RequestBody PDAInventoryDTO pdaInventoryDTO){
+    public TableDataInfo inventoryInquiry(@RequestBody PDAInventoryDTO pdaInventoryDTO) throws Exception {
         startPage();
         List<PDADepotItemVO> list = materialService.inventoryInquiry(pdaInventoryDTO);
         return getDataTable(list);

+ 5 - 0
src/main/java/com/jsh/erp/datasource/pda/dto/PDAInventoryDTO.java

@@ -4,6 +4,8 @@ package com.jsh.erp.datasource.pda.dto;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 /**
  * 存货查询接口
  */
@@ -22,4 +24,7 @@ public class PDAInventoryDTO {
     @ApiModelProperty("关键字")
     private String keyword;
 
+    @ApiModelProperty("商品种类ID数组")
+    private List<Long> categoryIds;
+
 }

+ 1 - 1
src/main/java/com/jsh/erp/filter/LogCostFilter.java

@@ -55,7 +55,7 @@ public class LogCostFilter implements Filter {
             return;
         }
         if (requestUrl != null && (requestUrl.contains("/doc.html") ||
-            requestUrl.contains("/user/pdaLogin") || requestUrl.contains("/pda/downloadApk") || requestUrl.contains("/pda/selectVersion") ||
+            requestUrl.contains("/user/pdaLogin") ||
             requestUrl.contains("/user/login") || requestUrl.contains("/user/register") || requestUrl.contains("/user/randomImage")
             ||requestUrl.contains("/open-api"))) {
             chain.doFilter(request, response);

+ 1 - 1
src/main/java/com/jsh/erp/service/MaterialService.java

@@ -193,7 +193,7 @@ public interface MaterialService extends IService<Material> {
      * pdaInventoryDTO
      * @return
      */
-    List<PDADepotItemVO> inventoryInquiry(PDAInventoryDTO pdaInventoryDTO);
+    List<PDADepotItemVO> inventoryInquiry(PDAInventoryDTO pdaInventoryDTO) throws Exception;
 
     /**
      * 查询库位树

+ 1 - 0
src/main/java/com/jsh/erp/service/UserBusinessService.java

@@ -80,6 +80,7 @@ public class UserBusinessService {
             String value = userBusiness.getValue();
             String newValue = value.replaceAll(",","\\]\\[");
             newValue = newValue.replaceAll("\\[0\\]","").replaceAll("\\[\\]","");
+            newValue = newValue.replace("\"", "");
             userBusiness.setValue(newValue);
             result=userBusinessMapper.updateByPrimaryKeySelective(userBusiness);
             logService.insertLog("关联关系", BusinessConstants.LOG_OPERATION_TYPE_EDIT, request);

+ 14 - 3
src/main/java/com/jsh/erp/service/impl/MaterialServiceImpl.java

@@ -2003,7 +2003,9 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
     }
 
     @Override
-    public List<PDADepotItemVO> inventoryInquiry(PDAInventoryDTO pdaInventoryDTO) {
+    public List<PDADepotItemVO> inventoryInquiry(PDAInventoryDTO pdaInventoryDTO) throws Exception {
+        //查询类型id的子类型
+        pdaInventoryDTO.setCategoryIds(selectCategoryIds(pdaInventoryDTO.getCategoryId()));
         return materialMapperEx.inventoryInquiry(pdaInventoryDTO);
     }
 
@@ -2018,9 +2020,9 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
             String [] str = s.split("-");
             if (map.get(str[0]) == null){
                 List<String> list = new ArrayList<>();
-                list.add(str[1]);
                 map.put(str[0],list);
-            }else {
+            }
+            if (str.length > 2){
                 map.get(str[0]).add(str[1]);
             }
         }
@@ -2136,4 +2138,13 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
         return materials;
     }
 
+    public List<Long> selectCategoryIds(Long id) throws Exception {
+        List<Long> longs = new ArrayList<>();
+        longs.add(id);
+        List<MaterialCategory> list = materialCategoryService.list(new LambdaQueryWrapperX<MaterialCategory>().eq(MaterialCategory::getParentId,id).eq(MaterialCategory::getDeleteFlag,"0"));
+        for (MaterialCategory materialCategory : list) {
+            longs.addAll(selectCategoryIds(materialCategory.getId()));
+        }
+        return longs;
+    }
 }

+ 1 - 9
src/main/resources/application-dev.yml

@@ -1,6 +1,6 @@
 server:
   #端口号
-  port: 9080
+  port: 8080
   tomcat:
     basedir: F:/kaifa/temp #文件上传临时路径
 
@@ -30,11 +30,3 @@ aliyun:
     bucketName: xiangli-erp
     miniProgramAppId: wxd716cb744e32271a
     linkUrl: https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com
-tesco:
-  sycnErpMaterialStockUrl: http://localhost:8088/no-auth/erp/sync-stock
-  sycnErpMaterialPriceUrl: http://localhost:8088/no-auth/erp/sync-saleprice
-mybatis-plus:
-  configuration:
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
-    #    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
-    default-executor-type: simple

+ 0 - 4
src/main/resources/application-pro.yml

@@ -30,7 +30,3 @@ aliyun:
     bucketName: xiangli-erp
     miniProgramAppId: wxd716cb744e32271a
     linkUrl: https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com
-
-tesco:
-  sycnErpMaterialStockUrl: https://tesco.xianglitech.com.cn/prod-api/no-auth/erp/sync-stock
-  sycnErpMaterialPriceUrl: https://tesco.xianglitech.com.cn/prod-api/no-auth/erp/sync-saleprice

+ 0 - 4
src/main/resources/application-test.yml

@@ -30,7 +30,3 @@ aliyun:
     bucketName: xiangli-erp
     miniProgramAppId: wxd716cb744e32271a
     linkUrl: https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com
-
-tesco:
-  sycnErpMaterialStockUrl: https://test.xianglitech.com.cn/stage-api/no-auth/erp/sync-stock
-  sycnErpMaterialPriceUrl: https://test.xianglitech.com.cn/stage-api/no-auth/erp/sync-saleprice

+ 1 - 1
src/main/resources/mapper_xml/MaterialExtendMapper.xml

@@ -482,7 +482,7 @@
   </select>
 
   <select id="selectPosition"  resultType="String">
-    SELECT DISTINCT position FROM jsh_material_extend WHERE position IS NOT NULL AND ifnull(delete_Flag,'0') !='1'
+    SELECT DISTINCT position FROM jsh_material_extend WHERE position IS NOT NULL AND position != "" AND ifnull(delete_Flag,'0') !='1'
   </select>
 
 </mapper>

+ 9 - 5
src/main/resources/mapper_xml/MaterialMapperEx.xml

@@ -849,8 +849,8 @@
         ORDER BY m.id DESC, me.default_flag DESC, me.production_date,me.batch_number ASC
     </select>
 
-    <select id="inventoryInquiry" resultType="com.jsh.erp.datasource.pda.vo.PDADepotItemVO">
-        select m.*,u.name unit_name,mc.name categoryName,me.bar_code,me.id meId,me.commodity_unit,me.sku,
+    <select id="inventoryInquiry" parameterType="com.jsh.erp.datasource.pda.dto.PDAInventoryDTO" resultType="com.jsh.erp.datasource.pda.vo.PDADepotItemVO">
+        select m.id materialId,m.name materialName,m.standard materialStandard,u.name unit_name,mc.name categoryName,me.bar_code,me.id meId,me.commodity_unit,me.sku,
         me.production_date,me.expiry_num,me.supplier_id,me.batch_number,me.depot_id,me.position,d.`name` depotName,s.supplier supplierName
         from jsh_material m
         left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
@@ -861,15 +861,19 @@
         where m.enabled = 1
         and me.id is not null
         <if test="keyword != null and keyword !=''">
-            <bind name="bindKey" value="'%'+materialParam+'%'"/>
-            and me.batch_number like #{bindKey} or m.name like #{bindKey}
+            <bind name="bindKey" value="'%'+keyword+'%'"/>
+            and (me.batch_number like #{bindKey} or m.name like #{bindKey})
         </if>
         <if test="position != null and position !=''">
             <bind name="bindPosition" value="'%'+position+'%'"/>
             and me.position like #{bindPosition}
         </if>
         <if test="categoryId != null">
-            and m.category_id = #{category_id}
+            and m.category_id IN (
+            <foreach collection="categoryIds" item="item" separator=",">
+                #{item}
+            </foreach>
+            )
         </if>
         <if test="type == 'have'">
             and me.inventory > 0