|
|
@@ -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
|