commit
38e3eec46c
23 changed files with 721 additions and 80 deletions
@ -0,0 +1,161 @@ |
|||||||
|
/** |
||||||
|
* BladeX Commercial License Agreement |
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p> |
||||||
|
* Use of this software is governed by the Commercial License Agreement |
||||||
|
* obtained after purchasing a license from BladeX. |
||||||
|
* <p> |
||||||
|
* 1. This software is for development use only under a valid license |
||||||
|
* from BladeX. |
||||||
|
* <p> |
||||||
|
* 2. Redistribution of this software's source code to any third party |
||||||
|
* without a commercial license is strictly prohibited. |
||||||
|
* <p> |
||||||
|
* 3. Licensees may copyright their own code but cannot use segments |
||||||
|
* from this software for such purposes. Copyright of this software |
||||||
|
* remains with BladeX. |
||||||
|
* <p> |
||||||
|
* Using this software signifies agreement to this License, and the software |
||||||
|
* must not be used for illegal purposes. |
||||||
|
* <p> |
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||||
|
* not liable for any claims arising from secondary or illegal development. |
||||||
|
* <p> |
||||||
|
* Author: Chill Zhuang (bladejava@qq.com) |
||||||
|
*/ |
||||||
|
package org.springblade.scheduling.scheduling.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||||
|
import io.swagger.v3.oas.annotations.Parameter; |
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||||
|
import jakarta.servlet.http.HttpServletResponse; |
||||||
|
import jakarta.validation.Valid; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.excel.util.ExcelUtil; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.secure.BladeUser; |
||||||
|
import org.springblade.core.secure.annotation.IsAdmin; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.DateUtil; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.scheduling.scheduling.entity.PersonResourceEntity; |
||||||
|
import org.springblade.scheduling.scheduling.excel.PersonResourceExcel; |
||||||
|
import org.springblade.scheduling.scheduling.service.IPersonResourceService; |
||||||
|
import org.springblade.scheduling.scheduling.vo.PersonResourceVO; |
||||||
|
import org.springblade.scheduling.scheduling.wrapper.PersonResourceWrapper; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备资源表 控制器 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
* @since 2025-11-12 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping("/personResource") |
||||||
|
@Tag(name = "人员资源表", description = "人员资源表接口") |
||||||
|
public class PersonResourceController extends BladeController { |
||||||
|
|
||||||
|
private final IPersonResourceService personResourceService; |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备资源表 详情 |
||||||
|
*/ |
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@Operation(summary = "详情", description = "传入mesPersonResource") |
||||||
|
public R<PersonResourceVO> detail(PersonResourceEntity entity) { |
||||||
|
PersonResourceEntity detail = personResourceService.getOne(Condition.getQueryWrapper(entity)); |
||||||
|
return R.data(PersonResourceWrapper.build().entityVO(detail)); |
||||||
|
} |
||||||
|
/** |
||||||
|
* 设备资源表 分页 |
||||||
|
*/ |
||||||
|
@GetMapping("/list") |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@Operation(summary = "分页", description = "传入mesPersonResource") |
||||||
|
public R<IPage<PersonResourceVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> entity, Query query) { |
||||||
|
IPage<PersonResourceEntity> pages = personResourceService.page(Condition.getPage(query), Condition.getQueryWrapper(entity, PersonResourceEntity.class)); |
||||||
|
return R.data(PersonResourceWrapper.build().pageVO(pages)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备资源表 自定义分页 |
||||||
|
*/ |
||||||
|
@GetMapping("/page") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@Operation(summary = "分页", description = "传入mesPersonResource") |
||||||
|
public R<IPage<PersonResourceVO>> page(PersonResourceVO entity, Query query) { |
||||||
|
IPage<PersonResourceVO> pages = personResourceService.selectPersonResourcePage(Condition.getPage(query), entity); |
||||||
|
return R.data(pages); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备资源表 新增 |
||||||
|
*/ |
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
@Operation(summary = "新增", description = "传入mesPersonResource") |
||||||
|
public R save(@Valid @RequestBody PersonResourceEntity entity) { |
||||||
|
return R.status(personResourceService.save(entity)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备资源表 修改 |
||||||
|
*/ |
||||||
|
@PostMapping("/update") |
||||||
|
@ApiOperationSupport(order = 5) |
||||||
|
@Operation(summary = "修改", description = "传入mesPersonResource") |
||||||
|
public R update(@Valid @RequestBody PersonResourceEntity entity) { |
||||||
|
return R.status(personResourceService.updateById(entity)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备资源表 新增或修改 |
||||||
|
*/ |
||||||
|
@PostMapping("/submit") |
||||||
|
@ApiOperationSupport(order = 6) |
||||||
|
@Operation(summary = "新增或修改", description = "传入mesPersonResource") |
||||||
|
public R submit(@Valid @RequestBody PersonResourceEntity entity) { |
||||||
|
return R.status(personResourceService.saveOrUpdate(entity)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 设备资源表 删除 |
||||||
|
*/ |
||||||
|
@PostMapping("/remove") |
||||||
|
@ApiOperationSupport(order = 7) |
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids") |
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
||||||
|
return R.status(personResourceService.deleteLogic(Func.toLongList(ids))); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 导出数据 |
||||||
|
*/ |
||||||
|
@IsAdmin |
||||||
|
@GetMapping("/export") |
||||||
|
@ApiOperationSupport(order = 9) |
||||||
|
@Operation(summary = "导出数据", description = "传入mesPersonResource") |
||||||
|
public void export(@Parameter(hidden = true) @RequestParam Map<String, Object> entity, BladeUser bladeUser, HttpServletResponse response) { |
||||||
|
QueryWrapper<PersonResourceEntity> queryWrapper = Condition.getQueryWrapper(entity, PersonResourceEntity.class); |
||||||
|
List<PersonResourceExcel> list = personResourceService.export(queryWrapper); |
||||||
|
ExcelUtil.export(response, "设备资源表数据" + DateUtil.time(), "设备资源表数据表", list, PersonResourceExcel.class); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("/initPersonResource") |
||||||
|
@ApiOperationSupport(order = 9) |
||||||
|
public void initPersonResource(){ |
||||||
|
personResourceService.initPersonResource(); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,163 @@ |
|||||||
|
/** |
||||||
|
* BladeX Commercial License Agreement |
||||||
|
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||||
|
* <p> |
||||||
|
* Use of this software is governed by the Commercial License Agreement |
||||||
|
* obtained after purchasing a license from BladeX. |
||||||
|
* <p> |
||||||
|
* 1. This software is for development use only under a valid license |
||||||
|
* from BladeX. |
||||||
|
* <p> |
||||||
|
* 2. Redistribution of this software's source code to any third party |
||||||
|
* without a commercial license is strictly prohibited. |
||||||
|
* <p> |
||||||
|
* 3. Licensees may copyright their own code but cannot use segments |
||||||
|
* from this software for such purposes. Copyright of this software |
||||||
|
* remains with BladeX. |
||||||
|
* <p> |
||||||
|
* Using this software signifies agreement to this License, and the software |
||||||
|
* must not be used for illegal purposes. |
||||||
|
* <p> |
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||||
|
* not liable for any claims arising from secondary or illegal development. |
||||||
|
* <p> |
||||||
|
* Author: Chill Zhuang (bladejava@qq.com) |
||||||
|
*/ |
||||||
|
package org.springblade.scheduling.scheduling.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||||
|
import io.swagger.v3.oas.annotations.Parameter; |
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||||
|
import jakarta.servlet.http.HttpServletResponse; |
||||||
|
import jakarta.validation.Valid; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.excel.util.ExcelUtil; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.secure.BladeUser; |
||||||
|
import org.springblade.core.secure.annotation.IsAdmin; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.DateUtil; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.scheduling.scheduling.entity.YieldOrderEntity; |
||||||
|
import org.springblade.scheduling.scheduling.excel.YieldOrderExcel; |
||||||
|
import org.springblade.scheduling.scheduling.service.IYieldOrderService; |
||||||
|
import org.springblade.scheduling.scheduling.vo.YieldOrderVO; |
||||||
|
import org.springblade.scheduling.scheduling.wrapper.YieldOrderWrapper; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* 车间订单表 控制器 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
* @since 2025-11-28 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping("/yieldOrder") |
||||||
|
@Tag(name = "车间订单表", description = "车间订单表接口") |
||||||
|
public class YieldOrderController extends BladeController { |
||||||
|
|
||||||
|
private final IYieldOrderService YieldOrderService; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 车间订单表 详情 |
||||||
|
*/ |
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@Operation(summary = "详情", description = "传入YieldOrder") |
||||||
|
public R<YieldOrderVO> detail(YieldOrderEntity YieldOrder) { |
||||||
|
YieldOrderEntity detail = YieldOrderService.getOne(Condition.getQueryWrapper(YieldOrder)); |
||||||
|
return R.data(YieldOrderWrapper.build().entityVO(detail)); |
||||||
|
} |
||||||
|
/** |
||||||
|
* 车间订单表 分页 |
||||||
|
*/ |
||||||
|
@GetMapping("/list") |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@Operation(summary = "分页", description = "传入YieldOrder") |
||||||
|
public R<IPage<YieldOrderVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> YieldOrder, Query query) { |
||||||
|
IPage<YieldOrderEntity> pages = YieldOrderService.page(Condition.getPage(query), Condition.getQueryWrapper(YieldOrder, YieldOrderEntity.class)); |
||||||
|
return R.data(YieldOrderWrapper.build().pageVO(pages)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 车间订单表 自定义分页 |
||||||
|
*/ |
||||||
|
@GetMapping("/page") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@Operation(summary = "分页", description = "传入YieldOrder") |
||||||
|
public R<IPage<YieldOrderVO>> page(YieldOrderVO YieldOrder, Query query) { |
||||||
|
IPage<YieldOrderVO> pages = YieldOrderService.selectYieldOrderPage(Condition.getPage(query), YieldOrder); |
||||||
|
return R.data(pages); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 车间订单表 新增 |
||||||
|
*/ |
||||||
|
@PostMapping("/save") |
||||||
|
@ApiOperationSupport(order = 4) |
||||||
|
@Operation(summary = "新增", description = "传入YieldOrder") |
||||||
|
public R save(@Valid @RequestBody YieldOrderEntity YieldOrder) { |
||||||
|
return R.status(YieldOrderService.save(YieldOrder)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 车间订单表 修改 |
||||||
|
*/ |
||||||
|
@PostMapping("/update") |
||||||
|
@ApiOperationSupport(order = 5) |
||||||
|
@Operation(summary = "修改", description = "传入YieldOrder") |
||||||
|
public R update(@Valid @RequestBody YieldOrderEntity YieldOrder) { |
||||||
|
return R.status(YieldOrderService.updateById(YieldOrder)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 车间订单表 新增或修改 |
||||||
|
*/ |
||||||
|
@PostMapping("/submit") |
||||||
|
@ApiOperationSupport(order = 6) |
||||||
|
@Operation(summary = "新增或修改", description = "传入YieldOrder") |
||||||
|
public R submit(@Valid @RequestBody YieldOrderEntity YieldOrder) { |
||||||
|
return R.status(YieldOrderService.saveOrUpdate(YieldOrder)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 车间订单表 删除 |
||||||
|
*/ |
||||||
|
@PostMapping("/remove") |
||||||
|
@ApiOperationSupport(order = 7) |
||||||
|
@Operation(summary = "逻辑删除", description = "传入ids") |
||||||
|
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
||||||
|
return R.status(YieldOrderService.deleteLogic(Func.toLongList(ids))); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 导出数据 |
||||||
|
*/ |
||||||
|
@IsAdmin |
||||||
|
@GetMapping("/export") |
||||||
|
@ApiOperationSupport(order = 9) |
||||||
|
@Operation(summary = "导出数据", description = "传入YieldOrder") |
||||||
|
public void exportYieldOrder(@Parameter(hidden = true) @RequestParam Map<String, Object> YieldOrder, BladeUser bladeUser, HttpServletResponse response) { |
||||||
|
QueryWrapper<YieldOrderEntity> queryWrapper = Condition.getQueryWrapper(YieldOrder, YieldOrderEntity.class); |
||||||
|
//if (!AuthUtil.isAdministrator()) {
|
||||||
|
// queryWrapper.lambda().eq(YieldOrder::getTenantId, bladeUser.getTenantId());
|
||||||
|
//}
|
||||||
|
//queryWrapper.lambda().eq(YieldOrderEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||||
|
List<YieldOrderExcel> list = YieldOrderService.export(queryWrapper); |
||||||
|
ExcelUtil.export(response, "车间订单表数据" + DateUtil.time(), "车间订单表数据表", list, YieldOrderExcel.class); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -1,15 +0,0 @@ |
|||||||
package org.springblade.scheduling.scheduling.task; |
|
||||||
|
|
||||||
/** |
|
||||||
* TODO:功能描述 |
|
||||||
* |
|
||||||
* @author sjx |
|
||||||
* @version 1.0 |
|
||||||
* @BelongsProject jonhon-mes-svr |
|
||||||
* @BelongsPackage org.springblade.scheduling.scheduling.task |
|
||||||
* @since 2025-11-27 14:56 |
|
||||||
*/ |
|
||||||
public class EquipResourceJob { |
|
||||||
//查询设备能力
|
|
||||||
//根据设备能力
|
|
||||||
} |
|
||||||
@ -0,0 +1,30 @@ |
|||||||
|
package org.springblade.scheduling.scheduling.task; |
||||||
|
|
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.scheduling.scheduling.service.IEquipResourceService; |
||||||
|
import org.springblade.scheduling.scheduling.service.IPersonResourceService; |
||||||
|
import org.springframework.scheduling.annotation.Scheduled; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
/** |
||||||
|
* TODO:功能描述 |
||||||
|
* |
||||||
|
* @author sjx |
||||||
|
* @version 1.0 |
||||||
|
* @BelongsProject jonhon-mes-svr |
||||||
|
* @BelongsPackage org.springblade.scheduling.scheduling.task |
||||||
|
* @since 2025-11-27 14:56 |
||||||
|
*/ |
||||||
|
@Component |
||||||
|
@AllArgsConstructor |
||||||
|
public class InitResourceJob { |
||||||
|
|
||||||
|
private final IPersonResourceService personResourceService; |
||||||
|
|
||||||
|
private final IEquipResourceService equipResourceService; |
||||||
|
@Scheduled(cron = "* * 1 * * ?") |
||||||
|
public void initResourceJob() { |
||||||
|
equipResourceService.initEquipResource(); |
||||||
|
personResourceService.initPersonResource(); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,28 @@ |
|||||||
|
package org.springblade.scheduling.scheduling.task; |
||||||
|
|
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.scheduling.scheduling.service.IEquipResourceService; |
||||||
|
import org.springblade.scheduling.scheduling.service.IPersonResourceService; |
||||||
|
import org.springblade.scheduling.scheduling.service.IWorkOrderService; |
||||||
|
import org.springframework.scheduling.annotation.Scheduled; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
/** |
||||||
|
* TODO:功能描述 |
||||||
|
* |
||||||
|
* @author sjx |
||||||
|
* @version 1.0 |
||||||
|
* @BelongsProject jonhon-mes-svr |
||||||
|
* @BelongsPackage org.springblade.scheduling.scheduling.task |
||||||
|
* @since 2025-12-10 16:15 |
||||||
|
*/ |
||||||
|
@Component |
||||||
|
@AllArgsConstructor |
||||||
|
public class SchedulingJob { |
||||||
|
private final IWorkOrderService workOrderService; |
||||||
|
|
||||||
|
@Scheduled(cron = "* * 1 * * ?") |
||||||
|
public void schedulingJob() { |
||||||
|
workOrderService.scheduling(); |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue