src/main/java/com/ruoyi/production/controller/SalesLedgerProductionAccountingController.java
@@ -13,8 +13,11 @@ 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 @@ -36,4 +39,14 @@ return AjaxResult.success(list); } /** * 导出 * @param response */ @PostMapping("/export") @ApiOperation("生产管理-生产核算-导出") public void export(HttpServletResponse response) { salesLedgerProductionAccountingService.export(response); } } src/main/java/com/ruoyi/production/dto/SalesLedgerProductionAccountingDto.java
@@ -1,5 +1,6 @@ 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; @@ -24,6 +25,7 @@ * 排产人名称 */ @ApiModelProperty(value = "生产人名称") @Excel(name = "生产人名称") private String schedulingUserName; @@ -31,29 +33,34 @@ * 工资 */ @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 = "开始时间") src/main/java/com/ruoyi/production/service/SalesLedgerProductionAccountingService.java
@@ -6,6 +6,8 @@ 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 @@ -16,4 +18,5 @@ IPage<SalesLedgerProductionAccountingDto> listPage(Page page, SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto); void export(HttpServletResponse response); } src/main/java/com/ruoyi/production/service/impl/SalesLedgerProductionAccountingServiceImpl.java
@@ -1,15 +1,26 @@ 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 @@ -27,4 +38,12 @@ 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(), "生产订单"); } } src/main/java/com/ruoyi/staff/pojo/StaffJoinLeaveRecord.java
@@ -73,9 +73,12 @@ // @Excel(name = "岗位") private Long deptPositionId; @TableField(exist = false) // @TableField(exist = false) // @Excel(name = "岗位") // private String deptPositionName; @Excel(name = "岗位") private String deptPositionName; private String postJob; /** * 家庭住址 src/main/java/com/ruoyi/staff/pojo/StaffOnJob.java
@@ -62,9 +62,12 @@ // @Excel(name = "岗位") private Integer deptPositionId; @TableField(exist = false) // @TableField(exist = false) // @Excel(name = "岗位") // private String deptPositionName; @Excel(name = "岗位") private String deptPositionName; private String postJob; /** * 家庭住址 src/main/java/com/ruoyi/staff/service/impl/StaffJoinLeaveRecordServiceImpl.java
@@ -192,7 +192,7 @@ // 通过部门名称查询部门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); } src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
@@ -45,7 +45,7 @@ </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, src/main/resources/mapper/system/SysUserMapper.xml
@@ -88,7 +88,7 @@ <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}