hanfucheng 4 months ago
parent
commit
24d91a2b99

+ 7 - 0
src/main/java/com/sooka/sponest/data/other/patrolpoint/service/impl/CenterdataTEmergencyPatrolpointServiceImpl.java

@@ -1,6 +1,7 @@
 package com.sooka.sponest.data.other.patrolpoint.service.impl;
 
 import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
 import com.ruoyi.common.security.utils.SecurityUtils;
@@ -69,6 +70,9 @@ public class CenterdataTEmergencyPatrolpointServiceImpl extends BaseServiceImpl
         centerdataTEmergencyPatrolpoint.setId(IdUtils.simpleUUID());
         centerdataTEmergencyPatrolpoint.setCreateBy(SecurityUtils.getUserId().toString());
         centerdataTEmergencyPatrolpoint.setCreateTime(DateUtils.getNowDate());
+        if (StringUtils.isNotEmpty(centerdataTEmergencyPatrolpoint.getDeptId())){
+            centerdataTEmergencyPatrolpoint.setDataDeptId(Long.valueOf(centerdataTEmergencyPatrolpoint.getDeptId()));
+        }
         return centerdataTEmergencyPatrolpointMapper.insertCenterdataTEmergencyPatrolpoint(centerdataTEmergencyPatrolpoint);
     }
 
@@ -82,6 +86,9 @@ public class CenterdataTEmergencyPatrolpointServiceImpl extends BaseServiceImpl
     public int updateCenterdataTEmergencyPatrolpoint(CenterdataTEmergencyPatrolpoint centerdataTEmergencyPatrolpoint) {
         centerdataTEmergencyPatrolpoint.setUpdateBy(SecurityUtils.getUserId());
         centerdataTEmergencyPatrolpoint.setUpdateTime(DateUtils.getNowDate());
+        if (StringUtils.isNotEmpty(centerdataTEmergencyPatrolpoint.getDeptId())){
+            centerdataTEmergencyPatrolpoint.setDataDeptId(Long.valueOf(centerdataTEmergencyPatrolpoint.getDeptId()));
+        }
         return centerdataTEmergencyPatrolpointMapper.updateCenterdataTEmergencyPatrolpoint(centerdataTEmergencyPatrolpoint);
     }
 

+ 1 - 2
src/main/resources/mapper/other/CenterdataTEmergencyPatrolpointMapper.xml

@@ -121,7 +121,6 @@
             <if test="enterpriseName != null">enterprise_name,</if>
             <if test="owndeptid != null">owndeptid,</if>
             <if test="dataDeptId != null">data_dept_id,</if>
-            <if test="deptId != null">data_dept_id,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -148,7 +147,7 @@
             <if test="patrolpointStatus != null">#{patrolpointStatus},</if>
             <if test="enterpriseName != null">#{enterpriseName},</if>
             <if test="owndeptid != null">#{owndeptid},</if>
-            <if test="deptId != null">#{deptId},</if>
+            <if test="dataDeptId != null">#{dataDeptId},</if>
         </trim>
     </insert>