Browse Source

增加心理咨询师相关业务

hotfix/yujt_opt
zhangyuan 5 years ago
parent
commit
a5807d7f6f
  1. 100
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/controller/PsychologistController.java
  2. 94
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/controller/PsychologistTitleController.java
  3. 94
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/controller/PsychologistTitleRelationController.java
  4. 45
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistDao.java
  5. 33
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistTitleDao.java
  6. 33
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistTitleRelationDao.java
  7. 84
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/entity/PsychologistEntity.java
  8. 49
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/entity/PsychologistTitleEntity.java
  9. 49
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/entity/PsychologistTitleRelationEntity.java
  10. 83
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/excel/PsychologistExcel.java
  11. 62
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/excel/PsychologistTitleExcel.java
  12. 62
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/excel/PsychologistTitleRelationExcel.java
  13. 47
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/redis/PsychologistRedis.java
  14. 47
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/redis/PsychologistTitleRedis.java
  15. 47
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/redis/PsychologistTitleRelationRedis.java
  16. 103
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/PsychologistService.java
  17. 95
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/PsychologistTitleRelationService.java
  18. 95
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/PsychologistTitleService.java
  19. 108
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologistServiceImpl.java
  20. 104
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologistTitleRelationServiceImpl.java
  21. 104
      epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologistTitleServiceImpl.java
  22. 45
      epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistDao.xml
  23. 19
      epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistTitleDao.xml
  24. 19
      epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistTitleRelationDao.xml

100
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/controller/PsychologistController.java

@ -0,0 +1,100 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.psychology.PsychologistDTO;
import com.elink.esua.epdc.dto.psychology.SysUserDictDTO;
import com.elink.esua.epdc.modules.psychology.excel.PsychologistExcel;
import com.elink.esua.epdc.modules.psychology.service.PsychologistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 心理咨询师表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@RestController
@RequestMapping("psychologist")
public class PsychologistController {
@Autowired
private PsychologistService psychologistService;
@GetMapping("page")
public Result<PageData<PsychologistDTO>> page(@RequestParam Map<String, Object> params) {
PageData<PsychologistDTO> page = psychologistService.page(params);
return new Result<PageData<PsychologistDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<PsychologistDTO> get(@PathVariable("id") String id) {
PsychologistDTO data = psychologistService.get(id);
return new Result<PsychologistDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody PsychologistDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
psychologistService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody PsychologistDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
psychologistService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
psychologistService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<PsychologistDTO> list = psychologistService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PsychologistExcel.class);
}
@GetMapping("userList")
public Result<List<SysUserDictDTO>> getSysUserDict() {
List<SysUserDictDTO> data = psychologistService.getSysUserDict();
return new Result<List<SysUserDictDTO>>().ok(data);
}
}

94
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/controller/PsychologistTitleController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.psychology.PsychologistTitleDTO;
import com.elink.esua.epdc.modules.psychology.excel.PsychologistTitleExcel;
import com.elink.esua.epdc.modules.psychology.service.PsychologistTitleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@RestController
@RequestMapping("psychologisttitle")
public class PsychologistTitleController {
@Autowired
private PsychologistTitleService psychologistTitleService;
@GetMapping("page")
public Result<PageData<PsychologistTitleDTO>> page(@RequestParam Map<String, Object> params){
PageData<PsychologistTitleDTO> page = psychologistTitleService.page(params);
return new Result<PageData<PsychologistTitleDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<PsychologistTitleDTO> get(@PathVariable("id") String id){
PsychologistTitleDTO data = psychologistTitleService.get(id);
return new Result<PsychologistTitleDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody PsychologistTitleDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
psychologistTitleService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody PsychologistTitleDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
psychologistTitleService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
psychologistTitleService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<PsychologistTitleDTO> list = psychologistTitleService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PsychologistTitleExcel.class);
}
}

94
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/controller/PsychologistTitleRelationController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.psychology.PsychologistTitleRelationDTO;
import com.elink.esua.epdc.modules.psychology.excel.PsychologistTitleRelationExcel;
import com.elink.esua.epdc.modules.psychology.service.PsychologistTitleRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@RestController
@RequestMapping("psychologisttitlerelation")
public class PsychologistTitleRelationController {
@Autowired
private PsychologistTitleRelationService psychologistTitleRelationService;
@GetMapping("page")
public Result<PageData<PsychologistTitleRelationDTO>> page(@RequestParam Map<String, Object> params){
PageData<PsychologistTitleRelationDTO> page = psychologistTitleRelationService.page(params);
return new Result<PageData<PsychologistTitleRelationDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<PsychologistTitleRelationDTO> get(@PathVariable("id") String id){
PsychologistTitleRelationDTO data = psychologistTitleRelationService.get(id);
return new Result<PsychologistTitleRelationDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody PsychologistTitleRelationDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
psychologistTitleRelationService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody PsychologistTitleRelationDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
psychologistTitleRelationService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
psychologistTitleRelationService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<PsychologistTitleRelationDTO> list = psychologistTitleRelationService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PsychologistTitleRelationExcel.class);
}
}

