51 changed files with 2532 additions and 0 deletions
@ -0,0 +1,69 @@ |
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.common.token.dto.TokenDto; |
|||
import com.elink.esua.epdc.commons.tools.annotation.LoginUser; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateOfficerAppFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateOptionAppFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateSubmitFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.result.EvaluateOfficerAppResultDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.result.EvaluateOptionAppResultDTO; |
|||
import com.elink.esua.epdc.service.ActInfoService; |
|||
import com.elink.esua.epdc.service.EvaluateService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 移动端接口-项目模块 |
|||
* @Author LPF |
|||
* @Date 2019/11/18 13:32 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("custom/evaluate") |
|||
public class ApiEvaluateController { |
|||
|
|||
@Autowired |
|||
private EvaluateService evaluateService; |
|||
|
|||
|
|||
/** |
|||
* 街道干部列表 |
|||
* @Params: [ formDto] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.EvaluateOfficerAppResultDTO>> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/19 16:34 |
|||
*/ |
|||
@GetMapping("getDeptOfficer") |
|||
public Result<List<EvaluateOfficerAppResultDTO>> getDeptOfficer(@LoginUser TokenDto tokenDto) { |
|||
EvaluateOfficerAppFormDTO formDto = new EvaluateOfficerAppFormDTO(); |
|||
formDto.setGridId(tokenDto.getGridId()); |
|||
return evaluateService.getDeptOfficer(formDto); |
|||
} |
|||
/** |
|||
* 评价列表 |
|||
* @Params: [ formDto] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.EvaluateOfficerAppResultDTO>> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/19 16:34 |
|||
*/ |
|||
@GetMapping("getOptionList") |
|||
public Result<List<EvaluateOptionAppResultDTO>> getOptionList(EvaluateOptionAppFormDTO formDto) { |
|||
return evaluateService.getOptionList(formDto); |
|||
} |
|||
/** |
|||
* 评价提交 |
|||
* @Params: [ formDto] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.EvaluateOfficerAppResultDTO>> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/19 16:34 |
|||
*/ |
|||
@PostMapping("evaluateSubmit") |
|||
public Result evaluateSubmit(EvaluateSubmitFormDTO formDto, @LoginUser TokenDto tokenDto) { |
|||
formDto.setFullName(tokenDto.getRealName()); |
|||
formDto.setMobile(tokenDto.getMobile()); |
|||
return evaluateService.evaluateSubmit(formDto); |
|||
} |
|||
} |
@ -0,0 +1,66 @@ |
|||
package com.elink.esua.epdc.feign; |
|||
|
|||
import com.elink.esua.epdc.activity.ActBannerDTO; |
|||
import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; |
|||
import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; |
|||
import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; |
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.config.FeignRequestInterceptor; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateOfficerAppFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateOptionAppFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateSubmitFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.result.EvaluateOfficerAppResultDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.result.EvaluateOptionAppResultDTO; |
|||
import com.elink.esua.epdc.feign.fallback.ActInfoFeignClientFallback; |
|||
import com.elink.esua.epdc.feign.fallback.EvaluateFeignClientFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 评价模块调用-移动app端 |
|||
* @Author LPF |
|||
* @Date 2019/11/18 16:39 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_CUSTOM_SERVER, fallback = EvaluateFeignClientFallback.class, configuration = FeignRequestInterceptor.class) |
|||
public interface EvaluateFeignClient { |
|||
|
|||
|
|||
|
|||
/** |
|||
* 街道干部列表 |
|||
* @Params: [formDto] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.EvaluateOfficerAppResultDTO>> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/19 16:42 |
|||
*/ |
|||
@GetMapping(value = "custom/evaluateofficer/getDeptOfficer", consumes = MediaType.APPLICATION_JSON_VALUE) |
|||
Result<List<EvaluateOfficerAppResultDTO>> getDeptOfficer(EvaluateOfficerAppFormDTO formDto); |
|||
|
|||
/** |
|||
* 评价列表 |
|||
* @Params: [formDto] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.EvaluateOptionAppResultDTO>> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/19 16:42 |
|||
*/ |
|||
@GetMapping(value = "custom/evaluateoption/getOptionList", consumes = MediaType.APPLICATION_JSON_VALUE) |
|||
Result<List<EvaluateOptionAppResultDTO>> getOptionList(EvaluateOptionAppFormDTO formDto); |
|||
/** |
|||
* 评价提交 |
|||
* @Params: [formDto] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/19 16:42 |
|||
*/ |
|||
@PostMapping(value = "custom/evaluateinfo/evaluateSubmit", consumes = MediaType.APPLICATION_JSON_VALUE) |
|||
Result evaluateSubmit(EvaluateSubmitFormDTO formDto); |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,43 @@ |
|||
package com.elink.esua.epdc.feign.fallback; |
|||
|
|||
import com.elink.esua.epdc.activity.ActBannerDTO; |
|||
import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; |
|||
import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; |
|||
import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; |
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateOfficerAppFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateOptionAppFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateSubmitFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.result.EvaluateOfficerAppResultDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.result.EvaluateOptionAppResultDTO; |
|||
import com.elink.esua.epdc.feign.ActInfoFeignClient; |
|||
import com.elink.esua.epdc.feign.EvaluateFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author LPF |
|||
* @Date 2019/11/18 16:39 |
|||
*/ |
|||
@Component |
|||
public class EvaluateFeignClientFallback implements EvaluateFeignClient { |
|||
|
|||
|
|||
@Override |
|||
public Result<List<EvaluateOfficerAppResultDTO>> getDeptOfficer(EvaluateOfficerAppFormDTO formDto) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "getDeptOfficer", formDto); |
|||
} |
|||
@Override |
|||
public Result<List<EvaluateOptionAppResultDTO>> getOptionList(EvaluateOptionAppFormDTO formDto) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "getOptionList", formDto); |
|||
} |
|||
@Override |
|||
public Result evaluateSubmit(EvaluateSubmitFormDTO formDto) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "evaluateSubmit", formDto); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,52 @@ |
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.activity.ActBannerDTO; |
|||
import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO; |
|||
import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO; |
|||
import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateOfficerAppFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateOptionAppFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateSubmitFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.result.EvaluateOfficerAppResultDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.result.EvaluateOptionAppResultDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 项目模块-移动App端 |
|||
* @Author LPF |
|||
* @Date 2019/11/18 13:34 |
|||
*/ |
|||
public interface EvaluateService { |
|||
|
|||
|
|||
/** |
|||
* 街道干部列表 |
|||
* @Params: [userDetail, formDto] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.ItemResultDTO>> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/19 16:37 |
|||
*/ |
|||
Result<List<EvaluateOfficerAppResultDTO>> getDeptOfficer(EvaluateOfficerAppFormDTO formDto); |
|||
/** |
|||
* 评价列表 |
|||
* @Params: [userDetail, formDto] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.ItemResultDTO>> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/19 16:37 |
|||
*/ |
|||
Result<List<EvaluateOptionAppResultDTO>> getOptionList(EvaluateOptionAppFormDTO formDto); |
|||
/** |
|||
* 评价提交 |
|||
* @Params: [userDetail, itemId] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.item.result.ItemDetailResultDTO> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/19 16:34 |
|||
*/ |
|||
Result evaluateSubmit(EvaluateSubmitFormDTO formDto); |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,43 @@ |
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateOfficerAppFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateOptionAppFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateSubmitFormDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.result.EvaluateOfficerAppResultDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.result.EvaluateOptionAppResultDTO; |
|||
import com.elink.esua.epdc.feign.EvaluateFeignClient; |
|||
import com.elink.esua.epdc.service.EvaluateService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 项目模块-移动app端 |
|||
* @Author LPF |
|||
* @Date 2019/11/18 16:34 |
|||
*/ |
|||
@Service |
|||
public class EvaluateServiceImpl implements EvaluateService { |
|||
|
|||
@Autowired |
|||
private EvaluateFeignClient evaluateFeignClient; |
|||
|
|||
|
|||
|
|||
@Override |
|||
public Result<List<EvaluateOfficerAppResultDTO>> getDeptOfficer(EvaluateOfficerAppFormDTO formDto) { |
|||
return evaluateFeignClient.getDeptOfficer(formDto); |
|||
} |
|||
@Override |
|||
public Result<List<EvaluateOptionAppResultDTO>> getOptionList(EvaluateOptionAppFormDTO formDto) { |
|||
return evaluateFeignClient.getOptionList(formDto); |
|||
} |
|||
|
|||
@Override |
|||
public Result evaluateSubmit(EvaluateSubmitFormDTO formDto){ |
|||
return evaluateFeignClient.evaluateSubmit(formDto); |
|||
} |
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.elink.esua.epdc.dto.evaluate; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 评价选项 |
|||
* |
|||
* @author work@yujt.net.cn |
|||
* @date 2019/11/27 10:03 |
|||
*/ |
|||
@Data |
|||
public class EvaluateOptions<T> { |
|||
private List<T> optionList; |
|||
} |
|||
|
|||
|
@ -0,0 +1,27 @@ |
|||
package com.elink.esua.epdc.dto.evaluate; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 评价选项 |
|||
* |
|||
* @author work@yujt.net.cn |
|||
* @date 2019/11/27 10:03 |
|||
*/ |
|||
@Data |
|||
public class EvaluateSelectOption { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String optionId; |
|||
|
|||
/** |
|||
* 选中状态 |
|||
*/ |
|||
private String selectFlag; |
|||
|
|||
} |
|||
|
|||
|
@ -0,0 +1,25 @@ |
|||
package com.elink.esua.epdc.dto.evaluate; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 评价选项 |
|||
* |
|||
* @author work@yujt.net.cn |
|||
* @date 2019/11/27 10:03 |
|||
*/ |
|||
@Data |
|||
public class EvaluateShowOption { |
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private Integer index; |
|||
|
|||
/** |
|||
* 选项 |
|||
*/ |
|||
private String optionContent; |
|||
|
|||
} |
|||
|
|||
|
@ -0,0 +1,44 @@ |
|||
/** |
|||
* 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.dto.evaluate.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 干部信息表 干部信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-02-05 |
|||
*/ |
|||
@Data |
|||
public class EvaluateOfficerAppFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 网格Id |
|||
*/ |
|||
@NotNull(message = "网格Id不能为空") |
|||
private Long gridId; |
|||
|
|||
} |
@ -0,0 +1,45 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto.evaluate.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 评价选项表 评价选项表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-02-05 |
|||
*/ |
|||
@Data |
|||
public class EvaluateOptionAppFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 权限编码(1.点赞,2.吐槽) |
|||
*/ |
|||
@NotNull(message = "评价类别不能为空") |
|||
private Integer roleCode; |
|||
|
|||
|
|||
} |
@ -0,0 +1,78 @@ |
|||
/** |
|||
* 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.dto.evaluate.form; |
|||
|
|||
import com.elink.esua.epdc.dto.evaluate.EvaluateSelectOption; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.Size; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 评价信息表 评价信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-02-06 |
|||
*/ |
|||
@Data |
|||
public class EvaluateSubmitFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
|
|||
/** |
|||
* 提交人姓名 |
|||
*/ |
|||
@NotBlank(message = "联系电话不能为空") |
|||
private String fullName; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
@NotBlank(message = "联系电话不能为空") |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 干部ID 干部信息表主键 |
|||
*/ |
|||
@NotBlank(message = "联系电话不能为空") |
|||
private String officerId; |
|||
|
|||
/** |
|||
* 评价类别(1.点赞,2.吐槽) |
|||
*/ |
|||
@NotNull(message = "评价类别不能为空") |
|||
private Integer roleCode; |
|||
|
|||
/** |
|||
* 评价内容 |
|||
*/ |
|||
@Size(min = 0, max = 50, message = "评价内容在50字以内") |
|||
private String content; |
|||
|
|||
/** |
|||
* 评价选项 |
|||
*/ |
|||
private List<EvaluateSelectOption> optionList; |
|||
|
|||
} |
@ -0,0 +1,113 @@ |
|||
/** |
|||
* 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.dto.evaluate.result; |
|||
|
|||
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 EvaluateDeptCountResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 部门名称 |
|||
*/ |
|||
private String deptName; |
|||
/** |
|||
* 干部人数 |
|||
*/ |
|||
private Integer officerCount; |
|||
|
|||
/** |
|||
* 被评价干部人数 |
|||
*/ |
|||
private Integer beEvaluatedCount; |
|||
|
|||
/** |
|||
* 评价总人数 |
|||
*/ |
|||
private Integer evaluatePeopleCount; |
|||
|
|||
/** |
|||
* 评价总次数 |
|||
*/ |
|||
private Integer evaluateCount; |
|||
|
|||
/** |
|||
* 被点赞总次数 |
|||
*/ |
|||
private Integer likeCount; |
|||
|
|||
/** |
|||
* 被吐槽总次数 |
|||
*/ |
|||
private Integer opposeCount; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 删除标识 0:否,1:是 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,60 @@ |
|||
/** |
|||
* 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.dto.evaluate.result; |
|||
|
|||
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 EvaluateOfficerAppResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String officerId; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
private String fullName; |
|||
|
|||
/** |
|||
* 性别(0-女,1-男) |
|||
*/ |
|||
private String sex; |
|||
|
|||
/** |
|||
* 职位 |
|||
*/ |
|||
private String position; |
|||
|
|||
|
|||
} |
@ -0,0 +1,127 @@ |
|||
/** |
|||
* 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.dto.evaluate.result; |
|||
|
|||
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 EvaluateOfficerCountResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 部门ID 部门表主键ID |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
private String fullName; |
|||
|
|||
/** |
|||
* 性别(0-女,1-男) |
|||
*/ |
|||
private String sex; |
|||
|
|||
/** |
|||
* 职位 |
|||
*/ |
|||
private String position; |
|||
|
|||
/** |
|||
* 点赞次数 |
|||
*/ |
|||
private Integer likesCount; |
|||
|
|||
/** |
|||
* 评价总人数 |
|||
*/ |
|||
private Integer evaluatePeopleCount; |
|||
|
|||
/** |
|||
* 评价总次数 |
|||
*/ |
|||
private Integer evaluateCount; |
|||
|
|||
/** |
|||
* 点赞选项次数 |
|||
*/ |
|||
private Integer likesOptionCount; |
|||
|
|||
/** |
|||
* 吐槽选项次数 |
|||
*/ |
|||
private Integer opposeOptionCount; |
|||
|
|||
/** |
|||
* 被踩次数 |
|||
*/ |
|||
private Integer opposeCount; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 删除标识 0:否,1:是 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
/** |
|||
* 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.dto.evaluate.result; |
|||
|
|||
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 EvaluateOptionAppResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String optionId; |
|||
|
|||
/** |
|||
* 权限编码(1.点赞,2.吐槽) |
|||
*/ |
|||
private Integer roleCode; |
|||
|
|||
/** |
|||
* 评价选项 |
|||
*/ |
|||
private String optionContent; |
|||
|
|||
|
|||
} |
@ -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.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.evaluate.EvaluateDetailDTO; |
|||
import com.elink.esua.epdc.modules.evaluate.excel.EvaluateDetailExcel; |
|||
import com.elink.esua.epdc.modules.evaluate.service.EvaluateDetailService; |
|||
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-06 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("evaluatedetail") |
|||
public class EvaluateDetailController { |
|||
|
|||
@Autowired |
|||
private EvaluateDetailService evaluateDetailService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<EvaluateDetailDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<EvaluateDetailDTO> page = evaluateDetailService.page(params); |
|||
return new Result<PageData<EvaluateDetailDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<EvaluateDetailDTO> get(@PathVariable("id") String id){ |
|||
EvaluateDetailDTO data = evaluateDetailService.get(id); |
|||
return new Result<EvaluateDetailDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody EvaluateDetailDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
evaluateDetailService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody EvaluateDetailDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
evaluateDetailService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
evaluateDetailService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<EvaluateDetailDTO> list = evaluateDetailService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, EvaluateDetailExcel.class); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
/** |
|||
* 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.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.evaluate.EvaluateInfoDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateSubmitFormDTO; |
|||
import com.elink.esua.epdc.modules.evaluate.excel.EvaluateInfoExcel; |
|||
import com.elink.esua.epdc.modules.evaluate.service.EvaluateDetailService; |
|||
import com.elink.esua.epdc.modules.evaluate.service.EvaluateInfoService; |
|||
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-06 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("evaluateinfo") |
|||
public class EvaluateInfoController { |
|||
|
|||
@Autowired |
|||
private EvaluateInfoService evaluateInfoService; |
|||
|
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<EvaluateInfoDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<EvaluateInfoDTO> page = evaluateInfoService.page(params); |
|||
return new Result<PageData<EvaluateInfoDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<EvaluateInfoDTO> get(@PathVariable("id") String id){ |
|||
EvaluateInfoDTO data = evaluateInfoService.get(id); |
|||
return new Result<EvaluateInfoDTO>().ok(data); |
|||
} |
|||
@PostMapping("evaluateSubmit") |
|||
public Result evaluateSubmit(@RequestBody EvaluateSubmitFormDTO formDto){ |
|||
ValidatorUtils.validateEntity(formDto); |
|||
return evaluateInfoService.evaluateSubmit(formDto); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody EvaluateInfoDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
evaluateInfoService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody EvaluateInfoDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
evaluateInfoService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
evaluateInfoService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<EvaluateInfoDTO> list = evaluateInfoService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, EvaluateInfoExcel.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.evaluate.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateDetailEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 评价详情表 评价详情表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-02-06 |
|||
*/ |
|||
@Mapper |
|||
public interface EvaluateDetailDao extends BaseDao<EvaluateDetailEntity> { |
|||
|
|||
} |
@ -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.EvaluateInfoEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 评价信息表 评价信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-02-06 |
|||
*/ |
|||
@Mapper |
|||
public interface EvaluateInfoDao extends BaseDao<EvaluateInfoEntity> { |
|||
|
|||
} |
@ -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.evaluate.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 qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-02-06 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_evaluate_detail") |
|||
public class EvaluateDetailEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 信息ID 评价信息表主键 |
|||
*/ |
|||
private String infoId; |
|||
|
|||
/** |
|||
* 评价类别(1.点赞,2.吐槽) |
|||
*/ |
|||
private Integer roleCode; |
|||
|
|||
/** |
|||
* 选项ID 选项表主键 |
|||
*/ |
|||
private String optionId; |
|||
|
|||
/** |
|||
* 是否选中(0-否,1-是) |
|||
*/ |
|||
private String selectFlag; |
|||
|
|||
} |
@ -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.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 qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-02-06 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_evaluate_info") |
|||
public class EvaluateInfoEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 提交人姓名 |
|||
*/ |
|||
private String fullName; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 干部ID 干部信息表主键 |
|||
*/ |
|||
private String officerId; |
|||
|
|||
/** |
|||
* 评价类别(1.点赞,2.吐槽) |
|||
*/ |
|||
private Integer roleCode; |
|||
|
|||
/** |
|||
* 评价内容 |
|||
*/ |
|||
private String content; |
|||
|
|||
private Integer optionCount; |
|||
|
|||
} |
@ -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-06 |
|||
*/ |
|||
@Data |
|||
public class EvaluateDetailExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "信息ID 评价信息表主键") |
|||
private String infoId; |
|||
|
|||
@Excel(name = "评价类别(1.点赞,2.吐槽)") |
|||
private Integer roleCode; |
|||
|
|||
@Excel(name = "选项ID 选项表主键") |
|||
private String optionId; |
|||
|
|||
@Excel(name = "是否选中(0-否,1-是)") |
|||
private String selectFlag; |
|||
|
|||
@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; |
|||
|
|||
|
|||
} |
@ -0,0 +1,71 @@ |
|||
/** |
|||
* 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-06 |
|||
*/ |
|||
@Data |
|||
public class EvaluateInfoExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "提交人姓名") |
|||
private String fullName; |
|||
|
|||
@Excel(name = "联系电话") |
|||
private String mobile; |
|||
|
|||
@Excel(name = "干部ID 干部信息表主键") |
|||
private String officerId; |
|||
|
|||
@Excel(name = "评价类别(1.点赞,2.吐槽)") |
|||
private Integer roleCode; |
|||
|
|||
@Excel(name = "评价内容") |
|||
private String content; |
|||
|
|||
@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; |
|||
|
|||
|
|||
} |
@ -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-06 |
|||
*/ |
|||
@Component |
|||
public class EvaluateDetailRedis { |
|||
@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.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-06 |
|||
*/ |
|||
@Component |
|||
public class EvaluateInfoRedis { |
|||
@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.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.dto.evaluate.EvaluateDetailDTO; |
|||
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateDetailEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 评价详情表 评价详情表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-02-06 |
|||
*/ |
|||
public interface EvaluateDetailService extends BaseService<EvaluateDetailEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<EvaluateDetailDTO> |
|||
* @author generator |
|||
* @date 2020-02-06 |
|||
*/ |
|||
PageData<EvaluateDetailDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<EvaluateDetailDTO> |
|||
* @author generator |
|||
* @date 2020-02-06 |
|||
*/ |
|||
List<EvaluateDetailDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return EvaluateDetailDTO |
|||
* @author generator |
|||
* @date 2020-02-06 |
|||
*/ |
|||
EvaluateDetailDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-02-06 |
|||
*/ |
|||
void save(EvaluateDetailDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-02-06 |
|||
*/ |
|||
void update(EvaluateDetailDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-02-06 |
|||
*/ |
|||
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.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.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.evaluate.EvaluateInfoDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateSubmitFormDTO; |
|||
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateInfoEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 评价信息表 评价信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2020-02-06 |
|||
*/ |
|||
public interface EvaluateInfoService extends BaseService<EvaluateInfoEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<EvaluateInfoDTO> |
|||
* @author generator |
|||
* @date 2020-02-06 |
|||
*/ |
|||
PageData<EvaluateInfoDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<EvaluateInfoDTO> |
|||
* @author generator |
|||
* @date 2020-02-06 |
|||
*/ |
|||
List<EvaluateInfoDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return EvaluateInfoDTO |
|||
* @author generator |
|||
* @date 2020-02-06 |
|||
*/ |
|||
EvaluateInfoDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-02-06 |
|||
*/ |
|||
void save(EvaluateInfoDTO dto); |
|||
/** |
|||
* 评价提交 |
|||
* |
|||
* @param formDto |
|||
* @return Result |
|||
* @author generator |
|||
* @date 2020-02-06 |
|||
*/ |
|||
Result evaluateSubmit(EvaluateSubmitFormDTO formDto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-02-06 |
|||
*/ |
|||
void update(EvaluateInfoDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2020-02-06 |
|||
*/ |
|||
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.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.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.evaluate.EvaluateDetailDTO; |
|||
import com.elink.esua.epdc.modules.evaluate.dao.EvaluateDetailDao; |
|||
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateDetailEntity; |
|||
import com.elink.esua.epdc.modules.evaluate.redis.EvaluateDetailRedis; |
|||
import com.elink.esua.epdc.modules.evaluate.service.EvaluateDetailService; |
|||
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-06 |
|||
*/ |
|||
@Service |
|||
public class EvaluateDetailServiceImpl extends BaseServiceImpl<EvaluateDetailDao, EvaluateDetailEntity> implements EvaluateDetailService { |
|||
|
|||
@Autowired |
|||
private EvaluateDetailRedis evaluateDetailRedis; |
|||
|
|||
@Override |
|||
public PageData<EvaluateDetailDTO> page(Map<String, Object> params) { |
|||
IPage<EvaluateDetailEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, EvaluateDetailDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<EvaluateDetailDTO> list(Map<String, Object> params) { |
|||
List<EvaluateDetailEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, EvaluateDetailDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<EvaluateDetailEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<EvaluateDetailEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public EvaluateDetailDTO get(String id) { |
|||
EvaluateDetailEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, EvaluateDetailDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(EvaluateDetailDTO dto) { |
|||
EvaluateDetailEntity entity = ConvertUtils.sourceToTarget(dto, EvaluateDetailEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(EvaluateDetailDTO dto) { |
|||
EvaluateDetailEntity entity = ConvertUtils.sourceToTarget(dto, EvaluateDetailEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,153 @@ |
|||
/** |
|||
* 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.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.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.evaluate.EvaluateDetailDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.EvaluateInfoDTO; |
|||
import com.elink.esua.epdc.dto.evaluate.EvaluateSelectOption; |
|||
import com.elink.esua.epdc.dto.evaluate.form.EvaluateSubmitFormDTO; |
|||
import com.elink.esua.epdc.modules.evaluate.dao.EvaluateInfoDao; |
|||
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateInfoEntity; |
|||
import com.elink.esua.epdc.modules.evaluate.redis.EvaluateInfoRedis; |
|||
import com.elink.esua.epdc.modules.evaluate.service.EvaluateDetailService; |
|||
import com.elink.esua.epdc.modules.evaluate.service.EvaluateInfoService; |
|||
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-06 |
|||
*/ |
|||
@Service |
|||
public class EvaluateInfoServiceImpl extends BaseServiceImpl<EvaluateInfoDao, EvaluateInfoEntity> implements EvaluateInfoService { |
|||
|
|||
@Autowired |
|||
private EvaluateInfoRedis evaluateInfoRedis; |
|||
|
|||
@Autowired |
|||
private EvaluateDetailService evaluateDetailService; |
|||
|
|||
@Override |
|||
public PageData<EvaluateInfoDTO> page(Map<String, Object> params) { |
|||
IPage<EvaluateInfoEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, EvaluateInfoDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<EvaluateInfoDTO> list(Map<String, Object> params) { |
|||
List<EvaluateInfoEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, EvaluateInfoDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<EvaluateInfoEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<EvaluateInfoEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public EvaluateInfoDTO get(String id) { |
|||
EvaluateInfoEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, EvaluateInfoDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(EvaluateInfoDTO dto) { |
|||
EvaluateInfoEntity entity = ConvertUtils.sourceToTarget(dto, EvaluateInfoEntity.class); |
|||
insert(entity); |
|||
} |
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public Result evaluateSubmit(EvaluateSubmitFormDTO formDto) { |
|||
try{ |
|||
EvaluateInfoDTO dto = new EvaluateInfoDTO(); |
|||
dto.setFullName(formDto.getFullName()); |
|||
dto.setMobile(formDto.getMobile()); |
|||
dto.setOfficerId(formDto.getOfficerId()); |
|||
dto.setContent(formDto.getContent()); |
|||
if (formDto.getRoleCode() != 1 |
|||
&& formDto.getRoleCode() != 2) { |
|||
return new Result().error("评价选项错误。"); |
|||
} |
|||
int optionCount = 0; |
|||
//统计选项
|
|||
for (EvaluateSelectOption item : formDto.getOptionList()) { |
|||
if("1".equals(item.getSelectFlag())){ |
|||
optionCount++; |
|||
} |
|||
} |
|||
// 新增评价信息
|
|||
dto.setOptionCount(optionCount); |
|||
dto.setRoleCode(formDto.getRoleCode()); |
|||
EvaluateInfoEntity entity = ConvertUtils.sourceToTarget(dto, EvaluateInfoEntity.class); |
|||
insert(entity); |
|||
// 新增评价选项信息
|
|||
EvaluateDetailDTO detailDto = new EvaluateDetailDTO(); |
|||
for (EvaluateSelectOption item : formDto.getOptionList()) { |
|||
detailDto.setInfoId(entity.getId()); |
|||
detailDto.setOptionId(item.getOptionId()); |
|||
detailDto.setSelectFlag(item.getSelectFlag()); |
|||
detailDto.setRoleCode(formDto.getRoleCode()); |
|||
evaluateDetailService.save(detailDto); |
|||
} |
|||
}catch (Exception e){ |
|||
e.printStackTrace(); |
|||
} |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(EvaluateInfoDTO dto) { |
|||
EvaluateInfoEntity entity = ConvertUtils.sourceToTarget(dto, EvaluateInfoEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.elink.esua.epdc.modules.feign; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.CompleteDeptDTO; |
|||
import com.elink.esua.epdc.dto.DeptGridPlatformDTO; |
|||
import com.elink.esua.epdc.dto.SysDeptDTO; |
|||
import com.elink.esua.epdc.modules.feign.fallback.SysFeignClientFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author lipf |
|||
* @email yujintao@elink-cn.com |
|||
* @date 2020/2/7 9:30 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_ADMIN_SERVER, fallback = SysFeignClientFallback.class) |
|||
public interface SysFeignClient { |
|||
|
|||
/** |
|||
* 根据网格ID获取所有上级机构名称和ID |
|||
* |
|||
* @param gridId |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.CompleteDeptDTO> |
|||
* @author yujintao |
|||
* @date 2019/9/7 09:31 |
|||
*/ |
|||
@GetMapping("sys/dept/getCompleteDept/{gridId}") |
|||
Result<CompleteDeptDTO> getCompleteDept(@PathVariable("gridId") Long gridId); |
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.elink.esua.epdc.modules.feign.fallback; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.CompleteDeptDTO; |
|||
import com.elink.esua.epdc.dto.DeptGridPlatformDTO; |
|||
import com.elink.esua.epdc.dto.SysDeptDTO; |
|||
import com.elink.esua.epdc.modules.feign.SysFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author lipf |
|||
* @email yujintao@elink-cn.com |
|||
* @date 2020/2/7 9:30 |
|||
*/ |
|||
@Component |
|||
public class SysFeignClientFallback implements SysFeignClient { |
|||
|
|||
@Override |
|||
public Result<CompleteDeptDTO> getCompleteDept(Long gridId) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getCompleteDept", gridId); |
|||
} |
|||
} |
@ -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.EvaluateDetailDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.modules.evaluate.entity.EvaluateDetailEntity" id="evaluateDetailMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="infoId" column="INFO_ID"/> |
|||
<result property="roleCode" column="ROLE_CODE"/> |
|||
<result property="optionId" column="OPTION_ID"/> |
|||
<result property="selectFlag" column="SELECT_FLAG"/> |
|||
<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> |
@ -0,0 +1,23 @@ |
|||
<?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.EvaluateInfoDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.modules.evaluate.entity.EvaluateInfoEntity" id="evaluateInfoMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="fullName" column="FULL_NAME"/> |
|||
<result property="mobile" column="MOBILE"/> |
|||
<result property="officerId" column="OFFICER_ID"/> |
|||
<result property="roleCode" column="ROLE_CODE"/> |
|||
<result property="content" column="CONTENT"/> |
|||
<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"/> |
|||
<result property="optionCount" column="OPTION_COUNT"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue