Commit c13e830a by yukang

合同管理

parent 6c8f42bf
......@@ -267,9 +267,6 @@ public class HGCW002 extends DaoEPBase {
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TAX_POINTS);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setFieldLength(15);
eiColumn.setDescName("税点");
eiMetadata.addMeta(eiColumn);
......
......@@ -96,6 +96,9 @@ public class ServiceHGCW002 extends ServiceBase {
HGCWTools.HgCw003.save(detail1Rows,contractNumber,userVO);
HGCWTools.HgCw999.batchUpdate(detail2Rows,HGCW002.getId());
} else {
HGCW002.setPlanStartDate(DateUtils.formatShort(HGCW002.getPlanStartDate()));
HGCW002.setPlanEndDate(DateUtils.formatShort(HGCW002.getPlanEndDate()));
HGCW002.setSigningDate(DateUtils.formatShort(HGCW002.getSigningDate()));
this.modify(HGCW002);
}
}
......
......@@ -38,14 +38,10 @@ public class ServiceHGCW002B 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");
HGCW002 HGCW002 = HGCWTools.HgCw002.getId(id);
inInfo.addBlock(EiConstant.resultBlock).addRow(HGCW002);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJECT_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){
{put("projCode",HGCW002.getProjCode());}
}, false);
//获取清单
List<HGCW003> hgcw003List = HGCWTools.HgCw003.queryByContractNumber(HGCW002.getContractNumber());
inInfo.addBlock("detail1").addRows(hgcw003List);
......
......@@ -4,6 +4,7 @@ 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.HGCW003;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.LogUtils;
......@@ -67,25 +68,29 @@ public class ServiceHGCW003 extends ServiceBase {
*/
@OperationLogAnnotation(operModul = "合同清单",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map> resultRows = inInfo.getBlock("detail1").getRows();
String contractNumber = "";
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(resultRows.get(i));
contractNumber = HGCW003.getContractNumber();
if (HGCW003.getId() == null || HGCW003.getId() == 0) {
this.add(HGCW003);
} else {
this.modify(HGCW003);
}
}
// inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
List<HGCW003> hgcw003List = HGCWTools.HgCw003.queryByContractNumber(contractNumber);
eiInfo.addBlock("detail1").addRows(hgcw003List);
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
return eiInfo;
}
/**
......@@ -108,54 +113,8 @@ public class ServiceHGCW003 extends ServiceBase {
DaoUtils.update("HGCW003.update", HGCW003);
}
/**
* 新增操作
*
* @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++) {
HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(resultRows.get(i));
DaoUtils.insert("HGCW003.insert", HGCW003);
}
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++) {
HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(resultRows.get(i));
DaoUtils.update("HGCW003.update", HGCW003);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
public void deleteEntity(HGCW003 HGCW003) {
DaoUtils.update("HGCW003.delete", HGCW003);
}
/**
......@@ -166,18 +125,25 @@ public class ServiceHGCW003 extends ServiceBase {
*/
@OperationLogAnnotation(operModul = "合同清单",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map> resultRows = inInfo.getBlock("detail1").getRows();
String contractNumber = "";
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW003.delete", resultRows.get(i));
HGCW003 HGCW003 = new HGCW003();
HGCW003.fromMap(resultRows.get(i));
contractNumber = HGCW003.getContractNumber();
this.deleteEntity(HGCW003);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
List<HGCW003> hgcw003List = HGCWTools.HgCw003.queryByContractNumber(contractNumber);
eiInfo.addBlock("detail1").addRows(hgcw003List);
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
return eiInfo;
}
/**
......
......@@ -3,7 +3,9 @@ package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.util.FileUtils;
import com.baosight.hggp.util.LogUtils;
......@@ -89,6 +91,16 @@ public class ServiceHGCW999 extends ServiceEPBase {
return inInfo;
}
public void add(HGCW999 HGCW999) {
DaoUtils.insert("HGCW999.insert", HGCW999);
}
public void deleteEntity(HGCW999 HGCW999) {
DaoUtils.update("HGCW999.delete", HGCW999);
}
/**
* 新增操作
*
......@@ -98,19 +110,24 @@ public class ServiceHGCW999 extends ServiceEPBase {
@OperationLogAnnotation(operModul = "附件清单",operType = "新增",operDesc = "物料清单-附件清单A-新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
try {
Long matId = null;
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW999 fSc002A = new HGCW999();
fSc002A.fromMap(resultRows.get(i));
DaoUtils.insert(HGCW999.INSERT, fSc002A);
matId = fSc002A.getMatId();
this.add(fSc002A);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
List<HGCW999> hgcw999List = HGCWTools.HgCw999.queryByBiz(matId,"HT");
eiInfo.addBlock("detail2").addRows(hgcw999List);
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
LogUtils.setDetailMsg(eiInfo, e, "新增失败");
}
return inInfo;
return eiInfo;
}
/**
......@@ -121,23 +138,24 @@ public class ServiceHGCW999 extends ServiceEPBase {
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "物料清单-附件清单A-删除操作")
public EiInfo delete(EiInfo inInfo) {
EiInfo eiInfo = new EiInfo();
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
Long matId = null;
List<Map> resultRows = inInfo.getBlock("detail2").getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW999 fSc002A = new HGCW999();
fSc002A.fromMap(resultRows.get(i));
DaoUtils.update(HGCW999.DELETE, fSc002A);
// if (!fSc002A.getDocId().isEmpty()) {
// this.delectDoc(fSc002A.getDocId());
// }
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
matId = fSc002A.getMatId();
this.deleteEntity(fSc002A);
}
List<HGCW999> hgcw999List = HGCWTools.HgCw999.queryByBiz(matId,"HT");
eiInfo.addBlock("detail2").addRows(hgcw999List);
eiInfo.setStatus(EiConstant.STATUS_DEFAULT);
eiInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
LogUtils.setDetailMsg(eiInfo, e, "删除失败");
}
return inInfo;
return eiInfo;
}
/**
......
......@@ -33,10 +33,10 @@ $(function() {
var totalPriceIncluding = 0;
var valueAddedTax = 0;
allRows.forEach(function (row, index) {
totalPriceExcluding += row.totalPriceExcluding;
totalPriceIncluding += row.totalPriceIncluding;
totalPriceExcluding += parseFloat(row.totalPriceExcluding);
totalPriceIncluding += parseFloat(row.totalPriceIncluding);
});
valueAddedTax = totalPriceIncluding - totalPriceExcluding;
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))
......@@ -230,10 +230,10 @@ function uploadFileFunc() {
*
* @param docId
*/
function uploadFileCallback(docId) {
function uploadFileCallback(data) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-docId", docId);
inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
inEiInfo.set("result-0-docId", data.docId);
inEiInfo.set("result-0-bizType", data.bizType);
EiCommunicator.send('HGCW999', 'insert', inEiInfo, {
onSuccess(response) {
if (response.status === 0) {
......
......@@ -9,6 +9,8 @@
<EF:EFPage title="修改合同">
<EF:EFRegion id="inqu1" title="基本信息">
<div class="row">
<EF:EFInput ename="result-0-id" cname="id" type="hidden"/>
<EF:EFSelect cname="项目编号" ename="projCodeBox" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions
......@@ -111,8 +113,8 @@
</EF:EFRegion>
<EF:EFRegion id="detail1" title="合同清单">
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="contractNumber" cname="合同号" hidden="true"/>
<EF:EFColumn ename="inventory" cname="清单" align="center" />
<EF:EFColumn ename="unit" cname="单位" align="center" />
<EF:EFColumn ename="provisionalQuantity" cname="暂定工程量" format="{0:N3}" align="center"/>
......@@ -126,8 +128,8 @@
</EF:EFRegion>
<EF:EFRegion id="detail2" title="附件信息">
<EF:EFGrid blockId="detail2" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="matId" cname="matId" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
......
......@@ -10,10 +10,19 @@ $(function () {
}
$("#fileDocId").val(docId);
NotificationUtil("附件上传成功");
var matId = $("#inqu_status-0-matId").val();
var bizType = $("#inqu_status-0-bizType").val();
console.log($("#fileDocId").val())
console.log($("#inqu_status-0-matId").val())
console.log($("#inqu_status-0-bizType").val())
var data = {
docId: docId,
matId: matId,
bizType: bizType
}
// saveTemp(e);
try {
parent.JSColorbox.setValueCallback(docId);
parent.JSColorbox.setValueCallback(data);
} catch (e){
}
},
......
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