|
@@ -2,26 +2,25 @@ package cn.cslg.pas.service.business.invalidReport;
|
|
|
|
|
|
import cn.cslg.pas.common.dto.DomainFieldDTO;
|
|
|
import cn.cslg.pas.common.dto.QueryFeatureHistoryDTO;
|
|
|
-import cn.cslg.pas.common.dto.invalidDTO.QueryClaimSplitHistoryDTO;
|
|
|
-import cn.cslg.pas.common.dto.invalidDTO.RemoveGroupFeatureDTO;
|
|
|
-import cn.cslg.pas.common.dto.invalidDTO.UpdateGroupFeatureDTO;
|
|
|
-import cn.cslg.pas.common.dto.invalidDTO.UpdateMessageDTO;
|
|
|
+import cn.cslg.pas.common.dto.invalidDTO.*;
|
|
|
+import cn.cslg.pas.common.model.cronModel.PersonnelVO;
|
|
|
import cn.cslg.pas.common.model.cronModel.Records;
|
|
|
import cn.cslg.pas.common.utils.GenerateObjectUtil;
|
|
|
import cn.cslg.pas.common.utils.Response;
|
|
|
import cn.cslg.pas.common.vo.invalidVO.GroupFeatureHistoryVO;
|
|
|
-import cn.cslg.pas.domain.business.AssoGroupFeature;
|
|
|
-import cn.cslg.pas.domain.business.EvidenceReason;
|
|
|
-import cn.cslg.pas.domain.business.Feature;
|
|
|
+import cn.cslg.pas.domain.business.*;
|
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
|
import cn.cslg.pas.mapper.InvalidReport.AssoGroupFeatureMapper;
|
|
|
import cn.cslg.pas.service.business.FeatureService;
|
|
|
+import cn.cslg.pas.service.business.InvalidStatutesService;
|
|
|
+import cn.cslg.pas.service.business.ProofGroupService;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
@@ -41,6 +40,10 @@ public class AssoGroupFeatureService extends ServiceImpl<AssoGroupFeatureMapper,
|
|
|
|
|
|
@Autowired
|
|
|
private FeatureService featureService;
|
|
|
+ @Autowired
|
|
|
+ private InvalidStatutesService invalidStatutesService;
|
|
|
+ @Autowired
|
|
|
+ private ProofGroupService proofGroupService;
|
|
|
|
|
|
//根据证据组合id查询特征id
|
|
|
public List<Integer> getFeatureIdsByGroupId(Integer groupId) {
|
|
@@ -391,10 +394,63 @@ public class AssoGroupFeatureService extends ServiceImpl<AssoGroupFeatureMapper,
|
|
|
ids.addAll(temIds);
|
|
|
}
|
|
|
});
|
|
|
- if(ids.size()>0){
|
|
|
+ if (ids.size() > 0) {
|
|
|
this.removeByIds(ids);
|
|
|
}
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Boolean addFeatureGroupBatch(AddFeatureGroupBatchDTO addFeatureGroupBatchDTO) {
|
|
|
+
|
|
|
+ PersonnelVO personnelVO = new PersonnelVO();
|
|
|
+ personnelVO.setId("1");
|
|
|
+
|
|
|
+ Integer claimId = addFeatureGroupBatchDTO.getClaimId();
|
|
|
+ Integer gen = addFeatureGroupBatchDTO.getGen();
|
|
|
+ String common = addFeatureGroupBatchDTO.getCommon();
|
|
|
+ String featureText = addFeatureGroupBatchDTO.getFeatureText();
|
|
|
+ //添加特征
|
|
|
+ Feature feature = new Feature();
|
|
|
+ feature.setContent(featureText);
|
|
|
+ feature.setCreateId(personnelVO.getId());
|
|
|
+ feature.insert();
|
|
|
+ Integer featureId = feature.getId();
|
|
|
+ //根据权要id 查询 无效法条
|
|
|
+ LambdaQueryWrapper<InvalidStatutes> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(InvalidStatutes::getClaimId, claimId);
|
|
|
+ List<InvalidStatutes> invalidStatutes = invalidStatutesService.list(queryWrapper);
|
|
|
+ if (invalidStatutes != null && invalidStatutes.size() != 0) {
|
|
|
+ List<Integer> statutesIds = invalidStatutes.stream().map(InvalidStatutes::getId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ //根据无效法条查询证据组合
|
|
|
+ if (statutesIds != null && statutesIds.size() != 0) {
|
|
|
+ LambdaQueryWrapper<ProofGroup> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.in(ProofGroup::getInvalidStatutesId, statutesIds);
|
|
|
+ List<ProofGroup> proofGroups = proofGroupService.list(queryWrapper1);
|
|
|
+
|
|
|
+ if (proofGroups != null && proofGroups.size() > 0) {
|
|
|
+ for (ProofGroup proofGroup : proofGroups) {
|
|
|
+ Integer order = this.getBaseMapper().selectLastGroupFeatureOrder(proofGroup.getId(), gen);
|
|
|
+ if (order == null) {
|
|
|
+ order = 1;
|
|
|
+ } else {
|
|
|
+ order = order + 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ AssoGroupFeature assoGroupFeature = new AssoGroupFeature();
|
|
|
+ assoGroupFeature.setGroupId(proofGroup.getId());
|
|
|
+ assoGroupFeature.setFeatureId(featureId);
|
|
|
+ assoGroupFeature.setFeatureGen(gen);
|
|
|
+ assoGroupFeature.setFeatureOrder(order);
|
|
|
+ assoGroupFeature.setCommon(common);
|
|
|
+ assoGroupFeature.insert();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|