xiaochen hace 2 años
padre
commit
0db060b450

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

@@ -39,27 +39,27 @@ public class SaticScheduleTask {
         return taskScheduler;
     }
 
-    /**
-     * 批量回调 生产领料
-     */
-    @Scheduled(cron = "0 */60 * * * ?")
-    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 */60 * * * ?")
+//    public void callback() {
+//        askGoodsService.getCallback();
+//    }
+//
+//    /**
+//     * 批量回调 入库回传
+//     */
+//    @Scheduled(cron = "0 */10 * * * ?")
+//    public void callPlugOutWarehousing(){
+//        askGoodsService.getCallPlugOutWarehousing();
+//    }
+//
+//    /**
+//     * 批量回调 生产收货接口文档/报工单 w
+//     */
+//    @Scheduled(cron = "0 */10 * * * ?")
+//    public void callWorkOrder(){
+//        askGoodsService.getCallWorkOrder();
+//    }
 }

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

@@ -262,7 +262,7 @@ public class AskGoodsController {
                     .setAskId(jsonObject.get("要货申请ID").toString())
                     .setAskCode(jsonObject.get("要货申请单号").toString())
                     .setEntryNumber(jsonObject.get("要货申请分录ID").toString())
-                    .setAmount(jsonObject.get("数量").toString())
+                    .setAmount(jsonObject.get("需求数量").toString())
                     .setAmountNum(jsonObject.get("已发数量").toString())
                     .setAmountNumber(jsonObject.get("取消数量").toString())
                     .setMoveType(jsonObject.get("类型").toString())

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

@@ -253,4 +253,6 @@ public interface AskGoodsMapper {
     void addInventory(Inventory inventory);
 
     List<Map<String, Object>> getCallWorkOrder();
+
+    void DelOutgoingReturnList(OutgoingReturn outgoingReturn);
 }

+ 30 - 16
src/main/java/com/tld/service/impl/AskGoodsServiceImpl.java

@@ -1643,23 +1643,37 @@ public class AskGoodsServiceImpl implements AskGoodsService {
             System.out.println("数量为:"+Double.parseDouble(outgoingReturn.getAmount()));
             System.out.println("已发数量为:"+Double.parseDouble(outgoingReturn.getAmountNum()));
             System.out.println("取消数量为:"+Double.parseDouble(outgoingReturn.getAmountNumber()));
-            ReturRemoval returRemoval = new ReturRemoval()
-                    .setDocumentId(outgoingReturn.getAskId())//单据id1
-                    .setRemovalCode(outgoingReturn.getAskId().substring(outgoingReturn.getAskId().length()-6)+outgoingReturn.getEntryNumber())//出库单编号1
-                    .setSourceType("8")//来源类型1
-                    .setMoveType(outgoingReturn.getMoveType())//移动类型1
-
-                    .setMaterialId(outgoingReturn.getMaterialId())//物料id
-                    .setWbs(outgoingReturn.getWbs())//wbs
-                    .setNum( String.valueOf(Double.parseDouble(outgoingReturn.getAmount()) - Double.parseDouble(outgoingReturn.getAmountNum()) - Double.parseDouble(outgoingReturn.getAmountNumber()))  )//数量-已发数量-取消数量 = 未发数量
-                    .setEntryNumber(outgoingReturn.getEntryNumber())//分录号
-                    .setDocumentPointsId("   ")//分录单id
-                    .setStorageLocationCode(askGoodsMapper.getLocationCode(outgoingReturn.getWarehouse()));//库存编号
+            System.out.println("转化为整数为:"+Double.valueOf(outgoingReturn.getAmount()).intValue());
+            if (Double.valueOf(outgoingReturn.getAmountNum()).intValue() == 0){
+                ReturRemoval returRemoval = new ReturRemoval()
+                        .setDocumentId(outgoingReturn.getAskId())//单据id1
+                        .setRemovalCode(outgoingReturn.getAskId().substring(outgoingReturn.getAskId().length()-6)+outgoingReturn.getEntryNumber())//出库单编号1
+                        .setSourceType("8")//来源类型1
+                        .setMoveType(outgoingReturn.getMoveType())//移动类型1
 
-            //添加父表信息
-            askGoodsMapper.addReturnGsRemovalF(returRemoval);
-            //添加子表信息
-            askGoodsMapper.addReturnGsRemoval(returRemoval);
+                        .setMaterialId(outgoingReturn.getMaterialId())//物料id
+                        .setWbs(outgoingReturn.getWbs())//wbs
+
+                        .setEntryNumber(outgoingReturn.getEntryNumber())//分录号
+                        .setDocumentPointsId("   ")//分录单id
+                        .setStorageLocationCode(askGoodsMapper.getLocationCode(outgoingReturn.getWarehouse()));//库存编号
+                if (Double.valueOf(outgoingReturn.getAmount()).intValue() < 0 ){
+                    returRemoval.setNum( String.valueOf( Double.parseDouble(outgoingReturn.getAmount())));
+                }else {
+                    returRemoval.setNum( String.valueOf(Double.parseDouble(outgoingReturn.getAmount()) - Double.parseDouble(outgoingReturn.getAmountNum()) - Double.parseDouble(outgoingReturn.getAmountNumber()))  );//数量-已发数量-取消数量 = 未发数量
+                }
+
+                if (Double.valueOf(returRemoval.getNum()).intValue() == 0){
+                    System.out.println("不能添加:"+Double.valueOf(returRemoval.getNum()).intValue());
+                }else {
+                    //添加父表信息
+                    askGoodsMapper.addReturnGsRemovalF(returRemoval);
+                    //添加子表信息
+                    askGoodsMapper.addReturnGsRemoval(returRemoval);
+                }
+            }
+            //删除
+            askGoodsMapper.DelOutgoingReturnList(outgoingReturn);
         }
     }
 

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

@@ -1273,6 +1273,9 @@
         from tld_return_gs_warehousing
         where order_number = #{orderNumber}
     </delete>
+    <delete id="DelOutgoingReturnList">
+        delete from tld_outgoing_return where id = #{id}
+    </delete>
     <!-- 查询名牌物料CODE -->
     <select id="getMing" resultType="String">
         select wllb_code from tld_mingpai where code = #{code}
@@ -1492,6 +1495,7 @@
     </select>
     <select id="getOutgoingReturnList" resultType="com.tld.model.OutgoingReturn">
         select id,ask_id,ask_code,entry_number,amount,amount_num,amount_number,move_type,material_id,inventory_organization,warehouse,wbs from tld_outgoing_return
+        order by id
     </select>
     <!--查询storage_location_code库位编号-->
     <select id="getLocationCode" resultType="java.lang.String">