Browse Source

问题修改

xiaochen 2 years atrás
parent
commit
a45dd96979

+ 9 - 0
src/main/java/com/tld/controller/AskGoodsController.java

@@ -405,4 +405,13 @@ public class AskGoodsController {
         askGoodsService.otherWarehousingReturnError();
     }
 
+    /**
+     * 转JSON
+     * */
+    @GetMapping("jsonError")
+    @PassToken
+    public void jsonError(){
+        askGoodsService.jsonError();
+    }
+
 }

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

@@ -225,4 +225,6 @@ public interface AskGoodsMapper {
     List<AskGoods> getAskGoodsMaterialTest(AskGoods askGoods);
 
     List<Error> otherWarehousingReturnError();
+
+    List<Error> getJsonError();
 }

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

@@ -95,4 +95,6 @@ public interface AskGoodsService {
     void shiftingParkingReturn();
 
     void otherWarehousingReturnError();
+
+    void jsonError();
 }

+ 27 - 9
src/main/java/com/tld/service/impl/AskGoodsServiceImpl.java

@@ -113,7 +113,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
             map.put("msg","成功");
         }catch (Exception e){
             e.printStackTrace();
-            map.put("status", "0009");
+            map.put("status", "0002");
             map.put("msg", "服务器请求异常,请稍后再试");
         }
         return map;
@@ -408,7 +408,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
                                                 ReqOutStocks1.put("ReqOutStocks", retunList2);
 
                                                 JSONObject ReqOutStocks2 = new JSONObject();
-                                                ReqOutStocks2.put("strJson",ReqOutStocks1);
+                                                ReqOutStocks2.put("strJson",ReqOutStocks1.toJSONString());
 
                                                 //如果失败存入报错信息跟数据
                                                 error.setErrorInfo(map1.get("FailReason").toString());
@@ -862,7 +862,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
                                                 ReqOutStocks1.put("BILLs", retunList2);
 
                                                 JSONObject ReqOutStocks2 = new JSONObject();
-                                                ReqOutStocks2.put("strJson",ReqOutStocks1);
+                                                ReqOutStocks2.put("strJson",ReqOutStocks1.toJSONString());
 
                                                 //如果失败存入报错信息跟数据
                                                 error.setErrorInfo(map1.get("FailReason").toString());
@@ -1032,7 +1032,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
                                                 ReqOutStocks1.put("BILLs", retunList2);
 
                                                 JSONObject ReqOutStocks2 = new JSONObject();
-                                                ReqOutStocks2.put("strJson",ReqOutStocks1);
+                                                ReqOutStocks2.put("strJson",ReqOutStocks1.toJSONString());
 
                                                 //如果失败存入报错信息跟数据
                                                 error.setErrorInfo(map1.get("FailReason").toString());
@@ -1162,8 +1162,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
                                                 ReqOutStocks1.put("BILLs", retunList2);
 
                                                 JSONObject ReqOutStocks2 = new JSONObject();
-                                                ReqOutStocks2.put("strJson",ReqOutStocks1);
-
+                                                ReqOutStocks2.put("strJson",ReqOutStocks1.toJSONString());
                                                 error.setErrorInfo(map1.get("FailReason").toString());
                                                 error.setUrl(url);
                                                 error.setDataVal(ReqOutStocks2.toJSONString()).setType("生产收货");
@@ -1284,7 +1283,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
                                                     ReqOutStocks1.put("BILLs", retunList2);
 
                                                     JSONObject ReqOutStocks2 = new JSONObject();
-                                                    ReqOutStocks2.put("strJson",ReqOutStocks1);
+                                                    ReqOutStocks2.put("strJson",ReqOutStocks1.toJSONString());
 
                                                     //如果失败存入报错信息跟数据
                                                     error.setErrorInfo(map1.get("FailReason").toString());
@@ -1407,7 +1406,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
                                                 ReqOutStocks1.put("ReqOutStocks", retunList2);
 
                                                 JSONObject ReqOutStocks2 = new JSONObject();
-                                                ReqOutStocks2.put("strJson",ReqOutStocks1);
+                                                ReqOutStocks2.put("strJson",ReqOutStocks1.toJSONString());
 
                                                 //如果失败存入报错信息跟数据
                                                 error.setErrorInfo(map1.get("FailReason").toString());
