| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.InoutConstant; |
| | | import com.fzzy.igds.data.*; |
| | |
| | | queryWrapper.like("complete_status", param.getCompleteStatus()); |
| | | } |
| | | |
| | | queryWrapper.orderByDesc("id"); |
| | | noticeInMapper.selectPage(page, queryWrapper); |
| | | } |
| | | |
| | |
| | | } |
| | | if (StringUtils.isNotBlank(param.getDeptId())) { |
| | | queryWrapper.eq("dept_id", param.getDeptId()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getAuditStatus())) { |
| | | queryWrapper.eq("audit_status", param.getAuditStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getCompleteStatus())) { |
| | | queryWrapper.eq("complete_status", param.getCompleteStatus()); |
| | |
| | | //获取质押合同数据 |
| | | PledgeContract pledge = this.getPledgeByDepotId(data); |
| | | if (null != pledge && pledge.getStatus().equals(Constant.YN_N)) { |
| | | return BaseResp.error("当前仓库有未解压的质押合同,质押合同=" + pledge.getName()); |
| | | return BaseResp.error("当前仓库有未解押的质押合同,质押合同=" + pledge.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 判断当前仓库是否在质押合同中未解压 |
| | | * 判断当前仓库是否在质押合同中未解押 |
| | | * @param data 当前数据 |
| | | * @return true-在质押合同中未解压,false-在质押合同中已解压 |
| | | * @return true-在质押合同中未解押,false-在质押合同中已解押 |
| | | */ |
| | | private PledgeContract getPledgeByDepotId(InoutNoticeIn data) { |
| | | IgdsBaseParam param = new IgdsBaseParam(); |
| | |
| | | param.setDepotId(data.getDepotId()); |
| | | param.setBankId(data.getBankId()); |
| | | return pledgeContractService.getByDepotId(param); |
| | | } |
| | | |
| | | /** |
| | | * 更新审核状态 |
| | | * @param id |
| | | * @param status |
| | | */ |
| | | public void updateNoticeInStatus(String id, String status) { |
| | | UpdateWrapper<InoutNoticeIn> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("id", id).set("audit_status", status); |
| | | |
| | | noticeInMapper.update(null, updateWrapper); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (StringUtils.isNotBlank(param.getCompleteStatus())) { |
| | | queryWrapper.like("complete_status", param.getCompleteStatus()); |
| | | } |
| | | |
| | | queryWrapper.orderByDesc("id"); |
| | | noticeOutMapper.selectPage(page, queryWrapper); |
| | | } |
| | | |
| | |
| | | } |
| | | if (StringUtils.isNotBlank(param.getDeptId())) { |
| | | queryWrapper.eq("dept_id", param.getDeptId()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getAuditStatus())) { |
| | | queryWrapper.eq("audit_status", param.getAuditStatus()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getCompleteStatus())) { |
| | | queryWrapper.eq("complete_status", param.getCompleteStatus()); |
| | |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public BaseResp saveOrUpdateOut(InoutNoticeOut data) { |
| | | //如果出库通知单类型为库区通知单,验证仓库是否是未解压得仓库,是则不允许保存 |
| | | //如果出库通知单类型为库区通知单,验证仓库是否是未解押得仓库,是则不允许保存 |
| | | if (InoutConstant.NOTICE_IN_TYPE_10.equals(data.getType())) { |
| | | //在质押合同找到未解压,且质押仓库包含当前仓库的数据 |
| | | //在质押合同找到未解押,且质押仓库包含当前仓库的数据 |
| | | //获取质押合同数据 |
| | | PledgeContract pledge = this.getPledgeByDepotIdOut(data); |
| | | if (null != pledge && pledge.getStatus().equals(Constant.YN_N)) { |
| | | return BaseResp.error("当前仓库有未解压的质押合同,质押合同=" + pledge.getName()); |
| | | return BaseResp.error("当前仓库有未解押的质押合同,质押合同=" + pledge.getName()); |
| | | } |
| | | } |
| | | //如果出库通知单类型为监管通知单 |
| | |
| | | noticeOutMapper.updateById(data); |
| | | return BaseResp.success(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 更新审核状态 |
| | | * @param id |
| | | * @param status |
| | | */ |
| | | public void updateNoticeOutStatus(String id, String status) { |
| | | UpdateWrapper<InoutNoticeOut> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("id", id).set("audit_status", status); |
| | | |
| | | noticeOutMapper.update(null, updateWrapper); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 判断当前仓库是否在质押合同中未解压 |
| | | * 判断当前仓库是否在质押合同中未解押 |
| | | * @param data 当前数据 |
| | | * @return true-在质押合同中未解压,false-在质押合同中已解压 |
| | | * @return true-在质押合同中未解押,false-在质押合同中已解押 |
| | | */ |
| | | private PledgeContract getPledgeByDepotIdOut(InoutNoticeOut data) { |
| | | IgdsBaseParam param = new IgdsBaseParam(); |