diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/operationInfo/OperationInfo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/operationInfo/OperationInfo.java index 6f5977f6..477225df 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/operationInfo/OperationInfo.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/operationInfo/OperationInfo.java @@ -11,6 +11,8 @@ import lombok.NoArgsConstructor; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +import javax.validation.constraints.NotBlank; + /** * 手术信息对象 operation_info * @@ -49,6 +51,7 @@ public class OperationInfo extends BaseEntity { */ @ApiModelProperty(value = "手术名称") @Excel(name = "手术名称") + @NotBlank(message = "手术名称不能为空") private String operationName; /** @@ -63,6 +66,7 @@ public class OperationInfo extends BaseEntity { */ @ApiModelProperty(value = "术式信息") @Excel(name = "术式信息") + @NotBlank(message = "术式信息不能为空") private String operationInfo; /** diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/operationInfo/OperationInfoMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/operationInfo/OperationInfoMapper.java index 1b62d83e..610832d3 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/operationInfo/OperationInfoMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/operationInfo/OperationInfoMapper.java @@ -70,12 +70,12 @@ public interface OperationInfoMapper { int countByDepartmentIdAndOperationName(@Param("departmentId") Long departmentId, @Param("operationName") String operationName); /** - * 检查所属科室同一手术名称下术式信息是否重复 + * 检查除当前记录之外是否存在同名的手术名称 * + * @param id * @param departmentId * @param operationName - * @param operationInfo * @return */ - int countByDepartmentIdAndOperationInfo(@Param("departmentId") Long departmentId, @Param("operationName") String operationName, @Param("operationInfo") String operationInfo); + int countByOperationNameExcludingId(@Param("id") Long id, @Param("departmentId") Long departmentId, @Param("operationName") String operationName); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicepackage/ServicePackageMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicepackage/ServicePackageMapper.java index 65dd6db5..11ce06d3 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicepackage/ServicePackageMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicepackage/ServicePackageMapper.java @@ -88,7 +88,7 @@ public interface ServicePackageMapper { List selectServicePackageVOListById(Long id); /** - * 判断所属科室下 + * 判断所属科室下服务包名称是否存在 * * @param departmentId * @param packageName @@ -104,4 +104,14 @@ public interface ServicePackageMapper { * @return */ int editReleaseStatus(@Param("id") Long id, @Param("whetherRelease") Integer whetherRelease); + + /** + * 检查除当前记录之外是否存在同名的服务包名称 + * + * @param id + * @param departmentId + * @param packageName + * @return + */ + int countByPackageNameExcludingId(@Param("id") Long id, @Param("departmentId") Long departmentId, @Param("packageName") String packageName); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicewaycontent/ServiceWayContentMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicewaycontent/ServiceWayContentMapper.java index 275c394e..df470e7c 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicewaycontent/ServiceWayContentMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/servicewaycontent/ServiceWayContentMapper.java @@ -163,4 +163,24 @@ public interface ServiceWayContentMapper { * @return */ int countByServiceFrequencyDTO(ServiceFrequencyDTO serviceFrequencyDTO); + + /** + * 检查除当前记录之外是否存在同名的服务内容 + * + * @param serviceContentId + * @param serviceWayId + * @param serviceContent + * @return + */ + int countByContentExcludingId(@Param("serviceContentId") Long serviceContentId, @Param("serviceWayId") Long serviceWayId, @Param("serviceContent") String serviceContent); + + /** + * 检查除当前记录之外是否存在相同的服务频次 + * + * @param id + * @param serviceContentId + * @param serviceWayContentEditDTO + * @return + */ + int countByServiceFrequencyExcludingId(@Param("id") Long id, @Param("serviceContentId") Long serviceContentId, @Param("serviceWayContentEditDTO") ServiceWayContentEditDTO serviceWayContentEditDTO); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/textmessage/TextMessageMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/textmessage/TextMessageMapper.java index 6a291bbf..19071069 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/textmessage/TextMessageMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/textmessage/TextMessageMapper.java @@ -112,17 +112,20 @@ public interface TextMessageMapper { */ int updateTextMessageSuitTask(@Param("task") TextMessageSuitTask task); - /** - * 根据textMessageId查询适用任务类型id - * - * @param textMessageId - * @return - */ - List selectTextMessageSuitTask(Long textMessageId); - /** * 根据id删除之前的适用任务类型 + * * @param id */ void deleteTextMessageSuitTask(Long id); + + /** + * 检查除当前记录之外是否存在同名的短信模板名称 + * + * @param id + * @param departmentId + * @param textMessageName + * @return + */ + int countByTextMessageNameExcludingId(@Param("id") Long id, @Param("departmentId") Long departmentId, @Param("textMessageName") String textMessageName); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/wechattemplate/WechatTemplateMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/wechattemplate/WechatTemplateMapper.java index d8b6d9da..a0467460 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/wechattemplate/WechatTemplateMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/wechattemplate/WechatTemplateMapper.java @@ -114,8 +114,18 @@ public interface WechatTemplateMapper { /** * 根据id删除之前存储的适用模板任务类型 + * * @param id */ void deleteWechatTemplateSuitTaskById(Long id); + /** + * 检查除当前记录之外是否存在同名的微信模板名称 + * + * @param id + * @param departmentId + * @param wechatTemplateName + * @return + */ + int countByWechatTemplateNameExcludingId(@Param("id") Long id, @Param("departmentId") Long departmentId, @Param("wechatTemplateName") String wechatTemplateName); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/operationInfo/impl/OperationInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/operationInfo/impl/OperationInfoServiceImpl.java index 3c9dbb6b..208bc3d5 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/operationInfo/impl/OperationInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/operationInfo/impl/OperationInfoServiceImpl.java @@ -55,24 +55,11 @@ public class OperationInfoServiceImpl implements IOperationInfoService { @Override @Transactional(rollbackFor = Exception.class) public int insertOperationInfo(OperationInfo operationInfo) { - // 检查手术名称是否为空 - if (StringUtils.isEmpty(operationInfo.getOperationName())) { - throw new ServiceException("手术名称不能为空"); - } - // 检查手术信息是否为空 - if (StringUtils.isEmpty(operationInfo.getOperationInfo())) { - throw new ServiceException("术式信息不能为空"); - } // 检查手术名称是否已存在 int existingNameCount = operationInfoMapper.countByDepartmentIdAndOperationName(operationInfo.getDepartmentId(), operationInfo.getOperationName()); if (existingNameCount > 0) { throw new ServiceException("手术名称已存在"); } - // 检查在所属科室同一手术名称下术式信息是否已存在 - int existingInfoCount = operationInfoMapper.countByDepartmentIdAndOperationInfo(operationInfo.getDepartmentId(), operationInfo.getOperationName(), operationInfo.getOperationInfo()); - if (existingInfoCount > 0) { - throw new ServiceException("术式信息已存在"); - } // 设置创建人、创建时间 operationInfo.setCreateBy(SecurityUtils.getUsername()); operationInfo.setCreateTime(DateUtils.getNowDate()); @@ -88,14 +75,10 @@ public class OperationInfoServiceImpl implements IOperationInfoService { @Override @Transactional(rollbackFor = Exception.class) public int updateOperationInfo(OperationInfo operationInfo) { - // 检查手术信息是否为空 - if (StringUtils.isEmpty(operationInfo.getOperationInfo())) { - throw new ServiceException("术式信息不能为空"); - } - // 检查在所属科室同一手术名称下术式信息是否已存在 - int existingInfoCount = operationInfoMapper.countByDepartmentIdAndOperationInfo(operationInfo.getDepartmentId(), operationInfo.getOperationName(), operationInfo.getOperationInfo()); - if (existingInfoCount > 0) { - throw new ServiceException("术式信息已存在"); + // 检查除当前记录之外是否存在同名的手术名称 + if (!operationInfo.getOperationName().equals(operationInfoMapper.selectOperationInfoById(operationInfo.getId())) + && operationInfoMapper.countByOperationNameExcludingId(operationInfo.getId(), operationInfo.getDepartmentId(), operationInfo.getOperationName()) > 0) { + throw new ServiceException("手术名称已存在"); } // 设置修改人,修改时间 operationInfo.setUpdateBy(SecurityUtils.getUsername()); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/scriptInfo/impl/ScriptInfoServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/scriptInfo/impl/ScriptInfoServiceImpl.java index d824a318..df3d4599 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/scriptInfo/impl/ScriptInfoServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/scriptInfo/impl/ScriptInfoServiceImpl.java @@ -84,9 +84,9 @@ public class ScriptInfoServiceImpl implements IScriptInfoService { @Transactional(rollbackFor = Exception.class) public int updateScriptInfo(ScriptInfo scriptInfo) { // 检查除当前记录之外是否存在同名的话术名称 - if (!scriptInfo.getCommonScriptName().equals(scriptInfoMapper.selectScriptInfoById(scriptInfo.getId())) + if (!scriptInfo.getCommonScriptName().equals(scriptInfoMapper.selectScriptInfoById(scriptInfo.getId()).getCommonScriptName()) && scriptInfoMapper.countByScriptNameExcludingId(scriptInfo.getCommonScriptName(), scriptInfo.getDepartmentId(), scriptInfo.getId()) > 0) { - // 存在同名的话术名称,不能进行更新 + // 存在同名的通用话术名称,不能进行更新 throw new ServiceException("通用话术名称已存在,请使用其他名称。"); } else { // 不存在同名的话术名称或者名称未改变,设置修改人和修改时间 diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/impl/ServicePackageServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/impl/ServicePackageServiceImpl.java index 377f8dc3..3a2f534e 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/impl/ServicePackageServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicepackage/impl/ServicePackageServiceImpl.java @@ -83,15 +83,17 @@ public class ServicePackageServiceImpl implements IServicePackageService { if (existNameCount > 0) { throw new ServiceException("当前科室下服务包名称已存在"); } + String username = SecurityUtils.getUsername(); + Date nowDate = DateUtils.getNowDate(); // 初始化ServicePackage,将servicePackageAddDTO赋值给ServicePackage,新增服务包 ServicePackage servicePackage = new ServicePackage(); BeanUtils.copyProperties(servicePackageAddDTO, servicePackage); + servicePackage.setCreateBy(username); + servicePackage.setCreateTime(nowDate); if (servicePackageMapper.insertServicePackage(servicePackage) <= 0) { throw new ServiceException("新增服务包失败"); } // 新增服务内容 - String username = SecurityUtils.getUsername(); - Date nowDate = DateUtils.getNowDate(); for (ServicePackageContentVO vo : servicePackageAddDTO.getVoList()) { Long serviceWayId = createServiceWay(servicePackage, vo, username, nowDate); Long serviceContentId = createServiceContent(servicePackage, vo, serviceWayId, username, nowDate); @@ -109,14 +111,18 @@ public class ServicePackageServiceImpl implements IServicePackageService { @Override @Transactional(rollbackFor = Exception.class) public int updateServicePackage(ServicePackageAddDTO servicePackageAddDTO) { - // 判断所属科室下服务包名称是否存在 - int existNameCount = servicePackageMapper.existNameCount(servicePackageAddDTO.getDepartmentId(), servicePackageAddDTO.getPackageName()); - if (existNameCount > 0) { + // 检查除当前记录之外是否存在同名的服务包名称 + if (!servicePackageAddDTO.getPackageName().equals(servicePackageMapper.selectServicePackagesById(servicePackageAddDTO.getId())) + && servicePackageMapper.countByPackageNameExcludingId(servicePackageAddDTO.getId(), servicePackageAddDTO.getDepartmentId(), servicePackageAddDTO.getPackageName()) > 0) { throw new ServiceException("当前科室下服务包名称已存在"); } + String username = SecurityUtils.getUsername(); + Date nowDate = DateUtils.getNowDate(); // 初始化ServicePackage,将servicePackageAddDTO赋值给ServicePackage,更新服务包 ServicePackage servicePackage = new ServicePackage(); BeanUtils.copyProperties(servicePackageAddDTO, servicePackage); + servicePackage.setCreateBy(username); + servicePackage.setCreateTime(nowDate); if (servicePackageMapper.updateServicePackage(servicePackage) <= 0) { throw new ServiceException("修改服务包失败"); } @@ -125,8 +131,6 @@ public class ServicePackageServiceImpl implements IServicePackageService { throw new ServiceException("删除服务包内容失败"); } // 新增服务内容 - String username = SecurityUtils.getUsername(); - Date nowDate = DateUtils.getNowDate(); for (ServicePackageContentVO vo : servicePackageAddDTO.getVoList()) { Long serviceWayId = createServiceWay(servicePackage, vo, username, nowDate); Long serviceContentId = createServiceContent(servicePackage, vo, serviceWayId, username, nowDate); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java index 68bcee67..fce9e32f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/servicewaycontent/impl/ServiceWayContentServiceImpl.java @@ -131,58 +131,90 @@ public class ServiceWayContentServiceImpl implements IServiceWayContentService { */ @Override public int updateServiceWayContent(ServiceWayContentEditDTO serviceWayContentEditDTO) { - // 判断服务内容在服务内容表中是否存在 - ServiceWayContentVO serviceWayContentVO = serviceWayContentMapper.countByWayIdAndContent(serviceWayContentEditDTO.getServiceWayId(), serviceWayContentEditDTO.getServiceContent()); +// // 判断服务内容在服务内容表中是否存在 +// ServiceWayContentVO serviceWayContentVO = serviceWayContentMapper.countByWayIdAndContent(serviceWayContentEditDTO.getServiceWayId(), serviceWayContentEditDTO.getServiceContent()); String username = SecurityUtils.getUsername(); Date date = DateUtils.getNowDate(); ServiceWayContent serviceFrequency = new ServiceWayContent(); - // 如果服务内容在服务内容表中存在 - if (ObjectUtils.isNotEmpty(serviceWayContentVO)) { - // 判断服务频次是否在服务频次表中是否存在 - ServiceFrequencyDTO serviceFrequencyDTO = new ServiceFrequencyDTO(); - BeanUtils.copyProperties(serviceWayContentEditDTO, serviceFrequencyDTO); - serviceFrequencyDTO.setServiceContentId(serviceWayContentVO.getId()); - // 如果当前服务内容下服务频次已存在 - if (serviceWayContentMapper.countByServiceFrequencyDTO(serviceFrequencyDTO) > 0) { - throw new ServiceException("当前服务内容下服务频次已存在"); - } - // 如果当前服务内容下服务频次不存在,更新服务频次 - serviceFrequency.setId(serviceWayContentEditDTO.getId()); - serviceFrequency.setServiceContentId(serviceWayContentVO.getId()); - serviceFrequency.setServiceFrequencyType(serviceWayContentEditDTO.getServiceFrequencyType()); - serviceFrequency.setServiceFrequencyText(serviceWayContentEditDTO.getServiceFrequencyText()); - serviceFrequency.setServiceFrequencyStart(serviceWayContentEditDTO.getServiceFrequencyStart()); - serviceFrequency.setServiceFrequencyEnd(serviceWayContentEditDTO.getServiceFrequencyEnd()); - serviceFrequency.setUpdateBy(username); - serviceFrequency.setUpdateTime(date); - if (serviceWayContentMapper.updateServiceWayContent(serviceFrequency) <= 0) { - throw new ServiceException("更新服务频次失败"); - } - } else { - // 如果服务内容在服务内容表不存在,更新服务内容,更新服务频次 - // 更新服务内容 - ServiceWayContent serviceContent = new ServiceWayContent(); - serviceContent.setId(serviceWayContentEditDTO.getServiceContentId()); - serviceContent.setServiceWayId(serviceWayContentEditDTO.getServiceWayId()); - serviceContent.setServiceContent(serviceWayContentEditDTO.getServiceContent()); - serviceContent.setUpdateBy(username); - serviceContent.setUpdateTime(date); - if (serviceWayContentMapper.updateServiceWayContent(serviceContent) <= 0) { - throw new ServiceException("更新服务内容失败"); - } - // 修改服务频次 - serviceFrequency.setId(serviceWayContentEditDTO.getId()); - serviceFrequency.setServiceContentId(serviceContent.getId()); - serviceFrequency.setServiceFrequencyType(serviceWayContentEditDTO.getServiceFrequencyType()); - serviceFrequency.setServiceFrequencyText(serviceWayContentEditDTO.getServiceFrequencyText()); - serviceFrequency.setServiceFrequencyStart(serviceWayContentEditDTO.getServiceFrequencyStart()); - serviceFrequency.setServiceFrequencyEnd(serviceWayContentEditDTO.getServiceFrequencyEnd()); - serviceFrequency.setUpdateBy(username); - serviceFrequency.setUpdateTime(date); - if (serviceWayContentMapper.updateServiceWayContent(serviceFrequency) <= 0) { - throw new ServiceException("更新服务频次失败"); - } + // 检查除当前记录之外是否存在同名的服务内容 + if (!serviceWayContentEditDTO.getServiceContent().equals(serviceWayContentMapper.selectServiceWayContentById(serviceWayContentEditDTO.getServiceContentId())) + && serviceWayContentMapper.countByContentExcludingId(serviceWayContentEditDTO.getServiceContentId(), serviceWayContentEditDTO.getServiceWayId(), serviceWayContentEditDTO.getServiceContent()) > 0) { + throw new ServiceException("服务内容已存在"); } + ServiceWayContent serviceContent = new ServiceWayContent(); + serviceContent.setId(serviceWayContentEditDTO.getServiceContentId()); + serviceContent.setServiceWayId(serviceWayContentEditDTO.getServiceWayId()); + serviceContent.setServiceContent(serviceWayContentEditDTO.getServiceContent()); + serviceContent.setUpdateBy(username); + serviceContent.setUpdateTime(date); + if (serviceWayContentMapper.updateServiceWayContent(serviceContent) <= 0) { + throw new ServiceException("修改服务内容失败"); + } + // 检查除当前记录之外是否存在相同的服务频次 + if (!serviceWayContentEditDTO.equals(serviceWayContentMapper.selectServiceWayContentById(serviceWayContentEditDTO.getId())) + && serviceWayContentMapper.countByServiceFrequencyExcludingId(serviceWayContentEditDTO.getId(), serviceWayContentEditDTO.getServiceContentId(), serviceWayContentEditDTO) > 0) { + throw new ServiceException("服务频次已存在"); + } + // 如果当前服务内容下服务频次不存在,更新服务频次 + serviceFrequency.setId(serviceWayContentEditDTO.getId()); + serviceFrequency.setServiceContentId(serviceWayContentEditDTO.getServiceContentId()); + serviceFrequency.setServiceFrequencyType(serviceWayContentEditDTO.getServiceFrequencyType()); + serviceFrequency.setServiceFrequencyText(serviceWayContentEditDTO.getServiceFrequencyText()); + serviceFrequency.setServiceFrequencyStart(serviceWayContentEditDTO.getServiceFrequencyStart()); + serviceFrequency.setServiceFrequencyEnd(serviceWayContentEditDTO.getServiceFrequencyEnd()); + serviceFrequency.setUpdateBy(username); + serviceFrequency.setUpdateTime(date); + if (serviceWayContentMapper.updateServiceWayContent(serviceFrequency) <= 0) { + throw new ServiceException("修改服务频次失败"); + } + + +// if (ObjectUtils.isNotEmpty(serviceWayContentVO)) { +// // 判断服务频次是否在服务频次表中是否存在 +// ServiceFrequencyDTO serviceFrequencyDTO = new ServiceFrequencyDTO(); +// BeanUtils.copyProperties(serviceWayContentEditDTO, serviceFrequencyDTO); +// serviceFrequencyDTO.setServiceContentId(serviceWayContentVO.getId()); +// // 如果当前服务内容下服务频次已存在 +// if (serviceWayContentMapper.countByServiceFrequencyDTO(serviceFrequencyDTO) > 0) { +// throw new ServiceException("当前服务内容下服务频次已存在"); +// } +// // 如果当前服务内容下服务频次不存在,更新服务频次 +// serviceFrequency.setId(serviceWayContentEditDTO.getId()); +// serviceFrequency.setServiceContentId(serviceWayContentVO.getId()); +// serviceFrequency.setServiceFrequencyType(serviceWayContentEditDTO.getServiceFrequencyType()); +// serviceFrequency.setServiceFrequencyText(serviceWayContentEditDTO.getServiceFrequencyText()); +// serviceFrequency.setServiceFrequencyStart(serviceWayContentEditDTO.getServiceFrequencyStart()); +// serviceFrequency.setServiceFrequencyEnd(serviceWayContentEditDTO.getServiceFrequencyEnd()); +// serviceFrequency.setUpdateBy(username); +// serviceFrequency.setUpdateTime(date); +// if (serviceWayContentMapper.updateServiceWayContent(serviceFrequency) <= 0) { +// throw new ServiceException("修改服务频次失败"); +// } +// } else { +// // 如果服务内容在服务内容表不存在,更新服务内容,更新服务频次 +// // 修改服务内容 +// ServiceWayContent serviceContent = new ServiceWayContent(); +// serviceContent.setId(serviceWayContentEditDTO.getServiceContentId()); +// serviceContent.setServiceWayId(serviceWayContentEditDTO.getServiceWayId()); +// serviceContent.setServiceContent(serviceWayContentEditDTO.getServiceContent()); +// serviceContent.setUpdateBy(username); +// serviceContent.setUpdateTime(date); +// if (serviceWayContentMapper.updateServiceWayContent(serviceContent) <= 0) { +// throw new ServiceException("修改服务内容失败"); +// } +// // 修改服务频次 +// serviceFrequency.setId(serviceWayContentEditDTO.getId()); +// serviceFrequency.setServiceContentId(serviceContent.getId()); +// serviceFrequency.setServiceFrequencyType(serviceWayContentEditDTO.getServiceFrequencyType()); +// serviceFrequency.setServiceFrequencyText(serviceWayContentEditDTO.getServiceFrequencyText()); +// serviceFrequency.setServiceFrequencyStart(serviceWayContentEditDTO.getServiceFrequencyStart()); +// serviceFrequency.setServiceFrequencyEnd(serviceWayContentEditDTO.getServiceFrequencyEnd()); +// serviceFrequency.setUpdateBy(username); +// serviceFrequency.setUpdateTime(date); +// if (serviceWayContentMapper.updateServiceWayContent(serviceFrequency) <= 0) { +// throw new ServiceException("修改服务频次失败"); +// } +// } return 1; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/textmessage/impl/TextMessageServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/textmessage/impl/TextMessageServiceImpl.java index 75350ef5..b52ad2b0 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/textmessage/impl/TextMessageServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/textmessage/impl/TextMessageServiceImpl.java @@ -7,15 +7,12 @@ import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.manage.domain.textmessage.TextMessage; import com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask; -import com.xinelu.manage.domain.wechattemplatesuittask.WechatTemplateSuitTask; import com.xinelu.manage.dto.textmessage.TextMessageDTO; import com.xinelu.manage.dto.textmessage.TextMessageTaskDTO; import com.xinelu.manage.mapper.textmessage.TextMessageMapper; import com.xinelu.manage.service.textmessage.ITextMessageService; import com.xinelu.manage.vo.textmessage.TextMessageTaskVO; import com.xinelu.manage.vo.textmessage.TextMessageVO; -import com.xinelu.manage.vo.wechattemplate.WechatTemplateTaskVO; -import com.xinelu.manage.vo.wechattemplate.WechatTemplateVO; import com.xinelu.system.mapper.SysDictDataMapper; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -161,8 +158,9 @@ public class TextMessageServiceImpl implements ITextMessageService { @Override @Transactional(rollbackFor = Exception.class) public int updateTextMessage(TextMessageTaskDTO textMessageTaskDTO) { - // 检查短信模板名称是否已存在 - if (textMessageMapper.countByTextMessageTaskDTO(textMessageTaskDTO) > 0) { + // 检查除当前记录之外是否存在同名的短信模板名称 + if (!textMessageTaskDTO.getTextMessageName().equals(textMessageMapper.selectTextMessageById(textMessageTaskDTO.getId())) && + textMessageMapper.countByTextMessageNameExcludingId(textMessageTaskDTO.getId(), textMessageTaskDTO.getDepartmentId(), textMessageTaskDTO.getTextMessageName()) > 0) { throw new ServiceException("短信模板名称已存在"); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/wechattemplate/impl/WechatTemplateServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/wechattemplate/impl/WechatTemplateServiceImpl.java index b54261ab..49371614 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/wechattemplate/impl/WechatTemplateServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/wechattemplate/impl/WechatTemplateServiceImpl.java @@ -147,11 +147,11 @@ public class WechatTemplateServiceImpl implements IWechatTemplateService { @Override @Transactional(rollbackFor = Exception.class) public int updateWechatTemplate(WechatTemplateTaskDTO wechatTemplateTaskDTO) { - // 检查微信模板名称是否已存在 - if (wechatTemplateMapper.countByWechatTemplateTaskDTO(wechatTemplateTaskDTO) > 0) { + // 检查除当前记录之外是否存在同名的微信模板名称 + if (!wechatTemplateTaskDTO.getWechatTemplateName().equals(wechatTemplateMapper.selectWechatTemplateById(wechatTemplateTaskDTO.getId())) && + wechatTemplateMapper.countByWechatTemplateNameExcludingId(wechatTemplateTaskDTO.getId(), wechatTemplateTaskDTO.getDepartmentId(), wechatTemplateTaskDTO.getWechatTemplateName()) > 0) { throw new ServiceException("微信模板名称已存在"); } - // 设置修改者和修改时间 String editUsername = SecurityUtils.getUsername(); Date editTime = DateUtils.getNowDate(); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicewaycontent/ServiceWayContentVO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicewaycontent/ServiceWayContentVO.java index 1d22f3ca..ddc58ea2 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicewaycontent/ServiceWayContentVO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/servicewaycontent/ServiceWayContentVO.java @@ -32,6 +32,13 @@ public class ServiceWayContentVO { @Excel(name = "服务内容") private String serviceContent; + /** + * 所属服务方式id + */ + @ApiModelProperty(value = "所属服务方式id") + @Excel(name = "所属服务方式id") + private String serviceWayId; + /** * 服务频次列表 */ diff --git a/postdischarge-manage/src/main/resources/mapper/manage/operationInfo/OperationInfoMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/operationInfo/OperationInfoMapper.xml index 3941bf6c..647b9b9e 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/operationInfo/OperationInfoMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/operationInfo/OperationInfoMapper.xml @@ -87,15 +87,14 @@ and operation_name = #{operationName} - + select count(1) from operation_info where department_id = #{departmentId} and operation_name = #{operationName} - and operation_info = #{operationInfo} + and id != #{id} - insert into operation_info diff --git a/postdischarge-manage/src/main/resources/mapper/manage/servicepackage/ServicePackageMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/servicepackage/ServicePackageMapper.xml index 8eb877c6..77dfd899 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/servicepackage/ServicePackageMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/servicepackage/ServicePackageMapper.xml @@ -196,8 +196,7 @@ and package_version like concat('%', - #{packageVersion} - }, + #{packageVersion}, '%' ) @@ -237,6 +236,14 @@ and package_name = #{packageName} + + insert into service_package diff --git a/postdischarge-manage/src/main/resources/mapper/manage/servicewaycontent/ServiceWayContentMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/servicewaycontent/ServiceWayContentMapper.xml index 337a1d20..cb14314f 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/servicewaycontent/ServiceWayContentMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/servicewaycontent/ServiceWayContentMapper.xml @@ -27,6 +27,7 @@ + @@ -149,13 +150,14 @@ - select count(*) + select count(1) from service_way_content swc where swc.service_way_name = #{serviceWayName} and swc.service_type = 'SERVICE_WRY' @@ -313,6 +315,40 @@ + + + + insert into service_way_content diff --git a/postdischarge-manage/src/main/resources/mapper/manage/textmessage/TextMessageMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/textmessage/TextMessageMapper.xml index 5144506a..31eb6878 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/textmessage/TextMessageMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/textmessage/TextMessageMapper.xml @@ -139,6 +139,7 @@ order by tm.create_time DESC ,tmst.create_time DESC + - + select count(1) + from text_message + where department_id = #{departmentId} + and text_message_name = #{textMessageName} + and id != #{id} diff --git a/postdischarge-manage/src/main/resources/mapper/manage/wechattemplate/WechatTemplateMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/wechattemplate/WechatTemplateMapper.xml index b15473fd..fe3b88bd 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/wechattemplate/WechatTemplateMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/wechattemplate/WechatTemplateMapper.xml @@ -183,6 +183,14 @@ and wechat_template_name = #{wechatTemplateName} + + insert into wechat_template