Commit 6378a4bb by yukang

账期维护,合同管理

parent 79ec23d8
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.HGCW001;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
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.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW001 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), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW001().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, HGCW001.QUERY, new HGCW001());
} 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();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGCW001 HGCW001 = new HGCW001();
HGCW001.fromMap(resultRows.get(i));
HGCW001.setAccountPeriod(DateUtils.formatShort(HGCW001.getAccountPeriod()));
if (HGCW001.getId() == null || HGCW001.getId() == 0) {
this.add(HGCW001);
} else {
this.modify(HGCW001);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param HGCW001
* @return
*/
public void add(HGCW001 HGCW001) {
DaoUtils.insert("HGCW001.insert", HGCW001);
}
/**
* 修改操作
*
* @param HGCW001
* @return
*/
public void modify(HGCW001 HGCW001) {
DaoUtils.update("HGCW001.update", HGCW001);
}
/**
* 新增操作
*
* @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++) {
HGCW001 HGCW001 = new HGCW001();
HGCW001.fromMap(resultRows.get(i));
DaoUtils.insert("HGCW001.insert", HGCW001);
}
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++) {
HGCW001 HGCW001 = new HGCW001();
HGCW001.fromMap(resultRows.get(i));
HGCW001.setAccountPeriod(DateUtils.formatShort(HGCW001.getAccountPeriod()));
DaoUtils.update("HGCW001.update", HGCW001);
}
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 delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW001.delete", resultRows.get(i));
}
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 switchRow(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
HGCW001 HGCW001 = new HGCW001();
HGCW001.fromMap(resultRows.get(0));
Integer accountPeriodStatus = HGCW001.getAccountPeriodStatus();
if (accountPeriodStatus == 1) {
//开账 - 做关账
HGCW001.setAccountPeriodStatus(0);
DaoUtils.update("HGCW001.updateSwitchRow", HGCW001);
} else if (accountPeriodStatus == 0) {
//先找是否已经有开账的记录
int switchRowNum = dao.count("HGCW001.getSwitchRowNum", HGCW001);
if (switchRowNum > 0) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!已经有一个会计期为开账状态!");
return inInfo;
}
HGCW001.setAccountPeriodStatus(1);
DaoUtils.update("HGCW001.updateSwitchRow", HGCW001);
}
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.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW002;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
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.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author yukang
* @date 2024年05月06日 18:22
*/
public class ServiceHGCW002 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), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW002().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, HGCW002.QUERY, new HGCW002());
} 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();
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HGCW002 HGCW002 = new HGCW002();
HGCW002.fromMap(resultRows.get(i));
if (HGCW002.getId() == null || HGCW002.getId() == 0) {
this.add(HGCW002);
} else {
this.modify(HGCW002);
}
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*
* @param HGCW002
* @return
*/
public void add(HGCW002 HGCW002) {
DaoUtils.insert("HGCW002.insert", HGCW002);
}
/**
* 修改操作
*
* @param HGCW002
* @return
*/
public void modify(HGCW002 HGCW002) {
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;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "账期维护",operType = "删除",operDesc = "删除")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
DaoUtils.update("HGCW002.delete", resultRows.get(i));
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-06 18:13:44
Version : 1.0
schema : hggp
tableName : HGCW001
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
ACCOUNT_YEAR VARCHAR,
ACCOUNT_PERIOD VARCHAR,
ACCOUNT_PERIOD_STATUS TINYINT,
ACCOUNT_PERIOD_DATE_START VARCHAR,
ACCOUNT_PERIOD_DATE_END VARCHAR,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
UPDATED_BY VARCHAR NOT NULL,
UPDATED_NAME VARCHAR NOT NULL,
UPDATED_TIME VARCHAR NOT NULL,
DEP_CODE VARCHAR
-->
<sqlMap namespace="HGCW001">
<sql id="authCondition">
<!-- 无权限时使用 -->
<isNotEmpty prepend=" AND " property="authDepCode">
DEP_CODE = #authDepCode#
</isNotEmpty>
<!-- 仅本人和部门组合 -->
<isEqual prepend=" AND " property="authCombination" compareValue="1">
(CREATED_BY = #authOnlyPeople# OR DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>)
</isEqual>
<!-- 仅本人或部门 -->
<isNotEqual prepend=" AND " property="authCombination" compareValue="1">
<isNotEmpty property="authOnlyPeople">
CREATED_BY = #authOnlyPeople#
</isNotEmpty>
<isNotEmpty property="authDepCodes">
DEP_CODE IN <iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountYear">
ACCOUNT_YEAR = #accountYear#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriod">
ACCOUNT_PERIOD = #accountPeriod#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodStatus">
ACCOUNT_PERIOD_STATUS = #accountPeriodStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodDateStart">
ACCOUNT_PERIOD_DATE_START = #accountPeriodDateStart#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodDateEnd">
ACCOUNT_PERIOD_DATE_END = #accountPeriodDateEnd#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW001">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
ACCOUNT_YEAR as "accountYear", <!-- 会计年度 -->
ACCOUNT_PERIOD as "accountPeriod", <!-- 会计期 -->
ACCOUNT_PERIOD_STATUS as "accountPeriodStatus", <!-- 会计期状态0:关账1:开账 -->
ACCOUNT_PERIOD_DATE_START as "accountPeriodDateStart", <!-- 账期开始日期 -->
ACCOUNT_PERIOD_DATE_END as "accountPeriodDateEnd", <!-- 账期结束日期 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM ${hggpSchema}.HGCW001 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCW001 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountYear">
ACCOUNT_YEAR = #accountYear#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriod">
ACCOUNT_PERIOD = #accountPeriod#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodStatus">
ACCOUNT_PERIOD_STATUS = #accountPeriodStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodDateStart">
ACCOUNT_PERIOD_DATE_START = #accountPeriodDateStart#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodDateEnd">
ACCOUNT_PERIOD_DATE_END = #accountPeriodDateEnd#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCW001 (ID,
ACCOUNT_CODE, <!-- 企业编码 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
ACCOUNT_YEAR, <!-- 会计年度 -->
ACCOUNT_PERIOD, <!-- 会计期 -->
ACCOUNT_PERIOD_STATUS, <!-- 会计期状态0:关账1:开账 -->
ACCOUNT_PERIOD_DATE_START, <!-- 账期开始日期 -->
ACCOUNT_PERIOD_DATE_END, <!-- 账期结束日期 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 -->
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #accountYear#, #accountPeriod#, #accountPeriodStatus#, #accountPeriodDateStart#, #accountPeriodDateEnd#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGCW001 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGCW001
SET
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
ACCOUNT_YEAR = #accountYear#, <!-- 会计年度 -->
ACCOUNT_PERIOD = #accountPeriod#, <!-- 会计期 -->
ACCOUNT_PERIOD_STATUS = #accountPeriodStatus#, <!-- 会计期状态0:关账1:开账 -->
ACCOUNT_PERIOD_DATE_START = #accountPeriodDateStart#, <!-- 账期开始日期 -->
ACCOUNT_PERIOD_DATE_END = #accountPeriodDateEnd#, <!-- 账期结束日期 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DEP_CODE = #depCode# <!-- 部门编码 -->
WHERE
ID = #id#
</update>
<select id="getSwitchRowNum" resultClass="com.baosight.hggp.hg.cw.domain.HGCW001">
SELECT * FROM ${hggpSchema}.HGCW001 WHERE ACCOUNT_PERIOD_STATUS = 1
</select>
<update id="updateSwitchRow">
UPDATE ${hggpSchema}.HGCW001
SET
ACCOUNT_PERIOD_STATUS = #accountPeriodStatus#, <!-- 会计期状态0:关账1:开账 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
$("#SWITCH").on("click", function () {
switchRow();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
],
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
saveFunc();
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
function saveFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
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;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW001", "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;
}
let flag = true;
$.each(rows, function(index, item) {
let accountPeriodStatus= item.get("accountPeriodStatus");
if(accountPeriodStatus === "1"){
message("选中的第"+(index+1)+"行记录为开账状态,不能删除!");
flag = false;
return false;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW001", "delete", true);
}
});
}
}
function switchRow() {
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("HGCW001", "switchRow", 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);
}
});
}
<!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="inqu" title="查询条件">
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFDatePicker cname="会计期" blockId="inqu_status" ename="accountPeriod" row="0" colWidth="3"
format="yyyy-MM" parseFormats="['yyyyMM']" start="year" depth="year"/>
<EF:EFSelect cname="会计期状态" ename="inqu_status-0-accountPeriodStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.accountPeriodStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称" width="110" align="center"
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="accountYear" cname="会计年度" width="100" align="center" start="decade" depth="decade"
editType="date" dateFormat="yyyy" parseFormats="['yyyy']" required="true"/>
<EF:EFColumn ename="accountPeriod" cname="会计期" width="100" align="center" start="year" depth="year"
editType="date" dateFormat="yyyy-MM" parseFormats="['yyyyMM']" required="true"/>
<EF:EFComboColumn ename="accountPeriodStatus" cname="会计期状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hggp.cw.accountPeriodStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="accountPeriodDateStart" cname="账期开始日期" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="accountPeriodDateEnd" cname="账期结束日期" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/PZ/HGCW001.js"></script>
\ No newline at end of file
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
],
loadComplete: function (e) {
$("#BTN_INSERT").on("click",addFunc);
$("#BTN_UPDATE").on("click",updateFunc);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 新增
*/
function addFunc() {
console.log("新增");
}
/**
* 修改
*/
function updateFunc() {
console.log("修改");
}
/**
* 删除
*/
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let accountPeriodStatus= item.get("accountPeriodStatus");
if(accountPeriodStatus === "1"){
message("选中的第"+(index+1)+"行记录为开账状态,不能删除!");
flag = false;
return false;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCW001", "delete", true);
}
});
}
}
<!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="inqu" title="查询条件">
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="项目名称" ename="projName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="合同号" ename="contractNumber" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="合同名称" ename="contractName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="合同类型" ename="inqu_status-0-contractType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType"/>
</EF:EFSelect>
<EF:EFSelect cname="合同类别" ename="inqu_status-0-contractCategory" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractCategory"/>
</EF:EFSelect>
<EF:EFDateSpan startCname="签订日期(从)" endCname="至" blockId="inqu_status"
startName="signingDateFrom" endName="signingDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
<EF:EFInput cname="甲方名称" ename="partyA" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="乙方名称" ename="partyB" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="主合同号" ename="mainContractNumber" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="合同状态" ename="inqu_status-0-contractStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractStatus"/>
</EF:EFSelect>
<EF:EFSelect cname="审批状态" ename="inqu_status-0-reviewStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFSelect>
<EF:EFSelect cname="结算状态" ename="inqu_status-0-balanceStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.balanceStatus"/>
</EF:EFSelect>
<EF:EFInput cname="创建人" ename="createdName" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="companyName" cname="所属公司" align="center" enable="false"/>
<EF:EFColumn ename="projCode" cname="项目编号" align="center" enable="false"/>
<EF:EFColumn ename="projName" cname="项目名称" align="center" enable="false"/>
<EF:EFColumn ename="signingDate" cname="签订日期" align="center" enable="false"/>
<EF:EFColumn ename="contractNumber" cname="合同号" align="center" enable="false"/>
<EF:EFColumn ename="contractName" cname="合同名称" align="center" enable="false"/>
<EF:EFColumn ename="partyA" cname="甲方名称" align="center" enable="false"/>
<EF:EFColumn ename="partyB" cname="乙方名称" align="center" enable="false"/>
<EF:EFColumn ename="mainContractNumber" cname="主合同号" align="center" enable="false"/>
<EF:EFColumn ename="mainContractName" cname="主合同名称" align="center" enable="false"/>
<EF:EFComboColumn ename="contractType" cname="合同类型" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.contractType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="contractCategory" cname="合同类别" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.contractCategory"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="contractStatus" cname="合同状态" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.contractStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="reviewStatus" cname="审批状态" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.reviewStatus"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="balanceStatus" cname="结算状态" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.balanceStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/PZ/HGCW002.js"></script>
\ No newline at end of file
<!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="基本信息">
<div class="row">
<EF:EFInput ename="detail-0-projCode" cname="项目编号" colWidth="4" required="true" />
<EF:EFInput ename="detail-0-projName" cname="项目简称" colWidth="4" />
<EF:EFInput ename="detail-0-prodOrderNo" cname="合同号" colWidth="4" readonly="true" />
</div>
<div class="row">
<EF:EFInput ename="detail-0-prdtName" cname="合同名称*" colWidth="4" />
<EF:EFInput ename="detail-0-partName" cname="合同类型*" colWidth="4" />
<EF:EFInput ename="detail-0-deliveryDate" cname="合同类别*" colWidth="4" />
</div>
<div class="row">
<EF:EFInput ename="detail-0-planCompletionDate" cname="甲方*名称" colWidth="4" />
<EF:EFInput ename="detail-0-num" cname="乙方名称" colWidth="4" />
<EF:EFInput ename="detail-0-totalWt" cname="丙方" colWidth="4" />
</div>
<div class="row">
<EF:EFInput ename="detail-0-assignedNum" cname="计划开工日期*" colWidth="4" />
<EF:EFInput ename="detail-0-unassignedNum" cname="计划竣工日期*" colWidth="4" />
<EF:EFInput ename="detail-0-unassignedNum" cname="合同状态" colWidth="4" />
</div>
<div class="row">
<EF:EFInput ename="detail-0-assignedNum" cname="甲方联系人姓名" colWidth="4" />
<EF:EFInput ename="detail-0-unassignedNum" cname="甲方联系人电话" colWidth="4" />
<EF:EFInput ename="detail-0-unassignedNum" cname="已方联系人姓名" colWidth="4" />
</div>
<div class="row">
<EF:EFInput ename="detail-0-assignedNum" cname="已方联系人电话" colWidth="4" />
<EF:EFInput ename="detail-0-unassignedNum" cname="工程地址*" colWidth="8" />
</div>
<div class="row">
<EF:EFInput ename="detail-0-assignedNum" cname="签约日期" colWidth="4" />
<EF:EFInput ename="detail-0-unassignedNum" cname="主合同号" colWidth="4" />
</div>
<div class="row">
<EF:EFTExtarea ename="detail-0-assignedNum" cname="合同内容*" colWidth="12" />
</div>
</EF:EFRegion>
<EF:EFRegion id="inqu2" title="承包方式及合同价款">
<div class="row">
<EF:EFInput ename="detail-0-projCode" cname="承包方式" colWidth="4" />
<EF:EFInput ename="detail-0-projName" cname="付款方式" colWidth="4" />
<EF:EFInput ename="detail-0-prodOrderNo" cname="计价方式" colWidth="4" />
</div>
<div class="row">
<EF:EFInput ename="detail-0-prdtName" cname="税点" colWidth="4" />
<EF:EFInput ename="detail-0-partName" cname="合同总价(不含税)" colWidth="4" />
<EF:EFInput ename="detail-0-deliveryDate" cname="增值税" colWidth="4" />
</div>
<div class="row">
<EF:EFInput ename="detail-0-planCompletionDate" cname="合同总价(含税)" colWidth="4" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result1" title="合同清单">
<EF:EFGrid blockId="result1" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="orgName" cname="清单" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="orgName" cname="单位" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="orgName" cname="暂定工程量" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="orgName" cname="计量方式" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="orgName" cname="材料供应方式" enable="false" align="center" hidden="true"/>
<EF:EFColumn ename="totalWt" cname="除税单价/元" enable="false" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="不含税总价" enable="false" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="含税总价" enable="false" format="{0:N3}"/>
<EF:EFColumn ename="totalWt" cname="其中人工费、元" enable="false" format="{0:N3}"/>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFRegion id="result2" title="附件信息">
<EF:EFGrid blockId="result1" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="docName" cname="附件类别" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="附件名称" enable="false" width="150"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HP/PZ/HGCW002A.js"></script>
\ No newline at end of file
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