springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WorkGuideApi.java
@@ -36,12 +36,11 @@ @ApiOperation(value = "办事指南_详情", response = ComActWorkGuideVO.class) @GetMapping("detailworkguide") public R detailWorkGuide(@RequestParam("workGuideId") Long workGuideId, @RequestParam(value = "conmunityId", required = false) Long communityId) { Long conmunityId = communityId; @RequestParam(value = "communityId", required = false) Long communityId) { LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin(); if (loginUserInfo != null) { conmunityId = loginUserInfo.getCommunityId(); communityId = loginUserInfo.getCommunityId(); } return communityService.detailWorkGuide(workGuideId, conmunityId); return communityService.detailWorkGuide(workGuideId, communityId); } } springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/WorkGuideApi.java
@@ -44,8 +44,8 @@ @ApiOperation(value = "办事指南_详情", response = ComActWorkGuideVO.class) @GetMapping("detailworkguide") public R detailWorkGuide(@RequestParam("workGuideId") Long workGuideId) { Long conmunityId = this.getLoginUserInfo().getCommunityId(); return communityService.detailWorkGuide(workGuideId, conmunityId); Long communityId = this.getLoginUserInfo().getCommunityId(); return communityService.detailWorkGuide(workGuideId, communityId); } @ApiOperation(value = "办事指南_分页", response = ComActWorkGuideVO.class) springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/QuestnaireAnswersDTO.java
@@ -5,6 +5,7 @@ import com.panzhihua.common.model.vos.community.ComActQuestnaireAnswerContentVO; import com.panzhihua.common.model.vos.community.ComActQuestnaireSubVO; import com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedVO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -21,4 +22,7 @@ @ApiModelProperty("题目用户回答列表") private List<ComActQuestnaireAnswerContentVO> answers; @ApiModelProperty("用户填报记录") private ComActReserveRegisterDetailedVO recordListVO; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActQuestnaireAnswerContentVO.java
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -28,4 +29,7 @@ private Integer type; @ApiModelProperty("题目选项ID") private Long selectionId; @ApiModelProperty("答题记录id") private Long reserveRecordId; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActReserveCommitVO.java
@@ -27,4 +27,6 @@ private Date reserveTime; @ApiModelProperty("姓名") private String name; @ApiModelProperty("预约内容") private String content; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -2942,7 +2942,7 @@ * @return 详情 */ @GetMapping("/detailworkguide") R detailWorkGuide(@RequestParam("workGuideId") Long workGuideId, @RequestParam("conmunityId") Long conmunityId); R detailWorkGuide(@RequestParam("workGuideId") Long workGuideId, @RequestParam("communityId") Long communityId); /** * 办事指南_分页 springcloud_k8s_panzhihuazhihuishequ/community_backstage/pom.xml
@@ -68,6 +68,16 @@ <artifactId>minio</artifactId> <version>6.0.8</version> </dependency> <!-- <dependency>--> <!-- <groupId>org.jxls</groupId>--> <!-- <artifactId>jxls</artifactId>--> <!-- <version>2.6.0</version>--> <!-- </dependency>--> <!-- <dependency>--> <!-- <groupId>org.jxls</groupId>--> <!-- <artifactId>jxls-poi</artifactId>--> <!-- <version>1.1.0</version>--> <!-- </dependency>--> </dependencies> <build> springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActReserveApi.java
@@ -22,6 +22,7 @@ import com.panzhihua.common.model.vos.community.reserve.*; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.service.user.UserService; import com.panzhihua.common.utlis.DateUtils; import com.panzhihua.common.utlis.SFTPUtil; import com.panzhihua.community_backstage.config.SFTPConfig; import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; @@ -497,68 +498,28 @@ headList.add(headn); }); List<List<Object>> datalist = new ArrayList<>(); List<ComActQuestnaireAnswerContentVO> answerContentVOList = questnaireAnswersDTOS.getAnswers(); if(answerContentVOList!=null && answerContentVOList.size()>0) { Map<LoginUserInfoVO, LinkedHashMap<Long, List<ComActQuestnaireAnswerContentVO>>> answersMap = new HashMap<>(); List<Object> userData = new ArrayList<>(); List<ComActQuestnaireAnswerContentVO> usersAnswers = questnaireAnswersDTOS.getAnswers(); usersAnswers.forEach(userAnswers -> { R<LoginUserInfoVO> loginUserInfoVOR = userService.getUserInfoByUserId(userAnswers.getUserId().toString()); if (R.isOk(loginUserInfoVOR)) { LoginUserInfoVO loginUserInfoVO = loginUserInfoVOR.getData(); LinkedHashMap<Long, List<ComActQuestnaireAnswerContentVO>> theUserList = answersMap.get(loginUserInfoVO); if (theUserList == null) { theUserList = new LinkedHashMap<>(); answersMap.put(loginUserInfoVO, theUserList); } /** * 按题分类题目答案 */ Long subId = userAnswers.getSubId(); List<ComActQuestnaireAnswerContentVO> answerContentVOList1 = theUserList.get(subId); if(answerContentVOList1==null){ answerContentVOList1 = new ArrayList<>(); theUserList.put(subId, answerContentVOList1); } answerContentVOList1.add(userAnswers); //查询用户回答的所有答案,并新增到答案列表中 ComActReserveRegisterDetailedVO recordListVO = questnaireAnswersDTOS.getRecordListVO(); userData.add(recordListVO.getNickName()); userData.add(DateUtils.format(recordListVO.getCreateAt(),DateUtils.ymdhms_format)); Long reserveRecordId = null; for (ComActQuestnaireAnswerContentVO userAnswers:usersAnswers) { if(reserveRecordId == null){ reserveRecordId = userAnswers.getReserveRecordId(); } }); /** * 构造导出数据 */ answersMap.forEach((user, answers) ->{ List<Object> userData = new ArrayList<>(); userData.add(user.getName()); //获取提交时间 Set<Long> keySet = answers.keySet(); String dateStr = ""; if(keySet!=null && keySet.size()>0){ try { ComActQuestnaireAnswerContentVO firstvo = answers.get(keySet.toArray()[0]).get(0); if (firstvo != null) { Date time = firstvo.getCreateAt(); if(time!=null) { String sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(time); dateStr = sd; } } }catch (Exception e){ dateStr = ""; } if(!reserveRecordId.equals(userAnswers.getReserveRecordId())){ datalist.add(userData); userData = new ArrayList<>(); userData.add(recordListVO.getNickName()); userData.add(DateUtils.format(recordListVO.getCreateAt(),DateUtils.ymdhms_format)); reserveRecordId = userAnswers.getReserveRecordId(); } userData.add(dateStr); answers.forEach((id, answer )->{ StringBuilder usersAnswerContent = new StringBuilder(""); answer.forEach(ans ->{ String context = (ans.getChoice()!=null?(ans.getChoice()+ "."):"") + ans.getAnswerContent(); usersAnswerContent.append(context +"\n"); }); userData.add(usersAnswerContent.toString()); }); datalist.add(userData); }); userData.add(userAnswers.getAnswerContent()); } } WriteCellStyle headWriteCellStyle = new WriteCellStyle(); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/WorkGuideApi.java
@@ -57,8 +57,8 @@ */ @GetMapping("detailworkguide") public R detailWorkGuide(@RequestParam("workGuideId") Long workGuideId, @RequestParam("conmunityId") Long conmunityId) { return workGuideService.detailWorkGuide(workGuideId, conmunityId); @RequestParam("communityId") Long communityId) { return workGuideService.detailWorkGuide(workGuideId, communityId); } /** springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActReserveAnswerContentMapper.java
@@ -42,4 +42,6 @@ */ List<ComActReserveRegisterDetailedAnswerVO> getRegisterDetailedAnswerList(@Param("reserveRecordId")Long reserveRecordId); ComActReserveRegisterDetailedVO getRegisterDetailedById(@Param("reserveRecordId") Long reserveRecordId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActReserveMapper.java
@@ -81,5 +81,10 @@ */ List<ComActReserveListAdminVO> listReserveAdmin(@Param("communityId") Long communityId); /** * 取消预约时,预约登记参加人数减少 * @param reserveId 预约登记id */ void addReserveCountById(@Param("reserveId") Long reserveId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveAnswerContentServiceImpl.java
@@ -9,6 +9,7 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActQuestnaireAnswerContentVO; import com.panzhihua.common.model.vos.community.ComActQuestnaireSubVO; import com.panzhihua.common.model.vos.community.reserve.ComActReserveRecordListVO; import com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedAnswerVO; import com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedVO; import com.panzhihua.common.utlis.DateUtils; @@ -58,15 +59,23 @@ }); result.setSubs(listSubVo); Long reserveRecordId = null; //查询用户回答 List<ComActReserveAnswerContentDO> questnaireAnswerContentDOList = this.baseMapper.selectListByReserve(reserveId); List<ComActQuestnaireAnswerContentVO> vos = new ArrayList<>(); questnaireAnswerContentDOList.forEach(dos -> { for (ComActReserveAnswerContentDO dos:questnaireAnswerContentDOList) { ComActQuestnaireAnswerContentVO vo = new ComActQuestnaireAnswerContentVO(); BeanUtils.copyProperties(dos, vo); reserveRecordId = dos.getReserveRecordId(); vos.add(vo); }); } result.setAnswers(vos); //查询用户提交信息 ComActReserveRegisterDetailedVO recordListVO = this.baseMapper.getRegisterDetailedById(reserveRecordId); if(recordListVO != null){ result.setRecordListVO(recordListVO); } return R.ok(result); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveRecordServiceImpl.java
@@ -8,12 +8,10 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.reserve.*; import com.panzhihua.common.utlis.DateUtils; import com.panzhihua.service_community.dao.ComActReserveAnswerContentMapper; import com.panzhihua.service_community.dao.ComActReserveOperationRecordMapper; import com.panzhihua.service_community.dao.*; import com.panzhihua.common.model.dtos.community.CancelRecordDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.service_community.dao.ComActReserveOperationRecordMapper; import com.panzhihua.service_community.dao.ComActReserveRecordMapper; import com.panzhihua.service_community.model.dos.ComActReserveOperationRecordDO; import com.panzhihua.service_community.model.dos.ComActReserveRecordDO; import com.panzhihua.service_community.service.ComActReserveOperationRecordService; @@ -42,6 +40,8 @@ public class ComActReserveRecordServiceImpl extends ServiceImpl<ComActReserveRecordMapper, ComActReserveRecordDO> implements ComActReserveRecordService { @Resource private ComActReserveRecordMapper comActReserveRecordMapper; @Resource private ComActReserveMapper comActReserveMapper; @Resource private ComActReserveAnswerContentMapper comActReserveAnswerContentMapper; @Resource @@ -120,13 +120,15 @@ public R makeCancelAdmin(CancelReserveRecordDTO reserveRecordDTO){ Integer count = this.baseMapper.getReserveStatusById(reserveRecordDTO.getIds()); if(count > 0){ return R.ok("您选择的记录中存在未预约成功,不可进行批量取消"); return R.fail("仅预约成功的可以进行取消操作"); } if(this.baseMapper.editReserveStatusById(reserveRecordDTO.getIds()) > 0){ Long userId = reserveRecordDTO.getUserId(); reserveRecordDTO.getIds().forEach(id -> { ComActReserveRecordDO reserveRecordDO = comActReserveRecordMapper.selectById(id); if(reserveRecordDO != null){ //取消预约返还可参加名额 comActReserveMapper.addReserveCountById(reserveRecordDO.getReserveId()); //添加操作记录 comActReserveOperationRecordService.addReserveOperationRecord(reserveRecordDO.getReserveId() ,reserveRecordDO.getId(),reserveRecordDO.getUserId(),ComActReserveOperationRecordDO.type.sq,null springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActReserveServiceImpl.java
@@ -175,6 +175,7 @@ comActReserveMapper.updateById(comActReserveDO); //新增用户答题记录 ComActReserveRecordDO userAnswerDO = new ComActReserveRecordDO(); userAnswerDO.setContent(comActReserveCommitVO.getContent()); userAnswerDO.setName(comActReserveCommitVO.getName()); userAnswerDO.setCommunityId(comActReserveCommitVO.getCommunityId()); userAnswerDO.setPhone(comActReserveCommitVO.getPhone()); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java
@@ -102,6 +102,10 @@ // } BeanUtils.copyProperties(comActVO, comActDO); // ComActDO selectOne = comActDAO.selectOne(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getAccount, account)); // if (null != selectOne && selectOne.getAccount().equals(comActVO.getAccount())) { // return R.fail("该登录账号重复,请重新修改"); // } int update = comActDAO.updateById(comActDO); if (update > 0) { if (a == 1) { springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActWorkGuideServiceImpl.java
@@ -104,14 +104,14 @@ } @Override public R detailWorkGuide(Long workGuideId, Long conmunityId) { public R detailWorkGuide(Long workGuideId, Long communityId) { ComActWorkGuideDO workGuideDO = this.baseMapper.selectById(workGuideId); if (workGuideDO == null) { return R.fail("Id有误!"); } ComActWorkGuideVO vo = new ComActWorkGuideVO(); BeanUtils.copyProperties(workGuideDO, vo); ComActDO comActDO = comActDAO.selectById(conmunityId); ComActDO comActDO = comActDAO.selectById(communityId); if (comActDO != null) { vo.setAddress(comActDO.getAddress()); vo.setPhone(comActDO.getContactsPhone()); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -550,7 +550,7 @@ try { // 查询社区信息 log.info("开始查询社区信息数据"); ComPopulationActVO populationActVO = comActDAO.getPopulationActById(31L); ComPopulationActVO populationActVO = comActDAO.getPopulationActById(communityId); if (populationActVO == null) { log.error("未查询到社区信息"); return R.fail("未查询到社区信息"); @@ -560,7 +560,7 @@ // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", 31)); .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId)); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); @@ -632,7 +632,7 @@ log.info("开始查询小区街路巷是否存在"); // 查询小区街路巷是否存在 ComMngVillageDO comMngVillageDO = null; String villageKey = 31 + vo.getRoad() + vo.getDoorNo(); String villageKey = communityId + vo.getRoad() + vo.getDoorNo(); if (!isOnly(villageKey, villageMap)) { comMngVillageDO = (ComMngVillageDO)villageMap.get(villageKey); } else { springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActReserveAnswerContentMapper.xml
@@ -32,9 +32,6 @@ LEFT JOIN com_act_reserve qn ON qs.reserve_id = qn.id WHERE qn.id = #{reserveId} ORDER BY ac.user_id, qs.id </select> <select id="pageRegisterDetailedListAdmin" parameterType="com.panzhihua.common.model.dtos.community.reserve.PageReserveRegisterDetailedAdminDTO" @@ -65,4 +62,15 @@ where carac.reserve_record_id = #{reserveRecordId} order by carac.id asc </select> <select id="getRegisterDetailedById" resultType="com.panzhihua.common.model.vos.community.reserve.ComActReserveRegisterDetailedVO"> SELECT carr.id, su.nick_name, carr.create_at FROM com_act_reserve_record AS carr LEFT JOIN sys_user AS su ON su.user_id = carr.user_id where carr.id = #{reserveRecordId} </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActReserveMapper.xml
@@ -179,4 +179,8 @@ com_act_reserve where is_del = 2 and `type` = 1 and community_id = #{communityId} </select> <update id="addReserveCountById"> update com_act_reserve set join_count = join_count - 1 where id = #{reserveId} </update> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActReserveRecordMapper.xml
@@ -87,7 +87,7 @@ </select> <select id="getReserveStatusById" resultType="integer"> select count(id) from com_act_reserve_record where `status` != 2 and id in select count(id) from com_act_reserve_record where `status` in (3,4) and id in <foreach collection='ids' item='id' index='index' open='(' close=')' separator=',' > #{id} </foreach>