diff --git a/docs/表结构SQL/MySQL.sql b/docs/表结构SQL/MySQL.sql index 56e888df..2ec98e4d 100644 --- a/docs/表结构SQL/MySQL.sql +++ b/docs/表结构SQL/MySQL.sql @@ -565,7 +565,7 @@ create table JCL_ORG_DETACH ( create table JCL_ORG_CARDACCESS ( id int auto_increment not null, type_id int not null, - type_name int not null, + type_name varchar(50) not null, status int null, all_people int null, superior int null, diff --git a/src/com/engine/organization/entity/personnelcard/po/CardAccessPO.java b/src/com/engine/organization/entity/personnelcard/po/CardAccessPO.java index 1d8f3e74..7a7d07c1 100644 --- a/src/com/engine/organization/entity/personnelcard/po/CardAccessPO.java +++ b/src/com/engine/organization/entity/personnelcard/po/CardAccessPO.java @@ -24,7 +24,7 @@ public class CardAccessPO { private Integer typeId; - private Integer typeName; + private String typeName; private Integer status; @@ -32,7 +32,7 @@ public class CardAccessPO { private Integer superior; - private String allSuperior; + private Integer allSuperior; private String custom; diff --git a/src/com/engine/organization/mapper/personnelcard/CardAccessMapper.xml b/src/com/engine/organization/mapper/personnelcard/CardAccessMapper.xml index 43336a70..2f751b30 100644 --- a/src/com/engine/organization/mapper/personnelcard/CardAccessMapper.xml +++ b/src/com/engine/organization/mapper/personnelcard/CardAccessMapper.xml @@ -42,7 +42,7 @@ type_id, - + type_name, @@ -77,7 +77,7 @@ #{typeId}, - + #{typeName}, @@ -119,7 +119,7 @@ type_id, - + type_name, @@ -154,7 +154,7 @@ #{typeId}, - + #{typeName}, @@ -220,7 +220,7 @@ UPDATE jcl_org_cardaccess SET delete_type = 1 WHERE delete_type = 0 - AND id IN + AND type_id IN #{id} @@ -233,7 +233,7 @@ from jcl_org_cardaccess t WHERE delete_type = 0 - AND id = #{id} + AND type_id = #{id} @@ -241,6 +241,6 @@ UPDATE jcl_org_cardaccess SET type_name = #{name} - WHERE id = #{id} + WHERE type_id = #{id} \ No newline at end of file diff --git a/src/com/engine/organization/service/impl/CardAccessServiceImpl.java b/src/com/engine/organization/service/impl/CardAccessServiceImpl.java index 9464e517..51ab0c7d 100644 --- a/src/com/engine/organization/service/impl/CardAccessServiceImpl.java +++ b/src/com/engine/organization/service/impl/CardAccessServiceImpl.java @@ -5,6 +5,7 @@ import com.engine.core.impl.Service; import com.engine.organization.component.OrganizationWeaTable; import com.engine.organization.entity.detach.vo.ManagerDetachVO; import com.engine.organization.entity.personnelcard.po.CardAccessPO; +import com.engine.organization.entity.personnelcard.vo.CardAccessVO; import com.engine.organization.mapper.personnelcard.CardAccessMapper; import com.engine.organization.service.CardAccessService; import com.engine.organization.util.HasRightUtil; @@ -31,7 +32,7 @@ public class CardAccessServiceImpl extends Service implements CardAccessService @Override public Map tablePage() { Map resultMap = new HashMap<>(); - OrganizationWeaTable table = new OrganizationWeaTable<>(user, ManagerDetachVO.class); + OrganizationWeaTable table = new OrganizationWeaTable<>(user, CardAccessVO.class); String sqlWhere = " where delete_type = 0"; table.setSqlwhere(sqlWhere); WeaResultMsg result = new WeaResultMsg(false); diff --git a/src/com/engine/organization/service/impl/FieldDefinedServiceImpl.java b/src/com/engine/organization/service/impl/FieldDefinedServiceImpl.java index b81fbbbb..4602f78b 100644 --- a/src/com/engine/organization/service/impl/FieldDefinedServiceImpl.java +++ b/src/com/engine/organization/service/impl/FieldDefinedServiceImpl.java @@ -3,6 +3,7 @@ package com.engine.organization.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.organization.entity.DeleteParam; import com.engine.organization.entity.SelectOptionParam; @@ -17,11 +18,13 @@ import com.engine.organization.entity.extend.po.ExtendInfoPO; import com.engine.organization.entity.extend.po.ExtendTitlePO; import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam; import com.engine.organization.entity.fieldset.vo.TypeTreeVO; +import com.engine.organization.entity.personnelcard.po.CardAccessPO; import com.engine.organization.enums.DeleteTypeEnum; import com.engine.organization.enums.ModuleTypeEnum; import com.engine.organization.mapper.extend.ExtendGroupMapper; import com.engine.organization.mapper.extend.ExtendInfoMapper; import com.engine.organization.mapper.extend.ExtendTitleMapper; +import com.engine.organization.service.CardAccessService; import com.engine.organization.service.FieldDefinedService; import com.engine.organization.util.HasRightUtil; import com.engine.organization.util.OrganizationAssert; @@ -29,6 +32,7 @@ import com.engine.organization.util.db.MapperProxyFactory; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import weaver.general.Util; +import weaver.hrm.User; import weaver.systeminfo.SystemEnv; import weaver.workflow.field.BrowserComInfo; @@ -56,6 +60,11 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ return MapperProxyFactory.getProxy(ExtendInfoMapper.class); } + private CardAccessService getCardAccessService(User user) { + return ServiceUtil.getService(CardAccessServiceImpl.class,user); + + } + @Override public List getTree(ModuleTypeEnum moduleTypeEnum) { Integer extendType = moduleTypeEnum.getValue(); @@ -208,8 +217,22 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ //默认新增title ExtendTitlePO extendTitlePO = buildExtendTitleType(extendGroupPO, 1); MapperProxyFactory.getProxy(ExtendTitleMapper.class).insertIgnoreNull(extendTitlePO); + CardAccessPO cardAccessPO = CardAccessPO.builder() + .typeId(extendGroupPO.getId().intValue()) + .typeName(fieldTypeTreeParam.getName()) + .status(1) + .allPeople(0) + .superior(0) + .allSuperior(0) + .creator((long)user.getUID()) + .deleteType(0) + .createTime(new Date()) + .updateTime(new Date()) + .build(); + getCardAccessService(user).addData(cardAccessPO); } else { MapperProxyFactory.getProxy(ExtendGroupMapper.class).update(fieldTypeTreeParam.getId(), fieldTypeTreeParam.getName()); + getCardAccessService(user).updateTabName(fieldTypeTreeParam.getName(),fieldTypeTreeParam.getId().intValue()); } } @@ -222,6 +245,7 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ if (CollectionUtils.isEmpty(titlesByGroupID)) { // 删除整个分组 getExtendGroupMapper().delete(param.getGroupType()); + getCardAccessService(user).deleteByIds(DeleteParam.builder().ids(param.getGroupType().toString()).build().getIds()); return 1; } return 0; diff --git a/src/com/engine/organization/service/impl/PostInfoServiceImpl.java b/src/com/engine/organization/service/impl/PostInfoServiceImpl.java index ac8d9817..e887cff8 100644 --- a/src/com/engine/organization/service/impl/PostInfoServiceImpl.java +++ b/src/com/engine/organization/service/impl/PostInfoServiceImpl.java @@ -128,11 +128,11 @@ public class PostInfoServiceImpl extends Service implements PostInfoService { SearchConditionItem nameItem = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "名称", "postInfoName"); nameItem.setRules("required|string"); // 权限 - SearchConditionItem authorityItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 50, "权限", "postInfoAuthority"); + SearchConditionItem authorityItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 0, "权限", "postInfoAuthority"); // 责任 - SearchConditionItem dutyItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 50, "责任", "postInfoDuty"); + SearchConditionItem dutyItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 0, "责任", "postInfoDuty"); // 资格 - SearchConditionItem qualificationItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 50, "资格", "postInfoQualification"); + SearchConditionItem qualificationItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 0, "资格", "postInfoQualification"); // 职务分类 SearchConditionItem postIdBrowser = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "职务分类", "161", "postId", "postBrowser"); postIdBrowser.setRules("required|string");