|
@@ -8,7 +8,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.lantone.common.enums.IsDeleteEnum;
|
|
|
import com.lantone.common.exception.Asserts;
|
|
|
import com.lantone.common.util.BeanUtil;
|
|
|
+import com.lantone.common.util.DateUtil;
|
|
|
import com.lantone.common.util.StringUtil;
|
|
|
+import com.lantone.common.util.SysUserUtils;
|
|
|
import com.lantone.daqe.dto.GetRegularPageDTO;
|
|
|
import com.lantone.daqe.entity.RegularInfo;
|
|
|
import com.lantone.daqe.entity.RegularMapping;
|
|
@@ -76,6 +78,8 @@ public class RegularManagementFacade {
|
|
|
if (regularInfoFacade.isExist(regularInfo)) {
|
|
|
Asserts.fail("该正则式已存在!");
|
|
|
}
|
|
|
+ regularInfo.setCreator(SysUserUtils.getCurrentPrinciple());
|
|
|
+ regularInfo.setGmtCreate(DateUtil.now());
|
|
|
return regularInfoFacade.save(regularInfo);
|
|
|
}
|
|
|
|
|
@@ -92,6 +96,8 @@ public class RegularManagementFacade {
|
|
|
//修改正则式
|
|
|
RegularInfo regularInfo = new RegularInfo();
|
|
|
BeanUtil.copyProperties(upRegularByIdVO, regularInfo);
|
|
|
+ regularInfo.setModifier(SysUserUtils.getCurrentPrinciple());
|
|
|
+ regularInfo.setGmtModified(DateUtil.now());
|
|
|
//修改表字段的正则式校验结果表中的正则式
|
|
|
if (regularInfoFacade.updateById(regularInfo)) {
|
|
|
return regularResultFacade.update(new UpdateWrapper<RegularResult>()
|
|
@@ -100,6 +106,8 @@ public class RegularManagementFacade {
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.set("regular_name", upRegularByIdVO.getName())
|
|
|
.set("regular_val", upRegularByIdVO.getVal())
|
|
|
+ .set("modifier", SysUserUtils.getCurrentPrinciple())
|
|
|
+ .set("gmt_modified", DateUtil.now())
|
|
|
.set("regular_des", upRegularByIdVO.getDescription()));
|
|
|
}
|
|
|
return false;
|
|
@@ -131,17 +139,26 @@ public class RegularManagementFacade {
|
|
|
if (regularInfoFacade.getById(id) == null) {
|
|
|
Asserts.fail("该正则式不存在!");
|
|
|
}
|
|
|
- if (regularInfoFacade.removeById(id)) {
|
|
|
+ RegularInfo regularInfo = new RegularInfo();
|
|
|
+ regularInfo.setId(id);
|
|
|
+ regularInfo.setModifier(SysUserUtils.getCurrentPrinciple());
|
|
|
+ regularInfo.setGmtModified(DateUtil.now());
|
|
|
+ regularInfo.setIsDeleted(IsDeleteEnum.Y.getKey());
|
|
|
+ if (regularInfoFacade.updateById(regularInfo)) {
|
|
|
//删除表字段的实际值与正则式关联关系
|
|
|
if (regularMappingFacade.update(new UpdateWrapper<RegularMapping>()
|
|
|
.eq("regular_id", id)
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .set("modifier", SysUserUtils.getCurrentPrinciple())
|
|
|
+ .set("gmt_modified", DateUtil.now())
|
|
|
.set("is_deleted", IsDeleteEnum.Y.getKey()))) {
|
|
|
//删除表字段的正则式校验结果表中的正则式
|
|
|
return regularResultFacade.update(new UpdateWrapper<RegularResult>()
|
|
|
.eq(hospitalId != null, "hospital_id", hospitalId)
|
|
|
.eq("regular_id", id)
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .set("modifier", SysUserUtils.getCurrentPrinciple())
|
|
|
+ .set("gmt_modified", DateUtil.now())
|
|
|
.set("is_deleted", IsDeleteEnum.Y.getKey()));
|
|
|
}
|
|
|
|