From c6f3bd69690128fef7bc3c24b74995a293350d43 Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期一, 18 八月 2025 09:14:29 +0800 Subject: [PATCH] 我的安灯发起/我的安灯响应, 响应操作 接口编写 --- src/main/java/org/jeecg/modules/andon/controller/AndonButtonConfigController.java | 284 ++++++++++++---------- src/main/java/org/jeecg/modules/andon/mapper/xml/AndonButtonConfigMapper.xml | 125 ++++++++++ src/main/java/org/jeecg/modules/andon/service/impl/AndonButtonConfigServiceImpl.java | 10 src/main/java/org/jeecg/modules/andon/controller/AndonResponseConfigController.java | 14 - src/main/java/org/jeecg/modules/andon/mapper/AndonButtonConfigMapper.java | 18 + src/main/java/org/jeecg/modules/andon/service/impl/AndonResponseConfigServiceImpl.java | 5 src/main/java/org/jeecg/modules/andon/controller/AndonOrderController.java | 235 ++++++++++--------- src/main/resources/application-dev.yml | 6 src/main/java/org/jeecg/modules/andon/service/IAndonButtonConfigService.java | 16 + src/main/java/org/jeecg/modules/andon/service/IAndonResponseConfigService.java | 7 10 files changed, 448 insertions(+), 272 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 index 633af0f..921719b 100644 --- a/src/main/java/org/jeecg/modules/andon/controller/AndonButtonConfigController.java +++ b/src/main/java/org/jeecg/modules/andon/controller/AndonButtonConfigController.java @@ -2,21 +2,18 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.StringUtils; 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.apache.shiro.SecurityUtils; 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.common.system.vo.LoginUser; import org.jeecg.modules.andon.dto.AndonButtonDTO; import org.jeecg.modules.andon.entity.AndonButtonConfig; -import org.jeecg.modules.andon.entity.AndonOrder; import org.jeecg.modules.andon.service.IAndonButtonConfigService; +import org.jeecg.modules.andon.service.impl.AndonOrderServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; @@ -27,41 +24,42 @@ import java.util.List; /** -* @Description: 瀹夌伅鎸夐挳閰嶇疆 -* @Author: jeecg-boot -* @Date: 2025-07-10 -* @Version: V1.0 -*/ -@Api(tags="瀹夌伅鎸夐挳閰嶇疆") + * @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; + @Autowired + private IAndonButtonConfigService andonButtonConfigService; + @Autowired + private AndonOrderServiceImpl andonOrderServiceImpl; - /** - * 鍒嗛〉鍒楄〃鏌ヨ - * - * @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 + * @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); + } /** @@ -70,117 +68,141 @@ * @param factoryId * @return */ - @ApiOperation(value="瀹夌伅鎸夐挳閰嶇疆-鍒嗛〉鍒楄〃鏌ヨ", notes="瀹夌伅鎸夐挳閰嶇疆-鍒嗛〉鍒楄〃鏌ヨ") + @ApiOperation(value = "瀹夌伅鎸夐挳閰嶇疆-鍒嗛〉鍒楄〃鏌ヨ", notes = "瀹夌伅鎸夐挳閰嶇疆-鍒嗛〉鍒楄〃鏌ヨ") @GetMapping(value = "/queryUserAndonButtonList") - public Result<List<AndonButtonDTO>> queryUserAndonButtonList(@RequestParam("factoryId") String factoryId) { + public Result<List<AndonButtonDTO>> queryUserAndonButtonList(@RequestParam("factoryId") String factoryId) { List<AndonButtonDTO> list = andonButtonConfigService.queryUserAndonButtonList(factoryId); return Result.OK(list); } + /** + * APP瀹夌伅鍙戣捣鍒楄〃鏌ヨ + * + * @param factoryId + * @return + */ + @ApiOperation(value = "瀹夌伅鍙戣捣-鍒嗛〉鍒楄〃鏌ヨ", notes = "瀹夌伅鍙戣捣-鍒嗛〉鍒楄〃鏌ヨ") + @GetMapping(value = "/queryUserAndonCallList") + public Result<List<AndonButtonDTO>> queryUserAndonCallList(@RequestParam("factoryId") String factoryId) { + List<AndonButtonDTO> list = andonButtonConfigService.queryUserAndonCallList(factoryId); + return Result.OK(list); + } + + /** + * APP瀹夌伅鍝嶅簲鍒楄〃鏌ヨ + * + * @param factoryId + * @return + */ + @ApiOperation(value = "瀹夌伅鍝嶅簲-鍒嗛〉鍒楄〃鏌ヨ", notes = "瀹夌伅鍝嶅簲-鍒嗛〉鍒楄〃鏌ヨ") + @GetMapping(value = "/queryUserAndonRespondList") + public Result<List<AndonButtonDTO>> queryUserAndonRespondList(@RequestParam("factoryId") String factoryId) { + List<AndonButtonDTO> list = andonButtonConfigService.queryUserAndonRespondList(factoryId); + return Result.OK(list); + } + /** + * 娣诲姞 + * + * @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: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("缂栬緫鎴愬姛!"); + } - /** - * 缂栬緫 - * - * @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("鍒犻櫎鎴愬姛!"); + } - /** - * 閫氳繃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("鎵归噺鍒犻櫎鎴愬姛!"); + } - /** - * 鎵归噺鍒犻櫎 - * - * @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); + } - /** - * 閫氳繃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 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); - } + * + * @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 index 23ca85f..3fbbe9c 100644 --- a/src/main/java/org/jeecg/modules/andon/controller/AndonOrderController.java +++ b/src/main/java/org/jeecg/modules/andon/controller/AndonOrderController.java @@ -21,41 +21,40 @@ import java.util.Arrays; /** -* @Description: 瀹夌伅宸ュ崟 -* @Author: jeecg-boot -* @Date: 2025-07-10 -* @Version: V1.0 -*/ -@Api(tags="瀹夌伅宸ュ崟") + * @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; + @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 + * @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); + } /** @@ -65,7 +64,7 @@ * @return */ @AutoLog(value = "瀹夌伅宸ュ崟-娣诲姞") - @ApiOperation(value="瀹夌伅宸ュ崟-娣诲姞", notes="瀹夌伅宸ュ崟-娣诲姞") + @ApiOperation(value = "瀹夌伅宸ュ崟-娣诲姞", notes = "瀹夌伅宸ュ崟-娣诲姞") @PostMapping(value = "/add") public Result<String> add(@RequestBody AndonOrder andonOrder) { andonOrderService.save(andonOrder); @@ -73,92 +72,106 @@ } + /** + * APP瀹夌伅鍝嶅簲鎿嶄綔 + * + * @param orderId + * @return + */ + @ApiOperation(value = "APP瀹夌伅鍝嶅簲鎿嶄綔", notes = "APP瀹夌伅鍝嶅簲鎿嶄綔") + @GetMapping(value = "/AndonRespond") + public Result<String> AndonRespond(@RequestParam("orderId") String orderId) { + AndonOrder andonOrder = andonOrderService.getById(orderId); + andonOrder.setOrderStatus("2"); + andonOrderService.updateById(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("缂栬緫鎴愬姛!"); - } + /** + * 缂栬緫 + * + * @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("鍒犻櫎鎴愬姛!"); - } + /** + * 閫氳繃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("鎵归噺鍒犻櫎鎴愬姛!"); - } + /** + * 鎵归噺鍒犻櫎 + * + * @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); - } + /** + * 閫氳繃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 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); - } + * + * @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 index 63510ae..976af22 100644 --- a/src/main/java/org/jeecg/modules/andon/controller/AndonResponseConfigController.java +++ b/src/main/java/org/jeecg/modules/andon/controller/AndonResponseConfigController.java @@ -181,18 +181,4 @@ return super.importExcel(request, response, AndonResponseConfig.class); } - - /** - * APP瀹夌伅鎸夐挳鍒楄〃鏌ヨ - * - * @param factoryId - * @return - */ - @ApiOperation(value = "瀹夌伅鎸夐挳閰嶇疆-鍒楄〃鏌ヨ", notes = "瀹夌伅鎸夐挳閰嶇疆-鍒楄〃鏌ヨ") - @GetMapping(value = "/queryAndonButtonList") - public Result<List<AndonButtonDTO>> queryAndonButtonList(@RequestParam("factoryId") String factoryId) { - List<AndonButtonDTO> list = andonResponseConfigService.queryAndonButtonList(factoryId); - return Result.OK(list); - } - } diff --git a/src/main/java/org/jeecg/modules/andon/mapper/AndonButtonConfigMapper.java b/src/main/java/org/jeecg/modules/andon/mapper/AndonButtonConfigMapper.java index 6812614..47fab66 100644 --- a/src/main/java/org/jeecg/modules/andon/mapper/AndonButtonConfigMapper.java +++ b/src/main/java/org/jeecg/modules/andon/mapper/AndonButtonConfigMapper.java @@ -21,4 +21,22 @@ * @return */ List<AndonButtonDTO> queryUserAndonButtonList(String factoryId); + + /** + * 鍙戣捣瀹夌伅鍒楄〃 + * @param factoryId + * @return + */ + List<AndonButtonDTO> queryUserAndonCallList(String factoryId); + + /** + * 鍝嶅簲瀹夌伅鍒楄〃 + * @param factoryId + * @return + */ + List<AndonButtonDTO> queryUserAndonRespondList(String factoryId); + } + + + 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 index 128f32a..fa2b139 100644 --- a/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonButtonConfigMapper.xml +++ b/src/main/java/org/jeecg/modules/andon/mapper/xml/AndonButtonConfigMapper.xml @@ -2,7 +2,11 @@ <!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 * + FROM andon_button_config + WHERE id = #{id} + and del_flag = 0 + and button_status = '鍚敤' </select> <select id="queryUserAndonButtonList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO"> select arc.id, @@ -13,15 +17,128 @@ from andon_order ao where ao.button_id = arc.button_id and ao.factory_id = arc.factory_id - and ao.order_status != '3') as blinking_flag, - STUFF((SELECT ',' + CAST(ao.id AS VARCHAR) + and ao.order_status != '3') as blinking_flag, STUFF((SELECT ',' + CAST (ao.id AS VARCHAR) FROM andon_order ao WHERE ao.button_id = arc.button_id and ao.factory_id = arc.factory_id - FOR XML PATH('')), 1, 1, '') as order_ids + FOR XML PATH ('')), 1, 1, '') as order_ids from andon_response_config arc left join andon_button_config abc on arc.button_id = abc.id where arc.factory_id=#{factoryId}; </select> + <select id="queryUserAndonCallList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO"> + select arc.id, + abc.id as buttonId, + abc.button_name as buttonName, + abc.button_code as buttonCode, + (select count(1) + from andon_order ao + where ao.button_id = arc.button_id + and ao.factory_id = arc.factory_id + and ao.order_status = '1') as blinkingFlag, + STUFF((SELECT ',' + CAST (ao.id AS VARCHAR) + FROM andon_order ao + WHERE ao.button_id = arc.button_id + and ao.factory_id = arc.factory_id + and ao.order_status = '1' + FOR XML PATH ('')), 1, 1, '') as orderIds, + bf.factory_name as factoryName, + parent_bf.factory_name as parentFactoryName, + abc.upgrade_response_duration as upgradeResponseDuration, + abc.second_upgrade_response_duration as secondUpgradeResponseDuration, + arc.firster_responder as responder, + arc.second_responder, + arc.third_responder, + STUFF((SELECT ',' + ao.order_status + FROM andon_order ao + WHERE ao.button_id = arc.button_id + and ao.factory_id = arc.factory_id + and ao.order_status = '1' + FOR XML PATH ('')), 1, 1, '') as orderStatus + from andon_response_config arc + left join andon_button_config abc + on arc.button_id = abc.id + left join base_factory bf on arc.factory_id = bf.id + left join base_factory parent_bf on bf.parent_id = parent_bf.id + where arc.factory_id=#{factoryId} + and (select count (1) + from andon_order ao + where ao.button_id = arc.button_id + and ao.factory_id = arc.factory_id + and ao.order_status = '1') = 1 + </select> +<!-- <select id="queryUserAndonCallList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO">--> +<!-- select arc.id,--> +<!-- abc.id as buttonId,--> +<!-- abc.button_name as buttonName,--> +<!-- abc.button_code as buttonCode,--> +<!-- (select count(1)--> +<!-- from andon_order ao--> +<!-- where ao.button_id = arc.button_id--> +<!-- and ao.factory_id = arc.factory_id--> +<!-- and ao.order_status != '3') as blinkingFlag, STUFF((SELECT ',' + CAST (ao.id AS VARCHAR)--> +<!-- FROM andon_order ao--> +<!-- WHERE ao.button_id = arc.button_id--> +<!-- and ao.factory_id = arc.factory_id--> +<!-- FOR XML PATH ('')), 1, 1, '') as orderIds, bf.factory_name as factoryName, parent_bf.factory_name as parentFactoryName, abc.upgrade_response_duration as upgradeResponseDuration, abc.second_upgrade_response_duration as secondUpgradeResponseDuration, arc.firster_responder as responder, arc.second_responder, arc.third_responder, STUFF((SELECT ',' + ao.order_status--> +<!-- FROM andon_order ao--> +<!-- WHERE ao.button_id = arc.button_id--> +<!-- and ao.factory_id = arc.factory_id--> +<!-- and ao.order_status != '3'--> +<!-- FOR XML PATH ('')), 1, 1, '') as orderStatus--> +<!-- from andon_response_config arc--> +<!-- left join andon_button_config abc--> +<!-- on arc.button_id = abc.id--> +<!-- left join base_factory bf on arc.factory_id = bf.id--> +<!-- left join base_factory parent_bf on bf.parent_id = parent_bf.id--> +<!-- where arc.factory_id=#{factoryId}--> +<!-- and (select count (1)--> +<!-- from andon_order ao--> +<!-- where ao.button_id = arc.button_id--> +<!-- and ao.factory_id = arc.factory_id--> +<!-- and ao.order_status != '3') = 1--> +<!-- </select>--> + + <select id="queryUserAndonRespondList" resultType="org.jeecg.modules.andon.dto.AndonButtonDTO"> + select arc.id, + abc.id as buttonId, + abc.button_name as buttonName, + abc.button_code as buttonCode, + (select count(1) + from andon_order ao + where ao.button_id = arc.button_id + and ao.factory_id = arc.factory_id + and ao.order_status = '2') as blinkingFlag, + STUFF((SELECT ',' + CAST(ao.id AS VARCHAR) + FROM andon_order ao + WHERE ao.button_id = arc.button_id + and ao.factory_id = arc.factory_id + and ao.order_status = '2' + FOR XML PATH ('')), 1, 1, '') as orderIds, + bf.factory_name as factoryName, + parent_bf.factory_name as parentFactoryName, + abc.upgrade_response_duration as upgradeResponseDuration, + abc.second_upgrade_response_duration as secondUpgradeResponseDuration, + arc.firster_responder as responder, + arc.second_responder, + arc.third_responder, + STUFF((SELECT ',' + ao.order_status + FROM andon_order ao + WHERE ao.button_id = arc.button_id + and ao.factory_id = arc.factory_id + and ao.order_status = '2' + FOR XML PATH ('')), 1, 1, '') as orderStatus + from andon_response_config arc + left join andon_button_config abc + on arc.button_id = abc.id + left join base_factory bf on arc.factory_id = bf.id + left join base_factory parent_bf on bf.parent_id = parent_bf.id + where arc.factory_id = #{factoryId} + and (select count(1) + from andon_order ao + where ao.button_id = arc.button_id + and ao.factory_id = arc.factory_id + and ao.order_status = '2') = 1 + </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 index b928375..dca5f8f 100644 --- a/src/main/java/org/jeecg/modules/andon/service/IAndonButtonConfigService.java +++ b/src/main/java/org/jeecg/modules/andon/service/IAndonButtonConfigService.java @@ -21,4 +21,20 @@ * @return */ List<AndonButtonDTO> queryUserAndonButtonList(String factoryId); + + + /** + * 鏌ヨ鐢ㄦ埛鍙戣捣瀹夌伅鎸夐挳鍒楄〃 + * @param factoryId + * @return + */ + List<AndonButtonDTO> queryUserAndonCallList(String factoryId); + + /** + * 鏌ヨ鐢ㄦ埛鍙戣捣瀹夌伅鍝嶅簲鍒楄〃 + * @param factoryId + * @return + */ + List<AndonButtonDTO> queryUserAndonRespondList(String factoryId); + } diff --git a/src/main/java/org/jeecg/modules/andon/service/IAndonResponseConfigService.java b/src/main/java/org/jeecg/modules/andon/service/IAndonResponseConfigService.java index 253efbf..58aa6bb 100644 --- a/src/main/java/org/jeecg/modules/andon/service/IAndonResponseConfigService.java +++ b/src/main/java/org/jeecg/modules/andon/service/IAndonResponseConfigService.java @@ -15,12 +15,7 @@ public interface IAndonResponseConfigService extends IService<AndonResponseConfig> { AndonResponseConfig getAndonResponseConfigByFactoryIdAndButtonId(String factoryId, String buttonId); - /** - * 鏍规嵁宸ュ巶id鏌ヨ鎸夐挳鍒楄〃 - * @param factoryId 宸ュ巶id - * @return - */ - List<AndonButtonDTO> queryAndonButtonList(String factoryId); + /** 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 index e1ebd85..e6b670a 100644 --- a/src/main/java/org/jeecg/modules/andon/service/impl/AndonButtonConfigServiceImpl.java +++ b/src/main/java/org/jeecg/modules/andon/service/impl/AndonButtonConfigServiceImpl.java @@ -29,5 +29,15 @@ return baseMapper.queryUserAndonButtonList(factoryId); } + @Override + public List<AndonButtonDTO> queryUserAndonCallList(String factoryId) { + return baseMapper.queryUserAndonCallList(factoryId); + } + + @Override + public List<AndonButtonDTO> queryUserAndonRespondList(String factoryId) { + return baseMapper.queryUserAndonRespondList(factoryId); + } + } 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 index c895470..926ae5f 100644 --- a/src/main/java/org/jeecg/modules/andon/service/impl/AndonResponseConfigServiceImpl.java +++ b/src/main/java/org/jeecg/modules/andon/service/impl/AndonResponseConfigServiceImpl.java @@ -49,10 +49,7 @@ return baseMapper.getAndonResponseConfigByFactoryIdAndButtonId(factoryId, buttonId); } - @Override - public List<AndonButtonDTO> queryAndonButtonList(String factoryId) { - return Collections.emptyList(); - } + @Override public void sendAndonNotification(AndonButtonDTO andonButtonDTO) { diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index c91a985..3ecdf62 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -126,9 +126,10 @@ connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 datasource: master: - url: jdbc:sqlserver://192.168.0.118:1433;databasename=LXZN_TEST_XHJ;nullCatalogMeansCurrent=true + + url: jdbc:sqlserver://127.0.0.1:1433;databasename=LXZN-TEXT-XHJ;nullCatalogMeansCurrent=true username: sa - password: 123 + password: 123456 driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver #redis 閰嶇疆 redis: @@ -284,6 +285,7 @@ agent-id: ?? webservice: url: http://10.101.0.182:8002/MesWebService/WebService.asmx?wsdl + namespace: http://tempuri.org/ # SAP RFC鏂瑰紡鎺ュ彛闆嗘垚 sap: rfc: -- Gitblit v1.9.3