Commit 6198d2bf by liuyang

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

parents f2ab9ba4 ab3093e8
......@@ -70,7 +70,7 @@ public class HGConstant {
//生产订单
public static final String HGSC006_ORDER_CODE = "HGSC006_ORDER_CODE";
//生产任务
public static final String HGSC007_TASCK_CODE = "HGSC007_TASCK_CODE";
public static final String HGSC007_TASK_CODE = "HGSC007_TASK_CODE";
//生产任务订单
public static final String PROD_TASK_NO = "PROD_TASK_NO";
//售后维修单号
......
......@@ -90,7 +90,7 @@ public class HGCW004 extends DaoEPBase {
private String signingDate = " "; /* 签订日期*/
private String partyA = " "; /* 甲方公司名称*/
private String partyB = " "; /* 乙方公司名称*/
private Boolean reviewStatus; /* 审批状态*/
private Integer reviewStatus; /* 审批状态*/
private String projactDetail = " "; /* 项目部位*/
private String contractContent = " "; /* 合同内容*/
private BigDecimal totalContractPriceIncluding = new BigDecimal("0"); /* 合同总价(含税)*/
......@@ -390,7 +390,7 @@ public class HGCW004 extends DaoEPBase {
* get the reviewStatus - 审批状态.
* @return the reviewStatus
*/
public Boolean getReviewStatus() {
public Integer getReviewStatus() {
return this.reviewStatus;
}
......@@ -399,7 +399,7 @@ public class HGCW004 extends DaoEPBase {
*
* @param reviewStatus - 审批状态
*/
public void setReviewStatus(Boolean reviewStatus) {
public void setReviewStatus(Integer reviewStatus) {
this.reviewStatus = reviewStatus;
}
/**
......@@ -581,7 +581,7 @@ public class HGCW004 extends DaoEPBase {
setSigningDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SIGNING_DATE)), signingDate));
setPartyA(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_A)), partyA));
setPartyB(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PARTY_B)), partyB));
setReviewStatus(NumberUtils.toBoolean(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus));
setReviewStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_REVIEW_STATUS)), reviewStatus));
setProjactDetail(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJACT_DETAIL)), projactDetail));
setContractContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_CONTENT)), contractContent));
setTotalContractPriceIncluding(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_TOTAL_CONTRACT_PRICE_INCLUDING)), totalContractPriceIncluding));
......
......@@ -149,55 +149,6 @@ public class ServiceHGCW002 extends ServiceBase {
DaoUtils.update("HGCW002.update", HGCW002);
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "新增",operDesc = "新增")
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 数据写入
for (int i = 0; i < resultRows.size(); i++) {
HGCW002 HGCW002 = new HGCW002();
HGCW002.fromMap(resultRows.get(i));
DaoUtils.insert("HGCW002.insert", HGCW002);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 修改操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "修改",operDesc = "修改")
public EiInfo update(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW002 HGCW002 = new HGCW002();
HGCW002.fromMap(resultRows.get(i));
DaoUtils.update("HGCW002.update", HGCW002);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/**
* 删除操作
......@@ -289,4 +240,11 @@ public class ServiceHGCW002 extends ServiceBase {
return inInfo;
}
public EiInfo queryContractByNumber(EiInfo inInfo){
HGCW002 hgcw002 = HGCWTools.HgCw002.getContractNumber(inInfo.getString("contractNumber"));
inInfo.set("hgcw002",hgcw002);
return inInfo;
}
}
......@@ -3,8 +3,10 @@ package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils;
......@@ -13,6 +15,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.math.BigDecimal;
import java.text.DecimalFormat;
......@@ -76,6 +79,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());
contractNumber = HGCW003.getContractNumber();
if (HGCW003.getId() == null || HGCW003.getId() == 0) {
this.add(HGCW003);
......
......@@ -5,6 +5,7 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.domain.HGCW004;
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.domain.HGSB003;
......@@ -217,7 +218,29 @@ public EiInfo updateDocId(EiInfo inInfo){
}
return inInfo;
}
/**
* 提交操作
* @param inInfo
* @return
*/
public EiInfo submit(EiInfo inInfo){
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW004 HGCW004 = new HGCW004();
HGCW004.fromMap(resultRows.get(i));
HGCW004.setReviewStatus(3);
DaoUtils.update("HGCW004.submit", HGCW004);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据提交成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
}
......
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
/**
* @author LiuYang
* @version 1.0 2024/5/10
*/
public class ServiceHGCW004A extends ServiceEPBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "上传",operDesc = "附件上传")
public EiInfo form(EiInfo inInfo) {
return inInfo;
}
}
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
/**
* @author LiuYang
* @version 1.0 2024/5/10
*/
public class ServiceHGCW005A extends ServiceEPBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "上传",operDesc = "附件上传")
public EiInfo form(EiInfo inInfo) {
return inInfo;
}
}
......@@ -4,6 +4,7 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoUtils;
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.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -72,6 +73,9 @@ 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);
......
......@@ -91,30 +91,14 @@ public class ServiceHGCW008 extends ServiceBase {
this.add(HGCW008);
// 写入其他数据
HGCWTools.HgCw009.save(detail1Rows,settlementNumber,userVO);
// 更新合同结算状态
HGCWTools.HgCw002.updateBalanceStatus(HGCW008.getContractNumber(),HGCW008.getSettlementType() + 1);
} else {
BigDecimal totalContractPriceExcluding = new BigDecimal(0);
BigDecimal totalContractPriceIncluding = new BigDecimal(0);
BigDecimal valueAddedTax = new BigDecimal(0);
BigDecimal totalQuantity = new BigDecimal(0);
//计算合同清单金额
for (int i = 0; i < detail1Rows.size(); i++) {
HGCW007 hgcw007 = new HGCW007();
hgcw007.fromMap(detail1Rows.get(i));
totalContractPriceExcluding = totalContractPriceExcluding.add(hgcw007.getTotalPrice());
totalQuantity = totalQuantity.add(hgcw007.getDeviceNumber());
}
BigDecimal taxPoints = new BigDecimal(HGCW008.getTaxPoints() / 100);
totalContractPriceIncluding = totalContractPriceExcluding.multiply(taxPoints.add(new BigDecimal(1)));
valueAddedTax = totalContractPriceIncluding.subtract(totalContractPriceExcluding);
DecimalFormat decimalFormat = new DecimalFormat("#.000");
HGCW008.setContractDate(DateUtils.formatShort(HGCW008.getContractDate()));
this.modify(HGCW008);
}
// 更新合同结算状态
HGCWTools.HgCw002.updateBalanceStatus(HGCW008.getContractNumber(),HGCW008.getSettlementType() + 1);
}
//更新金额
HGCWTools.HgCw009.calculateAmount(HGCW008.getSettlementNumber());
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.hg.cw.domain.HGCW006;
import com.baosight.hggp.hg.cw.domain.HGCW007;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.domain.*;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -28,15 +26,12 @@ public class ServiceHGCW008C extends ServiceBase {
@OperationLogAnnotation(operModul = "合同详情",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
// CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJECT_CODE_BOX_BLOCK_ID), null, false);
String id = inInfo.getString("id");
HGCW006 HGCW006 = HGCWTools.HgCw006.getId(id);
inInfo.addBlock(EiConstant.resultBlock).addRow(HGCW006);
HGCW008 HGCW008 = HGCWTools.HgCw008.getId(id);
inInfo.addBlock(EiConstant.resultBlock).addRow(HGCW008);
//获取清单
List<HGCW007> hgcw007List = HGCWTools.HgCw007.queryByContractNumber(HGCW006.getContractNumber());
inInfo.addBlock("detail1").addRows(hgcw007List);
List<HGCW999> hgcw999List = HGCWTools.HgCw999.queryByBiz(HGCW006.getId(),"ZL");
inInfo.addBlock("detail2").addRows(hgcw999List);
List<HGCW009> hgcw009List = HGCWTools.HgCw009.queryBySettlementNumber(HGCW008.getSettlementNumber());
inInfo.addBlock("detail1").addRows(hgcw009List);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......
......@@ -47,9 +47,7 @@ public class ServiceHGCW008E extends ServiceBase {
public EiInfo query(EiInfo inInfo) {
try {
List<String> ids = new ArrayList<>();
List<String> dids = new ArrayList<>();
String inventoryIds = inInfo.getString("inqu_status-0-inventoryIds");
String deductionIds = inInfo.getString("inqu_status-0-deductionIds");
if (StringUtils.isNotEmpty(inventoryIds)) {
String[] inventoryIdsArr = inventoryIds.split(",");
......@@ -59,6 +57,24 @@ public class ServiceHGCW008E extends ServiceBase {
inInfo.set("inqu_status-0-ids", ids);
}
inInfo = super.query(inInfo, HGCW003.QUERY, new HGCW003(),new HGCW003().eiMetadata,"","","result1",false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "合同清单",operType = "查询",operDesc = "查询")
public EiInfo query2(EiInfo inInfo) {
try {
List<String> dids = new ArrayList<>();
String deductionIds = inInfo.getString("inqu_status-0-deductionIds");
if (StringUtils.isNotEmpty(deductionIds)) {
String[] deductionIdsArr = deductionIds.split(",");
for (String id : deductionIdsArr) {
......
......@@ -2,8 +2,9 @@ package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW007;
import com.baosight.hggp.hg.cw.domain.HGCW009;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -29,7 +30,7 @@ public class ServiceHGCW009 extends ServiceBase {
@OperationLogAnnotation(operModul = "合同清单",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW007().eiMetadata);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW009().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -46,7 +47,7 @@ public class ServiceHGCW009 extends ServiceBase {
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW007.QUERY, new HGCW007());
inInfo = super.query(inInfo, HGCW009.QUERY, new HGCW009());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......@@ -64,20 +65,23 @@ public class ServiceHGCW009 extends ServiceBase {
EiInfo eiInfo = new EiInfo();
try {
List<Map> resultRows = inInfo.getBlock("detail1").getRows();
String contractNumber = "";
String settlementNumber = "";
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGCW007 HGCW007 = new HGCW007();
HGCW007.fromMap(resultRows.get(i));
contractNumber = HGCW007.getContractNumber();
if (HGCW007.getId() == null || HGCW007.getId() == 0) {
this.add(HGCW007);
HGCW009 HGCW009 = new HGCW009();
HGCW009.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW009.setCompanyCode(userVO.getUsercode());
HGCW009.setCompanyName(userVO.getUsername());
settlementNumber = HGCW009.getSettlementNumber();
if (HGCW009.getId() == null || HGCW009.getId() == 0) {
this.add(HGCW009);
} else {
this.modify(HGCW007);
this.modify(HGCW009);
}
}
List<HGCW007> HGCW007List = HGCWTools.HgCw007.queryByContractNumber(contractNumber);
eiInfo.addBlock("detail1").addRows(HGCW007List);
List<HGCW009> HGCW009List = HGCWTools.HgCw009.queryBySettlementNumber(settlementNumber);
eiInfo.addBlock("detail1").addRows(HGCW009List);
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
......@@ -89,25 +93,25 @@ public class ServiceHGCW009 extends ServiceBase {
/**
* 新增操作
*
* @param HGCW007
* @param HGCW009
* @return
*/
public void add(HGCW007 HGCW007) {
DaoUtils.insert("HGCW007.insert", HGCW007);
public void add(HGCW009 HGCW009) {
DaoUtils.insert("HGCW009.insert", HGCW009);
}
/**
* 修改操作
*
* @param HGCW007
* @param HGCW009
* @return
*/
public void modify(HGCW007 HGCW007) {
DaoUtils.update("HGCW007.update", HGCW007);
public void modify(HGCW009 HGCW009) {
DaoUtils.update("HGCW009.update", HGCW009);
}
public void deleteEntity(HGCW007 HGCW007) {
DaoUtils.update("HGCW007.delete", HGCW007);
public void deleteEntity(HGCW009 HGCW009) {
DaoUtils.update("HGCW009.delete", HGCW009);
}
/**
......@@ -121,16 +125,16 @@ public class ServiceHGCW009 extends ServiceBase {
EiInfo eiInfo = new EiInfo();
try {
List<Map> resultRows = inInfo.getBlock("detail1").getRows();
String contractNumber = "";
String settlementNumber = "";
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGCW007 HGCW007 = new HGCW007();
HGCW007.fromMap(resultRows.get(i));
contractNumber = HGCW007.getContractNumber();
this.deleteEntity(HGCW007);
HGCW009 HGCW009 = new HGCW009();
HGCW009.fromMap(resultRows.get(i));
settlementNumber = HGCW009.getSettlementNumber();
this.deleteEntity(HGCW009);
}
List<HGCW007> HGCW007List = HGCWTools.HgCw007.queryByContractNumber(contractNumber);
eiInfo.addBlock("detail1").addRows(HGCW007List);
List<HGCW009> HGCW009List = HGCWTools.HgCw009.queryBySettlementNumber(settlementNumber);
eiInfo.addBlock("detail1").addRows(HGCW009List);
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
......
......@@ -42,25 +42,25 @@
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
PROJ_NAME like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
CONTRACT_NUMBER like ('%$contractNumber$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractName">
CONTRACT_NAME = #contractName#
CONTRACT_NAME like ('%$contractName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDate">
SIGNING_DATE = #signingDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
PARTY_A like ('%$partyA$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyB">
PARTY_B = #partyB#
PARTY_B like ('%$partyB$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
......@@ -268,5 +268,14 @@
WHERE
ID = #id#
</update>
<update id="submit">
UPDATE ${hggpSchema}.HGCW004
SET
REVIEW_STATUS = #reviewStatus#, <!-- 审核状态 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -42,25 +42,25 @@
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
PROJ_NAME like ('%$projName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractNumber">
CONTRACT_NUMBER = #contractNumber#
CONTRACT_NUMBER like ('%$contractNumber$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractName">
CONTRACT_NAME = #contractName#
CONTRACT_NAME like ('%$contractName$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDate">
SIGNING_DATE = #signingDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
PARTY_A like ('%$partyA$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyB">
PARTY_B = #partyB#
PARTY_B like ('%$partyB$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
......
......@@ -303,9 +303,6 @@
<update id="update">
UPDATE ${hggpSchema}.HGCW008
SET
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
CONTRACT_NUMBER = #contractNumber#, <!-- 合同号 -->
......@@ -322,14 +319,9 @@
CUMULATIVE_SETTLEMENT_AMOUNT = #cumulativeSettlementAmount#, <!-- 累计结算金额 -->
CUMULATIVE_SETTLEMENT_TAX = #cumulativeSettlementTax#, <!-- 累计结算税金 -->
CUMULATIVE_PRICE_TAX = #cumulativePriceTax#, <!-- 累计结算价税合计金额 -->
REVIEW_STATUS = #reviewStatus#, <!-- 审核状态 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
......@@ -342,4 +334,15 @@
FROM ${hggpSchema}.HGCW008 WHERE 1=1
<include refid="condition" />
</select>
<update id="submit">
UPDATE ${hggpSchema}.HGCW008
SET
REVIEW_STATUS = #reviewStatus#, <!-- 审核状态 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -5,17 +5,21 @@ import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.*;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sc.domain.HGSC001A;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
public class HGCWTools {
......@@ -54,6 +58,14 @@ public class HGCWTools {
{put("balanceStatus",balanceStatus);}
});
}
public static HGCW002 getContractNumber(String contractNumber) {
AssertUtils.isNull(contractNumber, "合同号不能为空!");
List<HGCW002> results = DaoBase.getInstance().query(HGCW002.QUERY,new HashMap<String,Object>(){
{put("contractNumber",contractNumber);}
});
return results.get(0);
}
}
public static class HgCw003{
......@@ -153,10 +165,114 @@ public class HGCWTools {
public static List<HGCW009> queryBySettlementNumber(String settlementNumber) {
AssertUtils.isNull(settlementNumber, "结算单号不能为空!");
List<HGCW009> results = DaoBase.getInstance().query(HGCW009.QUERY,new HashMap<String,Object>(){
{put("contractNumber",settlementNumber);}
{put("settlementNumber",settlementNumber);}
});
return results;
}
/**
* 本次结算金额: 明细的本次结算求和
* 累计结算金额: 当前合同的所有结算单本次结算金额求和
* 本次结算税金: 明细的本次结算求和(不含扣款 )*税率
* 累计结算税金:当前合同的所有结算单的“本次结算税金”求和
* 本次价税合计=本次结算金额+本次结算税金
* 累计价税合计=累计结算金额+累计结算税金
* 劳务合同的本次结算税金: 明细的本次结算求和(不含扣款 )*税率
* 销售合同的本次结算税金: 明细的本次结算求和*税率
*/
public static void calculateAmount(String settlementNumber){
AssertUtils.isNull(settlementNumber, "结算单号不能为空!");
DecimalFormat decimalFormat = new DecimalFormat("#.000");
List<HGCW008> HGCW008List = DaoBase.getInstance().query(HGCW008.QUERY,new HashMap<String,Object>(){
{put("settlementNumber",settlementNumber);}
});
if (CollectionUtils.isEmpty(HGCW008List)) {
throw new PlatException("未找到对应的结算单!");
}
HGCW008 hgcw008 = HGCW008List.get(0);
BigDecimal thisTaxPoints = new BigDecimal(decimalFormat.format(new BigDecimal(hgcw008.getTaxPoints()).divide(new BigDecimal(100))));
// 找到对应的合同
HGCW002 hgcw002 = HGCWTools.HgCw002.getContractNumber(hgcw008.getContractNumber());
Integer contractType = hgcw002.getContractType();
List<HGCW008> hgcw008List = DaoBase.getInstance().query(HGCW008.QUERY,new HashMap<String,Object>(){
{put("contractNumber",hgcw008.getContractNumber());}
});
//本次计算
List<HGCW009> thisHGCW009List = DaoBase.getInstance().query(HGCW009.QUERY,new HashMap<String,Object>(){
{put("settlementNumber",settlementNumber);}
});
BigDecimal thisSettlementAmount = new BigDecimal(0);
BigDecimal thisSettlementTax = new BigDecimal(0);
AtomicReference<BigDecimal> cumulativeSettlementAmount = new AtomicReference<>(new BigDecimal(0));
AtomicReference<BigDecimal> cumulativeSettlementTax = new AtomicReference<>(new BigDecimal(0));
if (CollectionUtils.isNotEmpty(thisHGCW009List)) {
BigDecimal totalPrice = new BigDecimal(0);
BigDecimal deductionPrice= new BigDecimal(0);
for (int i = 0; i < thisHGCW009List.size(); i++) {
HGCW009 hgcw009 = thisHGCW009List.get(i);
if (hgcw009.getSettlementBasis().equals("合同内")) {
totalPrice = totalPrice.add(hgcw009.getTotalPrice());
} else {
deductionPrice = deductionPrice.add(hgcw009.getTotalPrice());
}
}
thisSettlementAmount = totalPrice.add(deductionPrice);
// * 劳务合同的本次结算税金: 明细的本次结算求和(不含扣款 )*税率
// * 销售合同的本次结算税金: 明细的本次结算求和*税率
if (contractType == 1) {
thisSettlementTax = new BigDecimal(decimalFormat.format(thisSettlementAmount.multiply(thisTaxPoints)));
} else {
thisSettlementTax = new BigDecimal(decimalFormat.format(totalPrice.multiply(thisTaxPoints)));
}
}
//其余的计算单
List<HGCW008> otherHGCW008List = hgcw008List.stream()
.filter(item -> !item.getSettlementNumber().equals(hgcw008.getSettlementNumber()))
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(otherHGCW008List)) {
otherHGCW008List.forEach(item -> {
// 找到对应的清单
BigDecimal taxPoints = new BigDecimal(decimalFormat.format(new BigDecimal(item.getTaxPoints()).divide(new BigDecimal(100))));
List<HGCW009> HGCW009List = DaoBase.getInstance().query(HGCW009.QUERY,new HashMap<String,Object>(){
{put("settlementNumber",item.getSettlementNumber());}
});
if (CollectionUtils.isNotEmpty(HGCW009List)) {
BigDecimal totalPrice = new BigDecimal(0);
BigDecimal deductionPrice= new BigDecimal(0);
for (int i = 0; i < HGCW009List.size(); i++) {
HGCW009 hgcw009 = HGCW009List.get(i);
if (hgcw009.getSettlementBasis().equals("合同内")) {
totalPrice = totalPrice.add(hgcw009.getTotalPrice());
} else {
deductionPrice = deductionPrice.add(hgcw009.getTotalPrice());
}
}
cumulativeSettlementAmount.set(totalPrice.add(deductionPrice));
if (contractType == 1) {
cumulativeSettlementTax.set(new BigDecimal(decimalFormat.format(cumulativeSettlementAmount.get().multiply(taxPoints))));
} else {
cumulativeSettlementTax.set(new BigDecimal(decimalFormat.format(totalPrice.multiply(taxPoints))));
}
}
});
}
// * 本次价税合计=本次结算金额+本次结算税金
// * 累计价税合计=累计结算金额+累计结算税金
BigDecimal thisPriceTax = new BigDecimal(decimalFormat.format(thisSettlementAmount.add(thisSettlementTax)));
BigDecimal cumulativePriceTax = new BigDecimal(decimalFormat.format(cumulativeSettlementAmount.get().add(cumulativeSettlementTax.get())));
hgcw008.setThisSettlementAmount(thisSettlementAmount);
hgcw008.setThisSettlementTax(thisSettlementTax);
hgcw008.setCumulativeSettlementAmount(thisSettlementAmount.add(cumulativeSettlementAmount.get()));
hgcw008.setCumulativeSettlementTax(thisSettlementTax.add(cumulativeSettlementTax.get()));
hgcw008.setThisPriceTax(thisPriceTax);
hgcw008.setCumulativePriceTax(thisPriceTax.add(cumulativePriceTax));
DaoUtils.update(HGCW008.UPDATE, hgcw008);
}
}
public static class HgCw999 {
......
<?xml version="1.0" encoding="UTF-8"?>
l<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSB007">
......
......@@ -64,6 +64,7 @@ public class HGSC007 extends DaoEPBase {
public static final String FIELD_updated_by = "updatedBy"; /* 更新人*/
public static final String FIELD_updated_name = "updatedName"; /* 修改人名称*/
public static final String FIELD_updated_time = "updatedTime"; /* 更新时间*/
public static final String FIELD_order_date = "orderDate"; /* 生产任务日期*/
public static final String COL_id = "id";
public static final String COL_mat_id = "mat_id"; /* 物料清单ID*/
......@@ -106,6 +107,7 @@ public class HGSC007 extends DaoEPBase {
public static final String COL_updated_by = "updated_by"; /* 更新人*/
public static final String COL_updated_name = "updated_name"; /* 修改人名称*/
public static final String COL_updated_time = "updated_time"; /* 更新时间*/
public static final String COL_order_date = "order_date"; /* 生产任务日期*/
public static final String QUERY = "HGSC007.query";
public static final String COUNT = "HGSC007.count";
......@@ -155,6 +157,8 @@ public class HGSC007 extends DaoEPBase {
private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 更新时间*/
private String orderDate = " "; /* 生产任务日期*/
/**
* initialize the metadata.
*/
......@@ -338,6 +342,9 @@ public class HGSC007 extends DaoEPBase {
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_order_date);
eiColumn.setDescName("生产任务日期");
eiMetadata.addMeta(eiColumn);
}
......@@ -1004,6 +1011,20 @@ public class HGSC007 extends DaoEPBase {
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* set the orderDate - 生产任务日期.
*
* @param orderDate - 生产任务日期
*/
public void setOrderDate(String orderDate) {
this.orderDate = orderDate;
}
public String getOrderDate() {
return orderDate;
}
/**
* get the value from Map.
*
......@@ -1053,6 +1074,7 @@ public class HGSC007 extends DaoEPBase {
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_by)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_name)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_updated_time)), updatedTime));
setOrderDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_order_date)), orderDate));
}
/**
......@@ -1103,6 +1125,7 @@ public class HGSC007 extends DaoEPBase {
map.put(FIELD_updated_by, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_updated_by)));
map.put(FIELD_updated_name, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_updated_name)));
map.put(FIELD_updated_time, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_updated_time)));
map.put(FIELD_order_date, StringUtils.toString(orderDate, eiMetadata.getMeta(FIELD_order_date)));
return map;
}
......
......@@ -82,10 +82,14 @@ public class ServiceHGSC006A extends ServiceBase {
}
// 写入子表数据
HGSC007 hgsc007 = new HGSC007();
String getCreatedTime = hgsc006.getCreatedTime(); //获取订单创建时间,并截取
String subCreatedTime =getCreatedTime.substring(0,8);
BeanUtils.copyProperties(hgsc006A,hgsc007);
cleanBaseInfo(hgsc007);
hgsc007.setTaskCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC007_TASCK_CODE));
hgsc007.setTaskCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC007_TASK_CODE));
hgsc007.setMatId(hgsc006.getMatId());
hgsc007.setOrderId(hgsc006.getId());
hgsc007.setOrderDate(subCreatedTime);
hgsc007.setOrderDetailId(hgsc006A.getId());
hgsc007.setQuantity(assignQuantity);
hgsc007.setTotalWeight(hgsc006A.getSingleWeight().multiply(new BigDecimal(assignQuantity)));
......
......@@ -183,10 +183,14 @@ public class ServiceHGSC006B extends ServiceBase {
HGSCTools.checkAssignedNum(orderDetailId, hgsc007.getQuantity());
HGSC007 add007 = new HGSC007();
String getCreatedTime = hgsc006.getCreatedTime(); //获取订单创建时间,并截取
String subCreatedTime =getCreatedTime.substring(0,8);
BeanUtils.copyProperties(hgsc006A,add007);
cleanBaseInfo(add007);
add007.setTaskCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC007_TASCK_CODE));
add007.setTaskCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGSC007_TASK_CODE));
add007.setMatId(hgsc006.getMatId());
add007.setOrderId(hgsc006.getId());
add007.setOrderDate(subCreatedTime);
add007.setOrderDetailId(hgsc006A.getId());
add007.setQuantity(hgsc007.getQuantity());
add007.setTotalWeight(hgsc006A.getSingleWeight().multiply(new BigDecimal(hgsc007.getQuantity())));
......
......@@ -106,7 +106,7 @@
product_code = #productCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="productName">
product_name = #productName#
product_name LIKE CONCAT('%', #productName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planStartDate">
plan_start_date = #planStartDate#
......@@ -124,7 +124,7 @@
group_code = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
group_name = #groupName#
group_name LIKE CONCAT('%', #groupName# ,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="completeDate">
complete_date = #completeDate#
......@@ -171,6 +171,9 @@
<isNotEmpty prepend=" AND " property="updatedTime">
updated_time = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="orderDate">
order_date = #orderDate#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -216,9 +219,11 @@
created_time as "createdTime", <!-- 创建时间 -->
updated_by as "updatedBy", <!-- 更新人 -->
updated_name as "updatedName", <!-- 修改人名称 -->
updated_time as "updatedTime" <!-- 更新时间 -->
updated_time as "updatedTime", <!-- 更新时间 -->
order_date as "orderDate" <!-- 生产任务日期 -->
FROM ${hggpSchema}.HGSC007 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -402,9 +407,10 @@
created_time, <!-- 创建时间 -->
updated_by, <!-- 更新人 -->
updated_name, <!-- 修改人名称 -->
updated_time <!-- 更新时间 -->
updated_time, <!-- 更新时间 -->
order_date <!-- 生产任务日期 -->
)
VALUES (#id#, #matId#, #orderId#, #orderDetailId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #taskCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #completeDate#, #quantity#, #finishQuantity#, #unfinishQuantity#, #singleWeight#, #totalWeight#, #finishWeight#, #unfinishWeight#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#)
VALUES (#id#, #matId#, #orderId#, #orderDetailId#, #techFlowId#, #techFlowName#, #inventProcessId#, #processCode#, #processName#, #processOrder#, #companyCode#, #companyName#, #depCode#, #depName#, #projCode#, #projName#, #taskCode#, #productType#, #productCode#, #productName#, #planStartDate#, #planEndDate#, #factoryCode#, #factoryName#, #groupCode#, #groupName#, #completeDate#, #quantity#, #finishQuantity#, #unfinishQuantity#, #singleWeight#, #totalWeight#, #finishWeight#, #unfinishWeight#, #accountCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#,#orderDate#)
</insert>
<delete id="delete">
......@@ -454,7 +460,8 @@
created_time = #createdTime#, <!-- 创建时间 -->
updated_by = #updatedBy#, <!-- 更新人 -->
updated_name = #updatedName#, <!-- 修改人名称 -->
updated_time = #updatedTime# <!-- 更新时间 -->
updated_time = #updatedTime#, <!-- 更新时间 -->
order_date = #orderDate# <!-- 生产任务日期 -->
WHERE
id = #id#
</update>
......
......@@ -682,7 +682,7 @@ public class HGSCTools {
public static class THGSC007{
public static HGSC007 getById(Long taskId){
AssertUtils.isTrue(Objects.isNull(taskId)||taskId<=0, "生产任务ID不能为空!");
HGSC007 results = (HGSC007)DaoBase.getInstance().get(HGSC006A.QUERY, HGSC007.FIELD_id, taskId);
HGSC007 results = (HGSC007)DaoBase.getInstance().get(HGSC007.QUERY, HGSC007.FIELD_id, taskId);
return results;
}
/**
......
......@@ -81,6 +81,10 @@ function updateFunc() {
message("请选择一条数据");
return;
}
if (rows[0].reviewStatus == "3") {
message("已经提交的数据不能进行修改!");
return;
}
JSColorbox.open({
href: "HGCW002B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW002",
title: "<div style='text-align: center;'>修改合同</div>",
......
......@@ -15,7 +15,7 @@ $(function() {
pageSizes: [10,20,30,50,100,200],
},
/**
* 签证详情,附件详情
* 附件上传
*/
columns: [{
field: "operator",
......@@ -24,8 +24,8 @@ $(function() {
let auditStatus = item.status;
let template = '';
if (item.id) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')">附件详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="fileDetailFunc(' + item.id + ')" >附件上传</a>';
}
return template;
......@@ -55,6 +55,11 @@ $(function() {
e.preventDefault();
deleteFunc();
},
loadComplete: function (e) {
$("#BTN_SUBMIT").on("click",submitFunc);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
......@@ -99,39 +104,45 @@ function saveFunc() {
return;
}
let flag = true;
// $.each(rows, function(index, item) {
// let companyCode= item.get("companyCode");
// let accountYear= item.get("accountYear");
// let accountPeriod= item.get("accountPeriod");
// let accountPeriodDateStart= item.get("accountPeriodStatus");
// let accountPeriodDateEnd= item.get("accountPeriodStatus");
//
// if(isBlank(companyCode)){
// message("选中的第"+(index+1)+"行\"公司名称\",不能为空!");
// flag = false;
// return false;
// }
// if(isBlank(accountYear)){
// message("选中的第"+(index+1)+"行\"会计年度\",不能为空!");
// flag = false;
// return false;
// }
// if(isBlank(accountPeriod)){
// message("选中的第"+(index+1)+"行\"会计期\",不能为空!");
// flag = false;
// return false;
// }
// if(isBlank(accountPeriodDateStart)){
// message("选中的第"+(index+1)+"行\"账期开始日期\",不能为空!");
// flag = false;
// return false;
// }
// if(isBlank(accountPeriodDateEnd)){
// message("选中的第"+(index+1)+"行\"账期结束日期\",不能为空!");
// flag = false;
// return false;
// }
// });
$.each(rows, function(index, item) {
let projCode= item.get("projCode");
let projactDetail= item.get("projactDetail");
let contractContent= item.get("contractContent");
let totalContractPriceIncluding= item.get("totalContractPriceIncluding");
let signingDate= item.get("signingDate");
let reviewStatus= item.get("reviewStatus");
if(isBlank(projCode)){
message("选中的第"+(index+1)+"行\"项目编号\",不能为空!");
flag = false;
return false;
}
if(isBlank(projactDetail)){
message("选中的第"+(index+1)+"行\"项目部位\",不能为空!");
flag = false;
return false;
}
if(isBlank(contractContent)){
message("选中的第"+(index+1)+"行\"签证事由及内容\",不能为空!");
flag = false;
return false;
}
if(isBlank(totalContractPriceIncluding)){
message("选中的第"+(index+1)+"行\"含税金额\",不能为空!");
flag = false;
return false;
}
if(isBlank(signingDate)){
message("选中的第"+(index+1)+"行\"签订日期\",不能为空!");
flag = false;
return false;
}
if((reviewStatus === "3")){
message("数据已提交");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
......@@ -264,3 +275,50 @@ function fileDetailFunc(id) {
height: "80%",
});
}
//提交功能
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
var flag = true;
rows.forEach(function (row) {
if (row.reviewStatus == "3") {
message("勾选的数据中有已经提交的合同!");
flag = false;
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW004", "submit", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
}
\ No newline at end of file
......@@ -51,10 +51,10 @@
<EF:EFColumn ename="partyA" cname="甲方名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="partyB" cname="乙方名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="projactDetail" cname="项目部位" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="contractContent" cname="签证事由及内容" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="含税金额" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="signingDate" cname="签订日期" width="120" enable="true" readonly="true" align="center" editType="date"
<EF:EFColumn ename="projactDetail" cname="项目部位" width="120" enable="true" align="center" required="true"/>
<EF:EFColumn ename="contractContent" cname="签证事由及内容" width="120" enable="true" align="center" required="true"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="含税金额" width="120" enable="true" align="center" required="true"/>
<EF:EFColumn ename="signingDate" cname="签订日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
......
$(function () {
IPLATUI.EFUpload = {
uploadFile: {
success: function(e) {
let docId = e.response.docId;
let docName = e.response.docName;
let id = $("#inqu_status-0-id").val()
if (isBlank(docId)) {
return;
}
$("#fileDocId").val(docId);
NotificationUtil("附件上传成功");
//saveTemp(e);
try {
parent.JSColorbox.setValueCallback({"id":id,"docId":docId,"docName":docName});
parent.JSColorbox.close();
} catch (e){
}
},
}
};
function saveTemp(e) {
let docId = e.response.docId;
let docName = e.response.docName;
let docSize = e.response.docSize;
let docTag = e.response.docTag;
let docUrl = e.response.docUrl;
let result = new EiInfo();
result.set("result-0-docId",docId);
result.set("result-0-docName",docName);
result.set("result-0-docSize",docSize);
result.set("result-0-docTag",docTag);
result.set("result-0-realPath",docUrl);
result.set("result-0-bizType",$("#inqu_status-0-bizType").val());
result.set("result-0-matId",$("#inqu_status-0-matId").val());
EiCommunicator.send("HPDS002", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/10
Time: 16:38
To change this template use File | Settings | File Templates.
--%>
<!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:EFInput blockId="inqu_status" row="0" ename="id" cname="ID" type="hidden"/>
<EF:EFRegion id="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="hg_file003" path="A"/>
</EF:EFRegion>
<EF:EFInput ename="fileDocId" cname="" hidden="true"/>
</EF:EFPage>
......@@ -104,7 +104,39 @@ function saveFunc() {
return;
}
let flag = true;
$.each(rows, function(index, item) {
let projCode= item.get("projCode");
let contractContent= item.get("contractContent");
let totalContractPriceIncluding= item.get("totalContractPriceIncluding");
let signingDate= item.get("signingDate");
let reviewStatus= item.get("reviewStatus");
if(isBlank(projCode)){
message("选中的第"+(index+1)+"行\"项目编号\",不能为空!");
flag = false;
return false;
}
if(isBlank(contractContent)){
message("选中的第"+(index+1)+"行\"扣款事由\",不能为空!");
flag = false;
return false;
}
if(isBlank(totalContractPriceIncluding)){
message("选中的第"+(index+1)+"行\"扣款金额\",不能为空!");
flag = false;
return false;
}
if(isBlank(signingDate)){
message("选中的第"+(index+1)+"行\"扣款日期\",不能为空!");
flag = false;
return false;
}
if((reviewStatus === "3")){
message("数据已提交");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
......@@ -188,6 +220,7 @@ function updateStatus(id,deviceStatus) {
}
);
}
//提交功能
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
......@@ -234,7 +267,7 @@ function submitFunc() {
}
}
//附件功能
function fileDetailFunc(id) {
JSColorbox.open({
href: "HGCW999?methodName=initLoad&inqu_status-0-bizType=KK&inqu_status-0-matId=" + id + "&efParentFormEname=HGCW005",
......
......@@ -50,11 +50,11 @@
<EF:EFColumn ename="contractName" 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="partyB" cname="乙方名称" width="120" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="contractContent" cname="扣款事由" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="扣款金额" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="signingDate" cname="扣款日期" width="120" enable="true" readonly="true" align="center" editType="date"
<EF:EFColumn ename="contractContent" cname="扣款事由" width="120" enable="true" align="center" required="true"/>
<EF:EFColumn ename="totalContractPriceIncluding" cname="扣款金额" width="120" enable="true" align="center" required="true"/>
<EF:EFColumn ename="signingDate" cname="扣款日期" width="120" enable="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyy-MM-dd']" required="true"/>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center" required="true"
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFComboColumn>
......
$(function () {
IPLATUI.EFUpload = {
uploadFile: {
success: function(e) {
let docId = e.response.docId;
let docName = e.response.docName;
let id = $("#inqu_status-0-id").val()
if (isBlank(docId)) {
return;
}
$("#fileDocId").val(docId);
NotificationUtil("附件上传成功");
//saveTemp(e);
try {
parent.JSColorbox.setValueCallback({"id":id,"docId":docId,"docName":docName});
parent.JSColorbox.close();
} catch (e){
}
},
}
};
function saveTemp(e) {
let docId = e.response.docId;
let docName = e.response.docName;
let docSize = e.response.docSize;
let docTag = e.response.docTag;
let docUrl = e.response.docUrl;
let result = new EiInfo();
result.set("result-0-docId",docId);
result.set("result-0-docName",docName);
result.set("result-0-docSize",docSize);
result.set("result-0-docTag",docTag);
result.set("result-0-realPath",docUrl);
result.set("result-0-bizType",$("#inqu_status-0-bizType").val());
result.set("result-0-matId",$("#inqu_status-0-matId").val());
EiCommunicator.send("HPDS002", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/10
Time: 16:38
To change this template use File | Settings | File Templates.
--%>
<!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:EFInput blockId="inqu_status" row="0" ename="id" cname="ID" type="hidden"/>
<EF:EFRegion id="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="hg_file003" path="A"/>
</EF:EFRegion>
<EF:EFInput ename="fileDocId" cname="" hidden="true"/>
</EF:EFPage>
......@@ -81,6 +81,10 @@ function updateFunc() {
message("请选择一条数据");
return;
}
if (rows[0].reviewStatus == "3") {
message("已经提交的数据不能进行修改!");
return;
}
JSColorbox.open({
href: "HGCW006B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW006",
title: "<div style='text-align: center;'>修改合同</div>",
......
......@@ -8,6 +8,7 @@
</head>
<EF:EFPage title="修改合同">
<EF:EFRegion id="inqu1" title="基本信息">
<EF:EFInput ename="result-0-id" cname="id" type="hidden"/>
<div class="row">
<EF:EFSelect cname="项目编号" ename="projCodeBox" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
......
......@@ -79,6 +79,10 @@ function updateFunc() {
message("请选择一条数据");
return;
}
if (rows[0].reviewStatus == "3") {
message("已经提交的数据不能进行修改!");
return;
}
JSColorbox.open({
href: "HGCW008B?methodName=initLoad&id=" + rows[0].id + "&efParentFormEname=HGCW008",
title: "<div style='text-align: center;'>修改结算单</div>",
......
......@@ -205,8 +205,10 @@ function choiceFunc() {
}
function choiceCallbackFunc(result) {
$.each(result, function(index, item) {
function choiceCallbackFunc(result1, result2) {
var contractType = $("#contractType").val();
if (contractType == "1") {
$.each(result1, function(index, item) {
detail1Grid.dataSource.insert();
detail1Grid.setCellValue(0, "rowNo", 0);
detail1Grid.setCellValue(0, "settlementBasis", "合同内");
......@@ -216,6 +218,29 @@ function choiceCallbackFunc(result) {
detail1Grid.setCellValue(0, "inventoryId", item.id);
detail1Grid.refresh();
})
} else {
$.each(result1, function(index, item) {
detail1Grid.dataSource.insert();
detail1Grid.setCellValue(0, "rowNo", 0);
detail1Grid.setCellValue(0, "settlementBasis", "合同内");
detail1Grid.setCellValue(0, "taskName", item.inventory);
detail1Grid.setCellValue(0, "unit", item.unit);
detail1Grid.setCellValue(0, "unitPrice", item.unitPriceExcludingTax);
detail1Grid.setCellValue(0, "inventoryId", item.id);
detail1Grid.refresh();
})
$.each(result2, function(index, item) {
detail1Grid.dataSource.insert();
detail1Grid.setCellValue(0, "rowNo", 0);
detail1Grid.setCellValue(0, "settlementBasis", "罚款");
detail1Grid.setCellValue(0, "taskName", item.projName);
detail1Grid.setCellValue(0, "unitPrice", item.totalContractPriceIncluding * -1);
detail1Grid.setCellValue(0, "remarks", item.contractContent);
detail1Grid.setCellValue(0, "inventoryId", item.id);
detail1Grid.refresh();
})
}
JSColorbox.close();
}
function cancelFunc() {
......
var sumCumulativeSettlementAmount = 0;
var sumCumulativeSettlementTax = 0;
$(function() {
......@@ -16,84 +18,77 @@ $(function() {
columns: [
],
loadComplete: function (grid) {
$("#BTN_CHOICE").on("click",choiceFunc);
grid.dataSource.bind("change", function(e) {
if (e.field == "dayNumber") {
if (e.field == "thisEngineeringQuantity") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
// 计算总金额
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 totalPrice = deviceNumber * unitPrice * dayNumber;
var inventoryId = item.inventoryId;
var thisEngineeringQuantity = parseFloat(item.thisEngineeringQuantity) || 0; // 工程量
var unitPrice = parseFloat(item.unitPrice) || 0; // 单价
var totalPrice = thisEngineeringQuantity * unitPrice; // 总价
detail1Grid.setCellValue(item, 'totalPrice', parseFloat(totalPrice));
console.log(grid.dataSource._data);
console.log(detail1Grid.getDataItems());
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);
var cumulativeEngineeringQuantity = queryCumulativeEngineeringQuantity(inventoryId);
detail1Grid.setCellValue(item, 'cumulativeEngineeringQuantity', thisEngineeringQuantity + cumulativeEngineeringQuantity);
// 计算总金额
calculateAmount(detail1Grid.getDataItems());
}
});
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))
grid.dataSource.bind("change", function(e) {
if (e.field == "unitPrice") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
var inventoryId = item.inventoryId;
var thisEngineeringQuantity = parseFloat(item.thisEngineeringQuantity) || 0; // 工程量
var unitPrice = parseFloat(item.unitPrice) || 0; // 单价
var totalPrice = thisEngineeringQuantity * unitPrice; // 总价
detail1Grid.setCellValue(item, 'totalPrice', parseFloat(totalPrice));
// 计算总金额
calculateAmount(detail1Grid.getDataItems());
}
});
setTimeout(function() {
initDate();
}, 1000);
},
beforeAdd :function (e) {
console.log("新增前");
var contractType = $("#contractType").val();
if (contractType == "1") {
} else {
message("劳务合同不可新增!");
e.preventDefault();
}
},
onAdd: function (e) {
var contractNumber = $("#result-0-contractNumber").val();
var settlementNumber = $("#result-0-settlementNumber").val();
$.each(e.items, function (index, item) {
item['settlementNumber'] = settlementNumber;
});
var contractType = $("#contractType").val();
if (contractType == "1") {
$.each(e.items, function (index, item) {
item['contractNumber'] = contractNumber;
item['settlementBasis'] = "罚款";
});
}
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
saveResult1Func(btnNode);
saveResult1Func();
calculateAmount(detail1Grid.getDataItems());
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteResult1Func();
calculateAmount(detail1Grid.getDataItems());
},
}
$("#UPLOAD_FILE").on("click", function () {
uploadFileFunc();
});
$("#DELETE_FILE").on("click", function () {
// let btnNode = $(this);
//禁用按钮
// btnNode.attr("disabled", true);
deleteFileFunc();
});
IPLATUI.EFGrid.detail2 = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
]
}
/**
* 下拉框事件
* @type {{"result-0-contractType": {select: IPLATUI.EFSelect.result-0-contractType.select}, projCodeBox: {select: IPLATUI.EFSelect.projCodeBox.select}}}
......@@ -117,19 +112,9 @@ $(function() {
}
}
IPLATUI.EFPopupInput = {
"popupInputPartyA": {
/**
* EFGrid 查询时触发的事件,通常在此处,设置查询条件
* 注意: 必须返回一个EiInfo,作为初始查询条件
* 配置了query时,默认每次打开窗口都会进行一次查询
*/
query: function (e) {
console.log("Step" + (++i) + ": ----query----");
var info = new EiInfo();
return info;
},
IPLATUI.EFPopupInput = {
"popupInputProjCode": {
/**
* grid中的数据回填时触发的事件
* @param e 回填数据事件
......@@ -141,12 +126,26 @@ $(function() {
console.log("Step" + (++i) + ": ----backFill----");
// 回填数据
var model = e.model;
// var data = model.toJSON();
console.log(model);
var partyA = model.usercode + "-" + model.username;
$("#result-0-partyA").val(partyA);
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , partyA)
e.preventDefault(); // 不使用默认的回填逻辑
var contractNumber = model.contractNumber;
var info = new EiInfo();
info.set("contractNumber", contractNumber);
EiCommunicator.send("HGCW008", "queryCalculateAmount", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
var data = ei.extAttr.result;
sumCumulativeSettlementAmount = data[0].sumCumulativeSettlementAmount;
sumCumulativeSettlementTax = data[0].sumCumulativeSettlementTax;
} else {
NotificationUtil(ei, "error");
return 0;
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
return 0;
}
});
}
}
};
......@@ -160,139 +159,230 @@ $(function() {
}
})
});
function initDate() {
var projCode = $("#result-0-projCode").val();
$("#projCodeBox").data("kendoDropDownList").value(projCode);
var partyA = $("#result-0-partyA").val();
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , partyA)
function choiceFunc() {
var contractType = $("#contractType").val();
var contractNumber = $("#result-0-contractNumber").val();
if (contractNumber) {
//获取已经加载的合同清单数据
var inventoryIds = [];
var deductionIds = [];
let allRows = new Array();
allRows = detail1Grid.getDataItems();
if (allRows) {
allRows.forEach(function (row, index) {
if (row.settlementBasis == "合同内") {
inventoryIds.push(row.inventoryId);
} else {
if (row.inventoryId) {
deductionIds.push(row.inventoryId);
}
}
})
}
if (contractType == "1") {
JSColorbox.open({
href: "HGCW008D?methodName=initLoad&inqu_status-0-contractNumber=" + contractNumber +
"&inqu_status-0-inventoryIds=" + inventoryIds.join(","),
title: "<div style='text-align: center;'>合同清单</div>",
width: "80%",
height: "80%",
dispaly: "flex",
callbackName: choiceCallbackFunc
});
$("#JSColorboxWin").css({"height": "100%"})
} else {
JSColorbox.open({
href: "HGCW008E?methodName=initLoad&inqu_status-0-contractNumber=" + contractNumber +
"&inqu_status-0-inventoryIds=" + inventoryIds.join(",") +
"&inqu_status-0-deductionIds=" + deductionIds.join(","),
title: "<div style='text-align: center;'>合同清单</div>",
width: "80%",
height: "80%",
dispaly: "flex",
callbackName: choiceCallbackFunc
});
$("#JSColorboxWin").css({"height": "100%"})
}
} else {
message("请先选择合同!");
}
}
function saveResult1Func(btn) {
let rows = detail1Grid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
function choiceCallbackFunc(result1, result2) {
var contractType = $("#contractType").val();
if (contractType == "1") {
$.each(result1, function(index, item) {
detail1Grid.dataSource.insert();
detail1Grid.setCellValue(0, "rowNo", 0);
detail1Grid.setCellValue(0, "settlementBasis", "合同内");
detail1Grid.setCellValue(0, "taskName", item.inventory);
detail1Grid.setCellValue(0, "unit", item.unit);
detail1Grid.setCellValue(0, "unitPrice", item.unitPriceExcludingTax);
detail1Grid.setCellValue(0, "inventoryId", item.id);
detail1Grid.refresh();
})
} else {
$.each(result1, function(index, item) {
detail1Grid.dataSource.insert();
detail1Grid.setCellValue(0, "rowNo", 0);
detail1Grid.setCellValue(0, "settlementBasis", "合同内");
detail1Grid.setCellValue(0, "taskName", item.inventory);
detail1Grid.setCellValue(0, "unit", item.unit);
detail1Grid.setCellValue(0, "unitPrice", item.unitPriceExcludingTax);
detail1Grid.setCellValue(0, "inventoryId", item.id);
detail1Grid.refresh();
})
$.each(result2, function(index, item) {
detail1Grid.dataSource.insert();
detail1Grid.setCellValue(0, "rowNo", 0);
detail1Grid.setCellValue(0, "settlementBasis", "罚款");
detail1Grid.setCellValue(0, "taskName", item.projName);
detail1Grid.setCellValue(0, "unitPrice", item.totalContractPriceIncluding * -1);
detail1Grid.setCellValue(0, "remarks", item.contractContent);
detail1Grid.setCellValue(0, "inventoryId", item.id);
detail1Grid.refresh();
})
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
JSColorbox.close();
}
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function btnSaveFunc() {
fieldValidation();
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail1", "HGCW008", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
}
});
}
function queryCumulativeEngineeringQuantity(inventoryId) {
if (inventoryId) {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("detail1"));
EiCommunicator.send("HGCW003", "save", info, {
info.set("inventoryId", inventoryId);
EiCommunicator.send("HGCW009", "queryEngineeringQuantity", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
NotificationUtil(response.msg);
} catch (e) {
// TODO: handle exception
}
if (IPLAT.isAvailable("detail1")) {
window['detail1Grid'].setEiInfo(ei);
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
return ei.result
} else {
NotificationUtil(ei, "error");
return 0;
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
return 0;
}
});
//释放禁用按钮
btn.attr("disabled", false);
}
});
return 0;
}
function uploadFileFunc() {
var id = $("#result-0-id").val();
JSColorbox.open({
href: "HGCW099?methodName=initLoad&inqu_status-0-bizType=ZL&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
* 本次结算金额: 明细的本次结算求和
* 累计结算金额: 当前合同的所有结算单本次结算金额求和
* 本次结算税金: 明细的本次结算求和(不含扣款 )*税率
* 累计结算税金:当前合同的所有结算单的“本次结算税金”求和
* 本次价税合计=本次结算金额+本次结算税金
* 累计价税合计=累计结算金额+累计结算税金
* 劳务合同的本次结算税金: 明细的本次结算求和(不含扣款 )*税率
* 销售合同的本次结算税金: 明细的本次结算求和*税率
* @param rows
*/
function uploadFileCallback(data) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-matId", data.matId);
inEiInfo.set("result-0-docId", data.docId);
inEiInfo.set("result-0-bizType", data.bizType);
EiCommunicator.send('HGCW999', 'insert', inEiInfo, {
onSuccess(ei) {
if (ei.status === 0) {
try {
NotificationUtil(ei.msg);
} catch (e) {
// TODO: handle exception
}
if (IPLAT.isAvailable("detail2")) {
window['detail2Grid'].setEiInfo(ei);
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
function calculateAmount(rows) {
var contractType = $("#contractType").val();
var totalPrice = 0;
var deductionPrice= 0;
rows.forEach(function (row, index) {
if (row.settlementBasis == "合同内") {
totalPrice += parseFloat(row.totalPrice);
} else {
NotificationUtil(ei);
deductionPrice += parseFloat(row.totalPrice);
}
});
//税点
var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() / 100 : 0;
//本次结算金额
var thisSettlementAmount = totalPrice + deductionPrice;
//累计结算金额
var cumulativeSettlementAmount = sumCumulativeSettlementAmount + thisSettlementAmount;
//本次结算税金
var thisSettlementTax = 0;
if (contractType == "1") {
thisSettlementTax = thisSettlementAmount * taxPoints;
} else {
thisSettlementTax = totalPrice * taxPoints;
}
//累计结算税金
var cumulativeSettlementTax = sumCumulativeSettlementTax + thisSettlementTax;
//本次价税合计=本次结算金额+本次结算税金
var thisPriceTax = parseFloat(thisSettlementAmount) + parseFloat(thisSettlementTax);
//累计价税合计=累计结算金额+累计结算税金
var cumulativePriceTax = parseFloat(cumulativeSettlementAmount) + parseFloat(cumulativeSettlementTax);
$("#result-0-thisSettlementAmount").val(parseFloat(thisSettlementAmount).toFixed(3))
$("#result-0-cumulativeSettlementAmount").val(parseFloat(cumulativeSettlementAmount).toFixed(3))
$("#result-0-thisSettlementTax").val(parseFloat(thisSettlementTax).toFixed(3))
$("#result-0-cumulativeSettlementTax").val(parseFloat(cumulativeSettlementTax).toFixed(3))
$("#result-0-thisPriceTax").val(parseFloat(thisPriceTax).toFixed(3))
$("#result-0-cumulativePriceTax").val(parseFloat(cumulativePriceTax).toFixed(3))
}
function initDate() {
var projCode = $("#result-0-projCode").val();
var contractNumber = $("#result-0-contractNumber").val();
IPLAT.EFPopupInput.text( $("#popupInputProjCode") , projCode)
//根据合同回去合同类型
var info = new EiInfo();
info.set("contractNumber", contractNumber);
EiCommunicator.send("HGCW002", "queryContractByNumber", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
var data = ei.extAttr.hgcw002;
$("#contractType").val(data.contractType);
} else {
NotificationUtil("执行失败!", "error");
NotificationUtil(ei, "error");
return 0;
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
return 0;
}
}, {
async: false
});
}
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function btnSaveFunc() {
fieldValidation();
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail1,detail2", "HGCW002", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
}
});
}
function deleteFileFunc() {
let rows = detail2Grid.getCheckedRows();
function saveResult1Func(btn) {
let rows = detail1Grid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("detail2"));
EiCommunicator.send("HGCW999", "delete", info, {
info.addBlock(JSUtils.checkedRows2Block("detail1"));
EiCommunicator.send("HGCW009", "save", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
NotificationUtil(ei.msg);
NotificationUtil(response.msg);
} catch (e) {
// TODO: handle exception
}
if (IPLAT.isAvailable("detail2")) {
window['detail2Grid'].setEiInfo(ei);
if (IPLAT.isAvailable("detail1")) {
window['detail1Grid'].setEiInfo(ei);
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
......@@ -309,12 +399,10 @@ function deleteFileFunc() {
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
//释放禁用按钮
// btn.attr("disabled", false);
}
});
}
function deleteResult1Func() {
let rows = detail1Grid.getCheckedRows();
if (rows.length < 1) {
......@@ -325,7 +413,7 @@ function deleteResult1Func() {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("detail1"));
EiCommunicator.send("HGCW003", "delete", info, {
EiCommunicator.send("HGCW009", "delete", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
......@@ -355,31 +443,9 @@ function deleteResult1Func() {
}
});
}
function fieldValidation() {
function calculateAmount() {
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))
}
function fieldValidation() {
var contractType = $("#result-0-contractType").val();
if (contractType == "3") {
var mainContractNumber = $("#result-0-mainContractNumber").val();
if (!mainContractNumber) {
message("请填写主合同号!");
return;
}
}
}
......@@ -8,6 +8,7 @@
</head>
<EF:EFPage title="修改结算单">
<EF:EFRegion id="inqu1" title="基本信息">
<EF:EFInput ename="result-0-id" cname="id" type="hidden"/>
<div class="row">
<EF:EFPopupInput ename="popupInputProjCode" cname="项目编号" colWidth="4"
serviceName="HGCW002" methodName="queryContractByType"
......@@ -65,8 +66,8 @@
<EF:EFRegion id="detail1" title="合同清单">
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="settlementNumber" cname="结算单" hidden="true"/>
<EF:EFColumn ename="settlementBasis" cname="结算依据" align="center" />
<EF:EFColumn ename="taskName" cname="任务名称" align="center" />
<EF:EFColumn ename="engineeringContent" cname="工程内容" align="center" />
......
$(function() {
IPLATUI.EFGrid.detail1 = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
]
}
});
<!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}"/>
<head>
</head>
<EF:EFPage title="修改结算单">
<EF:EFRegion id="inqu1" title="基本信息">
<EF:EFInput ename="result-0-id" cname="id" type="hidden"/>
<div class="row">
<EF:EFInput ename="result-0-projCode" cname="项目编号" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-projName" cname="项目简称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-contractNumber" cname="合同号" colWidth="4" readonly="true" />
<EF:EFInput ename="contractType" cname="合同类型" type="hidden"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-settlementNumber" cname="结算编号" colWidth="4" readonly="true"/>
<EF:EFSelect cname="结算类别" ename="result-0-settlementType" colWidth="4" filter="contains" readonly="true" enable="false">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.settlementType"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="税点" ename="result-0-taxPoints" colWidth="4" filter="contains" readonly="true" enable="false">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFSelect>
<EF:EFSelect cname="价税分离" ename="result-0-priceTaxSeparation" colWidth="4" filter="contains" readonly="true" enable="false">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.priceTaxSeparation"/>
</EF:EFSelect>
<EF:EFDatePicker cname="结算日期" ename="result-0-contractDate" colWidth="4"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true" enable="false"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-thisSettlementAmount" cname="本次结算金额(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-thisSettlementTax" cname="本次结算税金(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-thisPriceTax" cname="本次结算价税合计金额(元)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-totalContractPrice" cname="合同金额(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-cumulativeSettlementAmount" cname="累计结算金额(元)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-cumulativeSettlementTax" cname="累计结算税金(元)" colWidth="4" readonly="true"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-cumulativePriceTax" cname="累计结算价税合计金额(元)" colWidth="4" readonly="true"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="detail1" title="合同清单">
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="settlementNumber" cname="结算单" hidden="true"/>
<EF:EFColumn ename="settlementBasis" cname="结算依据" align="center" readonly="true" enable="false"/>
<EF:EFColumn ename="taskName" cname="任务名称" align="center" readonly="true" enable="false"/>
<EF:EFColumn ename="engineeringContent" cname="工程内容" align="center" readonly="true" enable="false"/>
<EF:EFColumn ename="thisEngineeringQuantity" cname="本次结算工程量" format="{0:N3}" align="center" readonly="true" enable="false"/>
<EF:EFColumn ename="cumulativeEngineeringQuantity" cname="至本次累计结算工程量" format="{0:N3}" align="center" readonly="true" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" align="center" readonly="true" enable="false"/>
<EF:EFColumn ename="unitPrice" cname="单价" format="{0:N3}" align="center" readonly="true" enable="false"/>
<EF:EFColumn ename="totalPrice" cname="合价" format="{0:N3}" align="center" readonly="true" enable="false"/>
<EF:EFColumn ename="remarks" cname="备注" align="center" readonly="true" enable="false"/>
<EF:EFColumn ename="inventoryId" cname="清单id" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HG/CW/HGCW008B.js"></script>
\ No newline at end of file
$(function () {
IPLATUI.EFGrid = {
"result": {
"result1": {
toolbarConfig: {
hidden: true, // true时,不显示功能按钮,但保留setting导出按钮
},
query: {
},
columns: []
},
"result2": {
toolbarConfig: {
hidden: true, // true时,不显示功能按钮,但保留setting导出按钮
},
......@@ -22,13 +31,16 @@ $(function () {
* 确认
*/
$('#confirm').on('click', function () {
let allRows = new Array();
allRows = resultGrid.getCheckedRows();
if (allRows.length > 0) {
parent.JSColorbox.setValueCallback(allRows);
let result1Rows = new Array();
let result2Rows = new Array();
result1Rows = result1Grid.getCheckedRows();
result2Rows = result2Grid.getCheckedRows();
if (result1Rows.length > 0 || result2Rows.length > 0) {
parent.JSColorbox.setValueCallback(result1Rows,result2Rows);
} else {
message("请选择至少一条合同清单!");
message("请选择至少一条数据!");
return;
}
})
......@@ -40,7 +52,9 @@ $(function () {
* 查询
*/
function query() {
resultGrid.dataSource.page(1);
result1Grid.dataSource.page(1);
result2Grid.dataSource.page(1);
}
$(window).load(function () {
......
......@@ -10,7 +10,7 @@
<EF:EFInput cname="IDS" ename="inventoryIds" blockId="inqu_status" row="0" type="hidden" />
<EF:EFInput cname="DIDS" ename="deductionIds" blockId="inqu_status" row="0" type="hidden" />
<EF:EFRegion id="result1" title="合同清单">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFGrid blockId="result1" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="inventory" cname="清单" align="center" enable="false"/>
<EF:EFColumn ename="unit" cname="单位" align="center" enable="false"/>
......@@ -24,7 +24,7 @@
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="result2" title="扣款单">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFGrid blockId="result2" autoDraw="override" isFloat="true" queryMethod="query2">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="projCode" cname="项目编号" align="center" enable="false"/>
<EF:EFColumn ename="projName" cname="项目名称" align="center" enable="false"/>
......
......@@ -121,6 +121,14 @@ function query() {
}
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
})
/**
* 保存
*/
let save = function () {
......
$(function () {
$("#QUERY").on("click", function () {
resultGrid.dataSource.page(1);
});
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="showUploadFile(' + item.matId + ')" >附件清单</a>';
return template;
}
}
],
loadComplete: function(grid) {
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'||e.eiInfo.extAttr.methodName == 'delete' ){
query();
}
}
}
});
/**
* 显示附件详情
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HGSC004D?methodName=initLoad&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/5/10
Time: 15:29
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="生产任务">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="productName" cname="产品名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="groupName" cname="班组名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="orderDate" cname="生产任务日期" role="date"
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"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="账套" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="220" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="true" width="120" align="center" readOnly="true"/>
<EF:EFColumn ename="orderDate" cname="生产任务日期" width="120" enable="true" readonly="false" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="taskCode" cname="生产任务单号" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="productCode" cname="产品编码" width="100" enable="false" readonly="true" align="center"/>
<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="groupName" cname="生产班组" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="singleWeight" cname="单重" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="totalWeight" cname="任务总重" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="finishWeight" cname="完工总重" width="100" enable="false" readonly="true" align="center"/>
<EF:EFColumn ename="unfinishWeight" 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="unfinishQuantity" cname="未完工数量" width="100" enable="false" readonly="true" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
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