修改微信模板修改和短信模板修改接口
This commit is contained in:
parent
32911dfa2d
commit
d9f279dc8d
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ public interface ServicePackageMapper {
|
||||
List<ServicePackageContentVO> 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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -112,17 +112,20 @@ public interface TextMessageMapper {
|
||||
*/
|
||||
int updateTextMessageSuitTask(@Param("task") TextMessageSuitTask task);
|
||||
|
||||
/**
|
||||
* 根据textMessageId查询适用任务类型id
|
||||
*
|
||||
* @param textMessageId
|
||||
* @return
|
||||
*/
|
||||
List<TextMessageSuitTask> 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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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 {
|
||||
// 不存在同名的话术名称或者名称未改变,设置修改人和修改时间
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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("短信模板名称已存在");
|
||||
}
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -32,6 +32,13 @@ public class ServiceWayContentVO {
|
||||
@Excel(name = "服务内容")
|
||||
private String serviceContent;
|
||||
|
||||
/**
|
||||
* 所属服务方式id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属服务方式id")
|
||||
@Excel(name = "所属服务方式id")
|
||||
private String serviceWayId;
|
||||
|
||||
/**
|
||||
* 服务频次列表
|
||||
*/
|
||||
|
||||
@ -87,15 +87,14 @@
|
||||
and operation_name = #{operationName}
|
||||
</select>
|
||||
|
||||
<select id="countByDepartmentIdAndOperationInfo" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
<select id="countByOperationNameExcludingId" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from operation_info
|
||||
where department_id = #{departmentId}
|
||||
and operation_name = #{operationName}
|
||||
and operation_info = #{operationInfo}
|
||||
and id != #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertOperationInfo" parameterType="OperationInfo" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into operation_info
|
||||
|
||||
@ -196,8 +196,7 @@
|
||||
</if>
|
||||
<if test="packageVersion != null and packageVersion != ''">
|
||||
and package_version like concat('%',
|
||||
#{packageVersion}
|
||||
},
|
||||
#{packageVersion},
|
||||
'%'
|
||||
)
|
||||
</if>
|
||||
@ -237,6 +236,14 @@
|
||||
and package_name = #{packageName}
|
||||
</select>
|
||||
|
||||
<select id="countByPackageNameExcludingId" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from service_package
|
||||
where department_id = #{departmentId}
|
||||
and package_name = #{packageName}
|
||||
and id != #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertServicePackage" parameterType="ServicePackage" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into service_package
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
<resultMap id="ServiceContentAndFrequencyVOMap" type="com.xinelu.manage.vo.servicewaycontent.ServiceWayContentVO">
|
||||
<id property="id" column="id"/>
|
||||
<result column="service_content" property="serviceContent"/>
|
||||
<result column="service_way_id" property="serviceWayId"/>
|
||||
<collection property="serviceWayFrequencyList"
|
||||
ofType="com.xinelu.manage.vo.servicefrequency.ServiceFrequencyVO">
|
||||
<id column="serviceFrequencyId" property="id"/>
|
||||
@ -149,13 +150,14 @@
|
||||
<select id="selectServiceWayContentListV1"
|
||||
resultMap="ServiceContentAndFrequencyVOMap">
|
||||
SELECT swc1.id,swc1.service_content,
|
||||
swc1.service_way_id,
|
||||
swc2.id AS serviceFrequencyId,
|
||||
swc2.service_frequency_type,
|
||||
swc2.service_frequency_text,
|
||||
swc2.service_frequency_start,
|
||||
swc2.service_frequency_end
|
||||
FROM service_way_content swc1
|
||||
LEFT JOIN service_way_content swc2 on swc1.id = swc2.service_content_id
|
||||
JOIN service_way_content swc2 on swc1.id = swc2.service_content_id
|
||||
<where>
|
||||
swc1.service_type = 'SERVICE_CONTENT'
|
||||
and swc2.service_type = 'SERVICE_FREQUENCY'
|
||||
@ -170,7 +172,7 @@
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
order by swc1.create_time DESC,swc2.create_time DESC
|
||||
order by swc1.create_time DESC,swc2.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectServiceWayContentDetailByFrequencyId"
|
||||
@ -191,7 +193,7 @@
|
||||
|
||||
</select>
|
||||
<select id="countByServiceName" resultType="java.lang.Integer" parameterType="java.lang.String">
|
||||
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 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="countByContentExcludingId" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from service_way_content
|
||||
where service_way_id = #{serviceWayId}
|
||||
and service_content = #{serviceContent}
|
||||
and id != #{serviceContentId}
|
||||
</select>
|
||||
|
||||
<select id="countByServiceFrequencyExcludingId" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from service_way_content
|
||||
<where>
|
||||
service_content_id =#{serviceContentId}
|
||||
and id != #{id}
|
||||
<if test="serviceWayContentEditDTO.serviceFrequencyType!=null and serviceWayContentEditDTO.serviceFrequencyType!=''">
|
||||
and service_frequency_type =
|
||||
#{serviceWayContentEditDTO.serviceFrequencyType}
|
||||
</if>
|
||||
<if test="serviceWayContentEditDTO.serviceFrequencyText!=null and serviceWayContentEditDTO.serviceFrequencyText!=''">
|
||||
and service_frequency_text =
|
||||
#{serviceWayContentEditDTO.serviceFrequencyText}
|
||||
</if>
|
||||
<if test="serviceWayContentEditDTO.serviceFrequencyStart!=null">
|
||||
and service_frequency_start =
|
||||
#{serviceWayContentEditDTO.serviceFrequencyStart}
|
||||
</if>
|
||||
<if test="serviceWayContentEditDTO.serviceFrequencyEnd!=null">
|
||||
and service_frequency_end =
|
||||
#{serviceWayContentEditDTO.serviceFrequencyEnd}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<insert id="insertServiceWayContent" parameterType="ServiceWayContent" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into service_way_content
|
||||
|
||||
@ -139,6 +139,7 @@
|
||||
</where>
|
||||
order by tm.create_time DESC ,tmst.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="countByTextMessageTaskDTO" resultType="java.lang.Integer"
|
||||
parameterType="com.xinelu.manage.dto.textmessage.TextMessageTaskDTO">
|
||||
select count(*)
|
||||
@ -146,11 +147,13 @@
|
||||
where department_id = #{departmentId}
|
||||
and text_message_name = #{textMessageName}
|
||||
</select>
|
||||
<select id="selectTextMessageSuitTask"
|
||||
resultType="com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask">
|
||||
select *
|
||||
from text_message_suit_task
|
||||
where text_message_id = #{textMessageId}
|
||||
|
||||
<select id="countByTextMessageNameExcludingId" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from text_message
|
||||
where department_id = #{departmentId}
|
||||
and text_message_name = #{textMessageName}
|
||||
and id != #{id}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
@ -183,6 +183,14 @@
|
||||
and wechat_template_name = #{wechatTemplateName}
|
||||
</select>
|
||||
|
||||
<select id="countByWechatTemplateNameExcludingId" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from wechat_template
|
||||
where department_id = #{departmentId}
|
||||
and wechat_template_name = #{wechatTemplateName}
|
||||
and id != #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWechatTemplate" parameterType="WechatTemplate" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into wechat_template
|
||||
|
||||
Loading…
Reference in New Issue
Block a user