Commit 34954166 by MMF

MMF 2026-03-17 设计资料解析错误日志

parent c76a2465
package com.zjsgfa.project.zjsgfa.controller;
import java.io.*;
import java.math.BigInteger;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Paths;
......@@ -13,7 +12,6 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.data.PictureRenderData;
......@@ -21,12 +19,10 @@ import com.deepoove.poi.data.PictureType;
import com.deepoove.poi.data.Pictures;
import com.deepoove.poi.plugin.table.LoopColumnTableRenderPolicy;
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.zjsgfa.common.constant.Constants;
import com.zjsgfa.common.utils.SecurityUtils;
import com.zjsgfa.common.utils.StringUtils;
import com.zjsgfa.common.utils.bean.BeanUtils;
import com.zjsgfa.common.utils.file.FileUploadUtils;
......@@ -252,6 +248,9 @@ public class SjDjjcController extends BaseController {
@Autowired
private SjBcxxMapper sjBcxxMapper;
@Autowired
private SjSjzlErrorLogMapper sjSjzlErrorLogMapper;
/**
* 查询设计信息-井基础信息列表
*/
......@@ -2403,6 +2402,7 @@ public class SjDjjcController extends BaseController {
importData(multipartFile, false, sjDjjcnew);
}
} else {
sjSjzlErrorLogMapper.add(SjSjzlErrorLog.builder().jh(id).body(body).build());
String s = root.get("message").getAsString();
return AjaxResult.error(s);
}
......
package com.zjsgfa.project.zjsgfa.controller;
import com.zjsgfa.framework.web.controller.BaseController;
import com.zjsgfa.framework.web.domain.AjaxResult;
import com.zjsgfa.project.zjsgfa.domain.SjSjzlErrorLog;
import com.zjsgfa.project.zjsgfa.service.SjSjzlErrorLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.xml.ws.soap.Addressing;
import java.util.List;
/**
* 设计资料解析错误日志
*/
@Slf4j
@RestController
@RequestMapping("/system/sjsjzl")
public class SjSjzlErrorLogController extends BaseController {
@Autowired
private SjSjzlErrorLogService sjSjzlErrorLogService;
/**
* 根据井号查询错误信息
* @param jh
* @return
*/
@GetMapping("/listByJh/{jh}")
public AjaxResult listByJh(@PathVariable Long jh) {
try {
List<SjSjzlErrorLog> dataList = sjSjzlErrorLogService.listByJh(jh);
return AjaxResult.success(dataList);
}catch (Exception e) {
log.error(e.getMessage());
return AjaxResult.error(e.getMessage());
}
}
/**
* 新增
*/
@PostMapping
public AjaxResult add(@RequestBody SjSjzlErrorLog sjSjzlErrorLog) {
try {
return toAjax(sjSjzlErrorLogService.add(sjSjzlErrorLog));
} catch (Exception e) {
log.error(e.getMessage());
return error(e.getMessage());
}
}
}
package com.zjsgfa.project.zjsgfa.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SjSjzlErrorLog implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
/**
* 井号
*/
private Long jh;
/**
* 错误信息
*/
private String body;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date gxsj;
}
package com.zjsgfa.project.zjsgfa.mapper;
import com.zjsgfa.project.zjsgfa.domain.SjSjzlErrorLog;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SjSjzlErrorLogMapper {
/**
* 根据井号查询错误信息
* @param jh
* @return
*/
List<SjSjzlErrorLog> listByJh(Long jh);
/**
* 新增
* @param sjBcxxErrorLog
* @return
*/
int add(SjSjzlErrorLog sjBcxxErrorLog);
}
package com.zjsgfa.project.zjsgfa.service;
import com.zjsgfa.project.zjsgfa.domain.SjSjzlErrorLog;
import java.util.List;
public interface SjSjzlErrorLogService {
List<SjSjzlErrorLog> listByJh(Long jh);
int add(SjSjzlErrorLog sjSjzlErrorLog);
}
package com.zjsgfa.project.zjsgfa.service.impl;
import com.zjsgfa.project.zjsgfa.domain.SjSjzlErrorLog;
import com.zjsgfa.project.zjsgfa.mapper.SjSjzlErrorLogMapper;
import com.zjsgfa.project.zjsgfa.service.SjSjzlErrorLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
@Service
public class SjSjzlErrorLogServiceImpl implements SjSjzlErrorLogService {
@Autowired
private SjSjzlErrorLogMapper sjSjzlErrorLogMapper;
@Override
public List<SjSjzlErrorLog> listByJh(Long jh) {
List<SjSjzlErrorLog> dataList = sjSjzlErrorLogMapper.listByJh(jh);
return dataList;
}
@Override
public int add(SjSjzlErrorLog sjSjzlErrorLog) {
return sjSjzlErrorLogMapper.add(sjSjzlErrorLog);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zjsgfa.project.zjsgfa.mapper.SjSjzlErrorLogMapper">
<!-- 返回实体 -->
<resultMap id="SjSjzlErrorLogResult" type="SjSjzlErrorLog">
<result property="id" column="id"/>
<result property="jh" column="jh"/>
<result property="body" column="body"/>
<result property="gxsj" column="gxsj"/>
</resultMap>
<!-- 通用查询 -->
<sql id="selectCommon">
SELECT id, jh, body, gxsj FROM sj_sjzl_error_log
</sql>
<!-- 根据井号查询 -->
<select id="listByJh" parameterType="long" resultMap="SjSjzlErrorLogResult">
<include refid="selectCommon"></include> WHERE jh = #{jh}
</select>
<!-- 新增 -->
<insert id="add" parameterType="SjSjzlErrorLog">
INSERT INTO sj_sjzl_error_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jh != null">jh,</if>
<if test="body != null and body != ''">body,</if>
gxsj
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jh != null">#{jh},</if>
<if test="body != null and body != ''">#{body},</if>
now()
</trim>
</insert>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment