lin 4 سال پیش
والد
کامیت
c2e7ceb191

+ 3 - 0
src/main/java/com/zoniot/ccrc/service/impl/CommunityServiceImpl.java

@@ -289,6 +289,8 @@ public class CommunityServiceImpl implements CommunityService {
     @Override
     public void syncCommunity(CommunityData communityData) {
         Integer siteId =  organizationMapper.findSiteId(communityData.getCustomerId());
+        Community communityTemp = communityMapper.findById(communityData.getId());
+
         Community community = new Community();
         community.setId(communityData.getId());
         community.setSiteId(siteId);
@@ -308,6 +310,7 @@ public class CommunityServiceImpl implements CommunityService {
         community.setDateUpdate(communityData.getDateUpdate());
         community.setCreateBy("system");
         community.setUpdateBy("system");
+        community.setOrgId(communityTemp!=null?communityTemp.getOrgId():null);
         log.info("syncCommunity community {}", JSON.toJSONString(community));
         communityMapper.replaceSelective(community);
 

+ 3 - 0
src/main/resources/mapper/CommunityMapper.xml

@@ -192,6 +192,7 @@
             <if test="community.dateUpdate!=null"> date_update,</if>
             <if test="community.createBy!=null"> create_by,</if>
             <if test="community.updateBy!=null"> update_by,</if>
+            <if test="community.orgId!=null"> org_id,</if>
         </trim>
         VALUES
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -229,6 +230,8 @@
             </if>
             <if test="community.updateBy!=null">#{community.updateBy,jdbcType=VARCHAR},
             </if>
+            <if test="community.orgId!=null">#{community.orgId,jdbcType=INTEGER},
+            </if>
         </trim>
     </insert>