| | |
| | | |
| | | public PageResponse<InoutData> inNextStep(InoutData data) throws Exception { |
| | | String msg; |
| | | IUser user = ContextUtil.getLoginUser(); |
| | | if (StringUtils.isEmpty(data.getCompanyId())) { |
| | | data.setCompanyId(user.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(data.getDeptId())) { |
| | | data.setDeptId(ContextUtil.subDeptId(user)); |
| | | } |
| | | |
| | | String curProgress = data.getProgress(); |
| | | List<FileData> files = data.getFiles(); |
| | | |
| | | if (StringUtils.isEmpty(data.getIntelCard())) { |
| | | data.setIntelCard(data.getUserId()); |
| | | } |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | private String getNextProgress(String curProgress, String type, |
| | | InoutSysConf sysConf) { |
| | | private String getNextProgress(String curProgress, String type, InoutSysConf sysConf) { |
| | | String nextProgress = null; |
| | | List<String> list = null; |
| | | if (InoutConstant.TYPE_IN.equals(type)) { |
| | |
| | | * 删除操作 删除数据为软删除,删除数据后需要根据删除情况联动库存等信息 |
| | | * |
| | | * @param data |
| | | * @param selected |
| | | * 是否已经查询过数据 |
| | | * @param selected 是否已经查询过数据 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 操作道闸设备 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "", null); |
| | | } |
| | | |
| | | /** |
| | | * 出入库注册数据提交,入库登记和出入库登记使用同一个方法 |
| | | * |
| | | * @param data |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public PageResponse<InoutData> submitRegisterInout(InoutData data) throws Exception { |
| | | |
| | | //首先判断流程中是否有已经存在的车辆信息未执行完成,直接从数据库中查询 |
| | | InoutParam param = new InoutParam(); |
| | | param.setCompanyId(data.getCompanyId()); |
| | | param.setPlateNum(data.getPlateNum()); |
| | | param.setIntelCard(data.getIntelCard()); |
| | | param.setType(data.getType()); |
| | | param.setStart(DateUtil.getNewByDay(null, -10)); |
| | | |
| | | int num = inoutService.checkExist(param); |
| | | if (num > 0) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), |
| | | "当前车牌或智慧卡有正在执行流程未结束,请联系管理员", data); |
| | | } |
| | | |
| | | |
| | | //获取系统参数配置 |
| | | InoutSysConf inoutSysConf = inoutManagerService.getCacheInoutSysConf(data.getCompanyId(), data.getDeptId()); |
| | | if (null == inoutSysConf) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), |
| | | "提示:当前库区未配置出入库流程信息,请联系管理员", data); |
| | | } |
| | | |
| | | String curProgress = data.getProgress(); |
| | | |
| | | //获取下一个流程状态 |
| | | String nextProgress = getNextProgress(curProgress, data.getType(), inoutSysConf); |
| | | data.setRegisterTime(new Date()); |
| | | data.setRegisterUser(ContextUtil.getLoginUserCName()); |
| | | data.setProgress(nextProgress); |
| | | |
| | | String msg = inoutService.insertData(data); |
| | | |
| | | if (null != msg) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(), |
| | | msg, data); |
| | | } |
| | | |
| | | // 执行附件信息 |
| | | fileService.saveInoutFiles(data.getFiles(), data.getCompanyId(), data.getId(), curProgress); |
| | | |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000.getCode(), "执行成功", data); |
| | | } |
| | | |
| | | } |