feat(sip): 更新订单信息和外部接口鉴权

- 修改订单信息相关代码,增加 bgType 字段并更新相关 mapper 和 service- 更新外部接口鉴权方式,使用静态变量 API_KEY 替代硬编码的字符串
-调整 OrderInfoVo 结构,添加 lastUpdateTime 字段
- 修改 ruoyi-admin 和 ruoyi-sip 的 artifactId
- 更新 ruoyi-admin 的资源过滤配置
master
chenhao 2025-05-14 16:54:07 +08:00
parent 626e5ac48e
commit 522ce35d68
8 changed files with 34 additions and 10 deletions

View File

@ -9,7 +9,7 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging> <packaging>jar</packaging>
<artifactId>ruoyi-admin</artifactId> <artifactId>oms-admin</artifactId>
<description> <description>
web服务入口 web服务入口
@ -134,6 +134,22 @@
</configuration> </configuration>
</plugin> --> </plugin> -->
</plugins> </plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/*.yml</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.yml</include>
</includes>
</resource>
</resources>
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
</build> </build>

View File

@ -16,7 +16,7 @@ ruoyi:
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口默认为80 # 服务器的HTTP端口默认为80
port: 8080 port: 28080
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: / context-path: /

View File

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-sip</artifactId> <artifactId>ruoyi-sip</artifactId>
<packaging>war</packaging> <packaging>jar</packaging>
<name>ruoyi-sip Maven Webapp</name> <name>ruoyi-sip Maven Webapp</name>
<!-- FIXME change it to the project's website --> <!-- FIXME change it to the project's website -->

View File

@ -37,6 +37,7 @@ public class ExternalController {
private IDeliveryListService deliveryListService; private IDeliveryListService deliveryListService;
@Autowired @Autowired
private IOrderInfoService orderInfoService; private IOrderInfoService orderInfoService;
private final static String API_KEY = "c7f858d0-30b8-4b7f-9ea1-0ccf5ceb1c54";
@ -46,7 +47,8 @@ public class ExternalController {
if (StringUtils.isEmpty(apiKey)) { if (StringUtils.isEmpty(apiKey)) {
return AjaxResult.error("apiKey不能为空"); return AjaxResult.error("apiKey不能为空");
} }
if (!"12345".equals(apiKey)){
if (!API_KEY.equals(apiKey)) {
return AjaxResult.error("鉴权失败"); return AjaxResult.error("鉴权失败");
} }
return AjaxResult.success(orderInfoService.getOrderInfo(dto)); return AjaxResult.success(orderInfoService.getOrderInfo(dto));
@ -58,7 +60,7 @@ public class ExternalController {
if (StringUtils.isEmpty(apiKey)) { if (StringUtils.isEmpty(apiKey)) {
return AjaxResult.error("apiKey不能为空"); return AjaxResult.error("apiKey不能为空");
} }
if (!"12345".equals(apiKey)){ if (!API_KEY.equals(apiKey)){
return AjaxResult.error("鉴权失败"); return AjaxResult.error("鉴权失败");
} }
return AjaxResult.success(deliveryListService.getNumberInfo(dto)); return AjaxResult.success(deliveryListService.getNumberInfo(dto));

View File

@ -46,6 +46,7 @@ public class OrderInfo extends BaseEntity
private String customerName; private String customerName;
//客户编码 //客户编码
private String customerCode; private String customerCode;
private String bgType;
/** /**
* *
*/ */

View File

@ -4,6 +4,8 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Dict;
import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.sip.domain.*; import com.ruoyi.sip.domain.*;
import com.ruoyi.sip.dto.ApiDataQueryDto; import com.ruoyi.sip.dto.ApiDataQueryDto;
import com.ruoyi.sip.service.IAgentInfoService; import com.ruoyi.sip.service.IAgentInfoService;
@ -173,8 +175,8 @@ public class OrderInfoServiceImpl implements IOrderInfoService
orderInfoVo.setOrderName(orderInfo.getOrderName()); orderInfoVo.setOrderName(orderInfo.getOrderName());
orderInfoVo.setVersionCode(orderInfo.getVersionCode()); orderInfoVo.setVersionCode(orderInfo.getVersionCode());
// 固定值待确认 // 固定值待确认
orderInfoVo.setBgType("1"); orderInfoVo.setBgType(DictUtils.getDictLabel("bg_type", orderInfo.getBgType()));
orderInfoVo.setLastUpdateTime(orderInfo.getUpdatedAt());
// 设置代表处信息 // 设置代表处信息
setAgentInfo(orderInfoVo, agentInfoMap.get(orderInfo.getOrderAgentCode())); setAgentInfo(orderInfoVo, agentInfoMap.get(orderInfo.getOrderAgentCode()));
// 设置客户信息 // 设置客户信息
@ -235,7 +237,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService
orderInfoVo.setCustomerCode(dto.getCustomerCode()); orderInfoVo.setCustomerCode(dto.getCustomerCode());
orderInfoVo.setCustomerName(dto.getCustomerName()); orderInfoVo.setCustomerName(dto.getCustomerName());
orderInfoVo.setCustomerPostcode(dto.getCustomerPostcode()); orderInfoVo.setCustomerPostcode(dto.getCustomerPostcode());
orderInfoVo.setIndustryType(dto.getIndustryType()); orderInfoVo.setIndustryType(DictUtils.getDictLabel("industry_type",dto.getIndustryType()));
orderInfoVo.setCustomerAddress(dto.getCustomerAddress()); orderInfoVo.setCustomerAddress(dto.getCustomerAddress());
orderInfoVo.setContactPerson(dto.getCustomerContact()); orderInfoVo.setContactPerson(dto.getCustomerContact());
orderInfoVo.setContactEmail(dto.getCustomerEmail()); orderInfoVo.setContactEmail(dto.getCustomerEmail());

View File

@ -3,6 +3,8 @@ package com.ruoyi.sip.vo;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* @author : ch * @author : ch
* @version : 1.0 * @version : 1.0
@ -56,6 +58,5 @@ public class OrderInfoVo {
private String contactPhone; private String contactPhone;
//客户邮箱 //客户邮箱
private String contactEmail; private String contactEmail;
private Date lastUpdateTime;
} }

View File

@ -18,6 +18,7 @@
<result property="orderType" column="order_type"/> <result property="orderType" column="order_type"/>
<result property="orderAgentCode" column="order_agent_code"/> <result property="orderAgentCode" column="order_agent_code"/>
<result property="orderPartnerCode" column="order_partner_code"/> <result property="orderPartnerCode" column="order_partner_code"/>
<result property="bgType" column="bg_type"/>
<result property="orderDate" column="order_date"/> <result property="orderDate" column="order_date"/>
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
@ -85,6 +86,7 @@
order_type, order_type,
order_agent_code, order_agent_code,
order_partner_code, order_partner_code,
bg_type,
order_date, order_date,
status, status,
remark, remark,