Merge remote-tracking branch 'origin/sqd' into sqd
| | |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.basic.service.IProductModelService; |
| | | import com.ruoyi.basic.service.IProductService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | |
| | | public AjaxResult importProduct(MultipartFile file) { |
| | | return AjaxResult.success(productModelService.importProduct(file)); |
| | | } |
| | | /** |
| | | * 产品维护-下载产品模板 |
| | | */ |
| | | @PostMapping("/downloadTemplate") |
| | | public void downloadTemplate(HttpServletResponse response) { |
| | | ExcelUtil<ProductModel> util = new ExcelUtil<>(ProductModel.class); |
| | | util.importTemplateExcel(response, "产品规格模板"); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.home.service.HomeService; |
| | | import com.ruoyi.lavorissue.mapper.LavorIssueMapper; |
| | | import com.ruoyi.lavorissue.pojo.LaborIssue; |
| | | import com.ruoyi.procurementrecord.mapper.CustomStorageMapper; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper; |
| | | import com.ruoyi.procurementrecord.pojo.CustomStorage; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordOut; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | |
| | | @Autowired |
| | | private CustomStorageMapper customStorageMapper; |
| | | |
| | | @Override |
| | | public HomeBusinessDto business() { |
| | | // 构建结果 |
| | |
| | | } |
| | | |
| | | LambdaQueryWrapper<SalesLedgerProduct> salesLedgerProductMapperLambdaQueryWrapperCopy = new LambdaQueryWrapper<SalesLedgerProduct>(); |
| | | salesLedgerProductMapperLambdaQueryWrapper.eq(SalesLedgerProduct::getType, 2) |
| | | salesLedgerProductMapperLambdaQueryWrapperCopy.eq(SalesLedgerProduct::getType, 2) |
| | | .in(SalesLedgerProduct::getSalesLedgerId, purchaseLedgers.stream().map(PurchaseLedger::getId).collect(Collectors.toList())); |
| | | List<SalesLedgerProduct> salesLedgerProductsCopy = salesLedgerProductMapper.selectList(salesLedgerProductMapperLambdaQueryWrapperCopy); |
| | | // 合计合同金额 |
| | |
| | | .map(ProcurementRecordStorage::getInboundNum) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // 成品入库 |
| | | List<CustomStorage> customStorages = customStorageMapper.selectList(null); |
| | | BigDecimal stockAmountCustom = customStorages.stream() |
| | | .map(CustomStorage::getInboundNum) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | stockAmount = stockAmount.add(stockAmountCustom); |
| | | List<ProcurementRecordOut> procurementRecordOuts = procurementRecordOutMapper.selectList(null); |
| | | BigDecimal outboundAmount = procurementRecordOuts.stream() |
| | | .map(ProcurementRecordOut::getInboundNum) |
| | |
| | | .map(ProcurementRecordStorage::getInboundNum) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // 获取当天成品入库数量 |
| | | LambdaQueryWrapper<CustomStorage> customStorageLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | customStorageLambdaQueryWrapper.ge(CustomStorage::getCreateTime, now) // 大于等于当天 |
| | | .lt(CustomStorage::getCreateTime, now.plusDays(1)); |
| | | List<CustomStorage> customStorages1 = customStorageMapper.selectList(customStorageLambdaQueryWrapper); |
| | | BigDecimal stockAmountCustom1 = customStorages1.stream() |
| | | .map(CustomStorage::getInboundNum) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | stockAmount1 = stockAmount1.add(stockAmountCustom1); |
| | | |
| | | homeBusinessDto.setMonthPurchaseMoney(receiveAmount.setScale(2, RoundingMode.HALF_UP).toString()); |
| | | homeBusinessDto.setMonthPurchaseHaveMoney(unReceiptPaymentAmount.setScale(2, RoundingMode.HALF_UP).toString()); |
| | |
| | | public void exportOne(HttpServletResponse response) { |
| | | List<ProcurementRecordOutPageDto> list = procurementRecordOutMapper.listOne(); |
| | | ExcelUtil<ProcurementRecordOutPageDto> util = new ExcelUtil<>(ProcurementRecordOutPageDto.class); |
| | | util.exportExcel(response, list, "生产出库台账"); |
| | | util.exportExcel(response, list, "采购出库台账"); |
| | | } |
| | | |
| | | /** |
| | |
| | | public void exportTwo(HttpServletResponse response) { |
| | | List<ProcurementRecordOutPageDto> list = procurementRecordOutMapper.listTwo(); |
| | | ExcelUtil<ProcurementRecordOutPageDto> util = new ExcelUtil<>(ProcurementRecordOutPageDto.class); |
| | | util.exportExcel(response, list, "生产出库台账"); |
| | | util.exportExcel(response, list, "成品出库台账"); |
| | | } |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | /** |
| | | * 导出 |
| | | * @param response |
| | | */ |
| | | @PostMapping("/export") |
| | | @ApiOperation("生产管理-生产核算-导出") |
| | | public void export(HttpServletResponse response) { |
| | | salesLedgerProductionAccountingService.export(response); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | * 排产人名称 |
| | | */ |
| | | @ApiModelProperty(value = "生产人名称") |
| | | @Excel(name = "生产人名称") |
| | | private String schedulingUserName; |
| | | |
| | | |
| | |
| | | * 工资 |
| | | */ |
| | | @ApiModelProperty(value = "工资") |
| | | @Excel(name = "工资") |
| | | private BigDecimal wages; |
| | | |
| | | /** |
| | | * 生产数量 |
| | | */ |
| | | @ApiModelProperty(value = "生产数量") |
| | | @Excel(name = "生产数量") |
| | | private BigDecimal finishedNum; |
| | | |
| | | /** |
| | | * 工时定额 |
| | | */ |
| | | @ApiModelProperty(value = "工时定额") |
| | | @Excel(name = "工时定额") |
| | | private BigDecimal workHours; |
| | | |
| | | /** |
| | | * 工序 |
| | | */ |
| | | @ApiModelProperty(value = "工序") |
| | | @Excel(name = "工序") |
| | | private String process; |
| | | /** |
| | | * 排产日期 |
| | | */ |
| | | @ApiModelProperty(value = "排产日期") |
| | | @Excel(name = "排产日期") |
| | | private String schedulingDate; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | |
| | | import com.ruoyi.production.dto.SalesLedgerProductionAccountingDto; |
| | | import com.ruoyi.production.pojo.SalesLedgerProductionAccounting; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/7/21 14:39 |
| | |
| | | IPage<SalesLedgerProductionAccountingDto> listPage(Page page, SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto); |
| | | |
| | | |
| | | void export(HttpServletResponse response); |
| | | } |
| | |
| | | package com.ruoyi.production.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.production.dto.SalesLedgerProductionAccountingDto; |
| | | import com.ruoyi.production.dto.SalesLedgerSchedulingDto; |
| | | import com.ruoyi.production.mapper.SalesLedgerProductionAccountingMapper; |
| | | import com.ruoyi.production.pojo.SalesLedgerProductionAccounting; |
| | | import com.ruoyi.production.pojo.SalesLedgerWork; |
| | | import com.ruoyi.production.service.SalesLedgerProductionAccountingService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | IPage<SalesLedgerProductionAccountingDto> list = salesLedgerProductionAccountingMapper.listPage(page, salesLedgerProductionAccountingDto); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response) { |
| | | Page page = new Page(-1,-1); |
| | | IPage<SalesLedgerProductionAccountingDto> salesLedgerProductionAccountingDtoIPage = listPage(page, new SalesLedgerProductionAccountingDto()); |
| | | ExcelUtil<SalesLedgerProductionAccountingDto> util = new ExcelUtil<>(SalesLedgerProductionAccountingDto.class); |
| | | util.exportExcel(response, salesLedgerProductionAccountingDtoIPage.getRecords(), "生产订单"); |
| | | } |
| | | } |
| | |
| | | .map(SalesLedgerWork::getFinishedNum) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | // 状态 = 数量和完工数量比较 |
| | | if(i.getSchedulingNum().compareTo(i.getSuccessNum()) == 0){ |
| | | if(i.getSuccessNum().compareTo(new BigDecimal(0)) == 0){ |
| | | i.setStatus("未开始"); |
| | | } else if(i.getQuantity().compareTo(i.getSuccessNum()) <= 0){ |
| | | i.setStatus("已完成"); |
| | | }else{ |
| | | i.setStatus("未完成"); |
| | | i.setStatus("生产中"); |
| | | } |
| | | }); |
| | | return list; |
| | |
| | | .filter(j -> j.getSalesLedgerProductId().equals(i.getSalesLedgerProductId())) |
| | | .map(SalesLedgerWork::getFinishedNum) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | if(i.getSuccessNum().compareTo(new BigDecimal(0)) == 0){ |
| | | i.setStatus("未开始"); |
| | | } else if(i.getQuantity().compareTo(i.getSuccessNum()) <= 0){ |
| | | i.setStatus("已完成"); |
| | | }else{ |
| | | i.setStatus("生产中"); |
| | | } |
| | | }); |
| | | ExcelUtil<SalesLedgerSchedulingDto> util = new ExcelUtil<>(SalesLedgerSchedulingDto.class); |
| | | util.exportExcel(response, list, "生产订单"); |
| | |
| | | private final InvoiceLedgerMapper invoiceLedgerMapper; |
| | | |
| | | private final SalesLedgerSchedulingMapper salesLedgerSchedulingMapper; |
| | | private final InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | |
| | | LambdaQueryWrapper<SalesLedgerScheduling> in = new LambdaQueryWrapper<SalesLedgerScheduling>() |
| | | .in(SalesLedgerScheduling::getSalesLedgerId, idList); |
| | | salesLedgerSchedulingMapper.delete(in); |
| | | LambdaQueryWrapper<InvoiceRegistrationProduct> InvoiceRegistrationProductWrapper = new LambdaQueryWrapper<>(); |
| | | InvoiceRegistrationProductWrapper.in(InvoiceRegistrationProduct::getSalesLedgerId, idList); |
| | | List<InvoiceRegistrationProduct> invoiceRegistrationProducts = invoiceRegistrationProductMapper.selectList(InvoiceRegistrationProductWrapper); |
| | | if (!CollectionUtils.isEmpty(invoiceRegistrationProducts)) { |
| | | List<Integer> InvoiceRegistrationProductIds = invoiceRegistrationProducts.stream().map(InvoiceRegistrationProduct::getId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<InvoiceLedger> invoiceLedgerQuery = new LambdaQueryWrapper<>(); |
| | | invoiceLedgerQuery.in(InvoiceLedger::getInvoiceRegistrationProductId, InvoiceRegistrationProductIds); |
| | | invoiceLedgerMapper.delete(invoiceLedgerQuery); |
| | | } |
| | | // 2. 再删除主表数据 |
| | | return salesLedgerMapper.deleteBatchIds(idList); |
| | | } |
| | |
| | | // @Excel(name = "岗位") |
| | | private Long deptPositionId; |
| | | |
| | | @TableField(exist = false) |
| | | // @TableField(exist = false) |
| | | // @Excel(name = "岗位") |
| | | // private String deptPositionName; |
| | | |
| | | @Excel(name = "岗位") |
| | | private String deptPositionName; |
| | | private String postJob; |
| | | |
| | | /** |
| | | * 家庭住址 |
| | |
| | | // @Excel(name = "岗位") |
| | | private Integer deptPositionId; |
| | | |
| | | @TableField(exist = false) |
| | | // @TableField(exist = false) |
| | | // @Excel(name = "岗位") |
| | | // private String deptPositionName; |
| | | |
| | | @Excel(name = "岗位") |
| | | private String deptPositionName; |
| | | private String postJob; |
| | | |
| | | /** |
| | | * 家庭住址 |
| | |
| | | // 通过部门名称查询部门id |
| | | for (StaffJoinLeaveRecord staffJoinLeaveRecord : staffJoinLeaveRecords) { |
| | | staffJoinLeaveRecord.setStaffState(1); |
| | | Optional<DeptPosition> deptPosition = deptPositions.stream().filter(deptPosition1 -> deptPosition1.getName().equals(staffJoinLeaveRecord.getDeptPositionName())).findFirst(); |
| | | Optional<DeptPosition> deptPosition = deptPositions.stream().filter(deptPosition1 -> deptPosition1.getName().equals(staffJoinLeaveRecord.getPostJob())).findFirst(); |
| | | deptPosition.ifPresent(position -> staffJoinLeaveRecord.setDeptPositionId(position.getId())); |
| | | add(staffJoinLeaveRecord); |
| | | } |
| | |
| | | |
| | | <select id="listTwo" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | | select |
| | | t1.supplier_name, |
| | | t1.product_category, |
| | | t1.id, |
| | | t1.specification_model, |
| | | t1.unit, |
| | | t1.tax_rate, |
| | | t1.tax_inclusive_unit_price, |
| | | t1.tax_inclusive_total_price, |
| | | t1.tax_exclusive_total_price, |
| | | t1.`code`, |
| | | t3.supplier_name, |
| | | t2.product_category, |
| | | t2.specification_model, |
| | | t2.unit, |
| | | t2.tax_rate, |
| | | t2.tax_inclusive_unit_price, |
| | | t2.tax_inclusive_total_price, |
| | | t2.tax_exclusive_total_price, |
| | | t1.inbound_num, |
| | | t1.create_time, |
| | | t1.create_time as time, |
| | | t1.create_by |
| | | from procurement_record_out t1 |
| | | left join sales_ledger_product t2 on t2.id = t1.sales_ledger_product_id |
| | | left join purchase_ledger t3 on t3.id = t2.sales_ledger_id |
| | | where t1.type = 3 |
| | | </select> |
| | | <select id="listPageByProduct" resultType="com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto"> |
| | |
| | | </select> |
| | | <select id="list" resultType="com.ruoyi.production.dto.SalesLedgerSchedulingDto"> |
| | | SELECT |
| | | T2.id, |
| | | T2.id as salesLedgerProductId, |
| | | ifNull(sum(t3.scheduling_num),0) AS schedulingNum, |
| | | T1.sales_contract_no, |
| | | T1.customer_contract_no, |
| | |
| | | T2.unit |
| | | FROM |
| | | sales_ledger_product T2 |
| | | LEFT join sales_ledger_scheduling t3 on T2.id = t3.sales_ledger_product_id |
| | | LEFT JOIN sales_ledger T1 ON T1.id = T2.sales_ledger_id |
| | | LEFT join sales_ledger_scheduling t3 on T1.id = t3.sales_ledger_id |
| | | where T1.id is not null and T2.type = 1 |
| | | GROUP BY T2.id |
| | | </select> |
| | |
| | | <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> |
| | | AND date_format(u.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') |
| | | </if> |
| | | <if test="params.deptId != null"> |
| | | <if test="deptId != null"> |
| | | AND u.user_id IN |
| | | ( |
| | | SELECT user_id FROM sys_user_dept WHERE dept_id = #{deptId} |