| | |
| | | import com.ld.igds.data.Page; |
| | | import com.ld.igds.data.PageResponse; |
| | | import com.ld.igds.inout.InoutConstant; |
| | | import com.ld.igds.inout.dto.InoutData; |
| | | import com.ld.igds.inout.dto.InoutGateDto; |
| | | import com.ld.igds.inout.dto.InoutParam; |
| | | import com.ld.igds.inout.dto.*; |
| | | import com.ld.igds.inout.manager.InoutCommonManager; |
| | | import com.ld.igds.inout.manager.InoutManager; |
| | | import com.ld.igds.io.dto.WeightDto; |
| | |
| | | "后台异常:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 扦样页面 |
| | | * |
| | | * @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); |
| | | |
| | | //入库流程 |
| | | 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 |
| | | */ |
| | | @RequestMapping("/page-sample-data") |
| | | public PageResponse<Page<InoutCheckData>> pageSampleData(@RequestBody InoutCheckParam param) { |
| | | return inoutManager.pageSampleData(param); |
| | | } |
| | | |
| | | /** |
| | | * 扦样页面提交 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/update-sample") |
| | | public PageResponse<InoutCheckData> updateSample(@RequestBody InoutCheckData data) { |
| | | try { |
| | | return inoutManager.updateSampleData(data); |
| | | } catch (Exception e) { |
| | | log.error("后台异常:{}", e); |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), |
| | | "后台异常:" + e.getMessage(), null); |
| | | } |
| | | } |
| | | } |