| | |
| | | import com.ruoyi.common.constant.InsOrderTypeConstants; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.enums.OrderType; |
| | | import com.ruoyi.common.numgen.NumberGenerator; |
| | | import com.ruoyi.common.utils.LimsDateUtil; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | |
| | | import com.ruoyi.inspect.service.InsOrderStateService; |
| | | import com.ruoyi.inspect.service.InsProductService; |
| | | import com.ruoyi.inspect.service.InsSampleService; |
| | | import com.ruoyi.inspect.vo.IfsOrderVO; |
| | | import com.ruoyi.inspect.vo.InsOrderPrintingVo; |
| | | import com.ruoyi.system.mapper.UserMapper; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | } |
| | | } |
| | | }); |
| | | //是否为原材料下单 |
| | | if (insOrder.getTypeSource() != null && insOrder.getTypeSource().equals(1)) { |
| | | // 原材料下单: 委托人就是报检人, 生产单位就是供应商单位 |
| | | //原材料下单或外购成品下单 |
| | | if (Objects.nonNull(insOrder.getTypeSource())&&Objects.nonNull(insOrder.getIfsInventoryId())) { |
| | | // 委托人就是报检人, 生产单位就是供应商单位 |
| | | IfsInventoryQuantity ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(insOrder.getIfsInventoryId()); |
| | | Integer declareUserId = ifsInventoryQuantity.getDeclareUserId(); |
| | | User user = userMapper.selectById(declareUserId); |
| | |
| | | upInsOrderOfState(insOrder); |
| | | |
| | | // 分配检验人 |
| | | upInsOrder(insOrder.getId(), null, appointed != null ? appointed.toString() : null, SecurityUtils.getUserId().intValue(), "原材料"); |
| | | String sonLaboratory = insOrder.getTypeSource().equals(1)?"原材料":"成品实验室"; |
| | | upInsOrder(insOrder.getId(), null, appointed != null ? appointed.toString() : null, SecurityUtils.getUserId().intValue(), sonLaboratory); |
| | | |
| | | //是否为原材料下单 |
| | | if(insOrder.getTypeSource().equals(1)){ |
| | | // 根据零件号判断是否是辅材 |
| | | boolean isRaw = false; |
| | | StructureTestObject productObject = insOrderMapper.selectProductByPartNo(ifsInventoryQuantity.getPartNo()); |
| | |
| | | ifsInventoryQuantityMapper.update(null, Wrappers.<IfsInventoryQuantity>lambdaUpdate() |
| | | .eq(IfsInventoryQuantity::getId, insOrder.getIfsInventoryId()) |
| | | .set(IfsInventoryQuantity::getIsFirst, 1)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public Map<String, Object> getInsOrderAndSample(Integer id, String laboratory) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | InsOrder insOrder = insOrderMapper.selectById(id); |
| | | // InsOrder insOrder = insOrderMapper.selectById(id); |
| | | IfsOrderVO ifsOrderVO = insOrderMapper.selectOrderInfoById(id); |
| | | List<SampleProductDto> list = insSampleMapper.getInsOrderAndSample(id, laboratory); |
| | | map.put("insOrder", insOrder); |
| | | map.put("insOrder", ifsOrderVO); |
| | | map.put("sampleProduct", list); |
| | | //查询所有记录模版去重 |
| | | List<Map<Integer, Object>> list2 = insOrderMapper.selectReportModelByOrderId(id, laboratory); |
| | |
| | | * TODO 后续需要调用IFS的接口 移入的库位号 toLocation |
| | | */ |
| | | // 检验后移库 |
| | | if(one.getIsSplitOrder().equals(1)){ |
| | | //如果订单为原材料的拆分订单,则移到外购库位 |
| | | toLocation = "W03"; |
| | | //1301:原材料合格库,CP-02-001:成品库 |
| | | if(StringUtils.equals(inventoryQuantity.getOrderType(), OrderType.RAW.getValue())){ |
| | | //如果订单为原材料的拆分订单,则移到外购原材料库位W03 |
| | | toLocation = one.getIsSplitOrder().equals(1)?"W03":"1301"; |
| | | }else if(StringUtils.equals(inventoryQuantity.getOrderType(), OrderType.WG.getValue())){ |
| | | toLocation = "CP-02-001"; |
| | | }else{ |
| | | toLocation = "1301"; |
| | | } |