Browse Source

问题修改

xiaochen 2 năm trước cách đây
mục cha
commit
341ccf1773

+ 1 - 1
src/main/java/com/tld/controller/GsAccessController.java

@@ -46,7 +46,7 @@ public class GsAccessController {
      */
     @PostMapping("addDictionary")
     @PassToken
-    public Map<String, Object> addDictionary(List<Dictionary> dictionarys){
+    public Map<String, Object> addDictionary(@RequestBody List<Dictionary> dictionarys){
         return dictionaryService.addDictionary(dictionarys);
     }
 

+ 11 - 0
src/main/java/com/tld/controller/QueryListController.java

@@ -1,6 +1,7 @@
 package com.tld.controller;
 
 import com.tld.model.*;
+import com.tld.model.Error;
 import com.tld.service.QueryListService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.*;
@@ -169,5 +170,15 @@ public class QueryListController {
     public Map<String, Object> getQueryInventory(Inventory inventory){
         return queryListService.getQueryInventory(inventory);
     }
+
+    /**
+     * 查询error错误日志信息
+     * @param error 参数
+     * @return 返回结果
+     */
+    @GetMapping("getErrorList")
+    public Map<String, Object> getErrorList(Error error){
+        return queryListService.getErrorList(error);
+    }
 }
 

+ 5 - 0
src/main/java/com/tld/mapper/ErrorMapper.java

@@ -3,7 +3,12 @@ package com.tld.mapper;
 import com.tld.model.Error;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.util.List;
+import java.util.Map;
+
 @Mapper
 public interface ErrorMapper {
     void addError(Error error);
+    List<Map<String,Object>> getErrorList(Error error);
+
 }

+ 1 - 0
src/main/java/com/tld/mapper/InventoryMapper.java

@@ -14,4 +14,5 @@ public interface InventoryMapper {
 
     List<Map<String,Object>> export(MakeInventory makeInventory);
 
+    void addInventoryLogging(MakeInventory makeInventory);
 }

+ 2 - 0
src/main/java/com/tld/mapper/QueryListMapper.java

@@ -1,6 +1,7 @@
 package com.tld.mapper;
 
 import com.tld.model.*;
+import com.tld.model.Error;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -40,4 +41,5 @@ public interface QueryListMapper {
     List<LogData> getLogData(LogData logData);
 
     List<Map<String, Object>> getQueryInventory(Inventory inventory);
+
 }

+ 16 - 0
src/main/java/com/tld/model/Error.java

@@ -31,4 +31,20 @@ public class Error implements Serializable {
      * 生成日期
      */
     private String scrq;
+    /**
+     * 开始时间
+     */
+    private String startTime;
+    /**
+     * 结束时间
+     */
+    private String endTime;
+    /**
+     * 页数
+     */
+    private int page;
+    /**
+     * 条数
+     */
+    private int limit;
 }

+ 1 - 1
src/main/java/com/tld/model/MakeInventory.java

@@ -6,7 +6,7 @@ import lombok.experimental.Accessors;
 import java.io.Serializable;
 
 /**
- * 盘点
+ * 盘点/库存表信息
  */
 @Data
 @Accessors(chain = true)

+ 4 - 0
src/main/java/com/tld/service/QueryListService.java

@@ -1,6 +1,7 @@
 package com.tld.service;
 
 import com.tld.model.*;
+import com.tld.model.Error;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -36,4 +37,7 @@ public interface QueryListService {
     Map<String, Object> getLogData(LogData logData);
 
     Map<String, Object> getQueryInventory(Inventory inventory);
+
+    Map<String, Object> getErrorList(Error error);
+
 }

+ 2 - 0
src/main/java/com/tld/service/impl/InventoryServiceImpl.java

@@ -28,6 +28,8 @@ public class InventoryServiceImpl implements InventoryService {
     public Map<String, Object> getInventoryList(MakeInventory makeInventory) {
         Map<String, Object> map = new HashMap<>();
         try {
+            //添加录入信息
+            inventoryMapper.addInventoryLogging(makeInventory);
             PageHelper.startPage(makeInventory.getPage(),makeInventory.getLimit());
             PageInfo<MakeInventory> list =  new PageInfo<>(inventoryMapper.getInventoryList(makeInventory));
             map.put("data", list);

+ 25 - 0
src/main/java/com/tld/service/impl/QueryListServiceImpl.java

@@ -3,10 +3,13 @@ package com.tld.service.impl;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.tld.excel.ExcelUtils;
+import com.tld.mapper.ErrorMapper;
 import com.tld.mapper.QueryListMapper;
 import com.tld.model.*;
+import com.tld.model.Error;
 import com.tld.service.QueryListService;
 import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.servlet.http.HttpServletRequest;
@@ -20,6 +23,9 @@ public class QueryListServiceImpl implements QueryListService {
 
     private final QueryListMapper queryListMapper;
 
+    @Autowired
+    private ErrorMapper errorMapper;
+
     @Override
     public Map<String, Object> dullGoods(Inventory inventory) {
         Map<String, Object> map = new HashMap<>();
@@ -323,4 +329,23 @@ public class QueryListServiceImpl implements QueryListService {
         }
         return map;
     }
+
+    /**
+     * 查询error错误日志信息
+     * */
+    @Override
+    public Map<String, Object> getErrorList(Error error) {
+        Map<String, Object> map = new HashMap<>();
+        try{
+            PageHelper.startPage(error.getPage(), error.getLimit());
+            PageInfo<Map<String, Object>> list = new PageInfo<>(errorMapper.getErrorList(error));
+            map.put("data", list);
+            map.put("msg", "200");
+        } catch (Exception e){
+            e.printStackTrace();
+            map.put("msg", "500");
+            map.put("errMsg", "服务器请求异常,请稍后再试");
+        }
+        return map;
+    }
 }

+ 1 - 1
src/main/resources/mapper/DictionaryMapper.xml

@@ -8,7 +8,7 @@
     </select>
     <!-- 物料字典新增 -->
     <insert id="addMaterial">
-        insert into tld_material(code,name,tld_id,specification_and_model,unit_of_measurement,size,is_not_disable,is_recommend,min_num,max_num,typ,company_number)
+        insert into tld_material(code,name,tld_id,specification_and_model,unit_of_measurement,size,is_not_disable,is_recommend,min_num,max_num,type,company_number)
         values(#{code},#{name},#{tldId},#{specificationAndModel},#{unitOfMeasurement},'0','0','0',"0","0",#{typeVal},#{companyNumber})
     </insert>
     <!-- 字典新增 -->

+ 25 - 0
src/main/resources/mapper/ErrorMapper.xml

@@ -6,4 +6,29 @@
     <insert id="addError">
         insert into tld_error (url,error_info,data_val,scrq) value (#{url},#{errorInfo},#{dataVal},now())
     </insert>
+    <!--查询error错误日志信息-->
+    <select id="getErrorList" resultType="java.util.Map">
+        SELECT
+            id,
+            url,
+            error_info,
+            data_val,
+            scrq
+        FROM
+            tld_error
+        <trim prefix="WHERE" prefixOverrides="and |or">
+            <if test="startTime != null and startTime != ''">
+                and scrq <![CDATA[>=]]> #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                and scrq <![CDATA[<=]]> #{endTime}
+            </if>
+            <if test="url != null and url != ''">
+                and url like CONCAT(CONCAT('%', #{url}), '%')
+            </if>
+        </trim>
+        ORDER BY scrq DESC
+    </select>
+
+
 </mapper>

+ 5 - 1
src/main/resources/mapper/InventoryMapper.xml

@@ -7,7 +7,11 @@
         insert into tld_inventory(storage_location_code,wllb_class,library_type,material_id,amount,total,totime,hold,amount_lock,account_sleeve,wbs,supplier_id,serial,wllb_code,produc_date,scrq,produc_batch,attribute)
         values (#{storageLocationCode},#{wllbClass},#{libraryType},#{materialId},#{amount},#{total},#{totime},#{hold},#{amountLock},#{accountSleeve},#{wbs},#{supplierId},#{serial},#{wllbCode},#{producDate},#{scrq},#{producBatch},#{attribute})
     </insert>
-
+    <!--添加录入盘点信息-->
+    <insert id="addInventoryLogging">
+        insert into tld_inventory_logging(storage_location_code,wllb_class,library_type,material_id,amount,total,totime,hold,amount_lock,account_sleeve,wbs,supplier_id,serial,wllb_code,produc_date,scrq,produc_batch,attribute)
+        values (#{storageLocationCode},#{wllbClass},#{libraryType},#{materialId},#{amount},#{total},#{totime},#{hold},#{amountLock},#{accountSleeve},#{wbs},#{supplierId},#{serial},#{wllbCode},#{producDate},#{scrq},#{producBatch},#{attribute})
+    </insert>
     <!--查询盘点-->
     <select id="getInventoryList" resultType="com.tld.model.MakeInventory">
         SELECT