| | |
| | | import com.ruoyi.common.utils.api.IfsApiUtils; |
| | | import com.ruoyi.framework.exception.ErrorException; |
| | | import com.ruoyi.inspect.dto.*; |
| | | import com.ruoyi.inspect.event.InsOrderDeletingEvent; |
| | | import com.ruoyi.inspect.mapper.*; |
| | | import com.ruoyi.inspect.pojo.*; |
| | | import com.ruoyi.inspect.service.InsOrderService; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | | import org.springframework.transaction.annotation.Isolation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | private InsUnqualifiedRetestProductMapper insUnqualifiedRetestProductMapper; |
| | | private IfsApiUtils ifsApiUtils; |
| | | private SpotCheckQuarterItemMapper spotCheckQuarterItemMapper; |
| | | private ApplicationEventPublisher applicationEventPublisher; |
| | | private StandardProductListMapper standardProductListMapper; |
| | | private StructureItemParameterMapper structureItemParameterMapper; |
| | | |
| | |
| | | return insOrder.getId(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean deleteReturnedOrder(Integer insOrderId) { |
| | | InsOrder order = insOrderMapper.selectById(insOrderId); |
| | | if (order == null) { |
| | | throw new ErrorException("成品订单不存在"); |
| | | } |
| | | if (!(Integer.valueOf(2).equals(order.getState()) || Integer.valueOf(3).equals(order.getState()))) { |
| | | throw new ErrorException("只有退回或撤销订单才能删除"); |
| | | } |
| | | Integer operatorId = SecurityUtils.getUserId().intValue(); |
| | | applicationEventPublisher.publishEvent(new InsOrderDeletingEvent(insOrderId, operatorId, LocalDateTime.now())); |
| | | return removeById(insOrderId); |
| | | } |
| | | |
| | | /** |
| | | * 添加检验项 |
| | | * |
| | |
| | | @Override |
| | | public Map<String, Object> getInsOrder(Integer id) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | InsOrder insOrder = insOrderMapper.selectById(id); |
| | | IfsOrderVO ifsOrderVO = insOrderMapper.selectOrderInfoById(id); |
| | | List<SampleProductDto> list; |
| | | // 判断是否是进厂报告免检 |
| | | if (insOrder.getIsExemption().equals(1)) { |
| | | if (ifsOrderVO.getIsExemption().equals(1)) { |
| | | list = insSampleMapper.selectExemptionByOrderId(id); |
| | | } else { |
| | | list = insSampleMapper.selectSampleProductListByOrderId2(id); |
| | | } |
| | | Map<String, Object> map1 = insSampleMapper.selectInsOrder(id); |
| | | map.put("insOrder", insOrder); |
| | | map.put("insOrder", ifsOrderVO); |
| | | map.put("sampleProduct", list); |
| | | map.put("insOrderTemplate", map1); |
| | | return map; |
| | |
| | | if (map1.get("APPROVED_DATE") != null) { |
| | | ifsInventoryQuantity.setApprovedDate(LocalDateTime.parse(map1.get("APPROVED_DATE").toString(), dateTimeFormatter)); // 审批日期 |
| | | } |
| | | ifsInventoryQuantity.setReqCeater(map1.get("REQ_CEATER") == null ? "" : map1.get("REQ_CEATER").toString()); // 采购申请创建人 |
| | | ifsInventoryQuantity.setReqCeaterName(map1.get("REQ_CEATER_NAME") == null ? "" : map1.get("REQ_CEATER_NAME").toString()); // 采购申请创建人名称 |
| | | ifsInventoryQuantity.setReqCeater(map1.get("REQ_CREATER") == null ? "" : map1.get("REQ_CREATER").toString()); // 采购申请创建人 |
| | | ifsInventoryQuantity.setReqCeaterName(map1.get("REQ_CREATER_NAME") == null ? "" : map1.get("REQ_CREATER_NAME").toString()); // 采购申请创建人名称 |
| | | ifsInventoryQuantity.setLineRemarks(map1.get("LINE_REMARKS") == null ? "" : map1.get("LINE_REMARKS").toString()); // 采购订单行备注 |
| | | ifsInventoryQuantity.setBuyUnitMeas(map1.get("BUY_UNIT_MEAS") == null ? "" : map1.get("BUY_UNIT_MEAS").toString()); // 采购单位 |
| | | ifsInventoryQuantity.setReceiverDate(LocalDateTime.now()); // 接收日期 |
| | |
| | | return toLocation; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getInsOrderList(List<Integer> selectOrderIds) { |
| | | return insOrderMapper.selectOrderInfoByIds(selectOrderIds); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 先修改采购订单批次号, 后进行移库操作 |