Commit 7f6e4cc2 by liuyang

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

parents 41c13420 45800e0d
...@@ -78,9 +78,10 @@ public class UserSessionUtils extends UserSession { ...@@ -78,9 +78,10 @@ public class UserSessionUtils extends UserSession {
} }
return accountCode; return accountCode;
} }
/** /**
获取用户所属公司 * * 获取用户所属公司
*
* @return * @return
*/ */
public static UserVO getUserCompany() { public static UserVO getUserCompany() {
...@@ -89,7 +90,7 @@ public class UserSessionUtils extends UserSession { ...@@ -89,7 +90,7 @@ public class UserSessionUtils extends UserSession {
if (CollectionUtils.isNotEmpty(orgList)) { if (CollectionUtils.isNotEmpty(orgList)) {
Org org = orgList.get(0); Org org = orgList.get(0);
if (!org.getOrgType().equals("company")) { if (!org.getOrgType().equals("company")) {
//如果不是公司公司,则找到上一级 // 如果不是公司公司,则找到上一级
Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId()); Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
userVO.setUsercode(org1.getOrgId()); userVO.setUsercode(org1.getOrgId());
userVO.setUsername(org1.getOrgCname()); userVO.setUsername(org1.getOrgCname());
...@@ -100,6 +101,7 @@ public class UserSessionUtils extends UserSession { ...@@ -100,6 +101,7 @@ public class UserSessionUtils extends UserSession {
} }
return userVO; return userVO;
} }
/** /**
* 获取登录用户的组织机构 * 获取登录用户的组织机构
* *
...@@ -114,6 +116,27 @@ public class UserSessionUtils extends UserSession { ...@@ -114,6 +116,27 @@ public class UserSessionUtils extends UserSession {
} }
/** /**
* 获取登录用户的公司编码
*
* @return
*/
public static List<String> getCompanyCode() {
List<Org> orgs = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isEmpty(orgs)) {
return new ArrayList<>();
}
List<String> orgIds = orgs.stream().map(Org::getOrgId).collect(Collectors.toList());
List<Org> parentOrgs = HGXSTools.XsOrg.queryParent(orgIds);
List<String> results = new ArrayList<>();
for (Org org : parentOrgs) {
if (OrgTypeEnum.COMPANY.getCode().equals(org.getOrgType())) {
results.add(org.getOrgId());
}
}
return results.stream().distinct().collect(Collectors.toList());
}
/**
* 获取登录用户的厂区编码 * 获取登录用户的厂区编码
* *
* @return * @return
...@@ -123,13 +146,36 @@ public class UserSessionUtils extends UserSession { ...@@ -123,13 +146,36 @@ public class UserSessionUtils extends UserSession {
if (CollectionUtils.isEmpty(orgs)) { if (CollectionUtils.isEmpty(orgs)) {
return new ArrayList<>(); return new ArrayList<>();
} }
List<String> factoryCodes = new ArrayList<>(); List<String> orgIds = orgs.stream().map(Org::getOrgId).collect(Collectors.toList());
for (Org org : orgs) { List<Org> parentOrgs = HGXSTools.XsOrg.queryParent(orgIds);
List<String> results = new ArrayList<>();
for (Org org : parentOrgs) {
if (OrgTypeEnum.FACTORY.getCode().equals(org.getOrgType())) {
results.add(org.getOrgId());
}
}
return results.stream().distinct().collect(Collectors.toList());
}
/**
* 获取登录用户的厂区名称
*
* @return
*/
public static List<String> getFactoryName() {
List<Org> orgs = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isEmpty(orgs)) {
return new ArrayList<>();
}
List<String> orgIds = orgs.stream().map(Org::getOrgId).collect(Collectors.toList());
List<Org> parentOrgs = HGXSTools.XsOrg.queryParent(orgIds);
List<String> results = new ArrayList<>();
for (Org org : parentOrgs) {
if (OrgTypeEnum.FACTORY.getCode().equals(org.getOrgType())) { if (OrgTypeEnum.FACTORY.getCode().equals(org.getOrgType())) {
factoryCodes.add(org.getOrgId()); results.add(org.getFactoryName());
} }
} }
return factoryCodes; return results.stream().distinct().collect(Collectors.toList());
} }
/** /**
......
...@@ -61,6 +61,8 @@ public class HGCG003B extends DaoEPBase { ...@@ -61,6 +61,8 @@ public class HGCG003B extends DaoEPBase {
public static final String FIELD_CONTRACT_DETAIL_ID = "contractDetailId"; /* 合同明细id*/ public static final String FIELD_CONTRACT_DETAIL_ID = "contractDetailId"; /* 合同明细id*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/ public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/ public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_CALCULATION_METHOD = "calculationMethod"; /* 计算方式 0-数量乘单价 1-重量乘单价*/
//页面要展示主表信息 //页面要展示主表信息
public static final String FIELD_SUP_CODE = "supCode"; /* 供应商编码*/ public static final String FIELD_SUP_CODE = "supCode"; /* 供应商编码*/
...@@ -164,6 +166,7 @@ public class HGCG003B extends DaoEPBase { ...@@ -164,6 +166,7 @@ public class HGCG003B extends DaoEPBase {
private Integer isInvoicing = 0; /*是否开票 0-否 1-是*/ private Integer isInvoicing = 0; /*是否开票 0-否 1-是*/
private Integer source; /* 数据来源 根据采购数据来源小代码 目前0默认采购合同,1手动录入*/ private Integer source; /* 数据来源 根据采购数据来源小代码 目前0默认采购合同,1手动录入*/
private Integer calculationMethod; /* 状态:0-未审批,1-审核通过,2-审核未通过*/
/** /**
* initialize the metadata. * initialize the metadata.
*/ */
...@@ -380,6 +383,10 @@ public class HGCG003B extends DaoEPBase { ...@@ -380,6 +383,10 @@ public class HGCG003B extends DaoEPBase {
eiColumn = new EiColumn(FIELD_PROJ_NAME); eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称"); eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CALCULATION_METHOD);
eiColumn.setDescName("计算方式 0-数量乘单价 1-重量乘单价");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -1039,6 +1046,14 @@ public class HGCG003B extends DaoEPBase { ...@@ -1039,6 +1046,14 @@ public class HGCG003B extends DaoEPBase {
this.projName = projName; this.projName = projName;
} }
public Integer getCalculationMethod() {
return calculationMethod;
}
public void setCalculationMethod(Integer calculationMethod) {
this.calculationMethod = calculationMethod;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -1092,6 +1107,7 @@ public class HGCG003B extends DaoEPBase { ...@@ -1092,6 +1107,7 @@ public class HGCG003B extends DaoEPBase {
setSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SOURCE)), source)); setSource(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_SOURCE)), source));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode)); setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName)); setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setCalculationMethod(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CALCULATION_METHOD)), calculationMethod));
} }
/** /**
...@@ -1146,6 +1162,7 @@ public class HGCG003B extends DaoEPBase { ...@@ -1146,6 +1162,7 @@ public class HGCG003B extends DaoEPBase {
map.put(FIELD_SOURCE, StringUtils.toString(source, eiMetadata.getMeta(FIELD_SOURCE))); map.put(FIELD_SOURCE, StringUtils.toString(source, eiMetadata.getMeta(FIELD_SOURCE)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE))); 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_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_CALCULATION_METHOD, StringUtils.toString(calculationMethod, eiMetadata.getMeta(FIELD_CALCULATION_METHOD)));
return map; return map;
} }
......
...@@ -196,22 +196,25 @@ public class ServiceHGCG002 extends ServiceBase { ...@@ -196,22 +196,25 @@ public class ServiceHGCG002 extends ServiceBase {
private void removeData(List<HGCG002> fCg002s, Map<String, HGCG002A> dbCg002AMap) { private void removeData(List<HGCG002> fCg002s, Map<String, HGCG002A> dbCg002AMap) {
//需要改变状态的采购计划主表 //需要改变状态的采购计划主表
List<String> planNos = fCg002s.stream().map(HGCG002::getPlanNo).collect(Collectors.toList()); List<String> planNos = fCg002s.stream().map(HGCG002::getPlanNo).collect(Collectors.toList());
List<HGCG001> hgcg001List = HGCGTools.HgCg001.list(planNos);
for (HGCG002 fCg002 : fCg002s) { for (HGCG002 fCg002 : fCg002s) {
String contractNo = fCg002.getContractNo(); String contractNo = fCg002.getContractNo();
HGCG002 dbCg002 = dbCg002AMap.get(contractNo); HGCG002 dbCg002 = dbCg002AMap.get(contractNo);
dbCg002.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode()); dbCg002.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGCG002.DELETE, dbCg002); DaoUtils.update(HGCG002.DELETE, dbCg002);
// 更新计划状态 if(StringUtils.isNotBlank(dbCg002.getPlanNo())){
HGCGTools.HgCg001.updateStatus(dbCg002.getPlanNo(), HGConstant.CgContractStatus.S_2); // 更新计划状态
HGCGTools.HgCg001.updateStatus(dbCg002.getPlanNo(), HGConstant.CgContractStatus.S_2);
}
} }
List<Long> primaryIds = fCg002s.stream().map(o->o.getId()).collect(Collectors.toList()); List<Long> primaryIds = fCg002s.stream().map(o->o.getId()).collect(Collectors.toList());
List<HGCG002B> queryHgcg002BList = HGCGTools.HgCg002B.listByPrimaryIds(primaryIds); List<HGCG002B> queryHgcg002BList = HGCGTools.HgCg002B.listByPrimaryIds(primaryIds);
for(HGCG002B hgcg002B : queryHgcg002BList){ for(HGCG002B hgcg002B : queryHgcg002BList){
// 更新计划明细状态 // 更新计划明细状态
HGCGTools.HgCg001A.updateStatus(hgcg002B.getPlanDetailId(), HGConstant.CgPlanStatus.S_2); if(hgcg002B.getPlanDetailId() != null && hgcg002B.getPlanDetailId().intValue() != 0){
HGCGTools.HgCg001A.updateStatus(hgcg002B.getPlanDetailId(), HGConstant.CgPlanStatus.S_2);
}
} }
......
...@@ -245,26 +245,27 @@ public class ServiceHGCG003 extends ServiceBase { ...@@ -245,26 +245,27 @@ public class ServiceHGCG003 extends ServiceBase {
HGCG003 dbCg003 = dbCg003Map.get(receiveNo); HGCG003 dbCg003 = dbCg003Map.get(receiveNo);
dbCg003.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode()); dbCg003.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGCG003.DELETE, dbCg003); DaoUtils.update(HGCG003.DELETE, dbCg003);
if(fCg003.getSource().intValue() == HGConstant.CgSource.DEFAULT){ if (fCg003.getSource().intValue() == HGConstant.CgSource.DEFAULT) {
// 更新合同状态 // 更新合同状态
HGCGTools.HgCg002.updateReceive(dbCg002AMap.get(contractNo), dbCg003.getReceiveQty().negate()); HGCGTools.HgCg002.updateReceive(dbCg002AMap.get(contractNo), dbCg003.getReceiveQty().negate());
} }
} }
//子表修改 //子表修改
List<Long> cg003Ids = fCg003s.stream().map(o->o.getId()).collect(Collectors.toList()); List<Long> cg003Ids = fCg003s.stream().map(o -> o.getId()).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(cg003Ids)){ if (!CollectionUtils.isEmpty(cg003Ids)) {
List<HGCG003B> fCg003Bs = HGCGTools.HgCg003B.listByPrimaryIds(cg003Ids); List<HGCG003B> fCg003Bs = HGCGTools.HgCg003B.listByPrimaryIds(cg003Ids);
// 采购合同明细DB数据 // 采购合同明细DB数据
Map<Long, HGCG002B> dbCg002BMap = HGCGUtils.HgCg002B.lockGetData( Map<Long, HGCG002B> dbCg002BMap = HGCGUtils.HgCg002B.lockGetData(
ObjectUtils.listEpKey(fCg003Bs, HGCG003B.FIELD_CONTRACT_DETAIL_ID)); ObjectUtils.listEpKey(fCg003Bs, HGCG003B.FIELD_CONTRACT_DETAIL_ID));
for (HGCG003B fCg003B : fCg003Bs) { for (HGCG003B fCg003B : fCg003Bs) {
HGCG003 hgcg003 = fCg003s.stream().filter(o->o.getId().compareTo(fCg003B.getPrimaryId()) == 0).findAny().orElse(null); HGCG003 hgcg003 = fCg003s.stream().filter(o -> o.getId().compareTo(fCg003B.getPrimaryId()) == 0)
.findAny().orElse(null);
fCg003B.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode()); fCg003B.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGCG003B.DELETE, fCg003B); DaoUtils.update(HGCG003B.DELETE, fCg003B);
//数据来源为合同的才需要更新合同状态 // 数据来源为合同的才需要更新合同状态
if(Objects.nonNull(hgcg003) && hgcg003.getSource().intValue() == HGConstant.CgSource.DEFAULT){ if (Objects.nonNull(hgcg003) && hgcg003.getSource().intValue() == HGConstant.CgSource.DEFAULT) {
// 更新合同状态 HGCG002B dbCg002b = dbCg002BMap.get(fCg003B.getContractDetailId());
HGCGTools.HgCg002B.updateReceive(dbCg002BMap.get(fCg003B.getContractDetailId()), fCg003B.getReceiveQty().negate()); HGCGTools.HgCg002B.updateReceive(dbCg002b, fCg003B.getReceiveQty().negate());
} }
} }
} }
......
...@@ -22,6 +22,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase; ...@@ -22,6 +22,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays; import java.util.Arrays;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
...@@ -86,12 +87,14 @@ public class ServiceHGCG003A extends ServiceBase { ...@@ -86,12 +87,14 @@ public class ServiceHGCG003A extends ServiceBase {
try { try {
List<HGCG002B> fCg002Bs = MapUtils.toDaoEPBases(inInfo, HGCG002B.class); List<HGCG002B> fCg002Bs = MapUtils.toDaoEPBases(inInfo, HGCG002B.class);
// db数据 // db数据
Map<Long, HGCG002B> dbCg002AMap = HGCGUtils.HgCg002B.lockGetDataEp(fCg002Bs); Map<Long, HGCG002B> dbCg002bMap = HGCGUtils.HgCg002B.lockGetDataEp(fCg002Bs);
HGCG002 cg001 = HGCGTools.HgCg002.get(fCg002Bs.get(0).getPrimaryId()); HGCG002 dbCg002 = HGCGTools.HgCg002.get(fCg002Bs.get(0).getPrimaryId());
// 数据校验 // 数据校验
this.checkConfirmData(fCg002Bs, dbCg002AMap,cg001); this.checkConfirmData(fCg002Bs, dbCg002bMap, dbCg002);
// 计算总金额和总重
this.calcAmountAndWeight(fCg002Bs, dbCg002bMap, dbCg002);
// 保存数据 // 保存数据
this.confirmData(fCg002Bs, dbCg002AMap,cg001); this.confirmData(fCg002Bs, dbCg002bMap, dbCg002);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + fCg002Bs.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + fCg002Bs.size() + "]条数据保存成功!");
...@@ -119,58 +122,96 @@ public class ServiceHGCG003A extends ServiceBase { ...@@ -119,58 +122,96 @@ public class ServiceHGCG003A extends ServiceBase {
fCg002B.getBcReceiveQty(), fCg002B.getBcMaxReceiveQty())); fCg002B.getBcReceiveQty(), fCg002B.getBcMaxReceiveQty()));
} }
} }
/**
* 计算总金额和总重
*
* @param fCg002Bs
* @param dbCg002BMap
* @param dbCg002
*/
private void calcAmountAndWeight(List<HGCG002B> fCg002Bs, Map<Long, HGCG002B> dbCg002BMap, HGCG002 dbCg002) {
for (HGCG002B fCg002B : fCg002Bs) {
Long id = fCg002B.getId();
HGCG002B dbCg002b = dbCg002BMap.get(id);
// 总重
fCg002B.setReceiveWeight(fCg002B.getBcReceiveQty().multiply(dbCg002b.getPurUnitWeight()));
// 含税总金额
BigDecimal amount = fCg002B.getReceiveWeight().multiply(dbCg002b.getPrice());
// 如果税率不为空,总金额减去税额
if (dbCg002b.getTaxRate() != null) {
amount = amount.subtract(amount.multiply(dbCg002b.getTaxRate()).divide(new BigDecimal("100")));
}
fCg002B.setAmount(amount);
}
}
/** /**
* 数据保存 * 数据保存
* @param fCg002Bs *
* @param fCg002Bs
* @param dbCg002BMap * @param dbCg002BMap
* @param cg002 * @param cg002
*/ */
private void confirmData(List<HGCG002B> fCg002Bs, Map<Long, HGCG002B> dbCg002BMap, HGCG002 cg002) { private void confirmData(List<HGCG002B> fCg002Bs, Map<Long, HGCG002B> dbCg002BMap, HGCG002 cg002) {
HGCG002B hgcg002B = fCg002Bs.get(0); HGCG002B hgcg002B = fCg002Bs.get(0);
HGCG003 newCg003 = new HGCG003(); HGCG003 newCg003 = new HGCG003();
BeanUtils.copyProperties(hgcg002B, newCg003,"id","createdBy","createdName","createdTime","updatedBy","updatedName","updatedTime"); BeanUtils.copyProperties(hgcg002B, newCg003, "id", "createdBy", "createdName", "createdTime", "updatedBy",
"updatedName", "updatedTime");
newCg003.setReceiveDate(DateUtils.shortDate()); newCg003.setReceiveDate(DateUtils.shortDate());
newCg003.setReceiveNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_RECEIVE_NO)); newCg003.setReceiveNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CG_RECEIVE_NO));
BigDecimal bcReceiveQtySum = fCg002Bs.stream().map(HGCG002B::getBcReceiveQty).reduce(BigDecimal.ZERO,BigDecimal::add); // 计算收获总数量
BigDecimal bcReceiveQtySum = fCg002Bs.stream().map(HGCG002B::getBcReceiveQty)
.reduce(BigDecimal.ZERO, BigDecimal::add);
newCg003.setReceiveQty(bcReceiveQtySum); newCg003.setReceiveQty(bcReceiveQtySum);
BigDecimal purUnitWeightSum = fCg002Bs.stream().map(HGCG002B::getPurUnitWeight).reduce(BigDecimal.ZERO,BigDecimal::add); // 计算收货总重
newCg003.setReceiveUnitWeight(purUnitWeightSum); BigDecimal receiveWeight = fCg002Bs.stream().map(HGCG002B::getReceiveWeight)
newCg003.setReceiveWeight(newCg003.getReceiveQty().multiply(newCg003.getReceiveUnitWeight())); .reduce(BigDecimal.ZERO, BigDecimal::add);
newCg003.setReceiveWeight(receiveWeight);
newCg003.setReceiveUnitWeight(receiveWeight.divide(bcReceiveQtySum, 3, RoundingMode.HALF_UP));
// 计算收货总金额
BigDecimal receiveAmount = fCg002Bs.stream().map(HGCG002B::getAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
newCg003.setAmount(receiveAmount);
newCg003.setStatus(HGConstant.CgReceiveStatus.S_0); newCg003.setStatus(HGConstant.CgReceiveStatus.S_0);
newCg003.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode()); newCg003.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
newCg003.setSource(HGConstant.CgSource.DEFAULT); newCg003.setSource(HGConstant.CgSource.DEFAULT);
DaoUtils.insert(HGCG003.INSERT, newCg003); DaoUtils.insert(HGCG003.INSERT, newCg003);
// 写入明细数据
for (HGCG002B fCg002B : fCg002Bs) { for (HGCG002B fCg002B : fCg002Bs) {
insertDetails(fCg002B,newCg003); Long id = fCg002B.getId();
HGCG002B dbCg002b = dbCg002BMap.get(id);
insertDetails(fCg002B, dbCg002b, newCg003);
} }
List<HGCG002> hgcg002List = new LinkedList<>(); List<HGCG002> hgcg002List = new LinkedList<>();
hgcg002List.add(cg002); hgcg002List.add(cg002);
HGCGTools.HgCg002.updateContractPrimary(hgcg002List); HGCGTools.HgCg002.updateContractPrimary(hgcg002List);
} }
private void insertDetails(HGCG002B dbCg002B, HGCG003 newCg003) { /**
* 新增明细数据
*
* @param fCg002B
* @param dbCg002b
* @param newCg003
*/
private void insertDetails(HGCG002B fCg002B, HGCG002B dbCg002b, HGCG003 newCg003) {
HGCG003B cg003B = new HGCG003B(); HGCG003B cg003B = new HGCG003B();
//拷贝主表明细信息 //拷贝主表明细信息
BeanUtils.copyProperties(newCg003,cg003B,"id"); BeanUtils.copyProperties(newCg003, cg003B, "id");
//拷贝明细信息 //拷贝明细信息
BeanUtils.copyProperties(dbCg002B,cg003B,"id","createdBy","createdName","createdTime","updatedBy","updatedName","updatedTime" BeanUtils.copyProperties(fCg002B, cg003B, "id", "createdBy", "createdName", "createdTime", "updatedBy",
,"contractNo","planNo","supCode","supName","purUserId","purUserName","status"); "updatedName", "updatedTime", "contractNo", "planNo", "supCode", "supName", "purUserId",
"purUserName", "status");
cg003B.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode()); cg003B.setDeleteFlag(DeleteFlagEnum.UN_REMOVE.getCode());
cg003B.setPrimaryId(newCg003.getId()); cg003B.setPrimaryId(newCg003.getId());
cg003B.setReceiveUnitWeight(dbCg002B.getPurUnitWeight()); cg003B.setReceiveUnitWeight(fCg002B.getPurUnitWeight());
cg003B.setReceiveQty(dbCg002B.getBcReceiveQty()); cg003B.setReceiveQty(fCg002B.getBcReceiveQty());
cg003B.setReceiveWeight(dbCg002B.getBcReceiveQty().multiply(dbCg002B.getPurUnitWeight())); cg003B.setReceiveWeight(fCg002B.getReceiveWeight());
cg003B.setContractDetailId(dbCg002B.getId()); cg003B.setContractDetailId(fCg002B.getId());
DaoUtils.insert(HGCG003B.INSERT,cg003B); DaoUtils.insert(HGCG003B.INSERT, cg003B);
BigDecimal diffQty = cg003B.getReceiveQty().subtract(dbCg002B.getReceiveQty());
Integer status = diffQty.compareTo(BigDecimal.ZERO) == 0 ? HGConstant.CgContractStatus.S_5
: HGConstant.CgContractStatus.S_4;
dbCg002B.setStatus(status);
// 更新合同状态 // 更新合同状态
HGCGTools.HgCg002B.updateReceive(dbCg002B, cg003B.getReceiveQty()); HGCGTools.HgCg002B.updateReceive(dbCg002b, cg003B.getReceiveQty());
} }
} }
...@@ -155,7 +155,8 @@ public class ServiceHGCG003B extends ServiceBase { ...@@ -155,7 +155,8 @@ public class ServiceHGCG003B extends ServiceBase {
* @param cg003 * @param cg003
* @param dbCg002BMap * @param dbCg002BMap
*/ */
private void editData(List<HGCG003B> fCg003Bs, Map<Long, HGCG003B> dbCg003BMap, Map<String, HGCG002A> dbCg002AMap, HGCG003 cg003, Map<Long, HGCG002B> dbCg002BMap) { private void editData(List<HGCG003B> fCg003Bs, Map<Long, HGCG003B> dbCg003BMap, Map<String, HGCG002A> dbCg002AMap,
HGCG003 cg003, Map<Long, HGCG002B> dbCg002BMap) {
for (HGCG003B fCg003B : fCg003Bs) { for (HGCG003B fCg003B : fCg003Bs) {
// 计算重量 // 计算重量
fCg003B.setReceiveWeight(fCg003B.getReceiveQty().multiply(fCg003B.getReceiveUnitWeight())); fCg003B.setReceiveWeight(fCg003B.getReceiveQty().multiply(fCg003B.getReceiveUnitWeight()));
...@@ -262,15 +263,17 @@ public class ServiceHGCG003B extends ServiceBase { ...@@ -262,15 +263,17 @@ public class ServiceHGCG003B extends ServiceBase {
* @param cg003 * @param cg003
* @param dbCg002BMap * @param dbCg002BMap
*/ */
private void removeData(List<HGCG003B> fCg003Bs, Map<Long, HGCG003B> dbCg003bMap, Map<String, HGCG002A> dbCg002AMap, HGCG003 cg003, Map<Long, HGCG002B> dbCg002BMap) { private void removeData(List<HGCG003B> fCg003Bs, Map<Long, HGCG003B> dbCg003bMap, Map<String, HGCG002A> dbCg002AMap,
HGCG003 cg003, Map<Long, HGCG002B> dbCg002BMap) {
//数据来源为合同的 //数据来源为合同的
if(cg003.getSource().intValue() == HGConstant.CgSource.DEFAULT){ if (cg003.getSource().intValue() == HGConstant.CgSource.DEFAULT) {
for (HGCG003B fCg003B : fCg003Bs) { for (HGCG003B fCg003B : fCg003Bs) {
HGCG003B dbCg003B = dbCg003bMap.get(fCg003B.getId()); HGCG003B dbCg003B = dbCg003bMap.get(fCg003B.getId());
dbCg003B.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode()); dbCg003B.setDeleteFlag(DeleteFlagEnum.REMOVE.getCode());
DaoUtils.update(HGCG003B.DELETE, dbCg003B); DaoUtils.update(HGCG003B.DELETE, dbCg003B);
// 更新合同状态 // 更新合同状态
HGCGTools.HgCg002B.updateReceive(dbCg002BMap.get(fCg003B.getContractDetailId()), dbCg003B.getReceiveQty().negate()); HGCGTools.HgCg002B.updateReceive(dbCg002BMap.get(fCg003B.getContractDetailId()),
dbCg003B.getReceiveQty().negate());
} }
List<HGCG002> hgcg002List = new LinkedList<>(); List<HGCG002> hgcg002List = new LinkedList<>();
dbCg002AMap.forEach((k, v)->{ dbCg002AMap.forEach((k, v)->{
......
...@@ -135,9 +135,8 @@ ...@@ -135,9 +135,8 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B">
resultClass="com.baosight.hggp.hg.cg.domain.HGCG002B"> SELECT
SELECT
ID as "id", ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 --> ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 --> DEP_CODE as "depCode", <!-- 部门编码 -->
...@@ -174,7 +173,8 @@ ...@@ -174,7 +173,8 @@
PROJ_CODE as "projCode", <!-- 项目编码 --> PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 --> PROJ_NAME as "projName", <!-- 项目名称 -->
CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 --> CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
PLAN_DETAIL_ID as "planDetailId" <!-- 计划明细id --> PLAN_DETAIL_ID as "planDetailId", <!-- 计划明细id -->
STATUS as "status"
FROM ${hggpSchema}.HGCG002A WHERE 1=1 FROM ${hggpSchema}.HGCG002A WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<include refid="idCondition"/> <include refid="idCondition"/>
......
...@@ -119,6 +119,9 @@ ...@@ -119,6 +119,9 @@
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
PROJ_NAME LIKE CONCAT('%', #projName# ,'%') PROJ_NAME LIKE CONCAT('%', #projName# ,'%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="calculationMethod">
CALCULATION_METHOD = #calculationMethod#
</isNotEmpty>
</sql> </sql>
<sql id="idCondition"> <sql id="idCondition">
...@@ -180,6 +183,7 @@ ...@@ -180,6 +183,7 @@
PRIMARY_ID as "primaryId", <!-- 主表id --> PRIMARY_ID as "primaryId", <!-- 主表id -->
PROJ_CODE as "projCode", <!-- 项目编码 --> PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 --> PROJ_NAME as "projName", <!-- 项目名称 -->
CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
CONTRACT_DETAIL_ID as "contractDetailId", <!-- 合同明细id --> CONTRACT_DETAIL_ID as "contractDetailId", <!-- 合同明细id -->
IS_INVOICING as "isInvoicing" IS_INVOICING as "isInvoicing"
FROM ${hggpSchema}.HGCG003A WHERE 1=1 FROM ${hggpSchema}.HGCG003A WHERE 1=1
...@@ -240,13 +244,14 @@ ...@@ -240,13 +244,14 @@
CONTRACT_DETAIL_ID, <!-- 合同明细id --> CONTRACT_DETAIL_ID, <!-- 合同明细id -->
PROJ_CODE, <!-- 项目编码 --> PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 --> PROJ_NAME, <!-- 项目名称 -->
CALCULATION_METHOD,
IS_INVOICING IS_INVOICING
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #receiveDate#, #receiveNo#, #planNo#, #contractNo#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #receiveDate#, #receiveNo#, #planNo#, #contractNo#,
#inventType#, #inventCode#, #inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#, #inventType#, #inventCode#, #inventName#, #specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#,
#receiveQty#, #deliverQty#, #depositQty#, #receiveUnitWeight#, #receiveWeight#, #status#, #price#, #amount#, #receiveQty#, #deliverQty#, #depositQty#, #receiveUnitWeight#, #receiveWeight#, #status#, #price#, #amount#,
#inventTypeDetail#, #primaryId#, #contractDetailId#,#projCode#,#projName#,#isInvoicing#) #inventTypeDetail#, #primaryId#, #contractDetailId#,#projCode#,#projName#,#calculationMethod#,#isInvoicing#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -295,6 +300,7 @@ ...@@ -295,6 +300,7 @@
CONTRACT_DETAIL_ID = #contractDetailId#, <!-- 合同明细id --> CONTRACT_DETAIL_ID = #contractDetailId#, <!-- 合同明细id -->
PROJ_CODE = #projCode#, <!-- 项目编码 --> PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 --> PROJ_NAME = #projName#, <!-- 项目名称 -->
CALCULATION_METHOD = #calculationMethod#,
IS_INVOICING = #isInvoicing# IS_INVOICING = #isInvoicing#
WHERE WHERE
ID = #id# ID = #id#
...@@ -390,6 +396,7 @@ ...@@ -390,6 +396,7 @@
a.CONTRACT_DETAIL_ID as "contractDetailId", <!-- 合同明细id --> a.CONTRACT_DETAIL_ID as "contractDetailId", <!-- 合同明细id -->
a.PROJ_CODE as "projCode", <!-- 项目编码 --> a.PROJ_CODE as "projCode", <!-- 项目编码 -->
a.PROJ_NAME as "projName", <!-- 项目名称 --> a.PROJ_NAME as "projName", <!-- 项目名称 -->
a.CALCULATION_METHOD as "calculationMethod", <!-- 计算方式 0-数量乘单价 1-重量乘单价 -->
b.STATUS as "status", <!-- 状态 --> b.STATUS as "status", <!-- 状态 -->
b.SUP_CODE as "supCode", <!-- 供应商编码 --> b.SUP_CODE as "supCode", <!-- 供应商编码 -->
b.SUP_NAME as "supName", <!-- 供应商名称 --> b.SUP_NAME as "supName", <!-- 供应商名称 -->
...@@ -439,6 +446,9 @@ ...@@ -439,6 +446,9 @@
<isNotEmpty prepend=" AND " property="receiveDate"> <isNotEmpty prepend=" AND " property="receiveDate">
a.RECEIVE_DATE = replace(#receiveDate#,'-','') a.RECEIVE_DATE = replace(#receiveDate#,'-','')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="calculationMethod">
a.CALCULATION_METHOD = #calculationMethod#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supCode"> <isNotEmpty prepend=" AND " property="supCode">
b.SUP_CODE = #supCode# b.SUP_CODE = #supCode#
</isNotEmpty> </isNotEmpty>
......
...@@ -345,7 +345,12 @@ public class HGCGTools { ...@@ -345,7 +345,12 @@ public class HGCGTools {
List<HGCG002A> results = list(contractNos); List<HGCG002A> results = list(contractNos);
return results.stream().collect(Collectors.toMap(HGCG002A::getContractNo, item -> item)); return results.stream().collect(Collectors.toMap(HGCG002A::getContractNo, item -> item));
} }
/**
* 更新合同信息
*
* @param hgcg002List
*/
public static void updateContractPrimary(List<HGCG002> hgcg002List) { public static void updateContractPrimary(List<HGCG002> hgcg002List) {
List<Long> primaryIds = hgcg002List.stream().map(o->o.getId()).collect(Collectors.toList()); List<Long> primaryIds = hgcg002List.stream().map(o->o.getId()).collect(Collectors.toList());
List<HGCG002B> queryHgcg002BList = HGCGTools.HgCg002B.listByPrimaryIds(primaryIds); List<HGCG002B> queryHgcg002BList = HGCGTools.HgCg002B.listByPrimaryIds(primaryIds);
...@@ -569,7 +574,13 @@ public class HGCGTools { ...@@ -569,7 +574,13 @@ public class HGCGTools {
paramMap.put(HGCG002.FIELD_ID, dbCg002B.getId()); paramMap.put(HGCG002.FIELD_ID, dbCg002B.getId());
paramMap.put(HGCG002.FIELD_RECEIVE_QTY, newReceiveQty); paramMap.put(HGCG002.FIELD_RECEIVE_QTY, newReceiveQty);
paramMap.put(HGCG002.FIELD_RECEIVE_WEIGHT, newReceiveQty.multiply(dbCg002B.getPurUnitWeight())); paramMap.put(HGCG002.FIELD_RECEIVE_WEIGHT, newReceiveQty.multiply(dbCg002B.getPurUnitWeight()));
paramMap.put(HGCG002.FIELD_STATUS, dbCg002B.getStatus()); if (newReceiveQty.compareTo(BigDecimal.ZERO) == 0) {
paramMap.put(HGCG002.FIELD_STATUS, HGConstant.CgContractStatus.S_2);
} else if (dbCg002B.getPurQty().compareTo(newReceiveQty) == 0) {
paramMap.put(HGCG002.FIELD_STATUS, HGConstant.CgContractStatus.S_5);
} else {
paramMap.put(HGCG002.FIELD_STATUS, HGConstant.CgContractStatus.S_4);
}
DaoUtils.update(HGSqlConstant.HgCg002B.UPDATE_RECEIVE, paramMap); DaoUtils.update(HGSqlConstant.HgCg002B.UPDATE_RECEIVE, paramMap);
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<sql id="condition"> <sql id="condition">
AND A.DELETE_FLAG = '0' AND A.DELETE_FLAG = '0'
<include refid="SqlBase.authCondition"/> <include refid="HGXSDataAuth.authConditionA"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
A.ID = #id# A.ID = #id#
</isNotEmpty> </isNotEmpty>
......
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.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
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.tools.HGCGTools;
import com.baosight.hggp.hg.cg.utils.HGCGUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC008;
import com.baosight.hggp.hg.kc.domain.HGKC008A;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ007;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.yx.domain.HGYX001A;
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.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.util.DateUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.math.BigDecimal;
import java.util.*;
/**
* @author:songx
* @date:2024/5/9,11:04
*/
public class ServiceHGKC008B 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),paramMap);
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());
inInfo = super.query(inInfo, HGKC010.QUERY, 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 receiveId = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC008A.FIELD_RECEIVE_ID);
List<HGKC010> hgkc010s = MapUtils.toDaoEPBases(inInfo, HGKC010.class);
// db数据
Map<Long, HGKC010> dbHgkc010Map = HGKCUtils.HgKc010.lockGetDataEp(hgkc010s);
List<HGKC008A> hgkc008AList = HGKCUtils.HgKc008A.listByPrimaryId(receiveId);
HGKC008 hgkc008 = HGKCUtils.HgKc008.get(receiveId);
// 数据校验
this.checkConfirmData(hgkc008AList, dbHgkc010Map,hgkc008);
// 保存数据
this.confirmData(dbHgkc010Map, hgkc008);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgkc010s.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
private void confirmData(Map<Long, HGKC010> dbHgkc010Map, HGKC008 hgkc008) {
List<HGKC008A> hgkc008AList = new LinkedList<>();
dbHgkc010Map.forEach((k,v) ->{
HGKC008A hgkc008A = new HGKC008A();
BeanUtils.copyProperties(hgkc008,hgkc008A,"id","createdBy","createdName","createdTime","updatedBy","updatedName","updatedTime");
hgkc008A.setReceiveId(hgkc008.getId());
hgkc008A.setInvLength(v.getLength());
hgkc008A.setInvThick(v.getThick());
hgkc008A.setInvUnitWeight(v.getInvUnitWeight());
hgkc008A.setInvWeight(v.getInvWeight());
hgkc008A.setInvWidth(v.getWidth());
hgkc008A.setInvSpec(v.getSpec());
hgkc008A.setInventType(v.getInventType());
hgkc008A.setInventTypeDetail(v.getInventTypeDetail());
hgkc008A.setInventCode(v.getInventCode());
hgkc008A.setInventName(v.getInventName());
hgkc008A.setInvQty(v.getInvQty());
hgkc008AList.add(hgkc008A);
});
DaoUtils.insertBatch(HGKC008A.INSERT, hgkc008AList);
}
private void checkConfirmData(List<HGKC008A> hgkc008AList, Map<Long, HGKC010> dbHgkc010Map, HGKC008 hgkc008) {
AssertUtils.isTrue(hgkc008.getStatus().compareTo(HGConstant.ProductStatus.YTJ) == 0,"领料单已提交,不可修改");
hgkc008AList.forEach(o -> {
dbHgkc010Map.forEach((k,v) ->{
AssertUtils.isTrue(o.getInventCode().equals(v.getInventCode()), "此领料单已选择存货:"+v.getInventCode());
});
});
}
}
...@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.kc.utils; ...@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.kc.utils;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum; import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.hg.cg.domain.HGCG003B;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.*; import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.tools.HGKCTools; import com.baosight.hggp.hg.kc.tools.HGKCTools;
...@@ -204,6 +205,52 @@ public class HGKCUtils { ...@@ -204,6 +205,52 @@ public class HGKCUtils {
queryRow.put(HGKC007.FIELD_OTHER_OUT_DATE, DateUtils.formatShort(otherOutDate)); queryRow.put(HGKC007.FIELD_OTHER_OUT_DATE, DateUtils.formatShort(otherOutDate));
} }
} }
/**
* 查询
*
* @param primaryId
* @return
*/
public static List<HGCG003B> listByPrimaryId(Long primaryId) {
AssertUtils.isNull(primaryId, "收货单id不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("primaryId", primaryId);
return DaoBase.getInstance().query(HGCG003B.QUERY, paramMap);
}
}
public static class HgKc008 {
/**
* 查询
*
* @param receiveId
* @return
*/
public static HGKC008 get(String receiveId) {
AssertUtils.isNull(receiveId, "领料单id不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("id", receiveId);
List<HGKC008> hgkc008List = DaoBase.getInstance().query(HGKC008.QUERY, paramMap);
return hgkc008List.get(0);
}
}
public static class HgKc008A {
/**
* 查询
*
* @param receiveId
* @return
*/
public static List<HGKC008A> listByPrimaryId(String receiveId) {
AssertUtils.isEmpty(receiveId, "领料单id不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("receiveId", receiveId);
return DaoBase.getInstance().query(HGKC008A.QUERY, paramMap);
}
} }
/** /**
* HGKC010 工具类 * HGKC010 工具类
......
package com.baosight.hggp.hg.sc.constant;
/**
* @author:songx
* @date:2024/8/22,10:09
*/
public class HgScSqlConstant {
/**
* 项目管理
*
* @author:songx
* @date:2024/5/7,16:36
*/
public static class HgSc001 {
// 德诚修改
public static final String UPDATE_FOR_DC = "HGSC001.updateForDc";
}
}
...@@ -8,6 +8,7 @@ import com.baosight.hggp.core.security.UserSessionUtils; ...@@ -8,6 +8,7 @@ import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.sb.tools.HGSBTools; import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.sc.domain.HGSC007; import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.sc.util.HgScUtils;
import com.baosight.hggp.hg.xs.domain.Company; import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Factory; import com.baosight.hggp.hg.xs.domain.Factory;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
...@@ -102,8 +103,8 @@ public class ServiceHGSC007 extends ServiceEPBase { ...@@ -102,8 +103,8 @@ public class ServiceHGSC007 extends ServiceEPBase {
if (StringUtils.isNotBlank(creatTime)) { if (StringUtils.isNotBlank(creatTime)) {
queryMap.put(HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime)); queryMap.put(HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime));
} }
// 设置组过滤条件 // 仅查询自己所在组的任务 added by songx at 20240820
this.setGroupCondition(queryMap); HgScUtils.HgSc007.setOrgCondition(queryMap);
inInfo = super.query(inInfo, HGSC007.QUERY, new HGSC007()); inInfo = super.query(inInfo, HGSC007.QUERY, new HGSC007());
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -126,33 +127,15 @@ public class ServiceHGSC007 extends ServiceEPBase { ...@@ -126,33 +127,15 @@ public class ServiceHGSC007 extends ServiceEPBase {
if (StringUtils.isNotBlank(creatTime)) { if (StringUtils.isNotBlank(creatTime)) {
queryMap.put(HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime)); queryMap.put(HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime));
} }
// 设置组过滤条件 // 仅查询自己所在组的任务 added by songx at 20240820
this.setGroupCondition(queryMap); HgScUtils.HgSc007.setOrgCondition(queryMap);
count = super.count(HGSC007.COUNT, queryMap); count = super.count(HGSC007.COUNT, queryMap);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
return count; return count;
} }
/**
* 设置组过滤条件
*
* @param queryMap
*/
private void setGroupCondition(Map queryMap) {
// 超级管理员看所有数据
if (LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
return;
}
// 仅查询自己所在组的任务 added by songx at 20240820
List<String> allGroupNames = UserSessionUtils.getAllGroupName();
// 当用户无组的时候,集合中添加空字符串用于查询,如果不加会查询出所有的数据
allGroupNames.add(" ");
queryMap.put("groupNames", allGroupNames);
}
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询公司", operDesc = "APP查询当前登陆用户角色所属公司") @OperationLogAnnotation(operModul = "生产任务", operType = "APP查询公司", operDesc = "APP查询当前登陆用户角色所属公司")
public List<Company> getRoleCompany(EiInfo inInfo) { public List<Company> getRoleCompany(EiInfo inInfo) {
List<Company> companyList = UserSessionUtils.getRoleCompany(); List<Company> companyList = UserSessionUtils.getRoleCompany();
......
package com.baosight.hggp.hg.sc.service; package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.domain.HGSC002; import com.baosight.hggp.hg.sc.domain.HGSC002;
import com.baosight.hggp.hg.sc.domain.HGSC008; import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools; import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.sc.util.HgScUtils;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.ObjectUtils; import com.baosight.hggp.util.ObjectUtils;
...@@ -22,28 +22,34 @@ import java.util.Map; ...@@ -22,28 +22,34 @@ import java.util.Map;
*/ */
public class ServiceHGSC008 extends ServiceEPBase { public class ServiceHGSC008 extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产报工单", operType = "查询", operDesc = "初始化页面") @OperationLogAnnotation(operModul = "生产报工单", operType = "查询", operDesc = "初始化页面")
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC008().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC008().eiMetadata);
inInfo = super.query(inInfo, HGSC008.QUERY, new HGSC008());
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
return inInfo; return inInfo;
} }
/* /**
* 查询*/ * 查询
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产报工单", operType = "查询", operDesc = "查询") @OperationLogAnnotation(operModul = "生产报工单", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
// 仅查询自己所在组的任务 added by songx at 20240820 // 仅查询自己所在组的任务 added by songx at 20240820
List<String> allGroupNames = UserSessionUtils.getAllGroupName(); HgScUtils.HgSc007.setOrgCondition(queryMap);
// 当用户无组的时候,集合中添加一个不存在的组用于查询,如果不加会查询出所有的数据
allGroupNames.add(" ");
queryMap.put("groupNames", allGroupNames);
inInfo = super.query(inInfo, HGSC008.QUERY, new HGSC008()); inInfo = super.query(inInfo, HGSC008.QUERY, new HGSC008());
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.util.EiInfoUtils;
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.service.impl.ServiceEPBase;
import java.util.List;
import java.util.Map;
/**
* 项目管理
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGSC101 extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC001().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HGSC001.QUERY, new HGSC001());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<HGSC001> fSc001s = MapUtils.toDaoEPBases(inInfo, HGSC001.class);
for (HGSC001 fSc001 : fSc001s) {
DaoUtils.update(HGSC001.DELETE, fSc001);
}
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fSc001s.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
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.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.Map;
/**
* 新增修改项目
*
* @author:songx
* @date:2022/7/11,11:08
*/
public class ServiceHGSC101A extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
this.setProjectInfo(inInfo);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 保存
*
* @param inInfo
* @return
*/
public EiInfo save(EiInfo inInfo) {
try {
HGSC001 fSc001 = MapUtils.toDaoEPBase(inInfo, HGSC001.class);
// 数据校验
this.checkData(fSc001);
// 设置基础信息
// 判断是新增还是修改
if (StringUtils.isBlank(fSc001.getProjCode())) {
addData(fSc001);
} else {
modifyData(fSc001);
}
inInfo.setMsg("保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 数据校验
*
* @param fSc001
*/
private void checkData(HGSC001 fSc001) {
AssertUtils.isEmpty(fSc001.getProjName(), "项目名称不能为空!");
}
/**
* 新增数据
*
* @param fSc001
*/
private void addData(HGSC001 fSc001) {
// 校验编号是否存在
fSc001.setProjCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROJ_NUMBER));
DaoUtils.insert(HGSC001.INSERT, fSc001);
}
/**
* 修改数据
*
* @param fSc001
*/
private void modifyData(HGSC001 fSc001) {
Map map = fSc001.toMap();
DaoUtils.update(HgScSqlConstant.HgSc001.UPDATE_FOR_DC, map);
}
/**
* 设置项目信息
*
* @param inInfo
*/
public void setProjectInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String projCode = MapUtils.getString(queryRow, HGSC001.FIELD_proj_code);
if (StringUtils.isBlank(projCode)) {
return;
}
EiBlock resultBlock = new EiBlock(EiConstant.resultBlock);
resultBlock.addRow(HGSCTools.Hgsc001.queryByCode(projCode));
resultBlock.addBlockMeta(new HGSC001().eiMetadata);
inInfo.setBlock(resultBlock);
}
}
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
Generate time : 2024-05-07 17:23:17
Version : 1.0
schema : hggp
tableName : HGSC001
id BIGINT NOT NULL primarykey,
company_code VARCHAR NOT NULL,
company_name VARCHAR NOT NULL,
dep_code VARCHAR,
dep_name VARCHAR,
subcontract_code VARCHAR NOT NULL,
subcontract_name VARCHAR NOT NULL,
genral_contract_code VARCHAR NOT NULL,
genral_contract_name VARCHAR NOT NULL,
party_pm_name VARCHAR,
party_pm_hpone VARCHAR,
contract_name VARCHAR,
contract_work_txt VARCHAR,
proj_code VARCHAR,
proj_name VARCHAR,
proj_type VARCHAR,
proj_status TINYINT,
approval_status TINYINT,
permiss_start_date VARCHAR,
start_date VARCHAR,
end_date VARCHAR,
account_code VARCHAR NOT NULL,
created_by VARCHAR,
created_name VARCHAR,
created_time VARCHAR,
updated_by VARCHAR,
updated_name VARCHAR,
updated_time VARCHAR
-->
<sqlMap namespace="HGSC001"> <sqlMap namespace="HGSC001">
<sql id="condition"> <sql id="condition">
<include refid="HGXSDataAuth.authCondition"/> <include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
<isNotEmpty prepend=" AND " property="id">
id = #id# id = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
...@@ -124,9 +90,8 @@ ...@@ -124,9 +90,8 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC001">
resultClass="com.baosight.hggp.hg.sc.domain.HGSC001"> SELECT
SELECT
id as "id", id as "id",
company_code as "companyCode", <!-- 公司编码 --> company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 --> company_name as "companyName", <!-- 公司名称 -->
...@@ -168,97 +133,10 @@ ...@@ -168,97 +133,10 @@
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC001 WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGSC001 WHERE 1=1
<include refid="condition" /> <include refid="condition"/>
</select> </select>
<!--
<isNotEmpty prepend=" AND " property="id">
id = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
dep_code = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depName">
dep_name = #depName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subcontractCode">
subcontract_code = #subcontractCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="subcontractName">
subcontract_name = #subcontractName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="genralContractCode">
genral_contract_code = #genralContractCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="genralContractName">
genral_contract_name = #genralContractName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyPmName">
party_pm_name = #partyPmName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyPmHpone">
party_pm_hpone = #partyPmHpone#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractName">
contract_name = #contractName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractWorkTxt">
contract_work_txt = #contractWorkTxt#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projType">
proj_type = #projType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projStatus">
proj_status = #projStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
approval_status = #approvalStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="permissStartDate">
permiss_start_date = #permissStartDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="startDate">
start_date = #startDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="endDate">
end_date = #endDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
created_by = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
created_name = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
created_time = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
updated_by = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
updated_name = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
-->
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGSC001 (id, INSERT INTO ${hggpSchema}.HGSC001 (id,
...@@ -411,4 +289,16 @@ ...@@ -411,4 +289,16 @@
<include refid="condition" /> <include refid="condition" />
ORDER BY PROJ_CODE desc ORDER BY PROJ_CODE desc
</select> </select>
<!-- 德诚修改 -->
<update id="updateForDc">
UPDATE ${hggpSchema}.HGSC001
SET
COMPANY_CODE = #companyCode#,
COMPANY_NAME = #companyName#,
PROJ_NAME = #projName#,
<include refid="SqlBase.updateRevise"/>
WHERE PROJ_CODE = #projCode#
</update>
</sqlMap> </sqlMap>
...@@ -2,9 +2,54 @@ ...@@ -2,9 +2,54 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/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="HGSC007"> <sqlMap namespace="HGSC007">
<sql id="column">
id as "id",
mat_id as "matId", <!-- 物料清单ID -->
order_id as "orderId", <!-- 生产计划ID -->
order_detail_id as "orderDetailId", <!-- 生产计划明细ID -->
tech_flow_id as "techFlowId", <!-- 工艺流程ID -->
tech_flow_name as "techFlowName", <!-- 工艺流程名称 -->
invent_process_id as "inventProcessId", <!-- 存货工序ID,对应HGPZ005A.id -->
process_code as "processCode", <!-- 工序编码 -->
process_name as "processName", <!-- 工序名称 -->
process_order as "processOrder", <!-- 加工顺序 -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
task_code as "taskCode", <!-- 任务编码 -->
product_type as "productType", <!-- 产品类型 -->
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
plan_start_date as "planStartDate", <!-- 计划开始日期 -->
plan_end_date as "planEndDate", <!-- 计划结束日期 -->
factory_code as "factoryCode", <!-- 工厂编号 -->
factory_name as "factoryName", <!-- 工厂名称 -->
group_code as "groupCode", <!-- 工作组编号 -->
group_name as "groupName", <!-- 工作组名称 -->
complete_date as "completeDate", <!-- 完工日期 -->
quantity as "quantity", <!-- 数量 -->
finish_quantity as "finishQuantity", <!-- 完工数量 -->
unfinish_quantity as "unfinishQuantity", <!-- 未完工数量 -->
single_weight as "singleWeight", <!-- 单重 -->
total_weight as "totalWeight", <!-- 总重 -->
finish_weight as "finishWeight", <!-- 完工重量 -->
unfinish_weight as "unfinishWeight", <!-- 未完工重量 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime", <!-- 更新时间 -->
LENGTH as "length", <!-- 长 -->
SPEC as "spec" <!-- 规格 -->
</sql>
<sql id="condition"> <sql id="condition">
<include refid="HGXSDataAuth.authCondition"/> <include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
id = #id# id = #id#
</isNotEmpty> </isNotEmpty>
...@@ -133,14 +178,23 @@ ...@@ -133,14 +178,23 @@
</isNotEmpty> </isNotEmpty>
<!-- 移动端请求参数 --> <!-- 移动端请求参数 -->
<isEqual prepend=" AND " property="completeStatus" compareValue="0"> <isEqual prepend=" AND " property="completeStatus" compareValue="0">
ifnull(complete_date,'') = '' trim(ifnull(complete_date,'')) = ''
</isEqual> </isEqual>
<isEqual prepend=" AND " property="completeStatus" compareValue="1"> <isEqual prepend=" AND " property="completeStatus" compareValue="1">
ifnull(complete_date,'') != '' trim(ifnull(complete_date,'')) != ''
</isEqual> </isEqual>
</sql> </sql>
<sql id="customCondition"> <sql id="customCondition">
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCodes">
FACTORY_CODE IN <iterate close=")" open="(" conjunction="," property="factoryCodes">#factoryCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryNames">
FACTORY_NAME IN <iterate close=")" open="(" conjunction="," property="factoryNames">#factoryNames[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCodes"> <isNotEmpty prepend=" AND " property="groupCodes">
GROUP_CODE IN <iterate close=")" open="(" conjunction="," property="groupCodes">#groupCodes[]#</iterate> GROUP_CODE IN <iterate close=")" open="(" conjunction="," property="groupCodes">#groupCodes[]#</iterate>
</isNotEmpty> </isNotEmpty>
...@@ -168,6 +222,7 @@ ...@@ -168,6 +222,7 @@
</isNotEmpty> </isNotEmpty>
</isNotEqual> </isNotEqual>
</sql> </sql>
<sql id="appOrderCondition"> <sql id="appOrderCondition">
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
h.account_code = #accountCode# h.account_code = #accountCode#
...@@ -186,70 +241,31 @@ ...@@ -186,70 +241,31 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <sql id="orderBy">
resultClass="com.baosight.hggp.hg.sc.domain.HGSC007"> <dynamic prepend="ORDER BY">
SELECT <isNotEmpty property="orderBy">
id as "id", $orderBy$
mat_id as "matId", <!-- 物料清单ID --> </isNotEmpty>
order_id as "orderId", <!-- 生产计划ID --> <isEmpty property="orderBy">
order_detail_id as "orderDetailId", <!-- 生产计划明细ID --> id desc, product_type asc, product_name, process_order desc
tech_flow_id as "techFlowId", <!-- 工艺流程ID --> </isEmpty>
tech_flow_name as "techFlowName", <!-- 工艺流程名称 --> </dynamic>
invent_process_id as "inventProcessId", <!-- 存货工序ID,对应HGPZ005A.id --> </sql>
process_code as "processCode", <!-- 工序编码 -->
process_name as "processName", <!-- 工序名称 -->
process_order as "processOrder", <!-- 加工顺序 -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
task_code as "taskCode", <!-- 任务编码 -->
product_type as "productType", <!-- 产品类型 -->
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
plan_start_date as "planStartDate", <!-- 计划开始日期 -->
plan_end_date as "planEndDate", <!-- 计划结束日期 -->
factory_code as "factoryCode", <!-- 工厂编号 -->
factory_name as "factoryName", <!-- 工厂名称 -->
group_code as "groupCode", <!-- 工作组编号 -->
group_name as "groupName", <!-- 工作组名称 -->
complete_date as "completeDate", <!-- 完工日期 -->
quantity as "quantity", <!-- 数量 -->
finish_quantity as "finishQuantity", <!-- 完工数量 -->
unfinish_quantity as "unfinishQuantity", <!-- 未完工数量 -->
single_weight as "singleWeight", <!-- 单重 -->
total_weight as "totalWeight", <!-- 总重 -->
finish_weight as "finishWeight", <!-- 完工重量 -->
unfinish_weight as "unfinishWeight", <!-- 未完工重量 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime", <!-- 更新时间 -->
LENGTH as "length", <!-- 长 -->
SPEC as "spec" <!-- 规格 -->
FROM ${hggpSchema}.HGSC007
WHERE 1=1
<include refid="condition" />
<include refid="customCondition"/>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
id desc, product_type asc, product_name, process_order desc
</isEmpty>
</dynamic>
</select> <select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC007">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGSC007
WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC007 WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGSC007
<include refid="condition" /> WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/> <include refid="customCondition"/>
</select> </select>
...@@ -306,10 +322,9 @@ ...@@ -306,10 +322,9 @@
#createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #spec#, #length#) #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #spec#, #length#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
DELETE FROM ${hggpSchema}.HGSC007 WHERE DELETE FROM ${hggpSchema}.HGSC007 WHERE id = #id#
id = #id# </delete>
</delete>
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGSC007 UPDATE ${hggpSchema}.HGSC007
...@@ -360,8 +375,7 @@ ...@@ -360,8 +375,7 @@
id = #id# id = #id#
</update> </update>
<!-- 行锁 -->
<!-- 行锁 -->
<update id="lock"> <update id="lock">
UPDATE ${hggpSchema}.HGSC007 UPDATE ${hggpSchema}.HGSC007
SET CREATED_TIME = CREATED_TIME SET CREATED_TIME = CREATED_TIME
...@@ -430,6 +444,7 @@ ...@@ -430,6 +444,7 @@
) a ) a
group by a.factoryCode, a.factoryName group by a.factoryCode, a.factoryName
</select> </select>
<!--查询工序日产量--> <!--查询工序日产量-->
<select id="queryWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select select
...@@ -449,6 +464,7 @@ ...@@ -449,6 +464,7 @@
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name
order by h.DEPOSIT_DATE asc order by h.DEPOSIT_DATE asc
</select> </select>
<!--查询工序日产量--> <!--查询工序日产量-->
<select id="queryDayWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryDayWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select select
...@@ -468,6 +484,7 @@ ...@@ -468,6 +484,7 @@
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name
order by h.DEPOSIT_DATE asc order by h.DEPOSIT_DATE asc
</select> </select>
<!--查询工序月产量--> <!--查询工序月产量-->
<select id="queryMonthWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryMonthWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select select
...@@ -487,6 +504,7 @@ ...@@ -487,6 +504,7 @@
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name
order by h.DEPOSIT_DATE asc order by h.DEPOSIT_DATE asc
</select> </select>
<!--项目产量--> <!--项目产量-->
<select id="queryProjCodeWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap"> <select id="queryProjCodeWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select select
......
...@@ -2,9 +2,50 @@ ...@@ -2,9 +2,50 @@
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/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="HGSC008"> <sqlMap namespace="HGSC008">
<sql id="column">
id as "id",
mat_id as "matId", <!-- 物料清单ID -->
task_id as "taskId", <!-- 生产任务ID -->
tech_flow_id as "techFlowId", <!-- 工艺流程ID -->
tech_flow_name as "techFlowName", <!-- 工艺流程名称 -->
invent_process_id as "inventProcessId", <!-- 存货工序ID,对应HGPZ005A.id -->
process_code as "processCode", <!-- 工序编码 -->
process_name as "processName", <!-- 工序名称 -->
process_order as "processOrder", <!-- 加工顺序 -->
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName", <!-- 公司名称 -->
dep_code as "depCode", <!-- 部门编码 -->
dep_name as "depName", <!-- 部门名称 -->
proj_code as "projCode", <!-- 项目编码 -->
proj_name as "projName", <!-- 项目名称 -->
work_code as "workCode", <!-- 报工编码 -->
product_type as "productType", <!-- 产品类型 -->
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
plan_start_date as "planStartDate", <!-- 计划开始日期 -->
plan_end_date as "planEndDate", <!-- 计划结束日期 -->
factory_code as "factoryCode", <!-- 工厂编号 -->
factory_name as "factoryName", <!-- 工厂名称 -->
group_code as "groupCode", <!-- 工作组编号 -->
group_name as "groupName", <!-- 工作组名称 -->
register_date as "registerDate", <!-- 报工日期 -->
quantity as "quantity", <!-- 数量 -->
single_weight as "singleWeight", <!-- 单重 -->
total_weight as "totalWeight", <!-- 总重 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime", <!-- 更新时间 -->
length as "length", <!-- 长 -->
spec as "spec", <!-- 规格 -->
exceed_reason as "exceedReason"
</sql>
<sql id="condition"> <sql id="condition">
<include refid="HGXSDataAuth.authCondition"/> <include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
id = #id# id = #id#
</isNotEmpty> </isNotEmpty>
...@@ -116,6 +157,15 @@ ...@@ -116,6 +157,15 @@
</sql> </sql>
<sql id="customCondition"> <sql id="customCondition">
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCodes">
FACTORY_CODE IN <iterate close=")" open="(" conjunction="," property="factoryCodes">#factoryCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryNames">
FACTORY_NAME IN <iterate close=")" open="(" conjunction="," property="factoryNames">#factoryNames[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCodes"> <isNotEmpty prepend=" AND " property="groupCodes">
GROUP_CODE IN <iterate close=")" open="(" conjunction="," property="groupCodes">#groupCodes[]#</iterate> GROUP_CODE IN <iterate close=")" open="(" conjunction="," property="groupCodes">#groupCodes[]#</iterate>
</isNotEmpty> </isNotEmpty>
...@@ -124,64 +174,31 @@ ...@@ -124,64 +174,31 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC008"> <sql id="orderBy">
SELECT <dynamic prepend="ORDER BY">
id as "id", <isNotEmpty property="orderBy">
mat_id as "matId", <!-- 物料清单ID --> $orderBy$
task_id as "taskId", <!-- 生产任务ID --> </isNotEmpty>
tech_flow_id as "techFlowId", <!-- 工艺流程ID --> <isEmpty property="orderBy">
tech_flow_name as "techFlowName", <!-- 工艺流程名称 --> register_date desc, id desc
invent_process_id as "inventProcessId", <!-- 存货工序ID,对应HGPZ005A.id --> </isEmpty>
process_code as "processCode", <!-- 工序编码 --> </dynamic>
process_name as "processName", <!-- 工序名称 --> </sql>
process_order as "processOrder", <!-- 加工顺序 -->
company_code as "companyCode", <!-- 公司编码 --> <select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC008">
company_name as "companyName", <!-- 公司名称 --> SELECT
dep_code as "depCode", <!-- 部门编码 --> <include refid="column"/>
dep_name as "depName", <!-- 部门名称 --> FROM ${hggpSchema}.HGSC008
proj_code as "projCode", <!-- 项目编码 --> WHERE 1=1
proj_name as "projName", <!-- 项目名称 --> <include refid="condition"/>
work_code as "workCode", <!-- 报工编码 -->
product_type as "productType", <!-- 产品类型 -->
product_code as "productCode", <!-- 产品编号 -->
product_name as "productName", <!-- 产品名称 -->
plan_start_date as "planStartDate", <!-- 计划开始日期 -->
plan_end_date as "planEndDate", <!-- 计划结束日期 -->
factory_code as "factoryCode", <!-- 工厂编号 -->
factory_name as "factoryName", <!-- 工厂名称 -->
group_code as "groupCode", <!-- 工作组编号 -->
group_name as "groupName", <!-- 工作组名称 -->
register_date as "registerDate", <!-- 报工日期 -->
quantity as "quantity", <!-- 数量 -->
single_weight as "singleWeight", <!-- 单重 -->
total_weight as "totalWeight", <!-- 总重 -->
account_code as "accountCode", <!-- 帐套 -->
created_by as "createdBy", <!-- 创建人 -->
created_name as "createdName", <!-- 创建人名称 -->
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime", <!-- 更新时间 -->
length as "length", <!-- 长 -->
spec as "spec", <!-- 规格 -->
exceed_reason as "exceedReason"
FROM ${hggpSchema}.HGSC008
WHERE 1=1
<include refid="condition" />
<include refid="customCondition"/> <include refid="customCondition"/>
<dynamic prepend="ORDER BY"> <include refid="orderBy"/>
<isNotEmpty property="orderBy"> </select>
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
register_date desc, id desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC008 WHERE 1=1 SELECT COUNT(*) FROM ${hggpSchema}.HGSC008
<include refid="condition" /> WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/> <include refid="customCondition"/>
</select> </select>
...@@ -236,10 +253,9 @@ ...@@ -236,10 +253,9 @@
</selectKey> </selectKey>
</insert> </insert>
<delete id="delete"> <delete id="delete">
DELETE FROM ${hggpSchema}.HGSC008 WHERE DELETE FROM ${hggpSchema}.HGSC008 WHERE id = #id#
id = #id# </delete>
</delete>
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGSC008 UPDATE ${hggpSchema}.HGSC008
...@@ -290,4 +306,5 @@ ...@@ -290,4 +306,5 @@
DELETE FROM ${hggpSchema}.HGSC008 WHERE DELETE FROM ${hggpSchema}.HGSC008 WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate> id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</delete> </delete>
</sqlMap> </sqlMap>
...@@ -189,6 +189,7 @@ public class HGSCTools { ...@@ -189,6 +189,7 @@ public class HGSCTools {
} }
public static class Hgsc001 { public static class Hgsc001 {
public static HGSC001 queryByCode(String code) { public static HGSC001 queryByCode(String code) {
AssertUtils.isNull(code, "项目Code不能为空!"); AssertUtils.isNull(code, "项目Code不能为空!");
List<HGSC001> results = DaoBase.getInstance().query(HGSC001.QUERY, new HashMap<String,Object>(){ List<HGSC001> results = DaoBase.getInstance().query(HGSC001.QUERY, new HashMap<String,Object>(){
......
package com.baosight.hggp.hg.sc.util;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.xservices.xs.util.LoginUserDetails;
import org.apache.commons.collections.CollectionUtils;
import java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/8/22,16:15
*/
public class HgScUtils {
/**
*
* @author:songx
* @date:2024/8/22,16:17
*/
public static class HgSc007 {
/**
* 设置组织机构查询条件
*
* @param queryMap
*/
public static void setOrgCondition(Map queryMap) {
// 超级管理员看所有数据
if (LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())) {
return;
}
// 仅查询自己所在组的任务 added by songx at 20240820
List<String> allGroupNames = UserSessionUtils.getAllGroupName();
if (CollectionUtils.isNotEmpty(allGroupNames)) {
queryMap.put("groupNames", allGroupNames);
return;
}
// 如果没有组,则查看所在厂区的任务
List<String> factoryNames = UserSessionUtils.getFactoryName();
if (CollectionUtils.isNotEmpty(factoryNames)) {
queryMap.put("factoryNames", factoryNames);
return;
}
// 如果没有厂区,则查看所在公司的任务
List<String> companyCodes = UserSessionUtils.getCompanyCode();
if (CollectionUtils.isNotEmpty(companyCodes)) {
queryMap.put("companyCodes", companyCodes);
return;
}
// 当用户无组织机构时,抛出异常
throw new PlatException("当前用户未绑定组织机构,无法操作数据,请联系管理员!");
}
}
}
...@@ -6,15 +6,15 @@ import com.baosight.hggp.core.constant.CommonConstant; ...@@ -6,15 +6,15 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sj.domain.HGSJ001; import com.baosight.hggp.hg.sj.domain.HGSJ001;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.sj.domain.HGSJ002A;
import com.baosight.hggp.hg.xs.domain.Company; import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
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.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -25,7 +25,12 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase; ...@@ -25,7 +25,12 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/** /**
* @author LiuYang * @author LiuYang
...@@ -188,4 +193,22 @@ public class ServiceHGSJ001 extends ServiceEPBase { ...@@ -188,4 +193,22 @@ public class ServiceHGSJ001 extends ServiceEPBase {
} }
return strList; return strList;
} }
/**
* 下拉框
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "仓库档案", operType = "查询", operDesc = "下拉框")
public EiInfo queryComboBox(EiInfo inInfo) {
try {
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.PROCESS_CODE_BLOCK_ID);
CommonMethod.initBlock(inInfo, list, EiInfoUtils.getFirstRow(inInfo), false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询工序失败");
}
return inInfo;
}
} }
...@@ -38,14 +38,10 @@ public class HGWD001 extends DaoEPBase { ...@@ -38,14 +38,10 @@ public class HGWD001 extends DaoEPBase {
public static final String FIELD_FILE_ID = "fileId"; /* 文件ID*/ public static final String FIELD_FILE_ID = "fileId"; /* 文件ID*/
public static final String FIELD_FILE_TYPE = "fileType"; /* 文件类型*/ public static final String FIELD_FILE_TYPE = "fileType"; /* 文件类型*/
public static final String FIELD_FILE_NAME = "fileName"; /* 文件名称*/ public static final String FIELD_FILE_NAME = "fileName"; /* 文件名称*/
public static final String FIELD_DOC_ID = "docId"; /* 文件号*/
public static final String FIELD_DOC_NAME = "docName"; /* 文件附件名称*/
public static final String FIELD_DOC_VERSION = "docVersion"; /* 文件版本号*/ public static final String FIELD_DOC_VERSION = "docVersion"; /* 文件版本号*/
public static final String FIELD_STATUS = "status"; /* 状态*/ public static final String FIELD_STATUS = "status"; /* 状态*/
public static final String FIELD_REMARK = "remark"; /* 备注*/ public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_RELEASE_DATE = "releaseDate"; /* 发布时间*/ public static final String FIELD_RELEASE_DATE = "releaseDate"; /* 发布时间*/
public static final String FIELD_PREVIEW_NUM = "previewNum"; /* 预览次数*/
public static final String FIELD_DOWNLOAD_NUM = "downloadNum"; /* 下载次数*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
...@@ -64,14 +60,10 @@ public class HGWD001 extends DaoEPBase { ...@@ -64,14 +60,10 @@ public class HGWD001 extends DaoEPBase {
public static final String COL_FILE_ID = "FILE_ID"; /* 文件ID*/ public static final String COL_FILE_ID = "FILE_ID"; /* 文件ID*/
public static final String COL_FILE_TYPE = "FILE_TYPE"; /* 文件类型*/ public static final String COL_FILE_TYPE = "FILE_TYPE"; /* 文件类型*/
public static final String COL_FILE_NAME = "FILE_NAME"; /* 文件名称*/ public static final String COL_FILE_NAME = "FILE_NAME"; /* 文件名称*/
public static final String COL_DOC_ID = "DOC_ID"; /* 文件号*/
public static final String COL_DOC_NAME = "DOC_NAME"; /* 文件附件名称*/
public static final String COL_DOC_VERSION = "DOC_VERSION"; /* 文件版本号*/ public static final String COL_DOC_VERSION = "DOC_VERSION"; /* 文件版本号*/
public static final String COL_STATUS = "STATUS"; /* 状态*/ public static final String COL_STATUS = "STATUS"; /* 状态*/
public static final String COL_REMARK = "REMARK"; /* 备注*/ public static final String COL_REMARK = "REMARK"; /* 备注*/
public static final String COL_RELEASE_DATE = "RELEASE_DATE"; /* 发布时间*/ public static final String COL_RELEASE_DATE = "RELEASE_DATE"; /* 发布时间*/
public static final String COL_PREVIEW_NUM = "PREVIEW_NUM"; /* 预览次数*/
public static final String COL_DOWNLOAD_NUM = "DOWNLOAD_NUM"; /* 下载次数*/
public static final String QUERY = "HGWD001.query"; public static final String QUERY = "HGWD001.query";
public static final String COUNT = "HGWD001.count"; public static final String COUNT = "HGWD001.count";
...@@ -97,14 +89,10 @@ public class HGWD001 extends DaoEPBase { ...@@ -97,14 +89,10 @@ public class HGWD001 extends DaoEPBase {
private String fileId = " "; /* 文件ID*/ private String fileId = " "; /* 文件ID*/
private String fileType = " "; /* 文件类型*/ private String fileType = " "; /* 文件类型*/
private String fileName = " "; /* 文件名称*/ private String fileName = " "; /* 文件名称*/
private String docId = " "; /* 文件号*/
private String docName = " "; /* 文件附件名称*/
private Integer docVersion = new Integer(0); /* 文件版本号*/ private Integer docVersion = new Integer(0); /* 文件版本号*/
private Integer status = 0; /* 状态*/ private Integer status = 0; /* 状态*/
private String remark = " "; /* 备注*/ private String remark = " "; /* 备注*/
private String releaseDate = " "; /* 发布时间*/ private String releaseDate = " "; /* 发布时间*/
private Integer previewNum = new Integer(0); /* 预览次数*/
private Integer downloadNum = new Integer(0); /* 下载次数*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -181,14 +169,6 @@ public class HGWD001 extends DaoEPBase { ...@@ -181,14 +169,6 @@ public class HGWD001 extends DaoEPBase {
eiColumn.setDescName("文件名称"); eiColumn.setDescName("文件名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_ID);
eiColumn.setDescName("文件号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_NAME);
eiColumn.setDescName("文件附件名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_VERSION); eiColumn = new EiColumn(FIELD_DOC_VERSION);
eiColumn.setDescName("文件版本号"); eiColumn.setDescName("文件版本号");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -205,14 +185,6 @@ public class HGWD001 extends DaoEPBase { ...@@ -205,14 +185,6 @@ public class HGWD001 extends DaoEPBase {
eiColumn.setDescName("发布时间"); eiColumn.setDescName("发布时间");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PREVIEW_NUM);
eiColumn.setDescName("预览次数");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOWNLOAD_NUM);
eiColumn.setDescName("下载次数");
eiMetadata.addMeta(eiColumn);
} }
...@@ -496,38 +468,6 @@ public class HGWD001 extends DaoEPBase { ...@@ -496,38 +468,6 @@ public class HGWD001 extends DaoEPBase {
this.fileName = fileName; this.fileName = fileName;
} }
/** /**
* get the docId - 文件号.
* @return the docId
*/
public String getDocId() {
return this.docId;
}
/**
* set the docId - 文件号.
*
* @param docId - 文件号
*/
public void setDocId(String docId) {
this.docId = docId;
}
/**
* get the docName - 文件附件名称.
* @return the docName
*/
public String getDocName() {
return this.docName;
}
/**
* set the docName - 文件附件名称.
*
* @param docName - 文件附件名称
*/
public void setDocName(String docName) {
this.docName = docName;
}
/**
* get the docVersion - 文件版本号. * get the docVersion - 文件版本号.
* @return the docVersion * @return the docVersion
*/ */
...@@ -592,38 +532,6 @@ public class HGWD001 extends DaoEPBase { ...@@ -592,38 +532,6 @@ public class HGWD001 extends DaoEPBase {
this.releaseDate = releaseDate; this.releaseDate = releaseDate;
} }
/** /**
* get the previewNum - 预览次数.
* @return the previewNum
*/
public Integer getPreviewNum() {
return this.previewNum;
}
/**
* set the previewNum - 预览次数.
*
* @param previewNum - 预览次数
*/
public void setPreviewNum(Integer previewNum) {
this.previewNum = previewNum;
}
/**
* get the downloadNum - 下载次数.
* @return the downloadNum
*/
public Integer getDownloadNum() {
return this.downloadNum;
}
/**
* set the downloadNum - 下载次数.
*
* @param downloadNum - 下载次数
*/
public void setDownloadNum(Integer downloadNum) {
this.downloadNum = downloadNum;
}
/**
* get the value from Map. * get the value from Map.
* *
* @param map - source data map * @param map - source data map
...@@ -648,14 +556,10 @@ public class HGWD001 extends DaoEPBase { ...@@ -648,14 +556,10 @@ public class HGWD001 extends DaoEPBase {
setFileId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_ID)), fileId)); setFileId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_ID)), fileId));
setFileType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_TYPE)), fileType)); setFileType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_TYPE)), fileType));
setFileName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_NAME)), fileName)); setFileName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_NAME)), fileName));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId));
setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName));
setDocVersion(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOC_VERSION)), docVersion)); setDocVersion(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOC_VERSION)), docVersion));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status)); setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark)); setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setReleaseDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RELEASE_DATE)), releaseDate)); setReleaseDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RELEASE_DATE)), releaseDate));
setPreviewNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PREVIEW_NUM)), previewNum));
setDownloadNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOWNLOAD_NUM)), downloadNum));
} }
/** /**
...@@ -682,14 +586,10 @@ public class HGWD001 extends DaoEPBase { ...@@ -682,14 +586,10 @@ public class HGWD001 extends DaoEPBase {
map.put(FIELD_FILE_ID, StringUtils.toString(fileId, eiMetadata.getMeta(FIELD_FILE_ID))); map.put(FIELD_FILE_ID, StringUtils.toString(fileId, eiMetadata.getMeta(FIELD_FILE_ID)));
map.put(FIELD_FILE_TYPE, StringUtils.toString(fileType, eiMetadata.getMeta(FIELD_FILE_TYPE))); map.put(FIELD_FILE_TYPE, StringUtils.toString(fileType, eiMetadata.getMeta(FIELD_FILE_TYPE)));
map.put(FIELD_FILE_NAME, StringUtils.toString(fileName, eiMetadata.getMeta(FIELD_FILE_NAME))); map.put(FIELD_FILE_NAME, StringUtils.toString(fileName, eiMetadata.getMeta(FIELD_FILE_NAME)));
map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID)));
map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME)));
map.put(FIELD_DOC_VERSION, StringUtils.toString(docVersion, eiMetadata.getMeta(FIELD_DOC_VERSION))); map.put(FIELD_DOC_VERSION, StringUtils.toString(docVersion, eiMetadata.getMeta(FIELD_DOC_VERSION)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS))); map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK))); map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_RELEASE_DATE, StringUtils.toString(releaseDate, eiMetadata.getMeta(FIELD_RELEASE_DATE))); map.put(FIELD_RELEASE_DATE, StringUtils.toString(releaseDate, eiMetadata.getMeta(FIELD_RELEASE_DATE)));
map.put(FIELD_PREVIEW_NUM, StringUtils.toString(previewNum, eiMetadata.getMeta(FIELD_PREVIEW_NUM)));
map.put(FIELD_DOWNLOAD_NUM, StringUtils.toString(downloadNum, eiMetadata.getMeta(FIELD_DOWNLOAD_NUM)));
return map; return map;
} }
......
...@@ -7,6 +7,7 @@ import com.baosight.hggp.hg.cw.tools.HGCWTools; ...@@ -7,6 +7,7 @@ import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.wd.constant.HgWdConstant; import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001B; import com.baosight.hggp.hg.wd.domain.HGWD001B;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.tools.HGWDTools; import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
...@@ -54,13 +55,14 @@ public class ServiceHGWD001B extends ServiceBase { ...@@ -54,13 +55,14 @@ public class ServiceHGWD001B extends ServiceBase {
*/ */
public void setFileInfo(EiInfo inInfo) { public void setFileInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String fileId = MapUtils.getString(queryRow, HGWD001.FIELD_FILE_ID); String fileId = MapUtils.getString(queryRow, HGWD002.FIELD_FILE_ID);
if (StringUtils.isBlank(fileId)) { String docId = MapUtils.getString(queryRow, HGWD002.FIELD_DOC_ID);
if (StringUtils.isBlank(fileId) || StringUtils.isBlank(docId)) {
return; return;
} }
EiBlock block = new EiBlock(EiConstant.queryBlock); EiBlock block = new EiBlock(EiConstant.queryBlock);
block.addRow(HGWDTools.HgWd001.get(fileId)); block.addRow(HGWDTools.HgWd002.get(fileId, docId));
block.addBlockMeta(new HGWD001().eiMetadata); block.addBlockMeta(new HGWD002().eiMetadata);
inInfo.setBlock(block); inInfo.setBlock(block);
} }
......
...@@ -6,6 +6,7 @@ import com.baosight.hggp.hg.cw.tools.HGCWTools; ...@@ -6,6 +6,7 @@ import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001B; import com.baosight.hggp.hg.wd.domain.HGWD001B;
import com.baosight.hggp.hg.wd.domain.HGWD001C; import com.baosight.hggp.hg.wd.domain.HGWD001C;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.tools.HGWDTools; import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
...@@ -51,13 +52,14 @@ public class ServiceHGWD001C extends ServiceBase { ...@@ -51,13 +52,14 @@ public class ServiceHGWD001C extends ServiceBase {
*/ */
public void setFileInfo(EiInfo inInfo) { public void setFileInfo(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String fileId = MapUtils.getString(queryRow, HGWD001.FIELD_FILE_ID); String fileId = MapUtils.getString(queryRow, HGWD002.FIELD_FILE_ID);
if (StringUtils.isBlank(fileId)) { String docId = MapUtils.getString(queryRow, HGWD002.FIELD_DOC_ID);
if (StringUtils.isBlank(fileId) || StringUtils.isBlank(docId)) {
return; return;
} }
EiBlock block = new EiBlock(EiConstant.queryBlock); EiBlock block = new EiBlock(EiConstant.queryBlock);
block.addRow(HGWDTools.HgWd001.get(fileId)); block.addRow(HGWDTools.HgWd002.get(fileId, docId));
block.addBlockMeta(new HGWD001().eiMetadata); block.addBlockMeta(new HGWD002().eiMetadata);
inInfo.setBlock(block); inInfo.setBlock(block);
} }
......
...@@ -20,14 +20,10 @@ ...@@ -20,14 +20,10 @@
FILE_ID as "fileId", <!-- 文件ID --> FILE_ID as "fileId", <!-- 文件ID -->
FILE_TYPE as "fileType", <!-- 文件类型 --> FILE_TYPE as "fileType", <!-- 文件类型 -->
FILE_NAME as "fileName", <!-- 文件名称 --> FILE_NAME as "fileName", <!-- 文件名称 -->
DOC_ID as "docId", <!-- 文件号 -->
DOC_NAME as "docName", <!-- 文件附件名称 -->
DOC_VERSION as "docVersion", <!-- 文件版本号 --> DOC_VERSION as "docVersion", <!-- 文件版本号 -->
STATUS as "status", <!-- 状态 --> STATUS as "status", <!-- 状态 -->
REMARK as "remark", <!-- 备注 --> REMARK as "remark", <!-- 备注 -->
RELEASE_DATE as "releaseDate", <!-- 发布时间 --> RELEASE_DATE as "releaseDate" <!-- 发布时间 -->
PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
DOWNLOAD_NUM as "downloadNum" <!-- 下载次数 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -82,12 +78,6 @@ ...@@ -82,12 +78,6 @@
<isNotEmpty prepend=" AND " property="fileName"> <isNotEmpty prepend=" AND " property="fileName">
FILE_NAME LIKE CONCAT('%', #fileName#, '%') FILE_NAME LIKE CONCAT('%', #fileName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docName">
DOC_NAME = #docName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docVersion"> <isNotEmpty prepend=" AND " property="docVersion">
DOC_VERSION = #docVersion# DOC_VERSION = #docVersion#
</isNotEmpty> </isNotEmpty>
...@@ -143,8 +133,6 @@ ...@@ -143,8 +133,6 @@
FILE_ID, <!-- 文件ID --> FILE_ID, <!-- 文件ID -->
FILE_TYPE, <!-- 文件类型 --> FILE_TYPE, <!-- 文件类型 -->
FILE_NAME, <!-- 文件名称 --> FILE_NAME, <!-- 文件名称 -->
DOC_ID, <!-- 文件号 -->
DOC_NAME, <!-- 文件附件名称 -->
DOC_VERSION, <!-- 文件版本号 --> DOC_VERSION, <!-- 文件版本号 -->
STATUS, <!-- 状态 --> STATUS, <!-- 状态 -->
REMARK, <!-- 备注 --> REMARK, <!-- 备注 -->
...@@ -153,7 +141,7 @@ ...@@ -153,7 +141,7 @@
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#,
#fileId#, #fileType#, #fileName#, #fileId#, #fileType#, #fileName#,
#docId#, #docName#, #docVersion#, #status#, #remark#, #releaseDate# #docVersion#, #status#, #remark#, #releaseDate#
<selectKey resultClass="long" keyProperty="id"> <selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD001 SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD001
</selectKey> </selectKey>
...@@ -171,8 +159,6 @@ ...@@ -171,8 +159,6 @@
SET SET
FILE_TYPE = #fileType#, <!-- 文件类型 --> FILE_TYPE = #fileType#, <!-- 文件类型 -->
FILE_NAME = #fileName#, <!-- 文件名称 --> FILE_NAME = #fileName#, <!-- 文件名称 -->
DOC_ID = #docId#, <!-- 文件号 -->
DOC_NAME = #docName#, <!-- 文件附件名称 -->
DOC_VERSION = #docVersion#, <!-- 文件版本号 --> DOC_VERSION = #docVersion#, <!-- 文件版本号 -->
STATUS = #status#, <!-- 状态 --> STATUS = #status#, <!-- 状态 -->
REMARK = #remark#, <!-- 备注 --> REMARK = #remark#, <!-- 备注 -->
...@@ -199,23 +185,4 @@ ...@@ -199,23 +185,4 @@
WHERE ID = #id# WHERE ID = #id#
</update> </update>
<!-- 预览自增 -->
<update id="previewIncr">
UPDATE ${hggpSchema}.HGWD001
SET
PREVIEW_NUM = PREVIEW_NUM + 1,
<include refid="SqlBase.updateRevise"/>
WHERE FILE_ID = #fileId#
</update>
<!-- 下载自增 -->
<update id="downloadIncr">
UPDATE ${hggpSchema}.HGWD001
SET
DOWNLOAD_NUM = DOWNLOAD_NUM + 1,
<include refid="SqlBase.updateRevise"/>
WHERE FILE_ID = #fileId#
</update>
</sqlMap> </sqlMap>
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
<isNotEmpty prepend=" AND " property="fileId"> <isNotEmpty prepend=" AND " property="fileId">
FILE_ID = #fileId# FILE_ID = #fileId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
</sql> </sql>
<sql id="orderBy"> <sql id="orderBy">
......
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
<isNotEmpty prepend=" AND " property="fileId"> <isNotEmpty prepend=" AND " property="fileId">
FILE_ID = #fileId# FILE_ID = #fileId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
</sql> </sql>
<sql id="orderBy"> <sql id="orderBy">
......
...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.dao.DaoUtils; ...@@ -5,6 +5,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant; import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A; import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -59,4 +60,28 @@ public class HGWDTools { ...@@ -59,4 +60,28 @@ public class HGWDTools {
} }
} }
/**
* HGWD002 定义
*
* @author:songx
* @date:2024/8/19,14:57
*/
public static class HgWd002 {
/**
* @param fileId
* @param docId
* @return
*/
public static HGWD002 get(String fileId, String docId) {
AssertUtils.isEmpty(fileId, "文件ID不能为空");
AssertUtils.isEmpty(docId, "附件ID不能为空");
Map queryMap = new HashMap();
queryMap.put(HGWD002.FIELD_FILE_ID, fileId);
queryMap.put(HGWD002.FIELD_DOC_ID, docId);
List<HGWD002> results = DaoBase.getInstance().query(HGWD002.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
}
} }
...@@ -295,9 +295,7 @@ public class HGXSTools { ...@@ -295,9 +295,7 @@ public class HGXSTools {
AssertUtils.isNull(orgId, "组织ID不能为空"); AssertUtils.isNull(orgId, "组织ID不能为空");
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("orgId", orgId); queryMap.put("orgId", orgId);
List<Org> results = DaoBase.getInstance().query(HGSqlConstant.HgXsOrg.QUERY_PARENT, queryMap); return DaoBase.getInstance().query(HGSqlConstant.HgXsOrg.QUERY_PARENT, queryMap);
AssertUtils.isEmpty(results, String.format("组织[%s]不存在父级信息", orgId));
return results;
} }
/** /**
...@@ -440,6 +438,34 @@ public class HGXSTools { ...@@ -440,6 +438,34 @@ public class HGXSTools {
// 去除重复组织机构 // 去除重复组织机构
return childOrgIds.stream().distinct().collect(Collectors.toList()); return childOrgIds.stream().distinct().collect(Collectors.toList());
} }
/**
* 查询父级(包含自身)
*
* @param orgIds
* @return
*/
public static List<Org> queryParent(List<String> orgIds) {
List<Org> results = new ArrayList<>();
List<String> resultIds = new ArrayList<>();
for (String orgId : orgIds) {
// 已经存在不在重复查询
if (resultIds.contains(orgId)) {
continue;
}
// 查询组织子集
List<Org> dbOrgs = XsOrg.queryParent(orgId);
for (Org dbOrg : dbOrgs) {
if (!resultIds.contains(dbOrg.getOrgId())) {
resultIds.add(dbOrg.getOrgId());
results.add(dbOrg);
}
}
}
// 去除重复组织机构
return results.stream().distinct().collect(Collectors.toList());
}
} }
} }
...@@ -10,10 +10,9 @@ spring.mvc.view.prefix=/** ...@@ -10,10 +10,9 @@ spring.mvc.view.prefix=/**
spring.servlet.multipart.max-file-size=1073741824 spring.servlet.multipart.max-file-size=1073741824
spring.servlet.multipart.max-request-size=1073741824 spring.servlet.multipart.max-request-size=1073741824
server.tomcat.max-swallow-size = -1 server.tomcat.max-swallow-size=-1
spring.servlet.multipart.enabled =true spring.servlet.multipart.enabled=true
spring.servlet.multipart.file-size-threshold =0 spring.servlet.multipart.file-size-threshold=0
#\u9879\u76EE\u540D\u79F0 #\u9879\u76EE\u540D\u79F0
componentEname=hggp componentEname=hggp
......
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u02B1\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03BB\uFFFD\uFFFD\uFFFD\uFFFD xservices.job.startupDelay = 60
xservices.job.startupDelay=60
org.quartz.scheduler.instanceName = iPlat4j_Scheduler org.quartz.scheduler.instanceName = iPlat4j_Scheduler
org.quartz.scheduler.instanceId = AUTO org.quartz.scheduler.instanceId = AUTO
...@@ -7,23 +6,20 @@ org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool ...@@ -7,23 +6,20 @@ org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 20 org.quartz.threadPool.threadCount = 20
org.quartz.threadPool.threadPriority = 5 org.quartz.threadPool.threadPriority = 5
org.quartz.jobStore.misfireThreshold = 60000 org.quartz.jobStore.misfireThreshold = 60000
#\uFFFD\u06B4\u6DFD\u02BD
#org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore #org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
#\uFFFD\uFFFD\uFFFD\u077F\u2DFD\u02BD\uFFFD\u05BE\u00FB\uFFFD\uFFFD\uFFFD\u02B1\uFFFD\uFFFD\uFFFD\uFFFD
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.useProperties = false org.quartz.jobStore.useProperties = false
org.quartz.jobStore.dataSource = appDS org.quartz.jobStore.dataSource = appDS
org.quartz.jobStore.tablePrefix = EJ_QRTZ_ org.quartz.jobStore.tablePrefix = EJ_QRTZ_
#\uFFFD\uFFFD\u023A\u0123\u02BD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue #isClustered
org.quartz.jobStore.isClustered = true org.quartz.jobStore.isClustered = true
##JNDI\uFFFD\uFFFD\uFFFD\u00F7\uFFFD\u02BD ##JNDI\u540D\u79F0
#org.quartz.dataSource.appDS.jndiURL=appDS #org.quartz.dataSource.appDS.jndiURL = appDS
#\uFFFD\u02F4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u077F\uFFFD\u05BE\u00FB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u077F\uFFFD\uFFFD\uFFFD\u0635\uFFFD\uFFFD\uFFFD\u03E2 #\u6570\u636E\u5E93\u8FDE\u63A5\u914D\u7F6E\u4FE1\u606F
org.quartz.jobStore.clusterCheckinInterval = 20000 org.quartz.jobStore.clusterCheckinInterval = 20000
org.quartz.dataSource.appDS.driver = com.mysql.cj.jdbc.Driver 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://rm-uf60e9vbmanleydq4.mysql.rds.aliyuncs.com:3306/iplat_hggp?useSSL=false&useUnicode=true&characterEncoding=utf-8
...@@ -34,7 +30,6 @@ org.quartz.dataSource.appDS.user = root ...@@ -34,7 +30,6 @@ org.quartz.dataSource.appDS.user = root
org.quartz.dataSource.appDS.password = Whxz@2019 org.quartz.dataSource.appDS.password = Whxz@2019
org.quartz.dataSource.appDS.maxConnections = 30 org.quartz.dataSource.appDS.maxConnections = 30
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05B1\uFFFD\uFFFD\uFFFD\uFFFD\u05BE\uFFFD\uFFFD\u00BC\uFFFD\uFFFD\uFFFD
org.quartz.plugin.logging.class = com.baosight.xservices.ej.job.quartz.JobLoggingPluginWithPartition org.quartz.plugin.logging.class = com.baosight.xservices.ej.job.quartz.JobLoggingPluginWithPartition
org.quartz.plugin.logging.tablePrefix = EJ_QRTZ_ org.quartz.plugin.logging.tablePrefix = EJ_QRTZ_
......
...@@ -7,28 +7,27 @@ $(function () { ...@@ -7,28 +7,27 @@ $(function () {
pageSize: 20, pageSize: 20,
pageSizes: [20, 50, 70, 100], pageSizes: [20, 50, 70, 100],
}, },
columns: [ columns: [{
{ field: "inventCode",
field: "inventCode", template: function (item) {
template: function (item) { let template = item.inventCode;
let template = item.inventCode; if (item.inventCode) {
if(item.inventCode){ for (let i = 0; i < inventRecordBoxBlockId.length; i++) {
for(let i=0;i<inventRecordBoxBlockId.length;i++){ if (item.inventCode === inventRecordBoxBlockId[i]['valueField']) {
if(item.inventCode === inventRecordBoxBlockId[i]['valueField']){ template = inventRecordBoxBlockId[i]['valueField'];
template = inventRecordBoxBlockId[i]['valueField']; } else {
}else{ template = item.inventCode;
template = item.inventCode;
}
} }
} }
return template; }
}, return template;
editor: function (container, options) { },
let inInfo = new EiInfo(); editor: function (container, options) {
inInfo.set("field", options.field); let inInfo = new EiInfo();
let dataSource = inventRecordBoxBlockId; inInfo.set("field", options.field);
EiCommunicator.send("HGPZ005", "queryInventCodeProdTypeFourBox", inInfo, { let dataSource = inventRecordBoxBlockId;
onSuccess: function (ei) { EiCommunicator.send("HGPZ005", "queryInventCodeProdTypeFourBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("invent_record_box_block_id").getMappedRows(); dataSource = ei.getBlock("invent_record_box_block_id").getMappedRows();
}, },
onFail: function (ei) { onFail: function (ei) {
...@@ -48,24 +47,25 @@ $(function () { ...@@ -48,24 +47,25 @@ $(function () {
template: "[#:valueField#]#:textField#|#:param4Field#", template: "[#:valueField#]#:textField#|#:param4Field#",
filter: "contains" filter: "contains"
}); });
}
},
{
field: "primaryId",
template: function (item) {
item['primaryId'] =$("#inqu_status-0-primaryId").val();
return $("#inqu_status-0-primaryId").val();
}
} }
], }, {
field: "primaryId",
template: function (item) {
item['primaryId'] = $("#inqu_status-0-primaryId").val();
return $("#inqu_status-0-primaryId").val();
}
}],
onRowClick: function (e){
setPurQty();
},
beforeEdit: function (e) { beforeEdit: function (e) {
var status = $("#inqu_status-0-status").val(); var status = $("#inqu_status-0-status").val();
if(status != '0'){ if (status != '0') {
e.preventDefault(); e.preventDefault();
} }
let item = e.model; let item = e.model;
//只有合同生成的不能编辑 //只有合同生成的不能编辑
if(item.source === '0'){ if (item.source === '0') {
//选择收货的指定列不让修改 //选择收货的指定列不让修改
for (let i = 0; i < e.sender.columns.length; i++) { for (let i = 0; i < e.sender.columns.length; i++) {
//指定的列不让修改 //指定的列不让修改
...@@ -147,9 +147,45 @@ $(window).load(function () { ...@@ -147,9 +147,45 @@ $(window).load(function () {
$(".k-grid-add").hide(); $(".k-grid-add").hide();
$(".k-grid-delete").hide(); $(".k-grid-delete").hide();
} }
// 勾选事件
resultCheckClick();
}); });
/**
* 勾选事件
*/
let resultCheckClick = function (){
resultGrid.element.on("click", "input.check-one,input.check-all", function (e) {
let action = $(this).prop("checked");
if (action != true) {
return;
}
setPurQty();
});
}
/**
* 设置采购数量
*/
let setPurQty = function (){
let checkRows = resultGrid.getCheckedRows();
let checkRowIndexs = resultGrid.getCheckedRowsIndex();
for (let rowNo = 0; rowNo < checkRowIndexs.length; rowNo++) {
let index = checkRowIndexs[rowNo];
let purQty = checkRows[rowNo]["purQty"];
let planQty = checkRows[rowNo]["planQty"];
if (isBlank(purQty) || parseFloat(purQty) == 0) {
resultGrid.setCellValue(index, "purQty", planQty);
}
let purWeight = checkRows[rowNo]["purWeight"];
let planWeight = checkRows[rowNo]["planWeight"];
if (isBlank(purWeight) || parseFloat(purWeight) == 0) {
resultGrid.setCellValue(index, "purWeight", planWeight);
}
}
}
/** /**
* 查询 * 查询
*/ */
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<EF:EFInput cname="计划单号" blockId="inqu_status" ename="planNo" row="0" colWidth="3"/> <EF:EFInput cname="计划单号" blockId="inqu_status" ename="planNo" row="0" colWidth="3"/>
<EF:EFSelect cname="状态" blockId="inqu_status" ename="status" row="0" colWidth="3" optionLabel="全部" <EF:EFSelect cname="状态" blockId="inqu_status" ename="status" row="0" colWidth="3" optionLabel="全部"
defultValue=""> defultValue="">
<EF:EFCodeOption codeName="hggp.hgcg.contractStatus" condition="ITEM_CODE IN ('0','2','4','5')"/> <EF:EFCodeOption codeName="hggp.hgcg.contractStatus" condition="ITEM_CODE IN ('0','2','4','5')"/>
</EF:EFSelect> </EF:EFSelect>
</div> </div>
<div class="row"> <div class="row">
...@@ -27,13 +27,13 @@ ...@@ -27,13 +27,13 @@
<EF:EFOptions blockId="sup_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="sup_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFDateSpan startCname="创建时间(从)" endCname="至" blockId="inqu_status" <EF:EFDateSpan startCname="创建时间(从)" endCname="至" blockId="inqu_status"
startName="createdTimeFrom" endName="createdTimeTo" row="0" role="datetime" startName="createdTimeFrom" endName="createdTimeTo" row="0" role="datetime"
format="yyyy-MM-dd HH:mm:ss" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true"> format="yyyy-MM-dd HH:mm:ss" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan> </EF:EFDateSpan>
</div> </div>
<div class="row"> <div class="row">
<EF:EFSelect cname="数据来源" blockId="inqu_status" ename="source" row="0" colWidth="3" optionLabel="全部" <EF:EFSelect cname="数据来源" blockId="inqu_status" ename="source" row="0" colWidth="3" optionLabel="全部"
defultValue=""> defultValue="">
<EF:EFCodeOption codeName="hggp.hpcg.receiveSource"/> <EF:EFCodeOption codeName="hggp.hpcg.receiveSource"/>
</EF:EFSelect> </EF:EFSelect>
</div> </div>
...@@ -47,10 +47,10 @@ ...@@ -47,10 +47,10 @@
<EF:EFCodeOption codeName="hggp.hpcg.receiveSource"/> <EF:EFCodeOption codeName="hggp.hpcg.receiveSource"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="companyCode" cname="公司编码" <EF:EFComboColumn ename="companyCode" cname="公司编码"
columnTemplate="#=companyName#" itemTemplate="#=companyName#" columnTemplate="#=companyName#" itemTemplate="#=companyName#"
textField="companyName" valueField="companyCode" textField="companyName" valueField="companyCode"
maxLength="16" readonly="false" width="100" required="true" maxLength="16" readonly="false" width="100" required="true"
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/> <EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center"/>
...@@ -59,9 +59,9 @@ ...@@ -59,9 +59,9 @@
<EF:EFColumn ename="contractDate" cname="合同日期" width="100" align="center" editType="date" <EF:EFColumn ename="contractDate" 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="contractNo" cname="合同号" enable="false" width="120" align="center"/> <EF:EFColumn ename="contractNo" cname="合同号" enable="false" width="120" align="center"/>
<%-- <EF:EFColumn ename="planNo" cname="计划单号" enable="false" width="120" align="center"/>--%> <%-- <EF:EFColumn ename="planNo" cname="计划单号" enable="false" width="120" align="center"/>--%>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center" defaultValue="0"> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hgcg.contractStatus" condition="ITEM_CODE IN ('0','2','4','5')"/> <EF:EFCodeOption codeName="hggp.hgcg.contractStatus" condition="ITEM_CODE IN ('0','2','4','5')"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="supCode" cname="供应商名称" width="120" align="left" defaultValue="" <EF:EFComboColumn ename="supCode" cname="供应商名称" width="120" align="left" defaultValue=""
filter="contains" required="true"> filter="contains" required="true">
...@@ -69,12 +69,18 @@ ...@@ -69,12 +69,18 @@
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="purUserName" cname="采购员" width="120" align="center" required="true"/> <EF:EFColumn ename="purUserName" cname="采购员" width="120" align="center" required="true"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" enable="false" defaultValue="0"/> <EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" enable="false"
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" enable="false" defaultValue="0"/> defaultValue="0" sumType="page"/>
<EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="120" align="right" format="{0:N3}" defaultValue="0"/> <EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" enable="false"
<EF:EFColumn ename="amount" cname="不含税金额" enable="false" width="80" align="right" format="{0:N3}" defaultValue="0"/> defaultValue="0" sumType="page"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" width="80" align="right" format="{0:N3}" defaultValue="0"/> <EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="120" align="right" format="{0:N3}"
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="80" align="right" format="{0:N3}" defaultValue="0"/> defaultValue="0" sumType="page"/>
<EF:EFColumn ename="amount" cname="不含税金额" enable="false" width="120" align="right" format="{0:C3}"
defaultValue="0" sumType="page"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" width="120" align="right" format="{0:C3}"
defaultValue="0" sumType="page"/>
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="120" align="right" format="{0:C3}"
defaultValue="0" sumType="page"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
......
...@@ -3,7 +3,7 @@ $(function () { ...@@ -3,7 +3,7 @@ $(function () {
"result": { "result": {
pageable: { pageable: {
pageSize: 20, pageSize: 20,
pageSizes: [20, 50, 70, 100], pageSizes: [20, 50, 100, 300],
}, },
columns: [ columns: [
], ],
......
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
role="date" format="yyyy-MM-dd" readonly="true"/> role="date" format="yyyy-MM-dd" readonly="true"/>
<EF:EFInput cname="计划单号" blockId="inqu_status" ename="planNo" row="0" colWidth="3"/> <EF:EFInput cname="计划单号" blockId="inqu_status" ename="planNo" row="0" colWidth="3"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3" <EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue=""> filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/> <EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFDateSpan startCname="创建时间(从)" endCname="至" blockId="inqu_status" <EF:EFDateSpan startCname="创建时间(从)" endCname="至" blockId="inqu_status"
startName="createdTimeFrom" endName="createdTimeTo" row="0" role="datetime" startName="createdTimeFrom" endName="createdTimeTo" row="0" role="datetime"
format="yyyy-MM-dd HH:mm:ss" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true"> format="yyyy-MM-dd HH:mm:ss" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan> </EF:EFDateSpan>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
...@@ -33,21 +33,26 @@ ...@@ -33,21 +33,26 @@
<EF:EFColumn ename="inventCode" cname="存货编码" enable="false" width="100" align="center"/> <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="inventName" cname="存货名称" enable="false" width="100" align="center"/>
<EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/> <EF:EFColumn ename="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" enable="false"/> <EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" enable="false"
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" enable="false"/> sumType="page"/>
<EF:EFColumn ename="price" cname="单价" width="80" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" enable="false"
<EF:EFComboColumn ename="taxRate" cname="税率(%)" enable="true" width="80" align="center" required="true"> sumType="page"/>
<EF:EFCodeOption codeName="hggp.cw.taxPoints" />
</EF:EFComboColumn>
<EF:EFColumn ename="amount" cname="不含税金额" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/> <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="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/> <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="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="thick" cname="厚(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
<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">
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFComboColumn>
<EF:EFColumn ename="amount" cname="不含税金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="120" align="right"
format="{0:C3}" sumType="page"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
......
...@@ -26,33 +26,41 @@ ...@@ -26,33 +26,41 @@
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="inventCode" required="true" cname="存货编号" /> <EF:EFColumn ename="inventCode" required="true" cname="存货编号"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true"/> <EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" required="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="false" <EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="false"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField" blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains" enable="false" > filter="contains" enable="false">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/> <EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" align="center" required="true"/> <EF:EFColumn ename="spec" cname="规格" width="120" align="center" required="true"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" required="true" defaultValue="0"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" required="true" defaultValue="0"/>
<EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="120" align="right" format="{0:N3}" defaultValue="0"/>
<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="80" align="center" required="true">
<EF:EFCodeOption codeName="hggp.cw.taxPoints" />
</EF:EFComboColumn>
<EF:EFColumn ename="amount" cname="不含税金额" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" width="80" align="center" required="true"/> <EF:EFColumn ename="material" cname="材质" width="80" align="center" required="true"/>
<EF:EFColumn ename="unit" 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}" required="true"/> <EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" align="right" format="{0:N3}" required="true"/> <EF:EFColumn ename="thick" cname="厚(MM)" width="80" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" required="true"
defaultValue="0" sumType="page"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" required="true"
defaultValue="0" sumType="page"/>
<EF:EFColumn ename="receiveQty" cname="已收货数量" enable="false" width="120" align="right" format="{0:N3}"
defaultValue="0" sumType="page"/>
<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">
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFComboColumn>
<EF:EFColumn ename="amount" cname="不含税金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
...@@ -60,7 +68,7 @@ ...@@ -60,7 +68,7 @@
<EF:EFColumn ename="companyCode" cname="公司编码" enable="false" width="100" align="center" 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:EFColumn ename="companyName" cname="公司名称" enable="false" width="130" align="center" hidden="true"/>
<EF:EFColumn ename="contractDate" cname="合同日期" enable="false" width="100" align="center" editType="date" <EF:EFColumn ename="contractDate" cname="合同日期" enable="false" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" hidden="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" hidden="true"/>
<EF:EFColumn ename="contractNo" cname="合同号" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="contractNo" cname="合同号" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="planNo" cname="计划单号" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="planNo" cname="计划单号" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="supCode" cname="供应商编号" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="supCode" cname="供应商编号" enable="false" width="120" align="center" hidden="true"/>
......
...@@ -9,46 +9,45 @@ $(function () { ...@@ -9,46 +9,45 @@ $(function () {
pageSize: 20, pageSize: 20,
pageSizes: [20, 50, 70, 100], pageSizes: [20, 50, 70, 100],
}, },
columns: [ columns: [{
{ field: "operator",
field: "operator", title: "操作",
title: "操作", template: function (item) {
template: function (item) { let template = '';
let template = ''; if (!isBlank(item.id)) {
if (!isBlank(item.id)){ template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + 'onclick="showDetail(' + item.id + ', ' + item.status + ', ' + item.source
+ 'onclick="showDetail(' + item.id + ', ' + item.status + ', ' + item.source + ')" >详情</a>'; + ')" >详情</a>';
} }
if (item.status == 0 && item.source == 1) { if (item.status == 0 && item.source == 1) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',2)" >确认收货</a>'; 'onclick="updateStatus(' + item.id + ',2)" >确认收货</a>';
} }
return template; return template;
} }
}, { }, {
field: "companyCode", field: "companyCode",
title: "公司编码", title: "公司编码",
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) { for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']) { if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']) {
return companyCodeBox[i]['companyCode']; return companyCodeBox[i]['companyCode'];
}
} }
return dataItem["companyCode"];
} }
}, return dataItem["companyCode"];
{ }
field: "purUserName", }, {
template: function (dataItem) { field: "purUserName",
for (let i = 0; i < userByCompany.length; i++) { template: function (dataItem) {
let purUserName = dataItem['purUserName']; for (let i = 0; i < userByCompany.length; i++) {
if(purUserName){ let purUserName = dataItem['purUserName'];
if (userByCompany[i]['userName'] === purUserName.userName) { if (purUserName) {
return userByCompany[i]['userName']; if (userByCompany[i]['userName'] === purUserName.userName) {
} return userByCompany[i]['userName'];
} }
} }
}
return dataItem["purUserName"]; return dataItem["purUserName"];
}, },
editor: function (container, options) { editor: function (container, options) {
......
...@@ -64,16 +64,21 @@ ...@@ -64,16 +64,21 @@
<EF:EFCodeOption codeName="hggp.hgcg.receiveStatus"/> <EF:EFCodeOption codeName="hggp.hgcg.receiveStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="supCode" cname="供应商名称" width="120" align="left" defaultValue="" <EF:EFComboColumn ename="supCode" cname="供应商名称" width="120" align="left" defaultValue=""
filter="contains" required="true"> filter="contains" required="true">
<EF:EFOptions blockId="sup_record_block_id" valueField="valueField" textField="textField"/> <EF:EFOptions blockId="sup_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="purUserName" cname="采购员" width="120" align="center" required="true"/> <EF:EFColumn ename="purUserName" cname="采购员" width="120" align="center" required="true"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N3}"/> <EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N3}"
<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}"/> <EF:EFColumn ename="deliverQty" cname="退货数量" enable="false" width="120" align="right" format="{0:N3}"
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/> sumType="page"/>
<EF:EFColumn ename="amount" cname="金额" enable="false" width="80" align="right" format="{0:N3}"/> <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="amount" cname="金额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
format="{0:N3}"/> format="{0:N3}"/>
<EF:EFColumn ename="receiveQty" cname="已收货数量" 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="purQty" 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}"/> <EF:EFColumn ename="purWeight" cname="采购重量" enable="false" width="100" align="right" format="{0:N3}"/>
<EF:EFComboColumn ename="supCode" cname="供应商名称" enable="false" width="120" align="left" defaultValue="" <EF:EFComboColumn ename="supCode" cname="供应商名称" enable="false" width="120" align="left" defaultValue=""
filter="contains"> filter="contains">
...@@ -69,9 +70,12 @@ ...@@ -69,9 +70,12 @@
<EF:EFColumn ename="purUserName" cname="采购员" enable="false" width="100" align="center"/> <EF:EFColumn ename="purUserName" cname="采购员" enable="false" width="100" align="center"/>
<EF:EFColumn ename="price" cname="单价" width="80" align="right" format="{0:N3}" enable="false"/> <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="taxRate" cname="税率(%)" width="80" align="right" format="{0:N3}" enable="false"/>
<EF:EFColumn ename="amount" cname="不含税金额" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="amount" cname="不含税金额" enable="false" width="120" align="right" format="{0:C3}"
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" width="80" align="right" format="{0:N3}"/> sumType="page"/>
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="80" align="right" format="{0:N3}"/> <EF:EFColumn ename="taxAmount" cname="税额" enable="false" width="120" align="right" format="{0:C3}"
sumType="page"/>
<EF:EFColumn ename="taxIncludeAmount" cname="含税金额" enable="false" width="120" align="right"
format="{0:C3}" sumType="page"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/> <EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/> <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="width" cname="宽(MM)" enable="false" width="80" align="right" format="{0:N3}"/>
......
...@@ -82,22 +82,19 @@ $(function () { ...@@ -82,22 +82,19 @@ $(function () {
loadComplete: function (grid) { loadComplete: function (grid) {
// 此grid对象 // 此grid对象
grid.dataSource.bind("change", function (e) { grid.dataSource.bind("change", function (e) {
var item = e.items[0];
//数量发生变化进行计算 //数量发生变化进行计算
if(e.field === "receiveQty"){ if(e.field === "receiveQty"){
if(e.items[0].receiveUnitWeight != null){ calAmount(item)
let receiveWeight = e.items[0].receiveQty * e.items[0].receiveUnitWeight;
resultGrid.setCellValue(e.items[0], 'receiveWeight', receiveWeight);
}
if(e.items[0].price != null){
let amount = e.items[0].receiveQty * e.items[0].price;
resultGrid.setCellValue(e.items[0], 'amount', amount);
}
} }
if(e.field === "price"){ if(e.field === "price"){
if(e.items[0].receiveQty != null){ calAmount(item)
let amount = e.items[0].receiveQty * e.items[0].price; }
resultGrid.setCellValue(e.items[0], 'amount', amount); if(e.field === "receiveWeight"){
} calAmount(item)
}
if(e.field === "calculationMethod"){
calAmount(item)
} }
if (e.field === "inventCode") { if (e.field === "inventCode") {
for (let i = 0; i < inventRecordBoxBlockId.length; i++) { for (let i = 0; i < inventRecordBoxBlockId.length; i++) {
...@@ -165,6 +162,34 @@ $(window).load(function () { ...@@ -165,6 +162,34 @@ $(window).load(function () {
}); });
/** /**
* 计算金额
* @param item
* @param length
* @param width
* @param thick
* @param coefficient
*/
let calAmount = function (item) {
//计算方式为重量乘单价
if(item.calculationMethod == 1){
if(item.receiveWeight && item.price){
// 重量*单价金额
let totalAmount = item.receiveWeight * item.price;
resultGrid.setCellValue(item, 'amount', totalAmount)
}
}else{
if(item.receiveQty && item.price){
if(item.receiveQty && item.price){
// 重量*单价金额
let totalAmount = item.receiveQty * item.price;
resultGrid.setCellValue(item, 'amount', totalAmount)
}
}
}
}
/**
* 查询 * 查询
*/ */
let query = function () { let query = function () {
......
...@@ -25,28 +25,35 @@ ...@@ -25,28 +25,35 @@
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="inventCode" required="true" cname="存货编号" /> <EF:EFColumn ename="inventCode" required="true" cname="存货编号"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" enable="false" readonly="true" required="true"/> <EF:EFColumn ename="inventName" cname="存货名称" width="120" align="center" enable="false" readonly="true"
required="true"/>
<EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="false" <EF:EFComboColumn ename="inventType" cname="存货类型" width="120" align="center" required="false"
blockName="invent_type_box_block_id" textField="textField" valueField="valueField" blockName="invent_type_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true" columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="true"
filter="contains" enable="false" > filter="contains" enable="false">
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/> <EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="specId" cname="规格ID" enable="false" width="100" align="center" hidden="true"/> <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="spec" cname="规格" enable="false" width="120" align="center"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" width="120" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="deliverQty" cname="退货数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="depositQty" cname="入库数量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="receiveWeight" cname="收货重量" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="receiveUnitWeight" cname="收货单重" enable="false" width="120" align="right" format="{0:N3}" hidden="true"/>
<EF:EFColumn ename="price" cname="单价" width="80" align="right" format="{0:N3}" required="true"/>
<EF:EFColumn ename="amount" cname="金额" enable="false" width="80" align="right" format="{0:N3}"/>
<EF:EFColumn ename="material" cname="材质" enable="false" width="80" align="center"/> <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="unit" cname="单位" enable="false" width="80" align="center"/>
<EF:EFColumn ename="length" cname="长(MM)" enable="false" width="80" align="right" format="{0:N3}"/> <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="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="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="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:EFColumn ename="price" cname="单价" width="120" align="right" format="{0:C3}" required="true"/>
<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"> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="hggp.hgcg.receiveStatus"/> <EF:EFCodeOption codeName="hggp.hgcg.receiveStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
......
...@@ -264,11 +264,13 @@ function showDetail(id,whCode,companyCode,status) { ...@@ -264,11 +264,13 @@ function showDetail(id,whCode,companyCode,status) {
JSColorbox.open({ JSColorbox.open({
href: "HGKC008A?methodName=initLoad&inqu_status-0-receiveId=" + id+"&inqu_status-0-whCode="+whCode+"&inqu_status-0-companyCode="+companyCode+"&inqu_status-0-status="+status, href: "HGKC008A?methodName=initLoad&inqu_status-0-receiveId=" + id+"&inqu_status-0-whCode="+whCode+"&inqu_status-0-companyCode="+companyCode+"&inqu_status-0-status="+status,
title: "<div style='text-align: center;'>领料详情</div>", title: "<div style='text-align: center;'>领料详情</div>",
width: "80%", width: "90%",
height: "80%", height: "90%",
}); });
} }
function loadChange(grid,e,field) { function loadChange(grid,e,field) {
var cell_label = field,that = grid; var cell_label = field,that = grid;
// locked 表示是否为固定列 // locked 表示是否为固定列
......
...@@ -142,7 +142,8 @@ $(function (){ ...@@ -142,7 +142,8 @@ $(function (){
}, },
} }
} }
// 选择合同
$("#SELECT_INVENT").on("click", selectInvent);
downKeyUp(); downKeyUp();
}) })
...@@ -217,6 +218,30 @@ let save = function (btnNode) { ...@@ -217,6 +218,30 @@ let save = function (btnNode) {
} }
} }
/**
* 选择
*/
let selectInvent = function () {
JSColorbox.open({
href: "HGKC008B?methodName=initLoad&inqu_status-0-receiveId="+$("#inqu_status-0-receiveId").val()+"&inqu_status-0-companyCode="+$("#inqu_status-0-companyCode").val(),
title: "<div style='text-align: center;'>综合实时库存</div>",
width: "90%",
height: "90%",
callbackName: selectInventCallback
});
}
/**
* 选择回调
*/
let selectInventCallback = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
function loadChange(grid,e,field) { function loadChange(grid,e,field) {
var cell_label = field,that = grid; var cell_label = field,that = grid;
// locked 表示是否为固定列 // locked 表示是否为固定列
......
$(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 invQty = rows[i]['invQty'];
let invWeight = rows[i]['invWeight'];
if (!isPositiveNumber(invQty)) {
message("勾选的第" + (i + 1) + "行库存数量必须大于0");
return;
}
if (!isPositiveNumber(invWeight)) {
message("勾选的第" + (i + 1) + "行库存总重必须大于0");
return;
}
}
JSUtils.confirm("确定对勾选的[" + rows.length + "]条数据生成\"采购收货\"吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC008B", "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-receiveId" cname="领料单id" colWidth="3" type="hidden"/>
<div class="row">
<EF:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货类型" blockId="inqu_status" ename="inventType" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="invent_type_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="存货编号" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="" template="[#=valueField#]#=textField#">
<EF:EFOptions blockId="invent_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</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="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="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>
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
<EF:EFInput blockId="inqu_status" row="0" ename="productName" cname="产品名称" placeholder="模糊查询" colWidth="3"/> <EF:EFInput blockId="inqu_status" row="0" ename="productName" cname="产品名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="createdTime" cname="生产任务日期" role="date" <EF:EFDatePicker blockId="inqu_status" row="0" ename="createdTime" cname="生产任务日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/> format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<%--<EF:EFDatePicker blockId="inqu_status" row="0" ename="complete_date" cname="生产完工日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>--%>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="completeDate" cname="生产完工日期" role="date" <EF:EFDatePicker blockId="inqu_status" row="0" ename="completeDate" cname="生产完工日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/> format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
</div> </div>
...@@ -35,13 +33,12 @@ ...@@ -35,13 +33,12 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/> <EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="120" align="center" readOnly="true"/> <EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="180" align="center" readOnly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="true" width="140" align="center" readOnly="true"/> <EF:EFColumn ename="projName" cname="项目名称" enable="true" width="140" align="center" readOnly="true"/>
<EF:EFColumn ename="createdTime" cname="生产任务日期" width="120" enable="true" readonly="false" align="center" editType="date" <EF:EFColumn ename="createdTime" cname="生产任务日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="taskCode" cname="生产任务单号" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="taskCode" cname="生产任务单号" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productCode" cname="产品编码" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="productCode" cname="产品编码" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productName" cname="产品名称" width="120" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="productName" cname="产品名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="processName" cname="工序" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="processName" cname="工序" width="100" enable="false" readonly="true" align="center"/>
...@@ -55,7 +52,6 @@ ...@@ -55,7 +52,6 @@
<EF:EFColumn ename="quantity" cname="任务数量" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="quantity" cname="任务数量" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="finishQuantity" cname="完工数量" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="finishQuantity" cname="完工数量" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="unfinishQuantity" cname="未完工数量" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="unfinishQuantity" cname="未完工数量" width="100" enable="false" readonly="true" align="center"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/10
Time: 15:29
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html> <!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
...@@ -30,9 +23,9 @@ ...@@ -30,9 +23,9 @@
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/> <EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="120" align="center" readOnly="true"/> <EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="180" align="center" readOnly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="true" width="120" align="center" readOnly="true"/> <EF:EFColumn ename="projName" cname="项目名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="workCode" cname="报工单号" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="workCode" cname="报工单号" width="130" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productCode" cname="产品编码" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="productCode" cname="产品编码" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productName" cname="产品名称" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="productName" cname="产品名称" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="processName" cname="工序" width="100" enable="false" readonly="true" align="center"/> <EF:EFColumn ename="processName" cname="工序" width="100" enable="false" readonly="true" align="center"/>
......
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="modify(\'' + item.projCode + '\')" >修改</a>';
return template;
}
}],
loadComplete: function (grid) {
// 新增
$("#ADD").on("click", add);
//删除
$("#REMOVE").on("click", remove);
},
onAdd: function (e) {
e.preventDefault();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
}
}
$("#QUERY").on("click", query);
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
}
/**
* 新增
*/
let add = function () {
addOrUpdate("");
}
/**
* 修改
*/
let modify = function (projCode) {
let params = "&inqu_status-0-projCode=" + projCode;
addOrUpdate(params);
}
/**
* 新增
*/
let addOrUpdate = function (params) {
JSColorbox.open({
href: "HGSC101A?methodName=initLoad" + params,
title: "<div style='text-align: center;'>" + (isBlank(params) ? "新增项目" : "修改项目") + "</div>",
width: "60%",
height: "70%",
params: params,
callbackName: addOrUpdateCallback
});
}
/**
* 新增成功后回调
*/
let addOrUpdateCallback = function () {
// 刷新列表
query();
// 关闭弹窗
JSColorbox.close();
}
/**
* 删除
*/
let remove = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC101", "remove", true);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<EF:EFPage title="项目管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status-0-companyName" cname="公司名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput ename="inqu_status-0-projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
<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="100" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="false" width="120" align="center"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
<EF:EFColumn ename="updatedBy" cname="修改人姓名" enable="false" width="110" align="center"/>
<EF:EFColumn ename="updatedTime" cname="修改时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFSelect = {
"result-0-companyCode": {
change: function (e) {
setCompanyName(this.value());
}
}
}
// 保存
$("#SAVE").on("click", save);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
});
/**
* 设置公司名称
*/
let setCompanyName = function (companyCode) {
if (isBlank(companyCode)) {
$("#result-0-companyName").val("");
} else {
$("#result-0-companyName").val($("#result-0-companyCode").data("kendoDropDownList").text());
}
}
/**
* 新增
*/
let save = function () {
let msg = checkParams();
if (msg != null) {
message(msg);
return;
}
JSUtils.confirm("确定\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("", "HGSC101A", "save", true,
function (e) {
if (e.getStatus() !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
});
}
/**
* 参数校验
*/
let checkParams = function () {
let projName = $("#result-0-projName").val();
if (isBlank(projName)) {
return "项目名称不能为空";
}
let companyCode = $("#result-0-companyCode").val();
if (isBlank(companyCode)) {
return "请选择公司";
}
return null;
}
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="新增项目">
<EF:EFRegion id="result" title="数据区域">
<EF:EFInput cname="UID" blockId="result" ename="internalCode" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="项目号" blockId="result" ename="projCode" row="0" colWidth="6" ratio="2:10" required="true"
readonly="true"/>
</div>
<div class="row">
<EF:EFSelect cname="公司" blockId="result" ename="companyCode" row="0" colWidth="6" ratio="2:10"
filter="contains">
<EF:EFOption label="请选择" value=""/>
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="公司名称" blockId="result" ename="companyName" row="0" colWidth="6" ratio="2:10"
type="hidden"/>
</div>
<div class="row">
<EF:EFInput cname="项目名称" blockId="result" ename="projName" row="0" colWidth="6" required="true"
ratio="2:10" maxLength="200"/>
</div>
<br/>
<span style="color: red; ">说明:项目号由系统自动生成</span><br>
</EF:EFRegion>
</EF:EFPage>
...@@ -75,17 +75,23 @@ $(function () { ...@@ -75,17 +75,23 @@ $(function () {
grid.dataSource.bind("change", function(e) { grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化 // 判断父级节点是否发生变化
if (e.field === "projCode") { if (e.field === "projCode") {
let item = e.items[0]; let item = e.items[0];
for (let i = 0; i < projCodeBox.length; i++) { for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]["valueField"] === item["projCode"]) { if (projCodeBox[i]["valueField"] === item["projCode"]) {
resultGrid.setCellValue(item, 'projName', projCodeBox[i]["textField"]); resultGrid.setCellValue(item, 'projName', projCodeBox[i]["textField"]);
if (isBlank(item["companyCode"])){ if (isBlank(item["companyCode"])) {
resultGrid.setCellValue(item, 'companyCode', projCodeBox[i]["param1Field"] == "null" ? "" : projCodeBox[i]["param1Field"]); resultGrid.setCellValue(item, 'companyCode',
resultGrid.setCellValue(item, 'companyName', projCodeBox[i]["param2Field"] == "null" ? "" : projCodeBox[i]["param2Field"]); projCodeBox[i]["param1Field"] == "null"
} ? "" : projCodeBox[i]["param1Field"]
break; );
} resultGrid.setCellValue(item, 'companyName',
} projCodeBox[i]["param2Field"] == "null"
? "" : projCodeBox[i]["param2Field"]
);
}
break;
}
}
} }
}); });
}, },
...@@ -177,26 +183,33 @@ let save = function (btnNode) { ...@@ -177,26 +183,33 @@ let save = function (btnNode) {
} }
} }
/**
* 发布
*/
function updateRelease() { function updateRelease() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
let rows = resultGrid.getCheckedRows(); inEiInfo.addBlock(JSUtils.checkedRows2Block("result"))
inEiInfo.addBlock(JSUtils.checkedRows2Block("result")) EiCommunicator.send('HGWD001', 'updateRelease', inEiInfo, {
EiCommunicator.send('HGWD001', 'updateRelease', inEiInfo, { onSuccess(response) {
onSuccess(response) { if (response.status != -1) {
if (response.status != -1){ NotificationUtil(response.msg);
NotificationUtil(response.msg); query();
query(); } else {
}else{ NotificationUtil(response.msg, "error");
NotificationUtil(response.msg, "error"); }
} },
}, onFail(errorMessage, status, e) {
onFail(errorMessage, status, e) { NotificationUtil("执行失败!", "error");
NotificationUtil("执行失败!", "error"); }
} }, {
}, { async: false
async: false }
} );
);
} }
/** /**
...@@ -224,4 +237,4 @@ function showDetail(id,companyCode) { ...@@ -224,4 +237,4 @@ function showDetail(id,companyCode) {
width: "75%", width: "75%",
height: "95%", height: "95%",
}); });
} }
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/9
Time: 15:01
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html> <!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
...@@ -36,35 +29,41 @@ ...@@ -36,35 +29,41 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息"> <EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/> <EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称" <EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center" defaultValue="0">
columnTemplate="#=textField#" itemTemplate="#=textField#" <EF:EFCodeOption codeName="hggp.hgwd.status"/>
textField="textField" valueField="valueField" </EF:EFComboColumn>
maxLength="16" readonly="true" width="160" required="true" <EF:EFComboColumn ename="companyCode" cname="公司名称"
align="center" filter="contains" sort="true"> columnTemplate="#=textField#" itemTemplate="#=textField#"
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/> textField="textField" valueField="valueField"
</EF:EFComboColumn> maxLength="16" readonly="true" width="160" required="true"
<EF:EFColumn ename="projName" cname="所属项目" width="160" enable="true" readonly="true" align="center" required="true"/> align="center" filter="contains" sort="true">
<%--<EF:EFComboColumn ename="projCode" cname="所属项目" blockName="proj_record_block_id" <EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
columnTemplate="#=textField#" itemTemplate="#=textField#" </EF:EFComboColumn>
textField="textField" valueField="valueField" <EF:EFColumn ename="companyName" cname="所属项目" width="160" enable="true" readonly="true" align="center"
maxLength="16" readonly="true" width="200" required="true" required="true" hidden="true"/>
align="center" filter="contains" sort="true" />--%> <EF:EFComboColumn ename="projCode" cname="所属项目" blockName="proj_record_block_id"
<EF:EFComboColumn ename="fileType" cname="文件类型" width="100" align="center" readonly="false" required="true" defaultValue="20"> columnTemplate="#=textField#" itemTemplate="#=textField#"
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/> textField="textField" valueField="valueField"
</EF:EFComboColumn> maxLength="16" readonly="true" width="200" required="true"
<EF:EFColumn ename="fileName" cname="文件名称" width="160" enable="true" readonly="false" align="center" required="true"/> align="center" filter="contains" sort="true"/>
<EF:EFColumn ename="fileId" cname="文件号" width="100" enable="true" readonly="true" align="center" required="false"/> <EF:EFColumn ename="projName" cname="所属项目" width="160" enable="true" readonly="true" align="center"
<EF:EFColumn ename="createdName" cname="创建人" align="center" width="100" readonly="true" required="false" required="true" hidden="true"/>
enable="false"/> <EF:EFComboColumn ename="fileType" cname="文件类型" width="100" align="center" readonly="false" required="true"
<EF:EFColumn ename="createdTime" cname="创建时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime" defaultValue="20">
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false" <EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
enable="false"/> </EF:EFComboColumn>
<EF:EFComboColumn ename="status" cname="状态" width="80" align="center" readonly="false" required="true" defaultValue="0"> <EF:EFColumn ename="fileName" cname="文件名称" width="160" enable="true" readonly="false" align="center"
<EF:EFCodeOption codeName="hggp.hgwd.status"/> required="true"/>
</EF:EFComboColumn> <EF:EFColumn ename="fileId" cname="文件号" width="100" enable="false" readonly="true" align="center"
required="false"/>
<EF:EFColumn ename="createdName" cname="创建人" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn ename="createdTime" cname="创建时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<EF:EFPage title="预览记录"> <EF:EFPage title="预览记录">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput cname="文件ID" ename="fileId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/> <EF:EFInput cname="文件ID" ename="fileId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<EF:EFInput cname="附件ID" ename="docId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<div class="row"> <div class="row">
<EF:EFInput cname="公司名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/> <EF:EFInput cname="公司名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/> <EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
...@@ -23,6 +24,7 @@ ...@@ -23,6 +24,7 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="fileId" cname="文件ID" enable="false" width="100" align="center" hidden="true"/> <EF:EFColumn ename="fileId" cname="文件ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="docId" cname="附件ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="createdName" cname="预览人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdName" cname="预览人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="预览时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="预览时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<EF:EFPage title="下载记录"> <EF:EFPage title="下载记录">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput cname="文件ID" ename="fileId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/> <EF:EFInput cname="文件ID" ename="fileId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<EF:EFInput cname="附件ID" ename="docId" blockId="inqu_status" row="0" colWidth="3" type="hidden"/>
<div class="row"> <div class="row">
<EF:EFInput cname="公司名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/> <EF:EFInput cname="公司名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/> <EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" readonly="true"/>
...@@ -23,6 +24,7 @@ ...@@ -23,6 +24,7 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="内码" hidden="true"/> <EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="fileId" cname="文件ID" enable="false" width="100" align="center" hidden="true"/> <EF:EFColumn ename="fileId" cname="文件ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="docId" cname="附件ID" enable="false" width="100" align="center" hidden="true"/>
<EF:EFColumn ename="createdName" cname="下载人" enable="false" width="100" align="center"/> <EF:EFColumn ename="createdName" cname="下载人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="下载时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="下载时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/> editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
......
...@@ -11,11 +11,12 @@ $(function () { ...@@ -11,11 +11,12 @@ $(function () {
field: "operator", field: "operator",
title: "操作", title: "操作",
template: function (model) { template: function (model) {
let param = "'" + model.fileId + "', '" + model.docId + "'";
let template = ''; let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showQueryRecord(\'' + model.fileId + '\')" >预览记录</a>'; + 'onclick="showQueryRecord(' + param + ')" >预览记录</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDownloadRecord(\'' + model.fileId + '\')" >下载记录</a>'; + 'onclick="showDownloadRecord(' + param + ')" >下载记录</a>';
return template; return template;
} }
}, { }, {
...@@ -59,10 +60,13 @@ let query = function () { ...@@ -59,10 +60,13 @@ let query = function () {
/** /**
* 显示查询记录 * 显示查询记录
*
* @param fileId
* @param docId
*/ */
let showQueryRecord = function (fileId) { let showQueryRecord = function (fileId, docId) {
JSColorbox.open({ JSColorbox.open({
href: "HGWD001B?inqu_status-0-fileId=" + fileId, href: "HGWD001B?inqu_status-0-fileId=" + fileId + "&inqu_status-0-docId=" + docId,
title: "<div style='text-align: center;'>预览记录</div>", title: "<div style='text-align: center;'>预览记录</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
...@@ -71,10 +75,13 @@ let showQueryRecord = function (fileId) { ...@@ -71,10 +75,13 @@ let showQueryRecord = function (fileId) {
/** /**
* 显示下载记录 * 显示下载记录
*
* @param fileId
* @param docId
*/ */
let showDownloadRecord = function (fileId) { let showDownloadRecord = function (fileId, docId) {
JSColorbox.open({ JSColorbox.open({
href: "HGWD001C?inqu_status-0-fileId=" + fileId, href: "HGWD001C?inqu_status-0-fileId=" + fileId + "&inqu_status-0-docId=" + docId,
title: "<div style='text-align: center;'>下载记录</div>", title: "<div style='text-align: center;'>下载记录</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
......
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