tangxiaobao
2021-07-16 503135f1f8a7cfed29cac1786a6a7c8758eed8d3
Merge remote-tracking branch 'origin/test' into txb
26个文件已修改
3个文件已添加
493 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/api/LoginApi.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/service/LoginService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/service/impl/LoginServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/enums/EventStatusEnum.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/bigscreen/BigScreenEventDTO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/EventGridCascadeListDTO.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginReturnsVO.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/EventMapGridCascadeVO.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/grid/GridService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/user/UserService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/LoginApi.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/MapApi.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java 115 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/api/MapApi.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/dao/EventGridMemberRelationMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/model/dos/EventGridDataDO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/EventGridMemberRelationService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventGridDataServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventGridMemberRelationServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventVisitingTasksServiceImpl.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventGridDataMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventGridMemberRelationMapper.xml 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventVisitingTasksMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/api/UserApi.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/UserService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/api/LoginApi.java
@@ -5,6 +5,7 @@
import com.panzhihua.common.exceptions.TokenException;
import com.panzhihua.common.exceptions.UnAuthenticationException;
import com.panzhihua.common.model.vos.LoginReturnVO;
import com.panzhihua.common.model.vos.LoginReturnsVO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.utlis.JWTTokenUtil;
@@ -153,7 +154,7 @@
     */
    @PostMapping("/loginGridApp")
    public R loginGridApp(@RequestParam("account") String account, @RequestParam("password") String password) {
        LoginReturnVO loginReturnVO = loginService.loginGridApp(account, password);
        LoginReturnsVO loginReturnVO = loginService.loginGridApp(account, password);
        return R.ok(loginReturnVO);
    }
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/service/LoginService.java
@@ -1,6 +1,7 @@
package com.panzhihua.auth.service;
import com.panzhihua.common.model.vos.LoginReturnVO;
import com.panzhihua.common.model.vos.LoginReturnsVO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
/**
@@ -63,7 +64,7 @@
     * @param password 密码
     * @return 登录结果
     */
    LoginReturnVO loginGridApp(String account, String password);
    LoginReturnsVO loginGridApp(String account, String password);
    /**
     * 网格综治后台登录
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/service/impl/LoginServiceImpl.java
@@ -3,6 +3,7 @@
import com.panzhihua.auth.service.LoginService;
import com.panzhihua.common.constants.TokenConstant;
import com.panzhihua.common.model.vos.LoginReturnVO;
import com.panzhihua.common.model.vos.LoginReturnsVO;
import com.panzhihua.common.utlis.JWTTokenUtil;
import com.panzhihua.common.constants.UserConstants;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
@@ -155,16 +156,17 @@
     * @return 登录结果
     */
    @Override
    public LoginReturnVO loginGridApp(String account, String password) {
    public LoginReturnsVO loginGridApp(String account, String password) {
        Authentication authentication = null;
        authentication = authenticationManager
                .authenticate(new UsernamePasswordAuthenticationToken(account+"_6", password));
        LoginUserInfoVO loginUser = (LoginUserInfoVO) authentication.getPrincipal();
        String token = JWTTokenUtil.generateToken(loginUser);
        String refeshToken = JWTTokenUtil.generateRefeshToken(loginUser);
        LoginReturnVO loginReturnVO=new LoginReturnVO();
        LoginReturnsVO loginReturnVO=new LoginReturnsVO();
        loginReturnVO.setToken(token);
        loginReturnVO.setRefreshToken(refeshToken);
        loginReturnVO.setUserId(loginUser.getUserId());
        return loginReturnVO;
    }
@@ -188,4 +190,5 @@
        loginReturnVO.setRefreshToken(refeshToken);
        return loginReturnVO;
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/enums/EventStatusEnum.java
@@ -10,8 +10,8 @@
@Getter
public enum EventStatusEnum
{
    DCL(1, "待处理"),
    YJJ(2, "已解决"),
    DCL(1, "待走访"),
    YJJ(2, "已走访"),
    DYZ(3, "待验证"),
    CGX(4, "草稿箱"),
    YCX(5, "已撤销"),
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/bigscreen/BigScreenEventDTO.java
@@ -17,4 +17,13 @@
    @ApiModelProperty(value = "查询结束时间")
    private String endTime;
    @ApiModelProperty(value = "事件状态(1待处理2已解决3待验证)")
    private Integer eventProcessStatus;
    @ApiModelProperty(value = "是否红牌(1.是 0.否)")
    private Integer redCard;
    @ApiModelProperty(value = "是否黄牌(1.是 0.否)")
    private Integer yellowCard;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/grid/EventGridCascadeListDTO.java
New file
@@ -0,0 +1,27 @@
package com.panzhihua.common.model.dtos.grid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("网格列表级联请求参数")
public class EventGridCascadeListDTO {
    @ApiModelProperty(value = "类型(1.社区  2.网格)")
    private Integer type;
    @ApiModelProperty(value = "登陆用户id",hidden = true)
    private Long userId;
    @ApiModelProperty(value = "社区id")
    private Long communityId;
    /**
     * 类型(1.社区  2.网格)
     */
    public interface type{
        int sq = 1;
        int wg = 2;
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginReturnsVO.java
New file
@@ -0,0 +1,22 @@
package com.panzhihua.common.model.vos;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 登录返回
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2020-11-27 08:55
 **/
@Data
@ApiModel(value = "登录返回体")
public class LoginReturnsVO {
    @ApiModelProperty("接口请求令牌")
    private String token;
    @ApiModelProperty("刷新token有效期长")
    private String refreshToken;
    @ApiModelProperty("用户id")
    private Long userId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/grid/EventMapGridCascadeVO.java
New file
@@ -0,0 +1,28 @@
package com.panzhihua.common.model.vos.grid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * 地图模块-网格员绑定的网格信息
 */
@Data
@ApiModel("地图模块-网格员绑定的网格信息")
public class EventMapGridCascadeVO {
    @ApiModelProperty("网格id")
    private Long gridId;
    @ApiModelProperty("网格名字")
    private String gridName;
    @ApiModelProperty("网格所属社区id")
    private Long gridCommunityId;
    @ApiModelProperty("社区下网格列表")
    private List<EventMapGridCascadeVO> childList;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/grid/GridService.java
@@ -1224,4 +1224,20 @@
     */
    @GetMapping("/eventgriddata/lc/list")
    R getLcGridLists();
    /**
     * 首页查询网格级联列表
     * @param cascadeListDTO    请求参数
     * @return  网格列表
     */
    @PostMapping("/map/getMapGridListsByApp")
    R getMapGridListsByApp(@RequestBody EventGridCascadeListDTO cascadeListDTO);
    /**
     * 首页查询网格级联列表2
     * @param userId    用户id
     * @return  网格列表
     */
    @PostMapping("/map/getMapGridsListsByApp")
    R getMapGridsListsByApp(@RequestParam("userId") Long userId);
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/user/UserService.java
@@ -768,4 +768,7 @@
     */
    @PostMapping("listagreements")
    R listAgreements(@RequestParam("communityId")Long communityId);
    @PostMapping("user/getUserGrids")
    R getGridIsOk(@RequestParam("userId")Long userId);
}
springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/LoginApi.java
@@ -1,13 +1,19 @@
package com.panzhihua.grid_app.api;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.vos.LoginReturnVO;
import com.panzhihua.common.model.vos.LoginReturnsVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComMngStructAreaVO;
import com.panzhihua.common.service.auth.TokenService;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.grid_app.model.vos.LoginBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
@@ -22,6 +28,8 @@
public class LoginApi extends BaseController {
    @Resource
    private TokenService tokenService;
    @Resource
    private UserService userService;
    @ApiOperation(value = "网格综治APP登录",response = LoginReturnVO.class)
    @PostMapping("login")
@@ -34,6 +42,19 @@
            return R.fail("账户密码不能为空");
        }
        R r = tokenService.loginGridApp(account, password);
        if(R.isOk(r)){
            LoginReturnsVO returnsVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), LoginReturnsVO.class);
            //查询用户是否绑定网格,如果未绑定则提示用户
            R r1 = userService.getGridIsOk(returnsVO.getUserId());
            if(R.isOk(r1)){
                LoginReturnVO returnVO = new LoginReturnVO();
                BeanUtils.copyProperties(returnsVO,returnVO);
                r.setData(returnVO);
                return r;
            }else {
                return R.fail("请联系管理员创建网格管理权限");
            }
        }
        return r;
    }
springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/MapApi.java
@@ -1,18 +1,17 @@
package com.panzhihua.grid_app.api;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.grid.EventGridCascadeListDTO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.grid.ComMapGridDetailVO;
import com.panzhihua.common.model.vos.grid.EventMapGridCascadeVO;
import com.panzhihua.common.model.vos.grid.EventMapGridVO;
import com.panzhihua.common.model.vos.grid.EventMapTrajectoryVO;
import com.panzhihua.common.service.grid.GridService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -56,4 +55,28 @@
        return gridService.getMapGridListByApp(userInfoVO.getUserId());
    }
    @ApiOperation(value = "查询网格员关联网格列表级联-lyq",response = EventMapGridVO.class)
    @PostMapping("getGridLists")
    public R getGridLists(@RequestBody EventGridCascadeListDTO cascadeListDTO){
        LoginUserInfoVO userInfoVO = this.getLoginUserInfo();
        if(userInfoVO == null || userInfoVO.getUserId() == null){
            return R.fail("请先登录");
        }
        if(cascadeListDTO.getType() == null){
            return R.fail("参数错误");
        }
        cascadeListDTO.setUserId(userInfoVO.getUserId());
        return gridService.getMapGridListsByApp(cascadeListDTO);
    }
    @ApiOperation(value = "查询网格员关联网格列表级联2-lyq",response = EventMapGridCascadeVO.class)
    @PostMapping("getGridsLists")
    public R getGridsLists(){
        LoginUserInfoVO userInfoVO = this.getLoginUserInfo();
        if(userInfoVO == null || userInfoVO.getUserId() == null){
            return R.fail("请先登录");
        }
        return gridService.getMapGridsListsByApp(userInfoVO.getUserId());
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -266,7 +266,7 @@
            "(select city_name from com_mng_struct_area_city where city_adcode = #{cityCode}) as city," +
            "(select district_name from com_mng_struct_area_district where district_adcode = #{districtCode}) as district" +
            "</script>")
    AreaAddressVO getAreaAddress(@Param("provinceCode") String provinceCode,@Param("cityCode") String cityCode,@Param("districtCode") String districtCode);
    AreaAddressVO getAreaAddress(@Param("provinceCode") String provinceCode, @Param("cityCode") String cityCode, @Param("districtCode") String districtCode);
    @Select("select count(id) as populationTotal " +
            ",(select count(id) from com_mng_population where act_id = #{communityId} and out_or_local = 1) as localTotal " +
@@ -456,6 +456,11 @@
            " count( egd.id ) AS gridTotal, " +
            " ( SELECT count( user_id ) FROM sys_user WHERE community_id = egd.grid_community_id AND type = 6 ) AS gridMemberTotal, " +
            " ( " +
            " SELECT " +
            "  count( e.id )  " +
            " FROM " +
            "  `event` AS e " +
            "  LEFT JOIN event_grid_data AS egd1 ON e.grid_id = egd1.id  " +
            " WHERE " +
            "  egd1.grid_community_id = egd.grid_community_id  " +
            "  AND event_status = 2  " +
@@ -468,6 +473,10 @@
            " ) AS eventTotal, " +
            " ( " +
            " SELECT " +
            "  count( e1.id )  " +
            " FROM " +
            "  `event` AS e1 " +
            "  LEFT JOIN event_grid_data AS egd2 ON e1.grid_id = egd2.id  " +
            " WHERE " +
            "  egd2.grid_community_id = egd.grid_community_id  " +
            "  AND event_status = 2  " +
@@ -480,6 +489,11 @@
            " AND event_deal_status IN ( 1, 2, 3 )) AS noSolveEventTotal, " +
            " ( " +
            " SELECT " +
            "  count( e1.id )  " +
            " FROM " +
            "  `event` AS e1 " +
            "  LEFT JOIN event_grid_data AS egd2 ON e1.grid_id = egd2.id  " +
            " WHERE " +
            "  egd2.grid_community_id = egd.grid_community_id  " +
            "  AND event_status = 2  " +
            "  AND event_deal_status = 4  " +
@@ -519,11 +533,12 @@
            " count( e.id ) AS eventZATotal, " +
            " IFNULL(( " +
            "  SELECT " +
            "   count( e1.id )  " +
            "  FROM " +
            "   `event` AS e1 " +
            "   LEFT JOIN event_grid_data AS egd1 ON egd1.id = e1.grid_id  " +
            "  WHERE " +
            "   egd1.grid_community_id = #{screenEventDTO.communityId}  " +
            "   egd1.grid_community_id = #{communityId}  " +
            "   AND event_category = 1  " +
            "   AND event_type = 1  " +
            "   AND event_deal_status = 4  " +
@@ -536,11 +551,14 @@
            "   ), " +
            "  0  " +
            " ) AS yesEventZATotal, " +
            " IFNULL(( " +
            "  SELECT " +
            "   count( e2.id )  " +
            "  FROM " +
            "   `event` AS e2 " +
            "   LEFT JOIN event_grid_data AS egd2 ON egd2.id = e2.grid_id  " +
            "  WHERE " +
            "   egd2.grid_community_id = #{screenEventDTO.communityId}  " +
            "   egd2.grid_community_id = #{communityId}  " +
            "   AND event_category = 1  " +
            "   AND event_type = 5  " +
            "   AND event_status = 2  " +
@@ -553,11 +571,14 @@
            "   ), " +
            "  0  " +
            " ) AS eventTFTotal, " +
            " IFNULL(( " +
            "  SELECT " +
            "   count( e3.id )  " +
            "  FROM " +
            "   `event` AS e3 " +
            "   LEFT JOIN event_grid_data AS egd3 ON egd3.id = e3.grid_id  " +
            "  WHERE " +
            "   egd3.grid_community_id = #{screenEventDTO.communityId}  " +
            "   egd3.grid_community_id = #{communityId}  " +
            "   AND event_category = 1  " +
            "   AND event_type = 5  " +
            "   AND event_deal_status = 4  " +
@@ -570,11 +591,14 @@
            "   ), " +
            "  0  " +
            " ) AS yesEventTFTotal, " +
            " IFNULL(( " +
            "  SELECT " +
            "   count( e4.id )  " +
            "  FROM " +
            "   `event` AS e4 " +
            "   LEFT JOIN event_grid_data AS egd4 ON egd4.id = e4.grid_id  " +
            "  WHERE " +
            "   egd4.grid_community_id = #{screenEventDTO.communityId}  " +
            "   egd4.grid_community_id = #{communityId}  " +
            "   AND event_category = 1  " +
            "   AND event_type = 6  " +
            "   AND event_status = 2  " +
@@ -587,11 +611,14 @@
            "   ), " +
            "  0  " +
            " ) AS eventTSTotal, " +
            " IFNULL(( " +
            "  SELECT " +
            "   count( e5.id )  " +
            "  FROM " +
            "   `event` AS e5 " +
            "   LEFT JOIN event_grid_data AS egd5 ON egd5.id = e5.grid_id  " +
            "  WHERE " +
            "   egd5.grid_community_id = #{screenEventDTO.communityId}  " +
            "   egd5.grid_community_id = #{communityId}  " +
            "   AND event_category = 1  " +
            "   AND event_type = 6  " +
            "   AND event_deal_status = 4  " +
@@ -604,11 +631,14 @@
            "   ), " +
            "  0  " +
            " ) AS yesEventTSTotal, " +
            " IFNULL(( " +
            "  SELECT " +
            "   count( e6.id )  " +
            "  FROM " +
            "   `event` AS e6 " +
            "   LEFT JOIN event_grid_data AS egd6 ON egd6.id = e6.grid_id  " +
            "  WHERE " +
            "   egd6.grid_community_id = #{screenEventDTO.communityId}  " +
            "   egd6.grid_community_id = #{communityId}  " +
            "   AND event_category = 1  " +
            "   AND event_type = 3  " +
            "   AND event_status = 2  " +
@@ -621,11 +651,14 @@
            "   ), " +
            "  0  " +
            " ) AS eventMDTotal, " +
            " IFNULL(( " +
            "  SELECT " +
            "   count( e7.id )  " +
            "  FROM " +
            "   `event` AS e7 " +
            "   LEFT JOIN event_grid_data AS egd7 ON egd7.id = e7.grid_id  " +
            "  WHERE " +
            "   egd7.grid_community_id = #{screenEventDTO.communityId}  " +
            "   egd7.grid_community_id = #{communityId}  " +
            "   AND event_category = 1  " +
            "   AND event_type = 3  " +
            "   AND event_deal_status = 4  " +
@@ -638,11 +671,14 @@
            "   ), " +
            "  0  " +
            " ) AS yesEventMDTotal, " +
            " IFNULL(( " +
            "  SELECT " +
            "   count( e8.id )  " +
            "  FROM " +
            "   `event` AS e8 " +
            "   LEFT JOIN event_grid_data AS egd8 ON egd8.id = e8.grid_id  " +
            "  WHERE " +
            "   egd8.grid_community_id = #{screenEventDTO.communityId}  " +
            "   egd8.grid_community_id = #{communityId}  " +
            "   AND event_category = 1  " +
            "   AND event_type = 4  " +
            "   AND event_status = 2  " +
@@ -655,11 +691,14 @@
            "   ), " +
            "  0  " +
            " ) AS eventBWDTotal, " +
            " IFNULL(( " +
            "  SELECT " +
            "   count( e9.id )  " +
            "  FROM " +
            "   `event` AS e9 " +
            "   LEFT JOIN event_grid_data AS egd9 ON egd9.id = e9.grid_id  " +
            "  WHERE " +
            "   egd9.grid_community_id = #{screenEventDTO.communityId}  " +
            "   egd9.grid_community_id = #{communityId}  " +
            "   AND event_category = 1  " +
            "   AND event_type = 4  " +
            "   AND event_deal_status = 4  " +
@@ -672,11 +711,14 @@
            "   ), " +
            "  0  " +
            " ) AS yesEventBWDTotal, " +
            " IFNULL(( " +
            "  SELECT " +
            "   count( e10.id )  " +
            "  FROM " +
            "   `event` AS e10 " +
            "   LEFT JOIN event_grid_data AS egd10 ON egd10.id = e10.grid_id  " +
            "  WHERE " +
            "   egd10.grid_community_id = #{screenEventDTO.communityId}  " +
            "   egd10.grid_community_id = #{communityId}  " +
            "   AND event_category = 1  " +
            "   AND event_type = 2  " +
            "   AND event_status = 2  " +
@@ -689,11 +731,14 @@
            "   ), " +
            "  0  " +
            " ) AS eventGGTotal, " +
            " IFNULL(( " +
            "  SELECT " +
            "   count( e11.id )  " +
            "  FROM " +
            "   `event` AS e11 " +
            "   LEFT JOIN event_grid_data AS egd11 ON egd11.id = e11.grid_id  " +
            "  WHERE " +
            "   egd11.grid_community_id = #{screenEventDTO.communityId}  " +
            "   egd11.grid_community_id = #{communityId}  " +
            "   AND event_category = 1  " +
            "   AND event_type = 2  " +
            "   AND event_deal_status = 4  " +
@@ -722,16 +767,11 @@
            " AND create_at <![CDATA[<=]]> #{screenEventDTO.endTime} " +
            " </if> " +
            "), 0 ) AS yesEventSSPTotal  " +
            " IFNULL(( SELECT count( id ) FROM com_act_easy_photo WHERE del_tag = 0 AND handle_status IS NOT NULL AND community_id = #{communityId} ), 0 ) AS eventSSPTotal, " +
            " IFNULL(( SELECT count( id ) FROM com_act_easy_photo WHERE del_tag = 0 AND handle_status = 2 AND community_id = #{communityId} ), 0 ) AS yesEventSSPTotal  " +
            "FROM " +
            " `event` AS e " +
            " LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id  " +
            "WHERE " +
            " egd.grid_community_id = #{screenEventDTO.communityId}  " +
            " egd.grid_community_id = #{communityId}  " +
            " AND event_category = 1  " +
            " AND event_type = 1  " +
            " AND event_status = 2 " +
            "<if test='screenEventDTO.startTime != null and screenEventDTO.startTime != &quot;&quot;'>" +
            " AND e.create_at <![CDATA[>=]]> #{screenEventDTO.startTime} " +
@@ -788,6 +828,10 @@
            " event_type AS type, " +
            " e.id AS eventId, " +
            " happent_lat_lng AS latLng  " +
            "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_type IN ( 1, 2, 3, 4, 5, 6 )  " +
            " AND e.event_status = 2  " +
@@ -798,10 +842,16 @@
            "<if test='screenEventDTO.endTime != null and screenEventDTO.endTime != &quot;&quot;'>" +
            " AND e.create_at <![CDATA[<=]]> #{screenEventDTO.endTime} " +
            " </if> " +
            "<if test='screenEventDTO.eventProcessStatus != null'>" +
            " AND e.event_process_status = #{screenEventDTO.eventProcessStatus} " +
            " </if> " +
            "<if test='screenEventDTO.redCard != null'>" +
            " AND e.red_card = #{screenEventDTO.redCard} " +
            " </if> " +
            "<if test='screenEventDTO.yellowCard != null'>" +
            " AND e.yellow_card = #{screenEventDTO.yellowCard} " +
            " </if> " +
            "UNION ALL SELECT " +
            " AND egd.grid_community_id = #{communityId}  " +
            " AND e.create_at >= DATE_SUB(CURDATE(),INTERVAL 30 DAY) UNION ALL " +
            "SELECT " +
            " IFNULL( NULL, 7 ) AS type, " +
            " id AS eventId, " +
            " lng_lat AS latLng  " +
@@ -809,14 +859,14 @@
            " com_act_easy_photo  " +
            "WHERE " +
            " community_id = #{screenEventDTO.communityId}  " +
            " community_id = #{communityId}  " +
            " AND del_tag = 0  " +
            " AND lng_lat IS NOT NULL  " +
            "<if test='screenEventDTO.startTime != null and screenEventDTO.startTime != &quot;&quot;'>" +
            " AND create_at <![CDATA[>=]]> #{screenEventDTO.startTime} " +
            " </if> " +
            "<if test='screenEventDTO.endTime != null and screenEventDTO.endTime != &quot;&quot;'>" +
            " AND create_at <![CDATA[<=]]> #{screenEventDTO.endTime} " +
            " </if> " +
            "<if test='screenEventDTO.eventProcessStatus != null'>" +
            " AND handle_status = #{screenEventDTO.eventProcessStatus} " +
            " </if> " +
            " </script>")
    List<EventGridIncidentStatisticsVO> getEventScreenEventList(@Param("screenEventDTO") BigScreenEventDTO screenEventDTO);
@@ -830,7 +880,7 @@
            "WHERE " +
            " label IS NOT NULL  " +
            " AND act_id = #{communityId}")
    CivilPopulationStatisticsVO getCivilScreenPopulation(@Param("communityId") Long communityId,@Param("lastMonth") Date lastMonth);
    CivilPopulationStatisticsVO getCivilScreenPopulation(@Param("communityId") Long communityId, @Param("lastMonth") Date lastMonth);
    @Select("SELECT `NAME`, " +
            " user_sum, " +
@@ -873,7 +923,7 @@
                    "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 45 and aa.age<= 55) AS age55," +
                    "(SELECT COUNT(aa.age) FROM " +
                    "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 55) AS age55over")
    Map<String, Long> countByAge(@Param("communityId")Long communityId);
    Map<String, Long> countByAge(@Param("communityId") Long communityId);
    @Select("SELECT COUNT(id)AS xx," +
            "(SELECT COUNT(id) FROM com_mng_population WHERE culture_level = 2 AND act_id = #{communityId}) as cz," +
@@ -885,10 +935,10 @@
            "(SELECT COUNT(id) FROM com_mng_population WHERE culture_level = 8 AND act_id = #{communityId}) as bs," +
            "(SELECT COUNT(id) FROM com_mng_population WHERE culture_level = 9 AND act_id = #{communityId}) as qt" +
            " FROM com_mng_population WHERE culture_level = 1 AND act_id = #{communityId}")
    Map<String, Long> countByCulture(@Param("communityId")Long communityId);
    Map<String, Long> countByCulture(@Param("communityId") Long communityId);
    @Select("select count(user_id) from sys_user where community_id = #{communityId} and type = 1")
    Long countUsedCommunityPopulation(@Param("communityId")Long communityId);
    Long countUsedCommunityPopulation(@Param("communityId") Long communityId);
    @Select(
            "SELECT " +
@@ -904,7 +954,7 @@
                    "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 45 and aa.age<= 55) AS age55," +
                    "(SELECT COUNT(aa.age) FROM " +
                    "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, birthday, CURDATE()) ) AS age FROM com_mng_population WHERE act_id = #{communityId}) AS aa WHERE aa.age > 55) AS age55over")
    Map<String, Long> indexCountByAge(@Param("communityId")Long communityId);
    Map<String, Long> indexCountByAge(@Param("communityId") Long communityId);
    @Select("SELECT " +
@@ -923,7 +973,7 @@
            " LEFT JOIN sys_user AS su ON su.user_id = caep.sponsor_id  " +
            "WHERE " +
            " id = #{eventId}")
    EventNewStatisticsVO getEventScreenSSPDateil(@Param("eventId")Long eventId);
    EventNewStatisticsVO getEventScreenSSPDateil(@Param("eventId") Long eventId);
    @Select("SELECT " +
            " su.nick_name AS userName, " +
@@ -1063,7 +1113,7 @@
            "AND population.eventStatus = #{populationListDTO.eventStatus} " +
            " </if> " +
            " </script>")
    IPage<ComMngPopulationListVO> getGridPopulationAdminList(Page page,@Param("populationListDTO") ComMngPopulationListDTO populationListDTO);
    IPage<ComMngPopulationListVO> getGridPopulationAdminList(Page page, @Param("populationListDTO") ComMngPopulationListDTO populationListDTO);
    @Select("select relation from com_mng_population_house_user where house_id = #{houseId} and popul_id = #{populationId}")
    Integer getPopulationRelationByHouseId(@Param("houseId") Long houseId, @Param("populationId") Long populationId);
