分部管理,更新为EC

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

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

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

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

@ -7,6 +7,7 @@
<result column="comp_name" property="compName"/>
<result column="comp_name_short" property="compNameShort"/>
<result column="parent_company" property="parentCompany"/>
<result column="ec_company" property="ecCompany"/>
<result column="org_code" property="orgCode"/>
<result column="industry" property="industry"/>
<result column="comp_principal" property="compPrincipal"/>
@ -30,6 +31,7 @@
, t.comp_name
, t.comp_name_short
, t.parent_company
, t.ec_company
, t.org_code
, t.industry
, t.comp_principal
@ -98,6 +100,9 @@
<if test="parentCompany != null ">
parent_company,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="orgCode != null ">
org_code,
</if>
@ -140,6 +145,9 @@
<if test="parentCompany != null ">
#{parentCompany},
</if>
<if test="ecCompany != null ">
#{ecCompany},
</if>
<if test="orgCode != null ">
#{orgCode},
</if>
@ -160,7 +168,7 @@
</insert>
<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
</selectKey>
INSERT INTO jcl_org_comp
@ -189,6 +197,9 @@
<if test="parentCompany != null ">
parent_company,
</if>
<if test="ecCompany != null ">
ec_company,
</if>
<if test="orgCode != null ">
org_code,
</if>
@ -228,8 +239,8 @@
<if test="compNameShort != null ">
#{compNameShort},
</if>
<if test="parentCompany != null ">
#{parentCompany},
<if test="ec_company != null ">
#{ecCompany},
</if>
<if test="orgCode != null ">
#{orgCode},
@ -300,8 +311,8 @@
jcl_org_comp t
WHERE t.delete_type = 0
<include refid="likeSQL"/>
<if test=" compPO.parentCompany != null ">
and t.parent_company = #{compPO.parentCompany}
<if test=" compPO.ecCompany != null ">
and t.ec_company = #{compPO.ecCompany}
</if>
<if test=" compPO.industry != null ">
and t.industry = #{compPO.industry}
@ -434,6 +445,7 @@
comp_name=#{compName},
comp_name_short=#{compNameShort},
parent_company=#{parentCompany},
ec_company=#{ecCompany},
org_code=#{orgCode},
industry=#{industry},
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.PageInfo;
import com.engine.organization.util.page.PageUtil;
import com.engine.organization.util.relation.EcHrmRelationUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import weaver.general.StringUtil;
@ -161,6 +162,11 @@ public class CompServiceImpl extends Service implements CompService {
}
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();
String ecCompanyID = Util.null2String(syncMap.get("id"));
OrganizationAssert.isTrue(StringUtils.isNotBlank(ecCompanyID), syncMap.get("message").toString());
@ -196,6 +202,11 @@ public class CompServiceImpl extends Service implements CompService {
compNo = repeatDetermine(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();
// 更新主表数据
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 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");
// 行业
@ -379,7 +390,7 @@ public class CompServiceImpl extends Service implements CompService {
&& StringUtil.isEmpty(compPO.getCompNo())
&& StringUtil.isEmpty(compPO.getCompNameShort())
&& StringUtil.isEmpty(compPO.getOrgCode())
&& null == compPO.getParentCompany()
&& null == compPO.getEcCompany()
&& null == compPO.getIndustry()
&& null == compPO.getCompPrincipal()
&& null == compPO.getForbiddenTag());

@ -62,7 +62,7 @@ public class ExtServiceImpl extends Service implements ExtService {
// 2编辑 1查看
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(","));
if (StringUtils.isEmpty(fields)) {
return conditionItems;

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

Loading…
Cancel
Save