| | |
| | | import com.zy.common.model.WrkDto; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.common.web.param.SearchLocParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | /*...........................赣州新增..............以下.............赣州新增...........................*/ |
| | | @PostMapping("/test/startUp/auth") |
| | | @ManagerAuth(memo = "申请PACK测试") |
| | | public synchronized R startUpTestPACK(@RequestBody TestMast testMast) { |
| | | if (Cools.isEmpty(testMast)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | mobileService.startUpTestPACK(testMast); //提交测试系统 |
| | | return R.ok(); |
| | | } |
| | | // @PostMapping("/test/startUp/auth") |
| | | // @ManagerAuth(memo = "申请PACK测试") |
| | | // public synchronized R startUpTestPACK(@RequestBody TestMast testMast) { |
| | | // if (Cools.isEmpty(testMast)) { |
| | | // return R.parse(BaseRes.PARAM); |
| | | // } |
| | | // mobileService.startUpTestPACK(testMast); //提交测试系统 |
| | | // return R.ok(); |
| | | // } |
| | | |
| | | @PostMapping("/test/suspend/auth") |
| | | // @ManagerAuth(memo = "暂停测试") |
| | | public synchronized R suspendTestPACK() { |
| | | mobileService.suspendTestPACK(); //请求暂停测试 |
| | | return R.ok(); |
| | | @ResponseBody |
| | | public synchronized R suspendTestPACK(@RequestBody SearchLocParam param) { |
| | | if (mobileService.suspendTestPACK(param.getBarcode())){ //请求暂停测试 |
| | | return R.ok(); |
| | | }else { |
| | | return R.error("暂停失败"); |
| | | } |
| | | } |
| | | /** |
| | | * 测试库基本信息 |
| | | */ |
| | | @RequestMapping("/pack/basic/information") |
| | | // @ManagerAuth(memo = "测试库基本信息") |
| | | public R packTestBasicInformation(){ |
| | | return R.ok().add(mobileService.packTestBasicInformation()); |
| | | } |
| | | /** |
| | | * 测试库使用情况 |
| | | */ |
| | | @RequestMapping("/pack/usage/rate") |
| | | // @ManagerAuth(memo = "测试库使用情况") |
| | | public R packUsageRate(){ |
| | | return R.ok().add(mobileService.packUsageRate()); |
| | | } |
| | | /** |
| | | * 测试库合格数 |
| | | */ |
| | | @RequestMapping("/pack/qualified") |
| | | // @ManagerAuth(memo = "测试库合格数") |
| | | public R packQualified(){ |
| | | return R.ok().add(mobileService.packQualified()); |
| | | } |
| | | /** |
| | | * 早8-晚20 |
| | | */ |
| | | @RequestMapping("/pack/morning") |
| | | // @ManagerAuth(memo = "测试库合格数") |
| | | public R chartAxisMorning(){ |
| | | return R.ok().add(mobileService.chartAxisMorning()); |
| | | } |
| | | /** |
| | | * 晚20-第二天早8 |
| | | */ |
| | | @RequestMapping("/pack/evening") |
| | | // @ManagerAuth(memo = "测试库合格数") |
| | | 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); |
| | | } |
| | | |
| | | /*...........................赣州新增..............以上.............赣州新增...........................*/ |
| | | |
| | | |