xiaochen před 2 roky
rodič
revize
85759b69e8

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

@@ -6,6 +6,7 @@ import com.tld.service.DeliveryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.Map;
 
 /**
@@ -69,4 +70,14 @@ public class DeliveryController {
     public Map<String, Object> OutOfLibrary(String uniqueCode, String type, String deliveryId){
         return deliveryService.OutOfLibrary(uniqueCode, type, deliveryId);
     }
+
+    /**
+     * 删除交货单
+     * @param id 参数
+     * @return 返回结果
+     */
+    @PostMapping("delDelivery")
+    public Map<String, Object> delDelivery(String id , HttpServletRequest request){
+        return deliveryService.delDelivery(id,request);
+    }
 }

+ 12 - 3
src/main/java/com/tld/controller/WarehouseTransferController.java

@@ -3,10 +3,9 @@ package com.tld.controller;
 import com.tld.model.WarehouseTransfer;
 import com.tld.service.WarehouseTransferService;
 import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.Map;
 
 /**
@@ -57,4 +56,14 @@ public class WarehouseTransferController {
     public Map<String, Object> warehousing(String uniqueCode, String type){
         return warehouseTransferService.warehousing(uniqueCode, type);
     }
+
+    /**
+     * 删除移库单
+     * @param id 参数
+     * @return 返回结果
+     */
+    @PostMapping("delWarehouseTransfer")
+    public Map<String, Object> delWarehouseTransfer(String id , HttpServletRequest request){
+        return warehouseTransferService.delWarehouseTransfer(id,request);
+    }
 }

+ 13 - 0
src/main/java/com/tld/controller/WarehousingController.java

@@ -6,6 +6,8 @@ import com.tld.model.WarehousingVirtual;
 import com.tld.service.WarehousingService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.Map;
 
@@ -120,6 +122,17 @@ public class WarehousingController {
         return warehousingService.updateInventoryNotice(notice);
     }
 
