|
@@ -1,11 +1,15 @@
|
|
package com.diagbot.facade;
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.diagbot.entity.DeptInfo;
|
|
import com.diagbot.entity.DeptInfo;
|
|
|
|
+import com.diagbot.enums.IsDeleteEnum;
|
|
|
|
+import com.diagbot.exception.CommonErrorCode;
|
|
|
|
+import com.diagbot.exception.CommonException;
|
|
import com.diagbot.service.impl.DeptInfoServiceImpl;
|
|
import com.diagbot.service.impl.DeptInfoServiceImpl;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.DateUtil;
|
|
import com.diagbot.util.DateUtil;
|
|
import com.diagbot.util.UserUtils;
|
|
import com.diagbot.util.UserUtils;
|
|
import com.diagbot.vo.AddDeptInfoVO;
|
|
import com.diagbot.vo.AddDeptInfoVO;
|
|
|
|
+import com.diagbot.vo.UpdateDeptInfoVO;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -17,7 +21,7 @@ import org.springframework.stereotype.Component;
|
|
public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 添加科室信息(本地)
|
|
|
|
|
|
+ * 添加科室信息
|
|
* @param addDeptInfoVO
|
|
* @param addDeptInfoVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -27,6 +31,47 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
deptInfo.setCreator(UserUtils.getCurrentPrincipleID());
|
|
deptInfo.setCreator(UserUtils.getCurrentPrincipleID());
|
|
deptInfo.setGmtCreate(DateUtil.now());
|
|
deptInfo.setGmtCreate(DateUtil.now());
|
|
Boolean flag = this.save(deptInfo);
|
|
Boolean flag = this.save(deptInfo);
|
|
|
|
+ if(!flag){
|
|
|
|
+ throw new CommonException(CommonErrorCode.FAIL,
|
|
|
|
+ "科室信息添加失败");
|
|
|
|
+ }
|
|
|
|
+ return flag;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改科室信息
|
|
|
|
+ * @param updateDeptInfoVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Boolean updateDeptInfo(UpdateDeptInfoVO updateDeptInfoVO) {
|
|
|
|
+ DeptInfo deptInfo =new DeptInfo();
|
|
|
|
+ BeanUtil.copyProperties(updateDeptInfoVO,deptInfo);
|
|
|
|
+ deptInfo.setModifier(UserUtils.getCurrentPrincipleID());
|
|
|
|
+ deptInfo.setGmtModified(DateUtil.now());
|
|
|
|
+ Boolean flag = this.updateById(deptInfo);
|
|
|
|
+ if(!flag){
|
|
|
|
+ throw new CommonException(CommonErrorCode.FAIL,
|
|
|
|
+ "科室信息修改失败");
|
|
|
|
+ }
|
|
|
|
+ return flag;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除科室信息
|
|
|
|
+ * @param updateDeptInfoVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Boolean deleteDeptInfo(UpdateDeptInfoVO updateDeptInfoVO) {
|
|
|
|
+ DeptInfo deptInfo =new DeptInfo();
|
|
|
|
+ BeanUtil.copyProperties(updateDeptInfoVO,deptInfo);
|
|
|
|
+ deptInfo.setModifier(UserUtils.getCurrentPrincipleID());
|
|
|
|
+ deptInfo.setIsDeleted(IsDeleteEnum.Y.getKey());
|
|
|
|
+ deptInfo.setGmtModified(DateUtil.now());
|
|
|
|
+ Boolean flag = this.updateById(deptInfo);
|
|
|
|
+ if(!flag){
|
|
|
|
+ throw new CommonException(CommonErrorCode.FAIL,
|
|
|
|
+ "科室信息删除失败");
|
|
|
|
+ }
|
|
return flag;
|
|
return flag;
|
|
}
|
|
}
|
|
|
|
|