|
@@ -78,7 +78,7 @@ public class QcModuleInfoFacade extends QcModuleInfoServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public Boolean saveOrUpdateModuleInfo(AddModuleInfoVO addModulInfoVO) {
|
|
|
- // 校验
|
|
|
+ // 校验名称是否相同
|
|
|
int count = this.count(new QueryWrapper<QcModuleInfo>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("mode_id", addModulInfoVO.getModeId())
|
|
@@ -88,6 +88,18 @@ public class QcModuleInfoFacade extends QcModuleInfoServiceImpl {
|
|
|
if (count > 0) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "相同【医院】【模块】下,模板名称已存在");
|
|
|
}
|
|
|
+
|
|
|
+ // 同一文书类型下只有一份
|
|
|
+ count = this.count(new QueryWrapper<QcModuleInfo>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("mode_id", addModulInfoVO.getModeId())
|
|
|
+ .eq("hospital_id", addModulInfoVO.getHospitalId())
|
|
|
+ .eq("record_module_id", addModulInfoVO.getRecordModuleId())
|
|
|
+ .ne("id", addModulInfoVO.getId() == null ? -1 : addModulInfoVO.getId()));
|
|
|
+ if (count > 0) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "相同【医院】【模块】下,模块类型已存在");
|
|
|
+ }
|
|
|
+
|
|
|
Long moduleId = null;
|
|
|
Boolean bac = false;
|
|
|
if (addModulInfoVO.getId() == null) {
|
|
@@ -167,7 +179,7 @@ public class QcModuleInfoFacade extends QcModuleInfoServiceImpl {
|
|
|
List<QcModuleDetail> qcModuleDetailList = qcModuleDetailFacade.list(new QueryWrapper<QcModuleDetail>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("module_id", getModuleInfoOneDTO.getId())
|
|
|
- .orderByDesc("order_no")
|
|
|
+ .orderByAsc("order_no")
|
|
|
);
|
|
|
List<QcModuleDetailDTO> qcModuleDetailDTOList = BeanUtil.listCopyTo(qcModuleDetailList, QcModuleDetailDTO.class);
|
|
|
|