|
@@ -1,10 +1,19 @@
|
|
|
package com.management.platform.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.management.platform.entity.Clue;
|
|
|
import com.management.platform.mapper.ClueMapper;
|
|
|
import com.management.platform.service.ClueService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.management.platform.service.SysFunctionService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import java.beans.Transient;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -17,4 +26,53 @@ import org.springframework.stereotype.Service;
|
|
|
@Service
|
|
|
public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements ClueService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysFunctionService sysFunctionService;
|
|
|
+ @Autowired
|
|
|
+ private ClueMapper clueMapper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void insert(Clue clue) {
|
|
|
+ setNull(clue);
|
|
|
+ clue.setCreateTime(new Date());
|
|
|
+ clueMapper.insert(clue);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void update(Clue clue) {
|
|
|
+ setNull(clue);
|
|
|
+ clueMapper.updateById(clue);
|
|
|
+ }
|
|
|
+
|
|
|
+ private Clue setNull(Clue clue) {
|
|
|
+ if (clue.getPlate1() == ""){
|
|
|
+ clue.setPlate1(null);
|
|
|
+ }
|
|
|
+ if (clue.getPlate2() == ""){
|
|
|
+ clue.setPlate2(null);
|
|
|
+ }
|
|
|
+ if (clue.getPlate3() == ""){
|
|
|
+ clue.setPlate3(null);
|
|
|
+ }
|
|
|
+ if (clue.getPlate4() == ""){
|
|
|
+ clue.setPlate4(null);
|
|
|
+ }
|
|
|
+ if (clue.getPlate5() == ""){
|
|
|
+ clue.setPlate5(null);
|
|
|
+ }
|
|
|
+ return clue;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void isDelete(List<Integer> ids) {
|
|
|
+ UpdateWrapper<Clue> updateWrapper = new UpdateWrapper<>();
|
|
|
+ updateWrapper.in("id", ids);
|
|
|
+ Clue clue = new Clue();
|
|
|
+ clue.setIsDelete(1);
|
|
|
+ clueMapper.update(clue, updateWrapper);
|
|
|
+ }
|
|
|
}
|