Merge pull request 'BUG修复' (#66) from feature/dxf into develop

Reviewed-on: #66
pull/68/head
dxfeng 3 years ago
commit 0315da18b1

@ -206,12 +206,36 @@ public class ExtendInfoBO {
fieldItem.setViewAttr(2);
}
}
// 浏览按钮特殊处理
if (FieldType.BROWSER.equals(fieldItem.getType())) {
switch (fieldItem.getType()) {
case BROWSER:
String browserId = SelectOptionParam.getCustomBrowserId(extendInfoPO.getCustomValue());
BrowserBean browserConditionParam = OrganizationFormItemUtil.browserItem(user, 2, 16, fieldItem.getViewAttr(), false, extendInfoPO.getFieldNameDesc(), extendInfoPO.getBrowserType(), extendInfoPO.getFieldName(), browserId).getBrowserConditionParam();
fieldItem.setBrowserConditionParam(browserConditionParam);
break;
case SELECT:
String customValue = Util.null2String(extendInfoPO.getCustomValue());
List<SearchConditionOption> searchConditionOptions = SelectOptionParam.convertJsonToListOption(customValue);
fieldItem.setOptions(searchConditionOptions);
break;
case FILEUPLOAD:
fieldItem.setUploadUrl("/api/doc/upload/uploadFile");
fieldItem.setCategory("category");
fieldItem.setMaxFilesNumber(10);
fieldItem.setMultiSelection(true);
Map<String, Object> otherParamsMap = new HashMap<>();
otherParamsMap.put("showClearAll", false);
otherParamsMap.put("showOrder", true);
fieldItem.setOtherParams(otherParamsMap);
break;
case DATEPICKER:
if ("402".equals(extendInfoPO.getBrowserType())) {
fieldItem.setFormat("YYYY");
} else if ("403".equals(extendInfoPO.getBrowserType())) {
fieldItem.setFormat("YYYY-MM");
}
break;
default:
break;
}
fieldItem.setWidth(width + "%");

@ -31,7 +31,7 @@ public class CardButtonPO {
private Integer showOrder;
private Integer open;
private Integer openType;
private Long creator;

@ -12,8 +12,6 @@
<result column="custom" property="custom"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
@ -29,8 +27,6 @@
, t.custom
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>

@ -9,11 +9,9 @@
<result column="roles" property="roles"/>
<result column="sys_default" property="sysDefault"/>
<result column="show_order" property="showOrder"/>
<result column="open" property="open"/>
<result column="open_type" property="openType"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
@ -28,11 +26,9 @@
, t.roles
, t.sys_default
, t.show_order
, t.open
, t.open_type
, t.creator
, t.delete_type
, t.create_time
, t.update_time
</sql>
<delete id="deleteByIds">
delete from jcl_org_cardbutton where id in

@ -197,9 +197,7 @@ public class CompServiceImpl extends Service implements CompService {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
CompSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), CompSearchParam.class);
String groupId = (String) params.get("viewCondition");
if ("0".equals(groupId)) {
groupId = GROUP_ID.toString();
}
if ("0".equals(groupId) || GROUP_ID.toString().equals(groupId)) {
String oldCompNo = getCompMapper().listById(searchParam.getId()).getCompNo();
String compNo = searchParam.getCompNo();
if (!compNo.equals(oldCompNo)) {
@ -219,8 +217,10 @@ public class CompServiceImpl extends Service implements CompService {
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_COMPEXT, params, groupId, searchParam.getId());
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_COMPEXT, params, "", searchParam.getId());
//更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_COMPEXT_DT1, params, searchParam.getId());

@ -281,10 +281,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
HasRightUtil.hasRight(user, RIGHT_NAME, false);
DeptSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), DeptSearchParam.class);
String groupId = (String) params.get("viewCondition");
if ("0".equals(groupId)) {
groupId = GROUP_ID.toString();
}
if ("0".equals(groupId) || GROUP_ID.toString().equals(groupId)) {
DepartmentPO oldDept = getDepartmentMapper().getDeptById(searchParam.getId());
String deptNo = searchParam.getDeptNo();
if (!deptNo.equals(oldDept.getDeptNo())) {
@ -318,10 +315,6 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, params).sync();
// 更新主表数据
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPT, params, "", searchParam.getId());
// 更新主表拓展表
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, params, groupId, searchParam.getId());
//更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, params, searchParam.getId());
DepartmentPO newDeptById = getDepartmentMapper().getDeptById(searchParam.getId());
new DepartmentTriggerRunnable(oldDept, newDeptById).run();
@ -332,6 +325,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
List<DepartmentPO> childList = getDepartmentMapper().getDeptListByPId(searchParam.getId());
String ecCompanyId = EcHrmRelationUtil.getEcCompanyId(Util.null2String(parentComp));
forbiddenChildTag(parentComp, ecCompanyId, childList);
}
// 更新主表拓展表
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_DEPTEXT, params, "", searchParam.getId());
//更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_DEPTEXT_DT1, params, searchParam.getId());
return searchParam.getId();
}

