Commit cb68d56c by 宋祥
parents 4a3af12b 610f12f4
......@@ -11,6 +11,7 @@ public enum ChangeTypeEnum {
UPDATE("update", "修改"),
DELETE("delete", "删除"),
UPLOAD_ADD("uploadAdd", "附件添加"),
UPLOAD_UPDATE("uploadUpdate", "附件变更"),
UPLOAD_DELETE("uploadDelete", "附件删除"),
RELEASE("release", "发布"),
;
......
package com.baosight.hggp.hg.cg.constant;
/**
* @author:songx
* @date:2024/8/30,15:53
*/
public class HgCgConst {
/**
* 计算方式
*
* @author:songx
* @date:2024/2/22,13:57
*/
public static class CalculationMethod {
// 数量计算
public static final Integer S0 = 0;
// 重量计算
public static final Integer S1 = 1;
}
}
......@@ -58,6 +58,7 @@ public class HGCG001A extends DaoEPBase {
public static final String FIELD_REMARKS = "remarks"; /*备注*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_CALCULATION_METHOD = "calculationMethod"; /* 计算方式 0-数量乘单价 1-重量乘单价*/
//页面展示
public static final String FIELD_SOURCE = "source"; /* 数据来源 根据采购数据来源小代码 目前默认0材料计划,1手工录入*/
......@@ -143,6 +144,7 @@ public class HGCG001A extends DaoEPBase {
private String remarks; /*备注*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private Integer calculationMethod; /* 计算方式 0-数量乘单价 1-重量乘单价*/
//选择合同需要信息
private Integer source; /* 数据来源 根据采购数据来源小代码 目前默认0材料计划,1手工录入*/
......@@ -368,6 +370,10 @@ public class HGCG001A extends DaoEPBase {
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CALCULATION_METHOD);
eiColumn.setDescName("计算方式 0-数量乘单价 1-重量乘单价");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -969,7 +975,15 @@ public class HGCG001A extends DaoEPBase {
public void setProjName(String projName) {
this.projName = projName;
}
public Integer getCalculationMethod() {
return calculationMethod;
}
public void setCalculationMethod(Integer calculationMethod) {
this.calculationMethod = calculationMethod;
}
/**
* get the value from Map.
*
......@@ -1013,6 +1027,7 @@ public class HGCG001A extends DaoEPBase {
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setCalculationMethod(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CALCULATION_METHOD)), calculationMethod));
setSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SOURCE)), source));
setPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_PRICE)), price));
......@@ -1066,6 +1081,7 @@ public class HGCG001A extends DaoEPBase {
map.put(FIELD_REMARKS,StringUtils.toString(remarks, eiMetadata.getMeta(FIELD_REMARKS)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_CALCULATION_METHOD, StringUtils.toString(calculationMethod, eiMetadata.getMeta(FIELD_CALCULATION_METHOD)));
map.put(FIELD_SOURCE, StringUtils.toString(source, eiMetadata.getMeta(FIELD_SOURCE)));
map.put(FIELD_PRICE, StringUtils.toString(price, eiMetadata.getMeta(FIELD_PRICE)));
......
......@@ -63,6 +63,8 @@ public class HGCG002B extends DaoEPBase {
//页面需要展示
public static final String FIELD_BC_RECEIVE_QTY = "bcReceiveQty"; /* 本次收货数量*/
public static final String FIELD_BC_MAX_RECEIVE_QTY = "bcMaxReceiveQty"; /* 本次最大收货数量*/
public static final String FIELD_BC_RECEIVE_WEIGHT = "bcReceiveWeight"; /* 本次收货重量*/
public static final String FIELD_BC_MAX_RECEIVE_WEIGHT = "bcMaxReceiveWeight"; /* 本次最大收货重量*/
public static final String FIELD_CONTRACT_DATE = "contractDate"; /* 合同日期*/
public static final String FIELD_CONTRACT_NO = "contractNo"; /* 合同号*/
public static final String FIELD_PLAN_NO = "planNo"; /* 计划单号*/
......@@ -155,6 +157,8 @@ public class HGCG002B extends DaoEPBase {
//页面需要填写、展示字段
private BigDecimal bcReceiveQty = new BigDecimal(0.000); /* 本次收货数量*/
private BigDecimal bcMaxReceiveQty = new BigDecimal(0.000); /* 本次最大收货数量*/
private BigDecimal bcReceiveWeight = new BigDecimal(0.000); /* 本次收货重量*/
private BigDecimal bcMaxReceiveWeight = new BigDecimal(0.000); /* 本次最大收货重量*/
private String contractDate = " "; /* 合同日期*/
private String contractNo = " "; /* 合同号*/
private String planNo = " "; /* 计划单号*/
......@@ -359,7 +363,22 @@ public class HGCG002B extends DaoEPBase {
eiColumn.setFieldLength(20);
eiColumn.setDescName("本次最大收货数量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_BC_RECEIVE_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("本次收货重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_BC_MAX_RECEIVE_WEIGHT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(20);
eiColumn.setDescName("本次最大收货重量");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CONTRACT_DATE);
eiColumn.setDescName("合同日期");
eiMetadata.addMeta(eiColumn);
......@@ -956,7 +975,23 @@ public class HGCG002B extends DaoEPBase {
public void setBcMaxReceiveQty(BigDecimal bcMaxReceiveQty) {
this.bcMaxReceiveQty = bcMaxReceiveQty;
}
public BigDecimal getBcReceiveWeight() {
return bcReceiveWeight;
}
public void setBcReceiveWeight(BigDecimal bcReceiveWeight) {
this.bcReceiveWeight = bcReceiveWeight;
}
public BigDecimal getBcMaxReceiveWeight() {
return bcMaxReceiveWeight;
}
public void setBcMaxReceiveWeight(BigDecimal bcMaxReceiveWeight) {
this.bcMaxReceiveWeight = bcMaxReceiveWeight;
}
public String getContractDate() {
return contractDate;
}
......@@ -1101,6 +1136,8 @@ public class HGCG002B extends DaoEPBase {
setBcReceiveQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BC_RECEIVE_QTY)), bcReceiveQty));
setBcMaxReceiveQty(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BC_MAX_RECEIVE_QTY)), bcMaxReceiveQty));
setBcReceiveWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BC_RECEIVE_WEIGHT)), bcReceiveWeight));
setBcMaxReceiveWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_BC_MAX_RECEIVE_WEIGHT)), bcMaxReceiveWeight));
setContractDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_DATE)), contractDate));
setContractNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NO)), contractNo));
setPlanNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_NO)), planNo));
......@@ -1158,6 +1195,8 @@ public class HGCG002B extends DaoEPBase {
map.put(FIELD_BC_RECEIVE_QTY, StringUtils.toString(bcReceiveQty, eiMetadata.getMeta(FIELD_BC_RECEIVE_QTY)));
map.put(FIELD_BC_MAX_RECEIVE_QTY, StringUtils.toString(bcMaxReceiveQty, eiMetadata.getMeta(FIELD_BC_MAX_RECEIVE_QTY)));
map.put(FIELD_BC_RECEIVE_WEIGHT, StringUtils.toString(bcReceiveWeight, eiMetadata.getMeta(FIELD_BC_RECEIVE_WEIGHT)));
map.put(FIELD_BC_MAX_RECEIVE_WEIGHT, StringUtils.toString(bcMaxReceiveWeight, eiMetadata.getMeta(FIELD_BC_MAX_RECEIVE_WEIGHT)));
map.put(FIELD_CONTRACT_DATE, StringUtils.toString(contractDate, eiMetadata.getMeta(FIELD_CONTRACT_DATE)));
map.put(FIELD_CONTRACT_NO, StringUtils.toString(contractNo, eiMetadata.getMeta(FIELD_CONTRACT_NO)));
map.put(FIELD_PLAN_NO, StringUtils.toString(planNo, eiMetadata.getMeta(FIELD_PLAN_NO)));
......
......@@ -101,6 +101,7 @@ public class ServiceHGCG001 extends ServiceBase {
// 写入数据
for (int i = 0; i < fCg001s.size(); i++) {
HGCG001 hgcg001 = fCg001s.get(i);
hgcg001.setPlanDate(DateUtils.formatShort(hgcg001.getPlanDate()));
if (hgcg001.getId() == null || hgcg001.getId() == 0) {
// 修改数据
this.saveData(hgcg001);
......
......@@ -94,11 +94,9 @@ public class ServiceHGCG002A extends ServiceBase {
@OperationLogAnnotation(operModul = "采购计划", operType = "修改", operDesc = "确认")
public EiInfo confirm(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<HGCG001A> fCg001As = MapUtils.toDaoEPBases(inInfo, HGCG001A.class);
// db数据
Map<Long, HGCG001A> dbCg001Map = this.lockGetData(fCg001As);
//计划主表信息
List<String> planNos = fCg001As.stream().map(HGCG001A::getPlanNo).collect(Collectors.toList());
Map<String, HGCG001> hgcg001Map = HGCGTools.HgCg001.map(planNos);
......
......@@ -4,7 +4,11 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.domain.*;
import com.baosight.hggp.hg.cg.constant.HgCgConst;
import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002B;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
......@@ -33,7 +37,7 @@ import java.util.Map;
* @date:2024/5/9,11:04
*/
public class ServiceHGCG003A extends ServiceBase {
/**
* 画面初始化
*
......@@ -54,7 +58,7 @@ public class ServiceHGCG003A extends ServiceBase {
}
return inInfo;
}
/**
* 查询操作
*
......@@ -75,7 +79,7 @@ public class ServiceHGCG003A extends ServiceBase {
}
return inInfo;
}
/**
* 确认操作.
*
......@@ -103,10 +107,11 @@ public class ServiceHGCG003A extends ServiceBase {
}
return inInfo;
}
/**
* 数据校验
* @param fCg002Bs
*
* @param fCg002Bs
* @param dbCg002BMap
* @param cg001
*/
......@@ -120,6 +125,9 @@ public class ServiceHGCG003A extends ServiceBase {
AssertUtils.isGt(fCg002B.getBcReceiveQty(), fCg002B.getBcMaxReceiveQty(),
String.format("合同[%s]本次收货数量(%s)不能大于本次最大收货数量(%s)", cg001.getContractNo(),
fCg002B.getBcReceiveQty(), fCg002B.getBcMaxReceiveQty()));
AssertUtils.isGt(fCg002B.getBcReceiveWeight(), fCg002B.getBcMaxReceiveWeight(),
String.format("合同[%s]本次收货重量(%s)不能大于本次最大收货重量(%s)", cg001.getContractNo(),
fCg002B.getBcReceiveWeight(), fCg002B.getBcMaxReceiveWeight()));
}
}
......@@ -135,9 +143,19 @@ public class ServiceHGCG003A extends ServiceBase {
Long id = fCg002B.getId();
HGCG002B dbCg002b = dbCg002BMap.get(id);
// 总重
fCg002B.setReceiveWeight(fCg002B.getBcReceiveQty().multiply(dbCg002b.getPurUnitWeight()));
BigDecimal bcReceiveWeight = fCg002B.getBcReceiveWeight();
if (bcReceiveWeight == null || bcReceiveWeight.compareTo(BigDecimal.ZERO) == 0) {
fCg002B.setReceiveWeight(fCg002B.getBcReceiveQty().multiply(dbCg002b.getPurUnitWeight()));
} else {
fCg002B.setReceiveWeight(bcReceiveWeight);
}
// 含税总金额
BigDecimal amount = fCg002B.getReceiveWeight().multiply(dbCg002b.getPrice());
BigDecimal amount;
if (HgCgConst.CalculationMethod.S1.equals(fCg002B.getCalculationMethod())) {
amount = fCg002B.getReceiveWeight().multiply(dbCg002b.getPrice());
} else {
amount = fCg002B.getBcReceiveQty().multiply(dbCg002b.getPrice());
}
// 如果税率不为空,总金额减去税额
if (dbCg002b.getTaxRate() != null) {
amount = amount.subtract(amount.multiply(dbCg002b.getTaxRate()).divide(new BigDecimal("100")));
......@@ -213,5 +231,5 @@ public class ServiceHGCG003A extends ServiceBase {
// 更新合同状态
HGCGTools.HgCg002B.updateReceive(dbCg002b, cg003B.getReceiveQty());
}
}
......@@ -6,7 +6,11 @@ import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.domain.*;
import com.baosight.hggp.hg.cg.domain.HGCG002;
import com.baosight.hggp.hg.cg.domain.HGCG002A;
import com.baosight.hggp.hg.cg.domain.HGCG002B;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
......@@ -14,21 +18,30 @@ import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGCG003B extends ServiceBase {
/**
* 画面初始化
*
......@@ -41,18 +54,18 @@ public class ServiceHGCG003B extends ServiceBase {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BOX_BLOCK_ID),
new HashMap<String, Object>(){{
put(HGPZ005.FIELD_STATUS,1);
new HashMap<String, Object>() {{
put(HGPZ005.FIELD_STATUS, 1);
put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour());
}}, false);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
EiInfoUtils.addBlock(inInfo, "roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003B().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
......@@ -69,7 +82,7 @@ public class ServiceHGCG003B extends ServiceBase {
}
return inInfo;
}
/**
* 保存操作.
*
......@@ -81,7 +94,7 @@ public class ServiceHGCG003B extends ServiceBase {
try {
List<HGCG003B> fCg003Bs = MapUtils.toDaoEPBases(inInfo, HGCG003B.class);
HGCG003 cg003 = HGCGTools.HgCg003.get(fCg003Bs.get(0).getPrimaryId());
if(cg003.getSource().intValue() == HGConstant.CgSource.DEFAULT){
if (cg003.getSource().intValue() == HGConstant.CgSource.DEFAULT) {
// 采购收货DB数据
Map<Long, HGCG003B> dbCg003BMap = HGCGUtils.HgCg003B.lockGetDataEp(fCg003Bs);
// 采购合同DB数据
......@@ -91,16 +104,16 @@ public class ServiceHGCG003B extends ServiceBase {
Map<Long, HGCG002B> dbCg002BMap = HGCGUtils.HgCg002B.lockGetData(
ObjectUtils.listEpKey(fCg003Bs, HGCG003B.FIELD_CONTRACT_DETAIL_ID));
// 数据校验
this.checkEditData(fCg003Bs, dbCg003BMap,cg003);
this.checkEditData(fCg003Bs, dbCg003BMap, cg003);
// 保存数据
this.editData(fCg003Bs, dbCg003BMap, dbCg002AMap,cg003,dbCg002BMap);
}else{
this.editData(fCg003Bs, dbCg003BMap, dbCg002AMap, cg003, dbCg002BMap);
} else {
// 写入数据
for (int i = 0; i < fCg003Bs.size(); i++) {
HGCG003B hgcg003B = fCg003Bs.get(i);
if (hgcg003B.getId() == null || hgcg003B.getId() == 0) {
// 修改数据
this.saveData(hgcg003B,cg003);
this.addData(hgcg003B, cg003);
} else {
this.updateData(hgcg003B);
}
......@@ -108,7 +121,6 @@ public class ServiceHGCG003B extends ServiceBase {
//修改主表信息
updateCg003Pur(cg003);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg003Bs.size() + "]条数据保存成功!");
......@@ -117,10 +129,11 @@ public class ServiceHGCG003B extends ServiceBase {
}
return inInfo;
}
/**
* 数据校验
* @param fCg003Bs
*
* @param fCg003Bs
* @param dbCg003Map
* @param cg003
*/
......@@ -146,9 +159,10 @@ public class ServiceHGCG003B extends ServiceBase {
}
}
}
/**
* 数据保存
*
* @param fCg003Bs
* @param dbCg003BMap
* @param dbCg002AMap
......@@ -167,7 +181,7 @@ public class ServiceHGCG003B extends ServiceBase {
HGCGTools.HgCg002B.updateReceive(dbCg002BMap.get(fCg003B.getContractDetailId()), diffQty);
}
List<HGCG002> hgcg002List = new LinkedList<>();
dbCg002AMap.forEach((k, v)->{
dbCg002AMap.forEach((k, v) -> {
hgcg002List.add(v);
});
//根据子表明细刷新合同主表信息
......@@ -175,9 +189,14 @@ public class ServiceHGCG003B extends ServiceBase {
//修改主表信息
updateCg003Pur(cg003);
}
private void saveData(HGCG003B hgcg003B, HGCG003 cg003) {
// 新增数据
/**
* 新增数据
*
* @param hgcg003B
* @param cg003
*/
private void addData(HGCG003B hgcg003B, HGCG003 cg003) {
hgcg003B.setPrimaryId(cg003.getId());
hgcg003B.setReceiveNo(cg003.getReceiveNo());
hgcg003B.setStatus(HGConstant.CgReceiveStatus.S_0);
......@@ -189,24 +208,30 @@ public class ServiceHGCG003B extends ServiceBase {
hgcg003B.setAccountCode(cg003.getAccountCode());
DaoUtils.insert(HGCG003B.INSERT, hgcg003B);
}
/**
* 修改数据
*
* @param hgcg003B
*/
private void updateData(HGCG003B hgcg003B) {
// 新增数据
DaoUtils.update(HGCG003B.UPDATE, hgcg003B);
}
private void updateCg003Pur(HGCG003 cg003) {
List<HGCG003B> queryCG003Bs = HGCGTools.HgCg003B.listByPrimaryId(cg003.getId());
List<HGCG003B> queryCG003Bs = HGCGTools.HgCg003B.listByPrimaryId(cg003.getId());
//修改主表信息
//收货数量
BigDecimal receiveQtySum = queryCG003Bs.stream().map(HGCG003B::getReceiveQty).reduce(BigDecimal.ZERO,BigDecimal::add);
BigDecimal receiveQtySum = queryCG003Bs.stream().map(HGCG003B::getReceiveQty)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setReceiveQty(receiveQtySum);
//收货重量
BigDecimal receiveWeightSum = queryCG003Bs.stream().map(HGCG003B::getReceiveWeight).reduce(BigDecimal.ZERO,BigDecimal::add);
BigDecimal receiveWeightSum = queryCG003Bs.stream().map(HGCG003B::getReceiveWeight)
.reduce(BigDecimal.ZERO, BigDecimal::add);
cg003.setReceiveWeight(receiveWeightSum);
DaoUtils.update(HGSqlConstant.HgCg003.UPDATE_QTY, cg003);
}
/**
* 删除操作.
*
......@@ -227,9 +252,9 @@ public class ServiceHGCG003B extends ServiceBase {
Map<Long, HGCG002B> dbCg002BMap = HGCGUtils.HgCg002B.lockGetData(
ObjectUtils.listEpKey(fCg003Bs, HGCG003B.FIELD_CONTRACT_DETAIL_ID));
// 数据校验
this.checkRemoveData(fCg003Bs, dbCg003BMap,cg003);
this.checkRemoveData(fCg003Bs, dbCg003BMap, cg003);
// 保存数据
this.removeData(fCg003Bs, dbCg003BMap, dbCg002AMap,cg003,dbCg002BMap);
this.removeData(fCg003Bs, dbCg003BMap, dbCg002AMap, cg003, dbCg002BMap);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg003Bs.size() + "]条数据删除成功!");
......@@ -238,10 +263,11 @@ public class ServiceHGCG003B extends ServiceBase {
}
return inInfo;
}
/**
* 数据校验
* @param fCg003Bs
*
* @param fCg003Bs
* @param dbCg003BMap
* @param cg003
*/
......@@ -254,9 +280,10 @@ public class ServiceHGCG003B extends ServiceBase {
String.format("收货单[%s]状态不是\"待确认\",不允许操作", receiveNo));
}
}
/**
* 数据保存
*
* @param fCg003Bs
* @param dbCg003bMap
* @param dbCg002AMap
......@@ -276,12 +303,12 @@ public class ServiceHGCG003B extends ServiceBase {
dbCg003B.getReceiveQty().negate());
}
List<HGCG002> hgcg002List = new LinkedList<>();
dbCg002AMap.forEach((k, v)->{
dbCg002AMap.forEach((k, v) -> {
hgcg002List.add(v);
});
//根据子表明细刷新合同主表信息
HGCGTools.HgCg002.updateContractPrimary(hgcg002List);
}else{
} else {
//手工录入的
for (HGCG003B fCg003B : fCg003Bs) {
HGCG003B dbCg003B = dbCg003bMap.get(fCg003B.getId());
......@@ -292,5 +319,5 @@ public class ServiceHGCG003B extends ServiceBase {
//修改主表信息
updateCg003Pur(cg003);
}
}
......@@ -210,6 +210,19 @@
</update>
<!-- 修改采购信息 -->
<update id="update">
UPDATE ${hggpSchema}.HGCG001
SET
COMPANY_CODE = #companyCode#,
COMPANY_NAME = #companyName#,
PROJ_CODE = #projCode#,
PROJ_NAME = #projName#,
PLAN_DATE = #planDate#,
<include refid="updateRevise"/>
WHERE PLAN_NO = #planNo#
</update>
<!-- 修改采购信息 -->
<update id="updatePur">
UPDATE ${hggpSchema}.HGCG001
SET
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGCG002A">
<sql id="condition">
<sql id="condition">
AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......@@ -116,6 +116,7 @@
CALCULATION_METHOD = #calculationMethod#
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
......@@ -292,9 +293,8 @@
</update>
<select id="queryByReceive" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B">
SELECT
<select id="queryByReceive" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B">
SELECT
a.ID as "id",
a.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
a.DEP_CODE as "depCode", <!-- 部门编码 -->
......@@ -329,6 +329,7 @@
a.INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型大类 -->
a.PRIMARY_ID as "primaryId", <!-- 主表id -->
(a.PUR_QTY - a.RECEIVE_QTY) as "bcMaxReceiveQty",
(a.PUR_WEIGHT - a.RECEIVE_WEIGHT) as "bcMaxReceiveWeight",
a.PROJ_CODE as "projCode", <!-- 项目编码 -->
a.PROJ_NAME as "projName", <!-- 项目名称 -->
a.CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
......@@ -341,10 +342,11 @@
b.PUR_USER_ID as "purUserId", <!-- 采购员 -->
b.PUR_USER_NAME as "purUserName" <!-- 采购员名称 -->
FROM ${hggpSchema}.HGCG002A a
LEFT JOIN ${hggpSchema}.HGCG002 b ON a.PRIMARY_ID = b.id
LEFT JOIN ${hggpSchema}.HGCG002 b ON a.PRIMARY_ID = b.id
WHERE 1=1
AND a.DELETE_FLAG = 0
AND b.DELETE_FLAG = 0
AND (a.PUR_QTY - a.RECEIVE_QTY) > 0
<isNotEmpty prepend=" AND " property="id">
a.ID = #id#
</isNotEmpty>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGCG003A">
<sql id="condition">
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
......@@ -259,52 +259,42 @@
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGCG003A
SET
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
RECEIVE_DATE = #receiveDate#, <!-- 收货日期 -->
RECEIVE_NO = #receiveNo#, <!-- 收货单号 -->
PLAN_NO = #planNo#, <!-- 计划单号 -->
CONTRACT_NO = #contractNo#, <!-- 合同号 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
SPEC_ID = #specId#, <!-- 规格ID -->
SPEC = #spec#, <!-- 规格 -->
MATERIAL = #material#, <!-- 材质 -->
UNIT = #unit#, <!-- 单位 -->
LENGTH = #length#, <!-- 长度 -->
WIDTH = #width#, <!-- 宽度 -->
THICK = #thick#, <!-- 厚度 -->
RECEIVE_QTY = #receiveQty#, <!-- 收货数量 -->
DELIVER_QTY = #deliverQty#, <!-- 退货数量 -->
DEPOSIT_QTY = #depositQty#, <!-- 入库数量 -->
RECEIVE_UNIT_WEIGHT = #receiveUnitWeight#, <!-- 收货单重 -->
RECEIVE_WEIGHT = #receiveWeight#, <!-- 收货重量 -->
STATUS = #status#, <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 -->
PRICE = #price#, <!-- 单价 -->
AMOUNT = #amount#, <!-- 金额(不含税金额) -->
INVENT_TYPE_DETAIL = #inventTypeDetail#, <!-- 存货类型大类 -->
PRIMARY_ID = #primaryId#, <!-- 主表id -->
CONTRACT_DETAIL_ID = #contractDetailId#, <!-- 合同明细id -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
CALCULATION_METHOD = #calculationMethod#,
IS_INVOICING = #isInvoicing#
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hggpSchema}.HGCG003A
SET
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
RECEIVE_DATE = #receiveDate#, <!-- 收货日期 -->
RECEIVE_NO = #receiveNo#, <!-- 收货单号 -->
CONTRACT_NO = #contractNo#, <!-- 合同号 -->
INVENT_TYPE = #inventType#, <!-- 存货类型 -->
INVENT_CODE = #inventCode#, <!-- 存货编码 -->
INVENT_NAME = #inventName#, <!-- 存货名称 -->
SPEC_ID = #specId#, <!-- 规格ID -->
SPEC = #spec#, <!-- 规格 -->
MATERIAL = #material#, <!-- 材质 -->
UNIT = #unit#, <!-- 单位 -->
LENGTH = #length#, <!-- 长度 -->
WIDTH = #width#, <!-- 宽度 -->
THICK = #thick#, <!-- 厚度 -->
RECEIVE_QTY = #receiveQty#, <!-- 收货数量 -->
RECEIVE_UNIT_WEIGHT = #receiveUnitWeight#, <!-- 收货单重 -->
RECEIVE_WEIGHT = #receiveWeight#, <!-- 收货重量 -->
STATUS = #status#, <!-- 状态:0-已收货,1-已入库,2-部分入库,3-退货 -->
PRICE = #price#, <!-- 单价 -->
AMOUNT = #amount#, <!-- 金额(不含税金额) -->
INVENT_TYPE_DETAIL = #inventTypeDetail#, <!-- 存货类型大类 -->
PRIMARY_ID = #primaryId#, <!-- 主表id -->
CONTRACT_DETAIL_ID = #contractDetailId#, <!-- 合同明细id -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
CALCULATION_METHOD = #calculationMethod#,
IS_INVOICING = #isInvoicing#
WHERE ID = #id#
</update>
<!-- 修改开票 -->
<update id="updateIsInvoicing">
......@@ -355,10 +345,9 @@
WHERE ID = #id#
</update>
<select id="queryByQualityTesting" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cg.domain.HGCG003B">
SELECT
a.ID as "id",
<select id="queryByQualityTesting" resultClass="com.baosight.hggp.hg.cg.domain.HGCG003B">
SELECT
a.ID as "id",
a.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
a.DEP_CODE as "depCode", <!-- 部门编码 -->
a.CREATED_BY as "createdBy", <!-- 记录创建者 -->
......
......@@ -373,14 +373,16 @@ public class HGConstant {
//生产报工
public static final String SCBG = "SCBG";
}
/**
*
* 采购计划数据来源
*
* @author:songx
* @date:2024/5/15,15:18
*/
public static class CgSource {
// 合同
public static final Integer DEFAULT = 0;
// 手动录入
public static final Integer SDLR = 1;
......
......@@ -108,14 +108,19 @@ public class HGSqlConstant {
// 收货完成
public static final String UPDATE_CONFIRM = MODULE_NAME + "updateConfirm";
}
/**
* @author:songx
* @date:2024/8/30,16:25
*/
public class HgCg003A {
/**
* 模块名称:HGCW003A
*/
// 模块名称:HGCW003A
private static final String MODULE_NAME = "HGCG003A.";
//
public static final String UPDATE_IS_INVOICING = MODULE_NAME + "updateIsInvoicing";
// 修改数量
public static final String UPDATE_QTY = MODULE_NAME + "updateQty";
}
/**
......
......@@ -41,7 +41,7 @@ public class HpDmTools {
}
}
public static List<HGDM099> getByBizId(String bizType, String docId) {
public static List<HGDM099> getByDocId(String bizType, String docId) {
AssertUtils.isEmpty(docId, "文件ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HGDM099.FIELD_BIZ_TYPE, bizType);
......
......@@ -19,5 +19,21 @@ public class HgWdSqlConstant {
// 搜索树节点
public static final String SEARCH_TREE_NODE = "HGWD001.searchTreeNode";
}
/**
* HGCW999 SQL定义
*
* @author:songx
* @date:2024/2/22,13:57
*/
public static class HgWd099 {
// 预览自增
public static final String PREVIEW_INCR = "HGWD099.previewIncr";
// 下载自增
public static final String DOWNLOAD_INCR = "HGWD099.downloadIncr";
// 发布
public static final String RELEASE_DATE = "HGWD099.updateReleaseDate";
}
}
......@@ -37,7 +37,9 @@ public class HGWD001A extends DaoEPBase {
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_CHANGE_TYPE = "changeType"; /* 变更类型*/
public static final String FIELD_CHANGE_CONTENT = "changeContent"; /* 变更内容*/
public static final String FIELD_CHANGE_START_CODE = "changeStartCode"; /* 变更前编码*/
public static final String FIELD_CHANGE_START = "changeStart"; /* 变更前*/
public static final String FIELD_CHANGE_END_CODE = "changeEndCode"; /* 变更后编码*/
public static final String FIELD_CHANGE_END = "changeEnd"; /* 变更后*/
public static final String FIELD_MAT_ID = "matId"; /* 上级ID*/
......@@ -83,7 +85,9 @@ public class HGWD001A extends DaoEPBase {
private String projName = " "; /* 项目名称*/
private String changeType = " "; /* 变更类型*/
private String changeContent = " "; /* 变更内容*/
private String changeStartCode = " "; /* 变更前编码*/
private String changeStart = " "; /* 变更前*/
private String changeEndCode = " "; /* 变更后编码*/
private String changeEnd = " "; /* 变更后*/
private Long matId = new Long(0);
......@@ -158,10 +162,18 @@ public class HGWD001A extends DaoEPBase {
eiColumn.setDescName("变更内容");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_START_CODE);
eiColumn.setDescName("变更前编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_START);
eiColumn.setDescName("变更前");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_END_CODE);
eiColumn.setDescName("变更后编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_END);
eiColumn.setDescName("变更后");
eiMetadata.addMeta(eiColumn);
......@@ -477,6 +489,22 @@ public class HGWD001A extends DaoEPBase {
this.matId = matId;
}
public String getChangeStartCode() {
return changeStartCode;
}
public void setChangeStartCode(String changeStartCode) {
this.changeStartCode = changeStartCode;
}
public String getChangeEndCode() {
return changeEndCode;
}
public void setChangeEndCode(String changeEndCode) {
this.changeEndCode = changeEndCode;
}
/**
* get the value from Map.
*
......@@ -501,7 +529,9 @@ public class HGWD001A extends DaoEPBase {
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setChangeType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_TYPE)), changeType));
setChangeContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_CONTENT)), changeContent));
setChangeStartCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_START_CODE)), changeStartCode));
setChangeStart(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_START)), changeStart));
setChangeEndCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_END_CODE)), changeEndCode));
setChangeEnd(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_END)), changeEnd));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MAT_ID)), matId));
}
......@@ -529,7 +559,9 @@ public class HGWD001A extends DaoEPBase {
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_CHANGE_TYPE, StringUtils.toString(changeType, eiMetadata.getMeta(FIELD_CHANGE_TYPE)));
map.put(FIELD_CHANGE_CONTENT, StringUtils.toString(changeContent, eiMetadata.getMeta(FIELD_CHANGE_CONTENT)));
map.put(FIELD_CHANGE_START_CODE, StringUtils.toString(changeStartCode, eiMetadata.getMeta(FIELD_CHANGE_START_CODE)));
map.put(FIELD_CHANGE_START, StringUtils.toString(changeStart, eiMetadata.getMeta(FIELD_CHANGE_START)));
map.put(FIELD_CHANGE_END_CODE, StringUtils.toString(changeEndCode, eiMetadata.getMeta(FIELD_CHANGE_END_CODE)));
map.put(FIELD_CHANGE_END, StringUtils.toString(changeEnd, eiMetadata.getMeta(FIELD_CHANGE_END)));
map.put(FIELD_MAT_ID, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_MAT_ID)));
......
......@@ -90,7 +90,7 @@ public class ServiceHGWD001B extends ServiceBase {
List<HGWD001B> fWd001bs = MapUtils.toDaoEPBases(inInfo, HGWD001B.class);
for (HGWD001B fWd001b : fWd001bs) {
// 预览记录+1
HGCWTools.HgCw999.previewIncr(fWd001b.getDocId());
HGWDTools.HgWd099.previewIncr(fWd001b.getDocId());
// 新增
DaoUtils.insert(HGWD001B.INSERT, fWd001b);
}
......
......@@ -90,7 +90,7 @@ public class ServiceHGWD001C extends ServiceBase {
List<HGWD001C> fWd001cs = MapUtils.toDaoEPBases(inInfo, HGWD001C.class);
for (HGWD001C fWd001c : fWd001cs) {
// 下载记录+1
HGCWTools.HgCw999.downloadIncr(fWd001c.getDocId());
HGWDTools.HgWd099.downloadIncr(fWd001c.getDocId());
// 新增
DaoUtils.insert(HGWD001C.INSERT, fWd001c);
}
......
......@@ -37,7 +37,7 @@ public class ServiceHGWD001D extends TreeService {
String accountCode = UserSessionUtils.getAccountCode();
if (StringUtils.isEmpty(accountCode) || CommonConstant.Field.ADMIN.equals(accountCode)) {
map.put("label", "root");
map.put("text", "组织机构");
map.put("text", "文档库");
list.add(map);
} else {
//Org org = HGXSTools.XsOrg.get(accountCode);
......@@ -50,6 +50,7 @@ public class ServiceHGWD001D extends TreeService {
hashMap.put("text", hgsc001.getProjName());
hashMap.put("projCode", hgsc001.getProjCode());
hashMap.put("projName", hgsc001.getProjName());
hashMap.put("ename", hgsc001.getProjCode());
hashMap.put("type", "1");
hashMap.put("leaf", "0");
hashMap.put("leafLevel", "0");
......@@ -71,8 +72,6 @@ public class ServiceHGWD001D extends TreeService {
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
queryMap.put("accountCode", LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())
? null : UserSessionUtils.getAccountCode());
queryMap.put("userId", LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())
? null : UserSessionUtils.getUserId());
List<Map> ret = this.dao.query("HGWD001.queryOrganiation", queryMap, 0, -999999);
Map parentOrgMap = new HashMap();
......
......@@ -104,7 +104,7 @@ public class ServiceHGWD001E extends ServiceEPBase {
hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
/**
......@@ -123,14 +123,14 @@ public class ServiceHGWD001E extends ServiceEPBase {
hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeStart(wd001.getFileName());
hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}else if (wd001 != null && !wd001.getFileType().equals(hgwd001.getFileType())){
List<Map> fileType1 = edcm01List.stream().filter(map -> map.get("itemCode").equals(wd001.getFileType())).collect(Collectors.toList());
List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList());
hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
DaoUtils.update(HGWD001.UPDATE, hgwd001);
......
......@@ -98,7 +98,7 @@ public class ServiceHGWD001F extends ServiceEPBase {
hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
/**
......@@ -117,14 +117,14 @@ public class ServiceHGWD001F extends ServiceEPBase {
hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeStart(wd001.getFileName());
hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}else if (wd001 != null && !wd001.getFileType().equals(hgwd001.getFileType())){
List<Map> fileType1 = edcm01List.stream().filter(map -> map.get("itemCode").equals(wd001.getFileType())).collect(Collectors.toList());
List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList());
hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
DaoUtils.update(HGWD001.UPDATE, hgwd001);
......
......@@ -97,7 +97,7 @@ public class ServiceHGWD001G extends ServiceEPBase {
hgwd001a.setChangeContent("项目名称");
hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
/**
......@@ -116,14 +116,14 @@ public class ServiceHGWD001G extends ServiceEPBase {
hgwd001a.setChangeContent("项目名称");
hgwd001a.setChangeStart(wd001.getFileName());
hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}else if (wd001 != null && !wd001.getFileType().equals(hgwd001.getFileType())){
List<Map> fileType1 = edcm01List.stream().filter(map -> map.get("itemCode").equals(wd001.getFileType())).collect(Collectors.toList());
List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList());
hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
DaoUtils.update(HGWD001.UPDATE, hgwd001);
......
......@@ -3,24 +3,21 @@ package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.ChangeTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -44,7 +41,7 @@ public class ServiceHGWD099 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGWD099().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -62,8 +59,9 @@ public class ServiceHGWD099 extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow =EiInfoUtils.getFirstRow(inInfo);
if(StringUtils.isNotEmpty(queryRow.get(HGDM099.FIELD_BIZ_ID).toString())){
inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
if (StringUtils.isNotEmpty(queryRow.get(HGWD001.FIELD_FILE_ID).toString())){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, User.FIELD_USER_ID, UserSessionUtils.getUserId());
inInfo = super.query(inInfo, HGWD099.QUERY, new HGWD099());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......@@ -83,10 +81,10 @@ public class ServiceHGWD099 extends ServiceEPBase {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HGDM099 hgdm099 = new HGDM099();
HGWD099 hgdm099 = new HGWD099();
hgdm099.fromMap(resultRow);
hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGDM099.INSERT, hgdm099);
DaoUtils.insert(HGWD099.INSERT, hgdm099);
HGWD001 hgwd001 =HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A();
......@@ -95,11 +93,12 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_ADD.getCode());
hgwd001a.setChangeContent("上传附件");
hgwd001a.setChangeContent(hgwd001.getFileName());
hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeStart(hgdm099.getDocId());
hgwd001a.setChangeEndCode(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
}
......@@ -124,9 +123,9 @@ public class ServiceHGWD099 extends ServiceEPBase {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HGDM099 hgdm099 = new HGDM099();
HGWD099 hgdm099 = new HGWD099();
hgdm099.fromMap(resultRow);
DaoUtils.update(HGDM099.DELETE, hgdm099);
DaoUtils.update(HGWD099.DELETE, hgdm099);
HGWD001 hgwd001 = HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A();
......@@ -135,11 +134,12 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_DELETE.getCode());
hgwd001a.setChangeContent("删除附件");
hgwd001a.setChangeContent(hgwd001.getFileName());
hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeStart(hgdm099.getDocId());
hgwd001a.setChangeEndCode(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
}
......@@ -151,45 +151,4 @@ public class ServiceHGWD099 extends ServiceEPBase {
}
return inInfo;
}
/**
* 删除文件
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGCW999.FIELD_DOC_ID,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HGDS002.DELETE,map);
}
}
}
......@@ -272,37 +272,32 @@
<!-- 文档库子节点树查询 -->
<select id="queryOrganiation" resultClass="java.util.HashMap">
SELECT
A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.PROJ_CODE as "projCode", <!-- 项目编码 -->
A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.FILE_ID as "label",
A.FILE_ID as "ename",
A.FILE_NAME as "text",
A.FILE_TYPE as "leaf",
A.FILE_TYPE as "type",
A.PARENT_ID as "parentId",
A.DELETE_FLAG as "isDeleted",
A.LEAF_LEVEL as "leafLevel"
FROM ${hggpSchema}.HGWD001 A INNER JOIN ${hggpSchema}.HGWD003 B ON A.FILE_ID = B.FILE_ID
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
FILE_ID as "label",
FILE_ID as "ename",
FILE_NAME as "text",
FILE_TYPE as "leaf",
FILE_TYPE as "type",
PARENT_ID as "parentId",
DELETE_FLAG as "isDeleted",
LEAF_LEVEL as "leafLevel"
FROM ${hggpSchema}.HGWD001
WHERE 1=1
<isEmpty prepend=" AND " property="deletedQuery">
A.DELETE_FLAG = '0'
DELETE_FLAG = '0'
</isEmpty>
<isNotEmpty prepend=" AND " property="node">
A.PARENT_ID = #node#
PARENT_ID = #node#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode#
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
B.USER_ID = #userId#
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
group by A.COMPANY_CODE,A.PROJ_CODE,A.FILE_ID,A.FILE_NAME,A.FILE_TYPE,A.PARENT_ID,A.DELETE_FLAG
order by A.CREATED_TIME asc
<!--group by COMPANY_CODE, PROJ_CODE, FILE_ID, FILE_NAME, FILE_TYPE, PARENT_ID, DELETE_FLAG-->
order by CREATED_TIME asc
</select>
<!--档库所有子节点树查询-->
......
......@@ -74,9 +74,15 @@
<isNotEmpty prepend=" AND " property="changeContent">
CHANGE_CONTENT = #changeContent#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeStartCode">
CHANGE_START_CODE = #changeStartCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeStart">
CHANGE_START = #changeStart#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeEndCode">
CHANGE_END_CODE = #changeEndCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeEnd">
CHANGE_END = #changeEnd#
</isNotEmpty>
......@@ -104,7 +110,9 @@
PROJ_NAME as "projName", <!-- 项目名称 -->
CHANGE_TYPE as "changeType", <!-- 变更类型 -->
CHANGE_CONTENT as "changeContent", <!-- 变更内容 -->
CHANGE_START_CODE as "changeStartCode",
CHANGE_START as "changeStart", <!-- 变更前 -->
CHANGE_END_CODE as "changeEndCode",
CHANGE_END as "changeEnd", <!-- 变更后 -->
MAT_ID as "matId"
FROM ${hggpSchema}.HGWD001A WHERE 1=1
......@@ -184,26 +192,30 @@
<insert id="insert">
INSERT INTO ${hggpSchema}.HGWD001A (ID,
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
CHANGE_TYPE, <!-- 变更类型 -->
CHANGE_CONTENT, <!-- 变更内容 -->
CHANGE_START, <!-- 变更前 -->
CHANGE_END, <!-- 变更后 -->
MAT_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #changeType#, #changeContent#, #changeStart#, #changeEnd#,#matId#)
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
CHANGE_TYPE, <!-- 变更类型 -->
CHANGE_CONTENT, <!-- 变更内容 -->
CHANGE_START_CODE,
CHANGE_START, <!-- 变更前 -->
CHANGE_END_CODE,
CHANGE_END, <!-- 变更后 -->
MAT_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #changeType#,
#changeContent#, #changeStartCode#, #changeStart#, #changeEndCode#, #changeEnd#,#matId#)
</insert>
<delete id="delete">
......@@ -234,7 +246,9 @@
PROJ_NAME = #projName#, <!-- 项目名称 -->
CHANGE_TYPE = #changeType#, <!-- 变更类型 -->
CHANGE_CONTENT = #changeContent#, <!-- 变更内容 -->
CHANGE_START_CODE = #changeStartCode#,
CHANGE_START = #changeStart#, <!-- 变更前 -->
CHANGE_END_CODE as #changeEndCode#,
CHANGE_END = #changeEnd#, <!-- 变更后 -->
MAT_ID = #matId#
WHERE
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGWD099">
<sql id="column">
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
BIZ_TYPE as "bizType", <!-- 业务类型 -->
BIZ_ID as "bizId", <!-- 业务ID -->
DOC_ID as "docId", <!-- 文件ID -->
DOC_NAME as "docName", <!-- 文件名称 -->
STATUS as "status",
PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
DOWNLOAD_NUM as "downloadNum", <!-- 下载次数 -->
DOC_VERSION as "docVersion", <!-- 文件版本号 -->
RELEASE_DATE as "releaseDate" <!-- 发布时间 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = '0'
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizType">
BIZ_TYPE = #bizType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="bizId">
BIZ_ID = #bizId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileId">
BIZ_ID IN (select FILE_ID from ${hggpSchema}.hgwd003 where USER_ID = #userId# and FILE_ID = #fileId# )
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docVersion">
DOC_VERSION = #docVersion#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="releaseDate">
RELEASE_DATE = #releaseDate#
</isNotEmpty>
</sql>
<sql id="customCondition">
<include refid="condition"/>
<isNotEmpty prepend=" AND " property="docName">
DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom">
CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateTo">
CREATED_TIME &lt;= CONCAT(REPLACE(#createdDateTo#, '-', ''), '235959')
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.wd.domain.HGWD099">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGWD099
WHERE 1=1
<include refid="customCondition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*)
FROM ${hggpSchema}.HGWD099
WHERE 1=1
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGWD099 (
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 是否删除 -->
BIZ_TYPE, <!-- 业务类型 -->
BIZ_ID, <!-- 业务ID -->
DOC_ID, <!-- 文件ID -->
DOC_NAME, <!-- 文件名称 -->
STATUS,
DOC_VERSION,
RELEASE_DATE
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #status#, #docVersion#, #releaseDate#
)
</insert>
<delete id="deleteBizId">
UPDATE ${hggpSchema}.HGWD099
SET DELETE_FLAG = 1
WHERE BIZ_ID = #bizId#
</delete>
<delete id="delete">
UPDATE ${hggpSchema}.HGWD099
SET DELETE_FLAG = 1
WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGWD099
SET
DOC_ID = #docId#, <!-- 文件ID -->
DOC_NAME = #docName#, <!-- 文件名称 -->
STATUS = #status#,
DOC_VERSION = DOC_VERSION + 1, <!--版本号-->
RELEASE_DATE = #releaseDate#, <!--发布时间-->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE ID = #id#
</update>
<update id="updateStatus">
UPDATE ${hggpSchema}.HGWD099
SET
STATUS = #status#, <!-- 状态 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE ID = #id#
</update>
<update id="updateReleaseDate">
UPDATE ${hggpSchema}.HGWD099
SET
RELEASE_DATE = #releaseDate#, <!--发布时间-->
DOC_VERSION = DOC_VERSION + 1, <!--版本号-->
STATUS = #status#, <!-- 状态 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<update id="batchUpdate">
UPDATE ${hggpSchema}.HGWD099
SET
BIZ_ID = #bizId#, <!-- 物料ID -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE DOC_ID IN <iterate close=")" open="(" conjunction="," property="docIds">#docIds[]#</iterate>
</update>
<!-- 预览自增 -->
<update id="previewIncr">
UPDATE ${hggpSchema}.HGWD099
SET
PREVIEW_NUM = PREVIEW_NUM + 1,
<include refid="SqlBase.updateRevise"/>
WHERE DOC_ID = #docId#
</update>
<!-- 下载自增 -->
<update id="downloadIncr">
UPDATE ${hggpSchema}.HGWD099
SET
DOWNLOAD_NUM = DOWNLOAD_NUM + 1,
<include refid="SqlBase.updateRevise"/>
WHERE DOC_ID = #docId#
</update>
</sqlMap>
\ No newline at end of file
package com.baosight.hggp.hg.wd.tools;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.constant.HgCwSqlConstant;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -84,7 +92,7 @@ public class HGWDTools {
return DaoBase.getInstance().query(HgWdSqlConstant.HgWd001.SEARCH_TREE_NODE, queryMap);
}
public static void add(HGWD001A hgwd001a) {
public static void addHGWD001A(HGWD001A hgwd001a) {
AssertUtils.isNull(hgwd001a, "文档对象不能为空");
DaoUtils.insert(HGWD001A.INSERT, hgwd001a);
}
......@@ -127,4 +135,50 @@ public class HGWDTools {
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
}
public static class HgWd099 {
public static List<HGWD099> getByDocId(String bizType, String docId) {
AssertUtils.isEmpty(docId, "文件ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HGWD099.FIELD_BIZ_TYPE, bizType);
paramMap.put(HGWD099.FIELD_DOC_ID, docId);
return DaoBase.getInstance().query(HGWD099.QUERY, paramMap);
}
/**
* 预览记录自增
*
* @param docId
*/
public static void previewIncr(String docId) {
AssertUtils.isEmpty(docId, "文件ID不能为空");
Map queryMap = new HashMap();
queryMap.put(HGCW999.FIELD_DOC_ID, docId);
DaoUtils.update(HgWdSqlConstant.HgWd099.PREVIEW_INCR, queryMap);
}
/**
* 下载记录自增
*
* @param docId
*/
public static void downloadIncr(String docId) {
AssertUtils.isEmpty(docId, "文件ID不能为空");
Map queryMap = new HashMap();
queryMap.put(HGCW999.FIELD_DOC_ID, docId);
DaoUtils.update(HgWdSqlConstant.HgWd099.DOWNLOAD_INCR, queryMap);
}
public static List<HGWD099> queryByBiz(String bizType) {
AssertUtils.isNull(bizType, "业务类型不能为空!");
List<HGWD099> results = DaoBase.getInstance().query(HGWD099.QUERY,
new HashMap<String,Object>(){{put("bizType",bizType);}}
);
return results;
}
}
}
......@@ -53,6 +53,8 @@ public class HGYX001 extends DaoEPBase {
public static final String FIELD_CONS_QUANTITY = "consQuantity"; /* 发货数量*/
public static final String FIELD_CONS_WEIGHT = "consWeight"; /* 发货重量*/
public static final String FIELD_STATUS = "status"; /* 审批状态 0-未审核,1-已审核*/
public static final String FIELD_IS_CONTRACT = "isContract"; /*是否扣款*/
public static final String FIELD_CONTRACT_NAME = "contractName"; /*扣款方*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -124,6 +126,8 @@ public class HGYX001 extends DaoEPBase {
private BigDecimal consQuantity = new BigDecimal("0"); /* 发货数量*/
private BigDecimal consWeight = new BigDecimal("0"); /* 发货重量*/
private Integer status = 0; /* 审批状态 0-未审核,1-已审核*/
private Integer isContract = 0;
private String contractName = " ";
/**
* initialize the metadata.
......@@ -258,6 +262,13 @@ public class HGYX001 extends DaoEPBase {
eiColumn.setDescName("审批状态 0-未审核,1-已审核");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_IS_CONTRACT);
eiColumn.setDescName("是否扣款");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CONTRACT_NAME);
eiColumn.setDescName("扣款方");
eiMetadata.addMeta(eiColumn);
}
......@@ -748,6 +759,23 @@ public class HGYX001 extends DaoEPBase {
public void setStatus(Integer status) {
this.status = status;
}
public Integer getIsContract() {
return isContract;
}
public void setIsContract(Integer isContract) {
this.isContract = isContract;
}
public String getContractName() {
return contractName;
}
public void setContractName(String contractName) {
this.contractName = contractName;
}
/**
* get the value from Map.
*
......@@ -786,6 +814,8 @@ public class HGYX001 extends DaoEPBase {
setConsQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_CONS_QUANTITY)), consQuantity));
setConsWeight(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_CONS_WEIGHT)), consWeight));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setIsContract(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_IS_CONTRACT)), isContract));
setContractName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_NAME)), contractName));
}
/**
......@@ -825,6 +855,8 @@ public class HGYX001 extends DaoEPBase {
map.put(FIELD_CONS_QUANTITY, StringUtils.toString(consQuantity, eiMetadata.getMeta(FIELD_CONS_QUANTITY)));
map.put(FIELD_CONS_WEIGHT, StringUtils.toString(consWeight, eiMetadata.getMeta(FIELD_CONS_WEIGHT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_IS_CONTRACT, StringUtils.toString(isContract, eiMetadata.getMeta(FIELD_IS_CONTRACT)));
map.put(FIELD_CONTRACT_NAME, StringUtils.toString(contractName, eiMetadata.getMeta(FIELD_CONTRACT_NAME)));
return map;
}
......
......@@ -48,6 +48,7 @@ public class ServiceHGYX001A extends ServiceEPBase {
outInfo = super.query(inInfo, HGYX001A.QUERY, new HGYX001A());
outInfo.getBlock(EiConstant.queryBlock).setRows(Collections.singletonList(hgYx001));
outInfo.getBlock(EiConstant.queryBlock).setBlockMeta(new HGYX001().eiMetadata);
}
outInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, "type", type);
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
......
......@@ -43,6 +43,7 @@ public class ServiceHGYX001B extends ServiceEPBase {
outInfo = super.query(inInfo, HGYX001A.QUERY, new HGYX001A());
outInfo.getBlock(EiConstant.queryBlock).setRows(Collections.singletonList(hgYx001));
outInfo.getBlock(EiConstant.queryBlock).setBlockMeta(new HGYX001().eiMetadata);
}
//UserVO userVO = HGCWTools.HgCw002.getUserCompany();
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
......
......@@ -69,7 +69,9 @@
NUM_PLATE as "numPlate", <!-- 车号 -->
CONS_QUANTITY as "consQuantity", <!-- 发货数量 -->
CONS_WEIGHT as "consWeight", <!-- 发货重量 -->
STATUS as "status" <!-- 审批状态 0-未审核,1-已审核 -->
STATUS as "status", <!-- 审批状态 0-未审核,1-已审核 -->
IS_CONTRACT as "isContract", <!-- 是否完成 -->
CONTRACT_NAME as "contractName"
</sql>
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
......@@ -166,6 +168,9 @@
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="isContract">
IS_CONTRACT = #isContract#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGYX001">
......@@ -311,12 +316,14 @@
NUM_PLATE, <!-- 车号 -->
CONS_QUANTITY, <!-- 发货数量 -->
CONS_WEIGHT, <!-- 发货重量 -->
STATUS <!-- 审批状态 0-未审核,1-已审核 -->
STATUS, <!-- 审批状态 0-未审核,1-已审核 -->
IS_CONTRACT,
CONTRACT_NAME
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #deliveryCode#,
#outboundCode#, #consCode#, #consName#, #consWhCode#, #consWhName#, #consAddr#, #receCode#, #receName#,
#receAddr#, #receUserPhone#, #tranType#, #numPlate#, #consQuantity#, #consWeight#, #status#)
#receAddr#, #receUserPhone#, #tranType#, #numPlate#, #consQuantity#, #consWeight#, #status#, #isContract#, #contractName#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGYX001
</selectKey>
......@@ -364,7 +371,9 @@
NUM_PLATE = #numPlate#, <!-- 车号 -->
CONS_QUANTITY = #consQuantity#, <!-- 发货数量 -->
CONS_WEIGHT = #consWeight#, <!-- 发货重量 -->
STATUS = #status# <!-- 审批状态 0-未审核,1-已审核 -->
STATUS = #status#, <!-- 审批状态 0-未审核,1-已审核 -->
IS_CONTRACT = #isContract#,
CONTRACT_NAME = #contractName#
WHERE
ID = #id#
</update>
......
......@@ -68,6 +68,7 @@ public class ServiceHGZL001B extends ServiceEPBase {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put(HGCG003B.FIELD_SOURCE, HGConstant.CgSource.DEFAULT);
queryMap.put(HGCG003B.FIELD_STATUS, HGConstant.CgReceiveStatus.S_0);
inInfo = super.query(inInfo, HGCG003B.QUERY_BY_QUALITY_TESTING, new HGCG003B());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
package com.baosight.xservices.xs.service;
import com.baosight.iplat4j.core.FrameworkInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.log.Logger;
import com.baosight.iplat4j.core.log.LoggerFactory;
......@@ -11,11 +12,12 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.StringUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import com.baosight.xservices.xs.jwt.JwtTokenValidator;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import java.util.HashMap;
import java.util.Map;
/**
* 重写
*
......@@ -76,6 +78,49 @@ public class ServiceXSUserJwt extends ServiceBase {
return outInfo;
}
/**
* 德诚系统对接专用
*
* @param inInfo
* @return
*/
public EiInfo generateJwtDc(EiInfo inInfo) {
String username = inInfo.getString("loginName");
String password = inInfo.getString("password");
String audience = inInfo.getString("audience");
EiInfo outInfo = new EiInfo();
try {
if (!StringUtils.isNotEmpty(audience)) {
audience = FrameworkInfo.getProjectEname().toUpperCase();
}
IUserManager um = SecurityFactory.getUserManager();
User user = um.getUser("DC" + username);
if (user == null) {
throw new UsernameNotFoundException("Can't find user!");
}
Map tokenMap = new HashMap();
tokenMap.put("sub", user.getLoginName());
tokenMap.put("uid", user.getUserId());
Object userCname = user.get("userName");
if (userCname != null) {
tokenMap.put("ucn", userCname.toString());
}
if (!StringUtils.isNotEmpty(audience)) {
audience = FrameworkInfo.getProjectEname().toUpperCase();
}
String token = this.jwtTokenValidator.generateToken(tokenMap, audience);
outInfo.setStatus(EiConstant.STATUS_SUCCESS);
outInfo.setMsg("登录成功!");
outInfo.set("token", token);
} catch (Exception var11) {
this.logger.error(var11.getMessage(), var11);
outInfo.setStatus(EiConstant.STATUS_FAILURE);
outInfo.setMsg(var11.getMessage());
}
return outInfo;
}
public EiInfo validateTest(EiInfo inInfo) {
new HashMap();
inInfo.set("userSessionData", new HashMap(UserSession.getData()));
......
......@@ -18,7 +18,7 @@ spring.servlet.multipart.file-size-threshold=0
componentEname=hggp
projectName=hggp
moduleName=ep
projectEnv=run
projectEnv=dev
platSchema=iplat_hggp
eplatSchema=EPLAT_HGGP
lowcodedbSchema=lowcodedb_hggp
......@@ -33,12 +33,12 @@ customerName=\u6B66\u6C49\u5B9D\u4FE1\u5927\u6570\u636E\u4E8B\u4E1A\u90E8
enterpriseName=\u6B66\u6C49\u5B9D\u4FE1\u5927\u6570\u636E\u4E8B\u4E1A\u90E8
datasource.type=dbcp
jdbc.driverClassName=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://rm-uf60e9vbmanleydq4.mysql.rds.aliyuncs.com:3306/iplat_hggp?useSSL=false&useUnicode=true&characterEncoding=utf-8
#jdbc.url=jdbc:mysql://129.211.46.84:3306/iplat_hggp?useSSL=false&useUnicode=true&characterEncoding=utf-8
jdbc.username=hggp
#jdbc.username=root
jdbc.password=hggp_Twhxz2024Aly
#jdbc.password=Whxz@2019
#jdbc.url=jdbc:mysql://rm-uf60e9vbmanleydq4.mysql.rds.aliyuncs.com:3306/iplat_hggp?useSSL=false&useUnicode=true&characterEncoding=utf-8
jdbc.url=jdbc:mysql://129.211.46.84:3306/iplat_hggp?useSSL=false&useUnicode=true&characterEncoding=utf-8
#jdbc.username=hggp
jdbc.username=root
#jdbc.password=hggp_Twhxz2024Aly
jdbc.password=Whxz@2019
jdbc.maxActive=20
jdbc.validationQuery=SELECT 1 FROM ${platSchema}.TEDFA00
......
......@@ -22,12 +22,12 @@ org.quartz.jobStore.isClustered = true
#\u6570\u636E\u5E93\u8FDE\u63A5\u914D\u7F6E\u4FE1\u606F
org.quartz.jobStore.clusterCheckinInterval = 20000
org.quartz.dataSource.appDS.driver = com.mysql.cj.jdbc.Driver
org.quartz.dataSource.appDS.URL = jdbc:mysql://rm-uf60e9vbmanleydq4.mysql.rds.aliyuncs.com:3306/iplat_hggp?useSSL=false&useUnicode=true&characterEncoding=utf-8
#org.quartz.dataSource.appDS.URL = jdbc:mysql://129.211.46.84:3306/iplat_hggp?useSSL=false&useUnicode=true&characterEncoding=utf-8
org.quartz.dataSource.appDS.user = hggp
#org.quartz.dataSource.appDS.user = root
org.quartz.dataSource.appDS.password = hggp_Twhxz2024Aly
#org.quartz.dataSource.appDS.password = Whxz@2019
#org.quartz.dataSource.appDS.URL = jdbc:mysql://rm-uf60e9vbmanleydq4.mysql.rds.aliyuncs.com:3306/iplat_hggp?useSSL=false&useUnicode=true&characterEncoding=utf-8
org.quartz.dataSource.appDS.URL = jdbc:mysql://129.211.46.84:3306/iplat_hggp?useSSL=false&useUnicode=true&characterEncoding=utf-8
#org.quartz.dataSource.appDS.user = hggp
org.quartz.dataSource.appDS.user = root
#org.quartz.dataSource.appDS.password = hggp_Twhxz2024Aly
org.quartz.dataSource.appDS.password = Whxz@2019
org.quartz.dataSource.appDS.maxConnections = 30
org.quartz.plugin.logging.class = com.baosight.xservices.ej.job.quartz.JobLoggingPluginWithPartition
......
......@@ -98,5 +98,6 @@
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD003.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD099.xml"/>
</sqlMapConfig>
......@@ -8,22 +8,22 @@ $(function () {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
if (!isBlank(item.id)){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ', ' + item.source + ')" >详情</a>';
}
return template;
columns: [{
field: "operator",
title: "操作",
template: function (item) {
let template = '';
if (!isBlank(item.id)) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ', ' + item.source
+ ')" >详情</a>';
}
}, {
field: "companyCode",
title: "公司编码",
template: function (dataItem) {
return template;
}
}, {
field: "companyCode",
title: "公司编码",
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']) {
return companyCodeBox[i]['companyCode'];
......@@ -41,9 +41,9 @@ $(function () {
return projCodeBox[i]['valueField'];
}
}
return dataItem["projCode"];
return dataItem["projCode"] == null ? "" : dataItem["projCode"];
},
editor: function (container, options) {
editor: function (container, options) {
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
inInfo.set("inqu_status-0-approvalStatus", 2);
......
......@@ -45,11 +45,11 @@
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="companyName" cname="公司名称" width="220" enable="false" readonly="true" align="left"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="140" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="left" enable="false"/>
<EF:EFColumn ename="planDate" cname="计划日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="planNo" cname="计划单号" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.planStatus"/>
......
......@@ -10,10 +10,8 @@ $(function () {
loadComplete: function (grid) {
grid.dataSource.bind("change", function (e) {
var item = e.items[0];
if (e.field == "price") {
calAmount(item);
}
if (e.field == "taxRate") {
if (e.field == "purQty" || e.field == "purWeight" || e.field == "price"
|| e.field == "taxRate" || e.field == "calculationMethod") {
calAmount(item);
}
});
......@@ -94,13 +92,16 @@ let confirm = function () {
* @param coefficient
*/
let calAmount = function (item) {
//原材料
if(item.inventTypeDetail === '3'){
if(item.purWeight && item.price && item.taxRate){
let price = item.price;
let taxRate = item.taxRate;
// 计算方式为重量乘单价
if (item.calculationMethod == 1) {
let purWeight = item.purWeight;
if (!isBlank(purWeight) && !isBlank(price) && !isBlank(taxRate)) {
// 重量*单价金额
let totalAmount = item.purWeight * item.price;
//不含税金额
let amount = totalAmount / (1 + item.taxRate / 100);
let totalAmount = purWeight * price;
// 不含税金额
let amount = totalAmount / (1 + taxRate / 100);
//税额
let taxAmount = totalAmount - amount;
//含税金额
......@@ -109,12 +110,13 @@ let calAmount = function (item) {
resultGrid.setCellValue(item, 'amount', amount)
resultGrid.setCellValue(item, 'taxIncludeAmount', taxIncludeAmount)
}
}else{
if(item.purQty && item.price && item.taxRate){
} else {
let purQty = item.purQty;
if (!isBlank(purQty) && !isBlank(price) && !isBlank(taxRate)) {
// 数量*单价金额
let totalAmount = item.purQty * item.price;
let totalAmount = purQty * price;
//不含税金额
let amount = totalAmount / (1 + item.taxRate / 100);
let amount = totalAmount / (1 + taxRate / 100);
//税额
let taxAmount = totalAmount - amount;
//含税金额
......
......@@ -42,6 +42,10 @@
required="true"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" sumType="page"
required="true"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="true" width="100" align="center"
required="true">
<EF:EFCodeOption codeName="hggp.cg.calculationMethod"/>
</EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" width="80" align="right" format="{0:N3}" required="true"/>
<EF:EFComboColumn ename="taxRate" cname="税率(%)" enable="true" width="100" align="center" required="true"
copy="true">
......
......@@ -106,6 +106,8 @@ let confirm = function () {
for (let i = 0; i < rows.length; i++) {
let bcReceiveQty = rows[i]['bcReceiveQty'];
let bcMaxReceiveQty = rows[i]['bcMaxReceiveQty'];
let bcReceiveWeight = rows[i]['bcReceiveWeight'];
let bcMaxReceiveWeight = rows[i]['bcMaxReceiveWeight'];
if (!isPositiveNumber(bcReceiveQty)) {
message("勾选的第" + (i + 1) + "行本次收货数量必须大于0");
return;
......@@ -114,6 +116,10 @@ let confirm = function () {
message("勾选的第" + (i + 1) + "行本次收货数量不能大于本次最大收货数量");
return;
}
if (!isBlank(bcReceiveWeight) && parseFloat(bcReceiveWeight) > parseFloat(bcMaxReceiveWeight)) {
message("勾选的第" + (i + 1) + "行本次收货重量不能大于本次最大收货重量");
return;
}
}
JSUtils.confirm("确定对勾选的[" + rows.length + "]条数据生成\"采购收货\"吗? ", {
ok: function () {
......
......@@ -59,7 +59,12 @@
required="true"/>
<EF:EFColumn ename="bcMaxReceiveQty" cname="本次最大</br>收货数量" enable="false" width="100" align="right"
format="{0:N3}"/>
<EF:EFColumn ename="bcReceiveWeight" cname="本次</br>收货重量" width="100" align="right" format="{0:N3}"
required="true"/>
<EF:EFColumn ename="bcMaxReceiveWeight" cname="本次最大</br>收货重量" enable="false" width="100" align="right"
format="{0:N3}"/>
<EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="receiveWeight" cname="已收货重量" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="purQty" cname="采购数量" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="purUnitWeight" cname="采购单重" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="purWeight" cname="采购重量" enable="false" width="100" align="right" format="{0:N3}"/>
......@@ -68,6 +73,9 @@
<EF:EFOptions blockId="sup_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="purUserName" cname="采购员" enable="false" width="100" align="center"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="true" width="100" align="center">
<EF:EFCodeOption codeName="hggp.cg.calculationMethod"/>
</EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" width="80" align="right" format="{0:N3}" enable="false"/>
<EF:EFColumn ename="taxRate" cname="税率(%)" width="80" align="right" format="{0:N3}" enable="false"/>
<EF:EFColumn ename="amount" cname="不含税金额" enable="false" width="120" align="right" format="{0:C3}"
......
......@@ -153,13 +153,17 @@ $(window).load(function () {
//合同选择的存货不让新增、删除
var source = $("#source").val();
if(source === '0'){
$(".k-grid-add").hide();
$(".k-grid-save-changes").hide();
$(".k-grid-cancel-changes").hide();
$(".k-grid-delete").hide();
}
}
});
/**
* 计算金额
*
* @param item
* @param length
* @param width
......
......@@ -41,20 +41,20 @@
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="width" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="thick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" width="120" align="right" format="{0:N3}" required="true"
sumType="page"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" width="120" align="right" format="{0:N3}" sumType="page"
required="true"/>
<EF:EFColumn ename="deliverQty" cname="退货数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/>
<EF:EFColumn ename="depositQty" cname="入库数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/>
<EF:EFColumn ename="receiveUnitWeight" cname="收货单重" enable="false" width="120" align="right" format="{0:N3}"
hidden="true"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="true" width="120" align="center" required="true">
<EF:EFCodeOption codeName="hggp.cg.calculationMethod" />
<EF:EFColumn ename="receiveWeight" cname="收货重量" width="120" align="right" format="{0:N3}" sumType="page"
required="true"/>
<EF:EFColumn ename="receiveUnitWeight" cname="收货单重" enable="false" width="120" align="right"
format="{0:N3}"/>
<EF:EFComboColumn ename="calculationMethod" cname="计算方式" enable="false" width="120" align="center">
<EF:EFCodeOption codeName="hggp.cg.calculationMethod"/>
</EF:EFComboColumn>
<EF:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:C3}" required="true"/>
<EF:EFColumn ename="price" cname="单价" enable="false" width="120" align="right" format="{0:C3}"/>
<EF:EFColumn ename="amount" cname="金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
......
......@@ -6,15 +6,15 @@ $(function () {
const init = () => {
$("#HGWD001").css("padding-bottom", "8px")
sessionStorage.removeItem("__user_id__")
setTimeout(() => {
setTimeout(() => {
resultGrid.dataSource.page(1);
// 显示授权按钮
showAuthButton();
}, 1000);
// 查询
$("#QUERY").on("click", function (e) {
resultGrid.dataSource.page(1);
});
// 分割线组件
(function () {
splitter = $("#splitter").kendoSplitter({
......@@ -94,21 +94,22 @@ $(function () {
"categoryTree": {
select: function (e) {
var _data = this.dataItem(e.node);
var nodeData = IPLATUI.EFTree.categoryTree.selectTreeNode;
var labelValue = _data.label;
var typeValue = _data.type;
const eNameValue = _data.ename;
setTreeNodeValue(_data);
$("[name = 'inqu_status-0-parentId']").val(labelValue);
$("[name = 'inqu_status-0-bizId']").val(labelValue);
$("[name = 'inqu_status-0-fileId']").val(eNameValue);
$("[name = 'inqu_status-0-leafLevel']").val(_data.leafLevel==null?0:_data.leafLevel);
$("[name = 'inqu_status-0-projCode']").val(_data.projCode);
$("[name = 'inqu_status-0-companyCode']").val(_data.companyCode);
$("[name = 'inqu_status-0-type']").val(_data.type);
$("[name = 'inqu_status-0-type']").val(typeValue);
$("[name = 'inqu_status-0-fileName']").val(_data.text);
resultGrid.dataSource.page(1);
// 编辑、删除树节点时,需要刷新的树节点
$("[name = 'inqu_status-0-orgParentId']").val(_data.parentId);
// 显示授权按钮
showAuthButton();
},
/*ROOT:{label: 'root',text: '组织机构'},*/
template: function (node) {
......@@ -351,7 +352,6 @@ $(function () {
selectTreeNode(tree, orgId);
// 设置当前选中的节点信息
$("[name = 'inqu_status-0-parentId']").val(orgId);
$("[name = 'inqu_status-0-bizId']").val(orgId);
$("[name = 'inqu_status-0-projCode']").val(data.projCode);
$("[name = 'inqu_status-0-companyCode']").val(data.companyCode);
$("[name = 'inqu_status-0-type']").val(data.type);
......@@ -378,7 +378,14 @@ $(function () {
this.expandPath(['root']);
}, 1000);
},
selectTreeNode: {},
selectTreeNode: {
fileId: '',
parentId: '',
projCode: '',
companyCode: '',
leafLevel: '',
type: '',
},
// expandLevel:1,
/**
* 开启结点拖拽功能,默认dragAndDrop = false不开启,
......@@ -465,6 +472,8 @@ $(function () {
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
$("#RELEASE").click("click",updateRelease)
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
......@@ -816,7 +825,7 @@ function uploadFile() {
}
JSColorbox.open({
href: "HGWD099A?methodName=initLoad&inqu_status-0-bizType=WD" +
"&inqu_status-0-bizId="+$("#inqu_status-0-bizId").val()+"" +
"&inqu_status-0-bizId="+$("#inqu_status-0-parentId").val()+"" +
"&inqu_status-0-operType=add" +
"&efParentFormEname=HGWD001",
title: "<div style='text-align: center;'>附件上传</div>",
......@@ -888,3 +897,48 @@ function deleteFunc() {
}
})
}
/**
* 发布
*/
function updateRelease() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let inEiInfo = new EiInfo();
inEiInfo.addBlock(JSUtils.checkedRows2Block("result"))
EiCommunicator.send('HGWD001', 'updateRelease', inEiInfo, {
onSuccess(response) {
if (response.status != -1) {
NotificationUtil(response.msg);
query();
} else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
/**
* 显示授权按钮
*/
let showAuthButton = function () {
let leafType = IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel;
// C:目录
if (leafType && leafType >0) {
$("#RELEASE").attr("disabled", false);
$("#UPLOAD_FILE").attr("disabled", false);
} else {
$("#RELEASE").attr("disabled", true);
$("#UPLOAD_FILE").attr("disabled", true);
}
}
\ No newline at end of file
......@@ -54,7 +54,6 @@
<EF:EFInput cname="公司代码" ename="companyCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="项目代码" ename="projCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="parentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="bizId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="fileId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="类型" ename="type" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/>
......@@ -69,6 +68,9 @@
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="120" align="center" defaultValue="0" hidden="false">
<EF:EFCodeOption codeName="hggp.hgwd.status"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
......
......@@ -78,7 +78,6 @@ $(function () {
//console.log(dayjs,"dayjs")
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
$("#RELEASE").click("click",updateRelease)
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "projCode") {
......@@ -185,34 +184,6 @@ let save = function (btnNode) {
}
}
/**
* 发布
*/
function updateRelease() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let inEiInfo = new EiInfo();
inEiInfo.addBlock(JSUtils.checkedRows2Block("result"))
EiCommunicator.send('HGWD001', 'updateRelease', inEiInfo, {
onSuccess(response) {
if (response.status != -1) {
NotificationUtil(response.msg);
query();
} else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
/**
* 显示详情
......
......@@ -38,6 +38,10 @@
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgyx.status" condition="ITEM_CODE IN ('0','1')"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="isContract" cname="是否扣款" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
......@@ -76,6 +80,10 @@
<EF:EFColumn ename="consAddr" cname="发货地址" hidden="true" width="120" align="center"/>
<EF:EFColumn ename="consQuantity" cname="发货数量" enable="true" readonly="true" width="120" align="center" format="{0:N3}" data-rules="number"/>
<EF:EFColumn ename="consWeight" cname="发货重量" width="120" align="center" format="{0:N3}" data-rules="number"/>
<EF:EFComboColumn ename="isContract" cname="是否扣款" width="80" align="center" enable="false" defaultValue="0" required="true">
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFComboColumn>
<EF:EFColumn ename="contractName" cname="扣款方" width="120" align="center"/>
<EF:EFComboColumn ename="status" cname="审核状态" width="80" align="center" enable="false" defaultValue="0" required="true">
<EF:EFCodeOption codeName="hggp.hgyx.status" condition="ITEM_CODE IN ('0','1')"/>
</EF:EFComboColumn>
......
......@@ -221,6 +221,13 @@ $(function() {
});
return false;
}
let isContract = $("#inqu_status-0-isContract").val();
let contractName = $("#inqu_status-0-contractName").val();
if (isContract=="1" && isBlank(contractName)){
message("是扣款,扣款方不能为空");
flag = false;
return false;
}
let rows = resultGrid.getDataItems();
if (rows.length < 1) {
message("明细信息不能为空,请选择数据");
......@@ -259,6 +266,13 @@ $(function() {
});
return false;
}
let isContract = $("#inqu_status-0-isContract").val();
let contractName = $("#inqu_status-0-contractName").val();
if (isContract=="1" && isBlank(contractName)){
message("是扣款,扣款方不能为空");
flag = false;
return false;
}
let rows = resultGrid.getDataItems();
if (rows.length < 1) {
message("明细信息不能为空,请选择数据");
......
......@@ -66,6 +66,10 @@
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFInput blockId="inqu_status" row="0" ename="type" cname="type" type="hidden" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="isContract" cname="是否扣款" colWidth="3" filter="contains">
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="contractName" cname="扣款方" required="false" colWidth="3"/>
</div>
</EF:EFRegion>
......
......@@ -65,6 +65,10 @@
required="true" colWidth="3" disabled="true"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="isContract" cname="是否扣款" colWidth="3" filter="contains">
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="contractName" cname="扣款方" required="true" colWidth="3"/>
</div>
</EF:EFRegion>
......
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