17 changed files with 1118 additions and 4 deletions
@ -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.PsychologyAnswerDTO; |
|||
import com.elink.esua.epdc.modules.psychology.excel.PsychologyAnswerExcel; |
|||
import com.elink.esua.epdc.modules.psychology.service.PsychologyAnswerService; |
|||
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-08 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("psychologyanswer") |
|||
public class PsychologyAnswerController { |
|||
|
|||
@Autowired |
|||
private PsychologyAnswerService psychologyAnswerService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<PsychologyAnswerDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<PsychologyAnswerDTO> page = psychologyAnswerService.page(params); |
|||
return new Result<PageData<PsychologyAnswerDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<PsychologyAnswerDTO> get(@PathVariable("id") String id){ |
|||
PsychologyAnswerDTO data = psychologyAnswerService.get(id); |
|||
return new Result<PsychologyAnswerDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody PsychologyAnswerDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
psychologyAnswerService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody PsychologyAnswerDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
psychologyAnswerService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
psychologyAnswerService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<PsychologyAnswerDTO> list = psychologyAnswerService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, PsychologyAnswerExcel.class); |
|||
} |
|||
|
|||
} |
|||
@ -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.PsychologyQuestionDTO; |
|||
import com.elink.esua.epdc.modules.psychology.excel.PsychologyQuestionExcel; |
|||
import com.elink.esua.epdc.modules.psychology.service.PsychologyQuestionService; |
|||
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-08 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("psychologyquestion") |
|||
public class PsychologyQuestionController { |
|||
|
|||
@Autowired |
|||
private PsychologyQuestionService psychologyQuestionService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<PsychologyQuestionDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<PsychologyQuestionDTO> page = psychologyQuestionService.page(params); |
|||
return new Result<PageData<PsychologyQuestionDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<PsychologyQuestionDTO> get(@PathVariable("id") String id){ |
|||
PsychologyQuestionDTO data = psychologyQuestionService.get(id); |
|||
return new Result<PsychologyQuestionDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody PsychologyQuestionDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
psychologyQuestionService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody PsychologyQuestionDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
psychologyQuestionService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
psychologyQuestionService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<PsychologyQuestionDTO> list = psychologyQuestionService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, PsychologyQuestionExcel.class); |
|||
} |
|||
|
|||
} |
|||
@ -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.PsychologyAnswerEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 心理问题答复表 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-08 |
|||
*/ |
|||
@Mapper |
|||
public interface PsychologyAnswerDao extends BaseDao<PsychologyAnswerEntity> { |
|||
|
|||
} |
|||
@ -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.PsychologyQuestionEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 心理问题提问表 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-08 |
|||
*/ |
|||
@Mapper |
|||
public interface PsychologyQuestionDao extends BaseDao<PsychologyQuestionEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
/** |
|||
* 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; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 心理问题答复表 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-08 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_psychology_answer") |
|||
public class PsychologyAnswerEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 问题id |
|||
*/ |
|||
private String questionId; |
|||
|
|||
/** |
|||
* 咨询师id(被绑定的管理端用户id) |
|||
*/ |
|||
private String psychologistId; |
|||
|
|||
/** |
|||
* 咨询师名称 |
|||
*/ |
|||
private String psychologistName; |
|||
|
|||
/** |
|||
* 回复问题的内容 |
|||
*/ |
|||
private String answerContent; |
|||
|
|||
} |
|||
@ -0,0 +1,81 @@ |
|||
/** |
|||
* 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; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 心理问题提问表 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-08 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_psychology_question") |
|||
public class PsychologyQuestionEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 提问者 用户id |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 提问者用户名 |
|||
*/ |
|||
private String userName; |
|||
|
|||
/** |
|||
* 用户的头像 |
|||
*/ |
|||
private String userAvatar; |
|||
|
|||
/** |
|||
* 问题内容 |
|||
*/ |
|||
private String questionContent; |
|||
|
|||
/** |
|||
* 已匿名 0否 1是 |
|||
*/ |
|||
private String anonymousFlag; |
|||
|
|||
/** |
|||
* 咨询师id (被绑定的管理端用户id)用户指定向谁提问 |
|||
*/ |
|||
private String psychologistId; |
|||
|
|||
/** |
|||
* 问题已几有人回复 |
|||
*/ |
|||
private Integer answerNum; |
|||
|
|||
/** |
|||
* 是否展示 0否 ,1是 |
|||
*/ |
|||
private String displayFlag; |
|||
|
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
/** |
|||
* 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-08 |
|||
*/ |
|||
@Data |
|||
public class PsychologyAnswerExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "问题id") |
|||
private String questionId; |
|||
|
|||
@Excel(name = "咨询师id(被绑定的管理端用户id)") |
|||
private String psychologistId; |
|||
|
|||
@Excel(name = "咨询师名称") |
|||
private String psychologistName; |
|||
|
|||
@Excel(name = "回复问题的内容") |
|||
private String answerContent; |
|||
|
|||
@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; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
/** |
|||
* 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-08 |
|||
*/ |
|||
@Data |
|||
public class PsychologyQuestionExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "提问者 用户id") |
|||
private String userId; |
|||
|
|||
@Excel(name = "提问者用户名") |
|||
private String userName; |
|||
|
|||
@Excel(name = "用户的头像") |
|||
private String userAvatar; |
|||
|
|||
@Excel(name = "问题内容") |
|||
private String questionContent; |
|||
|
|||
@Excel(name = "已匿名 0否 1是") |
|||
private String anonymousFlag; |
|||
|
|||
@Excel(name = "咨询师id (被绑定的管理端用户id)用户指定向谁提问") |
|||
private String psychologistId; |
|||
|
|||
@Excel(name = "问题已几有人回复 ") |
|||
private Integer answerNum; |
|||
|
|||
@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; |
|||
|
|||
|
|||
} |
|||
@ -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-08 |
|||
*/ |
|||
@Component |
|||
public class PsychologyAnswerRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
@ -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-08 |
|||
*/ |
|||
@Component |
|||
public class PsychologyQuestionRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
@ -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.PsychologyAnswerDTO; |
|||
import com.elink.esua.epdc.modules.psychology.entity.PsychologyAnswerEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 心理问题答复表 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-08 |
|||
*/ |
|||
public interface PsychologyAnswerService extends BaseService<PsychologyAnswerEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<PsychologyAnswerDTO> |
|||
* @author generator |
|||
* @date 2020-06-08 |
|||
*/ |
|||
PageData<PsychologyAnswerDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<PsychologyAnswerDTO> |
|||
* @author generator |
|||
* @date 2020-06-08 |
|||
*/ |
|||
List<PsychologyAnswerDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return PsychologyAnswerDTO |
|||
* @author generator |
|||
* @date 2020-06-08 |
|||
*/ |
|||
PsychologyAnswerDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-06-08 |
|||
*/ |
|||
void save(PsychologyAnswerDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-06-08 |
|||
*/ |
|||
void update(PsychologyAnswerDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-06-08 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
|||
@ -0,0 +1,106 @@ |
|||
/** |
|||
* 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.PsychologyQuestionDTO; |
|||
import com.elink.esua.epdc.dto.psychology.form.PsychologyQuestionFormDTO; |
|||
import com.elink.esua.epdc.modules.psychology.entity.PsychologyQuestionEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 心理问题提问表 |
|||
* |
|||
* @author zhangyuan qu@elink-cn.com |
|||
* @since v1.0.0 2020-06-08 |
|||
*/ |
|||
public interface PsychologyQuestionService extends BaseService<PsychologyQuestionEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<PsychologyQuestionDTO> |
|||
* @author generator |
|||
* @date 2020-06-08 |
|||
*/ |
|||
PageData<PsychologyQuestionDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<PsychologyQuestionDTO> |
|||
* @author generator |
|||
* @date 2020-06-08 |
|||
*/ |
|||
List<PsychologyQuestionDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return PsychologyQuestionDTO |
|||
* @author generator |
|||
* @date 2020-06-08 |
|||
*/ |
|||
PsychologyQuestionDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-06-08 |
|||
*/ |
|||
void save(PsychologyQuestionDTO dto); |
|||
|
|||
/** |
|||
* APP保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author zhangyuan |
|||
* @date 2020-06-08 |
|||
*/ |
|||
void saveFromApp(PsychologyQuestionFormDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-06-08 |
|||
*/ |
|||
void update(PsychologyQuestionDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-06-08 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
|||
@ -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.PsychologyAnswerDao; |
|||
import com.elink.esua.epdc.dto.psychology.PsychologyAnswerDTO; |
|||
import com.elink.esua.epdc.modules.psychology.entity.PsychologyAnswerEntity; |
|||
import com.elink.esua.epdc.modules.psychology.redis.PsychologyAnswerRedis; |
|||
import com.elink.esua.epdc.modules.psychology.service.PsychologyAnswerService; |
|||
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-08 |
|||
*/ |
|||
@Service |
|||
public class PsychologyAnswerServiceImpl extends BaseServiceImpl<PsychologyAnswerDao, PsychologyAnswerEntity> implements PsychologyAnswerService { |
|||
|
|||
@Autowired |
|||
private PsychologyAnswerRedis psychologyAnswerRedis; |
|||
|
|||
@Override |
|||
public PageData<PsychologyAnswerDTO> page(Map<String, Object> params) { |
|||
IPage<PsychologyAnswerEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, PsychologyAnswerDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<PsychologyAnswerDTO> list(Map<String, Object> params) { |
|||
List<PsychologyAnswerEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, PsychologyAnswerDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<PsychologyAnswerEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<PsychologyAnswerEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public PsychologyAnswerDTO get(String id) { |
|||
PsychologyAnswerEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, PsychologyAnswerDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(PsychologyAnswerDTO dto) { |
|||
PsychologyAnswerEntity entity = ConvertUtils.sourceToTarget(dto, PsychologyAnswerEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(PsychologyAnswerDTO dto) { |
|||
PsychologyAnswerEntity entity = ConvertUtils.sourceToTarget(dto, PsychologyAnswerEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,112 @@ |
|||
/** |
|||
* 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.dto.psychology.form.PsychologyQuestionFormDTO; |
|||
import com.elink.esua.epdc.modules.psychology.dao.PsychologyQuestionDao; |
|||
import com.elink.esua.epdc.dto.psychology.PsychologyQuestionDTO; |
|||
import com.elink.esua.epdc.modules.psychology.entity.PsychologyQuestionEntity; |
|||
import com.elink.esua.epdc.modules.psychology.redis.PsychologyQuestionRedis; |
|||
import com.elink.esua.epdc.modules.psychology.service.PsychologyQuestionService; |
|||
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-08 |
|||
*/ |
|||
@Service |
|||
public class PsychologyQuestionServiceImpl extends BaseServiceImpl<PsychologyQuestionDao, PsychologyQuestionEntity> implements PsychologyQuestionService { |
|||
|
|||
@Autowired |
|||
private PsychologyQuestionRedis psychologyQuestionRedis; |
|||
|
|||
@Override |
|||
public PageData<PsychologyQuestionDTO> page(Map<String, Object> params) { |
|||
IPage<PsychologyQuestionEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, PsychologyQuestionDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<PsychologyQuestionDTO> list(Map<String, Object> params) { |
|||
List<PsychologyQuestionEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, PsychologyQuestionDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<PsychologyQuestionEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<PsychologyQuestionEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public PsychologyQuestionDTO get(String id) { |
|||
PsychologyQuestionEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, PsychologyQuestionDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(PsychologyQuestionDTO dto) { |
|||
PsychologyQuestionEntity entity = ConvertUtils.sourceToTarget(dto, PsychologyQuestionEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void saveFromApp(PsychologyQuestionFormDTO dto) { |
|||
PsychologyQuestionEntity entity = ConvertUtils.sourceToTarget(dto, PsychologyQuestionEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(PsychologyQuestionDTO dto) { |
|||
PsychologyQuestionEntity entity = ConvertUtils.sourceToTarget(dto, PsychologyQuestionEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
<?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.PsychologyAnswerDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.modules.psychology.entity.PsychologyAnswerEntity" id="psychologyAnswerMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="questionId" column="QUESTION_ID"/> |
|||
<result property="psychologistId" column="PSYCHOLOGIST_ID"/> |
|||
<result property="psychologistName" column="PSYCHOLOGIST_NAME"/> |
|||
<result property="answerContent" column="ANSWER_CONTENT"/> |
|||
<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> |
|||
@ -0,0 +1,25 @@ |
|||
<?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.PsychologyQuestionDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.modules.psychology.entity.PsychologyQuestionEntity" id="psychologyQuestionMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="userId" column="USER_ID"/> |
|||
<result property="userName" column="USER_NAME"/> |
|||
<result property="userAvatar" column="USER_AVATAR"/> |
|||
<result property="questionContent" column="QUESTION_CONTENT"/> |
|||
<result property="anonymousFlag" column="ANONYMOUS_FLAG"/> |
|||
<result property="psychologistId" column="PSYCHOLOGIST_ID"/> |
|||
<result property="answerNum" column="ANSWER_NUM"/> |
|||
<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> |
|||
|
|||
|
|||
</mapper> |
|||
Loading…
Reference in new issue