diff --git a/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java b/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java index 8b8c38e..2f5979e 100644 --- a/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java +++ b/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java @@ -56,6 +56,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { "/api/shop/payment/mp-alipay/getPhoneNumber", "/api/shop/test/**", "/api/shop/wx-login/**", + "/api/shop/getOpenId", + "/api/shop/getOpenId/**", "/api/apps/hualala/**", "/api/apps/hualala-cart/**", "/api/apps/test-data/**", diff --git a/src/main/java/com/gxwebsoft/law/controller/AiController.java b/src/main/java/com/gxwebsoft/law/controller/AiController.java index fff484a..556d12b 100644 --- a/src/main/java/com/gxwebsoft/law/controller/AiController.java +++ b/src/main/java/com/gxwebsoft/law/controller/AiController.java @@ -1,31 +1,24 @@ package com.gxwebsoft.law.controller; +import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.http.HttpRequest; -import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.toolkit.sql.StringEscape; import com.gxwebsoft.common.core.utils.JSONUtil; import com.gxwebsoft.common.core.web.ApiResult; import com.gxwebsoft.common.core.web.BaseController; import com.gxwebsoft.law.config.WebSocketServer; import com.gxwebsoft.law.entity.ChatMessage; -import com.gxwebsoft.law.entity.ChatResponse; import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; +import java.io.*; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -38,36 +31,35 @@ public class AiController extends BaseController { @PostMapping("/message") public ApiResult message(@RequestBody ChatMessage message) throws IOException { - Map params = new HashMap<>(); - params.put("query", message.getQuery()); - params.put("user", getLoginUserId()); - params.put("response_mode", "streaming"); - String token = "Bearer app-UxV82WXIRrScpf53exkJ7dIw"; - if (message.getType() != null) { - token = "Bearer app-7AFseF5UTEJpZGkW93S0wybh"; - } - if (message.getInputs() != null) { - Map inputs = new HashMap<>(); - inputs.put("request_type", message.getRequestType()); - inputs.put("request_json", message.getInputs()); - params.put("inputs", inputs); - } else { - params.put("inputs", new HashMap<>()); - } + Map paramsJsonStr = new HashMap<>(); + paramsJsonStr.put("query", message.getQuery()); + paramsJsonStr.put("opsType", "0"); + + Map formData = new HashMap<>(); + formData.put("user", message.getUser()); + formData.put("responseMode", "streaming"); + formData.put("paramsJsonStr", JSONUtil.toJSONString(paramsJsonStr)); + formData.put("authCode", "1fbfa21a-a3df-445e-9ca5-2c1a9eead7f4"); // 使用 Java 自带的 HttpURLConnection 发送流式请求 try { - URL url = new URL("http://workflow.gxshucheng.com:8010/v1/chat-messages"); + URL url = new URL("https://ai-console.gxshucheng.com/ai-console-api/run/v1"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); - connection.setRequestProperty("Authorization", token); - connection.setRequestProperty("Content-Type", "application/json"); + connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); connection.setDoOutput(true); connection.setConnectTimeout(600000); connection.setReadTimeout(600000); // 写入请求体 - try (OutputStream os = connection.getOutputStream()) { - os.write(JSONUtil.toJSONString(params).getBytes(StandardCharsets.UTF_8)); + try (OutputStream os = connection.getOutputStream(); + PrintWriter writer = new PrintWriter(new OutputStreamWriter(os, StandardCharsets.UTF_8))) { + for (Map.Entry entry : formData.entrySet()) { + writeFormField(writer, entry.getKey(), entry.getValue()); + } + // 添加文件上传部分(可选) + // writeFilePart(writer, "file", "test.txt", "text/plain", "This is the file content."); + writer.append("--").append(boundary).append("--").append("\r\n"); + writer.flush(); } StringBuilder responseStr = new StringBuilder(); @@ -75,7 +67,7 @@ public class AiController extends BaseController { try (BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) { String line; while ((line = br.readLine()) != null) { - System.out.println("Received chunk: " + line); // 打印接收到的每一部分数据 + System.out.println(LocalDateTimeUtil.format(LocalDateTimeUtil.now(), "yyyy-MM-dd HH:mm:ss") + " Received chunk: " + line); // 打印接收到的每一部分数据 // 这里可以对每一部分数据进行处理,例如解析或发送给前端 if (!line.isEmpty()) { String[] dataList = line.split("data: "); @@ -91,13 +83,14 @@ public class AiController extends BaseController { answerData.put("taskId", task_id); webSocketServer.sendMessage(message.getUser(), JSONUtil.toJSONString(answerData)); } - System.out.println(answer); + System.out.println("answer: " + answer); responseStr.append(answer); - }else if (data.get("event") != null && data.get("event").equals("message_end")) { + }else if (data.get("event") != null && data.get("event").equals("node_finished")) { String task_id = (String) data.get("task_id"); HashMap answerData = new HashMap<>(); answerData.put("answer", "__END__"); answerData.put("taskId", task_id); + webSocketServer.sendMessage(message.getUser(), JSONUtil.toJSONString(answerData)); } } @@ -117,22 +110,35 @@ public class AiController extends BaseController { return success("Stream processing completed"); } + private static final String boundary = "---" + System.currentTimeMillis() + "---"; + + private static void writeFormField(PrintWriter writer, String fieldName, String value) { + writer.append("--").append(boundary).append("\r\n"); + writer.append("Content-Disposition: form-data; name=\"").append(fieldName).append("\"\r\n"); + writer.append("\r\n"); + writer.append(value).append("\r\n"); + } + @PostMapping("/messageStop") public ApiResult stop(@RequestBody Map data) { if (data.get("taskId") == null) return success(); String taskId = data.get("taskId").toString(); - Map postData = new HashMap<>(); + Map postData = new HashMap<>(); postData.put("user", getLoginUserId()); - String token = "Bearer app-UxV82WXIRrScpf53exkJ7dIw"; - if (data.get("type") != null) { - token = "Bearer app-7AFseF5UTEJpZGkW93S0wybh"; - } - String res = HttpRequest.post("http://workflow.gxshucheng.com:8010/v1/chat-messages/" + taskId + "/stop") - .header("Authorization", token) + postData.put("taskId", taskId); + postData.put("authCode", "1fbfa21a-a3df-445e-9ca5-2c1a9eead7f4"); +// String token = "Bearer app-UxV82WXIRrScpf53exkJ7dIw"; +// if (data.get("type") != null) { +// token = "Bearer app-7AFseF5UTEJpZGkW93S0wybh"; +// } + System.out.println("stop payload:" + postData); + String res = HttpRequest.post("https://ai-console.gxshucheng.com/ai-console-api/stop/v1") +// .header("Authorization", token) .header("Content-Type", "application/json") .body(JSONObject.toJSONString(postData)) .execute().body(); System.out.println("stop res:" + res); return success(); } + } \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/law/controller/LawLegalAidController.java b/src/main/java/com/gxwebsoft/law/controller/LawLegalAidController.java index 013c714..845ef8b 100644 --- a/src/main/java/com/gxwebsoft/law/controller/LawLegalAidController.java +++ b/src/main/java/com/gxwebsoft/law/controller/LawLegalAidController.java @@ -78,7 +78,7 @@ public class LawLegalAidController extends BaseController { lawLegalAid.setUserId(loginUser.getUserId()); } if (lawLegalAidService.save(lawLegalAid)) { - return success("添加成功"); + return success("添加成功", lawLegalAid); } return fail("添加失败"); } diff --git a/src/main/java/com/gxwebsoft/law/controller/LawLegalMediateController.java b/src/main/java/com/gxwebsoft/law/controller/LawLegalMediateController.java new file mode 100644 index 0000000..2c61a67 --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/controller/LawLegalMediateController.java @@ -0,0 +1,115 @@ +package com.gxwebsoft.law.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.law.service.LawLegalMediateService; +import com.gxwebsoft.law.entity.LawLegalMediate; +import com.gxwebsoft.law.param.LawLegalMediateParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.system.entity.User; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 调解申请控制器 + * + * @author LX + * @since 2025-10-09 18:44:33 + */ +@Api(tags = "调解申请管理") +@RestController +@RequestMapping("/api/law/law-legal-mediate") +public class LawLegalMediateController extends BaseController { + @Resource + private LawLegalMediateService lawLegalMediateService; + + @ApiOperation("分页查询调解申请") + @GetMapping("/page") + public ApiResult> page(LawLegalMediateParam param) { + // 使用关联查询 + return success(lawLegalMediateService.pageRel(param)); + } + + @ApiOperation("查询全部调解申请") + @GetMapping() + public ApiResult> list(LawLegalMediateParam param) { + // 使用关联查询 + return success(lawLegalMediateService.listRel(param)); + } + +// @PreAuthorize("hasAuthority('law:lawLegalMediate:list')") + @ApiOperation("根据id查询调解申请") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(lawLegalMediateService.getByIdRel(id)); + } + + @ApiOperation("添加调解申请") + @PostMapping() + public ApiResult save(@RequestBody LawLegalMediate lawLegalMediate) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + lawLegalMediate.setUserId(loginUser.getUserId()); + } + if (lawLegalMediateService.save(lawLegalMediate)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("修改调解申请") + @PutMapping() + public ApiResult update(@RequestBody LawLegalMediate lawLegalMediate) { + if (lawLegalMediateService.updateById(lawLegalMediate)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("删除调解申请") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (lawLegalMediateService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @ApiOperation("批量添加调解申请") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (lawLegalMediateService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改调解申请") + @PutMapping("/batch") + public ApiResult updateBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(lawLegalMediateService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除调解申请") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (lawLegalMediateService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/law/controller/LawLegalReviewController.java b/src/main/java/com/gxwebsoft/law/controller/LawLegalReviewController.java new file mode 100644 index 0000000..0ed882c --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/controller/LawLegalReviewController.java @@ -0,0 +1,245 @@ +package com.gxwebsoft.law.controller; + +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.core.util.ZipUtil; +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.law.service.LawLegalReviewService; +import com.gxwebsoft.law.entity.LawLegalReview; +import com.gxwebsoft.law.param.LawLegalReviewParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.system.entity.User; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.models.auth.In; +import org.apache.poi.xwpf.usermodel.*; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.CopyOption; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * 行政复议申请控制器 + * + * @author LX + * @since 2025-10-09 18:00:50 + */ +@Api(tags = "行政复议申请管理") +@RestController +@RequestMapping("/api/law/law-legal-review") +public class LawLegalReviewController extends BaseController { + @Resource + private LawLegalReviewService lawLegalReviewService; + @Value("${config.upload-path}") + private String uploadPath; + @Value("${config.server-url}") + private String serverUrl; + + @ApiOperation("分页查询行政复议申请") + @GetMapping("/page") + public ApiResult> page(LawLegalReviewParam param) { + // 使用关联查询 + return success(lawLegalReviewService.pageRel(param)); + } + + @ApiOperation("查询全部行政复议申请") + @GetMapping() + public ApiResult> list(LawLegalReviewParam param) { + // 使用关联查询 + return success(lawLegalReviewService.listRel(param)); + } + + // @PreAuthorize("hasAuthority('law:lawLegalReview:list')") + @ApiOperation("根据id查询行政复议申请") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(lawLegalReviewService.getByIdRel(id)); + } + + @ApiOperation("添加行政复议申请") + @PostMapping() + public ApiResult save(@RequestBody LawLegalReview lawLegalReview) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + lawLegalReview.setUserId(loginUser.getUserId()); + } + if (lawLegalReviewService.save(lawLegalReview)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("修改行政复议申请") + @PutMapping() + public ApiResult update(@RequestBody LawLegalReview lawLegalReview) { + if (lawLegalReviewService.updateById(lawLegalReview)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("删除行政复议申请") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (lawLegalReviewService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @ApiOperation("批量添加行政复议申请") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (lawLegalReviewService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改行政复议申请") + @PutMapping("/batch") + public ApiResult updateBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(lawLegalReviewService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除行政复议申请") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (lawLegalReviewService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @ApiOperation("导出") + @PostMapping("/export") + public ApiResult export(@RequestBody LawLegalReview lawLegalReviewData) throws IOException { + List list = new ArrayList<>(); + if (lawLegalReviewData.getIdList() != null) { + list = lawLegalReviewService.listByIds(lawLegalReviewData.getIdList()); + } else { + list = lawLegalReviewService.list(); + } + XWPFDocument doc = new XWPFDocument(Files.newInputStream(Paths.get(uploadPath + "/file/行政复议申请书.docx"))); + List pathList = new ArrayList<>(); + for (LawLegalReview lawLegalReview : list) { + String dir = uploadPath + "file/doc/行政复议申请书/" + lawLegalReview.getName() + "-" + lawLegalReview.getId(); + if (!FileUtil.exist(dir)) { + FileUtil.mkdir(dir); + } + String outputPath = dir + "/行政复议申请书.docx"; + pathList.add(outputPath); + FileOutputStream fos = new FileOutputStream(outputPath); + String nameFull = ""; + String name = ""; + if (lawLegalReview.getName() != null && !lawLegalReview.getName().isEmpty()) { + nameFull = lawLegalReview.getName(); + name = lawLegalReview.getName(); + } + if (lawLegalReview.getGender() != null) + nameFull += lawLegalReview.getGender().equals(0) ? "、男" : "、女"; + if (lawLegalReview.getNation() != null && !lawLegalReview.getNation().isEmpty()) + nameFull += "、" + lawLegalReview.getNation(); + if (lawLegalReview.getBirthday() != null && !lawLegalReview.getBirthday().isEmpty()) + nameFull += "、" + lawLegalReview.getBirthday(); + if (lawLegalReview.getIdCard() != null && !lawLegalReview.getIdCard().isEmpty()) + nameFull += "、" + lawLegalReview.getIdCard(); + if (lawLegalReview.getLiveAddress() != null && !lawLegalReview.getLiveAddress().isEmpty()) + nameFull += "、" + lawLegalReview.getLiveAddress(); + + JSONArray jsonArray = new JSONArray(); + if (lawLegalReview.getFiles() != null) { + jsonArray = JSON.parseArray(lawLegalReview.getFiles()); + CopyOption[] copyOptions = new CopyOption[]{StandardCopyOption.REPLACE_EXISTING}; + if (!jsonArray.isEmpty()) { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject fileData = jsonArray.getObject(i, JSONObject.class); + String filename = fileData.getString("title"); + JSONArray fileList = fileData.getJSONArray("fileList"); + for (int j = 0; j < fileList.size(); j++) { + List extList = StrUtil.split(fileList.getString(j), "."); + String ext = extList.get(extList.size() - 1); + String filePath = dir + "/" + filename + "-文件" + (j + 1) + "." + ext; + HttpUtil.downloadFile(fileList.getString(j), filePath); + } + } + } + } + + for (XWPFParagraph paragraph : doc.getParagraphs()) { + List runs = paragraph.getRuns(); + for (XWPFRun run : runs) { + String text = run.getText(0); + if (text != null) { + if (text.contains("nameFull")) { + text = text.replace("nameFull", nameFull); + } else if (text.contains("legalPerson")) { + text = text.replace("legalPerson", lawLegalReview.getLegalPerson() == null ? "" : lawLegalReview.getLegalPerson()); + } else if (text.contains("position")) { + text = text.replace("position", lawLegalReview.getPosition() == null ? "" : lawLegalReview.getPosition()); + } else if (text.contains("proxyName")) { + text = text.replace("proxyName", lawLegalReview.getProxyName() == null ? "" : lawLegalReview.getProxyName()); + } else if (text.contains("proxyPhone")) { + text = text.replace("proxyPhone", lawLegalReview.getProxyPhone() == null ? "" : lawLegalReview.getProxyPhone()); + } else if (text.contains("respondent0")) { + text = text.replace("respondent0", lawLegalReview.getRespondent() == null ? "" : lawLegalReview.getRespondent()); + } else if (text.contains("respondentLegalPerson")) { + text = text.replace("respondentLegalPerson", lawLegalReview.getRespondentLegalPerson() == null ? "" : lawLegalReview.getRespondentLegalPerson()); + } else if (text.contains("respondentPosition")) { + text = text.replace("respondentPosition", lawLegalReview.getRespondentPosition() == null ? "" : lawLegalReview.getRespondentPosition()); + } else if (text.contains("respondentAddress")) { + text = text.replace("respondentAddress", lawLegalReview.getRespondentAddress() == null ? "" : lawLegalReview.getRespondentAddress()); + } else if (text.contains("requestContent")) { + text = text.replace("requestContent", lawLegalReview.getRequestContent() == null ? "" : lawLegalReview.getRequestContent()); + } else if (text.contains("requestReason")) { + text = text.replace("requestReason", lawLegalReview.getRequestReason() == null ? "" : lawLegalReview.getRequestReason()); + } else if (text.contains("num")) { + text = text.replace("num", String.valueOf(jsonArray.size())); + } else if (text.contains("name")) { + text = text.replace("name", name); + } else if (text.contains("date")) { + text = text.replace("date", LocalDateTimeUtil.format(lawLegalReview.getCreateTime(), "yyyy年MM月dd日")); + } +// System.out.println("text1:" + text); + run.setText(text, 0); + } + } + } + + doc.write(fos); + fos.flush(); + fos.close(); + } + ZipUtil.zip(uploadPath + "file/doc/行政复议申请书"); + for (String path : pathList) { + FileUtil.del(path); + } + return success("导出成功", serverUrl + "/file/doc/行政复议申请书.zip"); + } + +} diff --git a/src/main/java/com/gxwebsoft/law/controller/LawPoorRequestController.java b/src/main/java/com/gxwebsoft/law/controller/LawPoorRequestController.java new file mode 100644 index 0000000..0583e3e --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/controller/LawPoorRequestController.java @@ -0,0 +1,115 @@ +package com.gxwebsoft.law.controller; + +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.law.service.LawPoorRequestService; +import com.gxwebsoft.law.entity.LawPoorRequest; +import com.gxwebsoft.law.param.LawPoorRequestParam; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.BatchParam; +import com.gxwebsoft.common.core.annotation.OperationLog; +import com.gxwebsoft.common.system.entity.User; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 控制器 + * + * @author LX + * @since 2025-10-20 15:47:20 + */ +@Api(tags = "管理") +@RestController +@RequestMapping("/api/law/law-poor-request") +public class LawPoorRequestController extends BaseController { + @Resource + private LawPoorRequestService lawPoorRequestService; + + @ApiOperation("分页查询") + @GetMapping("/page") + public ApiResult> page(LawPoorRequestParam param) { + // 使用关联查询 + return success(lawPoorRequestService.pageRel(param)); + } + + @ApiOperation("查询全部") + @GetMapping() + public ApiResult> list(LawPoorRequestParam param) { + // 使用关联查询 + return success(lawPoorRequestService.listRel(param)); + } + + @PreAuthorize("hasAuthority('law:lawPoorRequest:list')") + @ApiOperation("根据id查询") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { + // 使用关联查询 + return success(lawPoorRequestService.getByIdRel(id)); + } + + @ApiOperation("添加") + @PostMapping() + public ApiResult save(@RequestBody LawPoorRequest lawPoorRequest) { + // 记录当前登录用户id + User loginUser = getLoginUser(); + if (loginUser != null) { + lawPoorRequest.setUserId(loginUser.getUserId()); + } + if (lawPoorRequestService.save(lawPoorRequest)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("修改") + @PutMapping() + public ApiResult update(@RequestBody LawPoorRequest lawPoorRequest) { + if (lawPoorRequestService.updateById(lawPoorRequest)) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("删除") + @DeleteMapping("/{id}") + public ApiResult remove(@PathVariable("id") Integer id) { + if (lawPoorRequestService.removeById(id)) { + return success("删除成功"); + } + return fail("删除失败"); + } + + @ApiOperation("批量添加") + @PostMapping("/batch") + public ApiResult saveBatch(@RequestBody List list) { + if (lawPoorRequestService.saveBatch(list)) { + return success("添加成功"); + } + return fail("添加失败"); + } + + @ApiOperation("批量修改") + @PutMapping("/batch") + public ApiResult updateBatch(@RequestBody BatchParam batchParam) { + if (batchParam.update(lawPoorRequestService, "id")) { + return success("修改成功"); + } + return fail("修改失败"); + } + + @ApiOperation("批量删除") + @DeleteMapping("/batch") + public ApiResult removeBatch(@RequestBody List ids) { + if (lawPoorRequestService.removeByIds(ids)) { + return success("删除成功"); + } + return fail("删除失败"); + } + +} diff --git a/src/main/java/com/gxwebsoft/law/entity/LawLegalAid.java b/src/main/java/com/gxwebsoft/law/entity/LawLegalAid.java index e7cfb13..e68966e 100644 --- a/src/main/java/com/gxwebsoft/law/entity/LawLegalAid.java +++ b/src/main/java/com/gxwebsoft/law/entity/LawLegalAid.java @@ -1,10 +1,8 @@ package com.gxwebsoft.law.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.*; + import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; import java.io.Serializable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -75,4 +73,6 @@ public class LawLegalAid implements Serializable { @ApiModelProperty(value = "修改时间") private LocalDateTime updateTime; + @TableField(exist = false) + private LawPoorRequest poorRequest; } diff --git a/src/main/java/com/gxwebsoft/law/entity/LawLegalMediate.java b/src/main/java/com/gxwebsoft/law/entity/LawLegalMediate.java new file mode 100644 index 0000000..a9e1d93 --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/entity/LawLegalMediate.java @@ -0,0 +1,112 @@ +package com.gxwebsoft.law.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 调解申请 + * + * @author LX + * @since 2025-10-09 18:44:33 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "LawLegalMediate对象", description = "调解申请") +@TableName("law_legal_mediate") +public class LawLegalMediate implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + private Integer userId; + + private String name; + + private Integer gender; + + private Integer age; + + private String phone; + + private String birthday; + + private String idCard; + + @ApiModelProperty(value = "住所地址") + private String liveAddress; + + @ApiModelProperty(value = "户籍地址") + private String householdAddress; + + @ApiModelProperty(value = "说明") + private String content; + + @ApiModelProperty(value = "申请事项") + private String requestContent; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @ApiModelProperty(value = "租户id") + private Integer tenantId; + + @ApiModelProperty(value = "创建时间") + private LocalDateTime createTime; + + @ApiModelProperty(value = "修改时间") + private LocalDateTime updateTime; + + private String nation; + + @ApiModelProperty(value = "工作单位") + private String companyName; + + private String email; + + @ApiModelProperty(value = "代理人姓名") + private String proxyName; + + @ApiModelProperty(value = "代理人联系电话") + private String proxyPhone; + + @ApiModelProperty(value = "关系") + private String proxyRelation; + + @ApiModelProperty(value = "代理人身份证") + private String proxyIdCard; + + @ApiModelProperty(value = "被申请人") + private String respondent; + + @ApiModelProperty(value = "被申请人身份证") + private String respondentIdCard; + + @ApiModelProperty(value = "被申请人性别") + private Integer respondentGender; + + @ApiModelProperty(value = "被申请人年龄") + private Integer respondentAge; + + @ApiModelProperty(value = "被申请人民族") + private String respondentNation; + + @ApiModelProperty(value = "被申请人职位") + private String respondentPosition; + + @ApiModelProperty(value = "被申请人地址") + private String respondentAddress; + + @ApiModelProperty(value = "被申请人手机号") + private String respondentPhone; + +} diff --git a/src/main/java/com/gxwebsoft/law/entity/LawLegalReview.java b/src/main/java/com/gxwebsoft/law/entity/LawLegalReview.java new file mode 100644 index 0000000..3cd28ca --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/entity/LawLegalReview.java @@ -0,0 +1,121 @@ +package com.gxwebsoft.law.entity; + +import com.baomidou.mybatisplus.annotation.*; + +import java.time.LocalDateTime; +import java.io.Serializable; +import java.util.List; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 行政复议申请 + * + * @author LX + * @since 2025-10-09 18:00:50 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "LawLegalReview对象", description = "行政复议申请") +@TableName("law_legal_review") +public class LawLegalReview implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + private Integer userId; + + private String name; + + private Integer gender; + + private String phone; + + private String birthday; + + private String idCard; + + @ApiModelProperty(value = "住所地址") + private String liveAddress; + + @ApiModelProperty(value = "户籍地址") + private String householdAddress; + + @ApiModelProperty(value = "说明") + private String content; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @ApiModelProperty(value = "租户id") + private Integer tenantId; + + @ApiModelProperty(value = "创建时间") + private LocalDateTime createTime; + + @ApiModelProperty(value = "修改时间") + private LocalDateTime updateTime; + + private String nation; + + @ApiModelProperty(value = "工作单位") + private String companyName; + + private String email; + + @ApiModelProperty(value = "代理人姓名") + private String proxyName; + + @ApiModelProperty(value = "代理人联系电话") + private String proxyPhone; + + @ApiModelProperty(value = "关系") + private String proxyRelation; + + @ApiModelProperty(value = "代理人身份证") + private String proxyIdCard; + + @ApiModelProperty(value = "法人/负责人") + private String legalPerson; + + @ApiModelProperty(value = "职位") + private String position; + + @ApiModelProperty(value = "被申请人") + private String respondent; + + @ApiModelProperty(value = "被申请人法人/负责人") + private String respondentLegalPerson; + + @ApiModelProperty(value = "被申请人职位") + private String respondentPosition; + + @ApiModelProperty(value = "被申请人地址") + private String respondentAddress; + + @ApiModelProperty(value = "行政复议请求") + private String requestContent; + + @ApiModelProperty(value = "行政复议理由") + private String requestReason; + + @ApiModelProperty(value = "政府部门") + private String govName; + + @ApiModelProperty(value = "材料") + private String files; + + @ApiModelProperty(value = "申请人身份证明材料") + private String personFile; + + @ApiModelProperty(value = "代理材料") + private String proxyFile; + + @TableField(exist = false) + private List idList; +} diff --git a/src/main/java/com/gxwebsoft/law/entity/LawPoorRequest.java b/src/main/java/com/gxwebsoft/law/entity/LawPoorRequest.java new file mode 100644 index 0000000..97ff05c --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/entity/LawPoorRequest.java @@ -0,0 +1,82 @@ +package com.gxwebsoft.law.entity; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * + * + * @author LX + * @since 2025-10-20 15:47:20 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "LawPoorRequest对象", description = "") +@TableName("law_poor_request") +public class LawPoorRequest implements Serializable { + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + private Integer aidId; + + @ApiModelProperty(value = "人员列表") + private String peopleList; + + @ApiModelProperty(value = "总收入") + private BigDecimal totalIncome; + + @ApiModelProperty(value = "人均月收入") + private BigDecimal avgIncome; + + @ApiModelProperty(value = "房产几套") + private Integer houseNum; + + @ApiModelProperty(value = "房产面积") + private BigDecimal houseArea; + + @ApiModelProperty(value = "房产位置") + private String houseAddress; + + @ApiModelProperty(value = "汽车品牌型号") + private String car; + + @ApiModelProperty(value = "现金等资产") + private BigDecimal cash; + + @ApiModelProperty(value = "其他资产说明") + private String otherProperty; + + @ApiModelProperty(value = "重大支出") + private String outcome; + + private String name; + + private String phone; + + private Integer userId; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @TableLogic + private Integer deleted; + + @ApiModelProperty(value = "租户id") + private Integer tenantId; + + @ApiModelProperty(value = "创建时间") + private LocalDateTime createTime; + + @ApiModelProperty(value = "修改时间") + private LocalDateTime updateTime; + +} diff --git a/src/main/java/com/gxwebsoft/law/mapper/LawLegalMediateMapper.java b/src/main/java/com/gxwebsoft/law/mapper/LawLegalMediateMapper.java new file mode 100644 index 0000000..b8167c6 --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/mapper/LawLegalMediateMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.law.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.law.entity.LawLegalMediate; +import com.gxwebsoft.law.param.LawLegalMediateParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 调解申请Mapper + * + * @author LX + * @since 2025-10-09 18:44:33 + */ +public interface LawLegalMediateMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") LawLegalMediateParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") LawLegalMediateParam param); + +} diff --git a/src/main/java/com/gxwebsoft/law/mapper/LawLegalReviewMapper.java b/src/main/java/com/gxwebsoft/law/mapper/LawLegalReviewMapper.java new file mode 100644 index 0000000..6a4cafa --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/mapper/LawLegalReviewMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.law.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.law.entity.LawLegalReview; +import com.gxwebsoft.law.param.LawLegalReviewParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 行政复议申请Mapper + * + * @author LX + * @since 2025-10-09 18:00:50 + */ +public interface LawLegalReviewMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") LawLegalReviewParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") LawLegalReviewParam param); + +} diff --git a/src/main/java/com/gxwebsoft/law/mapper/LawPoorRequestMapper.java b/src/main/java/com/gxwebsoft/law/mapper/LawPoorRequestMapper.java new file mode 100644 index 0000000..2dc4b50 --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/mapper/LawPoorRequestMapper.java @@ -0,0 +1,37 @@ +package com.gxwebsoft.law.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.gxwebsoft.law.entity.LawPoorRequest; +import com.gxwebsoft.law.param.LawPoorRequestParam; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * Mapper + * + * @author LX + * @since 2025-10-20 15:47:20 + */ +public interface LawPoorRequestMapper extends BaseMapper { + + /** + * 分页查询 + * + * @param page 分页对象 + * @param param 查询参数 + * @return List + */ + List selectPageRel(@Param("page") IPage page, + @Param("param") LawPoorRequestParam param); + + /** + * 查询全部 + * + * @param param 查询参数 + * @return List + */ + List selectListRel(@Param("param") LawPoorRequestParam param); + +} diff --git a/src/main/java/com/gxwebsoft/law/mapper/xml/LawLegalAidMapper.xml b/src/main/java/com/gxwebsoft/law/mapper/xml/LawLegalAidMapper.xml index 454a426..9a4a15a 100644 --- a/src/main/java/com/gxwebsoft/law/mapper/xml/LawLegalAidMapper.xml +++ b/src/main/java/com/gxwebsoft/law/mapper/xml/LawLegalAidMapper.xml @@ -10,6 +10,9 @@ AND a.id = #{param.id} + + AND a.aid_id = #{param.aidId} + AND a.user_id = #{param.userId} diff --git a/src/main/java/com/gxwebsoft/law/mapper/xml/LawLegalMediateMapper.xml b/src/main/java/com/gxwebsoft/law/mapper/xml/LawLegalMediateMapper.xml new file mode 100644 index 0000000..7635c8c --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/mapper/xml/LawLegalMediateMapper.xml @@ -0,0 +1,117 @@ + + + + + + + SELECT a.* + FROM law_legal_mediate a + + + AND a.id = #{param.id} + + + AND a.user_id = #{param.userId} + + + AND a.name LIKE CONCAT('%', #{param.name}, '%') + + + AND a.gender = #{param.gender} + + + AND a.age = #{param.age} + + + AND a.phone LIKE CONCAT('%', #{param.phone}, '%') + + + AND a.birthday LIKE CONCAT('%', #{param.birthday}, '%') + + + AND a.id_card LIKE CONCAT('%', #{param.idCard}, '%') + + + AND a.live_address LIKE CONCAT('%', #{param.liveAddress}, '%') + + + AND a.household_address LIKE CONCAT('%', #{param.householdAddress}, '%') + + + AND a.content LIKE CONCAT('%', #{param.content}, '%') + + + AND a.request_content LIKE CONCAT('%', #{param.requestContent}, '%') + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND a.nation LIKE CONCAT('%', #{param.nation}, '%') + + + AND a.company_name LIKE CONCAT('%', #{param.companyName}, '%') + + + AND a.email LIKE CONCAT('%', #{param.email}, '%') + + + AND a.proxy_name LIKE CONCAT('%', #{param.proxyName}, '%') + + + AND a.proxy_phone LIKE CONCAT('%', #{param.proxyPhone}, '%') + + + AND a.proxy_relation LIKE CONCAT('%', #{param.proxyRelation}, '%') + + + AND a.proxy_id_card LIKE CONCAT('%', #{param.proxyIdCard}, '%') + + + AND a.respondent LIKE CONCAT('%', #{param.respondent}, '%') + + + AND a.respondent_id_card LIKE CONCAT('%', #{param.respondentIdCard}, '%') + + + AND a.respondent_gender = #{param.respondentGender} + + + AND a.respondent_age = #{param.respondentAge} + + + AND a.respondent_nation LIKE CONCAT('%', #{param.respondentNation}, '%') + + + AND a.respondent_position LIKE CONCAT('%', #{param.respondentPosition}, '%') + + + AND a.respondent_address LIKE CONCAT('%', #{param.respondentAddress}, '%') + + + AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/law/mapper/xml/LawLegalReviewMapper.xml b/src/main/java/com/gxwebsoft/law/mapper/xml/LawLegalReviewMapper.xml new file mode 100644 index 0000000..5fc70a7 --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/mapper/xml/LawLegalReviewMapper.xml @@ -0,0 +1,126 @@ + + + + + + + SELECT a.* + FROM law_legal_review a + + + AND a.id = #{param.id} + + + AND a.user_id = #{param.userId} + + + AND a.name LIKE CONCAT('%', #{param.name}, '%') + + + AND a.gender = #{param.gender} + + + AND a.phone LIKE CONCAT('%', #{param.phone}, '%') + + + AND a.birthday LIKE CONCAT('%', #{param.birthday}, '%') + + + AND a.id_card LIKE CONCAT('%', #{param.idCard}, '%') + + + AND a.live_address LIKE CONCAT('%', #{param.liveAddress}, '%') + + + AND a.household_address LIKE CONCAT('%', #{param.householdAddress}, '%') + + + AND a.content LIKE CONCAT('%', #{param.content}, '%') + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND a.nation LIKE CONCAT('%', #{param.nation}, '%') + + + AND a.company_name LIKE CONCAT('%', #{param.companyName}, '%') + + + AND a.email LIKE CONCAT('%', #{param.email}, '%') + + + AND a.proxy_name LIKE CONCAT('%', #{param.proxyName}, '%') + + + AND a.proxy_phone LIKE CONCAT('%', #{param.proxyPhone}, '%') + + + AND a.proxy_relation LIKE CONCAT('%', #{param.proxyRelation}, '%') + + + AND a.proxy_id_card LIKE CONCAT('%', #{param.proxyIdCard}, '%') + + + AND a.legal_person LIKE CONCAT('%', #{param.legalPerson}, '%') + + + AND a.position LIKE CONCAT('%', #{param.position}, '%') + + + AND a.respondent LIKE CONCAT('%', #{param.respondent}, '%') + + + AND a.respondent_legal_person LIKE CONCAT('%', #{param.respondentLegalPerson}, '%') + + + AND a.respondent_position LIKE CONCAT('%', #{param.respondentPosition}, '%') + + + AND a.respondent_address LIKE CONCAT('%', #{param.respondentAddress}, '%') + + + AND a.request_content LIKE CONCAT('%', #{param.requestContent}, '%') + + + AND a.request_reason LIKE CONCAT('%', #{param.requestReason}, '%') + + + AND a.gov_name LIKE CONCAT('%', #{param.govName}, '%') + + + AND a.files LIKE CONCAT('%', #{param.files}, '%') + + + AND a.person_file LIKE CONCAT('%', #{param.personFile}, '%') + + + AND a.proxy_file LIKE CONCAT('%', #{param.proxyFile}, '%') + + + AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/law/mapper/xml/LawPoorRequestMapper.xml b/src/main/java/com/gxwebsoft/law/mapper/xml/LawPoorRequestMapper.xml new file mode 100644 index 0000000..c786c7b --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/mapper/xml/LawPoorRequestMapper.xml @@ -0,0 +1,78 @@ + + + + + + + SELECT a.* + FROM law_poor_request a + + + AND a.id = #{param.id} + + + AND a.people_list LIKE CONCAT('%', #{param.peopleList}, '%') + + + AND a.total_income = #{param.totalIncome} + + + AND a.avg_income = #{param.avgIncome} + + + AND a.house_num = #{param.houseNum} + + + AND a.house_area = #{param.houseArea} + + + AND a.house_address LIKE CONCAT('%', #{param.houseAddress}, '%') + + + AND a.car LIKE CONCAT('%', #{param.car}, '%') + + + AND a.cash = #{param.cash} + + + AND a.other_property LIKE CONCAT('%', #{param.otherProperty}, '%') + + + AND a.outcome LIKE CONCAT('%', #{param.outcome}, '%') + + + AND a.name LIKE CONCAT('%', #{param.name}, '%') + + + AND a.phone LIKE CONCAT('%', #{param.phone}, '%') + + + AND a.deleted = #{param.deleted} + + + AND a.deleted = 0 + + + AND a.create_time >= #{param.createTimeStart} + + + AND a.create_time <= #{param.createTimeEnd} + + + AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') + ) + + + + + + + + + + + diff --git a/src/main/java/com/gxwebsoft/law/param/LawLegalAidParam.java b/src/main/java/com/gxwebsoft/law/param/LawLegalAidParam.java index 7217158..6df963c 100644 --- a/src/main/java/com/gxwebsoft/law/param/LawLegalAidParam.java +++ b/src/main/java/com/gxwebsoft/law/param/LawLegalAidParam.java @@ -26,6 +26,8 @@ public class LawLegalAidParam extends BaseParam { @QueryField(type = QueryType.EQ) private Integer id; + private Integer aidId; + @QueryField(type = QueryType.EQ) private Integer userId; diff --git a/src/main/java/com/gxwebsoft/law/param/LawLegalMediateParam.java b/src/main/java/com/gxwebsoft/law/param/LawLegalMediateParam.java new file mode 100644 index 0000000..c72ad05 --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/param/LawLegalMediateParam.java @@ -0,0 +1,104 @@ +package com.gxwebsoft.law.param; + +import java.math.BigDecimal; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 调解申请查询参数 + * + * @author LX + * @since 2025-10-09 18:44:33 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "LawLegalMediateParam对象", description = "调解申请查询参数") +public class LawLegalMediateParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @QueryField(type = QueryType.EQ) + private Integer id; + + @QueryField(type = QueryType.EQ) + private Integer userId; + + private String name; + + @QueryField(type = QueryType.EQ) + private Integer gender; + + @QueryField(type = QueryType.EQ) + private Integer age; + + private String phone; + + private String birthday; + + private String idCard; + + @ApiModelProperty(value = "住所地址") + private String liveAddress; + + @ApiModelProperty(value = "户籍地址") + private String householdAddress; + + @ApiModelProperty(value = "说明") + private String content; + + @ApiModelProperty(value = "申请事项") + private String requestContent; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + + private String nation; + + @ApiModelProperty(value = "工作单位") + private String companyName; + + private String email; + + @ApiModelProperty(value = "代理人姓名") + private String proxyName; + + @ApiModelProperty(value = "代理人联系电话") + private String proxyPhone; + + @ApiModelProperty(value = "关系") + private String proxyRelation; + + @ApiModelProperty(value = "代理人身份证") + private String proxyIdCard; + + @ApiModelProperty(value = "被申请人") + private String respondent; + + @ApiModelProperty(value = "被申请人身份证") + private String respondentIdCard; + + @ApiModelProperty(value = "被申请人性别") + @QueryField(type = QueryType.EQ) + private Integer respondentGender; + + @ApiModelProperty(value = "被申请人年龄") + @QueryField(type = QueryType.EQ) + private Integer respondentAge; + + @ApiModelProperty(value = "被申请人民族") + private String respondentNation; + + @ApiModelProperty(value = "被申请人职位") + private String respondentPosition; + + @ApiModelProperty(value = "被申请人地址") + private String respondentAddress; + +} diff --git a/src/main/java/com/gxwebsoft/law/param/LawLegalReviewParam.java b/src/main/java/com/gxwebsoft/law/param/LawLegalReviewParam.java new file mode 100644 index 0000000..91e39fa --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/param/LawLegalReviewParam.java @@ -0,0 +1,111 @@ +package com.gxwebsoft.law.param; + +import java.math.BigDecimal; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 行政复议申请查询参数 + * + * @author LX + * @since 2025-10-09 18:00:49 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "LawLegalReviewParam对象", description = "行政复议申请查询参数") +public class LawLegalReviewParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @QueryField(type = QueryType.EQ) + private Integer id; + + @QueryField(type = QueryType.EQ) + private Integer userId; + + private String name; + + @QueryField(type = QueryType.EQ) + private Integer gender; + + private String phone; + + private String birthday; + + private String idCard; + + @ApiModelProperty(value = "住所地址") + private String liveAddress; + + @ApiModelProperty(value = "户籍地址") + private String householdAddress; + + @ApiModelProperty(value = "说明") + private String content; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + + private String nation; + + @ApiModelProperty(value = "工作单位") + private String companyName; + + private String email; + + @ApiModelProperty(value = "代理人姓名") + private String proxyName; + + @ApiModelProperty(value = "代理人联系电话") + private String proxyPhone; + + @ApiModelProperty(value = "关系") + private String proxyRelation; + + @ApiModelProperty(value = "代理人身份证") + private String proxyIdCard; + + @ApiModelProperty(value = "法人/负责人") + private String legalPerson; + + @ApiModelProperty(value = "职位") + private String position; + + @ApiModelProperty(value = "被申请人") + private String respondent; + + @ApiModelProperty(value = "被申请人法人/负责人") + private String respondentLegalPerson; + + @ApiModelProperty(value = "被申请人职位") + private String respondentPosition; + + @ApiModelProperty(value = "被申请人地址") + private String respondentAddress; + + @ApiModelProperty(value = "行政复议请求") + private String requestContent; + + @ApiModelProperty(value = "行政复议理由") + private String requestReason; + + @ApiModelProperty(value = "政府部门") + private String govName; + + @ApiModelProperty(value = "材料") + private String files; + + @ApiModelProperty(value = "申请人身份证明材料") + private String personFile; + + @ApiModelProperty(value = "代理材料") + private String proxyFile; + +} diff --git a/src/main/java/com/gxwebsoft/law/param/LawPoorRequestParam.java b/src/main/java/com/gxwebsoft/law/param/LawPoorRequestParam.java new file mode 100644 index 0000000..bb56099 --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/param/LawPoorRequestParam.java @@ -0,0 +1,75 @@ +package com.gxwebsoft.law.param; + +import java.math.BigDecimal; +import com.gxwebsoft.common.core.annotation.QueryField; +import com.gxwebsoft.common.core.annotation.QueryType; +import com.gxwebsoft.common.core.web.BaseParam; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 查询参数 + * + * @author LX + * @since 2025-10-20 15:47:20 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@JsonInclude(JsonInclude.Include.NON_NULL) +@ApiModel(value = "LawPoorRequestParam对象", description = "查询参数") +public class LawPoorRequestParam extends BaseParam { + private static final long serialVersionUID = 1L; + + @QueryField(type = QueryType.EQ) + private Integer id; + + @QueryField(type = QueryType.EQ) + private Integer aidId; + + @ApiModelProperty(value = "人员列表") + private String peopleList; + + @ApiModelProperty(value = "总收入") + @QueryField(type = QueryType.EQ) + private BigDecimal totalIncome; + + @ApiModelProperty(value = "人均月收入") + @QueryField(type = QueryType.EQ) + private BigDecimal avgIncome; + + @ApiModelProperty(value = "房产几套") + @QueryField(type = QueryType.EQ) + private Integer houseNum; + + @ApiModelProperty(value = "房产面积") + @QueryField(type = QueryType.EQ) + private BigDecimal houseArea; + + @ApiModelProperty(value = "房产位置") + private String houseAddress; + + @ApiModelProperty(value = "汽车品牌型号") + private String car; + + @ApiModelProperty(value = "现金等资产") + @QueryField(type = QueryType.EQ) + private BigDecimal cash; + + @ApiModelProperty(value = "其他资产说明") + private String otherProperty; + + @ApiModelProperty(value = "重大支出") + private String outcome; + + private String name; + + private String phone; + + @ApiModelProperty(value = "是否删除, 0否, 1是") + @QueryField(type = QueryType.EQ) + private Integer deleted; + +} diff --git a/src/main/java/com/gxwebsoft/law/service/LawLegalMediateService.java b/src/main/java/com/gxwebsoft/law/service/LawLegalMediateService.java new file mode 100644 index 0000000..042ac07 --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/service/LawLegalMediateService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.law.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.law.entity.LawLegalMediate; +import com.gxwebsoft.law.param.LawLegalMediateParam; + +import java.util.List; + +/** + * 调解申请Service + * + * @author LX + * @since 2025-10-09 18:44:33 + */ +public interface LawLegalMediateService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(LawLegalMediateParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(LawLegalMediateParam param); + + /** + * 根据id查询 + * + * @param id + * @return LawLegalMediate + */ + LawLegalMediate getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/law/service/LawLegalReviewService.java b/src/main/java/com/gxwebsoft/law/service/LawLegalReviewService.java new file mode 100644 index 0000000..f71ab4a --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/service/LawLegalReviewService.java @@ -0,0 +1,42 @@ +package com.gxwebsoft.law.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.law.entity.LawLegalReview; +import com.gxwebsoft.law.param.LawLegalReviewParam; + +import java.util.List; + +/** + * 行政复议申请Service + * + * @author LX + * @since 2025-10-09 18:00:50 + */ +public interface LawLegalReviewService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(LawLegalReviewParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(LawLegalReviewParam param); + + /** + * 根据id查询 + * + * @param id + * @return LawLegalReview + */ + LawLegalReview getByIdRel(Integer id); + +} diff --git a/src/main/java/com/gxwebsoft/law/service/LawPoorRequestService.java b/src/main/java/com/gxwebsoft/law/service/LawPoorRequestService.java new file mode 100644 index 0000000..936b5a9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/service/LawPoorRequestService.java @@ -0,0 +1,43 @@ +package com.gxwebsoft.law.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.law.entity.LawPoorRequest; +import com.gxwebsoft.law.param.LawPoorRequestParam; + +import java.util.List; + +/** + * Service + * + * @author LX + * @since 2025-10-20 15:47:20 + */ +public interface LawPoorRequestService extends IService { + + /** + * 分页关联查询 + * + * @param param 查询参数 + * @return PageResult + */ + PageResult pageRel(LawPoorRequestParam param); + + /** + * 关联查询全部 + * + * @param param 查询参数 + * @return List + */ + List listRel(LawPoorRequestParam param); + + /** + * 根据id查询 + * + * @param id + * @return LawPoorRequest + */ + LawPoorRequest getByIdRel(Integer id); + + LawPoorRequest getByAidId(Integer aidId); +} diff --git a/src/main/java/com/gxwebsoft/law/service/impl/LawLegalAidServiceImpl.java b/src/main/java/com/gxwebsoft/law/service/impl/LawLegalAidServiceImpl.java index 59a1a31..c5cc3b0 100644 --- a/src/main/java/com/gxwebsoft/law/service/impl/LawLegalAidServiceImpl.java +++ b/src/main/java/com/gxwebsoft/law/service/impl/LawLegalAidServiceImpl.java @@ -7,8 +7,10 @@ import com.gxwebsoft.law.entity.LawLegalAid; import com.gxwebsoft.law.param.LawLegalAidParam; import com.gxwebsoft.common.core.web.PageParam; import com.gxwebsoft.common.core.web.PageResult; +import com.gxwebsoft.law.service.LawPoorRequestService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.List; /** @@ -19,12 +21,17 @@ import java.util.List; */ @Service public class LawLegalAidServiceImpl extends ServiceImpl implements LawLegalAidService { + @Resource + private LawPoorRequestService lawPoorRequestService; @Override public PageResult pageRel(LawLegalAidParam param) { PageParam page = new PageParam<>(param); page.setDefaultOrder("sort_number asc, create_time desc"); List list = baseMapper.selectPageRel(page, param); + for (LawLegalAid lawLegalAid : list) { + lawLegalAid.setPoorRequest(lawPoorRequestService.getByAidId(lawLegalAid.getId())); + } return new PageResult<>(list, page.getTotal()); } diff --git a/src/main/java/com/gxwebsoft/law/service/impl/LawLegalMediateServiceImpl.java b/src/main/java/com/gxwebsoft/law/service/impl/LawLegalMediateServiceImpl.java new file mode 100644 index 0000000..f4641ca --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/service/impl/LawLegalMediateServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.law.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.law.mapper.LawLegalMediateMapper; +import com.gxwebsoft.law.service.LawLegalMediateService; +import com.gxwebsoft.law.entity.LawLegalMediate; +import com.gxwebsoft.law.param.LawLegalMediateParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 调解申请Service实现 + * + * @author LX + * @since 2025-10-09 18:44:33 + */ +@Service +public class LawLegalMediateServiceImpl extends ServiceImpl implements LawLegalMediateService { + + @Override + public PageResult pageRel(LawLegalMediateParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(LawLegalMediateParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("sort_number asc, create_time desc"); + return page.sortRecords(list); + } + + @Override + public LawLegalMediate getByIdRel(Integer id) { + LawLegalMediateParam param = new LawLegalMediateParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/law/service/impl/LawLegalReviewServiceImpl.java b/src/main/java/com/gxwebsoft/law/service/impl/LawLegalReviewServiceImpl.java new file mode 100644 index 0000000..032d8a9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/service/impl/LawLegalReviewServiceImpl.java @@ -0,0 +1,47 @@ +package com.gxwebsoft.law.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.law.mapper.LawLegalReviewMapper; +import com.gxwebsoft.law.service.LawLegalReviewService; +import com.gxwebsoft.law.entity.LawLegalReview; +import com.gxwebsoft.law.param.LawLegalReviewParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 行政复议申请Service实现 + * + * @author LX + * @since 2025-10-09 18:00:50 + */ +@Service +public class LawLegalReviewServiceImpl extends ServiceImpl implements LawLegalReviewService { + + @Override + public PageResult pageRel(LawLegalReviewParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(LawLegalReviewParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("sort_number asc, create_time desc"); + return page.sortRecords(list); + } + + @Override + public LawLegalReview getByIdRel(Integer id) { + LawLegalReviewParam param = new LawLegalReviewParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + +} diff --git a/src/main/java/com/gxwebsoft/law/service/impl/LawPoorRequestServiceImpl.java b/src/main/java/com/gxwebsoft/law/service/impl/LawPoorRequestServiceImpl.java new file mode 100644 index 0000000..234b69a --- /dev/null +++ b/src/main/java/com/gxwebsoft/law/service/impl/LawPoorRequestServiceImpl.java @@ -0,0 +1,57 @@ +package com.gxwebsoft.law.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.law.mapper.LawPoorRequestMapper; +import com.gxwebsoft.law.service.LawPoorRequestService; +import com.gxwebsoft.law.entity.LawPoorRequest; +import com.gxwebsoft.law.param.LawPoorRequestParam; +import com.gxwebsoft.common.core.web.PageParam; +import com.gxwebsoft.common.core.web.PageResult; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Service实现 + * + * @author LX + * @since 2025-10-20 15:47:20 + */ +@Service +public class LawPoorRequestServiceImpl extends ServiceImpl implements LawPoorRequestService { + + @Override + public PageResult pageRel(LawPoorRequestParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("sort_number asc, create_time desc"); + List list = baseMapper.selectPageRel(page, param); + return new PageResult<>(list, page.getTotal()); + } + + @Override + public List listRel(LawPoorRequestParam param) { + List list = baseMapper.selectListRel(param); + // 排序 + PageParam page = new PageParam<>(); + page.setDefaultOrder("sort_number asc, create_time desc"); + return page.sortRecords(list); + } + + @Override + public LawPoorRequest getByIdRel(Integer id) { + LawPoorRequestParam param = new LawPoorRequestParam(); + param.setId(id); + return param.getOne(baseMapper.selectListRel(param)); + } + + @Override + public LawPoorRequest getByAidId(Integer aidId) { + return getOne( + new LambdaQueryWrapper() + .eq(LawPoorRequest::getAidId, aidId) + .last("limit 1") + ); + } + +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 11c717f..070e17e 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -3,9 +3,9 @@ # 数据源配置 spring: datasource: - url: jdbc:mysql://127.0.0.1:3306/law?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8 - username: root - password: root + url: jdbc:mysql://1.14.159.185:3318/law?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8 + username: law + password: HAXx4Ar2aNPCnBKi driver-class-name: com.mysql.cj.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource diff --git a/src/test/java/com/gxwebsoft/generator/LawGenerator.java b/src/test/java/com/gxwebsoft/generator/LawGenerator.java index de1f0e6..02e3375 100644 --- a/src/test/java/com/gxwebsoft/generator/LawGenerator.java +++ b/src/test/java/com/gxwebsoft/generator/LawGenerator.java @@ -45,8 +45,8 @@ public class LawGenerator { private static final String MODULE_NAME = "law"; // 需要生成的表 private static final String[] TABLE_NAMES = new String[]{ - "law_notary_config", - "law_notary_list", + "law_poor_request", +// "law_notary_list", }; // 需要去除的表前缀