|
@@ -102,11 +102,18 @@ public class PlanFacade extends PlanServiceImpl {
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("hospital_id", hospitalPlanSaveVO.getHospitalId())
|
|
|
.eq("plan_name", hospitalPlanSaveVO.getPlanName())
|
|
|
- .eq("plan_code", hospitalPlanSaveVO.getPlanCode())
|
|
|
.ne("id", hospitalPlanSaveVO.getId() == null ? -1 : hospitalPlanSaveVO.getId()));
|
|
|
if (count > 0) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "相同【医院】下,方案名称已存在");
|
|
|
}
|
|
|
+ int countTow = this.count(new QueryWrapper<Plan>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("hospital_id", hospitalPlanSaveVO.getHospitalId())
|
|
|
+ .eq("plan_code", hospitalPlanSaveVO.getPlanCode())
|
|
|
+ .ne("id", hospitalPlanSaveVO.getId() == null ? -1 : hospitalPlanSaveVO.getId()));
|
|
|
+ if (countTow > 0) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "相同【医院】下,方案编码已存在");
|
|
|
+ }
|
|
|
if (hospitalPlanSaveVO.getId() != null) {
|
|
|
UpdateWrapper<Plan> planQuery = new UpdateWrapper<>();
|
|
|
planQuery.eq("is_deleted", IsDeleteEnum.N.getKey())
|