Commit c1bab8cf by 宋祥

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

parents 03bf3adb ca864c64
......@@ -198,6 +198,10 @@ public class HGConstant {
//打包单号
public static final String PACK_CODE = "PACK_CODE";
//采购收票单号
public static final String HGCW12_INVOICE_CODE = "HGCW12_INVOICE_CODE";
//单号
public static final String HGCW10_INVOICE_CODE = "HGCW10_INVOICE_CODE";
}
/**
......
......@@ -52,6 +52,7 @@ public class HGCW010 extends DaoEPBase {
public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 剩余开票/收票金额*/
public static final String FIELD_COMPANY_CODES = "companyCodes";
public static final String FIELD_BRANCH_UNIT = "branchUnit";
public static final String FIELD_INVOICE_CODE = "invoiceCode";
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -114,6 +115,7 @@ public class HGCW010 extends DaoEPBase {
private String depCode = " "; /* 部门编码*/
private BigDecimal remainingAmount = new BigDecimal("0"); /* 累计结算价税合计金额*/
private String branchUnit = " ";
private String invoiceCode = " ";
/**
* initialize the metadata.
......@@ -240,6 +242,10 @@ public class HGCW010 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_BRANCH_UNIT);
eiColumn.setDescName("分支单位");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_CODE);
eiColumn.setDescName("开票单号");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -650,6 +656,14 @@ public class HGCW010 extends DaoEPBase {
this.branchUnit = branchUnit;
}
public String getInvoiceCode() {
return invoiceCode;
}
public void setInvoiceCode(String invoiceCode) {
this.invoiceCode = invoiceCode;
}
/**
* get the value from Map.
*
......@@ -684,6 +698,7 @@ public class HGCW010 extends DaoEPBase {
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setRemainingAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_AMOUNT)), remainingAmount));
setBranchUnit(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("branchUnit")), branchUnit));
setInvoiceCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVOICE_CODE)), invoiceCode));
}
/**
......@@ -719,6 +734,7 @@ public class HGCW010 extends DaoEPBase {
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)));
map.put(FIELD_BRANCH_UNIT, StringUtils.toString(branchUnit, eiMetadata.getMeta(FIELD_BRANCH_UNIT)));
map.put(FIELD_INVOICE_CODE, StringUtils.toString(invoiceCode, eiMetadata.getMeta(FIELD_INVOICE_CODE)));
return map;
}
......
......@@ -59,6 +59,7 @@ public class HGCW012 extends DaoEPBase {
public static final String FIELD_DEPOSIT_QTY = "depositQty"; /* 入库数量*/
public static final String FIELD_RECEIVE_WEIGHT = "receiveWeight"; /* 收货重量*/
public static final String FIELD_CONTRACT_NO = "contractNo"; /* 合同号*/
public static final String FIELD_INVOICE_CODE = "invoiceCode";
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -132,6 +133,7 @@ public class HGCW012 extends DaoEPBase {
private BigDecimal depositQty = new BigDecimal("0"); /* 入库数量*/
private BigDecimal receiveWeight = new BigDecimal("0"); /* 收货重量*/
private String contractNo = " "; /* 合同号*/
private String invoiceCode = " ";
/**
* initialize the metadata.
......@@ -288,6 +290,9 @@ public class HGCW012 extends DaoEPBase {
eiColumn.setDescName("合同号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVOICE_CODE);
eiColumn.setDescName("开票单号");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -817,6 +822,14 @@ public class HGCW012 extends DaoEPBase {
public void setContractNo(String contractNo) {
this.contractNo = contractNo;
}
public String getInvoiceCode() {
return invoiceCode;
}
public void setInvoiceCode(String invoiceCode) {
this.invoiceCode = invoiceCode;
}
/**
* get the value from Map.
*
......@@ -859,6 +872,7 @@ public class HGCW012 extends DaoEPBase {
setDepositQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DEPOSIT_QTY)), depositQty));
setReceiveWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_RECEIVE_WEIGHT)), receiveWeight));
setContractNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NO)), contractNo));
setInvoiceCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INVOICE_CODE)), invoiceCode));
}
/**
......@@ -902,6 +916,7 @@ public class HGCW012 extends DaoEPBase {
map.put(FIELD_DEPOSIT_QTY, StringUtils.toString(depositQty, eiMetadata.getMeta(FIELD_DEPOSIT_QTY)));
map.put(FIELD_RECEIVE_WEIGHT, StringUtils.toString(receiveWeight, eiMetadata.getMeta(FIELD_RECEIVE_WEIGHT)));
map.put(FIELD_CONTRACT_NO, StringUtils.toString(contractNo, eiMetadata.getMeta(FIELD_CONTRACT_NO)));
map.put(FIELD_INVOICE_CODE, StringUtils.toString(invoiceCode, eiMetadata.getMeta(FIELD_INVOICE_CODE)));
return map;
}
......
......@@ -131,19 +131,12 @@ public class ServiceHGCW010 extends ServiceBase {
AssertUtils.isNull(HGSC001, "项目编码[" + hgcw010.getProjCode() + "]不存在");
hgcw010.setProjName(HGSC001.getProjName());
}
hgcw010.setBillState(HGConstant.BillStatus.S1);
if (StringUtils.isNotBlank(hgcw010.getBillNumber())){
hgcw010.setBillState(HGConstant.BillStatus.S2);
}
hgcw010.setSigningDate(DateUtils.formatShort(hgcw010.getSigningDate()));
if (hgcw010.getId() == null || hgcw010.getId() == 0) {
hgcw010.setBillState(HGConstant.BillStatus.S1);
hgcw010.setReviewStatus(ReviewStatusEnum.UNREVIEWED.getCode());
this.add(hgcw010);
} else {
List<HGCW011> hgcw011List = HGCWTools.HgCw011.getMainId(hgcw010.getId());
if (hgcw011List.size() > 0 && StringUtils.isNotEmpty(hgcw010.getBillNumber())){
hgcw010.setBillState(HGConstant.BillStatus.S2);
}
this.modify(hgcw010);
}
}
......@@ -164,6 +157,7 @@ public class ServiceHGCW010 extends ServiceBase {
*/
public void add(HGCW010 hgcw010) {
hgcw010.setRemainingAmount(hgcw010.getTotalContractPriceIncluding());
hgcw010.setInvoiceCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGCW10_INVOICE_CODE));
DaoUtils.insert(HGCW010.INSERT, hgcw010);
}
......@@ -188,9 +182,9 @@ public class ServiceHGCW010 extends ServiceBase {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW010 HGCW010 = new HGCW010();
HGCW010.fromMap(resultRows.get(i));
List<HGCW011> hgcw011List = HGCWTools.HgCw011.getMainId(HGCW010.getId());
HGCW010 hgcw010 = new HGCW010();
hgcw010.fromMap(resultRows.get(i));
List<HGCW011> hgcw011List = HGCWTools.HgCw011.getMainId(hgcw010.getId());
if (CollectionUtils.isNotEmpty(hgcw011List)) {
for (HGCW011 hgcw011 : hgcw011List) {
HGCW002 hgcw002 = HGCWTools.HgCw002.getContractNumber(hgcw011.getSettlementNumber());
......@@ -205,10 +199,10 @@ public class ServiceHGCW010 extends ServiceBase {
HGCWTools.HgCw008.deductionAmount(hgcw011.getSettlementNumber(),
hgcw011.getTotalContractPriceIncluding().multiply(new BigDecimal(-1)));
}
DaoUtils.update("HGCW011.delete", hgcw011);
DaoUtils.update(HGCW011.DELETE, hgcw011);
}
}
DaoUtils.update("HGCW010.delete", HGCW010);
DaoUtils.update(HGCW010.DELETE, hgcw010);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......@@ -321,9 +315,9 @@ public class ServiceHGCW010 extends ServiceBase {
return inInfo;
}
public void addHGCW011(HGCW011 HGCW011) {
HGCW011.setId(null);
DaoUtils.insert("HGCW011.insert", HGCW011);
public void addHGCW011(HGCW011 hgcw011) {
hgcw011.setId(null);
DaoUtils.insert(HGCW011.INSERT, hgcw011);
}
......@@ -338,7 +332,7 @@ public class ServiceHGCW010 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HGCW010 HGCW010 = new HGCW010();
HGCW010.fromMap(resultRows.get(i));
HGCW010.setReviewStatus(1);
HGCW010.setReviewStatus(ReviewStatusEnum.REVIEWED.getCode());
DaoUtils.update("HGCW010.submit", HGCW010);
}
inInfo = this.query(inInfo);
......@@ -350,14 +344,16 @@ public class ServiceHGCW010 extends ServiceBase {
return inInfo;
}
@OperationLogAnnotation(operModul = "销售开票",operType = "开票",operDesc = "开票保存")
public EiInfo billing(EiInfo inInfo){
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW010 HGCW010 = new HGCW010();
HGCW010.fromMap(resultRows.get(i));
HGCW010.setBillState(2);
DaoUtils.update("HGCW010.billing", HGCW010);
HGCW010 hgcw010 = new HGCW010();
hgcw010.fromMap(resultRows.get(i));
hgcw010.setBillState(HGConstant.BillStatus.S2);
this.modify(hgcw010);
//DaoUtils.update("HGCW010.billing", hgcw010);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
......@@ -26,6 +26,7 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
......@@ -205,16 +206,17 @@ public class ServiceHGCW010D extends ServiceEPBase {
}
public void add(HGCW010 hgcw010) {
DaoUtils.insert("HGCW010.insert", hgcw010);
hgcw010.setInvoiceCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGCW10_INVOICE_CODE));
DaoUtils.insert(HGCW010.INSERT, hgcw010);
}
public void modify(HGCW010 hgcw010) {
DaoUtils.update("HGCW010.update", hgcw010);
DaoUtils.update(HGCW010.UPDATE, hgcw010);
}
public void addHGCW011(HGCW011 hgcw011) {
hgcw011.setId(null);
DaoUtils.insert("HGCW011.insert", hgcw011);
DaoUtils.insert(HGCW011.INSERT, hgcw011);
}
public List<HGCW011> mapToList(List<Map> rows, Long mainId) {
......
......@@ -4,6 +4,7 @@ import com.baosight.eplat.utils.StringUtils;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
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.domain.HGCW006;
import com.baosight.hggp.hg.cw.domain.HGCW010;
import com.baosight.hggp.hg.cw.domain.HGCW010A;
......@@ -18,6 +19,7 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
......@@ -172,6 +174,7 @@ public class ServiceHGCW010E extends ServiceEPBase {
}
public void add(HGCW010 hgcw010) {
hgcw010.setInvoiceCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGCW10_INVOICE_CODE));
DaoUtils.insert("HGCW010.insert", hgcw010);
}
......
package com.baosight.hggp.hg.cw.service;
import com.baosight.eplat.utils.StringUtils;
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.cw.domain.HGCW002;
import com.baosight.hggp.hg.cw.domain.HGCW006;
import com.baosight.hggp.hg.cw.domain.HGCW010;
import com.baosight.hggp.hg.cw.domain.HGCW011;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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 java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
......@@ -30,7 +37,7 @@ public class ServiceHGCW011 extends ServiceBase {
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
@OperationLogAnnotation(operModul = "销售开票",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,
......@@ -48,7 +55,7 @@ public class ServiceHGCW011 extends ServiceBase {
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@OperationLogAnnotation(operModul = "销售开票",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
......@@ -59,13 +66,57 @@ public class ServiceHGCW011 extends ServiceBase {
return inInfo;
}
@Override
public EiInfo update(EiInfo inInfo) {
try {
List<HGCW011> hgcw011s = MapUtils.toDaoEPBases(inInfo,HGCW011.class);
Long mainId = hgcw011s.stream().map(HGCW011::getMainId).distinct().findAny().orElseThrow(() -> new PlatException("请选择主表数据"));
HGCW010 hgcw010 = HGCWTools.HgCw010.getId(String.valueOf(mainId));
List<HGCW011> hgcw011List = HGCWTools.HgCw011.getMainId(mainId);
for (HGCW011 hgcw011: hgcw011s) {
HGCW002 hgcw002 = HGCWTools.HgCw002.getContractNumber(hgcw011.getSettlementNumber());
HGCW006 hgcw006 = HGCWTools.HgCw006.getContractNumber(hgcw011.getSettlementNumber());
HGCW011 cw011 =hgcw011List.stream().filter(hgcw0111 -> hgcw0111.getId().equals(hgcw011.getId())).findFirst().get();
BigDecimal acount = hgcw011.getTotalContractPriceIncluding();
if (acount.compareTo(cw011.getTotalContractPriceIncluding()) > 0){
acount = acount.subtract(cw011.getTotalContractPriceIncluding());
}else if (acount.compareTo(cw011.getTotalContractPriceIncluding()) < 0){
acount = cw011.getTotalContractPriceIncluding().subtract(acount).multiply(new BigDecimal(-1));
}
if (StringUtils.isNotNull(hgcw002)){
HGCWTools.HgCw008.remainingAmount(hgcw011.getSettlementNumber(), acount);
}else if (StringUtils.isNotNull(hgcw006)){
HGCWTools.HgCw006.deductionAmount(hgcw011.getSettlementNumber(), acount);
}else {
HGCWTools.HgCw008.deductionAmount(hgcw011.getSettlementNumber(), acount);
}
this.modify(hgcw011);
}
List<HGCW011> hgcw011List1 = HGCWTools.HgCw011.getMainId(mainId);
BigDecimal totalContractPriceIncluding =hgcw011List1.stream().map(HGCW011::getTotalContractPriceIncluding).reduce(BigDecimal.ZERO,BigDecimal::add);
BigDecimal taxPoints = new BigDecimal(hgcw010.getTaxPoints()); // 假设这是以整数形式给出的税率,比如17表示17%
BigDecimal taxRateAsDecimal = taxPoints.divide(new BigDecimal("100")).add(new BigDecimal("1")); // 将税率转换为小数形式
BigDecimal thisSettlementAmount = totalContractPriceIncluding.divide(taxRateAsDecimal, 2, RoundingMode.HALF_UP);
BigDecimal thisSettlementTax = totalContractPriceIncluding.subtract(thisSettlementAmount); // 计算税额
hgcw010.setThisSettlementTax(thisSettlementTax.toString());
hgcw010.setThisSettlementAmount(thisSettlementAmount.toString());
hgcw010.setTotalContractPriceIncluding(totalContractPriceIncluding);
DaoUtils.update(HGCW010.UPDATE, hgcw010);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgcw011s.size() + "]条数据保存成功!");
}catch (PlatException e){
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "保存",operDesc = "保存")
@OperationLogAnnotation(operModul = "销售开票",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
......@@ -96,21 +147,21 @@ public class ServiceHGCW011 extends ServiceBase {
/**
* 新增操作
*
* @param HGCW011
* @param hgcw011
* @return
*/
public void add(HGCW011 HGCW011) {
DaoUtils.insert("HGCW011.insert", HGCW011);
public void add(HGCW011 hgcw011) {
DaoUtils.insert(HGCW011.INSERT, hgcw011);
}
/**
* 修改操作
*
* @param HGCW011
* @param hgcw011
* @return
*/
public void modify(HGCW011 HGCW011) {
DaoUtils.update("HGCW011.update", HGCW011);
public void modify(HGCW011 hgcw011) {
DaoUtils.update(HGCW011.UPDATE, hgcw011);
}
/**
......@@ -119,12 +170,13 @@ public class ServiceHGCW011 extends ServiceBase {
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "删除",operDesc = "删除")
@OperationLogAnnotation(operModul = "销售开票",operType = "删除",operDesc = "删除")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW011.delete", resultRows.get(i));
DaoUtils.update(HGCW011.DELETE, resultRows.get(i));
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
......@@ -26,6 +26,7 @@ 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.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
......@@ -138,6 +139,7 @@ public class ServiceHGCW012 extends ServiceBase {
AssertUtils.isEmpty(hgcg003BList, "未找到匹配的采购收货");
hgcw012.setRemainingAmount(hgcw012.getTotalContractPriceIncluding());
hgcw012.setContractType(ContractTypeEnum.CGSH.getCode());
hgcw012.setInvoiceCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGCW12_INVOICE_CODE));
DaoUtils.insert(HGCW012.INSERT, hgcw012);
BigDecimal taxPoints = new BigDecimal(hgcw012.getTaxPoints()); // 假设这是以整数形式给出的税率,比如17表示17%
BigDecimal taxRateAsDecimal = taxPoints.divide(new BigDecimal("100")).add(new BigDecimal("1")); // 将税率 转换为小数形式
......@@ -305,6 +307,7 @@ public class ServiceHGCW012 extends ServiceBase {
hgcw012.setRemainingAmount(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
hgcw012.setProjCode(hgcw013List.get(0).getProjCode());
hgcw012.setProjName(hgcw013List.get(0).getProjName());
hgcw012.setInvoiceCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGCW12_INVOICE_CODE));
DaoUtils.insert(HGCW012.INSERT, hgcw012);
//生成明细表
......@@ -408,7 +411,7 @@ public class ServiceHGCW012 extends ServiceBase {
//hgcw012.setThisSettlementAmount(hgcw013List.get(0).getThisSettlementAmount());
//hgcw012.setSettlementNumber(settlementNumber.toString().substring(0, settlementNumber.length() - 1));
//hgcw012.setRemainingAmount(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
hgcw012.setInvoiceCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGCW12_INVOICE_CODE));
DaoUtils.insert(HGCW012.INSERT, hgcw012);
List<HGCG003B> hgcg003BList = MapUtils.toDaoEPBases(inInfo, HGCG003B.class);
Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetDataEp(hgcg003BList);
......@@ -441,10 +444,10 @@ public class ServiceHGCW012 extends ServiceBase {
if(hgcg003B.getInvoiceRemainingAmount().compareTo(BigDecimal.ZERO) > 0){
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_AMOUNT, hgcg003B.getInvoiceRemainingAmount().subtract(hgcw013.getSaveInvoiceAmount()));
}else{
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_AMOUNT, hgcg003B.getAmount().subtract(hgcw013.getSaveInvoiceAmount()));
paramMap.put(HGCG003B.FIELD_INVOICE_REMAINING_AMOUNT, hgcg003B.getTaxIncludeAmount().subtract(hgcw013.getSaveInvoiceAmount()));
}
//收货金额等于开票金额
if(hgcg003B.getAmount().compareTo(hgcg003B.getInvoiceAmount().add(hgcw013.getSaveInvoiceAmount())) == 0){
if(hgcg003B.getTaxIncludeAmount().compareTo(hgcg003B.getInvoiceAmount().add(hgcw013.getSaveInvoiceAmount())) == 0){
paramMap.put(HGCG003B.FIELD_IS_INVOICING, HGConstant.CgIsInvoicing.S_1);
}
}
......@@ -510,7 +513,7 @@ public class ServiceHGCW012 extends ServiceBase {
HGCW012 hgcw012 = new HGCW012();
hgcw012.setCompanyCode(hgcw013List.get(0).getCompanyCode());
hgcw012.setCompanyName(hgcw013List.get(0).getCompanyName());
hgcw012.setReviewStatus(0);
hgcw012.setReviewStatus(ReviewStatusEnum.UNREVIEWED.getCode());
hgcw012.setBillState(0);
hgcw012.setBillTybe(1);
hgcw012.setContractType(ContractTypeEnum.ZLHT.getCode());
......@@ -538,6 +541,7 @@ public class ServiceHGCW012 extends ServiceBase {
hgcw012.setRemainingAmount(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
hgcw012.setProjCode(hgcw013List.get(0).getProjCode());
hgcw012.setProjName(hgcw013List.get(0).getProjName());
hgcw012.setInvoiceCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGCW12_INVOICE_CODE));
DaoUtils.insert(HGCW012.INSERT, hgcw012);
//生成明细表
......
......@@ -7,10 +7,7 @@ import com.baosight.hggp.common.ReviewStatusEnum;
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.domain.HGCW005;
import com.baosight.hggp.hg.cw.domain.HGCW006;
import com.baosight.hggp.hg.cw.domain.HGCW014;
import com.baosight.hggp.hg.cw.domain.HGCW015;
import com.baosight.hggp.hg.cw.domain.*;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sc.domain.HGSC001;
......@@ -34,6 +31,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author yukang
......@@ -189,65 +187,45 @@ public class ServiceHGCW014 extends ServiceBase {
hgcw014.setCompanyCode(userVO.getUsercode());
hgcw014.setCompanyName(userVO.getUsername());
hgcw014.setCancelStatus(1);
hgcw014.setReviewStatus(0);
hgcw014.setReviewStatus(ReviewStatusEnum.UNREVIEWED.getCode());
hgcw014.setIncomeNumber(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_COLLECTION_NO));
hgcw014.setSigningDate(DateUtils.shortDate());
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
Map<String, BigDecimal> rowMap = new HashMap<>();
for (HGCW015 hgcw015 : hgcw015List) {
contractNumber.append(hgcw015.getContractNumber()).append(",");
}
for (Map m : resultRows) {
String c = m.get("billNumber").toString();
BigDecimal remainingAmount = new BigDecimal(m.get("thisAmount").toString());
rowMap.put(c, remainingAmount);
totalContractPriceIncluding = totalContractPriceIncluding.add(remainingAmount);
}
BigDecimal totalContractPriceIncluding = hgcw015List.stream().map(HGCW015::getTotalContractPriceIncluding).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
String contractNumbers = hgcw015List.stream().map(HGCW015::getContractNumber).distinct().collect(Collectors.joining(","));
hgcw014.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
hgcw014.setPartyA(hgcw015List.get(0).getPartyA());
hgcw014.setProjCode(hgcw015List.get(0).getProjCode());
hgcw014.setProjName(hgcw015List.get(0).getProjName());
hgcw014.setContractNumber(contractNumber.toString().substring(0, contractNumber.length() - 1));
hgcw014.setContractNumber(contractNumbers);
this.add(hgcw014);
//生成明细表
for (HGCW015 hgcw015 : hgcw015List) {
hgcw015.setMainId(hgcw014.getId());
// 反写金额
HGCWTools.HgCw010.cutAmount(hgcw015.getContractNumber(),rowMap.get(hgcw015.getContractNumber()));
HGCWTools.HgCw010.cutAmount(hgcw015.getContractNumber(),hgcw015.getTotalContractPriceIncluding());
DaoUtils.insert(HGCW015.INSERT, hgcw015);
}
} else {
HGCW014 hgcw014 = HGCWTools.HgCw014.getId(mainId);
Map<String, BigDecimal> rowMap = new HashMap<>();
for (Map m : resultRows) {
String c = m.get("billNumber").toString();
BigDecimal remainingAmount = new BigDecimal(m.get("thisAmount").toString());
rowMap.put(c, remainingAmount);
}
// 生成明细表
for (HGCW015 hgcw015 : hgcw015List) {
hgcw015.setMainId(hgcw014.getId());
// 反写金额
HGCWTools.HgCw010.cutAmount(hgcw015.getContractNumber(),rowMap.get(hgcw015.getContractNumber()));
HGCWTools.HgCw010.cutAmount(hgcw015.getContractNumber(),hgcw015.getTotalContractPriceIncluding());
this.addHGCW015(hgcw015);
}
List<HGCW015> hgcw015s = HGCWTools.HgCw015.getMainId(hgcw014.getId());
if (CollectionUtils.isNotEmpty(hgcw015s)) {
// 更新主表
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
for (HGCW015 hgcw015 : hgcw015s) {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw015.getTotalContractPriceIncluding());
contractNumber.append(hgcw015.getContractNumber()).append(",");
}
BigDecimal totalContractPriceIncluding = hgcw015s.stream().map(HGCW015::getTotalContractPriceIncluding).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
String contractNumber = hgcw015s.stream().map(HGCW015::getContractNumber).collect(Collectors.joining(","));
hgcw014.setTotalContractPriceIncluding(totalContractPriceIncluding);
hgcw014.setPartyA(hgcw015s.get(0).getPartyA());
hgcw014.setProjCode(hgcw015s.get(0).getProjCode());
hgcw014.setProjName(hgcw015s.get(0).getProjName());
hgcw014.setContractNumber(contractNumber.toString().substring(0, contractNumber.length() - 1));
hgcw014.setContractNumber(contractNumber);
this.modify(hgcw014);
}
}
......@@ -292,7 +270,7 @@ public class ServiceHGCW014 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HGCW014 HGCW014 = new HGCW014();
HGCW014.fromMap(resultRows.get(i));
if (!HGCW014.getReviewStatus().equals(ReviewStatusEnum.UNREVIEWED.getCode())){
if (HGCW014.getReviewStatus().equals(ReviewStatusEnum.UNREVIEWED.getCode())){
throw new RuntimeException("当前状态为未审核提交,请先审核提交!");
}
HGCW014.setCancelStatus(2);
......
......@@ -2,21 +2,18 @@ package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ReviewStatusEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.domain.HGCW010;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays;
......@@ -57,6 +54,8 @@ public class ServiceHGCW014A extends ServiceBase {
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCW010.FIELD_REVIEW_STATUS, ReviewStatusEnum.REVIEWED.getCode());
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "hiddenConditions", 0);
inInfo = super.query(inInfo, HGCW010.QUERY, new HGCW010());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
......@@ -184,63 +184,43 @@ public class ServiceHGCW016 extends ServiceBase {
//hgcw016.setReviewStatus(0);
//hgcw016.setIncomeNumber(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_COLLECTION_NO));
hgcw016.setSigningDate(DateUtils.shortDate());
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
Map<String, BigDecimal> rowMap = new HashMap<>();
for (HGCW017 hgcw017 : hgcw017List) {
contractNumber.append(hgcw017.getContractNumber()).append(",");
}
for (Map m : resultRows) {
String c = m.get(HGCW012.FIELD_BILL_NUMBER).toString();
BigDecimal remainingAmount = new BigDecimal(m.get("thisAmount").toString());
rowMap.put(c, remainingAmount);
totalContractPriceIncluding = totalContractPriceIncluding.add(remainingAmount);
}
BigDecimal totalContractPriceIncluding = hgcw017List.stream().map(HGCW017::getTotalContractPriceIncluding).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
String contractNumbers = hgcw017List.stream().map(HGCW017::getContractNumber).collect(Collectors.joining(","));
hgcw016.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
hgcw016.setCompanyCode(hgcw017List.get(0).getCompanyCode());
hgcw016.setCompanyName(hgcw017List.get(0).getCompanyName());
hgcw016.setProjCode(hgcw017List.get(0).getProjCode());
hgcw016.setProjName(hgcw017List.get(0).getProjName());
hgcw016.setPartyA(hgcw017List.get(0).getPartyA());
hgcw016.setContractNumber(contractNumber.toString().substring(0, contractNumber.length() - 1));
hgcw016.setContractNumber(contractNumbers);
this.add(hgcw016);
//生成明细表
for (HGCW017 hgcw017 : hgcw017List) {
hgcw017.setMainId(hgcw016.getId());
// 反写金额
HGCWTools.HgCw012.cutAmount(hgcw017.getContractNumber(),rowMap.get(hgcw017.getContractNumber()));
HGCWTools.HgCw012.cutAmount(hgcw017.getContractNumber(),hgcw017.getTotalContractPriceIncluding());
hgcw017.setDepCode(null);
DaoUtils.insert(HGCW017.INSERT, hgcw017);
}
} else {
HGCW016 hgcw016 = HGCWTools.HgCw016.getId(mainId);
Map<String, BigDecimal> rowMap = new HashMap<>();
for (Map m : resultRows) {
String c = m.get(HGCW012.FIELD_BILL_NUMBER).toString();
BigDecimal remainingAmount = new BigDecimal(m.get("thisAmount").toString());
rowMap.put(c, remainingAmount);
}
// 生成明细表
for (HGCW017 hgcw017 : hgcw017List) {
hgcw017.setMainId(hgcw016.getId());
// 反写金额
HGCWTools.HgCw012.cutAmount(hgcw017.getContractNumber(),rowMap.get(hgcw017.getContractNumber()));
HGCWTools.HgCw012.cutAmount(hgcw017.getContractNumber(),hgcw017.getTotalContractPriceIncluding());
this.addHGCW017(hgcw017);
}
List<HGCW017> hgcw017s = HGCWTools.HgCw017.getMainId(hgcw016.getId());
if (CollectionUtils.isNotEmpty(hgcw017s)) {
// 更新主表
BigDecimal totalContractPriceIncluding = BigDecimal.ZERO;
StringBuffer contractNumber = new StringBuffer();
for (HGCW017 hgcw017 : hgcw017s) {
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw017.getTotalContractPriceIncluding());
contractNumber.append(hgcw017.getContractNumber()).append(",");
}
BigDecimal totalContractPriceIncluding = hgcw017s.stream().map(HGCW017::getTotalContractPriceIncluding).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
String contractNumber = hgcw017s.stream().map(HGCW017::getContractNumber).collect(Collectors.joining());
hgcw016.setTotalContractPriceIncluding(totalContractPriceIncluding);
hgcw016.setPartyA(hgcw017s.get(0).getPartyA());
hgcw016.setContractNumber(contractNumber.toString().substring(0, contractNumber.length() - 1));
hgcw016.setContractNumber(contractNumber);
this.modify(hgcw016);
}
}
......
......@@ -119,6 +119,9 @@
<isNotEmpty prepend=" AND " property="branchUnit">
BRANCH_UNIT = #branchUnit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invoiceCode">
INVOICE_CODE LIKE CONCAT('%',#invoiceCode#,'%')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -149,7 +152,8 @@
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
BRANCH_UNIT as "branchUnit"
BRANCH_UNIT as "branchUnit",
INVOICE_CODE as "invoiceCode"
FROM ${hggpSchema}.HGCW010 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
......@@ -269,12 +273,13 @@
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE, <!-- 部门编码 -->
BRANCH_UNIT
BRANCH_UNIT,
INVOICE_CODE
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projName#, #projCode#, #settlementNumber#,
#billTybe#, #billNumber#, #billState#, #signingDate#, #partyA#, #reviewStatus#, #thisSettlementTax#,
#thisSettlementAmount#, #taxPoints#, #totalContractPriceIncluding#,#remainingAmount#, #createdBy#,
#createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#, #branchUnit#)
#createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#, #branchUnit#, #invoiceCode#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCW010
</selectKey>
......@@ -311,7 +316,8 @@
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
BRANCH_UNIT = #branchUnit#
BRANCH_UNIT = #branchUnit#,
INVOICE_CODE = #invoiceCode#
WHERE
ID = #id#
</update>
......
......@@ -72,7 +72,8 @@
SPEC as "spec", <!-- 规格 -->
DEPOSIT_QTY as "depositQty", <!-- 入库数量 -->
RECEIVE_WEIGHT as "receiveWeight", <!-- 收货重量 -->
CONTRACT_NO as "contractNo"
CONTRACT_NO as "contractNo",
INVOICE_CODE as "invoiceCode"
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
......@@ -180,6 +181,9 @@
<isNotEmpty prepend=" AND " property="contractNo">
CONTRACT_NO like concat('%' , #contractNo# , '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invoiceCode">
INVOICE_CODE like concat('%' , #invoiceCode# , '%')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -334,13 +338,14 @@
SPEC, <!-- 规格 -->
DEPOSIT_QTY, <!-- 入库数量 -->
RECEIVE_WEIGHT, <!-- 收货重量 -->
CONTRACT_NO
CONTRACT_NO,
INVOICE_CODE
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #settlementNumber#,
#billTybe#, #billNumber#, #billState#, #signingDate#, #partyA#, #reviewStatus#, #taxPoints#,
#thisSettlementTax#, #thisSettlementAmount#, #totalContractPriceIncluding#, #createdBy#, #createdName#,
#createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#, #remainingAmount#, #receiveDate#,
#contractType#, #inventTypeDetail#, #inventCode#, #inventName#, #spec#, #depositQty#, #receiveWeight#,#contractNo#)
#contractType#, #inventTypeDetail#, #inventCode#, #inventName#, #spec#, #depositQty#, #receiveWeight#,#contractNo#, #invoiceCode#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCW012
</selectKey>
......@@ -386,7 +391,8 @@
SPEC = #spec#, <!-- 规格 -->
DEPOSIT_QTY = #depositQty#, <!-- 入库数量 -->
RECEIVE_WEIGHT = #receiveWeight#, <!-- 收货重量 -->
CONTRACT_NO = #contractNo#
CONTRACT_NO = #contractNo#,
INVOICE_CODE = #invoiceCode#
WHERE
ID = #id#
</update>
......
......@@ -831,25 +831,30 @@ public class HGCWTools {
DaoUtils.update("HGCW010.update", hgcw010);
}
}
public static void cutAmount(String billNumber, BigDecimal cutAmount) {
AssertUtils.isNull(billNumber, "来源单号不能为空!");
public static void cutAmount(String invoiceCode, BigDecimal cutAmount) {
AssertUtils.isNull(invoiceCode, "销售开票单号不能为空!");
// 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("billNumber",billNumber);}
{put(HGCW010.FIELD_INVOICE_CODE,invoiceCode);}
});
if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的销售开票记录!");
results = DaoBase.getInstance().query(HGCW010.QUERY,new HashMap<String,Object>(){
{put(HGCW010.FIELD_BILL_NUMBER,invoiceCode);}
});
if (CollectionUtils.isEmpty(results)){
throw new PlatException("找不到对应的销售开票记录!");
}
}
DecimalFormat decimalFormat = new DecimalFormat("#.00");
HGCW010 HGCW010 = results.get(0);
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(HGCW010.getRemainingAmount().subtract(cutAmount)));
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);
hgcw010.setRemainingAmount(remainingAmount);
DaoUtils.update("HGCW010.updateDeductionAmount", hgcw010);
}
......@@ -970,16 +975,19 @@ public class HGCWTools {
DaoUtils.update("HGCW012.update", HGCW012);
}
}
public static void cutAmount(String billNumber, BigDecimal cutAmount) {
AssertUtils.isNull(billNumber, "发票号不能为空!");
public static void cutAmount(String invoiceCode, BigDecimal cutAmount) {
AssertUtils.isNull(invoiceCode, "采购收票单不能为空!");
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// throw new PlatException("扣款金额不能小于等于0!");
// }
List<HGCW012> results = DaoBase.getInstance().query(HGCW012.QUERY,new HashMap<String,Object>(){
{put(HGCW012.FIELD_BILL_NUMBER,billNumber);}
{put(HGCW010.FIELD_INVOICE_CODE,invoiceCode);}
});
if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的采购收票记录!");
results = DaoBase.getInstance().query(HGCW012.QUERY,new HashMap<String,Object>(){{put(HGCW012.FIELD_BILL_NUMBER,invoiceCode);}});
if (CollectionUtils.isEmpty(results)){
throw new PlatException("找不到对应的采购收票记录!");
}
}
DecimalFormat decimalFormat = new DecimalFormat("#.00");
HGCW012 HGCW012 = results.get(0);
......@@ -1192,9 +1200,10 @@ public class HGCWTools {
rows.forEach(row -> {
HGCW015 hgcw015 = new HGCW015();
hgcw015.fromMap(row);
String contractNumber = row.get("billNumber").toString();
String invoiceCode = row.get(HGCW010.FIELD_INVOICE_CODE).toString();
String billNumber = row.get(HGCW010.FIELD_BILL_NUMBER).toString();
String remainingAmount = row.get("thisAmount").toString();
hgcw015.setContractNumber(contractNumber);
hgcw015.setContractNumber(invoiceCode.isEmpty()?billNumber:invoiceCode);
hgcw015.setTotalContractPriceIncluding(new BigDecimal(remainingAmount));
if (mainId != null) {
hgcw015.setMainId(mainId);
......@@ -1260,9 +1269,10 @@ public class HGCWTools {
rows.forEach(row -> {
HGCW017 hgcw017 = new HGCW017();
hgcw017.fromMap(row);
String contractNumber = row.get(HGCW012.FIELD_BILL_NUMBER).toString();
String invoiceCode = row.get(HGCW012.FIELD_INVOICE_CODE).toString();
String billNumber = row.get(HGCW012.FIELD_BILL_NUMBER).toString();
String remainingAmount = row.get("thisAmount").toString();
hgcw017.setContractNumber(contractNumber);
hgcw017.setContractNumber(invoiceCode.isEmpty()?billNumber:invoiceCode);
hgcw017.setTotalContractPriceIncluding(new BigDecimal(remainingAmount));
if (mainId != null) {
hgcw017.setMainId(mainId);
......
......@@ -5,7 +5,7 @@ package com.baosight.hggp.hg.kc.constant;
* @date:2024/9/29,9:54
*/
public class HgKcSqlConst {
/**
* HGKC008 SQL 定义
*
......@@ -13,7 +13,7 @@ public class HgKcSqlConst {
* @date:2024/1/20,16:45
*/
public class HgKc008 {
// 锁
public static final String LOCK = "HGKC008.lock";
// 修改状态
......@@ -23,7 +23,7 @@ public class HgKcSqlConst {
// 修改
public static final String UPDATE_RECEIVE_TYPE = "HGKC008.updateReceiveType";
}
/**
* HGKC008A SQL 定义
*
......@@ -31,7 +31,7 @@ public class HgKcSqlConst {
* @date:2024/1/20,16:45
*/
public class HgKc008A {
// 锁
public static final String LOCK = "HGKC008A.lock";
// 修改状态
......@@ -41,7 +41,19 @@ public class HgKcSqlConst {
// 批量删除
public static final String BATCH_DELETE = "HGKC008A.batchDelete";
}
/**
* HGKC013A SQL 定义
*
* @author:jhs
* @date:2024/10/30,16:45
*/
public class HgKc013A {
// 锁
public static final String LOCK = "HGKC013A.lock";
}
/**
* HGKC014 SQL 定义
*
......@@ -49,7 +61,7 @@ public class HgKcSqlConst {
* @date:2024/1/20,16:45
*/
public class HgKc014 {
// 锁
public static final String LOCK = "HGKC014.lock";
// 修改状态
......@@ -57,7 +69,7 @@ public class HgKcSqlConst {
// 修改
public static final String UPDATE_RECEIVE_TYPE = "HGKC014.updateReceiveType";
}
/**
* HGKC014A SQL 定义
*
......@@ -65,7 +77,7 @@ public class HgKcSqlConst {
* @date:2024/1/20,16:45
*/
public class HgKc014A {
// 锁
public static final String LOCK = "HGKC014A.lock";
// 修改状态
......@@ -77,5 +89,5 @@ public class HgKcSqlConst {
// 实际入库数量
public static final String UPDATE_ACTUAL_QTY = "HGKC014A.updateActualQty";
}
}
......@@ -3,7 +3,6 @@ package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
......@@ -28,7 +27,6 @@ import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author:songx
......
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
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.service.impl.ServiceBase;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGKC013B extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "综合库存", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("inventTypeDetails", InventTypeDetailEnum.getInentTypeTwo());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BLOCK_ID), paramMap);
// CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID), paramMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID), null);
EiInfoUtils.addBlock(inInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC010().eiMetadata);
} catch (Exception 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);
// inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "inventTypeDetails", InventTypeDetailEnum.getInentTypeTwo());
queryRow.put("isInvQty", CommonConstant.YesNo.YES_1);
inInfo = super.query(inInfo, HGSqlConstant.HgKc010.QUERY_LY, new HGKC010());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 确认操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "实时库存", operType = "查询", operDesc = "确认")
public EiInfo confirm(EiInfo inInfo) {
try {
String parentId = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,
HGKC013A.FIELD_PARENT_ID);
List<HGKC010B> fKc010Bs = MapUtils.toDaoEPBases(inInfo, HGKC010B.class);
// db数据
Map<Long, HGKC010> dbKc010Map = HGKCUtils.HgKc010.lockGetDataEp(fKc010Bs);
// 调拨单明细
List<HGKC013A> dbKc013As = HGKCUtils.HgKc013A.listByPrimaryId(parentId);
// 调拨单主信息
HGKC013 hgkc013 = HGKCUtils.HgKc013.get(parentId);
// 数据校验
this.checkConfirmData(fKc010Bs, dbKc013As, dbKc010Map, hgkc013);
// 保存数据
this.confirmData(fKc010Bs, dbKc010Map, hgkc013);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fKc010Bs.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 确认数量
*
* @param fKc010Bs
* @param dbKc010Map
* @param dbKc013
*/
private void confirmData(List<HGKC010B> fKc010Bs, Map<Long, HGKC010> dbKc010Map, HGKC013 dbKc013) {
for (HGKC010B fKc010B : fKc010Bs) {
Long id = fKc010B.getId();
HGKC010 dbKc010 = dbKc010Map.get(id);
HGKC013A newKc013A = BeanUtils.copy(dbKc010, HGKC013A.class);
newKc013A.setParentId(dbKc013.getId());
newKc013A.setCalloutWhCode(dbKc013.getCalloutWhCode());
newKc013A.setCalloutWhName(dbKc013.getCalloutWhName());
newKc013A.setCallinWhCode(dbKc013.getCallinWhCode());
newKc013A.setCallinWhName(dbKc013.getCallinWhName());
//存货ID
newKc013A.setInventRecordId(dbKc010.getId());
newKc013A.setQuantity(fKc010B.getApplyQty());
newKc013A.setUnitWeight(fKc010B.getInvUnitWeight());
newKc013A.setWeight(fKc010B.getInvWeight());
newKc013A.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
DaoUtils.insert(HGKC013A.INSERT, newKc013A);
}
}
/**
* 数据校验
*
* @param fKc010Bs
* @param dbKc013As
* @param dbKc010Map
* @param dbKc013
*/
private void checkConfirmData(List<HGKC010B> fKc010Bs, List<HGKC013A> dbKc013As, Map<Long, HGKC010> dbKc010Map,
HGKC013 dbKc013) {
AssertUtils.isEquals(dbKc013.getStatus(), HGConstant.ProductStatus.YTJ, "调拨单已提交,不可修改");
for (HGKC013A dbKc013A : dbKc013As) {
for (Map.Entry<Long, HGKC010> dbKc010MapEntry : dbKc010Map.entrySet()) {
HGKC010 dbKc010 = dbKc010MapEntry.getValue();
AssertUtils.isEquals(dbKc010.getInventCode(), dbKc013A.getInventCode(),
String.format("此调拨单已选择存货:%s", dbKc010.getInventCode()));
}
}
for (HGKC010B fKc010B : fKc010Bs) {
AssertUtils.isGe(BigDecimal.ZERO, fKc010B.getApplyQty(), String.format("库存【%s】申请数量必须大于0",
fKc010B.getInventCode()));
// 查询已申请未提交的明细数量
BigDecimal applyQtySum = CollectionUtils.isEmpty(dbKc013As) ? BigDecimal.ZERO
: dbKc013As.stream().filter(o->o.getCalloutWhCode().equals(fKc010B.getWhCode()))
.map(HGKC013A::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal totalApplyQty = applyQtySum.add(fKc010B.getApplyQty());
HGKC010 dbKc010 = dbKc010Map.get(fKc010B.getId());
AssertUtils.isGt(totalApplyQty, dbKc010.getInvQty(), String.format("存货【%s(%s)】累计申请数量【%s】超过库存数量【%s】",
fKc010B.getInventCode(), fKc010B.getInventName(),
totalApplyQty.stripTrailingZeros().toPlainString(), dbKc010.getInvQty()));
}
}
}
......@@ -4,31 +4,31 @@
Version : 1.0
schema : hggp
tableName : HGKC013A
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
CALLOUT_WH_CODE VARCHAR,
CALLOUT_WH_NAME VARCHAR,
CALLIN_WH_CODE VARCHAR,
CALLIN_WH_NAME VARCHAR,
INVENT_RECORD_ID BIGINT,
INVENT_TYPE VARCHAR,
INVENT_CODE VARCHAR NOT NULL,
INVENT_NAME VARCHAR NOT NULL,
SPEC VARCHAR,
LENGTH DECIMAL,
WIDTH DECIMAL,
THICK DECIMAL,
QUANTITY DECIMAL,
UNIT_WEIGHT DECIMAL,
WEIGHT DECIMAL,
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
CALLOUT_WH_CODE VARCHAR,
CALLOUT_WH_NAME VARCHAR,
CALLIN_WH_CODE VARCHAR,
CALLIN_WH_NAME VARCHAR,
INVENT_RECORD_ID BIGINT,
INVENT_TYPE VARCHAR,
INVENT_CODE VARCHAR NOT NULL,
INVENT_NAME VARCHAR NOT NULL,
SPEC VARCHAR,
LENGTH DECIMAL,
WIDTH DECIMAL,
THICK DECIMAL,
QUANTITY DECIMAL,
UNIT_WEIGHT DECIMAL,
WEIGHT DECIMAL,
PARENT_ID BIGINT
-->
<sqlMap namespace="HGKC013A">
......@@ -156,6 +156,15 @@
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGKC013A">
SELECT
<include refid="column"/>
......@@ -340,4 +349,12 @@
ID = #id#
</update>
</sqlMap>
\ No newline at end of file
<!-- 行锁 -->
<update id="lock">
UPDATE ${hggpSchema}.HGKC013A
SET CREATED_TIME = CREATED_TIME
WHERE 1=1
<include refid="idCondition"/>
</update>
</sqlMap>
......@@ -1493,6 +1493,113 @@ public class HGKCTools {
}
/**
* HGKC013A 定义
*
* @author:jhs
* @date:2024/9/29,10:47
*/
public static class HgKc013A {
/**
* 锁
*
* @param ids
* @return
*/
public static void lockEx(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("ids", ids);
DaoBase.getInstance().update(HgKcSqlConst.HgKc008A.LOCK, paramMap);
}
/**
* 锁
*
* @param ids
* @return
*/
public static void lock(List<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return;
}
Map paramMap = new HashMap();
paramMap.put("ids", ids);
DaoBase.getInstance().update(HgKcSqlConst.HgKc013A.LOCK, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static List<HGKC013A> listEx(List<Long> ids) {
AssertUtils.isEmpty(ids, "ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGKC013A.QUERY, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static Map<Long, HGKC013A> mapEx(List<Long> ids) {
List<HGKC013A> results = listEx(ids);
return results.stream().collect(Collectors.toMap(HGKC013A::getId, item -> item));
}
/**
* 查询
*
* @param ids
* @return
*/
public static List<HGKC013A> list(List<Long> ids) {
AssertUtils.isEmpty(ids, "调拨明细id不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("ids", ids);
return DaoBase.getInstance().query(HGKC013A.QUERY, paramMap);
}
/**
* 查询
*
* @param ids
* @return
*/
public static Map<Long, HGKC013A> map(List<Long> ids) {
List<HGKC013A> results = list(ids);
return results.stream().collect(Collectors.toMap(HGKC013A::getId, item -> item));
}
/**
* 查询
*
* @param parentId
* @param whCode
* @param inventCode
* @return
*/
public static List<HGKC013A> listByInv(Long parentId,String whCode, String inventCode) {
if (Objects.isNull(parentId) || StringUtils.isBlank(whCode) || StringUtils.isBlank(inventCode)) {
return null;
}
Map<String, Object> paramMap = new HashMap();
paramMap.put(HGKC013A.FIELD_PARENT_ID, parentId);
paramMap.put(HGKC013A.FIELD_CALLOUT_WH_CODE, whCode);
paramMap.put(HGKC013A.FIELD_INVENT_CODE, inventCode);
return DaoBase.getInstance().query(HGKC013A.QUERY, paramMap);
}
}
/**
* HGKC014 定义
*
* @author:songx
......
......@@ -5,6 +5,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.enums.ValidFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
......@@ -66,9 +67,14 @@ public class ServiceHGPZ009 extends ServiceBase {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
// 排除虚拟企业
queryRow.put("exValidFlag", ValidFlagEnum.VIRTUALLY.getCode());
if (queryRow.containsKey("loginName") && !"admin".equals(queryRow.get("loginName").toString())){
queryRow.put("accountCode", UserSessionUtils.getAccountCode());
}else {
queryRow.remove("loginName");
}
inInfo = super.query(inInfo, HGPZ009.QUERY, new HGPZ009());
String projectEnv = ProjectInfo.getProjectEnv();
inInfo.setCell(EiConstant.resultBlock, ACConstants.ROW_CODE_0, "projectEnv", projectEnv);
//String projectEnv = ProjectInfo.getProjectEnv();
//inInfo.setCell(EiConstant.resultBlock, ACConstants.ROW_CODE_0, "projectEnv", projectEnv);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......
package com.baosight.hggp.hg.sc.service;
import cn.hutool.core.bean.BeanUtil;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ProductTypeEnum;
......@@ -10,9 +9,18 @@ import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.*;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.hg.sc.domain.HGSC005;
import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -24,9 +32,17 @@ import com.baosight.iplat4j.core.util.StringUtils;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import cn.hutool.core.bean.BeanUtil;
/**
* @Author jhs
......@@ -384,7 +400,7 @@ public class ServiceHGSC004A extends ServiceBase {
mapA.put("notId",hgsc004a.getId());
}
List<HGSC004A> hgsc004AList = dao.query(HGSC004A.QUERY,mapA, 0, -999999);
AssertUtils.isTrue(!CollectionUtils.isEmpty(hgsc004AList), "已存在构"+hgsc004a.getProductCode()+"-"+hgsc004a.getProductName());
AssertUtils.isTrue(!CollectionUtils.isEmpty(hgsc004AList), "已存在构"+hgsc004a.getProductCode()+"-"+hgsc004a.getProductName());
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
......
......@@ -398,8 +398,8 @@ public class ServiceHGSC007 extends ServiceEPBase {
});
List list = factoryCodes.stream()
.filter(o -> com.baosight.hggp.util.StringUtils.equals(o.getOrgType(), OrgTypeEnum.FACTORY.getCode()))
.map(item -> new Factory(item.getCompanyCode(), item.getCompanyName(), item.getFactoryCode(),
item.getFactoryName())).collect(Collectors.collectingAndThen(
.map(item -> new Factory(item.getCompanyCode(), item.getCompanyName(), item.getOrgId(),
item.getOrgCname())).collect(Collectors.collectingAndThen(
Collectors.toMap(Factory::getFactoryCode, Function.identity(),
(oldValue, newValue) -> oldValue),
// 将Map转回List
......
......@@ -263,8 +263,8 @@
<isNotEmpty prepend=" AND " property="materialId">
a.material_id = #materialId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialId">
a.material_id = #materialId#
<isNotEmpty prepend=" AND " property="inventSource">
a.invent_source = #inventSource#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="id">
a.id = #id#
......@@ -546,15 +546,15 @@
a.product_name as "productName", <!-- 产品名称 -->
a.invent_type as "inventType", <!-- 档案类型 -->
a.invent_source as "inventSource", <!-- 物料来源 1加工 2外购 -->
a.spec as "spec",
a.length as "length", <!-- 长 -->
a.width as "width", <!-- 宽 -->
a.thick as "thick", <!-- 厚 -->
c.spec as "spec",
c.length as "length", <!-- 长 -->
c.width as "width", <!-- 宽 -->
c.thick as "thick", <!-- 厚 -->
a.product_status as "productStatus", <!-- 产品状态 0:未提交,1:已提交 -->
a.change_type as "changeType", <!-- 变更类型:默认0,1:增加,2:替换,3:删除 -->
a.quantity as "quantity", <!-- 数量 -->
a.single_weight as "singleWeight", <!-- 单重 -->
a.total_weight as "totalWeight", <!-- 总重 -->
c.INV_QTY as "quantity", <!-- 数量 -->
c.INV_UNIT_WEIGHT as "singleWeight", <!-- 单重 -->
c.INV_WEIGHT as "totalWeight", <!-- 总重 -->
a.approval_status as "approvalStatus", <!-- 审批状态 0:待审;1:审核中;2:已审 -->
a.leaf as "leaf", <!-- 是否有叶子节点 -->
a.sort as "sort", <!-- 排序字段 -->
......@@ -567,7 +567,8 @@
a.updated_name as "updatedName", <!-- 修改人名称 -->
a.updated_time as "updatedTime" <!-- 更新时间 -->
FROM ${hggpSchema}.HGSC004A a
left join ${hggpSchema}.HGSC004 b on a.material_id = b.id
join ${hggpSchema}.HGSC004 b on a.material_id = b.id
join ${hggpSchema}.hgkc010 c on a.product_code = c.invent_code and a.company_code = c.company_code
WHERE 1=1
and a.lv = 4
and b.material_status = 2
......@@ -594,11 +595,12 @@
<isNotEmpty prepend=" AND " property="ids">
a.id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
<isNotEmpty prepend=" AND " property="whName">
c.wh_name like CONCAT('%', #whName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
c.wh_code = #whCode#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......
......@@ -1067,7 +1067,7 @@
</isNotEmpty>
group by h2.process_code
) B on A.process_code = B.process_code
where 1=1
where 1=1 and DELETE_FLAG = '0'
<isNotEmpty prepend=" AND " property="accountCode">
A.account_code = #accountCode#
</isNotEmpty>
......@@ -1099,7 +1099,7 @@
</isNotEmpty>
group by h2.process_code
) B on A.process_code = B.process_code
where 1=1
where 1=1 and DELETE_FLAG = '0'
<isNotEmpty prepend=" AND " property="accountCode">
A.account_code = #accountCode#
</isNotEmpty>
......
......@@ -592,7 +592,7 @@ public class HGSCTools {
mapA.put(HGSC004A.FIELD_parent_prod_code,hgsc004a.getParentProdCode());
mapA.put(HGSC004A.FIELD_product_code,hgsc004a.getProductCode());
List<HGSC004A> hgsc004AList = list(mapA);
AssertUtils.isTrue(!CollectionUtils.isEmpty(hgsc004AList), String.format("已存在构%s-%s",hgsc004a.getProductCode(),hgsc004a.getProductName()));
AssertUtils.isTrue(!CollectionUtils.isEmpty(hgsc004AList), String.format("已存在构%s-%s",hgsc004a.getProductCode(),hgsc004a.getProductName()));
}
AssertUtils.isEmpty(UserSessionUtils.getAccountCode(), "当前用户未绑定公司,无法操作数据,请联系管理员!");
//AssertUtils.isEmpty(UserSessionUtils.getOrgId(), "当前用户未绑定部门,无法操作数据,请联系管理员!");
......
......@@ -99,7 +99,7 @@
<select id="count" resultClass="int">
SELECT COUNT(*)
FROM ${hggpSchema}.HGWD001 A
FROM ${hggpSchema}.HGWD003 A
INNER JOIN ${platSchema}.XS_USER B ON A.USER_ID = B.LOGIN_NAME
LEFT JOIN ${platSchema}.TXSOG02 C ON B.USER_ID = C.USER_ID
LEFT JOIN ${platSchema}.TXSOG01 D ON C.ORG_ID = D.ORG_ID
......
package com.baosight.hggp.util;
import java.security.KeyFactory;
import java.security.MessageDigest;
import java.security.PrivateKey;
import java.security.Signature;
import java.security.spec.PKCS8EncodedKeySpec;
import java.text.SimpleDateFormat;
import java.util.Calendar;
/**
* @author songx
* @date 2024/10/31,15:15
*/
public class ByteUtils {
private static final String DSA = "DSA";
private static SimpleDateFormat CRED_TIME_FORMAT = new SimpleDateFormat("yyyyMMddHHmm");
private static String CRED_SEPERATOR = ":";
private static String signatureAlg = "SHA1WithDSA";
private static String SELF_PROJECTENAME = "A";
private static String privateKeyStr = "3082014b0201003082012c06072a8648ce3804013082011f02818100fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b76b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c70215009760508f15230bccb292b982a2eb840bf0581cf502818100f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d0782675159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e13c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243bcca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a041602145898ad70090def72e9d6a8ce864e688c366994a6";
private static String publicKeyStr = "*****";
/**
* md5
*
* @param data String
* @return md5 md5
*/
public static final String MD5(String data) {
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
digest.update(data.getBytes("utf-8"));
return encodeHex(digest.digest());
} catch (Exception e) {
throw new IllegalStateException(e.getMessage());
}
}
/**
* bytesmd5
*
* @param bytes bytes
* @return the string
*/
public static final String encodeHex(byte bytes[]) {
StringBuffer buf = new StringBuffer(bytes.length * 2);
for (int i = 0; i < bytes.length; i++) {
if ((bytes[i] & 0xff) < 16) {
buf.append("0");
}
buf.append(Long.toString(bytes[i] & 0xff, 16));
}
return buf.toString();
}
/**
* byte
*
* @param hex
* @return byte[] byte
*/
public static final byte[] decodeHex(String hex) {
char chars[] = hex.toCharArray();
byte bytes[] = new byte[chars.length / 2];
int byteCount = 0;
for (int i = 0; i < chars.length; i += 2) {
int newByte = 0;
newByte |= hexCharToByte(chars[i]);
newByte <<= 4;
newByte |= hexCharToByte(chars[i + 1]);
bytes[byteCount] = (byte) newByte;
byteCount++;
}
return bytes;
}
/**
*
*/
private static final byte hexCharToByte(char ch) {
switch (ch) {
case 48: // '0'
return 0;
case 49: // '1'
return 1;
case 50: // '2'
return 2;
case 51: // '3'
return 3;
case 52: // '4'
return 4;
case 53: // '5'
return 5;
case 54: // '6'
return 6;
case 55: // '7'
return 7;
case 56: // '8'
return 8;
case 57: // '9'
return 9;
case 97: // 'a'
return 10;
case 98: // 'b'
return 11;
case 99: // 'c'
return 12;
case 100: // 'd'
return 13;
case 101: // 'e'
return 14;
case 102: // 'f'
return 15;
case 58: // ':'
case 59: // ';'
case 60: // '<'
case 61: // '='
case 62: // '>'
case 63: // '?'
case 64: // '@'
case 65: // 'A'
case 66: // 'B'
case 67: // 'C'
case 68: // 'D'
case 69: // 'E'
case 70: // 'F'
case 71: // 'G'
case 72: // 'H'
case 73: // 'I'
case 74: // 'J'
case 75: // 'K'
case 76: // 'L'
case 77: // 'M'
case 78: // 'N'
case 79: // 'O'
case 80: // 'P'
case 81: // 'Q'
case 82: // 'R'
case 83: // 'S'
case 84: // 'T'
case 85: // 'U'
case 86: // 'V'
case 87: // 'W'
case 88: // 'X'
case 89: // 'Y'
case 90: // 'Z'
case 91: // '['
case 92: // '\\'
case 93: // ']'
case 94: // '^'
case 95: // '_'
case 96: // '`'
default:
return 0;
}
}
public static void main(String[] args) throws Exception {
KeyFactory keyFactory = KeyFactory.getInstance(DSA);
byte pri[] = ByteUtils.decodeHex(privateKeyStr);
PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(pri);
PrivateKey priKey = keyFactory.generatePrivate(privKeySpec);
Calendar now = Calendar.getInstance();
String minuteStr = CRED_TIME_FORMAT.format(now.getTime());
StringBuffer str = new StringBuffer();
String user = "YG5918";
str.append(minuteStr).append(CRED_SEPERATOR).append(user).append(
CRED_SEPERATOR).append("UDP").append(CRED_SEPERATOR).append("HGGP");
Signature sig = Signature.getInstance(signatureAlg);
sig.initSign(priKey);
sig.update(str.toString().getBytes("UTF8"));
byte[] signature = sig.sign();
String signatureStr = ByteUtils.encodeHex(signature);
str.append(CRED_SEPERATOR).append(signatureStr);
System.out.println(str);
}
}
......@@ -89,33 +89,24 @@ public class CommonMethod {
tryValue = (Map) result;
}catch (ClassCastException e){
tryValue = ((DaoEPBase)result).toMap();
}
row.put(HGConstants.VALUE_FIELD, String.valueOf(tryValue.get(tableParam.getValue())));
if(isSplicingSymbol) {
row.put(HGConstants.TEXT_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getText())));
row.put(HGConstants.PARAM1_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam1())));
row.put(HGConstants.PARAM2_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam2())));
row.put(HGConstants.PARAM3_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam3())));
row.put(HGConstants.PARAM4_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam4())));
row.put(HGConstants.PARAM5_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam5())));
row.put(HGConstants.PARAM6_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam6())));
row.put(HGConstants.PARAM7_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam7())));
row.put(HGConstants.PARAM8_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam8())));
row.put(HGConstants.PARAM9_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam9())));
row.put(HGConstants.PARAM10_FIELD, (tryValue.get(tableParam.getValue()) + HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getParam10())));
} else {
row.put(HGConstants.TEXT_FIELD, String.valueOf(tryValue.get(tableParam.getText())));
row.put(HGConstants.PARAM1_FIELD, String.valueOf(tryValue.get(tableParam.getParam1())));
row.put(HGConstants.PARAM2_FIELD, String.valueOf(tryValue.get(tableParam.getParam2())));
row.put(HGConstants.PARAM3_FIELD, String.valueOf(tryValue.get(tableParam.getParam3())));
row.put(HGConstants.PARAM4_FIELD, String.valueOf(tryValue.get(tableParam.getParam4())));
row.put(HGConstants.PARAM5_FIELD, String.valueOf(tryValue.get(tableParam.getParam5())));
row.put(HGConstants.PARAM6_FIELD, String.valueOf(tryValue.get(tableParam.getParam6())));
row.put(HGConstants.PARAM7_FIELD, String.valueOf(tryValue.get(tableParam.getParam7())));
row.put(HGConstants.PARAM8_FIELD, String.valueOf(tryValue.get(tableParam.getParam8())));
row.put(HGConstants.PARAM9_FIELD, String.valueOf(tryValue.get(tableParam.getParam9())));
row.put(HGConstants.PARAM10_FIELD, String.valueOf(tryValue.get(tableParam.getParam10())));
}
}
if (isSplicingSymbol) {
row.put(HGConstants.TEXT_FIELD, (tryValue.get(tableParam.getValue())
+ HGConstants.SPLICING_SYMBOL + tryValue.get(tableParam.getText())));
} else {
row.put(HGConstants.TEXT_FIELD, String.valueOf(tryValue.get(tableParam.getText())));
}
row.put(HGConstants.VALUE_FIELD, String.valueOf(tryValue.get(tableParam.getValue())));
row.put(HGConstants.PARAM1_FIELD, String.valueOf(tryValue.get(tableParam.getParam1())));
row.put(HGConstants.PARAM2_FIELD, String.valueOf(tryValue.get(tableParam.getParam2())));
row.put(HGConstants.PARAM3_FIELD, String.valueOf(tryValue.get(tableParam.getParam3())));
row.put(HGConstants.PARAM4_FIELD, String.valueOf(tryValue.get(tableParam.getParam4())));
row.put(HGConstants.PARAM5_FIELD, String.valueOf(tryValue.get(tableParam.getParam5())));
row.put(HGConstants.PARAM6_FIELD, String.valueOf(tryValue.get(tableParam.getParam6())));
row.put(HGConstants.PARAM7_FIELD, String.valueOf(tryValue.get(tableParam.getParam7())));
row.put(HGConstants.PARAM8_FIELD, String.valueOf(tryValue.get(tableParam.getParam8())));
row.put(HGConstants.PARAM9_FIELD, String.valueOf(tryValue.get(tableParam.getParam9())));
row.put(HGConstants.PARAM10_FIELD, String.valueOf(tryValue.get(tableParam.getParam10())));
resultRows.add(row);
}
eiBlock.addBlockMeta(initCodeMeta(HGConstants.TEXT_FIELD, HGConstants.VALUE_FIELD));
......
......@@ -840,12 +840,12 @@ public class ServiceXSUserManage extends ServiceEPBase {
throw new PlatException("[" + groupEname + "]用户组存在授权关系,不能删除!");
}
map.put("authGroupId", groupId);
List groupDataAuth = this.dao.query("XS10.query", map);
eiInfo.set(EiConstant.serviceId, "S_XS_31");
if (null != groupDataAuth && groupDataAuth.size() > 0) {
throw new PlatException("[" + groupEname + "]用户组存在数据集授权关系,不能删除!");
}
// map.put("authGroupId", groupId);
// List groupDataAuth = this.dao.query("XS10.query", map);
// eiInfo.set(EiConstant.serviceId, "S_XS_31");
// if (null != groupDataAuth && groupDataAuth.size() > 0) {
// throw new PlatException("[" + groupEname + "]用户组存在数据集授权关系,不能删除!");
// }
}
inInfoRowMap.put("groupId", groupId);
......
......@@ -2100,14 +2100,14 @@ $(function () {
try {
if (loginName !== "admin"){
var info = new EiInfo()
info.set("inqu_status-0-accountCode", loginName)
info.set("inqu_status-0-loginName", loginName)
EiCommunicator.send("HGPZ009", "query", info, {
onSuccess: function (ei) {//返回结果集
if (ei.blocks.result !== undefined){
let results = ei.getBlock("result").getMappedRows();
if (results.length>0 && results[0].docIdPc.trim().length>0){
let src = downloadHref(results[0].docIdPc.trim(),results[0].projectEnv)
let img=`<img src="${src}" style='width:200px;height:55px;background-image: none;'/>`;
//let src = downloadFile(results[0].docIdPc.trim(),true)
let img="<img src=\'"+downloadFile(results[0].docIdPc.trim(),true)+"\' style='width:200px;height:55px;background-image: none;'/>";
$("#sidebar .sidebar-content .side-header").html(img);
//$("#sidebar .sidebar-content .side-header").attr("src",downloadHref(results[0].docIdPc,results[0].projectEnv));
}else {
......@@ -2200,13 +2200,20 @@ function changepassword(formEname,formCname){
});
}
function downloadHref(docId,projectEnv) {
// S3地址有外网
// return IPLATUI.CONTEXT_PATH + ("run" == projectEnv ? ('/docFileDownload/' + docId)
// : ('/EU/DM/EUDM06.jsp?docId=' + docId));
// S3地址无外网
return IPLATUI.CONTEXT_PATH + ("run" == projectEnv ? ('/file/download/' + docId)
: ('/EU/DM/EUDM06.jsp?docId=' + docId));
/**
* 文件下载路径
*
* @param docId
* @param isPreview 是否预览,true:预览
* @returns {string}
*/
let downloadFile = function (docId, isPreview) {
if (isPreview) {
return IPLATUI.CONTEXT_PATH + '/file/download/preview/' + docId;
} else {
// S3地址必须支持公网
return IPLATUI.CONTEXT_PATH + '/file/download/' + docId;
}
}
/**
......
......@@ -94,8 +94,6 @@
} else {
response.sendRedirect(request.getContextPath() + _urlHtml);
}
} else {
//以正常方式进入登录首页
rd = request.getRequestDispatcher("iPlatV7-login.jsp");
......
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:sec="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-4.2.xsd">
<bean id="keyPairLocator" class="com.baosight.xservices.xs.sso.SecretKeyPairLocator4Config">
<property name="keyPairMapping">
<map>
<entry key="UDP">
<bean class="com.baosight.xservices.xs.sso.SecretKeyPair4DSA">
<property name="private"
value="3082014b0201003082012c06072a8648ce3804013082011f02818100fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b76b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c70215009760508f15230bccb292b982a2eb840bf0581cf502818100f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d0782675159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e13c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243bcca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a041602145898ad70090def72e9d6a8ce864e688c366994a6"/>
<property name="public"
value="308201b73082012c06072a8648ce3804013082011f02818100fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b76b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c70215009760508f15230bccb292b982a2eb840bf0581cf502818100f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d0782675159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e13c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243bcca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a0381840002818009202eda89c00359a104d5ffbd043f515c737588bac7be945d89c995b9c50f43b08881f3b93592d31ec4e55a905c30e1f4fdb39a4241697a526ebedfd6fc5238d3fb0ac793af0183a4716182aaa8cb2b325f2f8d4d298f115a430866e0c99e5386a1309853e43d17fc2bdc39a4ba64c714f33c2e7049d22440c947479f9c3f6c"/>
</bean>
</entry>
</map>
</property>
</bean>
</beans>
\ No newline at end of file
......@@ -434,8 +434,8 @@ function billFunc() {
message("勾选的数据中有已经开票的票据!");
flag = false;
}
if (row.billNumber == " ") {
message("勾选的数据中发票号为空");
if (isBlank(row.billNumber)) {
message("选中的第"+(index+1)+"行数据中发票号为空!");
flag = false;
}
})
......
......@@ -31,6 +31,7 @@
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.billTybe"/>
</EF:EFSelect>
<EF:EFInput cname="开票单号" ename="invoiceCode" blockId="inqu_status" row="0" colWidth="3" placeholder="模糊查询开票单号"/>
<EF:EFInput cname="发票号" ename="billNumber" blockId="inqu_status" row="0" colWidth="3" placeholder="模糊查询发票号"/>
<EF:EFSelect cname="开票状态" ename="inqu_status-0-billState" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
......@@ -75,6 +76,7 @@
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFColumn ename="settlementNumber" cname="来源单号" width="140" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="invoiceCode" cname="开票单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="billTybe" cname="票据类型" width="120" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="true" defaultValue="1">
<EF:EFCodeOption codeName="hggp.cw.billTybe"/>
......
......@@ -81,11 +81,17 @@ function saveFunc() {
let flag = true;
$.each(rows, function(index, item) {
let reviewStatus= item.get("reviewStatus");
let thisAmount= item.get("thisAmount");
if((reviewStatus === "1")){
message("数据已审核");
flag = false;
return false;
}
if (!isNumber(thisAmount) && thisAmount <= 0) {
message("勾选的第" + (index + 1) + "行本次收票金额必须是大于0的数字");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
......@@ -56,7 +56,7 @@
data-errorprompt="请输入数字,该值最大可设置15位整数和2位小数!"/>
<EF:EFColumn ename="thisPriceTax" cname="结算含税金额" enable="false" hidden="false" format="{0:N2}" align="right"/>
<EF:EFColumn ename="thisAmount" cname="本次开票金额" width="120" enable="true" readonly="false" format="{0:N2}" editType="text"
displayType="0.00" sort="true" align="right" maxLength="15" required="false"
displayType="0.00" sort="true" align="right" maxLength="15" required="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,2})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和2位小数!"/>
<EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" format="{0:N2}" editType="text"
......
......@@ -58,7 +58,7 @@ function saveFunc() {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW010", "save", info, {
EiCommunicator.send("HGCW011", "update", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
......
......@@ -57,11 +57,17 @@ function saveFunc() {
let flag = true;
$.each(rows, function(index, item) {
let reviewStatus= item.get("reviewStatus");
let thisAmount= item.get("thisAmount");
if((reviewStatus === "1")){
message("数据已审核");
flag = false;
return false;
}
if (!isNumber(thisAmount) && thisAmount <= 0) {
message("勾选的第" + (index + 1) + "行本次收票金额必须是大于0的数字");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
......@@ -69,7 +69,7 @@
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,2})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和2位小数!"/>
<EF:EFColumn ename="thisAmount" cname="本次开票金额" width="120" enable="true" readonly="false" format="{0:N2}" editType="text"
displayType="0.00" sort="true" align="right" maxLength="15" required="false"
displayType="0.00" sort="true" align="right" maxLength="15" required="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,2})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和2位小数!"/>
<EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" format="{0:N2}" editType="text"
......
......@@ -57,11 +57,17 @@ function saveFunc() {
let flag = true;
$.each(rows, function(index, item) {
let reviewStatus= item.get("reviewStatus");
let thisAmount= item.get("thisAmount");
if((reviewStatus === "1")){
message("数据已审核");
flag = false;
return false;
}
if (!isNumber(thisAmount) && thisAmount <= 0) {
message("勾选的第" + (index + 1) + "行本次收票金额必须是大于0的数字");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
......@@ -63,7 +63,7 @@
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,2})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和2位小数!"/>
<EF:EFColumn ename="thisAmount" cname="本次开票金额" width="120" enable="true" readonly="false" format="{0:N2}" editType="text"
displayType="0.00" sort="true" align="right" maxLength="15" required="false"
displayType="0.00" sort="true" align="right" maxLength="15" required="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,2})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和2位小数!"/>
<EF:EFColumn ename="remainingAmount" cname="剩余开票金额" width="120" enable="false" format="{0:N2}" editType="text"
......
......@@ -24,6 +24,7 @@
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.billTybe"/>
</EF:EFSelect>
<EF:EFInput cname="收票单号" ename="invoiceCode" blockId="inqu_status" row="0" colWidth="3" placeholder="模糊查询收票单号"/>
<EF:EFInput cname="发票号" ename="billNumber" blockId="inqu_status" row="0" colWidth="3" placeholder="模糊发票号"/>
<EF:EFSelect cname="审核状态" ename="inqu_status-0-billState" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
......@@ -58,6 +59,7 @@
maxLength="16" readonly="true" width="210" required="true"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFColumn ename="invoiceCode" cname="收票单号" enable="false" width="120" align="center"/>
<%--<EF:EFColumn ename="partyA" cname="供应商名称" width="220" enable="false" readonly="true" align="center"/>--%>
<EF:EFColumn ename="settlementNumber" cname="来源单号" width="200" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="billTybe" cname="票据类型" width="120" align="center" required="true" defaultValue="1"
......
......@@ -323,6 +323,14 @@ $(function () {
align:"right",
enable: false,
locked: false
},{
field: "taxIncludeAmount",
title: "含税金额",
headerTemplate: "<span style='color: '>含税金额 </span>",
format:"{0:C2}",
align:"right",
enable: false,
locked: false
},
{
field: "thisSettlementAmount",
......@@ -419,7 +427,7 @@ $(function () {
locked: false,
template: function (item) {
if (item.isInvoicing == 0 && item.invoiceRemainingAmount == 0){
item.invoiceRemainingAmount = item.amount;
item.invoiceRemainingAmount = item.taxIncludeAmount;
}
return kendo.format("{0:N2}",parseFloat(item.invoiceRemainingAmount));
}
......
......@@ -177,7 +177,7 @@ function submitFunc() {
message("选中的第"+(index+1)+"行未保存的数据,请先保存!");
flag = false;
}
if (row.reviewStatus == "3") {
if (row.reviewStatus == "1") {
message("勾选的数据中有已经提交的单据!");
flag = false;
return;
......
......@@ -52,6 +52,7 @@
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,2})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和2位小数!"/>
<EF:EFColumn ename="partyA" cname="客户名称" width="200" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="invoiceCode" cname="开票单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="来源单号" width="200" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="billTybe" cname="票据类型" width="120" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
......
......@@ -62,6 +62,7 @@
maxLength="16" readonly="true" width="200" required="true" enable="false"
align="center" filter="contains" sort="true">
</EF:EFComboColumn>
<EF:EFColumn ename="invoiceCode" cname="开票单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="来源单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="billTybe" cname="票据类型" width="120" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
......
......@@ -43,7 +43,7 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="left"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="180" align="left"/>
<EF:EFComboColumn cname="类型" ename="receiveType" width="80" align="center" required="false" enable="false">
<EF:EFCodeOption codeName="hggp.receiveType"/>
</EF:EFComboColumn>
......
......@@ -21,9 +21,9 @@ $(function (){
},
toolbarConfig: {
// hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
add: receiveDataSource === 2 ? false : true, // 不显示新增按钮
add: receiveDataSource === 2 ? false : true, // 不显示取消按钮
save: receiveDataSource === 2 ? false : true // 不显示保存按钮
add: receiveDataSource == 2 ? false : true, // 不显示新增按钮
save: receiveDataSource == 2 ? false : true, // 不显示保存按钮
cancel: receiveDataSource == 2 ? false : true // 不显示取消按钮
// delete: false, // 显示删除按钮
},
beforeEdit: function (e) {
......
......@@ -11,7 +11,7 @@
<EF:EFInput ename="inqu_status-0-companyName" cname="公司编号" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-receiveId" cname="领料单id" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-projCode" cname="项目编号" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-whName" cname="仓库名称" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-whCode" cname="仓库编号" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="仓库名称" ename="whName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
......@@ -34,8 +34,8 @@
</EF:EFComboColumn>
<EF:EFColumn ename="parentProdCode" cname="成品编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="parentProdName" cname="成品名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="materialCode" cname="材料编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="materialtName" cname="材料名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="productCode" cname="材料编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="productName" cname="材料名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="applyQty" cname="申请数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="quantity" cname="数量" enable="false" width="120" align="right" format="{0:N3}"/>
......
......@@ -310,7 +310,7 @@ function showDetail(id,calloutWhCode,calloutWhName,callinWhCode,callinWhName,sta
JSColorbox.open({
href: "HGKC013A?methodName=initLoad&inqu_status-0-parentId="+id+"&inqu_status-0-calloutWhCode="+calloutWhCode+"&inqu_status-0-calloutWhName="+calloutWhName+"&inqu_status-0-callinWhCode="+callinWhCode+"&inqu_status-0-callinWhName="+callinWhName+"&inqu_status-0-status="+status+"&inqu_status-0-calloutCompanyCode="+calloutCompanyCode,
title: "<div style='text-align: center;'>调拨单详情</div>",
width: "80%",
height: "80%",
width: "90%",
height: "90%",
});
}
......@@ -13,6 +13,12 @@ $(function() {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200]
},
toolbarConfig: {
// hidden: false, // true时,不显示功能按钮,但保留setting导出按钮
add: false, // 不显示新增按钮
cancel : false
// delete: false, // 显示删除按钮
},
columns: [{
field: "inventType",
filter: function (options) {
......@@ -23,73 +29,6 @@ $(function() {
editor: function (container, options) {
this.filter(options);
}
}, {
field: "inventCode",
title: "存货名称",
filter: function (options) {
let inventType = options.model["inventType"];
/*if (inventType){
return _.filter(inventCodedBox, function (item) {
return item["param1Field"] === inventType;
})
}*/
return options.values;
},
template: function (dataItem) {
for (let i = 0; i < inventCodedBox.length; i++) {
if (inventCodedBox[i]['valueField'] === dataItem['inventCode']){
dataItem['inventName'] = inventCodedBox[i]['textField']
dataItem['inventRecordId'] = inventCodedBox[i]['param2Field'];
return inventCodedBox[i]['textField'];
}
}
return dataItem["inventCode"];
},
editor: function (container, options) {
var input = $('<input />');
input.attr("name", options.field);
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: inventCodedBox,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
optionLabelTemplate: "#:valueField#-#:textField#-#:param3Field#",
valueTemplate: "#:valueField#-#:textField#-#:param3Field#",
template: "#:valueField#-#:textField#-#:param3Field#",
filter: "contains"
});
}
}, {
field: "spec",
filter: function (options) {
let specId = options.model["inventRecordId"];
if (specId){
return _.filter(specIdBox, function (item) {
return item["param7Field"] === specId;
})
}
return options.values;
},
template: function (item) {
return $.trim(item.spec) == "" ? "" : item.spec;
}
}, {
field: "length",
template: function (item) {
return item.length == 0 ? "-" : item.length;
}
}, {
field: "width",
template: function (item) {
return item.width == 0 ? "-" : item.width;
}
}, {
field: "thick",
template: function (item) {
return item.thick == 0 ? "-" : item.thick;
}
}/*, {
field: "unitWeight",
format: "{0:n3}",
......@@ -171,6 +110,8 @@ $(function() {
//deleteFunc();
}
}
// 选择存货
$("#SELECT_INVENT").on("click", selectInvent);
downKeyUp();
});
......@@ -261,4 +202,33 @@ let deleteFunc = function () {
JSUtils.submitGridsData("result", "HGKC004A", "delete", true);
}
});
}
\ No newline at end of file
}
/**
* 选择
*/
let selectInvent = function () {
let params = {
"inqu_status-0-parentId": $("#inqu_status-0-parentId").val(),
"inqu_status-0-companyCode": $("#inqu_status-0-calloutCompanyCode").val(),
"inqu_status-0-whCode": $("#inqu_status-0-calloutWhCode").val()
}
JSColorbox.open({
href: "HGKC013B",
title: "<div style='text-align: center;'>综合实时库存</div>",
width: "90%",
height: "90%",
params: params,
callbackName: selectInventCallback
});
}
/**
* 选择回调
*/
let selectInventCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
......@@ -21,6 +21,8 @@
<EF:EFInput blockId="inqu_status" row="0" ename="callinWhName" cname="调入仓库名称" colWidth="3" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="calloutWhCode" cname="调出仓库编码" colWidth="3" type="hidden" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="callinWhCode" cname="调入仓库编码" colWidth="3" type="hidden" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="calloutCompanyCode" cname="调出公司编码" colWidth="3" type="hidden" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="callinCompanyCode" cname="调入公司编码" colWidth="3" type="hidden" readonly="true"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inventName" cname="存货名称" colWidth="3" placeholder="模糊查询"/>
<EF:EFInput blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/>
......@@ -33,23 +35,24 @@
<%--<EF:EFComboColumn ename="inventCode" cname="存货名称" enable="true" width="120" align="center"
blockName="invent_code_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" filter="contains" />--%>
<EF:EFColumn ename="inventCode" cname="存货名称" enable="true" required="true" readonly="false" width="200" align="center"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="true" width="120" align="center" required="true"
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" required="false" readonly="true" width="120" align="center"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" required="false" readonly="true" width="200" align="center"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="120" align="center" required="false"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true"
<EF:EFComboColumn ename="spec" cname="规格" enable="false" width="120" align="center" required="false"
blockName="spec_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains">
</EF:EFComboColumn>
<%--defaultValue="0"--%>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" enable="true" readonly="true" align="center" hidden="true" maxLength="50"/>
<EF:EFColumn ename="length" cname="长度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="true" readonly="false" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="inventRecordId" cname="规格ID" width="120" enable="false" readonly="true" align="center" hidden="true" maxLength="50"/>
<EF:EFColumn ename="length" cname="长度(MM)" enable="false" readonly="true" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="width" cname="宽度(MM)" enable="false" readonly="true" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="thick" cname="厚度(MM)" enable="false" readonly="true" width="100" align="right" format="{0:N3}" maxLength="10"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,20}([.][0-9]{1,3})?$/" maxLength="20" required="true"
......
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
columns: []
},
};
// 查询
$("#QUERY").on("click", query);
// 确认
$("#CONFIRM").on("click", confirm);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
//存货编号查询条件
// initInventCode();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1); // 点击查询按钮,从第1页开始查询
}
/**
* 选择
*/
let confirm = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
for (let i = 0; i < rows.length; i++) {
let applyQty = rows[i]['applyQty'];
let invQty = rows[i]['invQty'];
if (!isPositiveNumber(applyQty)) {
message("勾选的第" + (i + 1) + "行申请数量必须大于0");
return;
}
if (parseFloat(invQty) < parseFloat(applyQty)) {
message("勾选的第" + (i + 1) + "行申请数量不能大于库存数量");
return;
}
}
JSUtils.confirm("确定对勾选的[" + rows.length + "]条数据进行\"调拨\"操作吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC013B", "confirm",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
/**
* 存货编号
*/
let initInventCode = function () {
//物料信息下拉
var inInfo=new EiInfo();
EiCommunicator.send("HGPZ005", "queryComboBox", inInfo, {
onSuccess: function (ei) {
let dataSource;
var input=$("#inqu_status-0-inventCode");
dataSource=ei.getBlock("invent_record_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataSource,
template: "[#:valueField#]#:textField#|#:param2Field#",
filter: "contains"
});
}, onFail: function (ei) {
}
}, {async: false});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="综合库存管理">
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="inqu_status-0-companyCode" cname="公司编号" colWidth="3" type="hidden"/>
<EF:EFInput ename="inqu_status-0-parentId" cname="领料单id" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFSelect cname="仓库" ename="whCode" blockId="inqu_status" row="0" colWidth="3"
optionLabel="全部" defultValue="" readonly="true">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货类型" ename="inventType" blockId="inqu_status" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="存货编码" ename="inventCode" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="存货名称" ename="inventName" blockId="inqu_status" row="0" colWidth="3"/>
</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="companyCode" cname="公司编码" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center" hidden="true"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center"
blockName="invent_type_block_id" textField="textField" valueField="valueField">
</EF:EFComboColumn>
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/>
<EF:EFColumn ename="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="applyQty" cname="申请数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="invQty" cname="库存数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invUnitWeight" cname="单重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="invWeight" cname="库存总重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
<EF:EFColumn ename="updatedName" cname="更新人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="updatedTime" cname="更新时刻" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......@@ -24,18 +24,18 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" needAuth="false">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFComboColumn ename="productCode" cname="成品编码" width="120" align="center" required="true" readonly="false"
<EF:EFComboColumn ename="productCode" cname="成品编码" width="200" align="center" required="true" readonly="false"
blockName="invent_record_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=valueField#-#=textField#"
filter="contains" />
<EF:EFColumn ename="productName" cname="成品名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="productName" cname="成品名称" width="200" align="center" required="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="true"
blockName="invent_type_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false" filter="contains" />
<EF:EFComboColumn ename="inventCode" cname="材料编码" width="120" align="center" required="false" readonly="false"
<EF:EFComboColumn ename="inventCode" cname="材料编码" width="200" align="center" required="false" readonly="false"
blockName="invent_record_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=valueField#" itemTemplate="#=valueField#-#=textField#" filter="contains" />
<EF:EFColumn ename="inventName" cname="材料名称" enable="false" width="120" align="center" required="false"/>
<EF:EFColumn ename="inventName" cname="材料名称" enable="false" width="200" align="center" required="false"/>
<EF:EFColumn ename="specId" cname="规格ID" width="140" align="center" maxLength="50" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" width="140" align="center" maxLength="50"/>
<EF:EFColumn ename="unit" cname="单位" width="80" align="center"/>
......@@ -89,8 +89,8 @@
columnTemplate="#=textField#" itemTemplate="#=valueField#-#=textField#"
filter="contains">
</EF:EFComboColumn>--%>
<EF:EFColumn ename="inventCode" cname="原料编码" enable="false" width="120" align="center" required="true"/>
<EF:EFColumn ename="inventName" cname="原料名称" enable="false" width="120" align="center" required="true"/>
<EF:EFColumn ename="inventCode" cname="原料编码" enable="false" width="200" align="center" required="true"/>
<EF:EFColumn ename="inventName" cname="原料名称" enable="false" width="200" align="center" required="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center" required="true"
blockName="invent_type_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
......
......@@ -9,7 +9,7 @@ $(function () {
resultGrid.dataSource.page(1);
}
// 显示授权按钮
showAuthButton();
//showAuthButton();
}, 1000);
// 分割线组件
......
......@@ -308,7 +308,9 @@ $(function () {
title: "<div style='text-align: center;'>文档权限管理</div>",
width: "90%",
height: "90%",
callbackName: editCallback
callbackName: function () {
editCallback($("#inqu_status-0-orgParentId").val());
}
});
})
......@@ -489,7 +491,11 @@ $(function () {
+ '\')" target="_blank">变更</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="changeFileRecords(\'' + model.id + '\',\'' + model.docId
+ '\',\'' + model.docName + '\')" target="_blank">变更记录</a>';
+ '\',\'' + model.docName + '\')" target="_blank">变更记录</a><br/>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showQueryRecord(\'' + model.docId + '\')" >预览记录</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDownloadRecord(\'' + model.docId + '\')" >下载记录</a>';
return template;
}
}, {
......@@ -1125,4 +1131,35 @@ let treeSelectClick = function (nodeData) {
showAuthButton();
// 刷新列表
query();
}
/**
* 显示查询记录
*
* @param docId
*/
let showQueryRecord = function (docId) {
let fileId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId;
JSColorbox.open({
href: "HGWD001B?inqu_status-0-fileId=" + fileId + "&inqu_status-0-docId=" + docId,
title: "<div style='text-align: center;'>预览记录</div>",
width: "80%",
height: "80%",
});
}
/**
* 显示下载记录
*
* @param docId
*/
let showDownloadRecord = function (docId) {
let fileId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId;
JSColorbox.open({
href: "HGWD001C?inqu_status-0-fileId=" + fileId + "&inqu_status-0-docId=" + docId,
title: "<div style='text-align: center;'>下载记录</div>",
width: "80%",
height: "80%",
});
}
\ No newline at end of file
......@@ -81,7 +81,7 @@
sort="single" serviceName="HGWD099" queryMethod="query" deleteMethod="delete">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="140" align="center" sort="false"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="150" align="center" sort="false"/>
<EF:EFColumn ename="docName" cname="附件名称" enable="false" width="200"/>
<EF:EFColumn ename="docType" cname="附件类型" enable="false" width="110" align="center"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center" sort="true"/>
......
......@@ -64,8 +64,7 @@ let save = function () {
function (e) {
var status = e.status;
if (status !== -1) {
let fileId = $("#inqu_status-0-fileId").val();
parent.JSColorbox.setValueCallback(fileId);
parent.JSColorbox.setValueCallback();
}
});
}
......@@ -98,8 +97,7 @@ let auth = function () {
* 授权回调
*/
let authCallback = function (res) {
let fileId = $("#inqu_status-0-fileId").val();
parent.JSColorbox.setValueCallback(fileId);
parent.JSColorbox.setValueCallback();
// 刷新页面
query();
......@@ -120,7 +118,12 @@ let removeUser = function () {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"取消授权用户\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD003", "removeUser",
true
true,function (e) {
var status = e.status;
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
});
......
......@@ -156,10 +156,6 @@ $(function () {
template: function (model) {
let param = "'" + model.docId + "', '" + model.docType + "', '" + model.docName + "'";
let template = '';
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
// + 'onclick="showQueryRecord(' + param + ')" >预览记录</a>';
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
// + 'onclick="showDownloadRecord(' + param + ')" >下载记录</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showPreview(' + param + ')" >预览</a>';
return template;
......
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