Explorar el Código

解决参数单位和权限问题

wukai hace 2 meses
padre
commit
4505bc271c

+ 3 - 3
jjt-admin/src/test/java/com/jjt/dye/DyeTest.java

@@ -28,11 +28,11 @@ public class DyeTest {
     private IDyeCalcHourService calcHourService;
     @Resource
     private IDyeHourLineService hourLineService;
-    String st = "2025-11-01";
-    String ed = "2025-11-04";
+    String st = "2025-11-04";
+    String ed = "2025-11-06";
     LocalDate localDate = LocalDate.parse(st);
     LocalDate endDate = LocalDate.parse(ed);
-    LocalDateTime start = LocalDateTime.of(localDate, LocalTime.MIN);
+    LocalDateTime start = LocalDateTime.of(localDate, LocalTime.MIN).plusHours(18);
 
     @Test
     public void calc() {

+ 6 - 6
jjt-biz/src/main/java/com/jjt/dye/controller/DyeCalcHourController.java

@@ -41,7 +41,7 @@ public class DyeCalcHourController extends BaseController{
      * 查询小时统计数据列表
      */
     @ApiOperation("查询小时统计数据列表")
-    @PreAuthorize("@ss.hasPermi('dye:hour:list')")
+   // @PreAuthorize("@ss.hasPermi('dye:hour:list')")
     @GetMapping("/list")
     public TableDataInfo list(DyeCalcHour dyeCalcHour)
     {
@@ -54,7 +54,7 @@ public class DyeCalcHourController extends BaseController{
      * 导出小时统计数据列表
      */
     @ApiOperation("导出小时统计数据列表")
-    @PreAuthorize("@ss.hasPermi('dye:hour:export')")
+   // @PreAuthorize("@ss.hasPermi('dye:hour:export')")
     @Log(title = "小时统计数据", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, DyeCalcHour dyeCalcHour)
@@ -68,7 +68,7 @@ public class DyeCalcHourController extends BaseController{
      * 获取小时统计数据详细信息
      */
     @ApiOperation("获取小时统计数据详细信息")
-    @PreAuthorize("@ss.hasPermi('dye:hour:query')")
+   // @PreAuthorize("@ss.hasPermi('dye:hour:query')")
     @GetMapping(value = "/{chId}")
     public AjaxResult getInfo(@PathVariable("chId") Long chId)
     {
@@ -79,7 +79,7 @@ public class DyeCalcHourController extends BaseController{
      * 新增小时统计数据
      */
     @ApiOperation("新增小时统计数据")
-    @PreAuthorize("@ss.hasPermi('dye:hour:add')")
+   // @PreAuthorize("@ss.hasPermi('dye:hour:add')")
     @Log(title = "小时统计数据", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody DyeCalcHour dyeCalcHour)
@@ -91,7 +91,7 @@ public class DyeCalcHourController extends BaseController{
      * 修改小时统计数据
      */
     @ApiOperation("修改小时统计数据")
-    @PreAuthorize("@ss.hasPermi('dye:hour:edit')")
+   // @PreAuthorize("@ss.hasPermi('dye:hour:edit')")
     @Log(title = "小时统计数据", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody DyeCalcHour dyeCalcHour)
@@ -103,7 +103,7 @@ public class DyeCalcHourController extends BaseController{
      * 删除小时统计数据
      */
     @ApiOperation("删除小时统计数据")
-    @PreAuthorize("@ss.hasPermi('dye:hour:remove')")
+   // @PreAuthorize("@ss.hasPermi('dye:hour:remove')")
     @Log(title = "小时统计数据", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{chIds}")
     public AjaxResult remove(@PathVariable Long[] chIds)

+ 6 - 6
jjt-biz/src/main/java/com/jjt/dye/controller/DyeDeviceController.java

@@ -41,7 +41,7 @@ public class DyeDeviceController extends BaseController{
      * 查询染整线设备管理列表
      */
     @ApiOperation("查询染整线设备管理列表")
-    @PreAuthorize("@ss.hasPermi('dye:device:list')")
+   // @PreAuthorize("@ss.hasPermi('dye:device:list')")
     @GetMapping("/list")
     public TableDataInfo list(DyeDevice dyeDevice)
     {
@@ -54,7 +54,7 @@ public class DyeDeviceController extends BaseController{
      * 导出染整线设备管理列表
      */
     @ApiOperation("导出染整线设备管理列表")
-    @PreAuthorize("@ss.hasPermi('dye:device:export')")
+   // @PreAuthorize("@ss.hasPermi('dye:device:export')")
     @Log(title = "染整线设备管理", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, DyeDevice dyeDevice)
@@ -68,7 +68,7 @@ public class DyeDeviceController extends BaseController{
      * 获取染整线设备管理详细信息
      */
     @ApiOperation("获取染整线设备管理详细信息")
-    @PreAuthorize("@ss.hasPermi('dye:device:query')")
+   // @PreAuthorize("@ss.hasPermi('dye:device:query')")
     @GetMapping(value = "/{deviceId}")
     public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId)
     {
@@ -79,7 +79,7 @@ public class DyeDeviceController extends BaseController{
      * 新增染整线设备管理
      */
     @ApiOperation("新增染整线设备管理")
-    @PreAuthorize("@ss.hasPermi('dye:device:add')")
+   // @PreAuthorize("@ss.hasPermi('dye:device:add')")
     @Log(title = "染整线设备管理", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody DyeDevice dyeDevice)
@@ -91,7 +91,7 @@ public class DyeDeviceController extends BaseController{
      * 修改染整线设备管理
      */
     @ApiOperation("修改染整线设备管理")
-    @PreAuthorize("@ss.hasPermi('dye:device:edit')")
+   // @PreAuthorize("@ss.hasPermi('dye:device:edit')")
     @Log(title = "染整线设备管理", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody DyeDevice dyeDevice)
@@ -103,7 +103,7 @@ public class DyeDeviceController extends BaseController{
      * 删除染整线设备管理
      */
     @ApiOperation("删除染整线设备管理")
-    @PreAuthorize("@ss.hasPermi('dye:device:remove')")
+   // @PreAuthorize("@ss.hasPermi('dye:device:remove')")
     @Log(title = "染整线设备管理", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{deviceIds}")
     public AjaxResult remove(@PathVariable Long[] deviceIds)

+ 6 - 6
jjt-biz/src/main/java/com/jjt/dye/controller/DyeEnergyController.java

@@ -41,7 +41,7 @@ public class DyeEnergyController extends BaseController{
      * 查询染整线能源基础管理列表
      */
     @ApiOperation("查询染整线能源基础管理列表")
-    @PreAuthorize("@ss.hasPermi('dye:energy:list')")
+   // @PreAuthorize("@ss.hasPermi('dye:energy:list')")
     @GetMapping("/list")
     public TableDataInfo list(DyeEnergy dyeEnergy)
     {
@@ -54,7 +54,7 @@ public class DyeEnergyController extends BaseController{
      * 导出染整线能源基础管理列表
      */
     @ApiOperation("导出染整线能源基础管理列表")
-    @PreAuthorize("@ss.hasPermi('dye:energy:export')")
+   // @PreAuthorize("@ss.hasPermi('dye:energy:export')")
     @Log(title = "染整线能源基础管理", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, DyeEnergy dyeEnergy)
@@ -68,7 +68,7 @@ public class DyeEnergyController extends BaseController{
      * 获取染整线能源基础管理详细信息
      */
     @ApiOperation("获取染整线能源基础管理详细信息")
-    @PreAuthorize("@ss.hasPermi('dye:energy:query')")
+   // @PreAuthorize("@ss.hasPermi('dye:energy:query')")
     @GetMapping(value = "/{engId}")
     public AjaxResult getInfo(@PathVariable("engId") Long engId)
     {
@@ -79,7 +79,7 @@ public class DyeEnergyController extends BaseController{
      * 新增染整线能源基础管理
      */
     @ApiOperation("新增染整线能源基础管理")
-    @PreAuthorize("@ss.hasPermi('dye:energy:add')")
+   // @PreAuthorize("@ss.hasPermi('dye:energy:add')")
     @Log(title = "染整线能源基础管理", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody DyeEnergy dyeEnergy)
@@ -91,7 +91,7 @@ public class DyeEnergyController extends BaseController{
      * 修改染整线能源基础管理
      */
     @ApiOperation("修改染整线能源基础管理")
-    @PreAuthorize("@ss.hasPermi('dye:energy:edit')")
+   // @PreAuthorize("@ss.hasPermi('dye:energy:edit')")
     @Log(title = "染整线能源基础管理", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody DyeEnergy dyeEnergy)
@@ -103,7 +103,7 @@ public class DyeEnergyController extends BaseController{
      * 删除染整线能源基础管理
      */
     @ApiOperation("删除染整线能源基础管理")
-    @PreAuthorize("@ss.hasPermi('dye:energy:remove')")
+   // @PreAuthorize("@ss.hasPermi('dye:energy:remove')")
     @Log(title = "染整线能源基础管理", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{engIds}")
     public AjaxResult remove(@PathVariable Long[] engIds)

+ 6 - 6
jjt-biz/src/main/java/com/jjt/dye/controller/DyeHourLineController.java

@@ -41,7 +41,7 @@ public class DyeHourLineController extends BaseController{
      * 查询产线小时统计数据列表
      */
     @ApiOperation("查询产线小时统计数据列表")
-    @PreAuthorize("@ss.hasPermi('dye:line:list')")
+   // @PreAuthorize("@ss.hasPermi('dye:line:list')")
     @GetMapping("/list")
     public TableDataInfo list(DyeHourLine dyeHourLine)
     {
@@ -54,7 +54,7 @@ public class DyeHourLineController extends BaseController{
      * 导出产线小时统计数据列表
      */
     @ApiOperation("导出产线小时统计数据列表")
-    @PreAuthorize("@ss.hasPermi('dye:line:export')")
+   // @PreAuthorize("@ss.hasPermi('dye:line:export')")
     @Log(title = "产线小时统计数据", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, DyeHourLine dyeHourLine)
@@ -68,7 +68,7 @@ public class DyeHourLineController extends BaseController{
      * 获取产线小时统计数据详细信息
      */
     @ApiOperation("获取产线小时统计数据详细信息")
-    @PreAuthorize("@ss.hasPermi('dye:line:query')")
+   // @PreAuthorize("@ss.hasPermi('dye:line:query')")
     @GetMapping(value = "/{hourLineId}")
     public AjaxResult getInfo(@PathVariable("hourLineId") Long hourLineId)
     {
@@ -79,7 +79,7 @@ public class DyeHourLineController extends BaseController{
      * 新增产线小时统计数据
      */
     @ApiOperation("新增产线小时统计数据")
-    @PreAuthorize("@ss.hasPermi('dye:line:add')")
+   // @PreAuthorize("@ss.hasPermi('dye:line:add')")
     @Log(title = "产线小时统计数据", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody DyeHourLine dyeHourLine)
@@ -91,7 +91,7 @@ public class DyeHourLineController extends BaseController{
      * 修改产线小时统计数据
      */
     @ApiOperation("修改产线小时统计数据")
-    @PreAuthorize("@ss.hasPermi('dye:line:edit')")
+   // @PreAuthorize("@ss.hasPermi('dye:line:edit')")
     @Log(title = "产线小时统计数据", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody DyeHourLine dyeHourLine)
@@ -103,7 +103,7 @@ public class DyeHourLineController extends BaseController{
      * 删除产线小时统计数据
      */
     @ApiOperation("删除产线小时统计数据")
-    @PreAuthorize("@ss.hasPermi('dye:line:remove')")
+   // @PreAuthorize("@ss.hasPermi('dye:line:remove')")
     @Log(title = "产线小时统计数据", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{hourLineIds}")
     public AjaxResult remove(@PathVariable Long[] hourLineIds)

+ 6 - 6
jjt-biz/src/main/java/com/jjt/dye/controller/DyeTypeController.java

@@ -41,7 +41,7 @@ public class DyeTypeController extends BaseController{
      * 查询染整线设备类型管理列表
      */
     @ApiOperation("查询染整线设备类型管理列表")
-    @PreAuthorize("@ss.hasPermi('dye:type:list')")
+   // @PreAuthorize("@ss.hasPermi('dye:type:list')")
     @GetMapping("/list")
     public TableDataInfo list(DyeType dyeType)
     {
@@ -54,7 +54,7 @@ public class DyeTypeController extends BaseController{
      * 导出染整线设备类型管理列表
      */
     @ApiOperation("导出染整线设备类型管理列表")
-    @PreAuthorize("@ss.hasPermi('dye:type:export')")
+   // @PreAuthorize("@ss.hasPermi('dye:type:export')")
     @Log(title = "染整线设备类型管理", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, DyeType dyeType)
@@ -68,7 +68,7 @@ public class DyeTypeController extends BaseController{
      * 获取染整线设备类型管理详细信息
      */
     @ApiOperation("获取染整线设备类型管理详细信息")
-    @PreAuthorize("@ss.hasPermi('dye:type:query')")
+   // @PreAuthorize("@ss.hasPermi('dye:type:query')")
     @GetMapping(value = "/{typeId}")
     public AjaxResult getInfo(@PathVariable("typeId") Long typeId)
     {
@@ -79,7 +79,7 @@ public class DyeTypeController extends BaseController{
      * 新增染整线设备类型管理
      */
     @ApiOperation("新增染整线设备类型管理")
-    @PreAuthorize("@ss.hasPermi('dye:type:add')")
+   // @PreAuthorize("@ss.hasPermi('dye:type:add')")
     @Log(title = "染整线设备类型管理", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody DyeType dyeType)
@@ -91,7 +91,7 @@ public class DyeTypeController extends BaseController{
      * 修改染整线设备类型管理
      */
     @ApiOperation("修改染整线设备类型管理")
-    @PreAuthorize("@ss.hasPermi('dye:type:edit')")
+   // @PreAuthorize("@ss.hasPermi('dye:type:edit')")
     @Log(title = "染整线设备类型管理", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody DyeType dyeType)
@@ -103,7 +103,7 @@ public class DyeTypeController extends BaseController{
      * 删除染整线设备类型管理
      */
     @ApiOperation("删除染整线设备类型管理")
-    @PreAuthorize("@ss.hasPermi('dye:type:remove')")
+   // @PreAuthorize("@ss.hasPermi('dye:type:remove')")
     @Log(title = "染整线设备类型管理", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{typeIds}")
     public AjaxResult remove(@PathVariable Long[] typeIds)

+ 1 - 0
jjt-biz/src/main/java/com/jjt/dye/service/impl/DyeTypeServiceImpl.java

@@ -53,6 +53,7 @@ public class DyeTypeServiceImpl implements IDyeTypeService {
             DyeTypePara para = new DyeTypePara();
             para.setParaCode(energy.getEngCode());
             para.setParaName(energy.getEngName());
+            para.setUpdatedBy(energy.getUpdatedBy());
             paras.add(para);
         });
         list.forEach(type -> {

+ 7 - 3
jjt-biz/src/main/java/com/jjt/task/YhjTask.java

@@ -2,6 +2,7 @@ package com.jjt.task;
 
 import com.jjt.calc.service.ITwinCalcDayYhjService;
 import com.jjt.calc.service.ITwinCalcHourYhjService;
+import com.jjt.dye.service.IDyeCalcHourService;
 import com.jjt.dyeing.service.IDyeingHourAvgService;
 import com.jjt.dyeing.service.IDyeingHourEnergyService;
 import com.jjt.dyeing.service.IDyeingHourLineService;
@@ -31,6 +32,8 @@ public class YhjTask {
     private IDyeingHourEnergyService energyService;
     @Resource
     private IDyeingHourLineService lineService;
+    @Resource
+    private IDyeCalcHourService dyeCalcHourService;
 
     /**
      * 统计上一时段数据
@@ -45,9 +48,10 @@ public class YhjTask {
             rzService.last();
         } catch (Exception ignored) {
         }
-        avgService.calcLastHour();
-        energyService.calcLastHour();
-        lineService.calcLastHour();
+        dyeCalcHourService.calcLastHour();
+//        avgService.calcLastHour();
+//        energyService.calcLastHour();
+//        lineService.calcLastHour();
     }
 
     /**