Explorar el Código

Merge remote-tracking branch 'origin/V0.0.1' into V0.0.1

jingyuanchao hace 2 años
padre
commit
a9b9b2ad70

+ 20 - 30
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppPlanMapper.xml

@@ -83,13 +83,6 @@
             <if test="info.orgType != null">
                 and a.exec_org_type = #{info.orgType}
             </if>
-            <if test="info.checkSub==false">
-                and a.plan_of_org_id = #{info.orgId}
-            </if>
-            <if test="info.checkSub==true">
-                and a.plan_of_org_id in (select id from sys_org where path like concat( (select path from sys_org where
-                id =#{info.orgId}),'%'))
-            </if>
             <if test="info.roleList != null and info.roleList.size > 0">
                 and a.id in (select plan_id from core_resumption_plan_to_role where role_id in
                 <foreach collection="info.roleList" item="roleId" index="index" open="(" separator="," close=")">
@@ -97,29 +90,26 @@
                 </foreach>
                 )
             </if>
-            <!--            <if test="info.orgList != null and info.orgList.size > 0">-->
-            <!--                and a.id in (select plan_id from core_resumption_plan_to_exec_org where org_id in-->
-            <!--                (select id from sys_org-->
-            <!--                where path like concat((select path from sys_org where id=#{info.orgId}),'%')-->
-            <!--                )-->
-            <!--            </if>-->
-<!--            and a.id in (-->
-<!--            select if(plan_of_org_id=plan_create_org_id,id,parent_id ) as id from core_resumption_plan-->
-<!--            where 1=1-->
-<!--            <if test="info.checkSub==false">-->
-<!--                and plan_of_org_id=#{info.orgId}-->
-<!--            </if>-->
-<!--            <if test="info.checkSub==true">-->
-<!--                and plan_of_org_id in (select id from sys_org-->
-<!--                where path like concat((select path from sys_org where id=#{info.orgId}),'%'))-->
-<!--            </if>-->
-<!--            )-->
-            <!--            <if test="info.ids!=null and info.ids.size > 0">-->
-            <!--                and a.plan_of_org_id in-->
-            <!--                <foreach collection="info.ids" item="orgId" index="index" open="(" separator="," close=")">-->
-            <!--                    #{orgId}-->
-            <!--                </foreach>-->
-            <!--            </if>-->
+            and a.id in (
+            select id from core_resumption_plan
+            where 1=1
+            <if test="info.checkSub==false">
+                and plan_of_org_id=#{info.orgId}
+            </if>
+            <if test="info.checkSub==true">
+                and plan_of_org_id in (select id from sys_org
+                where path like concat((select path from sys_org where id=#{info.orgId}),'%'))
+            </if>
+            and parent_id not in (select id from core_resumption_plan
+            where 1=1
+            <if test="info.checkSub==false">
+                and plan_of_org_id=#{info.orgId}
+            </if>
+            <if test="info.checkSub==true">
+                and plan_of_org_id in (select id from sys_org
+                where path like concat((select path from sys_org where id=#{info.orgId}),'%'))
+            </if>)
+            )
         </where>
     </select>
     <select id="selectChildren" parameterType="com.xunmei.core.resumption.dto.plan.CoreResumptionPlanPageDto"

+ 1 - 1
soc-modules/soc-modules-sync/src/main/java/com/xunmei/sync/domain/FjnxOrg.java

@@ -21,7 +21,7 @@ import java.util.Date;
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
-@TableName("t_fjnx_org")
+@TableName("sync_fjnx_org")
 @ApiModel(value="同步FJNX机构保存对象", description="")
 public class FjnxOrg implements Serializable {
 

+ 12 - 12
soc-modules/soc-modules-sync/src/main/java/com/xunmei/sync/domain/FjnxOrgBusinessRelation.java

@@ -16,7 +16,7 @@ import java.util.Date;
  */
 
 @Data
-@TableName("t_fjnx_org_business_relation")
+@TableName("sync_fjnx_org_business_relation")
 @ApiModel(value = "OrgBusinessRelation对象", description = "")
 public class FjnxOrgBusinessRelation implements Serializable {
 
@@ -25,27 +25,27 @@ public class FjnxOrgBusinessRelation implements Serializable {
     @JsonSerialize(using = ToStringSerializer.class)
     private Long id;
 
-    @ApiModelProperty(value = "机构id")
-    @TableField("org_id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long orgId;
+//    @ApiModelProperty(value = "机构id")
+//    @TableField("org_id")
+//    @JsonSerialize(using = ToStringSerializer.class)
+//    private Long orgId;
 
     @ApiModelProperty(value = "机构编码")
     @TableField("org_code")
     private String orgCode;
 
-    @ApiModelProperty(value = "业务父级Id")
-    @TableField("business_parent_id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    private Long businessParentId;
+//    @ApiModelProperty(value = "业务父级Id")
+//    @TableField("business_parent_id")
+//    @JsonSerialize(using = ToStringSerializer.class)
+//    private Long businessParentId;
 
     @ApiModelProperty(value = "业务父级机构编码")
     @TableField("business_parent_code")
     private String businessParentCode;
 
-    @ApiModelProperty(value = "机构层级")
-    @TableField("org_level")
-    private Integer orgLevel;
+//    @ApiModelProperty(value = "机构层级")
+//    @TableField("org_level")
+//    private Integer orgLevel;
 
     @ApiModelProperty(value = "创建时间")
     @TableField("create_time")

+ 1 - 1
soc-modules/soc-modules-sync/src/main/java/com/xunmei/sync/domain/FjnxUser.java

@@ -14,7 +14,7 @@ import java.util.Date;
 
 @Data
 @EqualsAndHashCode(callSuper = false)
-@TableName("t_fjnx_user")
+@TableName("sync_fjnx_user")
 @ApiModel(value="同步FJNX用户保存对象", description="")
 public class FjnxUser {
 

+ 5 - 4
soc-modules/soc-modules-sync/src/main/java/com/xunmei/sync/service/impl/FJNXSyncServiceImpl.java

@@ -534,7 +534,6 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
                 } else {
                     log.error("同步人员【{}】所属机构编码【{}】在当前数据库中未找到,{}", x.getUserId() + x.getUserName(), x.getDepCode(), x);
                 }
-
             });
         }
         return result;
@@ -559,6 +558,7 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
         user.setSource(1);
         // TODO 机构状态和机构类型转换
         //user.setIsLock(fjnxOrgDto.getUsableFlag());
+        user.setOriginalOrgId(org.getId());
         return user;
 
     }
@@ -573,14 +573,15 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
         user.setJobNumber(fjnxUserDto.getTeller());
         user.setApproveStatus(1L);
         user.setUpdateTime(fjnxUserDto.getUpdateTime());
-        user.setOrgId(org.getId());
-        user.setOrgName(org.getName());
-        user.setOrgPath(org.getPath());
+        user.setOrgId(businessOrg.getId());
+        user.setOrgName(businessOrg.getName());
+        user.setOrgPath(businessOrg.getPath());
         //0 禁用 1 启用已改密码 2 启用未改密码
         user.setIsLock(fjnxUserDto.getUserStatus());
         // TODO 机构状态和机构类型转换
         //user.setIsLock(fjnxOrgDto.getUsableFlag());
         user.setSource(1);
+        user.setOriginalOrgId(org.getId());
         return user;
 
     }