| | |
| | | import org.springblade.modules.place.service.IPlacePractitionerService; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.place.vo.PlaceExtVO; |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | updatePlaceInfo(placeExt); |
| | | // 查询对应已存在的从业人员 |
| | | QueryWrapper<PlacePractitionerEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("place_id", placeExt.getPlaceId()); |
| | | wrapper.eq("place_id", placeExt.getPlaceId()).eq("is_deleted", 0); |
| | | List<PlacePractitionerEntity> oldList = placePractitionerService.list(wrapper); |
| | | List<PlacePractitionerEntity> list = placeExt.getPlacePractitioner(); |
| | | // 申明新增,修改,删除集合 |
| | |
| | | List<PlacePractitionerEntity> removeList = new ArrayList<>(); |
| | | // 找出需要新增的,否则组成新集合进行比对 |
| | | for (PlacePractitionerEntity practitionerEntity : list) { |
| | | practitionerEntity.setPlaceId(placeExt.getPlaceId()); |
| | | if (StringUtils.isNotBlank(practitionerEntity.getIdCard())) { |
| | | // 从身份证号获取出生日期 |
| | | String birthDateStr = practitionerEntity.getIdCard().substring(6, 14); |
| | | // 解析出生日期字符串为日期对象 |
| | | practitionerEntity.setBirthday(DateUtil.parse(birthDateStr, "yyyyMMdd")); |
| | | if (practitionerEntity.getResignationTime() != null) { |
| | | practitionerEntity.setResignationFlag(2); |
| | | } |
| | | practitionerEntity.setPlaceId(placeExt.getPlaceId()); |
| | | if (null == practitionerEntity.getId()) { |
| | | // 新增 |
| | | practitionerEntity.setPlaceId(placeExt.getPlaceId()); |
| | |
| | | } |
| | | // 更新 |
| | | placeService.updateById(placeEntity); |
| | | // 警格网格绑定修改 |
| | | if (!Strings.isBlank(placeEntity.getHouseCode()) && !Strings.isBlank(placeEntity.getLng())) { |
| | | PlaceVO placeVO = new PlaceVO(); |
| | | placeVO.setHouseCode(placeEntity.getHouseCode()); |
| | | placeVO.setLng(placeEntity.getLng()); |
| | | placeVO.setLat(placeEntity.getLat()); |
| | | // 网格绑定 |
| | | placeService.policePositionHandle(placeVO); |
| | | // 警务网格绑定 |
| | | placeService.jwGridCodeBind(placeVO); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | // 查询从业人员信息 |
| | | QueryWrapper<PlacePractitionerEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("place_id", placeExt.getPlaceId()); |
| | | queryWrapper.eq("resignation_flag",1); |
| | | detail.setPlacePractitioner(placePractitionerService.list(queryWrapper)); |
| | | } |
| | | // 返回 |