新火炬后端单体项目初始化代码
Houjie
4 天以前 c6f3bd69690128fef7bc3c24b74995a293350d43
我的安灯发起/我的安灯响应, 响应操作 接口编写
已修改10个文件
246 ■■■■ 文件已修改
src/main/java/org/jeecg/modules/andon/controller/AndonButtonConfigController.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/andon/controller/AndonOrderController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/andon/controller/AndonResponseConfigController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/andon/mapper/AndonButtonConfigMapper.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/andon/mapper/xml/AndonButtonConfigMapper.xml 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/andon/service/IAndonButtonConfigService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/andon/service/IAndonResponseConfigService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/andon/service/impl/AndonButtonConfigServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/org/jeecg/modules/andon/service/impl/AndonResponseConfigServiceImpl.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-dev.yml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;
@@ -39,6 +36,8 @@
public class AndonButtonConfigController extends JeecgController<AndonButtonConfig, IAndonButtonConfigService> {
   @Autowired
   private IAndonButtonConfigService andonButtonConfigService;
    @Autowired
    private AndonOrderServiceImpl andonOrderServiceImpl;
   /**
    * 分页列表查询
@@ -63,7 +62,6 @@
   }
    /**
     * APP安灯按钮列表查询
     *
@@ -78,7 +76,31 @@
    }
    /**
     * 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);
    }
   /**
src/main/java/org/jeecg/modules/andon/controller/AndonOrderController.java
@@ -57,7 +57,6 @@
   }
    /**
     * 添加
     *
@@ -73,6 +72,20 @@
    }
    /**
     * 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("响应成功!");
    }
   /**
    *  编辑
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,8 +17,7 @@
                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
@@ -24,4 +27,118 @@
        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: