| | |
| | | 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; |
| | |
| | | InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_10, InoutConstant.PROGRESS_REGISTER, 1); |
| | | view.addObject("lprDto", conf); |
| | | |
| | | //初始化车牌识别 |
| | | inoutManager.initLpr(conf); |
| | | //登记初始化 |
| | | inoutManager.initInoutRegister(conf); |
| | | |
| | | 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 |
| | |
| | | List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger( |
| | | Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId()); |
| | | view.addObject("listFoodVariety", listFoodVariety); |
| | | |
| | | // 粮食性质下拉框 |
| | | List<DicTrigger> listFoodType = inoutCommonManager.getDicTrigger(Constant.TRIGGER_PARENT_FOOD_TYPE, user.getCompanyId()); |
| | | view.addObject("listFoodType", listFoodType); |
| | | |
| | | // 粮食等级下拉框 |
| | | List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger( |
| | |
| | | if (null != conf) conf.setSort(sort); |
| | | view.addObject("cardDto", conf); |
| | | |
| | | //称重页面初始化 |
| | | inoutManager.initInoutWeight(listInoutConf, sort); |
| | | |
| | | view.setViewName("admin/inout/in-weight"); |
| | | return view; |
| | |
| | | // 当前流程节点 |
| | | 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; |
| | |
| | | view.addObject("lprDto", conf); |
| | | |
| | | //初始化车牌识别 |
| | | inoutManager.initLpr(conf); |
| | | inoutManager.initInoutRegister(conf); |
| | | |
| | | view.setViewName("admin/inout/out-register"); |
| | | return view; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 扦样页面提交更新 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/submit-sample") |
| | | @Transactional |
| | | public PageResponse<InoutCheckData> submitSample(@RequestBody InoutCheckData data) throws Exception { |
| | | return inoutManager.submitSample(data); |
| | | } |
| | | |
| | | /** |
| | | * 出入库称重环节提交 |
| | | * |
| | | * @param data |
| | |
| | | @RequestMapping("/submit-handle") |
| | | @Transactional |
| | | public PageResponse<InoutData> submitHandle(@RequestBody InoutData data) throws Exception { |
| | | |
| | | log.debug("-------------submitHandle------------------"); |
| | | return inoutManager.submitHandle(data); |
| | | } |
| | | |
| | |
| | | @Transactional |
| | | public PageResponse<InoutData> submitComplete(@RequestBody InoutData data) throws Exception { |
| | | return inoutManager.submitComplete(data); |
| | | } |
| | | |
| | | /** |
| | | * 根据质检单号获取出入库信息 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/inout-check-scan-code") |
| | | public PageResponse<InoutCheckData> inoutDataByCheckId(@RequestBody InoutCheckParam param) { |
| | | if (null == param.getCompanyId()) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | return inoutManager.inoutDataByCheckId(param); |
| | | } |
| | | |
| | | /** |
| | | * 质检页面仅提交保存化验信息 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/submit-checkItem") |
| | | @Transactional |
| | | public PageResponse<InoutCheckData> submitCheckItem(@RequestBody InoutCheckData data) throws Exception { |
| | | return inoutManager.submitCheckData(data); |
| | | } |
| | | |
| | | /** |
| | | * 质检页面提交下一流程 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/submit-check") |
| | | @Transactional |
| | | public PageResponse<InoutCheckData> submitCheck(@RequestBody InoutCheckData data) throws Exception { |
| | | return inoutManager.submitCheck(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; |
| | | } |
| | | |
| | | /** |
| | | * 分页获取扦样数据 |
| | | * |
| | | * @param param |
| | |
| | | return inoutManager.pageSampleData(param); |
| | | } |
| | | |
| | | /** |
| | | * 扦样页面提交更新 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/update-sample") |
| | | public PageResponse<InoutCheckData> updateSample(@RequestBody InoutCheckData data) { |
| | | |
| | | return inoutManager.updateSampleData(data); |
| | | } |
| | | |
| | | /** |
| | | * 分页获取化验数据 |
| | |
| | | return inoutManager.getCheckItemData(param); |
| | | } |
| | | |
| | | /** |
| | | * 化验页面提交更新 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/update-check") |
| | | public PageResponse<InoutCheckData> updateCheck1(@RequestBody InoutCheckData data) { |
| | | |
| | | return inoutManager.updateCheckData(data); |
| | | } |
| | | |
| | | /** |
| | | * 根据粮食等级及粮食品种获取粮食定价 |