|
@@ -0,0 +1,69 @@
|
|
|
+package com.diagbot.facade;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
+import com.diagbot.entity.DoctorPageMode;
|
|
|
+import com.diagbot.enums.IsDeleteEnum;
|
|
|
+import com.diagbot.service.impl.DoctorPageModeServiceImpl;
|
|
|
+import com.diagbot.util.DateUtil;
|
|
|
+import com.diagbot.vo.DoctorIdVO;
|
|
|
+import com.diagbot.vo.DoctorPageModeVO;
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @author wangfeng
|
|
|
+ * @Description: 医生页面模式设置
|
|
|
+ * @date 2018年11月20日 下午2:56:01
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class DoctorPageModeFacade extends DoctorPageModeServiceImpl {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存医生页面结构设置信息
|
|
|
+ * @param doctorPageModeVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public boolean saveDoctorPageMode(@Valid DoctorPageModeVO doctorPageModeVO) {
|
|
|
+ QueryWrapper<DoctorPageMode> doctorPageModeWrapper = new QueryWrapper<>();
|
|
|
+ doctorPageModeWrapper.eq("doctor_id", doctorPageModeVO.getDoctorId()).eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ DoctorPageMode datas = getOne(doctorPageModeWrapper);
|
|
|
+ boolean res = false;
|
|
|
+ if (datas != null) {
|
|
|
+ UpdateWrapper<DoctorPageMode> doctorPageModeUpdate = new UpdateWrapper<>();
|
|
|
+ doctorPageModeUpdate.eq("doctor_id", doctorPageModeVO.getDoctorId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .set("mode_classify",doctorPageModeVO.getModeClassify())
|
|
|
+ .set("mode_value",doctorPageModeVO.getModeValue() )
|
|
|
+ .set("modifier",doctorPageModeVO.getDoctorId().toString() )
|
|
|
+ .set("gmt_modified", DateUtil.now());
|
|
|
+ res = update(new DoctorPageMode(), doctorPageModeUpdate);
|
|
|
+ //throw new CommonException(CommonErrorCode.NOT_EXISTS, "该模板名已存在");
|
|
|
+ }else {
|
|
|
+ DoctorPageMode doctorPageMode = new DoctorPageMode();
|
|
|
+ doctorPageMode.setDoctorId(doctorPageModeVO.getDoctorId());
|
|
|
+ doctorPageMode.setModeClassify(doctorPageModeVO.getModeClassify());
|
|
|
+ doctorPageMode.setModeValue(doctorPageModeVO.getModeValue());
|
|
|
+ doctorPageMode.setCreator(doctorPageModeVO.getDoctorId().toString());
|
|
|
+ doctorPageMode.setGmtCreate(DateUtil.now());
|
|
|
+ res = save(doctorPageMode);
|
|
|
+ }
|
|
|
+
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取医生页面结构设置信息
|
|
|
+ * @param doctorIdVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public DoctorPageMode getDoctorPageMode(@Valid DoctorIdVO doctorIdVO) {
|
|
|
+ QueryWrapper<DoctorPageMode> doctorPageModeWrapper = new QueryWrapper<>();
|
|
|
+ doctorPageModeWrapper.eq("doctor_id", doctorIdVO.getDoctorId()).eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ DoctorPageMode doctorPageModeData = getOne(doctorPageModeWrapper);
|
|
|
+ return doctorPageModeData;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|