45
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistDao.java

@ -0,0 +1,45 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 心理咨询师表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Mapper
public interface PsychologistDao extends BaseDao<PsychologistEntity> {
/**
* 咨询师列表
*
* @return java.util.List<com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity>
* @params [params]
* @author zhangyuan
* @since 2020/5/21 14:54
*/
List<PsychologistEntity> selectListOfPsychologist(Map<String, Object> params);
}

33
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistTitleDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.psychology.entity.PsychologistTitleEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Mapper
public interface PsychologistTitleDao extends BaseDao<PsychologistTitleEntity> {
}

33
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/dao/PsychologistTitleRelationDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.psychology.entity.PsychologistTitleRelationEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Mapper
public interface PsychologistTitleRelationDao extends BaseDao<PsychologistTitleRelationEntity> {
}

84
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/entity/PsychologistEntity.java

@ -0,0 +1,84 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 心理咨询师表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_psychologist")
public class PsychologistEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 咨询师姓名
*/
private String name;
/**
* 咨询师照片地址
*/
private String avatar;
/**
* 咨询师联系方式
*/
private String mobile;
/**
* 咨询师性别 0女 1男
*/
private String sex;
/**
* 绑定用户的id
*/
private String userId;
/**
* 座右铭
*/
private String motto;
/**
* 简介
*/
private String briefIntroduction;
/**
* 排序 从小到大
*/
private Integer sort;
/**
* 是否展示 0否 1是
*/
private String displayFlag;
}

49
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/entity/PsychologistTitleEntity.java

@ -0,0 +1,49 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_psychologist_title")
public class PsychologistTitleEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 头衔
*/
private String title;
/**
* 头衔编码
*/
private String code;
}

49
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/entity/PsychologistTitleRelationEntity.java

@ -0,0 +1,49 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_psychologist_title_relation")
public class PsychologistTitleRelationEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 头衔id
*/
private String titleId;
/**
* 咨询师id
*/
private String psychologistId;
}

83
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/excel/PsychologistExcel.java

@ -0,0 +1,83 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 心理咨询师表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Data
public class PsychologistExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "咨询师姓名")
private String name;
@Excel(name = "咨询师照片地址")
private String avatar;
@Excel(name = "咨询师联系方式")
private String mobile;
@Excel(name = "咨询师性别 0女 ,1男")
private String sex;
@Excel(name = "绑定用户的id")
private String userId;
@Excel(name = "座右铭")
private String motto;
@Excel(name = "简介")
private String briefIntroduction;
@Excel(name = "排序 从小到大")
private Integer sort;
@Excel(name = "是否展示 0否 ,1是")
private String displayFlag;
@Excel(name = "删除标记 0:未删除,1:已删除")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

62
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/excel/PsychologistTitleExcel.java

@ -0,0 +1,62 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Data
public class PsychologistTitleExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "头衔")
private String title;
@Excel(name = "头衔编码")
private String code;
@Excel(name = "删除标记 0:未删除,1:已删除")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

62
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/excel/PsychologistTitleRelationExcel.java

@ -0,0 +1,62 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Data
public class PsychologistTitleRelationExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "头衔id")
private String titleId;
@Excel(name = "咨询师id")
private String psychologistId;
@Excel(name = "删除标记 0:未删除,1:已删除")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

47
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/redis/PsychologistRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 心理咨询师表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Component
public class PsychologistRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/redis/PsychologistTitleRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Component
public class PsychologistTitleRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/redis/PsychologistTitleRelationRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Component
public class PsychologistTitleRelationRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

103
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/PsychologistService.java

