| | |
| | | package com.matrix.system.hive.service.imp; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.constance.Dictionary; |
| | |
| | | sysInstoreInfo.setCheckStatus(Dictionary.CHECK_STATUS_DSH); |
| | | // 设置入库单编号 |
| | | sysInstoreInfo.setInstoreId(DateUtil.getTimeMark()); |
| | | // SysShopInfo info = shopInfoDao.selectByShopName(Dictionary.SHOP_NAME_ZONGDIAN); |
| | | // // 系统限制入库只能入库到总店,总店不存在则 |
| | | // if (info == null) { |
| | | // throw new GlobleException("总店仓库不存在,请添加!"); |
| | | // } |
| | | |
| | | // 插入 |
| | | int i = sysInstoreInfoDao.insert(sysInstoreInfo); |
| | | // 设置总金额,并更新 |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int check(SysInstoreInfo sysInstoreInfo) { |
| | | LogUtil.info("入库单审核:{}", JSON.toJSONString(sysInstoreInfo)); |
| | | // 验证权限 |
| | | SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | sysInstoreInfo.setAppmanId(user.getSuId()); |
| | |
| | | sysInstoreInfo.setCompanyId(user.getCompanyId()); |
| | | |
| | | SysInstoreInfo checkInStore = sysInstoreInfoDao.selectById(sysInstoreInfo.getId()); |
| | | // if (!checkInStore.getAppmanId().equals(user.getSuId())) { |
| | | // throw new GlobleException("无权审核该单据!"); |
| | | // } |
| | | if (!checkInStore.getCheckStatus().equals(Dictionary.CHECK_STATUS_DSH)) { |
| | | throw new GlobleException("该单据状态为" + checkInStore.getCheckStatus() + ",不可审核!"); |
| | | } |