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); } } 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); } } 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); } } 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); } 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> 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); } 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); /** 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); } } 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) { 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: