BUG修复

pull/95/head
dxfeng 2 years ago
parent b9d06b4246
commit 8383c08a06

@ -37,7 +37,7 @@ public interface CompMapper {
* @param ids
* @return
*/
List<CompPO> listChild(@Param("ids") Collection<Long> ids);
List<CompPO> listChild(@Param("ids") Collection<Integer> ids);
/**
* ID

@ -54,7 +54,9 @@
<if test=" CompanyPO.supSubComId != null ">
and t.supSubComId = #{CompanyPO.supSubComId}
</if>
<include refid="isCanceled"/>
<if test=" CompanyPO.canceled != null ">
<include refid="isCanceled"/>
</if>
order by ${orderSql}
</select>
@ -215,19 +217,16 @@
</sql>
<sql id="isCanceled">
<if test=" CompanyPO.canceled != null and CompanyPO.canceled != '' ">
and ifnull(canceled,0)= #{CompanyPO.canceled}
</if>
and ifnull(canceled,0)=
#{CompanyPO.canceled}
</sql>
<sql id="isCanceled" databaseId="oracle">
<if test=" CompanyPO.canceled != null and CompanyPO.canceled != '' ">
and nvl(canceled,0)= #{CompanyPO.canceled}
</if>
and nvl(canceled,0)=
#{CompanyPO.canceled}
</sql>
<sql id="isCanceled" databaseId="sqlserver">
<if test=" CompanyPO.canceled != null and CompanyPO.canceled != '' ">
and isnull(canceled,0)= #{CompanyPO.canceled}
</if>
and isnull(canceled,0)=
#{CompanyPO.canceled}
</sql>
</mapper>

@ -95,13 +95,16 @@
from hrmdepartment t where departmentCode = #{departmentCode}
</select>
<select id="listUsedId" resultType="java.lang.String">
select parent_dept
select ec_department
from JCL_ORG_JOB
where delete_type = 0
union
select dept_id
from JCL_ORG_STAFF
where delete_type = 0
union
select departmentid
from hrmresource
</select>
<select id="getDeptsByIds" resultMap="BaseResultMap">
select
@ -182,17 +185,17 @@
</sql>
<sql id="isCanceled">
<if test=" departmentPO.canceled != null and departmentPO.canceled != '' ">
<if test=" departmentPO.canceled != null ">
and ifnull(canceled,0)= #{departmentPO.canceled}
</if>
</sql>
<sql id="isCanceled" databaseId="oracle">
<if test=" departmentPO.canceled != null and departmentPO.canceled != '' ">
<if test=" departmentPO.canceled != null">
and nvl(canceled,0)= #{departmentPO.canceled}
</if>
</sql>
<sql id="isCanceled" databaseId="sqlserver">
<if test=" departmentPO.canceled != null and departmentPO.canceled != '' ">
<if test=" departmentPO.canceled != null">
and isnull(canceled,0)= #{departmentPO.canceled}
</if>
</sql>

@ -56,12 +56,12 @@
</update>
<select id="listAll" resultType="com.engine.organization.entity.hrmresource.vo.HrmResourceVO">
SELECT t.last_name as lastName,d.departmentname as departmentName,
c.subcompanyname as companyName,t.mobile,t.telephone,t1.last_name as managerName
from jcl_org_hrmresource t
left join hrmdepartment d on t.ec_department = d.id
left join hrmsubcompany c on t.ec_eompany = c.id
left join jcl_org_hrmresource t1 on t.manager_id = t1.id
SELECT t.lastname as lastName,d.departmentname as departmentName,
c.subcompanyname as companyName,t.mobile,t.telephone,t1.lastname as managerName
from hrmresource t
left join hrmdepartment d on t.subcompanyid1 = d.id
left join hrmsubcompany c on t.departmentid = c.id
left join hrmresource t1 on t.managerid = t1.id
where 1 = 1
<if test="ids != null and ids.size > 0">
AND t.id IN
@ -92,7 +92,7 @@
<!--<if test="param.jobTitle != null and param.jobTitle != ''">-->
<!--and t.job_title = #{param.jobTitle}-->
<!--</if>-->
order by t.show_order asc
order by t.dsporder asc
</select>
<select id="getResourceListByJobId"
resultMap="HrmResourceMap">

@ -11,7 +11,6 @@ import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.hrm.service.impl.OrganizationServiceImpl;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.TopTab;
import com.engine.organization.entity.company.bo.CompBO;
import com.engine.organization.entity.company.dto.CompListDTO;
@ -135,9 +134,18 @@ public class CompServiceImpl extends Service implements CompService {
@Override
public Long updateComp(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
String ecCompanyId = Util.null2String(params.get("id"));
Integer ecCompanyId = Integer.parseInt(Util.null2String(params.get("id")));
Integer supSubComId = Integer.parseInt(Util.null2String(params.get("supsubcomid")));
Set<Integer> disableIds = new HashSet<>();
disableIds.add(ecCompanyId);
List<CompPO> compPOS = getCompMapper().listChild(Collections.singletonList(ecCompanyId));
if (CollectionUtils.isNotEmpty(compPOS)) {
addDisableIds(disableIds, compPOS);
}
OrganizationAssert.isFalse(disableIds.contains(supSubComId), "上级分部不能选择分部本身及其下级分部");
new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params).sync();
return Long.parseLong(ecCompanyId);
return (long) ecCompanyId;
}
@Override
@ -180,7 +188,6 @@ public class CompServiceImpl extends Service implements CompService {
Map<String, Object> retMap = new HashMap<>();
List<SearchConditionGroup> groupList = new ArrayList<>();
List<SearchConditionItem> itemList;
List<SearchConditionItem> extendItemList = new ArrayList<>();
String id = Util.null2String(params.get("id"));
int viewAttr = Integer.parseInt((String) params.get("viewAttr"));
@ -273,11 +280,7 @@ public class CompServiceImpl extends Service implements CompService {
}
searchConditionItem.setViewAttr(viewAttr);
if ("1".equals(isSystem)) {
itemList.add(searchConditionItem);
} else {
extendItemList.add(searchConditionItem);
}
itemList.add(searchConditionItem);
}
int operateLevel;
@ -319,11 +322,7 @@ public class CompServiceImpl extends Service implements CompService {
searchConditionItem.setViewAttr(viewAttr);
itemList.add(searchConditionItem);
}
groupList.add(new SearchConditionGroup(SystemEnv.getHtmlLabelNames(groupLabel, user.getLanguage()), true, itemList));
if (CollectionUtils.isNotEmpty(extendItemList)) {
groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList));
}
}
}
HashMap<String, Object> buttonsMap = new HashMap<>();
@ -371,7 +370,8 @@ public class CompServiceImpl extends Service implements CompService {
// 判断目标分部是否为它本身以及子元素
Set<Integer> disableIds = new HashSet<>();
disableIds.add(companyId);
List<CompPO> compPOS = getCompMapper().listChild(DeleteParam.builder().ids(companyId.toString()).build().getIds());
List<CompPO> compPOS = getCompMapper().listChild(Collections.singletonList(companyId));
if (CollectionUtils.isNotEmpty(compPOS)) {
addDisableIds(disableIds, compPOS);
}
@ -405,7 +405,7 @@ public class CompServiceImpl extends Service implements CompService {
private void addDisableIds(Set<Integer> disableIds, List<CompPO> compPOS) {
for (CompPO compPO : compPOS) {
disableIds.add(compPO.getId());
List<CompPO> childCompPOS = getCompMapper().listChild(DeleteParam.builder().ids(compPO.getId().toString()).build().getIds());
List<CompPO> childCompPOS = getCompMapper().listChild(Collections.singletonList(compPO.getId()));
addDisableIds(disableIds, childCompPOS);
}
}
@ -448,7 +448,6 @@ public class CompServiceImpl extends Service implements CompService {
boolean groupHide = lsField.size() == 0 || hfm.getGroupCount(lsField) == 0 || !"1".equals(Util.null2String(HrmFieldGroupComInfo.getIsShow(groupId)));
String groupLabel = HrmFieldGroupComInfo.getLabel(groupId);
List<SearchConditionItem> itemList = new ArrayList<>();
List<SearchConditionItem> extendItemList = new ArrayList<>();
for (Object o : lsField) {
String fieldId = (String) o;
String fieldName = HrmFieldComInfo.getFieldname(fieldId);
@ -536,17 +535,12 @@ public class CompServiceImpl extends Service implements CompService {
otherParams1.put("showOrder", false);
searchConditionItem.setOtherParams(otherParams1);
}
if ("1".equals(isSystem)) {
itemList.add(searchConditionItem);
} else {
extendItemList.add(searchConditionItem);
}
itemList.add(searchConditionItem);
}
}
groupList.add(new SearchConditionGroup(SystemEnv.getHtmlLabelNames(groupLabel, user.getLanguage()), true, itemList));
if (CollectionUtils.isNotEmpty(extendItemList)) {
groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList));
}
}
return groupList;
}

@ -193,9 +193,20 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
@Override
public Long updateForm(Map<String, Object> params) {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
String ecCompanyId = Util.null2String(params.get("id"));
Integer ecDepartmentId = Integer.parseInt(Util.null2String(params.get("id")));
Integer supDepId = Integer.parseInt(Util.null2String(params.get("supdepid")));
// 不可选择合并的数据,本身及子部门
Set<Integer> disableIds = new HashSet<>();
// 添加选择部门本身
disableIds.add(ecDepartmentId);
List<DepartmentPO> deptListByPId = getDepartmentMapper().getDeptListByPId(ecDepartmentId);
if (CollectionUtils.isNotEmpty(deptListByPId)) {
addDisableIds(disableIds, deptListByPId);
}
OrganizationAssert.isFalse(disableIds.contains(supDepId), "上级部门不能选择部门本身及其下级部门");
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, params).sync();
return Long.parseLong(ecCompanyId);
return (long) ecDepartmentId;
}
@Override
@ -241,7 +252,6 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
List<SearchConditionGroup> groupList = new ArrayList<>();
List<SearchConditionItem> itemList;
List<SearchConditionItem> extendItemList;
String id = Util.null2String(params.get("id"));
if (2 == viewAttr) {
params.put("viewattr", viewAttr);
@ -271,7 +281,6 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
if (!"1".equals(Util.null2String(HrmFieldGroupComInfo.getIsShow(groupId)))) continue;
String groupLabel = HrmFieldGroupComInfo.getLabel(groupId);
itemList = new ArrayList<>();
extendItemList = new ArrayList<>();
for (Object o : lsField) {
String fieldId = (String) o;
String isUse = HrmFieldComInfo.getIsused(fieldId);
@ -318,11 +327,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
}
searchConditionItem.setViewAttr(viewAttr);
if ("1".equals(isSystem)) {
itemList.add(searchConditionItem);
} else {
extendItemList.add(searchConditionItem);
}
itemList.add(searchConditionItem);
}
int operateLevel;
@ -366,9 +372,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
itemList.add(searchConditionItem);
}
groupList.add(new SearchConditionGroup(SystemEnv.getHtmlLabelNames(groupLabel, user.getLanguage()), true, itemList));
if (CollectionUtils.isNotEmpty(extendItemList)) {
groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList));
}
}
}
@ -830,7 +834,6 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
private List<SearchConditionGroup> getDepartmentConditionGroups(Map<String, Object> params) {
List<SearchConditionGroup> groupList = new ArrayList<>();
List<SearchConditionItem> itemList;
List<SearchConditionItem> extendItemList;
String id = Util.null2String(params.get("id"));
int viewAttr = Util.getIntValue(Util.null2String(params.get("viewattr")), 1);
@ -863,7 +866,6 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
boolean groupHide = lsField.size() == 0 || hfm.getGroupCount(lsField) == 0 || !"1".equals(Util.null2String(HrmFieldGroupComInfo.getIsShow(groupId)));
String grouplabel = HrmFieldGroupComInfo.getLabel(groupId);
itemList = new ArrayList<>();
extendItemList = new ArrayList<>();
for (Object o : lsField) {
String fieldId = (String) o;
String fieldName = HrmFieldComInfo.getFieldname(fieldId);
@ -946,17 +948,12 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
otherParams1.put("showOrder", false);
searchConditionItem.setOtherParams(otherParams1);
}
if ("1".equals(isSystem)) {
itemList.add(searchConditionItem);
} else {
extendItemList.add(searchConditionItem);
}
itemList.add(searchConditionItem);
}
}
groupList.add(new SearchConditionGroup(SystemEnv.getHtmlLabelNames(grouplabel, user.getLanguage()), true, itemList));
if (CollectionUtils.isNotEmpty(extendItemList)) {
groupList.add(new SearchConditionGroup("拓展信息", true, extendItemList));
}
}
return groupList;
}

@ -2,12 +2,9 @@ package com.engine.organization.thread;
import com.engine.common.util.ServiceUtil;
import com.engine.hrm.service.impl.OrganizationServiceImpl;
import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.enums.LogModuleNameEnum;
import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.relation.ResourceSyncUtil;
import weaver.conn.RecordSet;
import weaver.general.Util;
@ -26,13 +23,10 @@ public class OrganizationSyncEc {
private final OperateTypeEnum operateType;
private Map<String, Object> params;
private final User user;
private JobPO oldJobPO;
Map<String, Object> resultMap;
private boolean throwException = true;
private SystemDataMapper getSystemDataMapper() {
return MapperProxyFactory.getProxy(SystemDataMapper.class);
}
public OrganizationSyncEc(User user, LogModuleNameEnum moduleName, OperateTypeEnum operateType, Map<String, Object> params) {
this.moduleName = moduleName;
@ -49,22 +43,6 @@ public class OrganizationSyncEc {
this.throwException = throwException;
}
public OrganizationSyncEc(User user, LogModuleNameEnum moduleName, OperateTypeEnum operateType, Map<String, Object> params, JobPO oldJobPO) {
this.moduleName = moduleName;
this.operateType = operateType;
this.params = params;
this.user = user;
this.oldJobPO = oldJobPO;
}
public OrganizationSyncEc(User user, LogModuleNameEnum moduleName, OperateTypeEnum operateType, Map<String, Object> params, JobPO oldJobPO, boolean throwException) {
this.moduleName = moduleName;
this.operateType = operateType;
this.params = params;
this.user = user;
this.oldJobPO = oldJobPO;
this.throwException = throwException;
}
public Map<String, Object> sync() {
switch (moduleName) {

Loading…
Cancel
Save