分部管理,更新为EC

pull/227/MERGE^2
dxfeng 3 years ago
parent f05cf6da8f
commit 4fa38f704c

@ -88,6 +88,7 @@ public class CompBO {
.compName(param.getCompName()) .compName(param.getCompName())
.compNameShort(param.getCompNameShort()) .compNameShort(param.getCompNameShort())
.parentCompany(param.getParentCompany()) .parentCompany(param.getParentCompany())
.ecCompany(param.getEcCompany())
.orgCode(param.getOrgCode()) .orgCode(param.getOrgCode())
.industry(param.getIndustry()) .industry(param.getIndustry())
.compPrincipal(param.getCompPrincipal()) .compPrincipal(param.getCompPrincipal())

@ -42,6 +42,7 @@ public class CompSearchParam extends BaseQueryParam {
* *
*/ */
private Long parentCompany; private Long parentCompany;
private Long ecCompany;
/** /**
* *

@ -44,6 +44,8 @@ public class CompPO {
*/ */
private Long parentCompany; private Long parentCompany;
private Long ecCompany;
/** /**
* *
*/ */

@ -7,6 +7,7 @@
<result column="comp_name" property="compName"/> <result column="comp_name" property="compName"/>
<result column="comp_name_short" property="compNameShort"/> <result column="comp_name_short" property="compNameShort"/>
<result column="parent_company" property="parentCompany"/> <result column="parent_company" property="parentCompany"/>
<result column="ec_company" property="ecCompany"/>
<result column="org_code" property="orgCode"/> <result column="org_code" property="orgCode"/>
<result column="industry" property="industry"/> <result column="industry" property="industry"/>
<result column="comp_principal" property="compPrincipal"/> <result column="comp_principal" property="compPrincipal"/>
@ -30,6 +31,7 @@
, t.comp_name , t.comp_name
, t.comp_name_short , t.comp_name_short
, t.parent_company , t.parent_company
, t.ec_company
, t.org_code , t.org_code
, t.industry , t.industry
, t.comp_principal , t.comp_principal
@ -98,6 +100,9 @@
<if test="parentCompany != null "> <if test="parentCompany != null ">
parent_company, parent_company,
</if> </if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="orgCode != null "> <if test="orgCode != null ">
org_code, org_code,
</if> </if>
@ -140,6 +145,9 @@
<if test="parentCompany != null "> <if test="parentCompany != null ">
#{parentCompany}, #{parentCompany},
</if> </if>
<if test="ecCompany != null ">
#{ecCompany},
</if>
<if test="orgCode != null "> <if test="orgCode != null ">
#{orgCode}, #{orgCode},
</if> </if>
@ -160,7 +168,7 @@
</insert> </insert>
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.company.po.CompPO" databaseId="oracle"> <insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.company.po.CompPO" databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER"> <selectKey keyProperty="id" resultType="long" order="AFTER">
select JCL_ORG_COMP_ID.currval from dual select JCL_ORG_COMP_ID.currval from dual
</selectKey> </selectKey>
INSERT INTO jcl_org_comp INSERT INTO jcl_org_comp
@ -189,6 +197,9 @@
<if test="parentCompany != null "> <if test="parentCompany != null ">
parent_company, parent_company,
</if> </if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="orgCode != null "> <if test="orgCode != null ">
org_code, org_code,
</if> </if>
@ -228,8 +239,8 @@
<if test="compNameShort != null "> <if test="compNameShort != null ">
#{compNameShort}, #{compNameShort},
</if> </if>
<if test="parentCompany != null "> <if test="ec_company != null ">
#{parentCompany}, #{ecCompany},
</if> </if>
<if test="orgCode != null "> <if test="orgCode != null ">
#{orgCode}, #{orgCode},
@ -300,8 +311,8 @@
jcl_org_comp t jcl_org_comp t
WHERE t.delete_type = 0 WHERE t.delete_type = 0
<include refid="likeSQL"/> <include refid="likeSQL"/>
<if test=" compPO.parentCompany != null "> <if test=" compPO.ecCompany != null ">
and t.parent_company = #{compPO.parentCompany} and t.ec_company = #{compPO.ecCompany}
</if> </if>
<if test=" compPO.industry != null "> <if test=" compPO.industry != null ">
and t.industry = #{compPO.industry} and t.industry = #{compPO.industry}
@ -434,6 +445,7 @@
comp_name=#{compName}, comp_name=#{compName},
comp_name_short=#{compNameShort}, comp_name_short=#{compNameShort},
parent_company=#{parentCompany}, parent_company=#{parentCompany},
ec_company=#{ecCompany},
org_code=#{orgCode}, org_code=#{orgCode},
industry=#{industry}, industry=#{industry},
comp_principal=#{compPrincipal}, comp_principal=#{compPrincipal},

@ -37,6 +37,7 @@ import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.page.Column; import com.engine.organization.util.page.Column;
import com.engine.organization.util.page.PageInfo; import com.engine.organization.util.page.PageInfo;
import com.engine.organization.util.page.PageUtil; import com.engine.organization.util.page.PageUtil;
import com.engine.organization.util.relation.EcHrmRelationUtil;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import weaver.general.StringUtil; import weaver.general.StringUtil;
@ -161,6 +162,11 @@ public class CompServiceImpl extends Service implements CompService {
} }
params.put("show_order", maxShowOrder + 1); params.put("show_order", maxShowOrder + 1);
} }
// 赋值上级分部
String ecCompany = Util.null2String(params.get("ec_company"));
if (StringUtils.isNotBlank(ecCompany)) {
params.put("parent_company", EcHrmRelationUtil.getJclCompanyId(ecCompany).getId());
}
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.ADD, params).sync(); Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.ADD, params).sync();
String ecCompanyID = Util.null2String(syncMap.get("id")); String ecCompanyID = Util.null2String(syncMap.get("id"));
OrganizationAssert.isTrue(StringUtils.isNotBlank(ecCompanyID), syncMap.get("message").toString()); OrganizationAssert.isTrue(StringUtils.isNotBlank(ecCompanyID), syncMap.get("message").toString());
@ -196,6 +202,11 @@ public class CompServiceImpl extends Service implements CompService {
compNo = repeatDetermine(compNo); compNo = repeatDetermine(compNo);
params.put("comp_no", compNo); params.put("comp_no", compNo);
} }
// 上级分部
String ecCompany = Util.null2String(params.get("ec_company"));
if (StringUtils.isNotBlank(ecCompany)) {
params.put("parent_company", EcHrmRelationUtil.getJclCompanyId(ecCompany).getId());
}
new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params).sync(); new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params).sync();
// 更新主表数据 // 更新主表数据
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", searchParam.getId()); getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMP, params, "", searchParam.getId());
@ -234,7 +245,7 @@ public class CompServiceImpl extends Service implements CompService {
// 简称 // 简称
SearchConditionItem compNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "简称", "compNameShort"); SearchConditionItem compNameShortItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "简称", "compNameShort");
// 上级公司 // 上级公司
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级公司", "161", "parentCompany", "compBrowser"); SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "上级公司", "164", "ecCompany", "");
// 组织机构代码 // 组织机构代码
SearchConditionItem orgCodeItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "组织机构代码", "orgCode"); SearchConditionItem orgCodeItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "组织机构代码", "orgCode");
// 行业 // 行业
@ -379,7 +390,7 @@ public class CompServiceImpl extends Service implements CompService {
&& StringUtil.isEmpty(compPO.getCompNo()) && StringUtil.isEmpty(compPO.getCompNo())
&& StringUtil.isEmpty(compPO.getCompNameShort()) && StringUtil.isEmpty(compPO.getCompNameShort())
&& StringUtil.isEmpty(compPO.getOrgCode()) && StringUtil.isEmpty(compPO.getOrgCode())
&& null == compPO.getParentCompany() && null == compPO.getEcCompany()
&& null == compPO.getIndustry() && null == compPO.getIndustry()
&& null == compPO.getCompPrincipal() && null == compPO.getCompPrincipal()
&& null == compPO.getForbiddenTag()); && null == compPO.getForbiddenTag());

