Browse Source

问题修改

zhs 2 years ago
parent
commit
6c1847d4eb

+ 2 - 2
src/main/java/com/tld/config/MyRedissonConfig.java

@@ -16,8 +16,8 @@ public class MyRedissonConfig {
     public RedissonClient redissonClient(){
         // 创建配置 指定redis地址及节点信息
         Config config = new Config();
-        config.useSingleServer().setAddress("redis://8.142.144.205:6379").setPassword("#09SilverB");
-//        config.useSingleServer().setAddress("redis://10.2.111.91:6379").setPassword("#09SilverB");
+//        config.useSingleServer().setAddress("redis://8.142.144.205:6379").setPassword("#09SilverB");
+        config.useSingleServer().setAddress("redis://10.2.111.91:6379").setPassword("#09SilverB");
         //redis集群使用
 //        config.useClusterServers().addNodeAddress("redis://8.142.144.205:6379");
         // 根据config创建出RedissonClient实例

+ 31 - 31
src/main/java/com/tld/config/SaticScheduleTask.java

@@ -40,37 +40,37 @@ public class SaticScheduleTask {
         return taskScheduler;
     }
 
-//    /**
-//     * 批量回调 生产领料
-//     */
-//    @Scheduled(cron = "0 */10 * * * ?")
-//    public void callback() {
-//        askGoodsService.getCallback();
-//    }
-//
-//    /**
-//     * 批量回调 入库回传
-//     */
-//    @Scheduled(cron = "0 */10 * * * ?")
-//    public void callPlugOutWarehousing(){
-//        askGoodsService.getCallPlugOutWarehousing();
-//    }
-//
-//    /**
-//     * 批量回调 生产收货接口文档/报工单 w
-//     */
-//    @Scheduled(cron = "0 */10 * * * ?")
-//    public void callWorkOrder(){
-//        askGoodsService.getCallWorkOrder();
-//    }
-//
-//    /**
-//     * 批量回调 销售出库
-//     */
-//    @Scheduled(cron = "0 */10 * * * ?")
-//    public void callDelivery(){
-//        askGoodsService.callDelivery();
-//    }
+    /**
+     * 批量回调 生产领料
+     */
+    @Scheduled(cron = "0 */10 * * * ?")
+    public void callback() {
+        askGoodsService.getCallback();
+    }
+
+    /**
+     * 批量回调 入库回传
+     */
+    @Scheduled(cron = "0 */10 * * * ?")
+    public void callPlugOutWarehousing(){
+        askGoodsService.getCallPlugOutWarehousing();
+    }
+
+    /**
+     * 批量回调 生产收货接口文档/报工单 w
+     */
+    @Scheduled(cron = "0 */10 * * * ?")
+    public void callWorkOrder(){
+        askGoodsService.getCallWorkOrder();
+    }
+
+    /**
+     * 批量回调 销售出库
+     */
+    @Scheduled(cron = "0 */10 * * * ?")
+    public void callDelivery(){
+        askGoodsService.callDelivery();
+    }
 
     /**
      * 每天凌晨零点执行任务

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

@@ -271,4 +271,6 @@ public interface AskGoodsMapper {
     void editAskGoods(AskGoods askGoods);
 
     void editAskGoodsF(AskGoods askGoods);
+
+    Map<String, Object> getDelAskGoodsF(String id);
 }

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

@@ -830,18 +830,21 @@ public class AskGoodsServiceImpl implements AskGoodsService {
         try {
             String userId = request.getHeader("userId");
             //获取单据信息
-            Map<String, Object> mapVal = askGoodsMapper.getDelAskGoods(askGoods.getId());
+            //单据类型
+            String type = "生产领料";
+            Map<String, Object> mapVal = new HashMap<>();
+            if(askGoods.getEditType().equals("1")){
+                type = "非生产领料";
+                mapVal = askGoodsMapper.getDelAskGoodsF(askGoods.getId());
+            } else {
+                mapVal = askGoodsMapper.getDelAskGoods(askGoods.getId());
+            }
             //判断修改数量是否大于单据数量
             if(Double.doubleToLongBits(Double.parseDouble(mapVal.get("num").toString())) <  Double.doubleToLongBits(Double.parseDouble(askGoods.getOutNum()))){
                 map.put("msg", "500");
                 map.put("errMsg", "修改数量不能大于单据数量!");
                 return map;
             }
-            //单据类型
-            String type = "生产领料";
-            if(askGoods.getEditType().equals("1")){
-                type = "非生产领料";
-            }
             mapVal.put("edit", askGoods.getOutNum());//增加修改数量JSON
             //增加修改日志
             LogData logData = new LogData()

+ 16 - 16
src/main/resources/application.yml

@@ -13,24 +13,24 @@ spring:
       strict: true
       datasource:
         # 主库数据源
-        master:
-          username: root
-          password: "#09SilverB"
-          url: jdbc:mysql://8.142.144.205:3306/tld?useUnicode=true&characterEncoding=utf-8&useSSL=true&rewriteBatchedStatements=true&allowMultiQueries=true
-          driver-class-name: com.mysql.cj.jdbc.Driver
 #        master:
 #          username: root
 #          password: "#09SilverB"
-#          url: jdbc:mysql://10.2.111.91:3306/tld?useUnicode=true&characterEncoding=utf-8&useSSL=true&rewriteBatchedStatements=true&allowMultiQueries=true
-#          driver-class-name: com.mysql.cj.jdbc.Driver
-#        #从数据源
-#        slave:
-#          # 从数据源开关/默认关闭
-#          enabled: true
-#          url: jdbc:mysql://10.2.111.92:3306/tld?useUnicode=true&characterEncoding=utf-8&useSSL=true&rewriteBatchedStatements=true&allowMultiQueries=true
-#          username: root
-#          password: "#09SilverB"
+#          url: jdbc:mysql://8.142.144.205:3306/tld?useUnicode=true&characterEncoding=utf-8&useSSL=true&rewriteBatchedStatements=true&allowMultiQueries=true
 #          driver-class-name: com.mysql.cj.jdbc.Driver
+        master:
+          username: root
+          password: "#09SilverB"
+          url: jdbc:mysql://10.2.111.91:3306/tld?useUnicode=true&characterEncoding=utf-8&useSSL=true&rewriteBatchedStatements=true&allowMultiQueries=true
+          driver-class-name: com.mysql.cj.jdbc.Driver
+        #从数据源
+        slave:
+          # 从数据源开关/默认关闭
+          enabled: true
+          url: jdbc:mysql://10.2.111.92:3306/tld?useUnicode=true&characterEncoding=utf-8&useSSL=true&rewriteBatchedStatements=true&allowMultiQueries=true
+          username: root
+          password: "#09SilverB"
+          driver-class-name: com.mysql.cj.jdbc.Driver
         # sqlserver
 #        ds2:
 #          username: sa
@@ -46,8 +46,8 @@ spring:
     async:
       request-timeout: 20000
   redis:
-    host: 8.142.144.205
-#    host: 10.2.111.91
+#    host: 8.142.144.205
+    host: 10.2.111.91
     port: 6379
     password: '#09SilverB'
     pool:

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

@@ -1820,6 +1820,12 @@
     <select id="transmit" resultType="com.tld.model.Error">
         select id,url,data_val,type from tld_gs_data_val
     </select>
+    <!-- 查询非生产领用 -->
+    <select id="getDelAskGoodsF" resultType="java.util.Map">
+        select *
+        from tld_invite
+        where id = #{id}
+    </select>
     <!-- 新增WBS -->
     <insert id="addWbs" parameterType="java.util.Map">
         delete from tld_wbs where tld_id = #{wbsID};