src/main/java/org/springblade/modules/place/entity/PlacePoiLabel.java
@@ -35,4 +35,14 @@ */ private Integer type; /** * 颜色 */ private String color; /** * 备注 */ private String remark; } src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
@@ -8,6 +8,7 @@ <collection property="placePoiLabelVOList" javaType="java.util.List" ofType="org.springblade.modules.place.vo.PlacePoiLabelVO" autoMapping="true"> <id property="id" column="plid"/> <result property="remark" column="cremark"/> </collection> </resultMap> @@ -121,7 +122,13 @@ select jp.*, bu.real_name as username,bu.phone as phone, jppl.id as plid,jppl.*,jc.category_name as labelName, jppl.id as plid, jppl.place_id, jppl.poi_code, jppl.type, jppl.color, jppl.remark as cremark, jc.category_name as labelName, br.code as neiCode,jg.id as gridId from jczz_place jp left join blade_user bu on bu.id = jp.principal_user_id and bu.is_deleted = 0 @@ -191,6 +198,8 @@ left join jczz_place_poi_label jppl on jppl.place_id = jp.id where jp.is_deleted = 0 and jppl.type = 3 and jppl.color = '#30D17C' and jp.principal_user_id is not null and jp.house_code != '' and jp.id in ( select place_id from ${tableName} where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=30 ) @@ -207,10 +216,12 @@ </choose> union all ( select jp.* from jczz_place jp select jp.*,jppl.poi_code as label from jczz_place jp left join jczz_place_poi_label jppl on jppl.place_id = jp.id where jp.is_deleted = 0 and jppl.type = 3 and jppl.color = '#FFB42B' and jp.principal_user_id is not null and jp.house_code != '' and jp.id in ( select place_id from ${tableName} where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=14 ) @@ -228,10 +239,12 @@ ) union all ( select jp.* from jczz_place jp select jp.*,jppl.poi_code as label from jczz_place jp left join jczz_place_poi_label jppl on jppl.place_id = jp.id where jp.is_deleted = 0 and jppl.type = 3 and jppl.color = '#EA1F1F' and jp.principal_user_id is not null and jp.house_code != '' and jp.id in ( select place_id from ${tableName} where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=7 ) @@ -249,9 +262,12 @@ ) union all ( select jp.* from jczz_place jp select jp.*,jppl.poi_code as label from jczz_place jp left join jczz_place_poi_label jppl on jppl.place_id = jp.id where jp.is_deleted = 0 and jppl.type = 3 and jp.principal_user_id is not null and jp.house_code != '' and (jppl.color = '#30D17C' or jppl.color = '#FFB42B' or jppl.color = '#EA1F1F') and jp.id not in ( select place_id from ${tableName} where is_deleted = 0 and source = 2 and place_id is not null group by place_id ) src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java
@@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import liquibase.repackaged.org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.util.Strings; import org.springblade.common.node.TreeStringNode; import org.springblade.common.utils.IdUtils; @@ -33,7 +34,9 @@ import org.springblade.modules.grid.service.IGridService; import org.springblade.modules.grid.service.IGridmanService; import org.springblade.modules.grid.vo.GridVO; import org.springblade.modules.house.entity.HouseholdEntity; import org.springblade.modules.house.entity.UserHouseLabelEntity; import org.springblade.modules.house.service.IHouseholdService; import org.springblade.modules.place.entity.*; import org.springblade.modules.place.excel.PlaceAndRelExcel; import org.springblade.modules.place.excel.PlaceExcel; @@ -91,6 +94,9 @@ @Autowired private GridMapper gridMapper; @Autowired private IHouseholdService householdService; /** * 自定义列表查询 @@ -866,6 +872,8 @@ @Override @Transactional(rollbackFor = Exception.class) public boolean removePlace(List<Long> longs) { // 删除场所负责人对应的用户 removeUser(longs); // 删除 boolean removeByIds = removeByIds(longs); // 删除对应的详情 @@ -877,6 +885,54 @@ } /** * 删除场所负责人对应的用户 * @param longs */ public void removeUser(List<Long> longs) { // 遍历 for (Long id : longs) { PlaceEntity placeEntity = getById(id); if (null!=placeEntity.getPrincipalUserId()){ User user = userService.getById(placeEntity.getPrincipalUserId()); // 查询场所判断是否还绑定有其他的场所 QueryWrapper<PlaceEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("is_deleted",0).eq("principal_user_id",user.getId()); List<PlaceEntity> placeEntityList = list(queryWrapper); // 如果没有(1个 当前的还没有删除) if (placeEntityList.size()==1){ // 判断角色 if (!Strings.isBlank(user.getRoleId())){ // 判断是否还绑定其他的房屋,如果有,则不操作用户 QueryWrapper<HouseholdEntity> wrapper = new QueryWrapper<>(); wrapper.eq("is_deleted",0).eq("associated_user_id",user.getId()); List<HouseholdEntity> householdEntityList = householdService.list(wrapper); // 即没有房屋和场所了就删除对应的居民角色 if (householdEntityList.size()==0) { List<String> stringList = Arrays.asList(user.getRoleId().split(",")); // 查看当前用户的角色是否只有一个 if (stringList.size() > 1) { // 查询是否对应有场所负责人,如果有则不删除,如果没有则删除对应的角色 List<String> arrayList = new ArrayList<>(); for (String roleId : stringList) { if (!roleId.equals("1717429059648606209")) { arrayList.add(roleId); } } user.setRoleId(StringUtils.join(arrayList, ",")); // 更新用户 userService.updateById(user); } else { // 删除当前用户 userService.removeById(user.getId()); } } } } } } } /** * 删除场所对应的详情 * @param longs */ src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml
@@ -27,8 +27,8 @@ jda.region_code, jg.community_code neiCode, jc.street_code streetCode, bu.name realName, bu.phone, jp.principal as realName, jp.principal_phone as phone, jt.id, jt.NAME, jt.type, src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java
@@ -323,9 +323,9 @@ * 人员类-肇事肇祸精神障碍患者走访任务生成 */ public void createGridWordTask() { // 肇事肇祸精神障碍患者走访任务生成,查询标签为:20 // 肇事肇祸精神障碍患者走访任务生成,查询标签为:1006 List<Integer> list = new ArrayList<Integer>(){{ add(20); add(1006); }}; // 根据人员标签编号集合查询对应的住户(按颜色区分近多少天没有发过任务的住户) List<HouseholdVO> householdVOList = iHouseholdService.getHouseholdListByParam(list); @@ -534,6 +534,8 @@ taskEntity.setCreateTime(new Date()); taskEntity.setHouseCode(houseCode); taskEntity.setReportType(reportType); // 待场所负责人上报完善处理 taskEntity.setStatus(4); // 新增 save(taskEntity); // 返回 src/main/java/org/springblade/xxljob/jobhandler/LabelHandleJob.java
@@ -35,10 +35,10 @@ private ITaskService taskService; /** * 校园安全自查定时任务-绿色 * 三色定时任务 */ @XxlJob("campusSecurityJobHandler") public void campusSecurityJobHandler (String param){ @XxlJob("threeColourJobHandler") public void threeColourJobHandler (String param){ XxlJobHelper.log("开始执行任务..."); // 校园安全检查