@ -0,0 +1,103 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.psychology.PsychologistDTO;
import com.elink.esua.epdc.dto.psychology.SysUserDictDTO;
import com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity;
import java.util.List;
import java.util.Map;
/**
* 心理咨询师表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
public interface PsychologistService extends BaseService<PsychologistEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PsychologistDTO>
* @author generator
* @date 2020-06-04
*/
PageData<PsychologistDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PsychologistDTO>
* @author generator
* @date 2020-06-04
*/
List<PsychologistDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return PsychologistDTO
* @author generator
* @date 2020-06-04
*/
PsychologistDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-04
*/
void save(PsychologistDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-04
*/
void update(PsychologistDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-04
*/
void delete(String[] ids);
/**
* 获取绑定用户下拉列表
*
* @return
*/
List<SysUserDictDTO> getSysUserDict();
}

95
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/PsychologistTitleRelationService.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.psychology.PsychologistTitleRelationDTO;
import com.elink.esua.epdc.modules.psychology.entity.PsychologistTitleRelationEntity;
import java.util.List;
import java.util.Map;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
public interface PsychologistTitleRelationService extends BaseService<PsychologistTitleRelationEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PsychologistTitleRelationDTO>
* @author generator
* @date 2020-06-04
*/
PageData<PsychologistTitleRelationDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PsychologistTitleRelationDTO>
* @author generator
* @date 2020-06-04
*/
List<PsychologistTitleRelationDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return PsychologistTitleRelationDTO
* @author generator
* @date 2020-06-04
*/
PsychologistTitleRelationDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-04
*/
void save(PsychologistTitleRelationDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-04
*/
void update(PsychologistTitleRelationDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-04
*/
void delete(String[] ids);
}

95
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/PsychologistTitleService.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.psychology.PsychologistTitleDTO;
import com.elink.esua.epdc.modules.psychology.entity.PsychologistTitleEntity;
import java.util.List;
import java.util.Map;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
public interface PsychologistTitleService extends BaseService<PsychologistTitleEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PsychologistTitleDTO>
* @author generator
* @date 2020-06-04
*/
PageData<PsychologistTitleDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PsychologistTitleDTO>
* @author generator
* @date 2020-06-04
*/
List<PsychologistTitleDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return PsychologistTitleDTO
* @author generator
* @date 2020-06-04
*/
PsychologistTitleDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-06-04
*/
void save(PsychologistTitleDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-06-04
*/
void update(PsychologistTitleDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-06-04
*/
void delete(String[] ids);
}

108
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologistServiceImpl.java

@ -0,0 +1,108 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.dto.psychology.PsychologistDTO;
import com.elink.esua.epdc.dto.psychology.SysUserDictDTO;
import com.elink.esua.epdc.modules.psychology.dao.PsychologistDao;
import com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity;
import com.elink.esua.epdc.modules.psychology.redis.PsychologistRedis;
import com.elink.esua.epdc.modules.psychology.service.PsychologistService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 心理咨询师表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Service
public class PsychologistServiceImpl extends BaseServiceImpl<PsychologistDao, PsychologistEntity> implements PsychologistService {
@Autowired
private PsychologistRedis psychologistRedis;
@Override
public PageData<PsychologistDTO> page(Map<String, Object> params) {
IPage<PsychologistEntity> page = getPage(params);
List<PsychologistEntity> entityList = baseDao.selectListOfPsychologist(params);
List<PsychologistDTO> list = ConvertUtils.sourceToTarget(entityList, PsychologistDTO.class);
return new PageData<>(list, page.getTotal());
}
@Override
public List<PsychologistDTO> list(Map<String, Object> params) {
List<PsychologistEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PsychologistDTO.class);
}
private QueryWrapper<PsychologistEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<PsychologistEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public PsychologistDTO get(String id) {
PsychologistEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, PsychologistDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(PsychologistDTO dto) {
PsychologistEntity entity = ConvertUtils.sourceToTarget(dto, PsychologistEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(PsychologistDTO dto) {
PsychologistEntity entity = ConvertUtils.sourceToTarget(dto, PsychologistEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public List<SysUserDictDTO> getSysUserDict() {
return null;
}
}

104
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologistTitleRelationServiceImpl.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.modules.psychology.dao.PsychologistTitleRelationDao;
import com.elink.esua.epdc.dto.psychology.PsychologistTitleRelationDTO;
import com.elink.esua.epdc.modules.psychology.entity.PsychologistTitleRelationEntity;
import com.elink.esua.epdc.modules.psychology.redis.PsychologistTitleRelationRedis;
import com.elink.esua.epdc.modules.psychology.service.PsychologistTitleRelationService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Service
public class PsychologistTitleRelationServiceImpl extends BaseServiceImpl<PsychologistTitleRelationDao, PsychologistTitleRelationEntity> implements PsychologistTitleRelationService {
@Autowired
private PsychologistTitleRelationRedis psychologistTitleRelationRedis;
@Override
public PageData<PsychologistTitleRelationDTO> page(Map<String, Object> params) {
IPage<PsychologistTitleRelationEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, PsychologistTitleRelationDTO.class);
}
@Override
public List<PsychologistTitleRelationDTO> list(Map<String, Object> params) {
List<PsychologistTitleRelationEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PsychologistTitleRelationDTO.class);
}
private QueryWrapper<PsychologistTitleRelationEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<PsychologistTitleRelationEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public PsychologistTitleRelationDTO get(String id) {
PsychologistTitleRelationEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, PsychologistTitleRelationDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(PsychologistTitleRelationDTO dto) {
PsychologistTitleRelationEntity entity = ConvertUtils.sourceToTarget(dto, PsychologistTitleRelationEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(PsychologistTitleRelationDTO dto) {
PsychologistTitleRelationEntity entity = ConvertUtils.sourceToTarget(dto, PsychologistTitleRelationEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

104
epdc-cloud-property/src/main/java/com/elink/esua/epdc/modules/psychology/service/impl/PsychologistTitleServiceImpl.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.psychology.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.modules.psychology.dao.PsychologistTitleDao;
import com.elink.esua.epdc.dto.psychology.PsychologistTitleDTO;
import com.elink.esua.epdc.modules.psychology.entity.PsychologistTitleEntity;
import com.elink.esua.epdc.modules.psychology.redis.PsychologistTitleRedis;
import com.elink.esua.epdc.modules.psychology.service.PsychologistTitleService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 心理咨询师头衔表
*
* @author zhangyuan qu@elink-cn.com
* @since v1.0.0 2020-06-04
*/
@Service
public class PsychologistTitleServiceImpl extends BaseServiceImpl<PsychologistTitleDao, PsychologistTitleEntity> implements PsychologistTitleService {
@Autowired
private PsychologistTitleRedis psychologistTitleRedis;
@Override
public PageData<PsychologistTitleDTO> page(Map<String, Object> params) {
IPage<PsychologistTitleEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, PsychologistTitleDTO.class);
}
@Override
public List<PsychologistTitleDTO> list(Map<String, Object> params) {
List<PsychologistTitleEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PsychologistTitleDTO.class);
}
private QueryWrapper<PsychologistTitleEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<PsychologistTitleEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public PsychologistTitleDTO get(String id) {
PsychologistTitleEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, PsychologistTitleDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(PsychologistTitleDTO dto) {
PsychologistTitleEntity entity = ConvertUtils.sourceToTarget(dto, PsychologistTitleEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(PsychologistTitleDTO dto) {
PsychologistTitleEntity entity = ConvertUtils.sourceToTarget(dto, PsychologistTitleEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

45
epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistDao.xml

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.modules.psychology.dao.PsychologistDao">
<resultMap type="com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity" id="psychologistMap">
<result property="id" column="ID"/>
<result property="name" column="NAME"/>
<result property="avatar" column="AVATAR"/>
<result property="mobile" column="MOBILE"/>
<result property="sex" column="SEX"/>
<result property="userId" column="USER_ID"/>
<result property="motto" column="MOTTO"/>
<result property="briefIntroduction" column="BRIEF_INTRODUCTION"/>
<result property="sort" column="SORT"/>
<result property="displayFlag" column="DISPLAY_FLAG"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<sql id="Base_Column_List">
ID, NAME, AVATAR, MOBILE, SEX, USER_ID, MOTTO, BRIEF_INTRODUCTION, SORT,
DISPLAY_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME
</sql>
<select id="selectListOfPsychologist" resultType="com.elink.esua.epdc.modules.psychology.entity.PsychologistEntity">
SELECT
<include refid="Base_Column_List"/>
FROM
epdc_psychologist
WHERE
DEL_FLAG = '0'
<if test="name != null and name != ''">
AND NAME like CONCAT( '%', #{name}, '%' )
</if>
<if test="mobile != null and policeNo != ''">
AND MOBILE like CONCAT( '%', #{mobile}, '%' )
</if>
ORDER BY
SORT ASC,
CREATED_TIME DESC
</select>
</mapper>

19
epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistTitleDao.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.modules.psychology.dao.PsychologistTitleDao">
<resultMap type="com.elink.esua.epdc.modules.psychology.entity.PsychologistTitleEntity" id="psychologistTitleMap">
<result property="id" column="ID"/>
<result property="title" column="TITLE"/>
<result property="code" column="CODE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

19
epdc-cloud-property/src/main/resources/mapper/psychology/PsychologistTitleRelationDao.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.modules.psychology.dao.PsychologistTitleRelationDao">
<resultMap type="com.elink.esua.epdc.modules.psychology.entity.PsychologistTitleRelationEntity" id="psychologistTitleRelationMap">
<result property="id" column="ID"/>
<result property="titleId" column="TITLE_ID"/>
<result property="psychologistId" column="PSYCHOLOGIST_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>
Loading…
Cancel
Save