wzp
2025-05-05 6eddbbc337d8ab1de6daaa5afda2699179e3e8db
fix:修复bug
3个文件已添加
3个文件已修改
47 ■■■■ 已修改文件
doc/java8.rar 补丁 | 查看 | 原始文档 | blame | 历史
doc/jdk-8u291-windows-x64.exe 补丁 | 查看 | 原始文档 | blame | 历史
doc/sqlncli.msi 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbOrdersController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/utils/civilAviation/ServiceOrderUtil.java 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TbOrdersMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
doc/java8.rar
Binary files differ
doc/jdk-8u291-windows-x64.exe
Binary files differ
doc/sqlncli.msi
Binary files differ
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TbOrdersController.java
@@ -125,7 +125,7 @@
//        model.setCoTies("家属"); // 随机设置客户联系人与患者关系
            // 设置预约时间为一天后
            Calendar calendar = Calendar.getInstance();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd%20HH:mm");
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
            model.setApptDate(sdf.format(tbOrders.getBookingDate())); // 格式化预约运送时间
            model.setPtName(tbOrders.getPatientName()); // 患者姓名
@@ -188,7 +188,7 @@
//        model.setCoTies("家属"); // 随机设置客户联系人与患者关系
        // 设置预约时间为一天后
        Calendar calendar = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd%20HH:mm");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        model.setApptDate(sdf.format(tbOrders.getBookingDate())); // 格式化预约运送时间
        model.setPtName(tbOrders.getPatientName()); // 患者姓名
ruoyi-common/src/main/java/com/ruoyi/common/utils/civilAviation/ServiceOrderUtil.java
@@ -8,8 +8,11 @@
import com.ruoyi.common.utils.http.HttpUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
import java.net.URLEncoder;
@@ -19,9 +22,19 @@
/**
 * 民航医疗接口处理
 */
@Component
public class ServiceOrderUtil {
    private static final Logger log = LoggerFactory.getLogger(ServiceOrderUtil.class);
    public static String AddServiceOrederAPI = "http://localhost:8011/v1/";
    private static String addServiceOrederAPI;
    @Value("${min.apiUrl}")
    public void setAddServiceOrederAPI(String apiUrl) {
        ServiceOrderUtil.addServiceOrederAPI = apiUrl;
    }
    public static String getAddServiceOrederAPI() {
        return addServiceOrederAPI;
    }
    /**
     * 创建服务单
@@ -30,13 +43,15 @@
     * @return 服务单接口调用结果
     */
    public static ServiceOrderAppResultVo CreateServiceOrder(ServiceOrderAppVo model,String appSecret) {
        if (AddServiceOrederAPI.isEmpty()) {
        if (addServiceOrederAPI.isEmpty()) {
            // log.info("AddServiceOrederAPI 未设置,请先设置接口地址。");
            return null;
        }
        log.info("接口地址:"+addServiceOrederAPI);
        //计算时间戳和签名
        long unixTime = System.currentTimeMillis() / 1000; // 获取当前时间戳(秒)
        long unixTime = System.currentTimeMillis() / 1000; // 获取当前时间戳(秒)  Long.valueOf("1746444543") ;//
        model.setUnixTime(unixTime); // 设置时间戳到模型中
        // 将 model 转换为 Map<String, String>
@@ -47,15 +62,18 @@
            try {
                Object value = field.get(model);
                if (value != null) {
                    params.put(field.getName(), value.toString());
                    params.put(field.getName(),URLEncoder.encode(value.toString(), StandardCharsets.UTF_8.toString()));
                }
            } catch (IllegalAccessException e) {
                // log.error("获取对象属性值时出错", e);
            } catch (UnsupportedEncodingException e) {
                throw new RuntimeException(e);
            }
        }
        model.setSign(ServiceOrderSign.generateSign(params,appSecret)); // 生成签名并设置到模型中
        log.info("Sign值="+model.getSign());
        // 替换为
        StringBuilder formData = new StringBuilder();
@@ -71,16 +89,19 @@
                    // 将字段名首字母大写
                    String fieldName = field.getName();
                    String capitalizedFieldName = fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
                    formData.append(capitalizedFieldName)
                           .append("=")
                           .append(value.toString());
                            .append("=")
                            .append(URLEncoder.encode(value.toString(), StandardCharsets.UTF_8.toString()));
                }
            } catch (Exception e) {
                // log.error("拼接表单数据时出错", e);
            }
        }
        String responseData = HttpUtils.sendPost(AddServiceOrederAPI, formData.toString(), "application/x-www-form-urlencoded");
        log.info("请求参数="+formData.toString());
        String responseData = HttpUtils.sendPost(addServiceOrederAPI, formData.toString(), "application/x-www-form-urlencoded");
        if (responseData != null && !responseData.isEmpty()) {
@@ -106,7 +127,7 @@
     * @return 服务订单删除接口调用结果
     */
    public static ServiceOrderAppResultVo CancelServiceOrder(ServiceOrderDelVo model,String appSecret) {
        if (AddServiceOrederAPI.isEmpty()) {
        if (addServiceOrederAPI.isEmpty()) {
            // log.info("AddServiceOrederAPI 未设置,请先设置接口地址。");
            return null;
        }
@@ -147,14 +168,14 @@
                    String fieldName = field.getName();
                    formData.append(fieldName)
                           .append("=")
                           .append(value.toString());
                           .append(URLEncoder.encode(value.toString(), StandardCharsets.UTF_8.toString()));
                }
            } catch (Exception e) {
                // log.error("拼接表单数据时出错", e);
            }
        }
        String responseData = HttpUtils.sendPost(AddServiceOrederAPI, formData.toString(), "application/x-www-form-urlencoded");
        String responseData = HttpUtils.sendPost(addServiceOrederAPI, formData.toString(), "application/x-www-form-urlencoded");
        if (responseData != null && !responseData.isEmpty()) {
            // log.info("接口响应: " + responseData);
ruoyi-system/src/main/resources/mapper/system/TbOrdersMapper.xml
@@ -90,11 +90,13 @@
            <if test="UpdateTime != null "> and UpdateTime = #{UpdateTime}</if>
            <if test="OrderStatus != null "> and OrderStatus = #{OrderStatus}</if>
        </where>
        ORDER BY CreateTime DESC
    </select>
    
    <select id="selectTbOrdersByOrderID" parameterType="Long" resultMap="TbOrdersResult">
        <include refid="selectTbOrdersVo"/>
        where OrderID = #{OrderID}
        ORDER BY CreateTime DESC
    </select>
    <insert id="insertTbOrders" parameterType="TbOrders">