Commit 2df80332 by liuyang

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

parents 2ca0a8e7 8559207f
......@@ -92,7 +92,7 @@ public enum DdynamicEnum {
* 用途:存货档案下拉框 (不默认状态)
* 编写:
*/
INVENT_RECORD_BOX_BLOCK_ID("invent_record_box_block_id","inventCode","inventName","inventTypeDetail","id","inventType","spec","material","unit", "length", "width", "thick","COEFFICIENT","HGPZ005.queryInventCodeBox"),
INVENT_RECORD_BOX_BLOCK_ID("invent_record_box_block_id","inventCode","inventName","inventTypeDetail","id","inventType","spec","material","unit", "length", "width", "thick","coefficient","HGPZ005.queryInventCodeBox"),
/**
* 模块:存货档案
......@@ -348,6 +348,12 @@ public enum DdynamicEnum {
* 编写: ly
*/
DELIVERY_CODE_BOX_BLOCK_ID("deliveryCodeBox_block_id","deliveryCode","projName","id","HGYX001.queryReturnCodeBox"),
/**
* 项目下拉框根据权限查
*/
PROJ_RECORD_BY_ROLE_BLOCK_ID("projRecordByRole_block_id","projCode", "projName","companyCode","companyName", "HGSC001.queryProjectByRoleBox"),
;
......
......@@ -10,6 +10,7 @@ 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.constant.HGSqlConstant;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
......@@ -50,9 +51,10 @@ public class ServiceHGCG001 extends ServiceBase {
CommonMethod.distinctTextField(inInfo,DdynamicEnum.INVENT_RECORD_BLOCK_ID.getBlockId());
CommonMethod.objConvertComboBox(resultList,inInfo,DdynamicEnum.SPEC_NAME_BLOCK_ID.getBlockId(),HGCG001.FIELD_SPEC,HGCG001.FIELD_SPEC);
CommonMethod.distinctTextField(inInfo,DdynamicEnum.SPEC_NAME_BLOCK_ID.getBlockId());
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG001().eiMetadata);
} catch (PlatException e) {
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
......
......@@ -11,6 +11,7 @@ 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.constant.HGSqlConstant;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
......@@ -48,6 +49,7 @@ public class ServiceHGCG002 extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
EiInfoUtils.addBlock(inInfo,"userByCompany", UserSessionUtils.getUserByCompany(UserSessionUtils.getAccountCode()), User.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG002().eiMetadata);
} catch (Exception e) {
......
......@@ -11,6 +11,7 @@ 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.sc.domain.HGSC001;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.BeanUtils;
......@@ -51,6 +52,7 @@ public class ServiceHGCG002A extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"userByCompany", UserSessionUtils.getUserByCompany(UserSessionUtils.getAccountCode()), User.class);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG001().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......
......@@ -4,12 +4,14 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.domain.HGCG002A;
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.constant.HGSqlConstant;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
......@@ -46,8 +48,9 @@ public class ServiceHGCG003 extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SUP_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG003().eiMetadata);
} catch (PlatException e) {
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
......
......@@ -32,6 +32,9 @@ public class HGCW007 extends DaoEPBase {
public static final String FIELD_UNIT_PRICE = "unitPrice"; /* 单价*/
public static final String FIELD_DAY_NUMBER = "dayNumber"; /* 天数*/
public static final String FIELD_TOTAL_PRICE = "totalPrice"; /* 总价*/
public static final String FIELD_TAX_AMOUNT = "taxAmount"; /* 税额*/
public static final String FIELD_TOTAL_PRICE_INCLUDING = "totalPriceIncluding"; /* 含税总价*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 记录创建名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 记录创建时间*/
......@@ -51,6 +54,8 @@ public class HGCW007 extends DaoEPBase {
public static final String COL_UNIT_PRICE = "UNIT_PRICE"; /* 单价*/
public static final String COL_DAY_NUMBER = "DAY_NUMBER"; /* 天数*/
public static final String COL_TOTAL_PRICE = "TOTAL_PRICE"; /* 总价*/
public static final String COL_TAX_AMOUNT = "TAX_AMOUNT"; /* 税额*/
public static final String COL_TOTAL_PRICE_INCLUDING = "TOTAL_PRICE_INCLUDING"; /* 含税总价*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 记录创建名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 记录创建时间*/
......@@ -75,6 +80,8 @@ public class HGCW007 extends DaoEPBase {
private BigDecimal unitPrice = new BigDecimal("0"); /* 单价*/
private BigDecimal dayNumber = new BigDecimal("0"); /* 天数*/
private BigDecimal totalPrice = new BigDecimal("0"); /* 总价*/
private BigDecimal taxAmount = new BigDecimal("0"); /* 税额*/
private BigDecimal totalPriceIncluding = new BigDecimal("0"); /* 含税总价*/
private String createdBy = " "; /* 记录创建者*/
private String createdName = " "; /* 记录创建名称*/
private String createdTime = " "; /* 记录创建时间*/
......@@ -142,6 +149,20 @@ public class HGCW007 extends DaoEPBase {
eiColumn.setDescName("总价");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TAX_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("税额");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TOTAL_PRICE_INCLUDING);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("含税总价");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("记录创建者");
eiMetadata.addMeta(eiColumn);
......@@ -470,6 +491,8 @@ public class HGCW007 extends DaoEPBase {
setUnitPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_UNIT_PRICE)), unitPrice));
setDayNumber(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DAY_NUMBER)), dayNumber));
setTotalPrice(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_PRICE)), totalPrice));
setTaxAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TAX_AMOUNT)), taxAmount));
setTotalPriceIncluding(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_PRICE_INCLUDING)), totalPriceIncluding));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
......@@ -496,6 +519,8 @@ public class HGCW007 extends DaoEPBase {
map.put(FIELD_UNIT_PRICE, StringUtils.toString(unitPrice, eiMetadata.getMeta(FIELD_UNIT_PRICE)));
map.put(FIELD_DAY_NUMBER, StringUtils.toString(dayNumber, eiMetadata.getMeta(FIELD_DAY_NUMBER)));
map.put(FIELD_TOTAL_PRICE, StringUtils.toString(totalPrice, eiMetadata.getMeta(FIELD_TOTAL_PRICE)));
map.put(FIELD_TAX_AMOUNT, StringUtils.toString(taxAmount, eiMetadata.getMeta(FIELD_TAX_AMOUNT)));
map.put(FIELD_TOTAL_PRICE_INCLUDING, StringUtils.toString(totalPriceIncluding, eiMetadata.getMeta(FIELD_TOTAL_PRICE_INCLUDING)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
......@@ -506,4 +531,20 @@ public class HGCW007 extends DaoEPBase {
return map;
}
public BigDecimal getTaxAmount() {
return taxAmount;
}
public void setTaxAmount(BigDecimal taxAmount) {
this.taxAmount = taxAmount;
}
public BigDecimal getTotalPriceIncluding() {
return totalPriceIncluding;
}
public void setTotalPriceIncluding(BigDecimal totalPriceIncluding) {
this.totalPriceIncluding = totalPriceIncluding;
}
}
......@@ -35,7 +35,7 @@ public class HGCW051 extends DaoEPBase {
public static final String FIELD_YEAR = "year"; /* 年份*/
public static final String FIELD_MONTH = "month"; /* 月份*/
public static final String FIELD_AMOUNT = "amount"; /* 费用金额*/
public static final String FIELD_ACCOUNT = "account"; /* 企业编码*/
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String COL_ID = "ID";
......@@ -51,7 +51,7 @@ public class HGCW051 extends DaoEPBase {
public static final String COL_YEAR = "YEAR"; /* 年份*/
public static final String COL_MONTH = "MONTH"; /* 月份*/
public static final String COL_AMOUNT = "AMOUNT"; /* 费用金额*/
public static final String COL_ACCOUNT = "ACCOUNT"; /* 企业编码*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String QUERY = "HGCW051.query";
......@@ -73,7 +73,7 @@ public class HGCW051 extends DaoEPBase {
private String year = " "; /* 年份*/
private String month = " "; /* 月份*/
private BigDecimal amount = new BigDecimal("0"); /* 费用金额*/
private String account = " "; /* 企业编码*/
private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
/**
......@@ -138,7 +138,7 @@ public class HGCW051 extends DaoEPBase {
eiColumn.setDescName("费用金额");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
......@@ -368,17 +368,17 @@ public class HGCW051 extends DaoEPBase {
* get the account - 企业编码.
* @return the account
*/
public String getAccount() {
return this.account;
public String getAccountCode() {
return this.accountCode;
}
/**
* set the account - 企业编码.
* set the accountCode - 企业编码.
*
* @param account - 企业编码
* @param accountCode - 企业编码
*/
public void setAccount(String account) {
this.account = account;
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the depCode - 部门编码.
......@@ -417,7 +417,7 @@ public class HGCW051 extends DaoEPBase {
setYear(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_YEAR)), year));
setMonth(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MONTH)), month));
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setAccount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT)), account));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
}
......@@ -441,7 +441,7 @@ public class HGCW051 extends DaoEPBase {
map.put(FIELD_YEAR, StringUtils.toString(year, eiMetadata.getMeta(FIELD_YEAR)));
map.put(FIELD_MONTH, StringUtils.toString(month, eiMetadata.getMeta(FIELD_MONTH)));
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_ACCOUNT, StringUtils.toString(account, eiMetadata.getMeta(FIELD_ACCOUNT)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
return map;
......
......@@ -41,7 +41,7 @@ public class HGCW052 extends DaoEPBase {
public static final String FIELD_ITEM_NAME = "itemName"; /* 项目名称*/
public static final String FIELD_ITEM_CODE = "itemCode"; /* 项目编号*/
public static final String FIELD_IS_SHARE = "isShare"; /* 是否分摊费用*/
public static final String FIELD_ACCOUNT = "account"; /* 企业编码*/
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String COL_ID = "ID";
......@@ -63,7 +63,7 @@ public class HGCW052 extends DaoEPBase {
public static final String COL_ITEM_NAME = "ITEM_NAME"; /* 项目名称*/
public static final String COL_ITEM_CODE = "ITEM_CODE"; /* 项目编号*/
public static final String COL_IS_SHARE = "IS_SHARE"; /* 是否分摊费用*/
public static final String COL_ACCOUNT = "ACCOUNT"; /* 企业编码*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String QUERY = "HGCW052.query";
......@@ -91,7 +91,7 @@ public class HGCW052 extends DaoEPBase {
private String itemName = " "; /* 项目名称*/
private String itemCode = " "; /* 项目编号*/
private String isShare = " "; /* 是否分摊费用*/
private String account = " "; /* 企业编码*/
private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
/**
......@@ -180,7 +180,7 @@ public class HGCW052 extends DaoEPBase {
eiColumn.setDescName("是否分摊费用");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
......@@ -506,8 +506,8 @@ public class HGCW052 extends DaoEPBase {
* get the account - 企业编码.
* @return the account
*/
public String getAccount() {
return this.account;
public String getAccountCode() {
return this.accountCode;
}
/**
......@@ -515,8 +515,8 @@ public class HGCW052 extends DaoEPBase {
*
* @param account - 企业编码
*/
public void setAccount(String account) {
this.account = account;
public void setAccountCode(String account) {
this.accountCode = account;
}
/**
* get the depCode - 部门编码.
......@@ -561,7 +561,7 @@ public class HGCW052 extends DaoEPBase {
setItemName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ITEM_NAME)), itemName));
setItemCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ITEM_CODE)), itemCode));
setIsShare(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_IS_SHARE)), isShare));
setAccount(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT)), account));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
}
......@@ -591,7 +591,7 @@ public class HGCW052 extends DaoEPBase {
map.put(FIELD_ITEM_NAME, StringUtils.toString(itemName, eiMetadata.getMeta(FIELD_ITEM_NAME)));
map.put(FIELD_ITEM_CODE, StringUtils.toString(itemCode, eiMetadata.getMeta(FIELD_ITEM_CODE)));
map.put(FIELD_IS_SHARE, StringUtils.toString(isShare, eiMetadata.getMeta(FIELD_IS_SHARE)));
map.put(FIELD_ACCOUNT, StringUtils.toString(account, eiMetadata.getMeta(FIELD_ACCOUNT)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
return map;
......
......@@ -12,6 +12,8 @@ import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.CommonMethod;
......@@ -100,28 +102,33 @@ public class ServiceHGCW002 extends ServiceBase {
if (CollectionUtils.isNotEmpty(resultRows)) {
HGCW002 HGCW002 = new HGCW002();
HGCW002.fromMap(resultRows.get(0));
//获取项目所属公司
String projCode = HGCW002.getProjCode();
HGSC001 HGSC001 = HGSCTools.Hgsc001.queryByCode(projCode);
if (HGSC001 != null) {
HGCW002.setCompanyCode(HGSC001.getCompanyCode());
HGCW002.setCompanyName(HGSC001.getCompanyName());
} else {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!项目编码:[" + projCode + "]未找到对应的项目信息!");
}
HGCW002.setPlanStartDate(DateUtils.formatShort(HGCW002.getPlanStartDate()));
HGCW002.setPlanEndDate(DateUtils.formatShort(HGCW002.getPlanEndDate()));
HGCW002.setSigningDate(DateUtils.formatShort(HGCW002.getSigningDate()));
if (HGCW002.getId() == null || HGCW002.getId() == 0) {
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
String contractNumber =userVO.getUsercode() +
String contractNumber =HGCW002.getCompanyCode() +
HGCW002.getContractType() +
SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_CONTRACT_NO);
HGCW002.setCompanyCode(userVO.getUsercode());
HGCW002.setCompanyName(userVO.getUsername());
HGCW002.setContractNumber(contractNumber);
HGCW002.setReviewStatus(0);
HGCW002.setBalanceStatus(1);
HGCW002.setPlanStartDate(DateUtils.formatShort(HGCW002.getPlanStartDate()));
HGCW002.setPlanEndDate(DateUtils.formatShort(HGCW002.getPlanEndDate()));
HGCW002.setSigningDate(DateUtils.formatShort(HGCW002.getSigningDate()));
this.add(HGCW002);
// 写入其他数据
HGCWTools.HgCw003.save(detail1Rows,contractNumber,userVO);
HGCWTools.HgCw003.save(detail1Rows,contractNumber,HGCW002);
HGCWTools.HgCw999.batchUpdate(detail2Rows,HGCW002.getId());
} else {
HGCW002.setPlanStartDate(DateUtils.formatShort(HGCW002.getPlanStartDate()));
HGCW002.setPlanEndDate(DateUtils.formatShort(HGCW002.getPlanEndDate()));
HGCW002.setSigningDate(DateUtils.formatShort(HGCW002.getSigningDate()));
BigDecimal totalContractPriceExcluding = new BigDecimal(0);
BigDecimal totalContractPriceIncluding = new BigDecimal(0);
BigDecimal valueAddedTax = new BigDecimal(0);
......@@ -244,6 +251,10 @@ public class ServiceHGCW002 extends ServiceBase {
}
map.put("contractTyps", contractTypArray);
}
//增加根据当前登录人所属公司进行过滤
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
map.put("companyCode", userVO.getUsercode());
List<HGCW002> HGCW002List = dao.query("HGCW002.queryProjectComboBox", map);
inInfo.addBlock("projcet_combo_box").setRows(HGCW002List);
return inInfo;
......
......@@ -96,9 +96,9 @@ public class ServiceHGCW003 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW003.setCompanyCode(userVO.getUsercode());
HGCW003.setCompanyName(userVO.getUsername());
// UserVO userVO = HGCWTools.HgCw002.getUserCompany();
// HGCW003.setCompanyCode(userVO.getUsercode());
// HGCW003.setCompanyName(userVO.getUsername());
contractNumber = HGCW003.getContractNumber();
if (HGCW003.getId() == null || HGCW003.getId() == 0) {
this.add(HGCW003);
......
......@@ -12,6 +12,8 @@ import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sb.domain.HGSB003;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.CommonMethod;
......@@ -100,10 +102,16 @@ public class ServiceHGCW004 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HGCW004 HGCW004 = new HGCW004();
HGCW004.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW004.setCompanyCode(userVO.getUsercode());
HGCW004.setCompanyName(userVO.getUsername());
HGCW004.setContractName(userVO.getUsername());
//获取项目所属公司
String projCode = HGCW004.getProjCode();
HGSC001 HGSC001 = HGSCTools.Hgsc001.queryByCode(projCode);
if (HGSC001 != null) {
HGCW004.setCompanyCode(HGSC001.getCompanyCode());
HGCW004.setCompanyName(HGSC001.getCompanyName());
} else {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!项目编码:[" + projCode + "]未找到对应的项目信息!");
}
if (HGCW004.getId() == null || HGCW004.getId() == 0) {
this.add(HGCW004);
} else {
......
......@@ -10,6 +10,8 @@ import com.baosight.hggp.hg.cw.domain.HGCW005;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.CommonMethod;
......@@ -99,10 +101,16 @@ public class ServiceHGCW005 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HGCW005 HGCW005 = new HGCW005();
HGCW005.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW005.setCompanyCode(userVO.getUsercode());
HGCW005.setCompanyName(userVO.getUsername());
HGCW005.setContractName(userVO.getUsername());
//获取项目所属公司
String projCode = HGCW005.getProjCode();
HGSC001 HGSC001 = HGSCTools.Hgsc001.queryByCode(projCode);
if (HGSC001 != null) {
HGCW005.setCompanyCode(HGSC001.getCompanyCode());
HGCW005.setCompanyName(HGSC001.getCompanyName());
} else {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!项目编码:[" + projCode + "]未找到对应的项目信息!");
}
if (HGCW005.getId() == null || HGCW005.getId() == 0) {
this.add(HGCW005);
} else {
......
......@@ -9,6 +9,8 @@ import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.domain.HGCW007;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils;
......@@ -83,28 +85,33 @@ public class ServiceHGCW006 extends ServiceBase {
if (CollectionUtils.isNotEmpty(resultRows)) {
HGCW006 HGCW006 = new HGCW006();
HGCW006.fromMap(resultRows.get(0));
//获取项目所属公司
String projCode = HGCW006.getProjCode();
HGSC001 HGSC001 = HGSCTools.Hgsc001.queryByCode(projCode);
if (HGSC001 != null) {
HGCW006.setCompanyCode(HGSC001.getCompanyCode());
HGCW006.setCompanyName(HGSC001.getCompanyName());
} else {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!项目编码:[" + projCode + "]未找到对应的项目信息!");
}
HGCW006.setLeaseStartDate(DateUtils.formatShort(HGCW006.getLeaseStartDate()));
HGCW006.setLeaseEndDate(DateUtils.formatShort(HGCW006.getLeaseEndDate()));
HGCW006.setSigningDate(DateUtils.formatShort(HGCW006.getSigningDate()));
if (HGCW006.getId() == null || HGCW006.getId() == 0) {
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
String contractNumber =userVO.getUsercode() +
String contractNumber =HGCW006.getCompanyCode() +
"5" +
SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_CONTRACT_NO);
HGCW006.setCompanyCode(userVO.getUsercode());
HGCW006.setCompanyName(userVO.getUsername());
HGCW006.setContractNumber(contractNumber);
HGCW006.setReviewStatus(0);
HGCW006.setLeaseStartDate(DateUtils.formatShort(HGCW006.getLeaseStartDate()));
HGCW006.setLeaseEndDate(DateUtils.formatShort(HGCW006.getLeaseEndDate()));
HGCW006.setSigningDate(DateUtils.formatShort(HGCW006.getSigningDate()));
this.add(HGCW006);
// 写入其他数据
HGCWTools.HgCw007.save(detail1Rows,contractNumber,userVO);
HGCWTools.HgCw007.save(detail1Rows,contractNumber,HGCW006);
HGCWTools.HgCw999.batchUpdate(detail2Rows,HGCW006.getId());
} else {
HGCW006.setLeaseStartDate(DateUtils.formatShort(HGCW006.getLeaseStartDate()));
HGCW006.setLeaseEndDate(DateUtils.formatShort(HGCW006.getLeaseEndDate()));
HGCW006.setSigningDate(DateUtils.formatShort(HGCW006.getSigningDate()));
BigDecimal totalContractPriceExcluding = new BigDecimal(0);
BigDecimal totalContractPriceIncluding = new BigDecimal(0);
BigDecimal valueAddedTax = new BigDecimal(0);
......
......@@ -73,9 +73,6 @@ public class ServiceHGCW007 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HGCW007 HGCW007 = new HGCW007();
HGCW007.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW007.setCompanyCode(userVO.getUsercode());
HGCW007.setCompanyName(userVO.getUsername());
contractNumber = HGCW007.getContractNumber();
if (HGCW007.getId() == null || HGCW007.getId() == 0) {
this.add(HGCW007);
......
......@@ -56,6 +56,12 @@
<isNotEmpty prepend=" AND " property="totalPrice">
TOTAL_PRICE = #totalPrice#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taxAmount">
TAX_AMOUNT = #taxAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="totalPriceIncluding">
TOTAL_PRICE_INCLUDING = #totalPriceIncluding#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
......@@ -95,6 +101,8 @@
UNIT_PRICE as "unitPrice", <!-- 单价 -->
DAY_NUMBER as "dayNumber", <!-- 天数 -->
TOTAL_PRICE as "totalPrice", <!-- 总价 -->
TAX_AMOUNT as "taxAmount",
TOTAL_PRICE_INCLUDING as "totalPriceIncluding",
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
......@@ -185,6 +193,8 @@
UNIT_PRICE, <!-- 单价 -->
DAY_NUMBER, <!-- 天数 -->
TOTAL_PRICE, <!-- 总价 -->
TAX_AMOUNT,
TOTAL_PRICE_INCLUDING,
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
......@@ -193,7 +203,7 @@
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #contractNumber#, #deviceName#, #deviceNumber#, #unitPrice#, #dayNumber#, #totalPrice#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #contractNumber#, #deviceName#, #deviceNumber#, #unitPrice#, #dayNumber#, #totalPrice#, #taxAmount#, #totalPriceIncluding#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
</insert>
<delete id="delete">
......@@ -213,6 +223,8 @@
UNIT_PRICE = #unitPrice#, <!-- 单价 -->
DAY_NUMBER = #dayNumber#, <!-- 天数 -->
TOTAL_PRICE = #totalPrice#, <!-- 总价 -->
TAX_AMOUNT = #taxAmount#
TOTAL_PRICE_INCLUDING = #totalPriceIncluding#,
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
......
......@@ -70,7 +70,7 @@
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
COMPANY_NAME like ('%$companyName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="settlementNumber">
SETTLEMENT_NUMBER = #settlementNumber#
......@@ -79,7 +79,7 @@
BILL_TYBE = #billTybe#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="billNumber">
BILL_NUMBER = #billNumber#
BILL_NUMBER like ('%$billNumber$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="billState">
BILL_STATE = #billState#
......@@ -88,7 +88,7 @@
SIGNING_DATE = #signingDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
PARTY_A like ('%$partyA$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
......@@ -135,6 +135,15 @@
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="hiddenConditions">
REMAINING_AMOUNT > 0
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateFrom">
SIGNING_DATE &gt;= REPLACE(#signingDateFrom#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateTo">
SIGNING_DATE &lt;= REPLACE(#signingDateTo#, '-', '')
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......
......@@ -62,8 +62,8 @@
<isNotEmpty prepend=" AND " property="amount">
AMOUNT = #amount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="account">
ACCOUNT = #account#
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
......@@ -159,10 +159,10 @@
YEAR, <!-- 年份 -->
MONTH, <!-- 月份 -->
AMOUNT, <!-- 费用金额 -->
ACCOUNT, <!-- 企业编码 -->
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #year#, #month#, #amount#, #account#, #depCode#)
VALUES (#id#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #year#, #month#, #amount#, #accountCode#, #depCode#)
</insert>
<delete id="delete">
......@@ -185,7 +185,7 @@
YEAR = #year#, <!-- 年份 -->
MONTH = #month#, <!-- 月份 -->
AMOUNT = #amount#, <!-- 费用金额 -->
ACCOUNT = #account#, <!-- 企业编码 -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
WHERE
ID = #id#
......
......@@ -86,8 +86,8 @@
<isNotEmpty prepend=" AND " property="isShare">
IS_SHARE = #isShare#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="account">
ACCOUNT = #account#
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
......@@ -116,7 +116,7 @@
ITEM_NAME as "itemName", <!-- 项目名称 -->
ITEM_CODE as "itemCode", <!-- 项目编号 -->
IS_SHARE as "isShare", <!-- 是否分摊费用 -->
ACCOUNT as "account", <!-- 企业编码 -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM ${hggpSchema}.HGCW052 WHERE 1=1
<include refid="condition" />
......@@ -239,10 +239,10 @@
ITEM_NAME, <!-- 项目名称 -->
ITEM_CODE, <!-- 项目编号 -->
IS_SHARE, <!-- 是否分摊费用 -->
ACCOUNT, <!-- 企业编码 -->
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #year#, #month#, #amount#, #hgcw051Id#, #costType#, #costItem#, #itemName#, #itemCode#, #isShare#, #account#, #depCode#)
VALUES (#id#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #year#, #month#, #amount#, #hgcw051Id#, #costType#, #costItem#, #itemName#, #itemCode#, #isShare#, #accountCode#, #depCode#)
</insert>
<delete id="delete">
......@@ -271,7 +271,7 @@
ITEM_NAME = #itemName#, <!-- 项目名称 -->
ITEM_CODE = #itemCode#, <!-- 项目编号 -->
IS_SHARE = #isShare#, <!-- 是否分摊费用 -->
ACCOUNT = #account#, <!-- 企业编码 -->
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
WHERE
ID = #id#
......
......@@ -102,13 +102,13 @@ public class HGCWTools {
}
public static class HgCw003{
public static void save(List<Map> rows, String contractNumber, UserVO userVO) {
public static void save(List<Map> rows, String contractNumber, HGCW002 HGCW002) {
AssertUtils.isNull(contractNumber, "合同号不能为空!");
rows.forEach(row -> {
HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(row);
HGCW003.setCompanyCode(userVO.getUsercode());
HGCW003.setCompanyName(userVO.getUsername());
HGCW003.setCompanyCode(HGCW002.getCompanyCode());
HGCW003.setCompanyName(HGCW002.getCompanyName());
HGCW003.setContractNumber(contractNumber);
DaoUtils.insert(HGCW003.INSERT, HGCW003);
});
......@@ -140,13 +140,13 @@ public class HGCWTools {
}
public static class HgCw007 {
public static void save(List<Map> rows, String contractNumber, UserVO userVO) {
public static void save(List<Map> rows, String contractNumber, HGCW006 HGCW006) {
AssertUtils.isNull(contractNumber, "合同号不能为空!");
rows.forEach(row -> {
HGCW007 hgcw007 = new HGCW007();
hgcw007.fromMap(row);
hgcw007.setCompanyCode(userVO.getUsercode());
hgcw007.setCompanyName(userVO.getUsername());
hgcw007.setCompanyCode(HGCW006.getCompanyCode());
hgcw007.setCompanyName(HGCW006.getCompanyName());
hgcw007.setContractNumber(contractNumber);
DaoUtils.insert(HGCW007.INSERT, hgcw007);
});
......
......@@ -4,12 +4,14 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC001;
import com.baosight.hggp.hg.kc.domain.HGKC003;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -43,8 +45,9 @@ public class ServiceHGKC001 extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC001().eiMetadata);
} catch (PlatException e) {
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
......
......@@ -14,6 +14,7 @@ import com.baosight.hggp.hg.kc.domain.HGKC006;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -50,8 +51,9 @@ public class ServiceHGKC006 extends ServiceBase {
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.WH_RECORD_BLOCK_ID),map,false
);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC006().eiMetadata);
} catch (PlatException e) {
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
......
......@@ -15,6 +15,7 @@ import com.baosight.hggp.hg.kc.domain.HGKC007;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.utils.HGUtils;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -54,8 +55,9 @@ public class ServiceHGKC007 extends ServiceBase {
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.WH_RECORD_BLOCK_ID),map,false
);
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC007().eiMetadata);
} catch (PlatException e) {
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
......
......@@ -8,6 +8,7 @@ import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ007;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
......@@ -46,8 +47,9 @@ public class ServiceHGKC010 extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC010().eiMetadata);
} catch (PlatException e) {
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
......
......@@ -54,6 +54,7 @@ public class HGPZ007 extends DaoEPBase {
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
public static final String QUERY = "HGPZ007.query";
public static final String QUERY_NOT_BY_ROLE = "HGPZ007.queryNotByRole";
public static final String COUNT = "HGPZ007.count";
public static final String INSERT = "HGPZ007.insert";
public static final String UPDATE = "HGPZ007.update";
......
......@@ -126,6 +126,37 @@
<include refid="condition" />
</select>
<select id="queryNotByRole" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.pz.domain.HGPZ007">
SELECT
ID as "id", <!-- 主键ID -->
ACCOUNT_CODE as "accountCode", <!-- 帐套编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
WH_TYPE as "whType", <!-- 仓库类型 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
PRINC as "princ", <!-- 负责人 -->
STATUS as "status", <!-- 状态 0停用 1启用 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 -->
FROM ${hggpSchema}.HGPZ007 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......
......@@ -154,7 +154,7 @@ public class HGPZTools {
AssertUtils.isEmpty(whCode, "仓库编码不能为空");
Map queryMap = new HashMap();
queryMap.put("whCode", whCode);
List<HGPZ007> results = DaoBase.getInstance().query(HGPZ007.QUERY, queryMap);
List<HGPZ007> results = DaoBase.getInstance().query(HGPZ007.QUERY_NOT_BY_ROLE, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
......
......@@ -32,7 +32,7 @@ public class ServiceHGSC003 extends ServiceBase {
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID),map,false
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BY_ROLE_BLOCK_ID),map,false
);
} catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败");
......@@ -43,11 +43,6 @@ public class ServiceHGSC003 extends ServiceBase {
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC003.QUERY, new HGSC003());
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID),map,false
);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......@@ -178,7 +173,7 @@ public class ServiceHGSC003 extends ServiceBase {
map.put(HGSC001.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC001.FIELD_company_code, companyCode);
map.put(HGSC001.FIELD_approval_status, approvalStatus);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), map,false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BY_ROLE_BLOCK_ID), map,false);
return inInfo;
}
......@@ -192,10 +187,12 @@ public class ServiceHGSC003 extends ServiceBase {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String companyCode = MapUtils.getString(queryMap, HGSC003.FIELD_company_code);
String blueprintStatus = MapUtils.getString(queryMap, HGSC003.FIELD_blueprint_status);
String projCode = MapUtils.getString(queryMap, HGSC003.FIELD_proj_code);
Map map = new HashMap();
map.put(HGSC003.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC003.FIELD_company_code, companyCode);
map.put(HGSC003.FIELD_blueprint_status, blueprintStatus);
map.put(HGSC003.FIELD_proj_code, projCode);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.BLUEPRINT_BOX_BLOCK_ID), map,false);
return inInfo;
......
......@@ -8,6 +8,8 @@ import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC003;
import com.baosight.hggp.hg.sc.domain.HGSC004;
import com.baosight.hggp.hg.sc.domain.HGSC004A;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -28,13 +30,14 @@ public class ServiceHGSC004 extends ServiceBase {
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004.QUERY, new HGSC004());
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
Map map = new HashMap();
map.put(HGSC004.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC003.FIELD_blueprint_status, HGConstant.EnablingStatus.QY);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.BLUEPRINT_BOX_BLOCK_ID),map,false
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BY_ROLE_BLOCK_ID,DdynamicEnum.BLUEPRINT_BOX_BLOCK_ID),map,false
);
} catch (PlatException e) {
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
......@@ -43,12 +46,6 @@ public class ServiceHGSC004 extends ServiceBase {
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGSC004.QUERY, new HGSC004());
Map map = new HashMap();
map.put(HGSC004.FIELD_account_code, UserSessionUtils.getAccountCode());
map.put(HGSC003.FIELD_blueprint_status, HGConstant.EnablingStatus.QY);
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID,DdynamicEnum.BLUEPRINT_BOX_BLOCK_ID),map,false
);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......@@ -96,9 +93,9 @@ public class ServiceHGSC004 extends ServiceBase {
Map resultMap = EiInfoUtils.getFirstRow(inInfo,EiConstant.resultBlock);
HGSC004 hgsc004 = new HGSC004();
hgsc004.fromMap(resultMap);
HGSC003 hgsc003 = (HGSC003) super.dao.get(HGSC003.QUERY,HGSC004.FIELD_blueprint_code,hgsc004.getBlueprintCode());
hgsc004.setBlueprintId(hgsc003.getId());
HGSC003 hgsc003 = HGSCTools.Hgsc003.getByBlueprintCode(hgsc004.getBlueprintCode());
this.checkSaveData(hgsc004,hgsc003);
hgsc004.setBlueprintId(hgsc003.getId());
if(Objects.nonNull(hgsc004.getId())&&hgsc004.getId()!=0){
DaoUtils.update(HGSC004.UPDATE, hgsc004);
//变更清单里面的公司、项目信息
......@@ -139,6 +136,7 @@ public class ServiceHGSC004 extends ServiceBase {
AssertUtils.isTrue(hgsc004.getMaterialStatus().compareTo(HGConstant.MaterialStatus.WTJ) > 0,"非未提交不可修改!");
AssertUtils.isTrue(hgsc003.getBlueprintStatus().compareTo(HGConstant.EnablingStatus.TY) == 0,"蓝图已停用不可修改!");
}
AssertUtils.isTrue(Objects.isNull(hgsc003),"未获取到蓝图信息!");
Map<String,Object> map = new HashMap<>();
map.put("projCode",hgsc004.getProjCode());
List<HGSC004> hgsc004List = this.dao.query(HGSC004.QUERY,map);
......
......@@ -390,4 +390,17 @@
FROM ${hggpSchema}.HGSC001 WHERE approval_status = 2 and proj_status = 0
<include refid="condition" />
</select>
<select id="queryProjectByRoleBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
PROJ_CODE as "projCode",
PROJ_NAME as "projName",
company_code as "companyCode", <!-- 公司编码 -->
company_name as "companyName" <!-- 公司名称 -->
FROM ${hggpSchema}.HGSC001
WHERE 1=1
<include refid="condition" />
ORDER BY PROJ_CODE desc
</select>
</sqlMap>
......@@ -179,6 +179,7 @@
BLUEPRINT_NAME as "blueprintName" <!-- 蓝图名称 -->
FROM ${hggpSchema}.HGSC003
WHERE 1=1
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
......
......@@ -160,6 +160,12 @@
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC004A WHERE 1=1
AND lv NOT IN (1,2)
<include refid="condition" />
</select>
<select id="queryAll" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC004A">
SELECT
......@@ -257,12 +263,6 @@
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGSC004A WHERE 1=1
<include refid="condition" />
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC004A (id, <!-- 主键 -->
company_code, <!-- 公司编码(预留) -->
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-28 11:47:21
Version : 1.0
schema : hggp
tableName : HGSC009
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PLAN_MATERIAL_CODE VARCHAR,
PLAN_MATERIAL_NAME VARCHAR,
STATUS TINYINT,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR
-->
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC009">
<sql id="condition">
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
......
......@@ -196,6 +196,14 @@ public class HGSCTools {
}
}
public static class Hgsc003 {
public static HGSC003 getByBlueprintCode(String blueprintCode){
AssertUtils.isTrue(StringUtils.isBlank(blueprintCode), "蓝图编号不能为空!");
HGSC003 results = (HGSC003)DaoBase.getInstance().get(HGSC003.QUERY, HGSC003.FIELD_blueprint_code, blueprintCode);
return results;
}
}
public static class THGSC001A{
/**
......@@ -1074,9 +1082,9 @@ public class HGSCTools {
private static void checkAddDate(HGSC008 hgsc008){
List<String> orgIdList = UserSessionUtils.getOrgId();
AssertUtils.isEmpty(hgsc008.getGroupCode(),"生产任务班组信息异常,请联系管理员!");
AssertUtils.isTrue(!orgIdList.contains(hgsc008.getGroupCode()),"非当前任务生产组用户,无法报工此任务!");
// List<String> orgIdList = UserSessionUtils.getOrgId();
// AssertUtils.isEmpty(hgsc008.getGroupCode(),"生产任务班组信息异常,请联系管理员!");
// AssertUtils.isTrue(!orgIdList.contains(hgsc008.getGroupCode()),"非当前任务生产组用户,无法报工此任务!");
AssertUtils.isNull(hgsc008.getQuantity(),"报工数量不能为空!");
}
......
......@@ -312,7 +312,7 @@ public class HGXSTools {
queryMap.put("orgId", orgId);
queryMap.put("orgType", OrgTypeEnum.COMPANY.getCode());
List<Org> results = DaoBase.getInstance().query(HGSqlConstant.HgXsOrg.QUERY_PARENT, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(results.size() - 1);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
......
......@@ -5,9 +5,11 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.zl.domain.HGZL001;
import com.baosight.hggp.hg.zl.utils.HGZLUtils;
import com.baosight.hggp.util.AssertUtils;
......@@ -43,6 +45,7 @@ public class ServiceHGZL001 extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_CODE_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGZL001().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
......
......@@ -57,7 +57,7 @@
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC006A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC007.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC008.xml"/>
<sqlMap resource="com/baosight/hggp/hg/sc/sql/HGSC009.xml"/>
<!-- 財務 -->
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW001.xml"/>
......
......@@ -13,7 +13,7 @@
<EF:EFInput cname="计划单号" blockId="inqu_status" ename="planNo" row="0" colWidth="3"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFSelect cname="状态" blockId="inqu_status" ename="status" row="0" colWidth="3" optionLabel="全部"
defultValue="">
......
......@@ -68,7 +68,7 @@ $(function () {
// 数量*单价金额
let totalAmount = item.purQty * item.price;
//税额
let taxAmount = totalAmount* item.taxRate / 100;
let taxAmount = totalAmount * item.taxRate / 100;
//不含税金额
let amount = totalAmount - taxAmount;
//含税金额
......
......@@ -20,7 +20,7 @@
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFSelect cname="供应商名称" blockId="inqu_status" ename="supCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
......
......@@ -13,7 +13,7 @@
<EF:EFInput cname="计划单号" blockId="inqu_status" ename="planNo" row="0" colWidth="3"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
......
......@@ -20,7 +20,7 @@
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFSelect cname="供应商名称" blockId="inqu_status" ename="supCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
......
......@@ -12,6 +12,24 @@ $(function() {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
beforeEdit: function (e) {
console.log("正准备编辑第" + e.row + "行数据");
//编辑unitPriceExcludingTax totalPriceIncluding 判断计价方式result-0-pricingMethod
var pricingMethod = $("#result-0-pricingMethod").val();
if (pricingMethod == 1) {
if (e.field === "totalPriceIncluding") {
// 判断单元格 field 禁止编辑
e.preventDefault();
}
} else if (pricingMethod == 2){
if (e.field === "unitPriceExcludingTax") {
// 判断单元格 field 禁止编辑
e.preventDefault();
}
} else {
}
},
columns: [
],
loadComplete: function (grid) {
......@@ -20,7 +38,14 @@ $(function() {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
var pricingMethod = $("#result-0-pricingMethod").val();
if (pricingMethod == 1) {
calculateAmount(item);
} else if (pricingMethod == 2) {
calculateUnitAmount(item);
} else {
}
}
});
grid.dataSource.bind("change", function(e) {
......@@ -28,7 +53,29 @@ $(function() {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
var pricingMethod = $("#result-0-pricingMethod").val();
if (pricingMethod == 1) {
calculateAmount(item);
} else if (pricingMethod == 2) {
calculateUnitAmount(item);
} else {
}
}
});
grid.dataSource.bind("change", function(e) {
if (e.field == "totalPriceIncluding") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
var pricingMethod = $("#result-0-pricingMethod").val();
if (pricingMethod == 1) {
calculateAmount(item);
} else if (pricingMethod == 2) {
calculateUnitAmount(item);
} else {
}
}
});
},
......@@ -42,6 +89,13 @@ $(function() {
e.preventDefault();
deleteResult1Func();
},
beforeAdd: function (e) {
var pricingMethod = $("#result-0-pricingMethod").val();
if (!pricingMethod) {
e.preventDefault();
message("请先选择计价方式!");
}
}
}
$("#UPLOAD_FILE").on("click", function () {
......@@ -377,6 +431,14 @@ function deleteResult1Func() {
detail1Grid.removeRows([rows.rowNo]);// 刷新行号
})
refreshRowNo();
var pricingMethod = $("#result-0-pricingMethod").val();
if (pricingMethod == 1) {
calculateAmount(null);
} else if (pricingMethod == 2){
calculateUnitAmount(null);
} else {
}
}
let refreshRowNo = function () {
......@@ -432,16 +494,57 @@ function fieldValidation() {
}
}
/**
* 根据单价数量计算总金额
* @param item
*/
function calculateAmount(item) {
// 计算总金额
var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() / 100 : 0;
var provisionalQuantity = item.provisionalQuantity || 0;
var unitPriceExcludingTax = item.unitPriceExcludingTax || 0;
var provisionalQuantity = item != null ? item.provisionalQuantity || 0 : 0;
var unitPriceExcludingTax = item != null ? item.unitPriceExcludingTax || 0 : 0;
var totalPriceExcluding = provisionalQuantity * unitPriceExcludingTax;
var totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints));
if (item != null) {
detail1Grid.setCellValue(item, 'totalPriceExcluding', totalPriceExcluding);
detail1Grid.setCellValue(item, 'totalPriceIncluding', totalPriceIncluding);
}
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
var valueAddedTax = 0;
allRows.forEach(function (row, index) {
totalPriceExcluding += parseFloat(row.totalPriceExcluding);
totalPriceIncluding += parseFloat(row.totalPriceIncluding);
});
valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding);
$("#result-0-totalContractPriceExcluding").val(totalPriceExcluding.toFixed(3))
$("#result-0-totalContractPriceIncluding").val(totalPriceIncluding.toFixed(3))
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
}
/**
* 根据总金额数量算单价
* @param item
*/
function calculateUnitAmount(item) {
// 计算总金额
var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() / 100 : 0;
// 含税总金额
var totalPriceIncluding = item != null ? item.totalPriceIncluding || 0 : 0;
// 数量
var provisionalQuantity = item != null ? item.provisionalQuantity || 0 : 0;
//不含税
var totalPriceExcluding = totalPriceIncluding / (1 + parseFloat(taxPoints));
// 单价
var unitPriceExcludingTax = provisionalQuantity == 0 ? 0 : totalPriceExcluding / provisionalQuantity;
if (item != null) {
detail1Grid.setCellValue(item, 'totalPriceExcluding', totalPriceExcluding);
detail1Grid.setCellValue(item, 'unitPriceExcludingTax', unitPriceExcludingTax);
}
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
......
......@@ -102,7 +102,7 @@
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.paymentMethod"/>
</EF:EFSelect>
<EF:EFSelect cname="计价方式" ename="result-0-pricingMethod" colWidth="4" filter="contains">
<EF:EFSelect cname="计价方式" ename="result-0-pricingMethod" colWidth="4" filter="contains" required="true">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.pricingMethod"/>
</EF:EFSelect>
......@@ -130,7 +130,7 @@
<EF:EFColumn ename="supplyMethod" cname="材料供应方式" align="center"/>
<EF:EFColumn ename="unitPriceExcludingTax" cname="除税单价/元" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPriceExcluding" cname="不含税总价" enable="false" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPriceIncluding" cname="含税总价" enable="false" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPriceIncluding" cname="含税总价" format="{0:N3}" align="center"/>
<EF:EFColumn ename="laborCosts" cname="其中人工费、元" format="{0:N3}" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -13,6 +13,24 @@ $(function() {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
beforeEdit: function (e) {
console.log("正准备编辑第" + e.row + "行数据");
//编辑unitPriceExcludingTax totalPriceIncluding 判断计价方式result-0-pricingMethod
var pricingMethod = $("#result-0-pricingMethod").val();
if (pricingMethod == 1) {
if (e.field === "totalPriceIncluding") {
// 判断单元格 field 禁止编辑
e.preventDefault();
}
} else if (pricingMethod == 2){
if (e.field === "unitPriceExcludingTax") {
// 判断单元格 field 禁止编辑
e.preventDefault();
}
} else {
}
},
columns: [
],
loadComplete: function (grid) {
......@@ -21,13 +39,44 @@ $(function() {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
// 计算总金额
var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() / 100 : 0;
var totalPriceExcluding = item.provisionalQuantity * item.unitPriceExcludingTax;
var totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints));
detail1Grid.setCellValue(item, 'totalPriceExcluding', totalPriceExcluding);
detail1Grid.setCellValue(item, 'totalPriceIncluding', totalPriceIncluding);
calculateAmount();
var pricingMethod = $("#result-0-pricingMethod").val();
if (pricingMethod == 1) {
calculateAmount(item);
} else if (pricingMethod == 2) {
calculateUnitAmount(item);
} else {
}
}
});
grid.dataSource.bind("change", function(e) {
if (e.field == "provisionalQuantity") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
var pricingMethod = $("#result-0-pricingMethod").val();
if (pricingMethod == 1) {
calculateAmount(item);
} else if (pricingMethod == 2) {
calculateUnitAmount(item);
} else {
}
}
});
grid.dataSource.bind("change", function(e) {
if (e.field == "totalPriceIncluding") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
var pricingMethod = $("#result-0-pricingMethod").val();
if (pricingMethod == 1) {
calculateAmount(item);
} else if (pricingMethod == 2) {
calculateUnitAmount(item);
} else {
}
}
});
setTimeout(function() {
......@@ -53,6 +102,13 @@ $(function() {
e.preventDefault();
deleteResult1Func();
},
beforeAdd: function (e) {
var pricingMethod = $("#result-0-pricingMethod").val();
if (!pricingMethod) {
e.preventDefault();
message("请先选择计价方式!");
}
}
}
$("#UPLOAD_FILE").on("click", function () {
......@@ -486,7 +542,7 @@ function deleteResult1Func() {
}
if (IPLAT.isAvailable("detail1")) {
window['detail1Grid'].setEiInfo(ei);
calculateAmount();
calculateAmount(null);
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
......@@ -507,8 +563,56 @@ function deleteResult1Func() {
});
}
function calculateAmount() {
/**
* 根据单价数量计算总金额
* @param item
*/
function calculateAmount(item) {
// 计算总金额
var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() / 100 : 0;
var provisionalQuantity = item != null ? item.provisionalQuantity || 0 : 0;
var unitPriceExcludingTax = item != null ? item.unitPriceExcludingTax || 0 : 0;
var totalPriceExcluding = provisionalQuantity * unitPriceExcludingTax;
var totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints));
if (item != null) {
detail1Grid.setCellValue(item, 'totalPriceExcluding', totalPriceExcluding);
detail1Grid.setCellValue(item, 'totalPriceIncluding', totalPriceIncluding);
}
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
var valueAddedTax = 0;
allRows.forEach(function (row, index) {
totalPriceExcluding += parseFloat(row.totalPriceExcluding);
totalPriceIncluding += parseFloat(row.totalPriceIncluding);
});
valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding);
$("#result-0-totalContractPriceExcluding").val(totalPriceExcluding.toFixed(3))
$("#result-0-totalContractPriceIncluding").val(totalPriceIncluding.toFixed(3))
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
}
/**
* 根据总金额数量算单价
* @param item
*/
function calculateUnitAmount(item) {
// 计算总金额
var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() / 100 : 0;
// 含税总金额
var totalPriceIncluding = item != null ? item.totalPriceIncluding || 0 : 0;
// 数量
var provisionalQuantity = item != null ? item.provisionalQuantity || 0 : 0;
//不含税
var totalPriceExcluding = totalPriceIncluding / (1 + parseFloat(taxPoints));
// 单价
var unitPriceExcludingTax = provisionalQuantity == 0 ? 0 : totalPriceExcluding / provisionalQuantity;
if (item != null) {
detail1Grid.setCellValue(item, 'totalPriceExcluding', totalPriceExcluding);
detail1Grid.setCellValue(item, 'unitPriceExcludingTax', unitPriceExcludingTax);
}
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
......
......@@ -104,7 +104,7 @@
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.paymentMethod"/>
</EF:EFSelect>
<EF:EFSelect cname="计价方式" ename="result-0-pricingMethod" colWidth="4" filter="contains">
<EF:EFSelect cname="计价方式" ename="result-0-pricingMethod" colWidth="4" filter="contains" required="true">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.pricingMethod"/>
</EF:EFSelect>
......@@ -132,7 +132,7 @@
<EF:EFColumn ename="supplyMethod" cname="材料供应方式" align="center"/>
<EF:EFColumn ename="unitPriceExcludingTax" cname="除税单价/元" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPriceExcluding" cname="不含税总价" enable="false" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPriceIncluding" cname="含税总价" enable="false" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPriceIncluding" cname="含税总价" format="{0:N3}" align="center"/>
<EF:EFColumn ename="laborCosts" cname="其中人工费、元" format="{0:N3}" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -14,16 +14,46 @@ $(function() {
},
columns: [
],
beforeAdd: function (e) {
var pricingMethod = $("#result-0-pricingMethod").val();
if (!pricingMethod) {
e.preventDefault();
message("请先选择计价方式!");
}
},
beforeEdit: function (e) {
console.log("正准备编辑第" + e.row + "行数据");
//编辑unitPriceExcludingTax totalPriceIncluding 判断计价方式result-0-pricingMethod
var pricingMethod = $("#result-0-pricingMethod").val();
if (pricingMethod == 1) {
if (e.field === "totalPrice") {
// 判断单元格 field 禁止编辑
e.preventDefault();
}
} else if (pricingMethod == 2){
if (e.field === "unitPrice") {
// 判断单元格 field 禁止编辑
e.preventDefault();
}
} else {
}
},
loadComplete: function (grid) {
grid.dataSource.bind("change", function(e) {
if (e.field == "dayNumber" || e.field == "unitPrice" || e.field == "dayNumber") {
if (e.field == "deviceNumber" || e.field == "unitPrice" || e.field == "dayNumber" || e.field == "totalPrice") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
// 计算总金额
var pricingMethod = $("#result-0-pricingMethod").val();
if (pricingMethod == 1) {
calculateAmount(item);
} else if (pricingMethod == 2) {
calculateUnitAmount(item);
} else {
}
}
});
},
onSave: function (e) {
......@@ -78,18 +108,39 @@ $(function() {
"result-0-taxPoints": {
// 点击下拉选项时触发
select: function (e) { //获取勾选值
var allRows = detail1Grid.getDataItems();
if (allRows.length > 0) {
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
if (valueField) {
var taxPoints = valueField / 100;
var totalContractPriceExcluding = $("#result-0-totalContractPriceExcluding").val();
var totalContractPriceIncluding = totalContractPriceExcluding * (1 + taxPoints);
var totalContractPriceIncluding = 0;
var valueAddedTax = 0;
//更新表格含税金额
for (var i = 0; i < allRows.length; i++) {
var row = allRows[i];
var totalPriceIncluding = row.totalPrice * (1 + parseFloat(taxPoints));
var taxAmount = totalPriceIncluding - row.totalPrice;
detail1Grid.setCellValue(row, 'totalPriceIncluding', parseFloat(totalPriceIncluding).toFixed(3));
detail1Grid.setCellValue(row, 'taxAmount', parseFloat(taxAmount).toFixed(3));
totalContractPriceIncluding += totalPriceIncluding;
}
$("#result-0-totalContractPriceIncluding").val(totalContractPriceIncluding.toFixed(3))
$("#result-0-valueAddedTax").val((totalContractPriceIncluding - totalContractPriceExcluding).toFixed(3))
var totalPriceExcluding = $("#result-0-totalContractPriceExcluding").val();
valueAddedTax = parseFloat(totalContractPriceIncluding.toFixed(3)) - parseFloat(totalPriceExcluding);
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
} else {
var totalContractPriceExcluding = parseFloat($("#result-0-totalContractPriceExcluding").val());
var totalContractPriceExcluding = 0;
var valueAddedTax = 0;
for (var i = 0; i < allRows.length; i++) {
var row = allRows[i];
detail1Grid.setCellValue(row, 'totalPriceIncluding', row.totalPrice);
detail1Grid.setCellValue(row, 'taxAmount', 0);
totalContractPriceExcluding += parseFloat(row.totalPrice);
}
$("#result-0-totalContractPriceIncluding").val(totalContractPriceExcluding.toFixed(3))
$("#result-0-valueAddedTax").val(0)
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
}
}
}
},
......@@ -261,6 +312,14 @@ function deleteResult1Func() {
detail1Grid.removeRows([rows.rowNo]);// 刷新行号
})
refreshRowNo();
var pricingMethod = $("#result-0-pricingMethod").val();
if (pricingMethod == 1) {
calculateAmount(null);
} else if (pricingMethod == 2){
calculateUnitAmount(null);
} else {
}
}
let refreshRowNo = function () {
......@@ -301,13 +360,26 @@ $(window).load(function () {
refreshRowNo();
});
/**
* 计算总价
* @param item
*/
function calculateAmount(item) {
var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() / 100 : 0;
var deviceNumber = parseFloat(item.deviceNumber) || 0;
var unitPrice = parseFloat(item.unitPrice) || 0;
var dayNumber = parseFloat(item.dayNumber) || 0;
var deviceNumber = item != null ? parseFloat(item.deviceNumber) || 0 : 0;
var unitPrice = item != null ? parseFloat(item.unitPrice) || 0 : 0;
var dayNumber = item != null ? parseFloat(item.dayNumber) || 0 : 0;
var totalPrice = deviceNumber * unitPrice * dayNumber;
var totalPriceIncluding = totalPrice * (1 + parseFloat(taxPoints));
var taxAmount = totalPriceIncluding - totalPrice
if (item) {
detail1Grid.setCellValue(item, 'totalPrice', parseFloat(totalPrice));
detail1Grid.setCellValue(item, 'totalPriceIncluding', parseFloat(totalPriceIncluding));
detail1Grid.setCellValue(item, 'taxAmount', parseFloat(taxAmount));
}
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
......@@ -320,6 +392,7 @@ function calculateAmount(item) {
});
totalPriceExcluding = totalPrice;
totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints));
valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding);
$("#result-0-totalContractPriceExcluding").val(parseFloat(totalPriceExcluding).toFixed(3))
$("#result-0-totalContractPriceIncluding").val(parseFloat(totalPriceIncluding).toFixed(3))
......@@ -327,4 +400,41 @@ function calculateAmount(item) {
$("#result-0-totalQuantity").val(parseFloat(deviceNumber).toFixed(3))
}
/**
* 计算单价
*/
function calculateUnitAmount(item) {
var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() / 100 : 0;
var deviceNumber = item != null ? parseFloat(item.deviceNumber) || 0 : 0;
var dayNumber = item != null ? parseFloat(item.dayNumber) || 0 : 0;
var totalPrice = item != null ? parseFloat(item.totalPrice) || 0 : 0;
var unitPrice = totalPrice / (deviceNumber * dayNumber);
var totalPriceIncluding = totalPrice * (1 + parseFloat(taxPoints));
var taxAmount = totalPriceIncluding - totalPrice
if (item) {
detail1Grid.setCellValue(item, 'unitPrice', parseFloat(unitPrice));
detail1Grid.setCellValue(item, 'totalPriceIncluding', parseFloat(totalPriceIncluding));
detail1Grid.setCellValue(item, 'taxAmount', parseFloat(taxAmount));
}
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
var valueAddedTax = 0;
totalPrice = 0;
deviceNumber = 0
allRows.forEach(function (row, index) {
totalPrice += parseFloat(row.totalPrice);
deviceNumber += parseFloat(row.deviceNumber);
});
totalPriceExcluding = totalPrice;
totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints));
valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding);
$("#result-0-totalContractPriceExcluding").val(parseFloat(totalPriceExcluding).toFixed(3))
$("#result-0-totalContractPriceIncluding").val(parseFloat(totalPriceIncluding).toFixed(3))
$("#result-0-valueAddedTax").val(parseFloat(valueAddedTax).toFixed(3))
$("#result-0-totalQuantity").val(parseFloat(deviceNumber).toFixed(3))
}
......@@ -95,7 +95,10 @@
<EF:EFColumn ename="deviceNumber" cname="数量" format="{0:N3}" align="center"/>
<EF:EFColumn ename="unitPrice" cname="单价" format="{0:N3}" align="center"/>
<EF:EFColumn ename="dayNumber" cname="天数" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPrice" cname="总价" enable="false" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPrice" cname="总价" format="{0:N3}" align="center"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPriceIncluding" cname="含税总价" enable="false" format="{0:N3}" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="detail2" title="附件信息">
......
......@@ -165,8 +165,8 @@ function windowCallback() {
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
if (rows.length < 1) {
message("请至少选择一条数据");
return;
}
var flag = true;
......@@ -218,8 +218,8 @@ function submitFunc() {
function writeoffFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
if (rows.length < 1) {
message("请至少选择一条数据");
return;
}
var flag = true;
......
......@@ -164,8 +164,8 @@ function windowCallback() {
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
if (rows.length < 1) {
message("请至少选择一条数据");
return;
}
var flag = true;
......@@ -217,8 +217,8 @@ function submitFunc() {
function writeoffFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
if (rows.length < 1) {
message("请至少选择一条数据");
return;
}
var flag = true;
......
......@@ -10,14 +10,15 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="隐藏条件" ename="partyA" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="隐藏条件" ename="hiddenConditions" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="隐藏条件" ename="billState" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="隐藏条件" ename="mainId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFDateSpan startCname="付款日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="客户名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="供应商名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="票据类型" ename="inqu_status-0-billTybe" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.billTybe"/>
......@@ -31,7 +32,7 @@
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="thisAmount" cname="本次付款金额" width="120" align="center"/>
<EF:EFColumn ename="remainingAmount" cname="剩余付款金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="partyA" cname="客户名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="partyA" cname="供应商名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="settlementNumber" cname="来源单号" width="120" enable="false" readonly="true" align="center"/>
<EF:EFComboColumn ename="billTybe" cname="票据类型" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
......@@ -42,7 +43,7 @@
<EF:EFColumn ename="taxPoints" cname="税率(%)" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementAmount" cname="不含税金额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="thisSettlementTax" cname="税额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="付款总额" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="发票总额" width="120" enable="false" readonly="true" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
......
......@@ -20,7 +20,7 @@
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFSelect cname="供应商名称" blockId="inqu_status" ename="supCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
......
let WhNameGlobalData = [];
$(function () {
var companyCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var companyCodes = __eiInfo.getBlock("roleCompany").getMappedRows();
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
......@@ -28,9 +28,9 @@ $(function () {
field: "companyCode",
template: function (dataItem) {
for (let i = 0; i < companyCodes.length; i++) {
if (companyCodes[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodes[i]['textField']
return companyCodes[i]['textField'];
if (companyCodes[i]['companyCode'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodes[i]['companyName']
return companyCodes[i]['companyName'];
}
}
return dataItem["companyCode"];
......
......@@ -41,9 +41,9 @@
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
maxLength="16" readonly="false" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="otherEnterDate" cname="单据日期" width="100" align="center" editType="date"
......
let whNameGlobalData = [];
$(function () {
var companyCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var companyCodes = __eiInfo.getBlock("roleCompany").getMappedRows();
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
......@@ -28,9 +28,9 @@ $(function () {
field: "companyCode",
template: function (dataItem) {
for (let i = 0; i < companyCodes.length; i++) {
if (companyCodes[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodes[i]['textField']
return companyCodes[i]['textField'];
if (companyCodes[i]['companyCode'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodes[i]['companyName']
return companyCodes[i]['companyName'];
}
}
return dataItem["companyCode"];
......
......@@ -42,9 +42,9 @@
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
maxLength="16" readonly="false" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="otherOutDate" cname="单据日期" width="100" align="center" editType="date"
......
......@@ -9,8 +9,8 @@
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" blockId="inqu_status" ename="whCode" row="0" colWidth="3"
optionLabel="全部" defultValue="" filter="contains">
......
......@@ -2,7 +2,7 @@ $(function (){
var companyCodes = __eiInfo.getBlock("roleCompany").getMappedRows();
var projCodes = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var projCodes = __eiInfo.getBlock("projRecordByRole_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
......@@ -76,7 +76,7 @@ $(function (){
let dataSource;
EiCommunicator.send("HGSC003", "projComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("proj_record_block_id").getMappedRows();
dataSource = ei.getBlock("projRecordByRole_block_id").getMappedRows();
},
onFail: function (ei) {
}
......
$(function (){
var companyCodes = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var companyCodes = __eiInfo.getBlock("roleCompany").getMappedRows();
var projCodes = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
var projCodes = __eiInfo.getBlock("projRecordByRole_block_id").getMappedRows();
var blueprintCodes = __eiInfo.getBlock("blueprint_box_block_id").getMappedRows();
......@@ -43,9 +43,9 @@ $(function (){
field: "companyCode",
template: function (dataItem) {
for (let i = 0; i < companyCodes.length; i++) {
if (companyCodes[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodes[i]['textField']
return companyCodes[i]['textField'];
if (companyCodes[i]['companyCode'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodes[i]['companyName']
return companyCodes[i]['companyName'];
}
}
return dataItem["companyCode"];
......@@ -62,7 +62,7 @@ $(function (){
}
}
}
return template;
return item.projCode;
},
editor: function (container, options) {
let inInfo = new EiInfo();
......@@ -72,7 +72,7 @@ $(function (){
let dataSource;
EiCommunicator.send("HGSC003", "projComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("proj_record_block_id").getMappedRows();
dataSource = ei.getBlock("projRecordByRole_block_id").getMappedRows();
},
onFail: function (ei) {
}
......@@ -104,7 +104,7 @@ $(function (){
}
}
}
return template;
return item.blueprintCode;
},
editor: function (container, options) {
let inInfo = new EiInfo();
......@@ -112,10 +112,9 @@ $(function (){
inInfo.set("inqu_status-0-blueprintStatus", 1);
inInfo.set("inqu_status-0-projCode", options.model["projCode"]);
inInfo.set("field", options.field);
let dataSource;
EiCommunicator.send("HGSC003", "blueprintComboBox", inInfo, {
onSuccess: function (ei) {
dataSource = ei.getBlock("blueprint_box_block_id").getMappedRows();
blueprintCodes = ei.getBlock("blueprint_box_block_id").getMappedRows();
},
onFail: function (ei) {
}
......@@ -125,7 +124,7 @@ $(function (){
input.attr("id", options.field);
input.appendTo(container);
input.kendoDropDownList({
dataSource: dataSource,
dataSource: blueprintCodes,
minLength: 0,
dataTextField: "textField",
dataValueField: "valueField",
......
......@@ -26,14 +26,14 @@
<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="120" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
<EF:EFComboColumn ename="companyCode" cname="公司编码"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="120" required="true"
maxLength="16" readonly="false" width="100" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" align="center" enable="false" hidden="true" />
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center" required="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" align="center" enable="false"/>
<EF:EFColumn ename="blueprintCode" cname="蓝图编码" enable="true" width="120" align="center" required="true"/>
......
......@@ -612,6 +612,7 @@ let save = function (btnNode) {
ok: function () {
JSUtils.submitGridsData("result", "HGSC004A", "save", true);
btnNode.attr("disabled", false);
refreshTree();
}
});
}
......@@ -644,7 +645,7 @@ function showDetail(id) {
}
function updateProductStatus(id,status) {
JSUtils.confirm("确定是否\"删除\"操作? ", {
JSUtils.confirm("确定是否\"提交\"操作? ", {
ok: function () {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
......@@ -652,9 +653,13 @@ function updateProductStatus(id,status) {
inEiInfo.set("result-0-materialId", $("#inqu_status-0-materialId").val());
EiCommunicator.send('HGSC004A', 'updateProductStatus', inEiInfo, {
onSuccess(response) {
if (response.status == 1){
NotificationUtil(response.msg);
query();
refreshTree();
}else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
......@@ -673,9 +678,13 @@ function saveDetail() {
inEiInfo.setByNode("result");
EiCommunicator.send('HGSC004A', 'save', inEiInfo, {
onSuccess(response) {
if (response.status == 1){
NotificationUtil(response.msg);
query();
refreshTree();
}else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
......@@ -699,9 +708,13 @@ function deteleDetail(id) {
inEiInfo.set("result-0-materialId", $("#inqu_status-0-materialId").val());
EiCommunicator.send('HGSC004A', 'delete', inEiInfo, {
onSuccess(response) {
if (response.status == 1){
NotificationUtil(response.msg);
query();
refreshTree();
}else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
......@@ -737,7 +750,12 @@ let batchSubmit = function () {
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做提交操作吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC004A", "updateProductStatus", true);
JSUtils.submitGridsData("result", "HGSC004A", "updateProductStatus", true, function (e) {
var status = e.getStatus();
if (status !== -1) {
query();
}
});
}
});
}
......
......@@ -58,7 +58,7 @@
<EF:EFColumn ename="width" cname="宽(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="100" align="right" format="{0:N2}" maxLength="10" enable="false"/>
<EF:EFColumn ename="quantity" required="true" cname="数量"/>
<EF:EFColumn ename="singleWeight" cname="单重(kg)" width="100" enable="true" readonly="true" format="{0:N3}" editType="text"
<EF:EFColumn ename="singleWeight" cname="单重(kg)" width="100" enable="true" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,17}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
......
......@@ -28,7 +28,7 @@
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="150" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
<EF:EFComboColumn ename="companyCode" cname="公司编码"
columnTemplate="#=companyName#" itemTemplate="#=companyName#"
textField="companyName" valueField="companyCode"
maxLength="16" readonly="false" width="100" required="true"
......
......@@ -12,7 +12,7 @@
format="yyyy-MM-dd" readonly="true"/>
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
<EF:EFOptions blockId="company_code_block_id" textField="textField" valueField="valueField"/>
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFSelect cname="存货名称" blockId="inqu_status" ename="inventCode" row="0" colWidth="3"
filter="contains" optionLabel="全部" defultValue="">
......
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