@@ -1098,7 +1148,7 @@
            "</foreach>" +
            " </if> " +
            " </script>")
    IPage<EventSpecialPopulationVO> getBuildingHousePopulationList(Page page,@Param("populationDTO") PageComMngPopulationDTO populationDTO);
    IPage<EventSpecialPopulationVO> getBuildingHousePopulationList(Page page, @Param("populationDTO") PageComMngPopulationDTO populationDTO);
    @Select("<script> " +
            "SELECT " +
@@ -1191,6 +1241,7 @@
            " AND label like concat ('%',#{villagePopulationDTO.label},'%')  " +
            " </if> " +
            " </script>")
    IPage<ComMngVillagePopulationListVO> getVillagePopulationAdmin(Page page,@Param("villagePopulationDTO") PageComMngVillagePopulationDTO villagePopulationDTO);
    IPage<ComMngVillagePopulationListVO> getVillagePopulationAdmin(Page page, @Param("villagePopulationDTO") PageComMngVillagePopulationDTO villagePopulationDTO);
}
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/api/MapApi.java
@@ -1,5 +1,6 @@
package com.panzhihua.service_grid.api;
import com.panzhihua.common.model.dtos.grid.EventGridCascadeListDTO;
import com.panzhihua.common.model.dtos.grid.EventGridMemberWainDTO;
import com.panzhihua.common.model.dtos.grid.EventGridMemberWorkTrajectoryDTO;
import com.panzhihua.common.model.vos.R;
@@ -83,4 +84,14 @@
        return eventGridMemberWarnLogService.gridMemberWorkWarning(gridMemberWainDTO);
    }
    @PostMapping("getMapGridListsByApp")
    public R getMapGridListsByApp(@RequestBody EventGridCascadeListDTO cascadeListDTO){
        return eventGridMemberRelationService.getMapGridListsByApp(cascadeListDTO);
    }
    @PostMapping("getMapGridsListsByApp")
    public R getMapGridsListsByApp(@RequestParam("userId") Long userId){
        return eventGridMemberRelationService.getMapGridsListsByApp(userId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/dao/EventGridMemberRelationMapper.java
@@ -4,8 +4,10 @@
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.grid.EventGridCascadeListDTO;
import com.panzhihua.common.model.dtos.grid.MemberStatisticsAdminDTO;
import com.panzhihua.common.model.dtos.grid.PageEventGridMemberRelationDTO;
import com.panzhihua.common.model.vos.grid.EventMapGridCascadeVO;
import com.panzhihua.common.model.vos.grid.EventMapGridVO;
import com.panzhihua.common.model.vos.grid.EventStatisticsMemberAdminVO;
import com.panzhihua.common.model.vos.grid.admin.GridMemberCascadeVO;
@@ -62,4 +64,8 @@
    Integer getBuildingCount(@Param("villageId") Long villageId);
    List<EventMapGridVO> getMapGridListsByApp(@Param("cascadeListDTO") EventGridCascadeListDTO cascadeListDTO);
    List<EventMapGridCascadeVO> getMapGridsListsByApp(@Param("userId") Long userId, @Param("type") Integer type, @Param("communityId") Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/model/dos/EventGridDataDO.java
@@ -72,6 +72,7 @@
    /**
     * 备注   列: remarks
     */
    @TableField(fill = FieldFill.UPDATE)
    private String remarks;
    /**
     * 围栏数据   列: data
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/EventGridMemberRelationService.java
@@ -69,6 +69,10 @@
    R gridMemberCascadeList(EventGridMemberCascadeAddDTO memberCascadeAddDTO);
    R getMapGridListsByApp(EventGridCascadeListDTO cascadeListDTO);
    R getMapGridsListsByApp(Long userId);
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventGridDataServiceImpl.java
@@ -231,6 +231,7 @@
        EventGridDataDO gridDataDO = this.baseMapper.selectById(eventGridDataDTO.getGridId());
        if(gridDataDO != null){
            BeanUtils.copyProperties(eventGridDataDTO,gridDataDO);
            gridDataDO.setRemarks(eventGridDataDTO.getRemarks());
            gridDataDO.setUpdateBy(eventGridDataDTO.getUserId());
            if(this.baseMapper.updateById(gridDataDO) > 0){
                //移除网格员和网格关系
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventGridMemberRelationServiceImpl.java
@@ -8,6 +8,8 @@
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.grid.EventGridMemberRelationDetailsVO;
import com.panzhihua.common.model.vos.grid.EventGridMemberRelationVO;
import com.panzhihua.common.model.vos.grid.EventMapGridCascadeVO;
import com.panzhihua.common.model.vos.grid.EventMapGridVO;
import com.panzhihua.common.model.vos.grid.admin.GridMemberCascadeVO;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.service_grid.dao.*;
@@ -160,4 +162,25 @@
        return R.ok(result);
    }
    @Override
    public R getMapGridListsByApp(EventGridCascadeListDTO cascadeListDTO){
        return R.ok(eventGridMemberRelationMapper.getMapGridListsByApp(cascadeListDTO));
    }
    @Override
    public R getMapGridsListsByApp(Long userId){
        List<EventMapGridCascadeVO> resultList = new ArrayList<>();
        List<EventMapGridCascadeVO> list = this.eventGridMemberRelationMapper.getMapGridsListsByApp(userId,1,null);
        if(!list.isEmpty()){
            list.forEach(gridCascadeVO -> {
                List<EventMapGridCascadeVO> childList = this.eventGridMemberRelationMapper.getMapGridsListsByApp(userId,2,gridCascadeVO.getGridId());
                if(!childList.isEmpty()){
                    gridCascadeVO.setChildList(childList);
                    resultList.add(gridCascadeVO);
                }
            });
        }
        return R.ok(resultList);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
@@ -293,13 +293,15 @@
        if (eventGridDataDO == null) {
            return R.fail("网格不存在");
        }
        eventDO.setGridMemberCommunity(eventGridDataDO.getGridCommunityId());
        eventDO.setGridMemberStreet(eventGridDataDO.getGridStreetId());
        //检查特殊人群上报时参数
        if(commonEventAddDTO.getEventType().equals(6)){
            if(commonEventAddDTO.getPopulationIds() == null || commonEventAddDTO.getPopulationIds().size() <= 0){
                return R.fail("上报人员为空");
            }
        }
//        if(commonEventAddDTO.getEventType().equals(6)){
//            if(commonEventAddDTO.getPopulationIds() == null || commonEventAddDTO.getPopulationIds().size() <= 0){
//                return R.fail("上报人员为空");
//            }
//        }
        eventDO.setEventCategory(1l);//办件事件
        eventDO.setEventStatus(2);//事件状态 2发布
@@ -311,20 +313,22 @@
        eventDO.setCreateBy(commonEventAddDTO.getUserId());
        eventDO.setSubmitDate(new Date());
        eventDO.setOrderSn(getEventOrderSn(eventDO.getEventType()));
        if (eventMapper.insert(eventDO) == 1) {
        if (eventMapper.insert(eventDO) == 1) {
            //如果是特殊人群,则新增特殊人群与事件关系
            if(commonEventAddDTO.getEventType().equals(6)){
                List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>();
                commonEventAddDTO.getPopulationIds().forEach(populationId -> {
                    EventSpecialCrowdRecordDO specialCrowdRecordDO = new EventSpecialCrowdRecordDO();
                    specialCrowdRecordDO.setEventId(eventDO.getId());
                    specialCrowdRecordDO.setPopulationId(populationId);
                    specialCrowdRecordDO.setCreateAt(new Date());
                    crowdRecordList.add(specialCrowdRecordDO);
                });
                //添加特殊人群上报事件与人口关系
                eventSpecialCrowdRecordService.saveBatch(crowdRecordList);
                if(commonEventAddDTO.getPopulationIds() != null && commonEventAddDTO.getPopulationIds().size() > 0){
                    List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>();
                    commonEventAddDTO.getPopulationIds().forEach(populationId -> {
                        EventSpecialCrowdRecordDO specialCrowdRecordDO = new EventSpecialCrowdRecordDO();
                        specialCrowdRecordDO.setEventId(eventDO.getId());
                        specialCrowdRecordDO.setPopulationId(populationId);
                        specialCrowdRecordDO.setCreateAt(new Date());
                        crowdRecordList.add(specialCrowdRecordDO);
                    });
                    //添加特殊人群上报事件与人口关系
                    eventSpecialCrowdRecordService.saveBatch(crowdRecordList);
                }
            }
            //添加音频
@@ -735,15 +739,20 @@
    public R republishEvent(CommonEventRepublishDTO commonEventRepublishDTO) {
        EventDO eventDO = this.getBaseMapper().selectById(commonEventRepublishDTO.getId());
        //boolean canRepublishByUser = eventDO.getEventStatus() == 4 || eventDO.getEventStatus() == 1;
        boolean canRepublishByUser = eventDO.getEventDealStatus() == 7|eventDO.getEventDealStatus() == 5; //已失效状态
        boolean canRepublishByUser = eventDO.getEventDealStatus() == 6|eventDO.getEventDealStatus() == 5; //已失效状态
        if (!canRepublishByUser) {
            return R.fail("当前不是撤销/草稿状态");
        }
        if(eventDO.getEventCategory().equals(2L)){//宣传教育
            eventDO.setEventDealStatus(8);
        }else{
            eventDO.setEventProcessStatus(1); //待解决
            eventDO.setProcessType(1);   //网格员处理
        }
        eventDO.setEventStatus(2);//2 发布
        eventDO.setEventProcessStatus(1); //待解决
        eventDO.setProcessType(1);   //网格员处理
        eventDO.setUpdateBy(commonEventRepublishDTO.getUserId());
        int updated = this.getBaseMapper().updateById(eventDO);
        if (updated != 1) {
            return R.fail("更新事件状态失败");
@@ -1026,6 +1035,8 @@
        eventDO.setEventCategory(2l);//宣传事件
        eventDO.setEventStatus(2);//事件状态 2发布
        eventDO.setEventType(8);
        eventDO.setGridMemberCommunity(eventGridDataDO.getGridCommunityId());
        eventDO.setGridMemberStreet(eventGridDataDO.getGridStreetId());
        if(publicityEventAddDTO.getGridMemberId()!=null) {
            eventDO.setGridMemberId(publicityEventAddDTO.getGridMemberId());
        }else{
@@ -1743,9 +1754,9 @@
//            return R.fail("经纬度参数错误");
//        }
        //经纬度匹配规则:(短(纬度)在前长(经度)在后,不要擅自修改此规则,否则出现问题后果自负)
        if(!latLng.matches("[1-9][0-9](\\.[0-9]{1,6})?,[1-9][0-9]{2}(\\.[0-9]{1,6})?")){
            return R.fail("经纬度参数错误");
        }
//        if(!latLng.matches("[1-9][0-9](\\.[0-9]{1,6})?,[1-9][0-9]{2}(\\.[0-9]{1,6})?")){
//            return R.fail("经纬度参数错误");
//        }
        String latLngArr[] = latLng.split(",");
        try {
            Double lat = Double.valueOf(latLngArr[1]);
@@ -2260,7 +2271,7 @@
            workScreenVO.setResolvedNum(countMap.get("resolvedNum")== null ? 0L : Long.valueOf(countMap.get("resolvedNum").toString()));
            workScreenVO.setPendingNum(countMap.get("pendingNum")== null ? 0L : Long.valueOf(countMap.get("pendingNum").toString()));
            workScreenVO.setPropagandaNum(countMap.get("propagandaNum")== null ? 13L : Long.valueOf(countMap.get("propagandaNum").toString()));
            workScreenVO.setCurrentNum(countMap.get("currentNum")== null ? 0L : Long.valueOf(countMap.get("currentNum").toString()));
            workScreenVO.setCurrentNum(countMap.get("sspCurrentNum") + countMap.get("currentNum"));
        }
        //计算处理时间消耗的时间
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventVisitingTasksServiceImpl.java
@@ -22,8 +22,10 @@
import com.panzhihua.common.model.vos.visit.*;
import com.panzhihua.common.utlis.CopyUtil;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_grid.dao.EventGridDataMapper;
import com.panzhihua.service_grid.dao.EventResourceMapper;
import com.panzhihua.service_grid.dao.EventVisitingTasksMapper;
import com.panzhihua.service_grid.model.dos.EventGridDataDO;
import com.panzhihua.service_grid.model.dos.EventResourceDO;
import com.panzhihua.service_grid.model.dos.EventVisitingTasksDO;
import com.panzhihua.service_grid.service.EventResourceService;
@@ -34,6 +36,8 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import static java.util.stream.Collectors.collectingAndThen;
import static java.util.stream.Collectors.toCollection;
import javax.annotation.Resource;
import java.util.*;
@@ -41,6 +45,7 @@
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * @auther lyq
@@ -59,6 +64,9 @@
    @Resource
    private EventResourceService eventResourceService;
    @Resource
    private EventGridDataMapper eventGridDataMapper;
    @Value("${domain.aesKey:}")
    private String aesKey;
@@ -182,7 +190,7 @@
            EventVisitingTasksDO eventVisitingTasksDO = eventVisitingTasksMapper.selectById(Long.valueOf(id));
            if(eventVisitingTasksDO != null){
                if(!Objects.equals(eventVisitingTasksDO.getEventStatus(),EventTasksStatusEnum.DZF.getCode())){
                    return R.fail("您选择的走访任务中有已解决的不可删除");
                    return R.fail("您选择的走访任务中有已走访的不可删除");
                }
                eventVisitingTasksMapper.deleteById(id);
            }
@@ -241,7 +249,7 @@
            eventVisitingTasksDetailsVO.setImgList(eventResourceMapper.findListByRefId(eventVisitingTasksDO.getId(),2,1));
            eventVisitingTasksDetailsVO.setVosList(eventResourceMapper.findListByRefId(eventVisitingTasksDO.getId(),2,2));
            eventVisitingTasksDetailsVO.setVideoList(eventResourceMapper.findListByRefId(eventVisitingTasksDO.getId(),2,3));
            eventVisitingTasksDetailsVO.setHappentAddress(eventVisitingTasksDO.getAddress());
            return R.ok(eventVisitingTasksDetailsVO);
        }
        return R.fail();
@@ -290,8 +298,17 @@
        if(count > 0){
            return "被访问人["+map.get("name")+"]只能同时存在一条待走访任务;";
        }
        EventVisitingTasksDO visitingTasksDO = new EventVisitingTasksDO();
        visitingTasksDO.setGridId(gridId);
        //查询网格
        EventGridDataDO gridDataDO = eventGridDataMapper.selectById(gridId);
        if(gridDataDO != null){
            visitingTasksDO.setGridMemberCommunity(gridDataDO.getGridCommunityId());
            visitingTasksDO.setGridMemberStreet(gridDataDO.getGridStreetId());
        }
//        visitingTasksDO.setGridMemberStreet(Long.valueOf(gridMap.get("street_id").toString()));
//        visitingTasksDO.setGridMemberCommunity(communityId);
//        visitingTasksDO.setGridMember(Long.valueOf(gridMap.get("user_id").toString()));
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventGridDataMapper.xml
@@ -43,7 +43,7 @@
        egd.fill_color,
        egd.data,
        egd.create_at,
        egd.create_by,
        su1.`name` as createBy,
        egd.grid_community_id,
        (select lc_grid_name from lc_compare_code where local_grid_id = egd.id) as lcGirdName,
        (select id from lc_compare_code where local_grid_id = egd.id) as lcGirdId,
@@ -53,6 +53,7 @@
        LEFT JOIN com_act AS ca ON ca.community_id = egd.grid_community_id
        LEFT JOIN event_grid_member_relation AS egmr ON egmr.grid_id = egd.id
        left join sys_user as su on su.user_id = egmr.grid_member_id
        left join sys_user as su1 on su1.user_id = egd.create_by
        <where>
            <if test="pageEventGridDataDTO.gridStreetId!=null">
                AND egd.grid_street_id = #{pageEventGridDataDTO.gridStreetId}
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventGridMemberRelationMapper.xml
@@ -279,12 +279,12 @@
                    AND DATE_FORMAT(create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{statisticsAdminDTO.endTime}
                </if>
            ) AS handleTSTotal,
            ( SELECT count( id ) FROM event_visiting_tasks WHERE dell_user_id = su.user_id AND event_status = 2
            ( SELECT count( id ) FROM event_visiting_tasks WHERE grid_member = su.user_id AND event_status = 2
                <if test="statisticsAdminDTO.startTime!=null and statisticsAdminDTO.startTime != &quot;&quot;">
                    AND DATE_FORMAT(dell_date,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{statisticsAdminDTO.startTime}
                    AND DATE_FORMAT(submit_date,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{statisticsAdminDTO.startTime}
                </if>
                <if test="statisticsAdminDTO.endTime!=null and statisticsAdminDTO.endTime != &quot;&quot;">
                    AND DATE_FORMAT(dell_date,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{statisticsAdminDTO.endTime}
                    AND DATE_FORMAT(submit_date,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{statisticsAdminDTO.endTime}
                </if>
            ) AS handleZFTotal,
            ( SELECT count( id ) FROM com_act_easy_photo WHERE handle_status = 2 AND handler_id = su.user_id
@@ -341,4 +341,47 @@
        select count(id) from com_mng_building where village_id = #{villageId}
    </select>
    <select id="getMapGridListsByApp" parameterType="com.panzhihua.common.model.dtos.grid.EventGridCascadeListDTO"
            resultType="com.panzhihua.common.model.vos.grid.EventMapGridVO">
        <if test="cascadeListDTO.type != null and cascadeListDTO.type == 1">
            SELECT DISTINCT
            egmr.grid_community_id as gridId,
            ca.`name` AS gridName
            FROM
            event_grid_member_relation AS egmr
            LEFT JOIN com_act AS ca ON ca.community_id = egmr.grid_community_id
            WHERE
            grid_member_id = #{cascadeListDTO.userId}
        </if>
        <if test="cascadeListDTO.type != null and cascadeListDTO.type == 2">
            select id as gridId,grid_name AS gridName from event_grid_member_relation as egmr where grid_member_id = #{cascadeListDTO.userId} and grid_community_id = #{cascadeListDTO.communityId}
        </if>
    </select>
    <select id="getMapGridsListsByApp" resultType="com.panzhihua.common.model.vos.grid.EventMapGridCascadeVO">
        <if test="type != null and type == 1">
            SELECT DISTINCT
            egmr.grid_community_id as gridId,
            ca.`name` AS gridName
            FROM
            event_grid_member_relation AS egmr
            LEFT JOIN com_act AS ca ON ca.community_id = egmr.grid_community_id
            WHERE
            grid_member_id = #{userId}
        </if>
        <if test="type != null and type == 2">
            SELECT
            egmr.grid_id,
            egd.grid_name,
            egd.grid_community_id
            FROM
            event_grid_member_relation AS egmr
            left join event_grid_data as egd on egd.id = egmr.grid_id
            where egmr.grid_member_id = #{userId} and egd.grid_community_id = #{communityId}
        </if>
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventMapper.xml
@@ -72,7 +72,7 @@
            <if test="pageEventDTO.eventDealStatus!=null">
                AND event_deal_status = #{pageEventDTO.eventDealStatus}
            </if>
            <if test="pageEventDTO.isAll!=null and pageEventDTO.isAll = 1">
            <if test="pageEventDTO.isAll!=null and pageEventDTO.isAll == 1">
                AND event_deal_status in (1,2,4)
            </if>
            <if test="pageEventDTO.revokeType!=null">
@@ -1027,7 +1027,8 @@
                LEFT JOIN event_grid_data AS egd3 ON egd3.id = e3.grid_id
            WHERE
                e3.event_status = 2
                AND e3.create_at LIKE CONCAT(#{nowDate},'%')) as currentNum
                AND e3.create_at LIKE CONCAT(#{nowDate},'%')) as currentNum,
                (select count(id) from com_act_easy_photo where community_id = 2 and del_tag = 0 and create_at LIKE CONCAT('2021-07','%')) as sspCurrentNum
                FROM
                    `event` AS e
@@ -1090,7 +1091,7 @@
        WHERE
            egd.grid_community_id = #{communityId}
            AND e.event_status = 2
            AND e.event_deal_status in (1,2,3,4,6)
            AND e.event_deal_status in (1,2,3,4,6,8)
        ORDER BY
            e.create_at DESC
            LIMIT 10
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/resources/mapper/EventVisitingTasksMapper.xml
@@ -105,6 +105,7 @@
        <if test = "query.status == 0">
            and (vt.event_status = 1 or vt.event_status = 3 or vt.event_status = 6 or vt.event_status = 6)
        </if>
        group by cardNoStr
        order by vt.id desc
    </select>
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/api/UserApi.java
@@ -978,4 +978,9 @@
        return userService.listAgreements(communityId);
    }
    @PostMapping("user/getUserGrids")
    public R getGridIsOk(@RequestParam("userId") Long userId) {
        return userService.getGridIsOk(userId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java
@@ -425,4 +425,7 @@
    @Select("select id from lc_compare_code_member where local_grid_member_id = #{gridMemberId}")
    Long getLcMemberId(@Param("gridMemberId") Long gridMemberId);
    @Select("select count(id) from event_grid_member_relation where grid_member_id = #{userId}")
    Integer getGridIsOk(@Param("userId") Long userId);
}
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/UserService.java
@@ -467,4 +467,6 @@
     * @return  收益说明
     */
    R listAgreements(Long communityId);
    R getGridIsOk(Long userId);
}
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -2162,4 +2162,14 @@
        });
        return R.ok(sysUserAgreementVOS);
    }
    @Override
    public R getGridIsOk(Long userId){
        Integer count = this.userDao.getGridIsOk(userId);
        if(count > 0){
            return R.ok(count);
        }else{
            return R.fail();
        }
    }
}