Commit 88bc413e authored by mengmeng's avatar mengmeng

统计图完成V1

parent 4f861848
package io.hmit.modules.fhjw.controller;
import io.hmit.common.annotation.LogOperation;
import io.hmit.common.constant.Constant;
import io.hmit.common.page.PageData;
import io.hmit.common.utils.ExcelUtils;
import io.hmit.common.utils.Result;
import io.hmit.common.validator.AssertUtils;
import io.hmit.common.validator.ValidatorUtils;
import io.hmit.common.validator.group.AddGroup;
import io.hmit.common.validator.group.DefaultGroup;
import io.hmit.common.validator.group.UpdateGroup;
import io.hmit.modules.fhjw.dto.FhjwAnswerListDTO;
import io.hmit.modules.fhjw.excel.FhjwAnswerListExcel;
import io.hmit.modules.fhjw.service.FhjwAnswerListService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 答案列表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-07-06
*/
@RestController
@RequestMapping("fhjw/fhjwanswerlist")
@Api(tags="答案列表")
public class FhjwAnswerListController {
@Autowired
private FhjwAnswerListService fhjwAnswerListService;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
@RequiresPermissions("fhjw:fhjwanswerlist:page")
public Result<PageData<FhjwAnswerListDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<FhjwAnswerListDTO> page = fhjwAnswerListService.page(params);
return new Result<PageData<FhjwAnswerListDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
@RequiresPermissions("fhjw:fhjwanswerlist:info")
public Result<FhjwAnswerListDTO> get(@PathVariable("id") Long id){
FhjwAnswerListDTO data = fhjwAnswerListService.get(id);
return new Result<FhjwAnswerListDTO>().ok(data);
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
@RequiresPermissions("fhjw:fhjwanswerlist:save")
public Result save(@RequestBody FhjwAnswerListDTO dto){
//校验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
fhjwAnswerListService.save(dto);
return new Result();
}
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
@RequiresPermissions("fhjw:fhjwanswerlist:update")
public Result update(@RequestBody FhjwAnswerListDTO dto){
//校验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
fhjwAnswerListService.update(dto);
return new Result();
}
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
@RequiresPermissions("fhjw:fhjwanswerlist:delete")
public Result delete(@RequestBody Long[] ids){
//校验数据
AssertUtils.isArrayEmpty(ids, "id");
fhjwAnswerListService.delete(ids);
return new Result();
}
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
@RequiresPermissions("fhjw:fhjwanswerlist:export")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<FhjwAnswerListDTO> list = fhjwAnswerListService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, FhjwAnswerListExcel.class);
}
}
\ No newline at end of file
......@@ -10,6 +10,9 @@ import io.hmit.common.validator.ValidatorUtils;
import io.hmit.common.validator.group.AddGroup;
import io.hmit.common.validator.group.DefaultGroup;
import io.hmit.common.validator.group.UpdateGroup;
import io.hmit.modules.fhjw.dto.CommitteeCountDTO;
import io.hmit.modules.fhjw.dto.CommitteeCountListDTO;
import io.hmit.modules.fhjw.dto.FeedbackCountListDTO;
import io.hmit.modules.fhjw.dto.FhjwCommentDTO;
import io.hmit.modules.fhjw.excel.FhjwCommentExcel;
import io.hmit.modules.fhjw.service.FhjwCommentService;
......@@ -68,6 +71,55 @@ public class FhjwCommentController {
return new Result<FhjwCommentDTO>().ok(data);
}
@GetMapping("getCountByDept")
@ApiOperation("首页-获取每个部门所有的好差评数量")
@LogOperation("首页-获取每个部门所有的好差评数量")
@ApiImplicitParams({
@ApiImplicitParam(name = "startDate", value = "开始时间,格式:2021-06-01", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = "endDate", value = "结束时间,格式:2021-07-01", paramType = "query", dataType="String")
})
public Result<List<CommitteeCountListDTO>> getCountByDept(@ApiIgnore @RequestParam Map<String, Object> params) {
List<CommitteeCountListDTO> getCounts= fhjwCommentService.getCountByDept(params);
return new Result<List<CommitteeCountListDTO>>().ok(getCounts);
}
@GetMapping("getCaseCountByDept")
@ApiOperation("首页-获取每个部门已评价的案件数量")
@LogOperation("首页-获取每个部门已评价的案件数量")
public Result<List<CommitteeCountListDTO>> getCaseCountByDept() {
List<CommitteeCountListDTO> getCounts= fhjwCommentService.getCaseCountByDept();
return new Result<List<CommitteeCountListDTO>>().ok(getCounts);
}
@GetMapping("getCountByMouth")
@ApiOperation("首页-获取最近12个月的好差评数量")
@LogOperation("首页-获取最近12个月的好差评数量")
public Result<List<CommitteeCountDTO>> getCountByMouth() {
List<CommitteeCountDTO> getCounts= fhjwCommentService.getCountByMouth();
return new Result<List<CommitteeCountDTO>>().ok(getCounts);
}
@GetMapping("getCountByUserRole")
@ApiOperation("根据人员权限获取好差评数量")
@LogOperation("根据人员权限获取好差评数量")
@ApiImplicitParams({
@ApiImplicitParam(name = "startDate", value = "开始时间,格式:2021-06-01", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = "endDate", value = "结束时间,格式:2021-07-01", paramType = "query", dataType="String")
})
public Result<List<CommitteeCountDTO>> getCountByUserRole(@ApiIgnore @RequestParam Map<String, Object> params) {
List<CommitteeCountDTO> getCounts= fhjwCommentService.getCountByUserRole(params);
return new Result<List<CommitteeCountDTO>>().ok(getCounts);
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
......
......@@ -10,6 +10,7 @@ import io.hmit.common.validator.ValidatorUtils;
import io.hmit.common.validator.group.AddGroup;
import io.hmit.common.validator.group.DefaultGroup;
import io.hmit.common.validator.group.UpdateGroup;
import io.hmit.modules.fhjw.dto.FeedbackCountListDTO;
import io.hmit.modules.fhjw.dto.FhjwFeedbackDTO;
import io.hmit.modules.fhjw.excel.FhjwFeedbackExcel;
import io.hmit.modules.fhjw.service.FhjwFeedbackService;
......@@ -113,4 +114,18 @@ public class FhjwFeedbackController {
ExcelUtils.exportExcelToTarget(response, null, list, FhjwFeedbackExcel.class);
}
}
\ No newline at end of file
@GetMapping("getCount")
@ApiOperation("统计数量")
@LogOperation("统计数量")
@ApiImplicitParams({
@ApiImplicitParam(name = "startDate", value = "开始时间,格式:2021-06-01", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = "endDate", value = "结束时间,格式:2021-07-01", paramType = "query", dataType="String")
})
public Result<List<FeedbackCountListDTO>> getCount(@ApiIgnore @RequestParam Map<String, Object> params) {
List<FeedbackCountListDTO> getCounts= fhjwFeedbackService.getCountLists(params);
return new Result<List<FeedbackCountListDTO>>().ok(getCounts);
}
}
package io.hmit.modules.fhjw.dao;
import io.hmit.common.dao.BaseDao;
import io.hmit.modules.fhjw.entity.FhjwAnswerListEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 答案列表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-07-06
*/
@Mapper
public interface FhjwAnswerListDao extends BaseDao<FhjwAnswerListEntity> {
}
\ No newline at end of file
package io.hmit.modules.fhjw.dao;
import io.hmit.common.dao.BaseDao;
import io.hmit.modules.fhjw.dto.CommitteeCountDTO;
import io.hmit.modules.fhjw.entity.FhjwCommentEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 案件评价表
*
......@@ -12,5 +16,15 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FhjwCommentDao extends BaseDao<FhjwCommentEntity> {
}
\ No newline at end of file
//获取每个部门所有的好差评数量
List<CommitteeCountDTO> getCountByDept(Map<String, Object> params);
//获取每个部门已评价的案件数量
List<CommitteeCountDTO> getCaseCountByDept();
//获取最近12个月的好差评数量
List<CommitteeCountDTO> getCountByMouth();
//根据人员权限获取好差评数量
List<CommitteeCountDTO> getCountByUserRole(Map<String, Object> params);
}
package io.hmit.modules.fhjw.dao;
import io.hmit.common.dao.BaseDao;
import io.hmit.modules.fhjw.dto.FeedbackCountDTO;
import io.hmit.modules.fhjw.entity.FhjwFeedbackEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.Map;
/**
* 人员反馈表,包含意见反馈,控告申诉,代表委员有话说
*
......@@ -12,5 +15,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FhjwFeedbackDao extends BaseDao<FhjwFeedbackEntity> {
}
\ No newline at end of file
FeedbackCountDTO getCount(Map<String,Object> params);
}
package io.hmit.modules.fhjw.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Eve
* @email mengmengeve@gmail.com
* @create 2021/7/6
*/
@Data
@ApiModel(value = "好差评数量表")
public class CommitteeCountDTO {
@ApiModelProperty(value = "总数")
private Integer totalCount;
@ApiModelProperty(value = "案件所属部门ID")
private Long deptId;
@ApiModelProperty(value = "评价的用户权限ID")
private Long roleId;
@ApiModelProperty(value = "评价的用户权限")
private String userRole;
@ApiModelProperty(value = "时间")
private String createDate;
@ApiModelProperty(value = "好评总数")
private Integer good;
@ApiModelProperty(value = "中评总数")
private Integer medium;
@ApiModelProperty(value = "差评总数")
private Integer bad;
public CommitteeCountDTO assembleCountDTO (){
CommitteeCountDTO committeeCountDTO = new CommitteeCountDTO();
committeeCountDTO.setTotalCount(0);
committeeCountDTO.setGood(0);
committeeCountDTO.setMedium(0);
committeeCountDTO.setBad(0);
return committeeCountDTO;
}
}
package io.hmit.modules.fhjw.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Eve
* @email mengmengeve@gmail.com
* @create 2021/7/6
*/
@Data
@ApiModel(value = "评价统计表")
public class CommitteeCountListDTO {
@ApiModelProperty(value = "评价的名字")
private String name;
@ApiModelProperty(value = "案件所属部门名称")
private String deptName;
@ApiModelProperty(value = "评价统计详情")
private CommitteeCountDTO committeeCountDTO;
/**
* 组装返回的统计数据
* @param countName
* @param dto
* @return
*/
public CommitteeCountListDTO assembleCountListDTO(String countName,String deptName, CommitteeCountDTO dto){
CommitteeCountListDTO countListDTO = new CommitteeCountListDTO();
//为方便前端页面展示,如果查询出的总数为0,则将各项数值设置成0,不设置则默认为null
if( dto.getTotalCount().equals(0)){
countListDTO.setCommitteeCountDTO(new CommitteeCountDTO().assembleCountDTO());
}else{
countListDTO.setCommitteeCountDTO(dto);
}
countListDTO.setName(countName);
countListDTO.setDeptName(deptName);
return countListDTO;
}
}
package io.hmit.modules.fhjw.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Eve
* @email mengmengeve@gmail.com
* @create 2021/7/6
*/
@Data
@ApiModel(value = "反馈数量表")
public class FeedbackCountDTO {
@ApiModelProperty(value = "总数")
private Integer totalCount;
@ApiModelProperty(value = "反馈意见总数")
private Integer feedbackCount;
@ApiModelProperty(value = "控告申诉总数")
private Integer complainCount;
@ApiModelProperty(value = "代表委员有话说总数")
private Integer committeeCount;
@ApiModelProperty(value = "其他问题总数")
private Integer otherProblemCount;
@ApiModelProperty(value = "违规不当办案总数")
private Integer illegalCount;
@ApiModelProperty(value = "办案不廉或作风不正总数")
private Integer dishonestyCount;
@ApiModelProperty(value = "干预办案总数")
private Integer interveneCount;
@ApiModelProperty(value = "拖延消极办案总数")
private Integer delayCount;
/**
* 将所有总数设置成0
* @return FeedbackCountDTO
*/
public FeedbackCountDTO assembleZeroCountDTO(){
FeedbackCountDTO feedbackCountDTO = new FeedbackCountDTO();
feedbackCountDTO.setFeedbackCount(0);
feedbackCountDTO.setTotalCount(0);
feedbackCountDTO.setComplainCount(0);
feedbackCountDTO.setCommitteeCount(0);
feedbackCountDTO.setOtherProblemCount(0);
feedbackCountDTO.setIllegalCount(0);
feedbackCountDTO.setDishonestyCount(0);
feedbackCountDTO.setInterveneCount(0);
feedbackCountDTO.setDelayCount(0);
return feedbackCountDTO;
}
}
package io.hmit.modules.fhjw.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Eve
* @email mengmengeve@gmail.com
* @create 2021/7/6
*/
@Data
@ApiModel(value = "反馈数量表")
public class FeedbackCountListDTO {
@ApiModelProperty(value = "统计的名字")
private String name;
@ApiModelProperty(value = "反馈意见详情")
private FeedbackCountDTO feedbackCount;
/**
* 组装返回的统计数据
* @param countName
* @param dto
* @return
*/
public FeedbackCountListDTO assembleCountListDTO(String countName,FeedbackCountDTO dto){
FeedbackCountListDTO feedbackCountListDTO = new FeedbackCountListDTO();
//为方便前端页面展示,如果查询出的总数为0,则将各项数值设置成0,不设置则默认为null
if( dto.getTotalCount().equals(0)){
feedbackCountListDTO.setFeedbackCount(new FeedbackCountDTO().assembleZeroCountDTO());
}else{
feedbackCountListDTO.setFeedbackCount(dto);
}
feedbackCountListDTO.setName(countName);
return feedbackCountListDTO;
}
}
......@@ -34,5 +34,7 @@ public class FhjwAnswerDTO implements Serializable {
@ApiModelProperty(value = "可选答案")
private String answer;
@ApiModelProperty(value = "答案列表ID")
private Long answerlistId;
}
\ No newline at end of file
}
package io.hmit.modules.fhjw.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 答案列表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-07-06
*/
@Data
@ApiModel(value = "答案列表")
public class FhjwAnswerListDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键id")
private Long id;
@ApiModelProperty(value = "创建者")
private Long creator;
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "可选答案")
private String answer;
@ApiModelProperty(value = "更新时间")
private Date updateDate;
@ApiModelProperty(value = "更新者")
private Long updater;
}
\ No newline at end of file
......@@ -77,4 +77,10 @@ public class FhjwCommentDTO implements Serializable {
@ApiModelProperty(value = "受案号")
private String caseNum;
@ApiModelProperty(value = "案件所属部门ID")
private Long deptId;
@ApiModelProperty(value = "答案列表ID")
private Long answerlistId;
}
......@@ -27,4 +27,9 @@ public class FhjwAnswerEntity extends BaseEntity {
* 可选答案
*/
private String answer;
}
\ No newline at end of file
/**
* 问题列表ID
*/
private Long answerlistId;
}
package io.hmit.modules.fhjw.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.hmit.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 答案列表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-07-06
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fhjw_answer_list")
public class FhjwAnswerListEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 可选答案
*/
private String answer;
/**
* 更新时间
*/
private Date updateDate;
/**
* 更新者
*/
private Long updater;
}
\ No newline at end of file
......@@ -78,5 +78,4 @@ public class FhjwCaseEntity extends BaseEntity {
* 是否更新标志
*/
private String flag;
}
......@@ -89,11 +89,21 @@ public class FhjwCommentEntity extends BaseEntity {
/**
* 受案号
*/
@TableField(exist = false)
// @TableField(exist = false)
private String caseNum;
/**
* 用户所属权限ID
*/
private Long roleId;
/**
* 案件所属部门ID,根据案件承办人所属部门来决定
*/
private Long deptId;
/**
* 问题列表ID
*/
private Long answerlistId;
}
package io.hmit.modules.fhjw.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 答案列表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-07-06
*/
@Data
public class FhjwAnswerListExcel {
@Excel(name = "主键id")
private Long id;
@Excel(name = "创建者")
private Long creator;
@Excel(name = "创建时间")
private Date createDate;
@Excel(name = "可选答案")
private String answer;
@Excel(name = "更新时间")
private Date updateDate;
@Excel(name = "更新者")
private Long updater;
}
\ No newline at end of file
package io.hmit.modules.fhjw.service;
import io.hmit.common.service.CrudService;
import io.hmit.modules.fhjw.dto.FhjwAnswerListDTO;
import io.hmit.modules.fhjw.entity.FhjwAnswerListEntity;
/**
* 答案列表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-07-06
*/
public interface FhjwAnswerListService extends CrudService<FhjwAnswerListEntity, FhjwAnswerListDTO> {
FhjwAnswerListDTO getByAnswer(String answer);
}
......@@ -12,4 +12,6 @@ import io.hmit.modules.fhjw.entity.FhjwAnswerEntity;
*/
public interface FhjwAnswerService extends CrudService<FhjwAnswerEntity, FhjwAnswerDTO> {
@Override
void save(FhjwAnswerDTO dto);
}
......@@ -3,6 +3,7 @@ package io.hmit.modules.fhjw.service;
import io.hmit.common.page.PageData;
import io.hmit.common.service.CrudService;
import io.hmit.modules.fhjw.dto.FhjwCaseDTO;
import io.hmit.modules.fhjw.dto.FhjwCommentDTO;
import io.hmit.modules.fhjw.entity.FhjwCaseEntity;
import java.util.Map;
......@@ -23,4 +24,8 @@ public interface FhjwCaseService extends CrudService<FhjwCaseEntity, FhjwCaseDTO
@Override
void delete(Long[] ids);
@Override
void save(FhjwCaseDTO dto);
}
......@@ -2,6 +2,8 @@ package io.hmit.modules.fhjw.service;
import io.hmit.common.page.PageData;
import io.hmit.common.service.CrudService;
import io.hmit.modules.fhjw.dto.CommitteeCountDTO;
import io.hmit.modules.fhjw.dto.CommitteeCountListDTO;
import io.hmit.modules.fhjw.dto.FhjwCommentDTO;
import io.hmit.modules.fhjw.dto.UserDTO;
import io.hmit.modules.fhjw.entity.FhjwCommentEntity;
......@@ -27,4 +29,13 @@ public interface FhjwCommentService extends CrudService<FhjwCommentEntity, FhjwC
void delete(Long[] ids);
int getCountByUserId(Long userId);
//获取每个部门所有的好差评数量(可根据时间筛选)
List<CommitteeCountListDTO> getCountByDept(Map<String, Object> params);
//获取每个部门已评价的案件数量
List<CommitteeCountListDTO> getCaseCountByDept();
//获取最近12个月的好差评数量
List<CommitteeCountDTO> getCountByMouth();
//获取最近12个月的好差评数量
List<CommitteeCountDTO> getCountByUserRole(Map<String, Object> params);
}
......@@ -2,6 +2,8 @@ package io.hmit.modules.fhjw.service;
import io.hmit.common.page.PageData;
import io.hmit.common.service.CrudService;
import io.hmit.modules.fhjw.dto.FeedbackCountDTO;
import io.hmit.modules.fhjw.dto.FeedbackCountListDTO;
import io.hmit.modules.fhjw.dto.FhjwCommentDTO;
import io.hmit.modules.fhjw.dto.FhjwFeedbackDTO;
import io.hmit.modules.fhjw.entity.FhjwFeedbackEntity;
......@@ -25,4 +27,6 @@ public interface FhjwFeedbackService extends CrudService<FhjwFeedbackEntity, Fhj
List<FhjwFeedbackEntity> getByCaseNum(String caseNum);
int getCountByUserId(Long userId);
List<FeedbackCountListDTO> getCountLists(Map<String,Object> params);
}
package io.hmit.modules.fhjw.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.common.utils.ConvertUtils;
import io.hmit.modules.fhjw.dao.FhjwAnswerListDao;
import io.hmit.modules.fhjw.dto.FhjwAnswerListDTO;
import io.hmit.modules.fhjw.entity.FhjwAnswerListEntity;
import io.hmit.modules.fhjw.service.FhjwAnswerListService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 答案列表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-07-06
*/
@Service
public class FhjwAnswerListServiceImpl extends CrudServiceImpl<FhjwAnswerListDao, FhjwAnswerListEntity, FhjwAnswerListDTO> implements FhjwAnswerListService {
@Override
public QueryWrapper<FhjwAnswerListEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<FhjwAnswerListEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
return wrapper;
}
@Override
public FhjwAnswerListDTO getByAnswer(String answer) {
FhjwAnswerListEntity entity= baseDao.selectOne(new QueryWrapper<FhjwAnswerListEntity>().eq("answer",answer));
return ConvertUtils.sourceToTarget(entity,FhjwAnswerListDTO.class);
}
}
......@@ -3,13 +3,18 @@ package io.hmit.modules.fhjw.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.modules.fhjw.dao.FhjwAnswerDao;
import io.hmit.modules.fhjw.dao.FhjwAnswerListDao;
import io.hmit.modules.fhjw.dto.FhjwAnswerDTO;
import io.hmit.modules.fhjw.dto.FhjwAnswerListDTO;
import io.hmit.modules.fhjw.entity.FhjwAnswerEntity;
import io.hmit.modules.fhjw.service.FhjwAnswerListService;
import io.hmit.modules.fhjw.service.FhjwAnswerService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.Optional;
/**
* 问题答案表
......@@ -20,6 +25,9 @@ import java.util.Map;
@Service
public class FhjwAnswerServiceImpl extends CrudServiceImpl<FhjwAnswerDao, FhjwAnswerEntity, FhjwAnswerDTO> implements FhjwAnswerService {
@Autowired
private FhjwAnswerListService fhjwAnswerListService;
@Override
public QueryWrapper<FhjwAnswerEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
......@@ -32,5 +40,10 @@ public class FhjwAnswerServiceImpl extends CrudServiceImpl<FhjwAnswerDao, FhjwAn
return wrapper;
}
@Override
public void save(FhjwAnswerDTO dto) {
Optional<FhjwAnswerListDTO> result = Optional.ofNullable(fhjwAnswerListService.getByAnswer(dto.getAnswer()));
result.ifPresent(a -> dto.setAnswerlistId(a.getId()));
super.save(dto);
}
}
......@@ -121,4 +121,10 @@ public class FhjwCaseServiceImpl extends CrudServiceImpl<FhjwCaseDao, FhjwCaseEn
deleteById(id);
}
}
@Override
public void save(FhjwCaseDTO dto) {
super.save(dto);
}
}
......@@ -6,6 +6,8 @@ import io.hmit.common.page.PageData;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.common.utils.ConvertUtils;
import io.hmit.modules.fhjw.dao.FhjwCommentDao;
import io.hmit.modules.fhjw.dto.CommitteeCountDTO;
import io.hmit.modules.fhjw.dto.CommitteeCountListDTO;
import io.hmit.modules.fhjw.dto.FhjwCaseDTO;
import io.hmit.modules.fhjw.dto.FhjwCommentDTO;
import io.hmit.modules.fhjw.dto.QuestionListDTO;
......@@ -37,6 +39,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
......@@ -63,9 +66,6 @@ public class FhjwCommentServiceImpl extends CrudServiceImpl<FhjwCommentDao, Fhjw
@Autowired
private UserService userService;
@Autowired
private UserRoleService userRoleService;
@Autowired
private RoleService roleService;
......@@ -92,7 +92,7 @@ public class FhjwCommentServiceImpl extends CrudServiceImpl<FhjwCommentDao, Fhjw
Map<String, Object> param = new HashMap<>();
param.put("caseName",caseName);
caseIdList = fhjwCaseService.list(param).stream().map(FhjwCaseDTO::getId).collect(Collectors.toList());
//如果caseIdList 中不存在值,则去查一个咋都不可能存在的数
//caseIdList 中不存在值,则去查一个咋都不可能存在的数
if (caseIdList.size()==0){
wrapper.in("case_id",000);
}
......@@ -191,12 +191,10 @@ public class FhjwCommentServiceImpl extends CrudServiceImpl<FhjwCommentDao, Fhjw
Optional<RoleDTO> roleDTO = Optional.ofNullable(roleService.get(item.getRoleId()));
roleDTO.ifPresent(r-> item.setUserRole(r.getName()));
}
/*
Long roleId = userRoleService.getByUserId(item.getUserId()).getRoleId();
item.setUserRole(roleService.get(roleId).getName());
*/
});
return ConvertUtils.sourceToTarget(DTO,FhjwCommentDTO.class);
......@@ -220,5 +218,70 @@ public class FhjwCommentServiceImpl extends CrudServiceImpl<FhjwCommentDao, Fhjw
return count;
}
@Override
public List<CommitteeCountListDTO> getCountByDept(Map<String, Object> params) {
List<CommitteeCountListDTO> countListDTOS = new ArrayList<>();
List<CommitteeCountDTO> countDTOList = baseDao.getCountByDept(params);
countDTOList.stream().forEach(item ->{
String deptName = sysDeptService.get(item.getDeptId()).getName();
CommitteeCountListDTO countList = new CommitteeCountListDTO()
.assembleCountListDTO("",deptName,item);
countListDTOS.add(countList);
});
return countListDTOS;
}
@Override
public List<CommitteeCountListDTO> getCaseCountByDept() {
List<CommitteeCountListDTO> countListDTOS = new ArrayList<>();
List<CommitteeCountDTO> countDTOList = baseDao.getCaseCountByDept();
countDTOList.stream().forEach(item ->{
String deptName = sysDeptService.get(item.getDeptId()).getName();
CommitteeCountListDTO countList = new CommitteeCountListDTO()
.assembleCountListDTO("",deptName,item);
countListDTOS.add(countList);
});
return countListDTOS;
}
@Override
public List<CommitteeCountDTO> getCountByMouth() {
List<CommitteeCountDTO> countDTOList = baseDao.getCountByMouth();
return countDTOList;
}
@Override
public List<CommitteeCountDTO> getCountByUserRole(Map<String, Object> params) {
List<CommitteeCountDTO> countDTOList = baseDao.getCountByUserRole(params);
//获取所有的用户权限
List<RoleDTO> roleDTOList = roleService.getAllRoleList();
//获取:所有用户角色ID List、已参与评价的用户角色ID List、未参与过评价的用户角色ID List
List<Long> roleIDs = roleDTOList.stream().map(RoleDTO::getId).collect(Collectors.toList());
List<Long> committeeRoleIDs = countDTOList.stream().map(CommitteeCountDTO::getRoleId).collect(Collectors.toList());
List<Long> reduce1 = roleIDs.stream().filter(item -> !committeeRoleIDs.contains(item)).collect(Collectors.toList());
//将未参与过评价的用户角色,添加到已参与评价的用户角色列表中,并设置默认的好差评数为0
reduce1.stream().forEach(a -> {
CommitteeCountDTO dto = new CommitteeCountDTO().assembleCountDTO();
dto.setRoleId(a);
countDTOList.add(dto);
});
//根据userRoleID设置用户userRole,返回
List<CommitteeCountDTO> resultList2 = countDTOList.stream().map(m->{
roleDTOList.stream().filter(m2-> Objects.equals(m.getRoleId(), m2.getId())).forEach(s-> m.setUserRole(s.getName()));
return m;
}).collect(Collectors.toList());
return resultList2;
}
}
......@@ -6,6 +6,8 @@ import io.hmit.common.page.PageData;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.common.utils.ConvertUtils;
import io.hmit.modules.fhjw.dao.FhjwFeedbackDao;
import io.hmit.modules.fhjw.dto.FeedbackCountDTO;
import io.hmit.modules.fhjw.dto.FeedbackCountListDTO;
import io.hmit.modules.fhjw.dto.FhjwCaseDTO;
import io.hmit.modules.fhjw.dto.FhjwCommentDTO;
import io.hmit.modules.fhjw.dto.FhjwFeedbackDTO;
......@@ -26,6 +28,8 @@ import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
......@@ -97,6 +101,57 @@ public class FhjwFeedbackServiceImpl extends CrudServiceImpl<FhjwFeedbackDao, Fh
return count;
}
@Override
public List<FeedbackCountListDTO> getCountLists(Map<String, Object> params) {
List<FeedbackCountListDTO> countListDTOList = new ArrayList<>();
//所有反馈统计(统计各个类别的总数)
FeedbackCountDTO countDTO = baseDao.getCount(params);
FeedbackCountListDTO count = new FeedbackCountListDTO()
.assembleCountListDTO("反馈统计",countDTO);
//反馈意见统计
Map<String, Object> fdbQuery = params;
fdbQuery.put("feedbackType","feedback");
FeedbackCountDTO fdbCountDTO = baseDao.getCount(fdbQuery);
FeedbackCountListDTO fbdCount = new FeedbackCountListDTO()
.assembleCountListDTO("反馈意见统计",fdbCountDTO);
/*
if(fdbCountDTO.getTotalCount() !=0){
fbdCount.setFeedbackCount(fdbCountDTO);
}else{
fbdCount.setFeedbackCount(new FeedbackCountDTO().assembleZeroCountDTO());
}
fbdCount.setName("反馈意见统计");
*/
//代表委员意见统计
Map<String, Object> committeeQuery = params;
committeeQuery.put("feedbackType","committee");
FeedbackCountDTO committeeCountDTO = baseDao.getCount(committeeQuery);
FeedbackCountListDTO committeeCount = new FeedbackCountListDTO()
.assembleCountListDTO("代表委员意见统计",committeeCountDTO);
/*
committeeCount.setFeedbackCount(baseDao.getCount(committeeQuery));
committeeCount.setName("代表委员意见统计");
*/
countListDTOList.add(fbdCount);
countListDTOList.add(committeeCount);
countListDTOList.add(count);
return countListDTOList;
}
/**
* 在返回的实体中添加如下字段信息
* 用户名字
......@@ -129,4 +184,5 @@ public class FhjwFeedbackServiceImpl extends CrudServiceImpl<FhjwFeedbackDao, Fh
return ConvertUtils.sourceToTarget(dto,FhjwFeedbackDTO.class);
}
}
......@@ -5,7 +5,8 @@ spring:
# driver-class-name: com.mysql.cj.jdbc.Driver
driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://112.51.130.215:3306/security_enterprise?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
url: jdbc:mysql://119.3.143.77:3306/fhjw?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
# url: jdbc:mysql://119.3.143.77:3306/fhjw?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
url: jdbc:mysql://119.3.143.77:3306/fhjw_local?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
username: hmit_user
password: HmitUser@1234
# #Oracle
......
......@@ -5,7 +5,8 @@ spring:
# driver-class-name: com.mysql.cj.jdbc.Driver
driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://122.51.130.215:3306/security_enterprise?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
url: jdbc:mysql://119.3.143.77:3306/fhjw?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
# url: jdbc:mysql://119.3.143.77:3306/fhjw?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
url: jdbc:mysql://119.3.143.77:3306/fhjw_local?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
username: hmit_user
password: HmitUser@1234
initial-size: 10
......
<?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="io.hmit.modules.fhjw.dao.FhjwAnswerListDao">
<resultMap type="io.hmit.modules.fhjw.entity.FhjwAnswerListEntity" id="fhjwAnswerListMap">
<result property="id" column="id"/>
<result property="creator" column="creator"/>
<result property="createDate" column="create_date"/>
<result property="answer" column="answer"/>
<result property="updateDate" column="update_date"/>
<result property="updater" column="updater"/>
</resultMap>
</mapper>
\ No newline at end of file
......@@ -13,4 +13,43 @@
</resultMap>
</mapper>
\ No newline at end of file
<select id="getCountByDept" resultType="io.hmit.modules.fhjw.dto.CommitteeCountDTO">
select count(*) as totalCount,dept_id as deptId,
sum(answerlist_id ='1402159151000856069') as good,
sum(answerlist_id ='1402159151000856070') as medium,
sum(answerlist_id ='1402159151000856075') as bad
from fhjw_comment where 1=1
<if test="startDate !=null and endDate != null">
and create_date between #{startDate} and #{endDate}
</if>
GROUP BY dept_id
</select>
<select id="getCaseCountByDept" resultType="io.hmit.modules.fhjw.dto.CommitteeCountDTO">
select count(*) as totalCount, a.dept_id as deptId from
(select count(*) ,case_num,dept_id
from fhjw_comment GROUP BY dept_id,case_num ) as a
GROUP BY a.dept_id
</select>
<select id="getCountByMouth" resultType="io.hmit.modules.fhjw.dto.CommitteeCountDTO">
select DATE_FORMAT(create_date, '%Y-%m') as createDate,count(id) as totalCount ,
sum(answerlist_id ='1402159151000856069') as good,
sum(answerlist_id ='1402159151000856070') as medium,
sum(answerlist_id ='1402159151000856075') as bad
from fhjw_comment group by createDate order by create_date desc limit 12
</select>
<select id="getCountByUserRole" resultType="io.hmit.modules.fhjw.dto.CommitteeCountDTO">
select count(*) as totalCount,role_id as roleId,
sum(answerlist_id ='1402159151000856069') as good,
sum(answerlist_id ='1402159151000856070') as medium,
sum(answerlist_id ='1402159151000856075') as bad
from fhjw_comment where 1=1
<if test="startDate !=null and endDate != null">
and create_date between #{startDate} and #{endDate}
</if>
GROUP BY role_id
</select>
</mapper>
......@@ -12,5 +12,33 @@
<result property="createDate" column="create_date"/>
</resultMap>
<select id="getCount" resultType="io.hmit.modules.fhjw.dto.FeedbackCountDTO">
select count(*) as totalCount,
sum(feedback_type =1) as feedbackCount,
sum(feedback_type =2) as complainCount,
sum(feedback_type =3) as committeeCount,
sum(option_status = "反映拖延消极办案") as delayCount,
sum(option_status = "反映违规不当办案") as illegalCount,
sum(option_status = "反映办案不廉或作风不正") as dishonestyCount,
sum(option_status = "反映存在插手干预案件办理") as interveneCount,
sum(option_status = "反映其他方面问题") as otherProblemCount
from fhjw_feedback where 1=1
<if test="startDate !=null and endDate != null">
and create_date between #{startDate} and #{endDate}
</if>
</mapper>
\ No newline at end of file
<if test="feedbackType =='feedback'.toString()">
and feedback_type = '1'
</if>
<if test="feedbackType =='complain'.toString()">
and feedback_type = '2'
</if>
<if test="feedbackType =='committee'.toString()">
and feedback_type = '3'
</if>
</select>
</mapper>
package io.hmit.modules.fhjw.dao;
import io.hmit.common.dao.BaseDao;
import io.hmit.modules.fhjw.entity.FhjwAnswerListEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 答案列表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-07-06
*/
@Mapper
public interface FhjwAnswerListDao extends BaseDao<FhjwAnswerListEntity> {
}
\ No newline at end of file
......@@ -18,6 +18,9 @@ public class AnswerListDTO {
@ApiModelProperty(value = "答案ID")
private Long answerId;
@ApiModelProperty(value = "答案列表ID")
private Long answerlistId;
@ApiModelProperty(value = "答案")
private String answer;
......
......@@ -34,5 +34,7 @@ public class FhjwAnswerDTO implements Serializable {
@ApiModelProperty(value = "可选答案")
private String answer;
@ApiModelProperty(value = "答案列表ID")
private Long answerlistId;
}
\ No newline at end of file
}
package io.hmit.modules.fhjw.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 答案列表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-07-06
*/
@Data
@ApiModel(value = "答案列表")
public class FhjwAnswerListDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键id")
private Long id;
@ApiModelProperty(value = "创建者")
private Long creator;
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "可选答案")
private String answer;
@ApiModelProperty(value = "更新时间")
private Date updateDate;
@ApiModelProperty(value = "更新者")
private Long updater;
}
\ No newline at end of file
......@@ -62,6 +62,9 @@ public class FhjwCaseDTO implements Serializable {
@ApiModelProperty(value = "创建者")
private Long creator;
@ApiModelProperty(value = "案件所属部门ID,根据案件所属承办人部门对应")
private Long deptId;
@ApiModelProperty(value = "创建时间")
private Date createDate;
......
......@@ -44,10 +44,16 @@ public class FhjwCommentDTO implements Serializable {
@ApiModelProperty(value = "答案ID")
private Long caseId;
@ApiModelProperty(value = "答案ID")
@ApiModelProperty(value = "受案号")
private String caseNum;
@ApiModelProperty(value = "问题答案列表")
private List<AnswerListDTO> questionAnswerList;
@ApiModelProperty(value = "案件所属部门ID")
private Long deptId;
@ApiModelProperty(value = "答案列表ID")
private Long answerlistId;
}
......@@ -27,4 +27,9 @@ public class FhjwAnswerEntity extends BaseEntity {
* 可选答案
*/
private String answer;
}
\ No newline at end of file
/**
* 问题列表ID
*/
private Long answerlistId;
}
package io.hmit.modules.fhjw.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.hmit.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 答案列表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-07-06
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fhjw_answer_list")
public class FhjwAnswerListEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 可选答案
*/
private String answer;
/**
* 更新时间
*/
private Date updateDate;
/**
* 更新者
*/
private Long updater;
}
\ No newline at end of file
......@@ -78,5 +78,4 @@ public class FhjwCaseEntity extends BaseEntity {
* 2 未更新(默认)
*/
private String flag;
}
......@@ -44,4 +44,20 @@ public class FhjwCommentEntity extends BaseEntity {
*/
private Long roleId;
/**
* 受案号
*/
private String caseNum;
/**
* 案件所属部门ID,根据案件承办人所属部门来决定
*/
private Long deptId;
/**
* 问题列表ID
*/
private Long answerlistId;
}
package io.hmit.modules.fhjw.service;
import io.hmit.common.service.CrudService;
import io.hmit.modules.fhjw.dto.FhjwAnswerListDTO;
import io.hmit.modules.fhjw.entity.FhjwAnswerListEntity;
/**
* 答案列表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-07-06
*/
public interface FhjwAnswerListService extends CrudService<FhjwAnswerListEntity, FhjwAnswerListDTO> {
}
\ No newline at end of file
package io.hmit.modules.fhjw.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.modules.fhjw.dao.FhjwAnswerListDao;
import io.hmit.modules.fhjw.dto.FhjwAnswerListDTO;
import io.hmit.modules.fhjw.entity.FhjwAnswerListEntity;
import io.hmit.modules.fhjw.service.FhjwAnswerListService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 答案列表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-07-06
*/
@Service
public class FhjwAnswerListServiceImpl extends CrudServiceImpl<FhjwAnswerListDao, FhjwAnswerListEntity, FhjwAnswerListDTO> implements FhjwAnswerListService {
@Override
public QueryWrapper<FhjwAnswerListEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<FhjwAnswerListEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
return wrapper;
}
}
\ No newline at end of file
package io.hmit.modules.fhjw.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.page.PageData;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.common.utils.ConvertUtils;
import io.hmit.modules.fhjw.dao.FhjwCommentDao;
import io.hmit.modules.fhjw.dto.FhjwAnswerDTO;
import io.hmit.modules.fhjw.dto.FhjwCaseDTO;
import io.hmit.modules.fhjw.dto.FhjwCommentDTO;
import io.hmit.modules.fhjw.dto.UserCaseDTO;
import io.hmit.modules.fhjw.entity.FhjwCommentEntity;
import io.hmit.modules.fhjw.service.FhjwAnswerService;
import io.hmit.modules.fhjw.service.FhjwCaseService;
import io.hmit.modules.fhjw.service.FhjwCommentService;
import io.hmit.modules.fhjw.service.FhjwQuestionService;
import io.hmit.modules.fhjw.service.FhjwTempService;
import io.hmit.modules.fhjw.service.UserCaseService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
* 案件评价表
......@@ -31,6 +38,12 @@ public class FhjwCommentServiceImpl extends CrudServiceImpl<FhjwCommentDao, Fhjw
@Autowired
private FhjwCaseService fhjwCaseService;
@Autowired
private FhjwAnswerService fhjwAnswerService;
@Autowired
private UserCaseService userCaseService;
@Override
public QueryWrapper<FhjwCommentEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
......@@ -47,16 +60,29 @@ public class FhjwCommentServiceImpl extends CrudServiceImpl<FhjwCommentDao, Fhjw
Map<String, Object> params = new HashMap<>();
params.put("caseNum",dto.getCaseNum());
Long caseId = fhjwCaseService.list(params).get(0).getId();
//根据受案号查出caseID
List<FhjwCaseDTO> caseDto = fhjwCaseService.list(params);
//设置案件所属部门(根据承办人确定)
dto.setDeptId(caseDto.get(0).getDeptId());
//设置人员对应的caseID(存在相同受案号,不同当事人的情况,需要人员匹配caseID)
List<Long> ids = caseDto.stream().map(FhjwCaseDTO::getId).collect(Collectors.toList());
for (Long id :ids){
UserCaseDTO userCaseDTO= userCaseService.getByUserACase(dto.getUserId(),id);
if(userCaseDTO != null){
dto.setCaseId(id);
}
}
dto.getQuestionAnswerList().stream().forEach(item ->{
FhjwCommentDTO fhjwCommentDTO = new FhjwCommentDTO();
fhjwCommentDTO.setTempId(dto.getTempId());
fhjwCommentDTO.setCaseId(caseId);
FhjwCommentDTO fhjwCommentDTO = ConvertUtils.sourceToTarget(dto,FhjwCommentDTO.class);
fhjwCommentDTO.setCreateDate(new Date());
fhjwCommentDTO.setUserId(dto.getUserId());
fhjwCommentDTO.setAnswerId(item.getAnswerId());
//如果是"好、中、差"三个答案则去设置answerlistId 方便进行好差评统计
//前期未考虑到统计,为尽量减少修改,则直接增加answerlistId字段(好的数据库设计真的很重要!!!)
FhjwAnswerDTO answerDTO = fhjwAnswerService.get(item.getAnswerId());
fhjwCommentDTO.setAnswerlistId(answerDTO.getAnswerlistId());
fhjwCommentDTO.setQuestionId(item.getQuestionId());
fhjwCommentDTO.setRoleId(dto.getRoleId());
super.save(fhjwCommentDTO);
});
......
<?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="io.hmit.modules.fhjw.dao.FhjwAnswerListDao">
<resultMap type="io.hmit.modules.fhjw.entity.FhjwAnswerListEntity" id="fhjwAnswerListMap">
<result property="id" column="id"/>
<result property="creator" column="creator"/>
<result property="createDate" column="create_date"/>
<result property="answer" column="answer"/>
<result property="updateDate" column="update_date"/>
<result property="updater" column="updater"/>
</resultMap>
</mapper>
\ No newline at end of file
......@@ -117,6 +117,35 @@ public interface Constant {
}
}
/**
* 反馈类别
*/
enum FeedbackType {
/**
* 反馈意见
*/
FEEDBACK(1),
/**
* 控告申诉
*/
COMPLAINT(2),
/**
* 代表委员有话说
*/
COMMITTEE(3);
private int value;
FeedbackType(int value) {
this.value = value;
}
public int getValue() {
return value;
}
}
/**
* 云服务商
*/
......@@ -178,4 +207,4 @@ public interface Constant {
return value;
}
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment