| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.purchase.dto.ProductRecordDto; |
| | | import com.ruoyi.purchase.dto.TicketRegistrationDto; |
| | | import com.ruoyi.purchase.mapper.ProductRecordMapper; |
| | | import com.ruoyi.purchase.mapper.PurchaseLedgerMapper; |
| | | import com.ruoyi.purchase.mapper.TicketRegistrationMapper; |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | import com.ruoyi.purchase.pojo.PurchaseLedger; |
| | | import com.ruoyi.purchase.pojo.TicketRegistration; |
| | | import com.ruoyi.purchase.service.IProductRecordService; |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | * @date 2025-05-23 |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | @RequiredArgsConstructor |
| | | public class ProductRecordServiceImpl extends ServiceImpl<ProductRecordMapper, ProductRecord> implements IProductRecordService { |
| | | |
| | | @Autowired |
| | | private ProductRecordMapper productRecordMapper; |
| | | |
| | | @Autowired |
| | | private CommonFileMapper commonFileMapper; |
| | | @Autowired |
| | | private SalesLedgerProductMapper salesLedgerProductMapper; |
| | | @Autowired |
| | | private PurchaseLedgerMapper purchaseLedgerMapper; |
| | | |
| | | |
| | | private final SalesLedgerProductMapper salesLedgerProductMapper; |
| | | private final ProductRecordMapper productRecordMapper; |
| | | private final CommonFileMapper commonFileMapper; |
| | | /** |
| | | * 查询采购台账产品开票记录 |
| | | * |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateRecord(ProductRecordDto productRecordDto) { |
| | | public R<?> updateRecord(ProductRecordDto productRecordDto) { |
| | | ProductRecord productRecord = productRecordMapper.selectById(productRecordDto.getId()); |
| | | if (productRecord == null) return AjaxResult.error("记录不存在"); |
| | | if (productRecord == null) return R.fail("记录不存在"); |
| | | |
| | | // 更新产品台账 |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(productRecord.getSaleLedgerProjectId()); |
| | |
| | | productRecord.setFutureTicketsAmount(productRecord.getFutureTickets().multiply(productRecord.getTaxInclusiveUnitPrice())); |
| | | productRecordMapper.updateById(productRecord); |
| | | |
| | | return AjaxResult.success("修改成功"); |
| | | return R.ok(null, "修改成功"); |
| | | } |
| | | |
| | | @Override |