|  |  | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | import javax.servlet.http.HttpServletRequest; | 
 |  |  | import java.text.SimpleDateFormat; | 
 |  |  | import java.util.*; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  | 
 |  |  |     public R chartAxisEvening(){ | 
 |  |  |         return R.ok().add(mobileService.chartAxisEvening()); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @RequestMapping("/pack/morning/v2") | 
 |  |  | //    @ManagerAuth(memo = "测试库合格数") | 
 |  |  |     public R chartAxisMorningV2(){ | 
 |  |  |         Map<String,Object> map=new HashMap<String, Object>(); | 
 |  |  |         List<AxisBean> list = new ArrayList<AxisBean>(); | 
 |  |  |  | 
 |  |  |         List<WorkChartAxis> listChart = mobileService.chartAxisMorning(); | 
 |  |  |  | 
 |  |  |         if(listChart!=null) { | 
 |  |  |             ArrayList<Integer> data1 = new ArrayList<Integer>(); | 
 |  |  |             ArrayList<Integer> data2 = new ArrayList<Integer>(); | 
 |  |  |  | 
 |  |  |             SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); | 
 |  |  |             Calendar calendar = Calendar.getInstance(); | 
 |  |  |             calendar.add(Calendar.DATE, -12); | 
 |  |  |             for(int i=0;i<12;i++) { | 
 |  |  |                 boolean flag = true; | 
 |  |  |                 calendar.add(Calendar.DATE, 1); | 
 |  |  |                 String str = sf.format(calendar.getTime()); | 
 |  |  |                 for(WorkChartAxis workChart : listChart) { | 
 |  |  |                     if(str.equals(workChart.getYmd())) { | 
 |  |  |                         data1.add(workChart.getInqty()); | 
 |  |  |                         data2.add(workChart.getOutqty()); | 
 |  |  |                         flag = false; | 
 |  |  |                         break; | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |                 if(flag) { | 
 |  |  |                     data1.add(0); | 
 |  |  |                     data2.add(0); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             AxisBean inqty = new AxisBean(); | 
 |  |  |             inqty.setName("入库数量"); | 
 |  |  |             Integer[] array1 = new Integer[data1.size()]; | 
 |  |  |             inqty.setData(data1.toArray(array1)); | 
 |  |  |             list.add(inqty); | 
 |  |  |             AxisBean outqty = new AxisBean(); | 
 |  |  |             outqty.setName("出库数量"); | 
 |  |  |             Integer[] array2 = new Integer[data2.size()]; | 
 |  |  |             outqty.setData(data2.toArray(array2)); | 
 |  |  |             list.add(outqty); | 
 |  |  |         } | 
 |  |  |         map.put("rows",list); | 
 |  |  |         return R.ok(map); | 
 |  |  |     } | 
 |  |  |     /** | 
 |  |  |      * 晚20-第二天早8 | 
 |  |  |      */ | 
 |  |  |     @RequestMapping("/pack/evening/v2") | 
 |  |  | //    @ManagerAuth(memo = "测试库合格数") | 
 |  |  |     public R chartAxisEveningV2(){ | 
 |  |  |         Map<String,Object> map=new HashMap<String, Object>(); | 
 |  |  |         List<AxisBean> list = new ArrayList<AxisBean>(); | 
 |  |  |  | 
 |  |  |         List<WorkChartAxis> listChart = mobileService.chartAxisEvening(); | 
 |  |  |  | 
 |  |  |         if(listChart!=null) { | 
 |  |  |             ArrayList<Integer> data1 = new ArrayList<Integer>(); | 
 |  |  |             ArrayList<Integer> data2 = new ArrayList<Integer>(); | 
 |  |  |  | 
 |  |  |             SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); | 
 |  |  |             Calendar calendar = Calendar.getInstance(); | 
 |  |  |             calendar.add(Calendar.DATE, -12); | 
 |  |  |             for(int i=0;i<12;i++) { | 
 |  |  |                 boolean flag = true; | 
 |  |  |                 calendar.add(Calendar.DATE, 1); | 
 |  |  |                 String str = sf.format(calendar.getTime()); | 
 |  |  |                 for(WorkChartAxis workChart : listChart) { | 
 |  |  |                     if(str.equals(workChart.getYmd())) { | 
 |  |  |                         data1.add(workChart.getInqty()); | 
 |  |  |                         data2.add(workChart.getOutqty()); | 
 |  |  |                         flag = false; | 
 |  |  |                         break; | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |                 if(flag) { | 
 |  |  |                     data1.add(0); | 
 |  |  |                     data2.add(0); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             AxisBean inqty = new AxisBean(); | 
 |  |  |             inqty.setName("入库数量"); | 
 |  |  |             Integer[] array1 = new Integer[data1.size()]; | 
 |  |  |             inqty.setData(data1.toArray(array1)); | 
 |  |  |             list.add(inqty); | 
 |  |  |             AxisBean outqty = new AxisBean(); | 
 |  |  |             outqty.setName("出库数量"); | 
 |  |  |             Integer[] array2 = new Integer[data2.size()]; | 
 |  |  |             outqty.setData(data2.toArray(array2)); | 
 |  |  |             list.add(outqty); | 
 |  |  |         } | 
 |  |  |         map.put("rows",list); | 
 |  |  |         return R.ok(map); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /*...........................赣州新增..............以上.............赣州新增...........................*/ | 
 |  |  |  | 
 |  |  |  |