Commit 9d243a63 by yukang

付款单

parent 62bcb9ac
......@@ -55,6 +55,7 @@ public class HGCW006 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 剩余开票/收票金额*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -89,6 +90,7 @@ public class HGCW006 extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_REMAINING_AMOUNT = "REMAINING_AMOUNT";
public static final String QUERY = "HGCW006.query";
public static final String COUNT = "HGCW006.count";
......@@ -129,7 +131,7 @@ public class HGCW006 extends DaoEPBase {
private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/
private String depCode = " "; /* 部门编码*/
private BigDecimal remainingAmount = new BigDecimal("0"); /* 剩余开票/收票金额*/
/**
* initialize the metadata.
*/
......@@ -281,7 +283,12 @@ public class HGCW006 extends DaoEPBase {
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMAINING_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("剩余开票/收票金额");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -819,6 +826,14 @@ public class HGCW006 extends DaoEPBase {
public void setDepCode(String depCode) {
this.depCode = depCode;
}
public BigDecimal getRemainingAmount() {
return remainingAmount;
}
public void setRemainingAmount(BigDecimal remainingAmount) {
this.remainingAmount = remainingAmount;
}
/**
* get the value from Map.
*
......@@ -860,6 +875,7 @@ public class HGCW006 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setRemainingAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_AMOUNT)), remainingAmount));
}
/**
......@@ -902,6 +918,7 @@ public class HGCW006 extends DaoEPBase {
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_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_REMAINING_AMOUNT, StringUtils.toString(remainingAmount, eiMetadata.getMeta(FIELD_REMAINING_AMOUNT)));
return map;
}
......
......@@ -48,7 +48,7 @@ public class HGCW010 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 累计结算价税合计金额*/
public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 剩余开票/收票金额*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......
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.cw.domain.HGCW017;
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.LogUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW017 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID,
DdynamicEnum.COMPANY_BOX_BLOCK_ID,DdynamicEnum.PROJ_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW017().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW017.QUERY, new HGCW017());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
Long mainId = null;
for (int i = 0; i < resultRows.size(); i++) {
HGCW017 HGCW017 = new HGCW017();
HGCW017.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW017.setCompanyCode(userVO.getUsercode());
HGCW017.setCompanyName(userVO.getUsername());
mainId = HGCW017.getMainId();
if (HGCW017.getId() == null || HGCW017.getId() == 0) {
this.add(HGCW017);
} else {
// 回写数据
HGCW017 oldHGCW017 = HGCWTools.HgCw017.getId(HGCW017.getId());
//先加再扣
HGCWTools.HgCw012.cutAmount(oldHGCW017.getContractNumber(),
oldHGCW017.getTotalContractPriceIncluding().multiply(new BigDecimal(-1)));
this.modify(HGCW017);
HGCWTools.HgCw012.cutAmount(HGCW017.getContractNumber(),
HGCW017.getTotalContractPriceIncluding());
}
}
// 更新主表
HGCWTools.HgCw016.updateAmount(mainId);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param HGCW017
* @return
*/
public void add(HGCW017 HGCW017) {
DaoUtils.insert("HGCW017.insert", HGCW017);
}
/**
* 修改操作
*
* @param HGCW017
* @return
*/
public void modify(HGCW017 HGCW017) {
DaoUtils.update("HGCW017.update", HGCW017);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
Long mainId = null;
for (int i = 0; i < resultRows.size(); i++) {
HGCW017 HGCW017 = new HGCW017();
HGCW017.fromMap(resultRows.get(i));
mainId = HGCW017.getMainId();
DaoUtils.update("HGCW017.delete", HGCW017);
HGCWTools.HgCw012.cutAmount(HGCW017.getContractNumber(),
HGCW017.getTotalContractPriceIncluding().multiply(new BigDecimal(-1)));
}
// 更新主表
HGCWTools.HgCw016.updateAmount(mainId);
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
......@@ -171,6 +171,7 @@
TOTAL_CONTRACT_PRICE_EXCLUDING as "totalContractPriceExcluding", <!-- 合同总价(不含税) -->
VALUE_ADDED_TAX as "valueAddedTax", <!-- 增值税 -->
TOTAL_CONTRACT_PRICE_INCLUDING as "totalContractPriceIncluding", <!-- 合同总价(含税) -->
REMAINING_AMOUNT as "remainingAmount", <!-- 剩余金额 -->
REVIEW_STATUS as "reviewStatus", <!-- 审核状态 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
......@@ -325,6 +326,7 @@
TOTAL_CONTRACT_PRICE_EXCLUDING, <!-- 合同总价(不含税) -->
VALUE_ADDED_TAX, <!-- 增值税 -->
TOTAL_CONTRACT_PRICE_INCLUDING, <!-- 合同总价(含税) -->
REMAINING_AMOUNT, <!-- 剩余金额 -->
REVIEW_STATUS, <!-- 审核状态 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
......@@ -334,7 +336,7 @@
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #contractNumber#, #contractName#, #partyA#, #partyB#, #signingDate#, #totalQuantity#, #partyAName#, #partyAPhoneNumber#, #alreadyName#, #alreadyPhoneNumber#, #contractStatus#, #leaseStartDate#, #leaseEndDate#, #paymentMethod#, #pricingMethod#, #taxPoints#, #totalContractPriceExcluding#, #valueAddedTax#, #totalContractPriceIncluding#, #reviewStatus#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #contractNumber#, #contractName#, #partyA#, #partyB#, #signingDate#, #totalQuantity#, #partyAName#, #partyAPhoneNumber#, #alreadyName#, #alreadyPhoneNumber#, #contractStatus#, #leaseStartDate#, #leaseEndDate#, #paymentMethod#, #pricingMethod#, #taxPoints#, #totalContractPriceExcluding#, #valueAddedTax#, #totalContractPriceIncluding#,#remainingAmount#, #reviewStatus#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCW006
</selectKey>
......@@ -388,4 +390,14 @@
ID = #id#
</update>
<update id="updateDeductionAmount">
UPDATE ${hggpSchema}.HGCW006
SET
REMAINING_AMOUNT = #remainingAmount#, <!-- 审核状态 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -45,11 +45,14 @@
<isNotEmpty prepend=" AND " property="incomeNumber">
INCOME_NUMBER = #incomeNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDate">
SIGNING_DATE = #signingDate#
<isNotEmpty prepend=" AND " property="signingDateFrom">
SIGNING_DATE &gt;= REPLACE(#signingDateFrom#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="signingDateTo">
SIGNING_DATE &lt;= REPLACE(#signingDateTo#, '-', '')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="partyA">
PARTY_A = #partyA#
PARTY_A = like ('%$partyA$%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="cancelStatus">
CANCEL_STATUS = #cancelStatus#
......
......@@ -51,7 +51,8 @@
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW014.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW015.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW016.xml"/>
<sqlMap resource="com/baosight/hggp/hg/cw/sql/HGCW017.xml"/>
<!--配置-->
<sqlMap resource="com/baosight/hggp/hg/pz/sql/HGPZ005A.xml"/>
......
......@@ -290,8 +290,8 @@ function deleteFunc() {
function contractDetailFunc(id) {
JSColorbox.open({
href: "HGCW014C?methodName=initLoad&inqu_status-0-mainId=" + id + "&efParentFormEname=HGCW002",
title: "<div style='text-align: center;'>合同详情</div>",
href: "HGCW014C?methodName=initLoad&inqu_status-0-mainId=" + id + "&efParentFormEname=HGCW014",
title: "<div style='text-align: center;'>收款详情</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
......
......@@ -80,12 +80,12 @@ function choiceFunc() {
mainId = rows[0].id;
}
JSColorbox.open({
href: "HGCW014A?methodName=initLoad&inqu_status-0-hiddenConditions=1" +
href: "HGCW016A?methodName=initLoad&inqu_status-0-hiddenConditions=1" +
"&inqu_status-0-billState=2" +
"&inqu_status-0-reviewStatus=3" +
"&inqu_status-0-mainId=" + mainId +
"&efParentFormEname=HGCW014",
title: "<div style='text-align: center;'>销售开票</div>",
"&efParentFormEname=HGCW016",
title: "<div style='text-align: center;'>采购收票</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
......@@ -111,7 +111,7 @@ function updateFunc() {
return;
}
JSColorbox.open({
href: "HGCW014B?methodName=initLoad&inqu_status-0-mainId=" + rows[0].id + "&efParentFormEname=HGCW014",
href: "HGCW016B?methodName=initLoad&inqu_status-0-mainId=" + rows[0].id + "&efParentFormEname=HGCW016",
title: "<div style='text-align: center;'>收款清单</div>",
width: "90%",
height: "90%",
......@@ -129,7 +129,7 @@ function saveResult1Func() {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW014", "save", info, {
EiCommunicator.send("HGCW016", "save", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
......@@ -188,7 +188,7 @@ function submitFunc() {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW014", "submit", info, {
EiCommunicator.send("HGCW016", "submit", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
......@@ -236,7 +236,7 @@ function writeoffFunc() {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW014", "writeoff", info, {
EiCommunicator.send("HGCW016", "writeoff", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
......@@ -282,7 +282,7 @@ function deleteFunc() {
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW014", "delete", true);
JSUtils.submitGridsData("result", "HGCW016", "delete", true);
}
});
}
......@@ -290,8 +290,8 @@ function deleteFunc() {
function contractDetailFunc(id) {
JSColorbox.open({
href: "HGCW014C?methodName=initLoad&inqu_status-0-mainId=" + id + "&efParentFormEname=HGCW002",
title: "<div style='text-align: center;'>合同详情</div>",
href: "HGCW016C?methodName=initLoad&inqu_status-0-mainId=" + id + "&efParentFormEname=HGCW016",
title: "<div style='text-align: center;'>付款详情</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
......
......@@ -65,7 +65,7 @@ function btnSaveFunc() {
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据生成收款单吗? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW014", "select",
JSUtils.submitGridsData("result", "HGCW016", "select",
true, function (e) {
var status = e.getStatus();
if (status !== -1) {
......
......@@ -58,7 +58,7 @@ function saveFunc() {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW015", "save", info, {
EiCommunicator.send("HGCW017", "save", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
try {
......@@ -93,7 +93,7 @@ function deleteFunc() {
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW015", "delete", true);
JSUtils.submitGridsData("result", "HGCW017", "delete", true);
}
});
}
......
......@@ -8,16 +8,6 @@ $(function() {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
saveFunc();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
......@@ -44,57 +34,3 @@ let query = function () {
resultGrid.dataSource.page(1);
}
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function saveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW015", "save", 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");
}
});
//JSUtils.submitGridsData("result", "HPSC001", "save", true);
}
});
}
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW015", "delete", true);
}
});
}
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