| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.mapper.CustomerMapper; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | return salesLedgerMapper.selectSalesLedgerList(salesLedgerDto); |
| | | } |
| | | |
| | | @Override |
| | | public SalesLedgerDto getSalesLedgerWithProducts(SalesLedgerDto salesLedgerDto) { |
| | | // 1. 查询主表 |
| | | SalesLedger salesLedger = salesLedgerMapper.selectById(salesLedgerDto.getId()); |
| | |
| | | // 提供临时未开票数,未开票金额供前段计算 |
| | | product.setTempnoInvoiceAmount(product.getNoInvoiceAmount()); |
| | | product.setTempNoInvoiceNum(product.getNoInvoiceNum()); |
| | | product.setRegister(SecurityUtils.getLoginUser().getUser().getNickName()); |
| | | product.setRegisterDate(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | } |
| | | |
| | | // 3.查询上传文件 |
| | |
| | | fileRecord.setName(originalFilename); |
| | | fileRecord.setUrl(formalFilePath.toString()); |
| | | fileRecord.setCreateTime(LocalDateTime.now()); |
| | | fileRecord.setType("1"); |
| | | //销售 |
| | | fileRecord.setType(FileNameType.SALE.getValue()); |
| | | commonFileMapper.insert(fileRecord); |
| | | |
| | | // 删除临时文件记录 |
| | |
| | | |
| | | // 2. 查询当天/公司已存在的序列号(与原逻辑一致) |
| | | Long tenantId = SecurityUtils.getLoginUser().getTenantId(); |
| | | if(null != tenantId){ |
| | | if (null != tenantId) { |
| | | //获取公司编号 |
| | | SysDept sysDept = sysDeptMapper.selectDeptById(tenantId.longValue()); |
| | | if(!ObjectUtils.isEmpty(sysDept)){ |
| | | if (!ObjectUtils.isEmpty(sysDept)) { |
| | | datePart = (StringUtils.isEmpty(sysDept.getDeptNick()) ? "" : sysDept.getDeptNick()) + datePart; |
| | | } |
| | | } |