Commit 7f947997 by 宋祥

1.生产任务查询权限根据组过滤,

parent d6c4aa2e
......@@ -116,6 +116,15 @@ public class UserSessionUtils extends UserSession {
}
/**
* 获取登录用户的组织信息
*
* @return
*/
public static List<Org> getOrg() {
return HGXSTools.XsOrg.queryByUser();
}
/**
* 获取登录用户的公司编码
*
* @return
......
......@@ -152,9 +152,6 @@
<isNotEmpty prepend=" AND " property="unfinishWeight">
unfinish_weight = #unfinishWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
......@@ -173,19 +170,13 @@
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<!-- 移动端请求参数 -->
<isEqual prepend=" AND " property="completeStatus" compareValue="0">
trim(ifnull(complete_date,'')) = ''
</isEqual>
<isEqual prepend=" AND " property="completeStatus" compareValue="1">
trim(ifnull(complete_date,'')) != ''
</isEqual>
</sql>
<sql id="customCondition">
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="ids">
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
......@@ -201,6 +192,13 @@
<isNotEmpty prepend=" AND " property="groupNames">
GROUP_NAME IN <iterate close=")" open="(" conjunction="," property="groupNames">#groupNames[]#</iterate>
</isNotEmpty>
<!-- 移动端请求参数 -->
<isEqual prepend=" AND " property="completeStatus" compareValue="0">
TRIM(IFNULL(COMPLETE_DATE, '')) = ''
</isEqual>
<isEqual prepend=" AND " property="completeStatus" compareValue="1">
TRIM(IFNULL(COMPLETE_DATE, '')) != ''
</isEqual>
</sql>
<sql id="appCondition">
......@@ -247,7 +245,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id desc, product_type asc, product_name, process_order desc
ID DESC, PRODUCT_TYPE ASC, PRODUCT_NAME, PROCESS_ORDER DESC
</isEmpty>
</dynamic>
</sql>
......@@ -257,7 +255,6 @@
<include refid="column"/>
FROM ${hggpSchema}.HGSC007
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="orderBy"/>
</select>
......@@ -265,12 +262,11 @@
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC007
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC007 (id,
INSERT INTO ${hggpSchema}.HGSC007 (
mat_id, <!-- 物料清单ID -->
order_id, <!-- 生产计划ID -->
order_detail_id, <!-- 生产计划明细ID -->
......@@ -313,13 +309,14 @@
updated_time, <!-- 更新时间 -->
spec,
length
)
VALUES (#id#, #matId#, #orderId#, #orderDetailId#, #techFlowId#, #techFlowName#, #inventProcessId#,
) VALUES (
#matId#, #orderId#, #orderDetailId#, #techFlowId#, #techFlowName#, #inventProcessId#,
#processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#,
#projName#, #taskCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#,
#factoryCode#, #factoryName#, #groupCode#, #groupName#, #completeDate#, #quantity#, #finishQuantity#,
#unfinishQuantity#, #singleWeight#, #totalWeight#, #finishWeight#, #unfinishWeight#, #accountCode#, #createdBy#,
#createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #spec#, #length#)
#createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #spec#, #length#
)
</insert>
<delete id="delete">
......@@ -362,17 +359,12 @@
total_weight = #totalWeight#, <!-- 总重 -->
finish_weight = #finishWeight#, <!-- 完工重量 -->
unfinish_weight = #unfinishWeight#, <!-- 未完工重量 -->
account_code = #accountCode#, <!-- 帐套 -->
created_by = #createdBy#, <!-- 创建人 -->
created_name = #createdName#, <!-- 创建人名称 -->
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime#, <!-- 更新时间 -->
spec = #spec#,
length = #length#
WHERE
id = #id#
WHERE id = #id#
</update>
<!-- 行锁 -->
......@@ -381,10 +373,10 @@
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
id = #id#
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</update>
......
package com.baosight.hggp.hg.sc.util;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.xservices.xs.util.LoginUserDetails;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -31,26 +35,12 @@ public class HgScUtils {
if (LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
return;
}
// 查询自己所在组的任务 added by songx at 20240820
// 查询自己所在组的任务 added by songx at 20240820
List<String> allGroupNames = UserSessionUtils.getAllGroupName();
if (CollectionUtils.isNotEmpty(allGroupNames)) {
queryMap.put("groupNames", allGroupNames);
return;
}
// 如果没有组,则查看所在厂区的任务
List<String> factoryNames = UserSessionUtils.getFactoryName();
if (CollectionUtils.isNotEmpty(factoryNames)) {
queryMap.put("factoryNames", factoryNames);
return;
}
// 如果没有厂区,则查看所在公司的任务
List<String> companyCodes = UserSessionUtils.getCompanyCode();
if (CollectionUtils.isNotEmpty(companyCodes)) {
queryMap.put("companyCodes", companyCodes);
return;
queryMap.put("enableRoleAuth", CommonConstant.YesNo.NO_0);
}
// 当用户无组织机构时,抛出异常
throw new PlatException("当前用户未绑定组织机构,无法操作数据,请联系管理员!");
}
}
......
......@@ -6,14 +6,24 @@
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<!-- 0:不启用角色权限,1或者空:启用-->
<isNotEqual property="enableRoleAuth" compareValue="0">
<include refid="HGXSDataAuth.roleAuthCondition"/>
</isNotEqual>
</sql>
<sql id="roleAuthCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction=","
property="authDepCodes">#authDepCodes[]#</iterate>)
<isEqual prepend=" AND " property="authCombination" compareValue="1" open="(" close=")">
CREATED_BY = #authOnlyPeople#
OR DEP_CODE IN
<iterate close=")" open="(" conjunction="," property="authDepCodes">
#authDepCodes[]#
</iterate>
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
......@@ -22,7 +32,9 @@
</isNotEmpty>
<isNotEmpty property="authDepCodes">
DEP_CODE IN
<iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
<iterate close=")" open="(" conjunction="," property="authDepCodes">
#authDepCodes[]#
</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
......
......@@ -50,7 +50,7 @@
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="220" sort="true"/>
<EF:EFColumn ename="docType" cname="文件后缀" enable="false" width="100" 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="createdTime" cname="上传时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="140" readonly="true"
......
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