|
|
|
@ -3,6 +3,7 @@ package com.supervision.police.service.impl;
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.bean.copier.CopyOptions;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
@ -171,6 +172,15 @@ public class ModelCaseServiceImpl extends ServiceImpl<ModelCaseMapper, ModelCase
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(transactionManager = "dataSourceTransactionManager",rollbackFor = Exception.class)
|
|
|
|
|
public R<?> addPersion(CasePerson person) {
|
|
|
|
|
|
|
|
|
|
Assert.notEmpty(person.getCaseId(), "案件id不能为空");
|
|
|
|
|
Assert.notEmpty(person.getIdCard(), "身份证号不能为空");
|
|
|
|
|
Assert.notEmpty(person.getName(), "姓名不能为空");
|
|
|
|
|
Assert.notEmpty(person.getRoleCode(), "角色不能为空");
|
|
|
|
|
|
|
|
|
|
Long count = casePersonMapper.selectCount(new LambdaQueryWrapper<CasePerson>()
|
|
|
|
|
.eq(CasePerson::getCaseId, person.getCaseId()).eq(CasePerson::getIdCard, person.getIdCard()));
|
|
|
|
|
Assert.isTrue(count == 0, "该身份证号已存在");
|
|
|
|
|
int i = casePersonMapper.insert(person);
|
|
|
|
|
if (i > 0) {
|
|
|
|
|
caseStatusManageService.whenSaveCasePeople(person.getCaseId(), person.getRoleCode());
|
|
|
|
|