20 files modified
2 files added
| | |
| | | |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.utils.AuthUtils; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | |
| | | if (null != SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | // 设置社区编号 |
| | | communityCodeField.setAccessible(true); |
| | | communityCodeField.set(t,communityCode); |
| | | communityCodeField.set(t, communityCode); |
| | | } |
| | | } |
| | | // 超级管理员、系统管理员、公安管理员不过滤数据 |
| | | isAdministrator = Strings.isBlank(roleName) && |
| | | (AuthUtil.isAdministrator() == true || |
| | | AuthUtil.isAdmin() == true || |
| | | isGaAdmin() == true |
| | | ) ? 1 : 2; |
| | | if (isAdministrator==2) { |
| | | isAdministrator = AuthUtils.isAdmin(roleName) || AuthUtils.isAdmin() || |
| | | AuthUtils.isAdministrator() || AuthUtils.isGaAdmin() ? 1 : 2; |
| | | |
| | | if (isAdministrator == 2) { |
| | | // 获取当前用户的所属行政区划编号() |
| | | regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | // 获取网格编号集合 |
| | |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 是否为公安管理员 |
| | | * @return |
| | | */ |
| | | public boolean isGaAdmin() { |
| | | return StringUtil.containsAny(getUserRole(), new CharSequence[]{"gagly"}); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.common.utils; |
| | | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | |
| | | public class AuthUtils extends AuthUtil { |
| | | |
| | | /** |
| | | * 是否为公安管理员 |
| | | * @return |
| | | */ |
| | | public static boolean isGaAdmin() { |
| | | return StringUtil.containsAny(getUserRole(), new CharSequence[]{"gagly"}); |
| | | } |
| | | |
| | | /** |
| | | * 是否管理员角色 |
| | | * @return |
| | | */ |
| | | public static boolean isAdmin(String roleName) { |
| | | return StringUtil.containsAny(roleName, new CharSequence[]{"admin"}); |
| | | } |
| | | } |
| | |
| | | public R save(@Valid @RequestBody ArticleCommentEntity articleComment) { |
| | | articleComment.setUserId(AuthUtil.getUserId()); |
| | | String msg = articleCommentService.saveComment(articleComment); |
| | | if (!Strings.isBlank(msg)){ |
| | | return R.data(201,"",msg); |
| | | if (!Strings.isBlank(msg)&& msg.equals("操作成功")){ |
| | | return R.data(200,"",msg); |
| | | } |
| | | return R.data(200,"",msg); |
| | | return R.data(201,"",msg); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public IPage<ArticleCommentVO> selectArticleCommentPage(IPage<ArticleCommentVO> page, ArticleCommentVO noticeComment) { |
| | | String userRole = AuthUtil.getUserRole(); |
| | | if (userRole.contains("jdgly")) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | // if (userRole.contains("jdgly")) { |
| | | // List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | // IDistrictService bean = SpringUtils.getBean(IDistrictService.class); |
| | | // List<DistrictEntity> list = bean.list(Wrappers.<DistrictEntity>lambdaQuery() |
| | | // .in(DistrictEntity::getCommunityCode, regionChildCodesList)); |
| | | // List<String> fieldValues = list.stream().map(DistrictEntity::getId).collect(Collectors.toList()); |
| | | noticeComment.setCityCodeList(regionChildCodesList); |
| | | } |
| | | // noticeComment.setCityCodeList(regionChildCodesList); |
| | | // } |
| | | return page.setRecords(baseMapper.selectArticleCommentPage(page, noticeComment)); |
| | | } |
| | | |
| | |
| | | } |
| | | circle.setUserId(AuthUtil.getUserId()); |
| | | String msg = circleService.saveComment(circle); |
| | | if (!Strings.isBlank(msg)){ |
| | | return R.data(201,"",msg); |
| | | if (!Strings.isBlank(msg)&& msg.equals("操作成功")){ |
| | | return R.data(200,"",msg); |
| | | } |
| | | return R.data(200,"",msg); |
| | | return R.data(201,"",msg); |
| | | } |
| | | |
| | | /** |
| | |
| | | public R save(@Valid @RequestBody CircleEntity circle) { |
| | | circle.setUserId(AuthUtil.getUserId()); |
| | | String msg = circleService.saveCircle(circle); |
| | | if (!Strings.isBlank(msg)) { |
| | | return R.data(201, "", msg); |
| | | if (!Strings.isBlank(msg)&& msg.equals("操作成功")){ |
| | | return R.data(200,"",msg); |
| | | } |
| | | return R.data(200, "", msg); |
| | | return R.data(201, "", msg); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "新增或修改", notes = "传入publicDiscuss") |
| | | public R submit(@Valid @RequestBody PublicDiscussEntity publicDiscuss) { |
| | | publicDiscuss.setCreateBy(AuthUtil.getUserId()); |
| | | UpdateWrapper<PublicDiscussEntity> objectUpdateWrapper = new UpdateWrapper<>(); |
| | | objectUpdateWrapper.eq("article_id", publicDiscuss.getArticleId()); |
| | | objectUpdateWrapper.eq("event_type", publicDiscuss.getEventType()); |
| | | return R.status(publicDiscussService.saveOrUpdate(publicDiscuss,objectUpdateWrapper)); |
| | | return R.status(publicDiscussService.saveOrUpdate(publicDiscuss)); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (one.getVoteRestrictions().equals(CommonConstant.NUMBER_ONE)) { |
| | | long count = userPublicEnrollService.count(Wrappers.<UserPublicEnrollEntity>lambdaQuery() |
| | | .eq(UserPublicEnrollEntity::getPublicDiscussId, userPublicEnroll.getPublicDiscussId()) |
| | | .eq(UserPublicEnrollEntity::getUserId, userPublicEnroll.getUserId()) |
| | | .eq(UserPublicEnrollEntity::getHouseCode, userPublicEnroll.getHouseCode())); |
| | | if (count > 0) { |
| | | return R.fail("您房屋已经报名,不能重复报名!"); |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.constant.CommonConstant; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.modules.discuss.entity.PublicDiscussEntity; |
| | | import org.springblade.modules.discuss.entity.UserTopicsEntity; |
| | | import org.springblade.modules.discuss.excel.UserTopicsExcel; |
| | | import org.springblade.modules.discuss.service.IPublicDiscussService; |
| | | import org.springblade.modules.discuss.service.IUserTopicsService; |
| | | import org.springblade.modules.discuss.vo.TopicsVO; |
| | | import org.springblade.modules.discuss.vo.UserTopicsVO; |
| | | import org.springblade.modules.discuss.wrapper.UserTopicsWrapper; |
| | | import org.springblade.modules.house.excel.HouseExcel; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | |
| | | UserTopicsEntity detail = userTopicsService.getOne(Condition.getQueryWrapper(userTopics)); |
| | | return R.data(UserTopicsWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | /** |
| | | * 用户议题报表 分页 |
| | | */ |
| | |
| | | if (one.getVoteRestrictions().equals(CommonConstant.NUMBER_ONE)) { |
| | | long count = userTopicsService.count(Wrappers.<UserTopicsEntity>lambdaQuery() |
| | | .eq(UserTopicsEntity::getPublicDiscussId, userTopics.getPublicDiscussId()) |
| | | .eq(UserTopicsEntity::getUserId, userTopics.getUserId()) |
| | | .eq(UserTopicsEntity::getHouseCode, userTopics.getHouseCode())); |
| | | if (count > 0) { |
| | | return R.fail("您房屋已经投票,不能重复投票!"); |
| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "批量更新", notes = "传入topics") |
| | | public R updateBath(@Valid @RequestBody List<TopicsVO> topics) throws Exception { |
| | | Boolean result = userTopicsService.batchSave(topics); |
| | | return R.status(result); |
| | | String result = userTopicsService.batchSave(topics); |
| | | if (result.equals("200")) { |
| | | R.success("操作成功"); |
| | | } |
| | | return R.fail(result); |
| | | } |
| | | |
| | | /** |
| | | * 导出用户 |
| | | */ |
| | | @GetMapping("/exportUser") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "导出用户", notes = "传入userTopics") |
| | | public void exportUser(UserTopicsVO userTopics, HttpServletResponse response) { |
| | | List<UserTopicsExcel> list = userTopicsService.exportUser(userTopics); |
| | | ExcelUtil.export(response, "投票人员" + DateUtil.time(), "投票人员数据表", list, UserTopicsExcel.class); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | package org.springblade.modules.discuss.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * HouseExcel |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class UserTopicsExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 2L; |
| | | |
| | | @ExcelProperty( "姓名") |
| | | private String name; |
| | | |
| | | @ExcelProperty( "手机号") |
| | | private String phone; |
| | | |
| | | @ExcelProperty( "地址") |
| | | private String addressName; |
| | | |
| | | @ExcelProperty( "小区") |
| | | private String aoiName; |
| | | |
| | | @ExcelProperty( "投票项") |
| | | private String optionContent; |
| | | |
| | | |
| | | @ExcelProperty(value = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | package org.springblade.modules.discuss.mapper; |
| | | |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.springblade.modules.discuss.dto.UserTopicsDTO; |
| | | import org.springblade.modules.discuss.entity.UserTopicsEntity; |
| | | import org.springblade.modules.discuss.excel.UserTopicsExcel; |
| | | import org.springblade.modules.discuss.vo.UserTopicsVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | * @return 用户议题报表集合 |
| | | */ |
| | | public List<UserTopicsDTO> selectUserTopicsList(UserTopicsDTO userTopicsDTO); |
| | | |
| | | List<UserTopicsExcel> exportUser( UserTopicsVO userTopics); |
| | | } |
| | |
| | | bu.`name`, |
| | | bu.phone, |
| | | jda.address_name, |
| | | jda.aoi_name |
| | | jda.aoi_name, |
| | | jt.option_content |
| | | FROM |
| | | jczz_user_topics as jut |
| | | LEFT JOIN blade_user bu ON jut.user_id = bu.id AND bu.is_deleted = 0 |
| | | LEFT JOIN jczz_household jh ON jh.associated_user_id = jut.user_id AND jh.is_deleted = 0 |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jh.house_code |
| | | LEFT JOIN jczz_topics jt on jt.id = jut.topics_id |
| | | <where> |
| | | <if test="userTopics.id != null ">and jut.id = #{userTopics.id}</if> |
| | | <if test="userTopics.name != null and userTopics.name != ''"> |
| | |
| | | bu.`name`, |
| | | bu.phone, |
| | | jda.address_name, |
| | | jda.aoi_name |
| | | jda.aoi_name, |
| | | jt.option_content |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="exportUser" resultType="org.springblade.modules.discuss.excel.UserTopicsExcel"> |
| | | SELECT distinct |
| | | jut.article_id, |
| | | jut.delete_flag, |
| | | jut.signature_path, |
| | | jut.create_time, |
| | | bu.avatar, |
| | | bu.`name`, |
| | | bu.phone, |
| | | jda.address_name, |
| | | jda.aoi_name, |
| | | jt.option_content |
| | | FROM |
| | | jczz_user_topics as jut |
| | | LEFT JOIN blade_user bu ON jut.user_id = bu.id AND bu.is_deleted = 0 |
| | | LEFT JOIN jczz_household jh ON jh.associated_user_id = jut.user_id AND jh.is_deleted = 0 |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jh.house_code |
| | | LEFT JOIN jczz_topics jt on jt.id = jut.topics_id |
| | | <where> |
| | | <if test="id != null ">and jut.id = #{id}</if> |
| | | <if test="name != null and name != ''"> |
| | | and bu.name like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="phone != null and phone != ''"> |
| | | and bu.phone like concat('%',#{phone},'%') |
| | | </if> |
| | | |
| | | <if test="aoiCodeList != null and aoiCodeList.size() > 0"> |
| | | and jda.aoi_code in |
| | | <foreach collection="aoiCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="userId != null ">and jut.user_id = #{userId}</if> |
| | | <if test="topicsId != null ">and jut.topics_id = #{topicsId}</if> |
| | | <if test="createTime != null ">and jut.create_time = #{createTime}</if> |
| | | <if test="updateTime != null ">and jut.update_time = #{updateTime}</if> |
| | | <if test="deleteFlag != null ">and jut.delete_flag = #{deleteFlag}</if> |
| | | <if test="articleId != null ">and jut.article_id = #{articleId} |
| | | and jut.delete_flag = 0 |
| | | GROUP BY jut.article_id, jut.signature_path,jut.create_time,jut.delete_flag, |
| | | bu.avatar, |
| | | bu.`name`, |
| | | bu.phone, |
| | | jda.address_name, |
| | | jda.aoi_name, |
| | | jt.option_content |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.discuss.entity.UserTopicsEntity; |
| | | import org.springblade.modules.discuss.excel.UserTopicsExcel; |
| | | import org.springblade.modules.discuss.vo.TopicsVO; |
| | | import org.springblade.modules.discuss.vo.UserTopicsVO; |
| | | |
| | |
| | | IPage<UserTopicsVO> selectUserTopicsPage(IPage<UserTopicsVO> page, UserTopicsVO userTopics); |
| | | |
| | | |
| | | Boolean batchSave(List<TopicsVO> topics) throws Exception; |
| | | String batchSave(List<TopicsVO> topics) throws Exception; |
| | | |
| | | Integer getCount(Integer id); |
| | | |
| | | List<UserTopicsExcel> exportUser(UserTopicsVO userTopics); |
| | | } |
| | |
| | | import org.springblade.modules.discuss.entity.PublicDiscussEntity; |
| | | import org.springblade.modules.discuss.entity.TopicsEntity; |
| | | import org.springblade.modules.discuss.entity.UserTopicsEntity; |
| | | import org.springblade.modules.discuss.excel.UserTopicsExcel; |
| | | import org.springblade.modules.discuss.mapper.UserTopicsMapper; |
| | | import org.springblade.modules.discuss.service.IPublicDiscussService; |
| | | import org.springblade.modules.discuss.service.ITopicsService; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean batchSave(List<TopicsVO> topics) throws Exception { |
| | | public String batchSave(List<TopicsVO> topics) throws Exception { |
| | | // 判断是否一户一票 还是一人一票 |
| | | IPublicDiscussService bean = SpringUtil.getBean(IPublicDiscussService.class); |
| | | PublicDiscussEntity one = bean.getOne(Wrappers.<PublicDiscussEntity>lambdaQuery().eq(PublicDiscussEntity::getArticleId, topics.get(0).getArticleId())); |
| | |
| | | if (one.getVoteRestrictions().equals(CommonConstant.NUMBER_ONE)) { |
| | | long count = count(Wrappers.<UserTopicsEntity>lambdaQuery() |
| | | .eq(UserTopicsEntity::getHouseCode, topics.get(0).getHouseCode()) |
| | | .eq(UserTopicsEntity::getArticleId,topics.get(0).getArticleId())); |
| | | if (count > 1) { |
| | | throw new Exception("您的房屋已投票,不能重复投票!"); |
| | | .eq(UserTopicsEntity::getArticleId, topics.get(0).getArticleId())); |
| | | if (count > 0) { |
| | | return "您的房屋已投票,不能重复投票!"; |
| | | } |
| | | } else { |
| | | // |
| | | long count = count(Wrappers.<UserTopicsEntity>lambdaQuery() |
| | | .eq(UserTopicsEntity::getUserId, AuthUtil.getUserId()) |
| | | .eq(UserTopicsEntity::getArticleId,topics.get(0).getArticleId())); |
| | | if (count > 1) { |
| | | throw new Exception("您的已投票,不能重复投票!"); |
| | | .eq(UserTopicsEntity::getArticleId, topics.get(0).getArticleId())); |
| | | if (count > 0) { |
| | | return "您的已投票,不能重复投票!"; |
| | | } |
| | | } |
| | | Boolean userTopics = getaBoolean(topics); |
| | | if (userTopics != null) return userTopics; |
| | | return false; |
| | | if (userTopics != null) return "200"; |
| | | return "操作失败!"; |
| | | } |
| | | |
| | | @Nullable |
| | |
| | | .groupBy(UserTopicsEntity::getUserId)); |
| | | return list.size(); |
| | | } |
| | | |
| | | @Override |
| | | public List<UserTopicsExcel> exportUser(UserTopicsVO userTopics) { |
| | | if (StringUtils.isNotBlank(userTopics.getDistrictId())) { |
| | | List<String> longs = JSON.parseArray(userTopics.getDistrictId()).toJavaList(String.class); |
| | | IDistrictService bean = SpringUtils.getBean(IDistrictService.class); |
| | | List<DistrictEntity> list = bean.list(Wrappers.<DistrictEntity>lambdaQuery().in(DistrictEntity::getId, longs)); |
| | | List<String> collect = list.stream().map(item -> |
| | | item.getAoiCode() |
| | | ).collect(Collectors.toList()); |
| | | if (collect != null) { |
| | | userTopics.setAoiCodeList(collect); |
| | | } |
| | | } |
| | | List<UserTopicsExcel> userTopicsExcels = baseMapper.exportUser(userTopics); |
| | | return userTopicsExcels; |
| | | } |
| | | } |
| | |
| | | */ |
| | | package org.springblade.modules.discuss.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import org.springblade.modules.discuss.entity.UserTopicsEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | |
| | | private List<String> aoiCodeList; |
| | | |
| | | private String districtId; |
| | | |
| | | private String optionContent; |
| | | } |
| | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "小区编码") |
| | | private String aoiCode; |
| | | |
| | | /** |
| | | * 是否删除 |
| | | */ |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="isDeleted" column="is_deleted" /> |
| | | <result property="aoiCode" column="aoi_code" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectPlace"> |
| | |
| | | update_user, |
| | | update_time, |
| | | remark, |
| | | is_deleted |
| | | is_deleted, |
| | | |
| | | from |
| | | jczz_place |
| | | </sql> |
| | |
| | | <!--比对两点间的距离是否在1km 范围内(和地址总表位置对比)--> |
| | | <select id="comparisonPosition" resultType="java.lang.Integer"> |
| | | select count(1) from jczz_doorplate_address where 1=1 |
| | | and ( |
| | | and IFNULL(( |
| | | ACOS( |
| | | SIN( |
| | | ( #{place.y} * 3.1415 )/ 180 ) * SIN(( y * 3.1415 )/ 180 ) |
| | | + COS(( #{place.y} * 3.1415 )/ 180 ) * COS(( y * 3.1415 )/ 180 ) * COS(( #{place.x} * 3.1415 )/ 180 |
| | | - ( x * 3.1415 )/ 180 ))* 6370.996 |
| | | ) <= 1 |
| | | ),2) <= 1 |
| | | and address_code = #{place.houseCode} |
| | | </select> |
| | | |
| | |
| | | public R saveOrUpdate(@Valid @RequestBody PropertyCompanyCommentVO propertyCompanyComment) { |
| | | propertyCompanyComment.setCreateUser(AuthUtil.getUserId()); |
| | | String msg = propertyCompanyCommentService.saveOrUpdatePropertyCompanyComment(propertyCompanyComment); |
| | | if (!Strings.isBlank(msg)){ |
| | | return R.data(201,"",msg); |
| | | if (!Strings.isBlank(msg)&& msg.equals("操作成功")){ |
| | | return R.data(200,"",msg); |
| | | } |
| | | return R.data(200,"",msg); |
| | | return R.data(201,"",msg); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getStatisticsCount") |
| | | public R statisticsCount(@RequestParam("houseCode") String houseCode) { |
| | | public R statisticsCount(@RequestParam(value = "houseCode",required = false) String houseCode) { |
| | | return R.data(taskReportForRepairsService.getStatisticsCount(houseCode)); |
| | | } |
| | | |
| | |
| | | LEFT JOIN jczz_house jh on jh.house_code=jtrfr.address_code |
| | | left join jczz_grid jg on jg.grid_code = jh.grid_code and jg.is_deleted = 0 |
| | | left join blade_region br on br.code = jg.community_code |
| | | LEFT JOIN jczz_place jp on jtrfr.address_code = jp.house_code and jp.is_deleted = 0 |
| | | where jtrfr.is_deleted = 0 |
| | | <if test="vo.createUser != null and vo.createUser != ''"> |
| | | AND jtrfr.create_user = #{vo.createUser} |
| | |
| | | <!-- 物业和居民 --> |
| | | <if test="vo.roleType !=null and (vo.roleType == 'wy' or vo.roleType == 'inhabitant')"> |
| | | <if test="aoiCodeList!=null and aoiCodeList.size()>0"> |
| | | and jda.aoi_code in |
| | | and ( |
| | | jda.aoi_code in |
| | | <foreach collection="aoiCodeList" item="item" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | or |
| | | jp.aoi_code in |
| | | <foreach collection="aoiCodeList" item="item" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | |
| | | <if test="vo.roleType == 'wy' and vo.confirmUserId != null "> |
| | | and jtrfr.confirm_user_id = #{vo.confirmUserId} |
| | | or jtrfr.confirm_user_id = #{vo.confirmUserId} |
| | | </if> |
| | | </if> |
| | | <!-- 网格员及其他 --> |
| | | <if test="vo.roleType ==null"> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and jg.grid_code in |
| | | and ( |
| | | jg.grid_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | or |
| | | jp.grid_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | ) |
| | | </when> |
| | | </choose> |
| | | |
| | | <choose> |
| | | <when test="gridCodeList !=null and gridCodeList.size()>0"> |
| | | and jg.grid_code in |
| | | and ( |
| | | jg.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | or |
| | | jp.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | ) |
| | | </when> |
| | | <otherwise> |
| | | and jg.grid_code in ('') |
| | |
| | | </choose> |
| | | |
| | | <if test="vo.confirmUserId != null "> |
| | | and jtrfr.confirm_user_id = #{vo.confirmUserId} |
| | | or jtrfr.confirm_user_id = #{vo.confirmUserId} |
| | | </if> |
| | | |
| | | </if> |
| | |
| | | count( 1 ) |
| | | FROM |
| | | jczz_task_report_for_repairs jtr |
| | | LEFT JOIN jczz_doorplate_address jda ON jtr.address_code = jda.address_code |
| | | LEFT JOIN jczz_house jh ON jh.house_code = jtr.address_code |
| | | LEFT JOIN jczz_place jp ON jtr.address_code = jp.house_code |
| | | <where> |
| | | |
| | | <if test="neiCode != null and neiCode != ''"> |
| | | and jda.nei_code = #{neiCode} |
| | | </if> |
| | | and jtr.is_deleted = 0 |
| | | and jtr.confirm_flag = 1 |
| | | <if test="userId != null"> |
| | | AND jtr.address_code IN ( |
| | | AND ( |
| | | jp.grid_code IN ( |
| | | SELECT |
| | | jgr.house_code |
| | | jg.grid_code |
| | | FROM |
| | | jczz_grid_range jgr |
| | | LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | WHERE |
| | | jg.is_deleted = 0 |
| | | AND jgm.user_id = #{userId} ) |
| | | AND jgm.user_id = #{userId} |
| | | ) |
| | | OR jh.grid_code IN ( |
| | | SELECT |
| | | jg.grid_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | WHERE |
| | | jg.is_deleted = 0 |
| | | AND jgm.user_id = #{userId} |
| | | )) |
| | | </if> |
| | | and jtr.is_deleted = 0 |
| | | and jtr.confirm_flag = 1 |
| | | </where> |
| | | |
| | | |
| | | </select> |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.constant.CommonConstant; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.RoleUtil; |
| | | import org.springblade.common.utils.SpringUtils; |
| | |
| | | import org.springblade.modules.district.service.IDistrictService; |
| | | import org.springblade.modules.grid.entity.GridmanEntity; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.house.entity.HouseEntity; |
| | | import org.springblade.modules.house.service.IHouseService; |
| | | import org.springblade.modules.place.entity.PlaceEntity; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.property.entity.PropertyCompanyDistrictEntity; |
| | | import org.springblade.modules.property.entity.PropertyCompanyEntity; |
| | | import org.springblade.modules.property.service.IPropertyCompanyDistrictService; |
| | |
| | | @Override |
| | | public IPage<TaskReportForRepairsVO> selectTaskReportForRepairsPage(IPage<TaskReportForRepairsVO> page, TaskReportForRepairsVO taskReportForRepairs) { |
| | | // 公共参数设置 |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskReportForRepairsVO.class,taskReportForRepairs); |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskReportForRepairsVO.class, taskReportForRepairs); |
| | | taskReportForRepairs.setConfirmUserId(AuthUtil.getUserId()); |
| | | List<String> addressCodeList = new ArrayList<>(); |
| | | if (null != taskReportForRepairs.getRoleName() && !taskReportForRepairs.getRoleName().equals("")) { |
| | | if (taskReportForRepairs.getRoleName().equals("inhabitant")) { |
| | | if (taskReportForRepairs.getRoleName().equals("inhabitant")) { |
| | | taskReportForRepairs.setCreateUser(AuthUtil.getUserId()); |
| | | taskReportForRepairs.setConfirmUserId(null); |
| | | // |
| | |
| | | } |
| | | |
| | | return page.setRecords(baseMapper.selectTaskReportForRepairsPage(page, taskReportForRepairs, addressCodeList, |
| | | commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator(), aoiCodeList,commonParamSet.getGridCodeList())); |
| | | commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator(), aoiCodeList, commonParamSet.getGridCodeList())); |
| | | } |
| | | |
| | | /** |
| | |
| | | // 新增 |
| | | boolean save = taskService.save(taskEntity); |
| | | if (save) { |
| | | // 设置网格编码 |
| | | // if (taskReportForRepairs.getHouseFlag().equals(CommonConstant.NUMBER_TWO)) { |
| | | // IPlaceService bean = SpringUtils.getBean(IPlaceService.class); |
| | | // PlaceEntity placeEntity = bean.getOne(Wrappers.<PlaceEntity>lambdaQuery() |
| | | // .eq(PlaceEntity::getHouseCode, taskReportForRepairs.getAddressCode()).last("limit 1")); |
| | | // taskReportForRepairs.setGridCode(placeEntity.getGridCode()); |
| | | // } else { |
| | | // IHouseService bean = SpringUtils.getBean(IHouseService.class); |
| | | // HouseEntity houseEntity = bean.getOne(Wrappers.<HouseEntity>lambdaQuery() |
| | | // .eq(HouseEntity::getHouseCode, taskReportForRepairs.getAddressCode())); |
| | | // taskReportForRepairs.setGridCode(houseEntity.getGridCode()); |
| | | // } |
| | | taskReportForRepairs.setTaskId(taskEntity.getId()); |
| | | taskReportForRepairs.setConfirmFlag(1); |
| | | flag = save(taskReportForRepairs); |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.junit.jupiter.api.extension.ExtendWith; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.test.BladeBootTest; |
| | | import org.springblade.core.test.BladeSpringExtension; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.flow.engine.entity.FlowModel; |
| | | import org.springblade.flow.engine.service.FlowEngineService; |
| | | import org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity; |
| | | import org.springblade.modules.doorplateAddress.service.IDoorplateAddressService; |
| | | import org.springblade.modules.house.entity.HouseEntity; |
| | | import org.springblade.modules.house.service.IHouseService; |
| | | import org.springblade.modules.place.entity.PlaceEntity; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.task.entity.TaskReportForRepairsEntity; |
| | | import org.springblade.modules.task.service.ITaskReportForRepairsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.List; |
| | |
| | | @Autowired |
| | | private FlowEngineService service; |
| | | |
| | | @Autowired |
| | | private IPlaceService iPlaceService; |
| | | |
| | | @Autowired |
| | | private IDoorplateAddressService iDoorplateAddressService; |
| | | |
| | | @Autowired |
| | | private ITaskReportForRepairsService iTaskReportForRepairsService; |
| | | |
| | | // @Test |
| | | public void test() { |
| | | |
| | | List<PlaceEntity> list = iPlaceService.list(); |
| | | for (PlaceEntity placeEntity : list) { |
| | | DoorplateAddressEntity one = iDoorplateAddressService.getOne(Wrappers.<DoorplateAddressEntity>lambdaQuery() |
| | | .eq(DoorplateAddressEntity::getAddressCode, placeEntity.getHouseCode()).last("limit 1")); |
| | | if (one != null) { |
| | | placeEntity.setAoiCode(one.getAoiCode()); |
| | | iPlaceService.updateById(placeEntity); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | // @Test |
| | | public void test2() { |
| | | List<TaskReportForRepairsEntity> list = iTaskReportForRepairsService.list(); |
| | | IHouseService bean = SpringUtils.getBean(IHouseService.class); |
| | | IPlaceService bean2 = SpringUtils.getBean(IPlaceService.class); |
| | | |
| | | for (TaskReportForRepairsEntity taskReportForRepairsEntity : list) { |
| | | HouseEntity houseEntity = bean.getOne(Wrappers.<HouseEntity>lambdaQuery() |
| | | .eq(HouseEntity::getHouseCode, taskReportForRepairsEntity.getAddressCode())); |
| | | if (houseEntity != null) { |
| | | // taskReportForRepairsEntity.setGridCode(houseEntity.getGridCode()); |
| | | iTaskReportForRepairsService.updateById(taskReportForRepairsEntity); |
| | | }else { |
| | | PlaceEntity placeEntity = bean2.getOne(Wrappers.<PlaceEntity>lambdaQuery() |
| | | .eq(PlaceEntity::getHouseCode, taskReportForRepairsEntity.getAddressCode()).last("limit 1")); |
| | | // taskReportForRepairsEntity.setGridCode(placeEntity.getGridCode()); |
| | | iTaskReportForRepairsService.updateById(taskReportForRepairsEntity); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @Test |
| | | public void contextLoads() { |
| | | System.out.println("=====数据迁移启动====="); |