| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.entity.CompanyTarget; |
| | | 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.entity.*; |
| | | import com.zy.crm.manager.service.*; |
| | | import com.zy.crm.system.entity.Role; |
| | | import com.zy.crm.system.entity.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private CompanyTargetService companyTargetService; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private PlanService planService; |
| | | @Autowired |
| | | private PriOnline2Service priOnline2Service; |
| | | @Autowired |
| | | private PriQuoteService priQuoteService; |
| | | @Autowired |
| | | private BusinessTripService businessTripService; |
| | | @Autowired |
| | | private BusinessTripOtherService businessTripOtherService; |
| | | @Autowired |
| | | private ReimburseOnlineService reimburseOnlineService; |
| | | @Autowired |
| | | private CompanyMoneyService companyMoneyService; |
| | | |
| | | //获取团队数据 |
| | | @RequestMapping(value = "/dashboard/companyData/auth") |
| | |
| | | map.put("progressCount", progressCount); |
| | | map.put("successCount", successCount); |
| | | |
| | | // planPendingTaskCount |
| | | // priOnlinePendingTaskCount |
| | | // priQuotePendingTaskCount |
| | | // businessTripPendingTaskCount |
| | | // reimburseOnlinePendingTaskCount |
| | | // planPriOnlinePendingTaskCount |
| | | |
| | | //获取待处理任务数量 |
| | | int planPendingTaskCount = planService.selectCount(new EntityWrapper<Plan>().eq("director", getUserId()).lt("settle",4)); |
| | | map.put("planPendingTaskCount", planPendingTaskCount); |
| | | int priOnlinePendingTaskCount = priOnline2Service.selectCount(new EntityWrapper<PriOnline2>().eq("member_id", getUserId()).lt("settle",2)); |
| | | map.put("priOnlinePendingTaskCount", priOnlinePendingTaskCount); |
| | | int priQuotePendingTaskCount = priQuoteService.selectCount(new EntityWrapper<PriQuote>().eq("member_id", getUserId()).lt("settle",4)); |
| | | map.put("priQuotePendingTaskCount", priQuotePendingTaskCount); |
| | | int businessTripCount = businessTripService.selectCount(new EntityWrapper<BusinessTrip>().eq("member_id", getUserId()).lt("settle", 2)); |
| | | int businessTripOtherCount = businessTripOtherService.selectCount(new EntityWrapper<BusinessTripOther>().eq("member_id", getUserId()).lt("settle",2)); |
| | | int businessTripPendingTaskCount = businessTripCount+businessTripOtherCount; |
| | | map.put("businessTripPendingTaskCount", businessTripPendingTaskCount); |
| | | int reimburseOnlinePendingTaskCount = reimburseOnlineService.selectCount(new EntityWrapper<ReimburseOnline>().eq("member_id", getUserId()).lt("settle",6)); |
| | | map.put("reimburseOnlinePendingTaskCount", reimburseOnlinePendingTaskCount); |
| | | int planPriOnlinePendingTaskCount = planService.selectCount(new EntityWrapper<Plan>().eq("status", 1).eq("settle",4)); |
| | | map.put("planPriOnlinePendingTaskCount", planPriOnlinePendingTaskCount); |
| | | |
| | | Double successMoney1 = companyMoneyService.selectMoneyReceivablesAll(getUserId(), year); |
| | | map.put("successMoney1", successMoney1==null? 0:successMoney1); |
| | | |
| | | Double successMoney2 = companyMoneyService.selectMoneyActualReceiptsAll(getUserId(), year); |
| | | map.put("successMoney2", successMoney2==null? 0:successMoney2); |
| | | |
| | | |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R getCurrentMonthData() { |
| | | List<Double> list = orderService.selectCurrentYearMonthSuccess(); |
| | | return R.ok().add(list); |
| | | List<Double> lists = new ArrayList<>(); |
| | | int i = 0; |
| | | Double[] money=new Double[]{0.0,0.0,0.0,0.0}; |
| | | for (Double d : list){ |
| | | if (i<3){ |
| | | money[0] = money[0]+d; |
| | | }else if (i<6){ |
| | | money[1] = money[1]+d; |
| | | }else if (i<9){ |
| | | money[2] = money[2]+d; |
| | | }else if (i<12){ |
| | | money[3] = money[3]+d; |
| | | } |
| | | i++; |
| | | } |
| | | for (Double d : money){ |
| | | double d1=d/3; |
| | | lists.add(d1); |
| | | lists.add(d1); |
| | | lists.add(d1); |
| | | } |
| | | return R.ok().add(lists); |
| | | } |
| | | |
| | | @RequestMapping("/dashboard/popup/auth") |