Merge remote-tracking branch 'origin/jtwy' into jtwy
| | |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @GetMapping("/listPageByProductProduction") |
| | | @Log(title = "生产入库-入库管理-生产入库查询", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "入库查询") |
| | | public AjaxResult listPageByProductProduction(Page page, ProcurementPageDto procurementDto) { |
| | | IPage<ProcurementPageDto> result = procurementRecordService.listPageByProductProduction(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @GetMapping("/listPageByCustom") |
| | | @Log(title = "自定义入库-入库管理-入库查询", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "入库查询") |
| | |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @GetMapping("/listPageBySemiProduct") |
| | | @Log(title = "生产出库-出库台账-出库查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageBySemiProduct(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | IPage<ProcurementRecordOutPageDto> result = procurementRecordOutService.listPageBySemiProduct(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @GetMapping("/listPageByCustom") |
| | | @Log(title = "自定义出库-出库台账-出库查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageByCustom(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | |
| | | IPage<ProcurementPageDtoCopy> listPagePRS(Page page, @Param("req") ProcurementPageDto procurementDto); |
| | | |
| | | BigDecimal getSumQuantity(@Param("productModelId") Long productModelId); |
| | | |
| | | IPage<ProcurementPageDto> listPageByProductProduction(Page page, @Param("req") ProcurementPageDto procurementDto); |
| | | } |
| | |
| | | IPage<ProcurementRecordOutPageDto> listPageByCustom(Page page,@Param("req") ProcurementRecordOutPageDto procurementDto); |
| | | |
| | | BigDecimal getSumQuantity(@Param("productModelId") Long productModelId); |
| | | |
| | | ProcurementRecordOut selectCode(@Param("format") String format); |
| | | |
| | | IPage<ProcurementRecordOutPageDto> listPageBySemiProduct(Page page,@Param("req") ProcurementRecordOutPageDto procurementDto); |
| | | } |
| | |
| | | IPage<ProcurementRecordOutPageDto> listPageByProduct(Page page, ProcurementRecordOutPageDto procurementDto); |
| | | |
| | | IPage<ProcurementRecordOutPageDto> listPageByCustom(Page page, ProcurementRecordOutPageDto procurementDto); |
| | | |
| | | IPage<ProcurementRecordOutPageDto> listPageBySemiProduct(Page page, ProcurementRecordOutPageDto procurementDto); |
| | | } |
| | |
| | | InventoryInformationDto getReportList(); |
| | | |
| | | IPage<ProductModel> listPageProductionStock(Page page); |
| | | |
| | | IPage<ProcurementPageDto> listPageByProductProduction(Page page, ProcurementPageDto procurementDto); |
| | | } |
| | |
| | | Long aLong = procurementRecordOutMapper.selectCount(procurementRecordLambdaQueryWrapper); |
| | | ProcurementRecordOut.ProcurementRecordOutBuilder procurementRecordOut = ProcurementRecordOut.builder() |
| | | .procurementRecordStorageId(procurementRecordOutAdd.getId()) |
| | | .code("LS" + dateFormat.format(now) + String.format("%03d", aLong1 + 1)) |
| | | .code("SC" + dateFormat.format(now) + String.format("%03d", aLong1 + 1)) |
| | | .salesLedgerProductId(procurementRecordOutAdd.getSalesLedgerProductId()) |
| | | .inboundBatches(aLong.equals(0L) ? "第1批次" : "第"+ (aLong + 1) + "批次") |
| | | .inboundNum(new BigDecimal(procurementRecordOutAdd.getQuantity())) |
| | |
| | | public IPage<ProcurementRecordOutPageDto> listPageByCustom(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | return procurementRecordOutMapper.listPageByCustom(page, procurementDto); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<ProcurementRecordOutPageDto> listPageBySemiProduct(Page page, ProcurementRecordOutPageDto procurementDto) { |
| | | return procurementRecordOutMapper.listPageBySemiProduct(page, procurementDto); |
| | | } |
| | | } |
| | |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<ProcurementPageDto> listPageByProductProduction(Page page, ProcurementPageDto procurementDto) { |
| | | IPage<ProcurementPageDto> procurementPageDtoIPage = procurementRecordMapper.listPageByProductProduction(page, procurementDto); |
| | | return procurementPageDtoIPage; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordOut; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | | import com.ruoyi.production.controller.ProductWorkOrderController; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | |
| | | import com.ruoyi.quality.pojo.QualityInspect; |
| | | import com.ruoyi.quality.pojo.QualityInspectParam; |
| | | import com.ruoyi.quality.pojo.QualityTestStandard; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | @AllArgsConstructor |
| | | public class ProductionProductMainServiceImpl extends ServiceImpl<ProductionProductMainMapper, ProductionProductMain> implements ProductionProductMainService { |
| | | |
| | | private final ProcurementRecordOutMapper procurementRecordOutMapper; |
| | | private ProductionProductMainMapper productionProductMainMapper; |
| | | |
| | | private ProductWorkOrderController productWorkOrderController; |
| | |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | |
| | | |
| | | |
| | | // 新增逻辑 |
| | | ProductionProductMain productionProductMain = new ProductionProductMain(); |
| | | ProductProcessRouteItem productProcessRouteItem = productProcessRouteItemMapper.selectById(dto.getProductProcessRouteItemId()); |
| | |
| | | productionProductMain.setProductProcessRouteItemId(dto.getProductProcessRouteItemId()); |
| | | productionProductMain.setWorkOrderId(dto.getWorkOrderId()); |
| | | productionProductMain.setStatus(0); |
| | | |
| | | // 添加报工主表 |
| | | int insert = productionProductMainMapper.insert(productionProductMain); |
| | | |
| | |
| | | List<ProductStructureDto> productStructureDtos = productStructureMapper.listByproductModelId(productModel.getId()); |
| | | for (ProductStructureDto productStructureDto : productStructureDtos) { |
| | | ProductModel productModel1 = productModelMapper.selectById(productStructureDto.getProductModelId()); |
| | | |
| | | Product product = productMapper.selectById(productModel1.getProductId()); |
| | | BigDecimal stockQuantity = stockUtils.getStockQuantity(productModel1.getId()).get("stockQuantity"); |
| | | if (!(stockQuantity.compareTo(BigDecimal.ZERO) > 0)) { |
| | | throw new RuntimeException("库存不足"); |
| | | throw new RuntimeException(product.getProductName() + "库存为0"); |
| | | } |
| | | if (stockQuantity.compareTo(productStructureDto.getUnitQuantity().multiply(dto.getQuantity())) < 0) { |
| | | throw new RuntimeException(product.getProductName() + "库存不足"); |
| | | } |
| | | ProductionProductInput productionProductInput = new ProductionProductInput(); |
| | | productionProductInput.setProductModelId(productStructureDto.getProductModelId()); |
| | | productionProductInput.setQuantity(productStructureDto.getUnitQuantity().multiply(dto.getQuantity())); |
| | | productionProductInput.setProductMainId(productionProductMain.getId()); |
| | | productionProductInputMapper.insert(productionProductInput); |
| | | |
| | | |
| | | DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyyMMdd"); |
| | | LocalDate now = LocalDate.now(); |
| | | ProcurementRecordOut procurementRecordOut1 = procurementRecordOutMapper.selectCode(dateFormat.format(now)); |
| | | Long aLong = procurementRecordOut1 == null ? 1L : Long.valueOf(procurementRecordOut1.getCode().split("LS"+dateFormat.format(now))[1]); |
| | | //添加出库处理 |
| | | ProcurementRecordOut.ProcurementRecordOutBuilder procurementRecordOut = ProcurementRecordOut.builder() |
| | | .procurementRecordStorageId(0) |
| | | .code("LS" + dateFormat.format(now) + String.format("%03d", aLong + 1)) |
| | | .salesLedgerProductId(0) |
| | | .inboundBatches(aLong.equals(0L) ? "第1批次" : "第"+ (aLong + 1) + "批次") |
| | | .inboundNum(productionProductInput.getQuantity()) |
| | | .type(4) |
| | | .createTime(LocalDateTime.now()) |
| | | .createUser(user.getUserId()) |
| | | .createBy(user.getNickName()) |
| | | .updateUser(user.getUserId()) |
| | | .updateTime(LocalDateTime.now()) |
| | | .productModelId(productModel1.getId()); |
| | | procurementRecordOutMapper.insert(procurementRecordOut.build()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | // 获取生产订单 |
| | | ProductWorkOrder productWorkOrder = productWorkOrderMapper.selectById(dto.getWorkOrderId()); |
| | | List<ProductionProductMain> productionProductMains = productionProductMainMapper.selectList(new QueryWrapper<ProductionProductMain>().lambda().eq(ProductionProductMain::getWorkOrderId, dto.getWorkOrderId())); |
| | | |
| | | if (productionProductMains.isEmpty()) { |
| | | productWorkOrder.setActualStartTime(LocalDate.now()); |
| | | } |
| | | ProductOrder productOrder = productOrderMapper.selectById(productWorkOrder.getProductOrderId()); |
| | | if (productOrder == null) { |
| | | throw new RuntimeException("生产订单不存在"); |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | IPage<PurchaseLedgerDto> purchaseLedgerDtoIPage = purchaseLedgerService.selectPurchaseLedgerListPage(page ,purchaseLedger); |
| | | //过滤掉approvalStatus=3的记录 |
| | | purchaseLedgerDtoIPage.getRecords().removeIf(purchaseLedgerDto -> purchaseLedgerDto.getApprovalStatus() == 3); |
| | | purchaseLedgerDtoIPage.getRecords().forEach(purchaseLedgerDto -> { |
| | | if (purchaseLedgerDto.getUnReceiptPaymentAmount().compareTo(BigDecimal.ZERO) == 0) { |
| | | purchaseLedgerDto.setUnReceiptPaymentAmount(purchaseLedgerDto.getContractAmount()); |
| | | } |
| | | }); |
| | | return AjaxResult.success(purchaseLedgerDtoIPage); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getProductRecordById") |
| | | public AjaxResult getProductRecordById(Long id) { |
| | | if (id == null) { |
| | | @PostMapping("/getProductRecordById") |
| | | public AjaxResult getProductRecordById(@RequestBody ProductRecordDto productRecordDto) { |
| | | if (productRecordDto.getId() == null) { |
| | | return AjaxResult.error("参数错误"); |
| | | } |
| | | return AjaxResult.success(productRecordService.getProductRecordById(id)); |
| | | return AjaxResult.success(productRecordService.getProductRecordById(productRecordDto)); |
| | | } |
| | | |
| | | @ApiModelProperty("修改来票登记") |
| | |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | |
| | | private String projectName; |
| | | private Long issUerId; |
| | | private String issUer; |
| | | /** |
| | | * 合同金额(产品含税总价) |
| | | */ |
| | | private BigDecimal contractAmount = BigDecimal.ZERO; |
| | | //增值税 |
| | | private String invoiceAmount = "0"; |
| | | |
| | | /** |
| | | * 已来票金额(发票金额) |
| | | */ |
| | | private BigDecimal invoiceTotal = BigDecimal.ZERO; |
| | | private BigDecimal invoiceAmount = BigDecimal.ZERO; |
| | | /** |
| | | * 发票号 |
| | | */ |
| | | private String invoiceNumber; |
| | | |
| | | private String unTicketsPrice = "0"; |
| | | private BigDecimal unTicketsPrice = BigDecimal.ZERO; |
| | | |
| | | private List<CommonFile> commonFiles; |
| | | |
| | |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 采购台账产品开票记录Mapper接口 |
| | | * |
| | |
| | | |
| | | IPage<ProductRecordDto> productRecordPage(Page page, @Param("c") TicketRegistrationDto ticketRegistrationDto); |
| | | |
| | | ProductRecordDto getProductRecordById(Long id); |
| | | List<ProductRecordDto> getProductRecordById(@Param("c") ProductRecordDto productRecordDto); |
| | | } |
| | |
| | | |
| | | AjaxResult updateRecord(ProductRecordDto productRecordDto); |
| | | |
| | | ProductRecordDto getProductRecordById(Long id); |
| | | ProductRecordDto getProductRecordById(ProductRecordDto productRecordDto); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ProductRecordDto getProductRecordById(Long id) { |
| | | ProductRecordDto productRecordDto = productRecordMapper.getProductRecordById(id); |
| | | return productRecordDto; |
| | | public ProductRecordDto getProductRecordById(ProductRecordDto productRecordDto) { |
| | | List<ProductRecordDto> productRecordDtoList = productRecordMapper.getProductRecordById(productRecordDto); |
| | | if(productRecordDtoList != null && productRecordDtoList.size() > 0){ |
| | | ProductRecordDto productRecordDto1 = productRecordDtoList.get(productRecordDtoList.size() - 1); |
| | | // 过滤出与传入的 productRecordDto 主键相同的记录 |
| | | ProductRecordDto productRecordDto2 = productRecordDtoList.stream().filter(item -> |
| | | item.getId().equals(productRecordDto.getId())) |
| | | .findFirst().orElse(null); |
| | | productRecordDto2.setFutureTickets(productRecordDto1.getFutureTickets()); |
| | | productRecordDto2.setFutureTicketsAmount(productRecordDto1.getFutureTicketsAmount()); |
| | | return productRecordDto2; |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | |
| | | LocalDateTime localDateTime = entryDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
| | | salesLedgerProduct.setRegisterDate(localDateTime); |
| | | salesLedgerProduct.setFutureTickets(salesLedgerProduct.getQuantity()); |
| | | salesLedgerProduct.setFutureTicketsAmount(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | | salesLedgerProductMapper.insert(salesLedgerProduct); |
| | | } |
| | | } |
| | |
| | | procurementRecordOutAdd.setDetails(details); |
| | | |
| | | ProcurementRecordStorage.ProcurementRecordStorageBuilder procurementRecordBuilder = ProcurementRecordStorage.builder() |
| | | .salesLedgerProductId(details1.getId()) |
| | | .salesLedgerProductId(0) |
| | | .inboundBatches( "生产半成品入库") |
| | | .inboundNum(details1.getInboundQuantity()) |
| | | .type(2) |
| | |
| | | List<Details> details = new ArrayList<>(); |
| | | Details details1 = new Details(); |
| | | details1.setInboundQuantity(qualityInspect.getQuantity()); |
| | | details1.setId(Math.toIntExact(salesLedgerProduct.getProductId())); |
| | | details1.setId(Math.toIntExact(salesLedgerProduct.getId())); |
| | | details1.setUnitPrice(salesLedgerProduct.getTaxInclusiveUnitPrice()); |
| | | details1.setTotalPrice(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | | details1.setProductModelId(salesLedgerProduct.getProductModelId()); |
| | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | { |
| | | List<SalesLedgerProduct> list = salesLedgerProductService.selectSalesLedgerProductList(salesLedgerProduct); |
| | | list.forEach(item -> { |
| | | if (item.getFutureTickets().compareTo(BigDecimal.ZERO) == 0) { |
| | | item.setFutureTickets(item.getQuantity()); |
| | | } |
| | | if (item.getFutureTicketsAmount().compareTo(BigDecimal.ZERO) == 0) { |
| | | item.setFutureTicketsAmount(item.getTaxInclusiveTotalPrice()); |
| | | } |
| | | ProcurementPageDto procurementDto = new ProcurementPageDto(); |
| | | procurementDto.setSalesLedgerProductId(item.getId()); |
| | | procurementDto.setProductCategory(item.getProductCategory()); |
| | |
| | | /** |
| | | * 本次来票数 |
| | | */ |
| | | private BigDecimal ticketsNum; |
| | | private BigDecimal ticketsNum=BigDecimal.ZERO; |
| | | |
| | | /** |
| | | * 本次来票金额(元) |
| | | */ |
| | | private BigDecimal ticketsAmount; |
| | | private BigDecimal ticketsAmount=BigDecimal.ZERO; |
| | | |
| | | /** |
| | | * 未来票数 |
| | | */ |
| | | private BigDecimal futureTickets; |
| | | private BigDecimal futureTickets=BigDecimal.ZERO; |
| | | |
| | | /** |
| | | * 未来票金额(元) |
| | | */ |
| | | private BigDecimal futureTicketsAmount; |
| | | private BigDecimal futureTicketsAmount=BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "开票数") |
| | | private BigDecimal invoiceNum; |
| | |
| | | ProductWorkOrder productWorkOrder = new ProductWorkOrder(); |
| | | productWorkOrder.setProductProcessRouteItemId(productProcessRouteItem.getId()); |
| | | productWorkOrder.setProductOrderId(productOrder.getId()); |
| | | productWorkOrder.setQuantity(salesLedgerProduct.getQuantity()); |
| | | productWorkOrder.setPlanQuantity(salesLedgerProduct.getQuantity()); |
| | | productWorkOrder.setWorkOrderNo(workOrderNoStr); |
| | | productWorkOrder.setStatus(1); |
| | |
| | | import com.ruoyi.account.pojo.AccountIncome; |
| | | import com.ruoyi.account.service.AccountIncomeService; |
| | | import com.ruoyi.basic.mapper.CustomerMapper; |
| | | import com.ruoyi.basic.mapper.ProductModelMapper; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | 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; |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.other.pojo.TempFile; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | | import com.ruoyi.production.mapper.*; |
| | | import com.ruoyi.production.pojo.*; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | |
| | | private static final long LOCK_EXPIRE_TIME = 30; // 锁自动过期时间(秒) |
| | | |
| | | private final RedisTemplate<String, String> redisTemplate; |
| | | @Autowired |
| | | private ProductModelMapper productModelMapper; |
| | | @Autowired |
| | | private ProductStructureMapper productStructureMapper; |
| | | |
| | | @Override |
| | | public List<SalesLedger> selectSalesLedgerList(SalesLedgerDto salesLedgerDto) { |
| | |
| | | productOrderMapper.insert(productOrder); |
| | | |
| | | ProcessRoute processRoute = processRouteMapper.selectOne(new QueryWrapper<ProcessRoute>().lambda().eq(ProcessRoute::getProductModelId, salesLedgerProduct.getProductModelId())); |
| | | List<ProductStructureDto> productStructureDtos = productStructureMapper.listByproductModelId(salesLedgerProduct.getProductModelId()); |
| | | if (processRoute != null) { |
| | | //新增生产订单工艺路线主表 |
| | | ProductProcessRoute productProcessRoute = new ProductProcessRoute(); |
| | |
| | | // 生成完整的工单号 |
| | | String workOrderNoStr = String.format("%s%03d", datePrefix, sequenceNumber); |
| | | ProductWorkOrder productWorkOrder = new ProductWorkOrder(); |
| | | productStructureDtos.stream().forEach(productStructureDto -> { |
| | | if (productStructureDto.getProductModelId().equals(productProcessRouteItem.getProductModelId())){ |
| | | productWorkOrder.setQuantity(productStructureDto.getUnitQuantity().multiply(salesLedgerProduct.getQuantity())); |
| | | productWorkOrder.setPlanQuantity(productWorkOrder.getQuantity()); |
| | | } |
| | | }); |
| | | if (Objects.equals(productProcessRouteItem.getProductModelId(), salesLedgerProduct.getProductModelId())) { |
| | | productWorkOrder.setQuantity(salesLedgerProduct.getQuantity()); |
| | | productWorkOrder.setPlanQuantity(salesLedgerProduct.getQuantity()); |
| | | } |
| | | productWorkOrder.setProductProcessRouteItemId(productProcessRouteItem.getId()); |
| | | productWorkOrder.setProductOrderId(productOrder.getId()); |
| | | productWorkOrder.setPlanQuantity(salesLedgerProduct.getQuantity()); |
| | | productWorkOrder.setWorkOrderNo(workOrderNoStr); |
| | | productWorkOrder.setStatus(1); |
| | | productWorkOrderMapper.insert(productWorkOrder); |
| | |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id and t2.type = 1 |
| | | left join sales_ledger t3 on t3.id = t2.sales_ledger_id |
| | | <where> |
| | | t1.type = 2 |
| | | t1.type = 2 and t1.sales_ledger_product_id != 0 |
| | | <if test="req.customerName != null and req.customerName != ''"> |
| | | and t3.customer_name like concat('%',#{req.customerName},'%') |
| | | </if> |
| | |
| | | from procurement_record_storage |
| | | where product_model_id = #{productModelId} |
| | | </select> |
| | | <select id="listPageByProductProduction" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDto"> |
| | | select |
| | | t1.*, |
| | | t2.model as product_category , |
| | | t2.unit, |
| | | t3.product_name |
| | | from procurement_record_storage t1 |
| | | left join product_model t2 on t1.product_model_id = t2.id |
| | | left join product t3 on t2.product_id = t3.id |
| | | <where> |
| | | t1.type = 2 and t1.sales_ledger_product_id = 0 |
| | | <if test="req.productCategory != null and req.productCategory != ''"> |
| | | and t3.product_name like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | |
| | | <if test="req.timeStr != null and req.timeStr != ''"> |
| | | and t1.create_time like concat('%',#{req.timeStr},'%') |
| | | </if> |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="list" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | | select |
| | | t3.supplier_name, |
| | | select t3.supplier_name, |
| | | t2.product_category, |
| | | t1.id, |
| | | t2.specification_model, |
| | |
| | | </select> |
| | | |
| | | <select id="listOne" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | | select |
| | | t3.customer_contract_no, |
| | | select t3.customer_contract_no, |
| | | t3.sales_contract_no, |
| | | t3.customer_name, |
| | | t2.product_category, |
| | |
| | | </select> |
| | | |
| | | <select id="listTwo" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | | select |
| | | t1.supplier_name, |
| | | select t1.supplier_name, |
| | | t1.product_category, |
| | | t1.id, |
| | | t1.specification_model, |
| | |
| | | <select id="getSumQuantity" resultType="BigDecimal"> |
| | | select COALESCE(sum(inbound_num), 0) |
| | | from procurement_record_out |
| | | where type = 1 |
| | | and product_model_id = #{productModelId} |
| | | where |
| | | product_model_id = #{productModelId} |
| | | </select> |
| | | <select id="selectCode" resultType="com.ruoyi.procurementrecord.pojo.ProcurementRecordOut"> |
| | | select * |
| | | from procurement_record_out |
| | | where code like concat('%', #{format}) |
| | | order by id desc |
| | | limit 1 |
| | | </select> |
| | | <select id="listPageBySemiProduct" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | | select |
| | | t1.id, |
| | | t1.code, |
| | | t2.unit, |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_by, |
| | | t2.model as specification_model, |
| | | t2.product_code, |
| | | t3.product_name as product_category |
| | | from procurement_record_out t1 |
| | | left join product_model t2 on t2.id = t1.product_model_id |
| | | left join product t3 on t3.id = t2.product_id |
| | | <where> |
| | | and t1.type = 4 |
| | | <if test="req.productCategory !=null and req.productCategory !=''"> |
| | | t3.product_name like concat('%',#{req.productCategory},'%') |
| | | </if> |
| | | <if test="req.timeStr != null and req.timeStr != ''"> |
| | | and t1.create_time like concat('%',#{req.timeStr},'%') |
| | | </if> |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | and pl.supplier_name like concat('%',#{c.supplierName},'%') |
| | | </if> |
| | | <if test="c.createdAtStart != null and c.createdAtStart != ''"> |
| | | and pr.created_at >= date_format(#{c.createdAtStart},'%Y-%m-%d hh:mm:ss') |
| | | and pr.created_at >= str_to_date(#{c.createdAtStart}, '%Y-%m-%d') |
| | | </if> |
| | | <if test="c.createdAtEnd != null and c.createdAtEnd != ''"> |
| | | and pr.created_at <= date_format(#{c.createdAtEnd},'%Y-%m-%d hh:mm:ss') |
| | | and pr.created_at < date_add(str_to_date(#{c.createdAtEnd}, '%Y-%m-%d'), interval 1 day) |
| | | </if> |
| | | <if test="c.purchaseContractNumber != null and c.purchaseContractNumber != ''"> |
| | | and tr.purchase_contract_number like concat('%',#{c.purchaseContractNumber},'%') |
| | |
| | | left join sales_ledger sl on sl.id = pl.sales_ledger_id |
| | | left join ticket_registration tr on tr.id = pr.ticket_registration_id |
| | | left join product_model pm on pm.id = pr.product_model_id |
| | | |
| | | WHERE type = 2 and pr.id = #{id} |
| | | WHERE type = 2 |
| | | <if test="c.purchaseLedgerId != null and c.purchaseLedgerId != ''"> |
| | | and pr.purchase_ledger_id = #{c.purchaseLedgerId} |
| | | </if> |
| | | <if test="c.productModelId != null and c.productModelId != ''"> |
| | | and pm.id = #{c.productModelId} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | pl.supplier_name, |
| | | pl.project_name, |
| | | pl.contract_amount, |
| | | sum(pr.tickets_amount)as receipt_payment_amount, |
| | | pl.contract_amount-sum(pr.tickets_amount) AS unReceipt_payment_amount, |
| | | sum(tr.invoice_amount)as receipt_payment_amount, |
| | | pl.contract_amount-sum(tr.invoice_amount) AS unReceipt_payment_amount, |
| | | pl.entry_date, |
| | | pl.recorder_id, |
| | | pl.recorder_name, |
| | |
| | | pl.approval_status, |
| | | pl.payment_method |
| | | from purchase_ledger pl |
| | | left join sales_ledger_product slp on slp.sales_ledger_id = pl.id and slp.type=2 |
| | | left join product_record pr on pl.id = pr.purchase_ledger_id |
| | | left join ticket_registration tr on tr.id = pr.ticket_registration_id |
| | | left join supplier_manage sm on pl.supplier_id = sm.id |
| | | <where> |
| | | 1 = 1 |
| | |
| | | ) |
| | | </if> |
| | | <if test="invoiceRegistrationProductDto.invoiceDateStart != null and invoiceRegistrationProductDto.invoiceDateStart != ''"> |
| | | AND T3.invoice_date >= date_format(#{invoiceRegistrationProductDto.invoiceDateStart}, '%Y-%m-%d') |
| | | AND T3.invoice_date >= str_to_date(#{invoiceRegistrationProductDto.invoiceDateStart}, '%Y-%m-%d') |
| | | </if> |
| | | <if test="invoiceRegistrationProductDto.invoiceDateEnd != null and invoiceRegistrationProductDto.invoiceDateEnd != ''"> |
| | | AND T3.invoice_date <= date_format(#{invoiceRegistrationProductDto.invoiceDateEnd}, '%Y-%m-%d') |
| | | AND T3.invoice_date < date_add(str_to_date(#{invoiceRegistrationProductDto.invoiceDateEnd}, '%Y-%m-%d'), interval 1 day) |
| | | </if> |
| | | <if test="invoiceRegistrationProductDto.createTimeStart != null "> |
| | | AND T1.create_time >= date_format(#{invoiceRegistrationProductDto.createTimeStart}, '%Y-%m-%d %H:%i:%s') |