Commit 36a51ac2 by liuyang

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

 Conflicts:
	src/main/resources/resources/ibatis/sqlmap-config.xml
parents 0db191ff c958f4d3
......@@ -13,7 +13,8 @@ import java.util.Map;
*/
public enum ComputeTypeEnum {
CD(1,"长度"),
SL(2,"数量");
SL(2,"数量"),
ZL(3,"重量");
private Integer code;
......
......@@ -64,7 +64,7 @@ public class HGConstant {
// 其他入库单号
public static final String OTHER_ENTER_NO = "OTHER_ENTER_NO";
// 其他出库单号
public static final String OTHER_OUTER_NO = "OTHER_OUTER_NO";
public static final String OTHER_OUT_NO = "OTHER_OUT_NO";
//生产计划单
public static final String HGSC005_PLAN_CODE = "HGSC005_PLAN_CODE";
//生产订单
......
......@@ -42,6 +42,7 @@ public class HGCW008 extends DaoEPBase {
public static final String FIELD_CUMULATIVE_SETTLEMENT_AMOUNT = "cumulativeSettlementAmount"; /* 累计结算金额*/
public static final String FIELD_CUMULATIVE_SETTLEMENT_TAX = "cumulativeSettlementTax"; /* 累计结算税金*/
public static final String FIELD_CUMULATIVE_PRICE_TAX = "cumulativePriceTax"; /* 累计结算价税合计金额*/
public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 累计结算价税合计金额*/
public static final String FIELD_REVIEW_STATUS = "reviewStatus"; /* 审核状态*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 记录创建名称*/
......@@ -71,6 +72,9 @@ public class HGCW008 extends DaoEPBase {
public static final String COL_CUMULATIVE_SETTLEMENT_AMOUNT = "CUMULATIVE_SETTLEMENT_AMOUNT"; /* 累计结算金额*/
public static final String COL_CUMULATIVE_SETTLEMENT_TAX = "CUMULATIVE_SETTLEMENT_TAX"; /* 累计结算税金*/
public static final String COL_CUMULATIVE_PRICE_TAX = "CUMULATIVE_PRICE_TAX"; /* 累计结算价税合计金额*/
public static final String COL_REMAINING_AMOUNT = "REMAINING_AMOUNT"; /* 累计结算价税合计金额*/
public static final String COL_REVIEW_STATUS = "REVIEW_STATUS"; /* 审核状态*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 记录创建名称*/
......@@ -106,6 +110,7 @@ public class HGCW008 extends DaoEPBase {
private BigDecimal cumulativeSettlementAmount = new BigDecimal("0"); /* 累计结算金额*/
private BigDecimal cumulativeSettlementTax = new BigDecimal("0"); /* 累计结算税金*/
private BigDecimal cumulativePriceTax = new BigDecimal("0"); /* 累计结算价税合计金额*/
private BigDecimal remainingAmount = new BigDecimal("0"); /* 累计结算价税合计金额*/
private Integer reviewStatus; /* 审核状态*/
private String createdBy = " "; /* 记录创建者*/
private String createdName = " "; /* 记录创建名称*/
......@@ -223,6 +228,13 @@ public class HGCW008 extends DaoEPBase {
eiColumn.setDescName("累计结算价税合计金额");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMAINING_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("剩余开票/收票金额");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REVIEW_STATUS);
eiColumn.setDescName("审核状态");
eiMetadata.addMeta(eiColumn);
......@@ -713,6 +725,14 @@ public class HGCW008 extends DaoEPBase {
public void setDepCode(String depCode) {
this.depCode = depCode;
}
public BigDecimal getRemainingAmount() {
return remainingAmount;
}
public void setRemainingAmount(BigDecimal remainingAmount) {
this.remainingAmount = remainingAmount;
}
/**
* get the value from Map.
*
......@@ -741,6 +761,7 @@ public class HGCW008 extends DaoEPBase {
setCumulativeSettlementAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_CUMULATIVE_SETTLEMENT_AMOUNT)), cumulativeSettlementAmount));
setCumulativeSettlementTax(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_CUMULATIVE_SETTLEMENT_TAX)), cumulativeSettlementTax));
setCumulativePriceTax(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_CUMULATIVE_PRICE_TAX)), cumulativePriceTax));
setRemainingAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_AMOUNT)), remainingAmount));
setReviewStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
......@@ -778,6 +799,7 @@ public class HGCW008 extends DaoEPBase {
map.put(FIELD_CUMULATIVE_SETTLEMENT_AMOUNT, StringUtils.toString(cumulativeSettlementAmount, eiMetadata.getMeta(FIELD_CUMULATIVE_SETTLEMENT_AMOUNT)));
map.put(FIELD_CUMULATIVE_SETTLEMENT_TAX, StringUtils.toString(cumulativeSettlementTax, eiMetadata.getMeta(FIELD_CUMULATIVE_SETTLEMENT_TAX)));
map.put(FIELD_CUMULATIVE_PRICE_TAX, StringUtils.toString(cumulativePriceTax, eiMetadata.getMeta(FIELD_CUMULATIVE_PRICE_TAX)));
map.put(FIELD_REMAINING_AMOUNT, StringUtils.toString(remainingAmount, eiMetadata.getMeta(FIELD_REMAINING_AMOUNT)));
map.put(FIELD_REVIEW_STATUS, StringUtils.toString(reviewStatus, eiMetadata.getMeta(FIELD_REVIEW_STATUS)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
......@@ -789,4 +811,6 @@ public class HGCW008 extends DaoEPBase {
return map;
}
}
......@@ -48,6 +48,7 @@ public class HGCW010 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 累计结算价税合计金额*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -73,6 +74,7 @@ public class HGCW010 extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_REMAINING_AMOUNT = "REMAINING_AMOUNT"; /* 累计结算价税合计金额*/
public static final String QUERY = "HGCW010.query";
public static final String COUNT = "HGCW010.count";
......@@ -107,6 +109,7 @@ public class HGCW010 extends DaoEPBase {
private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/
private String depCode = " "; /* 部门编码*/
private BigDecimal remainingAmount = new BigDecimal("0"); /* 累计结算价税合计金额*/
/**
* initialize the metadata.
......@@ -214,6 +217,12 @@ public class HGCW010 extends DaoEPBase {
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMAINING_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("剩余开票/收票金额");
eiMetadata.addMeta(eiColumn);
}
......@@ -608,6 +617,14 @@ public class HGCW010 extends DaoEPBase {
public void setDepCode(String depCode) {
this.depCode = depCode;
}
//剩余开票金额
public BigDecimal getRemainingAmount() {
return remainingAmount;
}
public void setRemainingAmount(BigDecimal remainingAmount) {
this.remainingAmount = remainingAmount;
}
/**
* get the value from Map.
*
......@@ -640,6 +657,7 @@ public class HGCW010 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setRemainingAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_AMOUNT)), remainingAmount));
}
/**
......@@ -673,6 +691,7 @@ public class HGCW010 extends DaoEPBase {
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_REMAINING_AMOUNT, StringUtils.toString(remainingAmount, eiMetadata.getMeta(FIELD_REMAINING_AMOUNT)));
return map;
}
......
......@@ -88,6 +88,7 @@ public class ServiceHGCW008 extends ServiceBase {
HGCW008.setSettlementNumber(settlementNumber);
HGCW008.setReviewStatus(0);
HGCW008.setContractDate(DateUtils.formatShort(HGCW008.getContractDate()));
HGCW008.setRemainingAmount(HGCW008.getThisPriceTax());
this.add(HGCW008);
// 写入其他数据
HGCWTools.HgCw009.save(detail1Rows,settlementNumber,userVO);
......
......@@ -152,6 +152,7 @@
CUMULATIVE_SETTLEMENT_AMOUNT as "cumulativeSettlementAmount", <!-- 累计结算金额 -->
CUMULATIVE_SETTLEMENT_TAX as "cumulativeSettlementTax", <!-- 累计结算税金 -->
CUMULATIVE_PRICE_TAX as "cumulativePriceTax", <!-- 累计结算价税合计金额 -->
REMAINING_AMOUNT as "remainingAmount", <!-- 累计结算价税合计金额 -->
REVIEW_STATUS as "reviewStatus", <!-- 审核状态 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
......@@ -286,6 +287,7 @@
CUMULATIVE_SETTLEMENT_AMOUNT, <!-- 累计结算金额 -->
CUMULATIVE_SETTLEMENT_TAX, <!-- 累计结算税金 -->
CUMULATIVE_PRICE_TAX, <!-- 累计结算价税合计金额 -->
REMAINING_AMOUNT, <!-- 累计结算价税合计金额 -->
REVIEW_STATUS, <!-- 审核状态 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
......@@ -295,7 +297,7 @@
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #contractNumber#, #contractName#, #settlementNumber#, #settlementType#, #contractDate#, #taxPoints#, #priceTaxSeparation#, #thisSettlementAmount#, #thisSettlementTax#, #thisPriceTax#, #totalContractPrice#, #cumulativeSettlementAmount#, #cumulativeSettlementTax#, #cumulativePriceTax#, #reviewStatus#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #contractNumber#, #contractName#, #settlementNumber#, #settlementType#, #contractDate#, #taxPoints#, #priceTaxSeparation#, #thisSettlementAmount#, #thisSettlementTax#, #thisPriceTax#, #totalContractPrice#, #cumulativeSettlementAmount#, #cumulativeSettlementTax#, #cumulativePriceTax#,#remainingAmount#, #reviewStatus#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCW008
</selectKey>
......@@ -351,4 +353,16 @@
WHERE
ID = #id#
</update>
<update id="updateDeductionAmount">
UPDATE ${hggpSchema}.HGCW008
SET
REMAINING_AMOUNT = #remainingAmount#, <!-- 审核状态 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -292,29 +292,27 @@
<select id="queryconteractComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
COMPANY_NAME as "companyName", <!-- 所属公司 -->
PROJ_CODE as "projCode", <!-- 项目编号 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
CONTRACT_NUMBER as "contractNumber", <!-- 合同号 -->
CONTRACT_NAME as "contractName", <!-- 合同名称 -->
SETTLEMENT_NUMBER as "settlementNumber", <!-- 结算编号 -->
THIS_SETTLEMENT_TAX as "thisSettlementTax", <!-- 税金 -->
THIS_SETTLEMENT_AMOUNT as "thisSettlementAmount", <!-- 结算金额 -->
THIS_PRICE_TAX as "thisPriceTax" <!-- 税价合计 -->
FROM ${hggpSchema}.HGCW008
WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="settlementType">
SETTLEMENT_TYPE = "2"
</isNotEmpty>
A.COMPANY_NAME as "companyName", <!-- 所属公司 -->
A.PROJ_CODE as "projCode", <!-- 项目编号 -->
A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.CONTRACT_NUMBER as "contractNumber", <!-- 合同号 -->
A.CONTRACT_NAME as "contractName", <!-- 合同名称 -->
A.SETTLEMENT_NUMBER as "settlementNumber", <!-- 结算编号 -->
A.THIS_SETTLEMENT_TAX as "thisSettlementTax", <!-- 税金 -->
A.THIS_SETTLEMENT_AMOUNT as "thisSettlementAmount", <!-- 结算金额 -->
A.THIS_PRICE_TAX as "thisPriceTax", <!-- 税价合计 -->
B.CONTRACT_TYPE as "contractType" <!-- 合同类型 -->
FROM ${hggpSchema}.HGCW008 A LEFT JOIN ${hggpSchema}.HGCW002 B
ON A.PROJ_CODE = B.PROJ_CODE
AND A.CONTRACT_NUMBER = B.CONTRACT_NUMBER
AND A.COMPANY_CODE = B.COMPANY_CODE
WHERE 1=1 AND B.CONTRACT_TYPE = 1 AND A.SETTLEMENT_TYPE = 2
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
A.COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
ORDER BY CONTRACT_NUMBER
ORDER BY A.CONTRACT_NUMBER
</select>
</sqlMap>
......@@ -13,6 +13,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -142,6 +143,50 @@ public class HGCWTools {
});
return results.get(0);
}
public static void deductionAmount(String settlementNumber, BigDecimal deductionAmount) {
AssertUtils.isNull(settlementNumber, "结算单不能为空!");
if (deductionAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
throw new PlatException("扣款金额不能小于等于0!");
}
List<HGCW008> results = DaoBase.getInstance().query(HGCW008.QUERY,new HashMap<String,Object>(){
{put("settlementNumber",settlementNumber);}
});
if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的结算单!");
}
DecimalFormat decimalFormat = new DecimalFormat("#.000");
HGCW008 hgcw008 = results.get(0);
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(hgcw008.getRemainingAmount().subtract(deductionAmount)));
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) < 0) {
throw new PlatException("扣款金额不能大于结算单剩余金额!");
}
hgcw008.setRemainingAmount(remainingAmount);
DaoUtils.update("HGCW008.updateDeductionAmount", hgcw008);
}
public static void cutAmount(String settlementNumber, BigDecimal cutAmount) {
AssertUtils.isNull(settlementNumber, "结算单不能为空!");
if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
throw new PlatException("扣款金额不能小于等于0!");
}
List<HGCW010> results = DaoBase.getInstance().query(HGCW010.QUERY,new HashMap<String,Object>(){
{put("settlementNumber",settlementNumber);}
});
if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的结算单!");
}
DecimalFormat decimalFormat = new DecimalFormat("#.000");
HGCW010 HGCW010 = results.get(0);
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(HGCW010.getRemainingAmount().subtract(cutAmount)));
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) < 0) {
throw new PlatException("扣款金额不能大于结算单剩余金额!");
}
HGCW010.setRemainingAmount(remainingAmount);
DaoUtils.update("HGCW010.updateDeductionAmount", HGCW010);
}
}
public static class HgCw009 {
......
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
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.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 其他入库单
*
* @author:
* @date:2024/1/15,11:20
*/
public class ServiceHGKC006 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "其他入库单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC006().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "其他入库单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HGKCUtils.HgKc006.setCondition(queryRow);
inInfo = super.query(inInfo, HGKC006.QUERY, new HGKC006());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他入库单", operType = "插入", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGKC006 hgkc006 = new HGKC006();
hgkc006.fromMap(resultRows.get(i));
if (hgkc006.getId() == null || hgkc006.getId() == 0) {
this.add(hgkc006);
} else {
this.modify(hgkc006);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HGKC006 hgkc006 = new HGKC006();
hgkc006.fromMap(resultRows.get(i));
AssertUtils.isNull(hgkc006.getSubmitStatus(), "是否启用不能为空");
}
}
/**
* 新增
*
* @param hgkc006
* @throws Exception
*/
private void add(HGKC006 hgkc006) throws Exception {
hgkc006.setOtherEnterNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.OTHER_ENTER_NO));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
hgkc006.setCompanyCode(userVO.getUsercode());
hgkc006.setCompanyName(userVO.getUsername());
hgkc006.setSource(1);
DaoUtils.insert(HGKC006.INSERT, hgkc006);
}
/**
* 修改数据
*
* @param hgkc006
*/
private void modify(HGKC006 hgkc006) throws Exception {
DaoUtils.update(HGKC006.UPDATE, hgkc006);
}
/**
* 提交 .
*/
@OperationLogAnnotation(operModul = "其他入库单",operType = "提交")
public EiInfo check(EiInfo eiInfo) {
HGKC006 hgkc006 = new HGKC006();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgkc006.fromMap(map);
DaoUtils.update(HGKC006.CHECK, hgkc006.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("提交失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("提交失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("提交成功!");
return eiInfo;
}
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "其他入库单", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HGKC006 hgkc006 = new HGKC006();
hgkc006.fromMap(resultRows.get(i));
this.add(hgkc006);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 修改操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他入库单", operType = "修改", operDesc = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGKC006 hppz009 = new HGKC006();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(HGKC006.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他入库单", operType = "删除", operDesc = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGKC006 hgkc006 = new HGKC006();
hgkc006.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgkc006.getAccountCode());
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgkc006.getAccountName()));
}
DaoUtils.update(HGKC006.DELETE, hgkc006);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.domain.HGKC006A;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
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.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 其他入库单明细
*
* @author:
* @date:2024/1/15,11:20
*/
public class ServiceHGKC006A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "其他入库单明细", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC006A().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "其他入库单明细", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC006A.QUERY, new HGKC006A());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他入库单明细", operType = "插入", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGKC006A hgkc006A = new HGKC006A();
hgkc006A.fromMap(resultRows.get(i));
hgkc006A.setInvWeight(hgkc006A.getInvUnitWeight().multiply(hgkc006A.getInvQty()));
if (hgkc006A.getId() == null || hgkc006A.getId() == 0) {
Map queryMap = new HashMap();
queryMap.put("id",inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_PRIMARY_ID));
List<HGKC006> list = this.dao.query(HGKC006.QUERY,queryMap);
this.add(hgkc006A,list.get(0));
} else {
this.modify(hgkc006A);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HGKC006A hgkc006A = new HGKC006A();
hgkc006A.fromMap(resultRows.get(i));
//AssertUtils.isNull(hgkc006A.s(), "是否启用不能为空");
}
}
/**
* 新增
*
* @param hgkc006A
* @throws Exception
*/
private void add(HGKC006A hgkc006A,HGKC006 hgkc006) throws Exception {
hgkc006A.setPrimaryId(hgkc006.getId());
hgkc006A.setSource(1);
hgkc006A.setOtherEnterNo(hgkc006.getOtherEnterNo());
DaoUtils.insert(HGKC006A.INSERT, hgkc006A);
// 更新库存数量
HGKCUtils.HgKc010.updateInv(hgkc006.getCompanyCode(), hgkc006.getWhCode(), hgkc006A.getInventRecordId(),
hgkc006A.getInvQty(), hgkc006A.getInvUnitWeight(), hgkc006A.getInvWeight());
}
/**
* 修改数据
*
* @param hgkc006A
*/
private void modify(HGKC006A hgkc006A) {
DaoUtils.update(HGKC006A.UPDATE, hgkc006A);
}
/**
* 修改操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他入库单明细", operType = "修改", operDesc = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGKC006A hppz009 = new HGKC006A();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(HGKC006A.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他入库单明细", operType = "删除", operDesc = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGKC006A hgkc006A = new HGKC006A();
hgkc006A.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgkc006A.getAccountCode());
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgkc006A.getAccountName()));
}
DaoUtils.update(HGKC006A.DELETE, hgkc006A);
// 扣减库存
Map queryMap = new HashMap();
queryMap.put("id",inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_PRIMARY_ID));
List<HGKC006> list = this.dao.query(HGKC006.QUERY,queryMap);
HGKCUtils.HgKc010.updateInv(list.get(0).getCompanyCode(), list.get(0).getWhCode(), hgkc006A.getInventRecordId(),
hgkc006A.getInvQty().negate(), hgkc006A.getInvWeight().negate());
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.domain.HGKC007;
import com.baosight.hggp.hg.kc.domain.HGKC007;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
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.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 其他出库单
*
* @author:
* @date:2024/1/15,11:20
*/
public class ServiceHGKC007 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "其他出库单", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC007().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "其他出库单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
HGKCUtils.HgKc007.setCondition(queryRow);
inInfo = super.query(inInfo, HGKC007.QUERY, new HGKC007());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他出库单", operType = "插入", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGKC007 hgkc007 = new HGKC007();
hgkc007.fromMap(resultRows.get(i));
if (hgkc007.getId() == null || hgkc007.getId() == 0) {
this.add(hgkc007);
} else {
this.modify(hgkc007);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HGKC007 hgkc007 = new HGKC007();
hgkc007.fromMap(resultRows.get(i));
AssertUtils.isNull(hgkc007.getSubmitStatus(), "是否启用不能为空");
}
}
/**
* 新增
*
* @param hgkc007
* @throws Exception
*/
private void add(HGKC007 hgkc007) throws Exception {
hgkc007.setOtherOutNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.OTHER_OUT_NO));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
hgkc007.setCompanyCode(userVO.getUsercode());
hgkc007.setCompanyName(userVO.getUsername());
hgkc007.setSource(1);
DaoUtils.insert(HGKC007.INSERT, hgkc007);
}
/**
* 修改数据
*
* @param hgkc007
*/
private void modify(HGKC007 hgkc007) throws Exception {
DaoUtils.update(HGKC007.UPDATE, hgkc007);
}
/**
* 提交 .
*/
@OperationLogAnnotation(operModul = "其他入库单",operType = "提交")
public EiInfo check(EiInfo eiInfo) {
HGKC007 hgkc007 = new HGKC007();
EiBlock eiBlock = eiInfo.getBlock(EiConstant.resultBlock);
try {
for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgkc007.fromMap(map);
DaoUtils.update(HGKC007.CHECK, hgkc007.toMap());
}
} catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE);
eiInfo.setMsg("提交失败,原因参见详细错误描述!");
eiInfo.setDetailMsg(e.getMessage());
logError("提交失败!", e.getMessage());
return eiInfo;
}
eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
eiInfo.setMsg("提交成功!");
return eiInfo;
}
/**
* 新增操作.
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "其他出库单", operType = "新增", operDesc = "新增")
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HGKC007 hgkc007 = new HGKC007();
hgkc007.fromMap(resultRows.get(i));
this.add(hgkc007);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 修改操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他出库单", operType = "修改", operDesc = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGKC007 hppz009 = new HGKC007();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(HGKC007.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他出库单", operType = "删除", operDesc = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGKC007 hgkc007 = new HGKC007();
hgkc007.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgkc007.getAccountCode());
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgkc007.getAccountName()));
}
DaoUtils.update(HGKC007.DELETE, hgkc007);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.domain.HGKC006A;
import com.baosight.hggp.hg.kc.domain.HGKC007;
import com.baosight.hggp.hg.kc.domain.HGKC007A;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
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.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 其他出库明细
*
* @author:
* @date:2024/1/15,11:20
*/
public class ServiceHGKC007A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "其他出库明细", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC007A().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "其他出库明细", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGKC007A.QUERY, new HGKC007A());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他出库明细", operType = "插入", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGKC007A hgkc007A = new HGKC007A();
hgkc007A.fromMap(resultRows.get(i));
hgkc007A.setInvWeight(hgkc007A.getInvUnitWeight().multiply(hgkc007A.getInvQty()));
if (hgkc007A.getId() == null || hgkc007A.getId() == 0) {
Map queryMap = new HashMap();
queryMap.put("id",inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_PRIMARY_ID));
List<HGKC007> list = this.dao.query(HGKC007.QUERY,queryMap);
this.add(hgkc007A,list.get(0));
} else {
this.modify(hgkc007A);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 校验保存的数据
*
* @param resultRows
*/
private void checkSaveData(List<Map> resultRows) {
// 数据校验
for (int i = 0; i < resultRows.size(); i++) {
HGKC007A hgkc007A = new HGKC007A();
hgkc007A.fromMap(resultRows.get(i));
//AssertUtils.isNull(hgkc007A.getStatus(), "是否启用不能为空");
}
}
/**
* 新增
*
* @param hgkc007A
* @throws Exception
*/
private void add(HGKC007A hgkc007A,HGKC007 hgkc007) throws Exception {
hgkc007A.setPrimaryId(hgkc007.getId());
hgkc007A.setSource(1);
hgkc007A.setOtherOutNo(hgkc007.getOtherOutNo());
DaoUtils.insert(HGKC007A.INSERT, hgkc007A);
// 更新库存数量
HGKCUtils.HgKc010.updateInv(hgkc007.getCompanyCode(), hgkc007.getWhCode(), hgkc007A.getInventRecordId(),
hgkc007A.getInvQty().negate(), hgkc007A.getInvUnitWeight().negate(), hgkc007A.getInvWeight().negate());
}
/**
* 修改数据
*
* @param hgkc007A
*/
private void modify(HGKC007A hgkc007A) {
DaoUtils.update(HGKC007A.UPDATE, hgkc007A);
}
/**
* 修改操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他出库明细", operType = "修改", operDesc = "修改操作")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据校验
this.checkSaveData(resultRows);
for (int i = 0; i < resultRows.size(); i++) {
HGKC007A hppz009 = new HGKC007A();
hppz009.fromMap(resultRows.get(i));
DaoUtils.update(HGKC007A.UPDATE, hppz009);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "其他出库明细", operType = "删除", operDesc = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGKC007A hgkc007A = new HGKC007A();
hgkc007A.fromMap(resultRows.get(i));
// 校验企业下是否存在用户
int count = HGXSTools.XsUser.countByAccount(hgkc007A.getAccountCode());
if (count > 0) {
// throw new PlatException(String.format("企业[%s]已关联用户,请先解除用户", hgkc007A.getAccountName()));
}
DaoUtils.update(HGKC007A.DELETE, hgkc007A);
// 扣减库存
Map queryMap = new HashMap();
queryMap.put("id",inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC006A.FIELD_PRIMARY_ID));
List<HGKC007> list = this.dao.query(HGKC007.QUERY,queryMap);
HGKCUtils.HgKc010.updateInv(list.get(0).getCompanyCode(), list.get(0).getWhCode(), hgkc007A.getInventRecordId(),
hgkc007A.getInvQty(), hgkc007A.getInvWeight());
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
......@@ -3,11 +3,7 @@ package com.baosight.hggp.hg.kc.utils;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC002;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC011;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
......@@ -170,7 +166,40 @@ public class HGKCUtils {
return HGKCTools.HgKc003.map(depositNos);
}
}
public static class HgKc006 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HGUtils.setCondition(queryRow);
String otherEnterDate = MapUtils.getString(queryRow, HGKC006.FIELD_OTHER_ENTER_DATE);
if (StringUtils.isNotBlank(otherEnterDate)) {
queryRow.put(HGKC006.FIELD_OTHER_ENTER_DATE, DateUtils.formatShort(otherEnterDate));
}
}
}
public static class HgKc007 {
/**
* 设置查询条件
*
* @param queryRow 集合
* @return
*/
public static void setCondition(Map queryRow) {
HGUtils.setCondition(queryRow);
String otherOutDate = MapUtils.getString(queryRow, HGKC007.FIELD_OTHER_OUT_DATE);
if (StringUtils.isNotBlank(otherOutDate)) {
queryRow.put(HGKC007.FIELD_OTHER_OUT_DATE, DateUtils.formatShort(otherOutDate));
}
}
}
/**
* HGKC010 工具类
*
......
......@@ -64,7 +64,7 @@ public class HGSC007 extends DaoEPBase {
public static final String FIELD_updated_by = "updatedBy"; /* 更新人*/
public static final String FIELD_updated_name = "updatedName"; /* 修改人名称*/
public static final String FIELD_updated_time = "updatedTime"; /* 更新时间*/
public static final String FIELD_order_date = "orderDate"; /* 生产任务日期*/
public static final String COL_id = "id";
public static final String COL_mat_id = "mat_id"; /* 物料清单ID*/
......@@ -157,7 +157,7 @@ public class HGSC007 extends DaoEPBase {
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
private String orderDate = " "; /* 生产任务日期*/
/**
* initialize the metadata.
......@@ -342,9 +342,7 @@ public class HGSC007 extends DaoEPBase {
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_order_date);
eiColumn.setDescName("生产任务日期");
eiMetadata.addMeta(eiColumn);
}
......@@ -1012,18 +1010,6 @@ public class HGSC007 extends DaoEPBase {
this.updatedTime = updatedTime;
}
/**
* set the orderDate - 生产任务日期.
*
* @param orderDate - 生产任务日期
*/
public void setOrderDate(String orderDate) {
this.orderDate = orderDate;
}
public String getOrderDate() {
return orderDate;
}
/**
* get the value from Map.
......@@ -1074,7 +1060,7 @@ public class HGSC007 extends DaoEPBase {
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_by)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_name)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_time)), updatedTime));
setOrderDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_order_date)), orderDate));
}
/**
......@@ -1125,7 +1111,6 @@ public class HGSC007 extends DaoEPBase {
map.put(FIELD_updated_by, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_updated_by)));
map.put(FIELD_updated_name, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_updated_name)));
map.put(FIELD_updated_time, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_updated_time)));
map.put(FIELD_order_date, StringUtils.toString(orderDate, eiMetadata.getMeta(FIELD_order_date)));
return map;
}
......
......@@ -156,7 +156,7 @@ public class ServiceHGSC001 extends ServiceBase {
AssertUtils.isEmpty(hgsc001.getStartDate(), "请选择开工日期!");
AssertUtils.isEmpty(hgsc001.getEndDate(), "请选择完工日期!");
AssertUtils.isTrue(DateUtil.toDate(hgsc001.getEndDate(),DateUtil.DATE10_PATTERN).compareTo(
DateUtil.toDate(hgsc001.getStartDate(),DateUtil.DATE10_PATTERN))<0,"完工日期不能于开工日期!");
DateUtil.toDate(hgsc001.getStartDate(),DateUtil.DATE10_PATTERN))<0,"完工日期不能于开工日期!");
AssertUtils.isNull(hgsc001.getProjStatus(), "请选择项目状态!");
AssertUtils.isEmpty(hgsc001.getContractWorkTxt(), "请填写合同工作量!");
......
......@@ -4,7 +4,6 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.AssignStatusEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.sc.domain.HGSC006;
import com.baosight.hggp.hg.sc.domain.HGSC006A;
import com.baosight.hggp.hg.sc.domain.HGSC007;
......@@ -82,17 +81,16 @@ public class ServiceHGSC006A extends ServiceBase {
}
// 写入子表数据
HGSC007 hgsc007 = new HGSC007();
String getCreatedTime = hgsc006.getCreatedTime(); //获取订单创建时间,并截取
String subCreatedTime =getCreatedTime.substring(0,8);
BeanUtils.copyProperties(hgsc006A,hgsc007);
cleanBaseInfo(hgsc007);
hgsc007.setTaskCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC007_TASK_CODE));
hgsc007.setMatId(hgsc006.getMatId());
hgsc007.setOrderId(hgsc006.getId());
hgsc007.setOrderDate(subCreatedTime);
hgsc007.setOrderDetailId(hgsc006A.getId());
hgsc007.setQuantity(assignQuantity);
hgsc007.setUnfinishQuantity(assignQuantity);
hgsc007.setTotalWeight(hgsc006A.getSingleWeight().multiply(new BigDecimal(assignQuantity)));
hgsc007.setUnfinishWeight(hgsc007.getTotalWeight());
hgsc007.setGroupCode(groupCode);
hgsc007.setGroupName(groupName);
hgsc007.setFactoryCode(factoryCode);
......
......@@ -183,17 +183,16 @@ public class ServiceHGSC006B extends ServiceBase {
HGSCTools.checkAssignedNum(orderDetailId, hgsc007.getQuantity());
HGSC007 add007 = new HGSC007();
String getCreatedTime = hgsc006.getCreatedTime(); //获取订单创建时间,并截取
String subCreatedTime =getCreatedTime.substring(0,8);
BeanUtils.copyProperties(hgsc006A,add007);
cleanBaseInfo(add007);
add007.setTaskCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC007_TASK_CODE));
add007.setMatId(hgsc006.getMatId());
add007.setOrderId(hgsc006.getId());
add007.setOrderDate(subCreatedTime);
add007.setOrderDetailId(hgsc006A.getId());
add007.setQuantity(hgsc007.getQuantity());
add007.setUnfinishQuantity(hgsc007.getQuantity());
add007.setTotalWeight(hgsc006A.getSingleWeight().multiply(new BigDecimal(hgsc007.getQuantity())));
add007.setUnfinishWeight(add007.getTotalWeight());
add007.setGroupCode(hgsc007.getGroupCode());
add007.setGroupName(hgsc007.getGroupName());
add007.setFactoryCode(hgsc007.getFactoryCode());
......
......@@ -36,9 +36,9 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
public EiInfo query(EiInfo inInfo) {
try {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
String orderDate = block.getCellStr(ACConstants.ROW_CODE_0, HGSC007.FIELD_order_date);
if (!orderDate.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSC007.FIELD_order_date, StringUtil.removeHorizontalLine(orderDate));
String creatTime = block.getCellStr(ACConstants.ROW_CODE_0, HGSC007.FIELD_created_time);
if (!creatTime.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime));
}
inInfo = super.query(inInfo,HGSC007.QUERY,new HGSC007() );
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
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.springframework.beans.BeanUtils;
import java.math.BigDecimal;
import java.util.*;
/**
* @author wwl
* @version 1.0 2024/5/24
*/
public class ServiceHGSC007A extends ServiceEPBase {
@OperationLogAnnotation(operModul = "生产任务", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String taskId = MapUtils.getString(queryMap, HGSC008.FIELD_task_id);
HGSC007 hgsc007 = HGSCTools.THGSC007.getById(Long.valueOf(taskId));
HGSC008 hgsc008 = new HGSC008();
BeanUtils.copyProperties(hgsc007,hgsc008);
List<HGSC008> old008List = HGSCTools.THGSC008.getByTaskId(Long.valueOf(taskId));
hgsc008.setTaskQuantity(hgsc007.getQuantity());
hgsc008.setTaskWeight(hgsc007.getTotalWeight());
hgsc008.setRegisteredQuantity(Optional.ofNullable(old008List).orElse(new ArrayList<>()).stream().mapToInt(HGSC008::getQuantity).sum());
hgsc008.setRegisteredWeight(Optional.ofNullable(old008List).orElse(new ArrayList<>()).stream().map(HGSC008::getTotalWeight).reduce(BigDecimal.ZERO, BigDecimal::add));
hgsc008.setUnregisterQuantity(hgsc007.getQuantity() - hgsc008.getRegisteredQuantity());
hgsc008.setUnregisterWeight(hgsc007.getTotalWeight().subtract(hgsc008.getRegisteredWeight()));
hgsc008.setRegisterDate(DateUtil.toDateStr(new Date(),DateUtil.DATE10_PATTERN));
hgsc008.setQuantity(null);
hgsc008.setTotalWeight(null);
inInfo.addBlock(EiConstant.resultBlock).addRow(hgsc008);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
......@@ -385,7 +385,7 @@
SELECT distinct
proj_code as "projCode", <!-- 项目编码 -->
CONCAT(proj_code,"-",proj_name) as "projName" <!-- 项目名称 -->
FROM ${hggpSchema}.HGSC001 WHERE approval_status = 2
FROM ${hggpSchema}.HGSC001 WHERE approval_status = 2 and proj_status = 0
<include refid="condition" />
</select>
</sqlMap>
......@@ -160,7 +160,7 @@
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
created_time LIKE CONCAT('%', #createdTime# ,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
......@@ -171,9 +171,7 @@
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orderDate">
order_date = #orderDate#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -219,8 +217,7 @@
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime", <!-- 更新时间 -->
order_date as "orderDate" <!-- 生产任务日期 -->
updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC007 WHERE 1=1
<include refid="condition" />
......@@ -407,10 +404,10 @@
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time, <!-- 更新时间 -->
order_date <!-- 生产任务日期 -->
updated_time <!-- 更新时间 -->
)
VALUES (#id#, #matId#, #orderId#, #orderDetailId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #taskCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #completeDate#, #quantity#, #finishQuantity#, #unfinishQuantity#, #singleWeight#, #totalWeight#, #finishWeight#, #unfinishWeight#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#,#orderDate#)
VALUES (#id#, #matId#, #orderId#, #orderDetailId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #taskCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #completeDate#, #quantity#, #finishQuantity#, #unfinishQuantity#, #singleWeight#, #totalWeight#, #finishWeight#, #unfinishWeight#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
</insert>
<delete id="delete">
......@@ -460,8 +457,7 @@
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime#, <!-- 更新时间 -->
order_date = #orderDate# <!-- 生产任务日期 -->
updated_time = #updatedTime# <!-- 更新时间 -->
WHERE
id = #id#
</update>
......
......@@ -92,7 +92,6 @@ public class HGSCTools {
if(CollectionUtils.isNotEmpty(otherSc006AList)){
unassignQuantity = otherSc006AList.stream().mapToInt(HGSC006A::getUnassignQuantity).sum();
totalQuantity = otherSc006AList.stream().mapToInt(HGSC006A::getQuantity).sum();
}
AssignStatusEnum orderAssignStatus ;
switch (orderDetailAssignStatus){
......@@ -159,6 +158,9 @@ public class HGSCTools {
.collect(Collectors.toList());
long count = stringList.stream().distinct().count();
AssertUtils.isTrue(stringList.size() != count, "项目负责人重复!");
objList.stream().forEach( o -> {
AssertUtils.isEmpty(o.getUserCode(), "请选择负责人!");
});
}
public static List<HGSC001A> save(List<HGSC001A> hgsc001AList, Long projId){
......@@ -372,8 +374,10 @@ public class HGSCTools {
HGSC005A uo = op.get();
uo.setQuantity(uo.getQuantity()+o.getQuantity());
uo.setUnfinishQuantity(uo.getUnfinishQuantity()+o.getQuantity());
handleWeight(hgsc005a,uo);
updateList.add(uo);
}else{
handleWeight(hgsc005a,o);
createList.add(o);
}
});
......@@ -403,8 +407,10 @@ public class HGSCTools {
HGSC005A uo = op.get();
uo.setQuantity(o.getQuantity());
uo.setUnfinishQuantity(o.getQuantity()-uo.getFinishQuantity());
handleWeight(hgsc005a,uo);
updateList.add(uo);
}else{
handleWeight(hgsc005a,o);
createList.add(o);
}
});
......@@ -429,10 +435,12 @@ public class HGSCTools {
oldObjMap.forEach((k,v)->{
HGSC005A oldObj = v.get();
if(oldObj.getQuantity()-hgsc005a.getQuantity()<=0){
handleWeight(hgsc005a,oldObj);
deleteIds.add(oldObj.getId());
}else{
oldObj.setQuantity(oldObj.getQuantity()-hgsc005a.getQuantity());
oldObj.setUnfinishQuantity(oldObj.getQuantity()-oldObj.getFinishQuantity());
handleWeight(hgsc005a,oldObj);
updateList.add(oldObj);
}
});
......@@ -449,6 +457,15 @@ public class HGSCTools {
}
}
private static void handleWeight(HGSC005A hgsc005a, HGSC005A target){
if(Objects.nonNull(hgsc005a.getSingleWeight())) {
target.setSingleWeight(hgsc005a.getSingleWeight());
target.setTotalWeight(hgsc005a.getSingleWeight().multiply(new BigDecimal(target.getQuantity())));
target.setFinishWeight(hgsc005a.getSingleWeight().multiply(new BigDecimal(target.getFinishQuantity())));
target.setUnfinishWeight(hgsc005a.getSingleWeight().multiply(new BigDecimal(target.getUnfinishQuantity())));
}
}
/**
* 校验修改的数据
*
......@@ -552,6 +569,11 @@ public class HGSCTools {
.divide(timing,2, ROUND_DOWN)
.multiply(baseWorkHour).add(finalRemainder));
break;
case ZL:
workHour.set(planInfo.getTotalWeight().multiply(composingCoeff)
.divide(timing,2, ROUND_DOWN)
.multiply(baseWorkHour).add(finalRemainder));
break;
default:
break;
}
......@@ -718,6 +740,14 @@ public class HGSCTools {
}
public static class THGSC008{
public static List<HGSC008> getByTaskId(Long taskId){
AssertUtils.isTrue(Objects.isNull(taskId)||taskId<=0, "生产任务ID不能为空!");
List<HGSC008> results = DaoBase.getInstance().query(HGSC008.QUERY, new HashMap<String,Object>(){{put(HGSC008.FIELD_task_id, taskId);}});
return CollectionUtils.isEmpty(results) ? null : results;
}
}
}
......@@ -20,6 +20,10 @@
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC003.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC006.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC006A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC007.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC007A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC004.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC004A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010.xml"/>
......@@ -45,6 +49,9 @@
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW008.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW009.xml"/>
<!-- <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW014.xml"/>-->
<!-- <sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW015.xml"/>-->
<!--配置-->
<sqlMap resource="com/baosight/hggp/hg/pz/sql/HGPZ005A.xml"/>
......
......@@ -63,23 +63,7 @@ let query = function () {
*/
/**
* 修改
*/
function updateFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
JSColorbox.open({
href: "HGCW010B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>修改合同</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function windowCallback() {
......@@ -89,19 +73,10 @@ function windowCallback() {
JSColorbox.close();
}
function contractDetailFunc(id) {
JSColorbox.open({
href: "HGCW010C?methodName=initLoad&id=" + id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>合同详情</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function fileDetailFunc(id) {
JSColorbox.open({
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=HT&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW010",
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=KP&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW010",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
......
......@@ -20,6 +20,7 @@
<EF:EFColumn ename="thisPriceTax" cname="结算价税合计金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementTax" cname="结算税金" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementAmount" cname="结算金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="billNumber" cname="发票号" width="120" enable="false" readonly="true" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="detail2" title="附件信息">
......@@ -34,7 +35,7 @@
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="生成" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
......
let whNameGlobalData = [];
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [{
field: "operator",
template: function (item) {
let submitStatus = item.submitStatus;
let template = '';
if (submitStatus) {
if (submitStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',1)" >提交</a>';
}
}
// 详情
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="jump(' + item.id + ')" >详情</a>';
}
return template;
}
},{
field: "otherEnterDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
},{
field: "whCode",
filter: function (options) {
return _.filter(WhNameGlobalData, function (item) {
return item["param1Field"]=="true";
})
},
template: function (dataItem) {
for (let i = 0; i < WhNameGlobalData.length; i++) {
if (WhNameGlobalData[i]['valueField'] === dataItem['whCode']) {
return WhNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
//inInfo.set("inqu_status-0-whType", options.model["whType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HGPZ007");
inInfo.set("methodName", "queryWhCodeBox");
inInfo.set("blockId", "wh_code_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},],
loadComplete: function (grid) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择生产任务
$("#SELECT_TASK").on("click", selectTask);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
query();
initWh();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 初始化仓库
*/
let initWh = function () {
let inInfo = new EiInfo();
EiCommunicator.send("HGPZ007", "queryWhCodeBox", inInfo, {
onSuccess: function (ei) {
WhNameGlobalData = ei.getBlock("wh_code_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
//提交
function check(id, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-submitStatus", auditStatus);
EiCommunicator.send('HGKC006', 'check', inEiInfo, {
onSuccess(response) {
message("提交成功");
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
//详情
function jump(id) {
var herf = ctx + "\\web\\" + "HGKC006A?inqu_status-0-primaryId=" + id + "&efParentFormEname=HGKC006";
window.open(herf);
}
/**
* 选择生产任务
*/
let selectTask = function () {
JSColorbox.open({
href: "HGKC003A?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>",
width: "80%",
height: "80%",
callbackName: selectTaskCallback
});
}
/**
* 挑选库存回调
*/
let selectTaskCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let whCode= item.get("whCode");
if(isBlank(whCode)){
message("选中的第"+(index+1)+"行\"仓库名称\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC006", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC006", "delete", true);
}
});
}
<!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}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="其他入库单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker cname="单据日期" ename="otherEnterDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="其他入库单号" ename="otherEnterNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="仓库名称" ename="whCode" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="单据状态" ename="submitStatus" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hpkc.submitStatus"/>
</EF:EFSelect>
</div>
<%-- <div class="row">
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFDateSpan startCname="创建日期(从)" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>--%>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="otherEnterDate" cname="单据日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="otherEnterNo" cname="其他入库单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true"/>
<EF:EFComboColumn cname="状态" ename="submitStatus" width="90" align="center" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hpkc.submitStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
let InventNameGlobalData = [];
let inventAllGlobalData = [];
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [{
field: "inventCode",
filter: function (options) {
return _.filter(InventNameGlobalData, function (item) {
return item["param1Field"]=="true";
})
},
template: function (dataItem) {
for (let i = 0; i < InventNameGlobalData.length; i++) {
if (InventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
return InventNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "invent_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},{
field: "inventRecordId",
filter: function (options) {
return _.filter(inventAllGlobalData, function (item) {
return item["param7Field"]=="true";
})
},
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryInventBoxAll");
inInfo.set("blockId", "invent_all_box_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}, ],
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function(e) {
if (e.field === "inventCode"){
loadChange(grid,e,"inventRecordId");
}
else if (e.field == "inventRecordId") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === item.inventRecordId) {
resultGrid.setCellValue(item, 'partLength', inventAllGlobalData[i]['param3Field'])
resultGrid.setCellValue(item, 'partWidth', inventAllGlobalData[i]['param4Field'])
resultGrid.setCellValue(item, 'partThick', inventAllGlobalData[i]['param5Field'])
}
}
}
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择生产任务
$("#SELECT_TASK").on("click", selectTask);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
initInvent();
initSpec();
}
/**
* 初始化存货
*/
let initInvent = function () {
let inInfo = new EiInfo();
EiCommunicator.send("HGPZ005", "queryInventCodeBox", inInfo, {
onSuccess: function (ei) {
InventNameGlobalData = ei.getBlock("invent_record_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 初始化规格
*/
let initSpec = function () {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HGPZ005", "queryInventBoxAll", inInfo, {
onSuccess: function (ei) {
inventAllGlobalData = ei.getBlock("invent_all_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 选择生产任务
*/
let selectTask = function () {
JSColorbox.open({
href: "HGKC003A?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>",
width: "80%",
height: "80%",
callbackName: selectTaskCallback
});
}
/**
* 挑选库存回调
*/
let selectTaskCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let whCode= item.get("whCode");
/* if(isBlank(whCode)){
message("选中的第"+(index+1)+"行\"仓库名称\",不能为空!");
flag = false;
return false;
}*/
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC006A", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC006A", "delete", true);
}
});
}
<!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="查询条件">
<div class="row">
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="主表id" ename="primaryId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
</div>
<%-- <div class="row">
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFDateSpan startCname="创建日期(从)" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>--%>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="partLength" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partWidth" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partThick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invQty" cname="数量" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="invUnitWeight" cname="单重" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="总重" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="amount" cname="金额" width="120" align="right" enable="false" format="{0:N3}"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
let whNameGlobalData = [];
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [{
field: "operator",
template: function (item) {
let submitStatus = item.submitStatus;
let template = '';
if (submitStatus) {
if (submitStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;" ' +
'onclick="check(' + item.id + ',1)" >提交</a>';
}
}
// 详情
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="jump(' + item.id + ')" >详情</a>';
}
return template;
}
},{
field: "otherOutDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
},{
field: "whCode",
filter: function (options) {
return _.filter(WhNameGlobalData, function (item) {
return item["param1Field"]=="true";
})
},
template: function (dataItem) {
for (let i = 0; i < WhNameGlobalData.length; i++) {
if (WhNameGlobalData[i]['valueField'] === dataItem['whCode']) {
return WhNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
//inInfo.set("inqu_status-0-whType", options.model["whType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HGPZ007");
inInfo.set("methodName", "queryWhCodeBox");
inInfo.set("blockId", "wh_code_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},],
loadComplete: function (grid) {
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择生产任务
$("#SELECT_TASK").on("click", selectTask);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
query();
initWh();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 初始化仓库
*/
let initWh = function () {
let inInfo = new EiInfo();
EiCommunicator.send("HGPZ007", "queryWhCodeBox", inInfo, {
onSuccess: function (ei) {
WhNameGlobalData = ei.getBlock("wh_code_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
//提交
function check(id, auditStatus) {
const inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-submitStatus", auditStatus);
EiCommunicator.send('HGKC007', 'check', inEiInfo, {
onSuccess(response) {
message("提交成功");
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
},
{
async: false
}
);
}
//详情
function jump(id) {
var herf = ctx + "\\web\\" + "HGKC007A?inqu_status-0-primaryId=" + id + "&efParentFormEname=HGKC007";
window.open(herf);
}
/**
* 选择生产任务
*/
let selectTask = function () {
JSColorbox.open({
href: "HGKC003A?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>",
width: "80%",
height: "80%",
callbackName: selectTaskCallback
});
}
/**
* 挑选库存回调
*/
let selectTaskCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let whCode= item.get("whCode");
if(isBlank(whCode)){
message("选中的第"+(index+1)+"行\"仓库名称\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC007", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC007", "delete", true);
}
});
}
<!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}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="其他出库单">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker cname="单据日期" ename="otherOutDate" blockId="inqu_status" row="0" colWidth="3"
format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="其他出库单号" ename="otherOutNo" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFSelect cname="仓库名称" ename="whCode" blockId="inqu_status" row="0" colWidth="3"
filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="单据状态" ename="submitStatus" blockId="inqu_status" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hpkc.submitStatus"/>
</EF:EFSelect>
</div>
<%-- <div class="row">
<EF:EFInput cname="部件名称" ename="prdtName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="零件名称" ename="partName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFDateSpan startCname="创建日期(从)" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>--%>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="140" align="center"/>
<EF:EFColumn ename="otherOutDate" cname="单据日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="otherOutNo" cname="其他入库单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" />
<EF:EFComboColumn cname="状态" ename="submitStatus" width="90" align="center" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hpkc.submitStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
let InventNameGlobalData = [];
let inventAllGlobalData = [];
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [{
field: "inventCode",
filter: function (options) {
return _.filter(InventNameGlobalData, function (item) {
return item["param1Field"]=="true";
})
},
template: function (dataItem) {
for (let i = 0; i < InventNameGlobalData.length; i++) {
if (InventNameGlobalData[i]['valueField'] === dataItem['inventCode']) {
return InventNameGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventType", options.model["inventType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryComboBox");
inInfo.set("blockId", "invent_record_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
},{
field: "inventRecordId",
filter: function (options) {
return _.filter(inventAllGlobalData, function (item) {
return item["param7Field"]=="true";
})
},
template: function (dataItem) {
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === dataItem['inventRecordId']) {
return inventAllGlobalData[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventCode", options.model["inventCode"]);
inInfo.set("serviceName", "HGPZ005");
inInfo.set("methodName", "queryInventBoxAll");
inInfo.set("blockId", "invent_all_box_block_id");
inInfo.set("field", options.field);
refreshSelect(container, inInfo);
}
}, ],
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function(e) {
if (e.field === "inventCode"){
loadChange(grid,e,"inventRecordId");
}
else if (e.field == "inventRecordId") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
for (let i = 0; i < inventAllGlobalData.length; i++) {
if (inventAllGlobalData[i]['valueField'] === item.inventRecordId) {
resultGrid.setCellValue(item, 'partLength', inventAllGlobalData[i]['param3Field'])
resultGrid.setCellValue(item, 'partWidth', inventAllGlobalData[i]['param4Field'])
resultGrid.setCellValue(item, 'partThick', inventAllGlobalData[i]['param5Field'])
}
}
}
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
save();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
// 查询
$("#QUERY").on("click", query);
// 选择生产任务
$("#SELECT_TASK").on("click", selectTask);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
initInvent();
initSpec();
}
/**
* 初始化存货
*/
let initInvent = function () {
let inInfo = new EiInfo();
EiCommunicator.send("HGPZ005", "queryInventCodeBox", inInfo, {
onSuccess: function (ei) {
InventNameGlobalData = ei.getBlock("invent_record_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 初始化规格
*/
let initSpec = function () {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-inventTypes", [1, 2]);
inInfo.set("inqu_status-0-isSplicingSymbol", false);
EiCommunicator.send("HGPZ005", "queryInventBoxAll", inInfo, {
onSuccess: function (ei) {
inventAllGlobalData = ei.getBlock("invent_all_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
}, {async: false});
}
/**
* 选择生产任务
*/
let selectTask = function () {
JSColorbox.open({
href: "HGKC003A?methodName=initLoad",
title: "<div style='text-align: center;'>生产任务查询</div>",
width: "80%",
height: "80%",
callbackName: selectTaskCallback
});
}
/**
* 挑选库存回调
*/
let selectTaskCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 保存
*/
let save = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
/* let whCode= item.get("whCode");
if(isBlank(whCode)){
message("选中的第"+(index+1)+"行\"仓库名称\",不能为空!");
flag = false;
return false;
}*/
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC007A", "save", true);
}
});
}
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC007A", "delete", true);
}
});
}
<!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="查询条件">
<div class="row">
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="invent_record_box_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="主表id" ename="primaryId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货名称" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventRecordId" cname="规格" width="120" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="partLength" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partWidth" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="partThick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invQty" cname="数量" width="120" align="right" format="{0:N0}"/>
<EF:EFColumn ename="invUnitWeight" cname="单重" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="总重" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="prdtCode" cname="部件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="partCode" cname="零件编码" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="amount" cname="金额" width="120" align="right" enable="false" format="{0:N3}"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -54,6 +54,7 @@ function assign() {
let flag = true;
$.each(rows, function(index, item) {
let compareProductType = item.get("productType");
ids.push(item.id)
if(productType != compareProductType){
IPLAT.alert({
message : "选中的生产订单不属于同一工种,无法分派!",
......@@ -70,8 +71,8 @@ function assign() {
JSColorbox.open({
href: "HGSC098?methodName=initLoad&inqu_status-0-companyCode=" + companyCode + "&inqu_status-0-productType=" + productType,
title: "<div style='text-align: center;'>选择组织</div>",
width: "70%",
height: "70%",
width: "90%",
height: "90%",
callbackName: function (row) {
var info = new EiInfo()
info.set("ids", ids.join(','));
......@@ -113,12 +114,12 @@ function separateAssign(orderDetailId){
}
function showTaskInfo(orderDetailId) {
// JSColorbox.open({
// href: "HGSC007?methodName=initLoad&inqu_status-0-orderDetailId=" + orderDetailId + "&efParentFormEname=HGSC006A",
// title: "<div style='text-align: center;'>生产任务详情</div>",
// width: "90%",
// height: "90%"
// });
JSColorbox.open({
href: "HGSC007?methodName=initLoad&inqu_status-0-orderDetailId=" + orderDetailId + "&efParentFormEname=HGSC006A",
title: "<div style='text-align: center;'>生产任务详情</div>",
width: "90%",
height: "90%"
});
}
/**
......
......@@ -123,10 +123,10 @@ function query() {
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
})
// $(window).load(function () {
// // 查询
// query();
// })
/**
* 保存
......
......@@ -14,7 +14,12 @@ $(function () {
{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
let template = '';
if(item.unfinishQuantity>0){
template+='<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="registerWork(' + item.id + ')" >报工</a>';
}
template+='<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.matId + ')" >附件清单</a>';
return template;
}
......@@ -47,3 +52,21 @@ function showUploadFile(id) {
});
}
function registerWork(id) {
JSColorbox.open({
href: "HGSC007A?methodName=initLoad&inqu_status-0-taskId=" + id,
title: "<div style='text-align: center;'>报工</div>",
width: "90%",
height: "60%",
callbackName: registerWorkCallback
});
}
function registerWorkCallback(ei) {
if (ei.getStatus() >= 0) {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
}
......@@ -22,7 +22,7 @@
<EF:EFInput blockId="inqu_status" row="0" ename="productName" cname="产品名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="班组名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="orderDate" cname="生产任务日期" role="date"
<EF:EFDatePicker blockId="inqu_status" row="0" ename="createdTime" cname="生产任务日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<%--<EF:EFDatePicker blockId="inqu_status" row="0" ename="complete_date" cname="生产完工日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>--%>
......@@ -39,7 +39,7 @@
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="220" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="orderDate" cname="生产任务日期" width="120" enable="true" readonly="false" align="center" editType="date"
<EF:EFColumn ename="createdTime" cname="生产任务日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="taskCode" cname="生产任务单号" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productCode" cname="产品编码" width="100" enable="false" readonly="true" align="center"/>
......
$(function () {
$("#result-0-quantity_textField").on('change',function () {
var quantity = $("#result-0-quantity_textField").val();
if(!isPositiveInteger(quantity)){
message("报工数量必须是大于0的正整数")
}
var singleWeight = $("#result-0-singleWeight_textField").val();
if(isPositiveNumber(singleWeight)) {
$("#result-0-totalWeight_textField").val((parseInt(singleWeight*quantity*100)/100).toFixed(2));
}
})
/**
* 取消
*/
$('#cancel').on('click', function () {
// 关闭弹窗
parent.JSColorbox.close();
})
/**
* 保存*
*/
$("#btn_save").on("click",function(){
var quantity = $("#result-0-quantity_textField").val();
if(!isPositiveInteger(quantity)){
message("报工数量必须是大于0的正整数");
return ;
}
var registerDate = $("#result-0-registerDate").val();
if(!registerDate){
message("报工日期不能为空!");
return ;
}
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail", "HGSC001", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
}
});
});
});
<!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="报工">
<div class="row">
<EF:EFInput ename="result-0-taskId" cname="生产任务ID" type="hidden"/>
<EF:EFInput ename="result-0-productCode" cname="产品编码" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-productName" cname="产品名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-processName" cname="工序" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-singleWeight" cname="单重" colWidth="4" format="{0:0.00}" editType="text" readonly="true"/>
<EF:EFInput ename="result-0-taskQuantity" cname="任务数量" format="{0:0}" editType="text" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-taskWeight" cname="任务重量" format="{0:0.00}" editType="text" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-registeredQuantity" cname="已报工数量" format="{0:0}" editType="text" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-registeredWeight" cname="已报工重量" format="{0:0.00}" editType="text" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-unregisterQuantity" cname="剩余数量" format="{0:0}" editType="text" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-unregisterWeight" cname="剩余重量" format="{0:0.00}" editType="text" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-groupName" cname="班组" colWidth="4" required="true" readonly="true"/>
<EF:EFDatePicker cname="报工日期" ename="result-0-registerDate" colWidth="4"
format="yyyy-MM-dd" required="true" readonly="false"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-quantity" cname="报工数量" format="{0:0}" editType="text" colWidth="4" required="true" />
<EF:EFInput ename="result-0-totalWeight" cname="报工重量" format="{0:0.00}" editType="text" colWidth="4" readonly="true"/>
</div>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
......@@ -10,13 +10,13 @@
<EF:EFInput cname="公司编码" ename="companyCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="产品类型" ename="productType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFSelect ename="inqu_status-0-factoryCode" cname="工厂" colWidth="3" filter="contains"
<EF:EFSelect ename="inqu_status-0-factoryCode" cname="工厂" colWidth="4" filter="contains"
template="#=textField#" valueTemplate="#=textField#">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="factoryName" valueField="factoryCode"/>
</EF:EFSelect>
<EF:EFCascadeSelect cascadeFrom="inqu_status-0-factoryCode" cname="工作组" ename="inqu_status-0-groupCode"
colWidth="4" required="true" filter="contains" defaultValue=""
colWidth="4" filter="contains" defaultValue=""
serviceName="HGSC098" methodName="workGroupComboBox" resultId="workGroup"
textField="groupName" valueField="groupCode" >
</EF:EFCascadeSelect>
......
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