Browse Source

dept/option表代码生成

feature/dangjian
wanggongfeng 6 years ago
parent
commit
ab7a4a508b
  1. 107
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dept/EvaluateDeptDTO.java
  2. 92
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/option/EvaluateOptionDTO.java
  3. 94
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateDeptController.java
  4. 94
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateOptionController.java
  5. 33
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateDeptDao.java
  6. 33
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateOptionDao.java
  7. 73
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/entity/EvaluateDeptEntity.java
  8. 58
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/entity/EvaluateOptionEntity.java
  9. 77
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/excel/EvaluateDeptExcel.java
  10. 68
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/excel/EvaluateOptionExcel.java
  11. 47
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/redis/EvaluateDeptRedis.java
  12. 47
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/redis/EvaluateOptionRedis.java
  13. 95
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateDeptService.java
  14. 95
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateOptionService.java
  15. 104
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateDeptServiceImpl.java
  16. 104
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateOptionServiceImpl.java
  17. 24
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/evaluate/EvaluateDeptDao.xml
  18. 21
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/evaluate/EvaluateOptionDao.xml

107
esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dept/EvaluateDeptDTO.java

@ -0,0 +1,107 @@
/**
* 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.dept;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 评价部门表 评价部门表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Data
public class EvaluateDeptDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 部门ID
*/
private String deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 父所有部门ID
*/
private String parentDeptIds;
/**
* 父所有部门名称
*/
private String parentDeptNames;
/**
* 所有部门ID
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
/**
* 干部人数
*/
private Integer officerCount;
/**
* 删除标识 01
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

92
esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/option/EvaluateOptionDTO.java

@ -0,0 +1,92 @@
/**
* 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.option;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 评价选项表 评价选项表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Data
public class EvaluateOptionDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 权限编码1.点赞2.吐槽
*/
private Integer roleCode;
/**
* 评价选项
*/
private String optionContent;
/**
* 显示顺序
*/
private Integer sort;
/**
* 可用标记(0-不可用1-可用)
*/
private String available;
/**
* 乐观锁
*/
private Integer revision;
/**
* 删除标识 01
*/
private String delFlag;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

94
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateDeptController.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.evaluate.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.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dept.EvaluateDeptDTO;
import com.elink.esua.epdc.modules.evaluate.excel.EvaluateDeptExcel;
import com.elink.esua.epdc.modules.evaluate.service.EvaluateDeptService;
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 qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@RestController
@RequestMapping("evaluatedept")
public class EvaluateDeptController {
@Autowired
private EvaluateDeptService evaluateDeptService;
@GetMapping("page")
public Result<PageData<EvaluateDeptDTO>> page(@RequestParam Map<String, Object> params){
PageData<EvaluateDeptDTO> page = evaluateDeptService.page(params);
return new Result<PageData<EvaluateDeptDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<EvaluateDeptDTO> get(@PathVariable("id") String id){
EvaluateDeptDTO data = evaluateDeptService.get(id);
return new Result<EvaluateDeptDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody EvaluateDeptDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
evaluateDeptService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody EvaluateDeptDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
evaluateDeptService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
evaluateDeptService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<EvaluateDeptDTO> list = evaluateDeptService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, EvaluateDeptExcel.class);
}
}

94
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateOptionController.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.evaluate.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.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.modules.evaluate.excel.EvaluateOptionExcel;
import com.elink.esua.epdc.modules.evaluate.service.EvaluateOptionService;
import com.elink.esua.epdc.option.EvaluateOptionDTO;
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 qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@RestController
@RequestMapping("evaluateoption")
public class EvaluateOptionController {
@Autowired
private EvaluateOptionService evaluateOptionService;
@GetMapping("page")
public Result<PageData<EvaluateOptionDTO>> page(@RequestParam Map<String, Object> params){
PageData<EvaluateOptionDTO> page = evaluateOptionService.page(params);
return new Result<PageData<EvaluateOptionDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<EvaluateOptionDTO> get(@PathVariable("id") String id){
EvaluateOptionDTO data = evaluateOptionService.get(id);
return new Result<EvaluateOptionDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody EvaluateOptionDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
evaluateOptionService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody EvaluateOptionDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
evaluateOptionService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
evaluateOptionService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<EvaluateOptionDTO> list = evaluateOptionService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, EvaluateOptionExcel.class);
}
}

