Commit fb391799 by 宋祥
parents 07cf3177 3154428c
......@@ -116,6 +116,15 @@ public class UserSessionUtils extends UserSession {
}
/**
* 获取登录用户的组织信息
*
* @return
*/
public static List<Org> getOrg() {
return HGXSTools.XsOrg.queryByUser();
}
/**
* 获取登录用户的公司编码
*
* @return
......
package com.baosight.hggp.hg.cg.constant;
/**
* @author:songx
* @date:2024/9/4,9:24
*/
public class HgCgSqlConst {
/**
*
* @author:songx
* @date:2024/9/4,11:22
*/
public class HgCg003 {
// 模块名称:HGCW003
private static final String MODULE_NAME = "HGCG003.";
// 修改状态
public static final String UPDATE_STATUS = MODULE_NAME + "updateStatus";
}
/**
* @author:songx
* @date:2024/8/30,16:25
*/
public class HgCg003A {
// 模块名称:HGCW003A
private static final String MODULE_NAME = "HGCG003A.";
//
public static final String QUERY_BY_QUALITY_TESTING = MODULE_NAME + "queryByQualityTesting";
// 修改数量
public static final String UPDATE_QTY = MODULE_NAME + "updateQty";
}
}
package com.baosight.hggp.hg.cg.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:Hgcg003a.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-09-04 9:15:38 create
*/
public class HGCG003B1 extends HGCG003B {
private static final long serialVersionUID = 1L;
public static final String FIELD_SUP_CODE = "supCode"; /* 供应商编码*/
public static final String FIELD_SUP_NAME = "supName"; /* 供应商名称*/
public static final String FIELD_PUR_USER_ID = "purUserId"; /* 采购员*/
public static final String FIELD_PUR_USER_NAME = "purUserName"; /* 采购员名称*/
public static final String FIELD_SOURCE = "source"; /* 数据来源 根据采购数据来源小代码 目前0默认采购合同,1手动录入*/
private String supCode = " "; /* 供应商编码*/
private String supName = " "; /* 供应商名称*/
private String purUserId = " "; /* 采购员*/
private String purUserName = " "; /* 采购员名称*/
private Integer source; /* 数据来源 根据采购数据来源小代码 目前0默认采购合同,1手动录入*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_SUP_CODE);
eiColumn.setDescName("供应商编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SUP_NAME);
eiColumn.setDescName("供应商名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PUR_USER_ID);
eiColumn.setDescName("采购员");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PUR_USER_NAME);
eiColumn.setDescName("采购员名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SOURCE);
eiColumn.setDescName("数据来源");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGCG003B1() {
super.initMetaData();
initMetaData();
}
public String getSupCode() {
return supCode;
}
public void setSupCode(String supCode) {
this.supCode = supCode;
}
public String getSupName() {
return supName;
}
public void setSupName(String supName) {
this.supName = supName;
}
public String getPurUserId() {
return purUserId;
}
public void setPurUserId(String purUserId) {
this.purUserId = purUserId;
}
public String getPurUserName() {
return purUserName;
}
public void setPurUserName(String purUserName) {
this.purUserName = purUserName;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
super.fromMap(map);
setSupCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUP_CODE)), supCode));
setSupName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SUP_NAME)), supName));
setPurUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PUR_USER_ID)), purUserId));
setPurUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PUR_USER_NAME)), purUserName));
setSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SOURCE)), source));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_SUP_CODE, StringUtils.toString(supCode, eiMetadata.getMeta(FIELD_SUP_CODE)));
map.put(FIELD_SUP_NAME, StringUtils.toString(supName, eiMetadata.getMeta(FIELD_SUP_NAME)));
map.put(FIELD_PUR_USER_ID, StringUtils.toString(purUserId, eiMetadata.getMeta(FIELD_PUR_USER_ID)));
map.put(FIELD_PUR_USER_NAME, StringUtils.toString(purUserName, eiMetadata.getMeta(FIELD_PUR_USER_NAME)));
map.put(FIELD_SOURCE, StringUtils.toString(source, eiMetadata.getMeta(FIELD_SOURCE)));
return map;
}
}
......@@ -5,6 +5,7 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.constant.HgCgSqlConst;
import com.baosight.hggp.hg.cg.domain.*;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
......@@ -343,7 +344,7 @@ public class ServiceHGCG003 extends ServiceBase {
hgcg003.fromMap(map);
HGCG003 old = HGCGTools.HgCg003.get(hgcg003.getId());
hgcg003.setReceiveNo(old.getReceiveNo());
DaoUtils.update(HGCG003.UPDATE_STATUS, hgcg003);
DaoUtils.update(HgCgSqlConst.HgCg003.UPDATE_STATUS, hgcg003);
this.putInStorageData(old);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
......
......@@ -153,18 +153,24 @@ public class ServiceHGCG003A extends ServiceBase {
fCg002B.setPurUnitWeight(bcReceiveWeight.divide(bcReceiveQty, 3, RoundingMode.HALF_UP));
}
// 含税总金额
BigDecimal amount;
BigDecimal taxIncludeAmount;
if (HgCgConst.CalculationMethod.S1.equals(fCg002B.getCalculationMethod())) {
amount = bcReceiveWeight.multiply(dbCg002b.getPrice());
taxIncludeAmount = bcReceiveWeight.multiply(dbCg002b.getPrice());
} else {
amount = bcReceiveQty.multiply(dbCg002b.getPrice());
taxIncludeAmount = bcReceiveQty.multiply(dbCg002b.getPrice());
}
// 如果税率不为空,总金额减去税
// 如果税率不为空,计算不含税金
if (dbCg002b.getTaxRate() != null) {
BigDecimal taxRate = dbCg002b.getTaxRate().multiply(new BigDecimal("0.01")).add(BigDecimal.ONE);
amount = amount.divide(taxRate, 2, RoundingMode.HALF_UP);
}
BigDecimal amount = taxIncludeAmount.divide(taxRate, 2, RoundingMode.HALF_UP);
BigDecimal taxAmount = taxIncludeAmount.subtract(amount);
fCg002B.setAmount(amount);
fCg002B.setTaxAmount(taxAmount);
} else {
fCg002B.setAmount(taxIncludeAmount);
fCg002B.setTaxAmount(BigDecimal.ZERO);
}
fCg002B.setTaxIncludeAmount(taxIncludeAmount);
}
}
......@@ -191,10 +197,13 @@ public class ServiceHGCG003A extends ServiceBase {
.reduce(BigDecimal.ZERO, BigDecimal::add);
newCg003.setReceiveWeight(receiveWeight);
newCg003.setReceiveUnitWeight(receiveWeight.divide(bcReceiveQtySum, 3, RoundingMode.HALF_UP));
// 计算收货总金额
BigDecimal receiveAmount = fCg002Bs.stream().map(HGCG002B::getAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
newCg003.setAmount(receiveAmount);
// 计算不含税总金额
newCg003.setAmount(fCg002Bs.stream().map(HGCG002B::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
// 计算含税总金额
newCg003.setTaxIncludeAmount(fCg002Bs.stream().map(HGCG002B::getTaxIncludeAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add));
// 计算总税额
newCg003.setTaxAmount(fCg002Bs.stream().map(HGCG002B::getTaxAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
newCg003.setStatus(HGConstant.CgReceiveStatus.S_0);
newCg003.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
newCg003.setSource(HGConstant.CgSource.DEFAULT);
......
......@@ -94,7 +94,7 @@ public class ServiceHGCG003B extends ServiceBase {
try {
List<HGCG003B> fCg003Bs = MapUtils.toDaoEPBases(inInfo, HGCG003B.class);
HGCG003 cg003 = HGCGTools.HgCg003.get(fCg003Bs.get(0).getPrimaryId());
if (cg003.getSource().intValue() == HGConstant.CgSource.DEFAULT) {
if (cg003.getSource() == HGConstant.CgSource.DEFAULT) {
// 采购收货DB数据
Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetDataEp(fCg003Bs);
// 采购合同DB数据
......
......@@ -38,14 +38,17 @@
DEPOSIT_QTY as "depositQty", <!-- 入库数量 -->
RECEIVE_UNIT_WEIGHT as "receiveUnitWeight", <!-- 收货单重 -->
RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额 -->
STATUS as "status", <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 -->
SOURCE as "source", <!-- 数据来源 根据采购数据来源小代码 目前默认0采购合同,1手工录入 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型明细 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额(不含税金额) -->
TAX_INCLUDE_AMOUNT as "taxIncludeAmount", <!-- 含税金额 -->
TAX_AMOUNT as "taxAmount", <!-- 税额 -->
TAX_RATE as "taxRate", <!-- 税率 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
IS_INVOICING as "isInvoicing", <!-- 是否开票 -->
SOURCE as "source", <!-- 数据来源 根据采购数据来源小代码 目前0默认采购合同,1手动录入 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
IS_INVOICING as "isInvoicing"
PROJ_NAME as "projName" <!-- 项目名称 -->
</sql>
<sql id="condition">
......@@ -183,7 +186,6 @@
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCG003 (
ID,
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
......@@ -211,23 +213,30 @@
WIDTH, <!-- 宽度 -->
THICK, <!-- 厚度 -->
RECEIVE_QTY, <!-- 收货数量 -->
DELIVER_QTY, <!-- 退货数量 -->
DEPOSIT_QTY, <!-- 入库数量 -->
RECEIVE_UNIT_WEIGHT, <!-- 收货单重 -->
RECEIVE_WEIGHT, <!-- 收货重量 -->
PRICE, <!-- 单价 -->
AMOUNT, <!-- 金额 -->
STATUS, <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 -->
INVENT_TYPE_DETAIL,
IS_INVOICING,
PRICE, <!-- 单价 -->
AMOUNT, <!-- 金额(不含税金额) -->
TAX_INCLUDE_AMOUNT, <!-- 含税金额 -->
TAX_AMOUNT, <!-- 税额 -->
TAX_RATE, <!-- 税率 -->
INVENT_TYPE_DETAIL, <!-- 存货类型大类 -->
IS_INVOICING, <!-- 是否开票 -->
SOURCE, <!-- 数据来源 根据采购数据来源小代码 目前0默认采购合同,1手动录入 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
SOURCE <!-- 数据来源 根据采购数据来源小代码 目前默认0采购合同,1手工录入 -->
PROJ_NAME <!-- 项目名称 -->
) VALUES (
#id#,#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #receiveDate#, #receiveNo#,
#planNo#, #contractNo#, #supCode#, #supName#, #purUserId#, #purUserName#,
#inventType#, #inventCode#, #inventName#, #specId#, #spec#, #material#,
#unit#, #length#, #width#, #thick#, #receiveQty#, #receiveUnitWeight#,
#receiveWeight#,#price#, #amount#, #status#,#inventTypeDetail#,#isInvoicing#,#projCode#,#projName#, #source#
#unit#, #length#, #width#, #thick#, #receiveQty#, #deliverQty#, #depositQty#,
#receiveUnitWeight#, #receiveWeight#, #status#, #price#, #amount#,
#taxIncludeAmount#, #taxAmount#, #taxRate#, #inventTypeDetail#, #isInvoicing#,
#source#, #projCode#, #projName#
)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCG003
......@@ -270,6 +279,9 @@
RECEIVE_QTY = #receiveQty#, <!-- 收货数量 -->
RECEIVE_WEIGHT = #receiveWeight#, <!-- 收货重量 -->
AMOUNT = #amount#, <!-- 金额 -->
TAX_INCLUDE_AMOUNT = #taxIncludeAmount#, <!-- 含税金额 -->
TAX_AMOUNT = #taxAmount#, <!-- 税额 -->
TAX_RATE = #taxRate#, <!-- 税率 -->
RECEIVE_DATE = REPLACE(#receiveDate#, '-', ''), <!-- 收货日期 -->
PROJ_CODE = #projCode#, <!-- 项目编号 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
......
......@@ -138,66 +138,65 @@ public class ServiceHGKC003 extends ServiceBase {
AssertUtils.isTrue(fKc003.getSubmitStatus().compareTo(HGConstant.ProductStatus.WTJ) == 0,"入库单"+fKc003.getDepositNo()+"未提交,请勿退回");
}
/**
* 修改提交状态
*
* @param inInfo
* @return
*/
public EiInfo updateSubmitStatus(EiInfo inInfo){
int i = 0;
public EiInfo updateSubmitStatus(EiInfo inInfo) {
try {
HGKC003 hgkc003 = new HGKC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgkc003.fromMap(map);
hgkc003 = HGKCTools.HgKc003.getId(hgkc003.getId());
//查看是否能获取到账期,获取不到就提示
HGCWTools.HgCw001.getAccountPeriod(hgkc003.getCompanyCode(),hgkc003.getDepositDate());
hgkc003.setSubmitStatus(HGConstant.ProductStatus.YTJ);
List<HGKC003> fKc003s = MapUtils.toDaoEPBases(inInfo, HGKC003.class);
for (HGKC003 fKc003 : fKc003s) {
HGKC003 dbKc003 = HGKCTools.HgKc003.getId(fKc003.getId());
// 查看是否能获取到账期,获取不到就提示
HGCWTools.HgCw001.getAccountPeriod(dbKc003.getCompanyCode(), dbKc003.getDepositDate());
dbKc003.setSubmitStatus(HGConstant.ProductStatus.YTJ);
// 校验数据
this.checkSubmitData(hgkc003);
DaoUtils.update(HGKC003.UPDATE_SUBMIT_STATUS, hgkc003);
//修改计划生产任务完工数量
HGSCTools.complete(hgkc003.getQualityId(),hgkc003.getInvQty().intValue(),hgkc003.getRectificationId(),HGConstant.StorageType.RK);
this.checkSubmitData(dbKc003);
DaoUtils.update(HGKC003.UPDATE_SUBMIT_STATUS, dbKc003);
// 修改计划生产任务完工数量
HGSCTools.complete(dbKc003.getQualityId(), dbKc003.getInvQty().intValue(), dbKc003.getRectificationId(),
HGConstant.StorageType.RK);
// 修改库存
HGKCUtils.HgKc010.updateInv(hgkc003.getCompanyCode(), hgkc003.getWhCode(), hgkc003.getPrdtCode(),
hgkc003.getInvQty(), hgkc003.getInvWeight());
HGKCUtils.HgKc010.updateInv(dbKc003.getCompanyCode(), dbKc003.getWhCode(), dbKc003.getPrdtCode(),
dbKc003.getInvQty(), dbKc003.getInvWeight());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "提交")});
inInfo.setMsg("提交成功!");
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
LogUtils.setMsg(inInfo, e, "提交失败");
}
return inInfo;
}
private void checkSubmitData(HGKC003 hgkc003) {
AssertUtils.isEmpty(hgkc003.getWhCode(),"仓库编码不能为空!");
AssertUtils.isEmpty(hgkc003.getWhName(),"仓库名称不能为空!");
AssertUtils.isNull(hgkc003.getPrice(),"单价不能为空!");
/**
* 数据校验
*
* @param dbKc003
*/
private void checkSubmitData(HGKC003 dbKc003) {
AssertUtils.isEmpty(dbKc003.getWhCode(), "仓库编码不能为空!");
AssertUtils.isEmpty(dbKc003.getWhName(), "仓库名称不能为空!");
AssertUtils.isNull(dbKc003.getPrice(), "单价不能为空!");
//判断是不是最前工序,如果不是得提示
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCode(hgkc003.getPrdtCode());
List<HGKC003> hgkc003List = HGKCTools.HgKc003.getByQualityId(hgkc003.getQualityId());
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByInventCode(dbKc003.getPrdtCode());
List<HGKC003> hgkc003List = HGKCTools.HgKc003.getByQualityId(dbKc003.getQualityId());
//当前提交的工序信息
HGPZ005A hgpz005AFilter = hgpz005AList.stream().filter(o->o.getInventCode().equals(hgkc003.getPrdtCode())).findAny().orElse(null);
AssertUtils.isNull(hgpz005AFilter,"此物料没有配置工序!");
for(HGKC003 entity : hgkc003List){
if(entity.getId().intValue() != hgkc003.getId().intValue()){
HGPZ005A hgpz005AFilter = hgpz005AList.stream().filter(o -> o.getInventCode().equals(dbKc003.getPrdtCode()))
.findAny().orElse(null);
AssertUtils.isNull(hgpz005AFilter, "此物料没有配置工序!");
for (HGKC003 entity : hgkc003List) {
if (entity.getId().intValue() != dbKc003.getId().intValue()) {
//遍历相同质检单的工序
HGPZ005A hgpz005A = hgpz005AList.stream().filter(o->o.getInventCode().equals(entity.getPrdtCode())).findAny().orElse(null);
HGPZ005A hgpz005A = hgpz005AList.stream().filter(o -> o.getInventCode().equals(entity.getPrdtCode()))
.findAny().orElse(null);
//如果未提交的生产单有比当前更靠前的工序,则需要提示
AssertUtils.isTrue(hgpz005A.getProcessOrder().compareTo(hgpz005AFilter.getProcessOrder()) < 0,hgpz005A.getInventCode()+"的工序“"+hgpz005A.getProcessName()+"“未提交,生产入库号为:"+entity.getDepositNo());
AssertUtils.isTrue(hgpz005A.getProcessOrder().compareTo(hgpz005AFilter.getProcessOrder()) < 0,
hgpz005A.getInventCode() + "的工序“" + hgpz005A.getProcessName() + "“未提交,生产入库号为:"
+ entity.getDepositNo());
}
}
}
/**
......
......@@ -21,4 +21,10 @@ public class HgScSqlConstant {
// 修改项目名称
public static final String UPDATE_PROJ_NAME = "HGSC001.updateProjName";
}
public static class HgSc007 {
//app 查询生产任务
public static final String QUERY_APP = "HGSC007.queryApp";
}
}
......@@ -66,6 +66,9 @@ public class HGSC007 extends DaoEPBase {
public static final String FIELD_updated_time = "updatedTime"; /* 更新时间*/
public static final String FIELD_spec = "spec"; /* 规格*/
public static final String FIELD_length = "length"; /* 长*/
public static final String FIELD_IS_COMPLTE = "isComplete";
public static final String FIELD_TASK_QUANTITY = "taskQuantity";
public static final String FIELD_UN_TASK_QUANTITY = "unTaskQuantity";
public static final String COL_id = "id";
......@@ -165,6 +168,9 @@ public class HGSC007 extends DaoEPBase {
private String updatedTime = " "; /* 更新时间*/
private String spec = " "; /* 规格*/
private BigDecimal length = new BigDecimal("0"); /* 长*/
private Integer isComplete = new Integer(0); /* 是否完工 0-未报工 1-部分报工 2-已报工*/
private BigDecimal taskQuantity = new BigDecimal("0");
private BigDecimal unTaskQuantity = new BigDecimal("0");
/**
......@@ -361,6 +367,18 @@ public class HGSC007 extends DaoEPBase {
eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_IS_COMPLTE);
eiColumn.setDescName("报工状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TASK_QUANTITY);
eiColumn.setDescName("报工数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UN_TASK_QUANTITY);
eiColumn.setDescName("待报工数量");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -1043,6 +1061,30 @@ public class HGSC007 extends DaoEPBase {
this.length = length;
}
public Integer getIsComplete() {
return isComplete;
}
public void setIsComplete(Integer isComplete) {
this.isComplete = isComplete;
}
public BigDecimal getTaskQuantity() {
return taskQuantity;
}
public void setTaskQuantity(BigDecimal taskQuantity) {
this.taskQuantity = taskQuantity;
}
public BigDecimal getUnTaskQuantity() {
return unTaskQuantity;
}
public void setUnTaskQuantity(BigDecimal unTaskQuantity) {
this.unTaskQuantity = unTaskQuantity;
}
/**
* get the value from Map.
*
......@@ -1094,6 +1136,9 @@ public class HGSC007 extends DaoEPBase {
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_time)), updatedTime));
setSpec(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_spec)), spec));
setLength(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_length)), length));
setIsComplete(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_IS_COMPLTE)), isComplete));
setTaskQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TASK_QUANTITY)), taskQuantity));
setUnTaskQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UN_TASK_QUANTITY)), unTaskQuantity));
}
......@@ -1147,6 +1192,9 @@ public class HGSC007 extends DaoEPBase {
map.put(FIELD_updated_time, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_updated_time)));
map.put(FIELD_spec, StringUtils.toString(spec, eiMetadata.getMeta(FIELD_spec)));
map.put(FIELD_length, StringUtils.toString(length, eiMetadata.getMeta(FIELD_length)));
map.put(FIELD_IS_COMPLTE, StringUtils.toString(isComplete, eiMetadata.getMeta(FIELD_IS_COMPLTE)));
map.put(FIELD_TASK_QUANTITY, StringUtils.toString(taskQuantity, eiMetadata.getMeta(FIELD_TASK_QUANTITY)));
map.put(FIELD_UN_TASK_QUANTITY, StringUtils.toString(unTaskQuantity, eiMetadata.getMeta(FIELD_UN_TASK_QUANTITY)));
return map;
}
......
......@@ -21,37 +21,56 @@ import java.util.*;
*/
public class ServiceHGSC005A extends ServiceBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划详情", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
String planCode = inInfo.getCellStr(EiConstant.queryBlock,0,HGSC005A.FIELD_plan_code);
String planCode = inInfo.getCellStr(EiConstant.queryBlock, 0, HGSC005A.FIELD_plan_code);
HGSC005 hgsc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
inInfo.setCell(EiConstant.queryBlock,0,HGSC005.FIELD_is_schedule,hgsc005.getIsSchedule());
inInfo.setCell(EiConstant.queryBlock, 0, HGSC005.FIELD_is_schedule, hgsc005.getIsSchedule());
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC005A().eiMetadata);
// inInfo = super.query(inInfo, HGSC005A.QUERY, new HGSC005A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PLAN_PROCESS_BLOCK_ID), new HashMap<String, Object>(){{
put(HGSC005A.FIELD_plan_code,planCode);
}},false);
CommonMethod.comboBoxDefaultValue(inInfo,DdynamicEnum.PLAN_PROCESS_BLOCK_ID.getBlockId(),"全部");
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PLAN_PROCESS_BLOCK_ID),
new HashMap<String, Object>() {{
put(HGSC005A.FIELD_plan_code, planCode);
}}, false);
CommonMethod.comboBoxDefaultValue(inInfo, DdynamicEnum.PLAN_PROCESS_BLOCK_ID.getBlockId(), "全部");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 修改数据
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划详情", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC005A.QUERY, new HGSC005A());
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("查询成功!");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 修改数据
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划详情", operType = "保存", operDesc = "保存计划详情")
public EiInfo update(EiInfo inInfo){
public EiInfo update(EiInfo inInfo) {
try {
List<HGSC005A> hgsc005AList = MapUtils.toDaoEPBases(inInfo, HGSC005A.class);
// 数据校验
......@@ -74,31 +93,38 @@ public class ServiceHGSC005A extends ServiceBase {
}
private void checkSaveData(List<HGSC005A> hgsc005AList) {
AssertUtils.isEmpty(hgsc005AList,"保存数据为空,请勾选后修改保存!");
AssertUtils.isEmpty(hgsc005AList.get(0).getPlanCode(),"生产计划详情数据异常,请联系管理员!");
AssertUtils.isEmpty(hgsc005AList, "保存数据为空,请勾选后修改保存!");
AssertUtils.isEmpty(hgsc005AList.get(0).getPlanCode(), "生产计划详情数据异常,请联系管理员!");
HGSC005 hgsc005 = HGSCTools.THGSC005.queryByPlanCode(hgsc005AList.get(0).getPlanCode());
AssertUtils.isTrue(Objects.isNull(hgsc005.getCommitStatus()),"生产计划状态异常,请联系管理员!");
AssertUtils.isTrue(Objects.isNull(hgsc005.getCommitStatus()), "生产计划状态异常,请联系管理员!");
AssertUtils.isTrue(hgsc005.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0)>0,"生产计划已提交,不可修改!");
AssertUtils.isTrue(hgsc005.getCommitStatus().compareTo(CommonConstant.YesNo.NO_0) > 0, "生产计划已提交,不可修改!");
for (HGSC005A hgsc005a : hgsc005AList) {
AssertUtils.isEmpty(hgsc005a.getPlanStartDate(), String.format("产品[%s]计划开工日期为空!", hgsc005a.getProductName()));
AssertUtils.isEmpty(hgsc005a.getPlanStartDate(),
String.format("产品[%s]计划开工日期为空!", hgsc005a.getProductName()));
AssertUtils.isEmpty(hgsc005a.getPlanEndDate(), String.format("产品[%s]计划完工日期为空!", hgsc005a.getProductName()));
AssertUtils.isTrue(DateUtil.toDate(hgsc005a.getPlanEndDate(),DateUtil.DATE10_PATTERN).compareTo(
DateUtil.toDate(hgsc005a.getPlanStartDate(),DateUtil.DATE10_PATTERN))<0,String.format("产品[%s]计划完工日期不能大于开工日期!", hgsc005a.getProductName()));
AssertUtils.isTrue(DateUtil.toDate(hgsc005a.getPlanEndDate(), DateUtil.DATE10_PATTERN).compareTo(
DateUtil.toDate(hgsc005a.getPlanStartDate(), DateUtil.DATE10_PATTERN)) < 0,
String.format("产品[%s]计划完工日期不能大于开工日期!", hgsc005a.getProductName()));
}
}
/**
* 排产
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产计划详情", operType = "排产", operDesc = "排产")
public EiInfo schedule(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String planCode = MapUtils.getString(queryMap, "planCode");
HGSC005 hgsc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
this.checkScheduleData(hgsc005);
HGSC005 dbSc005 = HGSCTools.THGSC005.queryByPlanCode(planCode);
this.checkScheduleData(dbSc005);
int count = HGSCTools.THGSC005A.schedule(planCode);
hgsc005.setIsSchedule(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSC005.UPDATE,hgsc005);
dbSc005.setIsSchedule(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGSC005.UPDATE, dbSc005);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + count + "]条数据排产成功!");
......@@ -108,8 +134,13 @@ public class ServiceHGSC005A extends ServiceBase {
return inInfo;
}
private void checkScheduleData(HGSC005 hgsc005) {
AssertUtils.isTrue(hgsc005.getIsSchedule().compareTo(CommonConstant.YesNo.YES_1)==0,"当前计划已排产,请手动调整计划!");
/**
* 排产校验数据
*
* @param dbSc005
*/
private void checkScheduleData(HGSC005 dbSc005) {
// AssertUtils.isEquals(hgsc005.getIsSchedule(), CommonConstant.YesNo.YES_1, "当前计划已排产,请手动调整计划!");
}
}
}
......@@ -7,6 +7,7 @@ import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.util.HgScUtils;
import com.baosight.hggp.hg.xs.domain.Company;
......@@ -272,4 +273,20 @@ public class ServiceHGSC007 extends ServiceEPBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询", operDesc = "APP查询")
public EiInfo queryApp(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String creatTime = MapUtils.getString(queryMap, HGSC007.FIELD_created_time);
if (StringUtils.isNotBlank(creatTime)) {
queryMap.put(HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime));
}
// 仅查询自己所在组的任务 added by songx at 20240820
HgScUtils.HgSc007.setOrgCondition(queryMap);
inInfo = super.query(inInfo, HgScSqlConstant.HgSc007.QUERY_APP, new HGSC007());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
......@@ -980,22 +980,30 @@ public class HGSCTools {
return result;
}
//存货档案单位转换(米)
private final static BigDecimal unitConver = new BigDecimal(1000);
//基础工时
private final static BigDecimal baseWorkHour = new BigDecimal(8);
private final static Integer finishDateDiffDay = new Integer(-3);
/**
* 校验修改的数据
*
* @param hgsc005a
*/
private static void checkUpdateData(HGSC005A hgsc005a) {
AssertUtils.isTrue(Objects.isNull(hgsc005a.getMatId())||hgsc005a.getMatId()<=0, "物料清单ID不能为空!");
AssertUtils.isTrue(Objects.isNull(hgsc005a.getMatDetailId())||hgsc005a.getMatDetailId()<=0, "物料清单明细ID不能为空!");
AssertUtils.isTrue(Objects.isNull(hgsc005a.getMatId()) || hgsc005a.getMatId() <= 0, "物料清单ID不能为空!");
AssertUtils.isTrue(Objects.isNull(hgsc005a.getMatDetailId()) || hgsc005a.getMatDetailId() <= 0,
"物料清单明细ID不能为空!");
AssertUtils.isEmpty(hgsc005a.getProductCode(), "产品编码不能为空!");
AssertUtils.isEmpty(hgsc005a.getProductName(), "产品名称不能为空!");
AssertUtils.isTrue(Objects.isNull(hgsc005a.getTechFlowId())||hgsc005a.getTechFlowId()<=0, "工艺流程ID不能为空!");
AssertUtils.isTrue(Objects.isNull(hgsc005a.getQuantity())||hgsc005a.getQuantity()<=0, "数量不能为空!");
AssertUtils.isTrue(Objects.isNull(hgsc005a.getTechFlowId()) || hgsc005a.getTechFlowId() <= 0,
"工艺流程ID不能为空!");
AssertUtils.isTrue(Objects.isNull(hgsc005a.getQuantity()) || hgsc005a.getQuantity() <= 0, "数量不能为空!");
}
public static List<HGSC005A> constructObj(List<HGSC005A> hgsc005aList,HGSC005 hgsc005){
hgsc005aList.forEach(hgsc005a->{
public static List<HGSC005A> constructObj(List<HGSC005A> hgsc005aList, HGSC005 hgsc005) {
hgsc005aList.forEach(hgsc005a -> {
hgsc005a.setPlanCode(hgsc005.getPlanCode());
hgsc005a.setCompanyCode(hgsc005.getCompanyCode());
hgsc005a.setCompanyName(hgsc005.getCompanyName());
......@@ -1011,7 +1019,7 @@ public class HGSCTools {
return hgsc005aList;
}
public static HGSC005A constructObj(HGSC005A hgsc005a){
public static HGSC005A constructObj(HGSC005A hgsc005a) {
HGSC005 hgsc005 = THGSC005.queryByMatId(hgsc005a.getMatId());
hgsc005a.setPlanCode(hgsc005.getPlanCode());
hgsc005a.setCompanyCode(hgsc005.getCompanyCode());
......@@ -1027,44 +1035,51 @@ public class HGSCTools {
return hgsc005a;
}
//存货档案单位转换(米)
private final static BigDecimal unitConver = new BigDecimal(1000);
//基础工时
private final static BigDecimal baseWorkHour = new BigDecimal(8);
private final static Integer finishDateDiffDay = new Integer(-3);
/**
* 排产
*
* @param planCode
* @return
*/
public static int schedule(String planCode) {
List<HGSC005A> hgsc005AList = queryByPlanCode(planCode);
// hgsc005AList.sort(Comparator.comparing(HGSC005A::getProductType).thenComparing(HGSC005A::getProcessOrder,Comparator.reverseOrder()));
//通过工序编码查询工序设置
List<String> processCodes = hgsc005AList.stream().map(HGSC005A::getProcessCode).collect(Collectors.toList());
List<String> processCodes = hgsc005AList.stream().map(HGSC005A::getProcessCode)
.collect(Collectors.toList());
List<HGSJ001> hgsj001List = HGSJTools.Hgsj001.queryByProcessCodes(processCodes);
//通过产品编码查询存货档案
List<String> productCodes = hgsc005AList.stream().map(HGSC005A::getProductCode).collect(Collectors.toList());
List<String> productCodes = hgsc005AList.stream().map(HGSC005A::getProductCode)
.collect(Collectors.toList());
List<HGPZ005> hgpz005List = HGPZTools.HgPz005.listByInventCodes(productCodes);
//通过存货档案工序ID查询存货档案工序
List<Long> inventProcessIds = hgsc005AList.stream().map(HGSC005A::getInventProcessId).collect(Collectors.toList());
List<Long> inventProcessIds = hgsc005AList.stream().map(HGSC005A::getInventProcessId)
.collect(Collectors.toList());
List<HGPZ005A> hgpz005AList = HGPZTools.HgPz005A.queryByIds(inventProcessIds);
//筛选计划构建,并按产品分组
Map<String,List<HGSC005A>> strctMap = hgsc005AList.stream().filter(o->o.getProductType().compareTo(ProductTypeEnum.STRUCT.getCode())==0).collect(Collectors.groupingBy(HGSC005A::getProductCode));
List<HGSC005A> partList = hgsc005AList.stream().filter(o->o.getProductType().compareTo(ProductTypeEnum.PART.getCode())==0).collect(Collectors.toList());
Map<String, List<HGSC005A>> strctMap = hgsc005AList.stream()
.filter(o -> o.getProductType().compareTo(ProductTypeEnum.STRUCT.getCode()) == 0)
.collect(Collectors.groupingBy(HGSC005A::getProductCode));
List<HGSC005A> partList = hgsc005AList.stream()
.filter(o -> o.getProductType().compareTo(ProductTypeEnum.PART.getCode()) == 0)
.collect(Collectors.toList());
String minDate = "";
BigDecimal remainder = new BigDecimal(0);
for (String key : strctMap.keySet()) {
String endDate = "";
for(HGSC005A planInfo : strctMap.get(key)){
remainder = calculateWordHour(planInfo,hgsj001List,hgpz005List,hgpz005AList,endDate,remainder);
if(StringUtils.isBlank(minDate)){
for (HGSC005A planInfo : strctMap.get(key)) {
remainder = calculateWordHour(planInfo, hgsj001List, hgpz005List, hgpz005AList, endDate, remainder);
if (StringUtils.isBlank(minDate)) {
minDate = planInfo.getPlanStartDate();
}else{
minDate = DateUtil.toDate(planInfo.getPlanStartDate(),DateUtil.DATE10_PATTERN).compareTo(DateUtil.toDate(minDate,DateUtil.DATE10_PATTERN)) <=0?planInfo.getPlanStartDate():minDate;
} else {
minDate = DateUtil.toDate(planInfo.getPlanStartDate(), DateUtil.DATE10_PATTERN)
.compareTo(DateUtil.toDate(minDate, DateUtil.DATE10_PATTERN)) <= 0
? planInfo.getPlanStartDate() : minDate;
}
DaoUtils.update(HGSC005A.UPDATE,planInfo);
DaoUtils.update(HGSC005A.UPDATE, planInfo);
}
}
for(HGSC005A planInfo : partList){
for (HGSC005A planInfo : partList) {
remainder = calculateWordHour(planInfo,hgsj001List,hgpz005List,hgpz005AList,minDate,remainder);
minDate = DateUtil.toDate(planInfo.getPlanStartDate(),DateUtil.DATE10_PATTERN).compareTo(DateUtil.toDate(minDate,DateUtil.DATE10_PATTERN)) <=0?planInfo.getPlanStartDate():minDate;
DaoUtils.update(HGSC005A.UPDATE,planInfo);
......
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("当前用户未绑定组织机构,无法操作数据,请联系管理员!");
}
}
......
......@@ -21,6 +21,18 @@ public class HgWdSqlConstant {
}
/**
* @author:songx
* @date:2024/9/3,10:57
*/
public static class HgWd003 {
// 模块
public static final String MODULE = "HGWD003.";
// 修改信息
public static final String UPDATE_INFO = MODULE + "updateInfo";
}
/**
* HGCW999 SQL定义
*
* @author:songx
......
......@@ -42,6 +42,7 @@ public class HGWD001A extends DaoEPBase {
public static final String FIELD_CHANGE_END_CODE = "changeEndCode"; /* 变更后编码*/
public static final String FIELD_CHANGE_END = "changeEnd"; /* 变更后*/
public static final String FIELD_MAT_ID = "matId"; /* 上级ID*/
public static final String FIELD_ACCE_ID = "acceId"; /* 上级ID*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -92,6 +93,7 @@ public class HGWD001A extends DaoEPBase {
private String changeEndCode = " "; /* 变更后编码*/
private String changeEnd = " "; /* 变更后*/
private Long matId = new Long(0);
private String acceId = " ";
/**
* initialize the metadata.
......@@ -184,6 +186,10 @@ public class HGWD001A extends DaoEPBase {
eiColumn.setDescName("上级ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCE_ID);
eiColumn.setDescName("附件ID");
eiMetadata.addMeta(eiColumn);
}
......@@ -507,6 +513,14 @@ public class HGWD001A extends DaoEPBase {
this.changeEndCode = changeEndCode;
}
public String getAcceId() {
return acceId;
}
public void setAcceId(String acceId) {
this.acceId = acceId;
}
/**
* get the value from Map.
*
......@@ -536,6 +550,7 @@ public class HGWD001A extends DaoEPBase {
setChangeEndCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_END_CODE)), changeEndCode));
setChangeEnd(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_END)), changeEnd));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MAT_ID)), matId));
setAcceId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCE_ID)), acceId));
}
/**
......@@ -566,6 +581,7 @@ public class HGWD001A extends DaoEPBase {
map.put(FIELD_CHANGE_END_CODE, StringUtils.toString(changeEndCode, eiMetadata.getMeta(FIELD_CHANGE_END_CODE)));
map.put(FIELD_CHANGE_END, StringUtils.toString(changeEnd, eiMetadata.getMeta(FIELD_CHANGE_END)));
map.put(FIELD_MAT_ID, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_MAT_ID)));
map.put(FIELD_ACCE_ID, StringUtils.toString(acceId, eiMetadata.getMeta(FIELD_ACCE_ID)));
return map;
}
......
......@@ -47,6 +47,7 @@ public class HGWD002 extends DaoEPBase {
public static final String FIELD_RELEASE_DATE = "releaseDate"; /* 发布时间*/
public static final String FIELD_PREVIEW_NUM = "previewNum"; /* 预览次数*/
public static final String FIELD_DOWNLOAD_NUM = "downloadNum"; /* 下载次数*/
public static final String FIELD_DOC_TYPE = "docType"; /* 文件类型*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -105,6 +106,7 @@ public class HGWD002 extends DaoEPBase {
private String releaseDate = " "; /* 发布时间*/
private Integer previewNum = new Integer(0); /* 预览次数*/
private Integer downloadNum = new Integer(0); /* 下载次数*/
private String docType = " "; /* 文件类型*/
/**
* initialize the metadata.
......@@ -213,7 +215,9 @@ public class HGWD002 extends DaoEPBase {
eiColumn.setDescName("下载次数");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_TYPE);
eiColumn.setDescName("文件类型");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -623,6 +627,14 @@ public class HGWD002 extends DaoEPBase {
public void setDownloadNum(Integer downloadNum) {
this.downloadNum = downloadNum;
}
public String getDocType() {
return docType;
}
public void setDocType(String docType) {
this.docType = docType;
}
/**
* get the value from Map.
*
......@@ -656,6 +668,7 @@ public class HGWD002 extends DaoEPBase {
setReleaseDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RELEASE_DATE)), releaseDate));
setPreviewNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PREVIEW_NUM)), previewNum));
setDownloadNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOWNLOAD_NUM)), downloadNum));
setDocType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_TYPE)), docType));
}
/**
......@@ -690,6 +703,7 @@ public class HGWD002 extends DaoEPBase {
map.put(FIELD_RELEASE_DATE, StringUtils.toString(releaseDate, eiMetadata.getMeta(FIELD_RELEASE_DATE)));
map.put(FIELD_PREVIEW_NUM, StringUtils.toString(previewNum, eiMetadata.getMeta(FIELD_PREVIEW_NUM)));
map.put(FIELD_DOWNLOAD_NUM, StringUtils.toString(downloadNum, eiMetadata.getMeta(FIELD_DOWNLOAD_NUM)));
map.put(FIELD_DOC_TYPE, StringUtils.toString(docType, eiMetadata.getMeta(FIELD_DOC_TYPE)));
return map;
}
......
......@@ -36,6 +36,7 @@ public class HGWD003 extends DaoEPBase {
public static final String FIELD_USER_ID = "userId"; /* 用户ID*/
public static final String FIELD_USER_NAME = "userName"; /* 用户姓名*/
public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_IS_PROJECT_MANAGER = "isProjectManager"; /* 是否项目经理,0=否,1=是*/
public static final String FIELD_ORG_ID = "orgId"; /* 部门编码*/
public static final String FIELD_ORG_CNAME = "orgCname"; /* 部门名称*/
......@@ -53,6 +54,7 @@ public class HGWD003 extends DaoEPBase {
public static final String COL_USER_ID = "USER_ID"; /* 用户ID*/
public static final String COL_USER_NAME = "USER_NAME"; /* 用户姓名*/
public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_IS_PROJECT_MANAGER = "IS_PROJECT_MANAGER"; /* 是否项目经理,0=否,1=是*/
public static final String COL_ORG_ID = "ORG_ID"; /* 部门编码*/
public static final String COL_ORG_CNAME = "ORG_CNAME"; /* 部门名称*/
......@@ -76,6 +78,7 @@ public class HGWD003 extends DaoEPBase {
private String userId = " "; /* 用户ID*/
private String userName = " "; /* 用户姓名*/
private String remark = " "; /* 备注*/
private Integer isProjectManager = 0; /* 是否项目经理,0=否,1=是*/
private String orgId = " "; /* 部门编码*/
private String orgCname = " "; /* 部门名称*/
......@@ -142,6 +145,10 @@ public class HGWD003 extends DaoEPBase {
eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_IS_PROJECT_MANAGER);
eiColumn.setDescName("是否项目经理");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ORG_ID);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
......@@ -377,6 +384,14 @@ public class HGWD003 extends DaoEPBase {
this.remark = remark;
}
public Integer getIsProjectManager() {
return isProjectManager;
}
public void setIsProjectManager(Integer isProjectManager) {
this.isProjectManager = isProjectManager;
}
public String getOrgId() {
return orgId;
}
......@@ -415,6 +430,7 @@ public class HGWD003 extends DaoEPBase {
setUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_USER_ID)), userId));
setUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_USER_NAME)), userName));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setIsProjectManager(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_IS_PROJECT_MANAGER)), isProjectManager));
setOrgId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_ID)), orgId));
setOrgCname(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ORG_CNAME)), orgCname));
}
......@@ -440,6 +456,7 @@ public class HGWD003 extends DaoEPBase {
map.put(FIELD_USER_ID, StringUtils.toString(userId, eiMetadata.getMeta(FIELD_USER_ID)));
map.put(FIELD_USER_NAME, StringUtils.toString(userName, eiMetadata.getMeta(FIELD_USER_NAME)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_IS_PROJECT_MANAGER, StringUtils.toString(isProjectManager, eiMetadata.getMeta(FIELD_IS_PROJECT_MANAGER)));
map.put(FIELD_ORG_ID, StringUtils.toString(orgId, eiMetadata.getMeta(FIELD_ORG_ID)));
map.put(FIELD_ORG_CNAME, StringUtils.toString(orgCname, eiMetadata.getMeta(FIELD_ORG_CNAME)));
......
......@@ -36,6 +36,7 @@ public class HGWD099 extends DaoEPBase {
public static final String FIELD_DOWNLOAD_NUM = "downloadNum"; /* 下载次数*/
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 COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
......@@ -61,6 +62,7 @@ public class HGWD099 extends DaoEPBase {
public static final String UPDATE = "HGWD099.update";
public static final String DELETE = "HGWD099.delete";
public static final String DELETE_DOC_ID = "HGWD099.deleteDocId";
public static final String DELETE_ID = "HGWD099.deleteId";
private Long id = new Long(0);
......@@ -82,6 +84,7 @@ public class HGWD099 extends DaoEPBase {
private Integer downloadNum = new Integer(0); /* 下载次数*/
private String releaseDate = " "; /* 发布时间*/
private Integer docVersion = new Integer(0); /* 文件版本号*/
private String docType = " "; /* 文件类型*/
/**
* initialize the metadata.
......@@ -166,6 +169,9 @@ public class HGWD099 extends DaoEPBase {
eiColumn.setDescName("发布时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_TYPE);
eiColumn.setDescName("文件类型");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -457,6 +463,14 @@ public class HGWD099 extends DaoEPBase {
this.docVersion = docVersion;
}
public String getDocType() {
return docType;
}
public void setDocType(String docType) {
this.docType = docType;
}
/**
* get the value from Map.
*
......@@ -484,6 +498,7 @@ public class HGWD099 extends DaoEPBase {
setDownloadNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOWNLOAD_NUM)), downloadNum));
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));
}
/**
......@@ -512,6 +527,7 @@ public class HGWD099 extends DaoEPBase {
map.put(FIELD_DOWNLOAD_NUM, StringUtils.toString(downloadNum, eiMetadata.getMeta(FIELD_DOWNLOAD_NUM)));
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)));
return map;
}
......
......@@ -56,6 +56,7 @@ public class ServiceHGWD002 extends ServiceBase {
// 仅查询已发布的文件
queryRow.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, User.FIELD_USER_ID, UserSessionUtils.getUserId());
builder(inInfo);
inInfo = super.query(inInfo, HGWD002.QUERY, new HGWD002());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......@@ -63,4 +64,68 @@ public class ServiceHGWD002 extends ServiceBase {
return inInfo;
}
public void builder(EiInfo eiInfo){
String[] orderBy = eiInfo.getBlock(EiConstant.resultBlock).getString("orderBy").split(",");
if (orderBy.length>0){
StringBuilder orderByStr= new StringBuilder();
for (int i = 0; i < orderBy.length; i++) {
if (i != 0 && i != orderByStr.length() - 1) {
orderByStr.append(",");
}
switch (orderBy[i]) {
case "fileType asc":
orderByStr.append(orderBy[i].replace("fileType asc", "a.fileType asc"));
break;
case "docId asc":
orderByStr.append(orderBy[i].replace("docId asc", "b.docId asc"));
break;
case "docName asc":
orderByStr.append(orderBy[i].replace("docName asc", "b.docName asc"));
break;
case "docVersion asc":
orderByStr.append(orderBy[i].replace("docVersion asc", "b.docVersion asc"));
break;
case "createdTime asc":
orderByStr.append(orderBy[i].replace("createdTime asc", "b.createdTime asc"));
break;
case "previewNum asc":
orderByStr.append(orderBy[i].replace("previewNum asc", "b.previewNum asc"));
break;
case "downloadNum asc":
orderByStr.append(orderBy[i].replace("downloadNum asc", "b.downloadNum asc"));
break;
case "fileType desc":
orderByStr.append(orderBy[i].replace("fileType desc", "a.fileType desc"));
break;
case "docId desc":
orderByStr.append(orderBy[i].replace("docId desc", "b.docId desc"));
break;
case "docName desc":
orderByStr.append(orderBy[i].replace("docName desc", "b.docName desc"));
break;
case "docVersion desc":
orderByStr.append(orderBy[i].replace("docVersion desc", "b.docVersion desc"));
break;
case "createdTime desc":
orderByStr.append(orderBy[i].replace("createdTime desc", "b.createdTime desc"));
break;
case "previewNum desc":
orderByStr.append(orderBy[i].replace("previewNum desc", "b.previewNum desc"));
break;
case "downloadNum desc":
orderByStr.append(orderBy[i].replace("downloadNum desc", "b.downloadNum desc"));
break;
default:
if (!orderBy[i].isEmpty()){
orderByStr.append(orderBy[i]);
}else {
orderByStr.append(orderBy[i]);
}
break;
}
}
eiInfo.getBlock(EiConstant.resultBlock).set("orderBy",orderByStr);
}
}
}
......@@ -222,6 +222,32 @@ public class ServiceHGWD003 extends ServiceEPBase {
}
/**
* 保存
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "文档权限", operType = "保存", operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
// 获取FILE_ID
String fileId = MapUtils.getString(queryMap, HGWD003.FIELD_FILE_ID);
AssertUtils.isEmpty(fileId, "请选择目录");
List<HGWD003> fWd003s = MapUtils.toDaoEPBases(inInfo, HGWD003.class);
for (HGWD003 fWd003 : fWd003s) {
DaoUtils.update(HgWdSqlConstant.HgWd003.UPDATE_INFO, fWd003);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fWd003s.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 设置叶子节点是否可以展开
*
* @param nodes
......
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.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
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.hggp.util.ObjectUtils;
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 org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGWD003B 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 HGWD001().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, HGWD001.QUERY, new HGWD001());
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询节点失败");
}
return inInfo;
}
/**
* 复制用户
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "文档权限", operType = "保存", operDesc = "操作")
public EiInfo copyUser(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
// 获取FILE_ID信息
String mainFileId = MapUtils.getString(queryMap, "mainFileId");
HGWD001 dbWd001 = HGWDTools.HgWd001.get(mainFileId);
AssertUtils.isNull(dbWd001, String.format("【%s】文档目录不存在", mainFileId));
// 获取FILE_ID授权信息
List<HGWD003> dbMainWd003s = HGWDTools.HgWd003.listByFile(mainFileId);
AssertUtils.isEmpty(dbMainWd003s, String.format("文档目录【%s】还未进行授权,请授权后再进行复制", dbWd001.getFileName()));
// 复制授权信息
List<HGWD001> fWd001s = MapUtils.toDaoEPBases(inInfo, HGWD001.class);
this.copyAuthUser(fWd001s, dbMainWd003s);
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("复制授权用户成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "复制授权用户失败");
}
return inInfo;
}
/**
* 复制授权用户
*
* @param fWd001s
* @param dbMainWd003s
*/
private void copyAuthUser(List<HGWD001> fWd001s, List<HGWD003> dbMainWd003s) {
// 已授权信息
Map<String, List<HGWD003>> dbWd003Map = HGWDTools.HgWd003.map(
ObjectUtils.listEpKey(fWd001s, HGWD001.FIELD_FILE_ID));
for (HGWD001 fWd001 : fWd001s) {
String fileId = fWd001.getFileId();
// 已存在的授权用户信息
List<HGWD003> dbWd003s = dbWd003Map == null ? null : dbWd003Map.get(fileId);
List<String> userIds = CollectionUtils.isEmpty(dbWd003s) ? new ArrayList<>()
: dbWd003Map.get(fileId).stream().map(HGWD003::getUserId).collect(Collectors.toList());
// 过滤出未授权的用户,并重新赋值FILE_ID
List<HGWD003> filterWd003s = dbMainWd003s.stream()
.filter(dbMainWd003 -> !userIds.contains(dbMainWd003.getUserId()))
.map(dbMainWd003 -> {
dbMainWd003.setFileId(fWd001.getFileId());
return dbMainWd003;
}).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(filterWd003s)) {
DaoUtils.insertBatch(HGWD003.INSERT, filterWd003s);
}
}
}
}
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.ChangeTypeEnum;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD099;
......@@ -16,7 +15,6 @@ import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -29,6 +27,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author LiuYang
......@@ -73,19 +72,29 @@ public class ServiceHGWD004 extends ServiceEPBase {
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
List<HGWD099> hgwd099s =DaoBase.getInstance().query(HGWD099.QUERY,
new HashMap<String,Object>(){{
put(HGWD099.FIELD_DELETE_FLAG, Arrays.asList(CommonConstant.YesNo.NO_0,CommonConstant.YesNo.YES_1));
}}
);
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.fromMap(map);
Iplat4jUtils.deleteFileByDocId(hgwd001a.getChangeStartCode()); //删除物理附件
String docId = hgwd001a.getChangeType().equals(ChangeTypeEnum.UPLOAD_UPDATE.getCode()) ? hgwd001a.getChangeStartCode() : hgwd001a.getChangeEndCode();
List<HGWD099> cw099List = hgwd099s.stream().filter(hgwd099 -> hgwd099.getDocId().equals(docId)).collect(Collectors.toList());
if (cw099List.size() <= 1){
//删除物理附件
Iplat4jUtils.deleteFileByDocId(docId);
}
//删除附件详情
DaoUtils.update(HGWD099.DELETE_DOC_ID,
new HashMap<String,String>(){{
put(HGWD099.FIELD_DOC_ID, hgwd001a.getChangeStartCode());
}}
);
DaoUtils.update(HGWD001A.DELETE, hgwd001a); //删除变更记录
if (hgwd001a.getChangeType().equals(ChangeTypeEnum.UPLOAD_DELETE.getCode())) {
DaoUtils.update(HGWD099.DELETE_ID, new HashMap<String,String>(){{put(HGWD099.FIELD_ID, hgwd001a.getAcceId());}});
}
//删除变更记录
DaoUtils.update(HGWD001A.DELETE, hgwd001a);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
......
......@@ -3,12 +3,17 @@ package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.ChangeTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.extapp.decheng.api.DcOpenApi;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.xs.domain.User;
......@@ -18,11 +23,11 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
......@@ -84,6 +89,7 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgdm099.fromMap(resultRow);
hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGWD099.INSERT, hgdm099);
//项目文件
HGWD001 hgwd001 =HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A();
......@@ -101,6 +107,8 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
}
interaction(hgwd001,hgdm099.getDocName());
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
......@@ -137,6 +145,7 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeEndCode(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId());
hgwd001a.setAcceId(hgdm099.getId().toString());
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
......@@ -150,4 +159,31 @@ public class ServiceHGWD099 extends ServiceEPBase {
}
return inInfo;
}
/**
* 附件上传通知
* @param hgwd001 待变更的项目名称
* @param newName 变更后附件名称
*/
public void interaction(HGWD001 hgwd001,String newName){
try {
if (Objects.nonNull(hgwd001)){
List<HGWD003> listByFile = HGWDTools.HgWd003.listByFile(hgwd001.getFileId()); //获取文件下的权限人员
//当前登录用户是否是设计人员,是设计人员则通知项目经理
List<HGWD003> hgwd003s = listByFile.stream().filter(hgwd003 -> hgwd003.getUserId().equals(UserSessionUtils.getUserId()) && hgwd003.getIsProjectManager() == 0).collect(Collectors.toList());
if (hgwd003s.size()>0){
HGPZ009 hgpz009 = HGPZTools.HgPz009.getByCode(hgwd001.getAccountCode());
List<String> userIds = listByFile.stream().filter(hgwd003 -> hgwd003.getIsProjectManager() == 1).map(hgwd003 -> hgwd003.getUserId().replace(hgpz009.getLoginPrefix(),"")).distinct().collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(userIds)){
DcOpenApi.interactionAdd(
String.format("[%s]项目上传附件请审核发布", hgwd001.getProjName()),
String.format("上传附件名称[%s]",newName),String.join(",",userIds));
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
......@@ -111,7 +111,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
PROJ_CODE DESC, ID DESC
</isEmpty>
</dynamic>
</sql>
......@@ -232,6 +232,7 @@
RELEASE_DATE = #releaseDate#, <!--发布时间-->
DOC_VERSION = DOC_VERSION + 1, <!--版本号-->
STATUS = #status#, <!-- 状态 -->
REMARK = #remark#, <!-- 备注 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
......
......@@ -89,6 +89,9 @@
<isNotEmpty prepend=" AND " property="matId">
MAT_ID = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="acceId">
ACCE_ID = #acceId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -114,7 +117,8 @@
CHANGE_START as "changeStart", <!-- 变更前 -->
CHANGE_END_CODE as "changeEndCode",
CHANGE_END as "changeEnd", <!-- 变更后 -->
MAT_ID as "matId"
MAT_ID as "matId",
ACCE_ID as "acceId"
FROM ${hggpSchema}.HGWD001A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
......@@ -211,21 +215,20 @@
CHANGE_START, <!-- 变更前 -->
CHANGE_END_CODE,
CHANGE_END, <!-- 变更后 -->
MAT_ID
MAT_ID,
ACCE_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #changeType#,
#changeContent#, #changeStartCode#, #changeStart#, #changeEndCode#, #changeEnd#,#matId#)
#changeContent#, #changeStartCode#, #changeStart#, #changeEndCode#, #changeEnd#, #matId#, #acceId#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGWD001A WHERE
ID = #id#
DELETE FROM ${hggpSchema}.HGWD001A WHERE ID = #id#
</delete>
<delete id="deleteMatId">
DELETE FROM ${hggpSchema}.HGWD001A WHERE
MAT_ID = #matId#
DELETE FROM ${hggpSchema}.HGWD001A WHERE MAT_ID = #matId#
</delete>
<update id="update">
......@@ -250,7 +253,8 @@
CHANGE_START = #changeStart#, <!-- 变更前 -->
CHANGE_END_CODE as #changeEndCode#,
CHANGE_END = #changeEnd#, <!-- 变更后 -->
MAT_ID = #matId#
MAT_ID = #matId#,
ACCE_ID = #acceId#
WHERE
ID = #id#
</update>
......@@ -278,7 +282,8 @@
CHANGE_START as "changeStart", <!-- 变更前 -->
CHANGE_END_CODE as "changeEndCode",
CHANGE_END as "changeEnd", <!-- 变更后 -->
MAT_ID as "matId"
MAT_ID as "matId",
ACCE_ID as "acceId"
FROM ${hggpSchema}.HGWD001A WHERE 1=1 and CHANGE_TYPE IN ('uploadUpdate','uploadDelete')
<include refid="BaseCondition.createdTimeCondition"/>
<include refid="condition" />
......
......@@ -17,8 +17,12 @@
B.RELEASE_DATE as "releaseDate", <!-- 发布时间 -->
B.DOC_ID as "docId", <!-- 文件号 -->
B.DOC_NAME as "docName", <!-- 文件附件名称 -->
B.DOC_TYPE as "docType", <!-- 文件类型 -->
B.PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
B.DOWNLOAD_NUM as "downloadNum" <!-- 下载次数 -->
B.DOWNLOAD_NUM as "downloadNum", <!-- 下载次数 -->
B.CREATED_BY as "createdBy", <!-- 创建人 -->
B.CREATED_NAME as "createdName", <!-- 创建人名称 -->
B.CREATED_TIME as "createdTime" <!-- 创建时间 -->
</sql>
<sql id="condition">
......@@ -45,7 +49,7 @@
A.FILE_NAME LIKE CONCAT('%', #fileName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
A.STATUS = #status#
B.STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
B.DOC_ID = #docId#
......@@ -56,6 +60,12 @@
<isNotEmpty prepend=" AND " property="parentId">
B.BIZ_ID IN (select FILE_ID from ${hggpSchema}.hgwd003 where USER_ID = #userId# and FILE_ID = #parentId# )
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
LEFT(B.CREATED_TIME,8) = replace(#createdTime#,'-','')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docType">
B.DOC_TYPE = #docType#
</isNotEmpty>
</sql>
<sql id="orderBy">
......
......@@ -15,7 +15,8 @@
A.DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
A.FILE_ID as "fileId", <!-- 文件ID -->
A.USER_ID as "userId", <!-- 用户ID -->
A.REMARK as "remark" <!-- 备注 -->
A.REMARK as "remark", <!-- 备注 -->
A.IS_PROJECT_MANAGER as "isProjectManager" <!-- 是否项目经理,0=否,1=是 -->
</sql>
<sql id="columnB">
......@@ -41,6 +42,9 @@
<isNotEmpty prepend=" AND " property="userId">
A.USER_ID LIKE CONCAT('%', #userId#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileIds">
A.FILE_ID IN <iterate close=")" open="(" conjunction="," property="fileIds">#fileIds[]#</iterate>
</isNotEmpty>
</sql>
<sql id="conditionB">
......@@ -115,4 +119,13 @@
UPDATE ${hggpSchema}.HGWD003 SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
<!-- 修改信息 -->
<update id="updateInfo">
UPDATE ${hggpSchema}.HGWD003
SET
IS_PROJECT_MANAGER = #isProjectManager#,
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
......@@ -16,6 +16,7 @@
BIZ_ID as "bizId", <!-- 业务ID -->
DOC_ID as "docId", <!-- 文件ID -->
DOC_NAME as "docName", <!-- 文件名称 -->
DOC_TYPE as "docType", <!-- 文件类型 -->
STATUS as "status",
PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
DOWNLOAD_NUM as "downloadNum", <!-- 下载次数 -->
......@@ -24,7 +25,6 @@
</sql>
<sql id="condition">
AND DELETE_FLAG = '0'
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......@@ -41,6 +41,9 @@
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docType">
DOC_TYPE = #docType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
......@@ -53,6 +56,12 @@
<isNotEmpty prepend=" AND " property="parentId">
BIZ_ID = #parentId#
</isNotEmpty>
<isEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = 0
</isEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG in <iterate close=")" open="(" conjunction="," property="deleteFlag">#deleteFlag[]#</iterate>
</isNotEmpty>
</sql>
<sql id="customCondition">
......@@ -107,12 +116,13 @@
BIZ_ID, <!-- 业务ID -->
DOC_ID, <!-- 文件ID -->
DOC_NAME, <!-- 文件名称 -->
DOC_TYPE, <!-- 文件名称 -->
STATUS,
DOC_VERSION,
RELEASE_DATE
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #status#, #docVersion#, #releaseDate#
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #docType#, #status#, #docVersion#, #releaseDate#
)
</insert>
......@@ -132,11 +142,16 @@
DELETE FROM ${hggpSchema}.HGWD099 WHERE DOC_ID = #docId#
</delete>
<delete id="deleteId">
DELETE FROM ${hggpSchema}.HGWD099 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGWD099
SET
DOC_ID = #docId#, <!-- 文件ID -->
DOC_NAME = #docName#, <!-- 文件名称 -->
DOC_TYPE = #docType#, <!-- 文件类型 -->
STATUS = #status#,
DOC_VERSION = DOC_VERSION + 1, <!--版本号-->
RELEASE_DATE = #releaseDate#, <!--发布时间-->
......
......@@ -11,6 +11,7 @@ import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.MapUtils;
......@@ -40,12 +41,11 @@ public class HGWDTools {
* @return
*/
public static HGWD001 get(String fileId) {
//AssertUtils.isEmpty(fileId, "文件ID不能为空");
AssertUtils.isEmpty(fileId, "文件ID不能为空");
Map queryMap = new HashMap();
if (fileId != null) {
queryMap.put(HGWD001.FIELD_FILE_ID, fileId);
}
List<HGWD001> results = DaoBase.getInstance().query(HGWD001.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
......@@ -63,6 +63,29 @@ public class HGWDTools {
}
/**
* @param fileIds
* @return
*/
public static List<HGWD001> list(List<String> fileIds) {
AssertUtils.isEmpty(fileIds, "文件ID不能为空");
Map queryMap = new HashMap();
queryMap.put("fileIds", fileIds);
return DaoBase.getInstance().query(HGWD001.QUERY, queryMap);
}
/**
* @param fileIds
* @return
*/
public static Map<String, HGWD001> map(List<String> fileIds) {
List<HGWD001> dbWd001s = list(fileIds);
if (CollectionUtils.isEmpty(dbWd001s)) {
return null;
}
return dbWd001s.stream().collect(Collectors.toMap(HGWD001::getFileId, item -> item));
}
/**
* 根据父节点统计
*
* @param parentIds
......@@ -136,6 +159,49 @@ public class HGWDTools {
}
}
/**
* HGWD003 定义
*
* @author:songx
* @date:2024/9/3,10:14
*/
public static class HgWd003 {
/**
* @param fileId
* @return
*/
public static List<HGWD003> listByFile(String fileId) {
AssertUtils.isEmpty(fileId, "文件ID不能为空");
Map queryMap = new HashMap();
queryMap.put(HGWD003.FIELD_FILE_ID, fileId);
return DaoBase.getInstance().query(HGWD003.QUERY, queryMap);
}
/**
* @param fileIds
* @return
*/
public static List<HGWD003> list(List<String> fileIds) {
AssertUtils.isEmpty(fileIds, "文件ID不能为空");
Map queryMap = new HashMap();
queryMap.put("fileIds", fileIds);
return DaoBase.getInstance().query(HGWD003.QUERY, queryMap);
}
/**
* @param fileIds
* @return
*/
public static Map<String, List<HGWD003>> map(List<String> fileIds) {
List<HGWD003> dbWd001s = list(fileIds);
if (CollectionUtils.isEmpty(dbWd001s)) {
return null;
}
return dbWd001s.stream().collect(Collectors.groupingBy(HGWD003::getFileId));
}
}
public static class HgWd099 {
......
......@@ -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>
......
......@@ -4,11 +4,14 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cg.constant.HgCgSqlConst;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.cg.domain.HGCG003B1;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
......@@ -49,7 +52,7 @@ public class ServiceHGZL001B extends ServiceEPBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003().eiMetadata);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003B1().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -67,9 +70,9 @@ public class ServiceHGZL001B extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGCG003B.FIELD_SOURCE, HGConstant.CgSource.DEFAULT);
queryMap.put(HGCG003.FIELD_SOURCE, HGConstant.CgSource.DEFAULT);
queryMap.put(HGCG003B.FIELD_STATUS, HGConstant.CgReceiveStatus.S_0);
inInfo = super.query(inInfo, HGCG003B.QUERY_BY_QUALITY_TESTING, new HGCG003B());
inInfo = super.query(inInfo, HgCgSqlConst.HgCg003A.QUERY_BY_QUALITY_TESTING, new HGCG003B1());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......
......@@ -75,6 +75,10 @@
sumType="page"/>
<EF:EFColumn ename="amount" cname="金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<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']"/>
......
......@@ -56,8 +56,15 @@
<EF:EFCodeOption codeName="hggp.cg.calculationMethod"/>
</EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:C3}" required="true"/>
<EF:EFComboColumn ename="taxRate" cname="税率(%)" width="100" align="center" required="true" copy="true">
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFComboColumn>
<EF:EFColumn ename="amount" cname="金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.receiveStatus"/>
</EF:EFComboColumn>
......
let whNameGlobalData = [];
$(function () {
IPLATUI.EFGrid.result = {
......@@ -7,8 +7,7 @@ $(function () {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [
{
columns: [{
field: "operator",
title: "操作",
template: function (item) {
......@@ -146,27 +145,17 @@ function updateSubmitStatus(id) {
JSUtils.confirm("确定提交此生产入库单吗? ", {
ok: function () {
EiCommunicator.send('HGKC003', 'updateSubmitStatus', inEiInfo, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
onSuccess: function (res) {
message(res.msg);
if (res.status > -1) {
query();
} catch (e) {
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
}
);
});
}
});
......
......@@ -19,24 +19,26 @@
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="69vh">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" width="140" enable="false" readonly="false"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" width="80" enable="false" align="center"/>
<EF:EFColumn ename="qualityId" cname="质检单id" enable="false" width="90" align="center" hidden="true"/>
<EF:EFColumn ename="rectificationId" cname="整改通知单ID" enable="false" width="90" align="center" hidden="true"/>
<EF:EFComboColumn cname="入库类型" ename="storageType" width="90" align="center" required="false" enable="false" readonly="false" >
<EF:EFCodeOption codeName="hggp.kc.storageType" />
<EF:EFColumn ename="rectificationId" cname="整改通知单ID" enable="false" width="90" align="center"
hidden="true"/>
<EF:EFComboColumn cname="入库类型" ename="storageType" width="90" align="center" required="false" enable="false"
readonly="false">
<EF:EFCodeOption codeName="hggp.kc.storageType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="200" align="left"/>
<EF:EFColumn ename="projCode" cname="项目编号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="left"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="whName" cname="仓库名称" hidden="true"/>
<EF:EFColumn ename="depositDate" cname="单据日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="depositNo" cname="生产入库单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="depositNoOld" cname="历史生产入库单号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="depositNoOld" cname="历史生产入库单号" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="prdtType" cname="存货类型" width="120" align="center" required="false"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
......
......@@ -48,9 +48,11 @@
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/>
<EF:EFColumn ename="invUnitWeight" cname="单重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="库存总重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="库存总重(KG)" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
......
......@@ -37,18 +37,14 @@ $(window).load(function () {
query();
});
/**
* 排产
*/
function schedule() {
var planCode = $("#inqu_status-0-planCode").val();
var isSchedule = $("#inqu_status-0-isSchedule").val();
if(isSchedule&&isSchedule==='1'){
message("当前计划已排产,请手动调整计划!");
return;
}else {
var inInfo = new EiInfo();
inInfo.set("inqu_status-0-planCode", planCode);
IPLAT.confirm({
title: '提交',
message: '自动排产将覆盖原排产数据,且只能执行一次,请谨慎操作,确认对当前数据进行排产?',
message: '自动排产将覆盖原排产数据,请谨慎操作,确认对当前数据进行排产?',
okFn: function () {
var inInfo = new EiInfo();
inInfo.set("inqu_status-0-planCode", planCode);
......@@ -69,5 +65,4 @@ function schedule() {
});
}
});
}
}
......@@ -33,23 +33,28 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="productCode" cname="产品编码" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="productName" cname="产品名称" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="processName" cname="工序" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="finishDate" cname="交货日期" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="productCode" cname="产品编码" enable="false" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="productName" cname="产品名称" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="processName" cname="工序" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="finishDate" cname="交货日期" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="planStartDate" cname="计划开工日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFColumn ename="planEndDate" cname="计划完工日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFColumn ename="singleWeight" cname="单重(KG)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="totalWeight" cname="计划重量(KG)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="finishWeight" cname="完成重量(KG)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="unfinishWeight" cname="未完成重量(KG)" format="{0:0.00}" editType="text" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="quantity" cname="计划数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="finishQuantity" cname="完成数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="unfinishQuantity" cname="未完成数量" width="120" enable="true" align="center" readOnly="true"/>
<EF:EFColumn ename="singleWeight" cname="单重(KG)" format="{0:0.00}" editType="text" width="120" enable="true"
align="center" readonly="true"/>
<EF:EFColumn ename="totalWeight" cname="计划重量(KG)" format="{0:0.00}" editType="text" width="120"
enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="finishWeight" cname="完成重量(KG)" format="{0:0.00}" editType="text" width="120"
enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="unfinishWeight" cname="未完成重量(KG)" format="{0:0.00}" editType="text" width="120"
enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="quantity" cname="计划数量" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="finishQuantity" cname="完成数量" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="unfinishQuantity" cname="未完成数量" width="120" enable="true" align="center"
readonly="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -15,6 +15,9 @@ $(function () {
$("#QUERY").on("click", function (e) {
resultGrid.dataSource.page(1);
});
$("#QUERY1").on("click", function (e) {
result1Grid.dataSource.page(1);
});
// 分割线组件
(function () {
splitter = $("#splitter").kendoSplitter({
......@@ -89,7 +92,6 @@ $(function () {
}
init();
$("#QUERY").on("click", query);
IPLATUI.EFTree = {
"categoryTree": {
select: function (e) {
......@@ -471,9 +473,53 @@ $(function () {
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
//发布
$("#RELEASE").click("click",updateRelease);
$("#RELEASE").click("click",function () {
var rows = resultGrid.getCheckedRows();
let flat = 1;
if (rows.length == 0) {
message("请先勾选要发布的数据!");
return;
}
$.each(rows, function (i, row){
if (row.status == 1){
message("选中的第"+(i+1)+"行\"已发布\",不能重复发布!");
flat = 0;
return;
}
})
if (flat){
let parentId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId;
let inEiInfo = new EiInfo();
inEiInfo.set("inqu_status-0-fileId", parentId);
//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
});
}
});
//变更记录
$("#CHANGE_RECORD").on("click", changeResord);
// 复制附件
$("#COPY_FILE").on("click", copyFile);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
......@@ -494,6 +540,13 @@ $(function () {
}
}
],
},
result1:{
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
}
}
};
......@@ -501,6 +554,9 @@ $(function () {
// 查询
$("#BTN_DELETE").on("click", deleteFunc);
$("#SAVE1").on("click", saveFunc);
//确认发布
$("#confirmRelease").on("click", updateRelease);
});
let query = function () {
......@@ -862,6 +918,7 @@ function uploadFileCallback(data) {
inEiInfo.set("result-0-bizId", data.bizId);
inEiInfo.set("result-0-docId", data.docId);
inEiInfo.set("result-0-docName", data.docName);
inEiInfo.set("result-0-docType", data.docType);
inEiInfo.set("result-0-bizType", data.bizType);
inEiInfo.set("result-0-ndocId", data.ndocId);
let serviceName = data.operType == "add" ? "HGWD099" : "HGWD001";
......@@ -910,11 +967,18 @@ function updateRelease() {
message("请选择数据");
return;
}
let changeContent = $("#inqu_status-0-changeContent").val();
if (isBlank(changeContent)){
message("请输入变更内容");
return;
}
let inEiInfo = new EiInfo();
inEiInfo.addBlock(JSUtils.checkedRows2Block("result"))
inEiInfo.addBlock(JSUtils.checkedRows2Block("result"));
inEiInfo.set("inqu_status-0-changeContent", changeContent);
EiCommunicator.send('HGWD001', 'updateRelease', inEiInfo, {
onSuccess(response) {
if (response.status != -1) {
$("#releaseWindow").data("kendoWindow").close()
NotificationUtil(response.msg);
query();
} else {
......@@ -935,16 +999,41 @@ function updateRelease() {
*/
let showAuthButton = function () {
let leafType = IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel;
let parentId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId;
// C:目录
if (leafType && leafType >0) {
$("#RELEASE").attr("disabled", false);
$("#UPLOAD_FILE").attr("disabled", false);
$("#CHANGE_RECORD").attr("disabled", true);
$("#COPY_FILE").attr("disabled", false);
} else {
$("#RELEASE").attr("disabled", true);
$("#UPLOAD_FILE").attr("disabled", true);
$("#CHANGE_RECORD").attr("disabled", false);
$("#COPY_FILE").attr("disabled", true);
}
let inEiInfo = new EiInfo();
inEiInfo.set("inqu_status-0-fileId", parentId);
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 > 0 && rows[0].isProjectManager == "1"){
$("#RELEASE").attr("disabled", false);
}else {
$("#RELEASE").attr("disabled", true);
}
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
......@@ -967,3 +1056,55 @@ function changeResord() {
callbackName: uploadFileCallback
});
}
/**
* 复制文件
*/
let copyFile = function () {
let rowsDate = resultGrid.getCheckedRows();
if (rowsDate.length < 1){
message("请选择数据");
return;
}
let selectOrgWindow = $("#selectOrgWindow");
selectOrgWindow.data("kendoWindow").center();
selectOrgWindow.data("kendoWindow").open();
result1Grid.dataSource.page(1);
}
/**
* 复制附件
*/
function saveFunc() {
var rows = result1Grid.getCheckedRows();
if (rows.length == 0) {
message("请勾选数据文件!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据\"确认\"操作?", {
ok: function () {
JSUtils.submitGridsData("result,result1", "HGWD001", "save1", true,
function (ei) {
if (ei.getStatus() >= 0) {
try {
$("#selectOrgWindow").data("kendoWindow").close()
$("#inqu_status1-0-companyCode").val('');
$("#inqu_status1-0-projName").val('');
$("#inqu_status1-0-fileType").val('');
$("#inqu_status1-0-fileName").val('');
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
});
}
})
}
\ No newline at end of file
......@@ -4,10 +4,10 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
String userId = UserSession.getUserId();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<c:set var="loginName" value="<%=userId%>" />
<script type="text/javascript" src="${ctx}/common/js/dayjs.min.js"></script>
<EF:EFPage title="文档库">
......@@ -59,6 +59,7 @@
<EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库名称" ename="fileName" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="父级Id" ename="orgParentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="登录用户" ename="userId" blockId="inqu_status" row="0" colWidth="3" value="${loginName}" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden" value="WD"/>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
</div>
......@@ -81,7 +82,7 @@
</EF:EFPage>
<EF:EFWindow id="deleteOrgWindow" width="350px" height="200px">
<EF:EFWindow id="deleteOrgWindow" width="350px" height="165px">
<div class="kendo-del-message">
<span>确认删除?</span>
</div>
......@@ -92,3 +93,59 @@
</div>
</EF:EFWindow>
<EF:EFWindow id="selectOrgWindow" width="70%" height="70%" title="选择文档">
<EF:EFRegion id="inqu1" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status1" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status1" row="0" ename="projName" cname="项目名称" colWidth="3" placeholder="模糊查询项目名称"/>
<EF:EFSelect blockId="inqu_status1" row="0" ename="fileType" cname="文件类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status1" row="0" ename="fileName" cname="文件名称" colWidth="3" placeholder="模糊查询文件名称"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result1" title="明细信息" >
<EF:EFGrid blockId="result1" autoDraw="override" isFloat="true" checkMode="row" queryMethod="query1">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="parentId" cname="上级ID" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="160" required="true"
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"
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"/>
<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"
required="true"/>
<EF:EFColumn ename="fileId" cname="文件号" width="100" enable="false" readonly="true" align="center"
required="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFWindow>
<EF:EFWindow id="releaseWindow" title="发布变更" width="50%" height="30%">
<EF:EFRegion id="inqu2" title="">
<EF:EFInput blockId="inqu_status" row="0" ename="changeContent" cname="变更内容" type="textarea" colWidth="12" ratio="2:10" required="true"/>
</EF:EFRegion>
<div style="display: flex;justify-content: flex-end;">
<EF:EFButton ename="confirmRelease" cname="确认发布"/>
</div>
</EF:EFWindow>
......@@ -10,11 +10,16 @@
<EF:EFInput cname="文件ID" ename="fileId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<EF:EFInput cname="附件ID" ename="docId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFInput cname="公司名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="文件名称" ename="fileName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFSelect cname="文件类型" ename="fileType" blockId="inqu_status" row="0" colWidth="3" optionLabel=""
defultValue="" readonly="true">
<EF:EFInput cname="公司名称" ename="companyName" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
readonly="true"/>
</div>
<div class="row">
<EF:EFInput cname="文件名称" ename="fileName" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
readonly="true"/>
<EF:EFSelect cname="文件类型" ename="fileType" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
optionLabel="" defultValue="" readonly="true">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFSelect>
</div>
......
......@@ -10,11 +10,16 @@
<EF:EFInput cname="文件ID" ename="fileId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<EF:EFInput cname="附件ID" ename="docId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFInput cname="公司名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="文件名称" ename="fileName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFSelect cname="文件类型" ename="fileType" blockId="inqu_status" row="0" colWidth="3" optionLabel=""
defultValue="" readonly="true">
<EF:EFInput cname="公司名称" ename="companyName" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
readonly="true"/>
</div>
<div class="row">
<EF:EFInput cname="文件名称" ename="fileName" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
readonly="true"/>
<EF:EFSelect cname="文件类型" ename="fileType" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
optionLabel="" defultValue="" readonly="true">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFSelect>
</div>
......
......@@ -180,7 +180,15 @@ $(function () {
}, {
field: "docVersion",
template: function (model) {
return "V" + model.docVersion;
return "v" + model.docVersion;
}
}, {
field: "docType",
template: function (row) {
if (!isBlank(row.docType) && row.docType.startsWith(".")) {
return row.docType.substring(1);
}
return row.docType == null ? "" : row.docType;
}
}],
loadComplete: function (grid) {
......
......@@ -11,8 +11,8 @@
<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="query"
expandLevel="1">
</EF:EFTree>
</div>
</EF:EFRegion>
......@@ -28,20 +28,35 @@
<EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库名称" ename="fileName" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden" value="WD"/>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect blockId="inqu_status" row="0" ename="fileType" cname="文件分类" colWidth="3"
filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFSelect>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="createdTime" cname="上传时间" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="no" personal="true" queryMethod="query">
<EF:EFGrid blockId="result" autoDraw="override" queryMethod="query" sort="setted">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="fileId" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="previewNum" cname="预览次数" enable="false" width="100" align="right"/>
<EF:EFColumn ename="downloadNum" cname="下载次数" enable="false" width="100" align="right"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="200" align="center" sort="false"
hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="140" align="center" sort="false"/>
<EF:EFComboColumn ename="fileType" cname="文件分类" enable="false" width="90" align="center">
<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="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"
required="false" enable="false" sort="true"/>
<EF:EFColumn ename="previewNum" cname="预览次数" enable="false" width="100" align="right" sort="true"/>
<EF:EFColumn ename="downloadNum" cname="下载次数" enable="false" width="100" align="right" sort="true"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
......
......@@ -33,7 +33,8 @@ $(function () {
break;
}
return '<span class="' + icon + '" style="padding-right: 8px"> </span>'
+ '<span class="titleClass" title="' + item.label + '">' + item.text + '</span>'
+ '<span class="titleClass" title="' + item.label + '">'
+ item.text + '</span>'
},
selectNode: {
treeId: '',
......@@ -58,12 +59,17 @@ $(function () {
// 查询
$("#QUERY").on("click", query);
// 保存
$("#SAVE").on("click", save);
// 授权
$("#AUTH").on("click", auth);
// 删除
// 删除用户
$("#REMOVE_USER").on("click", removeUser);
// 复制用户
$("#COPY_USER").on("click", copyUser);
});
/**
......@@ -132,14 +138,34 @@ function expandTreeNode(tree, nodes) {
}
/**
* 保存
*/
let save = function () {
if (!checkSelectMain()) {
return;
}
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD003", "save", true, function (res) {
message(res.msg);
});
}
});
}
/**
* 授权
*/
let auth = function () {
let fileId = $("#inqu_status-0-fileId").val();
if (isBlank(fileId)) {
message("请选择需要授权的目录");
if (!checkSelectMain()) {
return;
}
let fileId = $("#inqu_status-0-fileId").val();
let fileName = $("#inqu_status-0-fileName").val();
let params = {
"inqu_status-0-fileId": fileId
......@@ -166,12 +192,15 @@ let authCallback = function (res) {
* 删除授权用户
*/
let removeUser = function () {
if (!checkSelectMain()) {
return;
}
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"取消授权用户\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD003", "removeUser",
false, function (res) {
......@@ -186,6 +215,34 @@ let removeUser = function () {
}
/**
* 复制授权用户
*/
let copyUser = function () {
if (!checkSelectMain()) {
return;
}
let fileId = $("#inqu_status-0-fileId").val();
let fileName = $("#inqu_status-0-fileName").val();
let params = {
"inqu_status-0-mainFileId": fileId
}
JSColorbox.open({
href: "HGWD003B",
title: "<div style='text-align: center;'>正在复制:【" + fileName + "】的授权用户...</div>",
width: "70%",
height: "80%",
params: params,
callbackName: copyUserCallback
});
}
/**
* 授权回调
*/
let copyUserCallback = function (res) {
}
/**
* 显示授权按钮
*/
let showAuthButton = function () {
......@@ -194,8 +251,24 @@ let showAuthButton = function () {
if (leafType && leafType === 'C') {
$("#AUTH").attr("disabled", false);
$("#REMOVE_USER").attr("disabled", false);
$("#COPY_USER").attr("disabled", false);
$("#SAVE").attr("disabled", false);
} else {
$("#AUTH").attr("disabled", true);
$("#REMOVE_USER").attr("disabled", true);
$("#COPY_USER").attr("disabled", true);
$("#SAVE").attr("disabled", true);
}
}
/**
* 校验是否选择的目录
*/
let checkSelectMain = function () {
let fileId = $("#inqu_status-0-fileId").val();
if (isBlank(fileId)) {
message("请选择需要目录");
return false;
}
return true;
}
......@@ -41,6 +41,10 @@
<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:EFComboColumn ename="isProjectManager" cname="是否项目经理" width="100" align="center"
required="true" copy="true">
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFComboColumn>
<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']"/>
......
......@@ -3,6 +3,10 @@ $(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100, 150],
},
loadComplete: function (grid) {
}
}
......
......@@ -15,8 +15,8 @@
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<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"/>
......
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100, 150],
},
loadComplete: function (grid) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 复制用户
$("#COPY_USER").on("click", copyUser);
});
/**
* 页面加载
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 复制用户
*/
let copyUser = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"复制\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD003B", "copyUser",
false, function (res) {
message(res.msg);
if (res.status !== -1) {
parent.JSColorbox.setValueCallback(res);
}
}
);
}
});
}
<!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="查询条件">
<EF:EFInput ename="mainFileId" cname="文件ID" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput ename="projName" cname="项目名称" blockId="inqu_status" row="0" colWidth="4"/>
<EF:EFInput ename="fileName" 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="fileId" cname="目录ID" hidden="true" primaryKey="true"/>
<EF:EFColumn ename="projCode" cname="项目编号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="120" align="left"/>
<EF:EFColumn ename="fileName" cname="目录名称" enable="false" width="120" align="left"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -14,10 +14,19 @@ $(function () {
field: "changeStartCode",
template: function (item) {
let template = item["changeStartCode"]
/*if (item.changeType == "uploadAdd" || item.changeType == "uploadDelete" || item.changeType == "uploadUpdate") {
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.changeStartCode) + '" target="_blank">'+item.changeStart+'</a>';
}*/
if (item['changeType'] === "uploadAdd" || item['changeType'] === "uploadDelete") {
template = item['changeEndCode'];
}
return template;
}
},
{
field: "changeStart",
template: function (item) {
let template = item["changeStart"]
if (item['changeType'] === "uploadAdd" || item['changeType'] === "uploadDelete") {
template = item['changeEnd'];
}
return template;
}
}
......
......@@ -17,6 +17,7 @@ $(function () {
var data = {
docId: docId,
docName: e.response.docName,
docType: e.response.docType,
bizId: matId,
bizType: bizType,
operType: operType,
......
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