代码拉取完成,页面将自动刷新
64
修复首页的金额统计bug(在小月份[月末为28、29、30时]下触发)
已关闭
bug描述:
在小月份(月末为28、29、30时)的任意一天,登录后进入首页,后台日志报错。
bug原因:
DepotItemMapperEx.xml中日期条件参数问题(中'${MonthTime}-01 00:00:00'和'${MonthTime}-31 23:59:59')
<select id="buyOrSaleNumber" resultType="java.math.BigDecimal">
select ifnull(sum(BasicNumber),0) as BasicNumber from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id
and dh.type='${type}' and dh.subType='${subType}'
and di.MaterialId =${MId}
and dh.OperTime >= '${MonthTime}-01 00:00:00'
and dh.OperTime <= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="buyOrSalePrice" resultType="java.math.BigDecimal">
select ifnull(sum(AllPrice),0) as AllPrice from jsh_depotitem di,jsh_depothead dh
where di.HeaderId = dh.id
and dh.type='${type}' and dh.subType='${subType}'
and di.MaterialId =${MId}
and dh.OperTime >= '${MonthTime}-01 00:00:00'
and dh.OperTime <= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
</select>
<select id="inOrOutPrice" resultType="java.math.BigDecimal">
select ifnull(sum(DiscountLastMoney),0) as allMoney from jsh_depothead dh
where 1=1
and dh.type='${type}' and dh.subType='${subType}'
and dh.OperTime >= '${MonthTime}-01 00:00:00'
and dh.OperTime <= '${MonthTime}-31 23:59:59'
and ifnull(dh.delete_Flag,'0') !='1'
</select>
bug解决:
- 在Tools工具类添加日期处理方法(获取指定日期的月初和月末日期字符串)
- 修改DepotItemMapperEx.xml中有相关问题的sql
- 修改DepotItemMapperEx.java类中相关方法的参数(将“年月”MonthTime替换为“月初”monthStartDateStr和“月末”monthEndDateStr)
- 修改Service类中调用到上述相关方法的代码