Commit c90df895 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 2e67a0e7 dc3696a8
...@@ -367,9 +367,9 @@ export default { ...@@ -367,9 +367,9 @@ export default {
width: 100, width: 100,
formatter: (row) => { formatter: (row) => {
if (row.check) { if (row.check) {
return <span>不选择</span>; return <span style="cursor:pointer;color:#ff0000">不选择</span>;
} else { } else {
return <span style="cursor:pointer">选择</span>; return <span style="cursor:pointer;color:#1890ff">选择</span>;
} }
}, },
}, },
......
...@@ -407,9 +407,9 @@ export default { ...@@ -407,9 +407,9 @@ export default {
width: 100, width: 100,
formatter: (row) => { formatter: (row) => {
if (row.check) { if (row.check) {
return <span>不选择</span>; return <span style="cursor:pointer;color:#ff0000">不选择</span>;
} else { } else {
return <span style="cursor:pointer">选择</span>; return <span style="cursor:pointer;color:#1890ff">选择</span>;
} }
}, },
}, },
......
...@@ -193,9 +193,9 @@ export default { ...@@ -193,9 +193,9 @@ export default {
width: 100, width: 100,
formatter: (row) => { formatter: (row) => {
if (row.check) { if (row.check) {
return <span>不选择</span>; return <span style="cursor:pointer;color:#ff0000">不选择</span>;
} else { } else {
return <span style="cursor:pointer">选择</span>; return <span style="cursor:pointer;color:#1890ff">选择</span>;
} }
}, },
}, },
......
...@@ -13,6 +13,8 @@ import com.mortals.framework.exception.AppException; ...@@ -13,6 +13,8 @@ import com.mortals.framework.exception.AppException;
import com.mortals.xhx.busiz.dingtalk.config.TalkConfiguration; import com.mortals.xhx.busiz.dingtalk.config.TalkConfiguration;
import com.mortals.xhx.busiz.dingtalk.req.DingTalkBaseReq; import com.mortals.xhx.busiz.dingtalk.req.DingTalkBaseReq;
import com.mortals.xhx.busiz.dingtalk.req.UserPageReq; import com.mortals.xhx.busiz.dingtalk.req.UserPageReq;
import com.mortals.xhx.busiz.req.CodeReq;
import com.mortals.xhx.busiz.req.LinkMessageReq;
import com.mortals.xhx.busiz.req.MobileReq; import com.mortals.xhx.busiz.req.MobileReq;
import com.mortals.xhx.busiz.req.ReviewSaveReq; import com.mortals.xhx.busiz.req.ReviewSaveReq;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
...@@ -131,9 +133,9 @@ public class TalkApiController { ...@@ -131,9 +133,9 @@ public class TalkApiController {
if(dingToken == null){ if(dingToken == null){
dingToken = getToken().getData(); dingToken = getToken().getData();
} }
req.setDeptId(res.getDeptid()); req.setDeptId(res.getDeptid()); //部门id
req.setCursor(res.getCursor()); req.setCursor(res.getCursor()); //起始页游标
req.setSize(res.getSize()); req.setSize(res.getSize()); //分页条数
OapiV2UserListResponse rsp = client.execute(req, dingToken); OapiV2UserListResponse rsp = client.execute(req, dingToken);
if(rsp.getErrcode() == 0){ if(rsp.getErrcode() == 0){
apiRespPdu.setCode(0); apiRespPdu.setCode(0);
...@@ -173,11 +175,12 @@ public class TalkApiController { ...@@ -173,11 +175,12 @@ public class TalkApiController {
if(dingToken == null){ if(dingToken == null){
dingToken = getToken().getData(); dingToken = getToken().getData();
} }
req.setMobile(mobile.getMobile()); req.setMobile(mobile.getMobile()); //用户手机号
//先根据手机号去获取userid 再通过userid获取详情 钉钉没有直接根据电话获取用户详情的接口
OapiV2UserGetbymobileResponse rsp = client.execute(req, dingToken); OapiV2UserGetbymobileResponse rsp = client.execute(req, dingToken);
if(rsp.getErrcode() == 0){ if(rsp.getErrcode() == 0){
//根据获取到的userid去获取用户详情 //根据获取到的userid去获取用户详情
ApiRespPdu<OapiV2UserGetResponse.UserGetResponse> userRsp = getUserInfo(rsp.getResult().getUserid()); ApiRespPdu<OapiV2UserGetResponse.UserGetResponse> userRsp = getUserInfoByUserId(rsp.getResult().getUserid());
if(userRsp.getCode() == 0){ if(userRsp.getCode() == 0){
apiRespPdu.setCode(userRsp.getCode()); apiRespPdu.setCode(userRsp.getCode());
apiRespPdu.setData(userRsp.getData()); apiRespPdu.setData(userRsp.getData());
...@@ -211,17 +214,17 @@ public class TalkApiController { ...@@ -211,17 +214,17 @@ public class TalkApiController {
* 根据userid查询用户详情 * 根据userid查询用户详情
* @return * @return
*/ */
@GetMapping("/dingtalk/getUserInfo") @GetMapping("/dingtalk/getUserInfoByUserId")
@UnAuth @UnAuth
public ApiRespPdu<OapiV2UserGetResponse.UserGetResponse> getUserInfo(@RequestBody String userid){ public ApiRespPdu<OapiV2UserGetResponse.UserGetResponse> getUserInfoByUserId(@RequestBody String userid){
ApiRespPdu<OapiV2UserGetResponse.UserGetResponse> apiRespPdu = new ApiRespPdu<>(); ApiRespPdu<OapiV2UserGetResponse.UserGetResponse> apiRespPdu = new ApiRespPdu<>();
try { try {
DingTalkClient client = new DefaultDingTalkClient(talkConfiguration.getGetuserinfo()); DingTalkClient client = new DefaultDingTalkClient(talkConfiguration.getGetuserinfobyuserid());
OapiV2UserGetRequest req = new OapiV2UserGetRequest(); OapiV2UserGetRequest req = new OapiV2UserGetRequest();
if(dingToken == null){ if(dingToken == null){
dingToken = getToken().getData(); dingToken = getToken().getData();
} }
req.setUserid(userid); req.setUserid(userid); //用户id
OapiV2UserGetResponse rsp = client.execute(req, dingToken); OapiV2UserGetResponse rsp = client.execute(req, dingToken);
apiRespPdu.setCode(0); apiRespPdu.setCode(0);
...@@ -236,4 +239,85 @@ public class TalkApiController { ...@@ -236,4 +239,85 @@ public class TalkApiController {
return apiRespPdu; return apiRespPdu;
} }
/**
* 推送链接类钉钉工作消息
* @return
*/
@PostMapping("/dingtalk/sendLinkMessage")
@UnAuth
public ApiRespPdu<String> sendLinkMessage(@RequestBody LinkMessageReq linkMessageReq){
ApiRespPdu<String> apiRespPdu = new ApiRespPdu<>();
try {
DingTalkClient client = new DefaultDingTalkClient(talkConfiguration.getSendmessage());
if(dingToken == null){
dingToken = getToken().getData();
}
OapiMessageCorpconversationAsyncsendV2Request req = new OapiMessageCorpconversationAsyncsendV2Request();
req.setAgentId(Long.valueOf(talkConfiguration.getGetAgentId()));
req.setUseridList(linkMessageReq.getUserIdList());
OapiMessageCorpconversationAsyncsendV2Request.Msg obj1 = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
obj1.setMsgtype("link"); //type为链接类消息
OapiMessageCorpconversationAsyncsendV2Request.Link obj2 = new OapiMessageCorpconversationAsyncsendV2Request.Link();
obj2.setPicUrl(linkMessageReq.getPicUrl()); //消息图片地址
obj2.setMessageUrl(linkMessageReq.getMessageUrl()); //跳转链接地址
obj2.setText(linkMessageReq.getText()); //消息描述
obj2.setTitle(linkMessageReq.getTitle()); //消息title
obj1.setLink(obj2);
req.setMsg(obj1);
OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(req, dingToken);
if(rsp.getErrcode() == 0){
apiRespPdu.setCode(0);
apiRespPdu.setData(rsp.getBody());
apiRespPdu.setMsg(rsp.getMsg());
}else {
apiRespPdu.setCode(-1);
apiRespPdu.setData(rsp.getBody());
apiRespPdu.setMsg(rsp.getMsg());
}
} catch (Exception e) {
e.printStackTrace();
apiRespPdu.setCode(-1);
apiRespPdu.setData("");
apiRespPdu.setMsg(e.toString());
}
return apiRespPdu;
}
/**
* 根据免登码查询用户详情
* @return
*/
@GetMapping("/dingtalk/getUserInfoByCode")
@UnAuth
public ApiRespPdu<OapiV2UserGetuserinfoResponse.UserGetByCodeResponse> getUserInfoByCode(@RequestBody CodeReq codeReq){
ApiRespPdu<OapiV2UserGetuserinfoResponse.UserGetByCodeResponse> apiRespPdu = new ApiRespPdu<>();
try {
DingTalkClient client = new DefaultDingTalkClient(talkConfiguration.getGetuserinfobycode());
OapiV2UserGetuserinfoRequest req = new OapiV2UserGetuserinfoRequest();
if(dingToken == null){
dingToken = getToken().getData();
}
req.setCode(codeReq.getCode()); //前端js获取到的免登码 用免登码获取用户信息
OapiV2UserGetuserinfoResponse rsp = client.execute(req, dingToken);
apiRespPdu.setCode(0);
apiRespPdu.setData(rsp.getResult());
apiRespPdu.setMsg(rsp.getMsg());
} catch (Exception e) {
e.printStackTrace();
apiRespPdu.setCode(-1);
apiRespPdu.setData(null);
apiRespPdu.setMsg(e.toString());
}
return apiRespPdu;
}
} }
...@@ -58,8 +58,21 @@ public class TalkConfiguration { ...@@ -58,8 +58,21 @@ public class TalkConfiguration {
/** /**
* 根据userid查询用户信息 * 根据userid查询用户信息
*/ */
@Value("${dingtalk.getuserinfo:https://oapi.dingtalk.com/topapi/v2/user/get}") @Value("${dingtalk.getuserinfobyuserid:https://oapi.dingtalk.com/topapi/v2/user/get}")
private String getuserinfo; private String getuserinfobyuserid;
/**
* 根据免登码查询用户信息
*/
@Value("${dingtalk.getuserinfobycode:https://oapi.dingtalk.com/topapi/v2/user/getuserinfo}")
private String getuserinfobycode;
/**
* 推送钉钉工作消息
*/
@Value("${dingtalk.sendmessage:https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2}")
private String sendmessage;
/** /**
* getDeptbyUser * getDeptbyUser
*/ */
......
package com.mortals.xhx.busiz.req;
/**
* @author ZYW
* @date 2023-07-13 20:11
*/
public class CodeReq {
String code;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
package com.mortals.xhx.busiz.req;
/**
* @author ZYW
* @date 2023-07-13 19:30
* 连接类工作消息
*/
public class LinkMessageReq {
String userIdList; //接收者用户id列表 多个接收者用,隔开
String picUrl; //消息图片地址
String messageUrl; //链接地址
String title; //消息标题,建议100字符以内。
String text; //消息描述,建议500字符以内。
public String getUserIdList() {
return userIdList;
}
public void setUserIdList(String userIdList) {
this.userIdList = userIdList;
}
public String getPicUrl() {
return picUrl;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public String getMessageUrl() {
return messageUrl;
}
public void setMessageUrl(String messageUrl) {
this.messageUrl = messageUrl;
}
}
...@@ -23,21 +23,22 @@ public class TestController { ...@@ -23,21 +23,22 @@ public class TestController {
@Autowired @Autowired
private IdgeneratorService idgeneratorService; private IdgeneratorService idgeneratorService;
@GetMapping("webservice") // @GetMapping("webservice")@GetMapping("idGens")
// public String idGens() {
// log.info("测试id生成");
//
// String stringId = idgeneratorService.getLongId(IdgeneratorServiceImpl.IdGeneratorKey.EFFECT).toString();
//
//
// return stringId;
// }
public String webservice() { public String webservice() {
log.info("测试"); log.info("测试");
return "ok"; return "ok";
} }
@GetMapping("idGens") //
public String idGens() {
log.info("测试id生成");
String stringId = idgeneratorService.getLongId(IdgeneratorServiceImpl.IdGeneratorKey.EFFECT_KEY).toString();
return stringId;
}
......
...@@ -21,10 +21,10 @@ public interface FeedbackDao extends ICRUDDao<FeedbackEntity,Long>{ ...@@ -21,10 +21,10 @@ public interface FeedbackDao extends ICRUDDao<FeedbackEntity,Long>{
/*** /***
* 问卷反馈人员列表 * 问卷反馈人员列表
* @param feedbackId * @param query
* @return * @return
*/ */
List<FeedbackStaffInfoVo> getFeedbackStaffList(Long feedbackId); Result<FeedbackStaffInfoVo> getFeedbackStaffList(FeedbackEntity query,PageInfo pageInfo);
/** /**
* 问卷单选多选反馈统计 * 问卷单选多选反馈统计
......
...@@ -28,8 +28,29 @@ public class FeedbackDaoImpl extends BaseCRUDDaoMybatis<FeedbackEntity,Long> imp ...@@ -28,8 +28,29 @@ public class FeedbackDaoImpl extends BaseCRUDDaoMybatis<FeedbackEntity,Long> imp
@Override @Override
public List<FeedbackStaffInfoVo> getFeedbackStaffList(Long feedbackId) { public Result<FeedbackStaffInfoVo> getFeedbackStaffList(FeedbackEntity query,PageInfo pageInfo) {
return this.getSqlSession().selectList(this.getSqlId("getFeedbackStaffList"), feedbackId); String sqlId = "getFeedbackStaffList";
Result result = new Result();
List list = null;
int count = this.getFeedbackStaffListCount(query);
if (count == 0) {
list = new ArrayList();
} else if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId(sqlId), query);
} else {
if (pageInfo.getBeginIndex() > count) {
pageInfo.setCurrPage(1);
}
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId(sqlId), query, rowBounds);
}
pageInfo.setTotalResult(count);
result.setPageInfo(pageInfo);
result.setList((List)list);
return result;
} }
@Override @Override
...@@ -66,4 +87,8 @@ public class FeedbackDaoImpl extends BaseCRUDDaoMybatis<FeedbackEntity,Long> imp ...@@ -66,4 +87,8 @@ public class FeedbackDaoImpl extends BaseCRUDDaoMybatis<FeedbackEntity,Long> imp
private int getQuestionAnswerListCount(Long questionId) { private int getQuestionAnswerListCount(Long questionId) {
return (Integer)this.getSqlSession().selectOne(this.getSqlId("getQuestionAnswerListCount"), questionId); return (Integer)this.getSqlSession().selectOne(this.getSqlId("getQuestionAnswerListCount"), questionId);
} }
private int getFeedbackStaffListCount(FeedbackEntity query) {
return (Integer)this.getSqlSession().selectOne(this.getSqlId("getFeedbackStaffListCount"), query);
}
} }
...@@ -17,6 +17,10 @@ import java.util.Date; ...@@ -17,6 +17,10 @@ import java.util.Date;
public class FeedbackVo extends BaseEntityLong { public class FeedbackVo extends BaseEntityLong {
private List<Long> staffList; private List<Long> staffList;
/** 问题Id */
private Long questionId; private Long questionId;
/** 反馈Id */
private Long feedbackId;
/** 反馈状态 */
private Integer backStatus;
} }
\ No newline at end of file
...@@ -2,6 +2,8 @@ package com.mortals.xhx.module.feedback.model.vo; ...@@ -2,6 +2,8 @@ package com.mortals.xhx.module.feedback.model.vo;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* 问卷单选多选反馈统计视图 * 问卷单选多选反馈统计视图
*/ */
...@@ -36,4 +38,6 @@ public class OptionSummaryVo { ...@@ -36,4 +38,6 @@ public class OptionSummaryVo {
* 选项统计 * 选项统计
*/ */
private Integer optionCount; private Integer optionCount;
List<OptionSummaryVo> optionList;
} }
...@@ -25,10 +25,10 @@ public interface FeedbackService extends ICRUDService<FeedbackEntity,Long>{ ...@@ -25,10 +25,10 @@ public interface FeedbackService extends ICRUDService<FeedbackEntity,Long>{
/*** /***
* 问卷反馈人员列表 * 问卷反馈人员列表
* @param feedbackId * @param query
* @return * @return
*/ */
List<FeedbackStaffInfoVo> getFeedbackStaffList(Long feedbackId) throws AppException; Result<FeedbackStaffInfoVo> getFeedbackStaffList(FeedbackEntity query,PageInfo pageInfo) throws AppException;
/** /**
* 问卷单选多选反馈统计 * 问卷单选多选反馈统计
......
...@@ -35,8 +35,8 @@ public class FeedbackQuestionServiceImpl extends AbstractCRUDServiceImpl<Feedbac ...@@ -35,8 +35,8 @@ public class FeedbackQuestionServiceImpl extends AbstractCRUDServiceImpl<Feedbac
item.setQuestionId(entity.getId()); item.setQuestionId(entity.getId());
item.setCreateUserId(this.getContextUserId(context)); item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date()); item.setCreateTime(new Date());
feedbackOptionService.save(item);
}).count(); }).count();
feedbackOptionService.save(entity.getFeedbackOptionList());
} }
super.saveAfter(entity, context); super.saveAfter(entity, context);
} }
......
...@@ -52,7 +52,9 @@ public class FeedbackServiceImpl extends AbstractCRUDServiceImpl<FeedbackDao, Fe ...@@ -52,7 +52,9 @@ public class FeedbackServiceImpl extends AbstractCRUDServiceImpl<FeedbackDao, Fe
item.setCreateUserId(this.getContextUserId(context)); item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date()); item.setCreateTime(new Date());
}).count(); }).count();
feedbackQuestionService.save(entity.getFeedbackQuestionList()); for(FeedbackQuestionEntity questionEntity:entity.getFeedbackQuestionList()) {
feedbackQuestionService.save(questionEntity);
}
} }
if(!ObjectUtils.isEmpty(entity.getStaffList())){ if(!ObjectUtils.isEmpty(entity.getStaffList())){
List<FeedbackStaffEntity> staffEntityList = new ArrayList<>(); List<FeedbackStaffEntity> staffEntityList = new ArrayList<>();
...@@ -81,7 +83,9 @@ public class FeedbackServiceImpl extends AbstractCRUDServiceImpl<FeedbackDao, Fe ...@@ -81,7 +83,9 @@ public class FeedbackServiceImpl extends AbstractCRUDServiceImpl<FeedbackDao, Fe
item.setUpdateUserId(this.getContextUserId(context)); item.setUpdateUserId(this.getContextUserId(context));
item.setUpdateTime(new Date()); item.setUpdateTime(new Date());
}).count(); }).count();
feedbackQuestionService.save(entity.getFeedbackQuestionList()); for(FeedbackQuestionEntity questionEntity:entity.getFeedbackQuestionList()) {
feedbackQuestionService.save(questionEntity);
}
} }
if(!ObjectUtils.isEmpty(entity.getStaffList())){ if(!ObjectUtils.isEmpty(entity.getStaffList())){
Long[] feedbackStaffIds = feedbackStaffService.find(new FeedbackStaffQuery().feedbackId(entity.getId())).stream().map(FeedbackStaffEntity::getId).toArray(Long[]::new); Long[] feedbackStaffIds = feedbackStaffService.find(new FeedbackStaffQuery().feedbackId(entity.getId())).stream().map(FeedbackStaffEntity::getId).toArray(Long[]::new);
...@@ -110,11 +114,14 @@ public class FeedbackServiceImpl extends AbstractCRUDServiceImpl<FeedbackDao, Fe ...@@ -110,11 +114,14 @@ public class FeedbackServiceImpl extends AbstractCRUDServiceImpl<FeedbackDao, Fe
} }
@Override @Override
public List<FeedbackStaffInfoVo> getFeedbackStaffList(Long feedbackId) throws AppException { public Result<FeedbackStaffInfoVo> getFeedbackStaffList(FeedbackEntity query,PageInfo pageInfo) throws AppException {
if(feedbackId==null){ if(query.getFeedbackId()==null){
throw new AppException("绩效反馈记录Id不能为空"); throw new AppException("绩效反馈记录Id不能为空");
} }
return dao.getFeedbackStaffList(feedbackId); if(pageInfo==null){
pageInfo = new PageInfo();
}
return dao.getFeedbackStaffList(query,pageInfo);
} }
@Override @Override
......
...@@ -24,12 +24,10 @@ import com.mortals.xhx.module.feedback.model.FeedbackEntity; ...@@ -24,12 +24,10 @@ import com.mortals.xhx.module.feedback.model.FeedbackEntity;
import com.mortals.xhx.module.feedback.service.FeedbackService; import com.mortals.xhx.module.feedback.service.FeedbackService;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List; import java.util.*;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*; import static com.mortals.framework.ap.SysConstains.*;
...@@ -64,12 +62,12 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba ...@@ -64,12 +62,12 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
/** /**
* 查询问卷反馈人员列表 * 查询问卷反馈人员列表
* @param feedbackId * @param query
* @return * @return
*/ */
@RequestMapping(value = {"getStaffList"},method = {RequestMethod.POST, RequestMethod.GET}) @PostMapping({"getStaffList"})
@UnAuth @UnAuth
public Rest<Object> getFeedbackStaffList(Long feedbackId) { public Rest<Object> getFeedbackStaffList(@RequestBody FeedbackEntity query) {
Rest<Object> ret = new Rest(); Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap(); Map<String, Object> model = new HashMap();
Context context = this.getContext(); Context context = this.getContext();
...@@ -77,9 +75,10 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba ...@@ -77,9 +75,10 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
int code=1; int code=1;
try { try {
List<FeedbackStaffInfoVo> result = this.getService().getFeedbackStaffList(feedbackId); PageInfo pageInfo = this.buildPageInfo(query);
if(CollectionUtils.isNotEmpty(result)) { Result<FeedbackStaffInfoVo> result = this.getService().getFeedbackStaffList(query,pageInfo);
Map<Integer, List<FeedbackStaffInfoVo>> groupMap = result.stream().collect(Collectors.groupingBy(FeedbackStaffInfoVo::getBackStatus)); if(CollectionUtils.isNotEmpty(result.getList())) {
Map<Integer, List<FeedbackStaffInfoVo>> groupMap = result.getList().stream().collect(Collectors.groupingBy(FeedbackStaffInfoVo::getBackStatus));
if(groupMap.containsKey(1)) { if(groupMap.containsKey(1)) {
model.put("feedBack", groupMap.get(1).size()); model.put("feedBack", groupMap.get(1).size());
}else { }else {
...@@ -94,8 +93,9 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba ...@@ -94,8 +93,9 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
model.put("feedBack", 0); model.put("feedBack", 0);
model.put("notBack", 0); model.put("notBack", 0);
} }
model.put("data", result); model.put("data", result.getList());
model.put("message_info", busiDesc + "成功"); model.put("pageInfo", result.getPageInfo());
this.parsePageInfo(model, result.getPageInfo());
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) { if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】"); this.recordSysLog(this.request, busiDesc + " 【成功】");
} }
...@@ -127,7 +127,21 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba ...@@ -127,7 +127,21 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
int code=1; int code=1;
try { try {
List<OptionSummaryVo> result = this.getService().getOptionSummaryList(feedbackId); List<OptionSummaryVo> result = this.getService().getOptionSummaryList(feedbackId);
model.put("data", result); List<OptionSummaryVo> list = new ArrayList<>();
if(CollectionUtils.isNotEmpty(result)) {
Map<Long, List<OptionSummaryVo>> groupMap = result.stream().collect(Collectors.groupingBy(OptionSummaryVo::getQuestionId));
for (Long key : groupMap.keySet()) {
OptionSummaryVo vo = new OptionSummaryVo();
OptionSummaryVo temp = groupMap.get(key).get(0);
vo.setQuestionId(key);
vo.setQuestion(temp.getQuestion());
vo.setFeedbackId(temp.getFeedbackId());
vo.setQuestionType(temp.getQuestionType());
vo.setOptionList(groupMap.get(key));
list.add(vo);
}
}
model.put("data", list);
model.put("message_info", busiDesc + "成功"); model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) { if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】"); this.recordSysLog(this.request, busiDesc + " 【成功】");
...@@ -157,14 +171,13 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba ...@@ -157,14 +171,13 @@ public class FeedbackController extends BaseCRUDJsonBodyMappingController<Feedba
Context context = this.getContext(); Context context = this.getContext();
String busiDesc = "查询问卷问题反馈详情"; String busiDesc = "查询问卷问题反馈详情";
int code=1; int code = 1;
try { try {
PageInfo pageInfo = this.buildPageInfo(query); PageInfo pageInfo = this.buildPageInfo(query);
Result<QuestionAnswerVo> result = this.getService().getQuestionAnswerList(query.getQuestionId(), pageInfo); Result<QuestionAnswerVo> result = this.getService().getQuestionAnswerList(query.getQuestionId(), pageInfo);
model.put("data", result.getList()); model.put("data", result.getList());
model.put("pageInfo", result.getPageInfo()); model.put("pageInfo", result.getPageInfo());
this.parsePageInfo(model, result.getPageInfo()); this.parsePageInfo(model, result.getPageInfo());
code = this.doListAfter(query, (Map)model, context);
model.put("message_info", busiDesc + "成功"); model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) { if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】"); this.recordSysLog(this.request, busiDesc + " 【成功】");
......
...@@ -62,4 +62,7 @@ hik: ...@@ -62,4 +62,7 @@ hik:
protocol: @profiles.hik.protocol@ protocol: @profiles.hik.protocol@
appSecret: @profiles.hik.appSecret@ appSecret: @profiles.hik.appSecret@
dingtalk: dingtalk:
agentId: 123123 agentId: 2652674890
AppKey: dingpqzradgfr4efdi2j
AppSecret: bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
<mapper namespace="com.mortals.xhx.module.feedback.dao.ibatis.FeedbackDaoImpl"> <mapper namespace="com.mortals.xhx.module.feedback.dao.ibatis.FeedbackDaoImpl">
<!-- 问卷反馈人员列表 --> <!-- 问卷反馈人员列表 -->
<select id="getFeedbackStaffList" parameterType="long" resultType="com.mortals.xhx.module.feedback.model.vo.FeedbackStaffInfoVo"> <select id="getFeedbackStaffList" parameterType="com.mortals.xhx.module.feedback.model.FeedbackEntity" resultType="com.mortals.xhx.module.feedback.model.vo.FeedbackStaffInfoVo">
SELECT * FROM (
SELECT SELECT
s.feedbackId, s.feedbackId,
s.staffId, s.staffId,
...@@ -21,7 +22,38 @@ ...@@ -21,7 +22,38 @@
WHERE WHERE
s.feedbackId = #{feedbackId} s.feedbackId = #{feedbackId}
GROUP BY GROUP BY
s.staffId; s.staffId
) AS t WHERE 1=1
<if test="backStatus != null">
AND t.backStatus = #{backStatus}
</if>
</select>
<select id="getFeedbackStaffListCount" parameterType="com.mortals.xhx.module.feedback.model.FeedbackEntity" resultType="int">
select count(1) from (
SELECT * FROM (
SELECT
s.feedbackId,
s.staffId,
s1.`name`,
s1.deptId,
s1.deptName,
s1.positionName,
CASE IFNULL(a.id, 0) WHEN 0 THEN 0 ELSE 1 END AS backStatus,
MAX(a.createTime) AS backTime
FROM
mortals_xhx_feedback_staff s
LEFT JOIN mortals_xhx_feedback_answer a ON s.staffId = a.staffId AND s.feedbackId = a.feedbackId
LEFT JOIN mortals_xhx_staff s1 ON s.staffId = s1.id
WHERE
s.feedbackId = #{feedbackId}
GROUP BY
s.staffId
) AS t WHERE 1=1
<if test="backStatus != null">
AND t.backStatus = #{backStatus}
</if>
) as tt
</select> </select>
<!-- 问卷单选多选反馈统计 --> <!-- 问卷单选多选反馈统计 -->
......
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