| | |
| | | import com.zy.crm.manager.entity.Order; |
| | | import com.zy.crm.manager.service.CompanyTargetService; |
| | | import com.zy.crm.manager.service.OrderService; |
| | | import com.zy.crm.manager.utils.WordUtils; |
| | | import com.zy.crm.system.entity.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | Double progressMoney = orderService.selectMoneyByYearAndStatus(year, 0); |
| | | //获取全年交易失败金额 |
| | | Double failedMoney = orderService.selectMoneyByYearAndStatus(year, 2); |
| | | //全年交易率 |
| | | double yearTransactionRate = successMoney == 0 ? successMoney : (successMoney / (successMoney + progressMoney + failedMoney)) * 100; |
| | | //全年完成率 |
| | | // double yearTransactionRate = successMoney == 0 ? successMoney : (successMoney / (successMoney + progressMoney + failedMoney)) * 100; |
| | | double yearTransactionRate = successMoney == 0 ? successMoney : (successMoney / Double.parseDouble(companyTarget.getTarget())) * 100; |
| | | |
| | | map.put("successMoney", formatter.format(successMoney));//全年交易成功金额 |
| | | map.put("progressMoney", formatter.format(progressMoney));//全年未交易成功金额 |
| | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy"); |
| | | String year = format.format(date); |
| | | |
| | | User user = getUser(); |
| | | String yearTarget = "0";//获取个人全年目标数据 |
| | | if (user.getTarget() != null) { |
| | | yearTarget = formatter.format(Double.parseDouble(user.getTarget())); |
| | | Double yearTarget = 0D;//获取个人全年目标数据 |
| | | CompanyTarget person = companyTargetService.selectPersonByYear(year, getUserId()); |
| | | if (person != null) { |
| | | yearTarget = Double.parseDouble(person.getTarget()); |
| | | } |
| | | map.put("yearTarget", yearTarget);//全年交易目标 |
| | | map.put("yearTarget", formatter.format(yearTarget));//全年交易目标 |
| | | |
| | | //获取全年交易成功金额 |
| | | Double successMoney = orderService.selectMoneyByUserAndYearAndStatus(user.getId(), year, 1); |
| | | Double successMoney = orderService.selectMoneyByUserAndYearAndStatus(getUserId(), year, 1); |
| | | //获取全年未交易成功金额 |
| | | Double progressMoney = orderService.selectMoneyByUserAndYearAndStatus(user.getId(), year, 0); |
| | | Double progressMoney = orderService.selectMoneyByUserAndYearAndStatus(getUserId(), year, 0); |
| | | //获取全年交易失败金额 |
| | | Double failedMoney = orderService.selectMoneyByUserAndYearAndStatus(user.getId(), year, 2); |
| | | //全年交易率 |
| | | double yearTransactionRate = successMoney == 0 ? successMoney : (successMoney / (successMoney + progressMoney + failedMoney)) * 100; |
| | | Double failedMoney = orderService.selectMoneyByUserAndYearAndStatus(getUserId(), year, 2); |
| | | //全年完成率 |
| | | // double yearTransactionRate = successMoney == 0 ? successMoney : (successMoney / (successMoney + progressMoney + failedMoney)) * 100; |
| | | double yearTransactionRate = successMoney == 0 ? successMoney : (successMoney / yearTarget) * 100; |
| | | |
| | | map.put("successMoney", formatter.format(successMoney));//全年交易成功金额 |
| | | map.put("progressMoney", formatter.format(progressMoney));//全年未交易成功金额 |
| | | map.put("yearTransactionRate", String.format("%.2f", yearTransactionRate));//全年交易率 |
| | | |
| | | //获取全年跟踪数量 |
| | | Integer progressCount = orderService.selectCountByUserYearAndStatus(user.getId(), year, 0); |
| | | Integer progressCount = orderService.selectCountByUserYearAndStatus(getUserId(), year, 0); |
| | | //获取全年成交数量 |
| | | Integer successCount = orderService.selectCountByUserYearAndStatus(user.getId(), year, 1); |
| | | Integer successCount = orderService.selectCountByUserYearAndStatus(getUserId(), year, 1); |
| | | map.put("progressCount", progressCount); |
| | | map.put("successCount", successCount); |
| | | |