@ -195,7 +195,12 @@ public class ExtServiceImpl extends Service implements ExtService {
Map<String, Object> resultMap = new HashMap<>();
Set<String> keys = item.keySet();
for (String key : keys) {
resultMap.put(key.toLowerCase(), item.get(key));
Object o = item.get(key);
if (o instanceof Integer) {
resultMap.put(key.toLowerCase(), Integer.toString((int) o));
} else {
resultMap.put(key.toLowerCase(), o);
}
}
resultMap.put("viewAttr", finalCheckRight ? viewAttr : 1);
return resultMap;
@ -250,9 +255,6 @@ public class ExtServiceImpl extends Service implements ExtService {
value = null;
}
if (null == value) {
if ("int".equals(collect.get(key).getFieldType())) {
value = null;
}
// 兼容sqlServer数据库text字段类型
if ("text".equals(collect.get(key).getFieldType())) {
value = "";
@ -308,9 +310,9 @@ public class ExtServiceImpl extends Service implements ExtService {
Map<String, Object> map = new HashMap<>();
for (ExtendInfoPO extendInfoPO : filterS) {
if (BROWSER_TYPE.equals(extendInfoPO.getControlType())) {
map.put(extendInfoPO.getFieldName() + "span", params.get(extendInfoPO.getFieldName() + "span_" + i));
map.put(extendInfoPO.getFieldName() + "span", parseDetailValue(params.get(extendInfoPO.getFieldName() + "span_" + i)));
}
map.put(extendInfoPO.getFieldName(), params.get(extendInfoPO.getFieldName() + "_" + i));
map.put(extendInfoPO.getFieldName(), parseDetailValue(params.get(extendInfoPO.getFieldName() + "_" + i)));
}
map.put("mainid", id);
map.put("group_id", groupId);
@ -322,4 +324,11 @@ public class ExtServiceImpl extends Service implements ExtService {
}
}
}
private Object parseDetailValue(Object obj) {
if (null == obj || StringUtils.isBlank(Util.null2String(obj))) {
return null;
}
return obj;
}
}

@ -284,9 +284,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
public int updateForm(Map<String, Object> params) {
Long id = Long.parseLong((String) params.get("id"));
String groupId = (String) params.get("viewCondition");
if ("0".equals(groupId)) {
groupId = GROUP_ID.toString();
}
int updateCount = 0;
if ("0".equals(groupId) || GROUP_ID.toString().equals(groupId)) {
// 判断编号是否重复
String workCode = Util.null2String(params.get("work_code"));
HrmResourcePO resourceById = getResourceMapper().getResourceById(id.toString());
@ -303,15 +302,17 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
String ecResourceId = Util.null2String(syncMap.get("id"));
OrganizationAssert.isTrue(StringUtils.isNotBlank(ecResourceId), Util.null2String(syncMap.get("message")));
int updateCount = 0;
// 更新主表数据
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", id);
new HrmResourceTriggerRunnable(id).run();
} else {
// 更新主表拓展表
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRMEXT, params, groupId, id);
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRMEXT, params, "", id);
}
//更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_HRMEXT_DT1, params, id);
new HrmResourceTriggerRunnable(id).run();
return updateCount;
}

@ -404,9 +404,7 @@ public class JobServiceImpl extends Service implements JobService {
if (StringUtils.isNotBlank(parent_job)) {
OrganizationAssert.isFalse(parent_job.equals(searchParam.getId().toString()), "上级岗位不能选择本身");
}
if ("0".equals(groupId)) {
groupId = GROUP_ID.toString();
}
if ("0".equals(groupId) || GROUP_ID.toString().equals(groupId)) {
JobPO oldJobPO = getJobMapper().getJobById(searchParam.getId());
String oldJobNo = oldJobPO.getJobNo();
String jobNo = searchParam.getJobNo();
@ -435,14 +433,16 @@ public class JobServiceImpl extends Service implements JobService {
params.put("jobactivityid", JOB_ACTIVITY_ID);
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, params, oldJobPO).sync();
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", searchParam.getId());
// 更新主表拓展表
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, groupId, searchParam.getId());
// 更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_JOBEXT_DT1, params, searchParam.getId());
JobPO jobById = getJobMapper().getJobById(searchParam.getId());
new JobTriggerRunnable(oldJobPO, jobById).run();
// 更新人员关联字段
updateResourceJob(jobById);
}
// 更新主表拓展表
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOBEXT, params, "", searchParam.getId());
// 更新明细表
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_JOBEXT_DT1, params, searchParam.getId());
return searchParam.getId();
}

@ -50,16 +50,16 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
item.put("companyname", rs.getString("companyname"));
fclasslist.add(item);
}
String sql = "select distinct id, fnumber, fname, ftype from jcl_org_map where ftype in (0, 1) ";
String sql = "select id, fnumber, fname, ftype from jcl_org_map where ftype in (0, 1) ";
// 分部分权过滤
DetachUtil detachUtil = new DetachUtil(user.getUID());
if (detachUtil.isDETACH()) {
String jclRoleLevels = detachUtil.getJclRoleLevels();
if (StringUtils.isNotBlank(jclRoleLevels)) {
sql = "select distinct id, fnumber, fname, ftype from jcl_org_map where (ftype = 0 or (ftype = 1 and fobjid in(" + jclRoleLevels + "))) ";
sql = "select id, fnumber, fname, ftype from jcl_org_map where (ftype = 0 or (ftype = 1 and fobjid in(" + jclRoleLevels + "))) ";
} else {
sql = "select distinct id, fnumber, fname, ftype from jcl_org_map where ftype = 0 ";
sql = "select id, fnumber, fname, ftype from jcl_org_map where ftype = 0 ";
}
}
rs.executeQuery(sql + " and fdateend > " + DBType.get(new RecordSet().getDBType()).currentDate() + " order by ftype , id,fdateend desc ");

Loading…
Cancel
Save