33
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateDeptDao.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.evaluate.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateDeptEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 评价部门表 评价部门表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Mapper
public interface EvaluateDeptDao extends BaseDao<EvaluateDeptEntity> {
}

33
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateOptionDao.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.evaluate.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateOptionEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 评价选项表 评价选项表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Mapper
public interface EvaluateOptionDao extends BaseDao<EvaluateOptionEntity> {
}

73
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/entity/EvaluateDeptEntity.java

@ -0,0 +1,73 @@
/**
* 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.evaluate.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 评价部门表 评价部门表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_evaluate_dept")
public class EvaluateDeptEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 部门ID
*/
private String deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 父所有部门ID
*/
private String parentDeptIds;
/**
* 父所有部门名称
*/
private String parentDeptNames;
/**
* 所有部门ID
*/
private String allDeptIds;
/**
* 所有部门名称
*/
private String allDeptNames;
/**
* 干部人数
*/
private Integer officerCount;
}

58
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/entity/EvaluateOptionEntity.java

@ -0,0 +1,58 @@
/**
* 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.evaluate.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 评价选项表 评价选项表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_evaluate_option")
public class EvaluateOptionEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 权限编码1.点赞2.吐槽
*/
private Integer roleCode;
/**
* 评价选项
*/
private String optionContent;
/**
* 显示顺序
*/
private Integer sort;
/**
* 可用标记(0-不可用1-可用)
*/
private String available;
}

77
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/excel/EvaluateDeptExcel.java