@ -62,7 +62,7 @@ public class ExtServiceImpl extends Service implements ExtService {
// 2编辑 1查看 // 2编辑 1查看
OrganizationAssert.notNull(groupId, "请选择对应的拓展页"); OrganizationAssert.notNull(groupId, "请选择对应的拓展页");
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName, ExtendInfoOperateType.EDIT.getValue(), "1"); List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, groupId, tableName, 1 == viewAttr ? ExtendInfoOperateType.LIST.getValue() : ExtendInfoOperateType.EDIT.getValue(), "1");
String fields = infoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(",")); String fields = infoPOList.stream().map(ExtendInfoPO::getFieldName).collect(Collectors.joining(","));
if (StringUtils.isEmpty(fields)) { if (StringUtils.isEmpty(fields)) {
return conditionItems; return conditionItems;

@ -385,9 +385,9 @@ public class OrganizationSyncEc {
map.put("subcompanyname", Util.null2String(params.get("comp_name_short"))); map.put("subcompanyname", Util.null2String(params.get("comp_name_short")));
// 上级分部通过UUID联查ec表ID // 上级分部通过UUID联查ec表ID
String parentCompany = Util.null2String(params.get("parent_company")); String ecCompany = Util.null2String(params.get("ec_company"));
if (StringUtils.isNotBlank(parentCompany)) { if (StringUtils.isNotBlank(ecCompany)) {
map.put("supsubcomid", EcHrmRelationUtil.getEcCompanyId(parentCompany)); map.put("supsubcomid", ecCompany);
} }
map.put("subcompanycode", params.get("comp_no").toString()); map.put("subcompanycode", params.get("comp_no").toString());

Loading…
Cancel
Save