diff --git a/src/com/api/jygf/web/MobilePermissionsAction.java b/src/com/api/jygf/web/MobilePermissionsAction.java deleted file mode 100644 index 040835b..0000000 --- a/src/com/api/jygf/web/MobilePermissionsAction.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.api.jygf.web; - -import javax.ws.rs.Path; - -/** - * @Author weaver_cl - * @Description: - * @Date 2022/10/9 - * @Version V1.0 - **/ -@Path("/mobile/permission") -public class MobilePermissionsAction extends com.engine.jygf.web.MobilePermissionsAction { -} diff --git a/src/com/engine/junchuang/annotation/CheckboxPopedom.java b/src/com/engine/junchuang/annotation/CheckboxPopedom.java deleted file mode 100644 index 9587412..0000000 --- a/src/com/engine/junchuang/annotation/CheckboxPopedom.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.engine.junchuang.annotation; - -import java.lang.annotation.*; - -/** - * @Author weaver_cl - * @Description: - * @Date 2022/5/30 - * @Version V1.0 - **/ -@Target({ElementType.ANNOTATION_TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface CheckboxPopedom { - - String id() default ""; - - String showmethod() default ""; - - String popedompara() default ""; -} diff --git a/src/com/engine/junchuang/annotation/OperatePopedom.java b/src/com/engine/junchuang/annotation/OperatePopedom.java deleted file mode 100644 index eea3ad2..0000000 --- a/src/com/engine/junchuang/annotation/OperatePopedom.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.engine.junchuang.annotation; - -import java.lang.annotation.*; - -/** - * @Author weaver_cl - * @Description: - * @Date 2022/5/30 - * @Version V1.0 - **/ -@Target({ElementType.ANNOTATION_TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface OperatePopedom { - - boolean async() default true; - - String transmethod() default ""; - - String otherpara() default ""; - - String otherpara2() default ""; - - String column() default ""; -} diff --git a/src/com/engine/junchuang/annotation/OrganizationTable.java b/src/com/engine/junchuang/annotation/OrganizationTable.java deleted file mode 100644 index df39650..0000000 --- a/src/com/engine/junchuang/annotation/OrganizationTable.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.engine.junchuang.annotation; - - -import com.cloudstore.eccom.pc.table.WeaTableType; - -import java.lang.annotation.*; - -/** - * @Author dxfeng - * @Description: - * @Date 2022/5/9 - * @Version V1.0 - **/ -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface OrganizationTable { - - String pageId() default ""; - - /** - * 数据库字段,以','分割,例如:"id, name, description" - */ - String fields() default ""; - - /** - * 表名 ,例如:"FROM hrsa_tax_agent" - */ - String fromSql() default ""; - - /** - * 条件 - */ - String where() default ""; - - /** - * 分组 - */ - String groupby() default ""; - - - /** - * 排序 - */ - String orderby() default ""; - - /** - * 主键 - */ - String primarykey() default ""; - - /** - * 去重 - */ - boolean distinct() default false; - - - /** - * 排序方式 - * @return - */ - String sortway() default "desc"; - - /** - * 操作按钮 - */ - OrganizationTableOperate[] operates() default {}; - - /** - * 操作按钮权限控制 - * @return - */ - OperatePopedom operatePopedom() default @OperatePopedom; - - /** - * 列表选择框 - */ - WeaTableType tableType() default WeaTableType.NONE; - - CheckboxPopedom checkboxPopedom() default @CheckboxPopedom; -} diff --git a/src/com/engine/junchuang/annotation/OrganizationTableColumn.java b/src/com/engine/junchuang/annotation/OrganizationTableColumn.java deleted file mode 100644 index bd1a816..0000000 --- a/src/com/engine/junchuang/annotation/OrganizationTableColumn.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.engine.junchuang.annotation; - -import java.lang.annotation.*; - -/** - * @Author dxfeng - * @Description: - * @Date 2022/5/9 - * @Version V1.0 - **/ -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface OrganizationTableColumn { - - String text() default ""; - - int labelId() default -1; - - String width() default ""; - - String column() default ""; - - boolean display() default true; - - String orderkey() default ""; - - String transmethod() default ""; - - // 额外参数 - String otherPara() default ""; -} diff --git a/src/com/engine/junchuang/annotation/OrganizationTableOperate.java b/src/com/engine/junchuang/annotation/OrganizationTableOperate.java deleted file mode 100644 index cd2175f..0000000 --- a/src/com/engine/junchuang/annotation/OrganizationTableOperate.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.engine.junchuang.annotation; - -import java.lang.annotation.*; - -/** - * @Author dxfeng - * @Description: - * @Date 2022/5/9 - * @Version V1.0 - **/ -@Target({ElementType.ANNOTATION_TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface OrganizationTableOperate { - - String text() default ""; - - int labelId() default -1; - - String href() default ""; - - String index() default "0"; - - - - -} diff --git a/src/com/engine/junchuang/annotation/TableTitle.java b/src/com/engine/junchuang/annotation/TableTitle.java deleted file mode 100644 index 71675ac..0000000 --- a/src/com/engine/junchuang/annotation/TableTitle.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.engine.junchuang.annotation; - -import java.lang.annotation.*; - - -@Target({ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface TableTitle { - String title(); - String dataIndex(); - String key(); - boolean display() default true; - String width() default ""; - boolean sorter() default false; -} diff --git a/src/com/engine/junchuang/component/OrganizationWeaTable.java b/src/com/engine/junchuang/component/OrganizationWeaTable.java deleted file mode 100644 index 81d2b6a..0000000 --- a/src/com/engine/junchuang/component/OrganizationWeaTable.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.engine.junchuang.component; - -import com.cloudstore.eccom.constant.WeaBoolAttr; -import com.cloudstore.eccom.pc.table.*; -import com.engine.junchuang.annotation.*; -import org.apache.commons.lang3.StringUtils; -import weaver.general.PageIdConst; -import weaver.hrm.User; -import weaver.systeminfo.SystemEnv; - -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class OrganizationWeaTable extends WeaTable { - - public OrganizationWeaTable(User user, Class clazz) { - - boolean isAnno = clazz.isAnnotationPresent(OrganizationTable.class); - if (isAnno) { - OrganizationTable table = (OrganizationTable) clazz.getAnnotation(OrganizationTable.class); - String pageId = table.pageId(); - super.setPageID(pageId); - String pageUid = pageId + "_" + user.getUID(); - super.setPageUID(pageUid); - String pageSize = PageIdConst.getPageSize(pageId, user.getUID()); - super.setPagesize(pageSize); - String backfields = table.fields(); - super.setBackfields(backfields); - String sql = table.fromSql(); - super.setSqlform(sql); - String where = table.where(); - if (StringUtils.isNotBlank(where)) { - super.setSqlwhere(where); - } - String orderby = table.orderby(); - if (StringUtils.isNotBlank(orderby)) { - super.setSqlorderby(orderby); - } - String sortway = table.sortway(); - if (StringUtils.isNotBlank(sortway)) { - super.setSqlsortway(sortway); - } - String groupby = table.groupby(); - if (StringUtils.isNotBlank(groupby)) { - super.setSqlgroupby(groupby); - } - boolean distinct = table.distinct(); - super.setSqlisdistinct(String.valueOf(distinct)); - String primarykey = table.primarykey(); - if (StringUtils.isNotBlank(primarykey)) { - super.setSqlprimarykey(primarykey); - } - OrganizationTableOperate[] operates = table.operates(); - if (operates != null && operates.length > 0) { - List operateList = new ArrayList<>(); - Arrays.stream(operates).forEach(o -> { - String text = o.text(); - int labelId = o.labelId(); - String htmlLabelName = SystemEnv.getHtmlLabelName(labelId, user.getLanguage()); - if (StringUtils.isNotBlank(htmlLabelName)) { - text = htmlLabelName; - } - WeaTableOperate weaTableOperate = new WeaTableOperate(text, o.href(), o.index()); - operateList.add(weaTableOperate); - }); - WeaTableOperates weaTableOperates = new WeaTableOperates(); - OperatePopedom popedoms = table.operatePopedom(); - WeaTablePopedom popedom = new WeaTablePopedom(); - if (popedoms != null && !"".equals(popedoms.transmethod())) { - popedom.setTransmethod(popedoms.transmethod()); - popedom.setOtherpara(popedoms.otherpara()); - weaTableOperates.setPopedom(popedom); - } - weaTableOperates.setOperate(operateList); - super.setOperates(weaTableOperates); - } - - WeaTableType weaTableTypeEnum = table.tableType(); - //设置check是否可用 - if (weaTableTypeEnum == WeaTableType.CHECKBOX) { - super.setTableType(weaTableTypeEnum); - CheckboxPopedom checkPopedom = table.checkboxPopedom(); - WeaTableCheckboxpopedom checkboxpopedom = new WeaTableCheckboxpopedom(); - if (checkPopedom != null && !"".equals(checkPopedom.showmethod())){ - checkboxpopedom.setShowmethod(checkPopedom.showmethod()); - checkboxpopedom.setPopedompara(checkPopedom.popedompara()); - } - super.setCheckboxpopedom(checkboxpopedom); - } - - } - - Field[] fields = clazz.getDeclaredFields(); - for (Field f : fields) { - boolean isanno = f.isAnnotationPresent(OrganizationTableColumn.class); - if (isanno) { - OrganizationTableColumn columnAnn = f.getAnnotation(OrganizationTableColumn.class); - String text = columnAnn.text(); - int labelId = columnAnn.labelId(); - String htmlLabelName = SystemEnv.getHtmlLabelName(labelId, user.getLanguage()); - if (StringUtils.isNotBlank(htmlLabelName)) { - text = htmlLabelName; - } - String width = columnAnn.width(); - String column = columnAnn.column(); - String orderkey = columnAnn.orderkey(); - boolean display = columnAnn.display(); - WeaTableColumn weaTableColumn = new WeaTableColumn(width, text, column, orderkey); - String transmethod = columnAnn.transmethod(); - - if (StringUtils.isNotBlank(transmethod)) { - weaTableColumn.setTransmethod(transmethod); - } - String otherPara = columnAnn.otherPara(); - if(StringUtils.isNotBlank(otherPara)) { - weaTableColumn.setOtherpara(otherPara); - } - if (!display) { - weaTableColumn.setDisplay(WeaBoolAttr.FALSE); - } - super.getColumns().add(weaTableColumn); - } - } - - - } -} diff --git a/src/com/engine/junchuang/entity/detach/vo/ManagerDetachVO.java b/src/com/engine/junchuang/entity/detach/vo/ManagerDetachVO.java deleted file mode 100644 index 45b2ec3..0000000 --- a/src/com/engine/junchuang/entity/detach/vo/ManagerDetachVO.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.engine.junchuang.entity.detach.vo; - -import com.cloudstore.eccom.pc.table.WeaTableType; -import com.engine.junchuang.annotation.OrganizationTable; -import com.engine.junchuang.annotation.OrganizationTableColumn; -import com.engine.junchuang.annotation.OrganizationTableOperate; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author weaver_cl - * @Description: - * @Date 2022/10/21 - * @Version V1.0 - **/ - -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@OrganizationTable(pageId = "e561e1ba-efad-11ed-8409-00e04c680716", - fields = "t.id," + - "t.ec_manager," + - "t.ec_rolelevel," + - "t.manage_module," + - "t.creator," + - "t.delete_type," + - "t.create_time," + - "t.update_time", - fromSql = "FROM jc_org_detach t ", - orderby = "id", - sortway = "asc", - primarykey = "id", - operates = { - @OrganizationTableOperate(index = "0", text = "编辑"), - @OrganizationTableOperate(index = "1", text = "删除") - }, - tableType = WeaTableType.CHECKBOX -) -public class ManagerDetachVO { - - - @OrganizationTableColumn(column = "id", display = false) - private Long id; - - - @OrganizationTableColumn(text = "管理员", width = "20%", column = "ec_manager", transmethod = "com.engine.organization.transmethod.ManagerDetachTransMethod.getManagerName") - private Integer ecManager; - - @OrganizationTableColumn(text = "可管理组织机构", width = "40%", column = "ec_rolelevel",transmethod = "com.engine.organization.transmethod.ManagerDetachTransMethod.getRoleLevel") - private String ecRolelevel; - - - @OrganizationTableColumn(text = "可管理模块", width = "40%", column = "manage_module") - private String manageModule; - -} diff --git a/src/com/engine/junchuang/service/OrgChartServiceImpl.java b/src/com/engine/junchuang/service/OrgChartServiceImpl.java index d883b17..b8e2475 100644 --- a/src/com/engine/junchuang/service/OrgChartServiceImpl.java +++ b/src/com/engine/junchuang/service/OrgChartServiceImpl.java @@ -35,16 +35,6 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { } String sql = "select id, fnumber, fname, ftype from junc_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 id, fnumber, fname, ftype from junc_org_map where (ftype = 0 or (ftype = 1 and fobjid in(" + jclRoleLevels + "))) "; - // } else { - // sql = "select id, fnumber, fname, ftype from junc_org_map where ftype = 0 "; - // } - //} DetachUtil detachUtil = new DetachUtil(user); if (detachUtil.isDETACH()) { @@ -149,9 +139,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { String whereSql = userWhereSql(request2Map); String bmfzr = ""; - if (id.contains("_")) { - whereSql += " and ftype = 3 "; - } else if (Integer.parseInt(id) > 100000000 && Integer.parseInt(id) < 200000000) { + if (!id.contains("_") && Integer.parseInt(id) > 100000000 && Integer.parseInt(id) < 200000000) { rs.executeQuery("select bmfzr from hrmdepartmentdefined where deptid =? ", Integer.parseInt(id) - 100000000); if (rs.next()) { bmfzr = rs.getString("bmfzr"); @@ -165,18 +153,18 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { } else { if (StringUtils.isNotBlank(bmfzr)) { bmfzr = bmfzr.split(",")[0]; - whereSql += " and ((t.fparentid = " + id.split("_")[0] + " and t.ftype =2 and t.fobjid in(" + detachUtil.getDepartmentIds() + ")) or (t.ftype = 3 and fobjid = '" + bmfzr + "'))"; - //whereSql += " and ((t.fparentid = " + id.split("_")[0] + " and t.ftype = 2 ) or (t.ftype = 3 and fobjid = '" + bmfzr + "'))"; + //whereSql += " and ((t.fparentid = " + id.split("_")[0] + " and t.ftype =2 and t.fobjid in(" + detachUtil.getDepartmentIds() + ")) or (t.ftype = 3 and fobjid = '" + bmfzr + "'))"; + whereSql += " and t.ftype = 3 and fobjid = '" + bmfzr + "' "; bmfzr = String.valueOf(200000000 + Integer.parseInt(bmfzr)); } else { - whereSql += " and t.fparentid = " + id.split("_")[0] + " and ((t.ftype =2 and t.fobjid in(" + detachUtil.getDepartmentIds() + ")) or (t.ftype = 3 ))"; - //whereSql += " and t.fparentid = " + id.split("_")[0]; + whereSql += " and t.fparentid = " + id.split("_")[0] + " and ((t.ftype =2 and t.fobjid in(" + detachUtil.getDepartmentIds() + ")) or (t.ftype = 3 ))"; } } } else { if (StringUtils.isNotBlank(bmfzr)) { bmfzr = bmfzr.split(",")[0]; - whereSql += " and ((t.fparentid = " + id.split("_")[0] + " and t.ftype =2 ) or (t.ftype = 3 and fobjid = '" + bmfzr + "'))"; + //whereSql += " and ((t.fparentid = " + id.split("_")[0] + " and t.ftype =2 ) or (t.ftype = 3 and fobjid = '" + bmfzr + "'))"; + whereSql += " and t.ftype = 3 and fobjid = '" + bmfzr + "' "; bmfzr = String.valueOf(200000000 + Integer.parseInt(bmfzr)); } else { whereSql += " and t.fparentid = " + id.split("_")[0]; @@ -450,7 +438,7 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { if ("3".equals(type)) { manageDeptId = id; id = id.split("_")[0]; - sql += " and ftype = 3 "; + //sql += " and ftype = 3 "; } @@ -461,7 +449,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { } else { if (StringUtils.isNotBlank(bmfzr)) { bmfzr = bmfzr.split(",")[0]; - sql += " and ((t.fparentid = " + id + " and t.ftype =2 and t.fobjid in(" + detachUtil.getDepartmentIds() + ")) or (t.ftype = 3 and fobjid = '" + bmfzr + "'))"; + //sql += " and ((t.fparentid = " + id + " and t.ftype =2 and t.fobjid in(" + detachUtil.getDepartmentIds() + ")) or (t.ftype = 3 and fobjid = '" + bmfzr + "'))"; + sql += " and t.ftype = 3 and fobjid = '" + bmfzr + "' "; bmfzr = String.valueOf(200000000 + Integer.parseInt(bmfzr)); } else { sql += " and t.fparentid = " + id + " and ((t.ftype =2 and t.fobjid in(" + detachUtil.getDepartmentIds() + ")) or (t.ftype = 3 ))"; @@ -470,7 +459,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { } else { if (StringUtils.isNotBlank(bmfzr)) { bmfzr = bmfzr.split(",")[0]; - sql += " and ((t.fparentid = " + id + " and t.ftype =2 ) or (t.ftype = 3 and fobjid = '" + bmfzr + "'))"; + //sql += " and ((t.fparentid = " + id + " and t.ftype =2 ) or (t.ftype = 3 and fobjid = '" + bmfzr + "'))"; + sql += " and t.ftype = 3 and fobjid = '" + bmfzr + "' "; bmfzr = String.valueOf(200000000 + Integer.parseInt(bmfzr)); } else { sql += " and t.fparentid = " + id; @@ -506,7 +496,6 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { item.put("fisvitual", rs.getString("fisvitual")); if (bmfzr.equals(item.get("id"))) { - // TODO item.put("id", id + "_" + bmfzr); item.put("parentId", id); item.put("hasChildren", hasChildren(id, false)); diff --git a/src/com/engine/junchuang/transmethod/ManagerDetachTransMethod.java b/src/com/engine/junchuang/transmethod/ManagerDetachTransMethod.java deleted file mode 100644 index e197ca7..0000000 --- a/src/com/engine/junchuang/transmethod/ManagerDetachTransMethod.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.engine.junchuang.transmethod; - - -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang.StringUtils; - -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -/** - * @Author weaver_cl - * @Description: - * @Date 2022/10/26 - * @Version V1.0 - **/ -public class ManagerDetachTransMethod { - - public static String getManagerName(String ecManager) { - if (StringUtils.isBlank(ecManager)) { - return ""; - } - List collect = Arrays.stream(ecManager.split(",")).map(Long::parseLong).collect(Collectors.toList()); - if (CollectionUtils.isEmpty(collect)) { - return ""; - } - //Record - //List employeeNameById = MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(collect); - //return StringUtils.join(employeeNameById, ","); - return ""; - } - - - public static String getRoleLevel(String ecRolelevel) { - //List> maps = MapperProxyFactory.getProxy(SystemDataMapper.class).getBrowserDatas(DeleteParam.builder().ids(ecRolelevel).build().getIds()); - //String names = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(",")); - //return names; - return ""; - } -} diff --git a/src/com/engine/junchuang/util/HasRightUtil.java b/src/com/engine/junchuang/util/HasRightUtil.java deleted file mode 100644 index e036b8d..0000000 --- a/src/com/engine/junchuang/util/HasRightUtil.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.engine.junchuang.util; - -import weaver.hrm.HrmUserVarify; -import weaver.hrm.User; - -/** - * @description: - * @author:dxfeng - * @createTime: 2022/06/07 - * @version: 1.0 - */ -public class HasRightUtil { - - /** - * 判断是否拥有对应权限 - * - * @param user - * @param rightName - * @param isReturnFalse - * @return - */ - public static boolean hasRight(User user, String rightName, boolean isReturnFalse) { - boolean hasRight = HrmUserVarify.checkUserRight(rightName, user); - if (!isReturnFalse) { - OrganizationAssert.isTrue(hasRight, "暂无权限访问"); - } - return hasRight; - } -} diff --git a/src/com/engine/junchuang/util/OrganizationAssert.java b/src/com/engine/junchuang/util/OrganizationAssert.java deleted file mode 100644 index 32dcdd0..0000000 --- a/src/com/engine/junchuang/util/OrganizationAssert.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.engine.junchuang.util; - -import com.engine.junchuang.exception.OrganizationRunTimeException; -import org.springframework.util.CollectionUtils; -import org.springframework.util.ObjectUtils; - -import java.util.Collection; -import java.util.Map; - -/** - * @Author weaver_cl - * @description: - * @Date 2022/4/26 - * @Version V1.0 - **/ -public abstract class OrganizationAssert { - /** - * 判断入参不为null - * - * @param object 待检查参数 - * @param message 检查失败返回的异常信息 - */ - public static void notNull(Object object, String message) { - if (object == null) { - throw new OrganizationRunTimeException(message); - } - } - - /** - * 判断多个入参不为null - * - * @param message 检查失败返回的异常信息 - * @param objects 待检查参数 - */ - public static void notNull(String message, Object... objects) { - for (Object obj : objects) { - if (obj == null) { - throw new OrganizationRunTimeException(message); - } - } - } - - /** - * 判断入参为null - * - * @param object 待检查参数 - * @param message 检查失败返回的异常信息 - */ - public static void isNull(Object object, String message) { - if (object != null) { - throw new OrganizationRunTimeException(message); - } - } - - /** - * 判断集合是否为空 - * - * @param collection 待检查参数 - * @param message 检查失败返回的异常信息 - */ - public static void isEmpty(Collection collection, String message) { - if (!CollectionUtils.isEmpty(collection)) { - throw new OrganizationRunTimeException(message); - } - } - - /** - * 判断集合不为空 - * - * @param collection 待检查参数 - * @param message 检查失败返回的异常信息 - */ - public static void notEmpty(Collection collection, String message) { - if (CollectionUtils.isEmpty(collection)) { - throw new OrganizationRunTimeException(message); - } - } - - /** - * 判断数组是否为空 - * - * @param arr 待检查参数 - * @param message 检查失败返回的异常信息 - */ - public static void notEmpty(Object[] arr, String message) { - if (ObjectUtils.isEmpty(arr)) { - throw new OrganizationRunTimeException(message); - } - } - - /** - * 判断map是否为空 - * - * @param map 待检查参数 - * @param message 检查失败返回的异常信息 - */ - public static void notEmpty(Map map, String message) { - if (CollectionUtils.isEmpty(map)) { - throw new OrganizationRunTimeException(message); - } - } - - /** - * 判断数组元素是否为空 - * - * @param arr 待检查参数 - * @param message 检查失败返回的异常信息 - */ - public static void notNullElement(Object[] arr, String message) { - if (arr != null) { - for (Object obj : arr) { - if (obj == null) { - throw new OrganizationRunTimeException(message); - } - } - } - } - - /** - * 判断boolean - * - * @param expression 待检查参数 - * @param message 检查失败返回的异常信息 - */ - public static void isTrue(boolean expression, String message) { - if (!expression) { - throw new OrganizationRunTimeException(message); - } - } - - public static void isFalse(boolean expression, String message) { - if (expression) { - throw new OrganizationRunTimeException(message); - } - } - - public static void isBlank(CharSequence cs, String message) { - int strLen; - if (cs != null && (strLen = cs.length()) != 0) { - for (int i = 0; i < strLen; ++i) { - if (!Character.isWhitespace(cs.charAt(i))) { - throw new OrganizationRunTimeException(message); - } - } - } - } - - public static void notBlank(CharSequence cs, String message) { - int strLen; - if (cs != null && (strLen = cs.length()) != 0) { - for (int i = 0; i < strLen; ++i) { - if (Character.isWhitespace(cs.charAt(i))) { - throw new OrganizationRunTimeException(message); - } - } - } - if (cs == null || cs.length() == 0) { - throw new OrganizationRunTimeException(message); - } - - } -} diff --git a/src/com/engine/junchuang/util/OrganizationFormItemUtil.java b/src/com/engine/junchuang/util/OrganizationFormItemUtil.java deleted file mode 100644 index 7a13cbf..0000000 --- a/src/com/engine/junchuang/util/OrganizationFormItemUtil.java +++ /dev/null @@ -1,286 +0,0 @@ -package com.engine.junchuang.util; - -import com.api.browser.bean.SearchConditionItem; -import com.api.browser.bean.SearchConditionOption; -import com.api.browser.util.ConditionFactory; -import com.api.browser.util.ConditionType; -import weaver.hrm.User; - -import java.util.ArrayList; -import java.util.List; - - -/** - * @Author dxfeng - * @description: - * @Date 2022/5/9 - * @Version V1.0 - **/ -public class OrganizationFormItemUtil { - - /** - * 下拉框 - * - * @param user - * @param selectOptions - * @param colSpan - * @param fieldcol - * @param labelcol - * @param isQuickSearch - * @param label - * @return - */ - public static SearchConditionItem selectItem(User user, List selectOptions, int colSpan, int fieldcol, - int labelcol, boolean isQuickSearch, String label, String name) { - ConditionFactory conditionFactory = new ConditionFactory(user); - SearchConditionItem select = conditionFactory.createCondition(ConditionType.SELECT, 502327, name); - select.setOptions(selectOptions); - select.setColSpan(colSpan); - select.setFieldcol(fieldcol); - select.setLabelcol(labelcol); - select.setIsQuickSearch(isQuickSearch); - select.setLabel(label); - return select; - } - - - /** - * checkbox - * - * @param user - * @param colSpan - * @param fieldcol - * @param viewAttr - * @param isQuickSearch - * @param label - * @param name - * @return - */ - public static SearchConditionItem checkboxItem(User user, int colSpan, int fieldcol, - int viewAttr, boolean isQuickSearch, String label, String name) { - ConditionFactory conditionFactory = new ConditionFactory(user); - SearchConditionItem checkbox = conditionFactory.createCondition(ConditionType.CHECKBOX, 502327, name); - checkbox.setColSpan(colSpan); - checkbox.setFieldcol(fieldcol); - checkbox.setViewAttr(viewAttr); - checkbox.setIsQuickSearch(isQuickSearch); - checkbox.setLabel(label); - return checkbox; - } - - - /** - * 输入框数字 - * - * @param user - * @param colSpan - * @param fieldcol - * @param viewAttr - * @param label - * @return - */ - public static SearchConditionItem inputNumberItem(User user, int colSpan, int fieldcol, - int viewAttr, String label, String name) { - ConditionFactory conditionFactory = new ConditionFactory(user); - SearchConditionItem inputnumber = conditionFactory.createCondition(ConditionType.INPUTNUMBER, 502327, name); - inputnumber.setColSpan(colSpan); - inputnumber.setFieldcol(fieldcol); - inputnumber.setViewAttr(viewAttr); - inputnumber.setLabel(label); - return inputnumber; - } - - - /** - * 输入框文本 - * - * @param user - * @param colSpan - * @param fieldcol - * @param viewAttr - * @param length - * @param label - * @return - */ - public static SearchConditionItem inputItem(User user, int colSpan, int fieldcol, - int viewAttr, int length, String label, String name) { - ConditionFactory conditionFactory = new ConditionFactory(user); - SearchConditionItem input = conditionFactory.createCondition(ConditionType.INPUT, 25034, name); - input.setColSpan(colSpan); - input.setFieldcol(fieldcol); - input.setViewAttr(viewAttr); - input.setLength(length); - input.setLabel(label); - return input; - } - - - /** - * 浏览按钮 - * - * @param user - * @param colSpan - * @param fieldcol - * @param viewAttr - * @param isQuickSearch - * @param label - * @param type - * @param name - * @param fieldDbType 数据展现集成标识 - * @return - */ - public static SearchConditionItem browserItem(User user, int colSpan, int fieldcol, - int viewAttr, boolean isQuickSearch, String label, String type, String name, String fieldDbType) { - ConditionFactory conditionFactory = new ConditionFactory(user); - SearchConditionItem browser = conditionFactory.createCondition(ConditionType.BROWSER, 502327, name, type); - browser.setColSpan(colSpan); - browser.setFieldcol(fieldcol); - browser.setViewAttr(viewAttr); - browser.setIsQuickSearch(isQuickSearch); - browser.setLabel(label); - return browser; - } - - - /** - * 日期区间 - * - * @param user - * @param colSpan - * @param fieldcol - * @param viewAttr - * @param label - * @return - */ - public static SearchConditionItem rangeDateItem(User user, int colSpan, int fieldcol, int viewAttr - , String label, String name1, String name2) { - ConditionFactory conditionFactory = new ConditionFactory(user); - SearchConditionItem rangeDate = conditionFactory.createCondition(ConditionType.TIMEPICKER, 502327, new String[]{name1, name2}); - rangeDate.setColSpan(colSpan); - rangeDate.setFieldcol(fieldcol); - rangeDate.setViewAttr(viewAttr); - rangeDate.setLabel(label); - return rangeDate; - } - - - /** - * 多行文本框 - * - * @param user - * @param colSpan - * @param fieldcol - * @param isQuickSearch - * @param viewAttr - * @param length - * @param label - * @param name - * @return - */ - public static SearchConditionItem textareaItem(User user, int colSpan, int fieldcol, boolean isQuickSearch, - int viewAttr, int length, String label, String name) { - ConditionFactory conditionFactory = new ConditionFactory(user); - SearchConditionItem textarea = conditionFactory.createCondition(ConditionType.TEXTAREA, 502227, name); - textarea.setColSpan(colSpan); - textarea.setFieldcol(fieldcol); - textarea.setIsQuickSearch(isQuickSearch); - textarea.setViewAttr(viewAttr); - textarea.setLength(length); - textarea.setLabel(label); - - return textarea; - } - - - /** - * 日期组合 - * @param user - * @param colSpan - * @param fieldcol - * @param isQuickSearch - * @param viewAttr - * @param label - * @param name - * @return - */ - public static SearchConditionItem dateItem(User user, int colSpan, int fieldcol, boolean isQuickSearch, - int viewAttr, String label, String name) { - ConditionFactory conditionFactory = new ConditionFactory(user); - SearchConditionItem date = conditionFactory.createCondition(ConditionType.DATE, 502227, name); - date.setColSpan(colSpan); - date.setFieldcol(fieldcol); - date.setIsQuickSearch(isQuickSearch); - date.setViewAttr(viewAttr); - date.setLabel(label); - return date; - } - - /** - * - * @param user - * @param colSpan - * @param fieldcol - * @param isQuickSearch - * @param viewAttr - * @param label - * @param name - * @return - */ - public static SearchConditionItem datePickerItem(User user, int colSpan, int fieldcol, boolean isQuickSearch, - int viewAttr, String label, String name) { - ConditionFactory conditionFactory = new ConditionFactory(user); - SearchConditionItem datePicker = conditionFactory.createCondition(ConditionType.DATEPICKER, 502227, name); - datePicker.setColSpan(colSpan); - datePicker.setFieldcol(fieldcol); - datePicker.setIsQuickSearch(isQuickSearch); - datePicker.setViewAttr(viewAttr); - datePicker.setLabel(label); - return datePicker; - } - - - public static SearchConditionItem dateGroupItem(User user, int colSpan, int fieldcol, boolean isQuickSearch, - int viewAttr, String label, String name) { - ConditionFactory conditionFactory = new ConditionFactory(user); - SearchConditionItem dateGroup = conditionFactory.createCondition(ConditionType.DATEGROUP, 502227, name); - dateGroup.setColSpan(colSpan); - dateGroup.setFieldcol(fieldcol); - dateGroup.setIsQuickSearch(isQuickSearch); - dateGroup.setViewAttr(viewAttr); - dateGroup.setLabel(label); - List datas = new ArrayList<>(); - datas.add(new DateGroupData("全部","0")); - datas.add(new DateGroupData("今天","1")); - datas.add(new DateGroupData("本周","2")); - datas.add(new DateGroupData("本月","3")); - datas.add(new DateGroupData("本季","4")); - datas.add(new DateGroupData("本年","5")); - datas.add(new DateGroupData("上个月","7")); - datas.add(new DateGroupData("上一年","8")); - datas.add(new DateGroupData("指定日期范围","6")); - dateGroup.setDatas(datas); - dateGroup.setValue(new ArrayList<>()); - dateGroup.setDateGroup(true); - return dateGroup; - } - - static class DateGroupData{ - private String name; - private String value; - - public DateGroupData(String name, String value) { - this.name = name; - this.value = value; - } - - public String getName() { - return name; - } - - public String getValue() { - return value; - } - } - - -} diff --git a/src/com/engine/junchuang/util/db/MapperProxyFactory.java b/src/com/engine/junchuang/util/db/MapperProxyFactory.java deleted file mode 100644 index 0198d78..0000000 --- a/src/com/engine/junchuang/util/db/MapperProxyFactory.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * - */ -package com.engine.junchuang.util.db; - -import org.apache.ibatis.session.SqlSession; -import weaver.conn.mybatis.MyBatisFactory; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - - -public class MapperProxyFactory implements InvocationHandler { - private Class clazz; - private boolean enableTransactions = false; - private SqlSession session; - - public MapperProxyFactory(Class clazz) { - this.clazz = clazz; - } - - @Override - public Object invoke(Object proxy, Method method, Object[] args) throws Exception { - if (this.session == null) { - this.session = MyBatisFactory.sqlSessionFactory.openSession(); - } - try { - Object target = session.getMapper(clazz); - return method.invoke(target, args); - } finally { - if (!enableTransactions) { - session.commit(); - session.close(); - } - } - } - - public Object getProxy() { - ClassLoader loader = Thread.currentThread().getContextClassLoader(); - Class[] interfaces = new Class[1]; - interfaces[0] = this.clazz; - return Proxy.newProxyInstance(loader, interfaces, this); - } - - public Object getProxy(boolean enableTransactions) { - this.enableTransactions = enableTransactions; - return this.getProxy(); - } - - public void commit() { - if (this.session != null) { - this.session.commit(); - this.session.close(); - } - } - - public void rollback() { - if (this.session != null) { - this.session.rollback(); - this.session.close(); - } - } - - public static T getProxy(Class clazz) { - MapperProxyFactory handle = new MapperProxyFactory(clazz); - return (T) handle.getProxy(); - } - - public static T getProxy(Class clazz, boolean enableTransactions) { - MapperProxyFactory handle = new MapperProxyFactory(clazz); - return (T) handle.getProxy(enableTransactions); - } -} diff --git a/src/com/engine/junchuang/util/detach/DetachUtil.java b/src/com/engine/junchuang/util/detach/DetachUtil.java index db9901c..b48e8d0 100644 --- a/src/com/engine/junchuang/util/detach/DetachUtil.java +++ b/src/com/engine/junchuang/util/detach/DetachUtil.java @@ -35,6 +35,9 @@ public class DetachUtil { List ids = Arrays.asList(allSupDepartment.split(",")); departmentIds.addAll(ids); } + ArrayList childDeptIds = new ArrayList<>(); + new DepartmentComInfo().getAllChildDeptByDepId(childDeptIds, departmentId); + departmentIds.addAll(childDeptIds); departmentIds.add(departmentId); String subCompanyId = rs.getString("subcompanyid1"); String allSupCompany = new SubCompanyComInfo().getAllSupCompany(subCompanyId); diff --git a/src/com/engine/jygf/cmd/MobilePermissionsCmd.java b/src/com/engine/jygf/cmd/MobilePermissionsCmd.java deleted file mode 100644 index 7e4ebdd..0000000 --- a/src/com/engine/jygf/cmd/MobilePermissionsCmd.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.engine.jygf.cmd; - -import com.engine.common.biz.AbstractCommonCommand; -import com.engine.common.entity.BizLogContext; -import com.engine.core.interceptor.CommandContext; -import org.apache.commons.lang3.StringUtils; -import weaver.conn.RecordSet; -import weaver.hrm.User; -import weaver.wechat.util.Utils; - -import java.util.*; - -/** - * @Author weaver_cl - * @Description: - * @Date 2022/10/9 - * @Version V1.0 - **/ -public class MobilePermissionsCmd extends AbstractCommonCommand> { - - private static final String FIELDID = "field100026"; //移动电话自定义字段 - - private static final String SCOPE = "HrmCustomFieldByInfoType"; - - private static final String SCOPEID = "-1"; - - public MobilePermissionsCmd(Map params, User user) { - this.user = user; - this.params = params; - } - - @Override - public BizLogContext getLogContext() { - return null; - } - - - @Override - public Map execute(CommandContext commandContext) { - Map data = new HashMap<>(); - String uid = Utils.null2String(user.getUID()); - RecordSet rs = new RecordSet(); - HashSet ids = new HashSet<>(); - ids.add(uid); - rs.executeQuery("select ckr,bckr from uf_yddhqx_dt1"); - while (rs.next()) { - String ckr = Utils.null2String(rs.getString("ckr")); - String bckr = Utils.null2String(rs.getString("bckr")); - if (Arrays.asList(ckr.split(",")).contains(uid)) { - ids.addAll(Arrays.asList(bckr.split(","))); - } - } - - Map mobileInfo = new HashMap<>(); - String value = StringUtils.join(ids,","); - rs.executeQuery("select id,"+FIELDID+" from cus_fielddata where scope = ? and scopeid = ?" + - " and id in ("+value+")",SCOPE,SCOPEID); - while (rs.next()){ - mobileInfo.put(Utils.null2String(rs.getString("id")),rs.getString(FIELDID)); - } - - data.put("ids",ids); - data.put("mobileInfo",mobileInfo); - return data; - } - - -} diff --git a/src/com/engine/jygf/service/MobilePermissionsService.java b/src/com/engine/jygf/service/MobilePermissionsService.java deleted file mode 100644 index e41d2a9..0000000 --- a/src/com/engine/jygf/service/MobilePermissionsService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.engine.jygf.service; - -import weaver.hrm.User; - -import java.util.Map; - -/** - * @Author weaver_cl - * @Description: - * @Date 2022/10/9 - * @Version V1.0 - **/ -public interface MobilePermissionsService { - - Map getPermissionInfo(Map params, User user); -} diff --git a/src/com/engine/jygf/service/impl/MobilePermissionsServiceImpl.java b/src/com/engine/jygf/service/impl/MobilePermissionsServiceImpl.java deleted file mode 100644 index 579ba36..0000000 --- a/src/com/engine/jygf/service/impl/MobilePermissionsServiceImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.engine.jygf.service.impl; - -import com.engine.core.impl.Service; -import com.engine.jygf.cmd.MobilePermissionsCmd; -import com.engine.jygf.service.MobilePermissionsService; -import weaver.hrm.User; - -import java.util.Map; - -/** - * @Author weaver_cl - * @Description: - * @Date 2022/10/9 - * @Version V1.0 - **/ -public class MobilePermissionsServiceImpl extends Service implements MobilePermissionsService { - - - - @Override - public Map getPermissionInfo(Map params, User user) { - return commandExecutor.execute(new MobilePermissionsCmd(params,user)); - } -} diff --git a/src/com/engine/jygf/web/MobilePermissionsAction.java b/src/com/engine/jygf/web/MobilePermissionsAction.java deleted file mode 100644 index f3cf66d..0000000 --- a/src/com/engine/jygf/web/MobilePermissionsAction.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.engine.jygf.web; - -import com.alibaba.fastjson.JSONObject; -import com.engine.common.util.ParamUtil; -import com.engine.common.util.ServiceUtil; -import com.engine.jygf.service.MobilePermissionsService; -import com.engine.jygf.service.impl.MobilePermissionsServiceImpl; -import weaver.hrm.HrmUserVarify; -import weaver.hrm.User; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import java.util.HashMap; -import java.util.Map; - -/** - * @Author weaver_cl - * @Description: - * @Date 2022/10/9 - * @Version V1.0 - **/ -public class MobilePermissionsAction { - - public MobilePermissionsService getMobilePermissionsService(User user) { - return ServiceUtil.getService(MobilePermissionsServiceImpl.class,user); - } - - /** - * 晶优光伏 移动电话通过建模控制权限 通讯录显示 - * @param request - * @param response - * @return - */ - @GET - @Path("/controller") - @Produces(MediaType.APPLICATION_JSON) - public String getPermissionInfo(@Context HttpServletRequest request, @Context HttpServletResponse response) { - Map apidatas = new HashMap<>(); - try { - User user = HrmUserVarify.getUser(request, response); - //实例化Service 并调用业务类处理 - apidatas = getMobilePermissionsService(user).getPermissionInfo(ParamUtil.request2Map(request), user); - } catch (Exception e) { - //异常处理 - apidatas.put("api_status", false); - } - return JSONObject.toJSONString(apidatas); - } - - - -}