Commit 2d5665d1 by 宋祥

Merge branch 'dev-sx' of http://git.pseer.com:8800/platform/hg-smart into dev

 Conflicts:
	src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
parents 0efb9a92 cc9e0b6a
...@@ -156,7 +156,7 @@ public class DaoUtils { ...@@ -156,7 +156,7 @@ public class DaoUtils {
} }
try { try {
BeanUtils.setProperty(bean, "createdBy", userId); BeanUtils.setProperty(bean, "createdBy", userId);
BeanUtils.setProperty(bean, "updatedBy", ""); BeanUtils.setProperty(bean, "updatedBy", userId);
} catch (Exception e) { } catch (Exception e) {
log.warn("写入创建人ID失败", e); log.warn("写入创建人ID失败", e);
} }
...@@ -169,7 +169,7 @@ public class DaoUtils { ...@@ -169,7 +169,7 @@ public class DaoUtils {
userName = "System"; userName = "System";
} }
BeanUtils.setProperty(bean, "createdName", userName); BeanUtils.setProperty(bean, "createdName", userName);
BeanUtils.setProperty(bean, "updatedName", ""); BeanUtils.setProperty(bean, "updatedName", userName);
} catch (Exception e) { } catch (Exception e) {
log.warn("写入创建人姓名失败", e); log.warn("写入创建人姓名失败", e);
} }
...@@ -198,8 +198,9 @@ public class DaoUtils { ...@@ -198,8 +198,9 @@ public class DaoUtils {
} }
// 创建时刻 // 创建时刻
try { try {
BeanUtils.setProperty(bean, "createdTime", DateUtils.shortDateTime()); String dateTime = DateUtils.shortDateTime();
BeanUtils.setProperty(bean, "updatedTime", ""); BeanUtils.setProperty(bean, "createdTime", dateTime);
BeanUtils.setProperty(bean, "updatedTime", dateTime);
} catch (Exception e) { } catch (Exception e) {
log.error("写入创建时刻失败:{}", e.getMessage(), e); log.error("写入创建时刻失败:{}", e.getMessage(), e);
} }
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC101">
<sql id="column">
id as "id",
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
subcontract_code as "subcontractCode", <!-- 分包商编码 -->
subcontract_name as "subcontractName", <!-- 分包商名称 -->
genral_contract_code as "genralContractCode", <!-- 总包商编码 -->
genral_contract_name as "genralContractName", <!-- 总包商名称 -->
party_pm_name as "partyPmName", <!-- 甲方项目经理名称 -->
party_pm_hpone as "partyPmHpone", <!-- 甲方项目经理联系电话 -->
contract_name as "contractName", <!-- 合同名称 -->
contract_work_txt as "contractWorkTxt", <!-- 合同工作量 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
proj_type as "projType", <!-- 项目性质 -->
proj_status as "projStatus", <!-- 项目状态 0:在建;1:完工 -->
approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
permiss_start_date as "permissStartDate", <!-- 准许开工日期 -->
start_date as "startDate", <!-- 开工日期 -->
end_date as "endDate", <!-- 完工日期 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name like ('%$companyName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name like concat('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projectName">
proj_name like concat('%', #projectName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projType">
proj_type = #projType#
</isNotEmpty>
</sql>
<sql id="customCondition">
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="projCodes">
PROJ_CODE IN
<iterate close=")" open="(" conjunction="," property="projCodes">#projCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
EXISTS (SELECT A.PROJ_CODE FROM ${hggpSchema}.HGWD001 A, ${hggpSchema}.HGWD003 B
WHERE A.FILE_ID = B.FILE_ID AND A.PROJ_CODE = T.PROJ_CODE AND B.USER_ID = #userId#)
</isNotEmpty>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC001">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSC001 T
WHERE 1=1
<include refid="customCondition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC001 T WHERE 1=1
<include refid="customCondition"/>
</select>
</sqlMap>
...@@ -28,6 +28,8 @@ public class HgWdSqlConstant { ...@@ -28,6 +28,8 @@ public class HgWdSqlConstant {
// 模块 // 模块
public static final String MODULE = "HGWD003."; public static final String MODULE = "HGWD003.";
// 查询
public static final String GET_BY_USER = MODULE + "getByUser";
// 修改信息 // 修改信息
public static final String UPDATE_INFO = MODULE + "updateInfo"; public static final String UPDATE_INFO = MODULE + "updateInfo";
// 批量写入 // 批量写入
...@@ -35,6 +37,20 @@ public class HgWdSqlConstant { ...@@ -35,6 +37,20 @@ public class HgWdSqlConstant {
} }
/** /**
* HGCW009 SQL定义
*
* @author:songx
* @date:2024/2/22,13:57
*/
public static class HgWd009 {
// 模块
public static final String MODULE = "HGWD009.";
// 查询
public static final String QUERY = MODULE + "query";
}
/**
* HGCW999 SQL定义 * HGCW999 SQL定义
* *
* @author:songx * @author:songx
......
...@@ -8,6 +8,7 @@ import com.baosight.hggp.hg.sc.domain.HGSC001; ...@@ -8,6 +8,7 @@ import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.wd.constant.HgWdConstant; import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.tools.HGWDTools; import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
...@@ -225,7 +226,13 @@ public class ServiceHGWD001D extends TreeService { ...@@ -225,7 +226,13 @@ public class ServiceHGWD001D extends TreeService {
*/ */
public List queryTopNode(String parentId) { public List queryTopNode(String parentId) {
List<Map> results = new ArrayList(); List<Map> results = new ArrayList();
List<HGSC001> dbSc001s = dao.query(HGSC001.QUERY, new HashMap<>()); Map queryMap = new HashMap<>();
// 非管理员仅查询自己有权限的项目
String userId = UserSessionUtils.getLoginName();
if (!HgWdUtils.HgWd009.isManager(userId)) {
queryMap.put("userId", userId);
}
List<HGSC001> dbSc001s = dao.query("HGSC101.query", queryMap);
if (CollectionUtils.isEmpty(dbSc001s)) { if (CollectionUtils.isEmpty(dbSc001s)) {
return results; return results;
} }
......
...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.constant.CommonConstant; ...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum; import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.domain.HGSC001; import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.wd.constant.HgWdConstant; import com.baosight.hggp.hg.wd.constant.HgWdConstant;
...@@ -12,6 +13,7 @@ import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant; ...@@ -12,6 +13,7 @@ import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD003; import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.tools.HGWDTools; import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
...@@ -150,6 +152,7 @@ public class ServiceHGWD003 extends ServiceEPBase { ...@@ -150,6 +152,7 @@ public class ServiceHGWD003 extends ServiceEPBase {
fWd003.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode()); fWd003.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.insert(HGWD003.DELETE, fWd003); DaoUtils.insert(HGWD003.DELETE, fWd003);
} }
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fWd003s.size() + "]条数据删除成功!"); inInfo.setMsg("操作成功!本次对[" + fWd003s.size() + "]条数据删除成功!");
} catch (Exception e) { } catch (Exception e) {
...@@ -184,4 +187,31 @@ public class ServiceHGWD003 extends ServiceEPBase { ...@@ -184,4 +187,31 @@ public class ServiceHGWD003 extends ServiceEPBase {
return inInfo; return inInfo;
} }
/**
* 是否项目经理
*
* @param inInfo
* @return
*/
public EiInfo isProjectManager(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
// 文档管理员不做校验
if (HgWdUtils.HgWd009.isManager(UserSessionUtils.getLoginName())) {
inInfo.set("isProjectManager", CommonConstant.YesNo.YES_1);
return inInfo;
}
queryMap.put(HGWD003.FIELD_USER_ID, UserSessionUtils.getLoginName());
List<HGWD003> dbWd003s = dao.query(HgWdSqlConstant.HgWd003.GET_BY_USER, queryMap);
if (CollectionUtils.isNotEmpty(dbWd003s)) {
HGWD003 dbWd003 = dbWd003s.get(0);
inInfo.set("isProjectManager", dbWd003.getIsProjectManager());
} else {
inInfo.set("isProjectManager", CommonConstant.YesNo.NO_0);
}
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "是否项目经理失败");
}
return inInfo;
}
} }
...@@ -31,8 +31,6 @@ import java.util.Map; ...@@ -31,8 +31,6 @@ import java.util.Map;
*/ */
public class ServiceHGWD003A extends ServiceEPBase { public class ServiceHGWD003A extends ServiceEPBase {
private EiBlockMeta eiMetadata = null;
/** /**
* 画面初始化 * 画面初始化
* *
......
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.domain.HGWD009;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiBlockMeta;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
* 文档管理员
*
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGWD009 extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "文档权限", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGWD009().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询
*
* @param inInfo
* @return
*/
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HGWD009.QUERY, new HGWD009());
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询节点失败");
}
return inInfo;
}
/**
* 删除用户
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "文档权限", operType = "保存", operDesc = "操作")
public EiInfo removeUser(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
List<HGWD009> fWd009s = MapUtils.toDaoEPBases(inInfo, HGWD009.class);
for (HGWD009 fWd009 : fWd009s) {
fWd009.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.insert(HGWD009.DELETE, fWd009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fWd009s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.domain.HGWD009;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiBlockMeta;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGWD009A extends ServiceEPBase {
private EiBlockMeta eiMetadata = null;
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "文档权限", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new User().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询
*
* @param inInfo
* @return
*/
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, "HGWD009A.query", new User());
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询节点失败");
}
return inInfo;
}
/**
* 保存
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "文档权限", operType = "保存", operDesc = "操作")
public EiInfo authUser(EiInfo inInfo) {
try {
List<HGWD009> fWd009s = MapUtils.toDaoEPBases(inInfo, HGWD009.class);
for (HGWD009 fWd009 : fWd009s) {
fWd009.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
DaoUtils.insert(HGWD009.INSERT, fWd009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fWd009s.size() + "]条数据添加成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "授权失败");
}
return inInfo;
}
}
...@@ -22,7 +22,10 @@ ...@@ -22,7 +22,10 @@
B.DOWNLOAD_NUM as "downloadNum", <!-- 下载次数 --> B.DOWNLOAD_NUM as "downloadNum", <!-- 下载次数 -->
B.CREATED_BY as "createdBy", <!-- 创建人 --> B.CREATED_BY as "createdBy", <!-- 创建人 -->
B.CREATED_NAME as "createdName", <!-- 创建人名称 --> B.CREATED_NAME as "createdName", <!-- 创建人名称 -->
B.CREATED_TIME as "createdTime" <!-- 创建时间 --> B.CREATED_TIME as "createdTime", <!-- 创建时间 -->
B.UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
B.UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
B.UPDATED_TIME as "updatedTime" <!-- 记录修改时间 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
......
...@@ -71,6 +71,15 @@ ...@@ -71,6 +71,15 @@
</dynamic> </dynamic>
</sql> </sql>
<select id="getByUser" resultClass="com.baosight.hggp.hg.wd.domain.HGWD003">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGWD003 A
WHERE 1=1
AND A.FILE_ID = #fileId#
AND A.USER_ID = #userId#
</select>
<select id="query" resultClass="com.baosight.hggp.hg.wd.domain.HGWD003"> <select id="query" resultClass="com.baosight.hggp.hg.wd.domain.HGWD003">
SELECT SELECT
<include refid="column"/>, <include refid="column"/>,
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGWD009">
<sql id="column">
T.ID as "id",
T.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
T.DEP_CODE as "depCode", <!-- 部门编码 -->
T.CREATED_BY as "createdBy", <!-- 记录创建者 -->
T.CREATED_NAME as "createdName", <!-- 记录创建名称 -->
T.CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
T.UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
T.UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
T.UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
T.DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
T.USER_ID as "userId", <!-- 用户ID -->
T.USER_NAME as "userName", <!-- 用户姓名 -->
T.REMARK as "remark" <!-- 备注 -->
</sql>
<sql id="columnD">
D.ORG_ID as "orgId",
D.ORG_CNAME as "orgCname"
</sql>
<sql id="condition">
AND T.DELETE_FLAG = 0
<include refid="conditionD"/>
<isNotEmpty prepend=" AND " property="id">
T.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
T.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
T.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
T.USER_ID LIKE CONCAT('%', #userId#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userName">
T.USER_NAME LIKE CONCAT('%', #userName#, '%')
</isNotEmpty>
</sql>
<sql id="conditionD">
<isNotEmpty prepend=" AND " property="orgCname">
D.ORG_CNAME LIKE CONCAT('%', #orgCname#, '%')
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
T.ID asc
</isEmpty>
</dynamic>
</sql>
<select id="getByUser" resultClass="com.baosight.hggp.hg.wd.domain.HGWD009">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGWD009 T
WHERE 1=1
AND USER_ID = #userId#
</select>
<select id="query" resultClass="com.baosight.hggp.hg.wd.domain.HGWD009">
SELECT
<include refid="column"/>,
<include refid="columnD"/>
FROM ${hggpSchema}.HGWD009 T
INNER JOIN ${platSchema}.XS_USER B ON T.USER_ID = B.LOGIN_NAME
LEFT JOIN ${platSchema}.TXSOG02 C ON B.USER_ID = C.USER_ID
LEFT JOIN ${platSchema}.TXSOG01 D ON C.ORG_ID = D.ORG_ID
WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGWD009 T
INNER JOIN ${platSchema}.XS_USER B ON T.USER_ID = B.LOGIN_NAME
LEFT JOIN ${platSchema}.TXSOG02 C ON B.USER_ID = C.USER_ID
LEFT JOIN ${platSchema}.TXSOG01 D ON C.ORG_ID = D.ORG_ID
WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGWD009 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
USER_ID, <!-- 用户ID -->
USER_NAME, <!-- 用户姓名 -->
REMARK <!-- 备注 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #userId#, #userName#, #remark#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGWD009 SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGWD009
SET
USER_ID = #userId#, <!-- 用户ID -->
USER_NAME = #userName#, <!-- 用户姓名 -->
REMARK = #remark#, <!-- 备注 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGWD009A">
<sql id="column">
A.USER_ID as "userId", <!-- 用户id -->
A.USER_NAME as "userName", <!-- 用户名 -->
A.LOGIN_NAME as "loginName", <!-- 登录id -->
A.GENDER as "gender", <!-- 性别 -->
A.MOBILE as "mobile", <!-- 手机号 -->
A.EMAIL as "email", <!-- 邮箱 -->
A.ACCOUNT_CODE as "accountCode" <!-- 企业编码 -->
</sql>
<sql id="columnB">
C.ORG_ID as "depCode", <!-- 部门编码-->
C.ORG_CNAME as "depName" <!-- 部门名称-->
</sql>
<sql id="condition">
<!-- 过滤已经添加的用户 -->
AND NOT EXISTS (SELECT * FROM ${hggpSchema}.HGWD009 T WHERE A.LOGIN_NAME = T.USER_ID
AND T.DELETE_FLAG = 0
)
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="loginName">
A.LOGIN_NAME = #loginName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
A.USER_ID LIKE CONCAT('%', #userId#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userName">
A.USER_NAME LIKE CONCAT('%', #userName#, '%')
</isNotEmpty>
</sql>
<sql id="conditionC">
<isNotEmpty prepend=" AND " property="depName">
C.ORG_CNAME LIKE CONCAT('%', #depName#, '%')
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
A.REC_CREATE_TIME DESC
</isEmpty>
</dynamic>
</sql>
<!-- 查询用户信息 -->
<select id="query" resultClass="com.baosight.hggp.hg.xs.domain.User">
SELECT
<include refid="column"/>,
<include refid="columnB"/>
FROM ${platSchema}.XS_USER A
LEFT JOIN ${platSchema}.TXSOG02 B ON A.USER_ID = B.USER_ID
LEFT JOIN ${platSchema}.TXSOG01 C ON B.ORG_ID = C.ORG_ID
WHERE 1=1
<include refid="condition"/>
<include refid="conditionC"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*)
FROM ${platSchema}.XS_USER A
LEFT JOIN ${platSchema}.TXSOG02 B ON A.USER_ID = B.USER_ID
LEFT JOIN ${platSchema}.TXSOG01 C ON B.ORG_ID = C.ORG_ID
WHERE 1=1
<include refid="condition"/>
<include refid="conditionC"/>
</select>
</sqlMap>
...@@ -115,6 +115,9 @@ ...@@ -115,6 +115,9 @@
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 --> DELETE_FLAG, <!-- 是否删除 -->
BIZ_TYPE, <!-- 业务类型 --> BIZ_TYPE, <!-- 业务类型 -->
BIZ_ID, <!-- 业务ID --> BIZ_ID, <!-- 业务ID -->
...@@ -127,6 +130,7 @@ ...@@ -127,6 +130,7 @@
OPER_STATUS OPER_STATUS
) VALUES ( ) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#updatedBy#, #updatedName#, #updatedTime#,
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #docType#, #status#, #docVersion#, #releaseDate#, #operStatus# #deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #docType#, #status#, #docVersion#, #releaseDate#, #operStatus#
<selectKey resultClass="long" keyProperty="id"> <selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD099 SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD099
......
...@@ -7,6 +7,7 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -7,6 +7,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.extapp.decheng.api.DcOpenApi; import com.baosight.hggp.core.extapp.decheng.api.DcOpenApi;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.constant.HgCwSqlConstant; import com.baosight.hggp.hg.cw.constant.HgCwSqlConstant;
import com.baosight.hggp.hg.cw.domain.HGCW009;
import com.baosight.hggp.hg.cw.domain.HGCW999; import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.dm.domain.HGDM099; import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.pz.domain.HGPZ009; import com.baosight.hggp.hg.pz.domain.HGPZ009;
...@@ -16,6 +17,7 @@ import com.baosight.hggp.hg.wd.domain.HGWD001; ...@@ -16,6 +17,7 @@ import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A; import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD002; import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.domain.HGWD003; import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.domain.HGWD009;
import com.baosight.hggp.hg.wd.domain.HGWD099; import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
...@@ -267,7 +269,10 @@ public class HGWDTools { ...@@ -267,7 +269,10 @@ public class HGWDTools {
AssertUtils.isNull(bizId, "业务ID不能为空!"); AssertUtils.isNull(bizId, "业务ID不能为空!");
List<HGWD099> results = DaoBase.getInstance().query(HGWD099.QUERY, List<HGWD099> results = DaoBase.getInstance().query(HGWD099.QUERY,
new HashMap<String,Object>(){{put("bizType",bizType); put("bizId",bizId);}} new HashMap<String, Object>() {{
put("bizType", bizType);
put("bizId", bizId);
}}
); );
return results; return results;
} }
...@@ -275,6 +280,28 @@ public class HGWDTools { ...@@ -275,6 +280,28 @@ public class HGWDTools {
} }
/** /**
* @author:songx
* @date:2024/8/19,14:57
*/
public static class HgWd009 {
/**
* 查询
*
* @param userId
*/
public static HGWD009 getByUser(String userId) {
AssertUtils.isEmpty(userId, "用户ID不能为空");
Map queryMap = new HashMap();
queryMap.put(HGWD009.FIELD_USER_ID, userId);
List<HGWD009> results = DaoBase.getInstance().query(HgWdSqlConstant.HgWd009.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
}
/**
* 附件上传通知 * 附件上传通知
* @param hgwd001 待变更的项目名称 * @param hgwd001 待变更的项目名称
* @param changeContent 变更内容 * @param changeContent 变更内容
......
package com.baosight.hggp.hg.wd.utils;
import com.baosight.hggp.hg.wd.domain.HGWD009;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
/**
* @author:songx
* @date:2024/9/23,14:57
*/
public class HgWdUtils {
/**
* @author:songx
* @date:2024/8/19,14:57
*/
public static class HgWd009 {
/**
* 是否管理员
*
* @param userId
* @return
*/
public static boolean isManager(String userId) {
HGWD009 dbWd009 = HGWDTools.HgWd009.getByUser(userId);
return dbWd009 != null;
}
}
}
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC007B.xml"/> <sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC007B.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC008.xml"/> <sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC008.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC009.xml"/> <sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC009.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC101.xml"/>
<!-- 財務 --> <!-- 財務 -->
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW001.xml"/> <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW001.xml"/>
...@@ -111,6 +112,8 @@ ...@@ -111,6 +112,8 @@
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD001A.xml"/> <sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD001A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD002.xml"/> <sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD003.xml"/> <sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD003.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD009.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD009A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD099.xml"/> <sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD099.xml"/>
</sqlMapConfig> </sqlMapConfig>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="220" sort="true"/> <EF:EFColumn ename="docName" cname="文件名称" enable="false" width="220" sort="true"/>
<EF:EFColumn ename="docType" cname="文件后缀" enable="false" width="110" align="center" sort="true"/> <EF:EFColumn ename="docType" cname="文件后缀" enable="false" width="110" align="center" sort="true"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center" sort="true"/> <EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center" sort="true"/>
<EF:EFColumn ename="createdTime" cname="上传时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime" <EF:EFColumn ename="updatedTime" cname="上传时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="140" readonly="true" dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="140" readonly="true"
required="false" enable="false" sort="true"/> required="false" enable="false" sort="true"/>
<EF:EFColumn ename="previewNum" cname="预览次数" enable="false" width="100" align="right" sort="true"/> <EF:EFColumn ename="previewNum" cname="预览次数" enable="false" width="100" align="right" sort="true"/>
......
...@@ -151,9 +151,7 @@ let save = function () { ...@@ -151,9 +151,7 @@ let save = function () {
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGWD003", "save", true, function (res) { JSUtils.submitGridsData("result", "HGWD003", "save", true);
message(res.msg);
});
} }
}); });
} }
...@@ -203,12 +201,7 @@ let removeUser = function () { ...@@ -203,12 +201,7 @@ let removeUser = function () {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"取消授权用户\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"取消授权用户\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HGWD003", "removeUser", JSUtils.submitGridsData("result", "HGWD003", "removeUser",
false, function (res) { true
message(res.msg);
if (res.status !== -1) {
query();
}
}
); );
} }
}); });
...@@ -247,19 +240,37 @@ let copyUserCallback = function (res) { ...@@ -247,19 +240,37 @@ let copyUserCallback = function (res) {
* 显示授权按钮 * 显示授权按钮
*/ */
let showAuthButton = function () { let showAuthButton = function () {
let label = IPLATUI.EFTree.docTree.selectNode.treeId;
let leafType = IPLATUI.EFTree.docTree.selectNode.leafType; let leafType = IPLATUI.EFTree.docTree.selectNode.leafType;
// C:目录 // C:目录
if (leafType && leafType === 'C') { if (!leafType && leafType != 'C') {
$("#AUTH").attr("disabled", false); $("#AUTH").hide();
$("#REMOVE_USER").attr("disabled", false); $("#REMOVE_USER").hide();
$("#COPY_USER").attr("disabled", false); $("#COPY_USER").hide();
$("#SAVE").attr("disabled", false); $("#SAVE").hide();
return;
}
// 管理员或者是项目经理,才能进行授权和操作用户
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-fileId", label);
EiCommunicator.send('HGWD003', 'isProjectManager', inInfo, {
onSuccess: function (res) {
if (res.getStatus() >= 0 && res.extAttr.isProjectManager == 1) {
$("#AUTH").show();
$("#REMOVE_USER").show();
$("#COPY_USER").show();
$("#SAVE").show();
} else { } else {
$("#AUTH").attr("disabled", true); $("#AUTH").hide();
$("#REMOVE_USER").attr("disabled", true); $("#REMOVE_USER").hide();
$("#COPY_USER").attr("disabled", true); $("#COPY_USER").hide();
$("#SAVE").attr("disabled", true); $("#SAVE").hide();
} }
},
onFail: function (res) {
NotificationUtil("操作失败,原因[" + res.getMsg() + "]", "error");
}
});
} }
/** /**
......
...@@ -43,8 +43,6 @@ let authUser = function () { ...@@ -43,8 +43,6 @@ let authUser = function () {
message("请选择数据"); message("请选择数据");
return; return;
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"授权\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD003A", "authUser", JSUtils.submitGridsData("result", "HGWD003A", "authUser",
true, function (res) { true, function (res) {
message(res.msg); message(res.msg);
...@@ -53,6 +51,4 @@ let authUser = function () { ...@@ -53,6 +51,4 @@ let authUser = function () {
} }
} }
); );
}
});
} }
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
loadComplete: function (grid) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 授权
$("#AUTH").on("click", auth);
// 删除用户
$("#REMOVE_USER").on("click", removeUser);
});
/**
* 页面加载
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 授权
*/
let auth = function () {
JSColorbox.open({
href: "HGWD009A",
title: "<div style='text-align: center;'>正在添加文档管理员</div>",
width: "70%",
height: "80%",
callbackName: authCallback
});
}
/**
* 授权回调
*/
let authCallback = function (res) {
// 刷新页面
query();
}
/**
* 删除授权用户
*/
let removeUser = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD009", "removeUser", true);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="文档管理员">
<EF:EFRegion title="查询区" id="inqu">
<div class="row">
<EF:EFInput cname="部门名称" ename="orgCname" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="用户账号" ename="userId" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="用户姓名" ename="userName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion title="结果集" id="result">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="orgCname" cname="部门名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="userId" cname="用户账号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="userName" cname="用户姓名" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100, 150],
},
loadComplete: function (grid) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 授权用户
$("#AUTH_USER").on("click", authUser);
});
/**
* 页面加载
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 授权用户
*/
let authUser = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"授权\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD009A", "authUser",
true, function (res) {
if (res.status !== -1) {
parent.JSColorbox.setValueCallback(res);
} else {
message(res.msg);
}
}
);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="文档管理员">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="depName" cname="部门名称" blockId="inqu_status" row="0" colWidth="4"/>
<EF:EFInput ename="loginName" cname="用户账号" blockId="inqu_status" row="0" colWidth="4"/>
<EF:EFInput ename="userName" cname="用户姓名" blockId="inqu_status" row="0" colWidth="4"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" height="69vh">
<EF:EFColumn ename="userId" cname="用户ID" hidden="true" primaryKey="true"/>
<EF:EFColumn ename="depName" cname="部门名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="loginName" cname="用户账号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="userName" cname="用户姓名" enable="false" width="120" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment