小程序数据统计小数点处理

This commit is contained in:
韩国东 2023-01-03 09:07:04 +08:00
parent 30bc3affd9
commit 3d0d4d3256
2 changed files with 9 additions and 3 deletions

View File

@ -446,7 +446,8 @@
<!--履职详情-->
<select id="factorDetail" resultMap="ResultMapWithBLOBs">
SELECT * FROM ListDetail ld
SELECT ld.*,ot.Subject taskName FROM ListDetail ld
left join oatask ot on ld.task_id = ot.OATaskId
WHERE ld.ListFactorId = #{listFactorId}
and ld.del_state = 1
ORDER BY ld.EndTime ASC
@ -478,7 +479,9 @@
<!--履职记录详情-->
<select id="findById" resultMap="ResultMapWithBLOBs">
SELECT * FROM ListDetail ld WHERE ld.`ListDetailId` = #{listDetailId}
SELECT ld.*,ot.Subject taskName FROM ListDetail ld
left join oatask ot on ld.task_id = ot.OATaskId
WHERE ld.`ListDetailId` = #{listDetailId}
</select>
<!--履职记录-->

View File

@ -832,7 +832,7 @@ public class PcBusinessService extends BaseController {
public SingleResult entPostListPercentStatistic(String enterpriseId,String listId,Integer year){
public SingleResult entPostListPercentStatistic(String enterpriseId,String listId,Integer year)throws Exception{
SingleResult singleResult = new SingleResult();
HashMap map = new HashMap();
long total = entPostTaskMapper.selectEntPostTaskTotal(enterpriseId,listId,year);
@ -840,10 +840,13 @@ public class PcBusinessService extends BaseController {
EntPostTaskStatistic entPostTaskStatistic = entPostTaskMapper.selectEntPostTaskByState(enterpriseId,listId,year);
if (null != entPostTaskStatistic){
double finishPercent = Arith.div(entPostTaskStatistic.getFinished(),total) * 100;
finishPercent = TypeConversion.decimalFormat(finishPercent,2);
map.put("finished",finishPercent);
double unfinishedPercent = Arith.div(entPostTaskStatistic.getOvertime(),total) * 100;
unfinishedPercent = TypeConversion.decimalFormat(unfinishedPercent,2);
map.put("unfinished",unfinishedPercent);
double haveInHand = Arith.div(entPostTaskStatistic.getHaveInHand(),total) * 100;
haveInHand = TypeConversion.decimalFormat(haveInHand,2);
map.put("haveInHand",haveInHand);
//数量
map.put("finishNumber",entPostTaskStatistic.getFinished());