+    /**
+     * 删除半成品
+     * @param id 参数
+     * @return 返回结果
+     */
+    @PostMapping("delInventoryNotice")
+    public Map<String, Object> delInventoryNotice(String id , HttpServletRequest request){
+        return warehousingService.delInventoryNotice(id,request);
+    }
+
+
     /**
      * 查询半成品流水
      * @param notice 参数

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

@@ -102,6 +102,10 @@ public interface AskGoodsMapper {
 
     void delPlugOutWarehousing(@Param("orderNumber") String orderNumber);
 
+    Map<String, Object> getInventoryNotice(@Param("id") String id);
+
+    void delInventoryNotice(@Param("id") String id);
+
     Map<String, Object> getDelAskGoods(String id);
 
     void delAskGoods(String id);

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

@@ -37,4 +37,9 @@ public interface DeliveryMapper {
     int getProductNumVitrual(Inventory inventory);
 
     Map<String, Object> getScanIsNot(AskGoods askGoods);
+
+    Map<String, Object> getDeliverys(@Param("id") String id);
+
+    void delDelivery(@Param("id") String id);
+
 }

+ 7 - 0
src/main/java/com/tld/mapper/WarehouseTransferMapper.java

@@ -4,8 +4,10 @@ import com.tld.model.AskGoods;
 import com.tld.model.Inventory;
 import com.tld.model.WarehouseTransfer;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 @Mapper
 public interface WarehouseTransferMapper {
@@ -26,4 +28,9 @@ public interface WarehouseTransferMapper {
     WarehouseTransfer getWarehouseTransferDetailedF(String askGoodsId);
 
     void addReturnGsWarehouseTransferF(WarehouseTransfer warehouseTransfer1);
+
+    Map<String, Object> getWarehouseTransfers(@Param("id") String id);
+
+    void delWarehouseTransfer(@Param("id") String id);
+
 }

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

@@ -3,6 +3,7 @@ package com.tld.service;
 import com.tld.model.AskGoods;
 import com.tld.model.Delivery;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.Map;
 
 public interface DeliveryService {
@@ -15,4 +16,7 @@ public interface DeliveryService {
     Map<String, Object> getAttribute(Delivery delivery);
 
     Map<String, Object> addVitrual(AskGoods askGoods);
+
+    Map<String, Object> delDelivery(String id, HttpServletRequest request);
+
 }

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

@@ -2,6 +2,7 @@ package com.tld.service;
 
 import com.tld.model.WarehouseTransfer;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.Map;
 
 public interface WarehouseTransferService {
@@ -12,4 +13,7 @@ public interface WarehouseTransferService {
     Map<String, Object> OutOfLibrary(String uniqueCode, String type, String askGoodsId);
 
     Map<String, Object> warehousing(String uniqueCode, String type);
+
+    Map<String, Object> delWarehouseTransfer(String id, HttpServletRequest request);
+
 }

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

@@ -4,6 +4,7 @@ import com.tld.model.Notice;
 import com.tld.model.Storage;
 import com.tld.model.WarehousingVirtual;
 
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.Map;
 
@@ -41,4 +42,7 @@ public interface WarehousingService {
     Map<String, Object> getHalf(Notice notice);
 
     void getHalfExcel(Notice notice, HttpServletResponse response);
+
+    Map<String, Object> delInventoryNotice(String id, HttpServletRequest request);
+
 }

+ 28 - 0
src/main/java/com/tld/service/impl/DeliveryServiceImpl.java

@@ -2,6 +2,7 @@ package com.tld.service.impl;
 
 import com.tld.mapper.AskGoodsMapper;
 import com.tld.mapper.DeliveryMapper;
+import com.tld.mapper.DictionaryMapper;
 import com.tld.model.*;
 import com.tld.service.DeliveryService;
 import org.redisson.api.RLock;
@@ -9,6 +10,7 @@ import org.redisson.api.RedissonClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.servlet.http.HttpServletRequest;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -23,6 +25,9 @@ public class DeliveryServiceImpl implements DeliveryService {
     //redis锁
     @Autowired
     private RedissonClient redissonClient;
+    //删除日志表
+    @Autowired
+    private DictionaryMapper dictionaryMapper;
 
     @Override
     public Map<String, Object> getDelivery(Delivery delivery) {
@@ -215,6 +220,29 @@ public class DeliveryServiceImpl implements DeliveryService {
         return map;
     }
 
+    @Override
+    public Map<String, Object> delDelivery(String id, HttpServletRequest request) {
+        Map<String, Object> map = new HashMap<>();
+        try {
+            String userId = request.getHeader("userId");
+            Map<String, Object> mapVal = deliveryMapper.getDeliverys(id);
+            LogData logData = new LogData()
+                    .setUserId(userId)
+                    .setData(mapVal.toString())
+                    .setType("0")
+                    .setDocumentType("交货单");
+            dictionaryMapper.addLogdata(logData);
+            deliveryMapper.delDelivery(id);
+            map.put("status", "200");
+            map.put("msg", "成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            map.put("status", "500");
+            map.put("msg", "服务器请求异常,请稍后再试");
+        }
+        return map;
+    }
+
     /**
      * 出库单生成
      * @return

+ 29 - 0
src/main/java/com/tld/service/impl/WarehouseTransferServiceImpl.java

@@ -9,6 +9,8 @@ import org.redisson.api.RLock;
 import org.redisson.api.RedissonClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -207,6 +209,33 @@ public class WarehouseTransferServiceImpl implements WarehouseTransferService {
         return map;
     }
 
+    /**
+     * 删除移库单
+     * @return
+     */
+    @Override
+    public Map<String, Object> delWarehouseTransfer(String id, HttpServletRequest request) {
+        Map<String, Object> map = new HashMap<>();
+        try {
+            String userId = request.getHeader("userId");
+            Map<String, Object> mapVal = warehouseTransferMapper.getWarehouseTransfers(id);
+            LogData logData = new LogData()
+                    .setUserId(userId)
+                    .setData(mapVal.toString())
+                    .setType("0")
+                    .setDocumentType("移库单");
+            dictionaryMapper.addLogdata(logData);
+            warehouseTransferMapper.delWarehouseTransfer(id);
+            map.put("status", "200");
+            map.put("msg", "成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            map.put("status", "500");
+            map.put("msg", "服务器请求异常,请稍后再试");
+        }
+        return map;
+    }
+
     /**
      * 移库单生成
      * @return

+ 29 - 0
src/main/java/com/tld/service/impl/WarehousingServiceImpl.java

@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -766,6 +767,34 @@ public class WarehousingServiceImpl implements WarehousingService {
         }
     }
 
+    /**
+     * 删除半成品
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Map<String, Object> delInventoryNotice(String id, HttpServletRequest request) {
+        Map<String, Object> map = new HashMap<>();
+        try {
+            String userId = request.getHeader("userId");
+            Map<String, Object> mapVal = askGoodsMapper.getInventoryNotice(id);
+            LogData logData = new LogData()
+                    .setUserId(userId)
+                    .setData(mapVal.toString())
+                    .setType("0")
+                    .setDocumentType("报工单");
+            dictionaryMapper.addLogdata(logData);
+            askGoodsMapper.delInventoryNotice(id);
+            map.put("status", "200");
+            map.put("msg", "成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            map.put("status", "500");
+            map.put("msg", "服务器请求异常,请稍后再试");
+        }
+        return map;
+    }
+
 
     /**
      * 入库单生成

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

@@ -590,6 +590,14 @@
         WHERE
             a.document_id = #{removalCode}
     </select>
+    <!-- 查询半成品原始数据 -->
+    <select id="getInventoryNotice" resultType="java.util.Map">
+        select * from tld_notice where id = #{id}
+    </select>
+    <!-- 删除半成品/产成品入库通知原始信息 -->
+    <delete id="delInventoryNotice">
+        delete from tld_notice where id = #{id}
+    </delete>
     <!-- 查询要料申请单 -->
     <select id="getDelAskGoods" resultType="java.util.Map">
         select * from tld_ask_goods where id = #{id}

+ 9 - 0
src/main/resources/mapper/DeliveryMapper.xml

@@ -164,4 +164,13 @@
             (select ifnull(sum(num),0) from tld_ask_goods_vitrual where wbs = #{wbs} and wllb_code = #{wllbCode} and storage_location_code = #{storageLocationCode} and produc_date = #{producDate}) as vitrualNum
         from dual
     </select>
+    <!-- 查询销售交货单原始数据 -->
+    <select id="getDeliverys" resultType="java.util.Map">
+        select * from tld_delivery where id = #{id}
+    </select>
+    <!-- 删除销售交货单原始数据 -->
+    <delete id="delDelivery">
+        delete from  tld_delivery where id = #{id}
+    </delete>
+
 </mapper>

+ 8 - 0
src/main/resources/mapper/WarehouseTransferMapper.xml

@@ -117,6 +117,14 @@
                scrq
         from tld_warehouse_transfer_f where warehouse_transfer_id = #{askGoodsId}
     </select>
+    <!--  查询移库单原始数据 -->
+    <select id="getWarehouseTransfers" resultType="java.util.Map">
+        select  * from tld_warehouse_transfer where id = #{id}
+    </select>
+    <!--  删除移库单原始数据 -->
+    <delete id="delWarehouseTransfer">
+        delete from tld_warehouse_transfer where id = #{id}
+    </delete>
     <!--  新增返回gs父表移库信息 -->
     <insert id="addReturnGsWarehouseTransferF">
         insert into tld_warehouse_transfer_f(warehouse_transfer_id,warehouse_transfer_code,ask_goods_warehouse_id,warehouse_transfer_type,scrq)