| | |
| | | package org.sxkj.fw.area.service.impl; |
| | | |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.sxkj.common.utils.HeaderUtils; |
| | | import org.sxkj.fw.area.entity.FwPoliceStationEntity; |
| | | import org.sxkj.fw.area.vo.FwPoliceStationVO; |
| | |
| | | |
| | | private void fillCreateFields(FwPoliceStationEntity fwPoliceStation) { |
| | | Long userId = AuthUtil.getUserId(); |
| | | Long deptId = Long.valueOf(AuthUtil.getDeptId()); |
| | | String deptIdStr = AuthUtil.getDeptId(); |
| | | Long deptId = null; |
| | | if (StringUtil.isNotBlank(deptIdStr)) { |
| | | try { |
| | | deptId = Long.valueOf(deptIdStr); |
| | | } catch (NumberFormatException ignored) { |
| | | deptId = null; |
| | | } |
| | | } |
| | | String areaCode = HeaderUtils.getAreaCode(); |
| | | if (StringUtil.isBlank(areaCode)) { |
| | | areaCode = fwPoliceStation.getAreaCode(); |
| | | } |
| | | Date now = new Date(); |
| | | fwPoliceStation.setCreateUser(userId); |
| | | fwPoliceStation.setUpdateUser(userId); |
| | | if (deptId != null) { |
| | | fwPoliceStation.setCreateDept(deptId); |
| | | } |
| | | if (StringUtil.isNotBlank(areaCode)) { |
| | | fwPoliceStation.setAreaCode(areaCode); |
| | | } |
| | | fwPoliceStation.setCreateTime(now); |
| | | fwPoliceStation.setUpdateTime(now); |
| | | } |
| | | |
| | | private void fillUpdateFields(FwPoliceStationEntity fwPoliceStation) { |
| | | fwPoliceStation.setUpdateUser(AuthUtil.getUserId()); |
| | | Long userId = AuthUtil.getUserId(); |
| | | if (userId != null) { |
| | | fwPoliceStation.setUpdateUser(userId); |
| | | } |
| | | fwPoliceStation.setUpdateTime(new Date()); |
| | | } |
| | | |