Merge remote-tracking branch 'origin/dev_New' into dev_New
| | |
| | | LambdaQueryWrapper<ApproveNode> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(ApproveNode::getApproveProcessId, id); |
| | | queryWrapper.eq(ApproveNode::getDeleteFlag, 0); |
| | | queryWrapper.eq(ApproveNode::getApproveNodeStatus, 0); |
| | | List<ApproveNode> list = list(queryWrapper); |
| | | // 按照 approveNodeOrder 字段升序排序 |
| | | list.sort(Comparator.comparingInt(ApproveNode::getApproveNodeOrder)); |
| | | LambdaQueryWrapper<ApproveProcess> approveProcessLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | approveProcessLambdaQueryWrapper.eq(ApproveProcess::getApproveId, id) |
| | | .eq(ApproveProcess::getApproveDelete, 0) |
| | | .eq(ApproveProcess::getApproveStatus, 0) |
| | | .last("limit 1"); |
| | | ApproveProcess approveProcess = approveProcessMapper.selectOne(approveProcessLambdaQueryWrapper); |
| | | if(approveProcess != null && approveProcess.getApproveStatus() == 3){ |
| | |
| | | LambdaQueryWrapper<ApproveProcess> approveProcessLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | approveProcessLambdaQueryWrapper.eq(ApproveProcess::getApproveId, approveNode.getApproveProcessId()) |
| | | .eq(ApproveProcess::getApproveDelete, 0) |
| | | .eq(ApproveProcess::getApproveStatus, 0) |
| | | .last("limit 1"); |
| | | ApproveProcess approveProcess = approveProcessMapper.selectOne(approveProcessLambdaQueryWrapper); |
| | | if(approveProcess == null) throw new RuntimeException("审批不存在"); |
| | |
| | | approveNodeLambdaQueryWrapper.eq(ApproveNode::getApproveProcessId, approveNode.getApproveProcessId()) |
| | | .eq(ApproveNode::getApproveNodeOrder, approveNode.getApproveNodeOrder() + 1) |
| | | .eq(ApproveNode::getDeleteFlag, 0) |
| | | .eq(ApproveNode::getApproveNodeStatus, 0) |
| | | .last("limit 1"); |
| | | ApproveNode approveNode1 = approveNodeMapper.selectOne(approveNodeLambdaQueryWrapper); |
| | | approveProcess.setApproveStatus(status); |
| | |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.production.dto.ProductOrderDto; |
| | | import com.ruoyi.production.dto.SalesLedgerProductionAccountingDto; |
| | | import com.ruoyi.production.pojo.SalesLedgerProductionAccounting; |
| | | import com.ruoyi.production.service.SalesLedgerProductionAccountingService; |
| | | import com.ruoyi.production.service.impl.SalesLedgerProductionAccountingServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | public class SalesLedgerProductionAccountingController extends BaseController { |
| | | |
| | | @Autowired |
| | | private SalesLedgerProductionAccountingServiceImpl salesLedgerProductionAccountingService; |
| | | private SalesLedgerProductionAccountingService salesLedgerProductionAccountingService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("生产核算-分页查询") |
| | |
| | | ExcelUtil<SalesLedgerProductionAccountingDto> util = new ExcelUtil<SalesLedgerProductionAccountingDto>(SalesLedgerProductionAccountingDto.class); |
| | | util.exportExcel(response, list, "生产核算数据"); |
| | | } |
| | | //---------------------------------------------------------------------------------------------------------------------------------------------------- |
| | | @GetMapping("/page") |
| | | @ApiModelProperty("查询工人生产工资信息") |
| | | public R pageProductionAccounting(SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto, Page page){ |
| | | return R.ok(salesLedgerProductionAccountingService.pageProductionAccounting(salesLedgerProductionAccountingDto, page)); |
| | | } |
| | | |
| | | @GetMapping("/listProductionDetails") |
| | | @ApiModelProperty("查询工人生产工资信息") |
| | | public R listProductionDetails(SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto, Page page){ |
| | | return R.ok(salesLedgerProductionAccountingService.listProductionDetails(salesLedgerProductionAccountingDto,page)); |
| | | } |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | |
| | | //销售合同号 |
| | | @Excel(name = "销售合同号") |
| | | private String salesContractNo; |
| | | |
| | | private LocalDate scheduleDate; |
| | | private String schedulingUserName; |
| | | private String customerName; |
| | | private String process; |
| | | private BigDecimal workHours; |
| | | private BigDecimal wages; |
| | | } |
| | |
| | | @ApiModelProperty(value = "结束时间") |
| | | private String entryDateEnd; |
| | | |
| | | |
| | | private BigDecimal outputNum; |
| | | |
| | | private BigDecimal outputRate; |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.production.dto.ProductionProductMainDto; |
| | | import com.ruoyi.production.dto.SalesLedgerProductionAccountingDto; |
| | | import com.ruoyi.production.pojo.ProductOrder; |
| | | import com.ruoyi.production.pojo.ProductionProductMain; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | * @return |
| | | */ |
| | | ProductOrder getOrderByMainId(@Param("productMainId") Long productMainId); |
| | | |
| | | IPage<ProductionProductMainDto> listProductionDetails(SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto, Page page); |
| | | } |
| | |
| | | IPage<SalesLedgerProductionAccountingDto> listPage(Page page,@Param("salesLedgerDto") SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto); |
| | | |
| | | |
| | | IPage<SalesLedgerProductionAccountingDto> pageProductionAccounting(Page page, @Param("ew") SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.production.dto.ProductionProductMainDto; |
| | | import com.ruoyi.production.dto.SalesLedgerProductionAccountingDto; |
| | | import com.ruoyi.production.pojo.SalesLedgerProductionAccounting; |
| | | |
| | |
| | | IPage<SalesLedgerProductionAccountingDto> listPage(Page page, SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto); |
| | | |
| | | |
| | | IPage<SalesLedgerProductionAccountingDto> pageProductionAccounting(SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto, Page page); |
| | | |
| | | IPage<ProductionProductMainDto> listProductionDetails(SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto, Page page); |
| | | } |
| | |
| | | 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.production.dto.ProductionProductMainDto; |
| | | import com.ruoyi.production.dto.SalesLedgerProductionAccountingDto; |
| | | import com.ruoyi.production.mapper.ProductionProductMainMapper; |
| | | import com.ruoyi.production.mapper.SalesLedgerProductionAccountingMapper; |
| | | import com.ruoyi.production.pojo.SalesLedgerProductionAccounting; |
| | | import com.ruoyi.production.service.SalesLedgerProductionAccountingService; |
| | |
| | | public class SalesLedgerProductionAccountingServiceImpl extends ServiceImpl<SalesLedgerProductionAccountingMapper, SalesLedgerProductionAccounting> implements SalesLedgerProductionAccountingService { |
| | | |
| | | private final SalesLedgerProductionAccountingMapper salesLedgerProductionAccountingMapper; |
| | | |
| | | private final ProductionProductMainMapper productionProductMainMapper; |
| | | |
| | | @Override |
| | | public IPage<SalesLedgerProductionAccountingDto> listPage(Page page, SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto) { |
| | | IPage<SalesLedgerProductionAccountingDto> list = salesLedgerProductionAccountingMapper.listPage(page, salesLedgerProductionAccountingDto); |
| | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<SalesLedgerProductionAccountingDto> pageProductionAccounting(SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto, Page page) { |
| | | // TODO 管理员查询所有,其他人只能查自己 |
| | | return salesLedgerProductionAccountingMapper.pageProductionAccounting(page, salesLedgerProductionAccountingDto); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<ProductionProductMainDto> listProductionDetails(SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto, Page page) { |
| | | return productionProductMainMapper.listProductionDetails(salesLedgerProductionAccountingDto, page); |
| | | } |
| | | |
| | | public static boolean isNumeric(String str) { |
| | | if (str == null || str.isEmpty()) { |
| | | return false; |
| | |
| | | |
| | | <select id="listPageProductionProductMainDto" resultType="com.ruoyi.production.dto.ProductionProductMainDto"> |
| | | select ppm.*, |
| | | pwo.work_order_no as workOrderNo, |
| | | pwo.status as workOrderStatus, |
| | | u.nick_name as nickName, |
| | | p.product_name as productName, |
| | | pm.model as productModelName, |
| | | ppo.quantity, |
| | | ppo.scrap_qty, |
| | | pm.unit, |
| | | sl.sales_contract_no salesContractNo |
| | | pwo.work_order_no as workOrderNo, |
| | | pwo.status as workOrderStatus, |
| | | u.nick_name as nickName, |
| | | p.product_name as productName, |
| | | pm.model as productModelName, |
| | | ppo.quantity, |
| | | ppo.scrap_qty, |
| | | pm.unit, |
| | | sl.sales_contract_no salesContractNo |
| | | from |
| | | production_product_main ppm |
| | | left join product_work_order pwo on pwo.id = ppm.work_order_id |
| | | left join product_order po on po.id = pwo.product_order_id |
| | | left join production_product_output ppo on ppm.id = ppo.product_main_id |
| | | left join product_model pm on pm.id = ppo.product_model_id |
| | | left join product p on p.id = pm.product_id |
| | | left join sales_ledger sl on sl.id = po.sales_ledger_id |
| | | left join sys_user u on u.user_id = ppm.user_id |
| | | production_product_main ppm |
| | | left join product_work_order pwo on pwo.id = ppm.work_order_id |
| | | left join product_order po on po.id = pwo.product_order_id |
| | | left join production_product_output ppo on ppm.id = ppo.product_main_id |
| | | left join product_model pm on pm.id = ppo.product_model_id |
| | | left join product p on p.id = pm.product_id |
| | | left join sales_ledger sl on sl.id = po.sales_ledger_id |
| | | left join sys_user u on u.user_id = ppm.user_id |
| | | <where> |
| | | <if test="c.nickName != null and c.nickName != ''"> |
| | | and u.nick_name like concat('%',#{c.nickName},'%') |
| | |
| | | <select id="getOrderByMainId" resultType="com.ruoyi.production.pojo.ProductOrder"> |
| | | select po.* |
| | | from product_order po |
| | | left join product_work_order pwo on po.id = pwo.product_order_id |
| | | left join production_product_main pm on work_order_id=pwo.id |
| | | where pm.id=#{productMainId} |
| | | left join product_work_order pwo on po.id = pwo.product_order_id |
| | | left join production_product_main pm on work_order_id = pwo.id |
| | | where pm.id = #{productMainId} |
| | | </select> |
| | | <select id="listProductionDetails" resultType="com.ruoyi.production.dto.ProductionProductMainDto"> |
| | | SELECT |
| | | slpa.scheduling_date, |
| | | slpa.scheduling_user_name, |
| | | sl.sales_contract_no, |
| | | sl.customer_name, |
| | | p.product_name, |
| | | pm.model, |
| | | pm.unit, |
| | | slpa.process, |
| | | ppo.quantity, |
| | | slpa.work_hours, |
| | | slpa.work_hours * slpa.finished_num AS wages |
| | | FROM |
| | | production_product_main ppm |
| | | LEFT JOIN sales_ledger_production_accounting slpa ON slpa.sales_ledger_work_id = ppm.id |
| | | LEFT JOIN production_product_output ppo ON ppm.id = ppo.product_main_id |
| | | LEFT JOIN product_work_order pwo ON pwo.id = ppm.work_order_id |
| | | LEFT JOIN product_order po ON po.id = pwo.product_order_id |
| | | LEFT JOIN process_route pr ON pr.id = po.route_id |
| | | LEFT JOIN product_model pm ON po.product_model_id = pm.id |
| | | LEFT JOIN product p ON p.id = pm.product_id |
| | | LEFT JOIN sales_ledger sl ON po.sales_ledger_id = sl.id |
| | | </select> |
| | | |
| | | <delete id="deleteByWorkOrderIds" parameterType="java.util.List"> |
| | |
| | | group by t4.id |
| | | order by t4.scheduling_date desc |
| | | </select> |
| | | <select id="pageProductionAccounting" |
| | | resultType="com.ruoyi.production.dto.SalesLedgerProductionAccountingDto"> |
| | | SELECT |
| | | slpa.scheduling_user_id, |
| | | slpa.scheduling_user_name, |
| | | sum(ppout.quantity) as output_num, |
| | | sum(slpa.finished_num * work_hours) as wages, |
| | | SUM(slpa.finished_num) / SUM(ppout.quantity) as output_rate |
| | | FROM sales_ledger_production_accounting slpa |
| | | LEFT JOIN production_product_main ppm ON slpa.sales_ledger_work_id = ppm.id |
| | | LEFT JOIN production_product_output ppout ON ppm.id = ppout.product_main_id |
| | | <where> |
| | | <if test="ew.schedulingUserName != null and ew.schedulingUserName !=''" > |
| | | and slpa.scheduling_user_name = #{ew.schedulingUserName} |
| | | </if> |
| | | </where> |
| | | GROUP BY slpa.scheduling_user_name |
| | | |
| | | </select> |
| | | |
| | | </mapper> |