From 12f376e4468e856df7548bc0826256f698adf277 Mon Sep 17 00:00:00 2001 From: houshuai <17802598606@163.com> Date: 星期二, 15 七月 2025 20:29:12 +0800 Subject: [PATCH] 安灯模块开发 --- src/main/java/org/jeecg/modules/andon/mapper/AndonOrderMapper.java | 17 src/main/java/org/jeecg/modules/andon/service/impl/AndonButtonConfigServiceImpl.java | 22 + src/main/java/org/jeecg/modules/andon/controller/AndonResponseConfigController.java | 161 ++++++++ src/main/java/org/jeecg/modules/andon/mapper/xml/AndonOrderMapper.xml | 7 src/main/java/org/jeecg/modules/andon/service/impl/AndonResponseConfigServiceImpl.java | 22 + src/main/java/org/jeecg/modules/quartz/job/AndonJob.java | 137 +++++++ src/main/java/org/jeecg/modules/andon/service/IAndonOrderService.java | 17 src/main/java/org/jeecg/modules/andon/entity/AndonResponseConfig.java | 81 ++++ src/main/java/org/jeecg/modules/andon/service/IAndonResponseConfigService.java | 14 src/main/java/org/jeecg/modules/andon/entity/AndonButtonConfig.java | 92 ++++ src/main/java/org/jeecg/modules/andon/controller/AndonButtonConfigController.java | 161 ++++++++ src/main/java/org/jeecg/modules/andon/mapper/xml/AndonButtonConfigMapper.xml | 7 src/main/java/org/jeecg/modules/andon/entity/AndonOrder.java | 121 ++++++ src/main/java/org/jeecg/modules/andon/mapper/AndonButtonConfigMapper.java | 15 src/main/java/org/jeecg/modules/andon/mapper/xml/AndonResponseConfigMapper.xml | 7 src/main/java/org/jeecg/modules/andon/controller/AndonOrderController.java | 161 ++++++++ src/main/java/org/jeecg/modules/andon/service/IAndonButtonConfigService.java | 14 src/main/java/org/jeecg/modules/andon/service/impl/AndonOrderServiceImpl.java | 24 + src/main/java/org/jeecg/modules/andon/mapper/AndonResponseConfigMapper.java | 15 19 files changed, 1,095 insertions(+), 0 deletions(-) diff --git a/src/main/java/org/jeecg/modules/andon/controller/AndonButtonConfigController.java b/src/main/java/org/jeecg/modules/andon/controller/AndonButtonConfigController.java new file mode 100644 index 0000000..be0c78d --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/controller/AndonButtonConfigController.java @@ -0,0 +1,161 @@ +package org.jeecg.modules.andon.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.andon.entity.AndonButtonConfig; +import org.jeecg.modules.andon.service.IAndonButtonConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** +* @Description: 瀹夌伅鎸夐挳閰嶇疆 +* @Author: jeecg-boot +* @Date: 2025-07-10 +* @Version: V1.0 +*/ +@Api(tags="瀹夌伅鎸夐挳閰嶇疆") +@RestController +@RequestMapping("/andonbuttonconfig/andonButtonConfig") +@Slf4j +public class AndonButtonConfigController extends JeecgController<AndonButtonConfig, IAndonButtonConfigService> { + @Autowired + private IAndonButtonConfigService andonButtonConfigService; + + /** + * 鍒嗛〉鍒楄〃鏌ヨ + * + * @param andonButtonConfig + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "瀹夌伅鎸夐挳閰嶇疆-鍒嗛〉鍒楄〃鏌ヨ") + @ApiOperation(value="瀹夌伅鎸夐挳閰嶇疆-鍒嗛〉鍒楄〃鏌ヨ", notes="瀹夌伅鎸夐挳閰嶇疆-鍒嗛〉鍒楄〃鏌ヨ") + @GetMapping(value = "/list") + public Result<IPage<AndonButtonConfig>> queryPageList(AndonButtonConfig andonButtonConfig, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper<AndonButtonConfig> queryWrapper = QueryGenerator.initQueryWrapper(andonButtonConfig, req.getParameterMap()); + Page<AndonButtonConfig> page = new Page<AndonButtonConfig>(pageNo, pageSize); + IPage<AndonButtonConfig> pageList = andonButtonConfigService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 娣诲姞 + * + * @param andonButtonConfig + * @return + */ + @AutoLog(value = "瀹夌伅鎸夐挳閰嶇疆-娣诲姞") + @ApiOperation(value="瀹夌伅鎸夐挳閰嶇疆-娣诲姞", notes="瀹夌伅鎸夐挳閰嶇疆-娣诲姞") + //@RequiresPermissions("org.jeecg.modules:andon_button_config:add") + @PostMapping(value = "/add") + public Result<String> add(@RequestBody AndonButtonConfig andonButtonConfig) { + andonButtonConfigService.save(andonButtonConfig); + return Result.OK("娣诲姞鎴愬姛锛�"); + } + + /** + * 缂栬緫 + * + * @param andonButtonConfig + * @return + */ + @AutoLog(value = "瀹夌伅鎸夐挳閰嶇疆-缂栬緫") + @ApiOperation(value="瀹夌伅鎸夐挳閰嶇疆-缂栬緫", notes="瀹夌伅鎸夐挳閰嶇疆-缂栬緫") + //@RequiresPermissions("org.jeecg.modules:andon_button_config:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result<String> edit(@RequestBody AndonButtonConfig andonButtonConfig) { + andonButtonConfigService.updateById(andonButtonConfig); + return Result.OK("缂栬緫鎴愬姛!"); + } + + /** + * 閫氳繃id鍒犻櫎 + * + * @param id + * @return + */ + @AutoLog(value = "瀹夌伅鎸夐挳閰嶇疆-閫氳繃id鍒犻櫎") + @ApiOperation(value="瀹夌伅鎸夐挳閰嶇疆-閫氳繃id鍒犻櫎", notes="瀹夌伅鎸夐挳閰嶇疆-閫氳繃id鍒犻櫎") + //@RequiresPermissions("org.jeecg.modules:andon_button_config:delete") + @DeleteMapping(value = "/delete") + public Result<String> delete(@RequestParam(name="id",required=true) String id) { + andonButtonConfigService.removeById(id); + return Result.OK("鍒犻櫎鎴愬姛!"); + } + + /** + * 鎵归噺鍒犻櫎 + * + * @param ids + * @return + */ + @AutoLog(value = "瀹夌伅鎸夐挳閰嶇疆-鎵归噺鍒犻櫎") + @ApiOperation(value="瀹夌伅鎸夐挳閰嶇疆-鎵归噺鍒犻櫎", notes="瀹夌伅鎸夐挳閰嶇疆-鎵归噺鍒犻櫎") + //@RequiresPermissions("org.jeecg.modules:andon_button_config:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.andonButtonConfigService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("鎵归噺鍒犻櫎鎴愬姛!"); + } + + /** + * 閫氳繃id鏌ヨ + * + * @param id + * @return + */ + //@AutoLog(value = "瀹夌伅鎸夐挳閰嶇疆-閫氳繃id鏌ヨ") + @ApiOperation(value="瀹夌伅鎸夐挳閰嶇疆-閫氳繃id鏌ヨ", notes="瀹夌伅鎸夐挳閰嶇疆-閫氳繃id鏌ヨ") + @GetMapping(value = "/queryById") + public Result<AndonButtonConfig> queryById(@RequestParam(name="id",required=true) String id) { + AndonButtonConfig andonButtonConfig = andonButtonConfigService.getById(id); + if(andonButtonConfig==null) { + return Result.error("鏈壘鍒板搴旀暟鎹�"); + } + return Result.OK(andonButtonConfig); + } + + /** + * 瀵煎嚭excel + * + * @param request + * @param andonButtonConfig + */ + //@RequiresPermissions("org.jeecg.modules:andon_button_config:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AndonButtonConfig andonButtonConfig) { + return super.exportXls(request, andonButtonConfig, AndonButtonConfig.class, "瀹夌伅鎸夐挳閰嶇疆"); + } + + /** + * 閫氳繃excel瀵煎叆鏁版嵁 + * + * @param request + * @param response + * @return + */ + //@RequiresPermissions("andon_button_config:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AndonButtonConfig.class); + } + +} diff --git a/src/main/java/org/jeecg/modules/andon/controller/AndonOrderController.java b/src/main/java/org/jeecg/modules/andon/controller/AndonOrderController.java new file mode 100644 index 0000000..ae59140 --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/controller/AndonOrderController.java @@ -0,0 +1,161 @@ +package org.jeecg.modules.andon.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.andon.entity.AndonOrder; +import org.jeecg.modules.andon.service.IAndonOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** +* @Description: 瀹夌伅宸ュ崟 +* @Author: jeecg-boot +* @Date: 2025-07-10 +* @Version: V1.0 +*/ +@Api(tags="瀹夌伅宸ュ崟") +@RestController +@RequestMapping("/andonorder/andonOrder") +@Slf4j +public class AndonOrderController extends JeecgController<AndonOrder, IAndonOrderService> { + @Autowired + private IAndonOrderService andonOrderService; + + /** + * 鍒嗛〉鍒楄〃鏌ヨ + * + * @param andonOrder + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "瀹夌伅宸ュ崟-鍒嗛〉鍒楄〃鏌ヨ") + @ApiOperation(value="瀹夌伅宸ュ崟-鍒嗛〉鍒楄〃鏌ヨ", notes="瀹夌伅宸ュ崟-鍒嗛〉鍒楄〃鏌ヨ") + @GetMapping(value = "/list") + public Result<IPage<AndonOrder>> queryPageList(AndonOrder andonOrder, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper<AndonOrder> queryWrapper = QueryGenerator.initQueryWrapper(andonOrder, req.getParameterMap()); + Page<AndonOrder> page = new Page<AndonOrder>(pageNo, pageSize); + IPage<AndonOrder> pageList = andonOrderService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 娣诲姞 + * + * @param andonOrder + * @return + */ + @AutoLog(value = "瀹夌伅宸ュ崟-娣诲姞") + @ApiOperation(value="瀹夌伅宸ュ崟-娣诲姞", notes="瀹夌伅宸ュ崟-娣诲姞") + //@RequiresPermissions("org.jeecg.modules:andon_order:add") + @PostMapping(value = "/add") + public Result<String> add(@RequestBody AndonOrder andonOrder) { + andonOrderService.save(andonOrder); + return Result.OK("娣诲姞鎴愬姛锛�"); + } + + /** + * 缂栬緫 + * + * @param andonOrder + * @return + */ + @AutoLog(value = "瀹夌伅宸ュ崟-缂栬緫") + @ApiOperation(value="瀹夌伅宸ュ崟-缂栬緫", notes="瀹夌伅宸ュ崟-缂栬緫") + //@RequiresPermissions("org.jeecg.modules:andon_order:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result<String> edit(@RequestBody AndonOrder andonOrder) { + andonOrderService.updateById(andonOrder); + return Result.OK("缂栬緫鎴愬姛!"); + } + + /** + * 閫氳繃id鍒犻櫎 + * + * @param id + * @return + */ + @AutoLog(value = "瀹夌伅宸ュ崟-閫氳繃id鍒犻櫎") + @ApiOperation(value="瀹夌伅宸ュ崟-閫氳繃id鍒犻櫎", notes="瀹夌伅宸ュ崟-閫氳繃id鍒犻櫎") + //@RequiresPermissions("org.jeecg.modules:andon_order:delete") + @DeleteMapping(value = "/delete") + public Result<String> delete(@RequestParam(name="id",required=true) String id) { + andonOrderService.removeById(id); + return Result.OK("鍒犻櫎鎴愬姛!"); + } + + /** + * 鎵归噺鍒犻櫎 + * + * @param ids + * @return + */ + @AutoLog(value = "瀹夌伅宸ュ崟-鎵归噺鍒犻櫎") + @ApiOperation(value="瀹夌伅宸ュ崟-鎵归噺鍒犻櫎", notes="瀹夌伅宸ュ崟-鎵归噺鍒犻櫎") + //@RequiresPermissions("org.jeecg.modules:andon_order:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.andonOrderService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("鎵归噺鍒犻櫎鎴愬姛!"); + } + + /** + * 閫氳繃id鏌ヨ + * + * @param id + * @return + */ + //@AutoLog(value = "瀹夌伅宸ュ崟-閫氳繃id鏌ヨ") + @ApiOperation(value="瀹夌伅宸ュ崟-閫氳繃id鏌ヨ", notes="瀹夌伅宸ュ崟-閫氳繃id鏌ヨ") + @GetMapping(value = "/queryById") + public Result<AndonOrder> queryById(@RequestParam(name="id",required=true) String id) { + AndonOrder andonOrder = andonOrderService.getById(id); + if(andonOrder==null) { + return Result.error("鏈壘鍒板搴旀暟鎹�"); + } + return Result.OK(andonOrder); + } + + /** + * 瀵煎嚭excel + * + * @param request + * @param andonOrder + */ + //@RequiresPermissions("org.jeecg.modules:andon_order:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AndonOrder andonOrder) { + return super.exportXls(request, andonOrder, AndonOrder.class, "瀹夌伅宸ュ崟"); + } + + /** + * 閫氳繃excel瀵煎叆鏁版嵁 + * + * @param request + * @param response + * @return + */ + //@RequiresPermissions("andon_order:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AndonOrder.class); + } + +} diff --git a/src/main/java/org/jeecg/modules/andon/controller/AndonResponseConfigController.java b/src/main/java/org/jeecg/modules/andon/controller/AndonResponseConfigController.java new file mode 100644 index 0000000..1798af8 --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/controller/AndonResponseConfigController.java @@ -0,0 +1,161 @@ +package org.jeecg.modules.andon.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.andon.entity.AndonResponseConfig; +import org.jeecg.modules.andon.service.IAndonResponseConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** +* @Description: 瀹夌伅鍝嶅簲閰嶇疆 +* @Author: jeecg-boot +* @Date: 2025-07-10 +* @Version: V1.0 +*/ +@Api(tags="瀹夌伅鍝嶅簲閰嶇疆") +@RestController +@RequestMapping("/andonresponseconfig/andonResponseConfig") +@Slf4j +public class AndonResponseConfigController extends JeecgController<AndonResponseConfig, IAndonResponseConfigService> { + @Autowired + private IAndonResponseConfigService andonResponseConfigService; + + /** + * 鍒嗛〉鍒楄〃鏌ヨ + * + * @param andonResponseConfig + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "瀹夌伅鍝嶅簲閰嶇疆-鍒嗛〉鍒楄〃鏌ヨ") + @ApiOperation(value="瀹夌伅鍝嶅簲閰嶇疆-鍒嗛〉鍒楄〃鏌ヨ", notes="瀹夌伅鍝嶅簲閰嶇疆-鍒嗛〉鍒楄〃鏌ヨ") + @GetMapping(value = "/list") + public Result<IPage<AndonResponseConfig>> queryPageList(AndonResponseConfig andonResponseConfig, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper<AndonResponseConfig> queryWrapper = QueryGenerator.initQueryWrapper(andonResponseConfig, req.getParameterMap()); + Page<AndonResponseConfig> page = new Page<AndonResponseConfig>(pageNo, pageSize); + IPage<AndonResponseConfig> pageList = andonResponseConfigService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 娣诲姞 + * + * @param andonResponseConfig + * @return + */ + @AutoLog(value = "瀹夌伅鍝嶅簲閰嶇疆-娣诲姞") + @ApiOperation(value="瀹夌伅鍝嶅簲閰嶇疆-娣诲姞", notes="瀹夌伅鍝嶅簲閰嶇疆-娣诲姞") + //@RequiresPermissions("org.jeecg.modules:andon_response_config:add") + @PostMapping(value = "/add") + public Result<String> add(@RequestBody AndonResponseConfig andonResponseConfig) { + andonResponseConfigService.save(andonResponseConfig); + return Result.OK("娣诲姞鎴愬姛锛�"); + } + + /** + * 缂栬緫 + * + * @param andonResponseConfig + * @return + */ + @AutoLog(value = "瀹夌伅鍝嶅簲閰嶇疆-缂栬緫") + @ApiOperation(value="瀹夌伅鍝嶅簲閰嶇疆-缂栬緫", notes="瀹夌伅鍝嶅簲閰嶇疆-缂栬緫") + //@RequiresPermissions("org.jeecg.modules:andon_response_config:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result<String> edit(@RequestBody AndonResponseConfig andonResponseConfig) { + andonResponseConfigService.updateById(andonResponseConfig); + return Result.OK("缂栬緫鎴愬姛!"); + } + + /** + * 閫氳繃id鍒犻櫎 + * + * @param id + * @return + */ + @AutoLog(value = "瀹夌伅鍝嶅簲閰嶇疆-閫氳繃id鍒犻櫎") + @ApiOperation(value="瀹夌伅鍝嶅簲閰嶇疆-閫氳繃id鍒犻櫎", notes="瀹夌伅鍝嶅簲閰嶇疆-閫氳繃id鍒犻櫎") + //@RequiresPermissions("org.jeecg.modules:andon_response_config:delete") + @DeleteMapping(value = "/delete") + public Result<String> delete(@RequestParam(name="id",required=true) String id) { + andonResponseConfigService.removeById(id); + return Result.OK("鍒犻櫎鎴愬姛!"); + } + + /** + * 鎵归噺鍒犻櫎 + * + * @param ids + * @return + */ + @AutoLog(value = "瀹夌伅鍝嶅簲閰嶇疆-鎵归噺鍒犻櫎") + @ApiOperation(value="瀹夌伅鍝嶅簲閰嶇疆-鎵归噺鍒犻櫎", notes="瀹夌伅鍝嶅簲閰嶇疆-鎵归噺鍒犻櫎") + //@RequiresPermissions("org.jeecg.modules:andon_response_config:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.andonResponseConfigService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("鎵归噺鍒犻櫎鎴愬姛!"); + } + + /** + * 閫氳繃id鏌ヨ + * + * @param id + * @return + */ + //@AutoLog(value = "瀹夌伅鍝嶅簲閰嶇疆-閫氳繃id鏌ヨ") + @ApiOperation(value="瀹夌伅鍝嶅簲閰嶇疆-閫氳繃id鏌ヨ", notes="瀹夌伅鍝嶅簲閰嶇疆-閫氳繃id鏌ヨ") + @GetMapping(value = "/queryById") + public Result<AndonResponseConfig> queryById(@RequestParam(name="id",required=true) String id) { + AndonResponseConfig andonResponseConfig = andonResponseConfigService.getById(id); + if(andonResponseConfig==null) { + return Result.error("鏈壘鍒板搴旀暟鎹�"); + } + return Result.OK(andonResponseConfig); + } + + /** + * 瀵煎嚭excel + * + * @param request + * @param andonResponseConfig + */ + //@RequiresPermissions("org.jeecg.modules:andon_response_config:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AndonResponseConfig andonResponseConfig) { + return super.exportXls(request, andonResponseConfig, AndonResponseConfig.class, "瀹夌伅鍝嶅簲閰嶇疆"); + } + + /** + * 閫氳繃excel瀵煎叆鏁版嵁 + * + * @param request + * @param response + * @return + */ + //@RequiresPermissions("andon_response_config:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AndonResponseConfig.class); + } + +} diff --git a/src/main/java/org/jeecg/modules/andon/entity/AndonButtonConfig.java b/src/main/java/org/jeecg/modules/andon/entity/AndonButtonConfig.java new file mode 100644 index 0000000..48eeeee --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/entity/AndonButtonConfig.java @@ -0,0 +1,92 @@ +package org.jeecg.modules.andon.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecg.common.aspect.annotation.Dict; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description: 瀹夌伅鎸夐挳閰嶇疆 + * @Author: jeecg-boot + * @Date: 2025-07-10 + * @Version: V1.0 + */ +@Data +@TableName("andon_button_config") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="andon_button_config瀵硅薄", description="瀹夌伅鎸夐挳閰嶇疆") +public class AndonButtonConfig implements Serializable { + private static final long serialVersionUID = 1L; + + /**涓婚敭*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "涓婚敭") + private String id; + /**鍒涘缓浜�*/ + @ApiModelProperty(value = "鍒涘缓浜�") + private String createBy; + /**鍒涘缓鏃ユ湡*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "鍒涘缓鏃ユ湡") + private Date createTime; + /**鏇存柊浜�*/ + @ApiModelProperty(value = "鏇存柊浜�") + private String updateBy; + /**鏇存柊鏃ユ湡*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "鏇存柊鏃ユ湡") + private Date updateTime; + /**鍒犻櫎鏍囪*/ + @Excel(name = "鍒犻櫎鏍囪", width = 15) + @ApiModelProperty(value = "鍒犻櫎鏍囪") + @TableLogic + private Integer delFlag; + /**瀹夌伅鍚嶇О*/ + @Excel(name = "瀹夌伅鍚嶇О", width = 15) + @ApiModelProperty(value = "瀹夌伅鍚嶇О") + private String buttonName; + /**瀹夌伅缂栫爜*/ + @Excel(name = "瀹夌伅缂栫爜", width = 15) + @ApiModelProperty(value = "瀹夌伅缂栫爜") + private String buttonCode; + /**鍗囩骇鍝嶅簲鏃堕暱(鍒嗛挓)*/ + @Excel(name = "鍗囩骇鍝嶅簲鏃堕暱(鍒嗛挓)", width = 15) + @ApiModelProperty(value = "鍗囩骇鍝嶅簲鏃堕暱(鍒嗛挓)") + private Integer upgradeResponseDuration; + /**鍗囩骇澶勭悊鏃堕暱(鍒嗛挓)*/ + @Excel(name = "鍗囩骇澶勭悊鏃堕暱(鍒嗛挓)", width = 15) + @ApiModelProperty(value = "鍗囩骇澶勭悊鏃堕暱(鍒嗛挓)") + private Integer upgradeProcessDuration; + /**浜屾鍗囩骇鍝嶅簲鏃堕暱(鍒嗛挓)*/ + @Excel(name = "浜屾鍗囩骇鍝嶅簲鏃堕暱(鍒嗛挓)", width = 15) + @ApiModelProperty(value = "浜屾鍗囩骇鍝嶅簲鏃堕暱(鍒嗛挓)") + private Integer secondUpgradeResponseDuration; + /**浜屾鍗囩骇澶勭悊鏃堕暱(鍒嗛挓)*/ + @Excel(name = "浜屾鍗囩骇澶勭悊鏃堕暱(鍒嗛挓)", width = 15) + @ApiModelProperty(value = "浜屾鍗囩骇澶勭悊鏃堕暱(鍒嗛挓)") + private Integer secondUpgradeProcessDuration; + /**瀹夌伅鎸夐挳鐘舵��*/ + @Excel(name = "瀹夌伅鎸夐挳鐘舵��", width = 15, dicCode = "button_status") + @Dict(dicCode = "button_status") + @ApiModelProperty(value = "瀹夌伅鎸夐挳鐘舵��") + private String buttonStatus; + /**澶囨敞*/ + @Excel(name = "澶囨敞", width = 15) + @ApiModelProperty(value = "澶囨敞") + private String remark; +} diff --git a/src/main/java/org/jeecg/modules/andon/entity/AndonOrder.java b/src/main/java/org/jeecg/modules/andon/entity/AndonOrder.java new file mode 100644 index 0000000..bdee167 --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/entity/AndonOrder.java @@ -0,0 +1,121 @@ +package org.jeecg.modules.andon.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecg.common.aspect.annotation.Dict; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description: 瀹夌伅宸ュ崟 + * @Author: jeecg-boot + * @Date: 2025-07-10 + * @Version: V1.0 + */ +@Data +@TableName("andon_order") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="andon_order瀵硅薄", description="瀹夌伅宸ュ崟") +public class AndonOrder implements Serializable { + private static final long serialVersionUID = 1L; + + /**涓婚敭*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "涓婚敭") + private String id; + /**鍒涘缓浜�*/ + @ApiModelProperty(value = "鍒涘缓浜�") + private String createBy; + /**鍒涘缓鏃ユ湡*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "鍒涘缓鏃ユ湡") + private Date createTime; + /**鏇存柊浜�*/ + @ApiModelProperty(value = "鏇存柊浜�") + private String updateBy; + /**鏇存柊鏃ユ湡*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "鏇存柊鏃ユ湡") + private Date updateTime; + /**鍒犻櫎鏍囪*/ + @Excel(name = "鍒犻櫎鏍囪", width = 15) + @ApiModelProperty(value = "鍒犻櫎鏍囪") + @TableLogic + private Integer delFlag; + /**浜х嚎ID*/ + @Excel(name = "浜х嚎ID", width = 15) + @ApiModelProperty(value = "浜х嚎ID") + @Dict(dictTable = "base_factory", dicCode = "id", dicText = "factory_name") + private String factoryId; + /**瀹夌伅绫诲瀷*/ + @Excel(name = "瀹夌伅绫诲瀷", width = 15) + @ApiModelProperty(value = "瀹夌伅绫诲瀷") + @Dict(dictTable = "andon_button_config", dicCode = "id", dicText = "button_name") + private String buttonId; + /**瀹夌伅浜�*/ + @Excel(name = "瀹夌伅浜�", width = 15) + @ApiModelProperty(value = "瀹夌伅浜�") + private String operator; + /**瀹夌伅鏃堕棿*/ + @Excel(name = "瀹夌伅鏃堕棿", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "瀹夌伅鏃堕棿") + private Date operateTime; + /**瀹夌伅绛夌骇*/ + @Excel(name = "瀹夌伅绛夌骇", width = 15, dicCode = "andon_level") + @Dict(dicCode = "andon_level") + @ApiModelProperty(value = "瀹夌伅绛夌骇") + private String andonLevel; + /**鍝嶅簲浜�*/ + @Excel(name = "鍝嶅簲浜�", width = 15) + @ApiModelProperty(value = "鍝嶅簲浜�") + private String responder; + /**鍝嶅簲鏃堕棿*/ + @Excel(name = "鍝嶅簲鏃堕棿", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "鍝嶅簲鏃堕棿") + private Date responseTime; + /**澶勭悊浜�*/ + @Excel(name = "澶勭悊浜�", width = 15) + @ApiModelProperty(value = "澶勭悊浜�") + private String processor; + /**澶勭悊瀹屾垚鏃堕棿*/ + @Excel(name = "澶勭悊瀹屾垚鏃堕棿", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "澶勭悊瀹屾垚鏃堕棿") + private Date processTime; + /**瀹夌伅鐘舵��*/ + @Excel(name = "瀹夌伅鐘舵��", width = 15, dicCode = "order_status") + @Dict(dicCode = "order_status") + @ApiModelProperty(value = "瀹夌伅鐘舵��") + private String orderStatus; + /**闂鎻忚堪*/ + @Excel(name = "闂鎻忚堪", width = 15) + @ApiModelProperty(value = "闂鎻忚堪") + private String problemDescreption; + /**澶勭悊缁撴灉鎻忚堪*/ + @Excel(name = "澶勭悊缁撴灉鎻忚堪", width = 15) + @ApiModelProperty(value = "澶勭悊缁撴灉鎻忚堪") + private String resolutionDescreption; + /**澶勭悊缁撴灉鍥剧墖*/ + @Excel(name = "澶勭悊缁撴灉鍥剧墖", width = 15) + @ApiModelProperty(value = "澶勭悊缁撴灉鍥剧墖") + private String imageFiles; +} diff --git a/src/main/java/org/jeecg/modules/andon/entity/AndonResponseConfig.java b/src/main/java/org/jeecg/modules/andon/entity/AndonResponseConfig.java new file mode 100644 index 0000000..96dd37d --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/entity/AndonResponseConfig.java @@ -0,0 +1,81 @@ +package org.jeecg.modules.andon.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecg.common.aspect.annotation.Dict; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description: 瀹夌伅鍝嶅簲閰嶇疆 + * @Author: jeecg-boot + * @Date: 2025-07-10 + * @Version: V1.0 + */ +@Data +@TableName("andon_response_config") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="andon_response_config瀵硅薄", description="瀹夌伅鍝嶅簲閰嶇疆") +public class AndonResponseConfig implements Serializable { + private static final long serialVersionUID = 1L; + + /**涓婚敭*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "涓婚敭") + private String id; + /**鍒涘缓浜�*/ + @ApiModelProperty(value = "鍒涘缓浜�") + private String createBy; + /**鍒涘缓鏃ユ湡*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "鍒涘缓鏃ユ湡") + private Date createTime; + /**鏇存柊浜�*/ + @ApiModelProperty(value = "鏇存柊浜�") + private String updateBy; + /**鏇存柊鏃ユ湡*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "鏇存柊鏃ユ湡") + private Date updateTime; + /**鍒犻櫎鏍囪*/ + @Excel(name = "鍒犻櫎鏍囪", width = 15) + @ApiModelProperty(value = "鍒犻櫎鏍囪") + @TableLogic + private Integer delFlag; + /**浜х嚎ID*/ + @Excel(name = "浜х嚎ID", width = 15) + @ApiModelProperty(value = "浜х嚎ID") + @Dict(dictTable = "base_factory", dicCode = "id", dicText = "factory_name") + private String factoryId; + /**瀹夌伅绫诲瀷*/ + @Excel(name = "瀹夌伅绫诲瀷", width = 15) + @ApiModelProperty(value = "瀹夌伅绫诲瀷") + @Dict(dictTable = "andon_button_config", dicCode = "id", dicText = "button_name") + private String buttonId; + /**鍒濆鍝嶅簲浜�*/ + @Excel(name = "鍒濆鍝嶅簲浜�", width = 15) + @ApiModelProperty(value = "鍒濆鍝嶅簲浜�") + private String firsterResponder; + /**浜岀骇鍝嶅簲浜�(鍗囩骇涓�娆�)*/ + @Excel(name = "浜岀骇鍝嶅簲浜�(鍗囩骇涓�娆�)", width = 15) + @ApiModelProperty(value = "浜岀骇鍝嶅簲浜�(鍗囩骇涓�娆�)") + private String secondResponder; + /**涓夌骇鍝嶅簲浜�(鍗囩骇涓ゆ)*/ + @Excel(name = "涓夌骇鍝嶅簲浜�(鍗囩骇涓ゆ)", width = 15) + @ApiModelProperty(value = "涓夌骇鍝嶅簲浜�(鍗囩骇涓ゆ)") + private String thirdResponder; +} diff --git a/src/main/java/org/jeecg/modules/andon/mapper/AndonButtonConfigMapper.java b/src/main/java/org/jeecg/modules/andon/mapper/AndonButtonConfigMapper.java new file mode 100644 index 0000000..2c87ddc --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/mapper/AndonButtonConfigMapper.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.andon.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.andon.entity.AndonButtonConfig; + +/** + * @Description: 瀹夌伅鎸夐挳閰嶇疆 + * @Author: jeecg-boot + * @Date: 2025-07-10 + * @Version: V1.0 + */ +public interface AndonButtonConfigMapper extends BaseMapper<AndonButtonConfig> { + AndonButtonConfig getAndonButtonById(@Param("id") String id); +} diff --git a/src/main/java/org/jeecg/modules/andon/mapper/AndonOrderMapper.java b/src/main/java/org/jeecg/modules/andon/mapper/AndonOrderMapper.java new file mode 100644 index 0000000..01a9296 --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/mapper/AndonOrderMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.andon.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.andon.entity.AndonOrder; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 瀹夌伅宸ュ崟 + * @Author: jeecg-boot + * @Date: 2025-07-10 + * @Version: V1.0 + */ +public interface AndonOrderMapper extends BaseMapper<AndonOrder> { + List<AndonOrder> getAndonOrdersExceptYWC(); +} diff --git a/src/main/java/org/jeecg/modules/andon/mapper/AndonResponseConfigMapper.java b/src/main/java/org/jeecg/modules/andon/mapper/AndonResponseConfigMapper.java new file mode 100644 index 0000000..85c537d --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/mapper/AndonResponseConfigMapper.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.andon.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.andon.entity.AndonResponseConfig; + +/** + * @Description: 瀹夌伅鍝嶅簲閰嶇疆 + * @Author: jeecg-boot + * @Date: 2025-07-10 + * @Version: V1.0 + */ +public interface AndonResponseConfigMapper extends BaseMapper<AndonResponseConfig> { + AndonResponseConfig getAndonResponseConfigByFactoryIdAndButtonId(@Param("factoryId") String factoryId, @Param("buttonId") String buttonId); +} diff --git a/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonButtonConfigMapper.xml b/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonButtonConfigMapper.xml new file mode 100644 index 0000000..ec55989 --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonButtonConfigMapper.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="org.jeecg.modules.andon.mapper.AndonButtonConfigMapper"> + <select id="getAndonButtonById" resultType="org.jeecg.modules.andon.entity.AndonButtonConfig"> + SELECT * FROM andon_button_config WHERE id = #{id} and del_flag = 0 and button_status = '鍚敤' + </select> +</mapper> \ No newline at end of file diff --git a/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonOrderMapper.xml b/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonOrderMapper.xml new file mode 100644 index 0000000..6ef821c --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonOrderMapper.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="org.jeecg.modules.andon.mapper.AndonOrderMapper"> + <select id="getAndonOrdersExceptYWC" resultType="org.jeecg.modules.andon.entity.AndonOrder"> + SELECT * FROM andon_order WHERE order_status != '3' and del_flag = 0 + </select> +</mapper> \ No newline at end of file diff --git a/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonResponseConfigMapper.xml b/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonResponseConfigMapper.xml new file mode 100644 index 0000000..2f95e67 --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonResponseConfigMapper.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="org.jeecg.modules.andon.mapper.AndonResponseConfigMapper"> + <select id="getAndonResponseConfigByFactoryIdAndButtonId" resultType="org.jeecg.modules.andon.entity.AndonResponseConfig"> + SELECT * FROM andon_response_config WHERE factory_id = #{factoryId} AND button_id = #{buttonId} AND del_flag = 0 + </select> +</mapper> \ No newline at end of file diff --git a/src/main/java/org/jeecg/modules/andon/service/IAndonButtonConfigService.java b/src/main/java/org/jeecg/modules/andon/service/IAndonButtonConfigService.java new file mode 100644 index 0000000..a3bd9e1 --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/service/IAndonButtonConfigService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.andon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.andon.entity.AndonButtonConfig; + +/** + * @Description: 瀹夌伅鎸夐挳閰嶇疆 + * @Author: jeecg-boot + * @Date: 2025-07-10 + * @Version: V1.0 + */ +public interface IAndonButtonConfigService extends IService<AndonButtonConfig> { + AndonButtonConfig getAndonButtonById(String id); +} diff --git a/src/main/java/org/jeecg/modules/andon/service/IAndonOrderService.java b/src/main/java/org/jeecg/modules/andon/service/IAndonOrderService.java new file mode 100644 index 0000000..a2cc301 --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/service/IAndonOrderService.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.andon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.andon.entity.AndonOrder; + +import java.util.List; + +/** + * @Description: 瀹夌伅宸ュ崟 + * @Author: jeecg-boot + * @Date: 2025-07-10 + * @Version: V1.0 + */ +public interface IAndonOrderService extends IService<AndonOrder> { + //宸插畬鎴愮姸鎬侀櫎澶� + List<AndonOrder> getAndonOrdersExceptYWC(); +} diff --git a/src/main/java/org/jeecg/modules/andon/service/IAndonResponseConfigService.java b/src/main/java/org/jeecg/modules/andon/service/IAndonResponseConfigService.java new file mode 100644 index 0000000..aaac967 --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/service/IAndonResponseConfigService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.andon.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.andon.entity.AndonResponseConfig; + +/** + * @Description: 瀹夌伅鍝嶅簲閰嶇疆 + * @Author: jeecg-boot + * @Date: 2025-07-10 + * @Version: V1.0 + */ +public interface IAndonResponseConfigService extends IService<AndonResponseConfig> { + AndonResponseConfig getAndonResponseConfigByFactoryIdAndButtonId(String factoryId, String buttonId); +} diff --git a/src/main/java/org/jeecg/modules/andon/service/impl/AndonButtonConfigServiceImpl.java b/src/main/java/org/jeecg/modules/andon/service/impl/AndonButtonConfigServiceImpl.java new file mode 100644 index 0000000..92a7933 --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/service/impl/AndonButtonConfigServiceImpl.java @@ -0,0 +1,22 @@ +package org.jeecg.modules.andon.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.andon.entity.AndonButtonConfig; +import org.jeecg.modules.andon.mapper.AndonButtonConfigMapper; +import org.jeecg.modules.andon.service.IAndonButtonConfigService; +import org.springframework.stereotype.Service; + +/** + * @Description: 瀹夌伅鎸夐挳閰嶇疆 + * @Author: jeecg-boot + * @Date: 2025-07-10 + * @Version: V1.0 + */ +@Service +public class AndonButtonConfigServiceImpl extends ServiceImpl<AndonButtonConfigMapper, AndonButtonConfig> implements IAndonButtonConfigService { + + @Override + public AndonButtonConfig getAndonButtonById(String id) { + return baseMapper.getAndonButtonById(id); + } +} diff --git a/src/main/java/org/jeecg/modules/andon/service/impl/AndonOrderServiceImpl.java b/src/main/java/org/jeecg/modules/andon/service/impl/AndonOrderServiceImpl.java new file mode 100644 index 0000000..1152cfd --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/service/impl/AndonOrderServiceImpl.java @@ -0,0 +1,24 @@ +package org.jeecg.modules.andon.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.andon.service.IAndonOrderService; +import org.jeecg.modules.andon.entity.AndonOrder; +import org.jeecg.modules.andon.mapper.AndonOrderMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description: 瀹夌伅宸ュ崟 + * @Author: jeecg-boot + * @Date: 2025-07-10 + * @Version: V1.0 + */ +@Service +public class AndonOrderServiceImpl extends ServiceImpl<AndonOrderMapper, AndonOrder> implements IAndonOrderService { + + @Override + public List<AndonOrder> getAndonOrdersExceptYWC() { + return baseMapper.getAndonOrdersExceptYWC(); + } +} diff --git a/src/main/java/org/jeecg/modules/andon/service/impl/AndonResponseConfigServiceImpl.java b/src/main/java/org/jeecg/modules/andon/service/impl/AndonResponseConfigServiceImpl.java new file mode 100644 index 0000000..04db58b --- /dev/null +++ b/src/main/java/org/jeecg/modules/andon/service/impl/AndonResponseConfigServiceImpl.java @@ -0,0 +1,22 @@ +package org.jeecg.modules.andon.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.andon.entity.AndonResponseConfig; +import org.jeecg.modules.andon.mapper.AndonResponseConfigMapper; +import org.jeecg.modules.andon.service.IAndonResponseConfigService; +import org.springframework.stereotype.Service; + +/** + * @Description: 瀹夌伅鍝嶅簲閰嶇疆 + * @Author: jeecg-boot + * @Date: 2025-07-10 + * @Version: V1.0 + */ +@Service +public class AndonResponseConfigServiceImpl extends ServiceImpl<AndonResponseConfigMapper, AndonResponseConfig> implements IAndonResponseConfigService { + + @Override + public AndonResponseConfig getAndonResponseConfigByFactoryIdAndButtonId(String factoryId, String buttonId) { + return baseMapper.getAndonResponseConfigByFactoryIdAndButtonId(factoryId,buttonId); + } +} diff --git a/src/main/java/org/jeecg/modules/quartz/job/AndonJob.java b/src/main/java/org/jeecg/modules/quartz/job/AndonJob.java new file mode 100644 index 0000000..b87b78d --- /dev/null +++ b/src/main/java/org/jeecg/modules/quartz/job/AndonJob.java @@ -0,0 +1,137 @@ +package org.jeecg.modules.quartz.job; + +import org.jeecg.modules.andon.entity.AndonButtonConfig; +import org.jeecg.modules.andon.entity.AndonOrder; +import org.jeecg.modules.andon.entity.AndonResponseConfig; +import org.jeecg.modules.andon.service.IAndonButtonConfigService; +import org.jeecg.modules.andon.service.IAndonOrderService; +import org.jeecg.modules.andon.service.IAndonResponseConfigService; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Date; +import java.util.List; +//org.jeecg.modules.quartz.job.AndonJob +public class AndonJob implements Job { + private static final String ANDON_STATUS_DXY = "1"; + private static final String ANDON_STATUS_DCL = "2"; + private static final String ANDON_STATUS_YWC = "3"; + @Autowired + @Lazy + private IAndonOrderService andonOrderService; + @Autowired + @Lazy + private IAndonButtonConfigService andonButtonConfigService; + @Autowired + @Lazy + private IAndonResponseConfigService andonResponseConfigService; + + @Override + public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { + LocalDateTime currentTime = LocalDateTime.now(); + List<AndonOrder> andonOrdersExceptYWC = andonOrderService.getAndonOrdersExceptYWC(); + for (AndonOrder andonOrder : andonOrdersExceptYWC) { + AndonResponseConfig andonResponseConfig = andonResponseConfigService.getAndonResponseConfigByFactoryIdAndButtonId(andonOrder.getFactoryId(), andonOrder.getButtonId()); + AndonButtonConfig andonButtonConfig = andonButtonConfigService.getAndonButtonById(andonOrder.getButtonId()); + System.out.println("andonOrder----"+andonOrder.getId()+"----andonResponseConfig----"+andonResponseConfig.getId()+"-----"+"andonButtonConfig----"+andonButtonConfig.getId()); + levelUpgradeOne(andonOrder, andonResponseConfig, andonButtonConfig, currentTime); + levelUpgradeTwo(andonOrder, andonResponseConfig, andonButtonConfig, currentTime); + levelProcessOne(andonOrder, andonResponseConfig, andonButtonConfig, currentTime); + levelProcessTwo(andonOrder, andonResponseConfig, andonButtonConfig, currentTime); + } + } + + /** + * 鍒ゆ柇浜岀骇鍝嶅簲鍗囩骇 + * 濡傛灉瀹夌伅宸ュ崟鍝嶅簲鏃堕棿瓒呰繃涓�绾у搷搴旀椂闀胯繕涓虹┖锛屽垯璇存槑鏈搷搴� + */ + public void levelUpgradeOne(AndonOrder andonOrder, AndonResponseConfig andonResponseConfig, AndonButtonConfig andonButtonConfig, LocalDateTime currentTime) { + if (andonOrder.getAndonLevel().equals("1") && andonOrder.getOrderStatus().equals(ANDON_STATUS_DXY)) { + //瀹夌伅鏃堕棿 + Date operateTime = andonOrder.getOperateTime(); + //鍝嶅簲鏃堕暱 锛堝垎閽燂級 + Integer upgradeResponseDuration = andonButtonConfig.getUpgradeResponseDuration(); + LocalDateTime timeoutTime = operateTime.toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDateTime() + .plusMinutes(upgradeResponseDuration); + if (currentTime.isAfter(timeoutTime)) { + //鍝嶅簲鏃堕棿瓒呰繃涓�绾у搷搴旀椂闀匡紝鍗囩骇涓�娆�,骞舵彁閱掞紙妯℃嫙鍙戦�侀涔︽秷鎭級 + andonOrder.setAndonLevel("2"); + andonOrderService.saveOrUpdate(andonOrder); + //TODO 鍙戦�侀涔︽秷鎭紙杩欏潡涓烘ā鎷熼渶瑕佹湁鎺ュ彛鎵嶈兘寮�鍙戯級 + System.out.println("鍒濆鍝嶅簲浜�"+andonResponseConfig.getFirsterResponder()+"鏈搷搴旓紒"+"瀹夌伅宸ュ崟锛�" + andonOrder.getId() + "宸插崌绾т簩绾у搷搴�,骞跺彂娑堟伅缁欎簩绾у搷搴斾汉"+andonResponseConfig.getSecondResponder()); + } + } + } + + /** + * 鍒ゆ柇涓夌骇鍝嶅簲鍗囩骇 + * 瀹夌伅宸ュ崟鍝嶅簲鏃堕棿瓒呰繃浜岀骇鍝嶅簲鏃堕暱杩樹负绌猴紝鍒欒鏄庢湭鍝嶅簲 + */ + public void levelUpgradeTwo(AndonOrder andonOrder, AndonResponseConfig andonResponseConfig, AndonButtonConfig andonButtonConfig, LocalDateTime currentTime) { + if (andonOrder.getAndonLevel().equals("2") && andonOrder.getOrderStatus().equals(ANDON_STATUS_DXY)) { + Date operateTime = andonOrder.getOperateTime(); + Integer upgradeResponseDuration = andonButtonConfig.getSecondUpgradeResponseDuration(); + LocalDateTime timeoutTime = operateTime.toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDateTime() + .plusMinutes(upgradeResponseDuration); + if (currentTime.isAfter(timeoutTime)) { + //鍝嶅簲鏃堕棿瓒呰繃涓�绾у搷搴旀椂闀匡紝鍗囩骇涓�娆�,骞舵彁閱掞紙妯℃嫙鍙戦�侀涔︽秷鎭級 + andonOrder.setAndonLevel("3"); + andonOrderService.saveOrUpdate(andonOrder); + //TODO 鍙戦�侀涔︽秷鎭紙杩欏潡涓烘ā鎷熼渶瑕佹湁鎺ュ彛鎵嶈兘寮�鍙戯級 + System.out.println("浜岀骇鍝嶅簲浜�"+andonResponseConfig.getSecondResponder()+"鏈搷搴旓紒"+"瀹夌伅宸ュ崟锛�" + andonOrder.getId() + "宸插崌绾т笁绾у搷搴�,骞跺彂娑堟伅缁欎笁绾у搷搴斾汉"+andonResponseConfig.getThirdResponder()); + } + } + } + /** + * 鍒ゆ柇浜岀骇澶勭悊鍗囩骇 + * 瀹夌伅宸ュ崟鍝嶅簲鏃堕棿瓒呰繃浜岀骇澶勭悊鏃堕暱杩樹负绌猴紝鍒欒鏄庢湭鍝嶅簲 + */ + public void levelProcessOne(AndonOrder andonOrder, AndonResponseConfig andonResponseConfig, AndonButtonConfig andonButtonConfig, LocalDateTime currentTime){ + if (andonOrder.getAndonLevel().equals("1") && andonOrder.getOrderStatus().equals(ANDON_STATUS_DCL)) { + Date responseTime = andonOrder.getResponseTime(); + Integer upgradeProcessDuration = andonButtonConfig.getUpgradeProcessDuration(); + LocalDateTime timeoutTime = responseTime.toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDateTime() + .plusMinutes(upgradeProcessDuration); + if (currentTime.isAfter(timeoutTime)) { + //澶勭悊鏃堕棿瓒呰繃涓�绾у鐞嗘椂闀匡紝鍗囩骇涓�娆�,骞舵彁閱掞紙妯℃嫙鍙戦�侀涔︽秷鎭級 + andonOrder.setAndonLevel("2"); + andonOrderService.saveOrUpdate(andonOrder); + //TODO 鍙戦�侀涔︽秷鎭紙杩欏潡涓烘ā鎷熼渶瑕佹湁鎺ュ彛鎵嶈兘寮�鍙戯級 + System.out.println("涓�绾у鐞嗕汉"+andonResponseConfig.getFirsterResponder()+"鏈鐞嗭紒"+"瀹夌伅宸ュ崟锛�" + andonOrder.getId() + "宸插崌绾т簩绾у鐞�,骞跺彂娑堟伅缁欎簩绾у鐞嗕汉"+andonResponseConfig.getSecondResponder()); + } + } + } + /** + * 鍒ゆ柇涓夌骇澶勭悊鍗囩骇 + * 瀹夌伅宸ュ崟鍝嶅簲鏃堕棿瓒呰繃浜岀骇澶勭悊鏃堕暱杩樹负绌猴紝鍒欒鏄庢湭鍝嶅簲 + */ + public void levelProcessTwo(AndonOrder andonOrder, AndonResponseConfig andonResponseConfig, AndonButtonConfig andonButtonConfig, LocalDateTime currentTime){ + if (andonOrder.getAndonLevel().equals("2") && andonOrder.getOrderStatus().equals(ANDON_STATUS_DCL)) { + Date responseTime = andonOrder.getResponseTime(); + Integer secondUpgradeProcessDuration = andonButtonConfig.getSecondUpgradeProcessDuration(); + LocalDateTime timeoutTime = responseTime.toInstant() + .atZone(ZoneId.systemDefault()) + .toLocalDateTime() + .plusMinutes(secondUpgradeProcessDuration); + if (currentTime.isAfter(timeoutTime)) { + //澶勭悊鏃堕棿瓒呰繃涓�绾у鐞嗘椂闀匡紝鍗囩骇涓�娆�,骞舵彁閱掞紙妯℃嫙鍙戦�侀涔︽秷鎭級 + andonOrder.setAndonLevel("3"); + andonOrderService.saveOrUpdate(andonOrder); + //TODO 鍙戦�侀涔︽秷鎭紙杩欏潡涓烘ā鎷熼渶瑕佹湁鎺ュ彛鎵嶈兘寮�鍙戯級 + System.out.println("浜岀骇澶勭悊浜�"+andonResponseConfig.getSecondResponder()+"鏈鐞嗭紒"+"瀹夌伅宸ュ崟锛�" + andonOrder.getId() + "宸插崌绾т笁绾у鐞�,骞跺彂娑堟伅缁欎笁绾у鐞嗕汉"+andonResponseConfig.getThirdResponder()); + } + } + } + +} -- Gitblit v1.9.3