| | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import cn.iocoder.yudao.framework.common.exception.ServiceException; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | |
| | | updateObj.setSourceDocType(null).setSourceDocId(null).setSourceLineId(null); // 不允许修改来源单据 |
| | | updateObj.setTemplateId(null); // 不允许修改模板 |
| | | updateObj.setItemId(null); // 不允许修改物料 |
| | | oqcMapper.updateById(updateObj); |
| | | // 编辑时允许清空客户;完成检验等局部更新仍保留原客户。 |
| | | updateObj.setClientId(null); |
| | | oqcMapper.update(updateObj, new LambdaUpdateWrapper<MesQcOqcDO>() |
| | | .eq(MesQcOqcDO::getId, updateReqVO.getId()) |
| | | .set(MesQcOqcDO::getClientId, updateReqVO.getClientId())); |
| | | } |
| | | |
| | | private void validateOqcSaveData(MesQcOqcSaveReqVO reqVO) { |
| | |
| | | |
| | | @Override |
| | | public PageResult<MesQcOqcDO> getOqcPage(MesQcOqcPageReqVO pageReqVO) { |
| | | // 获取用户有权限的客户 ID 列表 |
| | | List<Long> permittedClientIds = customerApi.getPermittedCustomerIds(); |
| | | return oqcMapper.selectPage(pageReqVO, permittedClientIds); |
| | | return oqcMapper.selectPage(pageReqVO, (List<Long>) null); |
| | | } |
| | | |
| | | @Override |
| | |
| | | oqc.setCheckQuantity(BigDecimal.ZERO); // 待填写 |
| | | oqc.setQualifiedQuantity(BigDecimal.ZERO); // 待填写 |
| | | oqc.setUnqualifiedQuantity(BigDecimal.ZERO); // 待填写 |
| | | oqc.setOutDate(java.time.LocalDateTime.now()); |
| | | MesWmProductSalesDO sales = productSalesService.getProductSales(salesId); |
| | | java.time.LocalDateTime businessDate = sales != null && sales.getSalesDate() != null |
| | | ? sales.getSalesDate() : java.time.LocalDateTime.now(); |
| | | oqc.setOutDate(businessDate); |
| | | oqc.setInspectDate(businessDate); |
| | | oqc.setStatus(MesQcStatusEnum.DRAFT.getStatus()); |
| | | oqcMapper.insert(oqc); |
| | | |
| | |
| | | reqVO.setName(row.getName().trim()); |
| | | reqVO.setItemId(qcImportHelper.resolveItemId(row.getItemCode())); |
| | | Long clientId = qcImportHelper.resolveClientId(row.getClientName()); |
| | | qcImportHelper.validateClientPermission(clientId, row.getClientName().trim()); |
| | | qcImportHelper.validateClientPermission(clientId, StrUtil.trimToEmpty(row.getClientName())); |
| | | reqVO.setClientId(clientId); |
| | | reqVO.setBatchCode(StrUtil.trimToNull(row.getBatchCode())); |
| | | reqVO.setTemplateId(qcImportHelper.resolveTemplateId(row.getTemplateName())); |