Commit 18272c87 by 宋祥

Merge branch 'master' of http://129.211.46.84:8800/platform/hg-smart into master-dc

parents 94ab7fb3 287e8db3
......@@ -128,7 +128,7 @@ public class DcOpenApi {
dataJsons.add(DcApiUtils.buildValueJson("title", title));
dataJsons.add(DcApiUtils.buildValueJson("sort2", 451)); // 451:默认分类
dataJsons.add(DcApiUtils.buildValueJson("intro", content));
dataJsons.add(DcApiUtils.buildValueJson("member", 1)); // 0:全部,1: 不分,-1:私密
dataJsons.add(DcApiUtils.buildValueJson("member1", 1)); // 0:全部,1: 不分,-1:私密
dataJsons.add(DcApiUtils.buildValueJson("share", ords));
String param = JSON.toJSONString(DcApiUtils.buildParamJson(dataJsons, "__sys_dosave"));
String result = HttpUtils.post(DeChengConst.INTERACTION_ADD, param, HttpUtils.JSON_MEDIA_TYPE);
......
......@@ -202,20 +202,21 @@
</sql>
<sql id="appCustomCondition">
<include refid="HGXSDataAuth.authConditionA"/>
<isNotEmpty prepend=" AND " property="companyCodes">
h.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
a.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCodes">
h.FACTORY_CODE IN <iterate close=")" open="(" conjunction="," property="factoryCodes">#factoryCodes[]#</iterate>
a.FACTORY_CODE IN <iterate close=")" open="(" conjunction="," property="factoryCodes">#factoryCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryNames">
h.FACTORY_NAME IN <iterate close=")" open="(" conjunction="," property="factoryNames">#factoryNames[]#</iterate>
a.FACTORY_NAME IN <iterate close=")" open="(" conjunction="," property="factoryNames">#factoryNames[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCodes">
h.GROUP_CODE IN <iterate close=")" open="(" conjunction="," property="groupCodes">#groupCodes[]#</iterate>
a.GROUP_CODE IN <iterate close=")" open="(" conjunction="," property="groupCodes">#groupCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupNames">
h.GROUP_NAME IN <iterate close=")" open="(" conjunction="," property="groupNames">#groupNames[]#</iterate>
a.GROUP_NAME IN <iterate close=")" open="(" conjunction="," property="groupNames">#groupNames[]#</iterate>
</isNotEmpty>
</sql>
......@@ -285,56 +286,56 @@
<select id="queryApp" resultClass="com.baosight.hggp.hg.sc.domain.HGSC007">
SELECT
h.id as "id",
h.mat_id as "matId", <!-- 物料清单ID -->
h.order_id as "orderId", <!-- 生产计划ID -->
h.order_detail_id as "orderDetailId", <!-- 生产计划明细ID -->
h.tech_flow_id as "techFlowId", <!-- 工艺流程ID -->
h.tech_flow_name as "techFlowName", <!-- 工艺流程名称 -->
h.invent_process_id as "inventProcessId", <!-- 存货工序ID,对应HGPZ005A.id -->
h.process_code as "processCode", <!-- 工序编码 -->
h.process_name as "processName", <!-- 工序名称 -->
h.process_order as "processOrder", <!-- 加工顺序 -->
h.company_code as "companyCode", <!-- 公司编码 -->
h.company_name as "companyName", <!-- 公司名称 -->
h.dep_code as "depCode", <!-- 部门编码 -->
h.dep_name as "depName", <!-- 部门名称 -->
h.proj_code as "projCode", <!-- 项目编码 -->
h.proj_name as "projName", <!-- 项目名称 -->
h.task_code as "taskCode", <!-- 任务编码 -->
h.product_type as "productType", <!-- 产品类型 -->
h.product_code as "productCode", <!-- 产品编号 -->
h.product_name as "productName", <!-- 产品名称 -->
h.plan_start_date as "planStartDate", <!-- 计划开始日期 -->
h.plan_end_date as "planEndDate", <!-- 计划结束日期 -->
h.factory_code as "factoryCode", <!-- 工厂编号 -->
h.factory_name as "factoryName", <!-- 工厂名称 -->
h.group_code as "groupCode", <!-- 工作组编号 -->
h.group_name as "groupName", <!-- 工作组名称 -->
h.complete_date as "completeDate", <!-- 完工日期 -->
h.quantity as "quantity", <!-- 数量 -->
h.finish_quantity as "finishQuantity", <!-- 完工数量 -->
h.unfinish_quantity as "unfinishQuantity", <!-- 未完工数量 -->
h.single_weight as "singleWeight", <!-- 单重 -->
h.total_weight as "totalWeight", <!-- 总重 -->
h.finish_weight as "finishWeight", <!-- 完工重量 -->
h.unfinish_weight as "unfinishWeight", <!-- 未完工重量 -->
h.account_code as "accountCode", <!-- 帐套 -->
h.created_by as "createdBy", <!-- 创建人 -->
h.created_name as "createdName", <!-- 创建人名称 -->
h.created_time as "createdTime", <!-- 创建时间 -->
h.updated_by as "updatedBy", <!-- 更新人 -->
h.updated_name as "updatedName", <!-- 修改人名称 -->
h.updated_time as "updatedTime", <!-- 更新时间 -->
h.LENGTH as "length", <!-- 长 -->
h.SPEC as "spec", <!-- 规格 -->
a.id as "id",
a.mat_id as "matId", <!-- 物料清单ID -->
a.order_id as "orderId", <!-- 生产计划ID -->
a.order_detail_id as "orderDetailId", <!-- 生产计划明细ID -->
a.tech_flow_id as "techFlowId", <!-- 工艺流程ID -->
a.tech_flow_name as "techFlowName", <!-- 工艺流程名称 -->
a.invent_process_id as "inventProcessId", <!-- 存货工序ID,对应HGPZ005A.id -->
a.process_code as "processCode", <!-- 工序编码 -->
a.process_name as "processName", <!-- 工序名称 -->
a.process_order as "processOrder", <!-- 加工顺序 -->
a.company_code as "companyCode", <!-- 公司编码 -->
a.company_name as "companyName", <!-- 公司名称 -->
a.dep_code as "depCode", <!-- 部门编码 -->
a.dep_name as "depName", <!-- 部门名称 -->
a.proj_code as "projCode", <!-- 项目编码 -->
a.proj_name as "projName", <!-- 项目名称 -->
a.task_code as "taskCode", <!-- 任务编码 -->
a.product_type as "productType", <!-- 产品类型 -->
a.product_code as "productCode", <!-- 产品编号 -->
a.product_name as "productName", <!-- 产品名称 -->
a.plan_start_date as "planStartDate", <!-- 计划开始日期 -->
a.plan_end_date as "planEndDate", <!-- 计划结束日期 -->
a.factory_code as "factoryCode", <!-- 工厂编号 -->
a.factory_name as "factoryName", <!-- 工厂名称 -->
a.group_code as "groupCode", <!-- 工作组编号 -->
a.group_name as "groupName", <!-- 工作组名称 -->
a.complete_date as "completeDate", <!-- 完工日期 -->
a.quantity as "quantity", <!-- 数量 -->
a.finish_quantity as "finishQuantity", <!-- 完工数量 -->
a.unfinish_quantity as "unfinishQuantity", <!-- 未完工数量 -->
a.single_weight as "singleWeight", <!-- 单重 -->
a.total_weight as "totalWeight", <!-- 总重 -->
a.finish_weight as "finishWeight", <!-- 完工重量 -->
a.unfinish_weight as "unfinishWeight", <!-- 未完工重量 -->
a.account_code as "accountCode", <!-- 帐套 -->
a.created_by as "createdBy", <!-- 创建人 -->
a.created_name as "createdName", <!-- 创建人名称 -->
a.created_time as "createdTime", <!-- 创建时间 -->
a.updated_by as "updatedBy", <!-- 更新人 -->
a.updated_name as "updatedName", <!-- 修改人名称 -->
a.updated_time as "updatedTime", <!-- 更新时间 -->
a.LENGTH as "length", <!-- 长 -->
a.SPEC as "spec", <!-- 规格 -->
ifnull(h2.quantity,0) as "taskQuantity", <!-- 任务数量 -->
h.quantity - ifnull(h2.quantity,0) as "unTaskQuantity", <!-- 待任务数量 -->
case when h.quantity - ifnull(h2.quantity,0) &lt;= 0 then 2
when ifnull(h2.quantity,0) &gt;0 and h.quantity - ifnull(h2.quantity,0) &gt; 0 then 1
a.quantity - ifnull(h2.quantity,0) as "unTaskQuantity", <!-- 待任务数量 -->
case when a.quantity - ifnull(h2.quantity,0) &lt;= 0 then 2
when ifnull(h2.quantity,0) &gt;0 and a.quantity - ifnull(h2.quantity,0) &gt; 0 then 1
else 0
end as "isComplete"
FROM ${hggpSchema}.HGSC007 h
FROM ${hggpSchema}.HGSC007 a
LEFT JOIN (
select task_id,sum(quantity) as quantity
from ${hggpSchema}.HGSC008
......@@ -376,151 +377,132 @@
work_code like ('%$workCode$%')
</isNotEmpty>
group by task_id
) h2 ON h.id = h2.task_id
) h2 ON a.id = h2.task_id
WHERE 1=1
<isNotEmpty prepend=" AND " property="id">
h.id = #id#
a.id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
h.mat_id = #matId#
a.mat_id = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orderId">
h.order_id = #orderId#
a.order_id = #orderId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orderDetailId">
h.order_detail_id = #orderDetailId#
a.order_detail_id = #orderDetailId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowId">
h.tech_flow_id = #techFlowId#
a.tech_flow_id = #techFlowId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="techFlowName">
h.tech_flow_name = #techFlowName#
a.tech_flow_name = #techFlowName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventProcessId">
h.invent_process_id = #inventProcessId#
a.invent_process_id = #inventProcessId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processCode">
h.process_code = #processCode#
a.process_code = #processCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
h.process_name = #processName#
a.process_name = #processName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processOrder">
h.process_order = #processOrder#
a.process_order = #processOrder#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
h.company_code = #companyCode#
a.company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
h.company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
h.dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
h.dep_name = #depName#
a.company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
h.proj_code = #projCode#
a.proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
h.proj_name LIKE CONCAT('%', #projName#, '%')
a.proj_name LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taskCode">
h.task_code = #taskCode#
a.task_code = #taskCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productType">
h.product_type = #productType#
a.product_type = #productType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productCode">
h.product_code LIKE CONCAT('%', #productCode#, '%')
a.product_code LIKE CONCAT('%', #productCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
h.product_name LIKE CONCAT('%', #productName#, '%')
a.product_name LIKE CONCAT('%', #productName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planStartDate">
h.plan_start_date = #planStartDate#
a.plan_start_date = #planStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planEndDate">
h.plan_end_date = #planEndDate#
a.plan_end_date = #planEndDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
h.factory_code = #factoryCode#
a.factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
h.factory_name = #factoryName#
a.factory_name = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
h.group_code = #groupCode#
a.group_code = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
h.group_name LIKE CONCAT('%', #groupName# ,'%')
a.group_name LIKE CONCAT('%', #groupName# ,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="completeDate">
h.complete_date = #completeDate#
a.complete_date = #completeDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="quantity">
h.quantity = #quantity#
a.quantity = #quantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="finishQuantity">
h.finish_quantity = #finishQuantity#
a.finish_quantity = #finishQuantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unfinishQuantity">
h.unfinish_quantity = #unfinishQuantity#
a.unfinish_quantity = #unfinishQuantity#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="singleWeight">
h.single_weight = #singleWeight#
a.single_weight = #singleWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalWeight">
h.total_weight = #totalWeight#
a.total_weight = #totalWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="finishWeight">
h.finish_weight = #finishWeight#
a.finish_weight = #finishWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unfinishWeight">
h.unfinish_weight = #unfinishWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
h.account_code = #accountCode#
a.unfinish_weight = #unfinishWeight#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
h.created_by = #createdBy#
a.created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
h.created_name = #createdName#
a.created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
h.created_time LIKE CONCAT('%', #createdTime# ,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
h.updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
h.updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
h.updated_time = #updatedTime#
a.created_time LIKE CONCAT('%', #createdTime# ,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
h.id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
a.id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isEqual prepend=" AND " property="isComplete" compareValue="0">
ifnull(h2.quantity,0) = 0 AND h.quantity - ifnull(h2.quantity,0) = h.quantity
ifnull(h2.quantity,0) = 0 AND a.quantity - ifnull(h2.quantity,0) = a.quantity
</isEqual>
<isEqual prepend=" AND " property="isComplete" compareValue="1">
ifnull(h2.quantity,0) > 0 AND h.quantity - ifnull(h2.quantity,0) &gt; 0
ifnull(h2.quantity,0) > 0 AND a.quantity - ifnull(h2.quantity,0) &gt; 0
</isEqual>
<isEqual prepend=" AND " property="isComplete" compareValue="2">
h.quantity &gt; 0 AND h.quantity - ifnull(h2.quantity,0) &lt;= 0
a.quantity &gt; 0 AND a.quantity - ifnull(h2.quantity,0) &lt;= 0
</isEqual>
<include refid="appCustomCondition"/>
<include refid="appCondition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
h.id desc, h.product_type asc, h.product_name, h.process_order desc
a.id desc, a.product_type asc, a.product_name, a.process_order desc
</isEmpty>
</dynamic>
</select>
......
......@@ -393,39 +393,63 @@ public class HGSCTools {
}
public static void add(List<HGSC004A> arrayList, String materialId) {
List<HGSC004> results = DaoBase.getInstance().query(HGSC004.QUERY, new HashMap<String,Object>(){
{put("id",materialId);}
});
AssertUtils.isEmpty(results, "物料清单不存在!");
HGSC004 hgsc004 = Hgsc004.getId(materialId);
List<HGSC004A> hgsc004aList = Optional.ofNullable(
list(new HashMap<String,Object>(){{put(HGSC004A.FIELD_material_id,materialId);}})).orElse(new ArrayList<>());
AssertUtils.isEmpty(Collections.singleton(hgsc004), "物料清单不存在,添加失败!");
AssertUtils.isTrue(hgsc004.getMaterialStatus()==2 || hgsc004.getApprovalStatus()==2, "物料清单已提交或已审核,无法添加!");
for (HGSC004A hgsc004a : arrayList){
//HGSC004A hgsc004a = new HGSC004A();
//hgsc004a.fromMap(resultRow);
hgsc004a.setCompanyCode(results.get(0).getCompanyCode());
hgsc004a.setCompanyName(results.get(0).getCompanyName());
hgsc004a.setDepCode(results.get(0).getDepCode());
hgsc004a.setDepName(results.get(0).getDepName());
hgsc004a.setCompanyCode(hgsc004.getCompanyCode());
hgsc004a.setCompanyName(hgsc004.getCompanyName());
hgsc004a.setDepCode(hgsc004.getDepCode());
hgsc004a.setDepName(hgsc004.getDepName());
hgsc004a.setProductCode(hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getProductCode()));
hgsc004a.setProductName(hgsc004a.getProjNamePrefix().trim().concat(hgsc004a.getProductName()));
if (hgsc004a.getParentProdCode().trim().isEmpty()){
hgsc004a.setParentProdCode(results.get(0).getProjCode());
hgsc004a.setParentProdName(results.get(0).getProjName());
hgsc004a.setMaterialId(results.get(0).getId());
hgsc004a.setParentProdCode(hgsc004.getProjCode());
hgsc004a.setParentProdName(hgsc004.getProjName());
hgsc004a.setMaterialId(hgsc004.getId());
hgsc004a.setLv(3);
}else{
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("companyCode", hgsc004a.getCompanyCode());
paramMap.put("projCode", hgsc004a.getProjCode());
paramMap.put("lv", 3);
paramMap.put("productCode", hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getParentProdCode()));
List<HGSC004A> hgsc004aList = list(paramMap);
AssertUtils.isEmpty(hgsc004aList, String.format("父节点-产品编号[%s]数据不存在,导入失败!",hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getParentProdCode())));
hgsc004a.setMaterialId(results.get(0).getId());
/*Map<String,Object> paramMap = new HashMap<>();
paramMap.put(HGSC004A.FIELD_company_code, hgsc004a.getCompanyCode());
paramMap.put(HGSC004A.FIELD_proj_code, hgsc004a.getProjCode());
paramMap.put(HGSC004A.FIELD_lv, 3);
paramMap.put(HGSC004A.FIELD_product_code, hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getParentProdCode()));*/
/*List<HGSC004A> hgsc004as = hgsc004aList.stream().filter(o ->
o.getProductCode().equals(hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getParentProdCode()))
&& o.getLv() == 3
&& o.getProjCode().equals(hgsc004a.getProjCode())
&& o.getCompanyCode().equals(hgsc004a.getCompanyCode())
).collect(Collectors.toList());*/
AssertUtils.isEmpty(hgsc004a.getParentProdCode(), String.format("父节点-产品编号[%s]数据不存在,导入失败!",hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getParentProdCode())));
hgsc004a.setMaterialId(hgsc004.getId());
hgsc004a.setLv(4);
hgsc004a.setParentProdCode(hgsc004a.getProjCodePrefix().trim().concat(hgsc004a.getParentProdCode()));
hgsc004a.setParentProdName(hgsc004a.getProjNamePrefix().trim().concat(hgsc004a.getParentProdName()));
}
checkSaveData(hgsc004a);
addEntity(hgsc004a);
if (hgsc004a.getLv() == 3){
DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
}else {
List<HGSC004A> hgsc004AS= hgsc004aList.stream()
.filter(o -> o.getLv() == 4
&& o.getCompanyCode().equals(hgsc004a.getCompanyCode())
&& o.getProjCode().equals(hgsc004a.getProjCode())
&& o.getParentProdCode().equals(hgsc004a.getParentProdCode())
&& o.getProductId().equals(hgsc004a.getProductId())
&& o.getProductCode().equals(hgsc004a.getProductCode())
).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(hgsc004AS)){
hgsc004AS.get(0).setQuantity(hgsc004a.getQuantity());
hgsc004AS.get(0).setSingleWeight(hgsc004a.getSingleWeight());
hgsc004AS.get(0).setTotalWeight(hgsc004a.getTotalWeight());
DaoUtils.update(HGSC004A.UPDATE, hgsc004a);
}else {
DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
}
}
}
}
......@@ -435,15 +459,12 @@ public class HGSCTools {
/*if(hgsc004a.getLv().intValue() < 4){
hgsc004a.setLv(hgsc004a.getLv() + 1);
}*/
if(hgsc004a.getLv().intValue() == 3){
hgsc004a.setLeaf(2);
}else{
hgsc004a.setLeaf(1);
}
hgsc004a.setProductStatus(HGConstant.ProductStatus.WTJ);
if(hgsc004a.getLv().intValue() == 3){
if(hgsc004a.getLv() == 3){
hgsc004a.setLeaf(2);
hgsc004a.setProductType(ProductTypeEnum.STRUCT.getCode().toString());
}else{
hgsc004a.setLeaf(1);
hgsc004a.setProductType(ProductTypeEnum.PART.getCode().toString());
}
if (hgsc004a.getQuantity().compareTo(BigDecimal.ZERO) == 0){
......@@ -480,7 +501,7 @@ public class HGSCTools {
hgsc004a.setLength(pz005.getLength());
hgsc004a.setWidth(pz005.getWidth());
hgsc004a.setThick(pz005.getThick());
DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
//DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
//主表全部提交时需要有改变状态
/*if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
hgsc004a.setChangeType(HGConstant.ChangeType.ZJ);
......@@ -504,14 +525,14 @@ public class HGSCTools {
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
}*/
//为构件的需要验证是否已经存在了,不能重复添加
if(hgsc004a.getLv().intValue() == 3){
if(hgsc004a.getLv() == 3){
Map<String,Object> mapA = new HashMap<>();
mapA.put("materialId",hgsc004a.getMaterialId());
mapA.put("productId",hgsc004a.getProductId());
mapA.put("parentProdCode",hgsc004a.getParentProdCode());
mapA.put("notId",hgsc004a.getId());
List<HGSC004A> hgsc004AList = DaoBase.getInstance().query(HGSC004A.QUERY,mapA);
AssertUtils.isTrue(!org.springframework.util.CollectionUtils.isEmpty(hgsc004AList), "已存在构建"+hgsc004a.getProductCode()+"-"+hgsc004a.getProductName());
mapA.put(HGSC004A.FIELD_material_id,hgsc004a.getMaterialId());
//mapA.put(HGSC004A.FIELD_product_id,hgsc004a.getProductId());
mapA.put(HGSC004A.FIELD_parent_prod_code,hgsc004a.getParentProdCode());
mapA.put(HGSC004A.FIELD_product_code,hgsc004a.getProductCode());
List<HGSC004A> hgsc004AList = list(mapA);
AssertUtils.isTrue(!CollectionUtils.isEmpty(hgsc004AList), String.format("已存在构建%s-%s",hgsc004a.getProductCode(),hgsc004a.getProductName()));
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
//AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
......
......@@ -35,5 +35,15 @@ public class HgWdConstant {
// 目录
public static final String C = "C";
}
/**
* 操作状态
*/
public static class OperStatus {
//新增
public static final Integer S_0 = 0;
//变更
public static final Integer S_1 = 1;
}
}
......@@ -37,6 +37,7 @@ public class HGWD099 extends DaoEPBase {
public static final String FIELD_RELEASE_DATE = "releaseDate"; /* 发布时间*/
public static final String FIELD_DOC_VERSION = "docVersion"; /* 文件版本号*/
public static final String FIELD_DOC_TYPE = "docType"; /* 文件类型*/
public static final String FIELD_OPER_STATUS = "operStatus"; /* 是否变更 0-否 1-是*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
......@@ -85,6 +86,7 @@ public class HGWD099 extends DaoEPBase {
private String releaseDate = " "; /* 发布时间*/
private Integer docVersion = new Integer(0); /* 文件版本号*/
private String docType = " "; /* 文件类型*/
private Integer operStatus = new Integer(0);
/**
* initialize the metadata.
......@@ -172,6 +174,10 @@ public class HGWD099 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_DOC_TYPE);
eiColumn.setDescName("文件类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_OPER_STATUS);
eiColumn.setDescName("操作状态");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -471,6 +477,14 @@ public class HGWD099 extends DaoEPBase {
this.docType = docType;
}
public Integer getOperStatus() {
return operStatus;
}
public void setOperStatus(Integer operStatus) {
this.operStatus = operStatus;
}
/**
* get the value from Map.
*
......@@ -499,6 +513,7 @@ public class HGWD099 extends DaoEPBase {
setDocVersion(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOC_VERSION)), docVersion));
setReleaseDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RELEASE_DATE)), releaseDate));
setDocType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_TYPE)), docType));
setOperStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_OPER_STATUS)), operStatus));
}
/**
......@@ -528,6 +543,7 @@ public class HGWD099 extends DaoEPBase {
map.put(FIELD_DOC_VERSION, StringUtils.toString(docVersion, eiMetadata.getMeta(FIELD_DOC_VERSION)));
map.put(FIELD_RELEASE_DATE, StringUtils.toString(releaseDate, eiMetadata.getMeta(FIELD_RELEASE_DATE)));
map.put(FIELD_DOC_TYPE, StringUtils.toString(docType, eiMetadata.getMeta(FIELD_DOC_TYPE)));
map.put(FIELD_OPER_STATUS, StringUtils.toString(operStatus, eiMetadata.getMeta(FIELD_OPER_STATUS)));
return map;
}
......
......@@ -203,6 +203,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd099.fromMap(map);
hgwd099.setStatus(HgWdConstant.FileStatus.S_1);
hgwd099.setReleaseDate(DateUtils.shortDateTime());
hgwd099.setOperStatus(HgWdConstant.OperStatus.S_0);
List<HGWD003> listByFile = HGWDTools.HgWd003.listByFile(hgwd099.getBizId());
List hgwd003s = listByFile.stream().map(HGWD003::getUserId).distinct().collect(Collectors.toList());
AssertUtils.isTrue(hgwd003s.size() <= 1, "文件未分配人员,请先分配人员!");
......@@ -221,7 +222,10 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd001.setRemark(changeContent.trim().length()==0?"附件发布":changeContent);
DaoUtils.update(HGWD001.RELEASE_DATE, hgwd001);
}
HGWDTools.interaction(hgwd001,strFileName.append("变更内容:").append(changeContent).toString());
if (StringUtils.isNotEmpty(changeContent)) {
strFileName.append("变更内容:").append(changeContent);
}
HGWDTools.interaction(hgwd001,strFileName.toString());
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "发布成功")});
......@@ -263,6 +267,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd099.setDocName(resultRow.get(HGWD099.FIELD_DOC_NAME).toString());
hgwd099.setDocType(resultRow.get(HGWD099.FIELD_DOC_TYPE).toString());
hgwd099.setStatus(HgWdConstant.FileStatus.S_0);
hgwd099.setOperStatus(HgWdConstant.OperStatus.S_1);
DaoUtils.insert(HGWD099.UPDATE, hgwd099);
}
HGWDTools.interaction(hgwd001,strFileName.substring(0,strFileName.length()-1));
......@@ -296,6 +301,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd001a.setChangeStartCode(hgwd099.getDocId());
hgwd001a.setChangeStart(hgwd099.getDocName());
}else if (ChangeTypeEnum.RELEASE.getCode().equals(type)){
hgwd001a.setChangeType(ChangeTypeEnum.RELEASE.getCode());
hgwd001a.setChangeContent(hgwd001.getRemark().trim().length()==0?"附件发布":hgwd001.getRemark().trim());
hgwd001a.setChangeStart("V".concat(hgwd001.getDocVersion()+""));
hgwd001a.setChangeEnd("V".concat(hgwd001.getDocVersion()+1+""));
......
......@@ -21,10 +21,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -69,6 +66,7 @@ public class ServiceHGWD001E extends ServiceEPBase {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map<String, Object>> edcm01List = Iplat4jTools.EdCm01.list("hggp.hgwd.fileType");
List<HGWD001> hgwd001s = new ArrayList<>();
// 写入数据
for (Map resultRow : resultRows) {
HGWD001 hgwd001 = new HGWD001();
......@@ -79,7 +77,9 @@ public class ServiceHGWD001E extends ServiceEPBase {
} else {
this.modify(hgwd001,edcm01List);
}
hgwd001s.add(hgwd001);
}
inInfo.getBlock(EiConstant.resultBlock).setRows(hgwd001s);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
......
......@@ -64,7 +64,7 @@ public class ServiceHGWD099 extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow =EiInfoUtils.getFirstRow(inInfo);
if (StringUtils.isNotEmpty(queryRow.get(HGWD001.FIELD_FILE_ID).toString())){
if (StringUtils.isNotEmpty(queryRow.get(HGWD001.FIELD_PARENT_ID).toString())){
inInfo = super.query(inInfo, HGWD099.QUERY, new HGWD099());
}
} catch (Throwable e) {
......
......@@ -21,7 +21,8 @@
PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
DOWNLOAD_NUM as "downloadNum", <!-- 下载次数 -->
DOC_VERSION as "docVersion", <!-- 文件版本号 -->
RELEASE_DATE as "releaseDate" <!-- 发布时间 -->
RELEASE_DATE as "releaseDate", <!-- 发布时间 -->
OPER_STATUS as "operStatus"
</sql>
<sql id="condition">
......@@ -62,6 +63,9 @@
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG in <iterate close=")" open="(" conjunction="," property="deleteFlag">#deleteFlag[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="operStatus">
OPER_STATUS = #operStatus#
</isNotEmpty>
</sql>
<sql id="customCondition">
......@@ -119,10 +123,11 @@
DOC_TYPE, <!-- 文件名称 -->
STATUS,
DOC_VERSION,
RELEASE_DATE
RELEASE_DATE,
OPER_STATUS
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #docType#, #status#, #docVersion#, #releaseDate#
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #docType#, #status#, #docVersion#, #releaseDate#, #operStatus#
)
</insert>
......@@ -155,6 +160,7 @@
STATUS = #status#,
DOC_VERSION = DOC_VERSION + 1, <!--版本号-->
RELEASE_DATE = #releaseDate#, <!--发布时间-->
OPER_STATUS = #operStatus#,
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
......@@ -177,6 +183,7 @@
RELEASE_DATE = #releaseDate#, <!--发布时间-->
DOC_VERSION = DOC_VERSION + 1, <!--版本号-->
STATUS = #status#, <!-- 状态 -->
OPER_STATUS = #operStatus#,
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
......
......@@ -271,7 +271,7 @@ public class HGWDTools {
if (Objects.nonNull(hgwd001)){
List<HGWD003> listByFile = HGWDTools.HgWd003.listByFile(hgwd001.getFileId()); //获取文件下的权限人员
HGPZ009 hgpz009 = HGPZTools.HgPz009.getByCode(hgwd001.getAccountCode());
//HGPZ009 hgpz009 = HGPZTools.HgPz009.getByCode(hgwd001.getAccountCode());
List<String> userIds = listByFile.stream().filter(item -> !item.getUserId().equals(UserSessionUtils.getUserId()) && item.getIsProjectManager() == 1)
.map(HGWD003::getExtId)
......
......@@ -43,6 +43,13 @@
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<!-- 0:不启用角色权限,1或者空:启用-->
<isNotEqual property="enableRoleAuth" compareValue="0">
<include refid="HGXSDataAuth.roleAuthConditionA"/>
</isNotEqual>
</sql>
<sql id="roleAuthConditionA">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
A.DEP_CODE = #authDepCode#
......@@ -50,7 +57,7 @@
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(A.CREATED_BY = #authOnlyPeople# OR A.DEP_CODE IN <iterate close=")" open="(" conjunction=","
property="authDepCodes">#authDepCodes[]#</iterate>)
property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
......
......@@ -356,7 +356,7 @@ $(function () {
$("[name = 'inqu_status-0-projCode']").val(data.projCode);
$("[name = 'inqu_status-0-companyCode']").val(data.companyCode);
$("[name = 'inqu_status-0-type']").val(data.type);
$("[name = 'inqu_status-0-fileId']").val(data.ename);
/*$("[name = 'inqu_status-0-fileId']").val(data.ename);*/
$("[name = 'inqu_status-0-fileName']").val(data.text);
$("[name = 'inqu_status-0-leafLevel']").val(data.leafLevel==null?0:data.leafLevel);
resultGrid.dataSource.page(1);
......@@ -403,60 +403,7 @@ $(function () {
pageable: {
pageSize: 20
},
dataBinding: function (e) {
var treeEname = $("#inqu_status-0-parentId").val();
for (let i = 0, length = e.items.length; i < length; i++) {
const model = e.items[i];
if (model.isNew()) {
e.preventDefault();
const orgId = $("#inqu_status-0-parentId").val();
if (orgId === "root" || orgId === "" || orgId == null) {
IPLAT.alert("请选择左侧组织机构组树节点后再进行新增");
} else {
const orgCnameValue = $("#inqu_status-0-fileName").val();
// 打开新增用户的弹窗
result1Grid.dataSource.page(1)
$("#insertUser").data("kendoWindow").open();
$("#insertUser_wnd_title").css({
"text-align": "justify",
"font-size": "14px",
"color": "#FFF"
});
$("#insertUser_wnd_title").html("正在为: [" + orgCnameValue + "] 添加成员用户");
}
model.parentId = treeEname;
}
}
},
loadComplete: function (grid) {
/**
* 为组织所属人员增加grid拖动至组织机构树事件
*/
grid.table.kendoDraggable({
filter: "tbody > tr",
group: "grid-tree",
hint: function (e) {
movedUser = resultGrid.dataSource.getByUid(e.data("uid"))
const text = e.context.innerText;
const attrs = text.split("\t");
let td =
"<td align='center' role='gridcell' id='fa fa-user'>" +
" <span class='fa fa-user'></span>" +
"</td>"
for (let attr of attrs) {
if (attr) {
let regex = new RegExp('\n', 'g');
let formattedAttr = attr.replace(regex, '');
td = td +
`<td align='center' role='gridcell'>` +
` <div className='i-validate-helper'>${formattedAttr}</div>` +
`</td>`
}
}
return $(`<div class="k-grid k-widget" style="pointer-events: none;border: #00bcff 1px solid"><table><tbody><tr>${td}</tr></tbody></table></div>`);
}
});
grid.dataSource.bind("requestEnd", function (e) {
if (e.type === "create" || e.type === "update" || e.type === "destroy") {
......@@ -481,40 +428,46 @@ $(function () {
message("请先勾选要发布的数据!");
return;
}
$.each(rows, function (i, row){
if (row.status == 1){
message("选中的第"+(i+1)+"行\"已发布\",不能重复发布!");
flat = 0;
return;
}
})
let status = rows.filter( row => row.status == 1);
if (status.length > 0){
message("选中的行\"已发布\",不能重复发布!");
flat = 0;
return;
}
if (flat){
let parentId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId;
let inEiInfo = new EiInfo();
inEiInfo.set("inqu_status-0-fileId", parentId);
$("#inqu_status-0-changeContent").val('');
//inEiInfo.set("inqu_status-0-isProjectManager", "1");
//inEiInfo.set("inqu_status-0-userId", $("#inqu_status-0-userId").val());
EiCommunicator.send("HGWD003", "query", inEiInfo, {
onSuccess(ei) {
if (!isBlank(ei.getBlock("result"))){
let rows = ei.getBlock("result").getMappedRows();
if (rows.length <= 1){
message("文件未分配人员,请先分配人员!");
return;
}else {
$("#releaseWindow").data("kendoWindow").center()
$("#releaseWindow").data("kendoWindow").open();
let operStatus = rows.filter( row => row.operStatus == 1);
if (operStatus.length == 0){
updateRelease(0);
}else {
let parentId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId;
let inEiInfo = new EiInfo();
inEiInfo.set("inqu_status-0-fileId", parentId);
$("#inqu_status-0-changeContent").val('');
//inEiInfo.set("inqu_status-0-isProjectManager", "1");
//inEiInfo.set("inqu_status-0-userId", $("#inqu_status-0-userId").val());
EiCommunicator.send("HGWD003", "query", inEiInfo, {
onSuccess(ei) {
if (!isBlank(ei.getBlock("result"))){
let rows = ei.getBlock("result").getMappedRows();
if (rows.length <= 1){
message("文件未分配人员,请先分配人员!");
return;
}else {
$("#releaseWindow").data("kendoWindow").center()
$("#releaseWindow").data("kendoWindow").open();
}
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
});
//变更记录
......@@ -567,9 +520,27 @@ let query = function () {
/**
* 新增组织机构回调
*/
let addCallback = function (parentId) {
let addCallback = function (rows) {
// 回填父级ID
$("#inqu_status-0-orgParentId").val(parentId);
//$("#inqu_status-0-orgParentId").val(parentId);
// 刷新树节点
const tree = $("#categoryTree").data("kendoTreeView");
var selectedNode = tree.select();
tree.append({ // append()selecttedNode
id: rows[0].fileId,
label: rows[0].fileId,
text: rows[0].fileName,
parentId: rows[0].parentId,
projCode: rows[0].projCode,
projName: rows[0].projName,
ename: rows[0].projCode,
type: rows[0].fileType,
leafLevel: rows[0].leafLevel,
leaf:0
}, selectedNode);
tree.reload(rows[0].parentId)
expandTreeNode(tree, rows[0].parentId);
$("#inqu_status-0-orgParentId").val(rows[0].parentId);
refreshTree();
}
......@@ -597,6 +568,7 @@ let refreshTree = function () {
let barElement = tree.findByUid(barDataItem.uid);
// 刷新完成后选中对应的树节点
tree.select(barElement);
setTreeNodeValue(barDataItem)
} else {
selectTreeNode(tree, treeOrgId)
}
......@@ -613,57 +585,6 @@ let refreshTree = function () {
selectTreeNode(tree, treeOrgId);
}, 500);
}
let movedUser;
let splitter;
/**
* 扩展信息查看
* @param e
*/
const user_ex_btn_func = (e) => {
const model = resultGrid.dataItem(e.closest("tr"));
const userId = model.id;
splitter.collapse(".k-pane:first")
splitter.expand(".k-pane:first")
const getNum = (str) => {
return parseFloat(str.slice(0, str.lastIndexOf('px')));
}
let leftPaneWidth = getNum($("#left-pane").css('width'))
const splitterWidth = 8;
let splitterLeft = getNum($(".k-splitbar").css('left'))
let rightPaneWidth = getNum($("#right-pane").css('width'))
let rightPaneLeft = getNum($("#right-pane").css('left'))
const totalWidth = leftPaneWidth + splitterWidth + rightPaneWidth;
const offset = totalWidth * 0.45 - leftPaneWidth;
leftPaneWidth += offset;
splitterLeft += offset;
rightPaneWidth -= offset;
rightPaneLeft += offset;
$("#left-pane").css('width', leftPaneWidth)
$(".k-splitbar").css('left', splitterLeft)
$("#right-pane").css('width', rightPaneWidth)
$("#right-pane").css('left', rightPaneLeft)
resultGrid.resize();
showUC(userId)
}
/**
* 显示抽屉组件
* @param uuid
*/
function showUC(uuid) {
var url = IPLATUI.CONTEXT_PATH + "/web/XS4100";
window.openDrawer(url, uuid);
}
/**
* 展开对应的树节点
* @param tree
......@@ -743,129 +664,6 @@ let setTreeNodeValue = function (nodeData) {
}
/**
* 非对称加密
* @param str
* @returns {string}
* @constructor
*/
function RSAEncrypt(str) {
// Encrypt with the public key...
var encrypt = new JSEncrypt();
encrypt.setPublicKey($('#__LOGIN_PUBLICKEY__').val());
return encrypt.encrypt(str);
}
/**
* 展示XS4100中的图片
* @param url
*/
function showXS4100Image(url) {
$("#showXS4100Image").attr("src", url);
$("#showXS4100ImageWindow").data("kendoWindow").center()
$("#showXS4100ImageWindow").data("kendoWindow").open()
return true;
}
/**
* 生成表头预览
*/
let tableHeader = [];
function showPreview() {
// 查询表头
let eiInfo = new EiInfo();
EiCommunicator.send("XSOG0801", "queryUserTableHeader", eiInfo, {
onSuccess: function (response) {
if (response.status > -1) {
// draw(response.get("cnameList"));
draw(response);
} else {
IPLAT.alert(response.getMsg());
}
}, onFail: function (errorMsg, status, e) { /* errorMsg 是平台格式化后的异常消息, status, e的含义和$.ajax的含义相同,请参考jQuery文档 */
console.log(errorMsg);
}
});
function draw(response) {
const currentTableHeader = response.get("cnameList");
const basicCount = response.get("basicCount");
const orgLevel = response.get("orgLevel");
if (JSON.stringify(tableHeader) === JSON.stringify(currentTableHeader)) {
return;
}
tableHeader = currentTableHeader;
let div = document.getElementById("excelTable");
div.innerHTML = "";
// 创建 table 元素并添加到 div 中
let table = document.createElement("table");
table.style.border = "1px solid black"; // 设置表格边框样式
div.appendChild(table);
// 创建表头行
let theadRow1 = document.createElement("tr");
table.appendChild(theadRow1);
for (let i = 0; i < currentTableHeader.length; i++) {
let th = document.createElement("th");
if (i < basicCount) {
th.textContent = '基础信息';
th.style.backgroundColor = "#99CCFF"; // 设置表头单元格边框样式
} else if (i < basicCount + 2 * orgLevel) {
th.textContent = '组织机构';
th.style.backgroundColor = "#CCFFCC"; // 设置表头单元格边框样式
} else {
th.textContent = '扩展信息';
th.style.backgroundColor = "#FFFF99"; // 设置表头单元格边框样式
}
th.style.border = "1px solid black"; // 设置表头单元格边框样式
th.style.padding = "4px";
theadRow1.appendChild(th);
}
// 创建表头行
let theadRow = document.createElement("tr");
table.appendChild(theadRow);
for (let i = 0; i < currentTableHeader.length; i++) {
let th = document.createElement("th");
th.textContent = `${currentTableHeader[i]}`;
th.style.border = "1px solid black"; // 设置表头单元格边框样式
th.style.padding = "4px";
theadRow.appendChild(th);
}
// 创建数据行
let rowData = [[], [], []];
for (let i = 0; i < currentTableHeader.length; i++) {
rowData[0].push(`数据1-${i + 1}`);
rowData[1].push(`数据2-${i + 1}`);
rowData[2].push(`数据3-${i + 1}`);
}
for (let i = 0; i < rowData.length; i++) {
let tr = document.createElement("tr"); // 创建行
table.appendChild(tr);
for (let j = 0; j < rowData[i].length; j++) {
let td = document.createElement("td"); // 创建单元格
td.textContent = rowData[i][j]; // 设置单元格内容
td.style.border = "1px solid black"; // 设置单元格边框样式
td.style.padding = "4px";
tr.appendChild(td);
}
}
}
}
/**
* 文件上传
*/
function uploadFile() {
......@@ -963,17 +761,18 @@ function deleteFunc() {
/**
* 发布
*/
function updateRelease() {
function updateRelease(operStatus) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let changeContent = $("#inqu_status-0-changeContent").val();
if (isBlank(changeContent)){
if (isBlank(operStatus) && isBlank(changeContent)){
message("请输入变更内容");
return;
}
let inEiInfo = new EiInfo();
inEiInfo.addBlock(JSUtils.checkedRows2Block("result"));
inEiInfo.set("inqu_status-0-changeContent", changeContent);
......@@ -1050,12 +849,10 @@ function changeResord() {
}
JSColorbox.open({
href: "HGWD001A?methodName=initLoad&inqu_status-0-bizType=WD" +
"&inqu_status-0-projCode=" + $("#inqu_status-0-parentId").val()+"" +
"&inqu_status-0-projName=" + $("#inqu_status-0-fileName").val() +
"&efParentFormEname=HGWD001",
"&inqu_status-0-projCode=" + $("#inqu_status-0-parentId").val()+"&efParentFormEname=HGWD001",
title: "<div style='text-align: center;'>变更记录</div>",
width: "80%",
height: "80%"
height: "80%",
});
}
......
......@@ -64,14 +64,14 @@
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="附件详情" fitHeight="true">
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="no" personal="true" serviceName="HGWD099" queryMethod="query"
deleteMethod="delete">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="140" align="center"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="180"/>
<EF:EFColumn ename="docType" cname="文件类型" enable="false" width="110"/>
<EF:EFColumn ename="docType" cname="文件类型" enable="false" width="110" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center"
defaultValue="0" hidden="false">
<EF:EFCodeOption codeName="hggp.hgwd.status"/>
......@@ -124,7 +124,7 @@
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="项目名称" width="160" enable="true" readonly="true" align="center"
<EF:EFColumn ename="companyName" cname="公司名称" width="160" enable="true" readonly="true" align="center"
required="true" hidden="true"/>
<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="proj_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
......
......@@ -24,8 +24,10 @@
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="projCode" cname="项目编码" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3" readonly="true"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="projCode" cname="项目名称" colWidth="3" filter="contains" readonly="true">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="proj_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="changeType" cname="变更类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgwd.changeType"/>
......
......@@ -182,7 +182,7 @@ let save = function (btnNode) {
var status = e.status;
if (status !== -1) {
let parentId = $("#inqu_status-0-parentId").val();
parent.JSColorbox.setValueCallback(parentId);
parent.JSColorbox.setValueCallback(e.getBlock("result").getMappedRows());
}
});
btnNode.attr("disabled", false);
......
......@@ -47,20 +47,20 @@
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="所属项目" width="160" enable="true" readonly="true" align="center"
<EF:EFColumn ename="companyName" cname="公司名称" width="160" enable="true" readonly="true" align="center"
required="true" hidden="true"/>
<EF:EFComboColumn ename="projCode" cname="所属项目" blockName="proj_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="200" required="true"
align="center" filter="contains" sort="true"/>
align="left" filter="contains" sort="true"/>
<EF:EFColumn ename="projName" cname="所属项目" width="160" enable="true" readonly="true" align="center"
required="true" hidden="true"/>
<EF:EFComboColumn ename="fileType" cname="文件类型" width="100" align="center" readonly="false" required="true"
defaultValue="20">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="fileName" cname="文件名称" width="160" enable="true" readonly="false" align="center"
<EF:EFColumn ename="fileName" cname="文件名称" width="160" enable="true" readonly="false" align="left"
required="true"/>
<EF:EFColumn ename="fileId" cname="文件号" width="100" enable="false" readonly="true" align="center"
required="false"/>
......
......@@ -52,14 +52,14 @@
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="200" required="true"
align="center" filter="contains" sort="true"/>
align="left" filter="contains" sort="true"/>
<EF:EFColumn ename="projName" cname="所属项目" width="160" enable="true" readonly="true" align="center"
required="true" hidden="true"/>
<EF:EFComboColumn ename="fileType" cname="文件类型" width="100" align="center" readonly="false" required="true"
defaultValue="20">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="fileName" cname="文件名称" width="160" enable="true" readonly="false" align="center"
<EF:EFColumn ename="fileName" cname="文件名称" width="160" enable="true" readonly="false" align="left"
required="true"/>
<EF:EFColumn ename="fileId" cname="文件号" width="100" enable="false" readonly="true" align="center"
required="false"/>
......
......@@ -98,7 +98,7 @@ $(function () {
const eNameValue = _data.ename;
setTreeNodeValue(_data);
$("[name = 'inqu_status-0-parentId']").val(labelValue);
$("[name = 'inqu_status-0-fileId']").val(eNameValue);
$("[name = 'inqu_status-0-fileId']").val(_data.id);
$("[name = 'inqu_status-0-leafLevel']").val(_data.leafLevel==null?0:_data.leafLevel);
$("[name = 'inqu_status-0-projCode']").val(_data.projCode);
$("[name = 'inqu_status-0-companyCode']").val(_data.companyCode);
......
......@@ -11,7 +11,7 @@
<EF:EFRegion title="文档目录树" id="tree" fitHeight="true">
<div id="menu" style="margin-top: 12px; margin-bottom: 8px">
<EF:EFTree bindId="docTree" ename="tree_name" textField="text" valueField="label"
hasChildren="leaf" pid="parentId" serviceName="HGWD001D" methodName="query"
hasChildren="leaf" pid="parentId" serviceName="HGWD001D" methodName="queryTree"
expandLevel="1">
</EF:EFTree>
</div>
......
......@@ -12,6 +12,7 @@ $(function () {
columns: [
{
field: "changeStartCode",
hidden: true,
template: function (item) {
let template = item["changeStartCode"]
if (item['changeType'] === "uploadAdd" || item['changeType'] === "uploadDelete") {
......
......@@ -44,9 +44,9 @@
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="projName" cname="项目名称" width="160" enable="true" readonly="false" align="left" required="false"/>
<EF:EFColumn ename="changeContent" cname="文件名称" width="160" enable="true" readonly="true" align="center" required="false"/>
<EF:EFColumn ename="changeStartCode" cname="附件ID" width="160" enable="true" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="changeStart" cname="附件名称" width="160" enable="true" readonly="true" align="center" required="false"/>
<EF:EFColumn ename="changeContent" cname="文件名称" width="160" enable="true" readonly="true" align="left" required="false"/>
<%--<EF:EFColumn ename="changeStartCode" cname="附件ID" width="160" enable="true" readonly="false" align="center" required="false"/>--%>
<EF:EFColumn ename="changeStart" cname="附件名称" width="160" enable="true" readonly="true" align="left" required="false"/>
<EF:EFColumn ename="createdName" cname="删除人" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn ename="createdTime" cname="删除时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
......
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