Commit 3e13ed28 by yukang

合同管理

parent 94eb1b65
...@@ -241,6 +241,12 @@ public enum DdynamicEnum { ...@@ -241,6 +241,12 @@ public enum DdynamicEnum {
*/ */
PLAN_PROCESS_BLOCK_ID("plan_process_block_id", "processName", "processName", "HGSC005A.queryProcessComboBox"), PLAN_PROCESS_BLOCK_ID("plan_process_block_id", "processName", "processName", "HGSC005A.queryProcessComboBox"),
/**
* 合同
*/
CONTRACT_BLOCK_ID("contract_block_id", "contractNumber", "contractName", "HGCW002.queryComboBox"),
/** /**
* *
*/ */
......
...@@ -5,6 +5,7 @@ import com.baosight.hggp.common.DdynamicEnum; ...@@ -5,6 +5,7 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.domain.HGCW002; import com.baosight.hggp.hg.cw.domain.HGCW002;
import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.tools.HGCWTools; import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO; import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
...@@ -14,10 +15,14 @@ import com.baosight.iplat4j.core.ei.EiConstant; ...@@ -14,10 +15,14 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.util.StringUtils;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -99,6 +104,21 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -99,6 +104,21 @@ public class ServiceHGCW002 extends ServiceBase {
HGCW002.setPlanStartDate(DateUtils.formatShort(HGCW002.getPlanStartDate())); HGCW002.setPlanStartDate(DateUtils.formatShort(HGCW002.getPlanStartDate()));
HGCW002.setPlanEndDate(DateUtils.formatShort(HGCW002.getPlanEndDate())); HGCW002.setPlanEndDate(DateUtils.formatShort(HGCW002.getPlanEndDate()));
HGCW002.setSigningDate(DateUtils.formatShort(HGCW002.getSigningDate())); HGCW002.setSigningDate(DateUtils.formatShort(HGCW002.getSigningDate()));
BigDecimal totalContractPriceExcluding = new BigDecimal(0);
BigDecimal totalContractPriceIncluding = new BigDecimal(0);
BigDecimal valueAddedTax = new BigDecimal(0);
//计算合同清单金额
for (int i = 0; i < detail1Rows.size(); i++) {
HGCW003 hgcw003 = new HGCW003();
hgcw003.fromMap(detail1Rows.get(i));
totalContractPriceExcluding = totalContractPriceExcluding.add(hgcw003.getTotalPriceExcluding());
totalContractPriceIncluding = totalContractPriceIncluding.add(hgcw003.getTotalPriceIncluding());
}
valueAddedTax = totalContractPriceIncluding.subtract(totalContractPriceExcluding);
DecimalFormat decimalFormat = new DecimalFormat("#.000");
HGCW002.setTotalContractPriceExcluding(new BigDecimal(decimalFormat.format(totalContractPriceExcluding)));
HGCW002.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
HGCW002.setValueAddedTax(new BigDecimal(decimalFormat.format(valueAddedTax)));
this.modify(HGCW002); this.modify(HGCW002);
} }
} }
...@@ -203,5 +223,17 @@ public class ServiceHGCW002 extends ServiceBase { ...@@ -203,5 +223,17 @@ public class ServiceHGCW002 extends ServiceBase {
return inInfo; return inInfo;
} }
public EiInfo contractComboBox(EiInfo inInfo){
Map<String, Object> map = new HashMap<>();
if (StringUtils.isNotEmpty(inInfo.getString("reviewStatus"))) {
map.put("reviewStatus", inInfo.getString("reviewStatus"));
}
if (StringUtils.isNotEmpty(inInfo.getString("contractType"))) {
map.put("contractType", inInfo.getString("contractType"));
}
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.CONTRACT_BLOCK_ID), map, false);
return inInfo;
}
} }
...@@ -412,7 +412,7 @@ ...@@ -412,7 +412,7 @@
<update id="update"> <update id="update">
UPDATE ${hggpSchema}.HGCW002 UPDATE ${hggpSchema}.HGCW002
SET SET
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 --> <!-- ACCOUNT_CODE = #accountCode#, 企业编码 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 --> COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 --> COMPANY_NAME = #companyName#, <!-- 公司名称 -->
PROJ_CODE = #projCode#, <!-- 项目编码 --> PROJ_CODE = #projCode#, <!-- 项目编码 -->
...@@ -442,17 +442,43 @@ ...@@ -442,17 +442,43 @@
TOTAL_CONTRACT_PRICE_EXCLUDING = #totalContractPriceExcluding#, <!-- 合同总价(不含税) --> TOTAL_CONTRACT_PRICE_EXCLUDING = #totalContractPriceExcluding#, <!-- 合同总价(不含税) -->
VALUE_ADDED_TAX = #valueAddedTax#, <!-- 税点 --> VALUE_ADDED_TAX = #valueAddedTax#, <!-- 税点 -->
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 合同总价(含税) --> TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 合同总价(含税) -->
REVIEW_STATUS = #reviewStatus#, <!-- 审核状态 --> <!-- REVIEW_STATUS = #reviewStatus#, 审核状态 -->
BALANCE_STATUS = #balanceStatus#, <!-- 结算状态;1未结算2部分结算3最终结算 --> <!-- BALANCE_STATUS = #balanceStatus#, 结算状态;1未结算2部分结算3最终结算 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 --> <!-- CREATED_BY = #createdBy#, 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 --> <!-- CREATED_NAME = #createdName#, 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 --> <!-- CREATED_TIME = #createdTime#, 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 --> UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 --> UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 --> UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
DEP_CODE = #depCode# <!-- 部门编码 --> <!-- DEP_CODE = #depCode# 部门编码 -->
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
<select id="queryComboBox" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap">
SELECT DISTINCT
CONTRACT_NUMBER as contractNumber, <!-- 合同号 -->
CONTRACT_NAME as contractName <!-- 合同名称 -->
FROM ${hggpSchema}.HGCW002
WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCodes">
COMPANY_CODE IN <iterate close=")" open="(" conjunction="," property="companyCodes">#companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="reviewStatus">
REVIEW_STATUS = #reviewStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractType">
CONTRACT_TYPE = #contractType#
</isNotEmpty>
ORDER BY CONTRACT_NUMBER
</select>
</sqlMap> </sqlMap>
...@@ -113,8 +113,11 @@ $(function() { ...@@ -113,8 +113,11 @@ $(function() {
//清除甲乙方 //清除甲乙方
IPLAT.EFPopupInput.clear(("#popupInputPartyA"), true) IPLAT.EFPopupInput.clear(("#popupInputPartyA"), true)
IPLAT.EFPopupInput.clear(("#popupInputPartyB"), true) IPLAT.EFPopupInput.clear(("#popupInputPartyB"), true)
IPLAT.EFPopupInput.clear(("#popupInputMainContractNumber"), true)
$("#result-0-partyA").val(""); $("#result-0-partyA").val("");
$("#result-0-partyB").val(""); $("#result-0-partyB").val("");
$("#result-0-mainContractNumber").val("");
} }
} }
} }
...@@ -199,6 +202,50 @@ $(function() { ...@@ -199,6 +202,50 @@ $(function() {
IPLAT.EFPopupInput.text( $("#popupInputPartyB") , partyB) IPLAT.EFPopupInput.text( $("#popupInputPartyB") , partyB)
e.preventDefault(); // 不使用默认的回填逻辑 e.preventDefault(); // 不使用默认的回填逻辑
} }
},
"popupInputMainContractNumber": {
/**
* EFGrid 查询时触发的事件,通常在此处,设置查询条件
* 注意: 必须返回一个EiInfo,作为初始查询条件
* 配置了query时,默认每次打开窗口都会进行一次查询
*/
query: function (e) {
console.log("Step" + (++i) + ": ----query----");
// 将自定义div中的字段构造成查询条件 EiInfo
// var queryInfo = EiInfo.build("#result-0-contractCategory");
var contractType = $("#result-0-contractType").val();
if (!contractType) {
message("请先选择合同类型!");
// 阻止弹窗
e.preventDefault();
} else if (!contractType === "3") {
message("只有合同类型为补充协议时,才需要填写主合同号!");
e.preventDefault();
}
var info = new EiInfo();
info.set("contractType",contractType)
return info;
},
/**
* grid中的数据回填时触发的事件
* @param e 回填数据事件
* e.sender 弹出窗口对象
* e.grid 弹出的grid对象
* e.model 选中的数据行model
*/
backFill: function (e) {
console.log("Step" + (++i) + ": ----backFill----");
// 回填数据
var model = e.model;
// var data = model.toJSON();
console.log(model);
var contractNumber = model.contractNumber;
var contractName = model.contractName;
$("#result-0-mainContractNumber").val(contractNumber);
IPLAT.EFPopupInput.text( $("#popupInputMainContractNumber") , contractName)
e.preventDefault(); // 不使用默认的回填逻辑
}
} }
}; };
...@@ -277,6 +324,7 @@ function cancelFunc() { ...@@ -277,6 +324,7 @@ function cancelFunc() {
} }
function btnSaveFunc() { function btnSaveFunc() {
fieldValidation();
JSUtils.confirm("确定对数据做\"保存\"操作? ", { JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGrid("detail1,detail2", "HGCW002", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback}); JSUtils.submitGrid("detail1,detail2", "HGCW002", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
...@@ -313,7 +361,16 @@ let refreshRowNo = function () { ...@@ -313,7 +361,16 @@ let refreshRowNo = function () {
detail1Grid.refresh(); detail1Grid.refresh();
} }
} }
function fieldValidation() {
var contractType = $("#result-0-contractType").val();
if (contractType == "3") {
var mainContractNumber = $("#result-0-mainContractNumber").val();
if (!mainContractNumber) {
message("请填写主合同号!");
return;
}
}
}
$(window).load(function () { $(window).load(function () {
refreshRowNo(); refreshRowNo();
}); });
......
...@@ -79,7 +79,17 @@ ...@@ -79,7 +79,17 @@
<div class="row"> <div class="row">
<EF:EFDatePicker cname="签约日期" ename="result-0-signingDate" colWidth="4" <EF:EFDatePicker cname="签约日期" ename="result-0-signingDate" colWidth="4"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/> format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFInput ename="result-0-mainContractNumber" cname="主合同号" colWidth="8" ratio="2:10"/> <EF:EFInput ename="result-0-mainContractNumber" cname="主合同号" type="hidden"/>
<EF:EFPopupInput ename="popupInputMainContractNumber" cname="主合同号" colWidth="8" ratio="2:10"
serviceName="HGCW002" methodName="contractComboBox"
resultId="contract_block_id"
save="false" popupType="ServiceGrid"
valueField="contractNumber" textField="contractName"
columnEnames="contractNumber,contractName"
columnCnames="合同号,合同名称"
readonly="true"
resizable="true" popupTitle="主合同号" popupWidth="800">
</EF:EFPopupInput>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput type="textarea" ename="result-0-contractContent" cname="合同内容" colWidth="8" ratio="2:10" required="true"/> <EF:EFInput type="textarea" ename="result-0-contractContent" cname="合同内容" colWidth="8" ratio="2:10" required="true"/>
......
...@@ -334,7 +334,7 @@ function cancelFunc() { ...@@ -334,7 +334,7 @@ function cancelFunc() {
function btnSaveFunc() { function btnSaveFunc() {
JSUtils.confirm("确定对数据做\"保存\"操作? ", { JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGrid("result", "HGCW002", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback}); JSUtils.submitGrid("detail1,detail2", "HGCW002", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
} }
}); });
} }
......
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