|
|
@@ -12,10 +12,7 @@ import com.jzg.commons.entity.dto.AgreementAuthParam;
|
|
|
import com.jzg.commons.entity.dto.AgreementEditParam;
|
|
|
import com.jzg.commons.entity.dto.AgreementParam;
|
|
|
import com.jzg.commons.entity.enums.YesNoEnum;
|
|
|
-import com.jzg.commons.entity.po.EsmInsCompany;
|
|
|
-import com.jzg.commons.entity.po.PtlAgreement;
|
|
|
-import com.jzg.commons.entity.po.PtlAgreementDept;
|
|
|
-import com.jzg.commons.entity.po.SysSystem;
|
|
|
+import com.jzg.commons.entity.po.*;
|
|
|
import com.jzg.commons.entity.vo.AgreementInfoVo;
|
|
|
import com.jzg.commons.entity.vo.AgreementUserVo;
|
|
|
import com.jzg.commons.entity.vo.AgreementVo;
|
|
|
@@ -28,8 +25,7 @@ import com.jzg.commons.util.idgen.IdWorker;
|
|
|
import com.jzg.organization.client.EsmInsCompanyClient;
|
|
|
import com.jzg.organization.mapper.PtlAgreementMapper;
|
|
|
import com.jzg.organization.mapper.SysUserMapper;
|
|
|
-import com.jzg.organization.service.PtlAgreementDeptService;
|
|
|
-import com.jzg.organization.service.PtlAgreementService;
|
|
|
+import com.jzg.organization.service.*;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
@@ -42,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author dongxin
|
|
|
@@ -68,6 +65,15 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
@Autowired
|
|
|
private SysUserMapper userMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PtlAgreementUndwrtRulesService agreementRulesService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private PtlAgreementUndwrtRulesAttrService agreementUndwrtRulesAttrService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private PtlAgreementUndwrtRulesAttrLinkService agreementUndwrtRulesAttrLinkService;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public Page<AgreementVo> queryPage(AgreementParam param) {
|
|
|
@@ -184,7 +190,21 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public boolean deleteByIds(List<String> ids) {
|
|
|
+
|
|
|
+ List<PtlAgreementUndwrtRules> rulesList = agreementRulesService.list(
|
|
|
+ new LambdaQueryWrapper<PtlAgreementUndwrtRules>()
|
|
|
+ .in(PtlAgreementUndwrtRules::getAgreementId, ids)
|
|
|
+ .eq(PtlAgreementUndwrtRules::getIsDelete, YesNoEnum.NO.getCode()));
|
|
|
+ List<String> rulesIdList = rulesList.stream().map(PtlAgreementUndwrtRules::getId)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if(CollUtil.isNotEmpty(rulesIdList)){
|
|
|
+ agreementUndwrtRulesAttrLinkService.remove(new LambdaQueryWrapper<PtlAgreementUndwrtRulesAttrLink>()
|
|
|
+ .in(PtlAgreementUndwrtRulesAttrLink::getRulesId, ids)
|
|
|
+ .eq(PtlAgreementUndwrtRulesAttrLink::getIsDelete, YesNoEnum.NO.getCode()));
|
|
|
+ agreementRulesService.removeByIds(rulesIdList);
|
|
|
+ }
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
}
|
|
|
|