@ -0,0 +1,77 @@
/**
* 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.evaluate.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 评价部门表 评价部门表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Data
public class EvaluateDeptExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "部门ID")
private String deptId;
@Excel(name = "部门名称")
private String deptName;
@Excel(name = "父所有部门ID")
private String parentDeptIds;
@Excel(name = "父所有部门名称")
private String parentDeptNames;
@Excel(name = "所有部门ID")
private String allDeptIds;
@Excel(name = "所有部门名称")
private String allDeptNames;
@Excel(name = "干部人数")
private Integer officerCount;
@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;
}

68
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/excel/EvaluateOptionExcel.java

@ -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.evaluate.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 评价选项表 评价选项表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Data
public class EvaluateOptionExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "权限编码(1.点赞,2.吐槽)")
private Integer roleCode;
@Excel(name = "评价选项")
private String optionContent;
@Excel(name = "显示顺序")
private Integer sort;
@Excel(name = "可用标记(0-不可用,1-可用)")
private String available;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "删除标识 0:否,1:是")
private String delFlag;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

47
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/redis/EvaluateDeptRedis.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.evaluate.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 评价部门表 评价部门表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Component
public class EvaluateDeptRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/redis/EvaluateOptionRedis.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.evaluate.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 评价选项表 评价选项表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Component
public class EvaluateOptionRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

95
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateDeptService.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.evaluate.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dept.EvaluateDeptDTO;
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateDeptEntity;
import java.util.List;
import java.util.Map;
/**
* 评价部门表 评价部门表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
public interface EvaluateDeptService extends BaseService<EvaluateDeptEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<EvaluateDeptDTO>
* @author generator
* @date 2020-02-05
*/
PageData<EvaluateDeptDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<EvaluateDeptDTO>
* @author generator
* @date 2020-02-05
*/
List<EvaluateDeptDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return EvaluateDeptDTO
* @author generator
* @date 2020-02-05
*/
EvaluateDeptDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-02-05
*/
void save(EvaluateDeptDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-02-05
*/
void update(EvaluateDeptDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-02-05
*/
void delete(String[] ids);
}

95
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateOptionService.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.evaluate.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateOptionEntity;
import com.elink.esua.epdc.option.EvaluateOptionDTO;
import java.util.List;
import java.util.Map;
/**
* 评价选项表 评价选项表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
public interface EvaluateOptionService extends BaseService<EvaluateOptionEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<EvaluateOptionDTO>
* @author generator
* @date 2020-02-05
*/
PageData<EvaluateOptionDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<EvaluateOptionDTO>
* @author generator
* @date 2020-02-05
*/
List<EvaluateOptionDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return EvaluateOptionDTO
* @author generator
* @date 2020-02-05
*/
EvaluateOptionDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-02-05
*/
void save(EvaluateOptionDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-02-05
*/
void update(EvaluateOptionDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-02-05
*/
void delete(String[] ids);
}

104
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateDeptServiceImpl.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.evaluate.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.dept.EvaluateDeptDTO;
import com.elink.esua.epdc.modules.evaluate.dao.EvaluateDeptDao;
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateDeptEntity;
import com.elink.esua.epdc.modules.evaluate.redis.EvaluateDeptRedis;
import com.elink.esua.epdc.modules.evaluate.service.EvaluateDeptService;
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 qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Service
public class EvaluateDeptServiceImpl extends BaseServiceImpl<EvaluateDeptDao, EvaluateDeptEntity> implements EvaluateDeptService {
@Autowired
private EvaluateDeptRedis evaluateDeptRedis;
@Override
public PageData<EvaluateDeptDTO> page(Map<String, Object> params) {
IPage<EvaluateDeptEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, EvaluateDeptDTO.class);
}
@Override
public List<EvaluateDeptDTO> list(Map<String, Object> params) {
List<EvaluateDeptEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, EvaluateDeptDTO.class);
}
private QueryWrapper<EvaluateDeptEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<EvaluateDeptEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public EvaluateDeptDTO get(String id) {
EvaluateDeptEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, EvaluateDeptDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(EvaluateDeptDTO dto) {
EvaluateDeptEntity entity = ConvertUtils.sourceToTarget(dto, EvaluateDeptEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(EvaluateDeptDTO dto) {
EvaluateDeptEntity entity = ConvertUtils.sourceToTarget(dto, EvaluateDeptEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

104
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateOptionServiceImpl.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.evaluate.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.modules.evaluate.dao.EvaluateOptionDao;
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateOptionEntity;
import com.elink.esua.epdc.modules.evaluate.redis.EvaluateOptionRedis;
import com.elink.esua.epdc.modules.evaluate.service.EvaluateOptionService;
import com.elink.esua.epdc.option.EvaluateOptionDTO;
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 qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Service
public class EvaluateOptionServiceImpl extends BaseServiceImpl<EvaluateOptionDao, EvaluateOptionEntity> implements EvaluateOptionService {
@Autowired
private EvaluateOptionRedis evaluateOptionRedis;
@Override
public PageData<EvaluateOptionDTO> page(Map<String, Object> params) {
IPage<EvaluateOptionEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, EvaluateOptionDTO.class);
}
@Override
public List<EvaluateOptionDTO> list(Map<String, Object> params) {
List<EvaluateOptionEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, EvaluateOptionDTO.class);
}
private QueryWrapper<EvaluateOptionEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<EvaluateOptionEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public EvaluateOptionDTO get(String id) {
EvaluateOptionEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, EvaluateOptionDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(EvaluateOptionDTO dto) {
EvaluateOptionEntity entity = ConvertUtils.sourceToTarget(dto, EvaluateOptionEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(EvaluateOptionDTO dto) {
EvaluateOptionEntity entity = ConvertUtils.sourceToTarget(dto, EvaluateOptionEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

24
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/evaluate/EvaluateDeptDao.xml

@ -0,0 +1,24 @@
<?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.evaluate.dao.EvaluateDeptDao">
<resultMap type="com.elink.esua.epdc.modules.evaluate.entity.EvaluateDeptEntity" id="evaluateDeptMap">
<result property="id" column="ID"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/>
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/>
<result property="allDeptIds" column="ALL_DEPT_IDS"/>
<result property="allDeptNames" column="ALL_DEPT_NAMES"/>
<result property="officerCount" column="OFFICER_COUNT"/>
<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>

21
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/evaluate/EvaluateOptionDao.xml

@ -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.evaluate.dao.EvaluateOptionDao">
<resultMap type="com.elink.esua.epdc.modules.evaluate.entity.EvaluateOptionEntity" id="evaluateOptionMap">
<result property="id" column="ID"/>
<result property="roleCode" column="ROLE_CODE"/>
<result property="optionContent" column="OPTION_CONTENT"/>
<result property="sort" column="SORT"/>
<result property="available" column="AVAILABLE"/>
<result property="revision" column="REVISION"/>
<result property="delFlag" column="DEL_FLAG"/>
<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