Merge branch 'zhaozhengjie1104' into test
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.util.ObjectUtils; |
| | |
| | | if (!ObjectUtils.isEmpty(data)) { |
| | | LoginUserInfoVO loginUserInfoVO = (LoginUserInfoVO)data; |
| | | R r1 = communityService.detailHouse(userId); |
| | | R r4=communityService.selectByIdCard(loginUserInfoVO.getIdCard()); |
| | | if (null != communityId && 0 != communityId) { |
| | | R r2 = communityService.detailCommunity(communityId); |
| | | if (R.isOk(r2)) { |
| | |
| | | r.setData(loginUserInfoVO); |
| | | } |
| | | } |
| | | if(R.isOk(r4)){ |
| | | String address= (String) r4.getData(); |
| | | if(StringUtils.isNotEmpty(address)){ |
| | | loginUserInfoVO.setAddress(address); |
| | | r.setData(loginUserInfoVO); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return r; |
| | |
| | | @ApiModelProperty("是否社区工作人员 1.是 2.否") |
| | | private Integer isCommunityWorker; |
| | | |
| | | @ApiModelProperty("实名认证地址") |
| | | private String address; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("隐患or安全记录(1.隐患 2.安全记录)") |
| | | private Integer dangerOrRecord; |
| | | |
| | | @ApiModelProperty("社区名字") |
| | | private String communityName; |
| | | |
| | | /** |
| | | * 巡查类型 |
| | | */ |
| | |
| | | R pagePopulation(ComMngPopulationDTO comMngPopulationVO); |
| | | |
| | | /** |
| | | * 根据身份证查询实有人口信息 |
| | | */ |
| | | @GetMapping("/common/data/population/selectByIdCard") |
| | | R selectByIdCard(@RequestParam("idCard") String idCard); |
| | | |
| | | /** |
| | | * 根据id实有人口详细信息 |
| | | * |
| | | * @param populationId |
| | |
| | | @ApiOperation(value = "分页查询巡查记录", response = ComSwPatrolRecordVO.class) |
| | | @PostMapping("/pagePatrolRecord") |
| | | public R pagePatrolRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | comSwPatrolRecordPageDTO.setCommunityId(communityId); |
| | | if(comSwPatrolRecordPageDTO.getCommunityId()==null){ |
| | | Long communityId = this.getCommunityId(); |
| | | comSwPatrolRecordPageDTO.setCommunityId(communityId); |
| | | } |
| | | return communityService.pagePatrolRecord(comSwPatrolRecordPageDTO); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "分页查询安全工作记录", response = ComSwSafetyWorkRecordVO.class) |
| | | @PostMapping("/pageSafetyWorkRecord") |
| | | public R pageSafetyWorkRecord(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | comSwPatrolRecordPageDTO.setCommunityId(communityId); |
| | | if(comSwPatrolRecordPageDTO.getCommunityId()==null){ |
| | | Long communityId = this.getCommunityId(); |
| | | comSwPatrolRecordPageDTO.setCommunityId(communityId); |
| | | } |
| | | return communityService.pageSafetyWorkRecord(comSwPatrolRecordPageDTO); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "分页查询隐患报告", response = ComSwDangerReportVO.class) |
| | | @PostMapping("/pageDangerReport") |
| | | public R pageDangerReport(@RequestBody ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | comSwPatrolRecordPageDTO.setCommunityId(communityId); |
| | | if(comSwPatrolRecordPageDTO.getCommunityId()==null){ |
| | | Long communityId = this.getCommunityId(); |
| | | comSwPatrolRecordPageDTO.setCommunityId(communityId); |
| | | } |
| | | return communityService.pageDangerReport(comSwPatrolRecordPageDTO); |
| | | } |
| | | |
| | |
| | | @PostMapping("/authRecord/add") |
| | | R addAuthRecord(@RequestBody ComElderAuthRecordVO comElderAuthRecordVO){ |
| | | comElderAuthRecordVO.setSubmitUserId(this.getUserId()); |
| | | comElderAuthRecordVO.setCommunityId(this.getCommunityId()); |
| | | return communityService.addAuthRecord(comElderAuthRecordVO); |
| | | } |
| | | /** |
| | |
| | | |
| | | import com.panzhihua.common.model.dtos.grid.AddComMngHousePopulationDTO; |
| | | import com.panzhihua.common.model.dtos.grid.DelComMngHousePopulationDTO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationDO; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据身份证查询实有人口信息 |
| | | */ |
| | | @GetMapping("/population/selectByIdCard") |
| | | public R selectByIdCard(@RequestParam("idCard") String idCard){ |
| | | ComMngPopulationDO comMngPopulationDO=comMngPopulationService.getPopulationByCardNo(idCard); |
| | | if(comMngPopulationDO!=null){ |
| | | return R.ok(comMngPopulationDO.getAddress()); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 社区后台导入实有人口 |
| | | * |
| | | * @param list |
| | |
| | | + "left join com_street as cs on cs.street_id = ca.street_id\n" + "where ca.community_id = #{communityId}") |
| | | ComPopulationActVO getPopulationActById(@Param("communityId") Long communityId); |
| | | |
| | | @Select("select `name`,street_id from com_street") |
| | | @Select("select `name`,street_id from com_street where area_code = '510423'") |
| | | List<StreetAllAppletsVO> getStreetList(); |
| | | |
| | | @Select("select ca.`name`,ca.street_id,ca.community_id,cs.`name` as streetName from com_act as ca left join com_street as cs on cs.street_id = ca.street_id where ca.state = 0 and ca.street_id = #{streetId}") |
| | | List<CommunitySwitchAllAppletsVO> getCommunityListByStreetId(@Param("streetId") Long streetId); |
| | | |
| | | @Select("select ca.`name`,ca.street_id,ca.community_id,cs.`name` as streetName from com_act as ca left join com_street as cs on cs.street_id = ca.street_id\n" |
| | | + " where ca.state = 0 and ca.name like concat('%',#{name},'%')") |
| | | @Select("select ca.`name`,ca.street_id,ca.community_id,cs.`name` as streetName " + |
| | | "from com_act as ca " + |
| | | "left join com_street as cs on cs.street_id = ca.street_id " + |
| | | "where ca.state = 0 and ca.name like '%%' and cs.area_code = '510423'") |
| | | List<CommunitySwitchAllAppletsVO> getCommunityListByName(@Param("name") String name); |
| | | |
| | | @Select("SELECT" + " c.community_id, " + " c.`name`, " + " c.street_id, " + " cs.`name` as streetName, " |
| | | + " round( ST_Distance_Sphere ( Point ( #{communityDTO.longitude}, #{communityDTO.latitude} ), Point ( c.lng, c.lat ) )/ 1000, 2 ) AS distance " |
| | | + "FROM " + " com_act c " + " left join com_street as cs on cs.street_id = c.street_id " |
| | | + " HAVING distance >= 0 and distance <= #{communityDTO.distance} " + "ORDER BY " + " distance ASC") |
| | | @Select("SELECT c.community_id, c.`name`, c.street_id, cs.`name` as streetName," + |
| | | "round( ST_Distance_Sphere ( Point ( #{communityDTO.longitude}, #{communityDTO.latitude} ), Point ( c.lng, c.lat ) )/ 1000, 2 ) AS distance " + |
| | | "FROM com_act c left join com_street as cs on cs.street_id = c.street_id " + |
| | | "where cs.area_code = '510423' " + |
| | | "HAVING distance >= 0 and distance <= #{communityDTO.distance} ORDER BY distance ASC") |
| | | List<CommunitySwitchAllAppletsVO> getCommunityListByNearby(@Param("communityDTO") SearchCommunityDTO communityDTO); |
| | | |
| | | @Select("select t.community_id,t.`name` from com_act t left join com_street t1 on t.street_id = t1.street_id where t.state = 0 and t1.street_id in (12,14,15,16,17,19)") |
| | |
| | | if(count==0){ |
| | | ComElderAuthRecordsDO comElderAuthRecordsDO=new ComElderAuthRecordsDO(); |
| | | BeanUtils.copyProperties(comElderAuthRecordVO,comElderAuthRecordsDO); |
| | | comElderAuthRecordsDO.setElderliesId(comElderAuthElderliesDO.getId()); |
| | | comElderAuthRecordsDO.setApprovalStatus(PASS_THROUGH.getStatus()); |
| | | comElderAuthRecordsDO.setApprovalDate(new Date()); |
| | | comElderAuthRecordsDO.setAuthStatus(CERTIFIED.getStatus()); |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ComSwDangerReportEditDTO; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.model.dos.ComSwSafetyWorkRecordDO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | |
| | | @Override |
| | | public R pageDangerReport(ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) { |
| | |
| | | comSwDangerReportVO.setCreateName(comSwPatrolRecordDAO.getCreateName(comSwDangerReportVO.getCreateBy())); |
| | | } |
| | | |
| | | // 所属社区名称 |
| | | comSwDangerReportVO.setCommunityName(comActDAO.selectById(comSwDangerReportVO.getCommunityId()).getName()); |
| | | |
| | | // 查询指派人名称 |
| | | if (StringUtils.isNotEmpty(comSwDangerReportVO.getAssignPerson())) { |
| | | StringBuilder sb = new StringBuilder(); |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ComSwPatrolRecordEditDTO; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComSwDangerReportDAO; |
| | | import com.panzhihua.service_community.dao.ComSwPatrolRecordDAO; |
| | | import com.panzhihua.service_community.dao.ComSwPatrolRecordReportDAO; |
| | | import com.panzhihua.service_community.dao.ComSwSafetyWorkRecordDAO; |
| | | import com.panzhihua.service_community.model.dos.ComSwDangerReportDO; |
| | | import com.panzhihua.service_community.model.dos.ComSwPatrolRecordDO; |
| | | import com.panzhihua.service_community.model.dos.ComSwPatrolRecordReportDO; |
| | |
| | | |
| | | @Resource |
| | | private ComSwPatrolRecordReportDAO comSwPatrolRecordReportDAO; |
| | | |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | |
| | | @Override |
| | | public R pagePatrolRecord(ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) { |
| | |
| | | if (comSwPatrolRecordVO.getCreateBy() != null) { |
| | | comSwPatrolRecordVO.setCreateName(comSwPatrolRecordDAO.getCreateName(comSwPatrolRecordVO.getCreateBy())); |
| | | } |
| | | // 所属社区名称 |
| | | comSwPatrolRecordVO.setCommunityName(comActDAO.selectById(comSwPatrolRecordVO.getCommunityId()).getName()); |
| | | |
| | | ComSwPatrolRecordReportDO recordReportDO = |
| | | comSwPatrolRecordReportDAO.selectOne(new QueryWrapper<ComSwPatrolRecordReportDO>().lambda() |
| | |
| | | </select> |
| | | |
| | | <select id="export" resultType="com.panzhihua.common.model.vos.community.ComActQuestnaireAnswerContentVO"> |
| | | SELECT |
| | | qs.type as optionType,ac.*,su.nick_name,carr.create_at as `time` |
| | | select ac.*,t.nick_name from ( SELECT |
| | | qs.type as optionType,ac.*,ac.create_at as `time` |
| | | FROM |
| | | com_act_reserve_record carr |
| | | LEFT JOIN com_act_reserve qn ON carr.reserve_id = qn.id |
| | | LEFT JOIN sys_user su ON carr.user_id = su.user_id |
| | | LEFT JOIN com_act_reserve_sub qs ON carr.reserve_id = qs.reserve_id |
| | | LEFT JOIN com_act_reserve_answer_content ac ON qs.id = ac.reserve_sub_id |
| | | WHERE |
| | |
| | | <if test="detailedAdminDTO.keyword!=null and detailedAdminDTO.keyword != """> |
| | | AND ac.answer_content like concat ('%',#{detailedAdminDTO.keyword},'%') |
| | | </if> |
| | | ) and ac.reserve_record_id in (select distinct reserve_record_id from com_act_reserve_answer_content where answer_content like concat('%',#{detailedAdminDTO.keyword},'%')) |
| | | GROUP BY ac.id |
| | | )and ac.reserve_record_id in (select distinct reserve_record_id from com_act_reserve_answer_content where answer_content like concat('%',#{detailedAdminDTO.keyword},'%') |
| | | <if test='detailedAdminDTO.startTime != null and detailedAdminDTO.startTime != ""'> |
| | | AND create_at <![CDATA[ >= ]]> #{detailedAdminDTO.startTime} |
| | | </if> |
| | | <if test='detailedAdminDTO.endTime != null and detailedAdminDTO.endTime != ""'> |
| | | AND create_at <![CDATA[ <= ]]> #{detailedAdminDTO.endTime} |
| | | </if> |
| | | <if test='detailedAdminDTO.beginTime != null and detailedAdminDTO.beginTime != ""'> |
| | | AND STR_TO_DATE(answer_content,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{detailedAdminDTO.beginTime} |
| | | </if> |
| | | <if test='detailedAdminDTO.stopTime != null and detailedAdminDTO.stopTime != ""'> |
| | | AND STR_TO_DATE(answer_content,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{detailedAdminDTO.stopTime} |
| | | </if> |
| | | ) |
| | | GROUP BY ac.id ) ac left join sys_user t on ac.user_id = t.user_id |
| | | order by ac.reserve_record_id asc,ac.id asc |
| | | </select> |
| | | </mapper> |
| | |
| | | csdr.street_suggestion AS streetSuggestion, |
| | | csdr.undertake_record AS undertakeRecord, |
| | | csdr.leader_suggestion AS leaderSuggestion, |
| | | csdr.assign_person AS assignPerson |
| | | csdr.assign_person AS assignPerson, |
| | | t.name as communityName |
| | | FROM |
| | | com_sw_danger_report as csdr |
| | | left join com_sw_patrol_record_report as csprr on csprr.report_id = csdr.id |
| | | left join com_sw_patrol_record as cspr on csprr.patrol_record_id = cspr.id |
| | | left join com_act t on csdr.community_id =t.community_id |
| | | <where> |
| | | <if test='comSwPatrolRecordDTO.communityId != null and comSwPatrolRecordDTO.communityId != ""'> |
| | | <if test='comSwPatrolRecordDTO.communityId != null and comSwPatrolRecordDTO.communityId != 0'> |
| | | AND cspr.community_id = #{comSwPatrolRecordDTO.communityId} |
| | | </if> |
| | | <if test='comSwPatrolRecordDTO.communityId == 0'> |
| | | AND t.street_id in (12,14,15,16,17,19) |
| | | </if> |
| | | <if test='comSwPatrolRecordDTO.patrolPerson != null and comSwPatrolRecordDTO.patrolPerson != ""'> |
| | | AND cspr.person_name LIKE concat('%',#{comSwPatrolRecordDTO.patrolPerson},'%') |
| | | </if> |
| | |
| | | cspr.succession_time AS successionTime, |
| | | cspr.create_at AS createAt, |
| | | cspr.create_by AS createBy, |
| | | csprr.report_id AS reportId |
| | | csprr.report_id AS reportId, |
| | | t.name as communityName |
| | | FROM |
| | | com_sw_patrol_record as cspr |
| | | left join com_sw_patrol_record_report as csprr on csprr.patrol_record_id = cspr.id |
| | | left join com_act t on cspr.community_id = t.community_id |
| | | <where> |
| | | <if test='comSwPatrolRecordDTO.communityId != null and comSwPatrolRecordDTO.communityId != ""'> |
| | | <if test='comSwPatrolRecordDTO.communityId != null and comSwPatrolRecordDTO.communityId != 0'> |
| | | AND cspr.community_id = #{comSwPatrolRecordDTO.communityId} |
| | | </if> |
| | | <if test='comSwPatrolRecordDTO.communityId == 0'> |
| | | AND t.street_id in (12,14,15,16,17,19) |
| | | </if> |
| | | <if test='comSwPatrolRecordDTO.patrolPerson != null and comSwPatrolRecordDTO.patrolPerson != ""'> |
| | | AND cspr.person_name LIKE concat('%',#{comSwPatrolRecordDTO.patrolPerson},'%') |
| | | </if> |
| | |
| | | cspr.record_photo AS recordPhoto, |
| | | csswr.remark, |
| | | cspr.create_at AS createAt, |
| | | cspr.create_by AS createBy |
| | | cspr.create_by AS createBy, |
| | | t.name as communityName |
| | | FROM |
| | | com_sw_safety_work_record as csswr |
| | | left join com_sw_patrol_record_report as csprr on csprr.report_id = csswr.id |
| | | left join com_sw_patrol_record as cspr on csprr.patrol_record_id = cspr.id |
| | | left join com_act t on cspr.community_id = t.community_id |
| | | <where> |
| | | <if test='comSwPatrolRecordDTO.communityId != null and comSwPatrolRecordDTO.communityId != ""'> |
| | | <if test='comSwPatrolRecordDTO.communityId != null and comSwPatrolRecordDTO.communityId != 0'> |
| | | AND cspr.community_id = #{comSwPatrolRecordDTO.communityId} |
| | | </if> |
| | | <if test='comSwPatrolRecordDTO.communityId == 0'> |
| | | AND t.street_id in (12,14,15,16,17,19) |
| | | </if> |
| | | <if test='comSwPatrolRecordDTO.patrolPerson != null and comSwPatrolRecordDTO.patrolPerson != ""'> |
| | | AND cspr.person_name LIKE concat('%',#{comSwPatrolRecordDTO.patrolPerson},'%') |
| | | </if> |