Commit e33fad0b by YG8429

询价管理、车辆管理优化

parent 96f4abf0
package com.baosight.hggp.hg.cg.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cg.domain.HGCG005;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
*
*/
public class ServiceHGCG005 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.SUPPLIER_RECORD_BLOCK_ID,
DdynamicEnum.USER_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCG005().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCG005.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGCG005.QUERY, new HGCG005());
// List sum = dao.query(HPSqlConstant.HPKC001.QUERY_SUM, queryRow);
// inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "询价管理",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HGCG005 hpcg005 = new HGCG005();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpcg005.fromMap(map);
hpcg005.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGCG005.DELETE_FLAG, hpcg005);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "询价管理",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
List<HGCG005> list = new ArrayList<>();
for (Map resultRow : resultRows) {
HGCG005 hpcg005 = new HGCG005();
hpcg005.fromMap(resultRow);
if (hpcg005.getId() == null || hpcg005.getId() == 0) {
hpcg005.setDeleteFlag(CommonConstant.YesNo.NO_0);
this.add(hpcg005);
} else {
this.modify(hpcg005);
}
list.add(hpcg005);
}
inInfo.getBlock(EiConstant.resultBlock).setRows(list);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGCG005 hpcg005) {
this.setBaseInfo(hpcg005);
//生成采购询价单号
hpcg005.setInquiryNumber(SequenceGenerator.getNextSequence(HGConstant.SequenceId.INQUIRY_NUMBER));
DaoUtils.insert(HGCG005.INSERT, hpcg005);
}
/**
* 设置基础信息
*
* @param hpcg005
*/
private void setBaseInfo(HGCG005 hpcg005) {
// 去除日期字符串中的-
hpcg005.setInquiryDate(StringUtil.removeHorizontalLine(hpcg005.getInquiryDate()));
}
/**
* 修改操作
*/
public void modify(HGCG005 hpcg005) {
DaoUtils.update(HGCG005.UPDATE, hpcg005);
}
@OperationLogAnnotation(operModul = "询价管理",operType = "提交",operDesc = "提交审批操作")
public EiInfo approve(EiInfo inInfo){
int i = 0;
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HGCG005 hpcg005 = new HGCG005();
hpcg005.fromMap(resultRow);
hpcg005.setProApplyStatus(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGCG005.UPDATE_PRO_APPLY_STATUS,hpcg005);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.approve", "提交")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("提交失败", e.getMessage());
return inInfo;
}
return inInfo;
}
}
package com.baosight.hggp.hg.cg.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.cg.domain.HGCG005A;
import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
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.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
*
*/
public class ServiceHGCG005A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCG005A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGCG005A.QUERY, new HGCG005A());
// List sum = dao.query(HPSqlConstant.HPKC001.QUERY_SUM, queryRow);
// inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.COLUMN_TOTAL_SUM, sum.get(0));
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "询价管理详情",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HGCG005A hgcg005A = new HGCG005A();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgcg005A.fromMap(map);
hgcg005A.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGCG005A.DELETE_FLAG, hgcg005A);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "询价管理详情详情",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
List<HGCG005A> list = new ArrayList<>();
for (Map resultRow : resultRows) {
HGCG005A hgcg005A = new HGCG005A();
hgcg005A.fromMap(resultRow);
if (hgcg005A.getId() == null || hgcg005A.getId() == 0) {
String hgcg005Id = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGCG005A.FIELD_HGCG005_ID);
hgcg005A.setHgcg005Id(Long.valueOf(hgcg005Id));
this.add(hgcg005A);
} else {
this.modify(hgcg005A);
}
list.add(hgcg005A);
}
inInfo.getBlock(EiConstant.resultBlock).setRows(list);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGCG005A hgcg005A) {
this.setBaseInfo(hgcg005A);
//生成采购询价单号
DaoUtils.insert(HGCG005A.INSERT, hgcg005A);
}
/**
* 设置基础信息
*
* @param hgcg005A
*/
private void setBaseInfo(HGCG005A hgcg005A) {
// 去除日期字符串中的-
hgcg005A.setDeliveryDate(StringUtil.removeHorizontalLine(hgcg005A.getDeliveryDate()));
}
/**
* 修改操作
*/
public void modify(HGCG005A hpcg004a) {
DaoUtils.update(HGCG005A.UPDATE, hpcg004a);
}
}
<?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-10-10 14:27:43
Version : 1.0
schema : hggp
tableName : HGCG005
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR NOT NULL,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
INQUIRY_DATE VARCHAR,
INQUIRY_NUMBER VARCHAR,
SUPPLIER_NAME VARCHAR,
INQUIRY_TYPE VARCHAR,
INQUIRY_PERSON VARCHAR,
DELETE_FLAG TINYINT,
PRO_APPLY_STATUS TINYINT
-->
<sqlMap namespace="HGCG005">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</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="inquiryDate">
INQUIRY_DATE = #inquiryDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryNumber">
INQUIRY_NUMBER = #inquiryNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supplierName">
SUPPLIER_NAME = #supplierName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryType">
INQUIRY_TYPE = #inquiryType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryPerson">
INQUIRY_PERSON = #inquiryPerson#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="proApplyStatus">
PRO_APPLY_STATUS = #proApplyStatus#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cg.domain.HGCG005">
SELECT
ID as "id", <!-- 主键id -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
INQUIRY_DATE as "inquiryDate", <!-- 询价日期 -->
INQUIRY_NUMBER as "inquiryNumber", <!-- 询价单号 -->
SUPPLIER_NAME as "supplierName", <!-- 供应商名称 -->
INQUIRY_TYPE as "inquiryType", <!-- 询价单类型 -->
INQUIRY_PERSON as "inquiryPerson", <!-- 询价单申请人 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
PRO_APPLY_STATUS as "proApplyStatus" <!-- 申请状态 -->
FROM ${hggpSchema}.HGCG005 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}.HGCG005 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="depCode">
DEP_CODE = #depCode#
</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="inquiryDate">
INQUIRY_DATE = #inquiryDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryNumber">
INQUIRY_NUMBER = #inquiryNumber#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="supplierName">
SUPPLIER_NAME = #supplierName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryType">
INQUIRY_TYPE = #inquiryType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inquiryPerson">
INQUIRY_PERSON = #inquiryPerson#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="proApplyStatus">
PRO_APPLY_STATUS = #proApplyStatus#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCG005 (ID, <!-- 主键id -->
ACCOUNT_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
INQUIRY_DATE, <!-- 询价日期 -->
INQUIRY_NUMBER, <!-- 询价单号 -->
SUPPLIER_NAME, <!-- 供应商名称 -->
INQUIRY_TYPE, <!-- 询价单类型 -->
INQUIRY_PERSON, <!-- 询价单申请人 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
PRO_APPLY_STATUS <!-- 申请状态 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #inquiryDate#, #inquiryNumber#, #supplierName#, #inquiryType#, #inquiryPerson#, #deleteFlag#, #proApplyStatus#)
<selectKey resultClass="java.lang.Long" keyProperty="id">
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGCG005
</selectKey>
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGCG005 WHERE
ID = #id#
</delete>
<update id="deleteFlag">
UPDATE ${hggpSchema}.HGCG005
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0:否1.是 -->
WHERE
ID = #id#
</update>
<!--修改提交状态-->
<update id="updateProApplyStatus">
UPDATE ${hggpSchema}.HGCG005
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
PRO_APPLY_STATUS = #proApplyStatus# <!-- 提交状态 0-未提交 1-已提交 -->
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hggpSchema}.HGCG005
SET
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
INQUIRY_DATE = #inquiryDate#, <!-- 询价日期 -->
INQUIRY_NUMBER = #inquiryNumber#, <!-- 询价单号 -->
SUPPLIER_NAME = #supplierName#, <!-- 供应商名称 -->
INQUIRY_TYPE = #inquiryType#, <!-- 询价单类型 -->
INQUIRY_PERSON = #inquiryPerson#, <!-- 询价单申请人 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
PRO_APPLY_STATUS = #proApplyStatus# <!-- 申请状态 -->
WHERE
ID = #id#
</update>
</sqlMap>
...@@ -193,6 +193,8 @@ public class HGConstant { ...@@ -193,6 +193,8 @@ public class HGConstant {
//办公用品领用单号 //办公用品领用单号
public static final String HGBG003_RECEIVE_CODE = "HGBG003_RECEIVE_CODE"; public static final String HGBG003_RECEIVE_CODE = "HGBG003_RECEIVE_CODE";
//采购询价单号
public static final String INQUIRY_NUMBER = "INQUIRY_NUMBER";
} }
/** /**
......
...@@ -37,6 +37,7 @@ public class HGXT002 extends DaoEPBase { ...@@ -37,6 +37,7 @@ public class HGXT002 extends DaoEPBase {
public static final String FIELD_LICENSE_PLATE_CODE = "licensePlateCode"; /* 车牌号*/ public static final String FIELD_LICENSE_PLATE_CODE = "licensePlateCode"; /* 车牌号*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/ public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String FIELD_APPLY_STATUS = "applyStatus"; /* 申请状态*/ public static final String FIELD_APPLY_STATUS = "applyStatus"; /* 申请状态*/
public static final String FIELD_INSURANCE_COMPANY = "insuranceCompany";
public static final String COL_ID = "ID"; /* 主键id*/ public static final String COL_ID = "ID"; /* 主键id*/
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码 预留*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码 预留*/
...@@ -53,6 +54,7 @@ public class HGXT002 extends DaoEPBase { ...@@ -53,6 +54,7 @@ public class HGXT002 extends DaoEPBase {
public static final String COL_LICENSE_PLATE_CODE = "LICENSE_PLATE_CODE"; /* 车牌号*/ public static final String COL_LICENSE_PLATE_CODE = "LICENSE_PLATE_CODE"; /* 车牌号*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/ public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
public static final String COL_APPLY_STATUS = "APPLY_STATUS"; /* 申请状态*/ public static final String COL_APPLY_STATUS = "APPLY_STATUS"; /* 申请状态*/
public static final String COL_INSURANCE_COMPANY = "INSURANCE_COMPANY";
public static final String QUERY = "HGXT002.query"; public static final String QUERY = "HGXT002.query";
public static final String COUNT = "HGXT002.count"; public static final String COUNT = "HGXT002.count";
...@@ -78,6 +80,7 @@ public class HGXT002 extends DaoEPBase { ...@@ -78,6 +80,7 @@ public class HGXT002 extends DaoEPBase {
private String licensePlateCode = " "; /* 车牌号*/ private String licensePlateCode = " "; /* 车牌号*/
private Integer deleteFlag = 0; /* 是否删除0.否1.是*/ private Integer deleteFlag = 0; /* 是否删除0.否1.是*/
private Integer applyStatus = 0; /* 申请状态*/ private Integer applyStatus = 0; /* 申请状态*/
private String insuranceCompany = " "; /* 保险公司*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -146,6 +149,10 @@ public class HGXT002 extends DaoEPBase { ...@@ -146,6 +149,10 @@ public class HGXT002 extends DaoEPBase {
eiColumn.setDescName("申请状态"); eiColumn.setDescName("申请状态");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INSURANCE_COMPANY);
eiColumn.setDescName("保险公司");
eiMetadata.addMeta(eiColumn);
} }
...@@ -396,6 +403,15 @@ public class HGXT002 extends DaoEPBase { ...@@ -396,6 +403,15 @@ public class HGXT002 extends DaoEPBase {
public void setApplyStatus(Integer applyStatus) { public void setApplyStatus(Integer applyStatus) {
this.applyStatus = applyStatus; this.applyStatus = applyStatus;
} }
public String getInsuranceCompany() {
return insuranceCompany;
}
public void setInsuranceCompany(String insuranceCompany) {
this.insuranceCompany = insuranceCompany;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -419,6 +435,7 @@ public class HGXT002 extends DaoEPBase { ...@@ -419,6 +435,7 @@ public class HGXT002 extends DaoEPBase {
setLicensePlateCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_LICENSE_PLATE_CODE)), licensePlateCode)); setLicensePlateCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_LICENSE_PLATE_CODE)), licensePlateCode));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag)); setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setApplyStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_APPLY_STATUS)), applyStatus)); setApplyStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_APPLY_STATUS)), applyStatus));
setInsuranceCompany(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_INSURANCE_COMPANY)), insuranceCompany));
} }
/** /**
...@@ -443,6 +460,7 @@ public class HGXT002 extends DaoEPBase { ...@@ -443,6 +460,7 @@ public class HGXT002 extends DaoEPBase {
map.put(FIELD_LICENSE_PLATE_CODE, StringUtils.toString(licensePlateCode, eiMetadata.getMeta(FIELD_LICENSE_PLATE_CODE))); map.put(FIELD_LICENSE_PLATE_CODE, StringUtils.toString(licensePlateCode, eiMetadata.getMeta(FIELD_LICENSE_PLATE_CODE)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG))); map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_APPLY_STATUS, StringUtils.toString(applyStatus, eiMetadata.getMeta(FIELD_APPLY_STATUS))); map.put(FIELD_APPLY_STATUS, StringUtils.toString(applyStatus, eiMetadata.getMeta(FIELD_APPLY_STATUS)));
map.put(FIELD_INSURANCE_COMPANY, StringUtils.toString(insuranceCompany, eiMetadata.getMeta(FIELD_INSURANCE_COMPANY)));
return map; return map;
} }
......
package com.baosight.hggp.hg.xt.service; package com.baosight.hggp.hg.xt.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG002;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.xt.domain.HGXT001; import com.baosight.hggp.hg.xt.domain.HGXT001;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils; import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil; import com.baosight.hggp.util.StringUtil;
...@@ -17,6 +20,8 @@ import com.baosight.iplat4j.core.resource.I18nMessages; ...@@ -17,6 +20,8 @@ import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -29,7 +34,14 @@ public class ServiceHGXT001 extends ServiceEPBase { ...@@ -29,7 +34,14 @@ public class ServiceHGXT001 extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.USER_BLOCK_ID
), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGXT001().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo; return inInfo;
} }
...@@ -77,6 +89,7 @@ public class ServiceHGXT001 extends ServiceEPBase { ...@@ -77,6 +89,7 @@ public class ServiceHGXT001 extends ServiceEPBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据 // 写入数据
List<HGXT001> list = new ArrayList<>();
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGXT001 hpxt001 = new HGXT001(); HGXT001 hpxt001 = new HGXT001();
hpxt001.fromMap(resultRow); hpxt001.fromMap(resultRow);
...@@ -85,7 +98,9 @@ public class ServiceHGXT001 extends ServiceEPBase { ...@@ -85,7 +98,9 @@ public class ServiceHGXT001 extends ServiceEPBase {
} else { } else {
this.modify(hpxt001); this.modify(hpxt001);
} }
list.add(hpxt001);
} }
inInfo.getBlock(EiConstant.resultBlock).setRows(list);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) { } catch (Exception e) {
......
package com.baosight.hggp.hg.xt.service; package com.baosight.hggp.hg.xt.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.xt.domain.HGXT001; import com.baosight.hggp.hg.xt.domain.HGXT001;
import com.baosight.hggp.hg.xt.domain.HGXT002; import com.baosight.hggp.hg.xt.domain.HGXT002;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.ErrorCodeUtils; import com.baosight.hggp.util.ErrorCodeUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil; import com.baosight.hggp.util.StringUtil;
...@@ -16,6 +18,8 @@ import com.baosight.iplat4j.core.exception.PlatException; ...@@ -16,6 +18,8 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages; import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -28,7 +32,14 @@ public class ServiceHGXT002 extends ServiceEPBase { ...@@ -28,7 +32,14 @@ public class ServiceHGXT002 extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.USER_BLOCK_ID
), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGXT002().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo; return inInfo;
} }
...@@ -51,13 +62,13 @@ public class ServiceHGXT002 extends ServiceEPBase { ...@@ -51,13 +62,13 @@ public class ServiceHGXT002 extends ServiceEPBase {
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
int i = 0; int i = 0;
try { try {
HGXT002 HGXT002 = new HGXT002(); HGXT002 hgxt002 = new HGXT002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) { for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HGXT002.fromMap(map); hgxt002.fromMap(map);
HGXT002.setDeleteFlag(CommonConstant.YesNo.YES_1); hgxt002.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGXT002.DELETE_FLAG, HGXT002); DaoUtils.update(HGXT002.DELETE_FLAG, hgxt002);
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
...@@ -76,15 +87,18 @@ public class ServiceHGXT002 extends ServiceEPBase { ...@@ -76,15 +87,18 @@ public class ServiceHGXT002 extends ServiceEPBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据 // 写入数据
List<HGXT002> list = new ArrayList<>();
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGXT002 HGXT002 = new HGXT002(); HGXT002 hgxt002 = new HGXT002();
HGXT002.fromMap(resultRow); hgxt002.fromMap(resultRow);
if (HGXT002.getId() == null || HGXT002.getId() == 0) { if (hgxt002.getId() == null || hgxt002.getId() == 0) {
this.add(HGXT002); this.add(hgxt002);
} else { } else {
this.modify(HGXT002); this.modify(hgxt002);
} }
list.add(hgxt002);
} }
inInfo.getBlock(EiConstant.resultBlock).setRows(list);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) { } catch (Exception e) {
...@@ -104,20 +118,20 @@ public class ServiceHGXT002 extends ServiceEPBase { ...@@ -104,20 +118,20 @@ public class ServiceHGXT002 extends ServiceEPBase {
/** /**
* 设置基础信息 * 设置基础信息
* *
* @param HGXT002 * @param hgxt002
*/ */
private void setBaseInfo(HGXT002 HGXT002) { private void setBaseInfo(HGXT002 hgxt002) {
// 去除日期字符串中的- // 去除日期字符串中的-
HGXT002.setApplyDate(StringUtil.removeHorizontalLine(HGXT002.getApplyDate())); hgxt002.setApplyDate(StringUtil.removeHorizontalLine(hgxt002.getApplyDate()));
HGXT002.setApplyStatus(CommonConstant.YesNo.NO_0); hgxt002.setApplyStatus(CommonConstant.YesNo.NO_0);
} }
/** /**
* 修改操作 * 修改操作
*/ */
public void modify(HGXT002 HGXT002) { public void modify(HGXT002 hgxt002) {
DaoUtils.update(HGXT002.UPDATE, HGXT002); DaoUtils.update(HGXT002.UPDATE, hgxt002);
} }
@OperationLogAnnotation(operModul = "车辆申请",operType = "提交",operDesc = "提交审批操作") @OperationLogAnnotation(operModul = "车辆申请",operType = "提交",operDesc = "提交审批操作")
......
...@@ -17,6 +17,7 @@ import com.baosight.iplat4j.core.resource.I18nMessages; ...@@ -17,6 +17,7 @@ import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -52,13 +53,13 @@ public class ServiceHGXT003 extends ServiceEPBase { ...@@ -52,13 +53,13 @@ public class ServiceHGXT003 extends ServiceEPBase {
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
int i = 0; int i = 0;
try { try {
HGXT003 HGXT003 = new HGXT003(); HGXT003 hgxt003 = new HGXT003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) { for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HGXT003.fromMap(map); hgxt003.fromMap(map);
HGXT003.setDeleteFlag(CommonConstant.YesNo.YES_1); hgxt003.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGXT003.DELETE_FLAG, HGXT003); DaoUtils.update(HGXT003.DELETE_FLAG, hgxt003);
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
...@@ -77,15 +78,18 @@ public class ServiceHGXT003 extends ServiceEPBase { ...@@ -77,15 +78,18 @@ public class ServiceHGXT003 extends ServiceEPBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据 // 写入数据
List<HGXT003> list = new ArrayList<>();
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGXT003 HGXT003 = new HGXT003(); HGXT003 hgxt003 = new HGXT003();
HGXT003.fromMap(resultRow); hgxt003.fromMap(resultRow);
if (HGXT003.getId() == null || HGXT003.getId() == 0) { if (hgxt003.getId() == null || hgxt003.getId() == 0) {
this.add(HGXT003); this.add(hgxt003);
} else { } else {
this.modify(HGXT003); this.modify(hgxt003);
} }
list.add(hgxt003);
} }
inInfo.getBlock(EiConstant.resultBlock).setRows(list);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) { } catch (Exception e) {
......
package com.baosight.hggp.hg.xt.service; package com.baosight.hggp.hg.xt.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
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.xt.domain.HGXT004; import com.baosight.hggp.hg.xt.domain.HGXT004;
import com.baosight.hggp.util.ErrorCodeUtils; import com.baosight.hggp.util.*;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -17,6 +16,8 @@ import com.baosight.iplat4j.core.resource.I18nMessages; ...@@ -17,6 +16,8 @@ import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -29,7 +30,14 @@ public class ServiceHGXT004 extends ServiceEPBase { ...@@ -29,7 +30,14 @@ public class ServiceHGXT004 extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.USER_BLOCK_ID
), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGXT004().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo; return inInfo;
} }
...@@ -52,13 +60,13 @@ public class ServiceHGXT004 extends ServiceEPBase { ...@@ -52,13 +60,13 @@ public class ServiceHGXT004 extends ServiceEPBase {
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
int i = 0; int i = 0;
try { try {
HGXT004 HGXT004 = new HGXT004(); HGXT004 hgxt004 = new HGXT004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) { for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HGXT004.fromMap(map); hgxt004.fromMap(map);
HGXT004.setDeleteFlag(CommonConstant.YesNo.YES_1); hgxt004.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGXT004.DELETE_FLAG, HGXT004); DaoUtils.update(HGXT004.DELETE_FLAG, hgxt004);
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
...@@ -77,15 +85,18 @@ public class ServiceHGXT004 extends ServiceEPBase { ...@@ -77,15 +85,18 @@ public class ServiceHGXT004 extends ServiceEPBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据 // 写入数据
List<HGXT004> list = new ArrayList<>();
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGXT004 HGXT004 = new HGXT004(); HGXT004 hgxt004 = new HGXT004();
HGXT004.fromMap(resultRow); hgxt004.fromMap(resultRow);
if (HGXT004.getId() == null || HGXT004.getId() == 0) { if (hgxt004.getId() == null || hgxt004.getId() == 0) {
this.add(HGXT004); this.add(hgxt004);
} else { } else {
this.modify(HGXT004); this.modify(hgxt004);
} }
list.add(hgxt004);
} }
inInfo.getBlock(EiConstant.resultBlock).setRows(list);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) { } catch (Exception e) {
...@@ -97,31 +108,31 @@ public class ServiceHGXT004 extends ServiceEPBase { ...@@ -97,31 +108,31 @@ public class ServiceHGXT004 extends ServiceEPBase {
/** /**
* 新增操作 * 新增操作
*/ */
public void add(HGXT004 HGXT004) { public void add(HGXT004 hgxt004) {
this.setBaseInfo(HGXT004); this.setBaseInfo(hgxt004);
//生成会议室管理申请 //生成会议室管理申请
HGXT004.setApplyNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CONFERENCE_APPLY_NO)); hgxt004.setApplyNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CONFERENCE_APPLY_NO));
DaoUtils.insert(HGXT004.INSERT, HGXT004); DaoUtils.insert(HGXT004.INSERT, hgxt004);
} }
/** /**
* 设置基础信息 * 设置基础信息
* *
* @param HGXT004 * @param hgxt004
*/ */
private void setBaseInfo(HGXT004 HGXT004) { private void setBaseInfo(HGXT004 hgxt004) {
// 去除日期字符串中的- // 去除日期字符串中的-
HGXT004.setApplyDate(StringUtil.removeHorizontalLine(HGXT004.getApplyDate())); hgxt004.setApplyDate(StringUtil.removeHorizontalLine(hgxt004.getApplyDate()));
HGXT004.setStartTime(StringUtil.removeHorizontalLine(HGXT004.getStartTime())); hgxt004.setStartTime(DateUtils.formatShort(hgxt004.getStartTime()));
HGXT004.setEndTime(StringUtil.removeHorizontalLine(HGXT004.getEndTime())); hgxt004.setEndTime(DateUtils.formatShort(hgxt004.getEndTime()));
} }
/** /**
* 修改操作 * 修改操作
*/ */
public void modify(HGXT004 HGXT004) { public void modify(HGXT004 hgxt004) {
DaoUtils.update(HGXT004.UPDATE, HGXT004); DaoUtils.update(HGXT004.UPDATE, hgxt004);
} }
@OperationLogAnnotation(operModul = "会议室管理",operType = "提交",operDesc = "提交审批操作") @OperationLogAnnotation(operModul = "会议室管理",operType = "提交",operDesc = "提交审批操作")
public EiInfo approve(EiInfo inInfo){ public EiInfo approve(EiInfo inInfo){
...@@ -129,10 +140,10 @@ public class ServiceHGXT004 extends ServiceEPBase { ...@@ -129,10 +140,10 @@ public class ServiceHGXT004 extends ServiceEPBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGXT004 HGXT004 = new HGXT004(); HGXT004 hgxt004 = new HGXT004();
HGXT004.fromMap(resultRow); hgxt004.fromMap(resultRow);
HGXT004.setProApplyStatus(CommonConstant.YesNo.YES_1); hgxt004.setProApplyStatus(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGXT004.UPDATE_PRO_APPLY_STATUS, HGXT004); DaoUtils.update(HGXT004.UPDATE_PRO_APPLY_STATUS, hgxt004);
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.approve", "提交")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.approve", "提交")});
...@@ -154,10 +165,10 @@ public class ServiceHGXT004 extends ServiceEPBase { ...@@ -154,10 +165,10 @@ public class ServiceHGXT004 extends ServiceEPBase {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGXT004 HGXT004 = new HGXT004(); HGXT004 hgxt004 = new HGXT004();
HGXT004.fromMap(resultRow); hgxt004.fromMap(resultRow);
HGXT004.setStatus(CommonConstant.YesNo.YES_1); hgxt004.setStatus(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGXT004.UPDATE_STATUS, HGXT004); DaoUtils.update(HGXT004.UPDATE_STATUS, hgxt004);
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.returnStatus", "返还")}); inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.returnStatus", "返还")});
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc CREATED_TIME DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -241,6 +241,9 @@ ...@@ -241,6 +241,9 @@
STATUS <!-- 返还状态 0-未返还 1-已返还 --> STATUS <!-- 返还状态 0-未返还 1-已返还 -->
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #applyDate#, #applyNo#, #applyPersonnel#, #licensePlateCode#, #driver#, #startTime#, #endTime#, #destination#, #mileage#, #reason#, #deleteFlag#, #proApplyStatus#, #status#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #applyDate#, #applyNo#, #applyPersonnel#, #licensePlateCode#, #driver#, #startTime#, #endTime#, #destination#, #mileage#, #reason#, #deleteFlag#, #proApplyStatus#, #status#)
<selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGXT001
</selectKey>
</insert> </insert>
<delete id="delete"> <delete id="delete">
......
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
UPDATED_TIME as "updatedTime", <!-- 更新时间 --> UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
APPLY_DATE as "applyDate", <!-- 申请日期 --> APPLY_DATE as "applyDate", <!-- 申请日期 -->
APPLY_NO as "applyNo", <!-- 保险单号 --> APPLY_NO as "applyNo", <!-- 保险单号 -->
INSURANCE_COMPANY as "insuranceCompany", <!-- 保险公司 -->
APPLY_PERSONNEL as "applyPersonnel", <!-- 申请人 --> APPLY_PERSONNEL as "applyPersonnel", <!-- 申请人 -->
LICENSE_PLATE_CODE as "licensePlateCode", <!-- 车牌号 --> LICENSE_PLATE_CODE as "licensePlateCode", <!-- 车牌号 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 --> DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
...@@ -101,7 +102,7 @@ ...@@ -101,7 +102,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc CREATED_TIME DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -175,9 +176,13 @@ ...@@ -175,9 +176,13 @@
APPLY_PERSONNEL, <!-- 申请人 --> APPLY_PERSONNEL, <!-- 申请人 -->
LICENSE_PLATE_CODE, <!-- 车牌号 --> LICENSE_PLATE_CODE, <!-- 车牌号 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 --> DELETE_FLAG, <!-- 是否删除0.否1.是 -->
APPLY_STATUS <!-- 申请状态 --> APPLY_STATUS, <!-- 申请状态 -->
INSURANCE_COMPANY
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #applyDate#, #applyNo#, #applyPersonnel#, #licensePlateCode#, #deleteFlag#, #applyStatus#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #applyDate#, #applyNo#, #applyPersonnel#, #licensePlateCode#, #deleteFlag#, #applyStatus#, #insuranceCompany#)
<selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGXT002
</selectKey>
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -224,7 +229,8 @@ ...@@ -224,7 +229,8 @@
APPLY_PERSONNEL = #applyPersonnel#, <!-- 申请人 --> APPLY_PERSONNEL = #applyPersonnel#, <!-- 申请人 -->
LICENSE_PLATE_CODE = #licensePlateCode#, <!-- 车牌号 --> LICENSE_PLATE_CODE = #licensePlateCode#, <!-- 车牌号 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 --> DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
APPLY_STATUS = #applyStatus# <!-- 申请状态 --> APPLY_STATUS = #applyStatus#, <!-- 申请状态 -->
INSURANCE_COMPANY = #insuranceCompany#
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc CREATED_TIME DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -186,6 +186,9 @@ ...@@ -186,6 +186,9 @@
T_HPXT002_ID T_HPXT002_ID
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #licensePlateCode#, #insuranceType#, #insuranceCompany#, #insuranceStartDate#, #insuranceEndDate#, #insuranceAmount#, #deleteFlag#, #tHpxt002Id# ) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #licensePlateCode#, #insuranceType#, #insuranceCompany#, #insuranceStartDate#, #insuranceEndDate#, #insuranceAmount#, #deleteFlag#, #tHpxt002Id# )
<selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGXT002A
</selectKey>
</insert> </insert>
<delete id="delete"> <delete id="delete">
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc CREATED_TIME DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -190,6 +190,9 @@ ...@@ -190,6 +190,9 @@
DELETE_FLAG <!-- 删除标记 --> DELETE_FLAG <!-- 删除标记 -->
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #maintenanceDate#, #maintenanceNumber#, #maintenanceType#, #licensePlate#, #handler#, #maintenanceCost#, #maintenanceReason#, #deleteFlag#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #maintenanceDate#, #maintenanceNumber#, #maintenanceType#, #licensePlate#, #handler#, #maintenanceCost#, #maintenanceReason#, #deleteFlag#)
<selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGXT003
</selectKey>
</insert> </insert>
<delete id="delete"> <delete id="delete">
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc CREATED_TIME DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -232,6 +232,9 @@ ...@@ -232,6 +232,9 @@
STATUS <!-- 返还状态 0-未返还 1-已返还 --> STATUS <!-- 返还状态 0-未返还 1-已返还 -->
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #applyDate#, #applyNo#, #applyPersonnel#, #meetingRoom#, #meetingSubject#, #meetingNature#, #importanceLevel#, #startTime#, #endTime#, #deleteFlag#, #proApplyStatus#, #status#) VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #applyDate#, #applyNo#, #applyPersonnel#, #meetingRoom#, #meetingSubject#, #meetingNature#, #importanceLevel#, #startTime#, #endTime#, #deleteFlag#, #proApplyStatus#, #status#)
<selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGXT004
</selectKey>
</insert> </insert>
<delete id="delete"> <delete id="delete">
......
$(function () {
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
/* 页面查询框的尺寸设置 */
$.extend(true, IPLATUI.Config, {
EFGrid: {
height: $(document).height() - $("#inqu").height() - $("#ef_form_head").height() - 100,
/*pageable: {
input: true,
numeric: false,
pageSizes: [10, 50 , 100 , 200]
}*/
}
});
IPLATUI.EFGrid= {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '';
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>';
}
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="details(' + item.id + ',' + item.proApplyStatus + ')" >详情</a>';
}
return template;
}
}, {
field: "inquiryDate",
attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
return currShortDate();
}
}],
onSave: function (e) {
// 阻止后台保存请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'delete'
|| e.eiInfo.extAttr.methodName == 'approve'){
query();
}
}
}
}
$("#APPROVE").on("click",function () {
approveFuncs();
})
downKeyUp();
})
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let supplierName= item.get("supplierName");
if(isBlank(supplierName)){
message("选中的第"+(index+1)+"行\"供应商名称\",不能为空!");
flag = false;
return false;
}
let inquiryPerson= item.get("inquiryPerson");
if(isBlank(inquiryPerson)){
message("选中的第"+(index+1)+"行\"询价人员\",不能为空!");
flag = false;
return false;
}
let inquiryType= item.get("inquiryType");
if(isBlank(inquiryType)){
message("选中的第"+(index+1)+"行\"询价单类型\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCG005", "save", true,
function (e) {
query();
});
btnNode.attr("disabled", false);
}
});
}
}
/**
* 提交
*/
function approveFuncs() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let proApplyStatus= item.get("proApplyStatus");
if(proApplyStatus=="1"){
message("选中的第"+(index+1)+"行\"数据已提交\",不能再次选中提交!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCG005", "approve", true);
}
});
}
}
/**
* 删除明细
*/
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let status= item.get("proApplyStatus");
if(status=="1"){
message("选中的第"+(index+1)+"行记录已提交,不能删除!");
flag = false;
return false;
}
});
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCG005", "delete", true,
function (e) {
query();
});
}
});
}
}
/**
* 显示附件清单
*
* @param id
*/
function showUploadFile(id) {
JSColorbox.open({
href: "HGXT001A?methodName=initLoad&inqu_status-0-matId=" + id,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
});
}
/**
* 显示详情清单
*
* @param id
*/
function details(id,proApplyStatus) {
JSColorbox.open({
href: "HGCG005A?methodName=initLoad&inqu_status-0-hgcg005Id=" + id + "&inqu_status-0-proApplyStatus=" + proApplyStatus,
title: "<div style='text-align: center;'>询价详情</div>",
width: "80%",
height: "80%",
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/3/25
Time: 16:17
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" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="询价管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDateSpan startCname="询价日期(从)" endCname="至" blockId="inqu_status"
startName="inquiryDateFrom" endName="inquiryDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan>
<EF:EFInput cname="询价人" ename="inqu_status-0-inquiryPerson" colWidth="3"/>
<EF:EFInput cname="供应商名称" ename="inqu_status-0-supplierName" colWidth="3"/>
</div>
<%-- <div class="row">--%>
<%-- <EF:EFInput cname="产品名称" ename="inqu_status-0-inquiryPerson" colWidth="3"/>--%>
<%-- <EF:EFInput cname="产品规格" ename="inqu_status-0-inquiryPerson" colWidth="3"/>--%>
<%-- <EF:EFInput cname="规格" ename="inqu_status-0-inquiryPerson" colWidth="3"/>--%>
<%-- </div>--%>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="130" align="center"/>
<EF:EFColumn ename="inquiryDate" cname="询价日期" align="center" width="150" readonly="true" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="inquiryNumber" cname="询价单号" enable="false" width="130" align="center" />
<EF:EFComboColumn ename="supplierName" cname="供应商名称" blockName="supplier_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="160" required="true"
align="center" filter="contains" sort="true" />
<EF:EFComboColumn ename="inquiryPerson" cname="询价人员" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" defaultValue="${loginName}"
maxLength="16" width="140" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="inquiryType" cname="询价类型" width="80" align="center" readonly="true">
<EF:EFCodeOption codeName="hggp.hgcg.inquiryType"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="proApplyStatus" cname="提交状态" width="80" align="center" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hgxt.proApplyStatus"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
],
loadComplete: function (grid) {
grid.dataSource.bind("change",function(e){
var item = e.items[0];
if(e.field == "invoiceType"){
if(item.invoiceType ){
/*
折扣:discount,
单价:unitPrice,
数量:quantity,
税率:taxRate,
折后单价:discountedPrice,
含税单价:taxInclusivePrice,
含税折后单价:taxInclusiveDiscountedPrice,
不含税金额:nonTaxAmount,
税额:taxAmount,
含税金额:taxInclusiveAmount,
*/
//折后单价
let discountedPrice = item.unitPrice * item.discount;
//含税单价
let taxInclusivePrice = item.unitPrice * (item.taxRate / 100 + 1);
//含税折后单价
let taxInclusiveDiscountedPrice = taxInclusivePrice * item.discount;
//不含税金额
let nonTaxAmount = discountedPrice * item.quantity;
//含税金额
let taxInclusiveAmount = discountedPrice * item.quantity * (item.taxRate / 100 + 1);
//税额
let taxAmount = taxInclusiveAmount - nonTaxAmount;
// 使用toFixed方法四舍五入到两位小数,并转换为数字
discountedPrice = Number(discountedPrice.toFixed(2));
// 使用toFixed方法四舍五入到两位小数,并转换为数字
taxInclusivePrice = Number(taxInclusivePrice.toFixed(2));
taxInclusiveDiscountedPrice = Number(taxInclusiveDiscountedPrice.toFixed(2));
nonTaxAmount = Number(nonTaxAmount.toFixed(2));
taxInclusiveAmount = Number(taxInclusiveAmount.toFixed(2));
taxAmount = Number(taxAmount.toFixed(2));
resultGrid.setCellValue(item,'discountedPrice',discountedPrice)
resultGrid.setCellValue(item,'taxInclusivePrice',taxInclusivePrice)
resultGrid.setCellValue(item,'taxInclusiveDiscountedPrice',taxInclusiveDiscountedPrice)
resultGrid.setCellValue(item,'nonTaxAmount',nonTaxAmount)
resultGrid.setCellValue(item,'taxInclusiveAmount',taxInclusiveAmount)
resultGrid.setCellValue(item,'taxAmount',taxAmount)
}
loadChange(grid,e,"price");
}
})
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
saveFunc(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
}
downKeyUp();
});
$(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 deliveryDate= item.get("deliveryDate");
let minPurchaseQuantity = item.get("minPurchaseQuantity");
let productCode= item.get("productCode");
let productName= item.get("productName");
let specification= item.get("specification");
let unit= item.get("unit");
let quantity= item.get("quantity");
let unitPrice= item.get("unitPrice");
let discount= item.get("discount");
let taxRate= item.get("taxRate");
let invoiceType= item.get("invoiceType");
if(isBlank(deliveryDate)){
message("选中的第"+(index+1)+"行\"交货日期\",不能为空!");
flag = false;
return false;
}
if(isBlank(minPurchaseQuantity)){
message("选中的第"+(index+1)+"行\"最小采购量\",不能为空!");
flag = false;
return false;
}
if(isBlank(productCode)){
message("选中的第"+(index+1)+"行\"产品编码\",不能为空!");
flag = false;
return false;
}
if(isBlank(productName)){
message("选中的第"+(index+1)+"行\"产品名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(specification)){
message("选中的第"+(index+1)+"行\"规格\",不能为空!");
flag = false;
return false;
}
if(isBlank(unit)){
message("选中的第"+(index+1)+"行\"单位\",不能为空!");
flag = false;
return false;
}
if(isBlank(quantity)){
message("选中的第"+(index+1)+"行\"数量\",不能为空!");
flag = false;
return false;
}
if(isBlank(unitPrice)){
message("选中的第"+(index+1)+"行\"单价\",不能为空!");
flag = false;
return false;
}
if(isBlank(discount)){
message("选中的第"+(index+1)+"行\"折扣\",不能为空!");
flag = false;
return false;
}
if(isBlank(taxRate)){
message("选中的第"+(index+1)+"行\"税率\",不能为空!");
flag = false;
return false;
}
if(isBlank(invoiceType)){
message("选中的第"+(index+1)+"行\"票据类型\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCG005A", "save", true,
function (e) {
//detailGrid.setEiInfo(e);
query();
});
}
});
}
}
/**
* 删除明细
*/
function deleteFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
let status= $("#inqu_status-0-proApplyStatus").val();
if(status=="1"){
message("记录已提交,不能删除!");
flag = false;
return false;
}
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCG005A", "delete", true,
function (e) {
query();
});
}
});
}
}
<!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:EFInput ename="proApplyStatus" blockId="inqu_status" row="0" type="hidden" />
<EF:EFInput ename="hgcg005Id" blockId="inqu_status" row="0" type="hidden" />
<EF:EFInput cname="产品编码" ename="productCode" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="产品名称" ename="productName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFInput cname="规格" ename="specification" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="deliveryDate" cname="交货日期" align="center" width="150" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="minPurchaseQuantity" cname="最小采购量" width="100" enable="true" required="true" align="center"/>
<EF:EFColumn ename="productCode" cname="产品编码" width="100" enable="true" required="true" align="center" />
<EF:EFColumn ename="productName" cname="产品名称" width="100" enable="true" required="true" align="center" />
<EF:EFColumn ename="specification" cname="规格" width="70" enable="true" required="true" align="center"/>
<EF:EFColumn ename="unit" cname="单位" width="70" enable="true" required="true" align="center"/>
<EF:EFColumn ename="quantity" cname="数量" format="{0:N0}" maxLength="20" width="70" align="right"
required="true" readonly="true"/>
<EF:EFColumn ename="unitPrice" cname="单价" width="70" enable="true" required="true" align="center"/>
<EF:EFColumn ename="discount" cname="折扣" width="70" enable="true" required="true" align="center"/>
<EF:EFComboColumn ename="taxRate" cname="税率" width="120" required="true" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="true">
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="invoiceType" cname="票据类型" width="120" required="true" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="true">
<EF:EFCodeOption codeName="hggp.cw.billTybe"/>
</EF:EFComboColumn>
<EF:EFColumn ename="discountedPrice" cname="折后单价"
width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="taxInclusivePrice" cname="含税单价"
width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="taxInclusiveDiscountedPrice" cname="含税折后单价"
width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="nonTaxAmount" cname="不含税金额"
width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="taxAmount" cname="税额"
width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="taxInclusiveAmount" cname="含税金额"
width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="false"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
...@@ -24,7 +24,7 @@ $(function () { ...@@ -24,7 +24,7 @@ $(function () {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>'; + 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>';
} }
if (item.status==0 && item.id){ if (item.status == 0 && item.proApplyStatus == 1 && item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="approveFunc(' + item.id + ')" >返还</a>'; 'onclick="approveFunc(' + item.id + ')" >返还</a>';
} }
......
...@@ -55,7 +55,12 @@ ...@@ -55,7 +55,12 @@
<EF:EFColumn ename="applyDate" cname="申请日期" width="110" align="center" editType="date" <EF:EFColumn ename="applyDate" cname="申请日期" width="110" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/>
<EF:EFColumn ename="applyNo" cname="申请单号" enable="false" width="130" align="center"/> <EF:EFColumn ename="applyNo" cname="申请单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="applyPersonnel" cname="申请人" enable="true" width="130" align="center" required="true"/> <EF:EFComboColumn ename="applyPersonnel" cname="申请人" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" defaultValue="${loginName}"
maxLength="16" width="130" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="licensePlateCode" cname="车牌号" enable="true" width="130" align="center" required="true"/> <EF:EFColumn ename="licensePlateCode" cname="车牌号" enable="true" width="130" align="center" required="true"/>
<EF:EFColumn ename="driver" cname="司机" enable="true" width="130" align="center" required="true"/> <EF:EFColumn ename="driver" cname="司机" enable="true" width="130" align="center" required="true"/>
<EF:EFColumn ename="startTime" cname="开始时间" width="110" align="center" editType="date" <EF:EFColumn ename="startTime" cname="开始时间" width="110" align="center" editType="date"
......
...@@ -99,18 +99,18 @@ let save = function (btnNode) { ...@@ -99,18 +99,18 @@ let save = function (btnNode) {
flag = false; flag = false;
return false; return false;
} }
let licensePlateCode= item.get("licensePlateCode"); // let licensePlateCode= item.get("licensePlateCode");
if(isBlank(licensePlateCode)){ // if(isBlank(licensePlateCode)){
message("选中的第"+(index+1)+"行\"车牌号\",不能为空!"); // message("选中的第"+(index+1)+"行\"车牌号\",不能为空!");
flag = false; // flag = false;
return false; // return false;
} // }
let applyNo= item.get("applyNo"); // let applyNo= item.get("applyNo");
if(isBlank(applyNo)){ // if(isBlank(applyNo)){
message("选中的第"+(index+1)+"行\"保险单号\",不能为空!"); // message("选中的第"+(index+1)+"行\"保险单号\",不能为空!");
flag = false; // flag = false;
return false; // return false;
} // }
}); });
if(flag) { if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
...@@ -55,9 +55,13 @@ ...@@ -55,9 +55,13 @@
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/> <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="applyDate" cname="申请日期" width="110" align="center" editType="date" <EF:EFColumn ename="applyDate" cname="申请日期" width="110" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/>
<EF:EFColumn ename="applyNo" cname="保险单号" enable="true" width="130" align="center"/> <EF:EFComboColumn ename="applyPersonnel" cname="申请人" columnTemplate="#=textField#" itemTemplate="#=textField#"
<EF:EFColumn ename="applyPersonnel" cname="申请人" enable="true" width="130" align="center" required="true"/> textField="textField" valueField="valueField" defaultValue="${loginName}"
<EF:EFColumn ename="licensePlateCode" cname="车牌号" enable="true" width="130" align="center" required="true"/> maxLength="16" width="130" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="insuranceCompany" cname="保险公司" enable="true" width="130" align="center" required="true"/>
<EF:EFComboColumn ename="applyStatus" cname="申请状态" width="80" align="center" enable="false" defaultValue="0"> <EF:EFComboColumn ename="applyStatus" cname="申请状态" width="80" align="center" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hgxt.proApplyStatus"/> <EF:EFCodeOption codeName="hggp.hgxt.proApplyStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
......
...@@ -103,12 +103,12 @@ let save = function (btnNode) { ...@@ -103,12 +103,12 @@ let save = function (btnNode) {
flag = false; flag = false;
return false; return false;
} }
let insuranceCompany= item.get("insuranceCompany"); // let insuranceCompany= item.get("insuranceCompany");
if(isBlank(insuranceCompany)){ // if(isBlank(insuranceCompany)){
message("选中的第"+(index+1)+"行\"保险公司\",不能为空!"); // message("选中的第"+(index+1)+"行\"保险公司\",不能为空!");
flag = false; // flag = false;
return false; // return false;
} // }
let insuranceAmount= item.get("insuranceAmount"); let insuranceAmount= item.get("insuranceAmount");
if(isBlank(insuranceAmount)){ if(isBlank(insuranceAmount)){
...@@ -119,7 +119,7 @@ let save = function (btnNode) { ...@@ -119,7 +119,7 @@ let save = function (btnNode) {
let insuranceStartDate= item.get("insuranceStartDate"); let insuranceStartDate= item.get("insuranceStartDate");
let insuranceEndDate= item.get("insuranceEndDate"); let insuranceEndDate= item.get("insuranceEndDate");
if (new Date(insuranceStartDate) > new Date(insuranceEndDate)){ if (new Date(insuranceStartDate) > new Date(insuranceEndDate)){
message("投保时间\"不能大于\"\"结束时间\"!"); message("投保开始时间\"不能大于\"\"结束时间\"!");
flag = false; flag = false;
return false; return false;
} }
......
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
<%-- <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/>--%> <%-- <EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="80" align="center"/>--%>
<EF:EFColumn ename="licensePlateCode" cname="车牌号" enable="true" width="130" align="center" required="true"/> <EF:EFColumn ename="licensePlateCode" cname="车牌号" enable="true" width="130" align="center" required="true"/>
<EF:EFColumn ename="insuranceType" cname="车险险种" enable="true" width="130" align="center" required="true"/> <EF:EFColumn ename="insuranceType" cname="车险险种" enable="true" width="130" align="center" required="true"/>
<EF:EFColumn ename="insuranceCompany" cname="保险公司" enable="true" width="130" align="center" required="true"/>
<EF:EFColumn ename="insuranceAmount" cname="保险金额(元)" width="80" align="right" format="{0:N3}" <EF:EFColumn ename="insuranceAmount" cname="保险金额(元)" width="80" align="right" format="{0:N3}"
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/" data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!" required="true"/> data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!" required="true"/>
......
...@@ -24,10 +24,10 @@ $(function () { ...@@ -24,10 +24,10 @@ $(function () {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>'; + 'onclick="showUploadFile(' + item.id + ')" >附件清单</a>';
} }
if (item.id && item.status==0){ // if (item.id && item.status==0){
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + // template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="approveFunc(' + item.id + ')" >返还</a>'; // 'onclick="approveFunc(' + item.id + ')" >返还</a>';
} // }
return template; return template;
} }
}, { }, {
......
...@@ -30,7 +30,12 @@ ...@@ -30,7 +30,12 @@
<EF:EFColumn ename="applyDate" cname="申请日期" width="110" align="center" editType="date" <EF:EFColumn ename="applyDate" cname="申请日期" width="110" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true" readonly="true"/>
<EF:EFColumn ename="applyNo" cname="申请单号" enable="false" width="130" align="center"/> <EF:EFColumn ename="applyNo" cname="申请单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="applyPersonnel" cname="申请人" enable="true" width="130" align="center" required="true"/> <EF:EFComboColumn ename="applyPersonnel" cname="申请人" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" defaultValue="${loginName}"
maxLength="16" width="130" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="meetingRoom" cname="会议室" enable="true" width="130" align="center" required="true"/> <EF:EFColumn ename="meetingRoom" cname="会议室" enable="true" width="130" align="center" required="true"/>
<EF:EFColumn ename="meetingSubject" cname="会议主题" enable="true" width="130" align="center" required="true"/> <EF:EFColumn ename="meetingSubject" cname="会议主题" enable="true" width="130" align="center" required="true"/>
<EF:EFComboColumn ename="meetingNature" cname="会议性质" width="130" align="center" enable="true" required="true"> <EF:EFComboColumn ename="meetingNature" cname="会议性质" width="130" align="center" enable="true" required="true">
...@@ -39,18 +44,18 @@ ...@@ -39,18 +44,18 @@
<EF:EFComboColumn ename="importanceLevel" cname="重要程度" width="130" align="center" enable="true" required="true"> <EF:EFComboColumn ename="importanceLevel" cname="重要程度" width="130" align="center" enable="true" required="true">
<EF:EFCodeOption codeName="hggp.hgxt.importanceLevel"/> <EF:EFCodeOption codeName="hggp.hgxt.importanceLevel"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="startTime" cname="开始时间" width="110" align="center" editType="date" <EF:EFColumn ename="startTime" cname="开始时间" parseFormats="['yyyyMMddHHmmss']" align="center" editType="datetime"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd HH:mm:ss" width="140" required="true"/>
<EF:EFColumn ename="endTime" cname="结束时间" width="110" align="center" editType="date" <EF:EFColumn ename="endTime" cname="结束时间" parseFormats="['yyyyMMddHHmmss']" align="center" editType="datetime"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd HH:mm:ss" width="140" required="true"/>
<EF:EFComboColumn ename="proApplyStatus" cname="提交状态" width="80" align="center" enable="false" defaultValue="0"> <EF:EFComboColumn ename="proApplyStatus" cname="提交状态" width="80" align="center" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hgxt.proApplyStatus"/> <EF:EFCodeOption codeName="hggp.hgxt.proApplyStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="status" cname="返还状态" width="80" align="center" <%-- <EF:EFComboColumn ename="status" cname="返还状态" width="80" align="center"--%>
textField="textField" valueField="valueField" readonly="true" defaultValue="0"> <%-- textField="textField" valueField="valueField" readonly="true" defaultValue="0">--%>
<EF:EFOption label="未返还" value="0"/> <%-- <EF:EFOption label="未返还" value="0"/>--%>
<EF:EFOption label="已返还" value="1"/> <%-- <EF:EFOption label="已返还" value="1"/>--%>
</EF:EFComboColumn> <%-- </EF:EFComboColumn>--%>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </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