吉安感知网项目-后端
xiebin
2026-01-28 74756c657109a4e48dd6c0b4d8959cdab89b33a9
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/service/impl/FwPoliceStationServiceImpl.java
@@ -17,6 +17,7 @@
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;
@@ -42,6 +43,11 @@
   @Override
   public IPage<FwPoliceStationVO> selectFwPoliceStationPage(IPage<FwPoliceStationVO> page, FwPoliceStationVO fwPoliceStation) {
      return page.setRecords(baseMapper.selectFwPoliceStationPage(page, fwPoliceStation));
   }
   @Override
   public List<FwPoliceStationVO> selectFwPoliceStationList() {
      return baseMapper.selectFwPoliceStationList();
   }
@@ -78,19 +84,37 @@
   private void fillCreateFields(FwPoliceStationEntity fwPoliceStation) {
      Long userId = AuthUtil.getUserId();
      Long deptId = Long.valueOf(AuthUtil.getDeptId());
      String areaCode = HeaderUtils.getAreaCode();
      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);
      fwPoliceStation.setCreateDept(deptId);
      fwPoliceStation.setAreaCode(areaCode);
      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());
   }