Commit b1b16318 by liuyang

2024-04-26 销售目标和销售计划功能优化

parent aea392ae
...@@ -32,12 +32,13 @@ public class HPPZ018 extends DaoEPBase { ...@@ -32,12 +32,13 @@ public class HPPZ018 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/ public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/ public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/
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_PARENT_ID = "parentId"; /* 父级ID*/
public static final String FIELD_YEAR = "year"; /* 年度*/ public static final String FIELD_YEAR = "year"; /* 年度*/
public static final String FIELD_MONTH = "month"; /* 月份*/ public static final String FIELD_MONTH = "month"; /* 月份*/
public static final String FIELD_SALES_CODE = "salesCode"; /* 销售单号*/ public static final String FIELD_SALES_CODE = "salesCode"; /* 销售单号*/
public static final String FIELD_PLAN_SALES_CODE = "planSalesCode"; /* 销售计划单号*/ public static final String FIELD_PLAN_SALES_CODE = "planSalesCode"; /* 销售计划单号*/
public static final String FIELD_SALES_AMOUNT = "salesAmount"; /* 营销额*/ public static final String FIELD_SALES_AMOUNT = "salesAmount"; /* 营销额*/
public static final String FIELD_STATUS = "status"; /* 状态 0-未审核,1-已审核*/ public static final String FIELD_STATUS = "status"; /* 审批状态 0-未审批 1-已审批*/
public static final String COL_ID = "ID"; /* ID*/ public static final String COL_ID = "ID"; /* ID*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码*/ public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码*/
...@@ -49,12 +50,13 @@ public class HPPZ018 extends DaoEPBase { ...@@ -49,12 +50,13 @@ public class HPPZ018 extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/ public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改时间*/ 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_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_YEAR = "YEAR"; /* 年度*/
public static final String COL_MONTH = "MONTH"; /* 月份*/ public static final String COL_MONTH = "MONTH"; /* 月份*/
public static final String COL_SALES_CODE = "SALES_CODE"; /* 销售单号*/ 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_PLAN_SALES_CODE = "PLAN_SALES_CODE"; /* 销售计划单号*/
public static final String COL_SALES_AMOUNT = "SALES_AMOUNT"; /* 营销额*/ public static final String COL_SALES_AMOUNT = "SALES_AMOUNT"; /* 营销额*/
public static final String COL_STATUS = "STATUS"; /* 状态 0-未审核,1-已审核*/ public static final String COL_STATUS = "STATUS"; /* 审批状态 0-未审批 1-已审批*/
public static final String QUERY = "HPPZ018.query"; public static final String QUERY = "HPPZ018.query";
public static final String COUNT = "HPPZ018.count"; public static final String COUNT = "HPPZ018.count";
...@@ -63,6 +65,7 @@ public class HPPZ018 extends DaoEPBase { ...@@ -63,6 +65,7 @@ public class HPPZ018 extends DaoEPBase {
public static final String DELETE = "HPPZ018.delete"; public static final String DELETE = "HPPZ018.delete";
public static final String DELETE_FLAG = "HPPZ018.deleteFlag"; public static final String DELETE_FLAG = "HPPZ018.deleteFlag";
public static final String UPDATE_STATUS = "HPPZ018.updateStatus"; public static final String UPDATE_STATUS = "HPPZ018.updateStatus";
public static final String DELETE_BY_PARENT_ID = "HPPZ018.deleteByParentId";
private Long id = new Long(0); /* ID*/ private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码*/ private String companyCode = " "; /* 企业编码*/
...@@ -74,12 +77,13 @@ public class HPPZ018 extends DaoEPBase { ...@@ -74,12 +77,13 @@ public class HPPZ018 extends DaoEPBase {
private String updatedName = " "; /* 修改人名称*/ private String updatedName = " "; /* 修改人名称*/
private String updatedTime = " "; /* 修改时间*/ private String updatedTime = " "; /* 修改时间*/
private Integer deleteFlag = 0; /* 是否删除0:否1.是*/ private Integer deleteFlag = 0; /* 是否删除0:否1.是*/
private Long parentId = new Long(0); /* 父级ID*/
private String year = " "; /* 年度*/ private String year = " "; /* 年度*/
private String month = " "; /* 月份*/ private String month = " "; /* 月份*/
private String salesCode = " "; /* 销售单号*/ private String salesCode = " "; /* 销售单号*/
private String planSalesCode = " "; /* 销售计划单号*/ private String planSalesCode = " "; /* 销售计划单号*/
private BigDecimal salesAmount = new BigDecimal("0"); /* 营销额*/ private BigDecimal salesAmount = new BigDecimal("0"); /* 营销额*/
private Integer status = 0; /* 状态 0-未审核,1-已审核*/ private Integer status = 0; /* 审批状态 0-未审批 1-已审批*/
/** /**
...@@ -129,6 +133,10 @@ public class HPPZ018 extends DaoEPBase { ...@@ -129,6 +133,10 @@ public class HPPZ018 extends DaoEPBase {
eiColumn.setDescName("是否删除0:否1.是"); eiColumn.setDescName("是否删除0:否1.是");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARENT_ID);
eiColumn.setDescName("父级ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_YEAR); eiColumn = new EiColumn(FIELD_YEAR);
eiColumn.setDescName("年度"); eiColumn.setDescName("年度");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -325,6 +333,15 @@ public class HPPZ018 extends DaoEPBase { ...@@ -325,6 +333,15 @@ public class HPPZ018 extends DaoEPBase {
public void setDeleteFlag(Integer deleteFlag) { public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag; this.deleteFlag = deleteFlag;
} }
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
/** /**
* get the year - 年度. * get the year - 年度.
* @return the year * @return the year
...@@ -432,6 +449,7 @@ public class HPPZ018 extends DaoEPBase { ...@@ -432,6 +449,7 @@ public class HPPZ018 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName)); setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime)); setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag)); 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)); setYear(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_YEAR)), year));
setMonth(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MONTH)), month)); setMonth(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MONTH)), month));
setSalesCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SALES_CODE)), salesCode)); setSalesCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SALES_CODE)), salesCode));
...@@ -457,6 +475,7 @@ public class HPPZ018 extends DaoEPBase { ...@@ -457,6 +475,7 @@ public class HPPZ018 extends DaoEPBase {
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME))); 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_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_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_YEAR, StringUtils.toString(year, eiMetadata.getMeta(FIELD_YEAR)));
map.put(FIELD_MONTH, StringUtils.toString(month, eiMetadata.getMeta(FIELD_MONTH))); 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_SALES_CODE, StringUtils.toString(salesCode, eiMetadata.getMeta(FIELD_SALES_CODE)));
......
...@@ -56,6 +56,14 @@ public class ServiceHPPZ017 extends ServiceEPBase { ...@@ -56,6 +56,14 @@ public class ServiceHPPZ017 extends ServiceEPBase {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hppz017.fromMap(map); hppz017.fromMap(map);
hppz017.setDeleteFlag(CommonConstant.YesNo.YES_1); hppz017.setDeleteFlag(CommonConstant.YesNo.YES_1);
if (hppz017.getStatus() == 1) {
//判断销售目标的销售计划是否有审批通过
HPPZTools.HpPz018.getPanentId(hppz017.getId(),1);
DaoUtils.update(HPPZ018.DELETE_BY_PARENT_ID,new HashMap<String,Object>(){{
put(HPPZ018.FIELD_PARENT_ID,hppz017.getId());
put(HPPZ018.FIELD_DELETE_FLAG,CommonConstant.YesNo.YES_1);
}});
}
DaoUtils.update(HPPZ017.DELETE_FLAG, hppz017); DaoUtils.update(HPPZ017.DELETE_FLAG, hppz017);
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
...@@ -63,9 +71,10 @@ public class ServiceHPPZ017 extends ServiceEPBase { ...@@ -63,9 +71,10 @@ public class ServiceHPPZ017 extends ServiceEPBase {
} catch (PlatException e) { } catch (PlatException e) {
e.printStackTrace(); e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE); //inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e); LogUtils.setDetailMsg(inInfo, e, "删除失败");
logError("删除失败", e.getMessage()); //ErrorCodeUtils.handleDeleteException(inInfo,i,e);
//logError("删除失败", e.getMessage());
return inInfo; return inInfo;
} }
return inInfo; return inInfo;
...@@ -129,6 +138,7 @@ public class ServiceHPPZ017 extends ServiceEPBase { ...@@ -129,6 +138,7 @@ public class ServiceHPPZ017 extends ServiceEPBase {
HPPZ018 hppz018 = new HPPZ018(); HPPZ018 hppz018 = new HPPZ018();
hppz018.toMap(); hppz018.toMap();
hppz018.setYear(hppz017.getYear()); hppz018.setYear(hppz017.getYear());
hppz018.setParentId(Long.valueOf(id));
hppz018.setSalesCode(hppz017.getSalesCode()); hppz018.setSalesCode(hppz017.getSalesCode());
BigDecimal bigDecimal = hppz017.getSalesAmount().divide(new BigDecimal(12),2,RoundingMode.UP); BigDecimal bigDecimal = hppz017.getSalesAmount().divide(new BigDecimal(12),2,RoundingMode.UP);
for (String months:MONTHS) { for (String months:MONTHS) {
...@@ -137,7 +147,6 @@ public class ServiceHPPZ017 extends ServiceEPBase { ...@@ -137,7 +147,6 @@ public class ServiceHPPZ017 extends ServiceEPBase {
hppz018.setSalesAmount(bigDecimal); hppz018.setSalesAmount(bigDecimal);
DaoUtils.insert(HPPZ018.INSERT, hppz018); DaoUtils.insert(HPPZ018.INSERT, hppz018);
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次数据分解成功!"); inInfo.setMsg("操作成功!本次数据分解成功!");
} catch (Exception e) { } catch (Exception e) {
......
...@@ -36,6 +36,7 @@ public class ServiceHPPZ018 extends ServiceEPBase { ...@@ -36,6 +36,7 @@ public class ServiceHPPZ018 extends ServiceEPBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPPZ018.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo,HPPZ018.QUERY); return super.query(inInfo,HPPZ018.QUERY);
} }
......
...@@ -44,6 +44,7 @@ public class ServiceHPPZ019 extends ServiceEPBase { ...@@ -44,6 +44,7 @@ public class ServiceHPPZ019 extends ServiceEPBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPPZ019.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPPZ019.FIELD_CONTRACT_DATE, inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPPZ019.FIELD_CONTRACT_DATE,
DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPPZ019.FIELD_CONTRACT_DATE))); DateUtils.formatShort(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPPZ019.FIELD_CONTRACT_DATE)));
return super.query(inInfo, HPPZ019.QUERY); return super.query(inInfo, HPPZ019.QUERY);
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
YEAR DESC YEAR DESC,STATUS asc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
UPDATED_BY = #updatedBy#, <!-- 修改人 --> UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 --> UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 --> UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 --> DELETE_FLAG = #deleteFlag# <!-- 是否删除0:否1.是 -->
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
......
...@@ -56,6 +56,9 @@ ...@@ -56,6 +56,9 @@
<isNotEmpty prepend=" AND " property="deleteFlag"> <isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag# DELETE_FLAG = #deleteFlag#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="year"> <isNotEmpty prepend=" AND " property="year">
YEAR = #year# YEAR = #year#
</isNotEmpty> </isNotEmpty>
...@@ -89,12 +92,13 @@ ...@@ -89,12 +92,13 @@
UPDATED_NAME as "updatedName", <!-- 修改人名称 --> UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 --> UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 --> DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
PARENT_ID as "parentId", <!-- 父级ID -->
YEAR as "year", <!-- 年度 --> YEAR as "year", <!-- 年度 -->
MONTH as "month", <!-- 月份 --> MONTH as "month", <!-- 月份 -->
SALES_CODE as "salesCode", <!-- 销售单号 --> SALES_CODE as "salesCode", <!-- 销售单号 -->
PLAN_SALES_CODE as "planSalesCode", <!-- 销售计划单号 --> PLAN_SALES_CODE as "planSalesCode", <!-- 销售计划单号 -->
SALES_AMOUNT as "salesAmount", <!-- 营销额 --> SALES_AMOUNT as "salesAmount", <!-- 营销额 -->
STATUS as "status" <!-- 状态 0-未审核,1-已审核 --> STATUS as "status" <!-- 审批状态 0-未审批 1-已审批 -->
FROM ${hpjxSchema}.T_HPPZ018 WHERE 1=1 FROM ${hpjxSchema}.T_HPPZ018 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
...@@ -102,7 +106,7 @@ ...@@ -102,7 +106,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc YEAR desc,MONTH asc,STATUS asc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -172,14 +176,15 @@ ...@@ -172,14 +176,15 @@
UPDATED_NAME, <!-- 修改人名称 --> UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 --> UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除0:否1.是 --> DELETE_FLAG, <!-- 是否删除0:否1.是 -->
PARENT_ID, <!-- 父级ID -->
YEAR, <!-- 年度 --> YEAR, <!-- 年度 -->
MONTH, <!-- 月份 --> MONTH, <!-- 月份 -->
SALES_CODE, <!-- 销售单号 --> SALES_CODE, <!-- 销售单号 -->
PLAN_SALES_CODE, <!-- 销售计划单号 --> PLAN_SALES_CODE, <!-- 销售计划单号 -->
SALES_AMOUNT, <!-- 营销额 --> SALES_AMOUNT, <!-- 营销额 -->
STATUS STATUS <!-- 审批状态 0-未审批 1-已审批 -->
) )
VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #year#, #month#, #salesCode#, #planSalesCode#, #salesAmount#, #status#) VALUES (#id#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #parentId#, #year#, #month#, #salesCode#, #planSalesCode#, #salesAmount#, #status#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -194,11 +199,23 @@ ...@@ -194,11 +199,23 @@
UPDATED_BY = #updatedBy#, <!-- 修改人 --> UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 --> UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 --> UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 --> DELETE_FLAG = #deleteFlag# <!-- 是否删除0:否1.是 -->
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
<!--parentId逻辑删除-->
<update id="deleteByParentId">
UPDATE ${hpjxSchema}.T_HPPZ018
SET
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag# <!-- 是否删除0:否1.是 -->
WHERE
PARENT_ID = #parentId#
</update>
<!--审批状态--> <!--审批状态-->
<update id="updateStatus"> <update id="updateStatus">
UPDATE ${hpjxSchema}.T_HPPZ018 UPDATE ${hpjxSchema}.T_HPPZ018
...@@ -223,12 +240,13 @@ ...@@ -223,12 +240,13 @@
UPDATED_NAME = #updatedName#, <!-- 修改人名称 --> UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 修改时间 --> UPDATED_TIME = #updatedTime#, <!-- 修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 --> DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
PARENT_ID = #parentId#, <!-- 父级ID -->
YEAR = #year#, <!-- 年度 --> YEAR = #year#, <!-- 年度 -->
MONTH = #month#, <!-- 月份 --> MONTH = #month#, <!-- 月份 -->
SALES_CODE = #salesCode#, <!-- 销售单号 --> SALES_CODE = #salesCode#, <!-- 销售单号 -->
PLAN_SALES_CODE = #planSalesCode#, <!-- 销售计划单号 --> PLAN_SALES_CODE = #planSalesCode#, <!-- 销售计划单号 -->
SALES_AMOUNT = #salesAmount#, <!-- 营销额 --> SALES_AMOUNT = #salesAmount#, <!-- 营销额 -->
STATUS = #status# STATUS = #status# <!-- 审批状态 0-未审批 1-已审批 -->
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
...@@ -238,7 +256,7 @@ ...@@ -238,7 +256,7 @@
CONCAT(YEAR,MONTH) as "yearMonth", CONCAT(YEAR,MONTH) as "yearMonth",
PLAN_SALES_CODE AS "planSalesCode" PLAN_SALES_CODE AS "planSalesCode"
FROM ${hpjxSchema}.T_HPPZ018 FROM ${hpjxSchema}.T_HPPZ018
WHERE 1=1 WHERE 1=1 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
......
...@@ -832,6 +832,7 @@ public class HPPZTools { ...@@ -832,6 +832,7 @@ public class HPPZTools {
AssertUtils.isNull(year, String.format("年份不能为空", year)); AssertUtils.isNull(year, String.format("年份不能为空", year));
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("year", year); queryMap.put("year", year);
queryMap.put(HPPZ017.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
List<HPPZ017> results = DaoBase.getInstance().query(HPPZ017.QUERY, queryMap); List<HPPZ017> results = DaoBase.getInstance().query(HPPZ017.QUERY, queryMap);
return results; return results;
...@@ -859,9 +860,40 @@ public class HPPZTools { ...@@ -859,9 +860,40 @@ public class HPPZTools {
AssertUtils.isNull(year, String.format("年份不能为空", year)); AssertUtils.isNull(year, String.format("年份不能为空", year));
Map queryMap = new HashMap(); Map queryMap = new HashMap();
queryMap.put("year", year); queryMap.put("year", year);
List<HPPZ018> results = DaoBase.getInstance().query(HPPZ017.QUERY, queryMap); queryMap.put(HPPZ018.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
List<HPPZ018> results = DaoBase.getInstance().query(HPPZ018.QUERY, queryMap);
return results; return results;
} }
public static List<HPPZ018> getPanentId(Long id){
AssertUtils.isNull(id, String.format("id不能为空", id));
return getPanentId(id,null);
}
public static List<HPPZ018> getPanentId(Long id,Integer status){
AssertUtils.isNull(id, String.format("id不能为空", id));
Map queryMap = new HashMap();
queryMap.put(HPPZ018.FIELD_PARENT_ID, id);
if (status != null) {
queryMap.put(HPPZ018.FIELD_STATUS,status);
}
List<HPPZ018> results = DaoBase.getInstance().query(HPPZ018.QUERY, queryMap);
AssertUtils.isNotEmpty(results, String.format("销售目标分解的销售计划已经审批通过,无法删除"));
return results;
}
}
public static class HpPz019 {
public static List<HPPZ019> getPlanSalesCode(String planSalesCode){
AssertUtils.isNull(planSalesCode, String.format("销售计划单号不能为空", planSalesCode));
Map queryMap = new HashMap();
queryMap.put(HPPZ019.FIELD_PLAN_SALES_CODE, planSalesCode);
queryMap.put(HPPZ019.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
List<HPPZ019> results = DaoBase.getInstance().query(HPPZ019.QUERY, queryMap);
//AssertUtils.isEmpty(results, String.format("部件编码[%s]信息不存在", prdtCode));
return results;
}
} }
} }
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