| | |
| | | package com.fzzy.sys.controller.inout; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.data.InoutParam; |
| | | import com.fzzy.igds.data.PageResponse; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.InoutConf; |
| | | import com.fzzy.igds.domain.InoutRecord; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.igds.utils.DateUtil; |
| | | import com.fzzy.sys.manager.common.CommonManager; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | |
| | | return prefix + "/inout-weight"; |
| | | } |
| | | |
| | | /** |
| | | * 出库登记 |
| | | * |
| | | * @param sort 表示使用的出入库设备配套号,不传递默认为1 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/out-register") |
| | | public String outRegister(HttpServletRequest httpRequest, |
| | | @RequestParam(value = "sort", required = false) String sort, |
| | | ModelMap view) { |
| | | |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | view.put(Constant.MODEL_KEY_LOGIN_USER, user); |
| | | |
| | | if (StringUtils.isEmpty(sort)) { |
| | | sort = inoutManager.getInoutWeightByClient(httpRequest); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(sort)) { |
| | | sort = "1"; |
| | | } |
| | | |
| | | String deptId = ContextUtil.subDeptId(user); |
| | | view.put("type", Constant.TYPE_OUT); |
| | | view.put("deptId", deptId); |
| | | |
| | | // 类型 |
| | | List<SysDictData> listInoutType = commonManager.getInoutType(); |
| | | view.put("listInoutType", listInoutType); |
| | | |
| | | //入库流程 |
| | | String inoutProgress = inoutManager.getInoutProgressConf(user.getCompanyId(), ContextUtil.subDeptId(user), Constant.TYPE_OUT); |
| | | view.put("inoutProgress", inoutProgress); |
| | | // 当前流程节点 |
| | | view.put("progress", Constant.PROGRESS_REGISTER); |
| | | |
| | | // 获取出入库配置信息 |
| | | List<InoutConf> listInoutConf = inoutManager.getListInoutConf(user.getCompanyId(), deptId); |
| | | |
| | | // 车牌识别参数封装 |
| | | InoutConf conf = inoutManager.getInoutConf(listInoutConf, sort, Constant.CONF_TYPE_10, Constant.PROGRESS_REGISTER, 1); |
| | | view.put("lprDto", conf); |
| | | |
| | | return prefix + "/out-register"; |
| | | } |
| | | |
| | | /** |
| | | * 出库简易操作页面 |
| | | * |
| | | * @param sort 表示使用的出入库设备配套号,不传递默认为1 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/out-easy") |
| | | public String outEasy(@RequestParam(value = "sort", required = false) String sort, |
| | | @RequestParam(value = "type", required = false) String type, |
| | | ModelMap view) { |
| | | |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | view.put(Constant.MODEL_KEY_LOGIN_USER, user); |
| | | |
| | | view.put("type", Constant.TYPE_OUT); |
| | | String deptId = ContextUtil.subDeptId(user); |
| | | view.put("deptId", deptId); |
| | | |
| | | // 仓库列表做下拉框使用 |
| | | List<Depot> listDepot = commonManager.listDepotByDeptId(deptId); |
| | | view.put(Constant.MODEL_KEY_DEPOT_LIST, listDepot); |
| | | |
| | | //入库流程 |
| | | String inoutProgress = inoutManager.getInoutProgressConf(user.getCompanyId(), |
| | | ContextUtil.subDeptId(user), Constant.TYPE_IN); |
| | | view.put("inoutProgress", inoutProgress); |
| | | |
| | | |
| | | // 粮食品种下拉框 |
| | | List<SysDictData> listFoodVariety = commonManager.getDicTrigger(Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId()); |
| | | view.put("listFoodVariety", listFoodVariety); |
| | | |
| | | // 粮食性质下拉框 |
| | | List<SysDictData> listFoodType = commonManager.getDicTrigger(Constant.TRIGGER_PARENT_FOOD_TYPE, user.getCompanyId()); |
| | | view.put("listFoodType", listFoodType); |
| | | |
| | | // 粮食等级下拉框 |
| | | List<SysDictData> listFoodLevel = commonManager.getDicTrigger(Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId()); |
| | | view.put("listFoodLevel", listFoodLevel); |
| | | |
| | | // 类型 |
| | | List<SysDictData> listInoutType = commonManager.getInoutType(); |
| | | view.put("listInoutType", listInoutType); |
| | | |
| | | // 当前流程标签 |
| | | view.put("progress", Constant.PROGRESS_WEIGHT_TAG); |
| | | |
| | | // 获取出入库配置信息 |
| | | List<InoutConf> listInoutConf = inoutManager.getListInoutConf(user.getCompanyId(), deptId); |
| | | |
| | | // 获取地磅信息 |
| | | InoutConf weightDto = inoutManager.getInoutConf(listInoutConf, sort, Constant.CONF_TYPE_30); |
| | | view.put("weightDto", weightDto); |
| | | |
| | | // 过程摄像头1 |
| | | InoutConf conf = inoutManager.getInoutConf(listInoutConf, sort, Constant.CONF_TYPE_60, Constant.PROGRESS_WEIGHT_TAG, 1); |
| | | view.put("snapDto1", conf); |
| | | |
| | | // 过程摄像头2 |
| | | conf = inoutManager.getInoutConf(listInoutConf, sort, Constant.CONF_TYPE_60, Constant.PROGRESS_WEIGHT_TAG, 2); |
| | | view.put("snapDto2", conf); |
| | | |
| | | // 过程摄像头3 |
| | | conf = inoutManager.getInoutConf(listInoutConf, sort, Constant.CONF_TYPE_60, Constant.PROGRESS_WEIGHT_TAG, 3); |
| | | view.put("snapDto3", conf); |
| | | |
| | | //默认查询时间 |
| | | view.put("endTime", DateFormatUtils.format(new Date(), "yyyy-MM-dd")); |
| | | view.put("startTime", DateFormatUtils.format(DateUtil.getNewByDay(null, -30), "yyyy-MM-dd")); |
| | | |
| | | return prefix + "/out-easy"; |
| | | } |
| | | |
| | | /** |
| | | * 分页获取流程未完成的数据 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/page-inout-data") |
| | | @ResponseBody |
| | | public PageResponse<Page<InoutRecord>> pageInoutData(@RequestBody InoutParam param) { |
| | | return inoutManager.pageInoutData(param); |
| | | } |
| | | |
| | | /** |
| | | * 出入库数据查询,根据条件查询数据,出入库数据信息 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/inout-query") |
| | | @ResponseBody |
| | | public PageResponse<InoutRecord> inoutQuery(@RequestBody InoutParam param) { |
| | | if (null == param.getCompanyId()) param.setCompanyId(ContextUtil.getCompanyId()); |
| | | return inoutManager.inoutQuery(param); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 出入库登记提交 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/submit-register") |
| | | @ResponseBody |
| | | public PageResponse<InoutRecord> submitRegister(@RequestBody InoutRecord data) { |
| | | |
| | | return inoutManager.submitRegister(data); |
| | | } |
| | | |
| | | /** |
| | | * 出入库化验信息提交 |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/submit-check") |
| | | @ResponseBody |
| | | public PageResponse<InoutRecord> submitCheck(@RequestBody InoutRecord data) { |
| | | |
| | | return inoutManager.submitCheck(data); |
| | | } |
| | | |
| | | /** |
| | | * 出入库称重环节提交 |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/submit-weight") |
| | | @ResponseBody |
| | | public PageResponse<InoutRecord> submitWeight(@RequestBody InoutRecord data) { |
| | | |
| | | return inoutManager.submitWeight(data); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 出入库称重环节提交,请注意:值仓挑提交的数据非出入库流水完整信息,不能直接调用update方法 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | @RequestMapping("/submit-handle") |
| | | @Transactional |
| | | @ResponseBody |
| | | public PageResponse<InoutRecord> submitHandle(@RequestBody InoutRecord data) { |
| | | |
| | | log.debug("-------------submitHandle------------------"); |
| | | return inoutManager.submitHandle(data); |
| | | } |
| | | |
| | | } |