Merge branch 'test' into 'master'
Test
See merge request root/zhihuishequ!112
| | |
| | | public R isShop(){ |
| | | return R.ok(Constants.IS_SHOP_OPEN); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取最新活动和用户最新收益",response =ComActEasyPhotoRewardVO.class ) |
| | | @PostMapping("getUserReward") |
| | | public R getUserReward(){ |
| | | return communityService.getUserReward(this.getUserId(),this.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "读取用户随手拍奖励") |
| | | @PostMapping("readUserReward") |
| | | public R readUserReward(){ |
| | | return communityService.readUserReward(this.getUserId(),this.getCommunityId()); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.HttpClientUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.*; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.MalformedURLException; |
| | | import java.net.ProtocolException; |
| | | import java.net.URL; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.nio.charset.Charset; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/official") |
| | | public class WxOfficialApi { |
| | | |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | //公众号appid |
| | | private List<String> appidList = new ArrayList<String>(){{this.add("wx7c733ebbf6c55ecf");this.add("wxc94f0cddf13577d5");}}; |
| | |
| | | String paramBody = JSON.toJSONString(map); // 这里用了Alibaba的fastjson |
| | | |
| | | OutputStream out = connection.getOutputStream(); |
| | | BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(out)); |
| | | BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(out,"utf-8")); |
| | | bw.write(paramBody); // 向流中写入参数字符串 |
| | | bw.flush(); |
| | | |
| | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 微信公众号请求头设置 |
| | | */ |
| | | public static Map<String, String> getWxHeaderMap() { |
| | | Map<String, String> map = new HashMap<>(new LinkedHashMap()); |
| | | map.put("Accept", "text/html, application/xhtml+xml, image/jxr, */*"); |
| | | map.put("Accept-Encoding", "gzip, deflate"); |
| | | map.put("Accept-Language", "zh-Hans-CN, zh-Hans; q=0.8, en-US; q=0.5, en; q=0.3"); |
| | | map.put("Host", "mp.weixin.qq.com"); |
| | | map.put("If-Modified-Since", "Sat, 04 Jan 2020 12:23:43 GMT"); |
| | | map.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 根据文章链接抓取文章内容 |
| | | * |
| | | * @param url 文章链接 |
| | | * @return 文章内容 |
| | | */ |
| | | public static String getActicle(String url) { |
| | | // post发送的参数 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("type", "news"); // news表示图文类型的素材,具体看API文档 |
| | | map.put("offset", 0); |
| | | map.put("count", 5); |
| | | // 将map转换成json字符串 |
| | | String paramBody = JSON.toJSONString(map); |
| | | return HttpClientUtil.get(url, getWxHeaderMap(),paramBody); |
| | | } |
| | | |
| | | @ApiOperation(value = "拉取公众号列表") |
| | | @GetMapping(value = "/list/noToken",produces="application/json;charset=UTF-8") |
| | | @GetMapping(value = "/list/noToken",produces="application/json;charset=utf-8") |
| | | public R pageDiscuss() throws Exception{ |
| | | WxOfficialApi officialApi = new WxOfficialApi(); |
| | | |
| | |
| | | if(!tokenList.isEmpty()){ |
| | | tokenList.forEach(token -> { |
| | | try { |
| | | String result = officialApi.getContentList(token); |
| | | String url = "https://api.weixin.qq.com/cgi-bin/material/batchget_material?access_token=" + token; |
| | | String result = getActicle(url); |
| | | log.info("通过token获取文章列表成功,返回结果:" + result); |
| | | resultList.add(JSON.parseObject(result)); |
| | | |
| | | JSONObject resultJson = JSON.parseObject(result); |
| | | if(resultJson != null){ |
| | | List<JSONObject> itemList = JSON.parseArray(resultJson.getString("item"),JSONObject.class); |
| | | if(!itemList.isEmpty()){ |
| | | for (JSONObject object : itemList) { |
| | | String newsId = object.getString("media_id"); |
| | | JSONObject contentJson = JSON.parseObject(object.getString("content")); |
| | | List<JSONObject> newsItemList = JSON.parseArray(contentJson.getString("news_item"),JSONObject.class); |
| | | String newsUrl = newsItemList.get(0).getString("url"); |
| | | newsItemList.get(0).put("news_id",newsId); |
| | | contentJson.put("news_item",newsItemList); |
| | | object.put("content",contentJson); |
| | | |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | valueOperations.set(UserConstants.NEWS_ID + newsId, newsUrl + "", 2, TimeUnit.DAYS); |
| | | } |
| | | } |
| | | resultJson.put("item",itemList); |
| | | } |
| | | resultList.add(resultJson); |
| | | }catch (Exception e){ |
| | | log.error("通过token获取文章列表失败,错误原因:" + e.getMessage()); |
| | | } |
| | |
| | | return R.ok(resultList); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取公众号文章链接") |
| | | @GetMapping(value = "/get/noToken") |
| | | public R getDiscuss(@RequestParam("mediaId") String mediaId){ |
| | | |
| | | String key = UserConstants.NEWS_ID + mediaId; |
| | | Boolean hasKey = stringRedisTemplate.hasKey(key); |
| | | if (!hasKey) { |
| | | return R.fail("未找到该文章的链接地址"); |
| | | } |
| | | |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | String url = valueOperations.get(key); |
| | | return R.ok(url); |
| | | } |
| | | |
| | | } |
| | |
| | | public static final String LOGOUT_TOKEN = "logout:"; |
| | | public static final String LOGIN_USER_INFO = "login_user_info:"; |
| | | public static final String PHONE_PUT="phone_put:"; |
| | | public static final String NEWS_ID="news_media_id:"; |
| | | } |
| | |
| | | vo.setResidence(PopulIsOkEnum.getCodeByName(oneData.get(27).trim())); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(28))){ |
| | | vo.setAddress(oneData.get(28).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(29))){ |
| | | Integer isOk = PopulPersonTypeEnum.getCodeByName(oneData.get(29)); |
| | | Integer isOk = PopulPersonTypeEnum.getCodeByName(oneData.get(28)); |
| | | if(isOk.equals(-1)){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第30列"); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第29列"); |
| | | importErrorVO.setErrorMsg("您填写的人员类型有误"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | |
| | | } |
| | | vo.setPersonType(isOk); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(29))){ |
| | | vo.setCountry(oneData.get(29).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(30))){ |
| | | vo.setCountry(oneData.get(30).trim()); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY-dd-MM HH:mm:ss"); |
| | | vo.setDateOfDeparture(simpleDateFormat.parse(oneData.get(30))); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(31))){ |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY-dd-MM HH:mm:ss"); |
| | | vo.setDateOfDeparture(simpleDateFormat.parse(oneData.get(31))); |
| | | vo.setPersonStatus(oneData.get(31).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(32))){ |
| | | vo.setPersonStatus(oneData.get(32).trim()); |
| | | vo.setMonthlyIncome(oneData.get(32).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(33))){ |
| | | vo.setMonthlyIncome(oneData.get(33).trim()); |
| | | vo.setFamilyStatus(oneData.get(33).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(34))){ |
| | | vo.setFamilyStatus(oneData.get(34).trim()); |
| | | vo.setGoalInChina(oneData.get(34).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(35))){ |
| | | vo.setGoalInChina(oneData.get(35).trim()); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY-dd-MM HH:mm:ss"); |
| | | vo.setDateOfArrival(simpleDateFormat.parse(oneData.get(35))); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(36))){ |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY-dd-MM HH:mm:ss"); |
| | | vo.setDateOfArrival(simpleDateFormat.parse(oneData.get(36))); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(37))){ |
| | | vo.setRemark(oneData.get(37).trim()); |
| | | vo.setRemark(oneData.get(36).trim()); |
| | | } |
| | | |
| | | if(StringUtils.isNotEmpty(oneData.get(37))){ |
| | | vo.setIdCardPositive(oneData.get(37).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(38))){ |
| | | vo.setIdCardPositive(oneData.get(38).trim()); |
| | | vo.setIdCardBack(oneData.get(38).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(39))){ |
| | | vo.setIdCardBack(oneData.get(39).trim()); |
| | | vo.setHouseHold(oneData.get(39).trim()); |
| | | } |
| | | if(StringUtils.isNotEmpty(oneData.get(40))){ |
| | | vo.setHouseHold(oneData.get(40).trim()); |
| | | } |
| | | if(StringUtils.isEmpty(oneData.get(41))){ |
| | | if(StringUtils.isEmpty(oneData.get(40))){ |
| | | vo.setDeath(0); |
| | | }else{ |
| | | vo.setDeath(PopulIsOkEnum.getCodeByName(oneData.get(41).trim())); |
| | | vo.setDeath(PopulIsOkEnum.getCodeByName(oneData.get(40).trim())); |
| | | } |
| | | for (int i = 42; i < headSize; i++) { |
| | | for (int i = 41; i < headSize; i++) { |
| | | if (oneData.get(i) != null && oneData.get(i).equals("是")) { |
| | | vo.getUserTagStr().add(headData.get(i).substring(0,headData.get(i).indexOf("("))); |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | @Data |
| | | @ApiModel("新增社区动态分类请求参数") |
| | | public class AddComActDynTypeDTO { |
| | | |
| | | @ApiModelProperty("分类名称") |
| | | @NotBlank(message = "分类名称不能为空") |
| | | @Length(min = 1, max = 5, message = "分类名称不可超过5个字") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("分类字体颜色") |
| | | @NotBlank(message = "分类字体颜色不能为空") |
| | | private String color; |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "操作人员id",hidden = true) |
| | | private Long userId; |
| | | |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "年龄开始时间查询字段",hidden = true) |
| | | private String ageStartTime; |
| | | |
| | | /** |
| | | * 最终年龄开始时间查询字段 |
| | | */ |
| | | @ApiModelProperty(value = "最终年龄开始时间查询字段",hidden = true) |
| | | private String ageStartTimeEnd; |
| | | |
| | | /** |
| | | * 年龄结束查询字段 |
| | | */ |
| | |
| | | private String ageEnd; |
| | | |
| | | /** |
| | | * 最终年龄结束时间查询字段 |
| | | */ |
| | | @ApiModelProperty(value = "最终年龄结束时间查询字段",hidden = true) |
| | | private String ageEndTimeEnd; |
| | | |
| | | /** |
| | | * 年龄结束时间查询字段 |
| | | */ |
| | | @ApiModelProperty(value = "年龄结束时间查询字段",hidden = true) |
| | |
| | | @ApiModelProperty(value = "是否是居住地(1.是 2.否)") |
| | | private Integer isResidence; |
| | | |
| | | @ApiModelProperty("与户主关系") |
| | | private Integer relation; |
| | | |
| | | /** |
| | | * 是否是居住地(1.是 2.否) |
| | | */ |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | @Data |
| | | @ApiModel("新增社区动态分类请求参数") |
| | | public class EditComActDynTypeDTO { |
| | | |
| | | @ApiModelProperty("主键(分类编码)") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("分类名称") |
| | | @Length(min = 1, max = 5, message = "分类名称不可超过5个字") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("分类字体颜色") |
| | | private String color; |
| | | |
| | | @ApiModelProperty(value = "操作人员id",hidden = true) |
| | | private Long userId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 随手拍发放奖励请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("随手拍发放奖励请求参数") |
| | | public class GrantRewardDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value="随手拍id") |
| | | @NotBlank(groups = {AddGroup.class}, message = "随手拍id不能为空") |
| | | private List<Long> ids; |
| | | |
| | | @ApiModelProperty(value="发放奖励金额") |
| | | @NotBlank(groups = {AddGroup.class}, message = "发放奖励金额不能为空") |
| | | private BigDecimal amount; |
| | | |
| | | @ApiModelProperty(value="操作人",hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("分页查询社区动态分类请求参数") |
| | | public class PageComActDynTypeDTO { |
| | | |
| | | @ApiModelProperty(value = "当前页数",example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "每页记录数",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty(value = "社区id",hidden = true) |
| | | private Long communityId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.bigscreen.event; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("大屏事件列表请求参数") |
| | | public class ScreenDrawEventListDTO { |
| | | |
| | | @ApiModelProperty(value = "最大展示事件数量",example = "100") |
| | | private Integer count = 100; |
| | | |
| | | @ApiModelProperty(value = "社区id", example = "2", required = true) |
| | | @NotNull(message = "社区id不能为空") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "多边形类型(1.圆形 2.多边形)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "圆心坐标经度") |
| | | private Double centerLng; |
| | | |
| | | @ApiModelProperty(value = "圆心坐标纬度") |
| | | private Double centerLat; |
| | | |
| | | @ApiModelProperty(value = "圆心半径") |
| | | private String radius; |
| | | |
| | | @ApiModelProperty(value = "多边形经纬度列表") |
| | | private List<ScreenDrawLngLatDTO> lngLatList; |
| | | |
| | | /** |
| | | * 多边形类型(1.圆形 2.多边形) |
| | | */ |
| | | public interface type{ |
| | | int yx = 1; |
| | | int dbx = 2; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.bigscreen.event; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel("经纬度参数") |
| | | public class ScreenDrawLngLatDTO { |
| | | |
| | | @ApiModelProperty(value = "经度") |
| | | private Double lng; |
| | | |
| | | @ApiModelProperty(value = "纬度") |
| | | private Double lat; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("普通奖励金额") |
| | | private BigDecimal ordinaryReward; |
| | | |
| | | @ApiModelProperty("一般奖励金额") |
| | | private BigDecimal commonlyReward; |
| | | |
| | | @ApiModelProperty("活动图片") |
| | | private String logo; |
| | | } |
| | |
| | | @ApiModelProperty("普通奖励金额") |
| | | private BigDecimal ordinaryReward; |
| | | |
| | | @ApiModelProperty("一般奖励金额") |
| | | private BigDecimal commonlyReward; |
| | | |
| | | @ApiModelProperty("活动图片") |
| | | private String logo; |
| | | } |
| | |
| | | @ApiModelProperty(value = "(当前操作)用户ID", hidden = true, example = "1") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "身份证号码", hidden = true, example = "1") |
| | | private String cardNo; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 社区动态分类 |
| | | */ |
| | | @Data |
| | | @ApiModel("社区动态分类") |
| | | public class ComActDynTypeVO { |
| | | |
| | | @ApiModelProperty("主键(分类编码)") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("分类名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("分类字体颜色") |
| | | private String color; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("创建人") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty("修改时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateAt; |
| | | |
| | | @ApiModelProperty("修改人") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty("社区id,当此值为0时,该社区动态分类为系统预设,不可操作") |
| | | private Long communityId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "是否增加 1 增加 0 不增加") |
| | | private Integer isAdd; |
| | | |
| | | @ApiModelProperty(value = "分类:1-社区风采 2-社区动态") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "社区动态分类id") |
| | | private Long type; |
| | | |
| | | @ApiModelProperty(value = "社区动态分类名称") |
| | | private String typeName; |
| | | |
| | | @ApiModelProperty(value = "社区动态分类颜色") |
| | | private String typeColor; |
| | | |
| | | @ApiModelProperty(value = "封面模式:1-小图展示 2-大图展示") |
| | | private Integer coverMode; |
| | |
| | | @ApiModelProperty("普通奖励金额") |
| | | private BigDecimal ordinaryReward; |
| | | |
| | | @ApiModelProperty("一般奖励金额") |
| | | private BigDecimal commonlyReward; |
| | | |
| | | @ApiModelProperty("活动图片") |
| | | private String logo; |
| | | |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 用户获得随手拍奖励返回参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("用户获得随手拍奖励返回参数") |
| | | public class ComActEasyPhotoRewardVO { |
| | | |
| | | @ApiModelProperty("奖励金额") |
| | | private BigDecimal amount; |
| | | |
| | | @ApiModelProperty("随手拍最新活动") |
| | | private ComActEasyPhotoActivityVO easyPhotoActivityVO; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "发生地址经纬度信息,逗号分割(长的在前面,短的在后面)") |
| | | private String lngLat; |
| | | |
| | | @ApiModelProperty(value = "随手拍标签(1.优质 2.精良 3.普通)") |
| | | @ApiModelProperty(value = "随手拍标签(1.优质 2.精良 3.普通 4.一般)") |
| | | private Integer activityType; |
| | | |
| | | @ApiModelProperty(value = "参加活动奖励金额") |
| | | private BigDecimal activityAmount; |
| | | |
| | | @ApiModelProperty(value = "活动奖励金额") |
| | | private BigDecimal activityMoney; |
| | | |
| | | @ApiModelProperty(value = "随手拍活动id") |
| | | private Long activityId; |
| | | |
| | | @ApiModelProperty(value = "类型(1.心情类 2.治理类)") |
| | | private Integer easyType; |
| | | |
| | | @ApiModelProperty(value = "随手拍活动") |
| | | private ComActEasyPhotoActivityVO easyPhotoActivityVO; |
| | | } |
| | |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | * @date: 2021/3/11 17:11 |
| | | */ |
| | | @Data |
| | | @EncryptDecryptClass |
| | | public class ComMngCarExcelVO implements Serializable { |
| | | /** |
| | | * 小区名称 |
| | |
| | | /** |
| | | * 车主身份证号码 |
| | | */ |
| | | @EncryptDecryptField |
| | | @ExcelProperty(value = "车主身份证号码" ,index = 2) |
| | | private String cardNo; |
| | | |
| | |
| | | */ |
| | | @ExcelProperty(value = "联系方式" ,index = 6) |
| | | private String mobile; |
| | | |
| | | /** |
| | | * 详细住址 |
| | | */ |
| | | @ExcelProperty(value = "详细住址" ,index = 7) |
| | | private String address; |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | * @author: llming |
| | | */ |
| | | @Data |
| | | @EncryptDecryptClass |
| | | public class ComMngPopulationServeExcelVO implements Serializable { |
| | | |
| | | @ExcelProperty(value = "姓名", index = 0) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value = "身份证号码", index = 1) |
| | | @EncryptDecryptField |
| | | private String cardNo; |
| | | |
| | | @ExcelProperty(value = "民族", index = 2) |
| | |
| | | @ApiModelProperty("事件发生经纬度") |
| | | private String latLng; |
| | | |
| | | @ApiModelProperty("处理状态") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.screen.event; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("网格员列表返回参数") |
| | | public class EventGridMemberVO { |
| | | |
| | | @ApiModelProperty("网格员id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("网格员名称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("网格员联系方式") |
| | | private String phone; |
| | | |
| | | } |
| | |
| | | public class EventLeftDownStatisticsVO { |
| | | |
| | | @ApiModelProperty("治安隐患事件总数") |
| | | private Integer eventZATotal; |
| | | private Integer eventZATotal = 0; |
| | | |
| | | @ApiModelProperty("治安隐患已完成事件总数") |
| | | private Integer yesEventZATotal; |
| | | private Integer yesEventZATotal = 0; |
| | | |
| | | @ApiModelProperty("突发事件总数") |
| | | private Integer eventTFTotal; |
| | | private Integer eventTFTotal = 0; |
| | | |
| | | @ApiModelProperty("突发事件已完成总数") |
| | | private Integer yesEventTFTotal; |
| | | private Integer yesEventTFTotal = 0; |
| | | |
| | | @ApiModelProperty("特殊人群信息上报总数") |
| | | private Integer eventTSTotal; |
| | | private Integer eventTSTotal = 0; |
| | | |
| | | @ApiModelProperty("特殊人群信息上报已完成事件总数") |
| | | private Integer yesEventTSTotal; |
| | | private Integer yesEventTSTotal = 0; |
| | | |
| | | @ApiModelProperty("矛盾纠纷事件总数") |
| | | private Integer eventMDTotal; |
| | | private Integer eventMDTotal = 0; |
| | | |
| | | @ApiModelProperty("矛盾纠纷已完成事件总数") |
| | | private Integer yesEventMDTotal; |
| | | private Integer yesEventMDTotal = 0; |
| | | |
| | | @ApiModelProperty("不稳定因素事件总数") |
| | | private Integer eventBWDTotal; |
| | | private Integer eventBWDTotal = 0; |
| | | |
| | | @ApiModelProperty("不稳定因素已完成事件总数") |
| | | private Integer yesEventBWDTotal; |
| | | private Integer yesEventBWDTotal = 0; |
| | | |
| | | @ApiModelProperty("公共服务事件总数") |
| | | private Integer eventGGTotal; |
| | | private Integer eventGGTotal = 0; |
| | | |
| | | @ApiModelProperty("公共服务已完成事件总数") |
| | | private Integer yesEventGGTotal; |
| | | private Integer yesEventGGTotal = 0; |
| | | |
| | | @ApiModelProperty("随手拍总数") |
| | | private Integer eventSSPTotal; |
| | | private Integer eventSSPTotal = 0; |
| | | |
| | | @ApiModelProperty("随手拍已完成总数") |
| | | private Integer yesEventSSPTotal; |
| | | private Integer yesEventSSPTotal = 0; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 实有人口统计返回参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("实有人口统计返回参数") |
| | | public class ScreenDrawEventPopulationTotalVO { |
| | | |
| | | @ApiModelProperty("居民总数") |
| | | private Integer populationTotal = 0; |
| | | |
| | | @ApiModelProperty("户籍人口") |
| | | private Integer localTotal = 0; |
| | | |
| | | @ApiModelProperty("流动人口") |
| | | private Integer outTotal = 0; |
| | | |
| | | @ApiModelProperty("其他人员") |
| | | private Integer specialTotal = 0; |
| | | |
| | | @ApiModelProperty("小区数") |
| | | private Integer villageTotal = 0; |
| | | |
| | | @ApiModelProperty("楼栋数") |
| | | private Integer buildTotal = 0; |
| | | |
| | | @ApiModelProperty("居民小组长") |
| | | private Integer JMXZZTotal = 8; |
| | | |
| | | @ApiModelProperty("楼栋长") |
| | | private Integer LDZTotal = 28; |
| | | |
| | | @ApiModelProperty("党小组长") |
| | | private Integer DXZZTotal = 10; |
| | | |
| | | @ApiModelProperty("妇女小组长") |
| | | private Integer FNXZZTotal = 7; |
| | | |
| | | @ApiModelProperty("卫生员") |
| | | private Integer WSYTotal = 7; |
| | | |
| | | @ApiModelProperty("监督员") |
| | | private Integer JDYTotal = 7; |
| | | |
| | | @ApiModelProperty("安全员") |
| | | private Integer AQYTotal = 7; |
| | | |
| | | @ApiModelProperty("网格员") |
| | | private Integer WGYTotal = 6; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.screen; |
| | | |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilVillageStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventGridIncidentStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventLeftDownStatisticsVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("大屏绘制多边形返回参数") |
| | | public class ScreenDrawEventVO { |
| | | |
| | | @ApiModelProperty("社区事件数据") |
| | | private List<EventGridIncidentStatisticsVO> gridIncidentList; |
| | | |
| | | @ApiModelProperty("小区列表数据") |
| | | private List<CivilVillageStatisticsVO> villageStatisticsList; |
| | | |
| | | @ApiModelProperty("人数统计数据") |
| | | private ScreenDrawEventPopulationTotalVO drawEventPopulationTotalVO; |
| | | |
| | | @ApiModelProperty("事件数量统计数据") |
| | | private EventLeftDownStatisticsVO leftDownStatisticsVO; |
| | | |
| | | |
| | | } |
| | |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long houseId; |
| | | |
| | | @ApiModelProperty("人口id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long populId; |
| | | |
| | | @ApiModelProperty("人和房屋关系") |
| | | private Integer relationId; |
| | | |
| | | @ApiModelProperty("与户主关系") |
| | | private Integer relation; |
| | | |
| | | @ApiModelProperty("房屋地址") |
| | | private String address; |
| | | |
| | |
| | | */ |
| | | @PostMapping("/population/page/exServiceman") |
| | | R pageExServiceman(@RequestBody ComExServicemanDTO comExServicemanDTO); |
| | | |
| | | /** |
| | | * 分页查询社区动态分类列表 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 动态分类列表 |
| | | */ |
| | | @PostMapping("/dyn/type/page") |
| | | R pageDynTypeByAdmin(@RequestBody PageComActDynTypeDTO comActDynTypeDTO); |
| | | |
| | | /** |
| | | * 查询社区下所有动态分类列表 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 动态分类列表 |
| | | */ |
| | | @PostMapping("/dyn/type/list") |
| | | R getDynTypeListByAdmin(@RequestBody PageComActDynTypeDTO comActDynTypeDTO); |
| | | |
| | | /** |
| | | * 添加社区动态分类 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @PostMapping("/dyn/type/add") |
| | | R addDynTypeByAdmin(@RequestBody AddComActDynTypeDTO comActDynTypeDTO); |
| | | |
| | | /** |
| | | * 编辑社区动态分类 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("/dyn/type/edit") |
| | | R editDynTypeByAdmin(@RequestBody EditComActDynTypeDTO comActDynTypeDTO); |
| | | |
| | | /** |
| | | * 删除社区动态分类 |
| | | * @param ids 社区动态分类id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/dyn/type/delete") |
| | | R deleteDynTypeByAdmin(@RequestBody List<Long> ids); |
| | | |
| | | /** |
| | | * 随手拍发放奖励 |
| | | * @param grantRewardDTO 请求参数 |
| | | * @return 发放结果 |
| | | */ |
| | | @PostMapping("/easyphoto/grantReward") |
| | | R grantReward(@RequestBody GrantRewardDTO grantRewardDTO); |
| | | |
| | | /** |
| | | * 获取最新活动和用户最新收益 |
| | | * @param userId 用户id |
| | | * @param communityId 社区id |
| | | * @return 最新活动和用户最新收益 |
| | | */ |
| | | @PostMapping("/easyphoto/getUserReward") |
| | | R getUserReward(@RequestParam("userId") Long userId,@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 读取用户随手拍奖励 |
| | | * @param userId 用户id |
| | | * @return 读取结果 |
| | | */ |
| | | @PostMapping("/easyphoto/readUserReward") |
| | | R readUserReward(@RequestParam("userId") Long userId,@RequestParam("communityId") Long communityId); |
| | | } |
| | |
| | | package com.panzhihua.common.service.grid; |
| | | |
| | | import com.panzhihua.common.model.dtos.IdDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenDrawEventListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.dtos.grid.admin.EventGridMemberCascadeAddDTO; |
| | |
| | | */ |
| | | @PostMapping("/map/getMapGridsListsByApp") |
| | | R getMapGridsListsByApp(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 绘制多边形统计数据 |
| | | * @param eventListDTO 请求参数 |
| | | * @return 统计数据 |
| | | */ |
| | | @PostMapping("/screen/getCivilDrawList") |
| | | R getCivilDrawList(@RequestBody ScreenDrawEventListDTO eventListDTO); |
| | | |
| | | /** |
| | | * 大屏-根据小区id查询小区统计人数 |
| | | * @param villageId 小区id |
| | | * @return 小区统计数据 |
| | | */ |
| | | @GetMapping("/screen/village/statistics") |
| | | R civilVillageStatistics(@RequestParam("villageId") Long villageId); |
| | | } |
| | |
| | | |
| | | @PostMapping("user/getUserGrids") |
| | | R getGridIsOk(@RequestParam("userId")Long userId); |
| | | |
| | | @GetMapping("getGridsMemberList") |
| | | R getGridsMemberList(@RequestParam("communityId")Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import java.awt.Point; |
| | | import java.awt.geom.Point2D; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenDrawLngLatDTO; |
| | | |
| | | /** |
| | | * 判断坐标点位置状态 |
| | | */ |
| | | public class GisPointUtil { |
| | | |
| | | private static double EARTH_RADIUS = 6378137d; |
| | | |
| | | private static double rad(double d) { |
| | | return d * Math.PI / 180.0; |
| | | } |
| | | |
| | | /** |
| | | * 通过经纬度获取距离(单位:米) |
| | | * |
| | | * @param lat1 |
| | | * @param lng1 |
| | | * @param lat2 |
| | | * @param lng2 |
| | | * @return |
| | | */ |
| | | public static double getDistance(double lat1, double lng1, double lat2, |
| | | double lng2) { |
| | | double radLat1 = rad(lat1); |
| | | double radLat2 = rad(lat2); |
| | | double a = radLat1 - radLat2; |
| | | double b = rad(lng1) - rad(lng2); |
| | | double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + |
| | | Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2))); |
| | | s = s * EARTH_RADIUS; |
| | | s = Math.round(s * 10000d) / 10000d; |
| | | return s; |
| | | } |
| | | |
| | | /** |
| | | * 判断一个点是否在圆形区域内 |
| | | * @param radius 半径 |
| | | * @param lat1 圆心纬度 |
| | | * @param lng1 圆心经度 |
| | | * @param lat2 坐标纬度 |
| | | * @param lng2 坐标经度 |
| | | */ |
| | | public static boolean isInCircle(double lng1, double lat1, double lng2, double lat2, String radius) { |
| | | return getDistance(lat1, lng1, lat2, lng2) < Double.parseDouble(radius); |
| | | } |
| | | |
| | | /** |
| | | * 判断是否在多边形区域内 |
| | | * |
| | | * @param pointLon |
| | | * 要判断的点的纵坐标 |
| | | * @param pointLat |
| | | * 要判断的点的横坐标 |
| | | // * @param lon |
| | | * 区域各顶点的纵坐标数组 |
| | | // * @param lat |
| | | * 区域各顶点的横坐标数组 |
| | | * @return |
| | | */ |
| | | public static boolean isInPolygon(double pointLon, double pointLat, List<ScreenDrawLngLatDTO> lngLatList) { |
| | | // 将要判断的横纵坐标组成一个点 |
| | | Point2D.Double point = new Point.Double(pointLon, pointLat); |
| | | // 将区域各顶点的横纵坐标放到一个点集合里面 |
| | | List<Point2D.Double> pointList = new ArrayList<Point2D.Double>(); |
| | | double polygonPoint_x = 0.0, polygonPoint_y = 0.0; |
| | | int len = lngLatList.size(); |
| | | for (int i = 0; i < len; i++) { |
| | | polygonPoint_x = lngLatList.get(i).getLng(); |
| | | polygonPoint_y = lngLatList.get(i).getLat(); |
| | | Point2D.Double polygonPoint = new Point2D.Double(polygonPoint_x, polygonPoint_y); |
| | | pointList.add(polygonPoint); |
| | | } |
| | | return check(point, pointList); |
| | | } |
| | | |
| | | /** |
| | | * 一个点是否在多边形内 |
| | | * |
| | | * @param point |
| | | * 要判断的点的横纵坐标 |
| | | * @param polygon |
| | | * 组成的顶点坐标集合 |
| | | * @return |
| | | */ |
| | | private static boolean check(Point2D.Double point, List<Point2D.Double> polygon) { |
| | | java.awt.geom.GeneralPath peneralPath = new java.awt.geom.GeneralPath(); |
| | | |
| | | Point2D.Double first = polygon.get(0); |
| | | // 通过移动到指定坐标(以双精度指定),将一个点添加到路径中 |
| | | peneralPath.moveTo(first.x, first.y); |
| | | polygon.remove(0); |
| | | for (Point2D.Double d : polygon) { |
| | | // 通过绘制一条从当前坐标到新指定坐标(以双精度指定)的直线,将一个点添加到路径中。 |
| | | peneralPath.lineTo(d.x, d.y); |
| | | } |
| | | // 将几何多边形封闭 |
| | | peneralPath.lineTo(first.x, first.y); |
| | | peneralPath.closePath(); |
| | | // 测试指定的 Point2D 是否在 Shape 的边界内。 |
| | | return peneralPath.contains(point); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | // String points = "[{\"sets\":[{\"name\":\"sswg\",\"value\":\"402881f6681232c00168129b896e0078\"}],\"where\":[{\"name\":\"id\",\"value\":3231735,\"type\":\"=\"}]},{\"sets\":[{\"name\":\"sswg\",\"value\":\"000000006817dd6f0168313b9b89049a\"}],\"where\":[{\"name\":\"id\",\"value\":3231735,\"type\":\"=\"}]}]"; |
| | | // JSONArray pointArray = (JSONArray)JSONArray.parse(points); |
| | | // System.out.println(isInPolygon(120.636514,31.341752, pointArray)); |
| | | // String points = "[{\"x\":120.61123416,\"y\":31.32889074,\"z\":137.05},{\"x\":120.61312695,\"y\":31.31892631,\"z\":128.61},{\"x\":120.61455616,\"y\":31.30808702,\"z\":43.66},{\"x\":120.62127327,\"y\":31.30899876,\"z\":62.21},{\"x\":120.63003506,\"y\":31.31057071,\"z\":29.43},{\"x\":120.63726235,\"y\":31.31203339,\"z\":92.90},{\"x\":120.64536616,\"y\":31.31334188,\"z\":78.36},{\"x\":120.64402082,\"y\":31.31947999,\"z\":13.19},{\"x\":120.64136126,\"y\":31.32757908,\"z\":87.36},{\"x\":120.63689776,\"y\":31.33287239,\"z\":60.62},{\"x\":120.63502091,\"y\":31.33742080,\"z\":114.21},{\"x\":120.63071787,\"y\":31.33793104,\"z\":32.99},{\"x\":120.62952446,\"y\":31.34483170,\"z\":164.79},{\"x\":120.62710968,\"y\":31.34801804,\"z\":164.15},{\"x\":120.62731359,\"y\":31.34823458,\"z\":189.53},{\"x\":120.62700980,\"y\":31.34894193,\"z\":194.24},{\"x\":120.62700980,\"y\":31.34894193,\"z\":194.24},{\"x\":120.62700980,\"y\":31.34894193,\"z\":194.24},{\"x\":120.62665860,\"y\":31.34861797,\"z\":155.41},{\"x\":120.61706620,\"y\":31.34846463,\"z\":200.05},{\"x\":120.61854348,\"y\":31.34267516,\"z\":138.68},{\"x\":120.62111689,\"y\":31.33313042,\"z\":154.61}]"; |
| | | // JSONArray pointArray = (JSONArray)JSONArray.parse(points); |
| | | // System.out.println(isInPolygon(120.66615036,31.33525453, pointArray));//不在范围内 |
| | | // System.out.println(isInPolygon(120.62171413,31.32044689, pointArray));//在范围内 |
| | | } |
| | | } |
| | |
| | | import org.apache.http.client.HttpClient; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.client.methods.HttpUriRequest; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.impl.client.DefaultHttpClient; |
| | | import org.apache.http.impl.client.HttpClients; |
| | | import org.apache.http.message.BasicHeader; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.io.OutputStreamWriter; |
| | | import java.io.*; |
| | | import java.net.MalformedURLException; |
| | | import java.net.URL; |
| | | import java.net.URLConnection; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * get请求 |
| | | * @param url 请求地址(get请求时参数自己组装到url上) |
| | | * @param headerMap 请求头 |
| | | * @return 响应文本 |
| | | */ |
| | | public static String get(String url, Map<String, String> headerMap,String param) { |
| | | // 请求地址,以及参数设置 |
| | | HttpPost post = new HttpPost(url); |
| | | if (headerMap != null) { |
| | | for (Map.Entry<String, String> entry : headerMap.entrySet()) { |
| | | post.setHeader(entry.getKey(), entry.getValue()); |
| | | } |
| | | } |
| | | if (StringUtils.isNotBlank(param)) { |
| | | log.info("参数值:{}", param); |
| | | HttpEntity httpEntity = new StringEntity(param, "utf-8"); |
| | | post.setEntity(httpEntity); |
| | | } |
| | | // 执行请求,获取相应 |
| | | return getRespString(post); |
| | | } |
| | | |
| | | /** |
| | | * 获取响应信息(String) |
| | | */ |
| | | public static String getRespString(HttpUriRequest request) { |
| | | // 获取响应流 |
| | | InputStream in = getRespInputStream(request); |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | String line; |
| | | |
| | | BufferedReader br = new BufferedReader(new InputStreamReader(in)); |
| | | try { |
| | | while ((line = br.readLine()) != null) { |
| | | sb.append(line); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | String str = sb.toString(); |
| | | return str; |
| | | } |
| | | |
| | | /** |
| | | * 获取响应信息(InputStream) |
| | | */ |
| | | public static InputStream getRespInputStream(HttpUriRequest request) { |
| | | // 获取响应对象 |
| | | HttpResponse response = null; |
| | | try { |
| | | response = HttpClients.createDefault().execute(request); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (response == null) { |
| | | return null; |
| | | } |
| | | // 获取Entity对象 |
| | | HttpEntity entity = response.getEntity(); |
| | | // 获取响应信息流 |
| | | InputStream in = null; |
| | | if (entity != null) { |
| | | try { |
| | | in = entity.getContent(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return in; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.AddComActDynTypeDTO; |
| | | import com.panzhihua.common.model.dtos.community.EditComActDynTypeDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComActDynTypeDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActDynTypeVO; |
| | | import com.panzhihua.common.model.vos.community.ComActDynVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Api(tags = {"社区动态分类模块"}) |
| | | @RestController |
| | | @RequestMapping("/dyn/type/") |
| | | public class ActDynTypeApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "分页查询社区动态列表", response = ComActDynTypeVO.class) |
| | | @PostMapping("/page") |
| | | public R page(@RequestBody PageComActDynTypeDTO comActDynTypeDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | comActDynTypeDTO.setCommunityId(communityId); |
| | | return communityService.pageDynTypeByAdmin(comActDynTypeDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询社区动态分类列表", response = ComActDynTypeVO.class) |
| | | @PostMapping("/list") |
| | | public R list(@RequestBody PageComActDynTypeDTO comActDynTypeDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | comActDynTypeDTO.setCommunityId(communityId); |
| | | return communityService.getDynTypeListByAdmin(comActDynTypeDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增社区动态分类") |
| | | @PostMapping("/add") |
| | | public R add(@Validated @RequestBody AddComActDynTypeDTO comActDynTypeDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | comActDynTypeDTO.setCommunityId(loginUserInfo.getCommunityId()); |
| | | comActDynTypeDTO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.addDynTypeByAdmin(comActDynTypeDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑社区动态分类") |
| | | @PostMapping("/edit") |
| | | public R add(@Validated @RequestBody EditComActDynTypeDTO comActDynTypeDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | comActDynTypeDTO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.editDynTypeByAdmin(comActDynTypeDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除社区动态分类") |
| | | @PostMapping("/delete") |
| | | public R delete(@RequestBody List<Long> ids) { |
| | | if(ids == null || ids.size() <= 0){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.deleteDynTypeByAdmin(ids); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDetailDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenDrawEventListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventGridStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventListVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventNewStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.*; |
| | | import com.panzhihua.common.model.vos.community.screen.index.IndexStatisticsVO; |
| | | import com.panzhihua.common.model.vos.screen.ScreenDrawEventPopulationTotalVO; |
| | | import com.panzhihua.common.model.vos.screen.ScreenDrawEventVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private GridService gridService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @ApiOperation(value = "大屏测试接口") |
| | | @GetMapping("/test/noToken") |
| | |
| | | } |
| | | return gridService.getScreenEventList(eventListDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "事件大屏画圈展示事件坐标点接口@lyq",response = ScreenDrawEventVO.class) |
| | | @PostMapping("/civil/draw/list/noToken") |
| | | public R civilDrawList(@RequestBody ScreenDrawEventListDTO eventListDTO) { |
| | | if(eventListDTO.getCommunityId() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return gridService.getCivilDrawList(eventListDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据小区id获取小区信息@lyq",response = ScreenDrawEventPopulationTotalVO.class) |
| | | @GetMapping("/civil/village/statistics/noToken") |
| | | public R civilVillageStatistics(@RequestParam("villageId") Long villageId) { |
| | | if(villageId == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return gridService.civilVillageStatistics(villageId); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取社区网格员列表接口@lyq",response = EventGridMemberVO.class) |
| | | @GetMapping("/grids/member/noToken") |
| | | public R getGridsMemberList(@RequestParam("communityId") Long communityId) { |
| | | if(communityId == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return userService.getGridsMemberList(communityId); |
| | | } |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.GrantRewardDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | log.info("新增微心愿未通过审核通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | } else if (type.intValue() == 5) { |
| | | if(comActMicroWishVO.getFeedback().length() > 200){ |
| | | return R.fail("反馈字数不得超过200字"); |
| | | } |
| | | sysUserNoticeVO.setTitle("微心愿已完成"); |
| | | sysUserNoticeVO.setBusinessContent(comActMicroWishVO.getFeedback()); |
| | | sysUserNoticeVO.setBusinessStatus(2); |
| | |
| | | return r; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "删除心愿") |
| | | @PostMapping("deletemicrowish") |
| | | public R deleteMicrowish(@RequestParam("id")Long id) { |
| | |
| | | return communityService.easyPhotoStatistics(communityId); |
| | | } |
| | | |
| | | @ApiOperation(value = "随手拍发放奖励") |
| | | @PostMapping("grantReward") |
| | | public R grantReward(@Valid @RequestBody GrantRewardDTO grantRewardDTO) { |
| | | grantRewardDTO.setUserId(this.getUserId()); |
| | | if(grantRewardDTO.getAmount() == null || grantRewardDTO.getAmount().compareTo(BigDecimal.ZERO) < -1){ |
| | | return R.fail("您输入的发放金额有误"); |
| | | } |
| | | return communityService.grantReward(grantRewardDTO); |
| | | } |
| | | |
| | | } |
| | |
| | | R r =communityService.getVillageById(Ids.get(0)); |
| | | if (R.isOk(r)){ |
| | | populList = JSON.parseArray(JSON.toJSONString(communityService.getPopulationListByVillageId(Ids.get(0)).getData()),ComMngPopulationVO.class); |
| | | }else { |
| | | populList = JSON.parseArray(JSON.toJSONString(communityService.getPopulationLists(Ids).getData()),ComMngPopulationVO.class); |
| | | } |
| | | }else { |
| | | populList = JSON.parseArray(JSON.toJSONString(communityService.getPopulationLists(Ids).getData()),ComMngPopulationVO.class); |
| | | } |
| | | populList = JSON.parseArray(JSON.toJSONString(communityService.getPopulationLists(Ids).getData()),ComMngPopulationVO.class); |
| | | }else{//导出全部 |
| | | populList = JSON.parseArray(JSON.toJSONString(communityService.getPopulationListByCommunityId(communityId).getData()),ComMngPopulationVO.class); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.AddComActDynTypeDTO; |
| | | import com.panzhihua.common.model.dtos.community.EditComActDynTypeDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComActDynTypeDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.service.ComActDynTypeService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/dyn/type/") |
| | | public class ActDynTypeApi { |
| | | |
| | | @Resource |
| | | private ComActDynTypeService comActDynTypeService; |
| | | |
| | | /** |
| | | * 分页查询社区动态分类列表 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 动态分类列表 |
| | | */ |
| | | @PostMapping("/page") |
| | | public R pageDynTypeByAdmin(@RequestBody PageComActDynTypeDTO comActDynTypeDTO) { |
| | | return comActDynTypeService.pageDynTypeByAdmin(comActDynTypeDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询社区下所有动态分类列表 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 动态分类列表 |
| | | */ |
| | | @PostMapping("/list") |
| | | public R getDynTypeListByAdmin(@RequestBody PageComActDynTypeDTO comActDynTypeDTO) { |
| | | return comActDynTypeService.getDynTypeListByAdmin(comActDynTypeDTO); |
| | | } |
| | | |
| | | /** |
| | | * 添加社区动态分类 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @PostMapping("/add") |
| | | public R addDynTypeByAdmin(@RequestBody AddComActDynTypeDTO comActDynTypeDTO) { |
| | | return comActDynTypeService.addDynTypeByAdmin(comActDynTypeDTO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑社区动态分类 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("/edit") |
| | | public R editDynTypeByAdmin(@RequestBody EditComActDynTypeDTO comActDynTypeDTO) { |
| | | return comActDynTypeService.editDynTypeByAdmin(comActDynTypeDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除社区动态分类 |
| | | * @param ids 社区动态分类id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/delete") |
| | | public R deleteDynTypeByAdmin(@RequestBody List<Long> ids) { |
| | | return comActDynTypeService.deleteDynTypeByAdmin(ids); |
| | | } |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVillageDO; |
| | | import com.panzhihua.service_community.service.ComMngPopulationHouseService; |
| | | import com.panzhihua.service_community.service.ComMngPopulationHouseUserService; |
| | | import com.panzhihua.service_community.service.ComMngPopulationService; |
| | |
| | | */ |
| | | @PostMapping("getVillageById") |
| | | public R getVillageById(@RequestParam(value = "villageId")Long villageId){ |
| | | R r = comMngVillageService.getVillageById(villageId); |
| | | return R.ok(r); |
| | | ComMngVillageDO comMngVillageDO = comMngVillageService.getVillageById(villageId); |
| | | if (comMngVillageDO != null) { |
| | | return R.ok(comMngVillageDO); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("putdynamic") |
| | | public R putDynamic(@RequestBody ComActDynVO comActDynVO) { |
| | | ComActDynDO comActDynDO = new ComActDynDO(); |
| | | Long id = comActDynVO.getId(); |
| | | BeanUtils.copyProperties(comActDynVO, comActDynDO); |
| | | ComActDynDO comActDynDO = comActDynService.getById(comActDynVO.getId()); |
| | | if(comActDynDO == null){ |
| | | return R.fail("未查到社区动态记录"); |
| | | } |
| | | // Long id = comActDynVO.getId(); |
| | | Integer isTopping = comActDynVO.getIsTopping(); |
| | | boolean b = isTopping.intValue() == 1; |
| | | boolean b = isTopping.equals(1); |
| | | if(b){ |
| | | ComActDynDO comActDynDO1 = comActDynService.getById(id); |
| | | Integer status = comActDynDO1.getStatus(); |
| | | if (status.intValue()==0) { |
| | | return R.fail("该动态还未发布"); |
| | | Integer status = comActDynDO.getStatus(); |
| | | if (status.equals(0)) { |
| | | return R.fail("待发布的社区动态不可置顶"); |
| | | } |
| | | } |
| | | |
| | | if(StringUtils.isEmpty(comActDynVO.getCover())){ |
| | | comActDynVO.setCover(comActDynDO.getCover()); |
| | | } |
| | | BeanUtils.copyProperties(comActDynVO, comActDynDO); |
| | | |
| | | boolean update = comActDynService.updateById(comActDynDO); |
| | | if (update) { |
| | | // 最多只能设置三条置顶状态,后边设置会取消先前设置的置顶 |
| | |
| | | public R getCommunityLists(){ |
| | | return comActService.getCommunityLists(); |
| | | } |
| | | |
| | | /** |
| | | * 随手拍发放奖励 |
| | | * @param grantRewardDTO 请求参数 |
| | | * @return 发放结果 |
| | | */ |
| | | @PostMapping("/easyphoto/grantReward") |
| | | public R grantReward(@RequestBody GrantRewardDTO grantRewardDTO) { |
| | | return comActEasyPhotoService.grantReward(grantRewardDTO); |
| | | } |
| | | |
| | | /** |
| | | * 获取最新活动和用户最新收益 |
| | | * @param userId 用户id |
| | | * @param communityId 社区id |
| | | * @return 最新活动和用户最新收益 |
| | | */ |
| | | @PostMapping("easyphoto/getUserReward") |
| | | public R getUserReward(@RequestParam("userId") Long userId,@RequestParam("communityId") Long communityId) { |
| | | return comActEasyPhotoService.getUserReward(userId,communityId); |
| | | } |
| | | |
| | | /** |
| | | * 读取用户随手拍奖励 |
| | | * @param userId 用户id |
| | | * @return 读取结果 |
| | | */ |
| | | @PostMapping("easyphoto/readUserReward") |
| | | public R readUserReward(@RequestParam("userId") Long userId,@RequestParam("communityId") Long communityId) { |
| | | return comActEasyPhotoService.readUserReward(userId,communityId); |
| | | } |
| | | } |
| | |
| | | "d.is_topping, " + |
| | | "d.publish_at, " + |
| | | "d.create_at, " + |
| | | "cadt.`name` as typeName, " + |
| | | "cadt.color as typeColor, " + |
| | | "ca.name as communityName " + |
| | | "FROM " + |
| | | "com_act_dyn d " + |
| | | "LEFT JOIN com_act_dyn_user u ON d.id = u.dyn_id " + |
| | | "LEFT JOIN com_act_dyn_type as cadt ON cadt.id = d.type " + |
| | | "LEFT JOIN com_act ca ON d.community_id = ca.community_id " + |
| | | "WHERE 1=1 " + |
| | | "<if test='comActDynVO.choice == 0 '>" + |
| | |
| | | "d.is_topping, " + |
| | | "d.publish_at, " + |
| | | "d.create_at, " + |
| | | "cadt.`name` as typeName, " + |
| | | "ca.name as communityName " + |
| | | "FROM " + |
| | | "com_act_dyn d " + |
| | | "LEFT JOIN com_act_dyn_user u ON d.id = u.dyn_id " + |
| | | "LEFT JOIN com_act_dyn_type as cadt ON cadt.id = d.type " + |
| | | "LEFT JOIN com_act ca ON d.community_id = ca.community_id " + |
| | | "WHERE " + |
| | | "d.community_id=#{comActDynVO.communityId} " + |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.PageComActDynTypeDTO; |
| | | import com.panzhihua.common.model.vos.community.ComActDynTypeVO; |
| | | import com.panzhihua.service_community.model.dos.ComActDynTypeDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-22 11:28:27 |
| | | * @describe 社区动态分类mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActDynTypeMapper extends BaseMapper<ComActDynTypeDO> { |
| | | |
| | | /** |
| | | * 分页查询社区动态分类列表 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 动态分类列表 |
| | | */ |
| | | IPage<ComActDynTypeVO> pageDynTypeByAdmin(Page page, @Param("comActDynTypeDTO") PageComActDynTypeDTO comActDynTypeDTO); |
| | | |
| | | /** |
| | | * 查询社区下所有动态分类列表 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 动态分类列表 |
| | | */ |
| | | List<ComActDynTypeVO> getDynTypeListByAdmin(@Param("comActDynTypeDTO") PageComActDynTypeDTO comActDynTypeDTO); |
| | | |
| | | Integer getDynCountByDynTypeIds(@Param("ids") List<Long> ids); |
| | | |
| | | Integer deleteDynTypeByIds(@Param("ids") List<Long> ids); |
| | | |
| | | } |
| | |
| | | "p.is_report, " + |
| | | "p.is_publicity, " + |
| | | "p.activity_type, " + |
| | | "p.activity_id, " + |
| | | "p.activity_amount, " + |
| | | "p.examine_at " + |
| | | "FROM " + |
| | |
| | | "p.is_publicity, " + |
| | | "p.activity_type, " + |
| | | "p.activity_amount, " + |
| | | "p.activity_id, " + |
| | | "p.examine_at " + |
| | | "FROM " + |
| | | "com_act_easy_photo p " + |
| | |
| | | "p.handle_result, " + |
| | | "p.photo_path_list, " + |
| | | "p.activity_type, " + |
| | | "p.activity_id, " + |
| | | "p.activity_amount, " + |
| | | "count(pu.id)giveThumbsUpNum, " + |
| | | "p.handle_photo_list " + |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActEasyPhotoRewardDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-23 14:30:03 |
| | | * @describe 用户随手拍奖励表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActEasyPhotoRewardMapper extends BaseMapper<ComActEasyPhotoRewardDO> { |
| | | |
| | | BigDecimal getUserReward(@Param("userId")Long userId, @Param("communityId")Long communityId); |
| | | |
| | | } |
| | |
| | | "title like concat('%',#{pageActWorkGuideDTO.title},'%')"+ |
| | | " </if> " + |
| | | " </where>" + |
| | | "order by create_at desc"+ |
| | | "order by update_at desc"+ |
| | | "</script>") |
| | | IPage<ComActWorkGuideVO> pageWorkGuide(Page page, @Param("pageActWorkGuideDTO") PageActWorkGuideDTO pageActWorkGuideDTO); |
| | | } |
| | |
| | | " SELECT " + |
| | | " t.area_name AS areaName, " + |
| | | " t.user_name AS userName, " + |
| | | " t.card_no AS cardNo, " + |
| | | " t.brand, " + |
| | | " t.plate_num AS plateNum, " + |
| | | " t.color, " + |
| | |
| | | "AND date_format(cmp.birthday,'%Y-%m-%d') <![CDATA[ >= ]]> #{comMngPopulationVO.ageEndTime} " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageStartTime == comMngPopulationVO.ageEndTime'>" + |
| | | "AND cmp.birthday = #{comMngPopulationVO.ageStartTime} " + |
| | | "AND cmp.birthday BETWEEN #{comMngPopulationVO.ageStartTimeEnd} and #{comMngPopulationVO.ageEndTime}" + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageStartTime != comMngPopulationVO.ageEndTime'>" + |
| | | "AND cmp.birthday BETWEEN #{comMngPopulationVO.ageEndTimeEnd} and #{comMngPopulationVO.ageStartTime}" + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.nativePlace != null and comMngPopulationVO.nativePlace != ""'>" + |
| | | "AND cmp.native_place LIKE concat(#{comMngPopulationVO.nativePlace},'%') " + |
| | |
| | | " FROM " + |
| | | " com_mng_population AS cmp where 1=1 " + |
| | | "<if test='populationListDTO.keyWord != null and populationListDTO.keyWord != ""'>" + |
| | | "AND (cmp.name like concat (#{populationListDTO.keyWord},'%') or cmp.card_no_str like concat (#{populationListDTO.keyWord},'%') or cmp.address like concat (#{populationListDTO.keyWord},'%')) " + |
| | | "AND (cmp.name like concat (#{populationListDTO.keyWord},'%') or cmp.card_no = #{populationListDTO.cardNo} or cmp.address like concat (#{populationListDTO.keyWord},'%')) " + |
| | | " </if> " + |
| | | "<if test='populationListDTO.label != null and populationListDTO.label != ""'>" + |
| | | "AND cmp.label like concat ('%',#{populationListDTO.label},'%') " + |
| | |
| | | @Mapper |
| | | public interface ComMngPopulationHouseDAO extends BaseMapper<ComMngPopulationHouseDO> { |
| | | |
| | | @Select("select cmphu.house_id,cmph.address,cmph.status from com_mng_population_house_user cmphu " + |
| | | @Select("select cmphu.house_id,cmph.address,cmph.status,cmphu.popul_id,cmphu.popul_id,cmphu.relation_id,cmphu.relation from com_mng_population_house_user cmphu " + |
| | | " left join com_mng_population_house as cmph on cmph.id = cmphu.house_id " + |
| | | " where cmphu.popul_id = #{populId}") |
| | | List<ComMngHouseVo> getPopulHouseListByPopulId(@Param("populId")Long populId); |
| | | |
| | | @Select("<script> " + |
| | | "select id as houseId,cmv.alley from com_mng_population_house as cmph left join com_mng_village as cmv on cmv.village_id = cmph.village_id where cmph.community_id = #{communityId}" + |
| | | "<if test='villageId != null'>" + |
| | | "<if test='villageId != null and villageId != ""'>" + |
| | | "and cmv.village_id = #{villageId}" + |
| | | " </if> " + |
| | | " </script>") |
| | |
| | | private String cover; |
| | | |
| | | /** |
| | | * 分类:1-社区风采 2-社区动态 |
| | | * 社区动态分类id |
| | | */ |
| | | private Integer type; |
| | | private Long type; |
| | | |
| | | /** |
| | | * 封面模式:1-小图展示 2-大图展示 |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-22 11:28:27 |
| | | * @describe 社区动态分类实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_dyn_type") |
| | | public class ComActDynTypeDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 分类名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 字体颜色 |
| | | */ |
| | | private String color; |
| | | |
| | | /** |
| | | * 是否删除(1.是 2.否) |
| | | */ |
| | | private Integer isDel; |
| | | |
| | | /** |
| | | * 社区id(为0时表示系统分类无法更改的) |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 是否删除(1.是 2.否) |
| | | */ |
| | | public interface isDel{ |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActDynTypeDO{" + |
| | | "id=" + id + |
| | | ", name=" + name + |
| | | ", color=" + color + |
| | | ", isDel=" + isDel + |
| | | ", communityId=" + communityId + |
| | | ", createAt=" + createAt + |
| | | ", createBy=" + createBy + |
| | | ", updateAt=" + updateAt + |
| | | ", updateBy=" + updateBy + |
| | | "}"; |
| | | } |
| | | } |
| | |
| | | private BigDecimal ordinaryReward; |
| | | |
| | | /** |
| | | * 一般奖励金额 |
| | | */ |
| | | private BigDecimal commonlyReward; |
| | | |
| | | /** |
| | | * 随手拍数量 |
| | | */ |
| | | private Integer count; |
| | |
| | | private BigDecimal activityAmount; |
| | | |
| | | /** |
| | | * 参加活动标签(1.优质 2.精良 3.普通) |
| | | * 参加活动标签(1.优质 2.精良 3.普通 4.一般) |
| | | */ |
| | | public interface activityType{ |
| | | int yz = 1; |
| | | int jl = 2; |
| | | int pt = 3; |
| | | int yb = 4; |
| | | } |
| | | |
| | | /** |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-23 14:30:03 |
| | | * @describe 用户随手拍奖励表实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_easy_photo_reward") |
| | | public class ComActEasyPhotoRewardDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 是否已读(1.是 2.否) |
| | | */ |
| | | private Integer isRead; |
| | | |
| | | /** |
| | | * 奖励金额 |
| | | */ |
| | | private BigDecimal amount; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 是否已读(1.是 2.否) |
| | | */ |
| | | public interface isRead{ |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActEasyPhotoRewardDO{" + |
| | | "id=" + id + |
| | | ", userId=" + userId + |
| | | ", communityId=" + communityId + |
| | | ", isRead=" + isRead + |
| | | ", amount=" + amount + |
| | | ", createAt=" + createAt + |
| | | ", updateAt=" + updateAt + |
| | | "}"; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 标签集合(多个标签以,隔开) |
| | | */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private String label; |
| | | |
| | | /** |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.AddComActDynTypeDTO; |
| | | import com.panzhihua.common.model.dtos.community.EditComActDynTypeDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComActDynTypeDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComActDynTypeDO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-22 11:28:27 |
| | | * @describe 社区动态分类服务类 |
| | | */ |
| | | public interface ComActDynTypeService extends IService<ComActDynTypeDO> { |
| | | |
| | | /** |
| | | * 分页查询社区动态分类列表 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 动态分类列表 |
| | | */ |
| | | R pageDynTypeByAdmin(PageComActDynTypeDTO comActDynTypeDTO); |
| | | |
| | | /** |
| | | * 查询社区下所有动态分类列表 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 动态分类列表 |
| | | */ |
| | | R getDynTypeListByAdmin(PageComActDynTypeDTO comActDynTypeDTO); |
| | | |
| | | /** |
| | | * 添加社区动态分类 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | R addDynTypeByAdmin(AddComActDynTypeDTO comActDynTypeDTO); |
| | | |
| | | /** |
| | | * 编辑社区动态分类 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | R editDynTypeByAdmin(EditComActDynTypeDTO comActDynTypeDTO); |
| | | |
| | | /** |
| | | * 删除社区动态分类 |
| | | * @param ids 社区动态分类id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | R deleteDynTypeByAdmin(List<Long> ids); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.model.dos.ComActEasyPhotoRewardDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-23 14:30:03 |
| | | * @describe 用户随手拍奖励表服务类 |
| | | */ |
| | | public interface ComActEasyPhotoRewardService extends IService<ComActEasyPhotoRewardDO> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentDTO; |
| | | import com.panzhihua.common.model.dtos.community.GrantRewardDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComActEasyPhotoCommentDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentUserDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.ComPbServiceTeamDTO; |
| | |
| | | */ |
| | | R easyPhotoStatistics(Long communityId); |
| | | |
| | | /** |
| | | * 随手拍发放奖励 |
| | | * @param grantRewardDTO 请求参数 |
| | | * @return 发放结果 |
| | | */ |
| | | R grantReward(GrantRewardDTO grantRewardDTO); |
| | | |
| | | /** |
| | | * 获取最新活动和用户最新收益 |
| | | * @param userId 用户id |
| | | * @param communityId 社区id |
| | | * @return 最新活动和用户最新收益 |
| | | */ |
| | | R getUserReward(Long userId,Long communityId); |
| | | |
| | | /** |
| | | * 读取用户随手拍奖励 |
| | | * @param userId 用户id |
| | | * @return 读取结果 |
| | | */ |
| | | R readUserReward(Long userId,Long communityId); |
| | | |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComActUserWalletDO; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-06-25 10:35:11 |
| | |
| | | * 随手拍审核通过给用户添加收益 |
| | | * @param activityType 审核通过选择的随手拍标签(1.优质 2.精良 3.普通) |
| | | * @param easyPhotoId 随手拍id |
| | | * @param userId 审核用户id |
| | | * @param userId 发放用户id |
| | | * @param amount 发放奖励金额 |
| | | */ |
| | | void examineAddMoney(Integer activityType,Long easyPhotoId,Long userId); |
| | | void examineAddMoney(Integer activityType, Long easyPhotoId, Long userId, BigDecimal amount); |
| | | |
| | | /** |
| | | * 分页查询收益结算列表 |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVillageDO; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | |
| | | * @param villageId 查询条件 |
| | | * @return 查询结果 |
| | | */ |
| | | R getVillageById(Long villageId); |
| | | ComMngVillageDO getVillageById(Long villageId); |
| | | |
| | | /** |
| | | * 分页查询实有房屋 |
| | |
| | | //查询当前活动下参与志愿者/居民数量 |
| | | Integer count = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda().eq(ComActActSignDO::getActivityId,activityId) |
| | | .eq(ComActActSignDO::getIsVolunteer,isVolunteer)); |
| | | if(isVolunteer.equals(1) && actActivityDO.getVolunteerMax() <= count){ |
| | | if(isVolunteer.equals(1) && actActivityDO.getVolunteerMax() <= count && !actActivityDO.getVolunteerMax().equals(-1)){ |
| | | return R.fail("志愿者报名人数已满"); |
| | | } |
| | | |
| | | if(isVolunteer.equals(0) && actActivityDO.getParticipantMax() <= count){ |
| | | if(isVolunteer.equals(0) && actActivityDO.getParticipantMax() <= count && !actActivityDO.getParticipantMax().equals(-1)){ |
| | | return R.fail("居民报名人数已满"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.AddComActDynTypeDTO; |
| | | import com.panzhihua.common.model.dtos.community.EditComActDynTypeDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComActDynTypeDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.dao.ComActDynTypeMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActDynTypeDO; |
| | | import com.panzhihua.service_community.service.ComActDynTypeService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-22 11:28:27 |
| | | * @describe 社区动态分类服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActDynTypeServiceImpl extends ServiceImpl<ComActDynTypeMapper, ComActDynTypeDO> implements ComActDynTypeService { |
| | | |
| | | /** |
| | | * 分页查询社区动态分类列表 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 动态分类列表 |
| | | */ |
| | | @Override |
| | | public R pageDynTypeByAdmin(PageComActDynTypeDTO comActDynTypeDTO){ |
| | | return R.ok(this.baseMapper.pageDynTypeByAdmin(new Page(comActDynTypeDTO.getPageNum(),comActDynTypeDTO.getPageSize()),comActDynTypeDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 查询社区下所有动态分类列表 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 动态分类列表 |
| | | */ |
| | | @Override |
| | | public R getDynTypeListByAdmin(PageComActDynTypeDTO comActDynTypeDTO){ |
| | | return R.ok(this.baseMapper.getDynTypeListByAdmin(comActDynTypeDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 添加社区动态分类 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @Override |
| | | public R addDynTypeByAdmin(AddComActDynTypeDTO comActDynTypeDTO){ |
| | | |
| | | ComActDynTypeDO dynTypeDO = this.baseMapper.selectOne(new QueryWrapper<ComActDynTypeDO>().lambda() |
| | | .eq(ComActDynTypeDO::getCommunityId,comActDynTypeDTO.getCommunityId()) |
| | | .eq(ComActDynTypeDO::getName,comActDynTypeDTO.getName()).eq(ComActDynTypeDO::getIsDel,ComActDynTypeDO.isDel.no)); |
| | | if(dynTypeDO != null){ |
| | | return R.fail("该分类名称已存在!"); |
| | | } |
| | | |
| | | dynTypeDO = new ComActDynTypeDO(); |
| | | BeanUtils.copyProperties(comActDynTypeDTO,dynTypeDO); |
| | | dynTypeDO.setCreateBy(comActDynTypeDTO.getUserId()); |
| | | dynTypeDO.setCreateAt(new Date()); |
| | | |
| | | if(this.baseMapper.insert(dynTypeDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("添加失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 编辑社区动态分类 |
| | | * @param comActDynTypeDTO 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @Override |
| | | public R editDynTypeByAdmin(EditComActDynTypeDTO comActDynTypeDTO){ |
| | | |
| | | if(comActDynTypeDTO.getId().equals(1L) || comActDynTypeDTO.getId().equals(2L)){ |
| | | return R.fail("系统预设社区动态分类不可修改"); |
| | | } |
| | | |
| | | ComActDynTypeDO dynTypeDO = this.baseMapper.selectById(comActDynTypeDTO.getId()); |
| | | if(dynTypeDO == null){ |
| | | return R.fail("未查询到记录"); |
| | | } |
| | | |
| | | Integer count = this.baseMapper.selectCount(new QueryWrapper<ComActDynTypeDO>().lambda() |
| | | .eq(ComActDynTypeDO::getCommunityId,dynTypeDO.getCommunityId()) |
| | | .eq(ComActDynTypeDO::getName,comActDynTypeDTO.getName()) |
| | | .eq(ComActDynTypeDO::getIsDel,ComActDynTypeDO.isDel.no) |
| | | .ne(ComActDynTypeDO::getId,comActDynTypeDTO.getId())); |
| | | |
| | | if(count > 0){ |
| | | return R.fail("该分类名称已存在!"); |
| | | } |
| | | |
| | | BeanUtils.copyProperties(comActDynTypeDTO,dynTypeDO); |
| | | dynTypeDO.setUpdateBy(comActDynTypeDTO.getUserId()); |
| | | dynTypeDO.setUpdateAt(new Date()); |
| | | |
| | | if(this.baseMapper.updateById(dynTypeDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("添加失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除社区动态分类 |
| | | * @param ids 社区动态分类id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | public R deleteDynTypeByAdmin(List<Long> ids){ |
| | | |
| | | Integer count = this.baseMapper.getDynCountByDynTypeIds(ids); |
| | | if(count > 0){ |
| | | return R.fail("您选中的分类中包含已被引用,无法删除!"); |
| | | } |
| | | |
| | | if(this.baseMapper.deleteDynTypeByIds(ids) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("删除失败"); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.ComActEasyPhotoRewardMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActEasyPhotoRewardDO; |
| | | import com.panzhihua.service_community.service.ComActEasyPhotoRewardService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-07-23 14:30:03 |
| | | * @describe 用户随手拍奖励表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActEasyPhotoRewardServiceImpl extends ServiceImpl<ComActEasyPhotoRewardMapper, ComActEasyPhotoRewardDO> implements ComActEasyPhotoRewardService { |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentDTO; |
| | | import com.panzhihua.common.model.dtos.community.GrantRewardDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComActEasyPhotoCommentDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentUserDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoCommentVO; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; |
| | | import com.panzhihua.common.model.vos.community.TodoEventsVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.SensitiveUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComActEasyPhotoService; |
| | | import com.panzhihua.service_community.service.ComActUserWalletService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-12-07 14:31 |
| | | **/ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActEasyPhotoServiceImpl extends ServiceImpl<ComActEasyPhotoDAO, ComActEasyPhotoDO> implements ComActEasyPhotoService { |
| | | @Resource |
| | |
| | | private ComActEasyPhotoCommentUserDAO comActEasyPhotoCommentUserDAO ; |
| | | @Resource |
| | | private ComActEasyPhotoActivityMapper comActEasyPhotoActivityMapper; |
| | | @Resource |
| | | private ComActEasyPhotoRewardMapper comActEasyPhotoRewardMapper; |
| | | @Resource |
| | | private ComActUserWalletService comActUserWalletService; |
| | | /** |
| | |
| | | comActEasyPhotoVO1.setHaveGiveThumbsUp(1); |
| | | } |
| | | comActEasyPhotoVO1.setPhone(SensitiveUtil.desensitizedPhoneNumber(comActEasyPhotoVO1.getPhone())); |
| | | |
| | | if(comActEasyPhotoVO1.getActivityId() != null && comActEasyPhotoVO1.getStatus().equals(ComActEasyPhotoDO.status.ywc)){ |
| | | //查询随手拍活动 |
| | | ComActEasyPhotoActivityDO photoActivityDO = comActEasyPhotoActivityMapper.selectById(comActEasyPhotoVO1.getActivityId()); |
| | | if(comActEasyPhotoVO1.getActivityType() != null){ |
| | | if(comActEasyPhotoVO1.getActivityType().equals(ComActEasyPhotoDO.activityType.yz)){ |
| | | comActEasyPhotoVO1.setActivityMoney(photoActivityDO.getGoodReward()); |
| | | }else if(comActEasyPhotoVO1.getActivityType().equals(ComActEasyPhotoDO.activityType.jl)){ |
| | | comActEasyPhotoVO1.setActivityMoney(photoActivityDO.getExcellentReward()); |
| | | }else if(comActEasyPhotoVO1.getActivityType().equals(ComActEasyPhotoDO.activityType.pt)){ |
| | | comActEasyPhotoVO1.setActivityMoney(photoActivityDO.getOrdinaryReward()); |
| | | }else if(comActEasyPhotoVO1.getActivityType().equals(ComActEasyPhotoDO.activityType.yb)){ |
| | | comActEasyPhotoVO1.setActivityMoney(photoActivityDO.getCommonlyReward()); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | iPage.setRecords(records); |
| | | } |
| | |
| | | comActEasyPhotoVO.setPhone(SensitiveUtil.desensitizedPhoneNumber(comActEasyPhotoVO.getPhone())); |
| | | if(comActEasyPhotoVO.getAddrRemark()==null){ |
| | | comActEasyPhotoVO.setAddrRemark(""); |
| | | } |
| | | |
| | | if(comActEasyPhotoVO.getActivityId() != null){ |
| | | ComActEasyPhotoActivityDO photoActivityDO = comActEasyPhotoActivityMapper.selectById(comActEasyPhotoVO.getActivityId()); |
| | | if(photoActivityDO != null){ |
| | | ComActEasyPhotoActivityVO easyPhotoActivityVO = new ComActEasyPhotoActivityVO(); |
| | | BeanUtils.copyProperties(photoActivityDO,easyPhotoActivityVO); |
| | | comActEasyPhotoVO.setEasyPhotoActivityVO(easyPhotoActivityVO); |
| | | } |
| | | } |
| | | return R.ok(comActEasyPhotoVO); |
| | | } |
| | |
| | | // 操作类型 1审核通过 2驳回 3反馈 |
| | | ComActEasyPhotoDO cmActEasyPhotoDO=new ComActEasyPhotoDO(); |
| | | cmActEasyPhotoDO.setId(comActEasyPhotoVO.getId()); |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | // cmActEasyPhotoDO.setActivityType(comActEasyPhotoVO.getActivityType()); |
| | | Date date = new Date(); |
| | | switch (type){ |
| | |
| | | }else{ |
| | | cmActEasyPhotoDO.setStatus(4);//已完成 |
| | | } |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | cmActEasyPhotoDO.setExamineAt(date); |
| | | //审核通过判断随手拍是否有活动并计算用户收益 |
| | | comActUserWalletService.examineAddMoney(comActEasyPhotoVO.getActivityType(),comActEasyPhotoVO.getId(),comActEasyPhotoVO.getUserId()); |
| | | cmActEasyPhotoDO.setActivityType(comActEasyPhotoVO.getActivityType()); |
| | | break; |
| | | case 2: |
| | | cmActEasyPhotoDO = this.comActEasyPhotoDAO.selectById(comActEasyPhotoVO.getId()); |
| | | if(!cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dsh)){ |
| | | return R.fail("该随手拍已审核,不可重复操作"); |
| | | } |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | cmActEasyPhotoDO.setStatus(3);//已驳回 |
| | | cmActEasyPhotoDO.setExamineAt(date); |
| | | cmActEasyPhotoDO.setRejectReason(comActEasyPhotoVO.getRejectReason()); |
| | |
| | | if(!cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dfk)){ |
| | | return R.fail("该随手拍不是待反馈状态,不可进行反馈"); |
| | | } |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | cmActEasyPhotoDO.setHandleResult(comActEasyPhotoVO.getHandleResult()); |
| | | cmActEasyPhotoDO.setHandlePhotoList(comActEasyPhotoVO.getHandlePhotoList()); |
| | | cmActEasyPhotoDO.setStatus(4);//已完成 |
| | |
| | | return R.ok(this.baseMapper.getEasyPhotoStatistics(communityId)); |
| | | } |
| | | |
| | | /** |
| | | * 随手拍发放奖励 |
| | | * @param grantRewardDTO 请求参数 |
| | | * @return 发放结果 |
| | | */ |
| | | @Override |
| | | public R grantReward(GrantRewardDTO grantRewardDTO){ |
| | | |
| | | if(grantRewardDTO.getIds() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | |
| | | for (Long id:grantRewardDTO.getIds()) { |
| | | //查询随手拍 |
| | | ComActEasyPhotoDO easyPhotoDO = this.baseMapper.selectById(id); |
| | | if(easyPhotoDO != null){ |
| | | if(easyPhotoDO.getActivityAmount() != null){ |
| | | log.info("该随手拍已发放过奖励,不可重复发放,随手拍id" + easyPhotoDO.getId()); |
| | | continue; |
| | | } |
| | | //审核通过判断随手拍是否有活动并计算用户收益 |
| | | comActUserWalletService.examineAddMoney(easyPhotoDO.getActivityType(),easyPhotoDO.getId(),easyPhotoDO.getSponsorId(),grantRewardDTO.getAmount()); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取最新活动和用户最新收益 |
| | | * @param userId 用户id |
| | | * @param communityId 社区id |
| | | * @return 最新活动和用户最新收益 |
| | | */ |
| | | @Override |
| | | public R getUserReward(Long userId,Long communityId){ |
| | | //结果返回参数 |
| | | ComActEasyPhotoRewardVO easyPhotoRewardVO = new ComActEasyPhotoRewardVO(); |
| | | //查询随手拍活动 |
| | | ComActEasyPhotoActivityVO photoActivityVO = new ComActEasyPhotoActivityVO(); |
| | | Date nowDate = DateUtils.getCurrentDate(DateUtils.ymdhms_format); |
| | | List<ComActEasyPhotoActivityDO> photoActivityDOS = comActEasyPhotoActivityMapper.selectList( |
| | | new QueryWrapper<ComActEasyPhotoActivityDO>().lambda().eq(ComActEasyPhotoActivityDO::getCommunityId,communityId) |
| | | .eq(ComActEasyPhotoActivityDO::getStatus,ComActEasyPhotoActivityDO.status.jxz) |
| | | .le(ComActEasyPhotoActivityDO::getActivityStartAt,nowDate).ge(ComActEasyPhotoActivityDO::getActivityEndAt,nowDate)); |
| | | if(!photoActivityDOS.isEmpty()){ |
| | | ComActEasyPhotoActivityDO photoActivityDO = photoActivityDOS.get(0); |
| | | BeanUtils.copyProperties(photoActivityDO,photoActivityVO); |
| | | easyPhotoRewardVO.setEasyPhotoActivityVO(photoActivityVO); |
| | | } |
| | | |
| | | //查询用户未读奖励金额 |
| | | BigDecimal amount = comActEasyPhotoRewardMapper.getUserReward(userId,communityId); |
| | | if(amount != null){ |
| | | easyPhotoRewardVO.setAmount(amount); |
| | | } |
| | | return R.ok(easyPhotoRewardVO); |
| | | } |
| | | |
| | | /** |
| | | * 读取用户随手拍奖励 |
| | | * @param userId 用户id |
| | | * @return 读取结果 |
| | | */ |
| | | @Override |
| | | public R readUserReward(Long userId,Long communityId){ |
| | | ComActEasyPhotoRewardDO easyPhotoRewardDO = comActEasyPhotoRewardMapper.selectOne(new QueryWrapper<ComActEasyPhotoRewardDO>().lambda() |
| | | .eq(ComActEasyPhotoRewardDO::getUserId,userId).eq(ComActEasyPhotoRewardDO::getCommunityId,communityId) |
| | | .eq(ComActEasyPhotoRewardDO::getIsRead,ComActEasyPhotoRewardDO.isRead.no)); |
| | | if(easyPhotoRewardDO != null){ |
| | | easyPhotoRewardDO.setIsRead(ComActEasyPhotoRewardDO.isRead.yes); |
| | | easyPhotoRewardDO.setUpdateAt(new Date()); |
| | | comActEasyPhotoRewardMapper.updateById(easyPhotoRewardDO); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActEasyPhotoActivityMapper; |
| | | import com.panzhihua.service_community.dao.ComActEasyPhotoDAO; |
| | | import com.panzhihua.service_community.dao.ComActEasyPhotoRewardMapper; |
| | | import com.panzhihua.service_community.dao.ComActUserWalletMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActEasyPhotoActivityDO; |
| | | import com.panzhihua.service_community.model.dos.ComActEasyPhotoDO; |
| | | import com.panzhihua.service_community.model.dos.ComActUserWalletDO; |
| | | import com.panzhihua.service_community.model.dos.ComActUserWalletTradeDO; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComActUserWalletChangeService; |
| | | import com.panzhihua.service_community.service.ComActUserWalletService; |
| | | import com.panzhihua.service_community.service.ComActUserWalletTradeService; |
| | |
| | | private ComActUserWalletTradeService comActUserWalletTradeService; |
| | | @Resource |
| | | private ComActUserWalletChangeService comActUserWalletChangeService; |
| | | @Resource |
| | | private ComActEasyPhotoRewardMapper comActEasyPhotoRewardMapper; |
| | | |
| | | /** |
| | | * 查询用户钱包信息 |
| | |
| | | * @param easyPhotoId 随手拍id |
| | | */ |
| | | @Override |
| | | public void examineAddMoney(Integer activityType,Long easyPhotoId,Long userId){ |
| | | public void examineAddMoney(Integer activityType,Long easyPhotoId,Long userId,BigDecimal amount){ |
| | | |
| | | //查询随手拍信息 |
| | | ComActEasyPhotoDO easyPhotoDO = comActEasyPhotoDAO.selectById(easyPhotoId); |
| | |
| | | } |
| | | |
| | | //查询随手拍活动 |
| | | ComActEasyPhotoActivityDO photoActivityDO = comActEasyPhotoActivityMapper.selectById(easyPhotoDO.getActivityId()); |
| | | if(photoActivityDO == null){ |
| | | log.error("给用户添加收益失败,原因:未查到活动记录,活动id:" + easyPhotoDO.getActivityId()); |
| | | return; |
| | | } |
| | | // ComActEasyPhotoActivityDO photoActivityDO = comActEasyPhotoActivityMapper.selectById(easyPhotoDO.getActivityId()); |
| | | // if(photoActivityDO == null){ |
| | | // log.error("给用户添加收益失败,原因:未查到活动记录,活动id:" + easyPhotoDO.getActivityId()); |
| | | // return; |
| | | // } |
| | | |
| | | // if(photoActivityDO.getStatus() != ComActEasyPhotoActivityDO.status.jxz){ |
| | | // log.error("给用户添加收益失败,原因:活动未在进行中,活动id:" + easyPhotoDO.getActivityId()); |
| | |
| | | this.baseMapper.insert(userWalletDO); |
| | | } |
| | | |
| | | //计算收益 |
| | | BigDecimal profitAmount = BigDecimal.ZERO; |
| | | if(activityType.equals(ComActEasyPhotoDO.activityType.yz)){ |
| | | profitAmount = photoActivityDO.getGoodReward(); |
| | | }else if(activityType.equals(ComActEasyPhotoDO.activityType.jl)){ |
| | | profitAmount = photoActivityDO.getExcellentReward(); |
| | | }else if(activityType.equals(ComActEasyPhotoDO.activityType.pt)){ |
| | | profitAmount = photoActivityDO.getOrdinaryReward(); |
| | | } |
| | | |
| | | if(profitAmount.compareTo(BigDecimal.ZERO) == 0){ |
| | | if(amount.compareTo(BigDecimal.ZERO) == 0){ |
| | | log.error("此次参加活动的随手拍收益为0,不记录本次交易"); |
| | | return; |
| | | }else{ |
| | |
| | | BigDecimal oldSettlementAmount = userWalletDO.getSettlementAmount(); |
| | | |
| | | //更新钱包金额 |
| | | userWalletDO.setIncomeAmount(userWalletDO.getIncomeAmount().add(profitAmount)); |
| | | userWalletDO.setAvailableAmount(userWalletDO.getAvailableAmount().add(profitAmount)); |
| | | userWalletDO.setIncomeAmount(userWalletDO.getIncomeAmount().add(amount)); |
| | | userWalletDO.setAvailableAmount(userWalletDO.getAvailableAmount().add(amount)); |
| | | comActUserWalletMapper.updateById(userWalletDO); |
| | | |
| | | //新增钱包资金交易记录 |
| | | Long tradeId = comActUserWalletTradeService.addWalletTrade(easyPhotoDO.getSponsorId(),easyPhotoDO.getCommunityId() |
| | | ,easyPhotoDO.getId(),profitAmount, ComActUserWalletTradeDO.type.fb,"发布随手拍" |
| | | ,easyPhotoDO.getId(),amount, ComActUserWalletTradeDO.type.fb,"发布随手拍" |
| | | ,userId,userWalletDO.getId(),ComActUserWalletTradeDO.changeType.add); |
| | | |
| | | //新增钱包资金变动记录 |
| | | comActUserWalletChangeService.addWalletChange(easyPhotoDO.getSponsorId(),easyPhotoDO.getCommunityId(),userWalletDO.getId() |
| | | ,oldIncomeAmount,userWalletDO.getIncomeAmount(),oldAvailableAmount,userWalletDO.getAvailableAmount() |
| | | ,oldSettlementAmount,userWalletDO.getSettlementAmount(),tradeId); |
| | | |
| | | //查询用户未读奖励金额 |
| | | ComActEasyPhotoRewardDO easyPhotoRewardDO = comActEasyPhotoRewardMapper.selectOne(new QueryWrapper<ComActEasyPhotoRewardDO>().lambda() |
| | | .eq(ComActEasyPhotoRewardDO::getCommunityId,easyPhotoDO.getCommunityId()) |
| | | .eq(ComActEasyPhotoRewardDO::getUserId,easyPhotoDO.getSponsorId()) |
| | | .eq(ComActEasyPhotoRewardDO::getIsRead,ComActEasyPhotoRewardDO.isRead.no)); |
| | | if(easyPhotoRewardDO == null){ |
| | | easyPhotoRewardDO = new ComActEasyPhotoRewardDO(); |
| | | easyPhotoRewardDO.setCommunityId(easyPhotoDO.getCommunityId()); |
| | | easyPhotoRewardDO.setUserId(easyPhotoDO.getSponsorId()); |
| | | easyPhotoRewardDO.setIsRead(ComActEasyPhotoRewardDO.isRead.no); |
| | | easyPhotoRewardDO.setCreateAt(new Date()); |
| | | easyPhotoRewardDO.setAmount(amount); |
| | | comActEasyPhotoRewardMapper.insert(easyPhotoRewardDO); |
| | | }else{ |
| | | easyPhotoRewardDO.setAmount(easyPhotoRewardDO.getAmount().add(amount)); |
| | | easyPhotoRewardDO.setUpdateAt(new Date()); |
| | | comActEasyPhotoRewardMapper.updateById(easyPhotoRewardDO); |
| | | } |
| | | } |
| | | //更新随手拍活动信息 |
| | | easyPhotoDO.setActivityType(activityType); |
| | | easyPhotoDO.setActivityAmount(profitAmount); |
| | | easyPhotoDO.setActivityAmount(amount); |
| | | comActEasyPhotoDAO.updateById(easyPhotoDO); |
| | | } |
| | | |
| | |
| | | if (comActDO != null){ |
| | | vo.setAddress(comActDO.getAddress()); |
| | | vo.setPhone(comActDO.getContactsPhone()); |
| | | vo.setLon(comActDO.getLng()); |
| | | vo.setLat(comActDO.getLat()); |
| | | } |
| | | // List<String> list = getCoordinate(vo.getAddress()); |
| | | // if (list !=null && list.size() > 0){ |
| | | // vo.setLon(list.get(0)); |
| | | // vo.setLat(list.get(1)); |
| | | // } |
| | | |
| | | List<ComActWorkGuideMaterialDO> workGuideMaterialDOS = workGuideMaterialDAO.selectList(new LambdaQueryWrapper<ComActWorkGuideMaterialDO>() |
| | | .eq(ComActWorkGuideMaterialDO::getWorkGuideId, workGuideId)); |
| | | workGuideMaterialDOS.forEach(workGuideMaterialDO -> { |
| | |
| | | .eq(ComActWorkGuideMaterialDO::getWorkGuideId, workGuideId)); |
| | | return R.ok(); |
| | | } |
| | | |
| | | // // 调用百度地图API根据地址,获取坐标 |
| | | // public static List<String> getCoordinate(String address) { |
| | | // List<String> list = new ArrayList<>(); |
| | | // if (address != null && !"".equals(address)) { |
| | | // address = address.replaceAll("\\s*", "").replace("#", "栋"); |
| | | // String url = "http://api.map.baidu.com/geocoder/v3/?address=" + address + "&output=json&ak=" + AK; |
| | | // String json = loadJSON(url); |
| | | //// json = "{" + json; |
| | | //// json = json + "}"; |
| | | // if (json != null && !"".equals(json)) { |
| | | // XMLSerializer xmlSerializer = new XMLSerializer(); |
| | | // //将xml转为json(注:如果是元素的属性,会在json里的key前加一个@标识) |
| | | // String result = xmlSerializer.read(json).toString(); |
| | | // JSONObject obj = JSONObject.parseObject(json); |
| | | // if ("0".equals(obj.getString("status"))) { |
| | | // double lng = obj.getJSONObject("result").getJSONObject("location").getDouble("lng"); // 经度 |
| | | // double lat = obj.getJSONObject("result").getJSONObject("location").getDouble("lat"); // 纬度 |
| | | // DecimalFormat df = new DecimalFormat("#.######"); |
| | | // list.add(df.format(lng)); |
| | | // list.add(df.format(lat)); |
| | | // return list; |
| | | // } |
| | | // } |
| | | // } |
| | | // return null; |
| | | // } |
| | | // |
| | | // public static String loadJSON(String url) { |
| | | // StringBuilder json = new StringBuilder(); |
| | | // try { |
| | | // URL oracle = new URL(url); |
| | | // URLConnection yc = oracle.openConnection(); |
| | | // BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream(), "UTF-8")); |
| | | // String inputLine = null; |
| | | // while ((inputLine = in.readLine()) != null) { |
| | | // json.append(inputLine); |
| | | // } |
| | | // in.close(); |
| | | // } catch (MalformedURLException e) {} catch (IOException e) {} |
| | | // return json.toString(); |
| | | // } |
| | | |
| | | } |
| | |
| | | cascadeHouseVOList = cascadeHouseVOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getAlley()))), ArrayList::new)); |
| | | cascadeHouseVOList.forEach(cascade -> { |
| | | cascade.setName(cascade.getAlley()); |
| | | }); |
| | | }); |
| | | break; |
| | | case 2: |
| | | if(houseDO != null){ |
| | |
| | | import com.panzhihua.service_community.service.ComMngPopulationService; |
| | | import com.panzhihua.service_community.service.ComMngVillageService; |
| | | import com.panzhihua.service_community.service.EventResourceService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 实有人口Service实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComMngPopulationServiceImpl extends ServiceImpl<ComMngPopulationDAO, ComMngPopulationDO> implements ComMngPopulationService { |
| | | @Resource |
| | |
| | | comMngPopulationVO.setAgeEndTime(ageEndTime); |
| | | } |
| | | } |
| | | |
| | | if (comMngPopulationVO.getAgeStartTime() !=null && !"".equals(comMngPopulationVO.getAgeStartTime()) && comMngPopulationVO.getAgeEndTime() !=null && !"".equals(comMngPopulationVO.getAgeEndTime())){ |
| | | if (comMngPopulationVO.getAgeStartTime().equals(comMngPopulationVO.getAgeEndTime())) { |
| | | Date endAge = DateUtils.stringToDate(comMngPopulationVO.getAgeEndTime(), new SimpleDateFormat("yyyy-MM-dd")); |
| | | String ageStartTime = DateUtils.getDateFormatString(DateUtils.yearAddNum(endAge, -1), "yyyy-MM-dd"); |
| | | if (StringUtils.isNotEmpty(ageStartTime)) { |
| | | comMngPopulationVO.setAgeStartTimeEnd(ageStartTime); |
| | | } |
| | | } else { |
| | | Date endAge = DateUtils.stringToDate(comMngPopulationVO.getAgeEndTime(), new SimpleDateFormat("yyyy-MM-dd")); |
| | | String ageStartTime = DateUtils.getDateFormatString(DateUtils.yearAddNum(endAge, -1), "yyyy-MM-dd"); |
| | | if (StringUtils.isNotEmpty(ageStartTime)) { |
| | | comMngPopulationVO.setAgeEndTimeEnd(ageStartTime); |
| | | } |
| | | } |
| | | } |
| | | IPage<ComMngPopulationVO> iPage = populationDAO.pagePopulation(page, comMngPopulationVO); |
| | | if (!iPage.getRecords().isEmpty()) { |
| | | iPage.getRecords().forEach(populDO -> { |
| | |
| | | // if (vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) { |
| | | // populationDO = updatePopulationDO(vo, populationDO); |
| | | // } |
| | | populationDO = updatePopulationDO(vo, populationDO); |
| | | populationDO = updatePopulationDO(vo, comActDO, populationDO); |
| | | } |
| | | |
| | | //处理实有人口房屋居住信息 |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | private ComMngPopulationDO updatePopulationDO(ComMngPopulationServeExcelVO vo, ComMngPopulationDO populationDO) throws Exception { |
| | | private ComMngPopulationDO updatePopulationDO(ComMngPopulationServeExcelVO vo, ComActDO comActDO, ComMngPopulationDO populationDO) throws Exception { |
| | | UpdateWrapper<ComMngPopulationDO> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("id",populationDO.getId()); |
| | | ComMngPopulationDO update = new ComMngPopulationDO(); |
| | |
| | | // if (StringUtils.isNotEmpty(populationDO.getPhone())) { |
| | | // update.setPhone(populationDO.getPhone()); |
| | | // } |
| | | String cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey); |
| | | BeanUtils.copyProperties(vo, update); |
| | | List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList()); |
| | | //查询当前社区标签列表 |
| | | List<String> list = new ArrayList<>(); |
| | | List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO.selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", comActDO.getCommunityId())); |
| | | if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { |
| | | list = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()).collect(Collectors.toList()); |
| | | } |
| | | //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 |
| | | Iterator<String> iterator = userTag.iterator(); |
| | | while (iterator.hasNext()) { |
| | | String s = iterator.next(); |
| | | if (!list.contains(s)) |
| | | iterator.remove(); |
| | | } |
| | | update.setLabel(Joiner.on(",").join(userTag)); |
| | | update.setCardNo(cardNoAES); |
| | | this.baseMapper.update(update,updateWrapper); |
| | | return populationDO; |
| | | } |
| | |
| | | populationHouseUserDO.setId(Snowflake.getId()); |
| | | populationHouseUserDO.setPopulId(populationDO.getId()); |
| | | populationHouseUserDO.setHouseId(houseEditDto.getId()); |
| | | populationHouseUserDO.setRelation(houseEditDto.getRelation()); |
| | | if (houseEditDto.getIsResidence().equals(ComMngPopulationHouseEditDTO.isResidence.yes)) { |
| | | houseId = houseEditDto.getId();//居住地 |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | ComMngPopulationHouseUserDO comMngPopulationHouseUserDO = comMngPopulationHouseUserDAO.selectOne(new QueryWrapper<ComMngPopulationHouseUserDO>().lambda() |
| | | .eq(ComMngPopulationHouseUserDO::getPopulId, vo.getId())); |
| | | if (comMngPopulationHouseUserDO != null) { |
| | | comMngPopulationHouseUserDO.setRelation(vo.getRelation()); |
| | | comMngPopulationHouseUserDAO.updateById(comMngPopulationHouseUserDO); |
| | | }else { |
| | | comMngPopulationHouseUserDO = new ComMngPopulationHouseUserDO(); |
| | | comMngPopulationHouseUserDO.setId(Snowflake.getId()); |
| | | comMngPopulationHouseUserDO.setPopulId(vo.getId()); |
| | | comMngPopulationHouseUserDO.setRelation(vo.getRelation()); |
| | | comMngPopulationHouseUserDO.setCreateAt(new Date()); |
| | | comMngPopulationHouseUserDAO.insert(comMngPopulationHouseUserDO); |
| | | } |
| | | // ComMngPopulationHouseUserDO comMngPopulationHouseUserDO = comMngPopulationHouseUserDAO.selectOne(new QueryWrapper<ComMngPopulationHouseUserDO>().lambda() |
| | | // .eq(ComMngPopulationHouseUserDO::getPopulId, vo.getId())); |
| | | // if (comMngPopulationHouseUserDO != null) { |
| | | // comMngPopulationHouseUserDO.setRelation(vo.getRelation()); |
| | | // comMngPopulationHouseUserDAO.updateById(comMngPopulationHouseUserDO); |
| | | // }else { |
| | | // comMngPopulationHouseUserDO = new ComMngPopulationHouseUserDO(); |
| | | // comMngPopulationHouseUserDO.setId(Snowflake.getId()); |
| | | // comMngPopulationHouseUserDO.setPopulId(vo.getId()); |
| | | // comMngPopulationHouseUserDO.setRelation(vo.getRelation()); |
| | | // comMngPopulationHouseUserDO.setCreateAt(new Date()); |
| | | // comMngPopulationHouseUserDAO.insert(comMngPopulationHouseUserDO); |
| | | // } |
| | | if (populationDAO.updateById(populationDO) > 0) { |
| | | return R.ok(); |
| | | } else { |
| | |
| | | */ |
| | | @Override |
| | | public R getGridPopulationAdminList(ComMngPopulationListDTO populationListDTO){ |
| | | if(StringUtils.isNotEmpty(populationListDTO.getKeyWord())){ |
| | | try { |
| | | populationListDTO.setCardNo(AESUtil.encrypt128(populationListDTO.getKeyWord(),aesKey)); |
| | | }catch (Exception e){ |
| | | log.error("转换身份证号码失败"); |
| | | } |
| | | } |
| | | |
| | | IPage<ComMngPopulationListVO> populationListIPage = this.baseMapper.getGridPopulationAdminList(new Page(populationListDTO.getPageNum(),populationListDTO.getPageSize()),populationListDTO); |
| | | if(!populationListIPage.getRecords().isEmpty()){ |
| | | populationListIPage.getRecords().forEach(population -> { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R getVillageById(Long villageId) { |
| | | public ComMngVillageDO getVillageById(Long villageId) { |
| | | ComMngVillageDO comMngVillageDO = new ComMngVillageDO(); |
| | | comMngVillageDO = comActVillageDAO.selectById(villageId); |
| | | if (comMngVillageDO != null) { |
| | | return R.ok(comMngVillageDO); |
| | | } |
| | | return R.fail(); |
| | | return comMngVillageDO; |
| | | } |
| | | |
| | | |
New file |
| | |
| | | <?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.panzhihua.service_community.dao.ComActDynTypeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActDynTypeDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="color" property="color" /> |
| | | <result column="is_del" property="isDel" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="update_at" property="updateAt" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, name, color, is_del, community_id, create_at, create_by, update_at, update_by |
| | | </sql> |
| | | |
| | | <select id="pageDynTypeByAdmin" parameterType="com.panzhihua.common.model.dtos.community.PageComActDynTypeDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActDynTypeVO"> |
| | | SELECT |
| | | cadt.id, |
| | | cadt.`name`, |
| | | cadt.color, |
| | | cadt.community_id, |
| | | cadt.create_at, |
| | | cadt.update_at, |
| | | su.`name` AS createBy, |
| | | su1.`name` AS updateBy |
| | | FROM |
| | | com_act_dyn_type AS cadt |
| | | LEFT JOIN sys_user AS su ON su.user_id = cadt.create_by |
| | | LEFT JOIN sys_user AS su1 ON su1.user_id = cadt.update_by |
| | | where cadt.community_id = 0 and cadt.is_del = 2 |
| | | <if test="comActDynTypeDTO.keyWord != null and comActDynTypeDTO.keyWord != """> |
| | | and (cadt.id = #{comActDynTypeDTO.keyWord} or cadt.`name` like concat (#{comActDynTypeDTO.keyWord},'%')) |
| | | </if> |
| | | union all |
| | | |
| | | SELECT |
| | | cadt.id, |
| | | cadt.`name`, |
| | | cadt.color, |
| | | cadt.community_id, |
| | | cadt.create_at, |
| | | cadt.update_at, |
| | | su.`name` AS createBy, |
| | | su1.`name` AS updateBy |
| | | FROM |
| | | com_act_dyn_type AS cadt |
| | | LEFT JOIN sys_user AS su ON su.user_id = cadt.create_by |
| | | LEFT JOIN sys_user AS su1 ON su1.user_id = cadt.update_by |
| | | where cadt.is_del = 2 |
| | | <if test="comActDynTypeDTO.communityId != null"> |
| | | and cadt.community_id = #{comActDynTypeDTO.communityId} |
| | | </if> |
| | | <if test="comActDynTypeDTO.keyWord != null and comActDynTypeDTO.keyWord != """> |
| | | and (cadt.id = #{comActDynTypeDTO.keyWord} or cadt.`name` like concat (#{comActDynTypeDTO.keyWord},'%')) |
| | | </if> |
| | | order by create_at desc |
| | | </select> |
| | | |
| | | <select id="getDynTypeListByAdmin" parameterType="com.panzhihua.common.model.dtos.community.PageComActDynTypeDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActDynTypeVO"> |
| | | SELECT |
| | | cadt.id, |
| | | cadt.`name`, |
| | | cadt.color, |
| | | cadt.community_id, |
| | | cadt.create_at, |
| | | cadt.update_at, |
| | | su.`name` AS createBy, |
| | | su1.`name` AS updateBy |
| | | FROM |
| | | com_act_dyn_type AS cadt |
| | | LEFT JOIN sys_user AS su ON su.user_id = cadt.create_by |
| | | LEFT JOIN sys_user AS su1 ON su1.user_id = cadt.update_by |
| | | where cadt.community_id = 0 and cadt.is_del = 2 |
| | | <if test="comActDynTypeDTO.keyWord != null and comActDynTypeDTO.keyWord != """> |
| | | and (cadt.id = #{comActDynTypeDTO.keyWord} or cadt.`name` like concat (#{comActDynTypeDTO.keyWord},'%')) |
| | | </if> |
| | | union all |
| | | |
| | | SELECT |
| | | cadt.id, |
| | | cadt.`name`, |
| | | cadt.color, |
| | | cadt.community_id, |
| | | cadt.create_at, |
| | | cadt.update_at, |
| | | su.`name` AS createBy, |
| | | su1.`name` AS updateBy |
| | | FROM |
| | | com_act_dyn_type AS cadt |
| | | LEFT JOIN sys_user AS su ON su.user_id = cadt.create_by |
| | | LEFT JOIN sys_user AS su1 ON su1.user_id = cadt.update_by |
| | | where cadt.is_del = 2 |
| | | <if test="comActDynTypeDTO.communityId != null"> |
| | | and cadt.community_id = #{comActDynTypeDTO.communityId} |
| | | </if> |
| | | <if test="comActDynTypeDTO.keyWord != null and comActDynTypeDTO.keyWord != """> |
| | | and (cadt.id = #{comActDynTypeDTO.keyWord} or cadt.`name` like concat (#{comActDynTypeDTO.keyWord},'%')) |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getDynCountByDynTypeIds" parameterType="List" resultType="Integer"> |
| | | select count(id) from com_act_dyn where `type` in |
| | | <foreach collection='ids' item='id' index='index' open='(' close=')' separator=',' > |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <update id="deleteDynTypeByIds" parameterType="List"> |
| | | update com_act_dyn_type set is_del = 1 where id in |
| | | <foreach collection='ids' item='id' index='index' open='(' close=')' separator=',' > |
| | | #{id} |
| | | </foreach> |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | <result column="count" property="count" /> |
| | | <result column="logo" property="logo" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="commonly_reward" property="commonlyReward" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, status, content, activity_start_at, activity_end_at, release_at, good_reward, excellent_reward, ordinary_reward, count, create_at, logo |
| | | id, status, content, activity_start_at, activity_end_at, release_at, good_reward, excellent_reward, ordinary_reward, count, create_at, logo, commonly_reward |
| | | </sql> |
| | | |
| | | <select id="pageActivity" parameterType="com.panzhihua.common.model.dtos.community.easyPhoto.PageEasyPhotoActivityDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActEasyPhotoActivityVO"> |
| | | select id,community_id,status,content,activity_start_at,activity_end_at,release_at,good_reward |
| | | ,excellent_reward,ordinary_reward,count,logo from com_act_easy_photo_activity |
| | | ,excellent_reward,ordinary_reward,commonly_reward,count,logo from com_act_easy_photo_activity |
| | | <where> |
| | | <if test="pageEasyPhotoActivityDTO.status != null"> |
| | | and status = #{pageEasyPhotoActivityDTO.status} |
New file |
| | |
| | | <?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.panzhihua.service_community.dao.ComActEasyPhotoRewardMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActEasyPhotoRewardDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="is_read" property="isRead" /> |
| | | <result column="amount" property="amount" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="update_at" property="updateAt" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, user_id, community_id, is_read, amount, create_at, update_at |
| | | </sql> |
| | | |
| | | <select id="getUserReward" resultType="java.math.BigDecimal"> |
| | | select amount from com_act_easy_photo_reward where user_id = #{userId} and is_read = 2 and community_id = #{communityId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package com.panzhihua.service_grid.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenDrawEventListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_grid.service.EventService; |
| | |
| | | return eventService.eventWork(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 绘制多边形统计数据 |
| | | * @param eventListDTO 请求参数 |
| | | * @return 统计数据 |
| | | */ |
| | | @PostMapping("/getCivilDrawList") |
| | | public R getCivilDrawList(@RequestBody ScreenDrawEventListDTO eventListDTO) { |
| | | return eventService.getCivilDrawList(eventListDTO); |
| | | } |
| | | |
| | | /** |
| | | * 大屏-根据小区id查询小区统计人数 |
| | | * @param villageId 小区id |
| | | * @return 小区统计数据 |
| | | */ |
| | | @GetMapping("/village/statistics") |
| | | public R civilVillageStatistics(@RequestParam("villageId") Long villageId) { |
| | | return eventService.civilVillageStatistics(villageId); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilVillageStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventGridIncidentStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventListVO; |
| | | import com.panzhihua.common.model.vos.grid.*; |
| | | import com.panzhihua.common.model.vos.screen.DateScreenVO; |
| | | import com.panzhihua.common.model.vos.screen.EventDetailWorkVO; |
| | | import com.panzhihua.common.model.vos.screen.EventTypeWorkVO; |
| | | import com.panzhihua.common.model.vos.screen.EventWorkVO; |
| | | import com.panzhihua.common.model.vos.screen.*; |
| | | import com.panzhihua.service_grid.model.dos.EventDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | EventTypeWorkVO getNoComplete(@Param("communityId") Long communityId); |
| | | |
| | | Map<String,Long> getSSPEventTotal(@Param("communityId") Long communityId); |
| | | |
| | | List<EventGridIncidentStatisticsVO> getEventListByCommunityId(@Param("communityId") Long communityId); |
| | | |
| | | List<CivilVillageStatisticsVO> getCivilScreenVillageList(@Param("communityId") Long communityId); |
| | | |
| | | ScreenDrawEventPopulationTotalVO getVillagePopulationTotal(@Param("villageId") Long villageId); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenDrawEventListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | |
| | | Boolean updateLcUploadFlag(Long id); |
| | | |
| | | R eventWork(Long communityId); |
| | | |
| | | /** |
| | | * 绘制多边形统计数据 |
| | | * @param eventListDTO 请求参数 |
| | | * @return 统计数据 |
| | | */ |
| | | R getCivilDrawList(ScreenDrawEventListDTO eventListDTO); |
| | | |
| | | /** |
| | | * 大屏-根据小区id查询小区统计人数 |
| | | * @param villageId 小区id |
| | | * @return 小区统计数据 |
| | | */ |
| | | R civilVillageStatistics(Long villageId); |
| | | } |
| | |
| | | import com.panzhihua.common.enums.EventType; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenDrawEventListDTO; |
| | | import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilVillageStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventGridIncidentStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventLeftDownStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventListVO; |
| | | import com.panzhihua.common.model.vos.grid.*; |
| | | import com.panzhihua.common.model.vos.screen.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.GisPointUtil; |
| | | import com.panzhihua.common.utlis.LngLatUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_grid.dao.*; |
| | |
| | | //查询网格员头像,姓名 |
| | | Map<String,Object> gridMember = eventMapper.getUserBaseInfo(eventDO.getGridMemberId()); |
| | | if (!CollectionUtils.isEmpty(gridMember)) { |
| | | eventDetailsVO.setGridMemberName(gridMember.get("name") == null ? "" : gridMember.get("name").toString()); |
| | | eventDetailsVO.setGridMemberName(gridMember.get("nick_name") == null ? "" : gridMember.get("nick_name").toString()); |
| | | eventDetailsVO.setGridMemberImageUrl(gridMember.get("image_url") == null ? "" : gridMember.get("image_url").toString()); |
| | | } |
| | | if(Objects.equals(eventDO.getGridMemberId(),eventDO.getCreateBy())){ |
| | | eventDetailsVO.setCreator(eventDetailsVO.getGridMemberName()); |
| | | }else{ |
| | | Map<String,Object> createUser = eventMapper.getUserBaseInfo(eventDO.getCreateBy()); |
| | | eventDetailsVO.setCreator(createUser.get("name") == null ? "" : createUser.get("name").toString()); |
| | | eventDetailsVO.setCreator(createUser.get("nick_name") == null ? "" : createUser.get("nick_name").toString()); |
| | | } |
| | | |
| | | //当事件为特殊人群上报时,需要查询事件与人口关联关系 |
| | |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public R eventWork(Long communityId){ |
| | | EventWorkScreenVO workScreenVO = new EventWorkScreenVO(); |
| | | String date = DateUtils.getDateFormatString(new Date(),moth_format_str); |
| | |
| | | } |
| | | return dateList; |
| | | } |
| | | |
| | | /** |
| | | * 绘制多边形统计数据 |
| | | * @param eventListDTO 请求参数 |
| | | * @return 统计数据 |
| | | */ |
| | | @Override |
| | | public R getCivilDrawList(ScreenDrawEventListDTO eventListDTO){ |
| | | |
| | | ScreenDrawEventVO drawEventVO = new ScreenDrawEventVO(); |
| | | //返回事件列表结果集 |
| | | List<EventGridIncidentStatisticsVO> eventResultList = new ArrayList<>(); |
| | | //返回小区列表结果集 |
| | | List<CivilVillageStatisticsVO> villageResultList = new ArrayList<>(); |
| | | //返回事件统计 |
| | | EventLeftDownStatisticsVO leftDownStatisticsVO = new EventLeftDownStatisticsVO(); |
| | | //返回人口统计 |
| | | ScreenDrawEventPopulationTotalVO drawEventPopulationTotalVO = new ScreenDrawEventPopulationTotalVO(); |
| | | //查询所有事件 |
| | | List<EventGridIncidentStatisticsVO> gridIncidentList = this.baseMapper.getEventListByCommunityId(eventListDTO.getCommunityId()); |
| | | if(!gridIncidentList.isEmpty()){ |
| | | gridIncidentList.forEach(gridIncident -> { |
| | | //拆分事件经纬度 |
| | | Double lng = 0.0;//经度 |
| | | Double lat = 0.0;//纬度 |
| | | String []lngLatString = gridIncident.getLatLng().split(","); |
| | | if(!gridIncident.getType().equals(7)){ |
| | | lat = Double.parseDouble(lngLatString[0]); |
| | | lng = Double.parseDouble(lngLatString[1]); |
| | | }else { |
| | | lat = Double.parseDouble(lngLatString[1]); |
| | | lng = Double.parseDouble(lngLatString[0]); |
| | | } |
| | | |
| | | //判断绘制的图形类型 |
| | | if(eventListDTO.getType().equals(ScreenDrawEventListDTO.type.yx)){ |
| | | //判断这个点是否在圆形范围内 |
| | | if(GisPointUtil.isInCircle(eventListDTO.getCenterLng(),eventListDTO.getCenterLat(),lng,lat,eventListDTO.getRadius())){ |
| | | if(eventResultList.size() <= eventListDTO.getCount()){ |
| | | eventResultList.add(gridIncident); |
| | | } |
| | | switch (gridIncident.getType()){ |
| | | case 1: |
| | | leftDownStatisticsVO.setEventZATotal(leftDownStatisticsVO.getEventZATotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventZATotal(leftDownStatisticsVO.getYesEventZATotal() + 1); |
| | | } |
| | | break; |
| | | case 2: |
| | | leftDownStatisticsVO.setEventGGTotal(leftDownStatisticsVO.getEventGGTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventGGTotal(leftDownStatisticsVO.getYesEventGGTotal() + 1); |
| | | } |
| | | break; |
| | | case 3: |
| | | leftDownStatisticsVO.setEventMDTotal(leftDownStatisticsVO.getEventMDTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventMDTotal(leftDownStatisticsVO.getYesEventMDTotal() + 1); |
| | | } |
| | | break; |
| | | case 4: |
| | | leftDownStatisticsVO.setEventBWDTotal(leftDownStatisticsVO.getEventBWDTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventBWDTotal(leftDownStatisticsVO.getYesEventBWDTotal() + 1); |
| | | } |
| | | break; |
| | | case 5: |
| | | leftDownStatisticsVO.setEventTFTotal(leftDownStatisticsVO.getEventTFTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventTFTotal(leftDownStatisticsVO.getYesEventTFTotal() + 1); |
| | | } |
| | | break; |
| | | case 6: |
| | | leftDownStatisticsVO.setEventTSTotal(leftDownStatisticsVO.getEventTSTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventTSTotal(leftDownStatisticsVO.getYesEventTSTotal() + 1); |
| | | } |
| | | break; |
| | | case 7: |
| | | leftDownStatisticsVO.setEventSSPTotal(leftDownStatisticsVO.getEventSSPTotal() + 1); |
| | | if(gridIncident.getStatus().equals(2)){ |
| | | leftDownStatisticsVO.setYesEventSSPTotal(leftDownStatisticsVO.getYesEventSSPTotal() + 1); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | }else{//多边形类型 |
| | | if(GisPointUtil.isInPolygon(lng,lat,eventListDTO.getLngLatList())){ |
| | | if(eventResultList.size() <= eventListDTO.getCount()){ |
| | | eventResultList.add(gridIncident); |
| | | } |
| | | switch (gridIncident.getType()){ |
| | | case 1: |
| | | leftDownStatisticsVO.setEventZATotal(leftDownStatisticsVO.getEventZATotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventZATotal(leftDownStatisticsVO.getYesEventZATotal() + 1); |
| | | } |
| | | break; |
| | | case 2: |
| | | leftDownStatisticsVO.setEventGGTotal(leftDownStatisticsVO.getEventGGTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventGGTotal(leftDownStatisticsVO.getYesEventGGTotal() + 1); |
| | | } |
| | | break; |
| | | case 3: |
| | | leftDownStatisticsVO.setEventMDTotal(leftDownStatisticsVO.getEventMDTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventMDTotal(leftDownStatisticsVO.getYesEventMDTotal() + 1); |
| | | } |
| | | break; |
| | | case 4: |
| | | leftDownStatisticsVO.setEventBWDTotal(leftDownStatisticsVO.getEventBWDTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventBWDTotal(leftDownStatisticsVO.getYesEventBWDTotal() + 1); |
| | | } |
| | | break; |
| | | case 5: |
| | | leftDownStatisticsVO.setEventTFTotal(leftDownStatisticsVO.getEventTFTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventTFTotal(leftDownStatisticsVO.getYesEventTFTotal() + 1); |
| | | } |
| | | break; |
| | | case 6: |
| | | leftDownStatisticsVO.setEventTSTotal(leftDownStatisticsVO.getEventTSTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventTSTotal(leftDownStatisticsVO.getYesEventTSTotal() + 1); |
| | | } |
| | | break; |
| | | case 7: |
| | | leftDownStatisticsVO.setEventSSPTotal(leftDownStatisticsVO.getEventSSPTotal() + 1); |
| | | if(gridIncident.getStatus().equals(2)){ |
| | | leftDownStatisticsVO.setYesEventSSPTotal(leftDownStatisticsVO.getYesEventSSPTotal() + 1); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | drawEventVO.setGridIncidentList(eventResultList); |
| | | drawEventVO.setLeftDownStatisticsVO(leftDownStatisticsVO); |
| | | |
| | | //查询所有小区 |
| | | List<CivilVillageStatisticsVO> villageStatisticsList = this.baseMapper.getCivilScreenVillageList(eventListDTO.getCommunityId()); |
| | | if(!villageStatisticsList.isEmpty()){ |
| | | villageStatisticsList.forEach(village -> { |
| | | //判断绘制的图形类型 |
| | | if(eventListDTO.getType().equals(ScreenDrawEventListDTO.type.yx)){ |
| | | //判断这个点是否在圆形范围内 |
| | | if(GisPointUtil.isInCircle(eventListDTO.getCenterLng(),eventListDTO.getCenterLat(),Double.parseDouble(village.getLng()),Double.parseDouble(village.getLat()),eventListDTO.getRadius())){ |
| | | villageResultList.add(village); |
| | | ScreenDrawEventPopulationTotalVO populationTotalVO = this.baseMapper.getVillagePopulationTotal(village.getVillageId()); |
| | | if(populationTotalVO != null){ |
| | | drawEventPopulationTotalVO.setVillageTotal(drawEventPopulationTotalVO.getVillageTotal() + 1); |
| | | drawEventPopulationTotalVO.setPopulationTotal(drawEventPopulationTotalVO.getPopulationTotal() + populationTotalVO.getPopulationTotal()); |
| | | drawEventPopulationTotalVO.setLocalTotal(drawEventPopulationTotalVO.getLocalTotal() + populationTotalVO.getLocalTotal()); |
| | | drawEventPopulationTotalVO.setOutTotal(drawEventPopulationTotalVO.getOutTotal() + populationTotalVO.getOutTotal()); |
| | | drawEventPopulationTotalVO.setSpecialTotal(drawEventPopulationTotalVO.getSpecialTotal() + populationTotalVO.getSpecialTotal()); |
| | | drawEventPopulationTotalVO.setBuildTotal(drawEventPopulationTotalVO.getBuildTotal() + populationTotalVO.getBuildTotal()); |
| | | } |
| | | } |
| | | }else {//多边形类型 |
| | | if(GisPointUtil.isInPolygon(Double.parseDouble(village.getLng()),Double.parseDouble(village.getLat()),eventListDTO.getLngLatList())){ |
| | | villageResultList.add(village); |
| | | ScreenDrawEventPopulationTotalVO populationTotalVO = this.baseMapper.getVillagePopulationTotal(village.getVillageId()); |
| | | if(populationTotalVO != null){ |
| | | drawEventPopulationTotalVO.setVillageTotal(drawEventPopulationTotalVO.getVillageTotal() + 1); |
| | | drawEventPopulationTotalVO.setPopulationTotal(drawEventPopulationTotalVO.getPopulationTotal() + populationTotalVO.getPopulationTotal()); |
| | | drawEventPopulationTotalVO.setLocalTotal(drawEventPopulationTotalVO.getLocalTotal() + populationTotalVO.getLocalTotal()); |
| | | drawEventPopulationTotalVO.setOutTotal(drawEventPopulationTotalVO.getOutTotal() + populationTotalVO.getOutTotal()); |
| | | drawEventPopulationTotalVO.setSpecialTotal(drawEventPopulationTotalVO.getSpecialTotal() + populationTotalVO.getSpecialTotal()); |
| | | drawEventPopulationTotalVO.setBuildTotal(drawEventPopulationTotalVO.getBuildTotal() + populationTotalVO.getBuildTotal()); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | drawEventVO.setVillageStatisticsList(villageResultList); |
| | | drawEventVO.setDrawEventPopulationTotalVO(drawEventPopulationTotalVO); |
| | | return R.ok(drawEventVO); |
| | | } |
| | | |
| | | /** |
| | | * 大屏-根据小区id查询小区统计人数 |
| | | * @param villageId 小区id |
| | | * @return 小区统计数据 |
| | | */ |
| | | @Override |
| | | public R civilVillageStatistics(Long villageId){ |
| | | ScreenDrawEventPopulationTotalVO result = this.baseMapper.getVillagePopulationTotal(villageId); |
| | | result.setVillageTotal(1); |
| | | return R.ok(result); |
| | | } |
| | | } |
| | |
| | | AND community_id = #{communityId} |
| | | </select> |
| | | |
| | | <select id="getEventListByCommunityId" parameterType="Long" |
| | | resultType="com.panzhihua.common.model.vos.community.screen.event.EventGridIncidentStatisticsVO"> |
| | | SELECT |
| | | e.id, |
| | | e.event_type AS type, |
| | | e.happent_lat_lng AS latLng, |
| | | e.event_deal_status as status |
| | | FROM |
| | | `event` AS e |
| | | left join event_grid_data as egd on egd.id = e.grid_id |
| | | WHERE |
| | | e.event_category = 1 |
| | | AND e.event_status = 2 |
| | | AND egd.grid_community_id = #{communityId} |
| | | AND e.event_deal_status IN (1,2,3,4) |
| | | union all |
| | | select id,7 as type,lng_lat as latLng,handle_status as status from com_act_easy_photo as caep where community_id = #{communityId} and lng_lat is not null |
| | | </select> |
| | | |
| | | <select id="getCivilScreenVillageList" parameterType="Long" resultType="com.panzhihua.common.model.vos.community.screen.civil.CivilVillageStatisticsVO"> |
| | | SELECT `NAME`, user_sum, lng, lat, village_images, village_id FROM com_mng_village AS cmv WHERE community_id = #{communityId} |
| | | </select> |
| | | |
| | | <select id="getVillagePopulationTotal" parameterType="Long" resultType="com.panzhihua.common.model.vos.screen.ScreenDrawEventPopulationTotalVO"> |
| | | SELECT |
| | | count( id ) as populationTotal, |
| | | (select count(id) from com_mng_population where village_id = #{villageId} and out_or_local = 1) as localTotal, |
| | | (select count(id) from com_mng_population where village_id = #{villageId} and out_or_local = 2) as localTotal, |
| | | (select count(id) from com_mng_population where village_id = #{villageId} and label is not null) as specialTotal, |
| | | (select count(id) from com_mng_building where village_id = #{villageId}) as buildTotal |
| | | FROM |
| | | com_mng_population AS cmp |
| | | WHERE |
| | | village_id = #{villageId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | "com_pb_activity a\n" + |
| | | "left join sys_user u on a.create_by=u.user_id \n" + |
| | | "where a.community_id=#{partyBuildingActivityVO.communityId}\n" + |
| | | " and a.`status` not in(5,6) \n"+ |
| | | "<if test='partyBuildingActivityVO.name != null and partyBuildingActivityVO.name.trim() != ""'>" + |
| | | "and a.name = #{partyBuildingActivityVO.name} \n" + |
| | | " </if> " + |
| | | "<if test='partyBuildingActivityVO.isAppliets != null and partyBuildingActivityVO.isAppliets==1'>" + |
| | | " and a.`status` not in(5,6) " + |
| | | " </if> " + |
| | | "<if test='partyBuildingActivityVO.status != null and partyBuildingActivityVO.status != 0 and partyBuildingActivityVO.isAppliets ==null '>" + |
| | | "AND a.`status` = #{partyBuildingActivityVO.status} \n" + |
| | | " </if> " + |
| | |
| | | return userService.getGridIsOk(userId); |
| | | } |
| | | |
| | | @GetMapping("getGridsMemberList") |
| | | public R getGridsMemberList(@RequestParam("communityId") Long communityId) { |
| | | return userService.getGridsMemberList(communityId); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.community.screen.event.EventGridMemberVO; |
| | | import com.panzhihua.common.model.vos.grid.GridMemberVO; |
| | | import com.panzhihua.common.model.vos.user.AdministratorsUserVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | |
| | | @Select("select count(id) from event_grid_member_relation where grid_member_id = #{userId}") |
| | | Integer getGridIsOk(@Param("userId") Long userId); |
| | | |
| | | @Select("select user_id,nick_name,phone from sys_user where type = 6 and community_id = #{communityId} limit 3") |
| | | List<EventGridMemberVO> getGridsMemberList(@Param("communityId") Long communityId); |
| | | |
| | | } |
| | |
| | | R listAgreements(Long communityId); |
| | | |
| | | R getGridIsOk(Long userId); |
| | | |
| | | R getGridsMemberList(Long communityId); |
| | | } |
| | |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public R getGridsMemberList(Long communityId){ |
| | | return R.ok(this.userDao.getGridsMemberList(communityId)); |
| | | } |
| | | } |