Commit 00a480c0 by liuyang

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

parents 12d5cfc4 51b8d56f
......@@ -216,8 +216,6 @@ public class ServiceHGCG002 extends ServiceBase {
HGCGTools.HgCg001A.updateStatus(hgcg002B.getPlanDetailId(), HGConstant.CgPlanStatus.S_2);
}
}
}
/**
......@@ -256,16 +254,17 @@ public class ServiceHGCG002 extends ServiceBase {
String contractNo = fCg002.getContractNo();
HGCG002 dbCg002 = dbCg002AMap.get(contractNo);
AssertUtils.isNull(dbCg002, String.format("合同[%s]不存在", contractNo));
AssertUtils.isTrue(StringUtils.isBlank(fCg002.getSupName()), String.format("合同[%s]供应商为空", contractNo));
AssertUtils.isTrue(StringUtils.isBlank(fCg002.getPurUserName()), String.format("合同[%s]采购员为空", contractNo));
AssertUtils.isEmpty(dbCg002.getSupName(), String.format("合同[%s]供应商为空", contractNo));
AssertUtils.isEmpty(dbCg002.getPurUserName(), String.format("合同[%s]采购员为空", contractNo));
AssertUtils.isNotEquals(HGConstant.CgContractStatus.S_0, dbCg002.getStatus(),
String.format("合同[%s]状态不是\"待审核\",不允许操作", contractNo));
AssertUtils.isTrue(fCg002.getAmount().compareTo(BigDecimal.ZERO) <= 0, String.format("合同[%s]不含税金额小于等于0,不允许操作", contractNo));
AssertUtils.isTrue(fCg002.getTaxIncludeAmount().compareTo(BigDecimal.ZERO) <= 0, String.format("合同[%s]含税金额小于等于0,不允许操作", contractNo));
AssertUtils.isTrue(dbCg002.getAmount().compareTo(BigDecimal.ZERO) <= 0,
String.format("合同[%s]不含税金额小于等于0,不允许操作", contractNo));
AssertUtils.isTrue(dbCg002.getTaxIncludeAmount().compareTo(BigDecimal.ZERO) <= 0,
String.format("合同[%s]含税金额小于等于0,不允许操作", contractNo));
}
}
/**
* 提交数据
*
......
......@@ -143,22 +143,26 @@ public class ServiceHGCG003A extends ServiceBase {
Long id = fCg002B.getId();
HGCG002B dbCg002b = dbCg002BMap.get(id);
// 总重
BigDecimal bcReceiveQty = fCg002B.getBcReceiveQty();
BigDecimal bcReceiveWeight = fCg002B.getBcReceiveWeight();
if (bcReceiveWeight == null || bcReceiveWeight.compareTo(BigDecimal.ZERO) == 0) {
fCg002B.setReceiveWeight(fCg002B.getBcReceiveQty().multiply(dbCg002b.getPurUnitWeight()));
fCg002B.setReceiveWeight(bcReceiveQty.multiply(dbCg002b.getPurUnitWeight()));
fCg002B.setPurUnitWeight(dbCg002b.getPurUnitWeight());
} else {
fCg002B.setReceiveWeight(bcReceiveWeight);
fCg002B.setPurUnitWeight(bcReceiveWeight.divide(bcReceiveQty, 3, RoundingMode.HALF_UP));
}
// 含税总金额
BigDecimal amount;
if (HgCgConst.CalculationMethod.S1.equals(fCg002B.getCalculationMethod())) {
amount = fCg002B.getReceiveWeight().multiply(dbCg002b.getPrice());
amount = bcReceiveWeight.multiply(dbCg002b.getPrice());
} else {
amount = fCg002B.getBcReceiveQty().multiply(dbCg002b.getPrice());
amount = bcReceiveQty.multiply(dbCg002b.getPrice());
}
// 如果税率不为空,总金额减去税额
if (dbCg002b.getTaxRate() != null) {
amount = amount.subtract(amount.multiply(dbCg002b.getTaxRate()).divide(new BigDecimal("100")));
BigDecimal taxRate = dbCg002b.getTaxRate().multiply(new BigDecimal("0.01")).add(BigDecimal.ONE);
amount = amount.divide(taxRate, 2, RoundingMode.HALF_UP);
}
fCg002B.setAmount(amount);
}
......
......@@ -2,11 +2,50 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGCG002A">
<sql id="column">
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
UNIT as "unit", <!-- 单位 -->
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
PUR_QTY as "purQty", <!-- 采购数量 -->
PUR_UNIT_WEIGHT as "purUnitWeight", <!-- 采购单重 -->
PUR_WEIGHT as "purWeight", <!-- 采购重量 -->
RECEIVE_QTY as "receiveQty", <!-- 收货数量 -->
RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额(不含税金额) -->
TAX_INCLUDE_AMOUNT as "taxIncludeAmount", <!-- 含税金额 -->
TAX_AMOUNT as "taxAmount", <!-- 税额 -->
TAX_RATE as "taxRate", <!-- 税率 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
PRIMARY_ID as "primaryId", <!-- 主表id -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
PLAN_DETAIL_ID as "planDetailId", <!-- 计划明细id -->
STATUS as "status"
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<include refid="idCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
......@@ -117,13 +156,6 @@
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......@@ -136,49 +168,14 @@
</isNotEmpty>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
MATERIAL as "material", <!-- 材质 -->
UNIT as "unit", <!-- 单位 -->
LENGTH as "length", <!-- 长度 -->
WIDTH as "width", <!-- 宽度 -->
THICK as "thick", <!-- 厚度 -->
PUR_QTY as "purQty", <!-- 采购数量 -->
PUR_UNIT_WEIGHT as "purUnitWeight", <!-- 采购单重 -->
PUR_WEIGHT as "purWeight", <!-- 采购重量 -->
RECEIVE_QTY as "receiveQty", <!-- 收货数量 -->
RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额(不含税金额) -->
TAX_INCLUDE_AMOUNT as "taxIncludeAmount", <!-- 含税金额 -->
TAX_AMOUNT as "taxAmount", <!-- 税额 -->
TAX_RATE as "taxRate", <!-- 税率 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
PRIMARY_ID as "primaryId", <!-- 主表id -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
PLAN_DETAIL_ID as "planDetailId", <!-- 计划明细id -->
STATUS as "status"
FROM ${hggpSchema}.HGCG002A WHERE 1=1
<include refid="condition" />
<include refid="idCondition"/>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -187,11 +184,19 @@
ID asc
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGCG002A WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCG002A WHERE 1=1
<include refid="condition" />
<include refid="condition"/>
</select>
<insert id="insert">
......@@ -292,7 +297,6 @@
<include refid="idCondition"/>
</update>
<select id="queryByReceive" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B">
SELECT
a.ID as "id",
......
......@@ -12,6 +12,8 @@ import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ007;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -24,6 +26,8 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @author:songx
......@@ -123,7 +127,13 @@ public class ServiceHGKC001 extends ServiceBase {
* @param dbCg004Map
*/
private void saveData(List<HGKC001> fCg004s, Map<String, HGKC001> dbCg004Map) {
List<String> whCodeList = fCg004s.stream().map(HGKC001::getWhCode).collect(Collectors.toList());
Map<String, HGPZ007> whMap = HGPZTools.HgPz007.map(whCodeList);
for (HGKC001 fCg004 : fCg004s) {
HGPZ007 wh = whMap.get(fCg004.getWhCode());
if(Objects.nonNull(wh)){
fCg004.setWhName(wh.getWhName());
}
DaoUtils.update(HGKC001.UPDATE_WH_CODE, fCg004);
}
}
......
package com.baosight.hggp.hg.pz.constant;
/**
* @author:songx
* @date:2024/9/3,14:43
*/
public class HgPzSqlConstant {
/**
* @author:songx
* @date:2024/9/3,14:43
*/
public class HgPz005A {
// 模块名称
public static final String MODULE = "HGPZ005A.";
// 修改排产系数
public static final String UPDATE_COMPOSING_COEFF = MODULE + "updateComposingCoeff";
}
}
package com.baosight.hggp.hg.pz.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.pz.constant.HgPzSqlConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ005A;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
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.hggp.util.StringUtils;
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.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:songx
* @date:2024/9/3,14:28
*/
public class ServiceHGPZ005D extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROCESS_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGPZ005().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String processCode = MapUtils.getString(queryMap, HGPZ005A.FIELD_PROCESS_CODE);
if (ObjectUtils.isNullBlank(processCode)) {
return inInfo;
}
inInfo = super.query(inInfo, HGPZ005.QUERY, new HGPZ005());
// 填充排产系数
List<Map> results = inInfo.getBlock(EiConstant.resultBlock).getRows();
if (CollectionUtils.isEmpty(results)) {
return inInfo;
}
List<String> inventCodes = results.stream().map(item -> MapUtils.getString(item, HGPZ005.FIELD_INVENT_CODE))
.collect(Collectors.toList());
Map<String, HGPZ005A> dbPz005AMap = HGPZTools.HgPz005A.mapByCode(inventCodes, processCode);
for (Map resultMap : results) {
String inventCode = MapUtils.getString(resultMap, HGPZ005.FIELD_INVENT_CODE);
HGPZ005A dbPz005A = dbPz005AMap.get(inventCode);
resultMap.put(HGPZ005A.FIELD_COMPOSING_COEFF, dbPz005A == null ? 1 : dbPz005A.getComposingCoeff());
}
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "工序设置", operType = "保存", operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String processCode = MapUtils.getString(queryMap, HGPZ005A.FIELD_PROCESS_CODE);
AssertUtils.isEmpty(processCode, "请选择工序");
BigDecimal composingCoeff = MapUtils.getBigDecimal(queryMap, HGPZ005A.FIELD_COMPOSING_COEFF);
AssertUtils.isGe(BigDecimal.ZERO, composingCoeff, "排产系数必须大于0");
List<HGPZ005> fPz005s = MapUtils.toDaoEPBases(inInfo, HGPZ005.class);
List<String> inventCodes = ObjectUtils.listEpKey(fPz005s, HGPZ005A.FIELD_INVENT_CODE);
AssertUtils.isEmpty(inventCodes, "请选择材料");
// 写入数据
queryMap.put("inventCodes", inventCodes);
DaoUtils.update(HgPzSqlConstant.HgPz005A.UPDATE_COMPOSING_COEFF, queryMap);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fPz005s.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-07 16:07:42
Version : 1.0
schema : hggp
tableName : HGPZ005
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
INVENT_TYPE TINYINT NOT NULL,
INVENT_CODE VARCHAR NOT NULL,
INVENT_NAME VARCHAR NOT NULL,
SPEC VARCHAR,
LENGTH DECIMAL,
WIDTH DECIMAL,
THICK DECIMAL,
MATERIAL VARCHAR,
COEFFICIENT DECIMAL,
UNIT VARCHAR,
STATUS TINYINT NOT NULL,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT
-->
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGPZ005">
<typeAlias alias="HGPZ005" type="com.baosight.hggp.hg.pz.domain.HGPZ005"/>
<sql id="column">
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 帐套编码 -->
......@@ -153,12 +128,17 @@
<isEqual prepend=" AND " property="isFlowId" compareValue="0">
FLOW_ID = #isFlowId#
</isEqual>
<isNotEmpty prepend=" AND " property="processCode">
INVENT_CODE IN (SELECT INVENT_CODE FROM ${hggpSchema}.HGPZ005A WHERE PROCESS_CODE = #processCode#)
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGPZ005">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGPZ005 WHERE 1=1 AND DELETE_FLAG = 0
FROM ${hggpSchema}.HGPZ005
WHERE 1=1
AND DELETE_FLAG = 0
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
......@@ -175,79 +155,6 @@
<include refid="condition" />
</select>
<!--<select id="get" resultClass="HGPZ005">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGPZ005 WHERE 1=1
<include refid="condition"/>
</select>-->
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventType">
INVENT_TYPE = #inventType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventCode">
INVENT_CODE = #inventCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventName">
INVENT_NAME = #inventName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="spec">
SPEC = #spec#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="length">
LENGTH = #length#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="width">
WIDTH = #width#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="thick">
THICK = #thick#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="material">
MATERIAL = #material#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="coefficient">
COEFFICIENT = #coefficient#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unit">
UNIT = #unit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGPZ005 (ID,
ACCOUNT_CODE, <!-- 帐套编码 -->
......@@ -463,6 +370,7 @@
<include refid="condition"/>
ORDER BY ID
</select>
<!-- 规格下拉框(无ID) -->
<select id="queryComboBoxSpecName" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT DISTINCT
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<!-- table information
Generate time : 2024-05-15 18:59:20
Version : 1.0
schema : hggp
tableName : HGPZ005A
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
PROCESS_CODE VARCHAR NOT NULL,
PROCESS_NAME VARCHAR NOT NULL,
COMPOSING_COEFF VARCHAR,
UNIT_COEFF VARCHAR,
PARENT_ID BIGINT
-->
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGPZ005A">
<sql id="condition">
......@@ -90,8 +69,7 @@
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.pz.domain.HGPZ005A">
<select id="query" resultClass="com.baosight.hggp.hg.pz.domain.HGPZ005A">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 帐套编码 -->
......@@ -132,57 +110,6 @@
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processCode">
PROCESS_CODE = #processCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processName">
PROCESS_NAME = #processName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="composingCoeff">
COMPOSING_COEFF = #composingCoeff#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="unitCoeff">
UNIT_COEFF = #unitCoeff#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="processClass">
PROCESS_CLASS = #processClass#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGPZ005A (ID,
ACCOUNT_CODE, <!-- 帐套编码 -->
......@@ -259,4 +186,15 @@
</isNotEmpty>
</select>
<!-- 修改排产系数 -->
<update id="updateComposingCoeff">
UPDATE ${hggpSchema}.HGPZ005A
SET
COMPOSING_COEFF = #composingCoeff#,
<include refid="SqlBase.updateRevise"/>
WHERE DELETE_FLAG = 0
AND PROCESS_CODE = #processCode#
AND INVENT_CODE IN <iterate close=")" open="(" conjunction="," property="inventCodes">#inventCodes[]#</iterate>
</update>
</sqlMap>
......@@ -699,12 +699,16 @@ public class HGPZTools {
pz005.setStatus(1); //默认启用
jointSpec(pz005);
DaoUtils.insert(HGPZ005.INSERT,pz005);
DaoUtils.insert(HGPZ005.INSERT, pz005);
return pz005;
}
}
/**
* @author:songx
* @date:2024/9/3,16:35
*/
public static class HgPz005A {
/**
......@@ -748,6 +752,33 @@ public class HGPZTools {
List<HGPZ005A> results = DaoBase.getInstance().query(HGPZ005A.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results;
}
/**
* @param inventCodes
* @param processCode
* @return
*/
public static List<HGPZ005A> listByCode(List<String> inventCodes, String processCode) {
AssertUtils.isEmpty(inventCodes, "存货编码不能为空");
AssertUtils.isEmpty(processCode, "工序编码不能为空");
Map queryMap = new HashMap();
queryMap.put("inventCodes", inventCodes);
queryMap.put("processCode", processCode);
return DaoBase.getInstance().query(HGPZ005A.QUERY, queryMap);
}
/**
* @param inventCodes
* @param processCode
* @return
*/
public static Map<String, HGPZ005A> mapByCode(List<String> inventCodes, String processCode) {
List<HGPZ005A> results = listByCode(inventCodes, processCode);
if (CollectionUtils.isEmpty(results)) {
return null;
}
return results.stream().collect(Collectors.toMap(HGPZ005A::getInventCode, item -> item));
}
}
/**
......
......@@ -49,6 +49,7 @@
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......@@ -307,7 +308,8 @@
STATUS as "status",
DELETE_FLAG as "deleteFlag",
COST_WEIGHT as "costWeight"
FROM ${hggpSchema}.HGGY001 WHERE 1=1
FROM ${hggpSchema}.HGGY001
WHERE 1=1
<include refid="condition" />
group by PROCESS_CODE, PROCESS_NAME, FACTORY_CODE, FACTORY_NAME, UNIT, STATUS, DELETE_FLAG, COST_WEIGHT
</select>
......
......@@ -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
......
......@@ -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)));
......
......@@ -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);
}
}
}
}
......@@ -111,7 +111,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
PROJ_CODE DESC, ID DESC
</isEmpty>
</dynamic>
</sql>
......
......@@ -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>
......@@ -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 {
......
......@@ -183,7 +183,7 @@ public class AssertUtils {
* @param message
*/
public static void isGt(BigDecimal a, BigDecimal b, String message) {
if (a.compareTo(b) == 1) {
if (a == null || b == null || a.compareTo(b) == 1) {
throw new PlatException(message);
}
}
......@@ -195,7 +195,7 @@ public class AssertUtils {
* @param b
*/
public static void isGe(BigDecimal a, BigDecimal b, String message) {
if (a.compareTo(b) > -1) {
if (a == null || b == null || a.compareTo(b) > -1) {
throw new PlatException(message);
}
}
......
......@@ -9,22 +9,23 @@ $(function () {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
columns: [
{
columns: [{
field: "operator",
title: "操作",
width: 120,
template: function (item) {
let template = '';
if (!isBlank(item.id)){
if (!isBlank(item.id)) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ',0, ' + item.source + ')" >详情</a>';
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ',0, ' + item.source
+ ')" >详情</a>';
}
if (!isBlank(item.id)){
if (!isBlank(item.id)) {
//审核通过的,可以进行合同变更
if(item.status == 2)
if (item.status == 2) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ', 1, ' + item.source + ')" >合同变更</a>';
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ', 1, '
+ item.source + ')" >合同变更</a>';
}
}
return template;
}
......@@ -49,7 +50,7 @@ $(function () {
return projCodeBox[i]['valueField'];
}
}
return dataItem["projCode"];
return dataItem["projCode"] == null ? "" : dataItem["projCode"];
},
editor: function (container, options) {
let inInfo = new EiInfo();
......
......@@ -39,7 +39,7 @@
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" height="65vh">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="110" align="center"/>
<EF:EFComboColumn ename="source" cname="数据来源" enable="false" width="80" align="center" defaultValue="1">
<EF:EFCodeOption codeName="hggp.hpcg.receiveSource"/>
</EF:EFComboColumn>
......@@ -50,8 +50,8 @@
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" width="100" align="center" required="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" width="200" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" width="140" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="130" align="center"/>
<EF:EFColumn ename="contractDate" cname="合同日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
......@@ -38,6 +38,7 @@ $(function () {
loadComplete: function (grid) {
// 确认
$("#CONFIRM").on("click", confirm);
// change事件
grid.dataSource.bind("change", function (e) {
supCodeChange(e);
......@@ -59,8 +60,7 @@ $(function () {
// 查询
$("#QUERY").on("click", query);
// 选择收货
$("#SELECT_RECEIVE").on("click", selectReceive);
$("#BTN_SUBMIT").on("click",batchUpdateSubmitStatus);
downKeyUp();
});
......@@ -229,3 +229,25 @@ function updateSubmitStatus(id) {
});
}
/**
* 保存
*/
let batchUpdateSubmitStatus = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
if (rows[i]['submitStatus'] != 0) {
message("勾选的第" + (i + 1) + "行提交状态不是未提交");
return;
}
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC001", "updateSubmitStatus", true);
}
});
}
......@@ -9,6 +9,9 @@ $(function() {
batchFlow();
});
// 排产系数
$("#BATCH_COE").on("click", batchCoe);
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
......@@ -274,6 +277,22 @@ let deleteFunc = function () {
});
}
/**
* 排产系数
*
* @param id
* @param inventCode
* @param flowId
*/
function batchCoe() {
JSColorbox.open({
href: "HGPZ005D",
title: "<div style='text-align: center;'>排产系数</div>",
width: "80%",
height: "90%"
});
}
function showDetail(id) {
JSColorbox.open({
href: "HGPZ005A?methodName=initLoad&inqu_status-0-parentId=" + id,
......
$(function () {
IPLATUI.EFSelect = {
"inqu_status-0-processCode": {
change: function (e) {
query();
}
}
}
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [],
loadComplete: function (grid) {
},
}
}
// 查询
$("#QUERY").on("click", query);
// 保存
$("#SAVE").on("click", save);
// 按键
downKeyUp();
})
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
let processCode = $("#inqu_status-0-processCode").val();
if (!isBlank(processCode)) {
query();
}
});
/**
* 查询
*/
let query = function () {
let processCode = $("#inqu_status-0-processCode").val();
if (isBlank(processCode)) {
message("请选择工序");
return;
}
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
let processCode = $("#inqu_status-0-processCode").val();
if (isBlank(processCode)) {
message("请选择工序");
return;
}
let composingCoeff = $("#inqu_status-0-composingCoeff").val();
if (isBlank(composingCoeff)) {
message("请填写排产系数");
return;
}
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ005D", "save",
false, function (res) {
message(res.msg);
}
);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="排产系数">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect cname="存货类型" ename="inventType" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="存货编码" ename="inventCodeLike" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="存货名称" ename="inventName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="规格" ename="spec" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="detail" title="编辑区域">
<div class="row">
<EF:EFSelect cname="工序" ename="processCode" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
filter="contains" required="true">
<EF:EFOptions blockId="processCode_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="排产系数" ename="composingCoeff" blockId="inqu_status" row="0" colWidth="6" ratio="2:10"
required="true"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" height="60vh">
<EF:EFColumn cname="排产系数" ename="composingCoeff" enable="false" width="100" align="center"/>
<EF:EFColumn cname="存货编码" ename="inventCode" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="120" align="center"
blockName="invent_type_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#">
</EF:EFComboColumn>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="140" align="center"/>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="100" align="right" format="{0:N2}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="100" align="right" format="{0:N2}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="100" align="right" format="{0:N2}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="100" align="center"/>
<EF:EFColumn ename="coefficient" cname="系数" enable="false" width="80" align="right" format="{0:N2}"
defaultValue="1"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -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>
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