@@ -1531,7 +1530,7 @@ public class AskGoodsServiceImpl implements AskGoodsService {
                                                 ReqOutStocks1.put("ReqOutStocks", retunList2);
 
                                                 JSONObject ReqOutStocks2 = new JSONObject();
-                                                ReqOutStocks2.put("strJson",ReqOutStocks1);
+                                                ReqOutStocks2.put("strJson",ReqOutStocks1.toJSONString());
 
                                                 //如果失败存入报错信息跟数据
                                                 error.setErrorInfo(map1.get("FailReason").toString());
@@ -1846,6 +1845,25 @@ public class AskGoodsServiceImpl implements AskGoodsService {
         }
     }
 
+    /**
+     * 转JSON
+     * */
+    @Override
+    public void jsonError() {
+        List<Error> errorList = askGoodsMapper.getJsonError();
+        for (Error error : errorList) {
+            System.out.println("字符串为:"+error.getDataVal());
+            JSONObject jsonObject = JSONObject.parseObject(error.getDataVal());
+
+            JSONObject jsonObject1 = JSONObject.parseObject(jsonObject.get("strJson").toString());
+
+            JSONObject jsonObject2 = new JSONObject();
+            jsonObject2.put("strJson",jsonObject1.toJSONString());
+
+            System.out.println("toJsonString字符串为:"+ jsonObject2.toJSONString());
+        }
+    }
+
     @Override
     public void test() {
         AskGoods askGoods = new AskGoods();

+ 1 - 1
src/main/java/com/tld/service/impl/DictionaryServiceImpl.java

@@ -95,7 +95,7 @@ public class DictionaryServiceImpl implements DictionaryService {
             map.put("msg", "成功");
         } catch (Exception e) {
             e.printStackTrace();
-            map.put("status", "0009");
+            map.put("status", "0002");
             map.put("msg", "服务器请求异常,请稍后再试");
         }
 //        finally {

+ 7 - 7
src/main/java/com/tld/service/impl/InviteServiceImpl.java

@@ -219,7 +219,7 @@ public class InviteServiceImpl implements InviteService {
             map.put("msg","成功");
         }catch (Exception e){
             e.printStackTrace();
-            map.put("status", "0009");
+            map.put("status", "0002");
             map.put("msg", "服务器请求异常,请稍后再试");
         }
         return map;
@@ -271,7 +271,7 @@ public class InviteServiceImpl implements InviteService {
             map.put("msg","成功");
         }catch (Exception e){
             e.printStackTrace();
-            map.put("status", "0009");
+            map.put("status", "0002");
             map.put("msg", "服务器请求异常,请稍后再试");
         }
         return map;
@@ -293,7 +293,7 @@ public class InviteServiceImpl implements InviteService {
             map.put("msg","成功");
         }catch (Exception e){
             e.printStackTrace();
-            map.put("status", "0009");
+            map.put("status", "0002");
             map.put("msg", "服务器请求异常,请稍后再试");
         }
         return map;
@@ -346,7 +346,7 @@ public class InviteServiceImpl implements InviteService {
             map.put("msg","成功");
         }catch (Exception e){
             e.printStackTrace();
-            map.put("status", "0009");
+            map.put("status", "0002");
             map.put("msg", "服务器请求异常,请稍后再试");
         }
         return map;
@@ -371,7 +371,7 @@ public class InviteServiceImpl implements InviteService {
             map.put("msg","成功");
         }catch (Exception e){
             e.printStackTrace();
-            map.put("status", "0009");
+            map.put("status", "0002");
             map.put("msg", "服务器请求异常,请稍后再试");
         }
         return map;
@@ -396,7 +396,7 @@ public class InviteServiceImpl implements InviteService {
             map.put("msg","成功");
         }catch (Exception e){
             e.printStackTrace();
-            map.put("status", "0009");
+            map.put("status", "0002");
             map.put("msg", "服务器请求异常,请稍后再试");
         }
         return map;
@@ -492,7 +492,7 @@ public class InviteServiceImpl implements InviteService {
             map.put("msg","成功");
         }catch (Exception e){
             e.printStackTrace();
-            map.put("status", "0009");
+            map.put("status", "0002");
             map.put("msg", "服务器请求异常,请稍后再试");
         }
         return map;

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

@@ -602,7 +602,7 @@ public class QueryListServiceImpl implements QueryListService {
                                             ReqOutStocks1.put("ReqOutStocks", retunList2);
 
                                             JSONObject ReqOutStocks2 = new JSONObject();
-                                            ReqOutStocks2.put("strJson",ReqOutStocks1);
+                                            ReqOutStocks2.put("strJson",ReqOutStocks1.toJSONString());
 
                                             //如果失败存入报错信息跟数据
                                             String msg = null ;
@@ -628,7 +628,7 @@ public class QueryListServiceImpl implements QueryListService {
                                                 ReqOutStocks1.put("ReqOutStocks", retunList2);
 
                                                 JSONObject ReqOutStocks2 = new JSONObject();
-                                                ReqOutStocks2.put("strJson",ReqOutStocks1);
+                                                ReqOutStocks2.put("strJson",ReqOutStocks1.toJSONString());
 
                                                 //如果失败存入报错信息跟数据
                                                 String msg = null ;
@@ -650,7 +650,7 @@ public class QueryListServiceImpl implements QueryListService {
                                                 ReqOutStocks1.put("ReqOutStocks", retunList2);
 
                                                 JSONObject ReqOutStocks2 = new JSONObject();
-                                                ReqOutStocks2.put("strJson",ReqOutStocks1);
+                                                ReqOutStocks2.put("strJson",ReqOutStocks1.toJSONString());
 
                                                 //如果失败存入报错信息跟数据
                                                 error.setErrorInfo(msg);

+ 4 - 3
src/main/java/com/tld/service/impl/ReceiveGoodsSerivceImpl.java

@@ -126,6 +126,7 @@ public class ReceiveGoodsSerivceImpl implements ReceiveGoodsSerivce {
                 if (receiveGoodsMapper.getReceiveGoodsf(receiveGoods1) == 0) {
                     receiveGoodsMapper.addReceiveGoodsf(receiveGoods);//添加父表
                 }
+                //判断是否重复
                 receiveGoodsMapper.addReceiveGoods(receiveGoods);//添加子表
 //                   }
                 receiveGoodsMapper.updatePurchaseType(receiveGoods);
@@ -139,7 +140,7 @@ public class ReceiveGoodsSerivceImpl implements ReceiveGoodsSerivce {
            map.put("msg","成功");
         } catch (Exception e) {
             e.printStackTrace();
-            map.put("status", "0009");
+            map.put("status", "0002");
             map.put("msg", "服务器请求异常,请稍后再试");
         }
         return map;
@@ -156,7 +157,7 @@ public class ReceiveGoodsSerivceImpl implements ReceiveGoodsSerivce {
             map.put("msg","成功");
         } catch (Exception e) {
             e.printStackTrace();
-            map.put("status", "0009");
+            map.put("status", "0002");
             map.put("msg", "服务器请求异常,请稍后再试");
         }
         return map;
@@ -182,7 +183,7 @@ public class ReceiveGoodsSerivceImpl implements ReceiveGoodsSerivce {
             map.put("msg","成功");
         } catch (Exception e) {
             e.printStackTrace();
-            map.put("status", "0009");
+            map.put("status", "0002");
             map.put("msg", "服务器请求异常,请稍后再试");
         }
         return map;

+ 6 - 1
src/main/resources/mapper/AskGoodsMapper.xml

@@ -1472,7 +1472,7 @@
     <!--出库错误信息回调-->
     <select id="getOutgoingReturnError" resultType="com.tld.model.Error">
         select id,url,error_info,data_val,scrq,type,transmission_type from tld_error
-        where transmission_type = '1'
+        where transmission_type = '3'
         and type = '出库回传'
     </select>
     <!--查询销售出库导入数据-->
@@ -1578,6 +1578,11 @@
         where transmission_type = '1'
         and type = '其它入库'
     </select>
+    <select id="getJsonError" resultType="com.tld.model.Error">
+        select id,url,error_info,data_val,scrq,type,transmission_type from tld_error
+        where transmission_type = '3'
+        and type = '出库回传'
+    </select>
     <!-- 修改数据传输状态 -->
     <update id="updateRemoval">
         update tld_removal set transmission_type = "1" where storage_code = #{removalCode}