Commit fe0b8c47 by 梅存智

问卷调查优化

parent 64b2208d
......@@ -107,6 +107,8 @@ public class TrainingProjectController {
}
}
}
/*//2024-11-28注释,不需要调用课程服务
List<Long> trProectIds = new ArrayList<>();
if (!CollectionUtils.isEmpty(listVos)) {
for (TrainingProjectListVo tr : listVos) {
......@@ -125,7 +127,7 @@ public class TrainingProjectController {
}
}
}
}
}*/
return Response.ok(resultPage);
} catch (Exception e) {
LOGGER.error("", e);
......
......@@ -2,7 +2,7 @@ package com.yizhi.application.protal.constant;
public enum BannerNameEnum {
MARKET("营销"), TRAIN("项目"), HOMEPAGE("首页"), COURSE("课程"), NEWS("新闻资讯"),ALBUM("专辑"),TRAIN_EXAM("培训测验");
MARKET("营销"), TRAIN("项目"), HOMEPAGE("首页"), COURSE("课程"), NEWS("新闻资讯"),ALBUM("专辑"),TRAIN_EXAM("培训测验"),RESEARCH("问卷调查");
private String key;
......
......@@ -7,6 +7,8 @@ import com.yizhi.application.protal.constant.BannerNameEnum;
import com.yizhi.application.protal.constant.TerminalEnum;
import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext;
import com.yizhi.research.application.feign.ResearchClient;
import com.yizhi.research.application.vo.domain.ResearchVo;
import com.yizhi.site.application.feign.BannerManageFeignClients;
import com.yizhi.site.application.vo.site.AllHomeBannerImageVO;
import com.yizhi.site.application.vo.site.ImageListVO;
......@@ -43,13 +45,16 @@ public class BannerApiController {
@Autowired
TrainingProjectClient trainingProjectClient;
@Autowired
ResearchClient researchClient;
/**
* 所有首页 轮播图
*/
@ApiOperation(value = "轮播学员端管理", notes = "轮播学员端管理", response = ImageListVO.class)
@PostMapping(value="/home/image/list")
@ApiImplicitParams({
@ApiImplicitParam(name="bannerName" , value="轮播图所属栏目, MARKET:营销, TRAIN:培训, HOMEPAGE:首页, COURSE:课程, NEWS:新闻资讯,ALBUM:专辑;TRAIN_EXAM:培训测验", dataType="Long"),
@ApiImplicitParam(name="bannerName" , value="轮播图所属栏目, MARKET:营销, TRAIN:培训, HOMEPAGE:首页, COURSE:课程, NEWS:新闻资讯,ALBUM:专辑;TRAIN_EXAM:培训测验;RESEARCH:问卷调查", dataType="Long"),
@ApiImplicitParam(name="terminalName" , value="终端名称, PC端:PC; APP: MOBILE; 微信: WECHAT", dataType="Long")
})
public Response<List<ImageListVO>> listAllHomeBannerImage(@RequestBody AllHomeBannerImageVO vo){
......@@ -90,6 +95,20 @@ public class BannerApiController {
result.add(img);
}
}
} else if(vo != null && BannerNameEnum.RESEARCH.getKey().equals(vo.getBannerName())){
List<ResearchVo> list = researchClient.getResearchTop(1);
if (!CollectionUtils.isEmpty(list)) {
result = new ArrayList<ImageListVO>(1);
for(ResearchVo item : list){
ImageListVO img = new ImageListVO();
img.setImgTitle(item.getName());
img.setId(item.getId());
img.setBannerPath(item.getLogoImg());
img.setCreateByName(item.getCreateByName());
img.setCreateTime(item.getCreateTime());
result.add(img);
}
}
} else {
result = bannerManageFeignClients.listAllHomeBannerImage(vo);
}
......
......@@ -39,8 +39,8 @@ public class ResearchController {
@GetMapping("/page/list")
@ApiOperation(value = "分页查询学员能看到的调研", notes = "分两种状态", response = ResearchVo.class)
public Response<ResearchVo> listPage(
@ApiParam(name = "state", value = "状态:1已完成,2进行中", required = true) @RequestParam("state") Integer state,
@ApiParam(name = "state", value = "状态:1已完成,2进行中", required = false) @RequestParam(name = "state", required = false) Integer state,
@ApiParam(name = "bizType", value = "业务类型:1调研(问卷、投票);2考试测验,默认1", required = true) @RequestParam(name = "bizType", defaultValue = "1") Integer bizType,
@ApiParam(name = "pageNo", value = "跳转页数,默认第一页", required = true) @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@ApiParam(name = "pageSize", value = "每页条数,默认20条", required = true) @RequestParam(name = "pageSize", defaultValue = "20") Integer pageSize
) {
......@@ -53,6 +53,7 @@ public class ResearchController {
pageVo.setPageNo(pageNo);
pageVo.setPageSize(pageSize);
pageVo.setState(state);
pageVo.setBizType(bizType);
com.yizhi.research.application.vo.BaseModel<PageVo> model = new BaseModel<>();
model.setDate(new Date());
model.setObj(pageVo);
......
......@@ -215,16 +215,19 @@ public class SystemController {
//我的消息
Integer sum = null;
try {
// sum = messageClient.unreadCount(ContextHolder.get().getAccountId());
/*//2024-11-2需求不需要统计数据,先注释
sum = messageClient.unreadCount(ContextHolder.get().getAccountId());*/
} catch (Exception e) {
e.printStackTrace();
}
MyItemVO xx = new MyItemVO(ItemCode.XX.getCode(), ItemCode.XX.getName(), sum == null ? 0 : sum);
/*MyItemVO xx = new MyItemVO(ItemCode.XX.getCode(), ItemCode.XX.getName(), sum == null ? 0 : sum);
if (!data2.contains(xx)) {
data2.add(xx);
}
}*/
//课程收藏
Integer courseCount = 0;
/*//2024-11-2需求不需要统计数据,先注释
try {
courseCount = courseClient.getMyFavoriteCount(context.getAccountId(), context.getCompanyId(), context.getSiteId());
Integer courseCount1 = studentCaseClient.getFavoritesCount(context.getCompanyId(), context.getSiteId(), context.getAccountId());
......@@ -235,7 +238,7 @@ public class SystemController {
}
} catch (Exception e) {
LOG.info("异常信息={}", e);
}
}*/
MyItemVO kcsc = new MyItemVO(ItemCode.KCSC.getCode(), ItemCode.KCSC.getName(), courseCount == null ? 0 : courseCount);
data1.put(ItemCode.KCSC.getCode(), kcsc);
}
......@@ -248,6 +251,8 @@ public class SystemController {
private void getApiData(List<MyItemConfigVO> voList, RequestContext context, List<MyItemVO> data2) {
for (MyItemConfigVO vo : voList) {
MyItemVO item = new MyItemVO();
/*//2024-11-2需求不需要统计数据,先注释
switch (vo.getItemType()) {
case 1://我的培训
BaseModel<TrainingProjectParamVo> model = new BaseModel<>();
......@@ -426,10 +431,11 @@ public class SystemController {
break;
default:
break;
}
}*/
item.setCode(vo.getWeixinCode());
item.setName(vo.getName());
item.setSortNo(vo.getSort());
item.setLogoImg(vo.getLogoImg());
data2.add(item);
LOG.info("---栏目名:" + item.getName() + "---统计数据:" + item.getQuantity());
}
......
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