| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | view.setViewName("admin/inout/in-register"); |
| | | return view; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 扦样页面 |
| | | * |
| | | * @param sort 表示使用的出入库设备配套号,不传递默认为1 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/in-sample") |
| | | public ModelAndView inSample(HttpServletRequest httpRequest, @RequestParam(value = "sort", required = false) String sort) { |
| | | if (StringUtils.isEmpty(sort)) { |
| | | sort = commonManager.getInoutWeightByClient(httpRequest); |
| | | } |
| | | ModelAndView view = new ModelAndView(); |
| | | // 仓库列表做下拉框使用 |
| | | List<Depot> listDepot = commonManager.listDepot(true); |
| | | view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); |
| | | |
| | | IUser user = ContextUtil.getLoginUser(); |
| | | view.addObject(Constant.MODEL_KEY_LOGIN_USER, user); |
| | | |
| | | String deptId = ContextUtil.subDeptId(user); |
| | | |
| | | view.addObject("bizType", BizType.INOUT_IN.getCode()); |
| | | view.addObject("type", InoutConstant.TYPE_IN); |
| | | view.addObject("deptId", deptId); |
| | | DefaultDept dept = commonManager.getSubDept(user, deptId); |
| | | view.addObject("deptName", dept.getName()); |
| | | |
| | | //入库流程 |
| | | String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(), deptId, InoutConstant.TYPE_IN); |
| | | view.addObject("inoutProgress", inoutProgress); |
| | | |
| | | // 当前流程节点 |
| | | view.addObject("progress", InoutConstant.PROGRESS_CHECK); |
| | | |
| | | // 粮食品种下拉框 |
| | | List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger( |
| | | Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId()); |
| | | view.addObject("listFoodVariety", listFoodVariety); |
| | | |
| | | // 粮食等级下拉框 |
| | | List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger( |
| | | Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId()); |
| | | view.addObject("listFoodLevel", listFoodLevel); |
| | | |
| | | view.addObject("endTime", |
| | | DateFormatUtils.format(new Date(), "yyyy-MM-dd")); |
| | | view.addObject("startTime", DateFormatUtils.format( |
| | | DateUtil.getNewByDay(null, -10), "yyyy-MM-dd")); |
| | | |
| | | // 获取出入库配置信息 |
| | | List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId); |
| | | |
| | | // 获取扦样机信息 |
| | | InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_20, InoutConstant.PROGRESS_CHECK, 1); |
| | | view.addObject("checkDto", conf); |
| | | view.setViewName("admin/inout/in-sample"); |
| | | return view; |
| | | } |
| | | |
| | | /** |
| | | * 扦样化验页面 |
| | | * 质检页面 |
| | | * |
| | | * @param sort 表示使用的出入库设备配套号,不传递默认为1 |
| | | * @return |
| | |
| | | // 当前流程节点 |
| | | view.addObject("progress", InoutConstant.PROGRESS_CARD_BACK); |
| | | |
| | | // 粮食品种下拉框 |
| | | List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger( |
| | | Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId()); |
| | | view.addObject("listFoodVariety", listFoodVariety); |
| | | |
| | | // 粮食等级下拉框 |
| | | List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger( |
| | | Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId()); |
| | | view.addObject("listFoodLevel", listFoodLevel); |
| | | |
| | | view.setViewName("admin/inout/in-card-back"); |
| | | return view; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 扦样页面提交更新 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/submit-sample") |
| | | @Transactional |
| | | public PageResponse<InoutCheckData> submitSample(@RequestBody InoutCheckData data) throws Exception { |
| | | return inoutManager.submitSample(data); |
| | | } |
| | | |
| | | /** |
| | | * 出入库称重环节提交 |
| | | * |
| | | * @param data |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 扦样页面 |
| | | * |
| | | * @param sort 表示使用的出入库设备配套号,不传递默认为1 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/in-sample") |
| | | public ModelAndView inSample(HttpServletRequest httpRequest, @RequestParam(value = "sort", required = false) String sort) { |
| | | if (StringUtils.isEmpty(sort)) { |
| | | sort = commonManager.getInoutWeightByClient(httpRequest); |
| | | } |
| | | ModelAndView view = new ModelAndView(); |
| | | // 仓库列表做下拉框使用 |
| | | List<Depot> listDepot = commonManager.listDepot(true); |
| | | view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); |
| | | |
| | | IUser user = ContextUtil.getLoginUser(); |
| | | view.addObject(Constant.MODEL_KEY_LOGIN_USER, user); |
| | | |
| | | String deptId = ContextUtil.subDeptId(user); |
| | | |
| | | view.addObject("bizType", BizType.INOUT_IN.getCode()); |
| | | view.addObject("type", InoutConstant.TYPE_IN); |
| | | view.addObject("deptId", deptId); |
| | | DefaultDept dept = commonManager.getSubDept(user, deptId); |
| | | view.addObject("deptName", dept.getName()); |
| | | |
| | | //入库流程 |
| | | String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(), deptId, InoutConstant.TYPE_IN); |
| | | view.addObject("inoutProgress", inoutProgress); |
| | | |
| | | // 当前流程节点 |
| | | view.addObject("progress", InoutConstant.PROGRESS_CHECK); |
| | | |
| | | // 粮食品种下拉框 |
| | | List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger( |
| | | Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId()); |
| | | view.addObject("listFoodVariety", listFoodVariety); |
| | | |
| | | // 粮食等级下拉框 |
| | | List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger( |
| | | Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId()); |
| | | view.addObject("listFoodLevel", listFoodLevel); |
| | | |
| | | view.addObject("endTime", |
| | | DateFormatUtils.format(new Date(), "yyyy-MM-dd")); |
| | | view.addObject("startTime", DateFormatUtils.format( |
| | | DateUtil.getNewByDay(null, -10), "yyyy-MM-dd")); |
| | | |
| | | // 获取出入库配置信息 |
| | | List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId); |
| | | |
| | | // 获取扦样机信息 |
| | | InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_20, InoutConstant.PROGRESS_CHECK, 1); |
| | | view.addObject("checkDto", conf); |
| | | view.setViewName("admin/inout/in-sample"); |
| | | return view; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页获取扦样数据 |
| | |
| | | return inoutManager.pageSampleData(param); |
| | | } |
| | | |
| | | /** |
| | | * 扦样页面提交更新 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/update-sample") |
| | | public PageResponse<InoutCheckData> updateSample(@RequestBody InoutCheckData data) { |
| | | |
| | | return inoutManager.updateSampleData(data); |
| | | } |
| | | |
| | | /** |
| | | * 分页获取化验数据 |