Commit 51b8d56f by 宋祥

Merge branch 'dev' of http://129.211.46.84:8800/platform/hg-smart into dev-sx

parents 10bc84d0 69135b39
......@@ -216,8 +216,6 @@ public class ServiceHGCG002 extends ServiceBase {
HGCGTools.HgCg001A.updateStatus(hgcg002B.getPlanDetailId(), HGConstant.CgPlanStatus.S_2);
}
}
}
/**
......@@ -244,7 +242,7 @@ public class ServiceHGCG002 extends ServiceBase {
}
return inInfo;
}
/**
* 数据校验
*
......@@ -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);
}
......
......@@ -268,7 +268,7 @@ public class ServiceHGCW010 extends ServiceBase {
}
catch (Exception e) {
LogUtils.setMsg(inInfo, e, "生成收款单失败");
LogUtils.setMsg(inInfo, e, "生成销售开票失败");
}
return inInfo;
}
......
......@@ -786,7 +786,7 @@ public class HGCWTools {
List<HGCW011> results = DaoBase.getInstance().query(HGCW011.QUERY,new HashMap<String,Object>(){
{put("settlementNumbers",settlementNumber);}
});
AssertUtils.isEmpty(results, "找不到对应的销售开票记录!");
//AssertUtils.isEmpty(results, "找不到对应的销售开票记录!");
BigDecimal totalAmount = new BigDecimal("0");
for (HGCW011 hgcw011: results) {
totalAmount = totalAmount.add(hgcw011.getTotalContractPriceIncluding());
......
......@@ -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"/>
<typeAlias alias="HGPZ005" type="com.baosight.hggp.hg.pz.domain.HGPZ005"/>
<sql id="column">
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 帐套编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_TYPE_DETAIL as "inventTypeDetail",
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
MATERIAL as "material", <!-- 材质 -->
COEFFICIENT as "coefficient", <!-- 系数 -->
UNIT as "unit", <!-- 单位 -->
STATUS as "status", <!-- 状态 0未启用 1启用 -->
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.是 -->
FLOW_ID as "flowId"
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 帐套编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
INVENT_TYPE as "inventType", <!-- 存货类型 -->
INVENT_TYPE_DETAIL as "inventTypeDetail",
INVENT_CODE as "inventCode", <!-- 存货编码 -->
INVENT_NAME as "inventName", <!-- 存货名称 -->
SPEC as "spec", <!-- 规格 -->
LENGTH as "length", <!-- 长 -->
WIDTH as "width", <!-- 宽 -->
THICK as "thick", <!-- 厚 -->
MATERIAL as "material", <!-- 材质 -->
COEFFICIENT as "coefficient", <!-- 系数 -->
UNIT as "unit", <!-- 单位 -->
STATUS as "status", <!-- 状态 0未启用 1启用 -->
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.是 -->
FLOW_ID as "flowId"
</sql>
<sql id="condition">
<!-- 存货档案去除权限限制
......@@ -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">
<sql id="condition">
<!--<include refid="HGXSDataAuth.authCondition"/>-->
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......@@ -90,9 +69,8 @@
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.pz.domain.HGPZ005A">
SELECT
<select id="query" resultClass="com.baosight.hggp.hg.pz.domain.HGPZ005A">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 帐套编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
......@@ -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>
......@@ -146,11 +146,11 @@ public class HGPZTools {
}
return pz004s.stream().collect(Collectors.toMap(HGPZ004::getInventType, item -> item));
}
}
public static class HgPz006 {
public static HGPZ006 getWhCode(String wHCode) {
HGPZ007 pz007 = HGPZTools.HgPz007.get(wHCode);
if (pz007 == null) {
......@@ -698,15 +698,19 @@ public class HGPZTools {
pz005.setUnit(hgsc009a.getUnit());
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 {
/**
* 通过存货编码查询存货工序*
*
......@@ -720,7 +724,7 @@ public class HGPZTools {
List<HGPZ005A> results = DaoBase.getInstance().query(HGPZ005A.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results;
}
/**
* 通过存货编码查询存货工序*
*
......@@ -734,7 +738,7 @@ public class HGPZTools {
List<HGPZ005A> results = DaoBase.getInstance().query(HGPZ005A.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results;
}
/**
* 通过存货编码查询存货工序*
*
......@@ -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>
......
......@@ -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,68 +9,69 @@ $(function () {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
columns: [
{
field: "operator",
title: "操作",
width: 120,
template: function (item) {
let template = '';
if (!isBlank(item.id)){
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
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>';
}
if (!isBlank(item.id)) {
//审核通过的,可以进行合同变更
if (item.status == 2) {
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 + ', 1, '
+ item.source + ')" >合同变更</a>';
}
if (!isBlank(item.id)){
//审核通过的,可以进行合同变更
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>';
}
return template;
}
}, {
field: "companyCode",
title: "公司编码",
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']) {
return companyCodeBox[i]['companyCode'];
}
return template;
}
}, {
field: "companyCode",
title: "公司编码",
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']) {
return companyCodeBox[i]['companyCode'];
}
return dataItem["companyCode"];
}
}, {
field: "projCode",
title: "项目编码",
template: function (dataItem) {
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]['valueField'] === dataItem['projCode']) {
dataItem['projName'] = projCodeBox[i]['textField']
return projCodeBox[i]['valueField'];
}
return dataItem["companyCode"];
}
}, {
field: "projCode",
title: "项目编码",
template: function (dataItem) {
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]['valueField'] === dataItem['projCode']) {
dataItem['projName'] = projCodeBox[i]['textField']
return projCodeBox[i]['valueField'];
}
return dataItem["projCode"] == null ? "" : dataItem["projCode"];
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("inqu_status-0-approvalStatus", 2);
inInfo.set("field", options.field);
EiCommunicator.send("HGSC003", "projComboBox", inInfo, {
onSuccess: function (ei) {
projCodeBox = ei.getBlock("projRecordByRole_block_id").getMappedRows();
},
onFail: function (ei) {
}
return dataItem["projCode"];
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("inqu_status-0-approvalStatus", 2);
inInfo.set("field", options.field);
EiCommunicator.send("HGSC003", "projComboBox", inInfo, {
onSuccess: function (ei) {
projCodeBox = ei.getBlock("projRecordByRole_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: projCodeBox,
minLength: 0,
dataTextField: "textField",
}, {async: false});
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: projCodeBox,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
optionLabelTemplate: "[#:valueField#]#:textField#",
valueTemplate: "[#:valueField#]#:textField#",
......
......@@ -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>
......@@ -254,7 +254,7 @@ $(function () {
IPLAT.NotificationUtil(ei.getMsg(), "success")
$("#deleteOrgWindow").data("kendoWindow").close();
const tree = $('#categoryTree').data('kendoTreeView');
const parentId = $("#inqu_status3-0-orgParentId").val();
const parentId = $("#inqu_status-0-orgParentId").val();
// 刷新树节点
tree.reload(parentId);
// 展开树
......@@ -322,7 +322,6 @@ $(function () {
callbackName: addCallback
});
}*/
})
$("#categoryTree").mousedown(function (e) {
......@@ -511,9 +510,9 @@ let query = function () {
/**
* 新增组织机构回调
*/
let addCallback = function (parentOrgId) {
let addCallback = function (parentId) {
// 回填父级ID
$("#inqu_status2-0-parentId").val(parentOrgId);
$("#inqu_status-0-orgParentId").val(parentId);
refreshTree();
}
......@@ -522,7 +521,7 @@ let addCallback = function (parentOrgId) {
*/
let editCallback = function (parentOrgId) {
// 回填父级ID
$("#inqu_status2-0-parentId").val(parentOrgId);
//$("#inqu_status-0-orgParentId").val(parentOrgId);
refreshTree();
}
......@@ -549,7 +548,7 @@ let refreshTree = function () {
}
// 刷新树节点
const tree = $("#categoryTree").data("kendoTreeView");
const treeOrgId = $("#inqu_status2-0-parentId").val()
const treeOrgId = $("#inqu_status-0-orgParentId").val()
tree.reload(treeOrgId)
expandTreeNode(tree, treeOrgId)
// tree.expandPath(treeOrgId)
......@@ -834,6 +833,11 @@ function uploadFile() {
});
}
/**
* 文件变更
* @param docId 文件标识
* @param bizId 业务标识
*/
function changeFile(docId,bizId) {
JSColorbox.open({
href: "HGWD099A?methodName=initLoad&inqu_status-0-bizType=WD" +
......@@ -944,7 +948,7 @@ let showAuthButton = function () {
}
/**
* 文件上传
* 变更记录
*/
function changeResord() {
let leafType = IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel;
......
......@@ -66,14 +66,14 @@
<EF:EFRegion id="result" title="附件详情" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="no" personal="true" serviceName="HGWD099" queryMethod="query" deleteMethod="delete">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="120" align="center" defaultValue="0" hidden="false">
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="180"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center" defaultValue="0" hidden="false">
<EF:EFCodeOption codeName="hggp.hgwd.status"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="140" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
......
......@@ -181,8 +181,8 @@ let save = function (btnNode) {
function (e) {
var status = e.status;
if (status !== -1) {
let parentOrgId = $("#inqu_status-0-parentOrgId").val();
parent.JSColorbox.setValueCallback(parentOrgId);
let parentId = $("#inqu_status-0-parentId").val();
parent.JSColorbox.setValueCallback(parentId);
}
});
btnNode.attr("disabled", false);
......
......@@ -149,8 +149,8 @@ let save = function (btnNode) {
function (e) {
var status = e.status;
if (status !== -1) {
let parentOrgId = $("#inqu_status-0-parentOrgId").val();
parent.JSColorbox.setValueCallback(parentOrgId);
let fileId = $("#inqu_status-0-fileId").val();
parent.JSColorbox.setValueCallback(fileId);
}
}
);
......
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