|
@@ -6,12 +6,14 @@ import com.github.pagehelper.PageInfo;
|
|
|
import com.tld.mapper.DictionaryMapper;
|
|
|
import com.tld.mapper.ReceiveGoodsMapper;
|
|
|
import com.tld.model.Access;
|
|
|
+import com.tld.model.LogData;
|
|
|
import com.tld.model.ReceiveGoods;
|
|
|
import com.tld.service.ReceiveGoodsSerivce;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.*;
|
|
|
|
|
|
@Service
|
|
@@ -141,6 +143,7 @@ public class ReceiveGoodsSerivceImpl implements ReceiveGoodsSerivce {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public Map<String, Object> addPurchase(List<Map<String, Object>> jsonData) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
try{
|
|
@@ -189,4 +192,27 @@ public class ReceiveGoodsSerivceImpl implements ReceiveGoodsSerivce {
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Map<String, Object> delReceiveGoods(String id, HttpServletRequest request) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ try{
|
|
|
+ String userId = request.getHeader("userId");
|
|
|
+ Map<String, Object> mapVal = receiveGoodsMapper.getDelReceiveGoods(id);
|
|
|
+ LogData logData = new LogData()
|
|
|
+ .setUserId(userId)
|
|
|
+ .setData(mapVal.toString())
|
|
|
+ .setType("0")
|
|
|
+ .setDocumentType("单据类型");
|
|
|
+ dictionaryMapper.addLogdata(logData);
|
|
|
+ receiveGoodsMapper.delReceiveGoods(id);
|
|
|
+ map.put("msg","200");
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ map.put("status", "500");
|
|
|
+ map.put("msg", "服务器请求异常,请稍后再试");
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|