Commit 094e68c1 by liuyang

2024-09-25

1.新增销售目标和销售计划
parent 0fa39dbf
...@@ -82,7 +82,7 @@ public class HGConstant { ...@@ -82,7 +82,7 @@ public class HGConstant {
//售后维修单号 //售后维修单号
public static final String HPXS006_PROD_NO = "HPXS006_NUMBER"; public static final String HPXS006_PROD_NO = "HPXS006_NUMBER";
//销售单号 //销售单号
public static final String HPPZ017_SALES_CODE = "HPPZ017_SALES_CODE"; public static final String HGPZ017_SALES_CODE = "HGPZ017_SALES_CODE";
//销售计划单号 //销售计划单号
public static final String PLAN_SALES_CODE = "PLAN_SALES_CODE"; public static final String PLAN_SALES_CODE = "PLAN_SALES_CODE";
//工序编码 //工序编码
......
package com.baosight.hggp.hg.pz.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:Hgpz017.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-09-26 18:55:30 create
*/
public class HGPZ017 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 帐套编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String FIELD_YEAR = "year"; /* 年度*/
public static final String FIELD_SALES_CODE = "salesCode"; /* 销售单号*/
public static final String FIELD_SALES_AMOUNT = "salesAmount"; /* 销售额*/
public static final String FIELD_TARGET_EXPLAIN = "targetExplain"; /* 目标说明*/
public static final String FIELD_STATUS = "status"; /* 状态:0未分解 1已分解*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 帐套编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
public static final String COL_YEAR = "YEAR"; /* 年度*/
public static final String COL_SALES_CODE = "SALES_CODE"; /* 销售单号*/
public static final String COL_SALES_AMOUNT = "SALES_AMOUNT"; /* 销售额*/
public static final String COL_TARGET_EXPLAIN = "TARGET_EXPLAIN"; /* 目标说明*/
public static final String COL_STATUS = "STATUS"; /* 状态:0未分解 1已分解*/
public static final String QUERY = "HGPZ017.query";
public static final String COUNT = "HGPZ017.count";
public static final String INSERT = "HGPZ017.insert";
public static final String UPDATE = "HGPZ017.update";
public static final String DELETE = "HGPZ017.delete";
public static final String DELETE_FLAG = "HGPZ017.deleteFlag";
private Long id = new Long(0);
private String accountCode = " "; /* 帐套编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = 0; /* 是否删除0.否1.是*/
private String year = " "; /* 年度*/
private String salesCode = " "; /* 销售单号*/
private BigDecimal salesAmount = new BigDecimal("0"); /* 销售额*/
private String targetExplain = " "; /* 目标说明*/
private Integer status = 0; /* 状态:0未分解 1已分解*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("帐套编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_YEAR);
eiColumn.setDescName("年度");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SALES_CODE);
eiColumn.setDescName("销售单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SALES_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(18);
eiColumn.setDescName("销售额");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TARGET_EXPLAIN);
eiColumn.setDescName("目标说明");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态:0未分解 1已分解");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGPZ017() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the accountCode - 帐套编码.
* @return the accountCode
*/
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 帐套编码.
*
* @param accountCode - 帐套编码
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称.
*
* @param updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除0.否1.是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除0.否1.是.
*
* @param deleteFlag - 是否删除0.否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the year - 年度.
* @return the year
*/
public String getYear() {
return this.year;
}
/**
* set the year - 年度.
*
* @param year - 年度
*/
public void setYear(String year) {
this.year = year;
}
/**
* get the salesCode - 销售单号.
* @return the salesCode
*/
public String getSalesCode() {
return this.salesCode;
}
/**
* set the salesCode - 销售单号.
*
* @param salesCode - 销售单号
*/
public void setSalesCode(String salesCode) {
this.salesCode = salesCode;
}
/**
* get the salesAmount - 销售额.
* @return the salesAmount
*/
public BigDecimal getSalesAmount() {
return this.salesAmount;
}
/**
* set the salesAmount - 销售额.
*
* @param salesAmount - 销售额
*/
public void setSalesAmount(BigDecimal salesAmount) {
this.salesAmount = salesAmount;
}
/**
* get the targetExplain - 目标说明.
* @return the targetExplain
*/
public String getTargetExplain() {
return this.targetExplain;
}
/**
* set the targetExplain - 目标说明.
*
* @param targetExplain - 目标说明
*/
public void setTargetExplain(String targetExplain) {
this.targetExplain = targetExplain;
}
/**
* get the status - 状态:0未分解 1已分解.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 状态:0未分解 1已分解.
*
* @param status - 状态:0未分解 1已分解
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setYear(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_YEAR)), year));
setSalesCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SALES_CODE)), salesCode));
setSalesAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_SALES_AMOUNT)), salesAmount));
setTargetExplain(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_TARGET_EXPLAIN)), targetExplain));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_YEAR, StringUtils.toString(year, eiMetadata.getMeta(FIELD_YEAR)));
map.put(FIELD_SALES_CODE, StringUtils.toString(salesCode, eiMetadata.getMeta(FIELD_SALES_CODE)));
map.put(FIELD_SALES_AMOUNT, StringUtils.toString(salesAmount, eiMetadata.getMeta(FIELD_SALES_AMOUNT)));
map.put(FIELD_TARGET_EXPLAIN, StringUtils.toString(targetExplain, eiMetadata.getMeta(FIELD_TARGET_EXPLAIN)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
return map;
}
}
package com.baosight.hggp.hg.pz.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:Hgpz018.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-09-26 18:55:30 create
*/
public class HGPZ018 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 帐套编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 创建人*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 创建人名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 更新人*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String FIELD_PARENT_ID = "parentId"; /* 父级ID*/
public static final String FIELD_YEAR = "year"; /* 年度*/
public static final String FIELD_MONTH = "month"; /* 月份*/
public static final String FIELD_SALES_CODE = "salesCode"; /* 销售单号*/
public static final String FIELD_PLAN_SALES_CODE = "planSalesCode"; /* 销售计划单号*/
public static final String FIELD_SALES_AMOUNT = "salesAmount"; /* 营销额*/
public static final String FIELD_STATUS = "status"; /* 审批状态 0-未审批 1-已审批*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 帐套编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 创建人*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 创建人名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 更新人*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
public static final String COL_PARENT_ID = "PARENT_ID"; /* 父级ID*/
public static final String COL_YEAR = "YEAR"; /* 年度*/
public static final String COL_MONTH = "MONTH"; /* 月份*/
public static final String COL_SALES_CODE = "SALES_CODE"; /* 销售单号*/
public static final String COL_PLAN_SALES_CODE = "PLAN_SALES_CODE"; /* 销售计划单号*/
public static final String COL_SALES_AMOUNT = "SALES_AMOUNT"; /* 营销额*/
public static final String COL_STATUS = "STATUS"; /* 审批状态 0-未审批 1-已审批*/
public static final String QUERY = "HGPZ018.query";
public static final String COUNT = "HGPZ018.count";
public static final String INSERT = "HGPZ018.insert";
public static final String UPDATE = "HGPZ018.update";
public static final String DELETE = "HGPZ018.delete";
public static final String DELETE_FLAG = "HGPZ018.deleteFlag";
public static final String UPDATE_STATUS = "HGPZ018.updateStatus";
public static final String DELETE_BY_PARENT_ID = "HGPZ018.deleteByParentId";
private Long id = new Long(0);
private String accountCode = " "; /* 帐套编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 更新人*/
private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag = 0; /* 是否删除0.否1.是*/
private Long parentId = new Long(0); /* 父级ID*/
private String year = " "; /* 年度*/
private String month = " "; /* 月份*/
private String salesCode = " "; /* 销售单号*/
private String planSalesCode = " "; /* 销售计划单号*/
private BigDecimal salesAmount = new BigDecimal("0"); /* 营销额*/
private Integer status = 0; /* 审批状态 0-未审批 1-已审批*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("帐套编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("创建人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("创建人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("更新人");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("更新人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("更新时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARENT_ID);
eiColumn.setDescName("父级ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_YEAR);
eiColumn.setDescName("年度");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MONTH);
eiColumn.setDescName("月份");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SALES_CODE);
eiColumn.setDescName("销售单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PLAN_SALES_CODE);
eiColumn.setDescName("销售计划单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_SALES_AMOUNT);
eiColumn.setType("N");
eiColumn.setScaleLength(2);
eiColumn.setFieldLength(20);
eiColumn.setDescName("营销额");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("审批状态 0-未审批 1-已审批");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGPZ018() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the accountCode - 帐套编码.
* @return the accountCode
*/
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 帐套编码.
*
* @param accountCode - 帐套编码
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 创建人.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 创建人.
*
* @param createdBy - 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 创建人名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 创建人名称.
*
* @param createdName - 创建人名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 创建时间.
*
* @param createdTime - 创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 更新人.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 更新人.
*
* @param updatedBy - 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 更新人名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 更新人名称.
*
* @param updatedName - 更新人名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 更新时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 更新时间.
*
* @param updatedTime - 更新时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 是否删除0.否1.是.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 是否删除0.否1.是.
*
* @param deleteFlag - 是否删除0.否1.是
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the parentId - 父级ID.
* @return the parentId
*/
public Long getParentId() {
return this.parentId;
}
/**
* set the parentId - 父级ID.
*
* @param parentId - 父级ID
*/
public void setParentId(Long parentId) {
this.parentId = parentId;
}
/**
* get the year - 年度.
* @return the year
*/
public String getYear() {
return this.year;
}
/**
* set the year - 年度.
*
* @param year - 年度
*/
public void setYear(String year) {
this.year = year;
}
/**
* get the month - 月份.
* @return the month
*/
public String getMonth() {
return this.month;
}
/**
* set the month - 月份.
*
* @param month - 月份
*/
public void setMonth(String month) {
this.month = month;
}
/**
* get the salesCode - 销售单号.
* @return the salesCode
*/
public String getSalesCode() {
return this.salesCode;
}
/**
* set the salesCode - 销售单号.
*
* @param salesCode - 销售单号
*/
public void setSalesCode(String salesCode) {
this.salesCode = salesCode;
}
/**
* get the planSalesCode - 销售计划单号.
* @return the planSalesCode
*/
public String getPlanSalesCode() {
return this.planSalesCode;
}
/**
* set the planSalesCode - 销售计划单号.
*
* @param planSalesCode - 销售计划单号
*/
public void setPlanSalesCode(String planSalesCode) {
this.planSalesCode = planSalesCode;
}
/**
* get the salesAmount - 营销额.
* @return the salesAmount
*/
public BigDecimal getSalesAmount() {
return this.salesAmount;
}
/**
* set the salesAmount - 营销额.
*
* @param salesAmount - 营销额
*/
public void setSalesAmount(BigDecimal salesAmount) {
this.salesAmount = salesAmount;
}
/**
* get the status - 审批状态 0-未审批 1-已审批.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 审批状态 0-未审批 1-已审批.
*
* @param status - 审批状态 0-未审批 1-已审批
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setParentId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_PARENT_ID)), parentId));
setYear(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_YEAR)), year));
setMonth(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MONTH)), month));
setSalesCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SALES_CODE)), salesCode));
setPlanSalesCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PLAN_SALES_CODE)), planSalesCode));
setSalesAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_SALES_AMOUNT)), salesAmount));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_PARENT_ID, StringUtils.toString(parentId, eiMetadata.getMeta(FIELD_PARENT_ID)));
map.put(FIELD_YEAR, StringUtils.toString(year, eiMetadata.getMeta(FIELD_YEAR)));
map.put(FIELD_MONTH, StringUtils.toString(month, eiMetadata.getMeta(FIELD_MONTH)));
map.put(FIELD_SALES_CODE, StringUtils.toString(salesCode, eiMetadata.getMeta(FIELD_SALES_CODE)));
map.put(FIELD_PLAN_SALES_CODE, StringUtils.toString(planSalesCode, eiMetadata.getMeta(FIELD_PLAN_SALES_CODE)));
map.put(FIELD_SALES_AMOUNT, StringUtils.toString(salesAmount, eiMetadata.getMeta(FIELD_SALES_AMOUNT)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
return map;
}
}
package com.baosight.hggp.hg.pz.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.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ017;
import com.baosight.hggp.hg.pz.domain.HGPZ018;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.LogUtils;
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.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/9/26
* @description 销售目标
*/
public class ServiceHGPZ017 extends ServiceEPBase {
public static final String[] MONTHS = {"01","02","03","04","05","06","07","08","09","10","11","12"};
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ017.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HGPZ017.QUERY, new HGPZ017());
return outEiInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ017.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo,HGPZ017.QUERY);
}
@OperationLogAnnotation(operModul = "销售目标",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HGPZ017 hppz017 = new HGPZ017();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz017.fromMap(map);
hppz017.setDeleteFlag(CommonConstant.YesNo.YES_1);
if (hppz017.getStatus() == 1) {
//判断销售目标的销售计划是否有审批通过
HGPZTools.HgPz018.getPanentId(hppz017.getId(),1);
DaoUtils.update(HGPZ018.DELETE_BY_PARENT_ID,new HashMap<String,Object>(){{
put(HGPZ018.FIELD_PARENT_ID,hppz017.getId());
put(HGPZ018.FIELD_DELETE_FLAG,CommonConstant.YesNo.YES_1);
}});
}
DaoUtils.update(HGPZ017.DELETE_FLAG, hppz017);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
@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++) {
HGPZ017 hppz017 = new HGPZ017();
hppz017.fromMap(resultRows.get(i));
if (hppz017.getId() == null || hppz017.getId() == 0) {
this.add(hppz017);
} else {
this.modify(hppz017);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGPZ017 hppz017) {
hppz017.setSalesCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGPZ017_SALES_CODE));
List<HGPZ017> hppz017s = HGPZTools.HgPz017.getYear(hppz017.getYear());
AssertUtils.isNotEmpty(hppz017s, String.format("年度[%s]销售目标已存在,添加失败!", hppz017.getYear()));
DaoUtils.insert(HGPZ017.INSERT, hppz017);
}
/**
* 修改操作
*/
public void modify(HGPZ017 hppz017) {
DaoUtils.update(HGPZ017.UPDATE, hppz017);
}
/**
* 分解销售目标
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "销售目标",operType = "分解",operDesc = "分解销售目标")
public EiInfo resolve(EiInfo inInfo){
try {
//List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
//修改状态 1已分解
String id = inInfo.getCellStr(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGPZ017.FIELD_ID);
String status = inInfo.getCellStr(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGPZ017.FIELD_STATUS);
HGPZ017 hppz017 = HGPZTools.HgPz017.getId(Long.valueOf(id));
hppz017.setStatus(Integer.valueOf(status));
DaoUtils.update(HGPZ017.UPDATE,hppz017);
//分解目标
HGPZ018 hppz018 = new HGPZ018();
hppz018.toMap();
hppz018.setYear(hppz017.getYear());
hppz018.setParentId(Long.valueOf(id));
hppz018.setSalesCode(hppz017.getSalesCode());
BigDecimal bigDecimal = hppz017.getSalesAmount().divide(new BigDecimal(12),2, RoundingMode.UP);
for (String months:MONTHS) {
hppz018.setMonth(months);
hppz018.setPlanSalesCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PLAN_SALES_CODE));
hppz018.setSalesAmount(bigDecimal);
DaoUtils.insert(HGPZ018.INSERT, hppz018);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次数据分解成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "分解失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.pz.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.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ018;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.LogUtils;
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.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/9/26
* @description 销售计划
*/
public class ServiceHGPZ018 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ018.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HGPZ018.QUERY, new HGPZ018());
return outEiInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGPZ018.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo,HGPZ018.QUERY);
}
@OperationLogAnnotation(operModul = "销售计划",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HGPZ018 hppz018 = new HGPZ018();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz018.fromMap(map);
hppz018.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGPZ018.DELETE_FLAG, hppz018);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
@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++) {
HGPZ018 hppz018 = new HGPZ018();
hppz018.fromMap(resultRows.get(i));
if (hppz018.getId() == null || hppz018.getId() == 0) {
this.add(hppz018);
} else {
this.modify(hppz018);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGPZ018 hppz018) {
hppz018.setPlanSalesCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PLAN_SALES_CODE));
List<HGPZ018> hppz018s = HGPZTools.HgPz018.getYear(hppz018.getYear());
AssertUtils.isNotEmpty(hppz018s, String.format("年度[%s]已存在", hppz018.getYear()));
DaoUtils.insert(HGPZ018.INSERT, hppz018);
}
/**
* 修改操作
*/
public void modify(HGPZ018 hppz018) {
DaoUtils.update(HGPZ018.UPDATE, hppz018);
}
public EiInfo updateStatus(EiInfo inInfo){
int i = 0;
try {
HGPZ018 hppz018 = new HGPZ018();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hppz018.fromMap(map);
hppz018.setStatus(HGConstant.WlApprovalStatu.S_1);
DaoUtils.update(HGPZ018.UPDATE_STATUS, hppz018);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException 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-09-26 18:55:30
Version : 1.0
schema : hggp
tableName : HGPZ017
ID INTEGER NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
YEAR VARCHAR,
SALES_CODE VARCHAR,
SALES_AMOUNT DECIMAL,
TARGET_EXPLAIN VARCHAR,
STATUS TINYINT
-->
<sqlMap namespace="HGPZ017">
<typeAlias alias="HGPZ017" type="com.baosight.hggp.hg.pz.domain.HGPZ017"/>
<sql id="column">
ID as "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", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
YEAR as "year", <!-- 年度 -->
SALES_CODE as "salesCode", <!-- 销售单号 -->
SALES_AMOUNT as "salesAmount", <!-- 销售额 -->
TARGET_EXPLAIN as "targetExplain", <!-- 目标说明 -->
STATUS as "status" <!-- 状态:0未分解 1已分解 -->
</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="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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="year">
YEAR = #year#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesCode">
SALES_CODE LIKE CONCAT('%',#salesCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesAmount">
SALES_AMOUNT LIKE CONCAT('%',#salesAmount#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="targetExplain">
TARGET_EXPLAIN = #targetExplain#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGPZ017">
SELECT
<include refid="column" />
FROM ${hggpSchema}.HGPZ017 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
YEAR DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ017 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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="year">
YEAR = #year#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesCode">
SALES_CODE = #salesCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesAmount">
SALES_AMOUNT = #salesAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="targetExplain">
TARGET_EXPLAIN = #targetExplain#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGPZ017 (ID,
ACCOUNT_CODE, <!-- 帐套编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
YEAR, <!-- 年度 -->
SALES_CODE, <!-- 销售单号 -->
SALES_AMOUNT, <!-- 销售额 -->
TARGET_EXPLAIN, <!-- 目标说明 -->
STATUS <!-- 状态:0未分解 1已分解 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #year#, #salesCode#, #salesAmount#, #targetExplain#, #status#)
<selectKey resultClass="java.lang.Long" keyProperty="id">
SELECT MAX(ID) FROM ${hggpSchema}.HGPZ017
</selectKey>
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGPZ017 WHERE
ID = #id#
</delete>
<!--逻辑删除-->
<update id="deleteFlag">
UPDATE ${hggpSchema}.HGPZ017
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0:否1.是 -->
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hggpSchema}.HGPZ017
SET
ACCOUNT_CODE = #accountCode#, <!-- 帐套编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
YEAR = #year#, <!-- 年度 -->
SALES_CODE = #salesCode#, <!-- 销售单号 -->
SALES_AMOUNT = #salesAmount#, <!-- 销售额 -->
TARGET_EXPLAIN = #targetExplain#, <!-- 目标说明 -->
STATUS = #status# <!-- 状态:0未分解 1已分解 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?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-09-26 18:55:30
Version : 1.0
schema : hggp
tableName : HGPZ018
ID INTEGER NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
PARENT_ID BIGINT,
YEAR VARCHAR,
MONTH VARCHAR,
SALES_CODE VARCHAR,
PLAN_SALES_CODE VARCHAR,
SALES_AMOUNT DECIMAL,
STATUS TINYINT
-->
<sqlMap namespace="HGPZ018">
<typeAlias alias="HGPZ018" type="com.baosight.hggp.hg.pz.domain.HGPZ018"/>
<sql id="column">
ID as "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", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
PARENT_ID as "parentId", <!-- 父级ID -->
YEAR as "year", <!-- 年度 -->
MONTH as "month", <!-- 月份 -->
SALES_CODE as "salesCode", <!-- 销售单号 -->
PLAN_SALES_CODE as "planSalesCode", <!-- 销售计划单号 -->
SALES_AMOUNT as "salesAmount", <!-- 营销额 -->
STATUS as "status" <!-- 审批状态 0-未审批 1-已审批 -->
</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="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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="year">
YEAR = #year#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="month">
MONTH = #month#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesCode">
SALES_CODE LIKE CONCAT('%',#salesCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planSalesCode">
PLAN_SALES_CODE LIKE CONCAT('%',#planSalesCode#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesAmount">
SALES_AMOUNT LIKE CONCAT('%',#salesAmount#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.pz.domain.HGPZ018">
SELECT
ID as "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", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
PARENT_ID as "parentId", <!-- 父级ID -->
YEAR as "year", <!-- 年度 -->
MONTH as "month", <!-- 月份 -->
SALES_CODE as "salesCode", <!-- 销售单号 -->
PLAN_SALES_CODE as "planSalesCode", <!-- 销售计划单号 -->
SALES_AMOUNT as "salesAmount", <!-- 营销额 -->
STATUS as "status" <!-- 审批状态 0-未审批 1-已审批 -->
FROM ${hggpSchema}.HGPZ018 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
YEAR DESC, MONTH ASC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGPZ018 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="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="year">
YEAR = #year#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="month">
MONTH = #month#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesCode">
SALES_CODE = #salesCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planSalesCode">
PLAN_SALES_CODE = #planSalesCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="salesAmount">
SALES_AMOUNT = #salesAmount#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGPZ018 (ID,
ACCOUNT_CODE, <!-- 帐套编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 更新人 -->
UPDATED_NAME, <!-- 更新人名称 -->
UPDATED_TIME, <!-- 更新时间 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
PARENT_ID, <!-- 父级ID -->
YEAR, <!-- 年度 -->
MONTH, <!-- 月份 -->
SALES_CODE, <!-- 销售单号 -->
PLAN_SALES_CODE, <!-- 销售计划单号 -->
SALES_AMOUNT, <!-- 营销额 -->
STATUS <!-- 审批状态 0-未审批 1-已审批 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #parentId#, #year#, #month#, #salesCode#, #planSalesCode#, #salesAmount#, #status#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGPZ018 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGPZ018
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#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
PARENT_ID = #parentId#, <!-- 父级ID -->
YEAR = #year#, <!-- 年度 -->
MONTH = #month#, <!-- 月份 -->
SALES_CODE = #salesCode#, <!-- 销售单号 -->
PLAN_SALES_CODE = #planSalesCode#, <!-- 销售计划单号 -->
SALES_AMOUNT = #salesAmount#, <!-- 营销额 -->
STATUS = #status# <!-- 审批状态 0-未审批 1-已审批 -->
WHERE
ID = #id#
</update>
<!--逻辑删除-->
<update id="deleteFlag">
UPDATE ${hggpSchema}.HGPZ018
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0:否1.是 -->
WHERE
ID = #id#
</update>
<!--parentId逻辑删除-->
<update id="deleteByParentId">
UPDATE ${hggpSchema}.HGPZ018
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0:否1.是 -->
WHERE
PARENT_ID = #parentId#
</update>
<!--审批状态-->
<update id="updateStatus">
UPDATE ${hggpSchema}.HGPZ018
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
STATUS = #status#
WHERE
ID = #id#
</update>
<select id="queryPlanSalesCode" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT
CONCAT(YEAR,MONTH) as "yearMonth",
PLAN_SALES_CODE AS "planSalesCode"
FROM ${hggpSchema}.HGPZ018
WHERE 1=1 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isEmpty prepend=" AND " property="status">
STATUS = 1
</isEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
YEAR DESC ,MONTH DESC
</isEmpty>
</dynamic>
</select>
</sqlMap>
...@@ -799,5 +799,70 @@ public class HGPZTools { ...@@ -799,5 +799,70 @@ public class HGPZTools {
return CollectionUtils.isEmpty(results) ? null : results.get(0); return CollectionUtils.isEmpty(results) ? null : results.get(0);
} }
} }
public static class HgPz017 {
/**
* 查询年份信息
*
* @param year
* @return
*/
public static List<HGPZ017> getYear(String year) {
AssertUtils.isNull(year, String.format("年份不能为空", year));
Map queryMap = new HashMap();
queryMap.put("year", year);
queryMap.put(HGPZ017.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
List<HGPZ017> results = DaoBase.getInstance().query(HGPZ017.QUERY, queryMap);
return results;
}
public static HGPZ017 getId(Long id){
AssertUtils.isNull(id, "ID不能为空");
Map queryMap = new HashMap();
queryMap.put("id", id);
List<HGPZ017> results = DaoBase.getInstance().query(HGPZ017.QUERY, queryMap);
AssertUtils.isEmpty(results, String.format("ID[%s]不存在", id));
return results.get(0);
}
}
public static class HgPz018 {
/**
* 查询年份信息
*
* @param year
* @return
*/
public static List<HGPZ018> getYear(String year) {
AssertUtils.isNull(year, String.format("年份不能为空", year));
Map queryMap = new HashMap();
queryMap.put("year", year);
queryMap.put(HGPZ018.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
List<HGPZ018> results = DaoBase.getInstance().query(HGPZ018.QUERY, queryMap);
return results;
}
public static List<HGPZ018> getPanentId(Long id){
AssertUtils.isNull(id, String.format("id不能为空", id));
return getPanentId(id,null);
}
public static List<HGPZ018> getPanentId(Long id,Integer status){
AssertUtils.isNull(id, String.format("id不能为空", id));
Map queryMap = new HashMap();
queryMap.put(HGPZ018.FIELD_PARENT_ID, id);
if (status != null) {
queryMap.put(HGPZ018.FIELD_STATUS,status);
}
List<HGPZ018> results = DaoBase.getInstance().query(HGPZ018.QUERY, queryMap);
AssertUtils.isNotEmpty(results, String.format("销售目标分解的销售计划已经审批通过,无法删除"));
return results;
}
}
} }
$(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.EFDatePicker = {
"inqu_status-0-year":{
start:"decade",
depth:"decade",
format:"yyyy",
}
}
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let status = item.status;
let template = '';
if (!isBlank(item.id) && status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="taskResolve(' + item.id + ')" >分解</a>';
}
return template;
}
}, {
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}, {
field: "updatedName",
template: function (options) {
return showUserName(options.updatedBy, options.updatedName);
}
}
],
loadComplete: function(grid) {
},
beforeEdit:function (e) {
if (e.model["status"] === "1") {
e.preventDefault();
}
},
onAdd: function (e) {
$.each(e.items, function (index, item) {
item['year'] = currShortDate().substring(0, 4)
});
},
//单元格数据储存时回调
afterEdit:function (e) {
/*if (e.field === "groupCode" && e.model["factoryCode"].length === 0){
for (let i = 0; i < groupCodeBox.length; i++) {
if (e.model[e.field] === groupCodeBox[i]["valueField"]){
e.model["factoryCode"]=groupCodeBox[i]["param1Field"]
break;
}
}
}*/
},
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') {
query();
}
},
exportGrid : {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "销售目标_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls",
exportBlockId: "result",
}
}
}
downKeyUp();
});
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 factoryCode= item.get("factoryCode");
if(isBlank(factoryCode)){
message("选中的第"+(index+1)+"行\"工厂\",不能为空!");
flag = false;
return false;
}
});*/
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ017", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
/**
* 分解销售目标
*
* @param id
*/
function taskResolve(id) {
JSUtils.confirm("确定对数据做\"分解\"操作? ", {
ok: function () {
var info = new EiInfo();
info.set("inqu_status-0-id",id);
info.set("inqu_status-0-status",1);
EiCommunicator.send("HGPZ017", "resolve", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
NotificationUtil(ei);
query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/9/26
Time: 19:25
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<EF:EFPage title="销售目标">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker blockId="inqu_status" row="0" ename="year" cname="年度" colWidth="4"/>
<EF:EFInput blockId="inqu_status" row="0" ename="salesAmount" cname="营业额" editType="number" colWidth="4"
data-regex="/^-?[0-9]{1,18}([.][0-9]{1,2})?$/"
data-errorprompt="请输入数字,该值最大可设置18位整数和2位小数!"
/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="cell">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="year" cname="年度" align="center" width="120" editType="date" start="decade" depth="decade"
readonly="true" dateFormat="yyyy" parseFormats="['yyyy']" required="true"/>
<EF:EFColumn ename="salesCode" cname="单号" enable="false" align="center" width="160"/>
<EF:EFColumn ename="salesAmount" cname="营业额" width="120" format="{0:C2}"
displayType="0.00" sort="true" align="right" maxLength="20" defaultValue="0"
data-regex="/^-?[0-9]{1,18}([.][0-9]{1,2})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFColumn ename="targetExplain" cname="目标说明" align="center" width="200" editType="textarea"/>
<EF:EFComboColumn ename="status" cname="分解状态" width="100" align="center" enable="false" defaultValue="0">
<EF:EFOption label="未分解" value="0"/>
<EF:EFOption label="已分解" value="1"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdName" cname="记录创建者" readonly="true" width="120" align="center" enable="false"/>
<EF:EFColumn ename="createdTime" cname="记录创建时间" enable="false" width="150" align="center" readonly="true"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="updatedName" cname="记录修改者" readonly="true" width="120" align="center" enable="false"/>
<EF:EFColumn ename="updatedTime" cname="记录修改时间" enable="false" width="150" align="center" readonly="true"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(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.EFDatePicker = {
"inqu_status-0-year":{
start:"decade",
depth:"decade",
format:"yyyy",
},
"inqu_status-0-month":{
start:"year",
depth:"year",
format:"mm",
}
}
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
/*{
field: "operator",
title: "操作",
template: function (item) {
let id = item.id;
let template = '';
if (item.status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateStatus(' + item.id + ')" >审核</a>';
}
return template;
}
},*/
{
field: "createdName",
template: function (options) {
return showUserName(options.createdBy, options.createdName);
}
}, {
field: "updatedName",
template: function (options) {
return showUserName(options.updatedBy, options.updatedName);
}
}
],
loadComplete: function(grid) {
$("#SUBMIT").on("click",submitFunc); //审核
},
beforeEdit:function (e) {
if (e.model["status"] === "1") {
e.preventDefault();
}
},
//单元格数据储存时回调
afterEdit:function (e) {
/*if (e.field === "groupCode" && e.model["factoryCode"].length === 0){
for (let i = 0; i < groupCodeBox.length; i++) {
if (e.model[e.field] === groupCodeBox[i]["valueField"]){
e.model["factoryCode"]=groupCodeBox[i]["param1Field"]
break;
}
}
}*/
},
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') {
query();
}
},
exportGrid : {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "销售目标_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls",
exportBlockId: "result",
}
}
}
downKeyUp();
});
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 factoryCode= item.get("factoryCode");
if(isBlank(factoryCode)){
message("选中的第"+(index+1)+"行\"工厂\",不能为空!");
flag = false;
return false;
}
});*/
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGPZ018", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
var flag = true;
rows.forEach(function (row, index) {
if (row.status == "1") {
message("选中的第"+(index+1)+"行已经审核,无法重复审核!");
flag = false;
}
})
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"审核\"操作? ", {
ok: function () {
JSUtils.submitGrid("result", "HGPZ018", "updateStatus",
{isAlldata:false,onSuccessCallback:function () {
query();
}})
}
});
}
}
/**
* 分解销售目标
*
* @param id
*/
function updateStatus(id) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-id", id);
inEiInfo.set("result-0-status", 1);
EiCommunicator.send('HGPZ018', 'updateStatus', inEiInfo, {
onSuccess(response) {
if (ei.getStatus() >= 0) {
NotificationUtil(ei);
query();
} else {
NotificationUtil(ei, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/9/26
Time: 19:25
To change this template use File | Settings | File Templates.
--%>
<!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}"/>
<EF:EFPage title="销售计划">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker blockId="inqu_status" row="0" ename="year" cname="年度" colWidth="4"/>
<EF:EFInput blockId="inqu_status" row="0" ename="salesAmount" cname="营业额" editType="number" colWidth="4"
data-regex="/^-?[0-9]{1,18}([.][0-9]{1,2})?$/"
data-errorprompt="请输入数字,该值最大可设置18位整数和2位小数!"
/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="cell">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<%--<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>--%>
<EF:EFColumn ename="year" cname="年度" align="center" width="120" editType="date" start="decade" depth="decade"
readonly="true" dateFormat="yyyy" parseFormats="['yyyy']"/>
<EF:EFColumn ename="month" cname="月度" align="center" width="120" editType="date" start="year" depth="year"
readonly="true" dateFormat="mm" parseFormats="['mm']"/>
<EF:EFColumn ename="salesCode" cname="单号" enable="false" align="center" width="160"/>
<EF:EFColumn ename="planSalesCode" cname="计划单号" enable="false" align="center" width="160"/>
<EF:EFColumn ename="salesAmount" cname="营业额" width="120" format="{0:N2}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="20"
data-regex="/^-?[0-9]{1,18}([.][0-9]{1,2})?$/"
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
<EF:EFComboColumn ename="status" cname="审批状态" width="100" align="center" defaultValue="0">
<EF:EFCodeOption codeName="hggp.cw.reviewStatus" condition = "ITEM_CODE IN ('0','1')"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdName" cname="记录创建者" readonly="true" width="120" align="center" enable="false"/>
<EF:EFColumn ename="createdTime" cname="记录创建时间" readonly="true" width="150" align="center" enable="false" parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="updatedName" cname="记录修改者" readonly="true" width="120" align="center" enable="false"/>
<EF:EFColumn ename="updatedTime" cname="记录修改时间" readonly="true" width="150" align="center" enable="false" parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</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