diff --git a/src/main/java/com/gxwebsoft/clinic/controller/ClinicAppointmentController.java b/src/main/java/com/gxwebsoft/clinic/controller/ClinicAppointmentController.java deleted file mode 100644 index cf186e3..0000000 --- a/src/main/java/com/gxwebsoft/clinic/controller/ClinicAppointmentController.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.gxwebsoft.clinic.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.clinic.service.ClinicAppointmentService; -import com.gxwebsoft.clinic.entity.ClinicAppointment; -import com.gxwebsoft.clinic.param.ClinicAppointmentParam; -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 io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 挂号控制器 - * - * @author 科技小王子 - * @since 2025-10-19 09:27:04 - */ -@Tag(name = "挂号管理") -@RestController -@RequestMapping("/api/clinic/clinic-appointment") -public class ClinicAppointmentController extends BaseController { - @Resource - private ClinicAppointmentService clinicAppointmentService; - - @Operation(summary = "分页查询挂号") - @GetMapping("/page") - public ApiResult> page(ClinicAppointmentParam param) { - // 使用关联查询 - return success(clinicAppointmentService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicAppointment:list')") - @Operation(summary = "查询全部挂号") - @GetMapping() - public ApiResult> list(ClinicAppointmentParam param) { - // 使用关联查询 - return success(clinicAppointmentService.listRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicAppointment:list')") - @Operation(summary = "根据id查询挂号") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(clinicAppointmentService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('clinic:clinicAppointment:save')") - @OperationLog - @Operation(summary = "添加挂号") - @PostMapping() - public ApiResult save(@RequestBody ClinicAppointment clinicAppointment) { - if (clinicAppointmentService.save(clinicAppointment)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicAppointment:update')") - @OperationLog - @Operation(summary = "修改挂号") - @PutMapping() - public ApiResult update(@RequestBody ClinicAppointment clinicAppointment) { - if (clinicAppointmentService.updateById(clinicAppointment)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicAppointment:remove')") - @OperationLog - @Operation(summary = "删除挂号") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (clinicAppointmentService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicAppointment:save')") - @OperationLog - @Operation(summary = "批量添加挂号") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (clinicAppointmentService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicAppointment:update')") - @OperationLog - @Operation(summary = "批量修改挂号") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(clinicAppointmentService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicAppointment:remove')") - @OperationLog - @Operation(summary = "批量删除挂号") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (clinicAppointmentService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/controller/ClinicDoctorApplyController.java b/src/main/java/com/gxwebsoft/clinic/controller/ClinicDoctorApplyController.java deleted file mode 100644 index 7471fa7..0000000 --- a/src/main/java/com/gxwebsoft/clinic/controller/ClinicDoctorApplyController.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.gxwebsoft.clinic.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.clinic.service.ClinicDoctorApplyService; -import com.gxwebsoft.clinic.entity.ClinicDoctorApply; -import com.gxwebsoft.clinic.param.ClinicDoctorApplyParam; -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 io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 医生入驻申请控制器 - * - * @author 科技小王子 - * @since 2025-10-19 09:27:04 - */ -@Tag(name = "医生入驻申请管理") -@RestController -@RequestMapping("/api/clinic/clinic-doctor-apply") -public class ClinicDoctorApplyController extends BaseController { - @Resource - private ClinicDoctorApplyService clinicDoctorApplyService; - - @PreAuthorize("hasAuthority('clinic:clinicDoctorApply:list')") - @Operation(summary = "分页查询医生入驻申请") - @GetMapping("/page") - public ApiResult> page(ClinicDoctorApplyParam param) { - // 使用关联查询 - return success(clinicDoctorApplyService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorApply:list')") - @Operation(summary = "查询全部医生入驻申请") - @GetMapping() - public ApiResult> list(ClinicDoctorApplyParam param) { - // 使用关联查询 - return success(clinicDoctorApplyService.listRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorApply:list')") - @Operation(summary = "根据id查询医生入驻申请") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(clinicDoctorApplyService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorApply:save')") - @OperationLog - @Operation(summary = "添加医生入驻申请") - @PostMapping() - public ApiResult save(@RequestBody ClinicDoctorApply clinicDoctorApply) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // clinicDoctorApply.setUserId(loginUser.getUserId()); - // } - if (clinicDoctorApplyService.save(clinicDoctorApply)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorApply:update')") - @OperationLog - @Operation(summary = "修改医生入驻申请") - @PutMapping() - public ApiResult update(@RequestBody ClinicDoctorApply clinicDoctorApply) { - if (clinicDoctorApplyService.updateById(clinicDoctorApply)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorApply:remove')") - @OperationLog - @Operation(summary = "删除医生入驻申请") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (clinicDoctorApplyService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorApply:save')") - @OperationLog - @Operation(summary = "批量添加医生入驻申请") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (clinicDoctorApplyService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorApply:update')") - @OperationLog - @Operation(summary = "批量修改医生入驻申请") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(clinicDoctorApplyService, "apply_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorApply:remove')") - @OperationLog - @Operation(summary = "批量删除医生入驻申请") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (clinicDoctorApplyService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/controller/ClinicDoctorUserController.java b/src/main/java/com/gxwebsoft/clinic/controller/ClinicDoctorUserController.java deleted file mode 100644 index 9f7012e..0000000 --- a/src/main/java/com/gxwebsoft/clinic/controller/ClinicDoctorUserController.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.gxwebsoft.clinic.controller; - -import com.gxwebsoft.clinic.entity.ClinicDoctorUser; -import com.gxwebsoft.clinic.param.ClinicDoctorUserParam; -import com.gxwebsoft.clinic.service.ClinicDoctorUserService; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 分销商用户记录表控制器 - * - * @author 科技小王子 - * @since 2025-10-23 15:58:21 - */ -@Tag(name = "分销商用户记录表管理") -@RestController -@RequestMapping("/api/clinic/clinic-doctor-user") -public class ClinicDoctorUserController extends BaseController { - @Resource - private ClinicDoctorUserService clinicDoctorUserService; - - @PreAuthorize("hasAuthority('clinic:clinicDoctorUser:list')") - @Operation(summary = "分页查询分销商用户记录表") - @GetMapping("/page") - public ApiResult> page(ClinicDoctorUserParam param) { - // 使用关联查询 - return success(clinicDoctorUserService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorUser:list')") - @Operation(summary = "查询全部分销商用户记录表") - @GetMapping() - public ApiResult> list(ClinicDoctorUserParam param) { - // 使用关联查询 - return success(clinicDoctorUserService.listRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorUser:list')") - @Operation(summary = "根据id查询分销商用户记录表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(clinicDoctorUserService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorUser:save')") - @OperationLog - @Operation(summary = "添加分销商用户记录表") - @PostMapping() - public ApiResult save(@RequestBody ClinicDoctorUser clinicDoctorUser) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - clinicDoctorUser.setUserId(loginUser.getUserId()); - } - if (clinicDoctorUserService.save(clinicDoctorUser)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorUser:update')") - @OperationLog - @Operation(summary = "修改分销商用户记录表") - @PutMapping() - public ApiResult update(@RequestBody ClinicDoctorUser clinicDoctorUser) { - if (clinicDoctorUserService.updateById(clinicDoctorUser)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorUser:remove')") - @OperationLog - @Operation(summary = "删除分销商用户记录表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (clinicDoctorUserService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorUser:save')") - @OperationLog - @Operation(summary = "批量添加分销商用户记录表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (clinicDoctorUserService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorUser:update')") - @OperationLog - @Operation(summary = "批量修改分销商用户记录表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(clinicDoctorUserService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicDoctorUser:remove')") - @OperationLog - @Operation(summary = "批量删除分销商用户记录表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (clinicDoctorUserService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/controller/ClinicMedicineController.java b/src/main/java/com/gxwebsoft/clinic/controller/ClinicMedicineController.java deleted file mode 100644 index 28e27c6..0000000 --- a/src/main/java/com/gxwebsoft/clinic/controller/ClinicMedicineController.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.gxwebsoft.clinic.controller; - -import com.gxwebsoft.clinic.entity.ClinicMedicine; -import com.gxwebsoft.clinic.param.ClinicMedicineParam; -import com.gxwebsoft.clinic.service.ClinicMedicineService; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 药品库控制器 - * - * @author 科技小王子 - * @since 2025-10-22 02:06:32 - */ -@Tag(name = "药品库管理") -@RestController -@RequestMapping("/api/clinic/clinic-medicine") -public class ClinicMedicineController extends BaseController { - @Resource - private ClinicMedicineService clinicMedicineService; - - @PreAuthorize("hasAuthority('clinic:clinicMedicine:list')") - @Operation(summary = "分页查询药品库") - @GetMapping("/page") - public ApiResult> page(ClinicMedicineParam param) { - // 使用关联查询 - return success(clinicMedicineService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicine:list')") - @Operation(summary = "查询全部药品库") - @GetMapping() - public ApiResult> list(ClinicMedicineParam param) { - // 使用关联查询 - return success(clinicMedicineService.listRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicine:list')") - @Operation(summary = "根据id查询药品库") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(clinicMedicineService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicine:save')") - @OperationLog - @Operation(summary = "添加药品库") - @PostMapping() - public ApiResult save(@RequestBody ClinicMedicine clinicMedicine) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // clinicMedicine.setUserId(loginUser.getUserId()); - // } - if (clinicMedicineService.save(clinicMedicine)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicine:update')") - @OperationLog - @Operation(summary = "修改药品库") - @PutMapping() - public ApiResult update(@RequestBody ClinicMedicine clinicMedicine) { - if (clinicMedicineService.updateById(clinicMedicine)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicine:remove')") - @OperationLog - @Operation(summary = "删除药品库") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (clinicMedicineService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicine:save')") - @OperationLog - @Operation(summary = "批量添加药品库") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (clinicMedicineService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicine:update')") - @OperationLog - @Operation(summary = "批量修改药品库") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(clinicMedicineService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicine:remove')") - @OperationLog - @Operation(summary = "批量删除药品库") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (clinicMedicineService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/controller/ClinicMedicineInoutController.java b/src/main/java/com/gxwebsoft/clinic/controller/ClinicMedicineInoutController.java deleted file mode 100644 index e1b89a8..0000000 --- a/src/main/java/com/gxwebsoft/clinic/controller/ClinicMedicineInoutController.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.gxwebsoft.clinic.controller; - -import com.gxwebsoft.clinic.entity.ClinicMedicineInout; -import com.gxwebsoft.clinic.param.ClinicMedicineInoutParam; -import com.gxwebsoft.clinic.service.ClinicMedicineInoutService; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 出入库控制器 - * - * @author 科技小王子 - * @since 2025-10-22 02:06:32 - */ -@Tag(name = "出入库管理") -@RestController -@RequestMapping("/api/clinic/clinic-medicine-inout") -public class ClinicMedicineInoutController extends BaseController { - @Resource - private ClinicMedicineInoutService clinicMedicineInoutService; - - @PreAuthorize("hasAuthority('clinic:clinicMedicineInout:list')") - @Operation(summary = "分页查询出入库") - @GetMapping("/page") - public ApiResult> page(ClinicMedicineInoutParam param) { - // 使用关联查询 - return success(clinicMedicineInoutService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineInout:list')") - @Operation(summary = "查询全部出入库") - @GetMapping() - public ApiResult> list(ClinicMedicineInoutParam param) { - // 使用关联查询 - return success(clinicMedicineInoutService.listRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineInout:list')") - @Operation(summary = "根据id查询出入库") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(clinicMedicineInoutService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineInout:save')") - @OperationLog - @Operation(summary = "添加出入库") - @PostMapping() - public ApiResult save(@RequestBody ClinicMedicineInout clinicMedicineInout) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // clinicMedicineInout.setUserId(loginUser.getUserId()); - // } - if (clinicMedicineInoutService.save(clinicMedicineInout)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineInout:update')") - @OperationLog - @Operation(summary = "修改出入库") - @PutMapping() - public ApiResult update(@RequestBody ClinicMedicineInout clinicMedicineInout) { - if (clinicMedicineInoutService.updateById(clinicMedicineInout)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineInout:remove')") - @OperationLog - @Operation(summary = "删除出入库") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (clinicMedicineInoutService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineInout:save')") - @OperationLog - @Operation(summary = "批量添加出入库") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (clinicMedicineInoutService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineInout:update')") - @OperationLog - @Operation(summary = "批量修改出入库") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(clinicMedicineInoutService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineInout:remove')") - @OperationLog - @Operation(summary = "批量删除出入库") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (clinicMedicineInoutService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/controller/ClinicMedicineStockController.java b/src/main/java/com/gxwebsoft/clinic/controller/ClinicMedicineStockController.java deleted file mode 100644 index 867b425..0000000 --- a/src/main/java/com/gxwebsoft/clinic/controller/ClinicMedicineStockController.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.gxwebsoft.clinic.controller; - -import com.gxwebsoft.clinic.entity.ClinicMedicineStock; -import com.gxwebsoft.clinic.param.ClinicMedicineStockParam; -import com.gxwebsoft.clinic.service.ClinicMedicineStockService; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 药品库存控制器 - * - * @author 科技小王子 - * @since 2025-10-22 02:06:32 - */ -@Tag(name = "药品库存管理") -@RestController -@RequestMapping("/api/clinic/clinic-medicine-stock") -public class ClinicMedicineStockController extends BaseController { - @Resource - private ClinicMedicineStockService clinicMedicineStockService; - - @PreAuthorize("hasAuthority('clinic:clinicMedicineStock:list')") - @Operation(summary = "分页查询药品库存") - @GetMapping("/page") - public ApiResult> page(ClinicMedicineStockParam param) { - // 使用关联查询 - return success(clinicMedicineStockService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineStock:list')") - @Operation(summary = "查询全部药品库存") - @GetMapping() - public ApiResult> list(ClinicMedicineStockParam param) { - // 使用关联查询 - return success(clinicMedicineStockService.listRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineStock:list')") - @Operation(summary = "根据id查询药品库存") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(clinicMedicineStockService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineStock:save')") - @OperationLog - @Operation(summary = "添加药品库存") - @PostMapping() - public ApiResult save(@RequestBody ClinicMedicineStock clinicMedicineStock) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // clinicMedicineStock.setUserId(loginUser.getUserId()); - // } - if (clinicMedicineStockService.save(clinicMedicineStock)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineStock:update')") - @OperationLog - @Operation(summary = "修改药品库存") - @PutMapping() - public ApiResult update(@RequestBody ClinicMedicineStock clinicMedicineStock) { - if (clinicMedicineStockService.updateById(clinicMedicineStock)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineStock:remove')") - @OperationLog - @Operation(summary = "删除药品库存") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (clinicMedicineStockService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineStock:save')") - @OperationLog - @Operation(summary = "批量添加药品库存") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (clinicMedicineStockService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineStock:update')") - @OperationLog - @Operation(summary = "批量修改药品库存") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(clinicMedicineStockService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicMedicineStock:remove')") - @OperationLog - @Operation(summary = "批量删除药品库存") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (clinicMedicineStockService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/controller/ClinicPatientUserController.java b/src/main/java/com/gxwebsoft/clinic/controller/ClinicPatientUserController.java deleted file mode 100644 index 87aa108..0000000 --- a/src/main/java/com/gxwebsoft/clinic/controller/ClinicPatientUserController.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.gxwebsoft.clinic.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.clinic.service.ClinicPatientUserService; -import com.gxwebsoft.clinic.entity.ClinicPatientUser; -import com.gxwebsoft.clinic.param.ClinicPatientUserParam; -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.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 患者控制器 - * - * @author 科技小王子 - * @since 2025-10-19 09:27:04 - */ -@Tag(name = "患者管理") -@RestController -@RequestMapping("/api/clinic/clinic-patient-user") -public class ClinicPatientUserController extends BaseController { - @Resource - private ClinicPatientUserService clinicPatientUserService; - - @PreAuthorize("hasAuthority('clinic:clinicPatientUser:list')") - @Operation(summary = "分页查询患者") - @GetMapping("/page") - public ApiResult> page(ClinicPatientUserParam param) { - // 使用关联查询 - return success(clinicPatientUserService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicPatientUser:list')") - @Operation(summary = "查询全部患者") - @GetMapping() - public ApiResult> list(ClinicPatientUserParam param) { - // 使用关联查询 - return success(clinicPatientUserService.listRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicPatientUser:list')") - @Operation(summary = "根据id查询患者") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(clinicPatientUserService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('clinic:clinicPatientUser:save')") - @OperationLog - @Operation(summary = "添加患者") - @PostMapping() - public ApiResult save(@RequestBody ClinicPatientUser clinicPatientUser) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - clinicPatientUser.setUserId(loginUser.getUserId()); - } - if (clinicPatientUserService.save(clinicPatientUser)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPatientUser:update')") - @OperationLog - @Operation(summary = "修改患者") - @PutMapping() - public ApiResult update(@RequestBody ClinicPatientUser clinicPatientUser) { - if (clinicPatientUserService.updateById(clinicPatientUser)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPatientUser:remove')") - @OperationLog - @Operation(summary = "删除患者") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (clinicPatientUserService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPatientUser:save')") - @OperationLog - @Operation(summary = "批量添加患者") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (clinicPatientUserService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPatientUser:update')") - @OperationLog - @Operation(summary = "批量修改患者") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(clinicPatientUserService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPatientUser:remove')") - @OperationLog - @Operation(summary = "批量删除患者") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (clinicPatientUserService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/controller/ClinicPrescriptionController.java b/src/main/java/com/gxwebsoft/clinic/controller/ClinicPrescriptionController.java deleted file mode 100644 index f51872e..0000000 --- a/src/main/java/com/gxwebsoft/clinic/controller/ClinicPrescriptionController.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.gxwebsoft.clinic.controller; - -import cn.hutool.core.util.IdUtil; -import com.gxwebsoft.clinic.dto.PrescriptionOrderRequest; -import com.gxwebsoft.clinic.entity.ClinicPrescription; -import com.gxwebsoft.clinic.param.ClinicPrescriptionParam; -import com.gxwebsoft.clinic.service.ClinicPrescriptionService; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.extern.slf4j.Slf4j; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 处方主表 -控制器 - * - * @author 科技小王子 - * @since 2025-10-22 02:01:13 - */ -@Tag(name = "处方主表管理") -@RestController -@RequestMapping("/api/clinic/clinic-prescription") -public class ClinicPrescriptionController extends BaseController { - @Resource - private ClinicPrescriptionService clinicPrescriptionService; - - @Operation(summary = "分页查询处方主表") - @GetMapping("/page") - public ApiResult> page(ClinicPrescriptionParam param) { - // 使用关联查询 - return success(clinicPrescriptionService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:list')") - @Operation(summary = "查询全部处方主表") - @GetMapping() - public ApiResult> list(ClinicPrescriptionParam param) { - // 使用关联查询 - return success(clinicPrescriptionService.listRel(param)); - } - - @Operation(summary = "根据id查询处方主表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(clinicPrescriptionService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:save')") - @OperationLog - @Operation(summary = "添加处方主表") - @PostMapping() - public ApiResult save(@RequestBody ClinicPrescription clinicPrescription) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - clinicPrescription.setDoctorId(loginUser.getUserId()); - // 生成订单号 - String orderNo = Long.toString(IdUtil.getSnowflakeNextId()); - clinicPrescription.setOrderNo(orderNo); - } - if (clinicPrescriptionService.save(clinicPrescription)) { - // 返回处方数据,包含处方ID - return success("添加成功",clinicPrescriptionService.getByLastId(clinicPrescription)); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:update')") - @OperationLog - @Operation(summary = "修改处方主表") - @PutMapping() - public ApiResult update(@RequestBody ClinicPrescription clinicPrescription) { - if (clinicPrescriptionService.updateById(clinicPrescription)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:remove')") - @OperationLog - @Operation(summary = "删除处方主表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (clinicPrescriptionService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:save')") - @OperationLog - @Operation(summary = "批量添加处方主表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (clinicPrescriptionService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:update')") - @OperationLog - @Operation(summary = "批量修改处方主表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(clinicPrescriptionService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:remove')") - @OperationLog - @Operation(summary = "批量删除处方主表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (clinicPrescriptionService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "创建处方订单") - @PostMapping("/order") - public ApiResult createOrder(@RequestBody PrescriptionOrderRequest request) { - try { - // 1. 参数校验 - if (request.getPrescriptionId() == null) { - return fail("处方ID不能为空"); - } - if (request.getPayType() == null) { - return fail("支付方式不能为空"); - } - - // 2. 查询处方信息 - ClinicPrescription prescription = clinicPrescriptionService.getById(request.getPrescriptionId()); - if (prescription == null) { - return fail("处方不存在"); - } - - // 3. 检查处方状态 - if (prescription.getStatus() != null && prescription.getStatus() == 2) { - return fail("该处方已支付,无需重复支付"); - } - if (prescription.getStatus() != null && prescription.getStatus() == 3) { - return fail("该处方已取消,无法支付"); - } - - // 4. 更新处方订单信息 - ClinicPrescription updatePrescription = new ClinicPrescription(); - updatePrescription.setId(request.getPrescriptionId()); - - // 根据支付类型更新状态 - if (request.getPayType() == 1) { - // 微信支付,状态保持为正常,等待支付回调 - updatePrescription.setStatus(0); - } else if (request.getPayType() == 4 || request.getPayType() == 5) { - // 现金支付或POS机支付,直接标记为已支付 - updatePrescription.setStatus(2); - updatePrescription.setIsSettled(1); - updatePrescription.setSettleTime(LocalDateTime.now()); - } else if (request.getPayType() == 6) { - // 免费,直接标记为已完成 - updatePrescription.setStatus(1); - updatePrescription.setIsSettled(1); - updatePrescription.setSettleTime(LocalDateTime.now()); - } - - if (clinicPrescriptionService.updateById(updatePrescription)) { - return success("订单创建成功", prescription); - } - return fail("订单创建失败"); - - } catch (Exception e) { - return fail("订单创建失败:" + e.getMessage()); - } - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/controller/ClinicPrescriptionItemController.java b/src/main/java/com/gxwebsoft/clinic/controller/ClinicPrescriptionItemController.java deleted file mode 100644 index eda3050..0000000 --- a/src/main/java/com/gxwebsoft/clinic/controller/ClinicPrescriptionItemController.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.gxwebsoft.clinic.controller; - -import com.gxwebsoft.clinic.entity.ClinicPrescriptionItem; -import com.gxwebsoft.clinic.param.ClinicPrescriptionItemParam; -import com.gxwebsoft.clinic.service.ClinicPrescriptionItemService; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 处方明细表 -控制器 - * - * @author 科技小王子 - * @since 2025-10-22 02:01:13 - */ -@Tag(name = "处方明细表管理") -@RestController -@RequestMapping("/api/clinic/clinic-prescription-item") -public class ClinicPrescriptionItemController extends BaseController { - @Resource - private ClinicPrescriptionItemService clinicPrescriptionItemService; - - @Operation(summary = "分页查询处方明细表") - @GetMapping("/page") - public ApiResult> page(ClinicPrescriptionItemParam param) { - // 使用关联查询 - return success(clinicPrescriptionItemService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:list')") - @Operation(summary = "查询全部处方明细表") - @GetMapping() - public ApiResult> list(ClinicPrescriptionItemParam param) { - // 使用关联查询 - return success(clinicPrescriptionItemService.listRel(param)); - } - - @Operation(summary = "根据id查询处方明细表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(clinicPrescriptionItemService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:save')") - @OperationLog - @Operation(summary = "添加处方明细表") - @PostMapping() - public ApiResult save(@RequestBody ClinicPrescriptionItem clinicPrescriptionItem) { - if (clinicPrescriptionItemService.save(clinicPrescriptionItem)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:update')") - @OperationLog - @Operation(summary = "修改处方明细表") - @PutMapping() - public ApiResult update(@RequestBody ClinicPrescriptionItem clinicPrescriptionItem) { - if (clinicPrescriptionItemService.updateById(clinicPrescriptionItem)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:remove')") - @OperationLog - @Operation(summary = "删除处方明细表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (clinicPrescriptionItemService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:save')") - @OperationLog - @Operation(summary = "批量添加处方明细表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (clinicPrescriptionItemService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:update')") - @OperationLog - @Operation(summary = "批量修改处方明细表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(clinicPrescriptionItemService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('clinic:clinicPrescription:remove')") - @OperationLog - @Operation(summary = "批量删除处方明细表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (clinicPrescriptionItemService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/controller/业务中台-排班信息接口对接文档20251114(2).docx b/src/main/java/com/gxwebsoft/clinic/controller/业务中台-排班信息接口对接文档20251114(2).docx deleted file mode 100644 index 8b21716..0000000 Binary files a/src/main/java/com/gxwebsoft/clinic/controller/业务中台-排班信息接口对接文档20251114(2).docx and /dev/null differ diff --git a/src/main/java/com/gxwebsoft/clinic/dto/PrescriptionOrderRequest.java b/src/main/java/com/gxwebsoft/clinic/dto/PrescriptionOrderRequest.java deleted file mode 100644 index 44bc7c2..0000000 --- a/src/main/java/com/gxwebsoft/clinic/dto/PrescriptionOrderRequest.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.gxwebsoft.clinic.dto; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.io.Serializable; - -/** - * 处方订单请求参数 - * - * @author 科技小王子 - * @since 2025-11-03 - */ -@Data -@Schema(name = "PrescriptionOrderRequest", description = "处方订单请求参数") -public class PrescriptionOrderRequest implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "处方ID", required = true) - private Integer prescriptionId; - - @Schema(description = "支付方式:0余额支付,1微信支付,2支付宝支付,3银联支付,4现金支付,5POS机支付,6免费,7积分支付", required = true) - private Integer payType; -} diff --git a/src/main/java/com/gxwebsoft/clinic/entity/ClinicAppointment.java b/src/main/java/com/gxwebsoft/clinic/entity/ClinicAppointment.java deleted file mode 100644 index c38ae8d..0000000 --- a/src/main/java/com/gxwebsoft/clinic/entity/ClinicAppointment.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.gxwebsoft.clinic.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import com.fasterxml.jackson.annotation.JsonFormat; - -/** - * 挂号 - * - * @author 科技小王子 - * @since 2025-10-19 09:27:03 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ClinicAppointment对象", description = "挂号") -public class ClinicAppointment implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "类型") - private Integer type; - - @Schema(description = "就诊原因") - private String reason; - - @Schema(description = "挂号时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime evaluateTime; - - @Schema(description = "医生") - private Integer doctorId; - - @Schema(description = "医生名称") - @TableField(exist = false) - private String doctorName; - - @Schema(description = "医生职位") - @TableField(exist = false) - private String doctorPosition; - - @Schema(description = "患者") - private Integer userId; - - @Schema(description = "患者名称") - @TableField(exist = false) - private String nickname; - - @Schema(description = "手机") - @TableField(exist = false) - private String phone; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序号") - private Integer sortNumber; - - @Schema(description = "是否删除") - private Integer isDelete; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/entity/ClinicDoctorApply.java b/src/main/java/com/gxwebsoft/clinic/entity/ClinicDoctorApply.java deleted file mode 100644 index 8d8e173..0000000 --- a/src/main/java/com/gxwebsoft/clinic/entity/ClinicDoctorApply.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.gxwebsoft.clinic.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import java.time.LocalDate; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import com.fasterxml.jackson.annotation.JsonFormat; - -/** - * 医生入驻申请 - * - * @author 科技小王子 - * @since 2025-10-19 09:27:04 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ClinicDoctorApply对象", description = "医生入驻申请") -public class ClinicDoctorApply implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @TableId(value = "apply_id", type = IdType.AUTO) - private Integer applyId; - - @Schema(description = "类型 0医生") - private Integer type; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "姓名") - private String realName; - - @Schema(description = "性别 1男 2女") - private Integer gender; - - @Schema(description = "手机号") - private String mobile; - - @Schema(description = "客户名称") - private String dealerName; - - @Schema(description = "证件号码") - private String idCard; - - @Schema(description = "生日") - @JsonFormat(pattern = "yyyy-MM-dd") - private LocalDate birthDate; - - @Schema(description = "区分职称等级(如主治医师、副主任医师)") - private String professionalTitle; - - @Schema(description = "工作单位") - private String workUnit; - - @Schema(description = "执业资格核心凭证") - private String practiceLicense; - - @Schema(description = "限定可执业科室或疾病类型") - private String practiceScope; - - @Schema(description = "开始工作时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime startWorkDate; - - @Schema(description = "简历") - private String resume; - - @Schema(description = "使用 JSON 存储多个证件文件路径(如执业证、学历证)") - private String certificationFiles; - - @Schema(description = "详细地址") - private String address; - - @Schema(description = "签约价格") - private BigDecimal money; - - @Schema(description = "推荐人用户ID") - private Integer refereeId; - - @Schema(description = "申请方式(10需后台审核 20无需审核)") - private Integer applyType; - - @Schema(description = "审核状态 (10待审核 20审核通过 30驳回)") - private Integer applyStatus; - - @Schema(description = "申请时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime applyTime; - - @Schema(description = "审核时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime auditTime; - - @Schema(description = "合同时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime contractTime; - - @Schema(description = "过期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expirationTime; - - @Schema(description = "驳回原因") - private String rejectReason; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "商城ID") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/entity/ClinicDoctorUser.java b/src/main/java/com/gxwebsoft/clinic/entity/ClinicDoctorUser.java deleted file mode 100644 index b95c86b..0000000 --- a/src/main/java/com/gxwebsoft/clinic/entity/ClinicDoctorUser.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.gxwebsoft.clinic.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 分销商用户记录表 - * - * @author 科技小王子 - * @since 2025-10-23 15:58:20 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ClinicDoctorUser对象", description = "分销商用户记录表") -public class ClinicDoctorUser implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "类型 0经销商 1企业 2集团") - private Integer type; - - @Schema(description = "自增ID") - private Integer userId; - - @Schema(description = "昵称") - @TableField(exist = false) - private String nickname; - - @Schema(description = "头像") - @TableField(exist = false) - private String avatar; - - @Schema(description = "姓名") - private String realName; - - @Schema(description = "手机号") - @TableField(exist = false) - private String phone; - - @Schema(description = "部门") - private Integer departmentId; - - @Schema(description = "专业领域") - private String specialty; - - @Schema(description = "职务级别") - private String position; - - @Schema(description = "执业资格") - private String qualification; - - @Schema(description = "医生简介") - private String introduction; - - @Schema(description = "挂号费") - private BigDecimal consultationFee; - - @Schema(description = "工作年限") - private Integer workYears; - - @Schema(description = "问诊人数") - private Integer consultationCount; - - @Schema(description = "专属二维码") - private String qrcode; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序号") - private Integer sortNumber; - - @Schema(description = "是否删除") - private Integer isDelete; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/entity/ClinicMedicine.java b/src/main/java/com/gxwebsoft/clinic/entity/ClinicMedicine.java deleted file mode 100644 index 43aa6df..0000000 --- a/src/main/java/com/gxwebsoft/clinic/entity/ClinicMedicine.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.gxwebsoft.clinic.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 药品库 - * - * @author 科技小王子 - * @since 2025-10-22 02:06:31 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ClinicMedicine对象", description = "药品库") -public class ClinicMedicine implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "药名") - private String name; - - @Schema(description = "拼音") - private String pinyin; - - @Schema(description = "分类(如“清热解毒”、“补气养血”)") - private String category; - - @Schema(description = "规格(如“饮片”、“颗粒”)") - private String specification; - - @Schema(description = "单位(如“克”、“袋”)") - private String unit; - - @Schema(description = "描述") - private String content; - - @Schema(description = "单价") - private BigDecimal pricePerUnit; - - @Schema(description = "是否活跃") - private Integer isActive; - - @Schema(description = "买家用户ID") - private Integer userId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "商城ID") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/entity/ClinicMedicineInout.java b/src/main/java/com/gxwebsoft/clinic/entity/ClinicMedicineInout.java deleted file mode 100644 index 3d3f428..0000000 --- a/src/main/java/com/gxwebsoft/clinic/entity/ClinicMedicineInout.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.gxwebsoft.clinic.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 出入库 - * - * @author 科技小王子 - * @since 2025-10-22 02:06:32 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ClinicMedicineInout对象", description = "出入库") -public class ClinicMedicineInout implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "买家用户ID") - private Integer userId; - - @Schema(description = "订单编号") - private String orderNo; - - @Schema(description = "分销商用户id(一级)") - private Integer firstUserId; - - @Schema(description = "分销商用户id(二级)") - private Integer secondUserId; - - @Schema(description = "分销商用户id(三级)") - private Integer thirdUserId; - - @Schema(description = "分销佣金(一级)") - private BigDecimal firstMoney; - - @Schema(description = "分销佣金(二级)") - private BigDecimal secondMoney; - - @Schema(description = "分销佣金(三级)") - private BigDecimal thirdMoney; - - @Schema(description = "单价") - private BigDecimal price; - - @Schema(description = "订单总金额") - private BigDecimal orderPrice; - - @Schema(description = "结算金额") - private BigDecimal settledPrice; - - @Schema(description = "换算成度") - private BigDecimal degreePrice; - - @Schema(description = "实发金额") - private BigDecimal payPrice; - - @Schema(description = "税率") - private BigDecimal rate; - - @Schema(description = "结算月份") - private String month; - - @Schema(description = "订单是否失效(0未失效 1已失效)") - private Integer isInvalid; - - @Schema(description = "佣金结算(0未结算 1已结算)") - private Integer isSettled; - - @Schema(description = "结算时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime settleTime; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "商城ID") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/entity/ClinicMedicineStock.java b/src/main/java/com/gxwebsoft/clinic/entity/ClinicMedicineStock.java deleted file mode 100644 index aa5973a..0000000 --- a/src/main/java/com/gxwebsoft/clinic/entity/ClinicMedicineStock.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.gxwebsoft.clinic.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 药品库存 - * - * @author 科技小王子 - * @since 2025-10-22 02:06:32 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ClinicMedicineStock对象", description = "药品库存") -public class ClinicMedicineStock implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "药品") - private Integer medicineId; - - @Schema(description = "库存数量") - private Integer stockQuantity; - - @Schema(description = "最小库存预警") - private Integer minStockLevel; - - @Schema(description = "上次更新时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime lastUpdated; - - @Schema(description = "买家用户ID") - private Integer userId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "商城ID") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/entity/ClinicPatientUser.java b/src/main/java/com/gxwebsoft/clinic/entity/ClinicPatientUser.java deleted file mode 100644 index 1b99fcb..0000000 --- a/src/main/java/com/gxwebsoft/clinic/entity/ClinicPatientUser.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.gxwebsoft.clinic.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import com.fasterxml.jackson.annotation.JsonFormat; - -/** - * 患者 - * - * @author 科技小王子 - * @since 2025-10-19 09:27:04 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ClinicPatientUser对象", description = "患者") -public class ClinicPatientUser implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "类型 0经销商 1企业 2集团") - private Integer type; - - @Schema(description = "自增ID") - private Integer userId; - - @Schema(description = "姓名") - private String realName; - - @Schema(description = "头像") - @TableField(exist = false) - private String avatar; - - @Schema(description = "手机号") - @TableField(exist = false) - private String phone; - - @Schema(description = "性别 0未知 1男 2女") - private Integer sex; - - @Schema(description = "年龄") - private Integer age; - - @Schema(description = "身高") - private String height; - - @Schema(description = "体重") - private String weight; - - @Schema(description = "过敏史") - private String allergyHistory; - - @Schema(description = "专属二维码") - private String qrcode; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序号") - private Integer sortNumber; - - @Schema(description = "是否删除") - private Integer isDelete; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/entity/ClinicPrescription.java b/src/main/java/com/gxwebsoft/clinic/entity/ClinicPrescription.java deleted file mode 100644 index 688adfd..0000000 --- a/src/main/java/com/gxwebsoft/clinic/entity/ClinicPrescription.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.gxwebsoft.clinic.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.gxwebsoft.shop.entity.ShopOrder; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 处方主表 - - * - * @author 科技小王子 - * @since 2025-10-22 02:01:13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ClinicPrescription对象", description = "处方主表") -public class ClinicPrescription implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "患者") - private Integer userId; - - @Schema(description = "患者名称") - @TableField(exist = false) - private String realName; - - @Schema(description = "年龄") - @TableField(exist = false) - private String age; - - @Schema(description = "身高") - @TableField(exist = false) - private String height; - - @Schema(description = "体重") - @TableField(exist = false) - private String weight; - - @Schema(description = "医生") - private Integer doctorId; - - @Schema(description = "医生名称") - @TableField(exist = false) - private String doctorName; - - @Schema(description = "医生资格") - @TableField(exist = false) - private String qualification; - - @Schema(description = "订单编号") - private String orderNo; - - @Schema(description = "0未付款,1已付款") - @TableField(exist = false) - private Boolean payStatus; - - @Schema(description = "0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款") - @TableField(exist = false) - private Integer orderStatus; - - @Schema(description = "关联就诊表") - private Integer visitRecordId; - - @Schema(description = "处方类型 0中药 1西药") - private Integer prescriptionType; - - @Schema(description = "诊断结果") - private String diagnosis; - - @Schema(description = "治疗方案") - private String treatmentPlan; - - @Schema(description = "煎药说明") - private String decoctionInstructions; - - @Schema(description = "上传附件") - private String image; - - @Schema(description = "订单总金额") - private BigDecimal orderPrice; - - @Schema(description = "单价") - private BigDecimal price; - - @Schema(description = "实付金额") - private BigDecimal payPrice; - - @Schema(description = "订单是否失效(0未失效 1已失效)") - private Integer isInvalid; - - @Schema(description = "结算(0未结算 1已结算)") - private Integer isSettled; - - @Schema(description = "结算时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime settleTime; - - @Schema(description = "状态, 0正常, 1已完成,2已支付,3已取消") - private Integer status; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "商城ID") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - - @Schema(description = "处方明细") - @TableField(exist = false) - private List items; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/entity/ClinicPrescriptionItem.java b/src/main/java/com/gxwebsoft/clinic/entity/ClinicPrescriptionItem.java deleted file mode 100644 index 78329d0..0000000 --- a/src/main/java/com/gxwebsoft/clinic/entity/ClinicPrescriptionItem.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.gxwebsoft.clinic.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 处方明细表 - - * - * @author 科技小王子 - * @since 2025-10-22 02:01:13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ClinicPrescriptionItem对象", description = "处方明细表") -public class ClinicPrescriptionItem implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "关联处方") - private Integer prescriptionId; - - @Schema(description = "订单编号") - private String prescriptionNo; - - @Schema(description = "关联药品") - private Integer medicineId; - - @Schema(description = "药品名称") - @TableField(exist = false) - private String medicineName; - - @Schema(description = "规格") - @TableField(exist = false) - private String specification; - - @Schema(description = "单位") - @TableField(exist = false) - private String unit; - - @Schema(description = "单价") - @TableField(exist = false) - private BigDecimal pricePerUnit; - - @Schema(description = "药品") - @TableField(exist = false) - private ClinicMedicine clinicMedicine; - - @Schema(description = "剂量(如“10g”)") - private String dosage; - - @Schema(description = "用法频率(如“每日三次”)") - private String usageFrequency; - - @Schema(description = "服用天数") - private Integer days; - - @Schema(description = "购买数量") - private Integer amount; - - @Schema(description = "单价") - private BigDecimal unitPrice; - - @Schema(description = "数量") - private Integer quantity; - - @Schema(description = "排序号") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "用户id") - private Integer userId; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "更新时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicAppointmentMapper.java b/src/main/java/com/gxwebsoft/clinic/mapper/ClinicAppointmentMapper.java deleted file mode 100644 index adcec99..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicAppointmentMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.clinic.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.clinic.entity.ClinicAppointment; -import com.gxwebsoft.clinic.param.ClinicAppointmentParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 挂号Mapper - * - * @author 科技小王子 - * @since 2025-10-19 09:27:03 - */ -public interface ClinicAppointmentMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ClinicAppointmentParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ClinicAppointmentParam param); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicDoctorApplyMapper.java b/src/main/java/com/gxwebsoft/clinic/mapper/ClinicDoctorApplyMapper.java deleted file mode 100644 index 2a08473..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicDoctorApplyMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.clinic.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.clinic.entity.ClinicDoctorApply; -import com.gxwebsoft.clinic.param.ClinicDoctorApplyParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 医生入驻申请Mapper - * - * @author 科技小王子 - * @since 2025-10-19 09:27:04 - */ -public interface ClinicDoctorApplyMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ClinicDoctorApplyParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ClinicDoctorApplyParam param); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicDoctorUserMapper.java b/src/main/java/com/gxwebsoft/clinic/mapper/ClinicDoctorUserMapper.java deleted file mode 100644 index ffda343..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicDoctorUserMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.clinic.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.clinic.entity.ClinicDoctorUser; -import com.gxwebsoft.clinic.param.ClinicDoctorUserParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 分销商用户记录表Mapper - * - * @author 科技小王子 - * @since 2025-10-19 09:27:04 - */ -public interface ClinicDoctorUserMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ClinicDoctorUserParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ClinicDoctorUserParam param); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicMedicineInoutMapper.java b/src/main/java/com/gxwebsoft/clinic/mapper/ClinicMedicineInoutMapper.java deleted file mode 100644 index 9454319..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicMedicineInoutMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.clinic.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.clinic.entity.ClinicMedicineInout; -import com.gxwebsoft.clinic.param.ClinicMedicineInoutParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 出入库Mapper - * - * @author 科技小王子 - * @since 2025-10-22 02:06:32 - */ -public interface ClinicMedicineInoutMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ClinicMedicineInoutParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ClinicMedicineInoutParam param); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicMedicineMapper.java b/src/main/java/com/gxwebsoft/clinic/mapper/ClinicMedicineMapper.java deleted file mode 100644 index 8fca0aa..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicMedicineMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.clinic.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.clinic.entity.ClinicMedicine; -import com.gxwebsoft.clinic.param.ClinicMedicineParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 药品库Mapper - * - * @author 科技小王子 - * @since 2025-10-22 02:06:31 - */ -public interface ClinicMedicineMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ClinicMedicineParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ClinicMedicineParam param); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicMedicineStockMapper.java b/src/main/java/com/gxwebsoft/clinic/mapper/ClinicMedicineStockMapper.java deleted file mode 100644 index 9a95139..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicMedicineStockMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.clinic.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.clinic.entity.ClinicMedicineStock; -import com.gxwebsoft.clinic.param.ClinicMedicineStockParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 药品库存Mapper - * - * @author 科技小王子 - * @since 2025-10-22 02:06:32 - */ -public interface ClinicMedicineStockMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ClinicMedicineStockParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ClinicMedicineStockParam param); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicPatientUserMapper.java b/src/main/java/com/gxwebsoft/clinic/mapper/ClinicPatientUserMapper.java deleted file mode 100644 index bf25805..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicPatientUserMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.clinic.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.clinic.entity.ClinicPatientUser; -import com.gxwebsoft.clinic.param.ClinicPatientUserParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 患者Mapper - * - * @author 科技小王子 - * @since 2025-10-19 09:27:04 - */ -public interface ClinicPatientUserMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ClinicPatientUserParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ClinicPatientUserParam param); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicPrescriptionItemMapper.java b/src/main/java/com/gxwebsoft/clinic/mapper/ClinicPrescriptionItemMapper.java deleted file mode 100644 index 1a21b01..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicPrescriptionItemMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.gxwebsoft.clinic.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.clinic.entity.ClinicPrescriptionItem; -import com.gxwebsoft.clinic.param.ClinicPrescriptionItemParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 处方明细表 -Mapper - * - * @author 科技小王子 - * @since 2025-10-22 02:01:13 - */ -public interface ClinicPrescriptionItemMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ClinicPrescriptionItemParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ClinicPrescriptionItemParam param); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicPrescriptionMapper.java b/src/main/java/com/gxwebsoft/clinic/mapper/ClinicPrescriptionMapper.java deleted file mode 100644 index 6eeefda..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/ClinicPrescriptionMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.gxwebsoft.clinic.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.clinic.entity.ClinicPrescription; -import com.gxwebsoft.clinic.param.ClinicPrescriptionParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 处方主表 -Mapper - * - * @author 科技小王子 - * @since 2025-10-22 02:01:13 - */ -public interface ClinicPrescriptionMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ClinicPrescriptionParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ClinicPrescriptionParam param); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicAppointmentMapper.xml b/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicAppointmentMapper.xml deleted file mode 100644 index 5aee909..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicAppointmentMapper.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - SELECT a.*, b.nickname, b.phone, c.real_name as doctorName, c.position as doctorPosition - FROM clinic_appointment a - LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id - LEFT JOIN clinic_doctor_user c ON a.doctor_id = c.user_id - - - AND a.id = #{param.id} - - - AND a.type = #{param.type} - - - AND a.reason LIKE CONCAT('%', #{param.reason}, '%') - - - AND a.evaluate_time LIKE CONCAT('%', #{param.evaluateTime}, '%') - - - AND a.doctor_id = #{param.doctorId} - - - AND a.user_id = #{param.userId} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.is_delete = #{param.isDelete} - - - 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/clinic/mapper/xml/ClinicDoctorApplyMapper.xml b/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicDoctorApplyMapper.xml deleted file mode 100644 index c701860..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicDoctorApplyMapper.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - SELECT a.* - FROM clinic_doctor_apply a - - - AND a.apply_id = #{param.applyId} - - - AND a.type = #{param.type} - - - AND a.user_id = #{param.userId} - - - AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') - - - AND a.gender = #{param.gender} - - - AND a.mobile LIKE CONCAT('%', #{param.mobile}, '%') - - - AND a.dealer_name LIKE CONCAT('%', #{param.dealerName}, '%') - - - AND a.id_card LIKE CONCAT('%', #{param.idCard}, '%') - - - AND a.birth_date LIKE CONCAT('%', #{param.birthDate}, '%') - - - AND a.professional_title LIKE CONCAT('%', #{param.professionalTitle}, '%') - - - AND a.work_unit LIKE CONCAT('%', #{param.workUnit}, '%') - - - AND a.practice_license LIKE CONCAT('%', #{param.practiceLicense}, '%') - - - AND a.practice_scope LIKE CONCAT('%', #{param.practiceScope}, '%') - - - AND a.start_work_date LIKE CONCAT('%', #{param.startWorkDate}, '%') - - - AND a.resume LIKE CONCAT('%', #{param.resume}, '%') - - - AND a.certification_files LIKE CONCAT('%', #{param.certificationFiles}, '%') - - - AND a.address LIKE CONCAT('%', #{param.address}, '%') - - - AND a.money = #{param.money} - - - AND a.referee_id = #{param.refereeId} - - - AND a.apply_type = #{param.applyType} - - - AND a.apply_status = #{param.applyStatus} - - - AND a.apply_time LIKE CONCAT('%', #{param.applyTime}, '%') - - - AND a.audit_time LIKE CONCAT('%', #{param.auditTime}, '%') - - - AND a.contract_time LIKE CONCAT('%', #{param.contractTime}, '%') - - - AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') - - - AND a.reject_reason LIKE CONCAT('%', #{param.rejectReason}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - 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/clinic/mapper/xml/ClinicDoctorUserMapper.xml b/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicDoctorUserMapper.xml deleted file mode 100644 index 61e787f..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicDoctorUserMapper.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - SELECT a.*, b.nickname, b.phone, b.avatar - FROM clinic_doctor_user a - LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id - - - AND a.id = #{param.id} - - - AND a.type = #{param.type} - - - AND a.user_id = #{param.userId} - - - AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') - - - AND a.phone LIKE CONCAT('%', #{param.phone}, '%') - - - AND a.department_id = #{param.departmentId} - - - AND a.specialty LIKE CONCAT('%', #{param.specialty}, '%') - - - AND a.position LIKE CONCAT('%', #{param.position}, '%') - - - AND a.qualification LIKE CONCAT('%', #{param.qualification}, '%') - - - AND a.introduction LIKE CONCAT('%', #{param.introduction}, '%') - - - AND a.consultation_fee = #{param.consultationFee} - - - AND a.work_years = #{param.workYears} - - - AND a.consultation_count = #{param.consultationCount} - - - AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.is_delete = #{param.isDelete} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR a.real_name = #{param.keywords} - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicMedicineInoutMapper.xml b/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicMedicineInoutMapper.xml deleted file mode 100644 index 0e49aac..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicMedicineInoutMapper.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - SELECT a.* - FROM clinic_medicine_inout a - - - AND a.id = #{param.id} - - - AND a.user_id = #{param.userId} - - - AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%') - - - AND a.first_user_id = #{param.firstUserId} - - - AND a.second_user_id = #{param.secondUserId} - - - AND a.third_user_id = #{param.thirdUserId} - - - AND a.first_money = #{param.firstMoney} - - - AND a.second_money = #{param.secondMoney} - - - AND a.third_money = #{param.thirdMoney} - - - AND a.price = #{param.price} - - - AND a.order_price = #{param.orderPrice} - - - AND a.settled_price = #{param.settledPrice} - - - AND a.degree_price = #{param.degreePrice} - - - AND a.pay_price = #{param.payPrice} - - - AND a.rate = #{param.rate} - - - AND a.month LIKE CONCAT('%', #{param.month}, '%') - - - AND a.is_invalid = #{param.isInvalid} - - - AND a.is_settled = #{param.isSettled} - - - AND a.settle_time LIKE CONCAT('%', #{param.settleTime}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - 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/clinic/mapper/xml/ClinicMedicineMapper.xml b/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicMedicineMapper.xml deleted file mode 100644 index 644a454..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicMedicineMapper.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - SELECT a.* - FROM clinic_medicine a - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.pinyin LIKE CONCAT('%', #{param.pinyin}, '%') - - - AND a.category LIKE CONCAT('%', #{param.category}, '%') - - - AND a.specification LIKE CONCAT('%', #{param.specification}, '%') - - - AND a.unit LIKE CONCAT('%', #{param.unit}, '%') - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.price_per_unit = #{param.pricePerUnit} - - - AND a.is_active = #{param.isActive} - - - AND a.user_id = #{param.userId} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - 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/clinic/mapper/xml/ClinicMedicineStockMapper.xml b/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicMedicineStockMapper.xml deleted file mode 100644 index 93ffcd9..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicMedicineStockMapper.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - SELECT a.* - FROM clinic_medicine_stock a - - - AND a.id = #{param.id} - - - AND a.medicine_id = #{param.medicineId} - - - AND a.stock_quantity = #{param.stockQuantity} - - - AND a.min_stock_level = #{param.minStockLevel} - - - AND a.last_updated LIKE CONCAT('%', #{param.lastUpdated}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - 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/clinic/mapper/xml/ClinicPatientUserMapper.xml b/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicPatientUserMapper.xml deleted file mode 100644 index d2124a7..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicPatientUserMapper.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - SELECT a.*, b.phone, b.avatar - FROM clinic_patient_user a - LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id - - - AND a.id = #{param.id} - - - AND a.type = #{param.type} - - - AND a.user_id = #{param.userId} - - - AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') - - - AND a.age LIKE CONCAT('%', #{param.age}, '%') - - - AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%') - - - AND a.height LIKE CONCAT('%', #{param.height}, '%') - - - AND a.weight LIKE CONCAT('%', #{param.weight}, '%') - - - AND a.allergy_history LIKE CONCAT('%', #{param.allergyHistory}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.is_delete = #{param.isDelete} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR a.real_name = #{param.keywords} - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicPrescriptionItemMapper.xml b/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicPrescriptionItemMapper.xml deleted file mode 100644 index bd5f01c..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicPrescriptionItemMapper.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - SELECT a.*, b.name AS medicineName, b.specification, b.unit, b.price_per_unit AS pricePerUnit - FROM clinic_prescription_item a - LEFT JOIN clinic_medicine b ON a.id = b.id - - - AND a.id = #{param.id} - - - AND a.prescription_id = #{param.prescriptionId} - - - AND a.prescription_no LIKE CONCAT('%', #{param.prescriptionNo}, '%') - - - AND a.medicine_id = #{param.medicineId} - - - AND a.dosage LIKE CONCAT('%', #{param.dosage}, '%') - - - AND a.usage_frequency LIKE CONCAT('%', #{param.usageFrequency}, '%') - - - AND a.days = #{param.days} - - - AND a.amount = #{param.amount} - - - AND a.unit_price = #{param.unitPrice} - - - AND a.quantity = #{param.quantity} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.user_id = #{param.userId} - - - 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/clinic/mapper/xml/ClinicPrescriptionMapper.xml b/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicPrescriptionMapper.xml deleted file mode 100644 index 877387d..0000000 --- a/src/main/java/com/gxwebsoft/clinic/mapper/xml/ClinicPrescriptionMapper.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - SELECT a.*, b.real_name, b.age, b.sex, b.height, b.weight, c.real_name as doctorName, c.qualification, d.order_status as orderStatus, d.pay_status as payStatus - FROM clinic_prescription a - LEFT JOIN clinic_patient_user b ON a.user_id = b.user_id - LEFT JOIN clinic_doctor_user c ON a.doctor_id = c.user_id - LEFT JOIN shop_order d ON a.order_no = d.order_no - - - AND a.id = #{param.id} - - - AND a.user_id = #{param.userId} - - - AND a.doctor_id = #{param.doctorId} - - - AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%') - - - AND a.visit_record_id = #{param.visitRecordId} - - - AND a.prescription_type = #{param.prescriptionType} - - - AND a.diagnosis LIKE CONCAT('%', #{param.diagnosis}, '%') - - - AND a.treatment_plan LIKE CONCAT('%', #{param.treatmentPlan}, '%') - - - AND a.decoction_instructions LIKE CONCAT('%', #{param.decoctionInstructions}, '%') - - - AND a.order_price = #{param.orderPrice} - - - AND a.price = #{param.price} - - - AND a.pay_price = #{param.payPrice} - - - AND a.is_invalid = #{param.isInvalid} - - - AND a.is_settled = #{param.isSettled} - - - AND a.id IN - - #{item} - - - - AND a.settle_time LIKE CONCAT('%', #{param.settleTime}, '%') - - - AND a.status = #{param.status} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - AND d.pay_status = 0 AND d.order_status = 0 - - - - AND d.pay_status = 1 AND d.delivery_status = 10 AND d.order_status = 0 - - - - AND d.pay_status = 1 AND d.order_status = 0 - - - - AND d.delivery_status = 20 AND d.order_status != 1 - - - - AND d.order_status = 1 AND d.evaluate_status = 0 - - - - AND d.order_status = 1 - - - - AND (d.order_status = 4 OR d.order_status = 5 OR d.order_status = 6 OR d.order_status = 7) - - - - AND d.deleted = 1 - - - - AND a.order_status = 2 - - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/clinic/param/ClinicAppointmentParam.java b/src/main/java/com/gxwebsoft/clinic/param/ClinicAppointmentParam.java deleted file mode 100644 index a6e6a17..0000000 --- a/src/main/java/com/gxwebsoft/clinic/param/ClinicAppointmentParam.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.gxwebsoft.clinic.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.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 挂号查询参数 - * - * @author 科技小王子 - * @since 2025-10-19 09:27:03 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ClinicAppointmentParam对象", description = "挂号查询参数") -public class ClinicAppointmentParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "类型") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "就诊原因") - private String reason; - - @Schema(description = "挂号时间") - private String evaluateTime; - - @Schema(description = "医生") - @QueryField(type = QueryType.EQ) - private Integer doctorId; - - @Schema(description = "患者") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序号") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "是否删除") - @QueryField(type = QueryType.EQ) - private Integer isDelete; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/param/ClinicDoctorApplyParam.java b/src/main/java/com/gxwebsoft/clinic/param/ClinicDoctorApplyParam.java deleted file mode 100644 index e9863da..0000000 --- a/src/main/java/com/gxwebsoft/clinic/param/ClinicDoctorApplyParam.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.gxwebsoft.clinic.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.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 医生入驻申请查询参数 - * - * @author 科技小王子 - * @since 2025-10-19 09:27:04 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ClinicDoctorApplyParam对象", description = "医生入驻申请查询参数") -public class ClinicDoctorApplyParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @QueryField(type = QueryType.EQ) - private Integer applyId; - - @Schema(description = "类型 0医生") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "姓名") - private String realName; - - @Schema(description = "性别 1男 2女") - @QueryField(type = QueryType.EQ) - private Integer gender; - - @Schema(description = "手机号") - private String mobile; - - @Schema(description = "客户名称") - private String dealerName; - - @Schema(description = "证件号码") - private String idCard; - - @Schema(description = "生日") - private String birthDate; - - @Schema(description = "区分职称等级(如主治医师、副主任医师)") - private String professionalTitle; - - @Schema(description = "工作单位") - private String workUnit; - - @Schema(description = "执业资格核心凭证") - private String practiceLicense; - - @Schema(description = "限定可执业科室或疾病类型") - private String practiceScope; - - @Schema(description = "开始工作时间") - private String startWorkDate; - - @Schema(description = "简历") - private String resume; - - @Schema(description = "使用 JSON 存储多个证件文件路径(如执业证、学历证)") - private String certificationFiles; - - @Schema(description = "详细地址") - private String address; - - @Schema(description = "签约价格") - @QueryField(type = QueryType.EQ) - private BigDecimal money; - - @Schema(description = "推荐人用户ID") - @QueryField(type = QueryType.EQ) - private Integer refereeId; - - @Schema(description = "申请方式(10需后台审核 20无需审核)") - @QueryField(type = QueryType.EQ) - private Integer applyType; - - @Schema(description = "审核状态 (10待审核 20审核通过 30驳回)") - @QueryField(type = QueryType.EQ) - private Integer applyStatus; - - @Schema(description = "申请时间") - private String applyTime; - - @Schema(description = "审核时间") - private String auditTime; - - @Schema(description = "合同时间") - private String contractTime; - - @Schema(description = "过期时间") - private String expirationTime; - - @Schema(description = "驳回原因") - private String rejectReason; - - @Schema(description = "备注") - private String comments; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/param/ClinicDoctorUserParam.java b/src/main/java/com/gxwebsoft/clinic/param/ClinicDoctorUserParam.java deleted file mode 100644 index 5157044..0000000 --- a/src/main/java/com/gxwebsoft/clinic/param/ClinicDoctorUserParam.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.gxwebsoft.clinic.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 分销商用户记录表查询参数 - * - * @author 科技小王子 - * @since 2025-10-23 15:58:20 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ClinicDoctorUserParam对象", description = "分销商用户记录表查询参数") -public class ClinicDoctorUserParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "类型 0经销商 1企业 2集团") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "姓名") - private String realName; - - @Schema(description = "手机号") - private String phone; - - @Schema(description = "部门") - @QueryField(type = QueryType.EQ) - private Integer departmentId; - - @Schema(description = "专业领域") - private String specialty; - - @Schema(description = "职务级别") - private String position; - - @Schema(description = "执业资格") - private String qualification; - - @Schema(description = "医生简介") - private String introduction; - - @Schema(description = "挂号费") - @QueryField(type = QueryType.EQ) - private BigDecimal consultationFee; - - @Schema(description = "工作年限") - @QueryField(type = QueryType.EQ) - private Integer workYears; - - @Schema(description = "问诊人数") - @QueryField(type = QueryType.EQ) - private Integer consultationCount; - - @Schema(description = "专属二维码") - private String qrcode; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序号") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "是否删除") - @QueryField(type = QueryType.EQ) - private Integer isDelete; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/param/ClinicMedicineInoutParam.java b/src/main/java/com/gxwebsoft/clinic/param/ClinicMedicineInoutParam.java deleted file mode 100644 index a438209..0000000 --- a/src/main/java/com/gxwebsoft/clinic/param/ClinicMedicineInoutParam.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.gxwebsoft.clinic.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 出入库查询参数 - * - * @author 科技小王子 - * @since 2025-10-22 02:06:32 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ClinicMedicineInoutParam对象", description = "出入库查询参数") -public class ClinicMedicineInoutParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "买家用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "订单编号") - private String orderNo; - - @Schema(description = "分销商用户id(一级)") - @QueryField(type = QueryType.EQ) - private Integer firstUserId; - - @Schema(description = "分销商用户id(二级)") - @QueryField(type = QueryType.EQ) - private Integer secondUserId; - - @Schema(description = "分销商用户id(三级)") - @QueryField(type = QueryType.EQ) - private Integer thirdUserId; - - @Schema(description = "分销佣金(一级)") - @QueryField(type = QueryType.EQ) - private BigDecimal firstMoney; - - @Schema(description = "分销佣金(二级)") - @QueryField(type = QueryType.EQ) - private BigDecimal secondMoney; - - @Schema(description = "分销佣金(三级)") - @QueryField(type = QueryType.EQ) - private BigDecimal thirdMoney; - - @Schema(description = "单价") - @QueryField(type = QueryType.EQ) - private BigDecimal price; - - @Schema(description = "订单总金额") - @QueryField(type = QueryType.EQ) - private BigDecimal orderPrice; - - @Schema(description = "结算金额") - @QueryField(type = QueryType.EQ) - private BigDecimal settledPrice; - - @Schema(description = "换算成度") - @QueryField(type = QueryType.EQ) - private BigDecimal degreePrice; - - @Schema(description = "实发金额") - @QueryField(type = QueryType.EQ) - private BigDecimal payPrice; - - @Schema(description = "税率") - @QueryField(type = QueryType.EQ) - private BigDecimal rate; - - @Schema(description = "结算月份") - private String month; - - @Schema(description = "订单是否失效(0未失效 1已失效)") - @QueryField(type = QueryType.EQ) - private Integer isInvalid; - - @Schema(description = "佣金结算(0未结算 1已结算)") - @QueryField(type = QueryType.EQ) - private Integer isSettled; - - @Schema(description = "结算时间") - private String settleTime; - - @Schema(description = "备注") - private String comments; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/param/ClinicMedicineParam.java b/src/main/java/com/gxwebsoft/clinic/param/ClinicMedicineParam.java deleted file mode 100644 index 71f4744..0000000 --- a/src/main/java/com/gxwebsoft/clinic/param/ClinicMedicineParam.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.gxwebsoft.clinic.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 药品库查询参数 - * - * @author 科技小王子 - * @since 2025-10-22 02:06:31 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ClinicMedicineParam对象", description = "药品库查询参数") -public class ClinicMedicineParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "药名") - private String name; - - @Schema(description = "拼音") - private String pinyin; - - @Schema(description = "分类(如“清热解毒”、“补气养血”)") - private String category; - - @Schema(description = "规格(如“饮片”、“颗粒”)") - private String specification; - - @Schema(description = "单位(如“克”、“袋”)") - private String unit; - - @Schema(description = "描述") - private String content; - - @Schema(description = "单价") - @QueryField(type = QueryType.EQ) - private BigDecimal pricePerUnit; - - @Schema(description = "是否活跃") - @QueryField(type = QueryType.EQ) - private Integer isActive; - - @Schema(description = "买家用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "备注") - private String comments; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/param/ClinicMedicineStockParam.java b/src/main/java/com/gxwebsoft/clinic/param/ClinicMedicineStockParam.java deleted file mode 100644 index a784c67..0000000 --- a/src/main/java/com/gxwebsoft/clinic/param/ClinicMedicineStockParam.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.gxwebsoft.clinic.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 药品库存查询参数 - * - * @author 科技小王子 - * @since 2025-10-22 02:06:32 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ClinicMedicineStockParam对象", description = "药品库存查询参数") -public class ClinicMedicineStockParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "药品") - @QueryField(type = QueryType.EQ) - private Integer medicineId; - - @Schema(description = "库存数量") - @QueryField(type = QueryType.EQ) - private Integer stockQuantity; - - @Schema(description = "最小库存预警") - @QueryField(type = QueryType.EQ) - private Integer minStockLevel; - - @Schema(description = "上次更新时间") - private String lastUpdated; - - @Schema(description = "买家用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "备注") - private String comments; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/param/ClinicPatientUserParam.java b/src/main/java/com/gxwebsoft/clinic/param/ClinicPatientUserParam.java deleted file mode 100644 index 79373df..0000000 --- a/src/main/java/com/gxwebsoft/clinic/param/ClinicPatientUserParam.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.gxwebsoft.clinic.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.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 患者查询参数 - * - * @author 科技小王子 - * @since 2025-10-23 15:27:17 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ClinicPatientUserParam对象", description = "患者查询参数") -public class ClinicPatientUserParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "类型 0经销商 1企业 2集团") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "姓名") - private String realName; - - @Schema(description = "年龄") - private String age; - - @Schema(description = "专属二维码") - private String qrcode; - - @Schema(description = "身高") - private String height; - - @Schema(description = "体重") - private String weight; - - @Schema(description = "过敏史") - private String allergyHistory; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序号") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "是否删除") - @QueryField(type = QueryType.EQ) - private Integer isDelete; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/param/ClinicPrescriptionItemParam.java b/src/main/java/com/gxwebsoft/clinic/param/ClinicPrescriptionItemParam.java deleted file mode 100644 index 5f83762..0000000 --- a/src/main/java/com/gxwebsoft/clinic/param/ClinicPrescriptionItemParam.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.gxwebsoft.clinic.param; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; -import java.util.Set; - -/** - * 处方明细表 -查询参数 - * - * @author 科技小王子 - * @since 2025-10-22 02:01:13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ClinicPrescriptionItemParam对象", description = "处方明细表 查询参数") -public class ClinicPrescriptionItemParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "关联处方") - @QueryField(type = QueryType.EQ) - private Integer prescriptionId; - - @Schema(description = "订单编号") - private String prescriptionNo; - - @Schema(description = "关联药品") - @QueryField(type = QueryType.EQ) - private Integer medicineId; - - @Schema(description = "剂量(如“10g”)") - private String dosage; - - @Schema(description = "用法频率(如“每日三次”)") - private String usageFrequency; - - @Schema(description = "服用天数") - @QueryField(type = QueryType.EQ) - private Integer days; - - @Schema(description = "购买数量") - @QueryField(type = QueryType.EQ) - private Integer amount; - - @Schema(description = "单价") - @QueryField(type = QueryType.EQ) - private BigDecimal unitPrice; - - @Schema(description = "数量") - @QueryField(type = QueryType.EQ) - private Integer quantity; - - @Schema(description = "排序号") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "用户id") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "处方ID集查询") - @TableField(exist = false) - private Set prescriptionIds; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/param/ClinicPrescriptionParam.java b/src/main/java/com/gxwebsoft/clinic/param/ClinicPrescriptionParam.java deleted file mode 100644 index e8c0a81..0000000 --- a/src/main/java/com/gxwebsoft/clinic/param/ClinicPrescriptionParam.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.gxwebsoft.clinic.param; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; -import java.util.Set; - -/** - * 处方主表 -查询参数 - * - * @author 科技小王子 - * @since 2025-10-22 02:01:12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ClinicPrescriptionParam对象", description = "处方主表查询参数") -public class ClinicPrescriptionParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "患者") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "医生") - @QueryField(type = QueryType.EQ) - private Integer doctorId; - - @Schema(description = "订单编号") - private String orderNo; - - @Schema(description = "订单类型 0商城订单 1处方订单") - private Integer type; - - @Schema(description = "关联就诊表") - @QueryField(type = QueryType.EQ) - private Integer visitRecordId; - - @Schema(description = "处方类型 0中药 1西药") - @QueryField(type = QueryType.EQ) - private Integer prescriptionType; - - @Schema(description = "诊断结果") - private String diagnosis; - - @Schema(description = "治疗方案") - private String treatmentPlan; - - @Schema(description = "煎药说明") - private String decoctionInstructions; - - @Schema(description = "订单总金额") - @QueryField(type = QueryType.EQ) - private BigDecimal orderPrice; - - @Schema(description = "单价") - @QueryField(type = QueryType.EQ) - private BigDecimal price; - - @Schema(description = "实付金额") - @QueryField(type = QueryType.EQ) - private BigDecimal payPrice; - - @Schema(description = "订单是否失效(0未失效 1已失效)") - @QueryField(type = QueryType.EQ) - private Integer isInvalid; - - @Schema(description = "结算(0未结算 1已结算)") - @QueryField(type = QueryType.EQ) - private Integer isSettled; - - @Schema(description = "结算时间") - private String settleTime; - - @Schema(description = "状态, 0正常, 1已完成,2已支付,3已取消") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "处方ID集查询") - @TableField(exist = false) - private Set ids; - - @Schema(description = "订单状态筛选:-1全部,0待支付,1待发货,2待核销,3待收货,4待评价,5已完成,6已退款,7已删除") - private Integer statusFilter; - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/ClinicAppointmentService.java b/src/main/java/com/gxwebsoft/clinic/service/ClinicAppointmentService.java deleted file mode 100644 index 28c7ac1..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/ClinicAppointmentService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.clinic.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.clinic.entity.ClinicAppointment; -import com.gxwebsoft.clinic.param.ClinicAppointmentParam; - -import java.util.List; - -/** - * 挂号Service - * - * @author 科技小王子 - * @since 2025-10-19 09:27:04 - */ -public interface ClinicAppointmentService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ClinicAppointmentParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ClinicAppointmentParam param); - - /** - * 根据id查询 - * - * @param id 主键ID - * @return ClinicAppointment - */ - ClinicAppointment getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/ClinicDoctorApplyService.java b/src/main/java/com/gxwebsoft/clinic/service/ClinicDoctorApplyService.java deleted file mode 100644 index 228ac95..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/ClinicDoctorApplyService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.clinic.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.clinic.entity.ClinicDoctorApply; -import com.gxwebsoft.clinic.param.ClinicDoctorApplyParam; - -import java.util.List; - -/** - * 医生入驻申请Service - * - * @author 科技小王子 - * @since 2025-10-19 09:27:04 - */ -public interface ClinicDoctorApplyService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ClinicDoctorApplyParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ClinicDoctorApplyParam param); - - /** - * 根据id查询 - * - * @param applyId 主键ID - * @return ClinicDoctorApply - */ - ClinicDoctorApply getByIdRel(Integer applyId); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/ClinicDoctorUserService.java b/src/main/java/com/gxwebsoft/clinic/service/ClinicDoctorUserService.java deleted file mode 100644 index a417b1d..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/ClinicDoctorUserService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.clinic.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.clinic.entity.ClinicDoctorUser; -import com.gxwebsoft.clinic.param.ClinicDoctorUserParam; - -import java.util.List; - -/** - * 分销商用户记录表Service - * - * @author 科技小王子 - * @since 2025-10-19 09:27:04 - */ -public interface ClinicDoctorUserService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ClinicDoctorUserParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ClinicDoctorUserParam param); - - /** - * 根据id查询 - * - * @param id 主键ID - * @return ClinicDoctorUser - */ - ClinicDoctorUser getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/ClinicMedicineInoutService.java b/src/main/java/com/gxwebsoft/clinic/service/ClinicMedicineInoutService.java deleted file mode 100644 index f3c55fa..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/ClinicMedicineInoutService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.clinic.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.clinic.entity.ClinicMedicineInout; -import com.gxwebsoft.clinic.param.ClinicMedicineInoutParam; -import com.gxwebsoft.common.core.web.PageResult; - -import java.util.List; - -/** - * 出入库Service - * - * @author 科技小王子 - * @since 2025-10-22 02:06:32 - */ -public interface ClinicMedicineInoutService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ClinicMedicineInoutParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ClinicMedicineInoutParam param); - - /** - * 根据id查询 - * - * @param id 主键ID - * @return ClinicMedicineInout - */ - ClinicMedicineInout getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/ClinicMedicineService.java b/src/main/java/com/gxwebsoft/clinic/service/ClinicMedicineService.java deleted file mode 100644 index e393701..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/ClinicMedicineService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.clinic.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.clinic.entity.ClinicMedicine; -import com.gxwebsoft.clinic.param.ClinicMedicineParam; -import com.gxwebsoft.common.core.web.PageResult; - -import java.util.List; - -/** - * 药品库Service - * - * @author 科技小王子 - * @since 2025-10-22 02:06:31 - */ -public interface ClinicMedicineService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ClinicMedicineParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ClinicMedicineParam param); - - /** - * 根据id查询 - * - * @param id 主键ID - * @return ClinicMedicine - */ - ClinicMedicine getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/ClinicMedicineStockService.java b/src/main/java/com/gxwebsoft/clinic/service/ClinicMedicineStockService.java deleted file mode 100644 index 04e792a..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/ClinicMedicineStockService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.clinic.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.clinic.entity.ClinicMedicineStock; -import com.gxwebsoft.clinic.param.ClinicMedicineStockParam; -import com.gxwebsoft.common.core.web.PageResult; - -import java.util.List; - -/** - * 药品库存Service - * - * @author 科技小王子 - * @since 2025-10-22 02:06:32 - */ -public interface ClinicMedicineStockService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ClinicMedicineStockParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ClinicMedicineStockParam param); - - /** - * 根据id查询 - * - * @param id 主键ID - * @return ClinicMedicineStock - */ - ClinicMedicineStock getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/ClinicPatientUserService.java b/src/main/java/com/gxwebsoft/clinic/service/ClinicPatientUserService.java deleted file mode 100644 index df37cc3..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/ClinicPatientUserService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.clinic.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.clinic.entity.ClinicPatientUser; -import com.gxwebsoft.clinic.param.ClinicPatientUserParam; - -import java.util.List; - -/** - * 患者Service - * - * @author 科技小王子 - * @since 2025-10-19 09:27:04 - */ -public interface ClinicPatientUserService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ClinicPatientUserParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ClinicPatientUserParam param); - - /** - * 根据id查询 - * - * @param id 主键ID - * @return ClinicPatientUser - */ - ClinicPatientUser getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/ClinicPrescriptionItemService.java b/src/main/java/com/gxwebsoft/clinic/service/ClinicPrescriptionItemService.java deleted file mode 100644 index 42b8687..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/ClinicPrescriptionItemService.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.gxwebsoft.clinic.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.clinic.entity.ClinicPrescriptionItem; -import com.gxwebsoft.clinic.param.ClinicPrescriptionItemParam; -import com.gxwebsoft.common.core.web.PageResult; - -import java.util.List; - -/** - * 处方明细表 -Service - * - * @author 科技小王子 - * @since 2025-10-22 02:01:13 - */ -public interface ClinicPrescriptionItemService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ClinicPrescriptionItemParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ClinicPrescriptionItemParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return ClinicPrescriptionItem - */ - ClinicPrescriptionItem getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/ClinicPrescriptionService.java b/src/main/java/com/gxwebsoft/clinic/service/ClinicPrescriptionService.java deleted file mode 100644 index 5e6d4c0..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/ClinicPrescriptionService.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.gxwebsoft.clinic.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.clinic.entity.ClinicPrescription; -import com.gxwebsoft.clinic.param.ClinicPrescriptionParam; -import com.gxwebsoft.common.core.web.PageResult; - -import java.util.List; - -/** - * 处方主表 -Service - * - * @author 科技小王子 - * @since 2025-10-22 02:01:13 - */ -public interface ClinicPrescriptionService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ClinicPrescriptionParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ClinicPrescriptionParam param); - - /** - * 根据id查询 - * - * @param id 主键ID - * @return ClinicPrescription - */ - ClinicPrescription getByIdRel(Integer id); - - // 添加成功后返回数据 - ClinicPrescription getByLastId(ClinicPrescription clinicPrescription); -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicAppointmentServiceImpl.java b/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicAppointmentServiceImpl.java deleted file mode 100644 index 2af3f86..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicAppointmentServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.clinic.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.clinic.mapper.ClinicAppointmentMapper; -import com.gxwebsoft.clinic.service.ClinicAppointmentService; -import com.gxwebsoft.clinic.entity.ClinicAppointment; -import com.gxwebsoft.clinic.param.ClinicAppointmentParam; -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 科技小王子 - * @since 2025-10-19 09:27:04 - */ -@Service -public class ClinicAppointmentServiceImpl extends ServiceImpl implements ClinicAppointmentService { - - @Override - public PageResult pageRel(ClinicAppointmentParam 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(ClinicAppointmentParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public ClinicAppointment getByIdRel(Integer id) { - ClinicAppointmentParam param = new ClinicAppointmentParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicDoctorApplyServiceImpl.java b/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicDoctorApplyServiceImpl.java deleted file mode 100644 index 9ba52d1..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicDoctorApplyServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.clinic.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.clinic.mapper.ClinicDoctorApplyMapper; -import com.gxwebsoft.clinic.service.ClinicDoctorApplyService; -import com.gxwebsoft.clinic.entity.ClinicDoctorApply; -import com.gxwebsoft.clinic.param.ClinicDoctorApplyParam; -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 科技小王子 - * @since 2025-10-19 09:27:04 - */ -@Service -public class ClinicDoctorApplyServiceImpl extends ServiceImpl implements ClinicDoctorApplyService { - - @Override - public PageResult pageRel(ClinicDoctorApplyParam 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(ClinicDoctorApplyParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public ClinicDoctorApply getByIdRel(Integer applyId) { - ClinicDoctorApplyParam param = new ClinicDoctorApplyParam(); - param.setApplyId(applyId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicDoctorUserServiceImpl.java b/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicDoctorUserServiceImpl.java deleted file mode 100644 index 5b65655..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicDoctorUserServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.clinic.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.clinic.mapper.ClinicDoctorUserMapper; -import com.gxwebsoft.clinic.service.ClinicDoctorUserService; -import com.gxwebsoft.clinic.entity.ClinicDoctorUser; -import com.gxwebsoft.clinic.param.ClinicDoctorUserParam; -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 科技小王子 - * @since 2025-10-19 09:27:04 - */ -@Service -public class ClinicDoctorUserServiceImpl extends ServiceImpl implements ClinicDoctorUserService { - - @Override - public PageResult pageRel(ClinicDoctorUserParam 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(ClinicDoctorUserParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public ClinicDoctorUser getByIdRel(Integer id) { - ClinicDoctorUserParam param = new ClinicDoctorUserParam(); - param.setUserId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicMedicineInoutServiceImpl.java b/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicMedicineInoutServiceImpl.java deleted file mode 100644 index fbd1caf..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicMedicineInoutServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.clinic.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.clinic.entity.ClinicMedicineInout; -import com.gxwebsoft.clinic.mapper.ClinicMedicineInoutMapper; -import com.gxwebsoft.clinic.param.ClinicMedicineInoutParam; -import com.gxwebsoft.clinic.service.ClinicMedicineInoutService; -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 科技小王子 - * @since 2025-10-22 02:06:32 - */ -@Service -public class ClinicMedicineInoutServiceImpl extends ServiceImpl implements ClinicMedicineInoutService { - - @Override - public PageResult pageRel(ClinicMedicineInoutParam 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(ClinicMedicineInoutParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public ClinicMedicineInout getByIdRel(Integer id) { - ClinicMedicineInoutParam param = new ClinicMedicineInoutParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicMedicineServiceImpl.java b/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicMedicineServiceImpl.java deleted file mode 100644 index cc6deba..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicMedicineServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.clinic.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.clinic.entity.ClinicMedicine; -import com.gxwebsoft.clinic.mapper.ClinicMedicineMapper; -import com.gxwebsoft.clinic.param.ClinicMedicineParam; -import com.gxwebsoft.clinic.service.ClinicMedicineService; -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 科技小王子 - * @since 2025-10-22 02:06:31 - */ -@Service -public class ClinicMedicineServiceImpl extends ServiceImpl implements ClinicMedicineService { - - @Override - public PageResult pageRel(ClinicMedicineParam 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(ClinicMedicineParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public ClinicMedicine getByIdRel(Integer id) { - ClinicMedicineParam param = new ClinicMedicineParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicMedicineStockServiceImpl.java b/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicMedicineStockServiceImpl.java deleted file mode 100644 index 2364578..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicMedicineStockServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.clinic.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.clinic.entity.ClinicMedicineStock; -import com.gxwebsoft.clinic.mapper.ClinicMedicineStockMapper; -import com.gxwebsoft.clinic.param.ClinicMedicineStockParam; -import com.gxwebsoft.clinic.service.ClinicMedicineStockService; -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 科技小王子 - * @since 2025-10-22 02:06:32 - */ -@Service -public class ClinicMedicineStockServiceImpl extends ServiceImpl implements ClinicMedicineStockService { - - @Override - public PageResult pageRel(ClinicMedicineStockParam 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(ClinicMedicineStockParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public ClinicMedicineStock getByIdRel(Integer id) { - ClinicMedicineStockParam param = new ClinicMedicineStockParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicPatientUserServiceImpl.java b/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicPatientUserServiceImpl.java deleted file mode 100644 index a3968b2..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicPatientUserServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.clinic.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.clinic.mapper.ClinicPatientUserMapper; -import com.gxwebsoft.clinic.service.ClinicPatientUserService; -import com.gxwebsoft.clinic.entity.ClinicPatientUser; -import com.gxwebsoft.clinic.param.ClinicPatientUserParam; -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 科技小王子 - * @since 2025-10-19 09:27:04 - */ -@Service -public class ClinicPatientUserServiceImpl extends ServiceImpl implements ClinicPatientUserService { - - @Override - public PageResult pageRel(ClinicPatientUserParam 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(ClinicPatientUserParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public ClinicPatientUser getByIdRel(Integer id) { - ClinicPatientUserParam param = new ClinicPatientUserParam(); - param.setUserId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicPrescriptionItemServiceImpl.java b/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicPrescriptionItemServiceImpl.java deleted file mode 100644 index 916b716..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicPrescriptionItemServiceImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.gxwebsoft.clinic.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.clinic.entity.ClinicPrescriptionItem; -import com.gxwebsoft.clinic.mapper.ClinicPrescriptionItemMapper; -import com.gxwebsoft.clinic.param.ClinicPrescriptionItemParam; -import com.gxwebsoft.clinic.service.ClinicPrescriptionItemService; -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 科技小王子 - * @since 2025-10-22 02:01:13 - */ -@Service -public class ClinicPrescriptionItemServiceImpl extends ServiceImpl implements ClinicPrescriptionItemService { - - @Override - public PageResult pageRel(ClinicPrescriptionItemParam 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(ClinicPrescriptionItemParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public ClinicPrescriptionItem getByIdRel(Integer id) { - ClinicPrescriptionItemParam param = new ClinicPrescriptionItemParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicPrescriptionServiceImpl.java b/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicPrescriptionServiceImpl.java deleted file mode 100644 index 742f741..0000000 --- a/src/main/java/com/gxwebsoft/clinic/service/impl/ClinicPrescriptionServiceImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.gxwebsoft.clinic.service.impl; - -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.clinic.entity.ClinicPrescription; -import com.gxwebsoft.clinic.entity.ClinicPrescriptionItem; -import com.gxwebsoft.clinic.mapper.ClinicPrescriptionMapper; -import com.gxwebsoft.clinic.param.ClinicPrescriptionItemParam; -import com.gxwebsoft.clinic.param.ClinicPrescriptionParam; -import com.gxwebsoft.clinic.service.ClinicPrescriptionItemService; -import com.gxwebsoft.clinic.service.ClinicPrescriptionService; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.shop.entity.ShopOrder; -import com.gxwebsoft.shop.entity.ShopOrderGoods; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * 处方主表 -Service实现 - * - * @author 科技小王子 - * @since 2025-10-22 02:01:13 - */ -@Service -public class ClinicPrescriptionServiceImpl extends ServiceImpl implements ClinicPrescriptionService { - - @Resource - private ClinicPrescriptionItemService clinicPrescriptionItemService; - @Override - public PageResult pageRel(ClinicPrescriptionParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("sort_number asc, create_time desc"); - List list = baseMapper.selectPageRel(page, param); - // 查询处方明细 - Set collectIds = list.stream().map(ClinicPrescription::getId).collect(Collectors.toSet()); - final ClinicPrescriptionItemParam itemParam = new ClinicPrescriptionItemParam(); - itemParam.setPrescriptionIds(collectIds); - final List clinicPrescriptionItems = clinicPrescriptionItemService.listRel(itemParam); - final Map> collect = clinicPrescriptionItems.stream().collect(Collectors.groupingBy(ClinicPrescriptionItem::getPrescriptionId)); - list.forEach(d -> { - d.setItems(collect.get(d.getId())); - }); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(ClinicPrescriptionParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public ClinicPrescription getByIdRel(Integer id) { - ClinicPrescriptionParam param = new ClinicPrescriptionParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - - @Override - public ClinicPrescription getByLastId(ClinicPrescription clinicPrescription) { - return getOne(new LambdaQueryWrapper().orderByDesc(ClinicPrescription::getId).eq(ClinicPrescription::getUserId, clinicPrescription.getUserId()).last("limit 1")); - } - -} diff --git a/src/main/java/com/gxwebsoft/cms/service/impl/CmsWebsiteServiceImpl.java b/src/main/java/com/gxwebsoft/cms/service/impl/CmsWebsiteServiceImpl.java index 0bc0566..747708d 100644 --- a/src/main/java/com/gxwebsoft/cms/service/impl/CmsWebsiteServiceImpl.java +++ b/src/main/java/com/gxwebsoft/cms/service/impl/CmsWebsiteServiceImpl.java @@ -12,8 +12,6 @@ import com.gxwebsoft.common.core.web.PageResult; import com.gxwebsoft.common.system.entity.User; import com.gxwebsoft.common.system.service.CompanyService; import com.gxwebsoft.common.system.service.UserService; -import com.gxwebsoft.project.entity.Project; -import com.gxwebsoft.project.service.ProjectService; import com.gxwebsoft.shop.vo.ShopVo; import org.springframework.stereotype.Service; @@ -70,8 +68,6 @@ public class CmsWebsiteServiceImpl extends ServiceImpl 0) { // TODO 国际化 @@ -284,22 +280,6 @@ public class CmsWebsiteServiceImpl extends ServiceImpl supplier) { - return requiresNewTx.execute(status -> supplier.get()); - } - - public static final class CompanyIdRefreshStats { - public final boolean anyDataRead; - public final int updated; - public final int matched; - public final int notFound; - public final int ambiguous; - - private CompanyIdRefreshStats(boolean anyDataRead, int updated, int matched, int notFound, int ambiguous) { - this.anyDataRead = anyDataRead; - this.updated = updated; - this.matched = matched; - this.notFound = notFound; - this.ambiguous = ambiguous; - } - - public Map toMap() { - Map result = new LinkedHashMap<>(); - result.put("updated", updated); - result.put("matched", matched); - result.put("notFound", notFound); - result.put("ambiguous", ambiguous); - return result; - } - } - - /** - * 按企业名称匹配 CreditCompany(name / matchName) 并回填 companyId。 - * - *

默认仅更新 companyId 为空/0 的记录(onlyNull=true);onlyNull=false 时会覆盖更新(仅当 companyId 不同)。

- * - *

注意:为避免跨租户误更新,当 currentTenantId 为空时会按记录自身 tenantId 维度匹配, - * tenantId 为空的记录将被跳过并计入 notFound。

- */ - public CompanyIdRefreshStats refreshCompanyIdByCompanyName(IService service, - CreditCompanyService creditCompanyService, - Integer currentTenantId, - Boolean onlyNull, - Integer limit, - SFunction idGetter, - BiConsumer idSetter, - SFunction nameGetter, - SFunction companyIdGetter, - BiConsumer companyIdSetter, - SFunction hasDataGetter, - BiConsumer hasDataSetter, - SFunction tenantIdGetter, - Supplier patchFactory) { - // Keep existing API; delegate to the multi-column implementation. - return refreshCompanyIdByCompanyNames(service, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - idGetter, - idSetter, - companyIdGetter, - companyIdSetter, - hasDataGetter, - hasDataSetter, - tenantIdGetter, - patchFactory, - nameGetter); - } - - /** - * 按多列“当事人/企业名称”匹配 CreditCompany(name / matchName) 并回填 companyId。 - * - *

按传入列顺序优先匹配:原告/上诉人 > 被告/被上诉人 > 其他当事人/第三人等。

- * - *

同一列若匹配到多个不同企业则视为歧义;若最终无法得到唯一 companyId,则跳过并计入 ambiguous/notFound。

- */ - @SafeVarargs - public final CompanyIdRefreshStats refreshCompanyIdByCompanyNames(IService service, - CreditCompanyService creditCompanyService, - Integer currentTenantId, - Boolean onlyNull, - Integer limit, - SFunction idGetter, - BiConsumer idSetter, - SFunction companyIdGetter, - BiConsumer companyIdSetter, - SFunction hasDataGetter, - BiConsumer hasDataSetter, - SFunction tenantIdGetter, - Supplier patchFactory, - SFunction... nameGetters) { - boolean onlyNullFlag = (onlyNull == null) || Boolean.TRUE.equals(onlyNull); - - if (nameGetters == null || nameGetters.length == 0) { - return new CompanyIdRefreshStats(false, 0, 0, 0, 0); - } - - // 1) 读取待处理数据(仅取必要字段,避免一次性拉全表字段) - @SuppressWarnings({"rawtypes", "unchecked"}) - SFunction[] selectColumns = (SFunction[]) new SFunction[4 + nameGetters.length]; - int colIdx = 0; - selectColumns[colIdx++] = idGetter; - selectColumns[colIdx++] = companyIdGetter; - selectColumns[colIdx++] = hasDataGetter; - selectColumns[colIdx++] = tenantIdGetter; - for (SFunction ng : nameGetters) { - selectColumns[colIdx++] = ng; - } - - var query = service.lambdaQuery() - .select(selectColumns) - .eq(currentTenantId != null, tenantIdGetter, currentTenantId) - .and(w -> { - // Only process rows that have at least one name column populated. - for (int i = 0; i < nameGetters.length; i++) { - if (i == 0) { - w.isNotNull(nameGetters[i]); - } else { - w.or().isNotNull(nameGetters[i]); - } - } - }); - if (onlyNullFlag) { - // Historically some tables used 0 as the "unset" companyId, while others left it NULL. - // Treat both as "unset" so refresh won't silently do nothing. - query.and(w -> w.isNull(companyIdGetter).or().eq(companyIdGetter, 0)); - } - if (limit != null && limit > 0) { - query.last("limit " + Math.min(limit, 200000)); - } - List rows = query.list(); - - if (CollectionUtils.isEmpty(rows)) { - return new CompanyIdRefreshStats(false, 0, 0, 0, 0); - } - - // 2) 按租户维度匹配(避免管理员/跨租户场景误匹配) - Map> rowsByTenant = new LinkedHashMap<>(); - int missingTenant = 0; - for (T row : rows) { - if (row == null) { - continue; - } - Integer tenantId = currentTenantId != null ? currentTenantId : tenantIdGetter.apply(row); - if (tenantId == null) { - // 未知租户下不做跨租户匹配,避免误更新 - missingTenant++; - continue; - } - rowsByTenant.computeIfAbsent(tenantId, k -> new ArrayList<>()).add(row); - } - - // 3) 批量更新 companyId - int updated = 0; - int matched = 0; - int notFound = 0; - int ambiguous = 0; - final int batchSize = 500; - List updates = new ArrayList<>(batchSize); - - final int inChunkSize = 900; - for (Map.Entry> entry : rowsByTenant.entrySet()) { - Integer tenantId = entry.getKey(); - List tenantRows = entry.getValue(); - if (tenantId == null || CollectionUtils.isEmpty(tenantRows)) { - continue; - } - - // 3.1) 查询当前租户下的 companyId 映射 - LinkedHashMap companyIdByName = new LinkedHashMap<>(); - LinkedHashMap ambiguousByName = new LinkedHashMap<>(); - LinkedHashSet nameSet = new LinkedHashSet<>(); - for (T row : tenantRows) { - if (row == null) { - continue; - } - for (SFunction ng : nameGetters) { - for (String name : splitPartyNames(ng.apply(row))) { - if (name != null) { - nameSet.add(name); - } - } - } - } - List allNames = new ArrayList<>(nameSet); - for (int i = 0; i < allNames.size(); i += inChunkSize) { - List chunk = allNames.subList(i, Math.min(allNames.size(), i + inChunkSize)); - if (CollectionUtils.isEmpty(chunk)) { - continue; - } - List companies = creditCompanyService.lambdaQuery() - .select(CreditCompany::getId, CreditCompany::getName, CreditCompany::getMatchName, CreditCompany::getTenantId) - .eq(CreditCompany::getTenantId, tenantId) - .and(w -> w.in(CreditCompany::getName, chunk).or().in(CreditCompany::getMatchName, chunk)) - .list(); - - for (CreditCompany c : companies) { - if (c == null || c.getId() == null) { - continue; - } - addCompanyNameMapping(companyIdByName, ambiguousByName, normalizeCompanyName(c.getName()), c.getId()); - addCompanyNameMapping(companyIdByName, ambiguousByName, normalizeCompanyName(c.getMatchName()), c.getId()); - } - } - - // 3.2) 更新当前租户下的数据 companyId - for (T row : tenantRows) { - if (row == null) { - continue; - } - - Integer companyId = null; - boolean hasAmbiguousName = false; - for (SFunction ng : nameGetters) { - LinkedHashSet idsForColumn = new LinkedHashSet<>(); - for (String key : splitPartyNames(ng.apply(row))) { - if (key == null) { - continue; - } - Integer amb = ambiguousByName.get(key); - if (amb != null && amb > 0) { - hasAmbiguousName = true; - continue; - } - Integer cid = companyIdByName.get(key); - if (cid != null) { - idsForColumn.add(cid); - } - } - if (idsForColumn.size() == 1) { - companyId = idsForColumn.iterator().next(); - break; - } - if (idsForColumn.size() > 1) { - // Multiple companies matched within one column (e.g. multiple plaintiffs) -> ambiguous. - hasAmbiguousName = true; - } - } - - if (companyId == null) { - if (hasAmbiguousName) { - ambiguous++; - } else { - notFound++; - } - continue; - } - matched++; - - Integer oldCompanyId = row != null ? companyIdGetter.apply(row) : null; - Boolean oldHasData = row != null ? hasDataGetter.apply(row) : null; - boolean needUpdate; - if (onlyNullFlag) { - needUpdate = (oldCompanyId == null) || oldCompanyId == 0; - } else { - needUpdate = oldCompanyId == null || !companyId.equals(oldCompanyId); - } - // 若已匹配到企业,但 hasData 未标记,则也需要回填 hasData=1 - if (!Boolean.TRUE.equals(oldHasData)) { - needUpdate = true; - } - if (!needUpdate) { - continue; - } - - Integer id = row != null ? idGetter.apply(row) : null; - if (id == null) { - continue; - } - T patch = patchFactory.get(); - idSetter.accept(patch, id); - companyIdSetter.accept(patch, companyId); - hasDataSetter.accept(patch, Boolean.TRUE); - updates.add(patch); - if (updates.size() >= batchSize) { - List batch = new ArrayList<>(updates); - updates.clear(); - updated += runInNewTx(() -> service.updateBatchById(batch, batchSize) ? batch.size() : 0); - } - } - } - - // currentTenantId 为空时,租户缺失的数据不做匹配更新,避免误更新 - if (currentTenantId == null && missingTenant > 0) { - notFound += missingTenant; - } - - if (!updates.isEmpty()) { - List batch = new ArrayList<>(updates); - updates.clear(); - updated += runInNewTx(() -> service.updateBatchById(batch, batchSize) ? batch.size() : 0); - } - - return new CompanyIdRefreshStats(true, updated, matched, notFound, ambiguous); - } - - /** - * 批量 upsert:优先按 code 匹配;code 为空时按 name 匹配。 - */ - public int upsertByCodeOrName(IService service, - List items, - SFunction idColumn, - BiConsumer idSetter, - SFunction codeColumn, - Function codeGetter, - SFunction nameColumn, - Function nameGetter, - Consumer> extraConditions, - int batchSize) { - if (CollectionUtils.isEmpty(items)) { - return 0; - } - - List codes = new ArrayList<>(); - List names = new ArrayList<>(); - for (T item : items) { - if (item == null) { - continue; - } - String code = normalize(codeGetter.apply(item)); - if (code != null) { - codes.add(code); - } else { - String name = normalize(nameGetter.apply(item)); - if (name != null) { - names.add(name); - } - } - } - - Map idByCode = new HashMap<>(); - if (!codes.isEmpty()) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - if (extraConditions != null) { - extraConditions.accept(wrapper); - } - wrapper.in(codeColumn, codes); - wrapper.select(idColumn, codeColumn); - for (T dbRow : service.list(wrapper)) { - String code = normalize(codeGetter.apply(dbRow)); - Integer id = extractId(dbRow, idColumn); - if (code != null && id != null) { - idByCode.putIfAbsent(code, id); - } - } - } - - Map idByName = new HashMap<>(); - if (!names.isEmpty()) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - if (extraConditions != null) { - extraConditions.accept(wrapper); - } - wrapper.in(nameColumn, names); - wrapper.select(idColumn, nameColumn); - for (T dbRow : service.list(wrapper)) { - String name = normalize(nameGetter.apply(dbRow)); - Integer id = extractId(dbRow, idColumn); - if (name != null && id != null) { - idByName.putIfAbsent(name, id); - } - } - } - - List updates = new ArrayList<>(); - List inserts = new ArrayList<>(); - for (T item : items) { - if (item == null) { - continue; - } - String code = normalize(codeGetter.apply(item)); - Integer id = null; - if (code != null) { - id = idByCode.get(code); - } else { - String name = normalize(nameGetter.apply(item)); - if (name != null) { - id = idByName.get(name); - } - } - - if (id != null) { - idSetter.accept(item, id); - updates.add(item); - } else { - inserts.add(item); - } - } - - if (!updates.isEmpty()) { - service.updateBatchById(updates, batchSize); - } - if (!inserts.isEmpty()) { - service.saveBatch(inserts, batchSize); - } - return updates.size() + inserts.size(); - } - - /** - * 批量 upsert:按单字段 key 匹配(key 非空)。 - */ - public int upsertBySingleKey(IService service, - List items, - SFunction idColumn, - BiConsumer idSetter, - SFunction keyColumn, - Function keyGetter, - Consumer> extraConditions, - int batchSize) { - if (CollectionUtils.isEmpty(items)) { - return 0; - } - - List keys = new ArrayList<>(items.size()); - for (T item : items) { - if (item == null) { - continue; - } - String key = normalize(keyGetter.apply(item)); - if (key != null) { - keys.add(key); - } - } - - Map idByKey = new HashMap<>(); - if (!keys.isEmpty()) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - if (extraConditions != null) { - extraConditions.accept(wrapper); - } - wrapper.in(keyColumn, keys); - wrapper.select(idColumn, keyColumn); - for (T dbRow : service.list(wrapper)) { - String key = normalize(keyGetter.apply(dbRow)); - Integer id = extractId(dbRow, idColumn); - if (key != null && id != null) { - idByKey.putIfAbsent(key, id); - } - } - } - - List updates = new ArrayList<>(); - List inserts = new ArrayList<>(); - for (T item : items) { - if (item == null) { - continue; - } - String key = normalize(keyGetter.apply(item)); - Integer id = key != null ? idByKey.get(key) : null; - if (id != null) { - idSetter.accept(item, id); - updates.add(item); - } else { - inserts.add(item); - } - } - - if (!updates.isEmpty()) { - service.updateBatchById(updates, batchSize); - } - if (!inserts.isEmpty()) { - service.saveBatch(inserts, batchSize); - } - return updates.size() + inserts.size(); - } - - /** - * 批量 upsert:按单字段 key 匹配(key 非空)。当匹配到已存在记录时: - * - 覆盖更新 - * - 将 counter(通常是 recommend)在数据库原值基础上 +1,用于记录“被更新次数” - * - *

注意:counter 会被覆盖写入(不是 SQL 自增),因此该方法适合导入场景。

- */ - public int upsertBySingleKeyAndIncrementCounterOnUpdate(IService service, - List items, - SFunction idColumn, - BiConsumer idSetter, - SFunction keyColumn, - Function keyGetter, - SFunction counterColumn, - BiConsumer counterSetter, - Consumer> extraConditions, - int batchSize) { - if (CollectionUtils.isEmpty(items)) { - return 0; - } - - List keys = new ArrayList<>(items.size()); - for (T item : items) { - if (item == null) { - continue; - } - String key = normalize(keyGetter.apply(item)); - if (key != null) { - keys.add(key); - } - } - - Map idByKey = new HashMap<>(); - Map counterByKey = new HashMap<>(); - if (!keys.isEmpty()) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - if (extraConditions != null) { - extraConditions.accept(wrapper); - } - wrapper.in(keyColumn, keys); - wrapper.select(idColumn, keyColumn, counterColumn); - for (T dbRow : service.list(wrapper)) { - String key = normalize(keyGetter.apply(dbRow)); - Integer id = extractId(dbRow, idColumn); - if (key == null || id == null) { - continue; - } - idByKey.putIfAbsent(key, id); - if (counterColumn != null) { - counterByKey.putIfAbsent(key, counterColumn.apply(dbRow)); - } - } - } - - List updates = new ArrayList<>(); - List inserts = new ArrayList<>(); - for (T item : items) { - if (item == null) { - continue; - } - String key = normalize(keyGetter.apply(item)); - Integer id = key != null ? idByKey.get(key) : null; - if (id != null) { - idSetter.accept(item, id); - Integer old = key != null ? counterByKey.get(key) : null; - if (counterSetter != null) { - counterSetter.accept(item, old == null ? 1 : old + 1); - } - updates.add(item); - } else { - // insert:如果未提供 counterSetter,则不做处理;如果提供则默认 0。 - if (counterSetter != null) { - counterSetter.accept(item, 0); - } - inserts.add(item); - } - } - - if (!updates.isEmpty()) { - service.updateBatchById(updates, batchSize); - } - if (!inserts.isEmpty()) { - service.saveBatch(inserts, batchSize); - } - return updates.size() + inserts.size(); - } - - /** - * 批量 upsert:优先按 code 匹配;code 为空时按 name 匹配。匹配到已存在记录时 counter +1。 - */ - public int upsertByCodeOrNameAndIncrementCounterOnUpdate(IService service, - List items, - SFunction idColumn, - BiConsumer idSetter, - SFunction codeColumn, - Function codeGetter, - SFunction nameColumn, - Function nameGetter, - SFunction counterColumn, - BiConsumer counterSetter, - Consumer> extraConditions, - int batchSize) { - if (CollectionUtils.isEmpty(items)) { - return 0; - } - - List codes = new ArrayList<>(); - List names = new ArrayList<>(); - for (T item : items) { - if (item == null) { - continue; - } - String code = normalize(codeGetter.apply(item)); - if (code != null) { - codes.add(code); - } else { - String name = normalize(nameGetter.apply(item)); - if (name != null) { - names.add(name); - } - } - } - - Map idByCode = new HashMap<>(); - Map counterByCode = new HashMap<>(); - if (!codes.isEmpty()) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - if (extraConditions != null) { - extraConditions.accept(wrapper); - } - wrapper.in(codeColumn, codes); - wrapper.select(idColumn, codeColumn, counterColumn); - for (T dbRow : service.list(wrapper)) { - String code = normalize(codeGetter.apply(dbRow)); - Integer id = extractId(dbRow, idColumn); - if (code == null || id == null) { - continue; - } - idByCode.putIfAbsent(code, id); - if (counterColumn != null) { - counterByCode.putIfAbsent(code, counterColumn.apply(dbRow)); - } - } - } - - Map idByName = new HashMap<>(); - Map counterByName = new HashMap<>(); - if (!names.isEmpty()) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - if (extraConditions != null) { - extraConditions.accept(wrapper); - } - wrapper.in(nameColumn, names); - wrapper.select(idColumn, nameColumn, counterColumn); - for (T dbRow : service.list(wrapper)) { - String name = normalize(nameGetter.apply(dbRow)); - Integer id = extractId(dbRow, idColumn); - if (name == null || id == null) { - continue; - } - idByName.putIfAbsent(name, id); - if (counterColumn != null) { - counterByName.putIfAbsent(name, counterColumn.apply(dbRow)); - } - } - } - - List updates = new ArrayList<>(); - List inserts = new ArrayList<>(); - for (T item : items) { - if (item == null) { - continue; - } - String code = normalize(codeGetter.apply(item)); - Integer id = null; - Integer old = null; - if (code != null) { - id = idByCode.get(code); - old = counterByCode.get(code); - } else { - String name = normalize(nameGetter.apply(item)); - if (name != null) { - id = idByName.get(name); - old = counterByName.get(name); - } - } - - if (id != null) { - idSetter.accept(item, id); - if (counterSetter != null) { - counterSetter.accept(item, old == null ? 1 : old + 1); - } - updates.add(item); - } else { - if (counterSetter != null) { - counterSetter.accept(item, 0); - } - inserts.add(item); - } - } - - if (!updates.isEmpty()) { - service.updateBatchById(updates, batchSize); - } - if (!inserts.isEmpty()) { - service.saveBatch(inserts, batchSize); - } - return updates.size() + inserts.size(); - } - - /** - * 批量失败时降级逐行,尽量保留“第 N 行”错误定位。 - */ - public int persistChunkWithFallback(List items, - List excelRowNumbers, - Supplier batchPersist, - BiFunction rowPersist, - List errorMessages) { - if (CollectionUtils.isEmpty(items)) { - return 0; - } - try { - return runInNewTx(batchPersist); - } catch (Exception batchException) { - int successCount = 0; - for (int i = 0; i < items.size(); i++) { - T item = items.get(i); - int excelRowNumber = (excelRowNumbers != null && i < excelRowNumbers.size()) ? excelRowNumbers.get(i) : -1; - try { - int delta = runInNewTx(() -> rowPersist.apply(item, excelRowNumber) ? 1 : 0); - successCount += delta; - } catch (Exception e) { - if (errorMessages != null) { - if (excelRowNumber > 0) { - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - } else { - errorMessages.add(e.getMessage()); - } - } - } - } - return successCount; - } - } - - /** - * 批量失败时降级逐行:允许调用方自定义“成功条数”的计算口径(例如:仅统计 insert 入库条数)。 - * - *

batchPersistCount / rowPersistCount 返回的是“需要累计的条数增量”,并不等同于“是否成功”。

- */ - public int persistChunkWithFallbackCount(List items, - List excelRowNumbers, - Supplier batchPersistCount, - BiFunction rowPersistCount, - List errorMessages) { - if (CollectionUtils.isEmpty(items)) { - return 0; - } - try { - return runInNewTx(batchPersistCount); - } catch (Exception batchException) { - int count = 0; - for (int i = 0; i < items.size(); i++) { - T item = items.get(i); - int excelRowNumber = (excelRowNumbers != null && i < excelRowNumbers.size()) ? excelRowNumbers.get(i) : -1; - try { - Integer delta = runInNewTx(() -> rowPersistCount.apply(item, excelRowNumber)); - if (delta != null && delta > 0) { - count += delta; - } - } catch (Exception e) { - if (errorMessages != null) { - if (excelRowNumber > 0) { - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - } else { - errorMessages.add(e.getMessage()); - } - } - } - } - return count; - } - } - - private static String normalize(String value) { - if (value == null) { - return null; - } - String trimmed = value.trim(); - return trimmed.isEmpty() ? null : trimmed; - } - - private static String normalizeCompanyName(String name) { - if (name == null) { - return null; - } - // 兼容 Excel/网页复制带来的全角空格 - String v = name.replace(' ', ' ').trim(); - return v.isEmpty() ? null : v; - } - - /** - * Split a "party names" cell into normalized company name candidates. - * Supports common separators used in Excel/web copy (comma/semicolon/Chinese list delimiter/newlines). - */ - private static List splitPartyNames(String raw) { - List result = new ArrayList<>(); - String v = normalizeCompanyName(raw); - if (v == null) { - return result; - } - String[] parts = PARTY_SPLIT_PATTERN.split(v); - if (parts == null || parts.length == 0) { - result.add(v); - return result; - } - for (String p : parts) { - String item = normalizeCompanyName(p); - if (item != null) { - result.add(item); - } - } - return result; - } - - private static void addCompanyNameMapping(Map idByName, - Map ambiguousByName, - String key, - Integer companyId) { - if (key == null || companyId == null) { - return; - } - Integer existing = idByName.get(key); - if (existing == null) { - idByName.put(key, companyId); - return; - } - if (!existing.equals(companyId)) { - ambiguousByName.put(key, 1); - } - } - - private static Integer extractId(T entity, SFunction idColumn) { - // SFunction 是 getter method ref,直接调用即可 - return idColumn.apply(entity); - } -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditAdministrativeLicenseController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditAdministrativeLicenseController.java deleted file mode 100644 index 8564fcc..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditAdministrativeLicenseController.java +++ /dev/null @@ -1,696 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditAdministrativeLicense; -import com.gxwebsoft.credit.param.CreditAdministrativeLicenseImportParam; -import com.gxwebsoft.credit.param.CreditAdministrativeLicenseParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditAdministrativeLicenseService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 行政许可控制器 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Tag(name = "行政许可管理") -@RestController -@RequestMapping("/api/credit/credit-administrative-license") -public class CreditAdministrativeLicenseController extends BaseController { - @Resource - private CreditAdministrativeLicenseService creditAdministrativeLicenseService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询行政许可") - @GetMapping("/page") - public ApiResult> page(CreditAdministrativeLicenseParam param) { - // 使用关联查询 - return success(creditAdministrativeLicenseService.pageRel(param)); - } - - @Operation(summary = "查询全部行政许可") - @GetMapping() - public ApiResult> list(CreditAdministrativeLicenseParam param) { - // 使用关联查询 - return success(creditAdministrativeLicenseService.listRel(param)); - } - - @Operation(summary = "根据id查询行政许可") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditAdministrativeLicenseService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:save')") - @OperationLog - @Operation(summary = "添加行政许可") - @PostMapping() - public ApiResult save(@RequestBody CreditAdministrativeLicense creditAdministrativeLicense) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditAdministrativeLicense.setUserId(loginUser.getUserId()); - // } - if (creditAdministrativeLicenseService.save(creditAdministrativeLicense)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:update')") - @OperationLog - @Operation(summary = "修改行政许可") - @PutMapping() - public ApiResult update(@RequestBody CreditAdministrativeLicense creditAdministrativeLicense) { - if (creditAdministrativeLicenseService.updateById(creditAdministrativeLicense)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:remove')") - @OperationLog - @Operation(summary = "删除行政许可") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditAdministrativeLicenseService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:save')") - @OperationLog - @Operation(summary = "批量添加行政许可") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditAdministrativeLicenseService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:update')") - @OperationLog - @Operation(summary = "批量修改行政许可") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditAdministrativeLicenseService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:remove')") - @OperationLog - @Operation(summary = "批量删除行政许可") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditAdministrativeLicenseService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditAdministrativeLicenseService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditAdministrativeLicense::getId, - CreditAdministrativeLicense::setId, - CreditAdministrativeLicense::getName, - CreditAdministrativeLicense::getCompanyId, - CreditAdministrativeLicense::setCompanyId, - CreditAdministrativeLicense::getHasData, - CreditAdministrativeLicense::setHasData, - CreditAdministrativeLicense::getTenantId, - CreditAdministrativeLicense::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入行政许可 - */ - @PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:save')") - @Operation(summary = "批量导入行政许可") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.readAnySheet( - file, CreditAdministrativeLicenseImportParam.class, this::isEmptyImportRow); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCode = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "决定文书/许可编号"); - Map urlByName = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "决定文书/许可证名称"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditAdministrativeLicenseImportParam param = list.get(i); - try { - CreditAdministrativeLicense item = convertImportParamToEntity(param); - String link = null; - if (!ImportHelper.isBlank(item.getCode())) { - link = urlByCode.get(item.getCode().trim()); - } - if ((link == null || link.isEmpty()) && !ImportHelper.isBlank(item.getName())) { - link = urlByName.get(item.getName().trim()); - } - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getName())) { - errorMessages.add("第" + excelRowNumber + "行:决定文书/许可证名称不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertByCodeOrName( - creditAdministrativeLicenseService, - chunkItems, - CreditAdministrativeLicense::getId, - CreditAdministrativeLicense::setId, - CreditAdministrativeLicense::getCode, - CreditAdministrativeLicense::getCode, - CreditAdministrativeLicense::getName, - CreditAdministrativeLicense::getName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditAdministrativeLicenseService.save(rowItem); - if (!saved) { - CreditAdministrativeLicense existing = null; - if (!ImportHelper.isBlank(rowItem.getCode())) { - existing = creditAdministrativeLicenseService.lambdaQuery() - .eq(CreditAdministrativeLicense::getCode, rowItem.getCode()) - .one(); - } - if (existing == null) { - existing = creditAdministrativeLicenseService.lambdaQuery() - .eq(CreditAdministrativeLicense::getName, rowItem.getName()) - .one(); - } - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditAdministrativeLicenseService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertByCodeOrName( - creditAdministrativeLicenseService, - chunkItems, - CreditAdministrativeLicense::getId, - CreditAdministrativeLicense::setId, - CreditAdministrativeLicense::getCode, - CreditAdministrativeLicense::getCode, - CreditAdministrativeLicense::getName, - CreditAdministrativeLicense::getName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditAdministrativeLicenseService.save(rowItem); - if (!saved) { - CreditAdministrativeLicense existing = null; - if (!ImportHelper.isBlank(rowItem.getCode())) { - existing = creditAdministrativeLicenseService.lambdaQuery() - .eq(CreditAdministrativeLicense::getCode, rowItem.getCode()) - .one(); - } - if (existing == null) { - existing = creditAdministrativeLicenseService.lambdaQuery() - .eq(CreditAdministrativeLicense::getName, rowItem.getName()) - .one(); - } - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditAdministrativeLicenseService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.ADMINISTRATIVE_LICENSE, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 批量导入历史行政许可(仅解析“历史行政许可”选项卡) - * 规则:优先按编号(code)匹配;code 为空时按名称(name)匹配;匹配到则覆盖更新(recommend++ 记录更新次数)。 - */ - @PreAuthorize("hasAuthority('credit:creditAdministrativeLicense:save')") - @Operation(summary = "批量导入历史行政许可") - @PostMapping("/import/history") - public ApiResult> importHistoryBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "历史行政许可"); - if (sheetIndex < 0) { - return fail("未读取到数据,请确认文件中存在“历史行政许可”选项卡且表头与示例格式一致", null); - } - - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditAdministrativeLicenseImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCode = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "决定文书/许可编号"); - Map urlByName = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "决定文书/许可证名称"); - - LinkedHashMap latestByKey = new LinkedHashMap<>(); - LinkedHashMap latestRowByKey = new LinkedHashMap<>(); - - for (int i = 0; i < list.size(); i++) { - CreditAdministrativeLicenseImportParam param = list.get(i); - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - try { - CreditAdministrativeLicense item = convertImportParamToEntity(param); - if (item.getCode() != null) { - item.setCode(item.getCode().trim()); - } - if (item.getName() != null) { - item.setName(item.getName().trim()); - } - - if (ImportHelper.isBlank(item.getName())) { - errorMessages.add("第" + excelRowNumber + "行:决定文书/许可证名称不能为空"); - continue; - } - - String link = null; - if (!ImportHelper.isBlank(item.getCode())) { - link = urlByCode.get(item.getCode()); - } - if ((link == null || link.isEmpty()) && !ImportHelper.isBlank(item.getName())) { - link = urlByName.get(item.getName()); - } - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - // 历史导入的数据统一标记为“失效” - item.setDataStatus("失效"); - - String dedupKey = !ImportHelper.isBlank(item.getCode()) ? ("CODE:" + item.getCode()) : ("NAME:" + item.getName()); - latestByKey.put(dedupKey, item); - latestRowByKey.put(dedupKey, excelRowNumber); - } catch (Exception e) { - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (latestByKey.isEmpty()) { - if (errorMessages.isEmpty()) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - return success("导入完成,成功0条,失败" + errorMessages.size() + "条", errorMessages); - } - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (Map.Entry entry : latestByKey.entrySet()) { - String dedupKey = entry.getKey(); - CreditAdministrativeLicense item = entry.getValue(); - Integer rowNo = latestRowByKey.get(dedupKey); - chunkItems.add(item); - chunkRowNumbers.add(rowNo != null ? rowNo : -1); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertByCodeOrNameAndIncrementCounterOnUpdate( - creditAdministrativeLicenseService, - chunkItems, - CreditAdministrativeLicense::getId, - CreditAdministrativeLicense::setId, - CreditAdministrativeLicense::getCode, - CreditAdministrativeLicense::getCode, - CreditAdministrativeLicense::getName, - CreditAdministrativeLicense::getName, - CreditAdministrativeLicense::getRecommend, - CreditAdministrativeLicense::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditAdministrativeLicenseService.save(rowItem); - if (!saved) { - CreditAdministrativeLicense existing = null; - if (!ImportHelper.isBlank(rowItem.getCode())) { - existing = creditAdministrativeLicenseService.lambdaQuery() - .eq(CreditAdministrativeLicense::getCode, rowItem.getCode()) - .select(CreditAdministrativeLicense::getId, CreditAdministrativeLicense::getRecommend) - .one(); - } - if (existing == null && !ImportHelper.isBlank(rowItem.getName())) { - existing = creditAdministrativeLicenseService.lambdaQuery() - .eq(CreditAdministrativeLicense::getName, rowItem.getName()) - .select(CreditAdministrativeLicense::getId, CreditAdministrativeLicense::getRecommend) - .one(); - } - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditAdministrativeLicenseService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertByCodeOrNameAndIncrementCounterOnUpdate( - creditAdministrativeLicenseService, - chunkItems, - CreditAdministrativeLicense::getId, - CreditAdministrativeLicense::setId, - CreditAdministrativeLicense::getCode, - CreditAdministrativeLicense::getCode, - CreditAdministrativeLicense::getName, - CreditAdministrativeLicense::getName, - CreditAdministrativeLicense::getRecommend, - CreditAdministrativeLicense::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditAdministrativeLicenseService.save(rowItem); - if (!saved) { - CreditAdministrativeLicense existing = null; - if (!ImportHelper.isBlank(rowItem.getCode())) { - existing = creditAdministrativeLicenseService.lambdaQuery() - .eq(CreditAdministrativeLicense::getCode, rowItem.getCode()) - .select(CreditAdministrativeLicense::getId, CreditAdministrativeLicense::getRecommend) - .one(); - } - if (existing == null && !ImportHelper.isBlank(rowItem.getName())) { - existing = creditAdministrativeLicenseService.lambdaQuery() - .eq(CreditAdministrativeLicense::getName, rowItem.getName()) - .select(CreditAdministrativeLicense::getId, CreditAdministrativeLicense::getRecommend) - .one(); - } - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditAdministrativeLicenseService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.ADMINISTRATIVE_LICENSE, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载行政许可导入模板 - */ - @Operation(summary = "下载行政许可导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditAdministrativeLicenseImportParam example = new CreditAdministrativeLicenseImportParam(); - example.setCode("(2024)示例许可编号"); - example.setName("示例行政许可名称"); - example.setStatusText("有效"); - example.setType("行政许可"); - example.setValidityStart("2024-01-01"); - example.setValidityEnd("2029-01-01"); - example.setLicensingAuthority("某某许可机关"); - example.setLicenseContent("许可内容示例"); - example.setDataSourceUnit("数据来源单位示例"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("行政许可导入模板", "行政许可", CreditAdministrativeLicenseImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_administrative_license_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditAdministrativeLicenseImportParam param) { - if (param == null) { - return true; - } - if (isImportHeaderRow(param)) { - return true; - } - return ImportHelper.isBlank(param.getCode()) - && ImportHelper.isBlank(param.getName()) - && ImportHelper.isBlank(param.getStatusText()); - } - - private boolean isImportHeaderRow(CreditAdministrativeLicenseImportParam param) { - return isHeaderValue(param.getCode(), "决定文书/许可编号") - || isHeaderValue(param.getName(), "决定文书/许可证名称") - || isHeaderValue(param.getStatusText(), "许可状态"); - } - - private static boolean isHeaderValue(String value, String headerText) { - if (value == null) { - return false; - } - return headerText.equals(value.trim()); - } - - private CreditAdministrativeLicense convertImportParamToEntity(CreditAdministrativeLicenseImportParam param) { - CreditAdministrativeLicense entity = new CreditAdministrativeLicense(); - - entity.setCode(param.getCode()); - entity.setName(param.getName()); - entity.setStatusText(param.getStatusText()); - entity.setType(param.getType()); - entity.setValidityStart(param.getValidityStart()); - entity.setValidityEnd(param.getValidityEnd()); - entity.setLicensingAuthority(param.getLicensingAuthority()); - entity.setLicenseContent(param.getLicenseContent()); - entity.setDataSourceUnit(param.getDataSourceUnit()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditBankruptcyController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditBankruptcyController.java deleted file mode 100644 index 2ba6a4a..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditBankruptcyController.java +++ /dev/null @@ -1,627 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditBankruptcy; -import com.gxwebsoft.credit.param.CreditBankruptcyImportParam; -import com.gxwebsoft.credit.param.CreditBankruptcyParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditBankruptcyService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 破产重整控制器 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Tag(name = "破产重整管理") -@RestController -@RequestMapping("/api/credit/credit-bankruptcy") -public class CreditBankruptcyController extends BaseController { - @Resource - private CreditBankruptcyService creditBankruptcyService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询破产重整") - @GetMapping("/page") - public ApiResult> page(CreditBankruptcyParam param) { - // 使用关联查询 - return success(creditBankruptcyService.pageRel(param)); - } - - @Operation(summary = "查询全部破产重整") - @GetMapping() - public ApiResult> list(CreditBankruptcyParam param) { - // 使用关联查询 - return success(creditBankruptcyService.listRel(param)); - } - - @Operation(summary = "根据id查询破产重整") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditBankruptcyService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditBankruptcy:save')") - @OperationLog - @Operation(summary = "添加破产重整") - @PostMapping() - public ApiResult save(@RequestBody CreditBankruptcy creditBankruptcy) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditBankruptcy.setUserId(loginUser.getUserId()); - // } - if (creditBankruptcyService.save(creditBankruptcy)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBankruptcy:update')") - @OperationLog - @Operation(summary = "修改破产重整") - @PutMapping() - public ApiResult update(@RequestBody CreditBankruptcy creditBankruptcy) { - if (creditBankruptcyService.updateById(creditBankruptcy)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBankruptcy:remove')") - @OperationLog - @Operation(summary = "删除破产重整") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditBankruptcyService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBankruptcy:save')") - @OperationLog - @Operation(summary = "批量添加破产重整") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditBankruptcyService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBankruptcy:update')") - @OperationLog - @Operation(summary = "批量修改破产重整") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditBankruptcyService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBankruptcy:remove')") - @OperationLog - @Operation(summary = "批量删除破产重整") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditBankruptcyService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditBankruptcy:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditBankruptcyService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditBankruptcy::getId, - CreditBankruptcy::setId, - CreditBankruptcy::getParty, - CreditBankruptcy::getCompanyId, - CreditBankruptcy::setCompanyId, - CreditBankruptcy::getHasData, - CreditBankruptcy::setHasData, - CreditBankruptcy::getTenantId, - CreditBankruptcy::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入破产重整 - */ - @PreAuthorize("hasAuthority('credit:creditBankruptcy:save')") - @Operation(summary = "批量导入破产重整") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.readAnySheet( - file, CreditBankruptcyImportParam.class, this::isEmptyImportRow); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCode = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditBankruptcyImportParam param = list.get(i); - try { - CreditBankruptcy item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getCode())) { - String link = urlByCode.get(item.getCode().trim()); - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getCode())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditBankruptcyService, - chunkItems, - CreditBankruptcy::getId, - CreditBankruptcy::setId, - CreditBankruptcy::getCode, - CreditBankruptcy::getCode, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditBankruptcyService.save(rowItem); - if (!saved) { - CreditBankruptcy existing = creditBankruptcyService.lambdaQuery() - .eq(CreditBankruptcy::getCode, rowItem.getCode()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditBankruptcyService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditBankruptcyService, - chunkItems, - CreditBankruptcy::getId, - CreditBankruptcy::setId, - CreditBankruptcy::getCode, - CreditBankruptcy::getCode, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditBankruptcyService.save(rowItem); - if (!saved) { - CreditBankruptcy existing = creditBankruptcyService.lambdaQuery() - .eq(CreditBankruptcy::getCode, rowItem.getCode()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditBankruptcyService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.BANKRUPTCY, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 批量导入历史破产重整(仅解析“历史破产重整”选项卡) - * 规则:案号/唯一标识相同则覆盖更新(recommend++ 记录更新次数);不存在则插入。 - */ - @PreAuthorize("hasAuthority('credit:creditBankruptcy:save')") - @Operation(summary = "批量导入历史破产重整") - @PostMapping("/import/history") - public ApiResult> importHistoryBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "历史破产重整"); - if (sheetIndex < 0) { - return fail("未读取到数据,请确认文件中存在“历史破产重整”选项卡且表头与示例格式一致", null); - } - - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditBankruptcyImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCode = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - LinkedHashMap latestByCode = new LinkedHashMap<>(); - LinkedHashMap latestRowByCode = new LinkedHashMap<>(); - - for (int i = 0; i < list.size(); i++) { - CreditBankruptcyImportParam param = list.get(i); - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - try { - CreditBankruptcy item = convertImportParamToEntity(param); - if (item.getCode() != null) { - item.setCode(item.getCode().trim()); - } - if (ImportHelper.isBlank(item.getCode())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - String link = urlByCode.get(item.getCode()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - latestByCode.put(item.getCode(), item); - latestRowByCode.put(item.getCode(), excelRowNumber); - } catch (Exception e) { - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (latestByCode.isEmpty()) { - if (errorMessages.isEmpty()) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - return success("导入完成,成功0条,失败" + errorMessages.size() + "条", errorMessages); - } - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (Map.Entry entry : latestByCode.entrySet()) { - String code = entry.getKey(); - CreditBankruptcy item = entry.getValue(); - Integer rowNo = latestRowByCode.get(code); - chunkItems.add(item); - chunkRowNumbers.add(rowNo != null ? rowNo : -1); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditBankruptcyService, - chunkItems, - CreditBankruptcy::getId, - CreditBankruptcy::setId, - CreditBankruptcy::getCode, - CreditBankruptcy::getCode, - CreditBankruptcy::getRecommend, - CreditBankruptcy::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditBankruptcyService.save(rowItem); - if (!saved) { - CreditBankruptcy existing = creditBankruptcyService.lambdaQuery() - .eq(CreditBankruptcy::getCode, rowItem.getCode()) - .select(CreditBankruptcy::getId, CreditBankruptcy::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditBankruptcyService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditBankruptcyService, - chunkItems, - CreditBankruptcy::getId, - CreditBankruptcy::setId, - CreditBankruptcy::getCode, - CreditBankruptcy::getCode, - CreditBankruptcy::getRecommend, - CreditBankruptcy::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditBankruptcyService.save(rowItem); - if (!saved) { - CreditBankruptcy existing = creditBankruptcyService.lambdaQuery() - .eq(CreditBankruptcy::getCode, rowItem.getCode()) - .select(CreditBankruptcy::getId, CreditBankruptcy::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditBankruptcyService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.BANKRUPTCY, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载破产重整导入模板 - */ - @Operation(summary = "下载破产重整导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditBankruptcyImportParam example = new CreditBankruptcyImportParam(); - example.setCode("(2024)示例案号"); - example.setType("破产清算"); - example.setParty("某某公司"); - example.setCourt("某某人民法院"); - example.setPublicDate("2024-01-10"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("破产重整导入模板", "破产重整", CreditBankruptcyImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_bankruptcy_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditBankruptcyImportParam param) { - if (param == null) { - return true; - } - if (isImportHeaderRow(param)) { - return true; - } - return ImportHelper.isBlank(param.getCode()) - && ImportHelper.isBlank(param.getParty()) - && ImportHelper.isBlank(param.getCourt()); - } - - private boolean isImportHeaderRow(CreditBankruptcyImportParam param) { - return isHeaderValue(param.getCode(), "案号") - || isHeaderValue(param.getType(), "案件类型") - || isHeaderValue(param.getParty(), "当事人"); - } - - private static boolean isHeaderValue(String value, String headerText) { - if (value == null) { - return false; - } - return headerText.equals(value.trim()); - } - - private CreditBankruptcy convertImportParamToEntity(CreditBankruptcyImportParam param) { - CreditBankruptcy entity = new CreditBankruptcy(); - - entity.setCode(param.getCode()); - entity.setType(param.getType()); - entity.setParty(param.getParty()); - entity.setCourt(param.getCourt()); - entity.setPublicDate(param.getPublicDate()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditBranchController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditBranchController.java deleted file mode 100644 index 8c81cb1..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditBranchController.java +++ /dev/null @@ -1,420 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditBranch; -import com.gxwebsoft.credit.param.CreditBranchImportParam; -import com.gxwebsoft.credit.param.CreditBranchParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditBranchService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 分支机构控制器 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Tag(name = "分支机构管理") -@RestController -@RequestMapping("/api/credit/credit-branch") -public class CreditBranchController extends BaseController { - @Resource - private CreditBranchService creditBranchService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询分支机构") - @GetMapping("/page") - public ApiResult> page(CreditBranchParam param) { - // 使用关联查询 - return success(creditBranchService.pageRel(param)); - } - - @Operation(summary = "查询全部分支机构") - @GetMapping() - public ApiResult> list(CreditBranchParam param) { - // 使用关联查询 - return success(creditBranchService.listRel(param)); - } - - @Operation(summary = "根据id查询分支机构") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditBranchService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditBranch:save')") - @OperationLog - @Operation(summary = "添加分支机构") - @PostMapping() - public ApiResult save(@RequestBody CreditBranch creditBranch) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditBranch.setUserId(loginUser.getUserId()); - // } - if (creditBranchService.save(creditBranch)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBranch:update')") - @OperationLog - @Operation(summary = "修改分支机构") - @PutMapping() - public ApiResult update(@RequestBody CreditBranch creditBranch) { - if (creditBranchService.updateById(creditBranch)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBranch:remove')") - @OperationLog - @Operation(summary = "删除分支机构") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditBranchService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBranch:save')") - @OperationLog - @Operation(summary = "批量添加分支机构") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditBranchService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBranch:update')") - @OperationLog - @Operation(summary = "批量修改分支机构") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditBranchService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBranch:remove')") - @OperationLog - @Operation(summary = "批量删除分支机构") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditBranchService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditBranch:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditBranchService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditBranch::getId, - CreditBranch::setId, - CreditBranch::getName, - CreditBranch::getCompanyId, - CreditBranch::setCompanyId, - CreditBranch::getHasData, - CreditBranch::setHasData, - CreditBranch::getTenantId, - CreditBranch::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入分支机构 - */ - @PreAuthorize("hasAuthority('credit:creditBranch:save')") - @Operation(summary = "批量导入分支机构") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.readAnySheet( - file, CreditBranchImportParam.class, this::isEmptyImportRow); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByName = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "分支机构名称"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditBranchImportParam param = list.get(i); - try { - CreditBranch item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getName())) { - String link = urlByName.get(item.getName().trim()); - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getName())) { - errorMessages.add("第" + excelRowNumber + "行:分支机构名称不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditBranchService, - chunkItems, - CreditBranch::getId, - CreditBranch::setId, - CreditBranch::getName, - CreditBranch::getName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditBranchService.save(rowItem); - if (!saved) { - CreditBranch existing = creditBranchService.lambdaQuery() - .eq(CreditBranch::getName, rowItem.getName()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditBranchService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditBranchService, - chunkItems, - CreditBranch::getId, - CreditBranch::setId, - CreditBranch::getName, - CreditBranch::getName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditBranchService.save(rowItem); - if (!saved) { - CreditBranch existing = creditBranchService.lambdaQuery() - .eq(CreditBranch::getName, rowItem.getName()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditBranchService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.BRANCH, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载分支机构导入模板 - */ - @Operation(summary = "下载分支机构导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditBranchImportParam example = new CreditBranchImportParam(); - example.setName("某某公司分支机构"); - example.setCurator("张三"); - example.setRegion("广西南宁"); - example.setEstablishDate("2020-06-01"); - example.setStatusText("存续"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("分支机构导入模板", "分支机构", CreditBranchImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_branch_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditBranchImportParam param) { - if (param == null) { - return true; - } - if (isImportHeaderRow(param)) { - return true; - } - return ImportHelper.isBlank(param.getName()) - && ImportHelper.isBlank(param.getCurator()) - && ImportHelper.isBlank(param.getRegion()); - } - - private boolean isImportHeaderRow(CreditBranchImportParam param) { - return isHeaderValue(param.getName(), "分支机构名称") - || isHeaderValue(param.getCurator(), "负责人") - || isHeaderValue(param.getRegion(), "地区"); - } - - private static boolean isHeaderValue(String value, String headerText) { - if (value == null) { - return false; - } - return headerText.equals(value.trim()); - } - - private CreditBranch convertImportParamToEntity(CreditBranchImportParam param) { - CreditBranch entity = new CreditBranch(); - - entity.setName(param.getName()); - entity.setCurator(param.getCurator()); - entity.setRegion(param.getRegion()); - entity.setEstablishDate(param.getEstablishDate()); - entity.setStatusText(param.getStatusText()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditBreachOfTrustController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditBreachOfTrustController.java deleted file mode 100644 index 880afde..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditBreachOfTrustController.java +++ /dev/null @@ -1,638 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditBreachOfTrust; -import com.gxwebsoft.credit.param.CreditBreachOfTrustImportParam; -import com.gxwebsoft.credit.param.CreditBreachOfTrustParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditBreachOfTrustService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.time.LocalDate; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 失信被执行人控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:46:14 - */ -@Tag(name = "失信被执行人管理") -@RestController -@RequestMapping("/api/credit/credit-breach-of-trust") -public class CreditBreachOfTrustController extends BaseController { - @Resource - private CreditBreachOfTrustService creditBreachOfTrustService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询失信被执行人") - @GetMapping("/page") - public ApiResult> page(CreditBreachOfTrustParam param) { - // 使用关联查询 - return success(creditBreachOfTrustService.pageRel(param)); - } - - @Operation(summary = "查询全部失信被执行人") - @GetMapping() - public ApiResult> list(CreditBreachOfTrustParam param) { - // 使用关联查询 - return success(creditBreachOfTrustService.listRel(param)); - } - - @Operation(summary = "根据id查询失信被执行人") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditBreachOfTrustService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditBreachOfTrust:save')") - @OperationLog - @Operation(summary = "添加失信被执行人") - @PostMapping() - public ApiResult save(@RequestBody CreditBreachOfTrust creditBreachOfTrust) { - if (creditBreachOfTrustService.save(creditBreachOfTrust)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBreachOfTrust:update')") - @OperationLog - @Operation(summary = "修改失信被执行人") - @PutMapping() - public ApiResult update(@RequestBody CreditBreachOfTrust creditBreachOfTrust) { - if (creditBreachOfTrustService.updateById(creditBreachOfTrust)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBreachOfTrust:remove')") - @OperationLog - @Operation(summary = "删除失信被执行人") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditBreachOfTrustService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBreachOfTrust:save')") - @OperationLog - @Operation(summary = "批量添加失信被执行人") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditBreachOfTrustService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBreachOfTrust:update')") - @OperationLog - @Operation(summary = "批量修改失信被执行人") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditBreachOfTrustService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditBreachOfTrust:remove')") - @OperationLog - @Operation(summary = "批量删除失信被执行人") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditBreachOfTrustService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditBreachOfTrust:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditBreachOfTrustService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditBreachOfTrust::getId, - CreditBreachOfTrust::setId, - CreditBreachOfTrust::getPlaintiffAppellant, - CreditBreachOfTrust::getCompanyId, - CreditBreachOfTrust::setCompanyId, - CreditBreachOfTrust::getHasData, - CreditBreachOfTrust::setHasData, - CreditBreachOfTrust::getTenantId, - CreditBreachOfTrust::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入失信被执行人 - */ - @PreAuthorize("hasAuthority('credit:creditBreachOfTrust:save')") - @Operation(summary = "批量导入失信被执行人") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "失信被执行人", 0); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditBreachOfTrustImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCaseNumber = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditBreachOfTrustImportParam param = list.get(i); - try { - CreditBreachOfTrust item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getCaseNumber())) { - String link = urlByCaseNumber.get(item.getCaseNumber().trim()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditBreachOfTrustService, - chunkItems, - CreditBreachOfTrust::getId, - CreditBreachOfTrust::setId, - CreditBreachOfTrust::getCaseNumber, - CreditBreachOfTrust::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditBreachOfTrustService.save(rowItem); - if (!saved) { - CreditBreachOfTrust existing = creditBreachOfTrustService.lambdaQuery() - .eq(CreditBreachOfTrust::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditBreachOfTrustService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditBreachOfTrustService, - chunkItems, - CreditBreachOfTrust::getId, - CreditBreachOfTrust::setId, - CreditBreachOfTrust::getCaseNumber, - CreditBreachOfTrust::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditBreachOfTrustService.save(rowItem); - if (!saved) { - CreditBreachOfTrust existing = creditBreachOfTrustService.lambdaQuery() - .eq(CreditBreachOfTrust::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditBreachOfTrustService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.BREACH_OF_TRUST, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 批量导入历史失信被执行人(仅解析“历史失信被执行人”选项卡) - * 规则:案号相同则覆盖更新(recommend++ 记录更新次数);案号不存在则插入。 - */ - @PreAuthorize("hasAuthority('credit:creditBreachOfTrust:save')") - @Operation(summary = "批量导入历史失信被执行人") - @PostMapping("/import/history") - public ApiResult> importHistoryBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "历史失信被执行人"); - if (sheetIndex < 0) { - return fail("未读取到数据,请确认文件中存在“历史失信被执行人”选项卡且表头与示例格式一致", null); - } - - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditBreachOfTrustImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCaseNumber = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - // 同案号多条:以导入文件中“最后一条”为准(视为最新) - LinkedHashMap latestByCaseNumber = new LinkedHashMap<>(); - LinkedHashMap latestRowByCaseNumber = new LinkedHashMap<>(); - - for (int i = 0; i < list.size(); i++) { - CreditBreachOfTrustImportParam param = list.get(i); - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - try { - CreditBreachOfTrust item = convertImportParamToEntity(param); - if (item.getCaseNumber() != null) { - item.setCaseNumber(item.getCaseNumber().trim()); - } - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - String link = urlByCaseNumber.get(item.getCaseNumber()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - // 历史导入的数据统一标记为“失效” - item.setDataStatus("失效"); - - latestByCaseNumber.put(item.getCaseNumber(), item); - latestRowByCaseNumber.put(item.getCaseNumber(), excelRowNumber); - } catch (Exception e) { - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (latestByCaseNumber.isEmpty()) { - if (errorMessages.isEmpty()) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - return success("导入完成,成功0条,失败" + errorMessages.size() + "条", errorMessages); - } - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (Map.Entry entry : latestByCaseNumber.entrySet()) { - String caseNumber = entry.getKey(); - CreditBreachOfTrust item = entry.getValue(); - Integer rowNo = latestRowByCaseNumber.get(caseNumber); - chunkItems.add(item); - chunkRowNumbers.add(rowNo != null ? rowNo : -1); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditBreachOfTrustService, - chunkItems, - CreditBreachOfTrust::getId, - CreditBreachOfTrust::setId, - CreditBreachOfTrust::getCaseNumber, - CreditBreachOfTrust::getCaseNumber, - CreditBreachOfTrust::getRecommend, - CreditBreachOfTrust::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditBreachOfTrustService.save(rowItem); - if (!saved) { - CreditBreachOfTrust existing = creditBreachOfTrustService.lambdaQuery() - .eq(CreditBreachOfTrust::getCaseNumber, rowItem.getCaseNumber()) - .select(CreditBreachOfTrust::getId, CreditBreachOfTrust::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditBreachOfTrustService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditBreachOfTrustService, - chunkItems, - CreditBreachOfTrust::getId, - CreditBreachOfTrust::setId, - CreditBreachOfTrust::getCaseNumber, - CreditBreachOfTrust::getCaseNumber, - CreditBreachOfTrust::getRecommend, - CreditBreachOfTrust::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditBreachOfTrustService.save(rowItem); - if (!saved) { - CreditBreachOfTrust existing = creditBreachOfTrustService.lambdaQuery() - .eq(CreditBreachOfTrust::getCaseNumber, rowItem.getCaseNumber()) - .select(CreditBreachOfTrust::getId, CreditBreachOfTrust::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditBreachOfTrustService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.BREACH_OF_TRUST, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载失信被执行人导入模板 - */ - @Operation(summary = "下载失信被执行人导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditBreachOfTrustImportParam example = new CreditBreachOfTrustImportParam(); - example.setDataType("失信被执行人"); - example.setCaseNumber("(2024)示例案号"); - example.setPlaintiffAppellant("原告示例"); - example.setAppellee("被告示例"); - example.setOtherPartiesThirdParty("第三人示例"); - example.setInvolvedAmount("20,293.91"); - example.setDataStatus("正常"); - example.setOccurrenceTime("2024-01-01"); - example.setCourtName("示例法院"); - example.setReleaseDate("2024-01-01"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("失信被执行人导入模板", "失信被执行人", CreditBreachOfTrustImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_breach_of_trust_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditBreachOfTrustImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getCaseNumber()) - && ImportHelper.isBlank(param.getPlaintiffAppellant()) - && ImportHelper.isBlank(param.getPlaintiffAppellant2()) - && ImportHelper.isBlank(param.getAppellee()) - && ImportHelper.isBlank(param.getAppellee2()); - } - - private CreditBreachOfTrust convertImportParamToEntity(CreditBreachOfTrustImportParam param) { - CreditBreachOfTrust entity = new CreditBreachOfTrust(); - - entity.setDataType(param.getDataType()); - entity.setCaseNumber(param.getCaseNumber()); - - String plaintiffAppellant = !ImportHelper.isBlank(param.getPlaintiffAppellant2()) - ? param.getPlaintiffAppellant2() - : param.getPlaintiffAppellant(); - entity.setPlaintiffAppellant(plaintiffAppellant); - - String appellee = !ImportHelper.isBlank(param.getAppellee2()) - ? param.getAppellee2() - : param.getAppellee(); - entity.setAppellee(appellee); - - entity.setOtherPartiesThirdParty(param.getOtherPartiesThirdParty()); - entity.setDataStatus(param.getDataStatus()); - - entity.setInvolvedAmount(!ImportHelper.isBlank(param.getInvolvedAmount2()) - ? param.getInvolvedAmount2() - : param.getInvolvedAmount()); - entity.setOccurrenceTime(!ImportHelper.isBlank(param.getOccurrenceTime2()) - ? param.getOccurrenceTime2() - : param.getOccurrenceTime()); - entity.setCourtName(!ImportHelper.isBlank(param.getCourtName2()) - ? param.getCourtName2() - : param.getCourtName()); - entity.setReleaseDate(param.getReleaseDate()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditCaseFilingController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditCaseFilingController.java deleted file mode 100644 index a19fa93..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditCaseFilingController.java +++ /dev/null @@ -1,443 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditCaseFiling; -import com.gxwebsoft.credit.param.CreditCaseFilingImportParam; -import com.gxwebsoft.credit.param.CreditCaseFilingParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditCaseFilingService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 司法大数据控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:47:23 - */ -@Tag(name = "司法大数据管理") -@RestController -@RequestMapping("/api/credit/credit-case-filing") -public class CreditCaseFilingController extends BaseController { - @Resource - private CreditCaseFilingService creditCaseFilingService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询司法大数据") - @GetMapping("/page") - public ApiResult> page(CreditCaseFilingParam param) { - // 使用关联查询 - return success(creditCaseFilingService.pageRel(param)); - } - - @Operation(summary = "查询全部司法大数据") - @GetMapping() - public ApiResult> list(CreditCaseFilingParam param) { - // 使用关联查询 - return success(creditCaseFilingService.listRel(param)); - } - - @Operation(summary = "根据id查询司法大数据") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditCaseFilingService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditCaseFiling:save')") - @OperationLog - @Operation(summary = "添加司法大数据") - @PostMapping() - public ApiResult save(@RequestBody CreditCaseFiling creditCaseFiling) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditCaseFiling.setUserId(loginUser.getUserId()); - // } - if (creditCaseFilingService.save(creditCaseFiling)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCaseFiling:update')") - @OperationLog - @Operation(summary = "修改司法大数据") - @PutMapping() - public ApiResult update(@RequestBody CreditCaseFiling creditCaseFiling) { - if (creditCaseFilingService.updateById(creditCaseFiling)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCaseFiling:remove')") - @OperationLog - @Operation(summary = "删除司法大数据") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditCaseFilingService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCaseFiling:save')") - @OperationLog - @Operation(summary = "批量添加司法大数据") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditCaseFilingService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCaseFiling:update')") - @OperationLog - @Operation(summary = "批量修改司法大数据") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditCaseFilingService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCaseFiling:remove')") - @OperationLog - @Operation(summary = "批量删除司法大数据") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditCaseFilingService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditCaseFiling:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditCaseFilingService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditCaseFiling::getId, - CreditCaseFiling::setId, - CreditCaseFiling::getAppellee, - CreditCaseFiling::getCompanyId, - CreditCaseFiling::setCompanyId, - CreditCaseFiling::getHasData, - CreditCaseFiling::setHasData, - CreditCaseFiling::getTenantId, - CreditCaseFiling::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入立案信息 - */ - @PreAuthorize("hasAuthority('credit:creditCaseFiling:save')") - @Operation(summary = "批量导入立案信息") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "立案信息", 0); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditCaseFilingImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - // easypoi 默认不会读取单元格超链接地址;url 通常挂在“案号”列的超链接中,需要额外读取回填。 - Map urlByCaseNumber = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditCaseFilingImportParam param = list.get(i); - try { - CreditCaseFiling item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getCaseNumber())) { - String link = urlByCaseNumber.get(item.getCaseNumber().trim()); - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditCaseFilingService, - chunkItems, - CreditCaseFiling::getId, - CreditCaseFiling::setId, - CreditCaseFiling::getCaseNumber, - CreditCaseFiling::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditCaseFilingService.save(rowItem); - if (!saved) { - CreditCaseFiling existing = creditCaseFilingService.lambdaQuery() - .eq(CreditCaseFiling::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditCaseFilingService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditCaseFilingService, - chunkItems, - CreditCaseFiling::getId, - CreditCaseFiling::setId, - CreditCaseFiling::getCaseNumber, - CreditCaseFiling::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditCaseFilingService.save(rowItem); - if (!saved) { - CreditCaseFiling existing = creditCaseFilingService.lambdaQuery() - .eq(CreditCaseFiling::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditCaseFilingService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.CASE_FILING, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载立案信息导入模板 - */ - @Operation(summary = "下载立案信息导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditCaseFilingImportParam example = new CreditCaseFilingImportParam(); - example.setDataType("立案信息"); - example.setPlaintiffAppellant("原告示例"); - example.setAppellee("被告示例"); - example.setOtherPartiesThirdParty2("第三人示例"); - example.setInvolvedAmount("100000"); - example.setDataStatus("正常"); - example.setCaseNumber("(2024)示例案号"); - example.setCauseOfAction("案由示例"); - example.setCourtName("示例法院"); - example.setOccurrenceTime("2024-01-01"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("立案信息导入模板", "立案信息", CreditCaseFilingImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_case_filing_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditCaseFilingImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getCaseNumber()) - && ImportHelper.isBlank(param.getPlaintiffAppellant()) - && ImportHelper.isBlank(param.getAppellee()) - && ImportHelper.isBlank(param.getCauseOfAction()) - && ImportHelper.isBlank(param.getOtherPartiesThirdParty()) - && ImportHelper.isBlank(param.getOtherPartiesThirdParty2()) - && ImportHelper.isBlank(param.getCourtName()) - && ImportHelper.isBlank(param.getCourtName2()) - && ImportHelper.isBlank(param.getOccurrenceTime()) - && ImportHelper.isBlank(param.getOccurrenceTime2()) - && ImportHelper.isBlank(param.getInvolvedAmount()) - && ImportHelper.isBlank(param.getInvolvedAmount2()) - && ImportHelper.isBlank(param.getDataStatus()) - && ImportHelper.isBlank(param.getDataType()) - && ImportHelper.isBlank(param.getComments()); - } - - private CreditCaseFiling convertImportParamToEntity(CreditCaseFilingImportParam param) { - CreditCaseFiling entity = new CreditCaseFiling(); - - // Template compatibility: prefer new columns when present. - String occurrenceTime = !ImportHelper.isBlank(param.getOccurrenceTime2()) - ? param.getOccurrenceTime2() - : param.getOccurrenceTime(); - String otherPartiesThirdParty = !ImportHelper.isBlank(param.getOtherPartiesThirdParty2()) - ? param.getOtherPartiesThirdParty2() - : param.getOtherPartiesThirdParty(); - String courtName = !ImportHelper.isBlank(param.getCourtName2()) - ? param.getCourtName2() - : param.getCourtName(); - String involvedAmount = !ImportHelper.isBlank(param.getInvolvedAmount2()) - ? param.getInvolvedAmount2() - : param.getInvolvedAmount(); - - entity.setDataType(param.getDataType()); - entity.setPlaintiffAppellant(param.getPlaintiffAppellant()); - entity.setAppellee(param.getAppellee()); - entity.setDataStatus(param.getDataStatus()); - - entity.setCaseNumber(param.getCaseNumber()); - entity.setCauseOfAction(param.getCauseOfAction()); - entity.setOtherPartiesThirdParty(otherPartiesThirdParty); - entity.setCourtName(courtName); - entity.setOccurrenceTime(occurrenceTime); - entity.setInvolvedAmount(involvedAmount); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditCompanyController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditCompanyController.java deleted file mode 100644 index 828fa0e..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditCompanyController.java +++ /dev/null @@ -1,548 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.ExcelImportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.ImportParams; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditCompany; -import com.gxwebsoft.credit.param.CreditCompanyImportParam; -import com.gxwebsoft.credit.param.CreditCompanyParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 企业控制器 - * - * @author 科技小王子 - * @since 2025-12-17 08:28:03 - */ -@Tag(name = "企业管理") -@RestController -@RequestMapping("/api/credit/credit-company") -public class CreditCompanyController extends BaseController { - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询企业") - @GetMapping("/page") - public ApiResult> page(CreditCompanyParam param) { - // 使用关联查询 - return success(creditCompanyService.pageRel(param)); - } - - @Operation(summary = "查询全部企业") - @GetMapping() - public ApiResult> list(CreditCompanyParam param) { - // 使用关联查询 - return success(creditCompanyService.listRel(param)); - } - - @Operation(summary = "根据id查询企业") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditCompanyService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditCompany:save')") - @OperationLog - @Operation(summary = "添加企业") - @PostMapping() - public ApiResult save(@RequestBody CreditCompany creditCompany) { - if (creditCompanyService.save(creditCompany)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCompany:update')") - @OperationLog - @Operation(summary = "修改企业") - @PutMapping() - public ApiResult update(@RequestBody CreditCompany creditCompany) { - if (creditCompanyService.updateById(creditCompany)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCompany:remove')") - @OperationLog - @Operation(summary = "删除企业") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditCompanyService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCompany:save')") - @OperationLog - @Operation(summary = "批量添加企业") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditCompanyService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCompany:update')") - @OperationLog - @Operation(summary = "批量修改企业") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditCompanyService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCompany:remove')") - @OperationLog - @Operation(summary = "批量删除企业") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditCompanyService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 批量导入企业 - */ - @PreAuthorize("hasAuthority('credit:creditJudiciary:save')") - @Operation(summary = "批量导入企业") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int insertedCount = 0; - Set touchedMatchNames = new HashSet<>(); - - try { - List list = null; - int usedTitleRows = 0; - int usedHeadRows = 0; - int[][] tryConfigs = new int[][]{{1, 1}, {0, 1}, {0, 2}, {0, 3}}; - - for (int[] config : tryConfigs) { - list = filterEmptyRows(tryImport(file, config[0], config[1])); - if (!CollectionUtils.isEmpty(list)) { - usedTitleRows = config[0]; - usedHeadRows = config[1]; - break; - } - } - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByName = ExcelImportSupport.readHyperlinksByHeaderKey(file, 0, usedTitleRows, usedHeadRows, "原文件导入名称"); - Map urlByMatchName = ExcelImportSupport.readHyperlinksByHeaderKey(file, 0, usedTitleRows, usedHeadRows, "系统匹配企业名称"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditCompanyImportParam param = list.get(i); - try { - CreditCompany item = convertImportParamToEntity(param); - String link = null; - if (item.getName() != null) { - link = urlByName.get(item.getName().trim()); - } - if ((link == null || link.isEmpty()) && item.getMatchName() != null) { - link = urlByMatchName.get(item.getMatchName().trim()); - } - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - - // 设置默认值 - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - // 验证必填字段 - if (item.getMatchName() == null || item.getMatchName().trim().isEmpty()) { - errorMessages.add("第" + excelRowNumber + "行:项目名称不能为空"); - continue; - } -// if (item.getCode() == null || item.getCode().trim().isEmpty()) { -// errorMessages.add("第" + excelRowNumber + "行:唯一标识不能为空"); -// continue; -// } - - touchedMatchNames.add(item.getMatchName().trim()); - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - insertedCount += batchImportSupport.persistChunkWithFallbackCount( - chunkItems, - chunkRowNumbers, - () -> { - int delta = countInsertedByMatchName(chunkItems); - batchImportSupport.upsertBySingleKey( - creditCompanyService, - chunkItems, - CreditCompany::getId, - CreditCompany::setId, - CreditCompany::getMatchName, - CreditCompany::getMatchName, - null, - mpBatchSize - ); - return delta; - }, - (rowItem, rowNumber) -> { - boolean saved = creditCompanyService.save(rowItem); - if (saved) { - return 1; // insert 入库 - } - CreditCompany existing = creditCompanyService.getByMatchName(rowItem.getMatchName()); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditCompanyService.updateById(rowItem)) { - return 0; // update 不计入“入库”条数 - } - } - throw new RuntimeException("保存失败"); - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - insertedCount += batchImportSupport.persistChunkWithFallbackCount( - chunkItems, - chunkRowNumbers, - () -> { - int delta = countInsertedByMatchName(chunkItems); - batchImportSupport.upsertBySingleKey( - creditCompanyService, - chunkItems, - CreditCompany::getId, - CreditCompany::setId, - CreditCompany::getMatchName, - CreditCompany::getMatchName, - null, - mpBatchSize - ); - return delta; - }, - (rowItem, rowNumber) -> { - boolean saved = creditCompanyService.save(rowItem); - if (saved) { - return 1; // insert 入库 - } - CreditCompany existing = creditCompanyService.getByMatchName(rowItem.getMatchName()); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditCompanyService.updateById(rowItem)) { - return 0; // update 不计入“入库”条数 - } - } - throw new RuntimeException("保存失败"); - }, - errorMessages - ); - } - - // 导入完成后,按 matchName 定位本次涉及的企业并回填“关联记录数”字段(避免 companyId/自增 id 在导入对象里拿不到)。 - if (!touchedMatchNames.isEmpty()) { - Set touchedCompanyIds = new HashSet<>(); - List allMatchNames = new ArrayList<>(touchedMatchNames); - final int inChunkSize = 800; - for (int i = 0; i < allMatchNames.size(); i += inChunkSize) { - List chunk = allMatchNames.subList(i, Math.min(allMatchNames.size(), i + inChunkSize)); - List dbRows = creditCompanyService.lambdaQuery() - .select(CreditCompany::getId) - .in(CreditCompany::getMatchName, chunk) - .list(); - if (!CollectionUtils.isEmpty(dbRows)) { - for (CreditCompany row : dbRows) { - if (row != null && row.getId() != null) { - touchedCompanyIds.add(row.getId()); - } - } - } - } - creditCompanyRecordCountService.refreshAll(touchedCompanyIds); - } - - if (errorMessages.isEmpty()) { - return success("成功入库" + insertedCount + "条数据", null); - } else { - return success("导入完成,入库" + insertedCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载企业导入模板 - */ - @Operation(summary = "下载企业导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditCompanyImportParam example = new CreditCompanyImportParam(); - example.setName("示例客户"); - example.setCode("C0001"); - example.setMatchName("匹配名称"); - example.setRegistrationStatus("登记状态"); - example.setLegalPerson("法定代表人"); - example.setRegisteredCapital("注册资本"); - example.setPaidinCapital("实缴资本"); - example.setEstablishDate("成立日期"); - example.setAddress("地址"); - example.setTel("电话"); - example.setMoreTel("更多电话"); - example.setEmail("邮箱"); - example.setMoreEmail("更多邮箱"); - example.setProvince("省"); - example.setCity("市"); - example.setRegion("区"); - example.setInstitutionType("机构类型"); - example.setTaxpayerCode("纳税人识别号"); - example.setRegistrationNumber("注册号"); - example.setOrganizationalCode("组织机构代码"); - example.setNumberOfInsuredPersons("参保人数"); - example.setAnnualReport("入库时间"); - example.setBusinessTerm("营业期限"); - example.setNationalStandardIndustryCategories("国标行业门类"); - example.setNationalStandardIndustryCategories2("国标行业大类"); - example.setNationalStandardIndustryCategories3("国标行业中类"); - example.setNationalStandardIndustryCategories4("国标行业小类"); - example.setNationalStandardIndustryCategories5("企查查行业门类"); - example.setNationalStandardIndustryCategories6("企查查行业大类"); - example.setNationalStandardIndustryCategories7("企查查行业中类"); - example.setNationalStandardIndustryCategories8("企查查行业小类"); - example.setCompanySize("企业规模"); - example.setFormerName("曾用名"); - example.setEnglishName("英文名"); - example.setDomain("官网"); - example.setMailingAddress("通信地址"); - example.setCompanyProfile("企业简介"); - example.setNatureOfBusiness("经营范围"); - example.setRegistrationAuthority("登记机关"); - example.setTaxpayerQualification("纳税人资质"); - example.setLatestAnnualReportYear("最新年报年份"); - example.setLatestAnnualReportOnOperatingRevenue("最新年报营业额"); - example.setEnterpriseScoreCheck("企查分"); - example.setCreditRating("信用等级"); - example.setCechnologyScore("科创分"); - example.setCechnologyLevel("科创等级"); - example.setSmallEnterprise("是否小微企业"); - templateList.add(example); - - ExportParams exportParams = new ExportParams("一级企业主表导入模板", "企业"); - - Workbook workbook = ExcelExportUtil.exportExcel(exportParams, CreditCompanyImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_company_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private List tryImport(MultipartFile file, int titleRows, int headRows) throws Exception { - ImportParams importParams = new ImportParams(); - importParams.setTitleRows(titleRows); - importParams.setHeadRows(headRows); - importParams.setStartSheetIndex(0); - importParams.setSheetNum(1); - return ExcelImportUtil.importExcel(file.getInputStream(), CreditCompanyImportParam.class, importParams); - } - - /** - * 过滤掉完全空白的导入行,避免空行导致导入失败 - */ - private List filterEmptyRows(List rawList) { - if (CollectionUtils.isEmpty(rawList)) { - return rawList; - } - rawList.removeIf(this::isEmptyImportRow); - return rawList; - } - - private boolean isEmptyImportRow(CreditCompanyImportParam param) { - if (param == null) { - return true; - } - return isBlank(param.getName()) - && isBlank(param.getCode()); - } - - private boolean isBlank(String value) { - return value == null || value.trim().isEmpty(); - } - - /** - * 入库条数以 insert 为准:matchName 在数据库中不存在时计 1,否则计 0。 - * - *

统计口径需与批量 upsert 的匹配字段保持一致(matchName)。

- */ - private int countInsertedByMatchName(List items) { - if (CollectionUtils.isEmpty(items)) { - return 0; - } - List matchNames = new ArrayList<>(items.size()); - for (CreditCompany item : items) { - if (item == null) { - continue; - } - String key = item.getMatchName(); - if (!isBlank(key)) { - matchNames.add(key.trim()); - } - } - if (matchNames.isEmpty()) { - return 0; - } - - Set existing = new HashSet<>(); - List dbRows = creditCompanyService.lambdaQuery() - .select(CreditCompany::getMatchName) - .in(CreditCompany::getMatchName, matchNames) - .list(); - if (!CollectionUtils.isEmpty(dbRows)) { - for (CreditCompany row : dbRows) { - String v = row != null ? row.getMatchName() : null; - if (!isBlank(v)) { - existing.add(v.trim()); - } - } - } - - int count = 0; - for (CreditCompany item : items) { - String key = item != null ? item.getMatchName() : null; - if (!isBlank(key) && !existing.contains(key.trim())) { - count++; - } - } - return count; - } - - /** - * 将CreditCompanyImportParam转换为CreditCompany实体 - */ - private CreditCompany convertImportParamToEntity(CreditCompanyImportParam param) { - CreditCompany entity = new CreditCompany(); - - entity.setCode(param.getCode()); - entity.setName(param.getName()); - entity.setMatchName(param.getMatchName()); - entity.setRegistrationStatus(param.getRegistrationStatus()); - entity.setLegalPerson(param.getLegalPerson()); - entity.setRegisteredCapital(param.getRegisteredCapital()); - entity.setPaidinCapital(param.getPaidinCapital()); - entity.setEstablishDate(param.getEstablishDate()); - entity.setAddress(param.getAddress()); - entity.setTel(param.getTel()); - entity.setMoreTel(param.getMoreTel()); - entity.setEmail(param.getEmail()); - entity.setMoreEmail(param.getMoreEmail()); - entity.setProvince(param.getProvince()); - entity.setCity(param.getCity()); - entity.setRegion(param.getRegion()); - entity.setInstitutionType(param.getInstitutionType()); - entity.setTaxpayerCode(param.getTaxpayerCode()); - entity.setRegistrationNumber(param.getRegistrationNumber()); - entity.setOrganizationalCode(param.getOrganizationalCode()); - entity.setNumberOfInsuredPersons(param.getNumberOfInsuredPersons()); - entity.setAnnualReport(param.getAnnualReport()); - entity.setBusinessTerm(param.getBusinessTerm()); - entity.setNationalStandardIndustryCategories(param.getNationalStandardIndustryCategories()); - entity.setNationalStandardIndustryCategories2(param.getNationalStandardIndustryCategories2()); - entity.setNationalStandardIndustryCategories3(param.getNationalStandardIndustryCategories3()); - entity.setNationalStandardIndustryCategories4(param.getNationalStandardIndustryCategories4()); - entity.setNationalStandardIndustryCategories5(param.getNationalStandardIndustryCategories5()); - entity.setNationalStandardIndustryCategories6(param.getNationalStandardIndustryCategories6()); - entity.setNationalStandardIndustryCategories7(param.getNationalStandardIndustryCategories7()); - entity.setNationalStandardIndustryCategories8(param.getNationalStandardIndustryCategories8()); - entity.setCompanySize(param.getCompanySize()); - entity.setFormerName(param.getFormerName()); - entity.setEnglishName(param.getEnglishName()); - entity.setDomain(param.getDomain()); - entity.setMailingAddress(param.getMailingAddress()); - entity.setCompanyProfile(param.getCompanyProfile()); - entity.setNatureOfBusiness(param.getNatureOfBusiness()); - entity.setRegistrationAuthority(param.getRegistrationAuthority()); - entity.setTaxpayerQualification(param.getTaxpayerQualification()); - entity.setLatestAnnualReportYear(param.getLatestAnnualReportYear()); - entity.setLatestAnnualReportOnOperatingRevenue(param.getLatestAnnualReportOnOperatingRevenue()); - entity.setEnterpriseScoreCheck(param.getEnterpriseScoreCheck()); - entity.setCreditRating(param.getCreditRating()); - entity.setCechnologyScore(param.getCechnologyScore()); - entity.setCechnologyLevel(param.getCechnologyLevel()); - entity.setSmallEnterprise(param.getSmallEnterprise()); - - return entity; - } - - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditCompetitorController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditCompetitorController.java deleted file mode 100644 index 9540c30..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditCompetitorController.java +++ /dev/null @@ -1,412 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditCompetitor; -import com.gxwebsoft.credit.param.CreditCompetitorImportParam; -import com.gxwebsoft.credit.param.CreditCompetitorParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditCompetitorService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 竞争对手控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:05 - */ -@Tag(name = "竞争对手管理") -@RestController -@RequestMapping("/api/credit/credit-competitor") -public class CreditCompetitorController extends BaseController { - @Resource - private CreditCompetitorService creditCompetitorService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询竞争对手") - @GetMapping("/page") - public ApiResult> page(CreditCompetitorParam param) { - // 使用关联查询 - return success(creditCompetitorService.pageRel(param)); - } - - @Operation(summary = "查询全部竞争对手") - @GetMapping() - public ApiResult> list(CreditCompetitorParam param) { - // 使用关联查询 - return success(creditCompetitorService.listRel(param)); - } - - @Operation(summary = "根据id查询竞争对手") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditCompetitorService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditCompetitor:save')") - @OperationLog - @Operation(summary = "添加竞争对手") - @PostMapping() - public ApiResult save(@RequestBody CreditCompetitor creditCompetitor) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditCompetitor.setUserId(loginUser.getUserId()); - // } - if (creditCompetitorService.save(creditCompetitor)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCompetitor:update')") - @OperationLog - @Operation(summary = "修改竞争对手") - @PutMapping() - public ApiResult update(@RequestBody CreditCompetitor creditCompetitor) { - if (creditCompetitorService.updateById(creditCompetitor)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCompetitor:remove')") - @OperationLog - @Operation(summary = "删除竞争对手") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditCompetitorService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCompetitor:save')") - @OperationLog - @Operation(summary = "批量添加竞争对手") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditCompetitorService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCompetitor:update')") - @OperationLog - @Operation(summary = "批量修改竞争对手") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditCompetitorService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCompetitor:remove')") - @OperationLog - @Operation(summary = "批量删除竞争对手") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditCompetitorService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditCompetitor:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditCompetitorService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditCompetitor::getId, - CreditCompetitor::setId, - CreditCompetitor::getName, - CreditCompetitor::getCompanyId, - CreditCompetitor::setCompanyId, - CreditCompetitor::getHasData, - CreditCompetitor::setHasData, - CreditCompetitor::getTenantId, - CreditCompetitor::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入竞争对手 - */ - @PreAuthorize("hasAuthority('credit:creditCompetitor:save')") - @Operation(summary = "批量导入竞争对手") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "竞争对手", 2); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditCompetitorImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByName = ExcelImportSupport.readUrlByKey( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "企业名称"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditCompetitorImportParam param = list.get(i); - try { - CreditCompetitor item = convertImportParamToEntity(param); - // name 才是持久化字段;companyName 为关联查询的临时字段(exist=false),导入时不应使用。 - if (!ImportHelper.isBlank(item.getName())) { - String link = urlByName.get(item.getName().trim()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getName())) { - errorMessages.add("第" + excelRowNumber + "行:企业名称不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditCompetitorService, - chunkItems, - CreditCompetitor::getId, - CreditCompetitor::setId, - CreditCompetitor::getName, - CreditCompetitor::getName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditCompetitorService.save(rowItem); - if (!saved) { - CreditCompetitor existing = creditCompetitorService.lambdaQuery() - .eq(CreditCompetitor::getName, rowItem.getName()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditCompetitorService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditCompetitorService, - chunkItems, - CreditCompetitor::getId, - CreditCompetitor::setId, - CreditCompetitor::getName, - CreditCompetitor::getName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditCompetitorService.save(rowItem); - if (!saved) { - CreditCompetitor existing = creditCompetitorService.lambdaQuery() - .eq(CreditCompetitor::getName, rowItem.getName()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditCompetitorService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.COMPETITOR, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载竞争对手导入模板 - */ - @Operation(summary = "下载竞争对手导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditCompetitorImportParam example = new CreditCompetitorImportParam(); - example.setName("示例科技有限公司"); - example.setLegalRepresentative("张三"); - example.setRegisteredCapital("5000"); - example.setEstablishmentDate("2015-01-01"); - example.setRegistrationStatus("存续"); - example.setIndustry("软件和信息服务业"); - example.setProvince("广东省"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("竞争对手导入模板", "竞争对手", CreditCompetitorImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_competitor_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditCompetitorImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getName()) - && ImportHelper.isBlank(param.getLegalRepresentative()) - && ImportHelper.isBlank(param.getRegisteredCapital()) - && ImportHelper.isBlank(param.getEstablishmentDate()); - } - - private CreditCompetitor convertImportParamToEntity(CreditCompetitorImportParam param) { - CreditCompetitor entity = new CreditCompetitor(); - - entity.setName(param.getName()); - entity.setLegalRepresentative(param.getLegalRepresentative()); - entity.setRegisteredCapital(param.getRegisteredCapital()); - entity.setEstablishmentDate(param.getEstablishmentDate()); - entity.setRegistrationStatus(param.getRegistrationStatus()); - entity.setIndustry(param.getIndustry()); - entity.setProvince(param.getProvince()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditCourtAnnouncementController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditCourtAnnouncementController.java deleted file mode 100644 index ef66aa6..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditCourtAnnouncementController.java +++ /dev/null @@ -1,432 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditCourtAnnouncement; -import com.gxwebsoft.credit.param.CreditCourtAnnouncementImportParam; -import com.gxwebsoft.credit.param.CreditCourtAnnouncementParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditCourtAnnouncementService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 法院公告司法大数据控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:13 - */ -@Tag(name = "法院公告司法大数据管理") -@RestController -@RequestMapping("/api/credit/credit-court-announcement") -public class CreditCourtAnnouncementController extends BaseController { - @Resource - private CreditCourtAnnouncementService creditCourtAnnouncementService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询法院公告司法大数据") - @GetMapping("/page") - public ApiResult> page(CreditCourtAnnouncementParam param) { - // 使用关联查询 - return success(creditCourtAnnouncementService.pageRel(param)); - } - - @Operation(summary = "查询全部法院公告司法大数据") - @GetMapping() - public ApiResult> list(CreditCourtAnnouncementParam param) { - // 使用关联查询 - return success(creditCourtAnnouncementService.listRel(param)); - } - - @Operation(summary = "根据id查询法院公告司法大数据") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditCourtAnnouncementService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:save')") - @OperationLog - @Operation(summary = "添加法院公告司法大数据") - @PostMapping() - public ApiResult save(@RequestBody CreditCourtAnnouncement creditCourtAnnouncement) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditCourtAnnouncement.setUserId(loginUser.getUserId()); - // } - if (creditCourtAnnouncementService.save(creditCourtAnnouncement)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:update')") - @OperationLog - @Operation(summary = "修改法院公告司法大数据") - @PutMapping() - public ApiResult update(@RequestBody CreditCourtAnnouncement creditCourtAnnouncement) { - if (creditCourtAnnouncementService.updateById(creditCourtAnnouncement)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:remove')") - @OperationLog - @Operation(summary = "删除法院公告司法大数据") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditCourtAnnouncementService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:save')") - @OperationLog - @Operation(summary = "批量添加法院公告司法大数据") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditCourtAnnouncementService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:update')") - @OperationLog - @Operation(summary = "批量修改法院公告司法大数据") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditCourtAnnouncementService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:remove')") - @OperationLog - @Operation(summary = "批量删除法院公告司法大数据") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditCourtAnnouncementService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditCourtAnnouncementService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditCourtAnnouncement::getId, - CreditCourtAnnouncement::setId, - CreditCourtAnnouncement::getAppellee, - CreditCourtAnnouncement::getCompanyId, - CreditCourtAnnouncement::setCompanyId, - CreditCourtAnnouncement::getHasData, - CreditCourtAnnouncement::setHasData, - CreditCourtAnnouncement::getTenantId, - CreditCourtAnnouncement::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入法院公告司法大数据 - */ - @PreAuthorize("hasAuthority('credit:creditCourtAnnouncement:save')") - @Operation(summary = "批量导入法院公告司法大数据") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - // 兼容多 sheet 文件:优先定位“法院公告”sheet,否则默认第 0 个。 - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "法院公告", 0); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditCourtAnnouncementImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCaseNumber = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditCourtAnnouncementImportParam param = list.get(i); - try { - CreditCourtAnnouncement item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getCaseNumber())) { - String link = urlByCaseNumber.get(item.getCaseNumber().trim()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditCourtAnnouncementService, - chunkItems, - CreditCourtAnnouncement::getId, - CreditCourtAnnouncement::setId, - CreditCourtAnnouncement::getCaseNumber, - CreditCourtAnnouncement::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditCourtAnnouncementService.save(rowItem); - if (!saved) { - CreditCourtAnnouncement existing = creditCourtAnnouncementService.lambdaQuery() - .eq(CreditCourtAnnouncement::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditCourtAnnouncementService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditCourtAnnouncementService, - chunkItems, - CreditCourtAnnouncement::getId, - CreditCourtAnnouncement::setId, - CreditCourtAnnouncement::getCaseNumber, - CreditCourtAnnouncement::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditCourtAnnouncementService.save(rowItem); - if (!saved) { - CreditCourtAnnouncement existing = creditCourtAnnouncementService.lambdaQuery() - .eq(CreditCourtAnnouncement::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditCourtAnnouncementService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.COURT_ANNOUNCEMENT, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载法院公告司法大数据导入模板 - */ - @Operation(summary = "下载法院公告司法大数据导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditCourtAnnouncementImportParam example = new CreditCourtAnnouncementImportParam(); - example.setDataType("法院公告"); - example.setPlaintiffAppellant("原告示例"); - example.setAppellee("被告示例"); - example.setOtherPartiesThirdParty("第三人示例"); - example.setOccurrenceTime("2024-01-01"); - example.setCaseNumber("(2024)示例案号"); - example.setCauseOfAction("案由示例"); - example.setCourtName("示例法院"); - example.setInvolvedAmount("100000"); - example.setDataStatus("正常"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("法院公告导入模板", "法院公告", CreditCourtAnnouncementImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_court_announcement_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditCourtAnnouncementImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getCaseNumber()) - && ImportHelper.isBlank(param.getCauseOfAction()); - } - - private CreditCourtAnnouncement convertImportParamToEntity(CreditCourtAnnouncementImportParam param) { - CreditCourtAnnouncement entity = new CreditCourtAnnouncement(); - - String dataType = !ImportHelper.isBlank(param.getDataType2()) - ? param.getDataType2() - : param.getDataType(); - String plaintiffAppellant = !ImportHelper.isBlank(param.getPlaintiffAppellant2()) - ? param.getPlaintiffAppellant2() - : param.getPlaintiffAppellant(); - String otherPartiesThirdParty = !ImportHelper.isBlank(param.getOtherPartiesThirdParty2()) - ? param.getOtherPartiesThirdParty2() - : param.getOtherPartiesThirdParty(); - String involvedAmount = !ImportHelper.isBlank(param.getInvolvedAmount2()) - ? param.getInvolvedAmount2() - : param.getInvolvedAmount(); - - String occurrenceTime = !ImportHelper.isBlank(param.getOccurrenceTime2()) - ? param.getOccurrenceTime2() - : param.getOccurrenceTime(); - - entity.setDataType(dataType); - entity.setPlaintiffAppellant(plaintiffAppellant); - entity.setAppellee(param.getAppellee()); - entity.setOtherPartiesThirdParty(otherPartiesThirdParty); - entity.setOccurrenceTime(occurrenceTime); - entity.setCaseNumber(param.getCaseNumber()); - entity.setCauseOfAction(param.getCauseOfAction()); - entity.setCourtName(param.getCourtName()); - entity.setInvolvedAmount(involvedAmount); - entity.setDataStatus(param.getDataStatus()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditCourtSessionController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditCourtSessionController.java deleted file mode 100644 index 481e530..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditCourtSessionController.java +++ /dev/null @@ -1,636 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditCourtSession; -import com.gxwebsoft.credit.param.CreditCourtSessionImportParam; -import com.gxwebsoft.credit.param.CreditCourtSessionParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditCourtSessionService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 开庭公告司法大数据控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:33 - */ -@Tag(name = "开庭公告司法大数据管理") -@RestController -@RequestMapping("/api/credit/credit-court-session") -public class CreditCourtSessionController extends BaseController { - @Resource - private CreditCourtSessionService creditCourtSessionService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询开庭公告司法大数据") - @GetMapping("/page") - public ApiResult> page(CreditCourtSessionParam param) { - // 使用关联查询 - return success(creditCourtSessionService.pageRel(param)); - } - - @Operation(summary = "查询全部开庭公告司法大数据") - @GetMapping() - public ApiResult> list(CreditCourtSessionParam param) { - // 使用关联查询 - return success(creditCourtSessionService.listRel(param)); - } - - @Operation(summary = "根据id查询开庭公告司法大数据") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditCourtSessionService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditCourtSession:save')") - @OperationLog - @Operation(summary = "添加开庭公告司法大数据") - @PostMapping() - public ApiResult save(@RequestBody CreditCourtSession creditCourtSession) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditCourtSession.setUserId(loginUser.getUserId()); - // } - if (creditCourtSessionService.save(creditCourtSession)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCourtSession:update')") - @OperationLog - @Operation(summary = "修改开庭公告司法大数据") - @PutMapping() - public ApiResult update(@RequestBody CreditCourtSession creditCourtSession) { - if (creditCourtSessionService.updateById(creditCourtSession)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCourtSession:remove')") - @OperationLog - @Operation(summary = "删除开庭公告司法大数据") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditCourtSessionService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCourtSession:save')") - @OperationLog - @Operation(summary = "批量添加开庭公告司法大数据") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditCourtSessionService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCourtSession:update')") - @OperationLog - @Operation(summary = "批量修改开庭公告司法大数据") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditCourtSessionService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCourtSession:remove')") - @OperationLog - @Operation(summary = "批量删除开庭公告司法大数据") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditCourtSessionService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditCourtSession:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditCourtSessionService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditCourtSession::getId, - CreditCourtSession::setId, - CreditCourtSession::getAppellee, - CreditCourtSession::getCompanyId, - CreditCourtSession::setCompanyId, - CreditCourtSession::getHasData, - CreditCourtSession::setHasData, - CreditCourtSession::getTenantId, - CreditCourtSession::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入开庭公告司法大数据 - */ - @PreAuthorize("hasAuthority('credit:creditCourtSession:save')") - @Operation(summary = "批量导入开庭公告司法大数据") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - // 兼容多 sheet 文件:优先定位“开庭公告”sheet,否则默认第 0 个。 - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "开庭公告", 0); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditCourtSessionImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCaseNumber = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditCourtSessionImportParam param = list.get(i); - try { - CreditCourtSession item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getCaseNumber())) { - String link = urlByCaseNumber.get(item.getCaseNumber().trim()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditCourtSessionService, - chunkItems, - CreditCourtSession::getId, - CreditCourtSession::setId, - CreditCourtSession::getCaseNumber, - CreditCourtSession::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditCourtSessionService.save(rowItem); - if (!saved) { - CreditCourtSession existing = creditCourtSessionService.lambdaQuery() - .eq(CreditCourtSession::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditCourtSessionService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditCourtSessionService, - chunkItems, - CreditCourtSession::getId, - CreditCourtSession::setId, - CreditCourtSession::getCaseNumber, - CreditCourtSession::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditCourtSessionService.save(rowItem); - if (!saved) { - CreditCourtSession existing = creditCourtSessionService.lambdaQuery() - .eq(CreditCourtSession::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditCourtSessionService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.COURT_SESSION, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 批量导入历史开庭公告(仅解析“历史开庭公告”选项卡) - * 规则:案号相同则覆盖更新(recommend++ 记录更新次数);案号不存在则插入。 - */ - @PreAuthorize("hasAuthority('credit:creditCourtSession:save')") - @Operation(summary = "批量导入历史开庭公告司法大数据") - @PostMapping("/import/history") - public ApiResult> importHistoryBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "历史开庭公告"); - if (sheetIndex < 0) { - return fail("未读取到数据,请确认文件中存在“历史开庭公告”选项卡且表头与示例格式一致", null); - } - - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditCourtSessionImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCaseNumber = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - LinkedHashMap latestByCaseNumber = new LinkedHashMap<>(); - LinkedHashMap latestRowByCaseNumber = new LinkedHashMap<>(); - - for (int i = 0; i < list.size(); i++) { - CreditCourtSessionImportParam param = list.get(i); - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - try { - CreditCourtSession item = convertImportParamToEntity(param); - if (item.getCaseNumber() != null) { - item.setCaseNumber(item.getCaseNumber().trim()); - } - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - String link = urlByCaseNumber.get(item.getCaseNumber()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - // 历史导入的数据统一标记为“失效” - item.setDataStatus("失效"); - - latestByCaseNumber.put(item.getCaseNumber(), item); - latestRowByCaseNumber.put(item.getCaseNumber(), excelRowNumber); - } catch (Exception e) { - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (latestByCaseNumber.isEmpty()) { - if (errorMessages.isEmpty()) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - return success("导入完成,成功0条,失败" + errorMessages.size() + "条", errorMessages); - } - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (Map.Entry entry : latestByCaseNumber.entrySet()) { - String caseNumber = entry.getKey(); - CreditCourtSession item = entry.getValue(); - Integer rowNo = latestRowByCaseNumber.get(caseNumber); - chunkItems.add(item); - chunkRowNumbers.add(rowNo != null ? rowNo : -1); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditCourtSessionService, - chunkItems, - CreditCourtSession::getId, - CreditCourtSession::setId, - CreditCourtSession::getCaseNumber, - CreditCourtSession::getCaseNumber, - CreditCourtSession::getRecommend, - CreditCourtSession::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditCourtSessionService.save(rowItem); - if (!saved) { - CreditCourtSession existing = creditCourtSessionService.lambdaQuery() - .eq(CreditCourtSession::getCaseNumber, rowItem.getCaseNumber()) - .select(CreditCourtSession::getId, CreditCourtSession::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditCourtSessionService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditCourtSessionService, - chunkItems, - CreditCourtSession::getId, - CreditCourtSession::setId, - CreditCourtSession::getCaseNumber, - CreditCourtSession::getCaseNumber, - CreditCourtSession::getRecommend, - CreditCourtSession::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditCourtSessionService.save(rowItem); - if (!saved) { - CreditCourtSession existing = creditCourtSessionService.lambdaQuery() - .eq(CreditCourtSession::getCaseNumber, rowItem.getCaseNumber()) - .select(CreditCourtSession::getId, CreditCourtSession::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditCourtSessionService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.COURT_SESSION, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载开庭公告司法大数据导入模板 - */ - @Operation(summary = "下载开庭公告司法大数据导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditCourtSessionImportParam example = new CreditCourtSessionImportParam(); - example.setDataType("开庭公告"); - example.setPlaintiffAppellant("原告示例"); - example.setAppellee("被告示例"); - example.setOtherPartiesThirdParty2("第三人示例"); - example.setCaseNumber("(2024)示例案号"); - example.setCauseOfAction("案由示例"); - example.setCourtName("示例法院"); - example.setOccurrenceTime("2024-01-01"); - example.setInvolvedAmount("100000"); - example.setDataStatus("正常"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("开庭公告导入模板", "开庭公告", CreditCourtSessionImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_court_session_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditCourtSessionImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getCaseNumber()) - && ImportHelper.isBlank(param.getCauseOfAction()); - } - - private CreditCourtSession convertImportParamToEntity(CreditCourtSessionImportParam param) { - CreditCourtSession entity = new CreditCourtSession(); - - // Template compatibility: prefer new columns ("发生时间"/"其他当事人/第三人") when present. - String occurrenceTime = !ImportHelper.isBlank(param.getOccurrenceTime2()) - ? param.getOccurrenceTime2() - : param.getOccurrenceTime(); - String otherPartiesThirdParty = !ImportHelper.isBlank(param.getOtherPartiesThirdParty2()) - ? param.getOtherPartiesThirdParty2() - : param.getOtherPartiesThirdParty(); - String involvedAmount = !ImportHelper.isBlank(param.getInvolvedAmount2()) - ? param.getInvolvedAmount2() - : param.getInvolvedAmount(); - - entity.setDataType(param.getDataType()); - entity.setPlaintiffAppellant(param.getPlaintiffAppellant()); - entity.setAppellee(param.getAppellee()); - entity.setDataStatus(param.getDataStatus()); - entity.setInvolvedAmount(involvedAmount); - - entity.setOtherPartiesThirdParty(otherPartiesThirdParty); - entity.setOccurrenceTime(occurrenceTime); - entity.setCaseNumber(param.getCaseNumber()); - entity.setCauseOfAction(param.getCauseOfAction()); - entity.setCourtName(param.getCourtName()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditCustomerController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditCustomerController.java deleted file mode 100644 index 5c2e4cc..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditCustomerController.java +++ /dev/null @@ -1,572 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditCustomer; -import com.gxwebsoft.credit.param.CreditCustomerImportParam; -import com.gxwebsoft.credit.param.CreditCustomerParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditCustomerService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 客户控制器 - * - * @author 科技小王子 - * @since 2025-12-21 21:20:58 - */ -@Tag(name = "客户管理") -@RestController -@RequestMapping("/api/credit/credit-customer") -public class CreditCustomerController extends BaseController { - @Resource - private CreditCustomerService creditCustomerService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询客户") - @GetMapping("/page") - public ApiResult> page(CreditCustomerParam param) { - // 使用关联查询 - return success(creditCustomerService.pageRel(param)); - } - - @Operation(summary = "查询全部客户") - @GetMapping() - public ApiResult> list(CreditCustomerParam param) { - // 使用关联查询 - return success(creditCustomerService.listRel(param)); - } - - @Operation(summary = "根据id查询客户") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditCustomerService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditCustomer:save')") - @OperationLog - @Operation(summary = "添加客户") - @PostMapping() - public ApiResult save(@RequestBody CreditCustomer creditCustomer) { - if (creditCustomerService.save(creditCustomer)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCustomer:update')") - @OperationLog - @Operation(summary = "修改客户") - @PutMapping() - public ApiResult update(@RequestBody CreditCustomer creditCustomer) { - if (creditCustomerService.updateById(creditCustomer)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCustomer:remove')") - @OperationLog - @Operation(summary = "删除客户") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditCustomerService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCustomer:save')") - @OperationLog - @Operation(summary = "批量添加客户") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditCustomerService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCustomer:update')") - @OperationLog - @Operation(summary = "批量修改客户") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditCustomerService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditCustomer:remove')") - @OperationLog - @Operation(summary = "批量删除客户") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditCustomerService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditCustomer:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditCustomerService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditCustomer::getId, - CreditCustomer::setId, - CreditCustomer::getName, - CreditCustomer::getCompanyId, - CreditCustomer::setCompanyId, - CreditCustomer::getHasData, - CreditCustomer::setHasData, - CreditCustomer::getTenantId, - CreditCustomer::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入客户 - */ - @PreAuthorize("hasAuthority('credit:creditCustomer:save')") - @Operation(summary = "批量导入客户") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "客户", 4); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditCustomerImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByName = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "客户"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditCustomerImportParam param = list.get(i); - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - try { - CreditCustomer item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getName())) { - String link = urlByName.get(item.getName().trim()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - if (ImportHelper.isBlank(item.getName())) { - errorMessages.add("第" + excelRowNumber + "行:客户不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> { - // 批内一次查库,避免逐行查/写导致数据库压力过大 - List names = new ArrayList<>(chunkItems.size()); - for (CreditCustomer it : chunkItems) { - if (it != null && !ImportHelper.isBlank(it.getName())) { - names.add(it.getName().trim()); - } - } - List existingList = names.isEmpty() - ? new ArrayList<>() - : creditCustomerService.lambdaQuery() - .in(CreditCustomer::getName, names) - .list(); - java.util.Map existingByName = new java.util.HashMap<>(); - for (CreditCustomer existing : existingList) { - if (existing != null && !ImportHelper.isBlank(existing.getName())) { - existingByName.putIfAbsent(existing.getName().trim(), existing); - } - } - - java.util.Map latestByName = new java.util.HashMap<>(); - int acceptedRows = 0; - for (int idx = 0; idx < chunkItems.size(); idx++) { - CreditCustomer it = chunkItems.get(idx); - int rowNo = (idx < chunkRowNumbers.size()) ? chunkRowNumbers.get(idx) : -1; - if (it == null || ImportHelper.isBlank(it.getName())) { - continue; - } - String name = it.getName().trim(); - CreditCustomer existing = existingByName.get(name); - if (existing != null) { - Integer existingTenantId = existing.getTenantId(); - if (it.getTenantId() != null - && existingTenantId != null - && !it.getTenantId().equals(existingTenantId)) { - errorMessages.add("第" + rowNo + "行:客户名称已存在且归属其他租户,无法导入"); - continue; - } - it.setId(existing.getId()); - if (existingTenantId != null) { - it.setTenantId(existingTenantId); - } - } - // 同名多行:保留最后一行的值(等价于“先插入/更新,再被后续行更新”) - latestByName.put(name, it); - acceptedRows++; - } - - List updates = new ArrayList<>(); - List inserts = new ArrayList<>(); - for (CreditCustomer it : latestByName.values()) { - if (it.getId() != null) { - updates.add(it); - } else { - inserts.add(it); - } - } - if (!updates.isEmpty()) { - creditCustomerService.updateBatchById(updates, mpBatchSize); - } - if (!inserts.isEmpty()) { - creditCustomerService.saveBatch(inserts, mpBatchSize); - } - return acceptedRows; - }, - (rowItem, rowNumber) -> { - CreditCustomer existing = creditCustomerService.lambdaQuery() - .eq(CreditCustomer::getName, rowItem.getName()) - .one(); - if (existing != null) { - Integer existingTenantId = existing.getTenantId(); - if (rowItem.getTenantId() != null - && existingTenantId != null - && !rowItem.getTenantId().equals(existingTenantId)) { - errorMessages.add("第" + rowNumber + "行:客户名称已存在且归属其他租户,无法导入"); - return false; - } - rowItem.setId(existing.getId()); - if (existingTenantId != null) { - rowItem.setTenantId(existingTenantId); - } - return creditCustomerService.updateById(rowItem); - } - - try { - return creditCustomerService.save(rowItem); - } catch (DataIntegrityViolationException e) { - if (!isDuplicateCustomerName(e)) { - throw e; - } - CreditCustomer dbExisting = creditCustomerService.lambdaQuery() - .eq(CreditCustomer::getName, rowItem.getName()) - .one(); - if (dbExisting != null) { - Integer existingTenantId = dbExisting.getTenantId(); - rowItem.setId(dbExisting.getId()); - if (existingTenantId != null) { - rowItem.setTenantId(existingTenantId); - } - return creditCustomerService.updateById(rowItem); - } - } - errorMessages.add("第" + rowNumber + "行:保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> { - List names = new ArrayList<>(chunkItems.size()); - for (CreditCustomer it : chunkItems) { - if (it != null && !ImportHelper.isBlank(it.getName())) { - names.add(it.getName().trim()); - } - } - List existingList = names.isEmpty() - ? new ArrayList<>() - : creditCustomerService.lambdaQuery() - .in(CreditCustomer::getName, names) - .list(); - java.util.Map existingByName = new java.util.HashMap<>(); - for (CreditCustomer existing : existingList) { - if (existing != null && !ImportHelper.isBlank(existing.getName())) { - existingByName.putIfAbsent(existing.getName().trim(), existing); - } - } - - java.util.Map latestByName = new java.util.HashMap<>(); - int acceptedRows = 0; - for (int idx = 0; idx < chunkItems.size(); idx++) { - CreditCustomer it = chunkItems.get(idx); - int rowNo = (idx < chunkRowNumbers.size()) ? chunkRowNumbers.get(idx) : -1; - if (it == null || ImportHelper.isBlank(it.getName())) { - continue; - } - String name = it.getName().trim(); - CreditCustomer existing = existingByName.get(name); - if (existing != null) { - Integer existingTenantId = existing.getTenantId(); - if (it.getTenantId() != null - && existingTenantId != null - && !it.getTenantId().equals(existingTenantId)) { - errorMessages.add("第" + rowNo + "行:客户名称已存在且归属其他租户,无法导入"); - continue; - } - it.setId(existing.getId()); - if (existingTenantId != null) { - it.setTenantId(existingTenantId); - } - } - latestByName.put(name, it); - acceptedRows++; - } - - List updates = new ArrayList<>(); - List inserts = new ArrayList<>(); - for (CreditCustomer it : latestByName.values()) { - if (it.getId() != null) { - updates.add(it); - } else { - inserts.add(it); - } - } - if (!updates.isEmpty()) { - creditCustomerService.updateBatchById(updates, mpBatchSize); - } - if (!inserts.isEmpty()) { - creditCustomerService.saveBatch(inserts, mpBatchSize); - } - return acceptedRows; - }, - (rowItem, rowNumber) -> { - CreditCustomer existing = creditCustomerService.lambdaQuery() - .eq(CreditCustomer::getName, rowItem.getName()) - .one(); - if (existing != null) { - Integer existingTenantId = existing.getTenantId(); - if (rowItem.getTenantId() != null - && existingTenantId != null - && !rowItem.getTenantId().equals(existingTenantId)) { - errorMessages.add("第" + rowNumber + "行:客户名称已存在且归属其他租户,无法导入"); - return false; - } - rowItem.setId(existing.getId()); - if (existingTenantId != null) { - rowItem.setTenantId(existingTenantId); - } - return creditCustomerService.updateById(rowItem); - } - - try { - return creditCustomerService.save(rowItem); - } catch (DataIntegrityViolationException e) { - if (!isDuplicateCustomerName(e)) { - throw e; - } - CreditCustomer dbExisting = creditCustomerService.lambdaQuery() - .eq(CreditCustomer::getName, rowItem.getName()) - .one(); - if (dbExisting != null) { - Integer existingTenantId = dbExisting.getTenantId(); - rowItem.setId(dbExisting.getId()); - if (existingTenantId != null) { - rowItem.setTenantId(existingTenantId); - } - return creditCustomerService.updateById(rowItem); - } - } - errorMessages.add("第" + rowNumber + "行:保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.CUSTOMER, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载客户导入模板 - */ - @Operation(summary = "下载客户导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditCustomerImportParam example = new CreditCustomerImportParam(); - example.setName("示例客户"); - example.setStatusTxt("合作中"); - example.setPrice("88.8"); - example.setPublicDate("2024-01-01"); - example.setDataSource("公开渠道"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("客户导入模板", "客户", CreditCustomerImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_customer_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditCustomerImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getName()) - && ImportHelper.isBlank(param.getStatusTxt()) - && ImportHelper.isBlank(param.getPrice()); - } - - private CreditCustomer convertImportParamToEntity(CreditCustomerImportParam param) { - CreditCustomer entity = new CreditCustomer(); - - entity.setName(normalizeString(param.getName())); - entity.setStatusTxt(normalizeString(param.getStatusTxt())); - entity.setPrice(normalizeString(param.getPrice())); - entity.setPublicDate(normalizeString(param.getPublicDate())); - entity.setDataSource(normalizeString(param.getDataSource())); - entity.setComments(normalizeString(param.getComments())); - - return entity; - } - - private String normalizeString(String value) { - if (ImportHelper.isBlank(value)) { - return null; - } - return value.trim(); - } - - private boolean isDuplicateCustomerName(DataIntegrityViolationException e) { - Throwable mostSpecificCause = e.getMostSpecificCause(); - String message = mostSpecificCause != null ? mostSpecificCause.getMessage() : e.getMessage(); - if (message == null) { - return false; - } - String lower = message.toLowerCase(); - if (!lower.contains("duplicate")) { - return false; - } - return lower.contains("credit_customer.name") - || lower.contains("for key 'name'") - || lower.contains("for key `name`"); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditDeliveryNoticeController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditDeliveryNoticeController.java deleted file mode 100644 index 74e6c5d..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditDeliveryNoticeController.java +++ /dev/null @@ -1,434 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditDeliveryNotice; -import com.gxwebsoft.credit.param.CreditDeliveryNoticeImportParam; -import com.gxwebsoft.credit.param.CreditDeliveryNoticeParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditDeliveryNoticeService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 送达公告司法大数据控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:52 - */ -@Tag(name = "送达公告司法大数据管理") -@RestController -@RequestMapping("/api/credit/credit-delivery-notice") -public class CreditDeliveryNoticeController extends BaseController { - @Resource - private CreditDeliveryNoticeService creditDeliveryNoticeService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询送达公告司法大数据") - @GetMapping("/page") - public ApiResult> page(CreditDeliveryNoticeParam param) { - // 使用关联查询 - return success(creditDeliveryNoticeService.pageRel(param)); - } - - @Operation(summary = "查询全部送达公告司法大数据") - @GetMapping() - public ApiResult> list(CreditDeliveryNoticeParam param) { - // 使用关联查询 - return success(creditDeliveryNoticeService.listRel(param)); - } - - @Operation(summary = "根据id查询送达公告司法大数据") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditDeliveryNoticeService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditDeliveryNotice:save')") - @OperationLog - @Operation(summary = "添加送达公告司法大数据") - @PostMapping() - public ApiResult save(@RequestBody CreditDeliveryNotice creditDeliveryNotice) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditDeliveryNotice.setUserId(loginUser.getUserId()); - // } - if (creditDeliveryNoticeService.save(creditDeliveryNotice)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditDeliveryNotice:update')") - @OperationLog - @Operation(summary = "修改送达公告司法大数据") - @PutMapping() - public ApiResult update(@RequestBody CreditDeliveryNotice creditDeliveryNotice) { - if (creditDeliveryNoticeService.updateById(creditDeliveryNotice)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditDeliveryNotice:remove')") - @OperationLog - @Operation(summary = "删除送达公告司法大数据") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditDeliveryNoticeService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditDeliveryNotice:save')") - @OperationLog - @Operation(summary = "批量添加送达公告司法大数据") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditDeliveryNoticeService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditDeliveryNotice:update')") - @OperationLog - @Operation(summary = "批量修改送达公告司法大数据") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditDeliveryNoticeService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditDeliveryNotice:remove')") - @OperationLog - @Operation(summary = "批量删除送达公告司法大数据") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditDeliveryNoticeService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditDeliveryNotice:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditDeliveryNoticeService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditDeliveryNotice::getId, - CreditDeliveryNotice::setId, - CreditDeliveryNotice::getOtherPartiesThirdParty, - CreditDeliveryNotice::getCompanyId, - CreditDeliveryNotice::setCompanyId, - CreditDeliveryNotice::getHasData, - CreditDeliveryNotice::setHasData, - CreditDeliveryNotice::getTenantId, - CreditDeliveryNotice::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入送达公告司法大数据 - */ - @PreAuthorize("hasAuthority('credit:creditDeliveryNotice:save')") - @Operation(summary = "批量导入送达公告司法大数据") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "送达公告", 0); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditDeliveryNoticeImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - // URL 通常以超链接形式存在于“案号”列里 - Map urlByCaseNumber = ExcelImportSupport.readHyperlinksByHeaderKey( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditDeliveryNoticeImportParam param = list.get(i); - try { - CreditDeliveryNotice item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getCaseNumber())) { - String link = urlByCaseNumber.get(item.getCaseNumber().trim()); - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditDeliveryNoticeService, - chunkItems, - CreditDeliveryNotice::getId, - CreditDeliveryNotice::setId, - CreditDeliveryNotice::getCaseNumber, - CreditDeliveryNotice::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditDeliveryNoticeService.save(rowItem); - if (!saved) { - CreditDeliveryNotice existing = creditDeliveryNoticeService.lambdaQuery() - .eq(CreditDeliveryNotice::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditDeliveryNoticeService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditDeliveryNoticeService, - chunkItems, - CreditDeliveryNotice::getId, - CreditDeliveryNotice::setId, - CreditDeliveryNotice::getCaseNumber, - CreditDeliveryNotice::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditDeliveryNoticeService.save(rowItem); - if (!saved) { - CreditDeliveryNotice existing = creditDeliveryNoticeService.lambdaQuery() - .eq(CreditDeliveryNotice::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditDeliveryNoticeService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.DELIVERY_NOTICE, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载送达公告导入模板 - */ - @Operation(summary = "下载送达公告导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditDeliveryNoticeImportParam example = new CreditDeliveryNoticeImportParam(); - example.setDataType("送达公告"); - example.setPlaintiffAppellant("原告示例"); - example.setAppellee("被告示例"); - example.setOtherPartiesThirdParty2("第三人示例"); - example.setInvolvedAmount("100000"); - example.setDataStatus("正常"); - example.setOccurrenceTime("2024-01-01"); - example.setCaseNumber("(2024)示例案号"); - example.setCauseOfAction("案由示例"); - example.setCourtName("示例法院"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("送达公告导入模板", "送达公告", CreditDeliveryNoticeImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_delivery_notice_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditDeliveryNoticeImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getCaseNumber()) - && ImportHelper.isBlank(param.getCauseOfAction()) - && ImportHelper.isBlank(param.getOtherPartiesThirdParty()) - && ImportHelper.isBlank(param.getOtherPartiesThirdParty2()) - && ImportHelper.isBlank(param.getPlaintiffAppellant()) - && ImportHelper.isBlank(param.getAppellee()); - } - - private CreditDeliveryNotice convertImportParamToEntity(CreditDeliveryNoticeImportParam param) { - CreditDeliveryNotice entity = new CreditDeliveryNotice(); - - String occurrenceTime = !ImportHelper.isBlank(param.getOccurrenceTime2()) - ? param.getOccurrenceTime2() - : param.getOccurrenceTime(); - String otherPartiesThirdParty = !ImportHelper.isBlank(param.getOtherPartiesThirdParty2()) - ? param.getOtherPartiesThirdParty2() - : param.getOtherPartiesThirdParty(); - String courtName = !ImportHelper.isBlank(param.getCourtName2()) - ? param.getCourtName2() - : param.getCourtName(); - String involvedAmount = !ImportHelper.isBlank(param.getInvolvedAmount2()) - ? param.getInvolvedAmount2() - : param.getInvolvedAmount(); - - entity.setDataType(param.getDataType()); - entity.setPlaintiffAppellant(param.getPlaintiffAppellant()); - entity.setAppellee(param.getAppellee()); - entity.setInvolvedAmount(involvedAmount); - entity.setDataStatus(param.getDataStatus()); - - entity.setOtherPartiesThirdParty(otherPartiesThirdParty); - entity.setOccurrenceTime(occurrenceTime); - entity.setCaseNumber(param.getCaseNumber()); - entity.setCauseOfAction(param.getCauseOfAction()); - entity.setCourtName(courtName); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditExternalController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditExternalController.java deleted file mode 100644 index 22c67cb..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditExternalController.java +++ /dev/null @@ -1,424 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditExternal; -import com.gxwebsoft.credit.param.CreditExternalImportParam; -import com.gxwebsoft.credit.param.CreditExternalParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditExternalService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 对外投资控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:12 - */ -@Tag(name = "对外投资管理") -@RestController -@RequestMapping("/api/credit/credit-external") -public class CreditExternalController extends BaseController { - @Resource - private CreditExternalService creditExternalService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询对外投资") - @GetMapping("/page") - public ApiResult> page(CreditExternalParam param) { - // 使用关联查询 - return success(creditExternalService.pageRel(param)); - } - - @Operation(summary = "查询全部对外投资") - @GetMapping() - public ApiResult> list(CreditExternalParam param) { - // 使用关联查询 - return success(creditExternalService.listRel(param)); - } - - @Operation(summary = "根据id查询对外投资") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditExternalService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditExternal:save')") - @OperationLog - @Operation(summary = "添加对外投资") - @PostMapping() - public ApiResult save(@RequestBody CreditExternal creditExternal) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditExternal.setUserId(loginUser.getUserId()); - // } - if (creditExternalService.save(creditExternal)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditExternal:update')") - @OperationLog - @Operation(summary = "修改对外投资") - @PutMapping() - public ApiResult update(@RequestBody CreditExternal creditExternal) { - if (creditExternalService.updateById(creditExternal)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditExternal:remove')") - @OperationLog - @Operation(summary = "删除对外投资") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditExternalService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditExternal:save')") - @OperationLog - @Operation(summary = "批量添加对外投资") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditExternalService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditExternal:update')") - @OperationLog - @Operation(summary = "批量修改对外投资") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditExternalService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditExternal:remove')") - @OperationLog - @Operation(summary = "批量删除对外投资") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditExternalService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditExternal:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditExternalService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditExternal::getId, - CreditExternal::setId, - CreditExternal::getName, - CreditExternal::getCompanyId, - CreditExternal::setCompanyId, - CreditExternal::getHasData, - CreditExternal::setHasData, - CreditExternal::getTenantId, - CreditExternal::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入对外投资 - */ - @PreAuthorize("hasAuthority('credit:creditExternal:save')") - @Operation(summary = "批量导入对外投资") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "对外投资", 0); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditExternalImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByName = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "被投资企业名称"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditExternalImportParam param = list.get(i); - try { - CreditExternal item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getName())) { - String link = urlByName.get(item.getName().trim()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getName())) { - errorMessages.add("第" + excelRowNumber + "行:被投资企业名称不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditExternalService, - chunkItems, - CreditExternal::getId, - CreditExternal::setId, - CreditExternal::getName, - CreditExternal::getName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditExternalService.save(rowItem); - if (!saved) { - CreditExternal existing = creditExternalService.lambdaQuery() - .eq(CreditExternal::getName, rowItem.getName()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditExternalService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditExternalService, - chunkItems, - CreditExternal::getId, - CreditExternal::setId, - CreditExternal::getName, - CreditExternal::getName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditExternalService.save(rowItem); - if (!saved) { - CreditExternal existing = creditExternalService.lambdaQuery() - .eq(CreditExternal::getName, rowItem.getName()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditExternalService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.EXTERNAL, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载对外投资导入模板 - */ - @Operation(summary = "下载对外投资导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditExternalImportParam example = new CreditExternalImportParam(); - example.setName("示例科技有限公司"); - example.setStatusTxt("存续"); - example.setLegalRepresentative("李四"); - example.setRegisteredCapital("10000"); - example.setEstablishmentDate("2018-06-01"); - example.setShareholdingRatio("20"); - example.setSubscribedInvestmentAmount("2000"); - example.setSubscribedInvestmentDate("2019-01-01"); - example.setIndirectShareholdingRatio("5"); - example.setInvestmentDate("2019-06-01"); - example.setRegion("上海"); - example.setIndustry("信息技术"); - example.setInvestmentCount(1); - example.setRelatedProductsInstitutions("关联产品示例"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("对外投资导入模板", "对外投资", CreditExternalImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_external_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditExternalImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getName()) - && ImportHelper.isBlank(param.getLegalRepresentative()) - && ImportHelper.isBlank(param.getRegisteredCapital()) - && ImportHelper.isBlank(param.getEstablishmentDate()); - } - - private CreditExternal convertImportParamToEntity(CreditExternalImportParam param) { - CreditExternal entity = new CreditExternal(); - - entity.setName(param.getName()); - entity.setStatusTxt(param.getStatusTxt()); - entity.setLegalRepresentative(param.getLegalRepresentative()); - entity.setRegisteredCapital(param.getRegisteredCapital()); - entity.setEstablishmentDate(param.getEstablishmentDate()); - entity.setShareholdingRatio(param.getShareholdingRatio()); - entity.setSubscribedInvestmentAmount(param.getSubscribedInvestmentAmount()); - entity.setSubscribedInvestmentDate(param.getSubscribedInvestmentDate()); - entity.setIndirectShareholdingRatio(param.getIndirectShareholdingRatio()); - entity.setInvestmentDate(param.getInvestmentDate()); - entity.setRegion(param.getRegion()); - entity.setIndustry(param.getIndustry()); - entity.setInvestmentCount(param.getInvestmentCount()); - entity.setRelatedProductsInstitutions(param.getRelatedProductsInstitutions()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditFinalVersionController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditFinalVersionController.java deleted file mode 100644 index e3335ce..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditFinalVersionController.java +++ /dev/null @@ -1,641 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditFinalVersion; -import com.gxwebsoft.credit.param.CreditFinalVersionImportParam; -import com.gxwebsoft.credit.param.CreditFinalVersionParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditFinalVersionService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 终本案件控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:19 - */ -@Tag(name = "终本案件管理") -@RestController -@RequestMapping("/api/credit/credit-final-version") -public class CreditFinalVersionController extends BaseController { - @Resource - private CreditFinalVersionService creditFinalVersionService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询终本案件") - @GetMapping("/page") - public ApiResult> page(CreditFinalVersionParam param) { - // 使用关联查询 - return success(creditFinalVersionService.pageRel(param)); - } - - @Operation(summary = "查询全部终本案件") - @GetMapping() - public ApiResult> list(CreditFinalVersionParam param) { - // 使用关联查询 - return success(creditFinalVersionService.listRel(param)); - } - - @Operation(summary = "根据id查询终本案件") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditFinalVersionService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditFinalVersion:save')") - @OperationLog - @Operation(summary = "添加终本案件") - @PostMapping() - public ApiResult save(@RequestBody CreditFinalVersion creditFinalVersion) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditFinalVersion.setUserId(loginUser.getUserId()); - // } - if (creditFinalVersionService.save(creditFinalVersion)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditFinalVersion:update')") - @OperationLog - @Operation(summary = "修改终本案件") - @PutMapping() - public ApiResult update(@RequestBody CreditFinalVersion creditFinalVersion) { - if (creditFinalVersionService.updateById(creditFinalVersion)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditFinalVersion:remove')") - @OperationLog - @Operation(summary = "删除终本案件") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditFinalVersionService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditFinalVersion:save')") - @OperationLog - @Operation(summary = "批量添加终本案件") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditFinalVersionService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditFinalVersion:update')") - @OperationLog - @Operation(summary = "批量修改终本案件") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditFinalVersionService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditFinalVersion:remove')") - @OperationLog - @Operation(summary = "批量删除终本案件") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditFinalVersionService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditFinalVersion:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditFinalVersionService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditFinalVersion::getId, - CreditFinalVersion::setId, - CreditFinalVersion::getAppellee, - CreditFinalVersion::getCompanyId, - CreditFinalVersion::setCompanyId, - CreditFinalVersion::getHasData, - CreditFinalVersion::setHasData, - CreditFinalVersion::getTenantId, - CreditFinalVersion::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入终本案件 - */ - @PreAuthorize("hasAuthority('credit:creditFinalVersion:save')") - @Operation(summary = "批量导入终本案件") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - // 按选项卡名称读取(客户提供的文件可能不是把目标 sheet 放在第一个) - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "终本案件", 0); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditFinalVersionImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCaseNumber = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditFinalVersionImportParam param = list.get(i); - try { - CreditFinalVersion item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getCaseNumber())) { - String link = urlByCaseNumber.get(item.getCaseNumber().trim()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditFinalVersionService, - chunkItems, - CreditFinalVersion::getId, - CreditFinalVersion::setId, - CreditFinalVersion::getCaseNumber, - CreditFinalVersion::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditFinalVersionService.save(rowItem); - if (!saved) { - CreditFinalVersion existing = creditFinalVersionService.lambdaQuery() - .eq(CreditFinalVersion::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditFinalVersionService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditFinalVersionService, - chunkItems, - CreditFinalVersion::getId, - CreditFinalVersion::setId, - CreditFinalVersion::getCaseNumber, - CreditFinalVersion::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditFinalVersionService.save(rowItem); - if (!saved) { - CreditFinalVersion existing = creditFinalVersionService.lambdaQuery() - .eq(CreditFinalVersion::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditFinalVersionService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.FINAL_VERSION, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 批量导入历史终本案件(仅解析“历史终本案件”选项卡) - * 规则:案号相同则覆盖更新(recommend++ 记录更新次数);案号不存在则插入。 - */ - @PreAuthorize("hasAuthority('credit:creditFinalVersion:save')") - @Operation(summary = "批量导入历史终本案件") - @PostMapping("/import/history") - public ApiResult> importHistoryBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "历史终本案件"); - if (sheetIndex < 0) { - return fail("未读取到数据,请确认文件中存在“历史终本案件”选项卡且表头与示例格式一致", null); - } - - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditFinalVersionImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCaseNumber = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - LinkedHashMap latestByCaseNumber = new LinkedHashMap<>(); - LinkedHashMap latestRowByCaseNumber = new LinkedHashMap<>(); - - for (int i = 0; i < list.size(); i++) { - CreditFinalVersionImportParam param = list.get(i); - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - try { - CreditFinalVersion item = convertImportParamToEntity(param); - if (item.getCaseNumber() != null) { - item.setCaseNumber(item.getCaseNumber().trim()); - } - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - String link = urlByCaseNumber.get(item.getCaseNumber()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - // 历史导入的数据统一标记为“失效” - item.setDataStatus("失效"); - - latestByCaseNumber.put(item.getCaseNumber(), item); - latestRowByCaseNumber.put(item.getCaseNumber(), excelRowNumber); - } catch (Exception e) { - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (latestByCaseNumber.isEmpty()) { - if (errorMessages.isEmpty()) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - return success("导入完成,成功0条,失败" + errorMessages.size() + "条", errorMessages); - } - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (Map.Entry entry : latestByCaseNumber.entrySet()) { - String caseNumber = entry.getKey(); - CreditFinalVersion item = entry.getValue(); - Integer rowNo = latestRowByCaseNumber.get(caseNumber); - chunkItems.add(item); - chunkRowNumbers.add(rowNo != null ? rowNo : -1); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditFinalVersionService, - chunkItems, - CreditFinalVersion::getId, - CreditFinalVersion::setId, - CreditFinalVersion::getCaseNumber, - CreditFinalVersion::getCaseNumber, - CreditFinalVersion::getRecommend, - CreditFinalVersion::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditFinalVersionService.save(rowItem); - if (!saved) { - CreditFinalVersion existing = creditFinalVersionService.lambdaQuery() - .eq(CreditFinalVersion::getCaseNumber, rowItem.getCaseNumber()) - .select(CreditFinalVersion::getId, CreditFinalVersion::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditFinalVersionService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditFinalVersionService, - chunkItems, - CreditFinalVersion::getId, - CreditFinalVersion::setId, - CreditFinalVersion::getCaseNumber, - CreditFinalVersion::getCaseNumber, - CreditFinalVersion::getRecommend, - CreditFinalVersion::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditFinalVersionService.save(rowItem); - if (!saved) { - CreditFinalVersion existing = creditFinalVersionService.lambdaQuery() - .eq(CreditFinalVersion::getCaseNumber, rowItem.getCaseNumber()) - .select(CreditFinalVersion::getId, CreditFinalVersion::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditFinalVersionService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.FINAL_VERSION, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载终本案件导入模板 - */ - @Operation(summary = "下载终本案件导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditFinalVersionImportParam example = new CreditFinalVersionImportParam(); - example.setCaseNumber("(2024)示例案号"); - example.setPlaintiffAppellant("原告示例"); - example.setAppellee("被告示例"); - example.setOtherPartiesThirdParty("第三人示例"); - example.setInvolvedAmount("20,293.91"); - example.setDataStatus("正常"); - example.setCourtName("示例法院"); - example.setOccurrenceTime("2024-01-01"); - example.setFinalDate("2024-01-01"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("终本案件导入模板", "终本案件", CreditFinalVersionImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_final_version_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditFinalVersionImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getCaseNumber()); - } - - private CreditFinalVersion convertImportParamToEntity(CreditFinalVersionImportParam param) { - CreditFinalVersion entity = new CreditFinalVersion(); - - String plaintiffAppellant = !ImportHelper.isBlank(param.getPlaintiffAppellant2()) - ? param.getPlaintiffAppellant2() - : param.getPlaintiffAppellant(); - String appellee = !ImportHelper.isBlank(param.getAppellee2()) - ? param.getAppellee2() - : param.getAppellee(); - String otherPartiesThirdParty = !ImportHelper.isBlank(param.getOtherPartiesThirdParty()) - ? param.getOtherPartiesThirdParty() - : param.getOtherPartiesThirdParty2(); - String involvedAmount = !ImportHelper.isBlank(param.getInvolvedAmount2()) - ? param.getInvolvedAmount2() - : param.getInvolvedAmount(); - String courtName = !ImportHelper.isBlank(param.getCourtName2()) - ? param.getCourtName2() - : param.getCourtName(); - String occurrenceTime = !ImportHelper.isBlank(param.getOccurrenceTime2()) - ? param.getOccurrenceTime2() - : param.getOccurrenceTime(); - - entity.setCaseNumber(param.getCaseNumber()); - entity.setPlaintiffAppellant(plaintiffAppellant); - entity.setAppellee(appellee); - entity.setUnfulfilledAmount(param.getUnfulfilledAmount()); - entity.setInvolvedAmount(involvedAmount); - entity.setOtherPartiesThirdParty(otherPartiesThirdParty); - entity.setDataStatus(param.getDataStatus()); - entity.setCourtName(courtName); - entity.setOccurrenceTime(occurrenceTime); - entity.setFinalDate(param.getFinalDate()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditGqdjController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditGqdjController.java deleted file mode 100644 index c9b8193..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditGqdjController.java +++ /dev/null @@ -1,814 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditGqdj; -import com.gxwebsoft.credit.param.CreditGqdjImportParam; -import com.gxwebsoft.credit.param.CreditGqdjParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditGqdjService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 股权冻结控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:37 - */ -@Tag(name = "股权冻结管理") -@RestController -@RequestMapping("/api/credit/credit-gqdj") -public class CreditGqdjController extends BaseController { - @Resource - private CreditGqdjService creditGqdjService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询股权冻结") - @GetMapping("/page") - public ApiResult> page(CreditGqdjParam param) { - // 使用关联查询 - return success(creditGqdjService.pageRel(param)); - } - - @Operation(summary = "查询全部股权冻结") - @GetMapping() - public ApiResult> list(CreditGqdjParam param) { - // 使用关联查询 - return success(creditGqdjService.listRel(param)); - } - - @Operation(summary = "根据id查询股权冻结") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditGqdjService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditGqdj:save')") - @OperationLog - @Operation(summary = "添加股权冻结") - @PostMapping() - public ApiResult save(@RequestBody CreditGqdj creditGqdj) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditGqdj.setUserId(loginUser.getUserId()); - // } - if (creditGqdjService.save(creditGqdj)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditGqdj:update')") - @OperationLog - @Operation(summary = "修改股权冻结") - @PutMapping() - public ApiResult update(@RequestBody CreditGqdj creditGqdj) { - if (creditGqdjService.updateById(creditGqdj)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditGqdj:remove')") - @OperationLog - @Operation(summary = "删除股权冻结") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditGqdjService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditGqdj:save')") - @OperationLog - @Operation(summary = "批量添加股权冻结") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditGqdjService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditGqdj:update')") - @OperationLog - @Operation(summary = "批量修改股权冻结") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditGqdjService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditGqdj:remove')") - @OperationLog - @Operation(summary = "批量删除股权冻结") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditGqdjService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据当事人/企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId 为空/0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditGqdj:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - // Match companyId by any party/company-name column (e.g. plaintiff/appellant, defendant/appellee). - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyNames( - creditGqdjService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditGqdj::getId, - CreditGqdj::setId, - CreditGqdj::getCompanyId, - CreditGqdj::setCompanyId, - CreditGqdj::getHasData, - CreditGqdj::setHasData, - CreditGqdj::getTenantId, - CreditGqdj::new, - CreditGqdj::getPlaintiffAppellant, - CreditGqdj::getAppellee - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入股权冻结司法大数据 - */ - @PreAuthorize("hasAuthority('credit:creditGqdj:save')") - @Operation(summary = "批量导入股权冻结司法大数据") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "股权冻结", 0); - // Prefer the "best" header configuration; many upstream files have extra title rows or multi-row headers. - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.readBest( - file, - CreditGqdjImportParam.class, - this::isEmptyImportRow, - // Score rows that look like real data (at least has a case number in either column). - p -> p != null - && (!ImportHelper.isBlank(p.getCaseNumber()) - || !ImportHelper.isBlank(p.getCaseNumber2()) - ), - sheetIndex - ); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - // Fallback: try other sheets if the named/default sheet doesn't match. - importResult = ExcelImportSupport.readAnySheetBest( - file, - CreditGqdjImportParam.class, - this::isEmptyImportRow, - p -> p != null - && (!ImportHelper.isBlank(p.getCaseNumber()) - || !ImportHelper.isBlank(p.getCaseNumber2())) - ); - list = importResult.getData(); - usedTitleRows = importResult.getTitleRows(); - usedHeadRows = importResult.getHeadRows(); - usedSheetIndex = importResult.getSheetIndex(); - } - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - // easypoi 默认不会读取单元格超链接地址;url 通常挂在“案号/执行通知文书号”列的超链接中,需要额外读取回填。 - String caseNumberHeader = "执行通知文书号"; - Map urlByCaseNumber = ExcelImportSupport.readHyperlinksByHeaderKey( - file, usedSheetIndex, usedTitleRows, usedHeadRows, caseNumberHeader); - // Some upstream sources use "案号" as the case number header. - Map urlByCaseNumberFromAh = ExcelImportSupport.readHyperlinksByHeaderKey( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - urlByCaseNumberFromAh.forEach(urlByCaseNumber::putIfAbsent); - // Some upstream sources use "暗号" as the case number header. - Map urlByCaseNumberFromAh2 = ExcelImportSupport.readHyperlinksByHeaderKey( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "暗号"); - urlByCaseNumberFromAh2.forEach(urlByCaseNumber::putIfAbsent); - // 有些源文件会单独提供“url/网址/链接”等列(可能是纯文本也可能是超链接) - Map urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, caseNumberHeader, "url"); - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, caseNumberHeader, "URL"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, caseNumberHeader, "网址"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, caseNumberHeader, "链接"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - // Try again with "案号" as the key column name. - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号", "url"); - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号", "URL"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号", "网址"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号", "链接"); - } - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - // Try again with "暗号" as the key column name. - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "暗号", "url"); - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "暗号", "URL"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "暗号", "网址"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "暗号", "链接"); - } - } - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditGqdjImportParam param = list.get(i); - try { - CreditGqdj item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getCaseNumber())) { - String key = item.getCaseNumber().trim(); - String link = urlByCaseNumber.get(key); - if (ImportHelper.isBlank(link)) { - link = urlByCaseNumberFromUrlCol.get(key); - } - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditGqdjService, - chunkItems, - CreditGqdj::getId, - CreditGqdj::setId, - CreditGqdj::getCaseNumber, - CreditGqdj::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditGqdjService.save(rowItem); - if (!saved) { - CreditGqdj existing = creditGqdjService.lambdaQuery() - .eq(CreditGqdj::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditGqdjService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditGqdjService, - chunkItems, - CreditGqdj::getId, - CreditGqdj::setId, - CreditGqdj::getCaseNumber, - CreditGqdj::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditGqdjService.save(rowItem); - if (!saved) { - CreditGqdj existing = creditGqdjService.lambdaQuery() - .eq(CreditGqdj::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditGqdjService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.GQDJ, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 批量导入历史股权冻结(仅解析“历史股权冻结”选项卡) - * 规则:执行通知文书号/案号相同则覆盖更新(recommend++ 记录更新次数);不存在则插入。 - */ - @PreAuthorize("hasAuthority('credit:creditGqdj:save')") - @Operation(summary = "批量导入历史股权冻结司法大数据") - @PostMapping("/import/history") - public ApiResult> importHistoryBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "历史股权冻结"); - if (sheetIndex < 0) { - return fail("未读取到数据,请确认文件中存在“历史股权冻结”选项卡且表头与示例格式一致", null); - } - - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.readBest( - file, - CreditGqdjImportParam.class, - this::isEmptyImportRow, - p -> p != null - && (!ImportHelper.isBlank(p.getCaseNumber()) - || !ImportHelper.isBlank(p.getCaseNumber2())), - sheetIndex - ); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - String caseNumberHeader = "执行通知文书号"; - Map urlByCaseNumber = ExcelImportSupport.readHyperlinksByHeaderKey( - file, usedSheetIndex, usedTitleRows, usedHeadRows, caseNumberHeader); - Map urlByCaseNumberFromAh = ExcelImportSupport.readHyperlinksByHeaderKey( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - urlByCaseNumberFromAh.forEach(urlByCaseNumber::putIfAbsent); - Map urlByCaseNumberFromAh2 = ExcelImportSupport.readHyperlinksByHeaderKey( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "暗号"); - urlByCaseNumberFromAh2.forEach(urlByCaseNumber::putIfAbsent); - Map urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, caseNumberHeader, "url"); - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, caseNumberHeader, "URL"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, caseNumberHeader, "网址"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, caseNumberHeader, "链接"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号", "url"); - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号", "URL"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号", "网址"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号", "链接"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "暗号", "url"); - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "暗号", "URL"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "暗号", "网址"); - } - if (urlByCaseNumberFromUrlCol.isEmpty()) { - urlByCaseNumberFromUrlCol = ExcelImportSupport.readKeyValueByHeaders( - file, usedSheetIndex, usedTitleRows, usedHeadRows, "暗号", "链接"); - } - } - } - - LinkedHashMap latestByCaseNumber = new LinkedHashMap<>(); - LinkedHashMap latestRowByCaseNumber = new LinkedHashMap<>(); - - for (int i = 0; i < list.size(); i++) { - CreditGqdjImportParam param = list.get(i); - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - try { - CreditGqdj item = convertImportParamToEntity(param); - if (item.getCaseNumber() != null) { - item.setCaseNumber(item.getCaseNumber().trim()); - } - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - String key = item.getCaseNumber(); - String link = urlByCaseNumber.get(key); - if (ImportHelper.isBlank(link)) { - link = urlByCaseNumberFromUrlCol.get(key); - } - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - // 历史导入的数据统一标记为“失效” - item.setDataStatus("失效"); - - latestByCaseNumber.put(item.getCaseNumber(), item); - latestRowByCaseNumber.put(item.getCaseNumber(), excelRowNumber); - } catch (Exception e) { - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (latestByCaseNumber.isEmpty()) { - if (errorMessages.isEmpty()) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - return success("导入完成,成功0条,失败" + errorMessages.size() + "条", errorMessages); - } - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (Map.Entry entry : latestByCaseNumber.entrySet()) { - String caseNumber = entry.getKey(); - CreditGqdj item = entry.getValue(); - Integer rowNo = latestRowByCaseNumber.get(caseNumber); - chunkItems.add(item); - chunkRowNumbers.add(rowNo != null ? rowNo : -1); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditGqdjService, - chunkItems, - CreditGqdj::getId, - CreditGqdj::setId, - CreditGqdj::getCaseNumber, - CreditGqdj::getCaseNumber, - CreditGqdj::getRecommend, - CreditGqdj::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditGqdjService.save(rowItem); - if (!saved) { - CreditGqdj existing = creditGqdjService.lambdaQuery() - .eq(CreditGqdj::getCaseNumber, rowItem.getCaseNumber()) - .select(CreditGqdj::getId, CreditGqdj::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditGqdjService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditGqdjService, - chunkItems, - CreditGqdj::getId, - CreditGqdj::setId, - CreditGqdj::getCaseNumber, - CreditGqdj::getCaseNumber, - CreditGqdj::getRecommend, - CreditGqdj::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditGqdjService.save(rowItem); - if (!saved) { - CreditGqdj existing = creditGqdjService.lambdaQuery() - .eq(CreditGqdj::getCaseNumber, rowItem.getCaseNumber()) - .select(CreditGqdj::getId, CreditGqdj::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditGqdjService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.GQDJ, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载股权冻结导入模板 - */ - @Operation(summary = "下载股权冻结导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditGqdjImportParam example = new CreditGqdjImportParam(); - example.setDataType("股权冻结"); - example.setPlaintiffAppellant("原告示例"); - example.setAppellee("被告示例"); - example.setCaseNumber("(2024)示例案号"); - example.setInvolvedAmount("100000"); - example.setCourtName("示例法院"); - example.setDataStatus("已公开"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("股权冻结导入模板", "股权冻结", CreditGqdjImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_gqdj_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditGqdjImportParam param) { - if (param == null) { - return true; - } - // Don't over-filter here: if some columns are mapped but case number header differs, - // we still want to read the row and report "案号不能为空" instead of "未读取到数据". - return ImportHelper.isBlank(param.getCaseNumber()) - && ImportHelper.isBlank(param.getCaseNumber2()) - && ImportHelper.isBlank(param.getAppellee()) - && ImportHelper.isBlank(param.getAppellee2()) - && ImportHelper.isBlank(param.getPlaintiffAppellant()) - && ImportHelper.isBlank(param.getPlaintiffAppellant2()) - && ImportHelper.isBlank(param.getInvolvedAmount()) - && ImportHelper.isBlank(param.getCourtName()) - && ImportHelper.isBlank(param.getDataType()) - && ImportHelper.isBlank(param.getDataStatus()) - && ImportHelper.isBlank(param.getDataStatus2()) - && ImportHelper.isBlank(param.getFreezeDateStart()) - && ImportHelper.isBlank(param.getFreezeDateEnd()) - && ImportHelper.isBlank(param.getFreezeDateStart2()) - && ImportHelper.isBlank(param.getFreezeDateEnd2()) - && ImportHelper.isBlank(param.getPublicDate()); - } - - private CreditGqdj convertImportParamToEntity(CreditGqdjImportParam param) { - CreditGqdj entity = new CreditGqdj(); - - // Template compatibility: some sources use alternate headers for the same columns. - String appellee = !ImportHelper.isBlank(param.getAppellee()) ? param.getAppellee() : param.getAppellee2(); - String plaintiffAppellant = !ImportHelper.isBlank(param.getPlaintiffAppellant()) - ? param.getPlaintiffAppellant() - : param.getPlaintiffAppellant2(); - - if (!ImportHelper.isBlank(param.getCaseNumber2())) { - entity.setCaseNumber(param.getCaseNumber2()); - } else { - entity.setCaseNumber(param.getCaseNumber()); - } - entity.setAppellee(appellee); - entity.setPlaintiffAppellant(plaintiffAppellant); - entity.setInvolvedAmount(param.getInvolvedAmount()); - entity.setCourtName(param.getCourtName()); - if (!ImportHelper.isBlank(param.getDataStatus2())) { - entity.setDataStatus(param.getDataStatus2()); - } else { - entity.setDataStatus(param.getDataStatus()); - } - entity.setDataType("股权冻结"); - entity.setPublicDate(param.getPublicDate()); - if (!ImportHelper.isBlank(param.getFreezeDateStart2())) { - entity.setFreezeDateStart(param.getFreezeDateStart2()); - } else { - entity.setFreezeDateStart(param.getFreezeDateStart()); - } - if (!ImportHelper.isBlank(param.getFreezeDateEnd2())) { - entity.setFreezeDateEnd(param.getFreezeDateEnd2()); - } else { - entity.setFreezeDateEnd(param.getFreezeDateEnd()); - } - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditHistoricalLegalPersonController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditHistoricalLegalPersonController.java deleted file mode 100644 index 5097d93..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditHistoricalLegalPersonController.java +++ /dev/null @@ -1,511 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditHistoricalLegalPerson; -import com.gxwebsoft.credit.param.CreditHistoricalLegalPersonImportParam; -import com.gxwebsoft.credit.param.CreditHistoricalLegalPersonParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditHistoricalLegalPersonService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 历史法定代表人控制器 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Tag(name = "历史法定代表人管理") -@RestController -@RequestMapping("/api/credit/credit-historical-legal-person") -public class CreditHistoricalLegalPersonController extends BaseController { - @Resource - private CreditHistoricalLegalPersonService creditHistoricalLegalPersonService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询历史法定代表人") - @GetMapping("/page") - public ApiResult> page(CreditHistoricalLegalPersonParam param) { - // 使用关联查询 - return success(creditHistoricalLegalPersonService.pageRel(param)); - } - - @Operation(summary = "查询全部历史法定代表人") - @GetMapping() - public ApiResult> list(CreditHistoricalLegalPersonParam param) { - // 使用关联查询 - return success(creditHistoricalLegalPersonService.listRel(param)); - } - - @Operation(summary = "根据id查询历史法定代表人") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditHistoricalLegalPersonService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:save')") - @OperationLog - @Operation(summary = "添加历史法定代表人") - @PostMapping() - public ApiResult save(@RequestBody CreditHistoricalLegalPerson creditHistoricalLegalPerson) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditHistoricalLegalPerson.setUserId(loginUser.getUserId()); - // } - if (creditHistoricalLegalPersonService.save(creditHistoricalLegalPerson)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:update')") - @OperationLog - @Operation(summary = "修改历史法定代表人") - @PutMapping() - public ApiResult update(@RequestBody CreditHistoricalLegalPerson creditHistoricalLegalPerson) { - if (creditHistoricalLegalPersonService.updateById(creditHistoricalLegalPerson)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:remove')") - @OperationLog - @Operation(summary = "删除历史法定代表人") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditHistoricalLegalPersonService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:save')") - @OperationLog - @Operation(summary = "批量添加历史法定代表人") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditHistoricalLegalPersonService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:update')") - @OperationLog - @Operation(summary = "批量修改历史法定代表人") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditHistoricalLegalPersonService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:remove')") - @OperationLog - @Operation(summary = "批量删除历史法定代表人") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditHistoricalLegalPersonService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditHistoricalLegalPersonService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditHistoricalLegalPerson::getId, - CreditHistoricalLegalPerson::setId, - CreditHistoricalLegalPerson::getName, - CreditHistoricalLegalPerson::getCompanyId, - CreditHistoricalLegalPerson::setCompanyId, - CreditHistoricalLegalPerson::getHasData, - CreditHistoricalLegalPerson::setHasData, - CreditHistoricalLegalPerson::getTenantId, - CreditHistoricalLegalPerson::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入历史法定代表人 - */ - @PreAuthorize("hasAuthority('credit:creditHistoricalLegalPerson:save')") - @Operation(summary = "批量导入历史法定代表人") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.readAnySheet( - file, CreditHistoricalLegalPersonImportParam.class, this::isEmptyImportRow); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByName = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "名称"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditHistoricalLegalPersonImportParam param = list.get(i); - try { - CreditHistoricalLegalPerson item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getName())) { - String link = urlByName.get(item.getName().trim()); - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getName())) { - errorMessages.add("第" + excelRowNumber + "行:名称不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> { - // 批内一次查库:按 name in (...) 拉取,再按 registerDate 做内存匹配 - List names = new ArrayList<>(chunkItems.size()); - for (CreditHistoricalLegalPerson it : chunkItems) { - if (it != null && !ImportHelper.isBlank(it.getName())) { - names.add(it.getName().trim()); - } - } - List existingList = names.isEmpty() - ? new ArrayList<>() - : creditHistoricalLegalPersonService.lambdaQuery() - .in(CreditHistoricalLegalPerson::getName, names) - .list(); - - java.util.Map byName = new java.util.HashMap<>(); - java.util.Map byNameDate = new java.util.HashMap<>(); - for (CreditHistoricalLegalPerson existing : existingList) { - if (existing == null || ImportHelper.isBlank(existing.getName())) { - continue; - } - String n = existing.getName().trim(); - byName.putIfAbsent(n, existing); - String d = ImportHelper.isBlank(existing.getRegisterDate()) ? null : existing.getRegisterDate().trim(); - if (d != null) { - byNameDate.putIfAbsent(n + "|" + d, existing); - } - } - - List updates = new ArrayList<>(); - List inserts = new ArrayList<>(); - for (CreditHistoricalLegalPerson it : chunkItems) { - if (it == null || ImportHelper.isBlank(it.getName())) { - continue; - } - String n = it.getName().trim(); - CreditHistoricalLegalPerson existing; - if (!ImportHelper.isBlank(it.getRegisterDate())) { - String d = it.getRegisterDate().trim(); - existing = byNameDate.get(n + "|" + d); - } else { - existing = byName.get(n); - } - if (existing != null) { - it.setId(existing.getId()); - updates.add(it); - } else { - inserts.add(it); - } - } - if (!updates.isEmpty()) { - creditHistoricalLegalPersonService.updateBatchById(updates, mpBatchSize); - } - if (!inserts.isEmpty()) { - creditHistoricalLegalPersonService.saveBatch(inserts, mpBatchSize); - } - return updates.size() + inserts.size(); - }, - (rowItem, rowNumber) -> { - boolean saved = creditHistoricalLegalPersonService.save(rowItem); - if (!saved) { - CreditHistoricalLegalPerson existing = creditHistoricalLegalPersonService.lambdaQuery() - .eq(CreditHistoricalLegalPerson::getName, rowItem.getName()) - .eq(!ImportHelper.isBlank(rowItem.getRegisterDate()), CreditHistoricalLegalPerson::getRegisterDate, rowItem.getRegisterDate()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditHistoricalLegalPersonService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> { - List names = new ArrayList<>(chunkItems.size()); - for (CreditHistoricalLegalPerson it : chunkItems) { - if (it != null && !ImportHelper.isBlank(it.getName())) { - names.add(it.getName().trim()); - } - } - List existingList = names.isEmpty() - ? new ArrayList<>() - : creditHistoricalLegalPersonService.lambdaQuery() - .in(CreditHistoricalLegalPerson::getName, names) - .list(); - - java.util.Map byName = new java.util.HashMap<>(); - java.util.Map byNameDate = new java.util.HashMap<>(); - for (CreditHistoricalLegalPerson existing : existingList) { - if (existing == null || ImportHelper.isBlank(existing.getName())) { - continue; - } - String n = existing.getName().trim(); - byName.putIfAbsent(n, existing); - String d = ImportHelper.isBlank(existing.getRegisterDate()) ? null : existing.getRegisterDate().trim(); - if (d != null) { - byNameDate.putIfAbsent(n + "|" + d, existing); - } - } - - List updates = new ArrayList<>(); - List inserts = new ArrayList<>(); - for (CreditHistoricalLegalPerson it : chunkItems) { - if (it == null || ImportHelper.isBlank(it.getName())) { - continue; - } - String n = it.getName().trim(); - CreditHistoricalLegalPerson existing; - if (!ImportHelper.isBlank(it.getRegisterDate())) { - String d = it.getRegisterDate().trim(); - existing = byNameDate.get(n + "|" + d); - } else { - existing = byName.get(n); - } - if (existing != null) { - it.setId(existing.getId()); - updates.add(it); - } else { - inserts.add(it); - } - } - if (!updates.isEmpty()) { - creditHistoricalLegalPersonService.updateBatchById(updates, mpBatchSize); - } - if (!inserts.isEmpty()) { - creditHistoricalLegalPersonService.saveBatch(inserts, mpBatchSize); - } - return updates.size() + inserts.size(); - }, - (rowItem, rowNumber) -> { - boolean saved = creditHistoricalLegalPersonService.save(rowItem); - if (!saved) { - CreditHistoricalLegalPerson existing = creditHistoricalLegalPersonService.lambdaQuery() - .eq(CreditHistoricalLegalPerson::getName, rowItem.getName()) - .eq(!ImportHelper.isBlank(rowItem.getRegisterDate()), CreditHistoricalLegalPerson::getRegisterDate, rowItem.getRegisterDate()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditHistoricalLegalPersonService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.HISTORICAL_LEGAL_PERSON, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载历史法定代表人导入模板 - */ - @Operation(summary = "下载历史法定代表人导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditHistoricalLegalPersonImportParam example = new CreditHistoricalLegalPersonImportParam(); - example.setName("张三"); - example.setRegisterDate("2020-01-01"); - example.setPublicDate("2023-06-01"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("历史法定代表人导入模板", "历史法定代表人", CreditHistoricalLegalPersonImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_historical_legal_person_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditHistoricalLegalPersonImportParam param) { - if (param == null) { - return true; - } - if (isImportHeaderRow(param)) { - return true; - } - return ImportHelper.isBlank(param.getName()) - && ImportHelper.isBlank(param.getRegisterDate()) - && ImportHelper.isBlank(param.getPublicDate()); - } - - private boolean isImportHeaderRow(CreditHistoricalLegalPersonImportParam param) { - return isHeaderValue(param.getName(), "名称") - || isHeaderValue(param.getRegisterDate(), "任职日期") - || isHeaderValue(param.getPublicDate(), "卸任日期"); - } - - private static boolean isHeaderValue(String value, String headerText) { - if (value == null) { - return false; - } - return headerText.equals(value.trim()); - } - - private CreditHistoricalLegalPerson convertImportParamToEntity(CreditHistoricalLegalPersonImportParam param) { - CreditHistoricalLegalPerson entity = new CreditHistoricalLegalPerson(); - - entity.setName(param.getName()); - entity.setRegisterDate(param.getRegisterDate()); - entity.setPublicDate(param.getPublicDate()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditJudgmentDebtorController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditJudgmentDebtorController.java deleted file mode 100644 index f1626f8..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditJudgmentDebtorController.java +++ /dev/null @@ -1,969 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditJudgmentDebtor; -import com.gxwebsoft.credit.param.CreditJudgmentDebtorImportParam; -import com.gxwebsoft.credit.param.CreditJudgmentDebtorParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditJudgmentDebtorService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.ss.usermodel.WorkbookFactory; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.util.Locale; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - -/** - * 被执行人控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:55 - */ -@Tag(name = "被执行人管理") -@RestController -@RequestMapping("/api/credit/credit-judgment-debtor") -public class CreditJudgmentDebtorController extends BaseController { - @Resource - private CreditJudgmentDebtorService creditJudgmentDebtorService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询被执行人") - @GetMapping("/page") - public ApiResult> page(CreditJudgmentDebtorParam param) { - // 使用关联查询 - return success(creditJudgmentDebtorService.pageRel(param)); - } - - @Operation(summary = "查询全部被执行人") - @GetMapping() - public ApiResult> list(CreditJudgmentDebtorParam param) { - // 使用关联查询 - return success(creditJudgmentDebtorService.listRel(param)); - } - - @Operation(summary = "根据id查询被执行人") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditJudgmentDebtorService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:save')") - @OperationLog - @Operation(summary = "添加被执行人") - @PostMapping() - public ApiResult save(@RequestBody CreditJudgmentDebtor creditJudgmentDebtor) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditJudgmentDebtor.setUserId(loginUser.getUserId()); - // } - if (creditJudgmentDebtorService.save(creditJudgmentDebtor)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:update')") - @OperationLog - @Operation(summary = "修改被执行人") - @PutMapping() - public ApiResult update(@RequestBody CreditJudgmentDebtor creditJudgmentDebtor) { - if (creditJudgmentDebtorService.updateById(creditJudgmentDebtor)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:remove')") - @OperationLog - @Operation(summary = "删除被执行人") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditJudgmentDebtorService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:save')") - @OperationLog - @Operation(summary = "批量添加被执行人") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditJudgmentDebtorService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:update')") - @OperationLog - @Operation(summary = "批量修改被执行人") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditJudgmentDebtorService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:remove')") - @OperationLog - @Operation(summary = "批量删除被执行人") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditJudgmentDebtorService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditJudgmentDebtorService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditJudgmentDebtor::getId, - CreditJudgmentDebtor::setId, - CreditJudgmentDebtor::getName, - CreditJudgmentDebtor::getCompanyId, - CreditJudgmentDebtor::setCompanyId, - CreditJudgmentDebtor::getHasData, - CreditJudgmentDebtor::setHasData, - CreditJudgmentDebtor::getTenantId, - CreditJudgmentDebtor::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入被执行人 - */ - @PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:save')") - @Operation(summary = "批量导入被执行人") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - try { - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - ImportOutcome outcome; - if (isZip(file)) { - outcome = importFromZip(file, currentUserId, currentTenantId, companyId); - } else { - outcome = importFromExcel(file, safeFileLabel(file.getOriginalFilename()), currentUserId, currentTenantId, companyId, false); - } - - if (!outcome.anyDataRead) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.JUDGMENT_DEBTOR, outcome.touchedCompanyIds); - - if (outcome.errorMessages.isEmpty()) { - return success("成功导入" + outcome.successCount + "条数据", null); - } - return success("导入完成,成功" + outcome.successCount + "条,失败" + outcome.errorMessages.size() + "条", outcome.errorMessages); - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 批量导入历史被执行人(写入被执行人表 credit_judgment_debtor,仅解析“历史被执行人”选项卡) - * 规则:案号相同则更新;案号不存在则插入;导入文件内案号重复时取最后一条覆盖。 - */ - @PreAuthorize("hasAuthority('credit:creditJudgmentDebtor:save')") - @Operation(summary = "批量导入历史被执行人") - @PostMapping("/import/history") - public ApiResult> importHistoryBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - try { - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - ImportOutcome outcome; - if (isZip(file)) { - outcome = importHistoryFromZip(file, currentUserId, currentTenantId, companyId); - } else { - outcome = importHistoryFromExcel(file, safeFileLabel(file.getOriginalFilename()), currentUserId, currentTenantId, companyId); - } - - if (!outcome.anyDataRead) { - return fail("未读取到数据,请确认文件中存在“历史被执行人”选项卡且表头与示例格式一致", null); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.JUDGMENT_DEBTOR, outcome.touchedCompanyIds); - - if (outcome.errorMessages.isEmpty()) { - return success("成功导入" + outcome.successCount + "条数据", null); - } - return success("导入完成,成功" + outcome.successCount + "条,失败" + outcome.errorMessages.size() + "条", outcome.errorMessages); - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载被执行人导入模板 - */ - @Operation(summary = "下载被执行人导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditJudgmentDebtorImportParam example = new CreditJudgmentDebtorImportParam(); - example.setCaseNumber("(2024)示例案号"); - example.setName("某某公司"); - example.setCode("1234567890"); - example.setOccurrenceTime("2024-01-10"); - example.setAmount("100000"); - example.setDataStatus("已公开"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("被执行人导入模板", "被执行人", CreditJudgmentDebtorImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_judgment_debtor_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditJudgmentDebtorImportParam param) { - if (param == null) { - return true; - } - if (isImportHeaderRow(param)) { - return true; - } - return ImportHelper.isBlank(param.getCaseNumber()); - } - - private boolean isImportHeaderRow(CreditJudgmentDebtorImportParam param) { - return isHeaderValue(param.getName(), "序号") - || isHeaderValue(param.getName1(), "序号") - || isHeaderValue(param.getCaseNumber(), "案号") - || isHeaderValue(param.getName(), "被执行人名称") - || isHeaderValue(param.getName1(), "被执行人") - || isHeaderValue(param.getCode(), "证件号/组织机构代码") - || isHeaderValue(param.getOccurrenceTime(), "立案日期") - || isHeaderValue(param.getCourtName(), "法院") - || isHeaderValue(param.getAmount(), "执行标的(元)") - || isHeaderValue(param.getDataStatus(), "数据状态"); - } - - private static boolean isHeaderValue(String value, String headerText) { - if (value == null) { - return false; - } - return headerText.equals(value.trim()); - } - - private CreditJudgmentDebtor convertImportParamToEntity(CreditJudgmentDebtorImportParam param) { - CreditJudgmentDebtor entity = new CreditJudgmentDebtor(); - - entity.setCaseNumber(param.getCaseNumber()); - entity.setName1(param.getName1()); - String debtorName = ImportHelper.isBlank(param.getName()) ? param.getName1() : param.getName(); - entity.setName(debtorName); - entity.setCode(param.getCode()); - entity.setOccurrenceTime(param.getOccurrenceTime()); - entity.setAmount(param.getAmount()); - entity.setCourtName(param.getCourtName()); - entity.setDataStatus(param.getDataStatus()); - entity.setComments(param.getComments()); - - return entity; - } - - private static class ImportOutcome { - private final boolean anyDataRead; - private final int successCount; - private final List errorMessages; - private final Set touchedCompanyIds; - - private ImportOutcome(boolean anyDataRead, int successCount, List errorMessages, Set touchedCompanyIds) { - this.anyDataRead = anyDataRead; - this.successCount = successCount; - this.errorMessages = errorMessages; - this.touchedCompanyIds = touchedCompanyIds != null ? touchedCompanyIds : new HashSet<>(); - } - } - - private ImportOutcome importFromExcel(MultipartFile excelFile, String fileLabel, Integer currentUserId, Integer currentTenantId, Integer companyId, boolean strictDebtorSheet) throws Exception { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - ExcelImportSupport.ImportResult importResult = readDebtorImport(excelFile, strictDebtorSheet); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return new ImportOutcome(false, 0, errorMessages, touchedCompanyIds); - } - - Map urlByCaseNumber = ExcelImportSupport.readHyperlinksByHeaderKey(excelFile, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - Map urlByName = ExcelImportSupport.readHyperlinksByHeaderKey(excelFile, usedSheetIndex, usedTitleRows, usedHeadRows, "被执行人名称"); - Map urlByName1 = ExcelImportSupport.readHyperlinksByHeaderKey(excelFile, usedSheetIndex, usedTitleRows, usedHeadRows, "被执行人"); - - String prefix = ImportHelper.isBlank(fileLabel) ? "" : "【" + fileLabel + "】"; - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - for (int i = 0; i < list.size(); i++) { - CreditJudgmentDebtorImportParam param = list.get(i); - try { - CreditJudgmentDebtor item = convertImportParamToEntity(param); - String link = null; - if (!ImportHelper.isBlank(item.getCaseNumber())) { - link = urlByCaseNumber.get(item.getCaseNumber().trim()); - } - if ((link == null || link.isEmpty()) && !ImportHelper.isBlank(item.getName())) { - link = urlByName.get(item.getName().trim()); - } - if ((link == null || link.isEmpty()) && !ImportHelper.isBlank(item.getName1())) { - link = urlByName1.get(item.getName1().trim()); - } - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add(prefix + "第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += persistImportChunk(chunkItems, chunkRowNumbers, prefix, mpBatchSize, errorMessages); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add(prefix + "第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - if (!chunkItems.isEmpty()) { - successCount += persistImportChunk(chunkItems, chunkRowNumbers, prefix, mpBatchSize, errorMessages); - } - return new ImportOutcome(true, successCount, errorMessages, touchedCompanyIds); - } - - private ImportOutcome importHistoryFromExcel(MultipartFile excelFile, String fileLabel, Integer currentUserId, Integer currentTenantId, Integer companyId) throws Exception { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - int historySheetIndex = ExcelImportSupport.findSheetIndex(excelFile, "历史被执行人"); - if (historySheetIndex < 0) { - return new ImportOutcome(false, 0, errorMessages, touchedCompanyIds); - } - - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.readBest( - excelFile, - CreditJudgmentDebtorImportParam.class, - this::isEmptyImportRow, - this::isScoreImportRow, - historySheetIndex - ); - - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return new ImportOutcome(false, 0, errorMessages, touchedCompanyIds); - } - - Map urlByCaseNumber = ExcelImportSupport.readHyperlinksByHeaderKey(excelFile, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - Map urlByName = ExcelImportSupport.readHyperlinksByHeaderKey(excelFile, usedSheetIndex, usedTitleRows, usedHeadRows, "被执行人名称"); - Map urlByName1 = ExcelImportSupport.readHyperlinksByHeaderKey(excelFile, usedSheetIndex, usedTitleRows, usedHeadRows, "被执行人"); - - String prefix = ImportHelper.isBlank(fileLabel) ? "" : "【" + fileLabel + "】"; - - // 同案号多条:以导入文件中“最后一条”为准(视为最新),避免批处理中重复 upsert。 - LinkedHashMap latestByCaseNumber = new LinkedHashMap<>(); - LinkedHashMap latestRowByCaseNumber = new LinkedHashMap<>(); - - for (int i = 0; i < list.size(); i++) { - CreditJudgmentDebtorImportParam param = list.get(i); - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - try { - CreditJudgmentDebtor item = convertImportParamToEntity(param); - - if (item.getCaseNumber() != null) { - item.setCaseNumber(item.getCaseNumber().trim()); - } - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add(prefix + "第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - String link = urlByCaseNumber.get(item.getCaseNumber()); - if ((link == null || link.isEmpty()) && !ImportHelper.isBlank(item.getName())) { - link = urlByName.get(item.getName().trim()); - } - if ((link == null || link.isEmpty()) && !ImportHelper.isBlank(item.getName1())) { - link = urlByName1.get(item.getName1().trim()); - } - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - // 历史导入的数据统一标记为“失效” - item.setDataStatus("失效"); - - latestByCaseNumber.put(item.getCaseNumber(), item); - latestRowByCaseNumber.put(item.getCaseNumber(), excelRowNumber); - } catch (Exception e) { - errorMessages.add(prefix + "第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (latestByCaseNumber.isEmpty()) { - return new ImportOutcome(true, 0, errorMessages, touchedCompanyIds); - } - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (Map.Entry entry : latestByCaseNumber.entrySet()) { - String caseNumber = entry.getKey(); - CreditJudgmentDebtor item = entry.getValue(); - Integer rowNo = latestRowByCaseNumber.get(caseNumber); - chunkItems.add(item); - chunkRowNumbers.add(rowNo != null ? rowNo : -1); - if (chunkItems.size() >= chunkSize) { - successCount += persistHistoryImportChunk(chunkItems, chunkRowNumbers, prefix, mpBatchSize, errorMessages); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } - if (!chunkItems.isEmpty()) { - successCount += persistHistoryImportChunk(chunkItems, chunkRowNumbers, prefix, mpBatchSize, errorMessages); - } - - return new ImportOutcome(true, successCount, errorMessages, touchedCompanyIds); - } - - private int persistHistoryImportChunk(List items, - List excelRowNumbers, - String prefix, - int mpBatchSize, - List errorMessages) { - if (CollectionUtils.isEmpty(items)) { - return 0; - } - - try { - return batchImportSupport.runInNewTx(() -> { - List keys = new ArrayList<>(items.size()); - for (CreditJudgmentDebtor item : items) { - if (item == null || ImportHelper.isBlank(item.getCaseNumber())) { - continue; - } - keys.add(item.getCaseNumber().trim()); - } - - Map existingByCaseNumber = new java.util.HashMap<>(); - if (!keys.isEmpty()) { - List existingList = creditJudgmentDebtorService.lambdaQuery() - .in(CreditJudgmentDebtor::getCaseNumber, keys) - .select(CreditJudgmentDebtor::getId, CreditJudgmentDebtor::getCaseNumber, CreditJudgmentDebtor::getRecommend) - .list(); - for (CreditJudgmentDebtor existing : existingList) { - if (existing == null || ImportHelper.isBlank(existing.getCaseNumber())) { - continue; - } - existingByCaseNumber.putIfAbsent(existing.getCaseNumber().trim(), existing); - } - } - - List updates = new ArrayList<>(); - List inserts = new ArrayList<>(); - for (CreditJudgmentDebtor item : items) { - if (item == null || ImportHelper.isBlank(item.getCaseNumber())) { - continue; - } - String caseNumber = item.getCaseNumber().trim(); - CreditJudgmentDebtor existing = existingByCaseNumber.get(caseNumber); - if (existing != null && existing.getId() != null) { - // 覆盖更新:recommend 记录“被更新次数”,每次更新 +1 - item.setId(existing.getId()); - Integer old = existing.getRecommend(); - item.setRecommend(old == null ? 1 : old + 1); - updates.add(item); - } else { - if (item.getRecommend() == null) { - item.setRecommend(0); - } - inserts.add(item); - } - } - - if (!updates.isEmpty()) { - creditJudgmentDebtorService.updateBatchById(updates, mpBatchSize); - } - if (!inserts.isEmpty()) { - creditJudgmentDebtorService.saveBatch(inserts, mpBatchSize); - } - return updates.size() + inserts.size(); - }); - } catch (Exception batchException) { - int successCount = 0; - for (int i = 0; i < items.size(); i++) { - CreditJudgmentDebtor item = items.get(i); - int excelRowNumber = (excelRowNumbers != null && i < excelRowNumbers.size()) ? excelRowNumbers.get(i) : -1; - try { - int delta = batchImportSupport.runInNewTx(() -> { - if (item == null || ImportHelper.isBlank(item.getCaseNumber())) { - return 0; - } - String caseNumber = item.getCaseNumber().trim(); - CreditJudgmentDebtor existing = creditJudgmentDebtorService.lambdaQuery() - .eq(CreditJudgmentDebtor::getCaseNumber, caseNumber) - .select(CreditJudgmentDebtor::getId, CreditJudgmentDebtor::getRecommend) - .one(); - if (existing != null && existing.getId() != null) { - item.setId(existing.getId()); - Integer old = existing.getRecommend(); - item.setRecommend(old == null ? 1 : old + 1); - return creditJudgmentDebtorService.updateById(item) ? 1 : 0; - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - return creditJudgmentDebtorService.save(item) ? 1 : 0; - }); - if (delta > 0) { - successCount += delta; - } else { - errorMessages.add(prefix + "第" + excelRowNumber + "行:保存失败"); - } - } catch (Exception e) { - errorMessages.add(prefix + "第" + excelRowNumber + "行:" + e.getMessage()); - } - } - return successCount; - } - } - - private int persistImportChunk(List items, - List excelRowNumbers, - String prefix, - int mpBatchSize, - List errorMessages) { - if (CollectionUtils.isEmpty(items)) { - return 0; - } - try { - return batchImportSupport.runInNewTx(() -> batchImportSupport.upsertBySingleKey( - creditJudgmentDebtorService, - items, - CreditJudgmentDebtor::getId, - CreditJudgmentDebtor::setId, - CreditJudgmentDebtor::getCaseNumber, - CreditJudgmentDebtor::getCaseNumber, - null, - mpBatchSize - )); - } catch (Exception batchException) { - int successCount = 0; - for (int i = 0; i < items.size(); i++) { - CreditJudgmentDebtor item = items.get(i); - int excelRowNumber = (excelRowNumbers != null && i < excelRowNumbers.size()) ? excelRowNumbers.get(i) : -1; - try { - int delta = batchImportSupport.runInNewTx(() -> { - boolean saved = creditJudgmentDebtorService.save(item); - if (!saved) { - CreditJudgmentDebtor existing = creditJudgmentDebtorService.lambdaQuery() - .eq(CreditJudgmentDebtor::getCaseNumber, item.getCaseNumber()) - .one(); - if (existing != null) { - item.setId(existing.getId()); - if (creditJudgmentDebtorService.updateById(item)) { - return 1; - } - } - } else { - return 1; - } - return 0; - }); - if (delta > 0) { - successCount += delta; - } else { - errorMessages.add(prefix + "第" + excelRowNumber + "行:保存失败"); - } - } catch (Exception e) { - errorMessages.add(prefix + "第" + excelRowNumber + "行:" + e.getMessage()); - } - } - return successCount; - } - } - - private ImportOutcome importFromZip(MultipartFile zipFile, Integer currentUserId, Integer currentTenantId, Integer companyId) throws Exception { - try { - return importFromZip(zipFile, currentUserId, currentTenantId, companyId, StandardCharsets.UTF_8); - } catch (IllegalArgumentException e) { - return importFromZip(zipFile, currentUserId, currentTenantId, companyId, Charset.forName("GBK")); - } - } - - private ImportOutcome importFromZip(MultipartFile zipFile, Integer currentUserId, Integer currentTenantId, Integer companyId, Charset charset) throws Exception { - List errorMessages = new ArrayList<>(); - int successCount = 0; - boolean anyDataRead = false; - Set touchedCompanyIds = new HashSet<>(); - - try (InputStream is = zipFile.getInputStream(); ZipInputStream zis = new ZipInputStream(is, charset)) { - ZipEntry entry; - while ((entry = zis.getNextEntry()) != null) { - if (entry.isDirectory()) { - continue; - } - String entryName = entry.getName(); - if (!isExcelFileName(entryName)) { - continue; - } - - byte[] bytes = readAllBytes(zis); - String entryFileName = safeFileLabel(entryName); - MultipartFile excelFile = new InMemoryMultipartFile(entryFileName, bytes); - - try { - ImportOutcome outcome = importFromExcel(excelFile, entryFileName, currentUserId, currentTenantId, companyId, true); - if (outcome.anyDataRead) { - anyDataRead = true; - successCount += outcome.successCount; - errorMessages.addAll(outcome.errorMessages); - touchedCompanyIds.addAll(outcome.touchedCompanyIds); - } - } catch (Exception e) { - errorMessages.add("【" + entryFileName + "】解析失败:" + e.getMessage()); - } - } - } - return new ImportOutcome(anyDataRead, successCount, errorMessages, touchedCompanyIds); - } - - private ImportOutcome importHistoryFromZip(MultipartFile zipFile, Integer currentUserId, Integer currentTenantId, Integer companyId) throws Exception { - try { - return importHistoryFromZip(zipFile, currentUserId, currentTenantId, companyId, StandardCharsets.UTF_8); - } catch (IllegalArgumentException e) { - return importHistoryFromZip(zipFile, currentUserId, currentTenantId, companyId, Charset.forName("GBK")); - } - } - - private ImportOutcome importHistoryFromZip(MultipartFile zipFile, Integer currentUserId, Integer currentTenantId, Integer companyId, Charset charset) throws Exception { - List errorMessages = new ArrayList<>(); - int successCount = 0; - boolean anyDataRead = false; - Set touchedCompanyIds = new HashSet<>(); - - try (InputStream is = zipFile.getInputStream(); ZipInputStream zis = new ZipInputStream(is, charset)) { - ZipEntry entry; - while ((entry = zis.getNextEntry()) != null) { - if (entry.isDirectory()) { - continue; - } - String entryName = entry.getName(); - if (!isExcelFileName(entryName)) { - continue; - } - - byte[] bytes = readAllBytes(zis); - String entryFileName = safeFileLabel(entryName); - MultipartFile excelFile = new InMemoryMultipartFile(entryFileName, bytes); - - try { - ImportOutcome outcome = importHistoryFromExcel(excelFile, entryFileName, currentUserId, currentTenantId, companyId); - if (outcome.anyDataRead) { - anyDataRead = true; - successCount += outcome.successCount; - errorMessages.addAll(outcome.errorMessages); - touchedCompanyIds.addAll(outcome.touchedCompanyIds); - } - } catch (Exception e) { - errorMessages.add("【" + entryFileName + "】解析失败:" + e.getMessage()); - } - } - } - return new ImportOutcome(anyDataRead, successCount, errorMessages, touchedCompanyIds); - } - - private static boolean isZip(MultipartFile file) { - String filename = file != null ? file.getOriginalFilename() : null; - if (filename == null) { - return false; - } - return filename.toLowerCase(Locale.ROOT).endsWith(".zip"); - } - - private ExcelImportSupport.ImportResult readDebtorImport(MultipartFile excelFile, boolean strictDebtorSheet) throws Exception { - List debtorSheetIndices = findDebtorSheetIndices(excelFile); - for (Integer sheetIndex : debtorSheetIndices) { - ExcelImportSupport.ImportResult sheetResult = ExcelImportSupport.readBest( - excelFile, - CreditJudgmentDebtorImportParam.class, - this::isEmptyImportRow, - this::isScoreImportRow, - sheetIndex - ); - if (!CollectionUtils.isEmpty(sheetResult.getData())) { - return sheetResult; - } - } - if (strictDebtorSheet) { - return new ExcelImportSupport.ImportResult<>(new ArrayList<>(), 0, 0); - } - return ExcelImportSupport.readAnySheetBest(excelFile, CreditJudgmentDebtorImportParam.class, this::isEmptyImportRow, this::isScoreImportRow); - } - - private boolean isScoreImportRow(CreditJudgmentDebtorImportParam param) { - if (param == null) { - return false; - } - if (isImportHeaderRow(param)) { - return false; - } - return !ImportHelper.isBlank(param.getCaseNumber()); - } - - private List findDebtorSheetIndices(MultipartFile excelFile) throws Exception { - // Prefer an explicitly-named "被执行人" sheet when present. - List preferred = new ArrayList<>(); - List indices = new ArrayList<>(); - try (InputStream is = excelFile.getInputStream(); Workbook workbook = WorkbookFactory.create(is)) { - int sheetCount = workbook.getNumberOfSheets(); - for (int i = 0; i < sheetCount; i++) { - String sheetName = workbook.getSheetName(i); - if (!isDebtorSheetName(sheetName)) { - continue; - } - String normalized = normalizeSheetName(sheetName); - if ("被执行人".equals(normalized)) { - preferred.add(i); - } else { - indices.add(i); - } - } - } - preferred.addAll(indices); - return preferred; - } - - private static boolean isDebtorSheetName(String sheetName) { - if (sheetName == null) { - return false; - } - String normalized = normalizeSheetName(sheetName); - return normalized.contains("被执行人") && !normalized.contains("失信") && !normalized.contains("历史"); - } - - private static String normalizeSheetName(String sheetName) { - if (sheetName == null) { - return ""; - } - return sheetName.replace(" ", "").replace(" ", "").trim(); - } - - private static boolean isExcelFileName(String name) { - if (name == null) { - return false; - } - String lower = name.toLowerCase(Locale.ROOT); - return lower.endsWith(".xlsx") || lower.endsWith(".xls") || lower.endsWith(".xlsm"); - } - - private static String safeFileLabel(String name) { - if (ImportHelper.isBlank(name)) { - return ""; - } - int lastSlash = name.lastIndexOf('/'); - if (lastSlash >= 0 && lastSlash + 1 < name.length()) { - return name.substring(lastSlash + 1); - } - return name; - } - - private static byte[] readAllBytes(InputStream inputStream) throws IOException { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - byte[] buffer = new byte[8192]; - int read; - while ((read = inputStream.read(buffer)) != -1) { - out.write(buffer, 0, read); - } - return out.toByteArray(); - } - - private static class InMemoryMultipartFile implements MultipartFile { - private final String originalFilename; - private final byte[] bytes; - - private InMemoryMultipartFile(String originalFilename, byte[] bytes) { - this.originalFilename = originalFilename; - this.bytes = bytes != null ? bytes : new byte[0]; - } - - @Override - public String getName() { - return originalFilename; - } - - @Override - public String getOriginalFilename() { - return originalFilename; - } - - @Override - public String getContentType() { - return null; - } - - @Override - public boolean isEmpty() { - return bytes.length == 0; - } - - @Override - public long getSize() { - return bytes.length; - } - - @Override - public byte[] getBytes() { - return bytes; - } - - @Override - public InputStream getInputStream() { - return new java.io.ByteArrayInputStream(bytes); - } - - @Override - public void transferTo(java.io.File dest) throws IOException { - Files.write(dest.toPath(), bytes); - } - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditJudicialDocumentController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditJudicialDocumentController.java deleted file mode 100644 index 2b62709..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditJudicialDocumentController.java +++ /dev/null @@ -1,640 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditJudicialDocument; -import com.gxwebsoft.credit.param.CreditJudicialDocumentImportParam; -import com.gxwebsoft.credit.param.CreditJudicialDocumentParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditJudicialDocumentService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 裁判文书司法大数据控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:03 - */ -@Tag(name = "裁判文书司法大数据管理") -@RestController -@RequestMapping("/api/credit/credit-judicial-document") -public class CreditJudicialDocumentController extends BaseController { - @Resource - private CreditJudicialDocumentService creditJudicialDocumentService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询裁判文书司法大数据") - @GetMapping("/page") - public ApiResult> page(CreditJudicialDocumentParam param) { - // 使用关联查询 - return success(creditJudicialDocumentService.pageRel(param)); - } - - @Operation(summary = "查询全部裁判文书司法大数据") - @GetMapping() - public ApiResult> list(CreditJudicialDocumentParam param) { - // 使用关联查询 - return success(creditJudicialDocumentService.listRel(param)); - } - - @Operation(summary = "根据id查询裁判文书司法大数据") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditJudicialDocumentService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditJudicialDocument:save')") - @OperationLog - @Operation(summary = "添加裁判文书司法大数据") - @PostMapping() - public ApiResult save(@RequestBody CreditJudicialDocument creditJudicialDocument) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditJudicialDocument.setUserId(loginUser.getUserId()); - // } - if (creditJudicialDocumentService.save(creditJudicialDocument)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudicialDocument:update')") - @OperationLog - @Operation(summary = "修改裁判文书司法大数据") - @PutMapping() - public ApiResult update(@RequestBody CreditJudicialDocument creditJudicialDocument) { - if (creditJudicialDocumentService.updateById(creditJudicialDocument)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudicialDocument:remove')") - @OperationLog - @Operation(summary = "删除裁判文书司法大数据") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditJudicialDocumentService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudicialDocument:save')") - @OperationLog - @Operation(summary = "批量添加裁判文书司法大数据") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditJudicialDocumentService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudicialDocument:update')") - @OperationLog - @Operation(summary = "批量修改裁判文书司法大数据") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditJudicialDocumentService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudicialDocument:remove')") - @OperationLog - @Operation(summary = "批量删除裁判文书司法大数据") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditJudicialDocumentService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditJudicialDocument:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditJudicialDocumentService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditJudicialDocument::getId, - CreditJudicialDocument::setId, - CreditJudicialDocument::getAppellee, - CreditJudicialDocument::getCompanyId, - CreditJudicialDocument::setCompanyId, - CreditJudicialDocument::getHasData, - CreditJudicialDocument::setHasData, - CreditJudicialDocument::getTenantId, - CreditJudicialDocument::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入裁判文书司法大数据 - */ - @PreAuthorize("hasAuthority('credit:creditJudicialDocument:save')") - @Operation(summary = "批量导入裁判文书司法大数据") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - // 支持按选项卡名称导入:默认读取“裁判文书”sheet(不存在则回退到第 0 个sheet) - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "裁判文书", 0); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditJudicialDocumentImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCaseNumber = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - Map urlByTitle = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "文书标题"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditJudicialDocumentImportParam param = list.get(i); - try { - CreditJudicialDocument item = convertImportParamToEntity(param); - String link = null; - if (!ImportHelper.isBlank(item.getCaseNumber())) { - link = urlByCaseNumber.get(item.getCaseNumber().trim()); - } - if (ImportHelper.isBlank(link) && !ImportHelper.isBlank(item.getTitle())) { - link = urlByTitle.get(item.getTitle().trim()); - } - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditJudicialDocumentService, - chunkItems, - CreditJudicialDocument::getId, - CreditJudicialDocument::setId, - CreditJudicialDocument::getCaseNumber, - CreditJudicialDocument::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditJudicialDocumentService.save(rowItem); - if (!saved) { - CreditJudicialDocument existing = creditJudicialDocumentService.lambdaQuery() - .eq(CreditJudicialDocument::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditJudicialDocumentService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditJudicialDocumentService, - chunkItems, - CreditJudicialDocument::getId, - CreditJudicialDocument::setId, - CreditJudicialDocument::getCaseNumber, - CreditJudicialDocument::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditJudicialDocumentService.save(rowItem); - if (!saved) { - CreditJudicialDocument existing = creditJudicialDocumentService.lambdaQuery() - .eq(CreditJudicialDocument::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditJudicialDocumentService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.JUDICIAL_DOCUMENT, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 批量导入历史裁判文书(仅解析“历史裁判文书”选项卡) - * 规则:案号相同则覆盖更新(recommend++ 记录更新次数);案号不存在则插入。 - */ - @PreAuthorize("hasAuthority('credit:creditJudicialDocument:save')") - @Operation(summary = "批量导入历史裁判文书司法大数据") - @PostMapping("/import/history") - public ApiResult> importHistoryBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "历史裁判文书"); - if (sheetIndex < 0) { - return fail("未读取到数据,请确认文件中存在“历史裁判文书”选项卡且表头与示例格式一致", null); - } - - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditJudicialDocumentImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCaseNumber = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - Map urlByTitle = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "文书标题"); - - LinkedHashMap latestByCaseNumber = new LinkedHashMap<>(); - LinkedHashMap latestRowByCaseNumber = new LinkedHashMap<>(); - - for (int i = 0; i < list.size(); i++) { - CreditJudicialDocumentImportParam param = list.get(i); - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - try { - CreditJudicialDocument item = convertImportParamToEntity(param); - if (item.getCaseNumber() != null) { - item.setCaseNumber(item.getCaseNumber().trim()); - } - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - String link = null; - if (!ImportHelper.isBlank(item.getCaseNumber())) { - link = urlByCaseNumber.get(item.getCaseNumber()); - } - if (ImportHelper.isBlank(link) && !ImportHelper.isBlank(item.getTitle())) { - link = urlByTitle.get(item.getTitle().trim()); - } - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - // 历史导入的数据统一标记为“失效” - item.setDataStatus("失效"); - - latestByCaseNumber.put(item.getCaseNumber(), item); - latestRowByCaseNumber.put(item.getCaseNumber(), excelRowNumber); - } catch (Exception e) { - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (latestByCaseNumber.isEmpty()) { - if (errorMessages.isEmpty()) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - return success("导入完成,成功0条,失败" + errorMessages.size() + "条", errorMessages); - } - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (Map.Entry entry : latestByCaseNumber.entrySet()) { - String caseNumber = entry.getKey(); - CreditJudicialDocument item = entry.getValue(); - Integer rowNo = latestRowByCaseNumber.get(caseNumber); - chunkItems.add(item); - chunkRowNumbers.add(rowNo != null ? rowNo : -1); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditJudicialDocumentService, - chunkItems, - CreditJudicialDocument::getId, - CreditJudicialDocument::setId, - CreditJudicialDocument::getCaseNumber, - CreditJudicialDocument::getCaseNumber, - CreditJudicialDocument::getRecommend, - CreditJudicialDocument::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditJudicialDocumentService.save(rowItem); - if (!saved) { - CreditJudicialDocument existing = creditJudicialDocumentService.lambdaQuery() - .eq(CreditJudicialDocument::getCaseNumber, rowItem.getCaseNumber()) - .select(CreditJudicialDocument::getId, CreditJudicialDocument::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditJudicialDocumentService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditJudicialDocumentService, - chunkItems, - CreditJudicialDocument::getId, - CreditJudicialDocument::setId, - CreditJudicialDocument::getCaseNumber, - CreditJudicialDocument::getCaseNumber, - CreditJudicialDocument::getRecommend, - CreditJudicialDocument::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditJudicialDocumentService.save(rowItem); - if (!saved) { - CreditJudicialDocument existing = creditJudicialDocumentService.lambdaQuery() - .eq(CreditJudicialDocument::getCaseNumber, rowItem.getCaseNumber()) - .select(CreditJudicialDocument::getId, CreditJudicialDocument::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditJudicialDocumentService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.JUDICIAL_DOCUMENT, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载裁判文书导入模板 - */ - @Operation(summary = "下载裁判文书导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditJudicialDocumentImportParam example = new CreditJudicialDocumentImportParam(); - example.setTitle("裁判文书"); - example.setOtherPartiesThirdParty("第三人示例"); - example.setOccurrenceTime("2024-01-01"); - example.setCaseNumber("(2024)示例案号"); - example.setCauseOfAction("案由示例"); - example.setInvolvedAmount("100000"); - example.setDefendantAppellee("裁判结果示例"); - example.setCourtName("示例法院"); - example.setReleaseDate("2024-01-02"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("裁判文书导入模板", "裁判文书", CreditJudicialDocumentImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_judicial_document_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditJudicialDocumentImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getCaseNumber()); - } - - private CreditJudicialDocument convertImportParamToEntity(CreditJudicialDocumentImportParam param) { - CreditJudicialDocument entity = new CreditJudicialDocument(); - - String involvedAmount = !ImportHelper.isBlank(param.getInvolvedAmount2()) - ? param.getInvolvedAmount2() - : param.getInvolvedAmount(); - - entity.setTitle(param.getTitle()); - entity.setType(param.getType()); - entity.setDataStatus(param.getDataStatus()); - entity.setOtherPartiesThirdParty(param.getOtherPartiesThirdParty()); - entity.setOccurrenceTime(param.getOccurrenceTime()); - entity.setCaseNumber(param.getCaseNumber()); - entity.setCauseOfAction(param.getCauseOfAction()); - entity.setInvolvedAmount(involvedAmount); - // Excel导入字段映射补全:否则对应数据库字段(defendant_appellee/release_date)会一直为空 - entity.setDefendantAppellee(param.getDefendantAppellee()); - entity.setReleaseDate(param.getReleaseDate()); - entity.setCourtName(param.getCourtName()); - entity.setComments(param.getComments()); - System.out.println("entity = " + entity); - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditJudiciaryController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditJudiciaryController.java deleted file mode 100644 index 51f6ffa..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditJudiciaryController.java +++ /dev/null @@ -1,474 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.ExcelImportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.ImportParams; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditJudiciary; -import com.gxwebsoft.credit.param.CreditJudiciaryImportParam; -import com.gxwebsoft.credit.param.CreditJudiciaryParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditJudiciaryService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 司法案件控制器 - * - * @author 科技小王子 - * @since 2025-12-16 15:23:58 - */ -@Tag(name = "司法案件管理") -@RestController -@RequestMapping("/api/credit/credit-judiciary") -public class CreditJudiciaryController extends BaseController { - @Resource - private CreditJudiciaryService creditJudiciaryService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询司法案件") - @GetMapping("/page") - public ApiResult> page(CreditJudiciaryParam param) { - // 使用关联查询 - return success(creditJudiciaryService.pageRel(param)); - } - - @Operation(summary = "查询全部司法案件") - @GetMapping() - public ApiResult> list(CreditJudiciaryParam param) { - // 使用关联查询 - return success(creditJudiciaryService.listRel(param)); - } - - @Operation(summary = "根据id查询司法案件") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditJudiciaryService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditJudiciary:save')") - @OperationLog - @Operation(summary = "添加司法案件") - @PostMapping() - public ApiResult save(@RequestBody CreditJudiciary creditJudiciary) { - if (creditJudiciaryService.save(creditJudiciary)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudiciary:update')") - @OperationLog - @Operation(summary = "修改司法案件") - @PutMapping() - public ApiResult update(@RequestBody CreditJudiciary creditJudiciary) { - if (creditJudiciaryService.updateById(creditJudiciary)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudiciary:remove')") - @OperationLog - @Operation(summary = "删除司法案件") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditJudiciaryService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudiciary:save')") - @OperationLog - @Operation(summary = "批量添加司法案件") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditJudiciaryService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudiciary:update')") - @OperationLog - @Operation(summary = "批量修改司法案件") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditJudiciaryService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditJudiciary:remove')") - @OperationLog - @Operation(summary = "批量删除司法案件") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditJudiciaryService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditJudiciary:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditJudiciaryService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditJudiciary::getId, - CreditJudiciary::setId, - CreditJudiciary::getName, - CreditJudiciary::getCompanyId, - CreditJudiciary::setCompanyId, - CreditJudiciary::getHasData, - CreditJudiciary::setHasData, - CreditJudiciary::getTenantId, - CreditJudiciary::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入司法案件 - */ - @PreAuthorize("hasAuthority('credit:creditJudiciary:save')") - @Operation(summary = "批量导入司法案件") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - // 支持按选项卡名称导入:默认读取“司法案件”sheet(不存在则回退到第 0 个sheet) - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "司法案件", 0); - - List list = null; - int usedTitleRows = 0; - int usedHeadRows = 0; - int[][] tryConfigs = new int[][]{{1, 1}, {0, 1}, {0, 2}, {0, 3}}; - - for (int[] config : tryConfigs) { - list = filterEmptyRows(tryImport(file, config[0], config[1], sheetIndex)); - if (!CollectionUtils.isEmpty(list)) { - usedTitleRows = config[0]; - usedHeadRows = config[1]; - break; - } - } - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - // easypoi 默认不会读取单元格超链接地址;url 可能挂在“案号/案件名称”等列的超链接中,需要额外读取回填。 - Map urlByCode = ExcelImportSupport.readHyperlinksByHeaderKey(file, sheetIndex, usedTitleRows, usedHeadRows, "案号"); - Map urlByName = ExcelImportSupport.readHyperlinksByHeaderKey(file, sheetIndex, usedTitleRows, usedHeadRows, "案件名称"); - // 有些源文件会单独提供“url/网址/链接”等列(可能是纯文本也可能是超链接) - Map urlByCodeFromUrlCol = ExcelImportSupport.readKeyValueByHeaders(file, sheetIndex, usedTitleRows, usedHeadRows, "案号", "url"); - if (urlByCodeFromUrlCol.isEmpty()) { - urlByCodeFromUrlCol = ExcelImportSupport.readKeyValueByHeaders(file, sheetIndex, usedTitleRows, usedHeadRows, "案号", "URL"); - } - if (urlByCodeFromUrlCol.isEmpty()) { - urlByCodeFromUrlCol = ExcelImportSupport.readKeyValueByHeaders(file, sheetIndex, usedTitleRows, usedHeadRows, "案号", "网址"); - } - if (urlByCodeFromUrlCol.isEmpty()) { - urlByCodeFromUrlCol = ExcelImportSupport.readKeyValueByHeaders(file, sheetIndex, usedTitleRows, usedHeadRows, "案号", "链接"); - } - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditJudiciaryImportParam param = list.get(i); - try { - CreditJudiciary item = convertImportParamToEntity(param); - if (!isBlank(item.getCode())) { - String key = item.getCode().trim(); - String link = urlByCode.get(key); - if (isBlank(link)) { - link = urlByCodeFromUrlCol.get(key); - } - if (!isBlank(link)) { - item.setUrl(link.trim()); - } - } else if (!isBlank(item.getName())) { - String link = urlByName.get(item.getName().trim()); - if (!isBlank(link)) { - item.setUrl(link.trim()); - } - } - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - - // 设置默认值 - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getType() == null) { - item.setType(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - // 验证必填字段 -// if (item.getName() == null || item.getName().trim().isEmpty()) { -// errorMessages.add("第" + excelRowNumber + "行:项目名称不能为空"); -// continue; -// } - if (item.getCode() == null || item.getCode().trim().isEmpty()) { - errorMessages.add("第" + excelRowNumber + "行:唯一标识不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditJudiciaryService, - chunkItems, - CreditJudiciary::getId, - CreditJudiciary::setId, - CreditJudiciary::getName, - CreditJudiciary::getName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditJudiciaryService.save(rowItem); - if (!saved) { - CreditJudiciary existing = creditJudiciaryService.getByName(rowItem.getName()); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditJudiciaryService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - errorMessages.add("第" + rowNumber + "行:保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditJudiciaryService, - chunkItems, - CreditJudiciary::getId, - CreditJudiciary::setId, - CreditJudiciary::getName, - CreditJudiciary::getName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditJudiciaryService.save(rowItem); - if (!saved) { - CreditJudiciary existing = creditJudiciaryService.getByName(rowItem.getName()); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditJudiciaryService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - errorMessages.add("第" + rowNumber + "行:保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.JUDICIARY, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载司法案件导入模板 - */ - @Operation(summary = "下载司法案件导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditJudiciaryImportParam example = new CreditJudiciaryImportParam(); - example.setName("示例客户"); - example.setCode("C0001"); - example.setInfoType("执行案件"); - example.setReason("买卖合同纠纷"); - example.setProcessDate("2025-08-27"); - example.setCaseProgress("首次执行"); - example.setCaseIdentity("被执行人"); - example.setCode("(2025)闽0103执5480号"); - example.setCourt("福建省福州市台江区人民法院"); - example.setCaseAmount("5134060.00"); - templateList.add(example); - - ExportParams exportParams = new ExportParams("司法案件导入模板", "司法案件"); - - Workbook workbook = ExcelExportUtil.exportExcel(exportParams, CreditJudiciaryImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_judiciary_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private List tryImport(MultipartFile file, int titleRows, int headRows, int sheetIndex) throws Exception { - ImportParams importParams = new ImportParams(); - importParams.setTitleRows(titleRows); - importParams.setHeadRows(headRows); - importParams.setStartSheetIndex(sheetIndex); - importParams.setSheetNum(1); - return ExcelImportUtil.importExcel(file.getInputStream(), CreditJudiciaryImportParam.class, importParams); - } - - /** - * 过滤掉完全空白的导入行,避免空行导致导入失败 - */ - private List filterEmptyRows(List rawList) { - if (CollectionUtils.isEmpty(rawList)) { - return rawList; - } - rawList.removeIf(this::isEmptyImportRow); - return rawList; - } - - private boolean isEmptyImportRow(CreditJudiciaryImportParam param) { - if (param == null) { - return true; - } - return isBlank(param.getName()) - && isBlank(param.getCode()) - && isBlank(param.getName()) - && isBlank(param.getInfoType()); - } - - private boolean isBlank(String value) { - return value == null || value.trim().isEmpty(); - } - - /** - * 将CreditJudiciaryImportParam转换为CreditJudiciary实体 - */ - private CreditJudiciary convertImportParamToEntity(CreditJudiciaryImportParam param) { - CreditJudiciary entity = new CreditJudiciary(); - - entity.setCode(param.getCode()); - entity.setName(param.getName()); - entity.setInfoType(param.getInfoType()); - entity.setReason(param.getReason()); - entity.setProcessDate(param.getProcessDate()); - entity.setCaseProgress(param.getCaseProgress()); - entity.setCaseIdentity(param.getCaseIdentity()); - entity.setCourt(param.getCourt()); - entity.setCaseAmount(param.getCaseAmount()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditMediationController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditMediationController.java deleted file mode 100644 index 1f0e25a..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditMediationController.java +++ /dev/null @@ -1,416 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditMediation; -import com.gxwebsoft.credit.param.CreditMediationImportParam; -import com.gxwebsoft.credit.param.CreditMediationParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditMediationService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 诉前调解司法大数据控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:25 - */ -@Tag(name = "诉前调解司法大数据管理") -@RestController -@RequestMapping("/api/credit/credit-mediation") -public class CreditMediationController extends BaseController { - @Resource - private CreditMediationService creditMediationService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询诉前调解司法大数据") - @GetMapping("/page") - public ApiResult> page(CreditMediationParam param) { - // 使用关联查询 - return success(creditMediationService.pageRel(param)); - } - - @Operation(summary = "查询全部诉前调解司法大数据") - @GetMapping() - public ApiResult> list(CreditMediationParam param) { - // 使用关联查询 - return success(creditMediationService.listRel(param)); - } - - @Operation(summary = "根据id查询诉前调解司法大数据") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditMediationService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditMediation:save')") - @OperationLog - @Operation(summary = "添加诉前调解司法大数据") - @PostMapping() - public ApiResult save(@RequestBody CreditMediation creditMediation) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditMediation.setUserId(loginUser.getUserId()); - // } - if (creditMediationService.save(creditMediation)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditMediation:update')") - @OperationLog - @Operation(summary = "修改诉前调解司法大数据") - @PutMapping() - public ApiResult update(@RequestBody CreditMediation creditMediation) { - if (creditMediationService.updateById(creditMediation)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditMediation:remove')") - @OperationLog - @Operation(summary = "删除诉前调解司法大数据") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditMediationService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditMediation:save')") - @OperationLog - @Operation(summary = "批量添加诉前调解司法大数据") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditMediationService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditMediation:update')") - @OperationLog - @Operation(summary = "批量修改诉前调解司法大数据") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditMediationService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditMediation:remove')") - @OperationLog - @Operation(summary = "批量删除诉前调解司法大数据") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditMediationService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditMediation:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditMediationService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditMediation::getId, - CreditMediation::setId, - CreditMediation::getAppellee, - CreditMediation::getCompanyId, - CreditMediation::setCompanyId, - CreditMediation::getHasData, - CreditMediation::setHasData, - CreditMediation::getTenantId, - CreditMediation::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入诉前调解司法大数据 - */ - @PreAuthorize("hasAuthority('credit:creditMediation:save')") - @Operation(summary = "批量导入诉前调解司法大数据") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "诉前调解", 0); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditMediationImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCaseNumber = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditMediationImportParam param = list.get(i); - try { - CreditMediation item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getCaseNumber())) { - String link = urlByCaseNumber.get(item.getCaseNumber().trim()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditMediationService, - chunkItems, - CreditMediation::getId, - CreditMediation::setId, - CreditMediation::getCaseNumber, - CreditMediation::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditMediationService.save(rowItem); - if (!saved) { - CreditMediation existing = creditMediationService.lambdaQuery() - .eq(CreditMediation::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditMediationService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditMediationService, - chunkItems, - CreditMediation::getId, - CreditMediation::setId, - CreditMediation::getCaseNumber, - CreditMediation::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditMediationService.save(rowItem); - if (!saved) { - CreditMediation existing = creditMediationService.lambdaQuery() - .eq(CreditMediation::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditMediationService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.MEDIATION, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载诉前调解导入模板 - */ - @Operation(summary = "下载诉前调解导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditMediationImportParam example = new CreditMediationImportParam(); - example.setOtherPartiesThirdParty("当事人"); - example.setCaseNumber("(2024)示例案号"); - example.setCauseOfAction("案由示例"); - example.setCourtName("示例法院"); - example.setOccurrenceTime("2024-01-01"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("诉前调解导入模板", "诉前调解", CreditMediationImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_mediation_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditMediationImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getCaseNumber()) - && ImportHelper.isBlank(param.getCauseOfAction()); - } - - private CreditMediation convertImportParamToEntity(CreditMediationImportParam param) { - CreditMediation entity = new CreditMediation(); - - // Template compatibility: prefer new columns ("发生时间"/"其他当事人/第三人"), fallback to legacy ones ("立案日期"/"当事人"). - String occurrenceTime = !ImportHelper.isBlank(param.getOccurrenceTime2()) - ? param.getOccurrenceTime2() - : param.getOccurrenceTime(); - String otherPartiesThirdParty = !ImportHelper.isBlank(param.getOtherPartiesThirdParty2()) - ? param.getOtherPartiesThirdParty2() - : param.getOtherPartiesThirdParty(); - - entity.setOccurrenceTime(occurrenceTime); - entity.setOtherPartiesThirdParty(otherPartiesThirdParty); - entity.setCaseNumber(param.getCaseNumber()); - entity.setCauseOfAction(param.getCauseOfAction()); - entity.setCourtName(param.getCourtName()); - entity.setComments(param.getComments()); - entity.setPlaintiffAppellant(param.getPlaintiffAppellant()); - entity.setAppellee(param.getAppellee()); - entity.setInvolvedAmount(param.getInvolvedAmount()); - entity.setDataStatus(param.getDataStatus()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditNearbyCompanyController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditNearbyCompanyController.java deleted file mode 100644 index 8a2ba1a..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditNearbyCompanyController.java +++ /dev/null @@ -1,475 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditNearbyCompany; -import com.gxwebsoft.credit.param.CreditNearbyCompanyImportParam; -import com.gxwebsoft.credit.param.CreditNearbyCompanyParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditNearbyCompanyService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 附近企业控制器 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Tag(name = "附近企业管理") -@RestController -@RequestMapping("/api/credit/credit-nearby-company") -public class CreditNearbyCompanyController extends BaseController { - @Resource - private CreditNearbyCompanyService creditNearbyCompanyService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询附近企业") - @GetMapping("/page") - public ApiResult> page(CreditNearbyCompanyParam param) { - // 使用关联查询 - return success(creditNearbyCompanyService.pageRel(param)); - } - - @Operation(summary = "查询全部附近企业") - @GetMapping() - public ApiResult> list(CreditNearbyCompanyParam param) { - // 使用关联查询 - return success(creditNearbyCompanyService.listRel(param)); - } - - @Operation(summary = "根据id查询附近企业") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditNearbyCompanyService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditNearbyCompany:save')") - @OperationLog - @Operation(summary = "添加附近企业") - @PostMapping() - public ApiResult save(@RequestBody CreditNearbyCompany creditNearbyCompany) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditNearbyCompany.setUserId(loginUser.getUserId()); - // } - if (creditNearbyCompanyService.save(creditNearbyCompany)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditNearbyCompany:update')") - @OperationLog - @Operation(summary = "修改附近企业") - @PutMapping() - public ApiResult update(@RequestBody CreditNearbyCompany creditNearbyCompany) { - if (creditNearbyCompanyService.updateById(creditNearbyCompany)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditNearbyCompany:remove')") - @OperationLog - @Operation(summary = "删除附近企业") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditNearbyCompanyService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditNearbyCompany:save')") - @OperationLog - @Operation(summary = "批量添加附近企业") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditNearbyCompanyService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditNearbyCompany:update')") - @OperationLog - @Operation(summary = "批量修改附近企业") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditNearbyCompanyService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditNearbyCompany:remove')") - @OperationLog - @Operation(summary = "批量删除附近企业") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditNearbyCompanyService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditNearbyCompany:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditNearbyCompanyService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditNearbyCompany::getId, - CreditNearbyCompany::setId, - CreditNearbyCompany::getName, - CreditNearbyCompany::getCompanyId, - CreditNearbyCompany::setCompanyId, - CreditNearbyCompany::getHasData, - CreditNearbyCompany::setHasData, - CreditNearbyCompany::getTenantId, - CreditNearbyCompany::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入附近企业 - */ - @PreAuthorize("hasAuthority('credit:creditNearbyCompany:save')") - @Operation(summary = "批量导入附近企业") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId, - @RequestParam(value = "parentId", required = false) Integer parentId, - @RequestParam(value = "type", required = false) Integer type) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.readAnySheet( - file, CreditNearbyCompanyImportParam.class, this::isEmptyImportRow); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCode = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "统一社会信用代码"); - Map urlByName = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "企业名称"); - - // 避免逐行写库:按批处理,显著降低 SQL 次数与事务开销 - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditNearbyCompanyImportParam param = list.get(i); - try { - CreditNearbyCompany item = convertImportParamToEntity(param); - String link = null; - if (!ImportHelper.isBlank(item.getCode())) { - link = urlByCode.get(item.getCode().trim()); - } - if ((link == null || link.isEmpty()) && !ImportHelper.isBlank(item.getName())) { - link = urlByName.get(item.getName().trim()); - } - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - - if (item.getParentId() == null && parentId != null) { - item.setParentId(parentId); - } - if (item.getType() == null && type != null) { - item.setType(type); - } - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getName())) { - errorMessages.add("第" + excelRowNumber + "行:企业名称不能为空"); - continue; - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += persistImportChunk(chunkItems, chunkRowNumbers, companyId, parentId, type, currentTenantId, mpBatchSize, errorMessages); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += persistImportChunk(chunkItems, chunkRowNumbers, companyId, parentId, type, currentTenantId, mpBatchSize, errorMessages); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.NEARBY_COMPANY, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - private int persistImportChunk(List items, - List excelRowNumbers, - Integer companyId, - Integer parentId, - Integer type, - Integer tenantId, - int mpBatchSize, - List errorMessages) { - return batchImportSupport.persistChunkWithFallback( - items, - excelRowNumbers, - () -> batchImportSupport.upsertByCodeOrName( - creditNearbyCompanyService, - items, - CreditNearbyCompany::getId, - CreditNearbyCompany::setId, - CreditNearbyCompany::getCode, - CreditNearbyCompany::getCode, - CreditNearbyCompany::getName, - CreditNearbyCompany::getName, - wrapper -> { - if (companyId != null) { - wrapper.eq(CreditNearbyCompany::getCompanyId, companyId); - } - if (parentId != null) { - wrapper.eq(CreditNearbyCompany::getParentId, parentId); - } - if (type != null) { - wrapper.eq(CreditNearbyCompany::getType, type); - } - if (tenantId != null) { - wrapper.eq(CreditNearbyCompany::getTenantId, tenantId); - } - }, - mpBatchSize - ), - (item, excelRowNumber) -> { - boolean saved = creditNearbyCompanyService.save(item); - if (!saved) { - CreditNearbyCompany existing = creditNearbyCompanyService.lambdaQuery() - .eq(!ImportHelper.isBlank(item.getCode()), CreditNearbyCompany::getCode, item.getCode()) - .eq(ImportHelper.isBlank(item.getCode()), CreditNearbyCompany::getName, item.getName()) - .eq(item.getCompanyId() != null, CreditNearbyCompany::getCompanyId, item.getCompanyId()) - .eq(item.getParentId() != null, CreditNearbyCompany::getParentId, item.getParentId()) - .eq(item.getType() != null, CreditNearbyCompany::getType, item.getType()) - .eq(item.getTenantId() != null, CreditNearbyCompany::getTenantId, item.getTenantId()) - .one(); - if (existing != null) { - item.setId(existing.getId()); - if (creditNearbyCompanyService.updateById(item)) { - return true; - } - } - } else { - return true; - } - String prefix = excelRowNumber > 0 ? ("第" + excelRowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - /** - * 下载附近企业导入模板 - */ - @Operation(summary = "下载附近企业导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditNearbyCompanyImportParam example = new CreditNearbyCompanyImportParam(); - example.setName("示例科技有限公司"); - example.setRegistrationStatus("存续"); - example.setLegalPerson("李四"); - example.setRegisteredCapital("1000万人民币"); - example.setPaidinCapital("200万人民币"); - example.setEstablishDate("2018-06-01"); - example.setCode("91440101MA5XXXXXXX"); - example.setAddress("广西南宁市某某路1号"); - example.setPhone("13800000000"); - example.setEmail("demo@example.com"); - example.setProvince("广西"); - example.setCity("南宁"); - example.setRegion("青秀区"); - example.setDomain("https://example.com"); - example.setInstitutionType("有限责任公司"); - example.setCompanySize("小微企业"); - example.setRegistrationAuthority("南宁市市场监督管理局"); - example.setTaxpayerQualification("一般纳税人"); - example.setLatestAnnualReportYear("2023"); - example.setLatestAnnualReportOnOperatingRevenue("1000万"); - example.setEnterpriseScoreCheck("85"); - example.setCreditRating("A级"); - example.setCechnologyScore("70"); - example.setCechnologyLevel("良好"); - example.setSmallEnterprise("是"); - example.setCompanyProfile("企业简介示例"); - example.setNatureOfBusiness("经营范围示例"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("附近企业导入模板", "附近企业", CreditNearbyCompanyImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_nearby_company_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditNearbyCompanyImportParam param) { - if (param == null) { - return true; - } - if (isImportHeaderRow(param)) { - return true; - } - return ImportHelper.isBlank(param.getName()) - && ImportHelper.isBlank(param.getCode()) - && ImportHelper.isBlank(param.getLegalPerson()); - } - - private boolean isImportHeaderRow(CreditNearbyCompanyImportParam param) { - return isHeaderValue(param.getName(), "企业名称") - || isHeaderValue(param.getCode(), "统一社会信用代码") - || isHeaderValue(param.getLegalPerson(), "法定代表人"); - } - - private static boolean isHeaderValue(String value, String headerText) { - if (value == null) { - return false; - } - return headerText.equals(value.trim()); - } - - private CreditNearbyCompany convertImportParamToEntity(CreditNearbyCompanyImportParam param) { - CreditNearbyCompany entity = new CreditNearbyCompany(); - - entity.setName(param.getName()); - entity.setRegistrationStatus(param.getRegistrationStatus()); - entity.setLegalPerson(param.getLegalPerson()); - entity.setRegisteredCapital(param.getRegisteredCapital()); - entity.setPaidinCapital(param.getPaidinCapital()); - entity.setEstablishDate(param.getEstablishDate()); - entity.setCode(param.getCode()); - entity.setAddress(param.getAddress()); - entity.setPhone(param.getPhone()); - entity.setEmail(param.getEmail()); - entity.setProvince(param.getProvince()); - entity.setCity(param.getCity()); - entity.setRegion(param.getRegion()); - entity.setDomain(param.getDomain()); - entity.setInstitutionType(param.getInstitutionType()); - entity.setCompanySize(param.getCompanySize()); - entity.setRegistrationAuthority(param.getRegistrationAuthority()); - entity.setTaxpayerQualification(param.getTaxpayerQualification()); - entity.setLatestAnnualReportYear(param.getLatestAnnualReportYear()); - entity.setLatestAnnualReportOnOperatingRevenue(param.getLatestAnnualReportOnOperatingRevenue()); - entity.setEnterpriseScoreCheck(param.getEnterpriseScoreCheck()); - entity.setCreditRating(param.getCreditRating()); - entity.setCechnologyScore(param.getCechnologyScore()); - entity.setCechnologyLevel(param.getCechnologyLevel()); - entity.setSmallEnterprise(param.getSmallEnterprise()); - entity.setCompanyProfile(param.getCompanyProfile()); - entity.setNatureOfBusiness(param.getNatureOfBusiness()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditPatentController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditPatentController.java deleted file mode 100644 index 262c43b..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditPatentController.java +++ /dev/null @@ -1,431 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditPatent; -import com.gxwebsoft.credit.param.CreditPatentImportParam; -import com.gxwebsoft.credit.param.CreditPatentParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditPatentService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 专利控制器 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Tag(name = "专利管理") -@RestController -@RequestMapping("/api/credit/credit-patent") -public class CreditPatentController extends BaseController { - @Resource - private CreditPatentService creditPatentService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询专利") - @GetMapping("/page") - public ApiResult> page(CreditPatentParam param) { - // 使用关联查询 - return success(creditPatentService.pageRel(param)); - } - - @Operation(summary = "查询全部专利") - @GetMapping() - public ApiResult> list(CreditPatentParam param) { - // 使用关联查询 - return success(creditPatentService.listRel(param)); - } - - @Operation(summary = "根据id查询专利") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditPatentService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditPatent:save')") - @OperationLog - @Operation(summary = "添加专利") - @PostMapping() - public ApiResult save(@RequestBody CreditPatent creditPatent) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditPatent.setUserId(loginUser.getUserId()); - // } - if (creditPatentService.save(creditPatent)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditPatent:update')") - @OperationLog - @Operation(summary = "修改专利") - @PutMapping() - public ApiResult update(@RequestBody CreditPatent creditPatent) { - if (creditPatentService.updateById(creditPatent)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditPatent:remove')") - @OperationLog - @Operation(summary = "删除专利") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditPatentService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditPatent:save')") - @OperationLog - @Operation(summary = "批量添加专利") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditPatentService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditPatent:update')") - @OperationLog - @Operation(summary = "批量修改专利") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditPatentService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditPatent:remove')") - @OperationLog - @Operation(summary = "批量删除专利") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditPatentService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditPatent:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditPatentService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditPatent::getId, - CreditPatent::setId, - CreditPatent::getPatentApplicant, - CreditPatent::getCompanyId, - CreditPatent::setCompanyId, - CreditPatent::getHasData, - CreditPatent::setHasData, - CreditPatent::getTenantId, - CreditPatent::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入专利 - */ - @PreAuthorize("hasAuthority('credit:creditPatent:save')") - @Operation(summary = "批量导入专利") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.readAnySheet( - file, CreditPatentImportParam.class, this::isEmptyImportRow); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByRegisterNo = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "申请号"); - Map urlByName = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "发明名称"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditPatentImportParam param = list.get(i); - try { - CreditPatent item = convertImportParamToEntity(param); - String link = null; - if (!ImportHelper.isBlank(item.getRegisterNo())) { - link = urlByRegisterNo.get(item.getRegisterNo().trim()); - } - if ((link == null || link.isEmpty()) && !ImportHelper.isBlank(item.getName())) { - link = urlByName.get(item.getName().trim()); - } - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getRegisterNo())) { - errorMessages.add("第" + excelRowNumber + "行:申请号不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditPatentService, - chunkItems, - CreditPatent::getId, - CreditPatent::setId, - CreditPatent::getRegisterNo, - CreditPatent::getRegisterNo, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditPatentService.save(rowItem); - if (!saved) { - CreditPatent existing = creditPatentService.lambdaQuery() - .eq(CreditPatent::getRegisterNo, rowItem.getRegisterNo()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditPatentService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditPatentService, - chunkItems, - CreditPatent::getId, - CreditPatent::setId, - CreditPatent::getRegisterNo, - CreditPatent::getRegisterNo, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditPatentService.save(rowItem); - if (!saved) { - CreditPatent existing = creditPatentService.lambdaQuery() - .eq(CreditPatent::getRegisterNo, rowItem.getRegisterNo()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditPatentService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.PATENT, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载专利导入模板 - */ - @Operation(summary = "下载专利导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditPatentImportParam example = new CreditPatentImportParam(); - example.setName("一种示例装置及方法"); - example.setType("发明专利"); - example.setStatusText("有效"); - example.setRegisterNo("CN2024XXXXXXXX.X"); - example.setRegisterDate("2024-01-01"); - example.setPublicNo("CN1XXXXXXXXX"); - example.setPublicDate("2024-06-01"); - example.setInventor("张三;李四"); - example.setPatentApplicant("示例科技有限公司"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("专利导入模板", "专利", CreditPatentImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_patent_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditPatentImportParam param) { - if (param == null) { - return true; - } - if (isImportHeaderRow(param)) { - return true; - } - return ImportHelper.isBlank(param.getPublicNo()); - } - - private boolean isImportHeaderRow(CreditPatentImportParam param) { - return isHeaderValue(param.getRegisterNo(), "申请号") - || isHeaderValue(param.getName(), "发明名称") - || isHeaderValue(param.getPatentApplicant(), "申请(专利权)人"); - } - - private static boolean isHeaderValue(String value, String headerText) { - if (value == null) { - return false; - } - return headerText.equals(value.trim()); - } - - private CreditPatent convertImportParamToEntity(CreditPatentImportParam param) { - CreditPatent entity = new CreditPatent(); - - entity.setName(param.getName()); - entity.setType(param.getType()); - entity.setStatusText(param.getStatusText()); - entity.setRegisterNo(param.getRegisterNo()); - entity.setRegisterDate(param.getRegisterDate()); - entity.setPublicNo(param.getPublicNo()); - entity.setPublicDate(param.getPublicDate()); - entity.setInventor(param.getInventor()); - entity.setPatentApplicant(param.getPatentApplicant()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditRiskRelationController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditRiskRelationController.java deleted file mode 100644 index 40e4daf..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditRiskRelationController.java +++ /dev/null @@ -1,399 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditRiskRelation; -import com.gxwebsoft.credit.param.CreditRiskRelationImportParam; -import com.gxwebsoft.credit.param.CreditRiskRelationParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditRiskRelationService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 风险关系表控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:41 - */ -@Tag(name = "风险关系表管理") -@RestController -@RequestMapping("/api/credit/credit-risk-relation") -public class CreditRiskRelationController extends BaseController { - @Resource - private CreditRiskRelationService creditRiskRelationService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询风险关系表") - @GetMapping("/page") - public ApiResult> page(CreditRiskRelationParam param) { - // 使用关联查询 - return success(creditRiskRelationService.pageRel(param)); - } - - @Operation(summary = "查询全部风险关系表") - @GetMapping() - public ApiResult> list(CreditRiskRelationParam param) { - // 使用关联查询 - return success(creditRiskRelationService.listRel(param)); - } - - @Operation(summary = "根据id查询风险关系表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditRiskRelationService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditRiskRelation:save')") - @OperationLog - @Operation(summary = "添加风险关系表") - @PostMapping() - public ApiResult save(@RequestBody CreditRiskRelation creditRiskRelation) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditRiskRelation.setUserId(loginUser.getUserId()); - // } - if (creditRiskRelationService.save(creditRiskRelation)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditRiskRelation:update')") - @OperationLog - @Operation(summary = "修改风险关系表") - @PutMapping() - public ApiResult update(@RequestBody CreditRiskRelation creditRiskRelation) { - if (creditRiskRelationService.updateById(creditRiskRelation)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditRiskRelation:remove')") - @OperationLog - @Operation(summary = "删除风险关系表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditRiskRelationService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditRiskRelation:save')") - @OperationLog - @Operation(summary = "批量添加风险关系表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditRiskRelationService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditRiskRelation:update')") - @OperationLog - @Operation(summary = "批量修改风险关系表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditRiskRelationService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditRiskRelation:remove')") - @OperationLog - @Operation(summary = "批量删除风险关系表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditRiskRelationService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditRiskRelation:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditRiskRelationService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditRiskRelation::getId, - CreditRiskRelation::setId, - CreditRiskRelation::getMainBodyName, - CreditRiskRelation::getCompanyId, - CreditRiskRelation::setCompanyId, - CreditRiskRelation::getHasData, - CreditRiskRelation::setHasData, - CreditRiskRelation::getTenantId, - CreditRiskRelation::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入风险关系表 - */ - @PreAuthorize("hasAuthority('credit:creditRiskRelation:save')") - @Operation(summary = "批量导入风险关系表") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "风险关系", 1); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditRiskRelationImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditRiskRelationImportParam param = list.get(i); - try { - CreditRiskRelation item = convertImportParamToEntity(param); - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getMainBodyName())) { - errorMessages.add("第" + excelRowNumber + "行:主体名称不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditRiskRelationService, - chunkItems, - CreditRiskRelation::getId, - CreditRiskRelation::setId, - CreditRiskRelation::getMainBodyName, - CreditRiskRelation::getMainBodyName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditRiskRelationService.save(rowItem); - if (!saved) { - CreditRiskRelation existing = creditRiskRelationService.lambdaQuery() - .eq(CreditRiskRelation::getMainBodyName, rowItem.getMainBodyName()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditRiskRelationService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditRiskRelationService, - chunkItems, - CreditRiskRelation::getId, - CreditRiskRelation::setId, - CreditRiskRelation::getMainBodyName, - CreditRiskRelation::getMainBodyName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditRiskRelationService.save(rowItem); - if (!saved) { - CreditRiskRelation existing = creditRiskRelationService.lambdaQuery() - .eq(CreditRiskRelation::getMainBodyName, rowItem.getMainBodyName()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditRiskRelationService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.RISK_RELATION, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载风险关系导入模板 - */ - @Operation(summary = "下载风险关系导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditRiskRelationImportParam example = new CreditRiskRelationImportParam(); - example.setMainBodyName("示例企业"); - example.setRegistrationStatus("存续"); - example.setRegisteredCapital("8000"); - example.setProvinceRegion("浙江"); - example.setAssociatedRelation("关联企业"); - example.setRiskRelation("存在风险关联"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("风险关系导入模板", "风险关系", CreditRiskRelationImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_risk_relation_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditRiskRelationImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getMainBodyName()) - && ImportHelper.isBlank(param.getRegistrationStatus()) - && ImportHelper.isBlank(param.getRegisteredCapital()); - } - - private CreditRiskRelation convertImportParamToEntity(CreditRiskRelationImportParam param) { - CreditRiskRelation entity = new CreditRiskRelation(); - - entity.setMainBodyName(param.getMainBodyName()); - entity.setRegistrationStatus(param.getRegistrationStatus()); - entity.setRegisteredCapital(param.getRegisteredCapital()); - entity.setProvinceRegion(param.getProvinceRegion()); - entity.setAssociatedRelation(param.getAssociatedRelation()); - entity.setRiskRelation(param.getRiskRelation()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditSupplierController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditSupplierController.java deleted file mode 100644 index 071aa3c..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditSupplierController.java +++ /dev/null @@ -1,405 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditSupplier; -import com.gxwebsoft.credit.param.CreditSupplierImportParam; -import com.gxwebsoft.credit.param.CreditSupplierParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditSupplierService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 供应商控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:47 - */ -@Tag(name = "供应商管理") -@RestController -@RequestMapping("/api/credit/credit-supplier") -public class CreditSupplierController extends BaseController { - @Resource - private CreditSupplierService creditSupplierService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询供应商") - @GetMapping("/page") - public ApiResult> page(CreditSupplierParam param) { - // 使用关联查询 - return success(creditSupplierService.pageRel(param)); - } - - @Operation(summary = "查询全部供应商") - @GetMapping() - public ApiResult> list(CreditSupplierParam param) { - // 使用关联查询 - return success(creditSupplierService.listRel(param)); - } - - @Operation(summary = "根据id查询供应商") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditSupplierService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditSupplier:save')") - @OperationLog - @Operation(summary = "添加供应商") - @PostMapping() - public ApiResult save(@RequestBody CreditSupplier creditSupplier) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditSupplier.setUserId(loginUser.getUserId()); - // } - if (creditSupplierService.save(creditSupplier)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditSupplier:update')") - @OperationLog - @Operation(summary = "修改供应商") - @PutMapping() - public ApiResult update(@RequestBody CreditSupplier creditSupplier) { - if (creditSupplierService.updateById(creditSupplier)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditSupplier:remove')") - @OperationLog - @Operation(summary = "删除供应商") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditSupplierService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditSupplier:save')") - @OperationLog - @Operation(summary = "批量添加供应商") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditSupplierService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditSupplier:update')") - @OperationLog - @Operation(summary = "批量修改供应商") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditSupplierService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditSupplier:remove')") - @OperationLog - @Operation(summary = "批量删除供应商") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditSupplierService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditSupplier:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditSupplierService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditSupplier::getId, - CreditSupplier::setId, - CreditSupplier::getSupplier, - CreditSupplier::getCompanyId, - CreditSupplier::setCompanyId, - CreditSupplier::getHasData, - CreditSupplier::setHasData, - CreditSupplier::getTenantId, - CreditSupplier::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入供应商 - */ - @PreAuthorize("hasAuthority('credit:creditSupplier:save')") - @Operation(summary = "批量导入供应商") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "供应商", 3); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditSupplierImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlBySupplier = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "供应商"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditSupplierImportParam param = list.get(i); - try { - CreditSupplier item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getSupplier())) { - String link = urlBySupplier.get(item.getSupplier().trim()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getSupplier())) { - errorMessages.add("第" + excelRowNumber + "行:供应商不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditSupplierService, - chunkItems, - CreditSupplier::getId, - CreditSupplier::setId, - CreditSupplier::getSupplier, - CreditSupplier::getSupplier, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditSupplierService.save(rowItem); - if (!saved) { - CreditSupplier existing = creditSupplierService.lambdaQuery() - .eq(CreditSupplier::getSupplier, rowItem.getSupplier()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditSupplierService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditSupplierService, - chunkItems, - CreditSupplier::getId, - CreditSupplier::setId, - CreditSupplier::getSupplier, - CreditSupplier::getSupplier, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditSupplierService.save(rowItem); - if (!saved) { - CreditSupplier existing = creditSupplierService.lambdaQuery() - .eq(CreditSupplier::getSupplier, rowItem.getSupplier()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditSupplierService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.SUPPLIER, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载供应商导入模板 - */ - @Operation(summary = "下载供应商导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditSupplierImportParam example = new CreditSupplierImportParam(); - example.setSupplier("示例供应商"); - example.setStatusTxt("合作中"); - example.setPurchaseAmount("120"); - example.setPublicDate("2024-02-01"); - example.setDataSource("公开渠道"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("供应商导入模板", "供应商", CreditSupplierImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_supplier_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditSupplierImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getSupplier()) - && ImportHelper.isBlank(param.getStatusTxt()) - && ImportHelper.isBlank(param.getPurchaseAmount()); - } - - private CreditSupplier convertImportParamToEntity(CreditSupplierImportParam param) { - CreditSupplier entity = new CreditSupplier(); - - entity.setSupplier(param.getSupplier()); - entity.setStatusTxt(param.getStatusTxt()); - entity.setPurchaseAmount(param.getPurchaseAmount()); - entity.setPublicDate(param.getPublicDate()); - entity.setDataSource(param.getDataSource()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditSuspectedRelationshipController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditSuspectedRelationshipController.java deleted file mode 100644 index 46da439..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditSuspectedRelationshipController.java +++ /dev/null @@ -1,552 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditSuspectedRelationship; -import com.gxwebsoft.credit.param.CreditSuspectedRelationshipImportParam; -import com.gxwebsoft.credit.param.CreditSuspectedRelationshipParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditSuspectedRelationshipService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 疑似关系控制器 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Tag(name = "疑似关系管理") -@RestController -@RequestMapping("/api/credit/credit-suspected-relationship") -public class CreditSuspectedRelationshipController extends BaseController { - @Resource - private CreditSuspectedRelationshipService creditSuspectedRelationshipService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询疑似关系") - @GetMapping("/page") - public ApiResult> page(CreditSuspectedRelationshipParam param) { - // 使用关联查询 - return success(creditSuspectedRelationshipService.pageRel(param)); - } - - @Operation(summary = "查询全部疑似关系") - @GetMapping() - public ApiResult> list(CreditSuspectedRelationshipParam param) { - // 使用关联查询 - return success(creditSuspectedRelationshipService.listRel(param)); - } - - @Operation(summary = "根据id查询疑似关系") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditSuspectedRelationshipService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:save')") - @OperationLog - @Operation(summary = "添加疑似关系") - @PostMapping() - public ApiResult save(@RequestBody CreditSuspectedRelationship creditSuspectedRelationship) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditSuspectedRelationship.setUserId(loginUser.getUserId()); - // } - if (creditSuspectedRelationshipService.save(creditSuspectedRelationship)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:update')") - @OperationLog - @Operation(summary = "修改疑似关系") - @PutMapping() - public ApiResult update(@RequestBody CreditSuspectedRelationship creditSuspectedRelationship) { - if (creditSuspectedRelationshipService.updateById(creditSuspectedRelationship)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:remove')") - @OperationLog - @Operation(summary = "删除疑似关系") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditSuspectedRelationshipService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:save')") - @OperationLog - @Operation(summary = "批量添加疑似关系") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditSuspectedRelationshipService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:update')") - @OperationLog - @Operation(summary = "批量修改疑似关系") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditSuspectedRelationshipService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:remove')") - @OperationLog - @Operation(summary = "批量删除疑似关系") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditSuspectedRelationshipService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditSuspectedRelationshipService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditSuspectedRelationship::getId, - CreditSuspectedRelationship::setId, - CreditSuspectedRelationship::getName, - CreditSuspectedRelationship::getCompanyId, - CreditSuspectedRelationship::setCompanyId, - CreditSuspectedRelationship::getHasData, - CreditSuspectedRelationship::setHasData, - CreditSuspectedRelationship::getTenantId, - CreditSuspectedRelationship::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入疑似关系 - */ - @PreAuthorize("hasAuthority('credit:creditSuspectedRelationship:save')") - @Operation(summary = "批量导入疑似关系") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.readAnySheet( - file, CreditSuspectedRelationshipImportParam.class, this::isEmptyImportRow); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByName = ExcelImportSupport.readHyperlinksByHeaderKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "企业名称"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditSuspectedRelationshipImportParam param = list.get(i); - try { - CreditSuspectedRelationship item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getName())) { - String link = urlByName.get(item.getName().trim()); - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getName())) { - errorMessages.add("第" + excelRowNumber + "行:企业名称不能为空"); - continue; - } - if (ImportHelper.isBlank(item.getRelatedParty())) { - errorMessages.add("第" + excelRowNumber + "行:关联方不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> { - List names = new ArrayList<>(chunkItems.size()); - List relatedParties = new ArrayList<>(chunkItems.size()); - for (CreditSuspectedRelationship it : chunkItems) { - if (it == null) { - continue; - } - if (!ImportHelper.isBlank(it.getName())) { - names.add(it.getName().trim()); - } - if (!ImportHelper.isBlank(it.getRelatedParty())) { - relatedParties.add(it.getRelatedParty().trim()); - } - } - - List existingList = (names.isEmpty() || relatedParties.isEmpty()) - ? new ArrayList<>() - : creditSuspectedRelationshipService.lambdaQuery() - .in(CreditSuspectedRelationship::getName, names) - .in(CreditSuspectedRelationship::getRelatedParty, relatedParties) - .list(); - - java.util.Map byNameRelated = new java.util.HashMap<>(); - java.util.Map byNameRelatedType = new java.util.HashMap<>(); - for (CreditSuspectedRelationship existing : existingList) { - if (existing == null - || ImportHelper.isBlank(existing.getName()) - || ImportHelper.isBlank(existing.getRelatedParty())) { - continue; - } - String n = existing.getName().trim(); - String r = existing.getRelatedParty().trim(); - byNameRelated.putIfAbsent(n + "|" + r, existing); - if (!ImportHelper.isBlank(existing.getType())) { - byNameRelatedType.putIfAbsent(n + "|" + r + "|" + existing.getType().trim(), existing); - } - } - - List updates = new ArrayList<>(); - List inserts = new ArrayList<>(); - for (CreditSuspectedRelationship it : chunkItems) { - if (it == null - || ImportHelper.isBlank(it.getName()) - || ImportHelper.isBlank(it.getRelatedParty())) { - continue; - } - String n = it.getName().trim(); - String r = it.getRelatedParty().trim(); - CreditSuspectedRelationship existing; - if (!ImportHelper.isBlank(it.getType())) { - existing = byNameRelatedType.get(n + "|" + r + "|" + it.getType().trim()); - } else { - existing = byNameRelated.get(n + "|" + r); - } - if (existing != null) { - it.setId(existing.getId()); - updates.add(it); - } else { - inserts.add(it); - } - } - if (!updates.isEmpty()) { - creditSuspectedRelationshipService.updateBatchById(updates, mpBatchSize); - } - if (!inserts.isEmpty()) { - creditSuspectedRelationshipService.saveBatch(inserts, mpBatchSize); - } - return updates.size() + inserts.size(); - }, - (rowItem, rowNumber) -> { - boolean saved = creditSuspectedRelationshipService.save(rowItem); - if (!saved) { - CreditSuspectedRelationship existing = creditSuspectedRelationshipService.lambdaQuery() - .eq(CreditSuspectedRelationship::getName, rowItem.getName()) - .eq(CreditSuspectedRelationship::getRelatedParty, rowItem.getRelatedParty()) - .eq(!ImportHelper.isBlank(rowItem.getType()), CreditSuspectedRelationship::getType, rowItem.getType()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditSuspectedRelationshipService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> { - List names = new ArrayList<>(chunkItems.size()); - List relatedParties = new ArrayList<>(chunkItems.size()); - for (CreditSuspectedRelationship it : chunkItems) { - if (it == null) { - continue; - } - if (!ImportHelper.isBlank(it.getName())) { - names.add(it.getName().trim()); - } - if (!ImportHelper.isBlank(it.getRelatedParty())) { - relatedParties.add(it.getRelatedParty().trim()); - } - } - - List existingList = (names.isEmpty() || relatedParties.isEmpty()) - ? new ArrayList<>() - : creditSuspectedRelationshipService.lambdaQuery() - .in(CreditSuspectedRelationship::getName, names) - .in(CreditSuspectedRelationship::getRelatedParty, relatedParties) - .list(); - - java.util.Map byNameRelated = new java.util.HashMap<>(); - java.util.Map byNameRelatedType = new java.util.HashMap<>(); - for (CreditSuspectedRelationship existing : existingList) { - if (existing == null - || ImportHelper.isBlank(existing.getName()) - || ImportHelper.isBlank(existing.getRelatedParty())) { - continue; - } - String n = existing.getName().trim(); - String r = existing.getRelatedParty().trim(); - byNameRelated.putIfAbsent(n + "|" + r, existing); - if (!ImportHelper.isBlank(existing.getType())) { - byNameRelatedType.putIfAbsent(n + "|" + r + "|" + existing.getType().trim(), existing); - } - } - - List updates = new ArrayList<>(); - List inserts = new ArrayList<>(); - for (CreditSuspectedRelationship it : chunkItems) { - if (it == null - || ImportHelper.isBlank(it.getName()) - || ImportHelper.isBlank(it.getRelatedParty())) { - continue; - } - String n = it.getName().trim(); - String r = it.getRelatedParty().trim(); - CreditSuspectedRelationship existing; - if (!ImportHelper.isBlank(it.getType())) { - existing = byNameRelatedType.get(n + "|" + r + "|" + it.getType().trim()); - } else { - existing = byNameRelated.get(n + "|" + r); - } - if (existing != null) { - it.setId(existing.getId()); - updates.add(it); - } else { - inserts.add(it); - } - } - if (!updates.isEmpty()) { - creditSuspectedRelationshipService.updateBatchById(updates, mpBatchSize); - } - if (!inserts.isEmpty()) { - creditSuspectedRelationshipService.saveBatch(inserts, mpBatchSize); - } - return updates.size() + inserts.size(); - }, - (rowItem, rowNumber) -> { - boolean saved = creditSuspectedRelationshipService.save(rowItem); - if (!saved) { - CreditSuspectedRelationship existing = creditSuspectedRelationshipService.lambdaQuery() - .eq(CreditSuspectedRelationship::getName, rowItem.getName()) - .eq(CreditSuspectedRelationship::getRelatedParty, rowItem.getRelatedParty()) - .eq(!ImportHelper.isBlank(rowItem.getType()), CreditSuspectedRelationship::getType, rowItem.getType()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditSuspectedRelationshipService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.SUSPECTED_RELATIONSHIP, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载疑似关系导入模板 - */ - @Operation(summary = "下载疑似关系导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditSuspectedRelationshipImportParam example = new CreditSuspectedRelationshipImportParam(); - example.setName("示例科技有限公司"); - example.setStatusText("存续"); - example.setLegalPerson("李四"); - example.setRegisteredCapital("1000万人民币"); - example.setCreateDate("2018-06-01"); - example.setRelatedParty("关联方示例"); - example.setType("股权关联"); - example.setDetail("疑似关系详情示例"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("疑似关系导入模板", "疑似关系", CreditSuspectedRelationshipImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_suspected_relationship_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditSuspectedRelationshipImportParam param) { - if (param == null) { - return true; - } - if (isImportHeaderRow(param)) { - return true; - } - return ImportHelper.isBlank(param.getName()) - && ImportHelper.isBlank(param.getRelatedParty()) - && ImportHelper.isBlank(param.getType()); - } - - private boolean isImportHeaderRow(CreditSuspectedRelationshipImportParam param) { - return isHeaderValue(param.getName(), "企业名称") - || isHeaderValue(param.getRelatedParty(), "关联方") - || isHeaderValue(param.getType(), "疑似关系类型"); - } - - private static boolean isHeaderValue(String value, String headerText) { - if (value == null) { - return false; - } - return headerText.equals(value.trim()); - } - - private CreditSuspectedRelationship convertImportParamToEntity(CreditSuspectedRelationshipImportParam param) { - CreditSuspectedRelationship entity = new CreditSuspectedRelationship(); - - entity.setName(param.getName()); - entity.setStatusText(param.getStatusText()); - entity.setLegalPerson(param.getLegalPerson()); - entity.setRegisteredCapital(param.getRegisteredCapital()); - entity.setCreateDate(param.getCreateDate()); - entity.setRelatedParty(param.getRelatedParty()); - entity.setType(param.getType()); - entity.setDetail(param.getDetail()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditUserController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditUserController.java deleted file mode 100644 index d5864b4..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditUserController.java +++ /dev/null @@ -1,502 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.ExcelImportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.ImportParams; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditUser; -import com.gxwebsoft.credit.param.CreditUserImportParam; -import com.gxwebsoft.credit.param.CreditUserParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditUserService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.ss.usermodel.WorkbookFactory; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.InputStream; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 招投标信息表控制器 - * - * @author 科技小王子 - * @since 2025-12-15 13:16:04 - */ -@Tag(name = "招投标信息表管理") -@RestController -@RequestMapping("/api/credit/credit-user") -public class CreditUserController extends BaseController { - private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - - @Resource - private CreditUserService creditUserService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询招投标信息表") - @GetMapping("/page") - public ApiResult> page(CreditUserParam param) { - // 使用关联查询 - return success(creditUserService.pageRel(param)); - } - - @Operation(summary = "查询全部招投标信息表") - @GetMapping() - public ApiResult> list(CreditUserParam param) { - // 使用关联查询 - return success(creditUserService.listRel(param)); - } - - @Operation(summary = "根据id查询招投标信息表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditUserService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditUser:save')") - @OperationLog - @Operation(summary = "添加招投标信息表") - @PostMapping() - public ApiResult save(@RequestBody CreditUser creditUser) { - if (creditUserService.save(creditUser)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditUser:update')") - @OperationLog - @Operation(summary = "修改招投标信息表") - @PutMapping() - public ApiResult update(@RequestBody CreditUser creditUser) { - if (creditUserService.updateById(creditUser)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditUser:remove')") - @OperationLog - @Operation(summary = "删除招投标信息表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditUserService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditUser:save')") - @OperationLog - @Operation(summary = "批量添加招投标信息表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditUserService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditUser:update')") - @OperationLog - @Operation(summary = "批量修改招投标信息表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditUserService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditUser:remove')") - @OperationLog - @Operation(summary = "批量删除招投标信息表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditUserService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditUser:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditUserService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditUser::getId, - CreditUser::setId, - CreditUser::getWinningName, - CreditUser::getCompanyId, - CreditUser::setCompanyId, - CreditUser::getHasData, - CreditUser::setHasData, - CreditUser::getTenantId, - CreditUser::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入招投标信息 - * Excel表头格式:客户名称、唯一标识、类型、企业角色、上级ID、信息类型、所在国家、所在省份、所在城市、所在辖区、街道地址、招采单位名称、中标单位名称、中标金额、备注、是否推荐、到期时间、排序、状态、用户ID、租户ID - */ - @PreAuthorize("hasAuthority('credit:creditUser:save')") - @Operation(summary = "批量导入招投标信息") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "招投标", 0); - List list = null; - int usedTitleRows = 0; - int usedHeadRows = 0; - int[][] tryConfigs = new int[][]{{1, 1}, {0, 1}, {0, 2}, {0, 3}}; - - for (int[] config : tryConfigs) { - list = filterEmptyRows(tryImport(file, config[0], config[1], sheetIndex)); - if (!CollectionUtils.isEmpty(list)) { - usedTitleRows = config[0]; - usedHeadRows = config[1]; - break; - } - } - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlMap = readNameHyperlinks(file, sheetIndex, usedTitleRows, usedHeadRows); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditUserImportParam param = list.get(i); - try { - CreditUser item = convertImportParamToEntity(param); - - String link = urlMap.get(i); - if (link != null && !link.isEmpty()) { - item.setUrl(link); - } - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - // 设置默认值 - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getType() == null) { - item.setType(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - // 验证必填字段 - if (item.getName() == null || item.getName().trim().isEmpty()) { - errorMessages.add("第" + excelRowNumber + "行:项目名称不能为空"); - continue; - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditUserService, - chunkItems, - CreditUser::getId, - CreditUser::setId, - CreditUser::getName, - CreditUser::getName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditUserService.save(rowItem); - if (!saved) { - CreditUser existing = creditUserService.getByName(rowItem.getName()); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditUserService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - errorMessages.add("第" + rowNumber + "行:保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditUserService, - chunkItems, - CreditUser::getId, - CreditUser::setId, - CreditUser::getName, - CreditUser::getName, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditUserService.save(rowItem); - if (!saved) { - CreditUser existing = creditUserService.getByName(rowItem.getName()); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditUserService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - errorMessages.add("第" + rowNumber + "行:保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.USER, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载招投标信息导入模板 - */ - @Operation(summary = "下载招投标信息导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditUserImportParam example = new CreditUserImportParam(); - example.setCode("CUS001"); - example.setName("示例客户"); - example.setReleaseDate("2023-01-01"); - example.setType(0); - example.setRole("采购方"); - example.setInfoType("企业"); - example.setAddress("广东省-广州市-南沙区"); - example.setProcurementName("示例招采单位"); - example.setWinningName("示例中标单位"); - example.setWinningPrice("100000"); - templateList.add(example); - - ExportParams exportParams = new ExportParams("招投标信息导入模板", "招投标信息"); - - Workbook workbook = ExcelExportUtil.exportExcel(exportParams, CreditUserImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_user_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private List tryImport(MultipartFile file, int titleRows, int headRows, int sheetIndex) throws Exception { - ImportParams importParams = new ImportParams(); - importParams.setTitleRows(titleRows); - importParams.setHeadRows(headRows); - importParams.setStartSheetIndex(sheetIndex); - importParams.setSheetNum(1); - return ExcelImportUtil.importExcel(file.getInputStream(), CreditUserImportParam.class, importParams); - } - - /** - * 读取“项目名称”列的超链接,按数据行顺序返回。 - */ - private Map readNameHyperlinks(MultipartFile file, int sheetIndex, int titleRows, int headRows) throws Exception { - Map result = new HashMap<>(); - try (InputStream is = file.getInputStream(); Workbook workbook = WorkbookFactory.create(is)) { - Sheet sheet = workbook.getSheetAt(sheetIndex); - if (sheet == null) { - return result; - } - int headerRowNum = titleRows + headRows - 1; - Row headerRow = sheet.getRow(headerRowNum); - int nameColIndex = 0; - if (headerRow != null) { - for (int c = headerRow.getFirstCellNum(); c < headerRow.getLastCellNum(); c++) { - Cell cell = headerRow.getCell(c); - if (cell != null && "项目名称".equals(cell.getStringCellValue())) { - nameColIndex = c; - break; - } - } - } - int dataStartRow = titleRows + headRows; - for (int r = dataStartRow; r <= sheet.getLastRowNum(); r++) { - Row row = sheet.getRow(r); - if (row == null) { - continue; - } - Cell cell = row.getCell(nameColIndex); - if (cell != null && cell.getHyperlink() != null) { - String address = cell.getHyperlink().getAddress(); - if (address != null && !address.isEmpty()) { - result.put(r - dataStartRow, address); - } - } - } - } - return result; - } - - /** - * 过滤掉完全空白的导入行,避免空行导致导入失败 - */ - private List filterEmptyRows(List rawList) { - if (CollectionUtils.isEmpty(rawList)) { - return rawList; - } - rawList.removeIf(this::isEmptyImportRow); - return rawList; - } - - private boolean isEmptyImportRow(CreditUserImportParam param) { - if (param == null) { - return true; - } - return isBlank(param.getName()) - && isBlank(param.getCode()) - && isBlank(param.getRole()) - && isBlank(param.getInfoType()) - && isBlank(param.getAddress()) - && isBlank(param.getProcurementName()) - && isBlank(param.getWinningName()) - && isBlank(param.getWinningPrice()); - } - - private boolean isBlank(String value) { - return value == null || value.trim().isEmpty(); - } - - /** - * 将CreditUserImportParam转换为CreditUser实体 - */ - private CreditUser convertImportParamToEntity(CreditUserImportParam param) { - CreditUser entity = new CreditUser(); - - entity.setCode(param.getCode()); - entity.setName(param.getName()); - entity.setReleaseDate(param.getReleaseDate()); - entity.setType(param.getType()); - entity.setRole(param.getRole()); - entity.setInfoType(param.getInfoType()); - entity.setAddress(param.getAddress()); - entity.setProcurementName(param.getProcurementName()); - entity.setWinningName(param.getWinningName()); - entity.setWinningPrice(param.getWinningPrice()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/CreditXgxfController.java b/src/main/java/com/gxwebsoft/credit/controller/CreditXgxfController.java deleted file mode 100644 index 8398f3e..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/CreditXgxfController.java +++ /dev/null @@ -1,632 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.credit.entity.CreditXgxf; -import com.gxwebsoft.credit.param.CreditXgxfImportParam; -import com.gxwebsoft.credit.param.CreditXgxfParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import com.gxwebsoft.credit.service.CreditCompanyRecordCountService; -import com.gxwebsoft.credit.service.CreditXgxfService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * 限制高消费控制器 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:55 - */ -@Tag(name = "限制高消费管理") -@RestController -@RequestMapping("/api/credit/credit-xgxf") -public class CreditXgxfController extends BaseController { - @Resource - private CreditXgxfService creditXgxfService; - - @Resource - private BatchImportSupport batchImportSupport; - - @Resource - private CreditCompanyService creditCompanyService; - - @Resource - private CreditCompanyRecordCountService creditCompanyRecordCountService; - - @Operation(summary = "分页查询限制高消费") - @GetMapping("/page") - public ApiResult> page(CreditXgxfParam param) { - // 使用关联查询 - return success(creditXgxfService.pageRel(param)); - } - - @Operation(summary = "查询全部限制高消费") - @GetMapping() - public ApiResult> list(CreditXgxfParam param) { - // 使用关联查询 - return success(creditXgxfService.listRel(param)); - } - - @Operation(summary = "根据id查询限制高消费") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(creditXgxfService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('credit:creditXgxf:save')") - @OperationLog - @Operation(summary = "添加限制高消费") - @PostMapping() - public ApiResult save(@RequestBody CreditXgxf creditXgxf) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // creditXgxf.setUserId(loginUser.getUserId()); - // } - if (creditXgxfService.save(creditXgxf)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditXgxf:update')") - @OperationLog - @Operation(summary = "修改限制高消费") - @PutMapping() - public ApiResult update(@RequestBody CreditXgxf creditXgxf) { - if (creditXgxfService.updateById(creditXgxf)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditXgxf:remove')") - @OperationLog - @Operation(summary = "删除限制高消费") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (creditXgxfService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('credit:creditXgxf:save')") - @OperationLog - @Operation(summary = "批量添加限制高消费") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (creditXgxfService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('credit:creditXgxf:update')") - @OperationLog - @Operation(summary = "批量修改限制高消费") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(creditXgxfService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('credit:creditXgxf:remove')") - @OperationLog - @Operation(summary = "批量删除限制高消费") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (creditXgxfService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - /** - * 根据企业名称匹配企业并更新 companyId(匹配 CreditCompany.name / CreditCompany.matchName) - * - *

默认仅更新 companyId=0 的记录;如需覆盖更新,传 onlyNull=false。

- */ - @PreAuthorize("hasAuthority('credit:creditXgxf:update')") - @OperationLog - @Operation(summary = "根据企业名称匹配并更新companyId") - @PostMapping("/company-id/refresh") - public ApiResult> refreshCompanyIdByCompanyName( - @RequestParam(value = "onlyNull", required = false, defaultValue = "true") Boolean onlyNull, - @RequestParam(value = "limit", required = false) Integer limit - ) { - User loginUser = getLoginUser(); - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - - BatchImportSupport.CompanyIdRefreshStats stats = batchImportSupport.refreshCompanyIdByCompanyName( - creditXgxfService, - creditCompanyService, - currentTenantId, - onlyNull, - limit, - CreditXgxf::getId, - CreditXgxf::setId, - CreditXgxf::getDataType, - CreditXgxf::getCompanyId, - CreditXgxf::setCompanyId, - CreditXgxf::getHasData, - CreditXgxf::setHasData, - CreditXgxf::getTenantId, - CreditXgxf::new - ); - - if (!stats.anyDataRead) { - return success("无可更新数据", stats.toMap()); - } - return success("更新完成,更新" + stats.updated + "条", stats.toMap()); - } - - /** - * 批量导入限制高消费司法大数据 - */ - @PreAuthorize("hasAuthority('credit:creditXgxf:save')") - @Operation(summary = "批量导入限制高消费司法大数据") - @PostMapping("/import") - public ApiResult> importBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "限制高消费", 0); - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditXgxfImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - // easypoi 默认不会读取单元格超链接地址;url 可能挂在“案号”等列的超链接中,或单独提供 url/网址/链接 列。 - Map urlByCaseNumber = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (int i = 0; i < list.size(); i++) { - CreditXgxfImportParam param = list.get(i); - try { - CreditXgxf item = convertImportParamToEntity(param); - if (!ImportHelper.isBlank(item.getCaseNumber())) { - String link = urlByCaseNumber.get(item.getCaseNumber().trim()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getRecommend() == null) { - item.setRecommend(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - if (item.getCompanyId() != null && item.getCompanyId() > 0) { - touchedCompanyIds.add(item.getCompanyId()); - } - - chunkItems.add(item); - chunkRowNumbers.add(excelRowNumber); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditXgxfService, - chunkItems, - CreditXgxf::getId, - CreditXgxf::setId, - CreditXgxf::getCaseNumber, - CreditXgxf::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditXgxfService.save(rowItem); - if (!saved) { - CreditXgxf existing = creditXgxfService.lambdaQuery() - .eq(CreditXgxf::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditXgxfService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } catch (Exception e) { - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKey( - creditXgxfService, - chunkItems, - CreditXgxf::getId, - CreditXgxf::setId, - CreditXgxf::getCaseNumber, - CreditXgxf::getCaseNumber, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - boolean saved = creditXgxfService.save(rowItem); - if (!saved) { - CreditXgxf existing = creditXgxfService.lambdaQuery() - .eq(CreditXgxf::getCaseNumber, rowItem.getCaseNumber()) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - if (creditXgxfService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.XGXF, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 批量导入历史限制高消费(仅解析“历史限制高消费”选项卡) - * 规则:案号相同则覆盖更新(recommend++ 记录更新次数);案号不存在则插入。 - */ - @PreAuthorize("hasAuthority('credit:creditXgxf:save')") - @Operation(summary = "批量导入历史限制高消费司法大数据") - @PostMapping("/import/history") - public ApiResult> importHistoryBatch(@RequestParam("file") MultipartFile file, - @RequestParam(value = "companyId", required = false) Integer companyId) { - List errorMessages = new ArrayList<>(); - int successCount = 0; - Set touchedCompanyIds = new HashSet<>(); - - try { - int sheetIndex = ExcelImportSupport.findSheetIndex(file, "历史限制高消费"); - if (sheetIndex < 0) { - return fail("未读取到数据,请确认文件中存在“历史限制高消费”选项卡且表头与示例格式一致", null); - } - - ExcelImportSupport.ImportResult importResult = ExcelImportSupport.read( - file, CreditXgxfImportParam.class, this::isEmptyImportRow, sheetIndex); - List list = importResult.getData(); - int usedTitleRows = importResult.getTitleRows(); - int usedHeadRows = importResult.getHeadRows(); - int usedSheetIndex = importResult.getSheetIndex(); - - if (CollectionUtils.isEmpty(list)) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - Integer currentTenantId = loginUser != null ? loginUser.getTenantId() : null; - Map urlByCaseNumber = ExcelImportSupport.readUrlByKey(file, usedSheetIndex, usedTitleRows, usedHeadRows, "案号"); - - LinkedHashMap latestByCaseNumber = new LinkedHashMap<>(); - LinkedHashMap latestRowByCaseNumber = new LinkedHashMap<>(); - - for (int i = 0; i < list.size(); i++) { - CreditXgxfImportParam param = list.get(i); - int excelRowNumber = i + 1 + usedTitleRows + usedHeadRows; - try { - CreditXgxf item = convertImportParamToEntity(param); - if (item.getCaseNumber() != null) { - item.setCaseNumber(item.getCaseNumber().trim()); - } - if (ImportHelper.isBlank(item.getCaseNumber())) { - errorMessages.add("第" + excelRowNumber + "行:案号不能为空"); - continue; - } - - String link = urlByCaseNumber.get(item.getCaseNumber()); - if (!ImportHelper.isBlank(link)) { - item.setUrl(link.trim()); - } - - if (item.getCompanyId() == null && companyId != null) { - item.setCompanyId(companyId); - } - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getTenantId() == null && currentTenantId != null) { - item.setTenantId(currentTenantId); - } - if (item.getStatus() == null) { - item.setStatus(0); - } - if (item.getDeleted() == null) { - item.setDeleted(0); - } - // 历史导入的数据统一标记为“失效” - item.setDataStatus("失效"); - - latestByCaseNumber.put(item.getCaseNumber(), item); - latestRowByCaseNumber.put(item.getCaseNumber(), excelRowNumber); - } catch (Exception e) { - errorMessages.add("第" + excelRowNumber + "行:" + e.getMessage()); - e.printStackTrace(); - } - } - - if (latestByCaseNumber.isEmpty()) { - if (errorMessages.isEmpty()) { - return fail("未读取到数据,请确认模板表头与示例格式一致", null); - } - return success("导入完成,成功0条,失败" + errorMessages.size() + "条", errorMessages); - } - - final int chunkSize = 500; - final int mpBatchSize = 500; - List chunkItems = new ArrayList<>(chunkSize); - List chunkRowNumbers = new ArrayList<>(chunkSize); - - for (Map.Entry entry : latestByCaseNumber.entrySet()) { - String caseNumber = entry.getKey(); - CreditXgxf item = entry.getValue(); - Integer rowNo = latestRowByCaseNumber.get(caseNumber); - chunkItems.add(item); - chunkRowNumbers.add(rowNo != null ? rowNo : -1); - if (chunkItems.size() >= chunkSize) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditXgxfService, - chunkItems, - CreditXgxf::getId, - CreditXgxf::setId, - CreditXgxf::getCaseNumber, - CreditXgxf::getCaseNumber, - CreditXgxf::getRecommend, - CreditXgxf::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditXgxfService.save(rowItem); - if (!saved) { - CreditXgxf existing = creditXgxfService.lambdaQuery() - .eq(CreditXgxf::getCaseNumber, rowItem.getCaseNumber()) - .select(CreditXgxf::getId, CreditXgxf::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditXgxfService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - chunkItems.clear(); - chunkRowNumbers.clear(); - } - } - - if (!chunkItems.isEmpty()) { - successCount += batchImportSupport.persistChunkWithFallback( - chunkItems, - chunkRowNumbers, - () -> batchImportSupport.upsertBySingleKeyAndIncrementCounterOnUpdate( - creditXgxfService, - chunkItems, - CreditXgxf::getId, - CreditXgxf::setId, - CreditXgxf::getCaseNumber, - CreditXgxf::getCaseNumber, - CreditXgxf::getRecommend, - CreditXgxf::setRecommend, - null, - mpBatchSize - ), - (rowItem, rowNumber) -> { - if (rowItem.getRecommend() == null) { - rowItem.setRecommend(0); - } - boolean saved = creditXgxfService.save(rowItem); - if (!saved) { - CreditXgxf existing = creditXgxfService.lambdaQuery() - .eq(CreditXgxf::getCaseNumber, rowItem.getCaseNumber()) - .select(CreditXgxf::getId, CreditXgxf::getRecommend) - .one(); - if (existing != null) { - rowItem.setId(existing.getId()); - Integer old = existing.getRecommend(); - rowItem.setRecommend(old == null ? 1 : old + 1); - if (creditXgxfService.updateById(rowItem)) { - return true; - } - } - } else { - return true; - } - String prefix = rowNumber > 0 ? ("第" + rowNumber + "行:") : ""; - errorMessages.add(prefix + "保存失败"); - return false; - }, - errorMessages - ); - } - - creditCompanyRecordCountService.refresh(CreditCompanyRecordCountService.CountType.XGXF, touchedCompanyIds); - - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载限制高消费导入模板 - */ - @Operation(summary = "下载限制高消费导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - List templateList = new ArrayList<>(); - - CreditXgxfImportParam example = new CreditXgxfImportParam(); - example.setDataType("限制高消费"); - example.setPlaintiffAppellant("原告示例"); - example.setAppellee("被告示例"); - example.setOccurrenceTime("2024-01-01"); - example.setCaseNumber("(2024)示例案号"); - example.setInvolvedAmount("100000"); - example.setCourtName("示例法院"); - example.setComments("备注信息"); - templateList.add(example); - - Workbook workbook = ExcelImportSupport.buildTemplate("限制高消费导入模板", "限制高消费", CreditXgxfImportParam.class, templateList); - - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=credit_xgxf_import_template.xlsx"); - - workbook.write(response.getOutputStream()); - workbook.close(); - } - - private boolean isEmptyImportRow(CreditXgxfImportParam param) { - if (param == null) { - return true; - } - return ImportHelper.isBlank(param.getCaseNumber()); - } - - private CreditXgxf convertImportParamToEntity(CreditXgxfImportParam param) { - CreditXgxf entity = new CreditXgxf(); - - entity.setCaseNumber(param.getCaseNumber()); - entity.setType(param.getType()); - entity.setDataType(param.getDataType()); - entity.setPlaintiffUser(param.getPlaintiffUser()); - entity.setDefendantUser(param.getDefendantUser()); - entity.setOtherPartiesThirdParty(param.getOtherPartiesThirdParty()); - entity.setPlaintiffAppellant(param.getPlaintiffAppellant()); - entity.setDataStatus(param.getDataStatus()); - entity.setAppellee(param.getAppellee()); - - // 兼容不同模板字段:如果 *2 有值则以 *2 为准写入主字段 - entity.setInvolvedAmount(!ImportHelper.isBlank(param.getInvolvedAmount2()) - ? param.getInvolvedAmount2() - : param.getInvolvedAmount()); - entity.setOccurrenceTime(!ImportHelper.isBlank(param.getOccurrenceTime2()) - ? param.getOccurrenceTime2() - : param.getOccurrenceTime()); - entity.setCourtName(!ImportHelper.isBlank(param.getCourtName2()) - ? param.getCourtName2() - : param.getCourtName()); - - entity.setReleaseDate(param.getReleaseDate()); - entity.setComments(param.getComments()); - - return entity; - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/ExcelImportSupport.java b/src/main/java/com/gxwebsoft/credit/controller/ExcelImportSupport.java deleted file mode 100644 index 6f42476..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/ExcelImportSupport.java +++ /dev/null @@ -1,609 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.ExcelImportUtil; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.afterturn.easypoi.excel.entity.ImportParams; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellType; -import org.apache.poi.ss.usermodel.DataFormatter; -import org.apache.poi.ss.usermodel.Hyperlink; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.ss.usermodel.WorkbookFactory; -import org.springframework.util.CollectionUtils; -import org.springframework.web.multipart.MultipartFile; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Predicate; - -/** - * Excel 导入导出通用支持 - */ -public class ExcelImportSupport { - - public static class ImportResult { - private final List data; - private final int titleRows; - private final int headRows; - private final int sheetIndex; - - public ImportResult(List data, int titleRows, int headRows) { - this(data, titleRows, headRows, 0); - } - - public ImportResult(List data, int titleRows, int headRows, int sheetIndex) { - this.data = data; - this.titleRows = titleRows; - this.headRows = headRows; - this.sheetIndex = sheetIndex; - } - - public List getData() { - return data; - } - - public int getTitleRows() { - return titleRows; - } - - public int getHeadRows() { - return headRows; - } - - public int getSheetIndex() { - return sheetIndex; - } - } - - public static ImportResult read(MultipartFile file, Class clazz, Predicate emptyRowPredicate) throws Exception { - return read(file, clazz, emptyRowPredicate, 0); - } - - /** - * 自动尝试所有 sheet(从第 0 个开始),直到读取到非空数据。 - */ - public static ImportResult readAnySheet(MultipartFile file, Class clazz, Predicate emptyRowPredicate) throws Exception { - ImportResult result = read(file, clazz, emptyRowPredicate, 0); - if (!CollectionUtils.isEmpty(result.getData())) { - return result; - } - - int sheetCount = getSheetCount(file); - for (int i = 1; i < sheetCount; i++) { - ImportResult sheetResult = read(file, clazz, emptyRowPredicate, i); - if (!CollectionUtils.isEmpty(sheetResult.getData())) { - return sheetResult; - } - } - return result; - } - - /** - * 自动尝试所有 sheet(从第 0 个开始),并在每个 sheet 内选择“得分”最高的表头配置。 - */ - public static ImportResult readAnySheetBest(MultipartFile file, Class clazz, Predicate emptyRowPredicate, Predicate scoreRowPredicate) throws Exception { - ImportResult result = readBest(file, clazz, emptyRowPredicate, scoreRowPredicate, 0); - if (!CollectionUtils.isEmpty(result.getData())) { - return result; - } - - int sheetCount = getSheetCount(file); - for (int i = 1; i < sheetCount; i++) { - ImportResult sheetResult = readBest(file, clazz, emptyRowPredicate, scoreRowPredicate, i); - if (!CollectionUtils.isEmpty(sheetResult.getData())) { - return sheetResult; - } - } - return result; - } - - /** - * 读取指定 sheet 的 Excel。 - * - * @param sheetIndex 目标 sheet 下标,从 0 开始。第二个选项卡传 1。 - */ - public static ImportResult read(MultipartFile file, Class clazz, Predicate emptyRowPredicate, int sheetIndex) throws Exception { - List list = null; - int usedTitleRows = 0; - int usedHeadRows = 0; - int[][] tryConfigs = new int[][]{{1, 1}, {0, 1}, {2, 1}, {3, 1}, {0, 2}, {0, 3}, {0, 4}}; - Exception lastFailure = null; - boolean anyImported = false; - - for (int[] config : tryConfigs) { - try { - list = filterEmptyRows(importSheet(file, clazz, config[0], config[1], sheetIndex), emptyRowPredicate); - anyImported = true; - } catch (Exception e) { - // Some source files can trigger easypoi/POI runtime exceptions for certain title/head row combinations. - // Keep trying other configurations instead of failing the whole import. - lastFailure = e; - continue; - } - if (!CollectionUtils.isEmpty(list)) { - usedTitleRows = config[0]; - usedHeadRows = config[1]; - break; - } - } - - // Fallback for upstream files with extra banner/title rows or wider multi-row headers. - // Keep the default fast path above for common templates. - if (CollectionUtils.isEmpty(list)) { - final int maxTitleRows = 10; - final int maxHeadRows = 6; - outer: - for (int titleRows = 0; titleRows <= maxTitleRows; titleRows++) { - for (int headRows = 1; headRows <= maxHeadRows; headRows++) { - try { - list = filterEmptyRows(importSheet(file, clazz, titleRows, headRows, sheetIndex), emptyRowPredicate); - anyImported = true; - } catch (Exception e) { - lastFailure = e; - continue; - } - if (!CollectionUtils.isEmpty(list)) { - usedTitleRows = titleRows; - usedHeadRows = headRows; - break outer; - } - } - } - } - if (list == null) { - if (!anyImported && lastFailure != null) { - throw lastFailure; - } - list = Collections.emptyList(); - } - return new ImportResult<>(list, usedTitleRows, usedHeadRows, sheetIndex); - } - - /** - * 读取指定 sheet 的 Excel,并从多组表头配置中挑选“得分”最高的结果。 - */ - public static ImportResult readBest(MultipartFile file, Class clazz, Predicate emptyRowPredicate, Predicate scoreRowPredicate, int sheetIndex) throws Exception { - List bestList = null; - int bestTitleRows = 0; - int bestHeadRows = 0; - int bestScore = -1; - int bestSize = -1; - Exception lastFailure = null; - boolean anyImported = false; - - int[][] tryConfigs = new int[][]{{1, 1}, {0, 1}, {2, 1}, {3, 1}, {0, 2}, {0, 3}, {0, 4}, {1, 2}, {1, 3}, {1, 4}, {2, 2}, {2, 3}, {2, 4}, {3, 2}, {3, 3}, {3, 4}}; - - for (int[] config : tryConfigs) { - List list; - try { - list = filterEmptyRows(importSheet(file, clazz, config[0], config[1], sheetIndex), emptyRowPredicate); - anyImported = true; - } catch (Exception e) { - lastFailure = e; - continue; - } - if (CollectionUtils.isEmpty(list)) { - continue; - } - - int score = 0; - if (scoreRowPredicate != null) { - for (T row : list) { - if (scoreRowPredicate.test(row)) { - score++; - } - } - } - - int size = list.size(); - if (score > bestScore || (score == bestScore && size > bestSize)) { - bestList = list; - bestTitleRows = config[0]; - bestHeadRows = config[1]; - bestScore = score; - bestSize = size; - } - } - - // Fallback scan: broaden the search space for messy source files (extra title rows, multi-row headers). - if (bestList == null) { - final int maxTitleRows = 10; - final int maxHeadRows = 6; - for (int titleRows = 0; titleRows <= maxTitleRows; titleRows++) { - for (int headRows = 1; headRows <= maxHeadRows; headRows++) { - List list; - try { - list = filterEmptyRows(importSheet(file, clazz, titleRows, headRows, sheetIndex), emptyRowPredicate); - anyImported = true; - } catch (Exception e) { - lastFailure = e; - continue; - } - if (CollectionUtils.isEmpty(list)) { - continue; - } - - int score = 0; - if (scoreRowPredicate != null) { - for (T row : list) { - if (scoreRowPredicate.test(row)) { - score++; - } - } - } - - int size = list.size(); - if (score > bestScore || (score == bestScore && size > bestSize)) { - bestList = list; - bestTitleRows = titleRows; - bestHeadRows = headRows; - bestScore = score; - bestSize = size; - } - } - } - } - - if (bestList != null) { - return new ImportResult<>(bestList, bestTitleRows, bestHeadRows, sheetIndex); - } - - if (!anyImported && lastFailure != null) { - throw lastFailure; - } - return read(file, clazz, emptyRowPredicate, sheetIndex); - } - - private static List importSheet(MultipartFile file, Class clazz, int titleRows, int headRows, int sheetIndex) throws Exception { - ImportParams importParams = new ImportParams(); - importParams.setTitleRows(titleRows); - importParams.setHeadRows(headRows); - importParams.setStartSheetIndex(sheetIndex); - importParams.setSheetNum(1); - - // Easypoi matches headers by exact string. Some upstream files contain extra spaces/tabs/newlines in header cells - // (e.g. "原告 / 上诉人" or "原告/上诉人\t"), which makes specific columns silently not mapped. - // Normalize header cells first to make imports robust. - try (InputStream is = file.getInputStream(); Workbook workbook = WorkbookFactory.create(is)) { - if (workbook.getNumberOfSheets() > sheetIndex) { - Sheet sheet = workbook.getSheetAt(sheetIndex); - if (sheet != null) { - normalizeHeaderCells(sheet, titleRows, headRows); - } - } - try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) { - workbook.write(bos); - try (ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray())) { - return ExcelImportUtil.importExcel(bis, clazz, importParams); - } - } - } - } - - private static void normalizeHeaderCells(Sheet sheet, int titleRows, int headRows) { - if (sheet == null || headRows <= 0) { - return; - } - int headerStart = Math.max(titleRows, 0); - int headerEnd = headerStart + headRows - 1; - for (int r = headerStart; r <= headerEnd; r++) { - Row row = sheet.getRow(r); - if (row == null) { - continue; - } - short last = row.getLastCellNum(); - for (int c = 0; c < last; c++) { - Cell cell = row.getCell(c); - if (cell == null) { - continue; - } - - String text = null; - CellType type = cell.getCellType(); - if (type == CellType.STRING) { - text = cell.getStringCellValue(); - } else if (type == CellType.FORMULA && cell.getCachedFormulaResultType() == CellType.STRING) { - text = cell.getStringCellValue(); - } else { - continue; - } - - String normalized = normalizeHeaderText(text); - if (normalized != null && !normalized.equals(text)) { - cell.setCellValue(normalized); - } - } - } - } - - private static String normalizeHeaderText(String text) { - if (text == null) { - return null; - } - // Remove common invisible whitespace characters, including full-width space. - return text - .replace("/", "/") - .replace(" ", "") - .replace("\t", "") - .replace("\r", "") - .replace("\n", "") - .replace("\u00A0", "") - .replace(" ", "") - .trim(); - } - - private static List filterEmptyRows(List rawList, Predicate emptyRowPredicate) { - if (CollectionUtils.isEmpty(rawList)) { - return rawList; - } - rawList.removeIf(emptyRowPredicate); - return rawList; - } - - private static int getSheetCount(MultipartFile file) throws Exception { - try (InputStream is = file.getInputStream(); Workbook workbook = WorkbookFactory.create(is)) { - return workbook.getNumberOfSheets(); - } - } - - /** - * 根据 sheet 名称查找下标(优先精确匹配,其次前缀匹配/包含匹配)。 - * - * @return 找不到返回 -1 - */ - public static int findSheetIndex(MultipartFile file, String sheetName) throws Exception { - if (file == null || sheetName == null || sheetName.trim().isEmpty()) { - return -1; - } - String target = normalizeSheetName(sheetName); - if (target.isEmpty()) { - return -1; - } - - try (InputStream is = file.getInputStream(); Workbook workbook = WorkbookFactory.create(is)) { - int sheetCount = workbook.getNumberOfSheets(); - for (int i = 0; i < sheetCount; i++) { - String candidate = normalizeSheetName(workbook.getSheetName(i)); - if (Objects.equals(candidate, target)) { - return i; - } - } - for (int i = 0; i < sheetCount; i++) { - String candidate = normalizeSheetName(workbook.getSheetName(i)); - if (candidate.startsWith(target) || candidate.contains(target) || target.startsWith(candidate)) { - return i; - } - } - return -1; - } - } - - public static int findSheetIndex(MultipartFile file, String sheetName, int defaultIndex) throws Exception { - int idx = findSheetIndex(file, sheetName); - return idx >= 0 ? idx : defaultIndex; - } - - private static String normalizeSheetName(String sheetName) { - if (sheetName == null) { - return ""; - } - return sheetName.replace(" ", "").replace(" ", "").trim(); - } - - /** - * 读取指定列(由表头名定位)的超链接,返回:单元格显示值 -> 超链接地址。 - * - *

适用于:导入对象没有 url 字段,但 Excel 把链接放在某个“名称/案号”等列的超链接里。

- */ - public static Map readHyperlinksByHeaderKey(MultipartFile file, int sheetIndex, int titleRows, int headRows, String headerName) throws Exception { - if (file == null || headerName == null || headerName.trim().isEmpty()) { - return Collections.emptyMap(); - } - - try (InputStream is = file.getInputStream(); Workbook workbook = WorkbookFactory.create(is)) { - if (workbook.getNumberOfSheets() <= sheetIndex) { - return Collections.emptyMap(); - } - Sheet sheet = workbook.getSheetAt(sheetIndex); - if (sheet == null) { - return Collections.emptyMap(); - } - - int colIndex = findColumnIndexByHeader(sheet, titleRows, headRows, headerName); - if (colIndex < 0) { - return Collections.emptyMap(); - } - - Map result = new HashMap<>(); - DataFormatter formatter = new DataFormatter(); - int dataStartRow = titleRows + headRows; - for (int r = dataStartRow; r <= sheet.getLastRowNum(); r++) { - Row row = sheet.getRow(r); - if (row == null) { - continue; - } - Cell cell = row.getCell(colIndex); - if (cell == null) { - continue; - } - String address = extractHyperlinkAddress(cell); - if (address == null || address.isEmpty()) { - continue; - } - String key = formatter.formatCellValue(cell); - if (key == null || key.trim().isEmpty()) { - continue; - } - result.put(key.trim(), address); - } - return result; - } - } - - /** - * 读取两列(由表头名定位)的文本/超链接,返回:key列显示值 -> value列(优先超链接地址,其次单元格文本)。 - * - *

适用于:Excel 把 url 放在单独一列(可能是纯文本,也可能是超链接)。

- */ - public static Map readKeyValueByHeaders(MultipartFile file, - int sheetIndex, - int titleRows, - int headRows, - String keyHeaderName, - String valueHeaderName) throws Exception { - if (file == null - || keyHeaderName == null || keyHeaderName.trim().isEmpty() - || valueHeaderName == null || valueHeaderName.trim().isEmpty()) { - return Collections.emptyMap(); - } - - try (InputStream is = file.getInputStream(); Workbook workbook = WorkbookFactory.create(is)) { - if (workbook.getNumberOfSheets() <= sheetIndex) { - return Collections.emptyMap(); - } - Sheet sheet = workbook.getSheetAt(sheetIndex); - if (sheet == null) { - return Collections.emptyMap(); - } - - int keyCol = findColumnIndexByHeader(sheet, titleRows, headRows, keyHeaderName); - int valCol = findColumnIndexByHeader(sheet, titleRows, headRows, valueHeaderName); - if (keyCol < 0 || valCol < 0) { - return Collections.emptyMap(); - } - - Map result = new HashMap<>(); - DataFormatter formatter = new DataFormatter(); - int dataStartRow = titleRows + headRows; - for (int r = dataStartRow; r <= sheet.getLastRowNum(); r++) { - Row row = sheet.getRow(r); - if (row == null) { - continue; - } - Cell keyCell = row.getCell(keyCol); - if (keyCell == null) { - continue; - } - String key = formatter.formatCellValue(keyCell); - if (key == null || key.trim().isEmpty()) { - continue; - } - - Cell valCell = row.getCell(valCol); - if (valCell == null) { - continue; - } - String value = extractHyperlinkAddress(valCell); - if (value == null || value.trim().isEmpty()) { - value = formatter.formatCellValue(valCell); - } - if (value == null || value.trim().isEmpty()) { - continue; - } - result.put(key.trim(), value.trim()); - } - return result; - } - } - - /** - * 读取“key列 -> url”的映射: - * - 优先读取 key 列自身的超链接(url 常挂在名称/案号等列的超链接里) - * - 如果源文件提供独立的 url/URL/网址/链接/链接地址 等列,则读取该列(支持文本或超链接) - */ - public static Map readUrlByKey(MultipartFile file, - int sheetIndex, - int titleRows, - int headRows, - String keyHeaderName) throws Exception { - if (file == null || keyHeaderName == null || keyHeaderName.trim().isEmpty()) { - return Collections.emptyMap(); - } - - Map result = new HashMap<>(); - - // 1) url 挂在 key 列超链接里(最常见) - Map fromKeyHyperlinks = readHyperlinksByHeaderKey(file, sheetIndex, titleRows, headRows, keyHeaderName); - if (!fromKeyHyperlinks.isEmpty()) { - result.putAll(fromKeyHyperlinks); - } - - // 2) url 作为单独一列(多种表头命名) - String[] urlHeaders = new String[]{"url", "URL", "网址", "链接", "链接地址"}; - for (String urlHeader : urlHeaders) { - Map fromUrlCol = readKeyValueByHeaders(file, sheetIndex, titleRows, headRows, keyHeaderName, urlHeader); - if (fromUrlCol.isEmpty()) { - continue; - } - for (Map.Entry entry : fromUrlCol.entrySet()) { - // 不覆盖已从 key 超链接读取到的地址 - result.putIfAbsent(entry.getKey(), entry.getValue()); - } - } - return result; - } - - private static int findColumnIndexByHeader(Sheet sheet, int titleRows, int headRows, String headerName) { - int firstHeaderRow = Math.max(0, titleRows); - int lastHeaderRow = Math.max(0, titleRows + headRows - 1); - for (int r = firstHeaderRow; r <= lastHeaderRow; r++) { - Row row = sheet.getRow(r); - if (row == null) { - continue; - } - for (int c = row.getFirstCellNum(); c < row.getLastCellNum(); c++) { - Cell cell = row.getCell(c); - if (cell == null) { - continue; - } - if (cell.getCellType() == CellType.STRING) { - String value = cell.getStringCellValue(); - if (headerName.equals(value != null ? value.trim() : null)) { - return c; - } - } else { - DataFormatter formatter = new DataFormatter(); - String value = formatter.formatCellValue(cell); - if (headerName.equals(value != null ? value.trim() : null)) { - return c; - } - } - } - } - return -1; - } - - private static String extractHyperlinkAddress(Cell cell) { - Hyperlink hyperlink = cell.getHyperlink(); - if (hyperlink != null && hyperlink.getAddress() != null && !hyperlink.getAddress().isEmpty()) { - return hyperlink.getAddress(); - } - if (cell.getCellType() == CellType.FORMULA) { - String formula = cell.getCellFormula(); - if (formula != null && formula.toUpperCase().startsWith("HYPERLINK(")) { - int firstQuote = formula.indexOf('\"'); - if (firstQuote >= 0) { - int secondQuote = formula.indexOf('\"', firstQuote + 1); - if (secondQuote > firstQuote) { - return formula.substring(firstQuote + 1, secondQuote); - } - } - } - } - return null; - } - - public static Workbook buildTemplate(String title, String sheetName, Class clazz, List examples) { - ExportParams exportParams = new ExportParams(title, sheetName); - return ExcelExportUtil.exportExcel(exportParams, clazz, examples); - } -} diff --git a/src/main/java/com/gxwebsoft/credit/controller/ImportHelper.java b/src/main/java/com/gxwebsoft/credit/controller/ImportHelper.java deleted file mode 100644 index c3590be..0000000 --- a/src/main/java/com/gxwebsoft/credit/controller/ImportHelper.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.gxwebsoft.credit.controller; - -import java.math.BigDecimal; -import java.time.LocalDate; - -/** - * 导入解析辅助工具 - */ -public final class ImportHelper { - - private ImportHelper() { - } - - public static boolean isBlank(String value) { - return value == null || value.trim().isEmpty(); - } - - public static BigDecimal parseBigDecimal(String value, String fieldLabel) { - if (isBlank(value)) { - return null; - } - try { - return new BigDecimal(value.trim()); - } catch (Exception e) { - throw new IllegalArgumentException(fieldLabel + "格式不正确"); - } - } - - public static LocalDate parseLocalDate(String value, String fieldLabel) { - if (isBlank(value)) { - return null; - } - try { - return LocalDate.parse(value.trim()); - } catch (Exception e) { - throw new IllegalArgumentException(fieldLabel + "日期格式应为yyyy-MM-dd"); - } - } -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditAdministrativeLicense.java b/src/main/java/com/gxwebsoft/credit/entity/CreditAdministrativeLicense.java deleted file mode 100644 index 374408f..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditAdministrativeLicense.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 行政许可 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditAdministrativeLicense对象", description = "行政许可") -public class CreditAdministrativeLicense implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "决定文书/许可编号") - private String code; - - @Schema(description = "决定文书/许可证名称") - private String name; - - @Schema(description = "许可状态") - private String statusText; - - @Schema(description = "许可类别") - private String type; - - @Schema(description = "链接") - private String url; - - @Schema(description = "有效期自") - private String validityStart; - - @Schema(description = "有效期至") - private String validityEnd; - - @Schema(description = "许可机关") - private String licensingAuthority; - - @Schema(description = "许可内容") - @TableField("License_content") - private String licenseContent; - - @Schema(description = "数据来源单位") - private String dataSourceUnit; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "主体企业") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditBankruptcy.java b/src/main/java/com/gxwebsoft/credit/entity/CreditBankruptcy.java deleted file mode 100644 index 1b227a7..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditBankruptcy.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 破产重整 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditBankruptcy对象", description = "破产重整") -public class CreditBankruptcy implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "案号") - private String code; - - @Schema(description = "案件类型") - private String type; - - @Schema(description = "当事人") - private String party; - - @Schema(description = "链接") - private String url; - - @Schema(description = "经办法院") - private String court; - - @Schema(description = "公开日期") - private String publicDate; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "主体企业") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditBranch.java b/src/main/java/com/gxwebsoft/credit/entity/CreditBranch.java deleted file mode 100644 index 8cf0447..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditBranch.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 分支机构 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditBranch对象", description = "分支机构") -public class CreditBranch implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "分支机构名称") - private String name; - - @Schema(description = "负责人") - private String curator; - - @Schema(description = "地区") - private String region; - - @Schema(description = "链接") - private String url; - - @Schema(description = "成立日期") - private String establishDate; - - @Schema(description = "状态") - private String statusText; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "主题企业") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditBreachOfTrust.java b/src/main/java/com/gxwebsoft/credit/entity/CreditBreachOfTrust.java deleted file mode 100644 index befe849..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditBreachOfTrust.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 失信被执行人 - * - * @author 科技小王子 - * @since 2025-12-19 19:46:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditBreachOfTrust对象", description = "失信被执行人") -public class CreditBreachOfTrust implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "失信被执行人") - private String plaintiffAppellant; - - @Schema(description = "疑似申请执行人") - private String appellee; - - @Schema(description = "涉案金额(元)") - private String involvedAmount; - - @Schema(description = "执行法院") - private String courtName; - - @Schema(description = "立案日期") - private String occurrenceTime; - - @Schema(description = "发布日期") - private String releaseDate; - - @Schema(description = "数据类型") - private String dataType; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditCaseFiling.java b/src/main/java/com/gxwebsoft/credit/entity/CreditCaseFiling.java deleted file mode 100644 index a0c340b..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditCaseFiling.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 司法大数据 - * - * @author 科技小王子 - * @since 2025-12-19 19:47:22 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditCaseFiling对象", description = "司法大数据") -public class CreditCaseFiling implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "数据类型") - private String dataType; - - @Schema(description = "原告/上诉人") - private String plaintiffAppellant; - - @Schema(description = "被告/被上诉人") - private String appellee; - - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Schema(description = "立案日期") - private String occurrenceTime; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "项目网址") - private String url; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "涉案金额") - private String involvedAmount; - - @Schema(description = "法院") - private String courtName; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditCompany.java b/src/main/java/com/gxwebsoft/credit/entity/CreditCompany.java deleted file mode 100644 index 5d70194..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditCompany.java +++ /dev/null @@ -1,294 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 企业 - * - * @author 科技小王子 - * @since 2025-12-17 08:28:03 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditCompany对象", description = "企业") -public class CreditCompany implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "原文件导入名称") - private String name; - - @Schema(description = "系统匹配企业名称") - private String matchName; - - @Schema(description = "登记状态") - private String registrationStatus; - - @Schema(description = "法定代表人") - private String legalPerson; - - @Schema(description = "注册资本") - private String registeredCapital; - - @Schema(description = "实缴资本") - private String paidinCapital; - - @Schema(description = "成立日期") - private String establishDate; - - @Schema(description = "统一社会信用代码") - private String code; - - @Schema(description = "企业地址") - private String address; - - @Schema(description = "所属省份") - private String province; - - @Schema(description = "所属城市") - private String city; - - @Schema(description = "所属区县") - private String region; - - @Schema(description = "电话") - private String tel; - - @Schema(description = "更多电话") - private String moreTel; - - @Schema(description = "邮箱") - private String email; - - @Schema(description = "更多邮箱") - private String moreEmail; - - @Schema(description = "企业(机构)类型") - private String institutionType; - - @Schema(description = "纳税人识别号") - private String taxpayerCode; - - @Schema(description = "注册号") - private String registrationNumber; - - @Schema(description = "组织机构代码") - private String organizationalCode; - - @Schema(description = "参保人数") - private String numberOfInsuredPersons; - - @Schema(description = "参保人数所属年报") - private String annualReport; - - @Schema(description = "营业期限") - private String businessTerm; - - @Schema(description = "国标行业门类") - private String nationalStandardIndustryCategories; - - @Schema(description = "国标行业大类") - private String nationalStandardIndustryCategories2; - - @Schema(description = "国标行业中类") - private String nationalStandardIndustryCategories3; - - @Schema(description = "国标行业小类") - private String nationalStandardIndustryCategories4; - - @Schema(description = "企查查行业门类") - private String nationalStandardIndustryCategories5; - - @Schema(description = "企查查行业大类") - private String nationalStandardIndustryCategories6; - - @Schema(description = "企查查行业中类") - private String nationalStandardIndustryCategories7; - - @Schema(description = "企查查行业小类") - private String nationalStandardIndustryCategories8; - - @Schema(description = "企业规模") - private String companySize; - - @Schema(description = "曾用名") - private String formerName; - - @Schema(description = "英文名") - private String englishName; - - @Schema(description = "官网") - private String domain; - - @Schema(description = "通信地址") - private String mailingAddress; - - @Schema(description = "企业简介") - private String companyProfile; - - @Schema(description = "经营范围") - private String natureOfBusiness; - - @Schema(description = "登记机关") - private String registrationAuthority; - - @Schema(description = "纳税人资质") - private String taxpayerQualification; - - @Schema(description = "最新年报年份") - private String latestAnnualReportYear; - - @Schema(description = "最新年报营业收入") - private String latestAnnualReportOnOperatingRevenue; - - @Schema(description = "企查分") - private String enterpriseScoreCheck; - - @Schema(description = "信用等级") - private String creditRating; - - @Schema(description = "科创分") - private String cechnologyScore; - - @Schema(description = "科创等级") - private String cechnologyLevel; - - @Schema(description = "是否小微企业") - private String smallEnterprise; - - - @Schema(description = "项目网址") - private String url; - - @Schema(description = "类型") - private Integer type; - - @Schema(description = "上级id, 0是顶级") - private Integer parentId; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "记录数") - private Integer creditAdministrativeLicense; - - @Schema(description = "记录数") - private Integer creditBankruptcy; - - @Schema(description = "记录数") - private Integer creditBranch; - - @Schema(description = "记录数") - private Integer creditBreachOfTrust; - - @Schema(description = "记录数") - private Integer creditCaseFiling; - - @Schema(description = "记录数") - private Integer creditCompetitor; - - @Schema(description = "记录数") - private Integer creditCourtAnnouncement; - - @Schema(description = "记录数") - private Integer creditCourtSession; - - @Schema(description = "记录数") - private Integer creditCustomer; - - @Schema(description = "记录数") - private Integer creditDeliveryNotice; - - @Schema(description = "记录数") - private Integer creditExternal; - - @Schema(description = "记录数") - private Integer creditFinalVersion; - - @Schema(description = "记录数") - private Integer creditGqdj; - - @Schema(description = "记录数") - private Integer creditHistoricalLegalPerson; - - @Schema(description = "记录数") - private Integer creditJudgmentDebtor; - - @Schema(description = "记录数") - private Integer creditJudicialDocument; - - @Schema(description = "记录数") - private Integer creditJudiciary; - - @Schema(description = "记录数") - private Integer creditMediation; - - @Schema(description = "记录数") - private Integer creditNearbyCompany; - - @Schema(description = "记录数") - private Integer creditPatent; - - @Schema(description = "记录数") - private Integer creditRiskRelation; - - @Schema(description = "记录数") - private Integer creditSupplier; - - @Schema(description = "记录数") - private Integer creditSuspectedRelationship; - - @Schema(description = "记录数") - private Integer creditUser; - - @Schema(description = "记录数") - private Integer creditXgxf; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditCompetitor.java b/src/main/java/com/gxwebsoft/credit/entity/CreditCompetitor.java deleted file mode 100644 index c7a580c..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditCompetitor.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 竞争对手 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:04 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditCompetitor对象", description = "竞争对手") -public class CreditCompetitor implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "序号") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "企业名称") - private String name; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "法定代表人") - private String legalRepresentative; - - @Schema(description = "注册资本") - private String registeredCapital; - - @Schema(description = "成立日期") - private String establishmentDate; - - @Schema(description = "登记状态") - private String registrationStatus; - - @Schema(description = "所属行业") - private String industry; - - @Schema(description = "所属省份") - private String province; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "所属企业名称") - @TableField(exist = false) - private String mainCompanyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditCourtAnnouncement.java b/src/main/java/com/gxwebsoft/credit/entity/CreditCourtAnnouncement.java deleted file mode 100644 index 1f42e78..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditCourtAnnouncement.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 法院公告司法大数据 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditCourtAnnouncement对象", description = "法院公告司法大数据") -public class CreditCourtAnnouncement implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "当事人") - private String otherPartiesThirdParty; - - @Schema(description = "公告类型") - private String dataType; - - @Schema(description = "公告人") - private String plaintiffAppellant; - - @Schema(description = "刊登日期") - private String occurrenceTime; - - @Schema(description = "被告/被上诉人") - private String appellee; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "涉案金额") - private String involvedAmount; - - @Schema(description = "法院") - private String courtName; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditCourtSession.java b/src/main/java/com/gxwebsoft/credit/entity/CreditCourtSession.java deleted file mode 100644 index 0784d41..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditCourtSession.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 开庭公告司法大数据 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:32 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditCourtSession对象", description = "开庭公告司法大数据") -public class CreditCourtSession implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "数据类型") - private String dataType; - - @Schema(description = "原告/上诉人") - private String plaintiffAppellant; - - @Schema(description = "被告/被上诉人") - private String appellee; - - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Schema(description = "发生时间") - private String occurrenceTime; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "涉案金额") - private String involvedAmount; - - @Schema(description = "法院") - private String courtName; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditCustomer.java b/src/main/java/com/gxwebsoft/credit/entity/CreditCustomer.java deleted file mode 100644 index 522faa5..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditCustomer.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 客户 - * - * @author 科技小王子 - * @since 2025-12-21 21:20:58 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditCustomer对象", description = "客户") -public class CreditCustomer implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "客户") - private String name; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "状态") - private String statusTxt; - - @Schema(description = "销售金额(万元)") - private String price; - - @Schema(description = "公开日期") - private String publicDate; - - @Schema(description = "数据来源") - private String dataSource; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditDeliveryNotice.java b/src/main/java/com/gxwebsoft/credit/entity/CreditDeliveryNotice.java deleted file mode 100644 index e03a4a4..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditDeliveryNotice.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 送达公告司法大数据 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:51 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditDeliveryNotice对象", description = "送达公告司法大数据") -public class CreditDeliveryNotice implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "当事人") - private String otherPartiesThirdParty; - - @Schema(description = "法院") - private String courtName; - - @Schema(description = "发布日期") - private String occurrenceTime; - - @Schema(description = "数据类型") - private String dataType; - - @Schema(description = "原告/上诉人") - private String plaintiffAppellant; - - @Schema(description = "被告/被上诉人") - private String appellee; - - @Schema(description = "涉案金额") - private String involvedAmount; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditExternal.java b/src/main/java/com/gxwebsoft/credit/entity/CreditExternal.java deleted file mode 100644 index e95a42f..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditExternal.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 对外投资 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:11 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditExternal对象", description = "对外投资") -public class CreditExternal implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "被投资企业名称") - private String name; - - @Schema(description = "状态") - private String statusTxt; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "法定代表人") - private String legalRepresentative; - - @Schema(description = "注册资本(金额)") - private String registeredCapital; - - @Schema(description = "成立日期") - private String establishmentDate; - - @Schema(description = "持股比例") - private String shareholdingRatio; - - @Schema(description = "认缴出资额") - private String subscribedInvestmentAmount; - - @Schema(description = "认缴出资日期") - private String subscribedInvestmentDate; - - @Schema(description = "间接持股比例") - private String indirectShareholdingRatio; - - @Schema(description = "投资日期") - private String investmentDate; - - @Schema(description = "所属地区") - private String region; - - @Schema(description = "所属行业") - private String industry; - - @Schema(description = "投资数量") - private Integer investmentCount; - - @Schema(description = "关联产品/机构") - private String relatedProductsInstitutions; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditFinalVersion.java b/src/main/java/com/gxwebsoft/credit/entity/CreditFinalVersion.java deleted file mode 100644 index 868fb2c..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditFinalVersion.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 终本案件 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:19 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditFinalVersion对象", description = "终本案件") -public class CreditFinalVersion implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "被执行人") - private String appellee; - - @Schema(description = "疑似申请执行人") - private String plaintiffAppellant; - - @Schema(description = "未履行金额(元)") - private String unfulfilledAmount; - - @Schema(description = "执行标的(元)") - private String involvedAmount; - - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Schema(description = "执行法院") - private String courtName; - - @Schema(description = "立案日期") - private String occurrenceTime; - - @Schema(description = "终本日期") - private String finalDate; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditGqdj.java b/src/main/java/com/gxwebsoft/credit/entity/CreditGqdj.java deleted file mode 100644 index 9b3c7b9..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditGqdj.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 股权冻结 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:37 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditGqdj对象", description = "股权冻结") -public class CreditGqdj implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "执行通知文书号") - private String caseNumber;; - - @Schema(description = "被执行人") - private String appellee; - - @Schema(description = "冻结股权标的企业") - private String plaintiffAppellant; - - @Schema(description = "被执行人持有股权、其他投资权益数额") - private String involvedAmount; - - @Schema(description = "执行法院") - private String courtName; - - @Schema(description = "类型") - private String dataType; - - @Schema(description = "状态") - private String dataStatus; - - @Schema(description = "详情链接") - private String url; - - @Schema(description = "冻结日期自") - private String freezeDateStart; - - @Schema(description = "冻结日期至") - private String freezeDateEnd; - - @Schema(description = "公示日期") - private String publicDate; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditHistoricalLegalPerson.java b/src/main/java/com/gxwebsoft/credit/entity/CreditHistoricalLegalPerson.java deleted file mode 100644 index f8557e2..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditHistoricalLegalPerson.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 历史法定代表人 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditHistoricalLegalPerson对象", description = "历史法定代表人") -public class CreditHistoricalLegalPerson implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "名称") - private String name; - - @Schema(description = "任职日期") - private String registerDate; - - @Schema(description = "卸任日期") - private String publicDate; - - @Schema(description = "链接") - private String url; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "主体企业") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditJudgmentDebtor.java b/src/main/java/com/gxwebsoft/credit/entity/CreditJudgmentDebtor.java deleted file mode 100644 index 9e1e4fc..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditJudgmentDebtor.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 被执行人 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:55 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditJudgmentDebtor对象", description = "被执行人") -public class CreditJudgmentDebtor implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "被执行人名称") - private String name; - - @Schema(description = "被执行人") - private String name1; - - @Schema(description = "证件号/组织机构代码") - private String code; - - @Schema(description = "项目网址") - private String url; - - @Schema(description = "发生时间") - private String occurrenceTime; - - @Schema(description = "执行标的(元)") - private String amount; - - @Schema(description = "法院") - private String courtName; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - - @Schema(description = "历史被执行人ID") - @TableField(exist = false) - private Integer historyId; - - @Schema(description = "历史被执行人名称") - @TableField(exist = false) - private String historyName; - - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditJudicialDocument.java b/src/main/java/com/gxwebsoft/credit/entity/CreditJudicialDocument.java deleted file mode 100644 index 0956b7e..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditJudicialDocument.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 裁判文书司法大数据 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:02 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditJudicialDocument对象", description = "裁判文书司法大数据") -public class CreditJudicialDocument implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "文书标题") - private String title; - - @Schema(description = "文书类型") - private String type; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "当事人") - private String otherPartiesThirdParty; - - @Schema(description = "案件金额(元)") - private String involvedAmount; - - @Schema(description = "裁判结果") - private String defendantAppellee; - - @Schema(description = "裁判日期") - private String occurrenceTime; - - @Schema(description = "发布日期") - private String releaseDate; - - @Schema(description = "被告/被上诉人") - private String appellee; - - @Schema(description = "法院") - private String courtName; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditJudiciary.java b/src/main/java/com/gxwebsoft/credit/entity/CreditJudiciary.java deleted file mode 100644 index 7fcb938..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditJudiciary.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 司法案件 - * - * @author 科技小王子 - * @since 2025-12-16 15:23:58 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditJudiciary对象", description = "司法案件") -public class CreditJudiciary implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "案件名称") - private String name; - - @Schema(description = "案号") - private String code; - - @Schema(description = "详情链接") - private String url; - - @Schema(description = "类型, 0普通用户, 1招投标") - private Integer type; - - @Schema(description = "案由") - private String reason; - - @Schema(description = "上级id, 0是顶级") - private Integer parentId; - - @Schema(description = "案件类型") - private String infoType; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "街道地址") - private String address; - - @Schema(description = "案件进程") - private String caseProgress; - - @Schema(description = "案件身份") - private String caseIdentity; - - @Schema(description = "法院") - private String court; - - @Schema(description = "进程日期") - private String processDate; - - @Schema(description = "案件金额(元)") - private String caseAmount; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expirationTime; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditMediation.java b/src/main/java/com/gxwebsoft/credit/entity/CreditMediation.java deleted file mode 100644 index b7d2b42..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditMediation.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 诉前调解司法大数据 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:25 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditMediation对象", description = "诉前调解司法大数据") -public class CreditMediation implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "数据类型") - private String dataType; - - @Schema(description = "原告/上诉人") - private String plaintiffAppellant; - - @Schema(description = "被告/被上诉人") - private String appellee; - - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Schema(description = "发生时间") - private String occurrenceTime; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "涉案金额") - private String involvedAmount; - - @Schema(description = "法院") - private String courtName; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - - @Schema(description = "发生时间") - @TableField(exist = false) - private String occurrenceTime2; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditNearbyCompany.java b/src/main/java/com/gxwebsoft/credit/entity/CreditNearbyCompany.java deleted file mode 100644 index 6c844eb..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditNearbyCompany.java +++ /dev/null @@ -1,234 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 附近企业 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditNearbyCompany对象", description = "附近企业") -public class CreditNearbyCompany implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "企业名称") - private String name; - - @Schema(description = "登记状态") - private String registrationStatus; - - @Schema(description = "法定代表人") - private String legalPerson; - - @Schema(description = "注册资本") - private String registeredCapital; - - @Schema(description = "成立日期") - private String establishDate; - - @Schema(description = "统一社会信用代码") - private String code; - - @Schema(description = "注册地址") - private String address; - - @Schema(description = "注册地址邮编") - private String postalCode; - - @Schema(description = "有效手机号") - private String phone; - - @Schema(description = "更多电话") - private String moreTel; - - @Schema(description = "邮箱") - private String email; - - @Schema(description = "邮箱") - private String moreEmail; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "所属省份") - private String province; - - @Schema(description = "所属城市") - private String city; - - @Schema(description = "所属区县") - private String region; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "主体企业") - @TableField(exist = false) - private String companyName; - - @Schema(description = "纳税人识别号") - private String taxpayerCode; - - @Schema(description = "注册号") - private String registrationNumber; - - @Schema(description = "组织机构代码") - private String organizationalCode; - - @Schema(description = "参保人数") - private String numberOfInsuredPersons; - - @Schema(description = "参保人数所属年报") - private String annualReport; - - @Schema(description = "企业(机构)类型") - private String institutionType; - - @Schema(description = "企业规模") - private String companySize; - - @Schema(description = "营业期限") - private String businessTerm; - - @Schema(description = "国标行业门类") - private String nationalStandardIndustryCategories; - - @Schema(description = "国标行业大类") - private String nationalStandardIndustryCategories2; - - @Schema(description = "国标行业中类") - private String nationalStandardIndustryCategories3; - - @Schema(description = "国标行业小类") - private String nationalStandardIndustryCategories4; - - @Schema(description = "曾用名") - private String formerName; - - @Schema(description = "英文名") - private String englishName; - - @Schema(description = "官网网址") - private String domain; - - @Schema(description = "通信地址") - private String mailingAddress; - - @Schema(description = "通信地址邮箱") - private String mailingEmail; - - @Schema(description = "企业简介") - private String companyProfile; - - @Schema(description = "经营范围") - private String natureOfBusiness; - - @Schema(description = "电话") - private String tel; - - @Schema(description = "企查查行业门类") - private String nationalStandardIndustryCategories5; - - @Schema(description = "企查查行业大类") - private String nationalStandardIndustryCategories6; - - @Schema(description = "企查查行业中类") - private String nationalStandardIndustryCategories7; - - @Schema(description = "企查查行业小类") - private String nationalStandardIndustryCategories8; - - @Schema(description = "链接") - private String url; - - @Schema(description = "类型") - private Integer type; - - @Schema(description = "上级id, 0是顶级") - private Integer parentId; - - @Schema(description = "实缴资本") - private String paidinCapital; - - @Schema(description = "登记机关") - private String registrationAuthority; - - @Schema(description = "纳税人资质") - private String taxpayerQualification; - - @Schema(description = "最新年报年份") - private String latestAnnualReportYear; - - @Schema(description = "最新年报营业收入") - private String latestAnnualReportOnOperatingRevenue; - - @Schema(description = "企查分") - private String enterpriseScoreCheck; - - @Schema(description = "信用等级") - private String creditRating; - - @Schema(description = "科创分") - private String cechnologyScore; - - @Schema(description = "科创等级") - private String cechnologyLevel; - - @Schema(description = "是否小微企业") - private String smallEnterprise; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditPatent.java b/src/main/java/com/gxwebsoft/credit/entity/CreditPatent.java deleted file mode 100644 index a45177b..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditPatent.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 专利 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditPatent对象", description = "专利") -public class CreditPatent implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "发明名称") - private String name; - - @Schema(description = "专利类型") - private String type; - - @Schema(description = "法律状态") - private String statusText; - - @Schema(description = "申请号") - private String registerNo; - - @Schema(description = "申请日") - private String registerDate; - - @Schema(description = "公开(公告)号") - private String publicNo; - - @Schema(description = "公开(公告)日期") - private String publicDate; - - @Schema(description = "发明人") - private String inventor; - - @Schema(description = "申请(专利权)人") - private String patentApplicant; - - @Schema(description = "链接") - private String url; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "主体企业") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditRiskRelation.java b/src/main/java/com/gxwebsoft/credit/entity/CreditRiskRelation.java deleted file mode 100644 index 1d75ff2..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditRiskRelation.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 风险关系表 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:40 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditRiskRelation对象", description = "风险关系表") -public class CreditRiskRelation implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "序号") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "主体名称") - private String mainBodyName; - - @Schema(description = "登记状态") - private String registrationStatus; - - @Schema(description = "注册资本") - private String registeredCapital; - - @Schema(description = "省份地区") - private String provinceRegion; - - @Schema(description = "关联关系") - private String associatedRelation; - - @Schema(description = "风险关系") - private String riskRelation; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditSupplier.java b/src/main/java/com/gxwebsoft/credit/entity/CreditSupplier.java deleted file mode 100644 index ceb4ff0..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditSupplier.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 供应商 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:47 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditSupplier对象", description = "供应商") -public class CreditSupplier implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "供应商") - private String supplier; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "状态") - private String statusTxt; - - @Schema(description = "采购金额(万元)") - private String purchaseAmount; - - @Schema(description = "公开日期") - private String publicDate; - - @Schema(description = "数据来源") - private String dataSource; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditSuspectedRelationship.java b/src/main/java/com/gxwebsoft/credit/entity/CreditSuspectedRelationship.java deleted file mode 100644 index 41898c8..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditSuspectedRelationship.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 疑似关系 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditSuspectedRelationship对象", description = "疑似关系") -public class CreditSuspectedRelationship implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "企业名称") - private String name; - - @Schema(description = "状态") - private String statusText; - - @Schema(description = "法定代表人") - private String legalPerson; - - @Schema(description = "注册资本") - private String registeredCapital; - - @Schema(description = "成立日期") - private String createDate; - - @Schema(description = "关联方") - private String relatedParty; - - @Schema(description = "疑似关系类型") - private String type; - - @Schema(description = "疑似关系详情") - private String detail; - - @Schema(description = "链接") - private String url; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "主体企业") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditUser.java b/src/main/java/com/gxwebsoft/credit/entity/CreditUser.java deleted file mode 100644 index 1407eb1..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditUser.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import com.fasterxml.jackson.annotation.JsonFormat; - -/** - * 招投标信息表 - * - * @author 科技小王子 - * @since 2025-12-15 13:16:03 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditUser对象", description = "招投标信息表") -public class CreditUser implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "项目名称") - private String name; - - @Schema(description = "项目网址") - private String url; - - @Schema(description = "唯一标识") - private String code; - - @Schema(description = "类型, 0普通用户, 1招投标") - private Integer type; - - @Schema(description = "企业角色") - private String role; - - @Schema(description = "上级id, 0是顶级") - private Integer parentId; - - @Schema(description = "信息类型") - private String infoType; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "街道地址") - private String address; - - @Schema(description = "招采单位") - private String procurementName; - - @Schema(description = "中标单位") - private String winningName; - - @Schema(description = "中标金额") - private String winningPrice; - - @Schema(description = "发布日期") - private String releaseDate; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/entity/CreditXgxf.java b/src/main/java/com/gxwebsoft/credit/entity/CreditXgxf.java deleted file mode 100644 index 4859bd8..0000000 --- a/src/main/java/com/gxwebsoft/credit/entity/CreditXgxf.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.gxwebsoft.credit.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * 限制高消费 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:55 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "CreditXgxf对象", description = "限制高消费") -public class CreditXgxf implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "数据类型") - private String type; - - @Schema(description = "限消令对象") - private String dataType; - - @Schema(description = "限制法定代表人") - private String plaintiffAppellant; - - @Schema(description = "申请人") - private String appellee; - - @Schema(description = "原告/上诉人") - private String plaintiffUser; - - @Schema(description = "被告/被上诉人") - private String defendantUser; - - @Schema(description = "涉案金额(元)") - private String involvedAmount; - - @Schema(description = "立案日期") - private String occurrenceTime; - - @Schema(description = "执行法院") - private String courtName; - - @Schema(description = "发布日期") - private String releaseDate; - - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "是否有数据") - private Boolean hasData; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditAdministrativeLicenseMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditAdministrativeLicenseMapper.java deleted file mode 100644 index 7f81ff0..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditAdministrativeLicenseMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditAdministrativeLicense; -import com.gxwebsoft.credit.param.CreditAdministrativeLicenseParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 行政许可Mapper - * - * @author 科技小王子 - * @since 2026-01-07 13:52:13 - */ -public interface CreditAdministrativeLicenseMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditAdministrativeLicenseParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditAdministrativeLicenseParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditBankruptcyMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditBankruptcyMapper.java deleted file mode 100644 index 50ed5b5..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditBankruptcyMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditBankruptcy; -import com.gxwebsoft.credit.param.CreditBankruptcyParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 破产重整Mapper - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -public interface CreditBankruptcyMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditBankruptcyParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditBankruptcyParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditBranchMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditBranchMapper.java deleted file mode 100644 index 3f4877c..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditBranchMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditBranch; -import com.gxwebsoft.credit.param.CreditBranchParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 分支机构Mapper - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -public interface CreditBranchMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditBranchParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditBranchParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditBreachOfTrustMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditBreachOfTrustMapper.java deleted file mode 100644 index 70da1c3..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditBreachOfTrustMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditBreachOfTrust; -import com.gxwebsoft.credit.param.CreditBreachOfTrustParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 失信被执行人Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:46:14 - */ -public interface CreditBreachOfTrustMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditBreachOfTrustParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditBreachOfTrustParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditCaseFilingMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditCaseFilingMapper.java deleted file mode 100644 index 8bfd804..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditCaseFilingMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditCaseFiling; -import com.gxwebsoft.credit.param.CreditCaseFilingParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 司法大数据Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:47:22 - */ -public interface CreditCaseFilingMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditCaseFilingParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditCaseFilingParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditCompanyMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditCompanyMapper.java deleted file mode 100644 index bbd7c01..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditCompanyMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditCompany; -import com.gxwebsoft.credit.param.CreditCompanyParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 企业Mapper - * - * @author 科技小王子 - * @since 2025-12-17 08:28:03 - */ -public interface CreditCompanyMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditCompanyParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditCompanyParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditCompetitorMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditCompetitorMapper.java deleted file mode 100644 index fad9fa7..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditCompetitorMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditCompetitor; -import com.gxwebsoft.credit.param.CreditCompetitorParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 竞争对手Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:49:04 - */ -public interface CreditCompetitorMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditCompetitorParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditCompetitorParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditCourtAnnouncementMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditCourtAnnouncementMapper.java deleted file mode 100644 index 5c6eb80..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditCourtAnnouncementMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditCourtAnnouncement; -import com.gxwebsoft.credit.param.CreditCourtAnnouncementParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 法院公告司法大数据Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:49:13 - */ -public interface CreditCourtAnnouncementMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditCourtAnnouncementParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditCourtAnnouncementParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditCourtSessionMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditCourtSessionMapper.java deleted file mode 100644 index c9dd2e1..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditCourtSessionMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditCourtSession; -import com.gxwebsoft.credit.param.CreditCourtSessionParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 开庭公告司法大数据Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:49:32 - */ -public interface CreditCourtSessionMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditCourtSessionParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditCourtSessionParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditCustomerMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditCustomerMapper.java deleted file mode 100644 index 6866565..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditCustomerMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditCustomer; -import com.gxwebsoft.credit.param.CreditCustomerParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 客户Mapper - * - * @author 科技小王子 - * @since 2025-12-21 21:20:58 - */ -public interface CreditCustomerMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditCustomerParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditCustomerParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditDeliveryNoticeMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditDeliveryNoticeMapper.java deleted file mode 100644 index 66ce505..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditDeliveryNoticeMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditDeliveryNotice; -import com.gxwebsoft.credit.param.CreditDeliveryNoticeParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 送达公告司法大数据Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:49:51 - */ -public interface CreditDeliveryNoticeMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditDeliveryNoticeParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditDeliveryNoticeParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditExternalMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditExternalMapper.java deleted file mode 100644 index de61c9f..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditExternalMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditExternal; -import com.gxwebsoft.credit.param.CreditExternalParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 对外投资Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:50:11 - */ -public interface CreditExternalMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditExternalParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditExternalParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditFinalVersionMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditFinalVersionMapper.java deleted file mode 100644 index dd4ef4a..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditFinalVersionMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditFinalVersion; -import com.gxwebsoft.credit.param.CreditFinalVersionParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 终本案件Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:50:19 - */ -public interface CreditFinalVersionMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditFinalVersionParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditFinalVersionParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditGqdjMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditGqdjMapper.java deleted file mode 100644 index 6cc6df7..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditGqdjMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditGqdj; -import com.gxwebsoft.credit.param.CreditGqdjParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 股权冻结Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:50:37 - */ -public interface CreditGqdjMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditGqdjParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditGqdjParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditHistoricalLegalPersonMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditHistoricalLegalPersonMapper.java deleted file mode 100644 index d13adee..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditHistoricalLegalPersonMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditHistoricalLegalPerson; -import com.gxwebsoft.credit.param.CreditHistoricalLegalPersonParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 历史法定代表人Mapper - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -public interface CreditHistoricalLegalPersonMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditHistoricalLegalPersonParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditHistoricalLegalPersonParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditJudgmentDebtorMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditJudgmentDebtorMapper.java deleted file mode 100644 index 13ef10f..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditJudgmentDebtorMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditJudgmentDebtor; -import com.gxwebsoft.credit.param.CreditJudgmentDebtorParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 被执行人Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:50:55 - */ -public interface CreditJudgmentDebtorMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditJudgmentDebtorParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditJudgmentDebtorParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditJudicialDocumentMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditJudicialDocumentMapper.java deleted file mode 100644 index 46356c6..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditJudicialDocumentMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditJudicialDocument; -import com.gxwebsoft.credit.param.CreditJudicialDocumentParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 裁判文书司法大数据Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:51:02 - */ -public interface CreditJudicialDocumentMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditJudicialDocumentParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditJudicialDocumentParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditJudiciaryMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditJudiciaryMapper.java deleted file mode 100644 index 85c3efa..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditJudiciaryMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditJudiciary; -import com.gxwebsoft.credit.param.CreditJudiciaryParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 司法案件Mapper - * - * @author 科技小王子 - * @since 2025-12-16 15:23:58 - */ -public interface CreditJudiciaryMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditJudiciaryParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditJudiciaryParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditMediationMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditMediationMapper.java deleted file mode 100644 index f46225b..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditMediationMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditMediation; -import com.gxwebsoft.credit.param.CreditMediationParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 诉前调解司法大数据Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:51:25 - */ -public interface CreditMediationMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditMediationParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditMediationParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditNearbyCompanyMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditNearbyCompanyMapper.java deleted file mode 100644 index c557744..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditNearbyCompanyMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditNearbyCompany; -import com.gxwebsoft.credit.param.CreditNearbyCompanyParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 附近企业Mapper - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -public interface CreditNearbyCompanyMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditNearbyCompanyParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditNearbyCompanyParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditPatentMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditPatentMapper.java deleted file mode 100644 index bb5628a..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditPatentMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditPatent; -import com.gxwebsoft.credit.param.CreditPatentParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 专利Mapper - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -public interface CreditPatentMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditPatentParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditPatentParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditRiskRelationMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditRiskRelationMapper.java deleted file mode 100644 index 077c758..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditRiskRelationMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditRiskRelation; -import com.gxwebsoft.credit.param.CreditRiskRelationParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 风险关系表Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:51:40 - */ -public interface CreditRiskRelationMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditRiskRelationParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditRiskRelationParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditSupplierMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditSupplierMapper.java deleted file mode 100644 index fd6d687..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditSupplierMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditSupplier; -import com.gxwebsoft.credit.param.CreditSupplierParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 供应商Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:51:47 - */ -public interface CreditSupplierMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditSupplierParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditSupplierParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditSuspectedRelationshipMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditSuspectedRelationshipMapper.java deleted file mode 100644 index 4e05d9c..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditSuspectedRelationshipMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditSuspectedRelationship; -import com.gxwebsoft.credit.param.CreditSuspectedRelationshipParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 疑似关系Mapper - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -public interface CreditSuspectedRelationshipMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditSuspectedRelationshipParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditSuspectedRelationshipParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditUserMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditUserMapper.java deleted file mode 100644 index dd1372c..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditUserMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditUser; -import com.gxwebsoft.credit.param.CreditUserParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 招投标信息表Mapper - * - * @author 科技小王子 - * @since 2025-12-15 13:16:03 - */ -public interface CreditUserMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditUserParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditUserParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/CreditXgxfMapper.java b/src/main/java/com/gxwebsoft/credit/mapper/CreditXgxfMapper.java deleted file mode 100644 index c63d8f5..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/CreditXgxfMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.credit.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.credit.entity.CreditXgxf; -import com.gxwebsoft.credit.param.CreditXgxfParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 限制高消费Mapper - * - * @author 科技小王子 - * @since 2025-12-19 19:51:55 - */ -public interface CreditXgxfMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") CreditXgxfParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") CreditXgxfParam param); - -} diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditAdministrativeLicenseMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditAdministrativeLicenseMapper.xml deleted file mode 100644 index 68cfa78..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditAdministrativeLicenseMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_administrative_license a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.status_text LIKE CONCAT('%', #{param.statusText}, '%') - - - AND a.type LIKE CONCAT('%', #{param.type}, '%') - - - AND a.url LIKE CONCAT('%', #{param.url}, '%') - - - AND a.validity_start LIKE CONCAT('%', #{param.validityStart}, '%') - - - AND a.validity_end LIKE CONCAT('%', #{param.validityEnd}, '%') - - - AND a.licensing_authority LIKE CONCAT('%', #{param.licensingAuthority}, '%') - - - AND a.License_content LIKE CONCAT('%', #{param.licenseContent}, '%') - - - AND a.data_source_unit LIKE CONCAT('%', #{param.dataSourceUnit}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.company_id = #{param.companyId} - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.code LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditBankruptcyMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditBankruptcyMapper.xml deleted file mode 100644 index 4015535..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditBankruptcyMapper.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_bankruptcy a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - - AND a.id = #{param.id} - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.type LIKE CONCAT('%', #{param.type}, '%') - - - AND a.party LIKE CONCAT('%', #{param.party}, '%') - - - AND a.url LIKE CONCAT('%', #{param.url}, '%') - - - AND a.court LIKE CONCAT('%', #{param.court}, '%') - - - AND a.public_date LIKE CONCAT('%', #{param.publicDate}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.company_id = #{param.companyId} - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.code LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditBranchMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditBranchMapper.xml deleted file mode 100644 index d5e33ea..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditBranchMapper.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_branch a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.curator LIKE CONCAT('%', #{param.curator}, '%') - - - AND a.region LIKE CONCAT('%', #{param.region}, '%') - - - AND a.url LIKE CONCAT('%', #{param.url}, '%') - - - AND a.establish_date LIKE CONCAT('%', #{param.establishDate}, '%') - - - AND a.status_text LIKE CONCAT('%', #{param.statusText}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.company_id = #{param.companyId} - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.curator LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditBreachOfTrustMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditBreachOfTrustMapper.xml deleted file mode 100644 index e82aa24..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditBreachOfTrustMapper.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_breach_of_trust a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.plaintiff_appellant LIKE CONCAT('%', #{param.plaintiffAppellant}, '%') - - - AND a.appellee LIKE CONCAT('%', #{param.appellee}, '%') - - - AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%') - - - AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%') - - - AND a.involved_amount = #{param.involvedAmount} - - - AND a.court_name LIKE CONCAT('%', #{param.courtName}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR a.case_number = #{param.keywords} - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.case_number LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCaseFilingMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCaseFilingMapper.xml deleted file mode 100644 index b0e4a32..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCaseFilingMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_case_filing a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.data_type LIKE CONCAT('%', #{param.dataType}, '%') - - - AND a.plaintiff_appellant LIKE CONCAT('%', #{param.plaintiffAppellant}, '%') - - - AND a.appellee LIKE CONCAT('%', #{param.appellee}, '%') - - - AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%') - - - AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%') - - - AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%') - - - AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%') - - - AND a.involved_amount = #{param.involvedAmount} - - - AND a.court_name LIKE CONCAT('%', #{param.courtName}, '%') - - - AND a.data_status LIKE CONCAT('%', #{param.dataStatus}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.case_number LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCompanyMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCompanyMapper.xml deleted file mode 100644 index ef07f47..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCompanyMapper.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - SELECT a.*, u.real_name AS realName - FROM credit_company a - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.match_name LIKE CONCAT('%', #{param.matchName}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.type = #{param.type} - - - AND a.parent_id = #{param.parentId} - - - AND a.registration_status LIKE CONCAT('%', #{param.registrationStatus}, '%') - - - AND a.legal_person LIKE CONCAT('%', #{param.legalPerson}, '%') - - - AND a.registered_capital LIKE CONCAT('%', #{param.registeredCapital}, '%') - - - AND a.paidin_capital LIKE CONCAT('%', #{param.paidinCapital}, '%') - - - AND a.establish_date LIKE CONCAT('%', #{param.establishDate}, '%') - - - AND a.address LIKE CONCAT('%', #{param.address}, '%') - - - AND a.tel LIKE CONCAT('%', #{param.tel}, '%') - - - AND a.more_tel LIKE CONCAT('%', #{param.moreTel}, '%') - - - AND a.email LIKE CONCAT('%', #{param.email}, '%') - - - AND a.more_email LIKE CONCAT('%', #{param.moreEmail}, '%') - - - AND a.country LIKE CONCAT('%', #{param.country}, '%') - - - AND a.province LIKE CONCAT('%', #{param.province}, '%') - - - AND a.city LIKE CONCAT('%', #{param.city}, '%') - - - AND a.region LIKE CONCAT('%', #{param.region}, '%') - - - AND a.institution_type LIKE CONCAT('%', #{param.institutionType}, '%') - - - AND a.taxpayer_code LIKE CONCAT('%', #{param.taxpayerCode}, '%') - - - AND a.registration_number LIKE CONCAT('%', #{param.registrationNumber}, '%') - - - AND a.organizational_code LIKE CONCAT('%', #{param.organizationalCode}, '%') - - - AND a.number_of_insured_persons LIKE CONCAT('%', #{param.numberOfInsuredPersons}, '%') - - - AND a.annual_report LIKE CONCAT('%', #{param.annualReport}, '%') - - - AND a.business_term LIKE CONCAT('%', #{param.businessTerm}, '%') - - - AND a.national_standard_industry_categories LIKE CONCAT('%', #{param.nationalStandardIndustryCategories}, '%') - - - AND a.national_standard_industry_categories2 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories2}, '%') - - - AND a.national_standard_industry_categories3 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories3}, '%') - - - AND a.national_standard_industry_categories4 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories4}, '%') - - - AND a.national_standard_industry_categories5 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories5}, '%') - - - AND a.national_standard_industry_categories6 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories6}, '%') - - - AND a.national_standard_industry_categories7 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories7}, '%') - - - AND a.national_standard_industry_categories8 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories8}, '%') - - - AND a.company_size LIKE CONCAT('%', #{param.companySize}, '%') - - - AND a.former_name LIKE CONCAT('%', #{param.formerName}, '%') - - - AND a.english_name LIKE CONCAT('%', #{param.englishName}, '%') - - - AND a.domain LIKE CONCAT('%', #{param.domain}, '%') - - - AND a.mailing_address LIKE CONCAT('%', #{param.mailingAddress}, '%') - - - AND a.company_profile LIKE CONCAT('%', #{param.companyProfile}, '%') - - - AND a.nature_of_business LIKE CONCAT('%', #{param.natureOfBusiness}, '%') - - - AND a.registration_authority LIKE CONCAT('%', #{param.registrationAuthority}, '%') - - - AND a.taxpayer_qualification LIKE CONCAT('%', #{param.taxpayerQualification}, '%') - - - AND a.latest_annual_report_year LIKE CONCAT('%', #{param.latestAnnualReportYear}, '%') - - - AND a.latest_annual_report_on_operating_revenue LIKE CONCAT('%', #{param.latestAnnualReportOnOperatingRevenue}, '%') - - - AND a.enterprise_score_check LIKE CONCAT('%', #{param.enterpriseScoreCheck}, '%') - - - AND a.credit_rating LIKE CONCAT('%', #{param.creditRating}, '%') - - - AND a.cechnology_score LIKE CONCAT('%', #{param.cechnologyScore}, '%') - - - AND a.cechnology_level LIKE CONCAT('%', #{param.cechnologyLevel}, '%') - - - AND a.small_enterprise LIKE CONCAT('%', #{param.smallEnterprise}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.match_name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.code = #{param.keywords} - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCompetitorMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCompetitorMapper.xml deleted file mode 100644 index 744416b..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCompetitorMapper.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_competitor a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.legal_representative LIKE CONCAT('%', #{param.legalRepresentative}, '%') - - - AND a.registered_capital = #{param.registeredCapital} - - - AND a.establishment_date LIKE CONCAT('%', #{param.establishmentDate}, '%') - - - AND a.registration_status LIKE CONCAT('%', #{param.registrationStatus}, '%') - - - AND a.industry LIKE CONCAT('%', #{param.industry}, '%') - - - AND a.province LIKE CONCAT('%', #{param.province}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR a.name LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCourtAnnouncementMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCourtAnnouncementMapper.xml deleted file mode 100644 index 6877424..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCourtAnnouncementMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_court_announcement a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.data_type LIKE CONCAT('%', #{param.dataType}, '%') - - - AND a.plaintiff_appellant LIKE CONCAT('%', #{param.plaintiffAppellant}, '%') - - - AND a.appellee LIKE CONCAT('%', #{param.appellee}, '%') - - - AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%') - - - AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%') - - - AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%') - - - AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%') - - - AND a.involved_amount = #{param.involvedAmount} - - - AND a.court_name LIKE CONCAT('%', #{param.courtName}, '%') - - - AND a.data_status LIKE CONCAT('%', #{param.dataStatus}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.case_number LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCourtSessionMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCourtSessionMapper.xml deleted file mode 100644 index 41c0cec..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCourtSessionMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_court_session a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.data_type LIKE CONCAT('%', #{param.dataType}, '%') - - - AND a.plaintiff_appellant LIKE CONCAT('%', #{param.plaintiffAppellant}, '%') - - - AND a.appellee LIKE CONCAT('%', #{param.appellee}, '%') - - - AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%') - - - AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%') - - - AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%') - - - AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%') - - - AND a.involved_amount = #{param.involvedAmount} - - - AND a.court_name LIKE CONCAT('%', #{param.courtName}, '%') - - - AND a.data_status LIKE CONCAT('%', #{param.dataStatus}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.case_number LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCustomerMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCustomerMapper.xml deleted file mode 100644 index cf00890..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditCustomerMapper.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_customer a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.status_txt LIKE CONCAT('%', #{param.statusTxt}, '%') - - - AND a.price = #{param.price} - - - AND a.public_date LIKE CONCAT('%', #{param.publicDate}, '%') - - - AND a.data_source LIKE CONCAT('%', #{param.dataSource}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.name LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditDeliveryNoticeMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditDeliveryNoticeMapper.xml deleted file mode 100644 index cb22c50..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditDeliveryNoticeMapper.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_delivery_notice a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%') - - - AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%') - - - AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%') - - - AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%') - - - AND a.court_name LIKE CONCAT('%', #{param.courtName}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.case_number LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditExternalMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditExternalMapper.xml deleted file mode 100644 index 94e2362..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditExternalMapper.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_external a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.status_txt LIKE CONCAT('%', #{param.statusTxt}, '%') - - - AND a.legal_representative LIKE CONCAT('%', #{param.legalRepresentative}, '%') - - - AND a.registered_capital = #{param.registeredCapital} - - - AND a.establishment_date LIKE CONCAT('%', #{param.establishmentDate}, '%') - - - AND a.shareholding_ratio = #{param.shareholdingRatio} - - - AND a.subscribed_investment_amount = #{param.subscribedInvestmentAmount} - - - AND a.subscribed_investment_date LIKE CONCAT('%', #{param.subscribedInvestmentDate}, '%') - - - AND a.indirect_shareholding_ratio = #{param.indirectShareholdingRatio} - - - AND a.investment_date LIKE CONCAT('%', #{param.investmentDate}, '%') - - - AND a.region LIKE CONCAT('%', #{param.region}, '%') - - - AND a.industry LIKE CONCAT('%', #{param.industry}, '%') - - - AND a.investment_count = #{param.investmentCount} - - - AND a.related_products_institutions LIKE CONCAT('%', #{param.relatedProductsInstitutions}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.name LIKE CONCAT('%', #{param.name}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditFinalVersionMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditFinalVersionMapper.xml deleted file mode 100644 index 630e357..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditFinalVersionMapper.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_final_version a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.plaintiff_appellant LIKE CONCAT('%', #{param.plaintiffAppellant}, '%') - - - AND a.appellee LIKE CONCAT('%', #{param.appellee}, '%') - - - AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%') - - - AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%') - - - AND a.involved_amount = #{param.involvedAmount} - - - AND a.court_name LIKE CONCAT('%', #{param.courtName}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.case_number = #{param.keywords} - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditGqdjMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditGqdjMapper.xml deleted file mode 100644 index 6c90a51..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditGqdjMapper.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_gqdj a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.data_type LIKE CONCAT('%', #{param.dataType}, '%') - - - AND a.plaintiff_appellant LIKE CONCAT('%', #{param.plaintiffAppellant}, '%') - - - AND a.appellee LIKE CONCAT('%', #{param.appellee}, '%') - - - AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%') - - - AND a.involved_amount = #{param.involvedAmount} - - - AND a.court_name LIKE CONCAT('%', #{param.courtName}, '%') - - - AND a.data_status LIKE CONCAT('%', #{param.dataStatus}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.case_number = #{param.keywords} - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditHistoricalLegalPersonMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditHistoricalLegalPersonMapper.xml deleted file mode 100644 index 2d25fd4..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditHistoricalLegalPersonMapper.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_historical_legal_person a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.register_date LIKE CONCAT('%', #{param.registerDate}, '%') - - - AND a.public_date LIKE CONCAT('%', #{param.publicDate}, '%') - - - AND a.url LIKE CONCAT('%', #{param.url}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.company_id = #{param.companyId} - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.name LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditJudgmentDebtorMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditJudgmentDebtorMapper.xml deleted file mode 100644 index c03a9ee..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditJudgmentDebtorMapper.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_judgment_debtor a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%') - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%') - - - AND a.amount = #{param.amount} - - - AND a.court_name LIKE CONCAT('%', #{param.courtName}, '%') - - - AND a.data_status LIKE CONCAT('%', #{param.dataStatus}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR a.case_number = #{param.keywords} - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.case_number LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditJudicialDocumentMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditJudicialDocumentMapper.xml deleted file mode 100644 index 8f2521c..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditJudicialDocumentMapper.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_judicial_document a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.title LIKE CONCAT('%', #{param.title}, '%') - - - AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%') - - - AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%') - - - AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%') - - - AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%') - - - AND a.involved_amount = #{param.involvedAmount} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.case_number LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditJudiciaryMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditJudiciaryMapper.xml deleted file mode 100644 index 9b69e2f..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditJudiciaryMapper.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_judiciary a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.type = #{param.type} - - - AND a.reason LIKE CONCAT('%', #{param.reason}, '%') - - - AND a.parent_id = #{param.parentId} - - - AND a.info_type LIKE CONCAT('%', #{param.infoType}, '%') - - - AND a.country LIKE CONCAT('%', #{param.country}, '%') - - - AND a.province LIKE CONCAT('%', #{param.province}, '%') - - - AND a.city LIKE CONCAT('%', #{param.city}, '%') - - - AND a.region LIKE CONCAT('%', #{param.region}, '%') - - - AND a.address LIKE CONCAT('%', #{param.address}, '%') - - - AND a.case_progress LIKE CONCAT('%', #{param.caseProgress}, '%') - - - AND a.case_identity LIKE CONCAT('%', #{param.caseIdentity}, '%') - - - AND a.court LIKE CONCAT('%', #{param.court}, '%') - - - AND a.process_date LIKE CONCAT('%', #{param.processDate}, '%') - - - AND a.case_amount LIKE CONCAT('%', #{param.caseAmount}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.name LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.code LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditMediationMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditMediationMapper.xml deleted file mode 100644 index b08bec6..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditMediationMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_mediation a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.data_type LIKE CONCAT('%', #{param.dataType}, '%') - - - AND a.plaintiff_appellant LIKE CONCAT('%', #{param.plaintiffAppellant}, '%') - - - AND a.appellee LIKE CONCAT('%', #{param.appellee}, '%') - - - AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%') - - - AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%') - - - AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%') - - - AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%') - - - AND a.involved_amount = #{param.involvedAmount} - - - AND a.court_name LIKE CONCAT('%', #{param.courtName}, '%') - - - AND a.data_status LIKE CONCAT('%', #{param.dataStatus}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.case_number LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditNearbyCompanyMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditNearbyCompanyMapper.xml deleted file mode 100644 index c461f3e..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditNearbyCompanyMapper.xml +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - SELECT a.*,b.name AS companyName, u.real_name AS realName - FROM credit_nearby_company a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.company_id = #{param.companyId} - - - AND a.registration_status LIKE CONCAT('%', #{param.registrationStatus}, '%') - - - AND a.legal_person LIKE CONCAT('%', #{param.legalPerson}, '%') - - - AND a.registered_capital LIKE CONCAT('%', #{param.registeredCapital}, '%') - - - AND a.establish_date LIKE CONCAT('%', #{param.establishDate}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.address LIKE CONCAT('%', #{param.address}, '%') - - - AND a.postal_code LIKE CONCAT('%', #{param.postalCode}, '%') - - - AND a.phone LIKE CONCAT('%', #{param.phone}, '%') - - - AND a.more_tel LIKE CONCAT('%', #{param.moreTel}, '%') - - - AND a.email LIKE CONCAT('%', #{param.email}, '%') - - - AND a.more_email LIKE CONCAT('%', #{param.moreEmail}, '%') - - - AND a.country LIKE CONCAT('%', #{param.country}, '%') - - - AND a.province LIKE CONCAT('%', #{param.province}, '%') - - - AND a.city LIKE CONCAT('%', #{param.city}, '%') - - - AND a.region LIKE CONCAT('%', #{param.region}, '%') - - - - - - AND a.registration_number LIKE CONCAT('%', #{param.registrationNumber}, '%') - - - AND a.organizational_code LIKE CONCAT('%', #{param.organizationalCode}, '%') - - - AND a.number_of_insured_persons LIKE CONCAT('%', #{param.numberOfInsuredPersons}, '%') - - - AND a.annual_report LIKE CONCAT('%', #{param.annualReport}, '%') - - - AND a.institution_type LIKE CONCAT('%', #{param.institutionType}, '%') - - - AND a.company_size LIKE CONCAT('%', #{param.companySize}, '%') - - - AND a.business_term LIKE CONCAT('%', #{param.businessTerm}, '%') - - - AND a.national_standard_industry_categories LIKE CONCAT('%', #{param.nationalStandardIndustryCategories}, '%') - - - AND a.national_standard_industry_categories2 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories2}, '%') - - - AND a.national_standard_industry_categories3 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories3}, '%') - - - AND a.national_standard_industry_categories4 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories4}, '%') - - - AND a.former_name LIKE CONCAT('%', #{param.formerName}, '%') - - - AND a.english_name LIKE CONCAT('%', #{param.englishName}, '%') - - - AND a.domain LIKE CONCAT('%', #{param.domain}, '%') - - - AND a.mailing_address LIKE CONCAT('%', #{param.mailingAddress}, '%') - - - AND a.mailing_email LIKE CONCAT('%', #{param.mailingEmail}, '%') - - - AND a.company_profile LIKE CONCAT('%', #{param.companyProfile}, '%') - - - AND a.nature_of_business LIKE CONCAT('%', #{param.natureOfBusiness}, '%') - - - AND a.tel LIKE CONCAT('%', #{param.tel}, '%') - - - AND a.national_standard_industry_categories5 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories5}, '%') - - - AND a.national_standard_industry_categories6 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories6}, '%') - - - AND a.national_standard_industry_categories7 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories7}, '%') - - - AND a.national_standard_industry_categories8 LIKE CONCAT('%', #{param.nationalStandardIndustryCategories8}, '%') - - - AND a.url LIKE CONCAT('%', #{param.url}, '%') - - - AND a.type = #{param.type} - - - AND a.parent_id = #{param.parentId} - - - AND a.paidin_capital LIKE CONCAT('%', #{param.paidinCapital}, '%') - - - AND a.registration_authority LIKE CONCAT('%', #{param.registrationAuthority}, '%') - - - AND a.taxpayer_qualification LIKE CONCAT('%', #{param.taxpayerQualification}, '%') - - - AND a.latest_annual_report_year LIKE CONCAT('%', #{param.latestAnnualReportYear}, '%') - - - AND a.latest_annual_report_on_operating_revenue LIKE CONCAT('%', #{param.latestAnnualReportOnOperatingRevenue}, '%') - - - AND a.enterprise_score_check LIKE CONCAT('%', #{param.enterpriseScoreCheck}, '%') - - - AND a.credit_rating LIKE CONCAT('%', #{param.creditRating}, '%') - - - AND a.cechnology_score LIKE CONCAT('%', #{param.cechnologyScore}, '%') - - - AND a.cechnology_level LIKE CONCAT('%', #{param.cechnologyLevel}, '%') - - - AND a.small_enterprise LIKE CONCAT('%', #{param.smallEnterprise}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR a.name = #{param.keywords} - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditPatentMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditPatentMapper.xml deleted file mode 100644 index 091c212..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditPatentMapper.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_patent a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.type LIKE CONCAT('%', #{param.type}, '%') - - - AND a.status_text LIKE CONCAT('%', #{param.statusText}, '%') - - - AND a.register_no LIKE CONCAT('%', #{param.registerNo}, '%') - - - AND a.register_date LIKE CONCAT('%', #{param.registerDate}, '%') - - - AND a.public_no LIKE CONCAT('%', #{param.publicNo}, '%') - - - AND a.public_date LIKE CONCAT('%', #{param.publicDate}, '%') - - - AND a.inventor LIKE CONCAT('%', #{param.inventor}, '%') - - - AND a.patent_applicant LIKE CONCAT('%', #{param.patentApplicant}, '%') - - - AND a.url LIKE CONCAT('%', #{param.url}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.company_id = #{param.companyId} - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.public_no LIKE CONCAT('%', #{param.keywords}, '%') - OR a.register_no LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditRiskRelationMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditRiskRelationMapper.xml deleted file mode 100644 index 9683d91..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditRiskRelationMapper.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_risk_relation a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.main_body_name LIKE CONCAT('%', #{param.mainBodyName}, '%') - - - AND a.registration_status LIKE CONCAT('%', #{param.registrationStatus}, '%') - - - AND a.registered_capital = #{param.registeredCapital} - - - AND a.province_region LIKE CONCAT('%', #{param.provinceRegion}, '%') - - - AND a.associated_relation LIKE CONCAT('%', #{param.associatedRelation}, '%') - - - AND a.risk_relation LIKE CONCAT('%', #{param.riskRelation}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name = #{param.keywords} - OR b.main_body_name LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditSupplierMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditSupplierMapper.xml deleted file mode 100644 index c5d3cdd..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditSupplierMapper.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_supplier a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.supplier LIKE CONCAT('%', #{param.supplier}, '%') - - - AND a.status_txt LIKE CONCAT('%', #{param.statusTxt}, '%') - - - AND a.purchase_amount = #{param.purchaseAmount} - - - AND a.public_date LIKE CONCAT('%', #{param.publicDate}, '%') - - - AND a.data_source LIKE CONCAT('%', #{param.dataSource}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditSuspectedRelationshipMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditSuspectedRelationshipMapper.xml deleted file mode 100644 index 28c2722..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditSuspectedRelationshipMapper.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_suspected_relationship a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.status_text LIKE CONCAT('%', #{param.statusText}, '%') - - - AND a.legal_person LIKE CONCAT('%', #{param.legalPerson}, '%') - - - AND a.registered_capital LIKE CONCAT('%', #{param.registeredCapital}, '%') - - - AND a.create_date LIKE CONCAT('%', #{param.createDate}, '%') - - - AND a.related_party LIKE CONCAT('%', #{param.relatedParty}, '%') - - - AND a.type LIKE CONCAT('%', #{param.type}, '%') - - - AND a.detail LIKE CONCAT('%', #{param.detail}, '%') - - - AND a.url LIKE CONCAT('%', #{param.url}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.company_id = #{param.companyId} - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.name LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditUserMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditUserMapper.xml deleted file mode 100644 index 345e12d..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditUserMapper.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_user a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.type = #{param.type} - - - AND a.role LIKE CONCAT('%', #{param.role}, '%') - - - AND a.parent_id = #{param.parentId} - - - AND a.info_type LIKE CONCAT('%', #{param.infoType}, '%') - - - AND a.country LIKE CONCAT('%', #{param.country}, '%') - - - AND a.province LIKE CONCAT('%', #{param.province}, '%') - - - AND a.city LIKE CONCAT('%', #{param.city}, '%') - - - AND a.region LIKE CONCAT('%', #{param.region}, '%') - - - AND a.address LIKE CONCAT('%', #{param.address}, '%') - - - AND a.procurement_name LIKE CONCAT('%', #{param.procurementName}, '%') - - - AND a.winning_name LIKE CONCAT('%', #{param.winningName}, '%') - - - AND a.winning_price LIKE CONCAT('%', #{param.winningPrice}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.procurement_name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.winning_name LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditXgxfMapper.xml b/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditXgxfMapper.xml deleted file mode 100644 index afba995..0000000 --- a/src/main/java/com/gxwebsoft/credit/mapper/xml/CreditXgxfMapper.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - SELECT a.*, b.name AS companyName, u.real_name AS realName - FROM credit_xgxf a - LEFT JOIN credit_company b ON a.company_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.data_type LIKE CONCAT('%', #{param.dataType}, '%') - - - AND a.plaintiff_appellant LIKE CONCAT('%', #{param.plaintiffAppellant}, '%') - - - AND a.appellee LIKE CONCAT('%', #{param.appellee}, '%') - - - AND a.other_parties_third_party LIKE CONCAT('%', #{param.otherPartiesThirdParty}, '%') - - - AND a.occurrence_time LIKE CONCAT('%', #{param.occurrenceTime}, '%') - - - AND a.case_number LIKE CONCAT('%', #{param.caseNumber}, '%') - - - AND a.cause_of_action LIKE CONCAT('%', #{param.causeOfAction}, '%') - - - AND a.involved_amount = #{param.involvedAmount} - - - AND a.court_name LIKE CONCAT('%', #{param.courtName}, '%') - - - AND a.data_status LIKE CONCAT('%', #{param.dataStatus}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR b.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.case_number = #{param.keywords} - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditAdministrativeLicenseImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditAdministrativeLicenseImportParam.java deleted file mode 100644 index 91bf7f0..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditAdministrativeLicenseImportParam.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 行政许可导入参数 - */ -@Data -public class CreditAdministrativeLicenseImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "决定文书/许可编号") - private String code; - - @Excel(name = "决定文书/许可证名称") - private String name; - - @Excel(name = "许可状态") - private String statusText; - - @Excel(name = "许可类别") - private String type; - - @Excel(name = "有效期自") - private String validityStart; - - @Excel(name = "有效期至") - private String validityEnd; - - @Excel(name = "许可机关") - private String licensingAuthority; - - @Excel(name = "许可内容") - private String licenseContent; - - @Excel(name = "数据来源单位") - private String dataSourceUnit; - - @Excel(name = "备注") - private String comments; -} - diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditAdministrativeLicenseParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditAdministrativeLicenseParam.java deleted file mode 100644 index 13b537b..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditAdministrativeLicenseParam.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 行政许可查询参数 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditAdministrativeLicenseParam对象", description = "行政许可查询参数") -public class CreditAdministrativeLicenseParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "决定文书/许可编号") - private String code; - - @Schema(description = "决定文书/许可证名称") - private String name; - - @Schema(description = "许可状态") - private String statusText; - - @Schema(description = "许可类别") - private String type; - - @Schema(description = "链接") - private String url; - - @Schema(description = "有效期自") - private String validityStart; - - @Schema(description = "有效期至") - private String validityEnd; - - @Schema(description = "许可机关") - private String licensingAuthority; - - @Schema(description = "许可内容") - private String licenseContent; - - @Schema(description = "数据来源单位") - private String dataSourceUnit; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditBankruptcyImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditBankruptcyImportParam.java deleted file mode 100644 index b1c83b9..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditBankruptcyImportParam.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 破产重整导入参数 - */ -@Data -public class CreditBankruptcyImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "案号") - private String code; - - @Excel(name = "案件类型") - private String type; - - @Excel(name = "当事人") - private String party; - - @Excel(name = "经办法院") - private String court; - - @Excel(name = "公开日期") - private String publicDate; - - @Excel(name = "备注") - private String comments; -} - diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditBankruptcyParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditBankruptcyParam.java deleted file mode 100644 index 1be91f0..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditBankruptcyParam.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 破产重整查询参数 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditBankruptcyParam对象", description = "破产重整查询参数") -public class CreditBankruptcyParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "案号") - private String code; - - @Schema(description = "案件类型") - private String type; - - @Schema(description = "当事人") - private String party; - - @Schema(description = "链接") - private String url; - - @Schema(description = "经办法院") - private String court; - - @Schema(description = "公开日期") - private String publicDate; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditBranchImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditBranchImportParam.java deleted file mode 100644 index 01c72c3..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditBranchImportParam.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 分支机构导入参数 - */ -@Data -public class CreditBranchImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "分支机构名称") - private String name; - - @Excel(name = "负责人") - private String curator; - - @Excel(name = "地区") - private String region; - - @Excel(name = "成立日期") - private String establishDate; - - @Excel(name = "状态") - private String statusText; - - @Excel(name = "备注") - private String comments; -} - diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditBranchParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditBranchParam.java deleted file mode 100644 index 3e24a08..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditBranchParam.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 分支机构查询参数 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditBranchParam对象", description = "分支机构查询参数") -public class CreditBranchParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "分支机构名称") - private String name; - - @Schema(description = "负责人") - private String curator; - - @Schema(description = "地区") - private String region; - - @Schema(description = "链接") - private String url; - - @Schema(description = "成立日期") - private String establishDate; - - @Schema(description = "状态") - private String statusText; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustImportParam.java deleted file mode 100644 index e90f364..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustImportParam.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 司法通用导入参数 - */ -@Data -public class CreditBreachOfTrustImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "数据类型") - private String dataType; - - @Excel(name = "案号") - private String caseNumber; - - @Excel(name = "失信被执行人") - private String plaintiffAppellant; - - @Excel(name = "原告/上诉人") - private String plaintiffAppellant2; - - @Excel(name = "疑似申请执行人") - private String appellee; - - @Excel(name = "被告/被上诉人") - private String appellee2; - - @Excel(name = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Excel(name = "数据状态") - private String dataStatus; - - @Excel(name = "涉案金额(元)") - private String involvedAmount; - - @Excel(name = "涉案金额") - private String involvedAmount2; - - @Excel(name = "执行法院") - private String courtName; - - @Excel(name = "法院") - private String courtName2; - - @Excel(name = "立案日期") - private String occurrenceTime; - - @Excel(name = "发生时间") - private String occurrenceTime2; - - @Excel(name = "发布日期") - private String releaseDate; - - @Excel(name = "备注") - private String comments; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustParam.java deleted file mode 100644 index 57b340f..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditBreachOfTrustParam.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 失信被执行人查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:46:13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditBreachOfTrustParam对象", description = "失信被执行人查询参数") -public class CreditBreachOfTrustParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "失信被执行人") - private String plaintiffAppellant; - - @Schema(description = "疑似申请执行人") - private String appellee; - - @Schema(description = "涉案金额(元)") - private String involvedAmount; - - @Schema(description = "执行法院") - private String courtName; - - @Schema(description = "立案日期") - private String occurrenceTime; - - @Schema(description = "发布日期") - private String releaseDate; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCaseFilingImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCaseFilingImportParam.java deleted file mode 100644 index 517f455..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCaseFilingImportParam.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 司法通用导入参数 - */ -@Data -public class CreditCaseFilingImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "数据类型") - private String dataType; - - @Excel(name = "原告/上诉人") - private String plaintiffAppellant; - - @Excel(name = "被告/被上诉人") - private String appellee; - - @Excel(name = "数据状态") - private String dataStatus; - - @Excel(name = "案号") - private String caseNumber; - - @Excel(name = "案由") - private String causeOfAction; - - @Excel(name = "当事人") - private String otherPartiesThirdParty; - - @Excel(name = "其他当事人/第三人") - private String otherPartiesThirdParty2; - - @Excel(name = "法院") - private String courtName; - - @Excel(name = "执行法院") - private String courtName2; - - @Excel(name = "立案日期") - private String occurrenceTime; - - @Excel(name = "发生时间") - private String occurrenceTime2; - - @Excel(name = "涉案金额") - private String involvedAmount; - - @Excel(name = "涉案金额(元)") - private String involvedAmount2; - - @Excel(name = "备注") - private String comments; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCaseFilingParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCaseFilingParam.java deleted file mode 100644 index d9b8c60..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCaseFilingParam.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 司法大数据查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:47:22 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditCaseFilingParam对象", description = "司法大数据查询参数") -public class CreditCaseFilingParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "数据类型") - private String dataType; - - @Schema(description = "原告/上诉人") - private String plaintiffAppellant; - - @Schema(description = "被告/被上诉人") - private String appellee; - - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Schema(description = "发生时间") - private String occurrenceTime; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "项目网址") - private String url; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "涉案金额") - private String involvedAmount; - - @Schema(description = "法院") - private String courtName; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCompanyImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCompanyImportParam.java deleted file mode 100644 index 9db4d95..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCompanyImportParam.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.io.Serializable; - -/** - * 企业导入参数 - * - * @author 科技小王子 - * @since 2025-12-15 - */ -@Data -public class CreditCompanyImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "原文件导入名称") - private String name; - - @Excel(name = "系统匹配企业名称") - private String matchName; - - @Excel(name = "统一社会信用代码") - private String code; - - @Excel(name = "登记状态") - private String registrationStatus; - - @Excel(name = "法定代表人") - private String legalPerson; - - @Excel(name = "注册资本") - private String registeredCapital; - - @Excel(name = "实缴资本") - private String paidinCapital; - - @Excel(name = "成立日期") - private String establishDate; - - @Excel(name = "企业地址") - private String address; - - @Excel(name = "电话") - private String tel; - - @Excel(name = "更多电话") - private String moreTel; - - @Excel(name = "邮箱") - private String email; - - @Excel(name = "更多邮箱") - private String moreEmail; - - @Excel(name = "所在国家") - private String country; - - @Excel(name = "所属省份") - private String province; - - @Excel(name = "所属城市") - private String city; - - @Excel(name = "所属区县") - private String region; - - @Excel(name = "企业(机构)类型") - private String institutionType; - - @Excel(name = "纳税人识别号") - private String taxpayerCode; - - @Excel(name = "注册号") - private String registrationNumber; - - @Excel(name = "组织机构代码") - private String organizationalCode; - - @Excel(name = "参保人数") - private String numberOfInsuredPersons; - - @Excel(name = "参保人数所属年报") - private String annualReport; - - @Excel(name = "营业期限") - private String businessTerm; - - @Excel(name = "国标行业门类") - private String nationalStandardIndustryCategories; - - @Excel(name = "国标行业大类") - private String nationalStandardIndustryCategories2; - - @Excel(name = "国标行业中类") - private String nationalStandardIndustryCategories3; - - @Excel(name = "国标行业小类") - private String nationalStandardIndustryCategories4; - - @Excel(name = "企查查行业门类") - private String nationalStandardIndustryCategories5; - - @Excel(name = "企查查行业大类") - private String nationalStandardIndustryCategories6; - - @Excel(name = "企查查行业中类") - private String nationalStandardIndustryCategories7; - - @Excel(name = "企查查行业小类") - private String nationalStandardIndustryCategories8; - - @Excel(name = "企业规模") - private String companySize; - - @Excel(name = "曾用名") - private String formerName; - - @Excel(name = "英文名") - private String englishName; - - @Excel(name = "官网") - private String domain; - - @Excel(name = "通信地址") - private String mailingAddress; - - @Excel(name = "企业简介") - private String companyProfile; - - @Excel(name = "经营范围") - private String natureOfBusiness; - - @Excel(name = "登记机关") - private String registrationAuthority; - - @Excel(name = "纳税人资质") - private String taxpayerQualification; - - @Excel(name = "最新年报年份") - private String latestAnnualReportYear; - - @Excel(name = "最新年报营业收入") - private String latestAnnualReportOnOperatingRevenue; - - @Excel(name = "企查分") - private String enterpriseScoreCheck; - - @Excel(name = "信用等级") - private String creditRating; - - @Excel(name = "科创分") - private String cechnologyScore; - - @Excel(name = "科创等级") - private String cechnologyLevel; - - @Excel(name = "是否小微企业") - private String smallEnterprise; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCompanyParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCompanyParam.java deleted file mode 100644 index e1db229..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCompanyParam.java +++ /dev/null @@ -1,203 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 企业查询参数 - * - * @author 科技小王子 - * @since 2025-12-17 08:28:02 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditCompanyParam对象", description = "企业查询参数") -public class CreditCompanyParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "原文件导入名称") - private String name; - - @Schema(description = "系统匹配企业名称") - private String matchName; - - @Schema(description = "统一社会信用代码") - private String code; - - @Schema(description = "类型") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "上级id, 0是顶级") - @QueryField(type = QueryType.EQ) - private Integer parentId; - - @Schema(description = "登记状态") - private String registrationStatus; - - @Schema(description = "法定代表人") - private String legalPerson; - - @Schema(description = "注册资本") - private String registeredCapital; - - @Schema(description = "实缴资本") - private String paidinCapital; - - @Schema(description = "成立日期") - private String establishDate; - - @Schema(description = "企业地址") - private String address; - - @Schema(description = "电话") - private String tel; - - @Schema(description = "更多电话") - private String moreTel; - - @Schema(description = "邮箱") - private String email; - - @Schema(description = "更多邮箱") - private String moreEmail; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "所属省份") - private String province; - - @Schema(description = "所属城市") - private String city; - - @Schema(description = "所属区县") - private String region; - - @Schema(description = "企业(机构)类型") - private String institutionType; - - @Schema(description = "纳税人识别号") - private String taxpayerCode; - - @Schema(description = "注册号") - private String registrationNumber; - - @Schema(description = "组织机构代码") - private String organizationalCode; - - @Schema(description = "参保人数") - private String numberOfInsuredPersons; - - @Schema(description = "参保人数所属年报") - private String annualReport; - - @Schema(description = "营业期限") - private String businessTerm; - - @Schema(description = "国标行业门类") - private String nationalStandardIndustryCategories; - - @Schema(description = "国标行业大类") - private String nationalStandardIndustryCategories2; - - @Schema(description = "国标行业中类") - private String nationalStandardIndustryCategories3; - - @Schema(description = "国标行业小类") - private String nationalStandardIndustryCategories4; - - @Schema(description = "企查查行业门类") - private String nationalStandardIndustryCategories5; - - @Schema(description = "企查查行业大类") - private String nationalStandardIndustryCategories6; - - @Schema(description = "企查查行业中类") - private String nationalStandardIndustryCategories7; - - @Schema(description = "企查查行业小类") - private String nationalStandardIndustryCategories8; - - @Schema(description = "企业规模") - private String companySize; - - @Schema(description = "曾用名") - private String formerName; - - @Schema(description = "英文名") - private String englishName; - - @Schema(description = "官网") - private String domain; - - @Schema(description = "通信地址") - private String mailingAddress; - - @Schema(description = "企业简介") - private String companyProfile; - - @Schema(description = "经营范围") - private String natureOfBusiness; - - @Schema(description = "登记机关") - private String registrationAuthority; - - @Schema(description = "纳税人资质") - private String taxpayerQualification; - - @Schema(description = "最新年报年份") - private String latestAnnualReportYear; - - @Schema(description = "最新年报营业收入") - private String latestAnnualReportOnOperatingRevenue; - - @Schema(description = "企查分") - private String enterpriseScoreCheck; - - @Schema(description = "信用等级") - private String creditRating; - - @Schema(description = "科创分") - private String cechnologyScore; - - @Schema(description = "科创等级") - private String cechnologyLevel; - - @Schema(description = "是否小微企业") - private String smallEnterprise; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCompetitorImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCompetitorImportParam.java deleted file mode 100644 index 33a4066..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCompetitorImportParam.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 竞争对手导入参数 - */ -@Data -public class CreditCompetitorImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "企业名称") - private String name; - - @Excel(name = "法定代表人") - private String legalRepresentative; - - @Excel(name = "注册资本") - private String registeredCapital; - - @Excel(name = "成立日期") - private String establishmentDate; - - @Excel(name = "登记状态") - private String registrationStatus; - - @Excel(name = "所属行业") - private String industry; - - @Excel(name = "所属省份") - private String province; - - @Excel(name = "备注") - private String comments; -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCompetitorParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCompetitorParam.java deleted file mode 100644 index d265914..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCompetitorParam.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 竞争对手查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:04 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditCompetitorParam对象", description = "竞争对手查询参数") -public class CreditCompetitorParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "序号") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "企业名称") - private String name; - - @Schema(description = "法定代表人") - private String legalRepresentative; - - @Schema(description = "注册资本") - private String registeredCapital; - - @Schema(description = "成立日期") - private String establishmentDate; - - @Schema(description = "登记状态") - private String registrationStatus; - - @Schema(description = "所属行业") - private String industry; - - @Schema(description = "所属省份") - private String province; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCourtAnnouncementImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCourtAnnouncementImportParam.java deleted file mode 100644 index ffb47fc..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCourtAnnouncementImportParam.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 司法通用导入参数 - */ -@Data -public class CreditCourtAnnouncementImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "案号") - private String caseNumber; - - @Excel(name = "案由") - private String causeOfAction; - - @Excel(name = "当事人") - private String otherPartiesThirdParty; - - @Excel(name = "其他当事人/第三人") - private String otherPartiesThirdParty2; - - @Excel(name = "公告类型") - private String dataType; - - @Excel(name = "数据类型") - private String dataType2; - - @Excel(name = "公告人") - private String plaintiffAppellant; - - @Excel(name = "原告/上诉人") - private String plaintiffAppellant2; - - @Excel(name = "被告/被上诉人") - private String appellee; - - @Excel(name = "涉案金额") - private String involvedAmount; - - @Excel(name = "涉案金额(元)") - private String involvedAmount2; - - @Excel(name = "法院") - private String courtName; - - @Excel(name = "数据状态") - private String dataStatus; - - @Excel(name = "刊登日期") - private String occurrenceTime; - - @Excel(name = "发生时间") - private String occurrenceTime2; - - @Excel(name = "备注") - private String comments; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCourtAnnouncementParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCourtAnnouncementParam.java deleted file mode 100644 index 177a51b..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCourtAnnouncementParam.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 法院公告司法大数据查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditCourtAnnouncementParam对象", description = "法院公告司法大数据查询参数") -public class CreditCourtAnnouncementParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "数据类型") - private String dataType; - - @Schema(description = "原告/上诉人") - private String plaintiffAppellant; - - @Schema(description = "被告/被上诉人") - private String appellee; - - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Schema(description = "发生时间") - private String occurrenceTime; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "涉案金额") - private String involvedAmount; - - @Schema(description = "法院") - private String courtName; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCourtSessionImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCourtSessionImportParam.java deleted file mode 100644 index d4007d9..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCourtSessionImportParam.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 司法通用导入参数 - */ -@Data -public class CreditCourtSessionImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "数据类型") - private String dataType; - - @Excel(name = "案号") - private String caseNumber; - - @Excel(name = "案由") - private String causeOfAction; - - @Excel(name = "当事人") - private String otherPartiesThirdParty; - - @Excel(name = "其他当事人/第三人") - private String otherPartiesThirdParty2; - - @Excel(name = "原告/上诉人") - private String plaintiffAppellant; - - @Excel(name = "被告/被上诉人") - private String appellee; - - @Excel(name = "涉案金额") - private String involvedAmount; - - @Excel(name = "涉案金额(元)") - private String involvedAmount2; - - @Excel(name = "数据状态") - private String dataStatus; - - @Excel(name = "法院") - private String courtName; - - @Excel(name = "开庭时间") - private String occurrenceTime; - - @Excel(name = "发生时间") - private String occurrenceTime2; - - @Excel(name = "备注") - private String comments; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCourtSessionParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCourtSessionParam.java deleted file mode 100644 index cf8a5f9..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCourtSessionParam.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 开庭公告司法大数据查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:32 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditCourtSessionParam对象", description = "开庭公告司法大数据查询参数") -public class CreditCourtSessionParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "数据类型") - private String dataType; - - @Schema(description = "原告/上诉人") - private String plaintiffAppellant; - - @Schema(description = "被告/被上诉人") - private String appellee; - - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Schema(description = "发生时间") - private String occurrenceTime; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "涉案金额") - private String involvedAmount; - - @Schema(description = "法院") - private String courtName; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCustomerImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCustomerImportParam.java deleted file mode 100644 index 1a06637..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCustomerImportParam.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 客户导入参数 - */ -@Data -public class CreditCustomerImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "客户") - private String name; - - @Excel(name = "状态") - private String statusTxt; - - @Excel(name = "销售金额(万元)") - private String price; - - @Excel(name = "公开日期") - private String publicDate; - - @Excel(name = "数据来源") - private String dataSource; - - @Excel(name = "备注") - private String comments; -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditCustomerParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditCustomerParam.java deleted file mode 100644 index 1046bba..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditCustomerParam.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 客户查询参数 - * - * @author 科技小王子 - * @since 2025-12-21 21:20:57 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditCustomerParam对象", description = "客户查询参数") -public class CreditCustomerParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "客户") - private String name; - - @Schema(description = "状态") - private String statusTxt; - - @Schema(description = "销售金额(万元)") - @QueryField(type = QueryType.EQ) - private BigDecimal price; - - @Schema(description = "公开日期") - private String publicDate; - - @Schema(description = "数据来源") - private String dataSource; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditDeliveryNoticeImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditDeliveryNoticeImportParam.java deleted file mode 100644 index 214e1a7..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditDeliveryNoticeImportParam.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 司法通用导入参数 - */ -@Data -public class CreditDeliveryNoticeImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "数据类型") - private String dataType; - - @Excel(name = "原告/上诉人") - private String plaintiffAppellant; - - @Excel(name = "被告/被上诉人") - private String appellee; - - @Excel(name = "数据状态") - private String dataStatus; - - @Excel(name = "涉案金额") - private String involvedAmount; - - @Excel(name = "涉案金额(元)") - private String involvedAmount2; - - @Excel(name = "案号") - private String caseNumber; - - @Excel(name = "案由") - private String causeOfAction; - - @Excel(name = "当事人") - private String otherPartiesThirdParty; - - @Excel(name = "其他当事人/第三人") - private String otherPartiesThirdParty2; - - @Excel(name = "法院") - private String courtName; - - @Excel(name = "执行法院") - private String courtName2; - - @Excel(name = "发布日期") - private String occurrenceTime; - - @Excel(name = "发生时间") - private String occurrenceTime2; - - @Excel(name = "备注") - private String comments; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditDeliveryNoticeParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditDeliveryNoticeParam.java deleted file mode 100644 index 161d039..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditDeliveryNoticeParam.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 送达公告司法大数据查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:51 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditDeliveryNoticeParam对象", description = "送达公告司法大数据查询参数") -public class CreditDeliveryNoticeParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "当事人") - private String otherPartiesThirdParty; - - @Schema(description = "法院") - private String courtName; - - @Schema(description = "发布日期") - private String occurrenceTime; - - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditExternalImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditExternalImportParam.java deleted file mode 100644 index 68cd0d4..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditExternalImportParam.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 对外投资导入参数 - */ -@Data -public class CreditExternalImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "被投资企业名称") - private String name; - - @Excel(name = "状态") - private String statusTxt; - - @Excel(name = "法定代表人") - private String legalRepresentative; - - @Excel(name = "注册资本") - private String registeredCapital; - - @Excel(name = "成立日期") - private String establishmentDate; - - @Excel(name = "持股比例") - private String shareholdingRatio; - - @Excel(name = "认缴出资额") - private String subscribedInvestmentAmount; - - @Excel(name = "认缴出资日期") - private String subscribedInvestmentDate; - - @Excel(name = "间接持股比例") - private String indirectShareholdingRatio; - - @Excel(name = "投资日期") - private String investmentDate; - - @Excel(name = "所属地区") - private String region; - - @Excel(name = "所属行业") - private String industry; - - @Excel(name = "投资数量") - private Integer investmentCount; - - @Excel(name = "关联产品/机构") - private String relatedProductsInstitutions; - - @Excel(name = "备注") - private String comments; -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditExternalParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditExternalParam.java deleted file mode 100644 index 4a12707..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditExternalParam.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 对外投资查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:11 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditExternalParam对象", description = "对外投资查询参数") -public class CreditExternalParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "被投资企业名称") - private String name; - - @Schema(description = "企业状态(如存续、注销等)") - private String statusTxt; - - @Schema(description = "法定代表人姓名") - private String legalRepresentative; - - @Schema(description = "注册资本(金额)") - private String registeredCapital; - - @Schema(description = "成立日期") - private String establishmentDate; - - @Schema(description = "持股比例") - private String shareholdingRatio; - - @Schema(description = "认缴出资额") - private String subscribedInvestmentAmount; - - @Schema(description = "认缴出资日期") - private String subscribedInvestmentDate; - - @Schema(description = "间接持股比例") - private String indirectShareholdingRatio; - - @Schema(description = "投资日期") - private String investmentDate; - - @Schema(description = "所属地区") - private String region; - - @Schema(description = "所属行业") - private String industry; - - @Schema(description = "投资数量") - @QueryField(type = QueryType.EQ) - private Integer investmentCount; - - @Schema(description = "关联产品/机构") - private String relatedProductsInstitutions; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionImportParam.java deleted file mode 100644 index 4aea1d7..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionImportParam.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 司法通用导入参数 - */ -@Data -public class CreditFinalVersionImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "案号") - private String caseNumber; - - @Excel(name = "被执行人") - private String appellee; - - @Excel(name = "被告/被上诉人") - private String appellee2; - - @Excel(name = "疑似申请执行人") - private String plaintiffAppellant; - - @Excel(name = "原告/上诉人") - private String plaintiffAppellant2; - - @Excel(name = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Excel(name = "当事人") - private String otherPartiesThirdParty2; - - @Excel(name = "数据状态") - private String dataStatus; - - @Excel(name = "未履行金额(元)") - private String unfulfilledAmount; - - @Excel(name = "执行标的(元)") - private String involvedAmount; - - @Excel(name = "涉案金额") - private String involvedAmount2; - - @Excel(name = "执行法院") - private String courtName; - - @Excel(name = "法院") - private String courtName2; - - @Excel(name = "立案日期") - private String occurrenceTime; - - @Excel(name = "发生时间") - private String occurrenceTime2; - - @Excel(name = "终本日期") - private String finalDate; - - @Excel(name = "备注") - private String comments; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionParam.java deleted file mode 100644 index a184197..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditFinalVersionParam.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 终本案件查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:19 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditFinalVersionParam对象", description = "终本案件查询参数") -public class CreditFinalVersionParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "被告/被上诉人") - private String appellee; - - @Schema(description = "疑似申请执行人") - private String plaintiffAppellant; - - @Schema(description = "未履行金额(元)") - private String unfulfilledAmount; - - @Schema(description = "执行标的(元)") - private String involvedAmount; - - @Schema(description = "执行法院") - private String courtName; - - @Schema(description = "立案日期") - private String occurrenceTime; - - @Schema(description = "终本日期") - private String finalDate; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditGqdjImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditGqdjImportParam.java deleted file mode 100644 index 60e0c9a..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditGqdjImportParam.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.io.Serializable; - -/** - * 股权冻结导入参数 - */ -@Data -public class CreditGqdjImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "执行通知文书号") - private String caseNumber; - - // Some upstream sources use "案号" instead of "执行通知文书号". - @Excel(name = "案号") - private String caseNumber2; - - @Excel(name = "被执行人") - private String appellee; - - // Some upstream sources use "被执行人名称" as the executed person column. - @Excel(name = "被执行人名称") - private String appellee2; - - @Excel(name = "冻结股权标的企业") - private String plaintiffAppellant; - - // Some upstream sources use "冻结股权标的企业名称" as the target company column. - @Excel(name = "冻结股权标的企业名称") - private String plaintiffAppellant2; - - @Excel(name = "被执行人持有股权、其他投资权益数额") - private String involvedAmount; - - @Excel(name = "执行法院") - private String courtName; - - @Excel(name = "类型") - private String dataType; - - @Excel(name = "状态") - private String dataStatus; - - // Some upstream sources use "数据状态" as the status column. - @Excel(name = "数据状态") - private String dataStatus2; - - @Excel(name = "冻结日期自") - private String freezeDateStart; - - @Excel(name = "冻结日期至") - private String freezeDateEnd; - - @Excel(name = "冻结开始日期") - private String freezeDateStart2; - - @Excel(name = "冻结结束日期") - private String freezeDateEnd2; - - @Excel(name = "公示日期") - private String publicDate; -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditGqdjParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditGqdjParam.java deleted file mode 100644 index 1641a42..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditGqdjParam.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 股权冻结查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:37 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditGqdjParam对象", description = "股权冻结查询参数") -public class CreditGqdjParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "执行通知文书号") - private String caseNumber; - - @Schema(description = "被执行人") - private String appellee; - - @Schema(description = "冻结股权标的企业") - private String plaintiffAppellant; - - @Schema(description = "被执行人持有股权、其他投资权益数额") - private String involvedAmount; - - @Schema(description = "执行法院") - private String courtName; - - @Schema(description = "类型") - private String dataType; - - @Schema(description = "状态") - private String dataStatus; - - @Schema(description = "冻结日期自") - private String freezeDateStart; - - @Schema(description = "冻结日期至") - private String freezeDateEnd; - - @Schema(description = "公示日期") - private String publicDate; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditHistoricalLegalPersonImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditHistoricalLegalPersonImportParam.java deleted file mode 100644 index 19182f5..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditHistoricalLegalPersonImportParam.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 历史法定代表人导入参数 - */ -@Data -public class CreditHistoricalLegalPersonImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "名称") - private String name; - - @Excel(name = "任职日期") - private String registerDate; - - @Excel(name = "卸任日期") - private String publicDate; - - @Excel(name = "备注") - private String comments; -} - diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditHistoricalLegalPersonParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditHistoricalLegalPersonParam.java deleted file mode 100644 index 8c94edc..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditHistoricalLegalPersonParam.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 历史法定代表人查询参数 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditHistoricalLegalPersonParam对象", description = "历史法定代表人查询参数") -public class CreditHistoricalLegalPersonParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "名称") - private String name; - - @Schema(description = "任职日期") - private String registerDate; - - @Schema(description = "卸任日期") - private String publicDate; - - @Schema(description = "链接") - private String url; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditJudgmentDebtorImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditJudgmentDebtorImportParam.java deleted file mode 100644 index 41b6708..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditJudgmentDebtorImportParam.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 被执行人导入参数 - */ -@Data -public class CreditJudgmentDebtorImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "案号") - private String caseNumber; - - @Excel(name = "被执行人名称") - private String name; - - @Excel(name = "被执行人") - private String name1; - - @Excel(name = "证件号/组织机构代码") - private String code; - - @Excel(name = "立案日期") - private String occurrenceTime; - - @Excel(name = "执行标的(元)") - private String amount; - - @Excel(name = "法院") - private String courtName; - - @Excel(name = "数据状态") - private String dataStatus; - - @Excel(name = "备注") - private String comments; -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditJudgmentDebtorParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditJudgmentDebtorParam.java deleted file mode 100644 index 6480ced..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditJudgmentDebtorParam.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 被执行人查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:54 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditJudgmentDebtorParam对象", description = "被执行人查询参数") -public class CreditJudgmentDebtorParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "被执行人名称") - private String name; - - @Schema(description = "证件号/组织机构代码") - private String code; - - @Schema(description = "立案日期") - private String occurrenceTime; - - @Schema(description = "执行标的(元)") - @QueryField(type = QueryType.EQ) - private String amount; - - @Schema(description = "法院") - private String courtName; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditJudicialDocumentImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditJudicialDocumentImportParam.java deleted file mode 100644 index c063b6c..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditJudicialDocumentImportParam.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.io.Serializable; - -/** - * 司法通用导入参数 - */ -@Data -public class CreditJudicialDocumentImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "文书标题") - private String title; - - @Excel(name = "文书类型") - private String type; - - @Excel(name = "案号") - private String caseNumber; - - @Excel(name = "案由") - private String causeOfAction; - - @Excel(name = "当事人") - private String otherPartiesThirdParty; - - @Excel(name = "案件金额(元)") - private String involvedAmount; - - @Excel(name = "涉案金额") - private String involvedAmount2; - - @Excel(name = "裁判结果") - private String defendantAppellee; - - @Excel(name = "裁判日期") - private String occurrenceTime; - - @Excel(name = "发布日期") - private String releaseDate; - - @Excel(name = "法院") - private String courtName; - - @Excel(name = "数据状态") - private String dataStatus; - - @Excel(name = "备注") - private String comments; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditJudicialDocumentParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditJudicialDocumentParam.java deleted file mode 100644 index 6415b53..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditJudicialDocumentParam.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 裁判文书司法大数据查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:02 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditJudicialDocumentParam对象", description = "裁判文书司法大数据查询参数") -public class CreditJudicialDocumentParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "文书标题") - private String title; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "当事人") - private String otherPartiesThirdParty; - - @Schema(description = "案件金额(元)") - private String involvedAmount; - - @Schema(description = "裁判结果") - private String defendantAppellee; - - @Schema(description = "裁判日期") - private String occurrenceTime; - - @Schema(description = "发布日期") - private String releaseDate; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditJudicialImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditJudicialImportParam.java deleted file mode 100644 index 35436f7..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditJudicialImportParam.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.io.Serializable; - -/** - * 司法通用导入参数 - */ -@Data -public class CreditJudicialImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "数据类型") - private String dataType; - - @Excel(name = "原告/上诉人") - private String plaintiffAppellant; - - @Excel(name = "被告/被上诉人") - private String appellee; - - @Excel(name = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Excel(name = "发生时间") - private String occurrenceTime; - - @Excel(name = "案号") - private String caseNumber; - - @Excel(name = "案由") - private String causeOfAction; - - @Excel(name = "涉案金额") - private String involvedAmount; - - @Excel(name = "法院") - private String courtName; - - @Excel(name = "数据状态") - private String dataStatus; - - @Excel(name = "备注") - private String comments; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditJudiciaryImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditJudiciaryImportParam.java deleted file mode 100644 index 4c08656..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditJudiciaryImportParam.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 招投标信息导入参数 - * - * @author 科技小王子 - * @since 2025-12-15 - */ -@Data -public class CreditJudiciaryImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "案件名称") - private String name; - - @Excel(name = "案件类型") - private String infoType; - - @Excel(name = "案由") - private String reason; - - @Excel(name = "进程日期") - private String processDate; - - @Excel(name = "案件进程") - private String caseProgress; - - @Excel(name = "案件身份") - private String caseIdentity; - - @Excel(name = "案号") - private String code; - - @Excel(name = "法院") - private String court; - - @Excel(name = "案件金额(元)") - private String caseAmount; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditJudiciaryParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditJudiciaryParam.java deleted file mode 100644 index 295cc75..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditJudiciaryParam.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 司法案件查询参数 - * - * @author 科技小王子 - * @since 2025-12-16 15:23:57 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditJudiciaryParam对象", description = "司法案件查询参数") -public class CreditJudiciaryParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "案件名称") - private String name; - - @Schema(description = "案号") - private String code; - - @Schema(description = "类型, 0普通用户, 1招投标") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "案由") - private String reason; - - @Schema(description = "上级id, 0是顶级") - @QueryField(type = QueryType.EQ) - private Integer parentId; - - @Schema(description = "案件类型") - private String infoType; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "街道地址") - private String address; - - @Schema(description = "案件进程") - private String caseProgress; - - @Schema(description = "案件身份") - private String caseIdentity; - - @Schema(description = "法院") - private String court; - - @Schema(description = "进程日期") - private String processDate; - - @Schema(description = "案件金额(元)") - private String caseAmount; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "到期时间") - private String expirationTime; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditMediationImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditMediationImportParam.java deleted file mode 100644 index 0799e5e..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditMediationImportParam.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.io.Serializable; - -/** - * 司法通用导入参数 - */ -@Data -public class CreditMediationImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "案号") - private String caseNumber; - - @Excel(name = "案由") - private String causeOfAction; - - @Excel(name = "当事人") - private String otherPartiesThirdParty; - - @Excel(name = "法院") - private String courtName; - - @Excel(name = "立案日期") - private String occurrenceTime; - - @Excel(name = "备注") - private String comments; - - @Excel(name = "原告/上诉人") - private String plaintiffAppellant; - - @Excel(name = "被告/被上诉人") - private String appellee; - - @Excel(name = "数据状态") - private String dataStatus; - - @Excel(name = "涉案金额") - private String involvedAmount; - - @Excel(name = "发生时间") - private String occurrenceTime2; - - @Excel(name = "其他当事人/第三人") - private String otherPartiesThirdParty2; -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditMediationParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditMediationParam.java deleted file mode 100644 index 4561edd..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditMediationParam.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 诉前调解司法大数据查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:24 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditMediationParam对象", description = "诉前调解司法大数据查询参数") -public class CreditMediationParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "数据类型") - private String dataType; - - @Schema(description = "原告/上诉人") - private String plaintiffAppellant; - - @Schema(description = "被告/被上诉人") - private String appellee; - - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Schema(description = "发生时间") - private String occurrenceTime; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "涉案金额") - private String involvedAmount; - - @Schema(description = "法院") - private String courtName; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditNearbyCompanyImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditNearbyCompanyImportParam.java deleted file mode 100644 index e592f93..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditNearbyCompanyImportParam.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 附近企业导入参数 - */ -@Data -public class CreditNearbyCompanyImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "企业名称") - private String name; - - @Excel(name = "登记状态") - private String registrationStatus; - - @Excel(name = "法定代表人") - private String legalPerson; - - @Excel(name = "注册资本") - private String registeredCapital; - - @Excel(name = "实缴资本") - private String paidinCapital; - - @Excel(name = "成立日期") - private String establishDate; - - @Excel(name = "统一社会信用代码") - private String code; - - @Excel(name = "注册地址") - private String address; - - @Excel(name = "有效手机号") - private String phone; - - @Excel(name = "邮箱") - private String email; - - @Excel(name = "所属省份") - private String province; - - @Excel(name = "所属城市") - private String city; - - @Excel(name = "所属区县") - private String region; - - @Excel(name = "官网网址") - private String domain; - - @Excel(name = "企业(机构)类型") - private String institutionType; - - @Excel(name = "企业规模") - private String companySize; - - @Excel(name = "登记机关") - private String registrationAuthority; - - @Excel(name = "纳税人资质") - private String taxpayerQualification; - - @Excel(name = "最新年报年份") - private String latestAnnualReportYear; - - @Excel(name = "最新年报营业收入") - private String latestAnnualReportOnOperatingRevenue; - - @Excel(name = "企查分") - private String enterpriseScoreCheck; - - @Excel(name = "信用等级") - private String creditRating; - - @Excel(name = "科创分") - private String cechnologyScore; - - @Excel(name = "科创等级") - private String cechnologyLevel; - - @Excel(name = "是否小微企业") - private String smallEnterprise; - - @Excel(name = "企业简介") - private String companyProfile; - - @Excel(name = "经营范围") - private String natureOfBusiness; - - @Excel(name = "备注") - private String comments; -} - diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditNearbyCompanyParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditNearbyCompanyParam.java deleted file mode 100644 index f2ba839..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditNearbyCompanyParam.java +++ /dev/null @@ -1,216 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 附近企业查询参数 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditNearbyCompanyParam对象", description = "附近企业查询参数") -public class CreditNearbyCompanyParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "企业名称") - private String name; - - @Schema(description = "登记状态") - private String registrationStatus; - - @Schema(description = "法定代表人") - private String legalPerson; - - @Schema(description = "注册资本") - private String registeredCapital; - - @Schema(description = "成立日期") - private String establishDate; - - @Schema(description = "统一社会信用代码") - private String code; - - @Schema(description = "注册地址") - private String address; - - @Schema(description = "注册地址邮编") - private String postalCode; - - @Schema(description = "有效手机号") - private String phone; - - @Schema(description = "更多电话") - private String moreTel; - - @Schema(description = "邮箱") - private String email; - - @Schema(description = "邮箱") - private String moreEmail; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "所属省份") - private String province; - - @Schema(description = "所属城市") - private String city; - - @Schema(description = "所属区县") - private String region; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private String companyId; - - @Schema(description = "纳税人识别号") - private String taxpayerCode; - - @Schema(description = "注册号") - private String registrationNumber; - - @Schema(description = "组织机构代码") - private String organizationalCode; - - @Schema(description = "参保人数") - private String numberOfInsuredPersons; - - @Schema(description = "参保人数所属年报") - private String annualReport; - - @Schema(description = "企业(机构)类型") - private String institutionType; - - @Schema(description = "企业规模") - private String companySize; - - @Schema(description = "营业期限") - private String businessTerm; - - @Schema(description = "国标行业门类") - private String nationalStandardIndustryCategories; - - @Schema(description = "国标行业大类") - private String nationalStandardIndustryCategories2; - - @Schema(description = "国标行业中类") - private String nationalStandardIndustryCategories3; - - @Schema(description = "国标行业小类") - private String nationalStandardIndustryCategories4; - - @Schema(description = "曾用名") - private String formerName; - - @Schema(description = "英文名") - private String englishName; - - @Schema(description = "官网网址") - private String domain; - - @Schema(description = "通信地址") - private String mailingAddress; - - @Schema(description = "通信地址邮箱") - private String mailingEmail; - - @Schema(description = "企业简介") - private String companyProfile; - - @Schema(description = "经营范围") - private String natureOfBusiness; - - @Schema(description = "电话") - private String tel; - - @Schema(description = "企查查行业门类") - private String nationalStandardIndustryCategories5; - - @Schema(description = "企查查行业大类") - private String nationalStandardIndustryCategories6; - - @Schema(description = "企查查行业中类") - private String nationalStandardIndustryCategories7; - - @Schema(description = "企查查行业小类") - private String nationalStandardIndustryCategories8; - - @Schema(description = "链接") - private String url; - - @Schema(description = "类型") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "上级id, 0是顶级") - @QueryField(type = QueryType.EQ) - private Integer parentId; - - @Schema(description = "实缴资本") - private String paidinCapital; - - @Schema(description = "登记机关") - private String registrationAuthority; - - @Schema(description = "纳税人资质") - private String taxpayerQualification; - - @Schema(description = "最新年报年份") - private String latestAnnualReportYear; - - @Schema(description = "最新年报营业收入") - private String latestAnnualReportOnOperatingRevenue; - - @Schema(description = "企查分") - private String enterpriseScoreCheck; - - @Schema(description = "信用等级") - private String creditRating; - - @Schema(description = "科创分") - private String cechnologyScore; - - @Schema(description = "科创等级") - private String cechnologyLevel; - - @Schema(description = "是否小微企业") - private String smallEnterprise; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditPatentImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditPatentImportParam.java deleted file mode 100644 index 34e2777..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditPatentImportParam.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 专利导入参数 - */ -@Data -public class CreditPatentImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "发明名称") - private String name; - - @Excel(name = "专利类型") - private String type; - - @Excel(name = "法律状态") - private String statusText; - - @Excel(name = "申请号") - private String registerNo; - - @Excel(name = "申请日") - private String registerDate; - - @Excel(name = "公开(公告)号") - private String publicNo; - - @Excel(name = "公开(公告)日期") - private String publicDate; - - @Excel(name = "发明人") - private String inventor; - - @Excel(name = "申请(专利权)人") - private String patentApplicant; - - @Excel(name = "备注") - private String comments; -} - diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditPatentParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditPatentParam.java deleted file mode 100644 index ae3cd27..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditPatentParam.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 专利查询参数 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditPatentParam对象", description = "专利查询参数") -public class CreditPatentParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "发明名称") - private String name; - - @Schema(description = "专利类型") - private String type; - - @Schema(description = "法律状态") - private String statusText; - - @Schema(description = "申请号") - private String registerNo; - - @Schema(description = "申请日") - private String registerDate; - - @Schema(description = "公开(公告)号") - private String publicNo; - - @Schema(description = "公开(公告)日期") - private String publicDate; - - @Schema(description = "发明人") - private String inventor; - - @Schema(description = "申请(专利权)人") - private String patentApplicant; - - @Schema(description = "链接") - private String url; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditRiskRelationImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditRiskRelationImportParam.java deleted file mode 100644 index b2a8ff3..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditRiskRelationImportParam.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 风险关系导入参数 - */ -@Data -public class CreditRiskRelationImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "主体名称") - private String mainBodyName; - - @Excel(name = "登记状态") - private String registrationStatus; - - @Excel(name = "注册资本") - private String registeredCapital; - - @Excel(name = "省份地区") - private String provinceRegion; - - @Excel(name = "关联关系") - private String associatedRelation; - - @Excel(name = "风险关系") - private String riskRelation; - - @Excel(name = "备注") - private String comments; -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditRiskRelationParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditRiskRelationParam.java deleted file mode 100644 index 6ff4f44..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditRiskRelationParam.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 风险关系表查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:40 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditRiskRelationParam对象", description = "风险关系表查询参数") -public class CreditRiskRelationParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "序号") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "主体名称") - private String mainBodyName; - - @Schema(description = "登记状态") - private String registrationStatus; - - @Schema(description = "注册资本") - private String registeredCapital; - - @Schema(description = "省份地区") - private String provinceRegion; - - @Schema(description = "关联关系") - private String associatedRelation; - - @Schema(description = "风险关系") - private String riskRelation; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditSupplierImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditSupplierImportParam.java deleted file mode 100644 index 45ff9c0..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditSupplierImportParam.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 供应商导入参数 - */ -@Data -public class CreditSupplierImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "供应商") - private String supplier; - - @Excel(name = "状态") - private String statusTxt; - - @Excel(name = "采购金额(万元)") - private String purchaseAmount; - - @Excel(name = "公开日期") - private String publicDate; - - @Excel(name = "数据来源") - private String dataSource; - - @Excel(name = "备注") - private String comments; -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditSupplierParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditSupplierParam.java deleted file mode 100644 index a2f646d..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditSupplierParam.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 供应商查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:47 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditSupplierParam对象", description = "供应商查询参数") -public class CreditSupplierParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "供应商") - private String supplier; - - @Schema(description = "状态") - private String statusTxt; - - @Schema(description = "采购金额(万元)") - private String purchaseAmount; - - @Schema(description = "公开日期") - private String publicDate; - - @Schema(description = "数据来源") - private String dataSource; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditSuspectedRelationshipImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditSuspectedRelationshipImportParam.java deleted file mode 100644 index 575e6fd..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditSuspectedRelationshipImportParam.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 疑似关系导入参数 - */ -@Data -public class CreditSuspectedRelationshipImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "企业名称") - private String name; - - @Excel(name = "状态") - private String statusText; - - @Excel(name = "法定代表人") - private String legalPerson; - - @Excel(name = "注册资本") - private String registeredCapital; - - @Excel(name = "成立日期") - private String createDate; - - @Excel(name = "关联方") - private String relatedParty; - - @Excel(name = "疑似关系类型") - private String type; - - @Excel(name = "疑似关系详情") - private String detail; - - @Excel(name = "备注") - private String comments; -} - diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditSuspectedRelationshipParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditSuspectedRelationshipParam.java deleted file mode 100644 index ee87cef..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditSuspectedRelationshipParam.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 疑似关系查询参数 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditSuspectedRelationshipParam对象", description = "疑似关系查询参数") -public class CreditSuspectedRelationshipParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "企业名称") - private String name; - - @Schema(description = "状态") - private String statusText; - - @Schema(description = "法定代表人") - private String legalPerson; - - @Schema(description = "注册资本") - private String registeredCapital; - - @Schema(description = "成立日期") - private String createDate; - - @Schema(description = "关联方") - private String relatedParty; - - @Schema(description = "疑似关系类型") - private String type; - - @Schema(description = "疑似关系详情") - private String detail; - - @Schema(description = "链接") - private String url; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditUserImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditUserImportParam.java deleted file mode 100644 index 0420439..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditUserImportParam.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.io.Serializable; - -/** - * 招投标信息导入参数 - * - * @author 科技小王子 - * @since 2025-12-15 - */ -@Data -public class CreditUserImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "项目名称") - private String name; - - @Excel(name = "发布日期") - private String releaseDate; - - @Excel(name = "序号") - private String code; - - @Excel(name = "类型", replace = {"普通用户_0", "招投标_1"}) - private Integer type; - - @Excel(name = "企业角色") - private String role; - - @Excel(name = "上级ID") - private Integer parentId; - - @Excel(name = "信息类型") - private String infoType; - -// @Excel(name = "所在国家") -// private String country; - -// @Excel(name = "所在省份") -// private String province; - -// @Excel(name = "所在城市") -// private String city; - -// @Excel(name = "所在辖区") -// private String region; - - @Excel(name = "省份地区") - private String address; - - @Excel(name = "招采单位") - private String procurementName; - - @Excel(name = "中标单位") - private String winningName; - - @Excel(name = "中标金额") - private String winningPrice; - -// @Excel(name = "备注") -// private String comments; -// -// @Excel(name = "是否推荐", replace = {"否_0", "是_1"}) -// private Integer recommend; - -// @Excel(name = "到期时间", format = "yyyy-MM-dd HH:mm:ss") -// private String expirationTime; - -// @Excel(name = "排序") -// private Integer sortNumber; -// -// @Excel(name = "状态", replace = {"正常_0", "冻结_1"}) -// private Integer status; - -// @Excel(name = "用户ID") -// private Integer userId; -// -// @Excel(name = "租户ID") -// private Integer tenantId; -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditUserParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditUserParam.java deleted file mode 100644 index 2a74eb7..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditUserParam.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.gxwebsoft.credit.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.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 招投标信息表查询参数 - * - * @author 科技小王子 - * @since 2025-12-15 13:16:03 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditUserParam对象", description = "招投标信息表查询参数") -public class CreditUserParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "项目名称") - private String name; - - @Schema(description = "唯一标识") - private String code; - - @Schema(description = "类型, 0普通用户, 1招投标") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "企业角色") - private String role; - - @Schema(description = "上级id, 0是顶级") - @QueryField(type = QueryType.EQ) - private Integer parentId; - - @Schema(description = "信息类型") - private String infoType; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "街道地址") - private String address; - - @Schema(description = "招采单位名称") - private String procurementName; - - @Schema(description = "中标单位名称") - private String winningName; - - @Schema(description = "中标单位名称") - private String winningPrice; - - @Schema(description = "发布日期") - private String releaseDate; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "到期时间") - private String expirationTime; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditXgxfImportParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditXgxfImportParam.java deleted file mode 100644 index d0eb97d..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditXgxfImportParam.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.gxwebsoft.credit.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.io.Serializable; - -/** - * 司法通用导入参数 - */ -@Data -public class CreditXgxfImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "案号") - private String caseNumber; - - @Excel(name = "数据类型") - private String type; - - @Excel(name = "限消令对象") - private String dataType; - - @Excel(name = "限制法定代表人") - private String plaintiffAppellant; - - @Excel(name = "申请人") - private String appellee; - - @Excel(name = "涉案金额(元)") - private String involvedAmount; - - @Excel(name = "涉案金额") - private String involvedAmount2; - - @Excel(name = "立案日期") - private String occurrenceTime; - - @Excel(name = "发生时间") - private String occurrenceTime2; - - @Excel(name = "执行法院") - private String courtName; - - @Excel(name = "发布日期") - private String releaseDate; - - @Excel(name = "备注") - private String comments; - - @Excel(name = "原告/上诉人") - private String plaintiffUser; - - @Excel(name = "被告/被上诉人") - private String defendantUser; - - @Excel(name = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Excel(name = "数据状态") - private String dataStatus; - - @Excel(name = "法院") - private String courtName2; - -} diff --git a/src/main/java/com/gxwebsoft/credit/param/CreditXgxfParam.java b/src/main/java/com/gxwebsoft/credit/param/CreditXgxfParam.java deleted file mode 100644 index 3934489..0000000 --- a/src/main/java/com/gxwebsoft/credit/param/CreditXgxfParam.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.gxwebsoft.credit.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 限制高消费查询参数 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:54 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "CreditXgxfParam对象", description = "限制高消费查询参数") -public class CreditXgxfParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "案号") - private String caseNumber; - - @Schema(description = "数据类型") - private String type; - - @Schema(description = "限消令对象") - private String dataType; - - @Schema(description = "限制法定代表人") - private String plaintiffAppellant; - - @Schema(description = "申请人") - private String appellee; - - @Schema(description = "涉案金额(元)") - private String involvedAmount; - - @Schema(description = "立案日期") - private String occurrenceTime; - - @Schema(description = "执行法院") - private String courtName; - - @Schema(description = "发布日期") - private String releaseDate; - - @Schema(description = "其他当事人/第三人") - private String otherPartiesThirdParty; - - @Schema(description = "案由") - private String causeOfAction; - - @Schema(description = "数据状态") - private String dataStatus; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditAdministrativeLicenseService.java b/src/main/java/com/gxwebsoft/credit/service/CreditAdministrativeLicenseService.java deleted file mode 100644 index d2253e5..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditAdministrativeLicenseService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditAdministrativeLicense; -import com.gxwebsoft.credit.param.CreditAdministrativeLicenseParam; - -import java.util.List; - -/** - * 行政许可Service - * - * @author 科技小王子 - * @since 2026-01-07 13:52:13 - */ -public interface CreditAdministrativeLicenseService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditAdministrativeLicenseParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditAdministrativeLicenseParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditAdministrativeLicense - */ - CreditAdministrativeLicense getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditBankruptcyService.java b/src/main/java/com/gxwebsoft/credit/service/CreditBankruptcyService.java deleted file mode 100644 index 3a23584..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditBankruptcyService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditBankruptcy; -import com.gxwebsoft.credit.param.CreditBankruptcyParam; - -import java.util.List; - -/** - * 破产重整Service - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -public interface CreditBankruptcyService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditBankruptcyParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditBankruptcyParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditBankruptcy - */ - CreditBankruptcy getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditBranchService.java b/src/main/java/com/gxwebsoft/credit/service/CreditBranchService.java deleted file mode 100644 index 5cdb363..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditBranchService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditBranch; -import com.gxwebsoft.credit.param.CreditBranchParam; - -import java.util.List; - -/** - * 分支机构Service - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -public interface CreditBranchService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditBranchParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditBranchParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditBranch - */ - CreditBranch getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditBreachOfTrustService.java b/src/main/java/com/gxwebsoft/credit/service/CreditBreachOfTrustService.java deleted file mode 100644 index 57d40dc..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditBreachOfTrustService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditBreachOfTrust; -import com.gxwebsoft.credit.param.CreditBreachOfTrustParam; - -import java.util.List; - -/** - * 失信被执行人Service - * - * @author 科技小王子 - * @since 2025-12-19 19:46:14 - */ -public interface CreditBreachOfTrustService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditBreachOfTrustParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditBreachOfTrustParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditBreachOfTrust - */ - CreditBreachOfTrust getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditCaseFilingService.java b/src/main/java/com/gxwebsoft/credit/service/CreditCaseFilingService.java deleted file mode 100644 index 23bb227..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditCaseFilingService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditCaseFiling; -import com.gxwebsoft.credit.param.CreditCaseFilingParam; - -import java.util.List; - -/** - * 司法大数据Service - * - * @author 科技小王子 - * @since 2025-12-19 19:47:22 - */ -public interface CreditCaseFilingService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditCaseFilingParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditCaseFilingParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditCaseFiling - */ - CreditCaseFiling getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditCompanyRecordCountService.java b/src/main/java/com/gxwebsoft/credit/service/CreditCompanyRecordCountService.java deleted file mode 100644 index 0326a22..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditCompanyRecordCountService.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.gxwebsoft.credit.service; - -import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -/** - * 刷新 credit_company 表内的“关联记录数”字段。 - * - *

这些字段是通过统计:credit_company.id = 关联表.company_id(且 deleted=0) 得到。

- */ -@Service -public class CreditCompanyRecordCountService { - - public enum CountType { - ADMINISTRATIVE_LICENSE("credit_administrative_license", "credit_administrative_license"), - BANKRUPTCY("credit_bankruptcy", "credit_bankruptcy"), - BRANCH("credit_branch", "credit_branch"), - BREACH_OF_TRUST("credit_breach_of_trust", "credit_breach_of_trust"), - CASE_FILING("credit_case_filing", "credit_case_filing"), - COMPETITOR("credit_competitor", "credit_competitor"), - COURT_ANNOUNCEMENT("credit_court_announcement", "credit_court_announcement"), - COURT_SESSION("credit_court_session", "credit_court_session"), - CUSTOMER("credit_customer", "credit_customer"), - DELIVERY_NOTICE("credit_delivery_notice", "credit_delivery_notice"), - EXTERNAL("credit_external", "credit_external"), - FINAL_VERSION("credit_final_version", "credit_final_version"), - GQDJ("credit_gqdj", "credit_gqdj"), - HISTORICAL_LEGAL_PERSON("credit_historical_legal_person", "credit_historical_legal_person"), - JUDGMENT_DEBTOR("credit_judgment_debtor", "credit_judgment_debtor"), - JUDICIAL_DOCUMENT("credit_judicial_document", "credit_judicial_document"), - JUDICIARY("credit_judiciary", "credit_judiciary"), - MEDIATION("credit_mediation", "credit_mediation"), - NEARBY_COMPANY("credit_nearby_company", "credit_nearby_company"), - PATENT("credit_patent", "credit_patent"), - RISK_RELATION("credit_risk_relation", "credit_risk_relation"), - SUPPLIER("credit_supplier", "credit_supplier"), - SUSPECTED_RELATIONSHIP("credit_suspected_relationship", "credit_suspected_relationship"), - USER("credit_user", "credit_user"), - XGXF("credit_xgxf", "credit_xgxf"); - - private final String companyColumn; - private final String sourceTable; - - CountType(String companyColumn, String sourceTable) { - this.companyColumn = companyColumn; - this.sourceTable = sourceTable; - } - - public String getCompanyColumn() { - return companyColumn; - } - - public String getSourceTable() { - return sourceTable; - } - } - - private final NamedParameterJdbcTemplate namedJdbc; - - public CreditCompanyRecordCountService(NamedParameterJdbcTemplate namedJdbc) { - this.namedJdbc = namedJdbc; - } - - /** - * 刷新某个“记录数”字段(只更新传入 companyIds)。 - */ - public void refresh(CountType type, Collection companyIds) { - if (type == null || CollectionUtils.isEmpty(companyIds)) { - return; - } - List ids = normalizeCompanyIds(companyIds); - if (ids.isEmpty()) { - return; - } - - // 表/字段名来自固定枚举,不允许外部传入,避免 SQL 注入。 - String sql = "" - + "UPDATE credit_company c " - + "SET " + type.getCompanyColumn() + " = (" - + " SELECT COUNT(1) " - + " FROM " + type.getSourceTable() + " t " - + " WHERE t.company_id = c.id AND t.deleted = 0" - + ") " - + "WHERE c.id IN (:ids)"; - - final int inChunkSize = 1000; - for (int i = 0; i < ids.size(); i += inChunkSize) { - List chunk = ids.subList(i, Math.min(ids.size(), i + inChunkSize)); - namedJdbc.update(sql, new MapSqlParameterSource("ids", chunk)); - } - } - - /** - * 刷新全部“记录数”字段(只更新传入 companyIds)。 - */ - public void refreshAll(Collection companyIds) { - if (CollectionUtils.isEmpty(companyIds)) { - return; - } - for (CountType type : CountType.values()) { - refresh(type, companyIds); - } - } - - private static List normalizeCompanyIds(Collection companyIds) { - Set unique = new LinkedHashSet<>(); - for (Integer id : companyIds) { - if (id != null && id > 0) { - unique.add(id); - } - } - return new ArrayList<>(unique); - } -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditCompanyService.java b/src/main/java/com/gxwebsoft/credit/service/CreditCompanyService.java deleted file mode 100644 index e96c34e..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditCompanyService.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditCompany; -import com.gxwebsoft.credit.param.CreditCompanyParam; - -import java.util.List; - -/** - * 企业Service - * - * @author 科技小王子 - * @since 2025-12-17 08:28:03 - */ -public interface CreditCompanyService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditCompanyParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditCompanyParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditCompany - */ - CreditCompany getByIdRel(Integer id); - - CreditCompany getByName(String name); - - CreditCompany getByMatchName(String name); -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditCompetitorService.java b/src/main/java/com/gxwebsoft/credit/service/CreditCompetitorService.java deleted file mode 100644 index b7612a6..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditCompetitorService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditCompetitor; -import com.gxwebsoft.credit.param.CreditCompetitorParam; - -import java.util.List; - -/** - * 竞争对手Service - * - * @author 科技小王子 - * @since 2025-12-19 19:49:05 - */ -public interface CreditCompetitorService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditCompetitorParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditCompetitorParam param); - - /** - * 根据id查询 - * - * @param id 序号 - * @return CreditCompetitor - */ - CreditCompetitor getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditCourtAnnouncementService.java b/src/main/java/com/gxwebsoft/credit/service/CreditCourtAnnouncementService.java deleted file mode 100644 index a693994..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditCourtAnnouncementService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditCourtAnnouncement; -import com.gxwebsoft.credit.param.CreditCourtAnnouncementParam; - -import java.util.List; - -/** - * 法院公告司法大数据Service - * - * @author 科技小王子 - * @since 2025-12-19 19:49:13 - */ -public interface CreditCourtAnnouncementService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditCourtAnnouncementParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditCourtAnnouncementParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditCourtAnnouncement - */ - CreditCourtAnnouncement getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditCourtSessionService.java b/src/main/java/com/gxwebsoft/credit/service/CreditCourtSessionService.java deleted file mode 100644 index 6df519f..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditCourtSessionService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditCourtSession; -import com.gxwebsoft.credit.param.CreditCourtSessionParam; - -import java.util.List; - -/** - * 开庭公告司法大数据Service - * - * @author 科技小王子 - * @since 2025-12-19 19:49:32 - */ -public interface CreditCourtSessionService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditCourtSessionParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditCourtSessionParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditCourtSession - */ - CreditCourtSession getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditCustomerService.java b/src/main/java/com/gxwebsoft/credit/service/CreditCustomerService.java deleted file mode 100644 index afcafb1..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditCustomerService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditCustomer; -import com.gxwebsoft.credit.param.CreditCustomerParam; - -import java.util.List; - -/** - * 客户Service - * - * @author 科技小王子 - * @since 2025-12-21 21:20:58 - */ -public interface CreditCustomerService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditCustomerParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditCustomerParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditCustomer - */ - CreditCustomer getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditDeliveryNoticeService.java b/src/main/java/com/gxwebsoft/credit/service/CreditDeliveryNoticeService.java deleted file mode 100644 index 2398954..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditDeliveryNoticeService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditDeliveryNotice; -import com.gxwebsoft.credit.param.CreditDeliveryNoticeParam; - -import java.util.List; - -/** - * 送达公告司法大数据Service - * - * @author 科技小王子 - * @since 2025-12-19 19:49:51 - */ -public interface CreditDeliveryNoticeService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditDeliveryNoticeParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditDeliveryNoticeParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditDeliveryNotice - */ - CreditDeliveryNotice getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditExternalService.java b/src/main/java/com/gxwebsoft/credit/service/CreditExternalService.java deleted file mode 100644 index c78c895..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditExternalService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditExternal; -import com.gxwebsoft.credit.param.CreditExternalParam; - -import java.util.List; - -/** - * 对外投资Service - * - * @author 科技小王子 - * @since 2025-12-19 19:50:11 - */ -public interface CreditExternalService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditExternalParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditExternalParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditExternal - */ - CreditExternal getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditFinalVersionService.java b/src/main/java/com/gxwebsoft/credit/service/CreditFinalVersionService.java deleted file mode 100644 index b68bb42..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditFinalVersionService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditFinalVersion; -import com.gxwebsoft.credit.param.CreditFinalVersionParam; - -import java.util.List; - -/** - * 终本案件Service - * - * @author 科技小王子 - * @since 2025-12-19 19:50:19 - */ -public interface CreditFinalVersionService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditFinalVersionParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditFinalVersionParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditFinalVersion - */ - CreditFinalVersion getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditGqdjService.java b/src/main/java/com/gxwebsoft/credit/service/CreditGqdjService.java deleted file mode 100644 index 18c7f15..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditGqdjService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditGqdj; -import com.gxwebsoft.credit.param.CreditGqdjParam; - -import java.util.List; - -/** - * 股权冻结Service - * - * @author 科技小王子 - * @since 2025-12-19 19:50:37 - */ -public interface CreditGqdjService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditGqdjParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditGqdjParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditGqdj - */ - CreditGqdj getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditHistoricalLegalPersonService.java b/src/main/java/com/gxwebsoft/credit/service/CreditHistoricalLegalPersonService.java deleted file mode 100644 index 0a309a6..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditHistoricalLegalPersonService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditHistoricalLegalPerson; -import com.gxwebsoft.credit.param.CreditHistoricalLegalPersonParam; - -import java.util.List; - -/** - * 历史法定代表人Service - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -public interface CreditHistoricalLegalPersonService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditHistoricalLegalPersonParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditHistoricalLegalPersonParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditHistoricalLegalPerson - */ - CreditHistoricalLegalPerson getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditJudgmentDebtorService.java b/src/main/java/com/gxwebsoft/credit/service/CreditJudgmentDebtorService.java deleted file mode 100644 index f46a36d..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditJudgmentDebtorService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditJudgmentDebtor; -import com.gxwebsoft.credit.param.CreditJudgmentDebtorParam; - -import java.util.List; - -/** - * 被执行人Service - * - * @author 科技小王子 - * @since 2025-12-19 19:50:55 - */ -public interface CreditJudgmentDebtorService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditJudgmentDebtorParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditJudgmentDebtorParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditJudgmentDebtor - */ - CreditJudgmentDebtor getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditJudicialDocumentService.java b/src/main/java/com/gxwebsoft/credit/service/CreditJudicialDocumentService.java deleted file mode 100644 index 56ce04d..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditJudicialDocumentService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditJudicialDocument; -import com.gxwebsoft.credit.param.CreditJudicialDocumentParam; - -import java.util.List; - -/** - * 裁判文书司法大数据Service - * - * @author 科技小王子 - * @since 2025-12-19 19:51:02 - */ -public interface CreditJudicialDocumentService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditJudicialDocumentParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditJudicialDocumentParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditJudicialDocument - */ - CreditJudicialDocument getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditJudiciaryService.java b/src/main/java/com/gxwebsoft/credit/service/CreditJudiciaryService.java deleted file mode 100644 index 122b303..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditJudiciaryService.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditJudiciary; -import com.gxwebsoft.credit.param.CreditJudiciaryParam; - -import java.util.List; - -/** - * 司法案件Service - * - * @author 科技小王子 - * @since 2025-12-16 15:23:58 - */ -public interface CreditJudiciaryService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditJudiciaryParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditJudiciaryParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditJudiciary - */ - CreditJudiciary getByIdRel(Integer id); - - /** - * 根据名称查询 - * - * @param name 名称 - * @return CreditJudiciary - */ - CreditJudiciary getByName(String name); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditMediationService.java b/src/main/java/com/gxwebsoft/credit/service/CreditMediationService.java deleted file mode 100644 index 4870dd8..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditMediationService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditMediation; -import com.gxwebsoft.credit.param.CreditMediationParam; - -import java.util.List; - -/** - * 诉前调解司法大数据Service - * - * @author 科技小王子 - * @since 2025-12-19 19:51:25 - */ -public interface CreditMediationService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditMediationParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditMediationParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditMediation - */ - CreditMediation getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditNearbyCompanyService.java b/src/main/java/com/gxwebsoft/credit/service/CreditNearbyCompanyService.java deleted file mode 100644 index 7622af9..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditNearbyCompanyService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditNearbyCompany; -import com.gxwebsoft.credit.param.CreditNearbyCompanyParam; - -import java.util.List; - -/** - * 附近企业Service - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -public interface CreditNearbyCompanyService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditNearbyCompanyParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditNearbyCompanyParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditNearbyCompany - */ - CreditNearbyCompany getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditPatentService.java b/src/main/java/com/gxwebsoft/credit/service/CreditPatentService.java deleted file mode 100644 index 44d0e99..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditPatentService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditPatent; -import com.gxwebsoft.credit.param.CreditPatentParam; - -import java.util.List; - -/** - * 专利Service - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -public interface CreditPatentService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditPatentParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditPatentParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditPatent - */ - CreditPatent getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditRiskRelationService.java b/src/main/java/com/gxwebsoft/credit/service/CreditRiskRelationService.java deleted file mode 100644 index 141ff83..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditRiskRelationService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditRiskRelation; -import com.gxwebsoft.credit.param.CreditRiskRelationParam; - -import java.util.List; - -/** - * 风险关系表Service - * - * @author 科技小王子 - * @since 2025-12-19 19:51:40 - */ -public interface CreditRiskRelationService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditRiskRelationParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditRiskRelationParam param); - - /** - * 根据id查询 - * - * @param id 序号 - * @return CreditRiskRelation - */ - CreditRiskRelation getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditSupplierService.java b/src/main/java/com/gxwebsoft/credit/service/CreditSupplierService.java deleted file mode 100644 index 469fd34..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditSupplierService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditSupplier; -import com.gxwebsoft.credit.param.CreditSupplierParam; - -import java.util.List; - -/** - * 供应商Service - * - * @author 科技小王子 - * @since 2025-12-19 19:51:47 - */ -public interface CreditSupplierService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditSupplierParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditSupplierParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditSupplier - */ - CreditSupplier getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditSuspectedRelationshipService.java b/src/main/java/com/gxwebsoft/credit/service/CreditSuspectedRelationshipService.java deleted file mode 100644 index f44913d..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditSuspectedRelationshipService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditSuspectedRelationship; -import com.gxwebsoft.credit.param.CreditSuspectedRelationshipParam; - -import java.util.List; - -/** - * 疑似关系Service - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -public interface CreditSuspectedRelationshipService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditSuspectedRelationshipParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditSuspectedRelationshipParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditSuspectedRelationship - */ - CreditSuspectedRelationship getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditUserService.java b/src/main/java/com/gxwebsoft/credit/service/CreditUserService.java deleted file mode 100644 index e833256..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditUserService.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditUser; -import com.gxwebsoft.credit.param.CreditUserParam; - -import java.util.List; - -/** - * 招投标信息表Service - * - * @author 科技小王子 - * @since 2025-12-15 13:16:03 - */ -public interface CreditUserService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditUserParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditUserParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditUser - */ - CreditUser getByIdRel(Integer id); - - CreditUser getByName(String name); -} diff --git a/src/main/java/com/gxwebsoft/credit/service/CreditXgxfService.java b/src/main/java/com/gxwebsoft/credit/service/CreditXgxfService.java deleted file mode 100644 index 7871e79..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/CreditXgxfService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.credit.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditXgxf; -import com.gxwebsoft.credit.param.CreditXgxfParam; - -import java.util.List; - -/** - * 限制高消费Service - * - * @author 科技小王子 - * @since 2025-12-19 19:51:55 - */ -public interface CreditXgxfService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(CreditXgxfParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(CreditXgxfParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return CreditXgxf - */ - CreditXgxf getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditAdministrativeLicenseServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditAdministrativeLicenseServiceImpl.java deleted file mode 100644 index 8df16b6..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditAdministrativeLicenseServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditAdministrativeLicense; -import com.gxwebsoft.credit.mapper.CreditAdministrativeLicenseMapper; -import com.gxwebsoft.credit.param.CreditAdministrativeLicenseParam; -import com.gxwebsoft.credit.service.CreditAdministrativeLicenseService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 行政许可Service实现 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:13 - */ -@Service -public class CreditAdministrativeLicenseServiceImpl extends ServiceImpl implements CreditAdministrativeLicenseService { - - @Override - public PageResult pageRel(CreditAdministrativeLicenseParam 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(CreditAdministrativeLicenseParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditAdministrativeLicense getByIdRel(Integer id) { - CreditAdministrativeLicenseParam param = new CreditAdministrativeLicenseParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditBankruptcyServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditBankruptcyServiceImpl.java deleted file mode 100644 index 7ce7d70..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditBankruptcyServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditBankruptcy; -import com.gxwebsoft.credit.mapper.CreditBankruptcyMapper; -import com.gxwebsoft.credit.param.CreditBankruptcyParam; -import com.gxwebsoft.credit.service.CreditBankruptcyService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 破产重整Service实现 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Service -public class CreditBankruptcyServiceImpl extends ServiceImpl implements CreditBankruptcyService { - - @Override - public PageResult pageRel(CreditBankruptcyParam 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(CreditBankruptcyParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditBankruptcy getByIdRel(Integer id) { - CreditBankruptcyParam param = new CreditBankruptcyParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditBranchServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditBranchServiceImpl.java deleted file mode 100644 index dcf4bec..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditBranchServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditBranch; -import com.gxwebsoft.credit.mapper.CreditBranchMapper; -import com.gxwebsoft.credit.param.CreditBranchParam; -import com.gxwebsoft.credit.service.CreditBranchService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 分支机构Service实现 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Service -public class CreditBranchServiceImpl extends ServiceImpl implements CreditBranchService { - - @Override - public PageResult pageRel(CreditBranchParam 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(CreditBranchParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditBranch getByIdRel(Integer id) { - CreditBranchParam param = new CreditBranchParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditBreachOfTrustServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditBreachOfTrustServiceImpl.java deleted file mode 100644 index 0398416..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditBreachOfTrustServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditBreachOfTrust; -import com.gxwebsoft.credit.mapper.CreditBreachOfTrustMapper; -import com.gxwebsoft.credit.param.CreditBreachOfTrustParam; -import com.gxwebsoft.credit.service.CreditBreachOfTrustService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 失信被执行人Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:46:14 - */ -@Service -public class CreditBreachOfTrustServiceImpl extends ServiceImpl implements CreditBreachOfTrustService { - - @Override - public PageResult pageRel(CreditBreachOfTrustParam 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(CreditBreachOfTrustParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditBreachOfTrust getByIdRel(Integer id) { - CreditBreachOfTrustParam param = new CreditBreachOfTrustParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditCaseFilingServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditCaseFilingServiceImpl.java deleted file mode 100644 index 3f1f4e4..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditCaseFilingServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditCaseFiling; -import com.gxwebsoft.credit.mapper.CreditCaseFilingMapper; -import com.gxwebsoft.credit.param.CreditCaseFilingParam; -import com.gxwebsoft.credit.service.CreditCaseFilingService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 司法大数据Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:47:22 - */ -@Service -public class CreditCaseFilingServiceImpl extends ServiceImpl implements CreditCaseFilingService { - - @Override - public PageResult pageRel(CreditCaseFilingParam 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(CreditCaseFilingParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditCaseFiling getByIdRel(Integer id) { - CreditCaseFilingParam param = new CreditCaseFilingParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditCompanyServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditCompanyServiceImpl.java deleted file mode 100644 index ab591b3..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditCompanyServiceImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditCompany; -import com.gxwebsoft.credit.mapper.CreditCompanyMapper; -import com.gxwebsoft.credit.param.CreditCompanyParam; -import com.gxwebsoft.credit.service.CreditCompanyService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 企业Service实现 - * - * @author 科技小王子 - * @since 2025-12-17 08:28:03 - */ -@Service -public class CreditCompanyServiceImpl extends ServiceImpl implements CreditCompanyService { - - @Override - public PageResult pageRel(CreditCompanyParam 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(CreditCompanyParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditCompany getByIdRel(Integer id) { - CreditCompanyParam param = new CreditCompanyParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - - @Override - public CreditCompany getByName(String name) { - CreditCompanyParam param = new CreditCompanyParam(); - param.setName(name); - return param.getOne(baseMapper.selectListRel(param)); - } - - @Override - public CreditCompany getByMatchName(String name) { - CreditCompanyParam param = new CreditCompanyParam(); - param.setMatchName(name); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditCompetitorServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditCompetitorServiceImpl.java deleted file mode 100644 index 4204d3e..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditCompetitorServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditCompetitor; -import com.gxwebsoft.credit.mapper.CreditCompetitorMapper; -import com.gxwebsoft.credit.param.CreditCompetitorParam; -import com.gxwebsoft.credit.service.CreditCompetitorService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 竞争对手Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:05 - */ -@Service -public class CreditCompetitorServiceImpl extends ServiceImpl implements CreditCompetitorService { - - @Override - public PageResult pageRel(CreditCompetitorParam 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(CreditCompetitorParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditCompetitor getByIdRel(Integer id) { - CreditCompetitorParam param = new CreditCompetitorParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditCourtAnnouncementServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditCourtAnnouncementServiceImpl.java deleted file mode 100644 index d9e6ecf..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditCourtAnnouncementServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditCourtAnnouncement; -import com.gxwebsoft.credit.mapper.CreditCourtAnnouncementMapper; -import com.gxwebsoft.credit.param.CreditCourtAnnouncementParam; -import com.gxwebsoft.credit.service.CreditCourtAnnouncementService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 法院公告司法大数据Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:13 - */ -@Service -public class CreditCourtAnnouncementServiceImpl extends ServiceImpl implements CreditCourtAnnouncementService { - - @Override - public PageResult pageRel(CreditCourtAnnouncementParam 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(CreditCourtAnnouncementParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditCourtAnnouncement getByIdRel(Integer id) { - CreditCourtAnnouncementParam param = new CreditCourtAnnouncementParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditCourtSessionServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditCourtSessionServiceImpl.java deleted file mode 100644 index c875735..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditCourtSessionServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditCourtSession; -import com.gxwebsoft.credit.mapper.CreditCourtSessionMapper; -import com.gxwebsoft.credit.param.CreditCourtSessionParam; -import com.gxwebsoft.credit.service.CreditCourtSessionService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 开庭公告司法大数据Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:33 - */ -@Service -public class CreditCourtSessionServiceImpl extends ServiceImpl implements CreditCourtSessionService { - - @Override - public PageResult pageRel(CreditCourtSessionParam 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(CreditCourtSessionParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditCourtSession getByIdRel(Integer id) { - CreditCourtSessionParam param = new CreditCourtSessionParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditCustomerServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditCustomerServiceImpl.java deleted file mode 100644 index edfbfc8..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditCustomerServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditCustomer; -import com.gxwebsoft.credit.mapper.CreditCustomerMapper; -import com.gxwebsoft.credit.param.CreditCustomerParam; -import com.gxwebsoft.credit.service.CreditCustomerService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 客户Service实现 - * - * @author 科技小王子 - * @since 2025-12-21 21:20:58 - */ -@Service -public class CreditCustomerServiceImpl extends ServiceImpl implements CreditCustomerService { - - @Override - public PageResult pageRel(CreditCustomerParam 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(CreditCustomerParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditCustomer getByIdRel(Integer id) { - CreditCustomerParam param = new CreditCustomerParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditDeliveryNoticeServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditDeliveryNoticeServiceImpl.java deleted file mode 100644 index becedc3..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditDeliveryNoticeServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditDeliveryNotice; -import com.gxwebsoft.credit.mapper.CreditDeliveryNoticeMapper; -import com.gxwebsoft.credit.param.CreditDeliveryNoticeParam; -import com.gxwebsoft.credit.service.CreditDeliveryNoticeService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 送达公告司法大数据Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:49:51 - */ -@Service -public class CreditDeliveryNoticeServiceImpl extends ServiceImpl implements CreditDeliveryNoticeService { - - @Override - public PageResult pageRel(CreditDeliveryNoticeParam 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(CreditDeliveryNoticeParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditDeliveryNotice getByIdRel(Integer id) { - CreditDeliveryNoticeParam param = new CreditDeliveryNoticeParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditExternalServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditExternalServiceImpl.java deleted file mode 100644 index 2b45a20..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditExternalServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditExternal; -import com.gxwebsoft.credit.mapper.CreditExternalMapper; -import com.gxwebsoft.credit.param.CreditExternalParam; -import com.gxwebsoft.credit.service.CreditExternalService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 对外投资Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:11 - */ -@Service -public class CreditExternalServiceImpl extends ServiceImpl implements CreditExternalService { - - @Override - public PageResult pageRel(CreditExternalParam 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(CreditExternalParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditExternal getByIdRel(Integer id) { - CreditExternalParam param = new CreditExternalParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditFinalVersionServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditFinalVersionServiceImpl.java deleted file mode 100644 index c40ec14..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditFinalVersionServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditFinalVersion; -import com.gxwebsoft.credit.mapper.CreditFinalVersionMapper; -import com.gxwebsoft.credit.param.CreditFinalVersionParam; -import com.gxwebsoft.credit.service.CreditFinalVersionService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 终本案件Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:19 - */ -@Service -public class CreditFinalVersionServiceImpl extends ServiceImpl implements CreditFinalVersionService { - - @Override - public PageResult pageRel(CreditFinalVersionParam 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(CreditFinalVersionParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditFinalVersion getByIdRel(Integer id) { - CreditFinalVersionParam param = new CreditFinalVersionParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditGqdjServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditGqdjServiceImpl.java deleted file mode 100644 index acc1353..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditGqdjServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditGqdj; -import com.gxwebsoft.credit.mapper.CreditGqdjMapper; -import com.gxwebsoft.credit.param.CreditGqdjParam; -import com.gxwebsoft.credit.service.CreditGqdjService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 股权冻结Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:37 - */ -@Service -public class CreditGqdjServiceImpl extends ServiceImpl implements CreditGqdjService { - - @Override - public PageResult pageRel(CreditGqdjParam 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(CreditGqdjParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditGqdj getByIdRel(Integer id) { - CreditGqdjParam param = new CreditGqdjParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditHistoricalLegalPersonServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditHistoricalLegalPersonServiceImpl.java deleted file mode 100644 index ffd3d1f..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditHistoricalLegalPersonServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditHistoricalLegalPerson; -import com.gxwebsoft.credit.mapper.CreditHistoricalLegalPersonMapper; -import com.gxwebsoft.credit.param.CreditHistoricalLegalPersonParam; -import com.gxwebsoft.credit.service.CreditHistoricalLegalPersonService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 历史法定代表人Service实现 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Service -public class CreditHistoricalLegalPersonServiceImpl extends ServiceImpl implements CreditHistoricalLegalPersonService { - - @Override - public PageResult pageRel(CreditHistoricalLegalPersonParam 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(CreditHistoricalLegalPersonParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditHistoricalLegalPerson getByIdRel(Integer id) { - CreditHistoricalLegalPersonParam param = new CreditHistoricalLegalPersonParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditJudgmentDebtorServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditJudgmentDebtorServiceImpl.java deleted file mode 100644 index 9291270..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditJudgmentDebtorServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditJudgmentDebtor; -import com.gxwebsoft.credit.mapper.CreditJudgmentDebtorMapper; -import com.gxwebsoft.credit.param.CreditJudgmentDebtorParam; -import com.gxwebsoft.credit.service.CreditJudgmentDebtorService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 被执行人Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:50:55 - */ -@Service -public class CreditJudgmentDebtorServiceImpl extends ServiceImpl implements CreditJudgmentDebtorService { - - @Override - public PageResult pageRel(CreditJudgmentDebtorParam 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(CreditJudgmentDebtorParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditJudgmentDebtor getByIdRel(Integer id) { - CreditJudgmentDebtorParam param = new CreditJudgmentDebtorParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditJudicialDocumentServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditJudicialDocumentServiceImpl.java deleted file mode 100644 index a83095a..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditJudicialDocumentServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditJudicialDocument; -import com.gxwebsoft.credit.mapper.CreditJudicialDocumentMapper; -import com.gxwebsoft.credit.param.CreditJudicialDocumentParam; -import com.gxwebsoft.credit.service.CreditJudicialDocumentService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 裁判文书司法大数据Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:02 - */ -@Service -public class CreditJudicialDocumentServiceImpl extends ServiceImpl implements CreditJudicialDocumentService { - - @Override - public PageResult pageRel(CreditJudicialDocumentParam 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(CreditJudicialDocumentParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditJudicialDocument getByIdRel(Integer id) { - CreditJudicialDocumentParam param = new CreditJudicialDocumentParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditJudiciaryServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditJudiciaryServiceImpl.java deleted file mode 100644 index 6b31fbe..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditJudiciaryServiceImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditJudiciary; -import com.gxwebsoft.credit.mapper.CreditJudiciaryMapper; -import com.gxwebsoft.credit.param.CreditJudiciaryParam; -import com.gxwebsoft.credit.service.CreditJudiciaryService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 司法案件Service实现 - * - * @author 科技小王子 - * @since 2025-12-16 15:23:58 - */ -@Service -public class CreditJudiciaryServiceImpl extends ServiceImpl implements CreditJudiciaryService { - - @Override - public PageResult pageRel(CreditJudiciaryParam 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(CreditJudiciaryParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditJudiciary getByIdRel(Integer id) { - CreditJudiciaryParam param = new CreditJudiciaryParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - - @Override - public CreditJudiciary getByName(String name) { - CreditJudiciaryParam param = new CreditJudiciaryParam(); - param.setName(name); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditMediationServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditMediationServiceImpl.java deleted file mode 100644 index 9ec551a..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditMediationServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditMediation; -import com.gxwebsoft.credit.mapper.CreditMediationMapper; -import com.gxwebsoft.credit.param.CreditMediationParam; -import com.gxwebsoft.credit.service.CreditMediationService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 诉前调解司法大数据Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:25 - */ -@Service -public class CreditMediationServiceImpl extends ServiceImpl implements CreditMediationService { - - @Override - public PageResult pageRel(CreditMediationParam 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(CreditMediationParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditMediation getByIdRel(Integer id) { - CreditMediationParam param = new CreditMediationParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditNearbyCompanyServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditNearbyCompanyServiceImpl.java deleted file mode 100644 index 5083b95..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditNearbyCompanyServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditNearbyCompany; -import com.gxwebsoft.credit.mapper.CreditNearbyCompanyMapper; -import com.gxwebsoft.credit.param.CreditNearbyCompanyParam; -import com.gxwebsoft.credit.service.CreditNearbyCompanyService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 附近企业Service实现 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Service -public class CreditNearbyCompanyServiceImpl extends ServiceImpl implements CreditNearbyCompanyService { - - @Override - public PageResult pageRel(CreditNearbyCompanyParam 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(CreditNearbyCompanyParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditNearbyCompany getByIdRel(Integer id) { - CreditNearbyCompanyParam param = new CreditNearbyCompanyParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditPatentServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditPatentServiceImpl.java deleted file mode 100644 index 3bb975d..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditPatentServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditPatent; -import com.gxwebsoft.credit.mapper.CreditPatentMapper; -import com.gxwebsoft.credit.param.CreditPatentParam; -import com.gxwebsoft.credit.service.CreditPatentService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 专利Service实现 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Service -public class CreditPatentServiceImpl extends ServiceImpl implements CreditPatentService { - - @Override - public PageResult pageRel(CreditPatentParam 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(CreditPatentParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditPatent getByIdRel(Integer id) { - CreditPatentParam param = new CreditPatentParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditRiskRelationServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditRiskRelationServiceImpl.java deleted file mode 100644 index f000de1..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditRiskRelationServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditRiskRelation; -import com.gxwebsoft.credit.mapper.CreditRiskRelationMapper; -import com.gxwebsoft.credit.param.CreditRiskRelationParam; -import com.gxwebsoft.credit.service.CreditRiskRelationService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 风险关系表Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:40 - */ -@Service -public class CreditRiskRelationServiceImpl extends ServiceImpl implements CreditRiskRelationService { - - @Override - public PageResult pageRel(CreditRiskRelationParam 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(CreditRiskRelationParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditRiskRelation getByIdRel(Integer id) { - CreditRiskRelationParam param = new CreditRiskRelationParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditSupplierServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditSupplierServiceImpl.java deleted file mode 100644 index 56a9c06..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditSupplierServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditSupplier; -import com.gxwebsoft.credit.mapper.CreditSupplierMapper; -import com.gxwebsoft.credit.param.CreditSupplierParam; -import com.gxwebsoft.credit.service.CreditSupplierService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 供应商Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:47 - */ -@Service -public class CreditSupplierServiceImpl extends ServiceImpl implements CreditSupplierService { - - @Override - public PageResult pageRel(CreditSupplierParam 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(CreditSupplierParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditSupplier getByIdRel(Integer id) { - CreditSupplierParam param = new CreditSupplierParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditSuspectedRelationshipServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditSuspectedRelationshipServiceImpl.java deleted file mode 100644 index 4907758..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditSuspectedRelationshipServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditSuspectedRelationship; -import com.gxwebsoft.credit.mapper.CreditSuspectedRelationshipMapper; -import com.gxwebsoft.credit.param.CreditSuspectedRelationshipParam; -import com.gxwebsoft.credit.service.CreditSuspectedRelationshipService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 疑似关系Service实现 - * - * @author 科技小王子 - * @since 2026-01-07 13:52:14 - */ -@Service -public class CreditSuspectedRelationshipServiceImpl extends ServiceImpl implements CreditSuspectedRelationshipService { - - @Override - public PageResult pageRel(CreditSuspectedRelationshipParam 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(CreditSuspectedRelationshipParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditSuspectedRelationship getByIdRel(Integer id) { - CreditSuspectedRelationshipParam param = new CreditSuspectedRelationshipParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditUserServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditUserServiceImpl.java deleted file mode 100644 index 9bd5a00..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditUserServiceImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.credit.mapper.CreditUserMapper; -import com.gxwebsoft.credit.service.CreditUserService; -import com.gxwebsoft.credit.entity.CreditUser; -import com.gxwebsoft.credit.param.CreditUserParam; -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 科技小王子 - * @since 2025-12-15 13:16:03 - */ -@Service -public class CreditUserServiceImpl extends ServiceImpl implements CreditUserService { - - @Override - public PageResult pageRel(CreditUserParam 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(CreditUserParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditUser getByIdRel(Integer id) { - CreditUserParam param = new CreditUserParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - - @Override - public CreditUser getByName(String name) { - CreditUserParam param = new CreditUserParam(); - param.setName(name); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/credit/service/impl/CreditXgxfServiceImpl.java b/src/main/java/com/gxwebsoft/credit/service/impl/CreditXgxfServiceImpl.java deleted file mode 100644 index d8ffa3a..0000000 --- a/src/main/java/com/gxwebsoft/credit/service/impl/CreditXgxfServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.credit.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.credit.entity.CreditXgxf; -import com.gxwebsoft.credit.mapper.CreditXgxfMapper; -import com.gxwebsoft.credit.param.CreditXgxfParam; -import com.gxwebsoft.credit.service.CreditXgxfService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 限制高消费Service实现 - * - * @author 科技小王子 - * @since 2025-12-19 19:51:55 - */ -@Service -public class CreditXgxfServiceImpl extends ServiceImpl implements CreditXgxfService { - - @Override - public PageResult pageRel(CreditXgxfParam 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(CreditXgxfParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public CreditXgxf getByIdRel(Integer id) { - CreditXgxfParam param = new CreditXgxfParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryApplyController.java b/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryApplyController.java deleted file mode 100644 index b34af63..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryApplyController.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.gxwebsoft.dormitory.controller; - -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.dormitory.entity.DormitoryApply; -import com.gxwebsoft.dormitory.param.DormitoryApplyParam; -import com.gxwebsoft.dormitory.service.DormitoryApplyService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 审批管理控制器 - * - * @author 科技小王子 - * @since 2025-10-03 15:54:30 - */ -@Tag(name = "审批管理管理") -@RestController -@RequestMapping("/api/dormitory/dormitory-apply") -public class DormitoryApplyController extends BaseController { - @Resource - private DormitoryApplyService dormitoryApplyService; - - @PreAuthorize("hasAuthority('dormitory:dormitoryApply:list')") - @Operation(summary = "分页查询审批管理") - @GetMapping("/page") - public ApiResult> page(DormitoryApplyParam param) { - // 使用关联查询 - return success(dormitoryApplyService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryApply:list')") - @Operation(summary = "查询全部审批管理") - @GetMapping() - public ApiResult> list(DormitoryApplyParam param) { - // 使用关联查询 - return success(dormitoryApplyService.listRel(param)); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryApply:list')") - @Operation(summary = "根据id查询审批管理") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(dormitoryApplyService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryApply:save')") - @OperationLog - @Operation(summary = "添加审批管理") - @PostMapping() - public ApiResult save(@RequestBody DormitoryApply dormitoryApply) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - dormitoryApply.setUserId(loginUser.getUserId()); - } - if (dormitoryApplyService.save(dormitoryApply)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryApply:update')") - @OperationLog - @Operation(summary = "修改审批管理") - @PutMapping() - public ApiResult update(@RequestBody DormitoryApply dormitoryApply) { - if (dormitoryApplyService.updateById(dormitoryApply)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryApply:remove')") - @OperationLog - @Operation(summary = "删除审批管理") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (dormitoryApplyService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryApply:save')") - @OperationLog - @Operation(summary = "批量添加审批管理") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (dormitoryApplyService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryApply:update')") - @OperationLog - @Operation(summary = "批量修改审批管理") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(dormitoryApplyService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryApply:remove')") - @OperationLog - @Operation(summary = "批量删除审批管理") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (dormitoryApplyService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryBedController.java b/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryBedController.java deleted file mode 100644 index c90f412..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryBedController.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.gxwebsoft.dormitory.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.dormitory.service.DormitoryBedService; -import com.gxwebsoft.dormitory.entity.DormitoryBed; -import com.gxwebsoft.dormitory.param.DormitoryBedParam; -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.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 宿舍床位控制器 - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Tag(name = "宿舍床位管理") -@RestController -@RequestMapping("/api/dormitory/dormitory-bed") -public class DormitoryBedController extends BaseController { - @Resource - private DormitoryBedService dormitoryBedService; - - @Operation(summary = "分页查询宿舍床位") - @GetMapping("/page") - public ApiResult> page(DormitoryBedParam param) { - // 使用关联查询 - return success(dormitoryBedService.pageRel(param)); - } - - @Operation(summary = "查询全部宿舍床位") - @GetMapping() - public ApiResult> list(DormitoryBedParam param) { - // 使用关联查询 - return success(dormitoryBedService.listRel(param)); - } - - @Operation(summary = "根据id查询宿舍床位") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(dormitoryBedService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryBed:save')") - @OperationLog - @Operation(summary = "添加宿舍床位") - @PostMapping() - public ApiResult save(@RequestBody DormitoryBed dormitoryBed) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - // dormitoryBed实体类没有userId字段,所以不设置 - } - if (dormitoryBedService.save(dormitoryBed)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryBed:update')") - @OperationLog - @Operation(summary = "修改宿舍床位") - @PutMapping() - public ApiResult update(@RequestBody DormitoryBed dormitoryBed) { - if (dormitoryBedService.updateById(dormitoryBed)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryBed:remove')") - @OperationLog - @Operation(summary = "删除宿舍床位") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (dormitoryBedService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryBed:save')") - @OperationLog - @Operation(summary = "批量添加宿舍床位") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (dormitoryBedService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryBed:update')") - @OperationLog - @Operation(summary = "批量修改宿舍床位") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(dormitoryBedService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryBed:remove')") - @OperationLog - @Operation(summary = "批量删除宿舍床位") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (dormitoryBedService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryBuildingController.java b/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryBuildingController.java deleted file mode 100644 index ab84fbf..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryBuildingController.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.gxwebsoft.dormitory.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.dormitory.service.DormitoryBuildingService; -import com.gxwebsoft.dormitory.entity.DormitoryBuilding; -import com.gxwebsoft.dormitory.param.DormitoryBuildingParam; -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.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 宿舍楼栋控制器 - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Tag(name = "宿舍楼栋管理") -@RestController -@RequestMapping("/api/dormitory/dormitory-building") -public class DormitoryBuildingController extends BaseController { - @Resource - private DormitoryBuildingService dormitoryBuildingService; - - @Operation(summary = "分页查询宿舍楼栋") - @GetMapping("/page") - public ApiResult> page(DormitoryBuildingParam param) { - // 使用关联查询 - return success(dormitoryBuildingService.pageRel(param)); - } - - @Operation(summary = "查询全部宿舍楼栋") - @GetMapping() - public ApiResult> list(DormitoryBuildingParam param) { - // 使用关联查询 - return success(dormitoryBuildingService.listRel(param)); - } - - @Operation(summary = "根据id查询宿舍楼栋") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(dormitoryBuildingService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryBuilding:save')") - @OperationLog - @Operation(summary = "添加宿舍楼栋") - @PostMapping() - public ApiResult save(@RequestBody DormitoryBuilding dormitoryBuilding) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - // dormitoryBuilding实体类没有userId字段,所以不设置 - } - if (dormitoryBuildingService.save(dormitoryBuilding)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryBuilding:update')") - @OperationLog - @Operation(summary = "修改宿舍楼栋") - @PutMapping() - public ApiResult update(@RequestBody DormitoryBuilding dormitoryBuilding) { - if (dormitoryBuildingService.updateById(dormitoryBuilding)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryBuilding:remove')") - @OperationLog - @Operation(summary = "删除宿舍楼栋") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (dormitoryBuildingService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryBuilding:save')") - @OperationLog - @Operation(summary = "批量添加宿舍楼栋") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (dormitoryBuildingService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryBuilding:update')") - @OperationLog - @Operation(summary = "批量修改宿舍楼栋") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(dormitoryBuildingService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryBuilding:remove')") - @OperationLog - @Operation(summary = "批量删除宿舍楼栋") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (dormitoryBuildingService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryFloorController.java b/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryFloorController.java deleted file mode 100644 index 2d16bda..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryFloorController.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.gxwebsoft.dormitory.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.dormitory.service.DormitoryFloorService; -import com.gxwebsoft.dormitory.entity.DormitoryFloor; -import com.gxwebsoft.dormitory.param.DormitoryFloorParam; -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.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 宿舍楼层控制器 - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Tag(name = "宿舍楼层管理") -@RestController -@RequestMapping("/api/dormitory/dormitory-floor") -public class DormitoryFloorController extends BaseController { - @Resource - private DormitoryFloorService dormitoryFloorService; - - @Operation(summary = "分页查询宿舍楼层") - @GetMapping("/page") - public ApiResult> page(DormitoryFloorParam param) { - // 使用关联查询 - return success(dormitoryFloorService.pageRel(param)); - } - - @Operation(summary = "查询全部宿舍楼层") - @GetMapping() - public ApiResult> list(DormitoryFloorParam param) { - // 使用关联查询 - return success(dormitoryFloorService.listRel(param)); - } - - @Operation(summary = "根据id查询宿舍楼层") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(dormitoryFloorService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryFloor:save')") - @OperationLog - @Operation(summary = "添加宿舍楼层") - @PostMapping() - public ApiResult save(@RequestBody DormitoryFloor dormitoryFloor) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - // dormitoryFloor实体类没有userId字段,所以不设置 - } - if (dormitoryFloorService.save(dormitoryFloor)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryFloor:update')") - @OperationLog - @Operation(summary = "修改宿舍楼层") - @PutMapping() - public ApiResult update(@RequestBody DormitoryFloor dormitoryFloor) { - if (dormitoryFloorService.updateById(dormitoryFloor)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryFloor:remove')") - @OperationLog - @Operation(summary = "删除宿舍楼层") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (dormitoryFloorService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryFloor:save')") - @OperationLog - @Operation(summary = "批量添加宿舍楼层") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (dormitoryFloorService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryFloor:update')") - @OperationLog - @Operation(summary = "批量修改宿舍楼层") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(dormitoryFloorService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryFloor:remove')") - @OperationLog - @Operation(summary = "批量删除宿舍楼层") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (dormitoryFloorService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryRecordController.java b/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryRecordController.java deleted file mode 100644 index 7a6cc15..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/controller/DormitoryRecordController.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.gxwebsoft.dormitory.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.dormitory.service.DormitoryRecordService; -import com.gxwebsoft.dormitory.entity.DormitoryRecord; -import com.gxwebsoft.dormitory.param.DormitoryRecordParam; -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.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 宿舍记录控制器 - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Tag(name = "宿舍记录管理") -@RestController -@RequestMapping("/api/dormitory/dormitory-record") -public class DormitoryRecordController extends BaseController { - @Resource - private DormitoryRecordService dormitoryRecordService; - - @Operation(summary = "分页查询宿舍记录") - @GetMapping("/page") - public ApiResult> page(DormitoryRecordParam param) { - // 使用关联查询 - return success(dormitoryRecordService.pageRel(param)); - } - - @Operation(summary = "查询全部宿舍记录") - @GetMapping() - public ApiResult> list(DormitoryRecordParam param) { - // 使用关联查询 - return success(dormitoryRecordService.listRel(param)); - } - - @Operation(summary = "根据id查询宿舍记录") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(dormitoryRecordService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryRecord:save')") - @OperationLog - @Operation(summary = "添加宿舍记录") - @PostMapping() - public ApiResult save(@RequestBody DormitoryRecord dormitoryRecord) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - // dormitoryRecord实体类没有userId字段,所以不设置 - } - if (dormitoryRecordService.save(dormitoryRecord)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryRecord:update')") - @OperationLog - @Operation(summary = "修改宿舍记录") - @PutMapping() - public ApiResult update(@RequestBody DormitoryRecord dormitoryRecord) { - if (dormitoryRecordService.updateById(dormitoryRecord)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryRecord:remove')") - @OperationLog - @Operation(summary = "删除宿舍记录") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (dormitoryRecordService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryRecord:save')") - @OperationLog - @Operation(summary = "批量添加宿舍记录") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (dormitoryRecordService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryRecord:update')") - @OperationLog - @Operation(summary = "批量修改宿舍记录") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(dormitoryRecordService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('dormitory:dormitoryRecord:remove')") - @OperationLog - @Operation(summary = "批量删除宿舍记录") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (dormitoryRecordService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryApply.java b/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryApply.java deleted file mode 100644 index 0b82350..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryApply.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.gxwebsoft.dormitory.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 审批管理 - * - * @author 科技小王子 - * @since 2025-10-03 15:54:30 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(description = "审批管理") -public class DormitoryApply implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "类型") - private Integer type; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "姓名") - private String realName; - - @Schema(description = "手机号") - private String mobile; - - @Schema(description = "客户名称") - private String dealerName; - - @Schema(description = "客户编号") - private String dealerCode; - - @Schema(description = "详细地址") - private String address; - - @Schema(description = "签约价格") - private BigDecimal money; - - @Schema(description = "推荐人用户ID") - private Integer refereeId; - - @Schema(description = "申请方式(10需后台审核 20无需审核)") - private Integer applyType; - - @Schema(description = "审核状态 (10待审核 20审核通过 30驳回)") - private Integer applyStatus; - - @Schema(description = "申请时间") - private LocalDateTime applyTime; - - @Schema(description = "审核时间") - private LocalDateTime auditTime; - - @Schema(description = "合同时间") - private LocalDateTime contractTime; - - @Schema(description = "过期时间") - private LocalDateTime expirationTime; - - @Schema(description = "驳回原因") - private String rejectReason; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "商城ID") - private Integer tenantId; - - @Schema(description = "创建时间") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - private LocalDateTime updateTime; - -} \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryBed.java b/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryBed.java deleted file mode 100644 index 7302543..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryBed.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.gxwebsoft.dormitory.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 宿舍床位 - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(description = "宿舍床位") -public class DormitoryBed implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "宿舍名称") - private String name; - - @Schema(description = "编号") - private String code; - - @Schema(description = "楼栋ID") - private Integer buildingId; - - @Schema(description = "楼栋名称") - @TableField(exist = false) - private String buildingName; - - @Schema(description = "楼层ID") - private Integer floorId; - - @Schema(description = "楼层名称") - @TableField(exist = false) - private String floorName; - - @Schema(description = "宿舍ID") - private Integer recordId; - - @Schema(description = "宿舍名称") - @TableField(exist = false) - private String recordName; - - @Schema(description = "学生ID") - private Integer userId; - - @Schema(description = "学生昵称") - @TableField(exist = false) - private String realName; - - @Schema(description = "手机号码") - @TableField(exist = false) - private String phone; - - @Schema(description = "头像") - @TableField(exist = false) - private String avatar; - - @Schema(description = "上下铺 1下铺 2上铺 0无") - private Boolean bunk; - - @Schema(description = "充电口") - private Boolean chargingPort; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1报修") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private LocalDateTime createTime; - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryBuilding.java b/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryBuilding.java deleted file mode 100644 index f79d4fb..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryBuilding.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.gxwebsoft.dormitory.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 宿舍楼栋 - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(description = "宿舍楼栋") -public class DormitoryBuilding implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "楼栋名称") - private String name; - - @Schema(description = "楼栋编号") - private String code; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private LocalDateTime createTime; - -} \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryFloor.java b/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryFloor.java deleted file mode 100644 index e72b2e0..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryFloor.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.gxwebsoft.dormitory.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 宿舍楼层 - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(description = "宿舍楼层") -public class DormitoryFloor implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "楼层") - private String name; - - @Schema(description = "编号") - private String code; - - @Schema(description = "楼栋") - @TableField(exist = false) - private String buildingName; - - @Schema(description = "楼栋ID") - private Integer buildingId; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private LocalDateTime createTime; - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryRecord.java b/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryRecord.java deleted file mode 100644 index d2aac03..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/entity/DormitoryRecord.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.gxwebsoft.dormitory.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 宿舍记录 - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(description = "宿舍记录") -public class DormitoryRecord implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "宿舍名称") - private String name; - - @Schema(description = "编号") - private String code; - - @Schema(description = "楼栋ID") - private Integer buildingId; - - @Schema(description = "楼栋名称") - @TableField(exist = false) - private String buildingName; - - @Schema(description = "楼层ID") - private Integer floorId; - - @Schema(description = "楼层名称") - @TableField(exist = false) - private String floorName; - - @Schema(description = "床位数") - private Integer beds; - - @Schema(description = "独立卫生间") - private Boolean toilet; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private LocalDateTime createTime; - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryApplyMapper.java b/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryApplyMapper.java deleted file mode 100644 index b7e5ea5..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryApplyMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.dormitory.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.dormitory.entity.DormitoryApply; -import com.gxwebsoft.dormitory.param.DormitoryApplyParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 审批管理Mapper - * - * @author 科技小王子 - * @since 2025-10-03 15:54:30 - */ -public interface DormitoryApplyMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") DormitoryApplyParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") DormitoryApplyParam param); - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryBedMapper.java b/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryBedMapper.java deleted file mode 100644 index 484bf2b..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryBedMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.dormitory.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.dormitory.entity.DormitoryBed; -import com.gxwebsoft.dormitory.param.DormitoryBedParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 宿舍床位Mapper - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -public interface DormitoryBedMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") DormitoryBedParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") DormitoryBedParam param); - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryBuildingMapper.java b/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryBuildingMapper.java deleted file mode 100644 index 3bfc4ca..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryBuildingMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.dormitory.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.dormitory.entity.DormitoryBuilding; -import com.gxwebsoft.dormitory.param.DormitoryBuildingParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 宿舍楼栋Mapper - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -public interface DormitoryBuildingMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") DormitoryBuildingParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") DormitoryBuildingParam param); - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryFloorMapper.java b/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryFloorMapper.java deleted file mode 100644 index 84f7e9b..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryFloorMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.dormitory.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.dormitory.entity.DormitoryFloor; -import com.gxwebsoft.dormitory.param.DormitoryFloorParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 宿舍楼层Mapper - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -public interface DormitoryFloorMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") DormitoryFloorParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") DormitoryFloorParam param); - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryRecordMapper.java b/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryRecordMapper.java deleted file mode 100644 index 9d64316..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/mapper/DormitoryRecordMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.dormitory.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.dormitory.entity.DormitoryRecord; -import com.gxwebsoft.dormitory.param.DormitoryRecordParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 宿舍记录Mapper - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -public interface DormitoryRecordMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") DormitoryRecordParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") DormitoryRecordParam param); - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/mapper/xml/DormitoryApplyMapper.xml b/src/main/java/com/gxwebsoft/dormitory/mapper/xml/DormitoryApplyMapper.xml deleted file mode 100644 index a42aa41..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/mapper/xml/DormitoryApplyMapper.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - SELECT a.* - FROM dormitory_apply a - - - AND a.id = #{param.id} - - - AND a.type = #{param.type} - - - AND a.user_id = #{param.userId} - - - AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') - - - AND a.mobile LIKE CONCAT('%', #{param.mobile}, '%') - - - AND a.dealer_name LIKE CONCAT('%', #{param.dealerName}, '%') - - - AND a.dealer_code LIKE CONCAT('%', #{param.dealerCode}, '%') - - - AND a.address LIKE CONCAT('%', #{param.address}, '%') - - - AND a.money = #{param.money} - - - AND a.referee_id = #{param.refereeId} - - - AND a.apply_type = #{param.applyType} - - - AND a.apply_status = #{param.applyStatus} - - - AND a.apply_time LIKE CONCAT('%', #{param.applyTime}, '%') - - - AND a.audit_time LIKE CONCAT('%', #{param.auditTime}, '%') - - - AND a.contract_time LIKE CONCAT('%', #{param.contractTime}, '%') - - - AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') - - - AND a.reject_reason LIKE CONCAT('%', #{param.rejectReason}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - 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/dormitory/mapper/xml/DormitoryBedMapper.xml b/src/main/java/com/gxwebsoft/dormitory/mapper/xml/DormitoryBedMapper.xml deleted file mode 100644 index 351e144..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/mapper/xml/DormitoryBedMapper.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - SELECT a.*, b.name AS buildingName, c.name AS floorName, d.name AS recordName, e.real_name AS realName, e.phone AS phone, e.avatar - FROM dormitory_bed a - LEFT JOIN dormitory_building b ON a.building_id = b.id - LEFT JOIN dormitory_floor c ON a.floor_id = c.id - LEFT JOIN dormitory_record d ON a.record_id = d.id - LEFT JOIN shop_user e ON a.user_id = e.user_id - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.building_id = #{param.buildingId} - - - AND a.floor_id = #{param.floorId} - - - AND a.record_id = #{param.recordId} - - - AND a.user_id = #{param.userId} - - - AND a.bunk = #{param.bunk} - - - AND a.charging_port = #{param.chargingPort} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - 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/dormitory/mapper/xml/DormitoryBuildingMapper.xml b/src/main/java/com/gxwebsoft/dormitory/mapper/xml/DormitoryBuildingMapper.xml deleted file mode 100644 index b7a6e30..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/mapper/xml/DormitoryBuildingMapper.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - SELECT a.* - FROM dormitory_building a - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - 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/dormitory/mapper/xml/DormitoryFloorMapper.xml b/src/main/java/com/gxwebsoft/dormitory/mapper/xml/DormitoryFloorMapper.xml deleted file mode 100644 index 9cafffe..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/mapper/xml/DormitoryFloorMapper.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - SELECT a.*, b.name AS buildingName - FROM dormitory_floor a - LEFT JOIN dormitory_building b ON a.building_id = b.id - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.building_id = #{param.buildingId} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - 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/dormitory/mapper/xml/DormitoryRecordMapper.xml b/src/main/java/com/gxwebsoft/dormitory/mapper/xml/DormitoryRecordMapper.xml deleted file mode 100644 index 95755c9..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/mapper/xml/DormitoryRecordMapper.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - SELECT a.*, b.name AS buildingName, c.name AS floorName - FROM dormitory_record a - LEFT JOIN dormitory_building b ON a.building_id = b.id - LEFT JOIN dormitory_floor c ON a.floor_id = c.id - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.building_id = #{param.buildingId} - - - AND a.floor_id = #{param.floorId} - - - AND a.beds = #{param.beds} - - - AND a.toilet = #{param.toilet} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - 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/dormitory/param/DormitoryApplyParam.java b/src/main/java/com/gxwebsoft/dormitory/param/DormitoryApplyParam.java deleted file mode 100644 index 474cb02..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/param/DormitoryApplyParam.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.gxwebsoft.dormitory.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 审批管理查询参数 - * - * @author 科技小王子 - * @since 2025-10-03 15:54:30 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(description = "审批管理查询参数") -public class DormitoryApplyParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "主键ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "类型") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "姓名") - private String realName; - - @Schema(description = "手机号") - private String mobile; - - @Schema(description = "客户名称") - private String dealerName; - - @Schema(description = "客户编号") - private String dealerCode; - - @Schema(description = "详细地址") - private String address; - - @Schema(description = "签约价格") - @QueryField(type = QueryType.EQ) - private BigDecimal money; - - @Schema(description = "推荐人用户ID") - @QueryField(type = QueryType.EQ) - private Integer refereeId; - - @Schema(description = "申请方式(10需后台审核 20无需审核)") - @QueryField(type = QueryType.EQ) - private Integer applyType; - - @Schema(description = "审核状态 (10待审核 20审核通过 30驳回)") - @QueryField(type = QueryType.EQ) - private Integer applyStatus; - - @Schema(description = "申请时间") - private String applyTime; - - @Schema(description = "审核时间") - private String auditTime; - - @Schema(description = "合同时间") - private String contractTime; - - @Schema(description = "过期时间") - private String expirationTime; - - @Schema(description = "驳回原因") - private String rejectReason; - - @Schema(description = "备注") - private String comments; - -} \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/dormitory/param/DormitoryBedParam.java b/src/main/java/com/gxwebsoft/dormitory/param/DormitoryBedParam.java deleted file mode 100644 index 2b99a10..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/param/DormitoryBedParam.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.gxwebsoft.dormitory.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.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 宿舍床位查询参数 - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(description = "宿舍床位查询参数") -public class DormitoryBedParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "宿舍名称") - private String name; - - @Schema(description = "编号") - private String code; - - @Schema(description = "楼栋ID") - @QueryField(type = QueryType.EQ) - private Integer buildingId; - - @Schema(description = "楼层ID") - @QueryField(type = QueryType.EQ) - private Integer floorId; - - @Schema(description = "宿舍ID") - @QueryField(type = QueryType.EQ) - private Integer recordId; - - @Schema(description = "学生ID") - private Integer userId; - - @Schema(description = "上下铺 1下铺 2上铺 0无") - @QueryField(type = QueryType.EQ) - private Boolean bunk; - - @Schema(description = "充电口") - @QueryField(type = QueryType.EQ) - private Boolean chargingPort; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1报修") - @QueryField(type = QueryType.EQ) - private Integer status; - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/param/DormitoryBuildingParam.java b/src/main/java/com/gxwebsoft/dormitory/param/DormitoryBuildingParam.java deleted file mode 100644 index 1c02691..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/param/DormitoryBuildingParam.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.gxwebsoft.dormitory.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.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 宿舍楼栋查询参数 - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(description = "宿舍楼栋查询参数") -public class DormitoryBuildingParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "楼栋名称") - private String name; - - @Schema(description = "楼栋编号") - private String code; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - -} \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/dormitory/param/DormitoryFloorParam.java b/src/main/java/com/gxwebsoft/dormitory/param/DormitoryFloorParam.java deleted file mode 100644 index d699dbc..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/param/DormitoryFloorParam.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.gxwebsoft.dormitory.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.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 宿舍楼层查询参数 - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(description = "宿舍楼层查询参数") -public class DormitoryFloorParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "楼层") - private String name; - - @Schema(description = "编号") - private String code; - - @Schema(description = "楼栋ID") - @QueryField(type = QueryType.EQ) - private Integer buildingId; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - -} \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/dormitory/param/DormitoryRecordParam.java b/src/main/java/com/gxwebsoft/dormitory/param/DormitoryRecordParam.java deleted file mode 100644 index 2843d1d..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/param/DormitoryRecordParam.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.gxwebsoft.dormitory.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.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 宿舍记录查询参数 - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(description = "宿舍记录查询参数") -public class DormitoryRecordParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "宿舍名称") - private String name; - - @Schema(description = "编号") - private String code; - - @Schema(description = "楼栋ID") - @QueryField(type = QueryType.EQ) - private Integer buildingId; - - @Schema(description = "楼层ID") - @QueryField(type = QueryType.EQ) - private Integer floorId; - - @Schema(description = "床位数") - @QueryField(type = QueryType.EQ) - private Integer beds; - - @Schema(description = "独立卫生间") - @QueryField(type = QueryType.EQ) - private Boolean toilet; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - -} \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/dormitory/service/DormitoryApplyService.java b/src/main/java/com/gxwebsoft/dormitory/service/DormitoryApplyService.java deleted file mode 100644 index 3456e75..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/service/DormitoryApplyService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.dormitory.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.dormitory.entity.DormitoryApply; -import com.gxwebsoft.dormitory.param.DormitoryApplyParam; - -import java.util.List; - -/** - * 审批管理Service - * - * @author 科技小王子 - * @since 2025-10-03 15:54:30 - */ -public interface DormitoryApplyService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(DormitoryApplyParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(DormitoryApplyParam param); - - /** - * 根据id查询 - * - * @param id 主键ID - * @return DormitoryApply - */ - DormitoryApply getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/service/DormitoryBedService.java b/src/main/java/com/gxwebsoft/dormitory/service/DormitoryBedService.java deleted file mode 100644 index 3f80f7b..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/service/DormitoryBedService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.dormitory.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.dormitory.entity.DormitoryBed; -import com.gxwebsoft.dormitory.param.DormitoryBedParam; - -import java.util.List; - -/** - * 宿舍床位Service - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -public interface DormitoryBedService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(DormitoryBedParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(DormitoryBedParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return DormitoryBed - */ - DormitoryBed getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/service/DormitoryBuildingService.java b/src/main/java/com/gxwebsoft/dormitory/service/DormitoryBuildingService.java deleted file mode 100644 index c5b015f..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/service/DormitoryBuildingService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.dormitory.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.dormitory.entity.DormitoryBuilding; -import com.gxwebsoft.dormitory.param.DormitoryBuildingParam; - -import java.util.List; - -/** - * 宿舍楼栋Service - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -public interface DormitoryBuildingService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(DormitoryBuildingParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(DormitoryBuildingParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return DormitoryBuilding - */ - DormitoryBuilding getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/service/DormitoryFloorService.java b/src/main/java/com/gxwebsoft/dormitory/service/DormitoryFloorService.java deleted file mode 100644 index 0e64087..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/service/DormitoryFloorService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.dormitory.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.dormitory.entity.DormitoryFloor; -import com.gxwebsoft.dormitory.param.DormitoryFloorParam; - -import java.util.List; - -/** - * 宿舍楼层Service - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -public interface DormitoryFloorService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(DormitoryFloorParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(DormitoryFloorParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return DormitoryFloor - */ - DormitoryFloor getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/service/DormitoryRecordService.java b/src/main/java/com/gxwebsoft/dormitory/service/DormitoryRecordService.java deleted file mode 100644 index 13fe03d..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/service/DormitoryRecordService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.dormitory.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.dormitory.entity.DormitoryRecord; -import com.gxwebsoft.dormitory.param.DormitoryRecordParam; - -import java.util.List; - -/** - * 宿舍记录Service - * - * @author 科技小王子 - * @since 2025-10-03 10:49:27 - */ -public interface DormitoryRecordService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(DormitoryRecordParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(DormitoryRecordParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return DormitoryRecord - */ - DormitoryRecord getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryApplyServiceImpl.java b/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryApplyServiceImpl.java deleted file mode 100644 index 003fa9a..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryApplyServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.dormitory.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.dormitory.entity.DormitoryApply; -import com.gxwebsoft.dormitory.mapper.DormitoryApplyMapper; -import com.gxwebsoft.dormitory.param.DormitoryApplyParam; -import com.gxwebsoft.dormitory.service.DormitoryApplyService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 审批管理Service实现 - * - * @author 科技小王子 - * @since 2025-10-03 15:54:30 - */ -@Service -public class DormitoryApplyServiceImpl extends ServiceImpl implements DormitoryApplyService { - - @Override - public PageResult pageRel(DormitoryApplyParam 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(DormitoryApplyParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public DormitoryApply getByIdRel(Integer id) { - DormitoryApplyParam param = new DormitoryApplyParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryBedServiceImpl.java b/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryBedServiceImpl.java deleted file mode 100644 index 0014b17..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryBedServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.dormitory.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.dormitory.mapper.DormitoryBedMapper; -import com.gxwebsoft.dormitory.service.DormitoryBedService; -import com.gxwebsoft.dormitory.entity.DormitoryBed; -import com.gxwebsoft.dormitory.param.DormitoryBedParam; -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 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Service -public class DormitoryBedServiceImpl extends ServiceImpl implements DormitoryBedService { - - @Override - public PageResult pageRel(DormitoryBedParam 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(DormitoryBedParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public DormitoryBed getByIdRel(Integer id) { - DormitoryBedParam param = new DormitoryBedParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryBuildingServiceImpl.java b/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryBuildingServiceImpl.java deleted file mode 100644 index e15e01e..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryBuildingServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.dormitory.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.dormitory.mapper.DormitoryBuildingMapper; -import com.gxwebsoft.dormitory.service.DormitoryBuildingService; -import com.gxwebsoft.dormitory.entity.DormitoryBuilding; -import com.gxwebsoft.dormitory.param.DormitoryBuildingParam; -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 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Service -public class DormitoryBuildingServiceImpl extends ServiceImpl implements DormitoryBuildingService { - - @Override - public PageResult pageRel(DormitoryBuildingParam 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(DormitoryBuildingParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public DormitoryBuilding getByIdRel(Integer id) { - DormitoryBuildingParam param = new DormitoryBuildingParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryFloorServiceImpl.java b/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryFloorServiceImpl.java deleted file mode 100644 index 6ddd3c5..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryFloorServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.dormitory.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.dormitory.mapper.DormitoryFloorMapper; -import com.gxwebsoft.dormitory.service.DormitoryFloorService; -import com.gxwebsoft.dormitory.entity.DormitoryFloor; -import com.gxwebsoft.dormitory.param.DormitoryFloorParam; -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 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Service -public class DormitoryFloorServiceImpl extends ServiceImpl implements DormitoryFloorService { - - @Override - public PageResult pageRel(DormitoryFloorParam 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(DormitoryFloorParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public DormitoryFloor getByIdRel(Integer id) { - DormitoryFloorParam param = new DormitoryFloorParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryRecordServiceImpl.java b/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryRecordServiceImpl.java deleted file mode 100644 index a7f218b..0000000 --- a/src/main/java/com/gxwebsoft/dormitory/service/impl/DormitoryRecordServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.dormitory.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.dormitory.mapper.DormitoryRecordMapper; -import com.gxwebsoft.dormitory.service.DormitoryRecordService; -import com.gxwebsoft.dormitory.entity.DormitoryRecord; -import com.gxwebsoft.dormitory.param.DormitoryRecordParam; -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 科技小王子 - * @since 2025-10-03 10:49:27 - */ -@Service -public class DormitoryRecordServiceImpl extends ServiceImpl implements DormitoryRecordService { - - @Override - public PageResult pageRel(DormitoryRecordParam 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(DormitoryRecordParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public DormitoryRecord getByIdRel(Integer id) { - DormitoryRecordParam param = new DormitoryRecordParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/enterprise/controller/EnterpriseController.java b/src/main/java/com/gxwebsoft/enterprise/controller/EnterpriseController.java deleted file mode 100644 index 819568a..0000000 --- a/src/main/java/com/gxwebsoft/enterprise/controller/EnterpriseController.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.gxwebsoft.enterprise.controller; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.enterprise.entity.Enterprise; -import com.gxwebsoft.enterprise.service.EnterpriseService; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * - * @author GIIT-YC - * - */ -@Tag(name = "企业信息管理") -@RestController -@RequestMapping("/api/enterprise/enterprise") -public class EnterpriseController extends BaseController { - - @Resource - private EnterpriseService enterpriseService; - -// @PreAuthorize("hasAuthority('enterprise:enterprise:list')") - @Operation(summary = "分页查询企业信息") - @GetMapping("/page") - public ApiResult> page(Enterprise enterprise) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.like(StrUtil.isNotBlank(enterprise.getName()), Enterprise::getName, enterprise.getName()); - wrapper.like(StrUtil.isNotBlank(enterprise.getCreditCode()), Enterprise::getCreditCode, enterprise.getCreditCode()); - wrapper.orderByAsc(Enterprise::getName); - - final Page page = new Page<>(enterprise.getPage(), enterprise.getLimit()); - final IPage p = enterpriseService.page(page, wrapper); - - return success(new PageResult(p.getRecords(), p.getTotal())); - } - -// @PreAuthorize("hasAuthority('enterprise:enterprise:list')") - @Operation(summary = "查询全部企业信息") - @GetMapping("/list") - public ApiResult> list(Enterprise enterprise) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.like(StrUtil.isNotBlank(enterprise.getName()), Enterprise::getName, enterprise.getName()); - wrapper.like(StrUtil.isNotBlank(enterprise.getCreditCode()), Enterprise::getCreditCode, enterprise.getCreditCode()); - return success(enterpriseService.list(wrapper)); - } - -// @PreAuthorize("hasAuthority('enterprise:enterprise:list')") - @Operation(summary = "根据id查询企业信息") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(enterpriseService.getById(id)); - } - -// @PreAuthorize("hasAuthority('enterprise:enterprise:list')") - @Operation(summary = "根据CreditCode查询企业信息") - @GetMapping("/creditCode/{creditCode}") - public ApiResult getByCreditCode(@PathVariable("creditCode") String creditCode) { - Enterprise enterprise = enterpriseService.getOne(new LambdaQueryWrapper().eq(Enterprise::getCreditCode, creditCode)); - return success(enterprise); - } - -// @PreAuthorize("hasAuthority('enterprise:enterprise:save')") - @OperationLog - @Operation(summary = "添加企业信息") - @PostMapping() - public ApiResult save(@RequestBody Enterprise enterprise) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - enterprise.setUserId(loginUser.getUserId()); - final Enterprise one = enterpriseService.getOne(new LambdaQueryWrapper().eq(Enterprise::getCreditCode, enterprise.getCreditCode())); - if (!ObjectUtil.isEmpty(one)) { - return fail("企业统一信用代码已存在"); - } - if (enterpriseService.save(enterprise)) { - //TODO 查询知识库(kb_name=enterprise.getCreditCode) - - //TODO 新建知识库 - String kbId = "pggi9mpair"; - - //绑定知识库 - enterprise.setKbId(kbId); - enterpriseService.updateById(enterprise); - return success("添加成功"); - } - } - return fail("添加失败"); - } - -// @PreAuthorize("hasAuthority('enterprise:enterprise:update')") - @OperationLog - @Operation(summary = "修改企业信息") - @PutMapping() - public ApiResult update(@RequestBody Enterprise enterprise) { - if(StrUtil.isEmpty(enterprise.getKbId())) { - //TODO 查询知识库 - - //TODO 新建知识库 - String kbId = "pggi9mpair"; - - //绑定知识库 - enterprise.setKbId(kbId); - } - if (enterpriseService.updateById(enterprise)) { - return success("修改成功"); - } - return fail("修改失败"); - } - -// @PreAuthorize("hasAuthority('enterprise:enterprise:remove')") - @OperationLog - @Operation(summary = "删除企业信息") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (enterpriseService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -// @PreAuthorize("hasAuthority('enterprise:enterprise:remove')") - @OperationLog - @Operation(summary = "批量删除企业信息") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (enterpriseService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/enterprise/entity/Enterprise.java b/src/main/java/com/gxwebsoft/enterprise/entity/Enterprise.java deleted file mode 100644 index 9e99efd..0000000 --- a/src/main/java/com/gxwebsoft/enterprise/entity/Enterprise.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.gxwebsoft.enterprise.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.gxwebsoft.common.core.web.BaseParam; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 企业信息 - * @author GIIT-YC - */ -@Data -@TableName("enterprise") -@EqualsAndHashCode(callSuper = false) -@Schema(name = "Enterprise对象", description = "企业信息表") -public class Enterprise extends BaseParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "企业名称") - private String name; - - @Schema(description = "统一代码") - private String creditCode; - - @Schema(description = "企业性质(国企、行政事业单位、民间非营利组织)") - private String enterpriseType; - - @Schema(description = "所属行业(使用插件)") - private String industry; - - @Schema(description = "知识库ID") - private String kbId; - - @Schema(description = "客户ID") - private Integer userId; - - @Schema(description = "租户ID") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; -} \ No newline at end of file diff --git a/src/main/java/com/gxwebsoft/enterprise/mapper/EnterpriseMapper.java b/src/main/java/com/gxwebsoft/enterprise/mapper/EnterpriseMapper.java deleted file mode 100644 index 33ca945..0000000 --- a/src/main/java/com/gxwebsoft/enterprise/mapper/EnterpriseMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.gxwebsoft.enterprise.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.gxwebsoft.enterprise.entity.Enterprise; - -/** - * - * @author GIIT-YC - * - */ -public interface EnterpriseMapper extends BaseMapper { - -} diff --git a/src/main/java/com/gxwebsoft/enterprise/mapper/xml/EnterpriseMapper.xml b/src/main/java/com/gxwebsoft/enterprise/mapper/xml/EnterpriseMapper.xml deleted file mode 100644 index b543162..0000000 --- a/src/main/java/com/gxwebsoft/enterprise/mapper/xml/EnterpriseMapper.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/main/java/com/gxwebsoft/enterprise/service/EnterpriseService.java b/src/main/java/com/gxwebsoft/enterprise/service/EnterpriseService.java deleted file mode 100644 index daf3ff8..0000000 --- a/src/main/java/com/gxwebsoft/enterprise/service/EnterpriseService.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.gxwebsoft.enterprise.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.enterprise.entity.Enterprise; - -/** - * - * @author GIIT-YC - * - */ -public interface EnterpriseService extends IService { - -} diff --git a/src/main/java/com/gxwebsoft/enterprise/service/impl/EnterpriseServiceImpl.java b/src/main/java/com/gxwebsoft/enterprise/service/impl/EnterpriseServiceImpl.java deleted file mode 100644 index a6eedda..0000000 --- a/src/main/java/com/gxwebsoft/enterprise/service/impl/EnterpriseServiceImpl.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.gxwebsoft.enterprise.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.enterprise.entity.Enterprise; -import com.gxwebsoft.enterprise.mapper.EnterpriseMapper; -import com.gxwebsoft.enterprise.service.EnterpriseService; -import org.springframework.stereotype.Service; - -/** - * - * @author GIIT-YC - * - */ -@Service -public class EnterpriseServiceImpl extends ServiceImpl implements EnterpriseService { - -} diff --git a/src/main/java/com/gxwebsoft/hjm/controller/HjmBxLogController.java b/src/main/java/com/gxwebsoft/hjm/controller/HjmBxLogController.java deleted file mode 100644 index 8d8b8a8..0000000 --- a/src/main/java/com/gxwebsoft/hjm/controller/HjmBxLogController.java +++ /dev/null @@ -1,170 +0,0 @@ -package com.gxwebsoft.hjm.controller; - -import cn.hutool.core.util.StrUtil; -import com.gxwebsoft.common.core.config.ConfigProperties; -import com.gxwebsoft.common.core.utils.FileServerUtil; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.FileRecord; -import com.gxwebsoft.hjm.service.HjmBxLogService; -import com.gxwebsoft.hjm.entity.HjmBxLog; -import com.gxwebsoft.hjm.param.HjmBxLogParam; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.system.entity.User; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.io.File; -import java.util.List; - -/** - * 黄家明_报险记录控制器 - * - * @author 科技小王子 - * @since 2025-06-06 13:08:29 - */ -@Tag(name = "黄家明_报险记录管理") -@RestController -@RequestMapping("/api/hjm/hjm-bx-log") -public class HjmBxLogController extends BaseController { - @Resource - private ConfigProperties config; - @Resource - private HjmBxLogService hjmBxLogService; - - @Operation(summary = "分页查询黄家明_报险记录") - @GetMapping("/page") - public ApiResult> page(HjmBxLogParam param) { - // 使用关联查询 - return success(hjmBxLogService.pageRel(param)); - } - - @Operation(summary = "查询全部黄家明_报险记录") - @GetMapping() - public ApiResult> list(HjmBxLogParam param) { - // 使用关联查询 - return success(hjmBxLogService.listRel(param)); - } - - @Operation(summary = "根据id查询黄家明_报险记录") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(hjmBxLogService.getByIdRel(id)); - } - - @Operation(summary = "添加黄家明_报险记录") - @PostMapping() - public ApiResult save(@RequestBody HjmBxLog hjmBxLog) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - hjmBxLog.setUserId(loginUser.getUserId()); - } - if (hjmBxLogService.save(hjmBxLog)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmBxLog:update')") - @OperationLog - @Operation(summary = "修改黄家明_报险记录") - @PutMapping() - public ApiResult update(@RequestBody HjmBxLog hjmBxLog) { - if (hjmBxLogService.updateById(hjmBxLog)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmBxLog:remove')") - @OperationLog - @Operation(summary = "删除黄家明_报险记录") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (hjmBxLogService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmBxLog:save')") - @OperationLog - @Operation(summary = "批量添加黄家明_报险记录") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (hjmBxLogService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmBxLog:update')") - @OperationLog - @Operation(summary = "批量修改黄家明_报险记录") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(hjmBxLogService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmBxLog:remove')") - @OperationLog - @Operation(summary = "批量删除黄家明_报险记录") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (hjmBxLogService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "上传文件") - @PostMapping("/upload") - public ApiResult upload(@RequestParam MultipartFile file, HttpServletRequest request) { - FileRecord result = null; - try { - String dir = getUploadDir(); - File upload = FileServerUtil.upload(file, dir, config.getUploadUuidName()); - String path = upload.getAbsolutePath().replace("\\", "/").substring(dir.length() - 1); - // String requestURL = StrUtil.removeSuffix(request.getRequestURL(), "/upload"); - String requestURL = config.getFileServer() + "/api/file"; - String originalName = file.getOriginalFilename(); - result = new FileRecord(); - result.setCreateUserId(getLoginUserId()); - result.setName(StrUtil.isBlank(originalName) ? upload.getName() : originalName); - result.setLength(upload.length()); - result.setPath(path); - result.setUrl(requestURL + path); - String contentType = FileServerUtil.getContentType(upload); - result.setContentType(contentType); - if (FileServerUtil.isImage(contentType)) { - result.setThumbnail(requestURL + "/thumbnail" + path); - } - result.setUrl(path); - System.out.println("result = " + result); - return success(result); - } catch (Exception e) { - e.printStackTrace(); - return fail("上传失败", result).setError(e.toString()); - } - } - - /** - * 文件上传位置(服务器) - */ - private String getUploadDir() { - return config.getUploadPath(); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/controller/HjmCarController.java b/src/main/java/com/gxwebsoft/hjm/controller/HjmCarController.java deleted file mode 100644 index eb9838a..0000000 --- a/src/main/java/com/gxwebsoft/hjm/controller/HjmCarController.java +++ /dev/null @@ -1,416 +0,0 @@ -package com.gxwebsoft.hjm.controller; - -import cn.afterturn.easypoi.excel.ExcelImportUtil; -import cn.afterturn.easypoi.excel.ExcelExportUtil; -import cn.afterturn.easypoi.excel.entity.ImportParams; -import cn.afterturn.easypoi.excel.entity.ExportParams; -import cn.hutool.http.HttpUtil; -import com.alibaba.fastjson.JSONObject; - -import java.util.ArrayList; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.DictData; -import com.gxwebsoft.common.system.param.DictDataParam; -import com.gxwebsoft.common.system.service.DictDataService; -import com.gxwebsoft.hjm.service.HjmCarService; -import com.gxwebsoft.hjm.entity.HjmCar; -import com.gxwebsoft.hjm.param.HjmCarParam; -import com.gxwebsoft.hjm.param.HjmCarImportParam; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.hjm.service.GpsDiagnosticService; -import com.gxwebsoft.hjm.service.HjmFenceService; -import com.gxwebsoft.hjm.service.HjmGpsLogService; -import com.gxwebsoft.hjm.service.MqttService; -import com.gxwebsoft.hjm.service.impl.HjmCarServiceImpl; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.apache.poi.ss.usermodel.Workbook; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -import javax.annotation.Resource; -import java.util.List; -import java.util.Map; - - -/** - * 黄家明_车辆管理控制器 - * - * @author 科技小王子 - * @since 2025-04-14 16:43:26 - */ -@Tag(name = "黄家明_车辆管理管理") -@RestController -@RequestMapping("/api/hjm/hjm-car") -public class HjmCarController extends BaseController { - private static final Logger logger = LoggerFactory.getLogger(PushCallback.class); - @Resource - private HjmCarService hjmCarService; - @Resource - private HjmFenceService hjmFenceService; - @Resource - private DictDataService dictDataService; - @Resource - private HjmGpsLogService hjmGpsLogService; - @Resource - private HjmCarServiceImpl hjmCarServiceImpl; - @Resource - private MqttService mqttService; - @Resource - private GpsDiagnosticService gpsDiagnosticService; - - @Operation(summary = "分页查询黄家明_车辆管理") - @GetMapping("/page") - public ApiResult> page(HjmCarParam param) { - return success(hjmCarService.pageRel(param)); - } - - @Operation(summary = "查询全部黄家明_车辆管理") - @GetMapping() - public ApiResult> list(HjmCarParam param) { - // 使用关联查询 - return success(hjmCarService.listRel(param)); - } - - @Operation(summary = "根据id查询黄家明_车辆管理") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(hjmCarService.getByIdRel(id)); - } - - @Operation(summary = "根据code查询车辆") - @GetMapping("/getByCode/{code}") - public ApiResult getByCode(@PathVariable("code") String code) { - return success(hjmCarService.getByCode(code)); - } - - @PreAuthorize("hasAuthority('hjm:hjmCar:save')") - @OperationLog - @Operation(summary = "添加黄家明_车辆管理") - @PostMapping() - public ApiResult save(@RequestBody HjmCar hjmCar) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - hjmCar.setUserId(loginUser.getUserId()); - } - if (hjmCarService.save(hjmCar)) { - // 重新生成编号 - hjmCar.setCode(hjmCar.getCode().concat(hjmCar.getId().toString())); - hjmCarService.updateById(hjmCar); - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改黄家明_车辆管理") - @PutMapping() - public ApiResult update(@RequestBody HjmCar hjmCar) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - // 判断GPS设备是否被绑定 - final HjmCar byGpsNo = hjmCarService.getByGpsNo(hjmCar.getGpsNo()); - if(byGpsNo != null && byGpsNo.getInstallerId().equals(1)){ - return fail("该GPS设备已被绑定"); - } - hjmCar.setDriverName(loginUser.getRealName()); - hjmCar.setUserId(loginUser.getUserId()); - hjmCar.setCode(null); - if (hjmCarService.updateById(hjmCar)) { - return success("绑定成功"); - } - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmCar:remove')") - @OperationLog - @Operation(summary = "删除黄家明_车辆管理") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - // 硬删除(物理删除),不走 @TableLogic 逻辑删除 - if (hjmCarService.hardRemoveById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmCar:save')") - @OperationLog - @Operation(summary = "批量添加黄家明_车辆管理") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (hjmCarService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmCar:update')") - @OperationLog - @Operation(summary = "批量修改黄家明_车辆管理") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(hjmCarService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmCar:remove')") - @OperationLog - @Operation(summary = "批量删除黄家明_车辆管理") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - // 硬删除(物理删除),不走 @TableLogic 逻辑删除 - if (hjmCarService.hardRemoveByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - - /** - * excel批量导入车辆 - * Excel表头格式:车辆名称、车辆图片、类型、管理负责人、车辆编号、司机ID、保险状态、GPS设备编号、电子围栏ID、电子围栏名称、位置、纬度、经度、区域、地址、组织ID、父级组织ID、微信小程序码、用户ID、排序、备注、状态 - */ - @PreAuthorize("hasAuthority('hjm:hjmCar:save')") - @Transactional(rollbackFor = {Exception.class}) - @Operation(summary = "批量导入车辆") - @PostMapping("/import") - public ApiResult> importBatch(MultipartFile file) { - ImportParams importParams = new ImportParams(); - List errorMessages = new ArrayList<>(); - int successCount = 0; - - try { - List list = ExcelImportUtil.importExcel(file.getInputStream(), HjmCarImportParam.class, importParams); - - // 获取当前登录用户 - User loginUser = getLoginUser(); - Integer currentUserId = loginUser != null ? loginUser.getUserId() : null; - - for (int i = 0; i < list.size(); i++) { - HjmCarImportParam param = list.get(i); - try { - // 手动转换对象,避免JSON序列化问题 - HjmCar item = convertImportParamToEntity(param); - - // 设置必填字段的默认值 - if (item.getUserId() == null && currentUserId != null) { - item.setUserId(currentUserId); - } - if (item.getStatus() == null) { - item.setStatus(0); // 默认状态为正常 - } - if (item.getDeleted() == null) { - item.setDeleted(0); // 默认未删除 - } - if (item.getType() == null) { - item.setType(0); // 默认类型为汽车 - } - - // 验证必填字段 - if (item.getCode() == null) { - errorMessages.add("第" + (i + 1) + "行:车辆编号不能为空"); - continue; - } - // 保存数据 - if (hjmCarService.save(item)) { - successCount++; - } else { - errorMessages.add("第" + (i + 1) + "行:保存失败"); - } - - } catch (Exception e) { - errorMessages.add("第" + (i + 1) + "行:" + e.getMessage()); - System.err.println("导入第" + (i + 1) + "行数据失败: " + e.getMessage()); - e.printStackTrace(); - } - } - - // 返回结果 - if (errorMessages.isEmpty()) { - return success("成功导入" + successCount + "条数据", null); - } else { - return success("导入完成,成功" + successCount + "条,失败" + errorMessages.size() + "条", errorMessages); - } - - } catch (Exception e) { - System.err.println("批量导入车辆失败: " + e.getMessage()); - e.printStackTrace(); - return fail("导入失败:" + e.getMessage(), null); - } - } - - /** - * 下载车辆导入模板 - */ - @Operation(summary = "下载车辆导入模板") - @GetMapping("/import/template") - public void downloadTemplate(HttpServletResponse response) throws IOException { - // 创建空的导入参数列表作为模板 - List templateList = new ArrayList<>(); - - // 添加一行示例数据 - HjmCarImportParam example = new HjmCarImportParam(); - example.setName("示例车辆"); - example.setType(0); - example.setKuaidiAdmin("管理员"); - example.setCode("CAR"); - example.setInsuranceStatus("正常"); - example.setGpsNo("GPS001"); - example.setDistrict("示例区域"); - example.setStatus(0); - example.setComments("这是示例数据,请删除后填入真实数据"); - templateList.add(example); - - // 设置导出参数 - ExportParams exportParams = new ExportParams("车辆导入模板", "车辆信息"); - - // 生成Excel - Workbook workbook = ExcelExportUtil.exportExcel(exportParams, HjmCarImportParam.class, templateList); - - // 设置响应头 - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=car_import_template.xlsx"); - - // 输出到响应流 - workbook.write(response.getOutputStream()); - workbook.close(); - } - - /** - * 将HjmCarImportParam转换为HjmCar实体 - */ - private HjmCar convertImportParamToEntity(HjmCarImportParam param) { - HjmCar entity = new HjmCar(); - - // 基本字段转换 - entity.setName(param.getName()); - entity.setImage(param.getImage()); - entity.setType(param.getType()); - entity.setKuaidiAdmin(param.getKuaidiAdmin()); - entity.setCode(param.getCode()); - entity.setDriverId(param.getDriverId()); - entity.setInsuranceStatus(param.getInsuranceStatus()); - entity.setGpsNo(param.getGpsNo()); - entity.setFenceId(param.getFenceId()); - entity.setFenceName(param.getFenceName()); - entity.setLocation(param.getLocation()); - entity.setLatitude(param.getLatitude()); - entity.setLongitude(param.getLongitude()); - entity.setDistrict(param.getDistrict()); - entity.setAddress(param.getAddress()); - entity.setOrganizationId(param.getOrganizationId()); - entity.setOrganizationParentId(param.getOrganizationParentId()); - entity.setMpCode(param.getMpCode()); - entity.setUserId(param.getUserId()); - entity.setSortNumber(param.getSortNumber()); - entity.setComments(param.getComments()); - entity.setStatus(param.getStatus()); - - return entity; - } - - @Operation(summary = "根据坐标解析地址(腾讯地图)") - @GetMapping("/pageByQQMap") - public ApiResult> pageByQQMap(HjmCarParam param) { - // 检查必要的坐标参数 - if (param.getLatitude() == null || param.getLatitude().isEmpty() || - param.getLongitude() == null || param.getLongitude().isEmpty()) { - // 如果坐标为空,直接返回分页结果 - param.setLimit(100L); - return success(hjmCarService.pageRel(param)); - } - - final DictDataParam dictDataParam = new DictDataParam(); - dictDataParam.setDictCode("QQMapKey"); -// final List dictDataList = dictDataService.listRel(dictDataParam); -// if (!CollectionUtils.isEmpty(dictDataList)) { -// final DictData dictData = dictDataList.get(0); - final String API_KEY = "RDABZ-IF7AB-L4AUO-JHMX3-GBSGE-KIF53"; - String url = "https://apis.map.qq.com/ws/geocoder/v1/?location=".concat(param.getLatitude()).concat(",").concat(param.getLongitude()).concat("&key=").concat(API_KEY); - final String string = HttpUtil.get(url); - if (string.contains("\"result\":")) { - JSONObject jsonObject = JSONObject.parseObject(string); - JSONObject result = jsonObject.getJSONObject("result"); - JSONObject address_component = result.getJSONObject("address_component"); - String district = address_component.getString("district"); - System.out.println("district = " + district); - param.setDistrict(district); - return success(hjmCarService.pageRel(param)); - } -// } - param.setLimit(100L); - return success(hjmCarService.pageRel(param)); - } - - @Operation(summary = "获取MQTT连接状态") - @GetMapping("/mqtt/status") - public ApiResult getMqttStatus() { - boolean connected = mqttService.isConnected(); - String clientInfo = mqttService.getClientInfo(); - return success("MQTT状态查询成功", Map.of( - "connected", connected, - "clientInfo", clientInfo, - "status", connected ? "已连接" : "未连接" - )); - } - - @Operation(summary = "重新连接MQTT") - @PostMapping("/mqtt/reconnect") - public ApiResult reconnectMqtt() { - try { - mqttService.reconnect(); - return success("MQTT重连请求已发送"); - } catch (Exception e) { - logger.error("MQTT重连失败", e); - return fail("MQTT重连失败: " + e.getMessage()); - } - } - - @Operation(summary = "GPS数据诊断") - @GetMapping("/gps/diagnose") - public ApiResult diagnoseGpsData() { - try { - Map report = gpsDiagnosticService.diagnoseGpsDataIssues(); - return success("GPS数据诊断完成", report); - } catch (Exception e) { - logger.error("GPS数据诊断失败", e); - return fail("GPS数据诊断失败: " + e.getMessage()); - } - } - - @Operation(summary = "检查特定GPS设备") - @GetMapping("/gps/check/{gpsNo}") - public ApiResult checkSpecificGpsDevice(@PathVariable String gpsNo) { - try { - Map deviceInfo = gpsDiagnosticService.checkSpecificGpsDevice(gpsNo); - return success("GPS设备检查完成", deviceInfo); - } catch (Exception e) { - logger.error("检查GPS设备失败: {}", gpsNo, e); - return fail("检查GPS设备失败: " + e.getMessage()); - } - } - - - - -} diff --git a/src/main/java/com/gxwebsoft/hjm/controller/HjmChoicesController.java b/src/main/java/com/gxwebsoft/hjm/controller/HjmChoicesController.java deleted file mode 100644 index eef4ee8..0000000 --- a/src/main/java/com/gxwebsoft/hjm/controller/HjmChoicesController.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.gxwebsoft.hjm.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.hjm.service.HjmChoicesService; -import com.gxwebsoft.hjm.entity.HjmChoices; -import com.gxwebsoft.hjm.param.HjmChoicesParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 黄家明_选择题选项控制器 - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -@Tag(name = "黄家明_选择题选项管理") -@RestController -@RequestMapping("/api/hjm/hjm-choices") -public class HjmChoicesController extends BaseController { - @Resource - private HjmChoicesService hjmChoicesService; - - @Operation(summary = "分页查询黄家明_选择题选项") - @GetMapping("/page") - public ApiResult> page(HjmChoicesParam param) { - // 使用关联查询 - return success(hjmChoicesService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('hjm:hjmChoices:list')") - @Operation(summary = "查询全部黄家明_选择题选项") - @GetMapping() - public ApiResult> list(HjmChoicesParam param) { - // 使用关联查询 - return success(hjmChoicesService.listRel(param)); - } - - @Operation(summary = "根据id查询黄家明_选择题选项") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(hjmChoicesService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('hjm:hjmChoices:save')") - @OperationLog - @Operation(summary = "添加黄家明_选择题选项") - @PostMapping() - public ApiResult save(@RequestBody HjmChoices hjmChoices) { - if (hjmChoicesService.save(hjmChoices)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmChoices:update')") - @OperationLog - @Operation(summary = "修改黄家明_选择题选项") - @PutMapping() - public ApiResult update(@RequestBody HjmChoices hjmChoices) { - if (hjmChoicesService.updateById(hjmChoices)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmChoices:remove')") - @OperationLog - @Operation(summary = "删除黄家明_选择题选项") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (hjmChoicesService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmChoices:save')") - @OperationLog - @Operation(summary = "批量添加黄家明_选择题选项") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (hjmChoicesService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmChoices:update')") - @OperationLog - @Operation(summary = "批量修改黄家明_选择题选项") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(hjmChoicesService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmChoices:remove')") - @OperationLog - @Operation(summary = "批量删除黄家明_选择题选项") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (hjmChoicesService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/controller/HjmCoursesController.java b/src/main/java/com/gxwebsoft/hjm/controller/HjmCoursesController.java deleted file mode 100644 index d3f3beb..0000000 --- a/src/main/java/com/gxwebsoft/hjm/controller/HjmCoursesController.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.gxwebsoft.hjm.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.hjm.service.HjmCoursesService; -import com.gxwebsoft.hjm.entity.HjmCourses; -import com.gxwebsoft.hjm.param.HjmCoursesParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 黄家明_课程控制器 - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -@Tag(name = "黄家明_课程管理") -@RestController -@RequestMapping("/api/hjm/hjm-courses") -public class HjmCoursesController extends BaseController { - @Resource - private HjmCoursesService hjmCoursesService; - - @Operation(summary = "分页查询黄家明_课程") - @GetMapping("/page") - public ApiResult> page(HjmCoursesParam param) { - // 使用关联查询 - return success(hjmCoursesService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('hjm:hjmCourses:list')") - @Operation(summary = "查询全部黄家明_课程") - @GetMapping() - public ApiResult> list(HjmCoursesParam param) { - // 使用关联查询 - return success(hjmCoursesService.listRel(param)); - } - - @Operation(summary = "根据id查询黄家明_课程") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(hjmCoursesService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('hjm:hjmCourses:save')") - @OperationLog - @Operation(summary = "添加黄家明_课程") - @PostMapping() - public ApiResult save(@RequestBody HjmCourses hjmCourses) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - hjmCourses.setUserId(loginUser.getUserId()); - } - if (hjmCoursesService.save(hjmCourses)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmCourses:update')") - @OperationLog - @Operation(summary = "修改黄家明_课程") - @PutMapping() - public ApiResult update(@RequestBody HjmCourses hjmCourses) { - if (hjmCoursesService.updateById(hjmCourses)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmCourses:remove')") - @OperationLog - @Operation(summary = "删除黄家明_课程") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (hjmCoursesService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmCourses:save')") - @OperationLog - @Operation(summary = "批量添加黄家明_课程") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (hjmCoursesService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmCourses:update')") - @OperationLog - @Operation(summary = "批量修改黄家明_课程") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(hjmCoursesService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmCourses:remove')") - @OperationLog - @Operation(summary = "批量删除黄家明_课程") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (hjmCoursesService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/controller/HjmExamLogController.java b/src/main/java/com/gxwebsoft/hjm/controller/HjmExamLogController.java deleted file mode 100644 index 7202eec..0000000 --- a/src/main/java/com/gxwebsoft/hjm/controller/HjmExamLogController.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.gxwebsoft.hjm.controller; - -import cn.hutool.core.date.DateUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.hjm.service.HjmExamLogService; -import com.gxwebsoft.hjm.entity.HjmExamLog; -import com.gxwebsoft.hjm.param.HjmExamLogParam; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.system.entity.User; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 黄家明_学习记录控制器 - * - * @author 科技小王子 - * @since 2025-06-05 14:32:03 - */ -@Tag(name = "黄家明_学习记录管理") -@RestController -@RequestMapping("/api/hjm/hjm-exam-log") -public class HjmExamLogController extends BaseController { - @Resource - private HjmExamLogService hjmExamLogService; - - @Operation(summary = "分页查询黄家明_学习记录") - @GetMapping("/page") - public ApiResult> page(HjmExamLogParam param) { - // 使用关联查询 - return success(hjmExamLogService.pageRel(param)); - } - - @Operation(summary = "查询全部黄家明_学习记录") - @GetMapping() - public ApiResult> list(HjmExamLogParam param) { - // 使用关联查询 - return success(hjmExamLogService.listRel(param)); - } - - @Operation(summary = "根据id查询黄家明_学习记录") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(hjmExamLogService.getByIdRel(id)); - } - - @Operation(summary = "添加黄家明_学习记录") - @PostMapping() - public ApiResult save(@RequestBody HjmExamLog hjmExamLog) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - hjmExamLog.setUserId(loginUser.getUserId()); - } - if (hjmExamLogService.save(hjmExamLog)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmExamLog:update')") - @OperationLog - @Operation(summary = "修改黄家明_学习记录") - @PutMapping() - public ApiResult update(@RequestBody HjmExamLog hjmExamLog) { - if (hjmExamLogService.updateById(hjmExamLog)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmExamLog:remove')") - @OperationLog - @Operation(summary = "删除黄家明_学习记录") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (hjmExamLogService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmExamLog:save')") - @OperationLog - @Operation(summary = "批量添加黄家明_学习记录") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (hjmExamLogService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmExamLog:update')") - @OperationLog - @Operation(summary = "批量修改黄家明_学习记录") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(hjmExamLogService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmExamLog:remove')") - @OperationLog - @Operation(summary = "批量删除黄家明_学习记录") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (hjmExamLogService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "查询本月是否已完成学习任务") - @GetMapping("/getMyMonthExamLog") - public ApiResult> getMyMonthExamLog() { - User loginUser = getLoginUser(); - if (loginUser == null) { - return fail("请先登录",null); - } - - // 查询当前月份的记录 - List list = hjmExamLogService.list(new LambdaQueryWrapper() - .eq(HjmExamLog::getStatus, 1) - .eq(HjmExamLog::getUserId, loginUser.getUserId()) - .ge(HjmExamLog::getCreateTime, DateUtil.beginOfMonth(DateUtil.date())) - .le(HjmExamLog::getCreateTime, DateUtil.endOfMonth(DateUtil.date()))); - - return success("查询成功", list); - } - - @Operation(summary = "检查本月是否已完成学习任务") - @GetMapping("/checkMonthTaskCompleted") - public ApiResult checkMonthTaskCompleted() { - User loginUser = getLoginUser(); - if (loginUser == null) { - return fail("请先登录",null); - } - - // 查询本月是否有完成的学习记录 - long count = hjmExamLogService.count(new LambdaQueryWrapper() - .eq(HjmExamLog::getStatus, 1) - .eq(HjmExamLog::getUserId, loginUser.getUserId()) - .ge(HjmExamLog::getCreateTime, DateUtil.beginOfMonth(DateUtil.date())) - .le(HjmExamLog::getCreateTime, DateUtil.endOfMonth(DateUtil.date()))); - - boolean isCompleted = count > 0; - return success(isCompleted ? "本月已完成学习任务" : "本月尚未完成学习任务", isCompleted); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/controller/HjmFenceController.java b/src/main/java/com/gxwebsoft/hjm/controller/HjmFenceController.java deleted file mode 100644 index 956a7e3..0000000 --- a/src/main/java/com/gxwebsoft/hjm/controller/HjmFenceController.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.gxwebsoft.hjm.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.hjm.service.HjmFenceService; -import com.gxwebsoft.hjm.entity.HjmFence; -import com.gxwebsoft.hjm.param.HjmFenceParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 黄家明_电子围栏控制器 - * - * @author 科技小王子 - * @since 2025-06-03 02:08:03 - */ -@Tag(name = "黄家明_电子围栏管理") -@RestController -@RequestMapping("/api/hjm/hjm-fence") -public class HjmFenceController extends BaseController { - @Resource - private HjmFenceService hjmFenceService; - - @Operation(summary = "分页查询黄家明_电子围栏") - @GetMapping("/page") - public ApiResult> page(HjmFenceParam param) { - // 使用关联查询 - return success(hjmFenceService.pageRel(param)); - } - - @Operation(summary = "查询全部黄家明_电子围栏") - @GetMapping() - public ApiResult> list(HjmFenceParam param) { - // 使用关联查询 - return success(hjmFenceService.listRel(param)); - } - - @Operation(summary = "根据id查询黄家明_电子围栏") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(hjmFenceService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('hjm:hjmFence:save')") - @OperationLog - @Operation(summary = "添加黄家明_电子围栏") - @PostMapping() - public ApiResult save(@RequestBody HjmFence hjmFence) { - if (hjmFenceService.save(hjmFence)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmFence:update')") - @OperationLog - @Operation(summary = "修改黄家明_电子围栏") - @PutMapping() - public ApiResult update(@RequestBody HjmFence hjmFence) { - if (hjmFenceService.updateById(hjmFence)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmFence:remove')") - @OperationLog - @Operation(summary = "删除黄家明_电子围栏") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (hjmFenceService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmFence:save')") - @OperationLog - @Operation(summary = "批量添加黄家明_电子围栏") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (hjmFenceService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmFence:update')") - @OperationLog - @Operation(summary = "批量修改黄家明_电子围栏") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(hjmFenceService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmFence:remove')") - @OperationLog - @Operation(summary = "批量删除黄家明_电子围栏") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (hjmFenceService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/controller/HjmGpsLogController.java b/src/main/java/com/gxwebsoft/hjm/controller/HjmGpsLogController.java deleted file mode 100644 index f176e86..0000000 --- a/src/main/java/com/gxwebsoft/hjm/controller/HjmGpsLogController.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.gxwebsoft.hjm.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.hjm.service.HjmGpsLogService; -import com.gxwebsoft.hjm.entity.HjmGpsLog; -import com.gxwebsoft.hjm.param.HjmGpsLogParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 黄家明_gps轨迹控制器 - * - * @author 科技小王子 - * @since 2025-06-11 12:03:50 - */ -@Tag(name = "黄家明_gps轨迹管理") -@RestController -@RequestMapping("/api/hjm/hjm-gps-log") -public class HjmGpsLogController extends BaseController { - @Resource - private HjmGpsLogService hjmGpsLogService; - - @Operation(summary = "分页查询黄家明_gps轨迹") - @GetMapping("/page") - public ApiResult> page(HjmGpsLogParam param) { - // 使用关联查询 - return success(hjmGpsLogService.pageRel(param)); - } - - @Operation(summary = "查询全部黄家明_gps轨迹") - @GetMapping() - public ApiResult> list(HjmGpsLogParam param) { - // 使用关联查询 - return success(hjmGpsLogService.listRel(param)); - } - - @Operation(summary = "根据id查询黄家明_gps轨迹") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(hjmGpsLogService.getByIdRel(id)); - } - - @Operation(summary = "添加黄家明_gps轨迹") - @PostMapping() - public ApiResult save(@RequestBody HjmGpsLog hjmGpsLog) { - if (hjmGpsLogService.save(hjmGpsLog)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmGpsLog:update')") - @OperationLog - @Operation(summary = "修改黄家明_gps轨迹") - @PutMapping() - public ApiResult update(@RequestBody HjmGpsLog hjmGpsLog) { - if (hjmGpsLogService.updateById(hjmGpsLog)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmGpsLog:remove')") - @OperationLog - @Operation(summary = "删除黄家明_gps轨迹") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (hjmGpsLogService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmGpsLog:save')") - @OperationLog - @Operation(summary = "批量添加黄家明_gps轨迹") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (hjmGpsLogService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmGpsLog:update')") - @OperationLog - @Operation(summary = "批量修改黄家明_gps轨迹") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(hjmGpsLogService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmGpsLog:remove')") - @OperationLog - @Operation(summary = "批量删除黄家明_gps轨迹") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (hjmGpsLogService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - // 分析车辆是否逆行 - -} diff --git a/src/main/java/com/gxwebsoft/hjm/controller/HjmQuestionsController.java b/src/main/java/com/gxwebsoft/hjm/controller/HjmQuestionsController.java deleted file mode 100644 index 0a55323..0000000 --- a/src/main/java/com/gxwebsoft/hjm/controller/HjmQuestionsController.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.gxwebsoft.hjm.controller; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.hjm.entity.HjmChoices; -import com.gxwebsoft.hjm.service.HjmChoicesService; -import com.gxwebsoft.hjm.service.HjmQuestionsService; -import com.gxwebsoft.hjm.entity.HjmQuestions; -import com.gxwebsoft.hjm.param.HjmQuestionsParam; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.system.entity.User; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 黄家明_题目控制器 - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -@Tag(name = "黄家明_题目管理") -@RestController -@RequestMapping("/api/hjm/hjm-questions") -public class HjmQuestionsController extends BaseController { - @Resource - private HjmQuestionsService hjmQuestionsService; - @Resource - private HjmChoicesService hjmChoicesService; - - @Operation(summary = "分页查询黄家明_题目") - @GetMapping("/page") - public ApiResult> page(HjmQuestionsParam param) { - // 使用关联查询 - return success(hjmQuestionsService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('hjm:hjmQuestions:list')") - @Operation(summary = "查询全部黄家明_题目") - @GetMapping() - public ApiResult> list(HjmQuestionsParam param) { - // 使用关联查询 - return success(hjmQuestionsService.listRel(param)); - } - - @Operation(summary = "根据id查询黄家明_题目") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(hjmQuestionsService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('hjm:hjmQuestions:save')") - @OperationLog - @Operation(summary = "添加黄家明_题目") - @PostMapping() - public ApiResult save(@RequestBody HjmQuestions hjmQuestions) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - hjmQuestions.setUserId(loginUser.getUserId()); - } - if (hjmQuestionsService.save(hjmQuestions)) { - final List choicesList = hjmQuestions.getChoicesList(); - if (!CollectionUtils.isEmpty(choicesList)) { - choicesList.forEach(choice -> { - choice.setQuestionId(hjmQuestions.getId()); - }); - hjmChoicesService.saveBatch(choicesList); - } - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmQuestions:update')") - @OperationLog - @Operation(summary = "修改黄家明_题目") - @PutMapping() - public ApiResult update(@RequestBody HjmQuestions hjmQuestions) { - if (hjmQuestionsService.updateById(hjmQuestions)) { - if (!CollectionUtils.isEmpty(hjmQuestions.getChoicesList())) { - hjmChoicesService.updateBatchById(hjmQuestions.getChoicesList()); - } - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmQuestions:remove')") - @OperationLog - @Operation(summary = "删除黄家明_题目") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (hjmQuestionsService.removeById(id)) { - hjmChoicesService.remove(new LambdaQueryWrapper().eq(HjmChoices::getQuestionId, id)); - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmQuestions:save')") - @OperationLog - @Operation(summary = "批量添加黄家明_题目") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (hjmQuestionsService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmQuestions:update')") - @OperationLog - @Operation(summary = "批量修改黄家明_题目") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(hjmQuestionsService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmQuestions:remove')") - @OperationLog - @Operation(summary = "批量删除黄家明_题目") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (hjmQuestionsService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/controller/HjmViolationController.java b/src/main/java/com/gxwebsoft/hjm/controller/HjmViolationController.java deleted file mode 100644 index acede29..0000000 --- a/src/main/java/com/gxwebsoft/hjm/controller/HjmViolationController.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.gxwebsoft.hjm.controller; - -import cn.hutool.core.util.ObjUtil; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.hjm.entity.HjmCar; -import com.gxwebsoft.hjm.service.HjmCarService; -import com.gxwebsoft.hjm.service.HjmViolationService; -import com.gxwebsoft.hjm.entity.HjmViolation; -import com.gxwebsoft.hjm.param.HjmViolationParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 黄家明_违章记录控制器 - * - * @author 科技小王子 - * @since 2025-06-20 13:48:43 - */ -@Tag(name = "黄家明_违章记录管理") -@RestController -@RequestMapping("/api/hjm/hjm-violation") -public class HjmViolationController extends BaseController { - @Resource - private HjmViolationService hjmViolationService; - @Resource - private HjmCarService hjmCarService; - - @PreAuthorize("hasAuthority('hjm:hjmViolation:list')") - @Operation(summary = "分页查询黄家明_违章记录") - @GetMapping("/page") - public ApiResult> page(HjmViolationParam param) { - // 使用关联查询 - return success(hjmViolationService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('hjm:hjmViolation:list')") - @Operation(summary = "查询全部黄家明_违章记录") - @GetMapping() - public ApiResult> list(HjmViolationParam param) { - // 使用关联查询 - return success(hjmViolationService.listRel(param)); - } - - @PreAuthorize("hasAuthority('hjm:hjmViolation:list')") - @Operation(summary = "根据id查询黄家明_违章记录") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(hjmViolationService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('hjm:hjmViolation:save')") - @OperationLog - @Operation(summary = "添加黄家明_违章记录") - @PostMapping() - public ApiResult save(@RequestBody HjmViolation hjmViolation) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - hjmViolation.setUserId(loginUser.getUserId()); - final HjmCar car = hjmCarService.getByCode(hjmViolation.getCode()); - if (ObjUtil.isEmpty(car)) { - return fail("车辆编号不存在"); - } - if (hjmViolationService.save(hjmViolation)) { - hjmViolationService.send(hjmViolation); - return success("添加成功"); - } - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmViolation:update')") - @OperationLog - @Operation(summary = "修改黄家明_违章记录") - @PutMapping() - public ApiResult update(@RequestBody HjmViolation hjmViolation) { - if (hjmViolationService.updateById(hjmViolation)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmViolation:remove')") - @OperationLog - @Operation(summary = "删除黄家明_违章记录") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (hjmViolationService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmViolation:save')") - @OperationLog - @Operation(summary = "批量添加黄家明_违章记录") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (hjmViolationService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmViolation:update')") - @OperationLog - @Operation(summary = "批量修改黄家明_违章记录") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(hjmViolationService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('hjm:hjmViolation:remove')") - @OperationLog - @Operation(summary = "批量删除黄家明_违章记录") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (hjmViolationService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/controller/MQTTClientDemo.java b/src/main/java/com/gxwebsoft/hjm/controller/MQTTClientDemo.java deleted file mode 100644 index 585cafd..0000000 --- a/src/main/java/com/gxwebsoft/hjm/controller/MQTTClientDemo.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.gxwebsoft.hjm.controller; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.eclipse.paho.client.mqttv3.*; -import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; - -/** -* @Description: - * maven 依赖: - * - * org.eclipse.paho - * org.eclipse.paho.client.mqttv3 - * 1.2.1 - * - * -* @Author: lx -* @Version: 1.0.0 -* @Date: 2025/7/2 -*/ -public class MQTTClientDemo { - - private static final Log log = LogFactory.getLog(MQTTClientDemo.class); - - private MqttClient client; - - private String HOST = "TCP://127.0.0.1:1883"; - private String userName = ""; - private String passWord = ""; - private String mqttClientId=""; - private MqttCallback callback; - - - public MQTTClientDemo(MqttCallback callback, String host,String clientId,String usrname,String password) throws MqttException { - this.callback = callback; - HOST = host; - mqttClientId = clientId; - userName = usrname; - passWord = password; - - client = new MqttClient(HOST, mqttClientId, new MemoryPersistence()); - connect(); - } - - /** - * 用来连接服务器 - */ - public void connect() { - MqttConnectOptions options = new MqttConnectOptions(); - options.setCleanSession(false); - options.setUserName(userName); - options.setPassword(passWord.toCharArray()); - // 设置超时时间 - options.setConnectionTimeout(10); - // 设置会话心跳时间 - options.setKeepAliveInterval(20); - //设置自动重连 - options.setAutomaticReconnect(true); - try { - System.out.println("DC MQTT Host="+HOST); - System.out.println("DC MQTT ClientId="+mqttClientId); - System.out.println("DC MQTT userName="+userName); - System.out.println("DC MQTT passWord="+passWord); - client.setCallback(this.callback); - client.connect(options); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public MqttTopic getTopic(String topic) { - return client.getTopic(topic); - } - - public void subscribe(String topic) throws MqttException { - client.subscribe(topic); - } - - public void subscribe(String[] topics) throws MqttException { - client.subscribe(topics); - } - - //qos 0:最多一次 、1:最少一次 、2:只有一次 - public void subscribe(String topic,int qos) throws MqttException { - client.subscribe(topic,qos); - } - - public void subscribe(String[] topics,int[] qosArr) throws MqttException { - client.subscribe(topics,qosArr); - } - - /** - * - * @param topic - * @param message - * @throws MqttPersistenceException - * @throws MqttException - */ - public void publish(MqttTopic topic , MqttMessage message) throws MqttPersistenceException, - MqttException { - MqttDeliveryToken token = topic.publish(message); - /* - //原地等待发送结果 - token.waitForCompletion(); - if(token.isComplete()) { - log.info("message is published completely! "); - }else { - log.info("message is published failed! "); - } - */ - } - - public void publish(MqttTopic topic,String payload,int qos,boolean retained) throws MqttPersistenceException, MqttException { - MqttMessage msg = new MqttMessage(); - msg.setQos(qos); - msg.setRetained(retained); - msg.setPayload(payload.getBytes()); - publish(topic,msg); - } - - public boolean isConnected() { - return client.isConnected(); - } - - - public static void main(String[] args) throws MqttException { - MQTTClientDemo mqttClient = new MQTTClientDemo(new MqttCallback() { - @Override - public void connectionLost(Throwable throwable) { - log.error("connectionLost..."); - } - @Override - public void messageArrived(String topic, MqttMessage message) throws Exception { - if (topic.equals("xxxxx")){ - /*是指定topic*/ - } - log.debug("DC 接收消息主题 : " + topic); - log.debug("DC 接收消息Qos : " + message.getQos()); - log.debug("DC 接收消息内容 : " + new String(message.getPayload())); - } - @Override - public void deliveryComplete(IMqttDeliveryToken token) { - log.error("deliveryComplete..." + token.isComplete()); - } - },"HOST", "SERVER_" + System.currentTimeMillis(), "userName", "passWord"); - /*订阅一个*/ - mqttClient.subscribe("TOPIC"); -// mqttClient.subscribe(new String[] {"TOPIC"}); - } -} diff --git a/src/main/java/com/gxwebsoft/hjm/controller/PushCallback.java b/src/main/java/com/gxwebsoft/hjm/controller/PushCallback.java deleted file mode 100644 index 6e59c83..0000000 --- a/src/main/java/com/gxwebsoft/hjm/controller/PushCallback.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.gxwebsoft.hjm.controller; - -import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken; -import org.eclipse.paho.client.mqttv3.MqttCallback; -import org.eclipse.paho.client.mqttv3.MqttMessage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * 推送消息的回调类 - */ -public class PushCallback implements MqttCallback { - private static final Logger logger = LoggerFactory.getLogger(PushCallback.class); - @Override - public void connectionLost(Throwable throwable) { - logger.info("连接丢失............."); - } - - @Override - public void messageArrived(String topic, MqttMessage mqttMessage) throws Exception { - logger.info("接收消息主题 : " + topic); - logger.info("接收消息Qos : " + mqttMessage.getQos()); - logger.info("接收消息内容 : " + new String(mqttMessage.getPayload())); - - } - - @Override - public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) { - logger.info("deliveryComplete............."); - } -} diff --git a/src/main/java/com/gxwebsoft/hjm/controller/SendSubscriptionMessages.java b/src/main/java/com/gxwebsoft/hjm/controller/SendSubscriptionMessages.java deleted file mode 100644 index 7ca5d11..0000000 --- a/src/main/java/com/gxwebsoft/hjm/controller/SendSubscriptionMessages.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.gxwebsoft.hjm.controller; - -import com.alibaba.fastjson.JSONObject; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.hjm.dto.BatchTemplateMessageRequest; -import com.gxwebsoft.hjm.dto.SubscribeMessageRequest; -import com.gxwebsoft.hjm.dto.TemplateMessageRequest; -import com.gxwebsoft.hjm.service.WxNotificationService; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; - -/** - * 微信公众号订阅通知控制器 - * - * @author 科技小王子 - * @since 2025-06-15 - */ -@Slf4j -@Tag(name = "微信公众号订阅通知") -@RestController -@RequestMapping("/api/hjm/wx-subscription") -public class SendSubscriptionMessages extends BaseController { - - @Resource - private WxNotificationService wxNotificationService; - - /** - * 发送模板消息 - */ - @Operation(summary = "发送模板消息") - @OperationLog("发送模板消息") - @PostMapping("/send-template") - public ApiResult sendTemplateMessage(@RequestBody TemplateMessageRequest request) { - try { - User loginUser = getLoginUser(); - Integer tenantId = loginUser != null ? loginUser.getTenantId() : 0; - - // 发送模板消息 - boolean success = wxNotificationService.sendTemplateMessage(tenantId, request); - - if (success) { - return success("模板消息发送成功"); - } else { - return fail("模板消息发送失败"); - } - - } catch (Exception e) { - log.error("发送模板消息失败", e); - return fail("发送失败:" + e.getMessage()); - } - } - - - - - - /** - * 发送订阅消息(小程序订阅消息) - */ - @Operation(summary = "发送订阅消息") - @OperationLog("发送订阅消息") - @PostMapping("/send-subscribe") - public ApiResult sendSubscribeMessage(@RequestBody SubscribeMessageRequest request) { - try { - User loginUser = getLoginUser(); - Integer tenantId = loginUser != null ? loginUser.getTenantId() : 0; - - // 发送订阅消息 - boolean success = wxNotificationService.sendSubscribeMessage(tenantId, request); - - if (success) { - return success("订阅消息发送成功"); - } else { - return fail("订阅消息发送失败"); - } - - } catch (Exception e) { - log.error("发送订阅消息失败", e); - return fail("发送失败:" + e.getMessage()); - } - } - - - - /** - * 批量发送模板消息 - */ - @Operation(summary = "批量发送模板消息") - @OperationLog("批量发送模板消息") - @PostMapping("/batch-send-template") - public ApiResult batchSendTemplateMessage(@RequestBody BatchTemplateMessageRequest request) { - try { - User loginUser = getLoginUser(); - Integer tenantId = loginUser != null ? loginUser.getTenantId() : 0; - - WxNotificationService.BatchSendResult result = wxNotificationService.batchSendTemplateMessage(tenantId, request.getMessages()); - - return success("批量发送完成," + result.toString()); - - } catch (Exception e) { - log.error("批量发送模板消息失败", e); - return fail("批量发送失败:" + e.getMessage()); - } - } - - /** - * 获取模板列表 - */ - @Operation(summary = "获取模板列表") - @GetMapping("/templates") - public ApiResult getTemplateList() { - try { - User loginUser = getLoginUser(); - Integer tenantId = loginUser != null ? loginUser.getTenantId() : 0; - - String response = wxNotificationService.getTemplateList(tenantId); - if (response != null) { - JSONObject result = JSONObject.parseObject(response); - return success("获取成功", result); - } else { - return fail("获取失败"); - } - - } catch (Exception e) { - log.error("获取模板列表失败", e); - return fail("获取失败:" + e.getMessage()); - } - } -} diff --git a/src/main/java/com/gxwebsoft/hjm/controller/WxNotificationTestController.java b/src/main/java/com/gxwebsoft/hjm/controller/WxNotificationTestController.java deleted file mode 100644 index 1d7aac4..0000000 --- a/src/main/java/com/gxwebsoft/hjm/controller/WxNotificationTestController.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.gxwebsoft.hjm.controller; - -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.hjm.dto.SubscribeMessageRequest; -import com.gxwebsoft.hjm.dto.TemplateMessageRequest; -import com.gxwebsoft.hjm.service.WxNotificationService; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.text.SimpleDateFormat; -import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.Map; - -/** - * 微信通知测试控制器 - * - * @author 科技小王子 - * @since 2025-06-15 - */ -@Slf4j -@Tag(name = "微信通知测试") -@RestController -@RequestMapping("/api/hjm/wx-notification-test") -public class WxNotificationTestController extends BaseController { - - @Resource - private WxNotificationService wxNotificationService; - - /** - * 测试发送订单确认通知 - */ - @Operation(summary = "测试发送订单确认通知") - @PostMapping("/test-order-notification") - public ApiResult testOrderNotification(@RequestParam String openId, - @RequestParam String orderNo, - @RequestParam(required = false) String templateId) { - try { - User loginUser = getLoginUser(); - Integer tenantId = loginUser != null ? loginUser.getTenantId() : 0; - - // 构建模板消息请求 - TemplateMessageRequest request = new TemplateMessageRequest(); - request.setToUser(openId); - request.setTemplateId(templateId != null ? templateId : "your_order_template_id"); - request.setUrl("https://your-domain.com/order/" + orderNo); - request.setTopColor("#173177"); - - // 构建模板数据 - Map data = new HashMap<>(); - data.put("first", new TemplateMessageRequest.TemplateDataItem("您的订单已确认", "#173177")); - data.put("keyword1", new TemplateMessageRequest.TemplateDataItem(orderNo, "#173177")); - data.put("keyword2", new TemplateMessageRequest.TemplateDataItem( - new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(LocalDateTime.now()), "#173177")); - data.put("remark", new TemplateMessageRequest.TemplateDataItem("感谢您的使用,如有疑问请联系客服!", "#173177")); - - request.setData(data); - - // 发送消息 - boolean success = wxNotificationService.sendTemplateMessage(tenantId, request); - - if (success) { - return success("订单确认通知发送成功"); - } else { - return fail("订单确认通知发送失败"); - } - - } catch (Exception e) { - log.error("测试发送订单确认通知失败", e); - return fail("发送失败:" + e.getMessage()); - } - } - - /** - * 测试发送支付成功通知 - */ - @Operation(summary = "测试发送支付成功通知") - @PostMapping("/test-payment-notification") - public ApiResult testPaymentNotification(@RequestParam String openId, - @RequestParam String orderNo, - @RequestParam String amount, - @RequestParam(required = false) String templateId) { - try { - User loginUser = getLoginUser(); - Integer tenantId = loginUser != null ? loginUser.getTenantId() : 0; - - TemplateMessageRequest request = new TemplateMessageRequest(); - request.setToUser(openId); - request.setTemplateId(templateId != null ? templateId : "your_payment_template_id"); - request.setUrl("https://your-domain.com/order/" + orderNo); - - Map data = new HashMap<>(); - data.put("first", new TemplateMessageRequest.TemplateDataItem("支付成功通知", "#173177")); - data.put("keyword1", new TemplateMessageRequest.TemplateDataItem(orderNo, "#173177")); - data.put("keyword2", new TemplateMessageRequest.TemplateDataItem("¥" + amount, "#FF0000")); - data.put("keyword3", new TemplateMessageRequest.TemplateDataItem( - new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(LocalDateTime.now()), "#173177")); - data.put("remark", new TemplateMessageRequest.TemplateDataItem("您的订单已支付成功,我们将尽快为您处理!", "#173177")); - - request.setData(data); - - boolean success = wxNotificationService.sendTemplateMessage(tenantId, request); - - if (success) { - return success("支付成功通知发送成功"); - } else { - return fail("支付成功通知发送失败"); - } - - } catch (Exception e) { - log.error("测试发送支付成功通知失败", e); - return fail("发送失败:" + e.getMessage()); - } - } - - /** - * 测试发送订阅消息 - */ - @Operation(summary = "测试发送订阅消息") - @PostMapping("/test-subscribe-notification") - public ApiResult testSubscribeNotification(@RequestParam String openId, - @RequestParam String title, - @RequestParam String content, - @RequestParam(required = false) String templateId) { - try { - User loginUser = getLoginUser(); - Integer tenantId = loginUser != null ? loginUser.getTenantId() : 0; - - SubscribeMessageRequest request = new SubscribeMessageRequest(); - request.setToUser(openId); - request.setTemplateId(templateId != null ? templateId : "your_subscribe_template_id"); - request.setPage("pages/notification/detail"); - request.setMiniprogramState("formal"); - request.setLang("zh_CN"); - - Map data = new HashMap<>(); - data.put("thing1", new SubscribeMessageRequest.SubscribeDataItem(title)); - data.put("thing2", new SubscribeMessageRequest.SubscribeDataItem(content)); - data.put("time3", new SubscribeMessageRequest.SubscribeDataItem( - new SimpleDateFormat("yyyy年MM月dd日 HH:mm").format(LocalDateTime.now()))); - - request.setData(data); - - boolean success = wxNotificationService.sendSubscribeMessage(tenantId, request); - - if (success) { - return success("订阅消息发送成功"); - } else { - return fail("订阅消息发送失败"); - } - - } catch (Exception e) { - log.error("测试发送订阅消息失败", e); - return fail("发送失败:" + e.getMessage()); - } - } - - /** - * 测试发送系统通知 - */ - @Operation(summary = "测试发送系统通知") - @PostMapping("/test-system-notification") - public ApiResult testSystemNotification(@RequestParam String openId, - @RequestParam String message, - @RequestParam(required = false) String templateId) { - try { - User loginUser = getLoginUser(); - Integer tenantId = loginUser != null ? loginUser.getTenantId() : 0; - - TemplateMessageRequest request = new TemplateMessageRequest(); - request.setToUser(openId); - request.setTemplateId(templateId != null ? templateId : "your_system_template_id"); - request.setTopColor("#173177"); - - Map data = new HashMap<>(); - data.put("first", new TemplateMessageRequest.TemplateDataItem("系统通知", "#173177")); - data.put("keyword1", new TemplateMessageRequest.TemplateDataItem("系统消息", "#173177")); - data.put("keyword2", new TemplateMessageRequest.TemplateDataItem(message, "#173177")); - data.put("keyword3", new TemplateMessageRequest.TemplateDataItem( - new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(LocalDateTime.now()), "#173177")); - data.put("remark", new TemplateMessageRequest.TemplateDataItem("如有疑问,请联系客服。", "#173177")); - - request.setData(data); - - boolean success = wxNotificationService.sendTemplateMessage(tenantId, request); - - if (success) { - return success("系统通知发送成功"); - } else { - return fail("系统通知发送失败"); - } - - } catch (Exception e) { - log.error("测试发送系统通知失败", e); - return fail("发送失败:" + e.getMessage()); - } - } - - /** - * 获取当前配置的模板列表 - */ - @Operation(summary = "获取当前配置的模板列表") - @GetMapping("/get-templates") - public ApiResult getTemplates() { - try { - User loginUser = getLoginUser(); - Integer tenantId = loginUser != null ? loginUser.getTenantId() : 0; - - String response = wxNotificationService.getTemplateList(tenantId); - return success("获取成功", response); - - } catch (Exception e) { - log.error("获取模板列表失败", e); - return fail("获取失败:" + e.getMessage()); - } - } -} diff --git a/src/main/java/com/gxwebsoft/hjm/dto/BatchTemplateMessageRequest.java b/src/main/java/com/gxwebsoft/hjm/dto/BatchTemplateMessageRequest.java deleted file mode 100644 index dbea9fc..0000000 --- a/src/main/java/com/gxwebsoft/hjm/dto/BatchTemplateMessageRequest.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.gxwebsoft.hjm.dto; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -/** - * 批量发送模板消息请求 - * - * @author 科技小王子 - * @since 2025-06-15 - */ -@Data -@Schema(name = "BatchTemplateMessageRequest", description = "批量发送模板消息请求") -public class BatchTemplateMessageRequest { - - @Schema(description = "模板消息列表", required = true) - private List messages; - - @Schema(description = "发送间隔时间(毫秒),默认100ms") - private Long intervalMs = 100L; -} diff --git a/src/main/java/com/gxwebsoft/hjm/dto/SubscribeMessageRequest.java b/src/main/java/com/gxwebsoft/hjm/dto/SubscribeMessageRequest.java deleted file mode 100644 index 8625784..0000000 --- a/src/main/java/com/gxwebsoft/hjm/dto/SubscribeMessageRequest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.gxwebsoft.hjm.dto; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Map; - -/** - * 微信小程序订阅消息请求 - * - * @author 科技小王子 - * @since 2025-06-15 - */ -@Data -@Schema(name = "SubscribeMessageRequest", description = "微信小程序订阅消息请求") -public class SubscribeMessageRequest { - - @Schema(description = "接收者openid", required = true) - private String toUser; - - @Schema(description = "所需下发的订阅模板id", required = true) - private String templateId; - - @Schema(description = "点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。") - private String page; - - @Schema(description = "跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版") - private String miniprogramState = "formal"; - - @Schema(description = "进入小程序查看的语言类型,支持zh_CN(简体中文)、en_US(英文)、zh_HK(繁体中文)、zh_TW(繁体中文),默认为zh_CN") - private String lang = "zh_CN"; - - @Schema(description = "模板内容,格式形如 { \"key1\": { \"value\": any }, \"key2\": { \"value\": any } }", required = true) - private Map data; - - /** - * 订阅消息数据项 - */ - @Data - @Schema(name = "SubscribeDataItem", description = "订阅消息数据项") - public static class SubscribeDataItem { - @Schema(description = "数据值", required = true) - private String value; - - public SubscribeDataItem() {} - - public SubscribeDataItem(String value) { - this.value = value; - } - } -} diff --git a/src/main/java/com/gxwebsoft/hjm/dto/TemplateMessageRequest.java b/src/main/java/com/gxwebsoft/hjm/dto/TemplateMessageRequest.java deleted file mode 100644 index f15f6e4..0000000 --- a/src/main/java/com/gxwebsoft/hjm/dto/TemplateMessageRequest.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.gxwebsoft.hjm.dto; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.Map; - -/** - * 微信公众号模板消息请求 - * - * @author 科技小王子 - * @since 2025-06-15 - */ -@Data -@Schema(name = "TemplateMessageRequest", description = "微信公众号模板消息请求") -public class TemplateMessageRequest { - - @Schema(description = "接收者openid", required = true) - private String toUser; - - @Schema(description = "模板ID", required = true) - private String templateId; - - @Schema(description = "模板跳转链接(海外帐号没有跳转能力)") - private String url; - - @Schema(description = "模板内容字体颜色,不填默认为黑色") - private String topColor = "#173177"; - - @Schema(description = "模板数据", required = true) - private Map data; - - @Schema(description = "跳小程序所需数据,不需跳小程序可不用传该数据") - private MiniProgram miniprogram; - - /** - * 模板数据项 - */ - @Data - @Schema(name = "TemplateDataItem", description = "模板数据项") - public static class TemplateDataItem { - @Schema(description = "数据值", required = true) - private String value; - - @Schema(description = "数据颜色,不填默认为黑色") - private String color = "#173177"; - - public TemplateDataItem() {} - - public TemplateDataItem(String value) { - this.value = value; - } - - public TemplateDataItem(String value, String color) { - this.value = value; - this.color = color; - } - } - - /** - * 小程序跳转信息 - */ - @Data - @Schema(name = "MiniProgram", description = "小程序跳转信息") - public static class MiniProgram { - @Schema(description = "所需跳转到的小程序appid(该小程序appid必须与发模板消息的公众号是绑定关联关系,暂不支持小游戏)") - private String appid; - - @Schema(description = "所需跳转到小程序的具体页面路径,支持带参数,(示例index?foo=bar),要求该小程序已发布,暂不支持小游戏") - private String pagepath; - } -} diff --git a/src/main/java/com/gxwebsoft/hjm/entity/Gps.java b/src/main/java/com/gxwebsoft/hjm/entity/Gps.java deleted file mode 100644 index 6c9768f..0000000 --- a/src/main/java/com/gxwebsoft/hjm/entity/Gps.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.gxwebsoft.hjm.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * GPS - * - * @author 科技小王子 - * @since 2025-04-14 16:43:26 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "GPS对象", description = "GPS") -public class Gps implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "物联网卡的imsi号") - @TableField(exist = false) - private String imsi; - - @Schema(description = "设备ID") - private String imei; - - @Schema(description = "移动网络编码") - private String plmn; - - @Schema(description = "4G网络路由区") - private String lac; - - @Schema(description = "4G网络基站小区id") - private String ci; - - @Schema(description = "4G网络信号值") - private String rssi; - - @Schema(description = "设备当前时间戳") - private Integer time; - - @Schema(description = "设备当前时间") - private String ddmmyy; - - @Schema(description = "时分秒") - private String hhmmss; - - @Schema(description = "速度") - private String speed; - - @Schema(description = "miles") - private String miles; - - @Schema(description = "是否定位") - private Boolean fixed; - - @Schema(description = "经度") - private String lat; - - @Schema(description = "纬度") - private String lng; - - @Schema(description = "定位星数") - private String satcnt; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/entity/HjmBxLog.java b/src/main/java/com/gxwebsoft/hjm/entity/HjmBxLog.java deleted file mode 100644 index f17bb6d..0000000 --- a/src/main/java/com/gxwebsoft/hjm/entity/HjmBxLog.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.gxwebsoft.hjm.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_报险记录 - * - * @author 科技小王子 - * @since 2025-06-06 13:08:29 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HjmBxLog对象", description = "黄家明_报险记录") -public class HjmBxLog implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "用户昵称") - @TableField(exist = false) - private String nickname; - - @Schema(description = "事故类型") - private String accidentType; - - @Schema(description = "车辆ID") - private Integer carId; - - @Schema(description = "车辆编号") - @TableField(exist = false) - private String carNo; - - @Schema(description = "车辆图片") - @TableField(exist = false) - private String carAvatar; - - @Schema(description = "保险图片") - private String image; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/entity/HjmCar.java b/src/main/java/com/gxwebsoft/hjm/entity/HjmCar.java deleted file mode 100644 index 3b18194..0000000 --- a/src/main/java/com/gxwebsoft/hjm/entity/HjmCar.java +++ /dev/null @@ -1,179 +0,0 @@ -package com.gxwebsoft.hjm.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; -import java.util.List; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_车辆管理 - * - * @author 科技小王子 - * @since 2025-04-14 16:43:26 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HjmCar对象", description = "黄家明_车辆管理") -public class HjmCar implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "车辆名称") - private String name; - - @Schema(description = "车辆图片") - private String image; - - @Schema(description = "类型 0汽车 1其他车") - private Integer type; - - @Schema(description = "管理负责人") - @TableField(exist = false) - private String kuaidiAdmin; - - @Schema(description = "车辆编号") - private String code; - - @Schema(description = "车辆车架号") - private String vinCode; - - @Schema(description = "司机") - private Integer driverId; - - @Schema(description = "操作员") - @TableField(exist = false) - private String driver; - - @Schema(description = "操作员") - private String driverName; - - @Schema(description = "操作员电话") - @TableField(exist = false) - private String driverPhone; - - @Schema(description = "保险状态") - private String insuranceStatus; - - @Schema(description = "保单图片") - private String bdImg; - - @Schema(description = "GPS设备编号") - private String gpsNo; - - @Schema(description = "电子围栏ID") - private Integer fenceId; - - @Schema(description = "电子围栏名称") - private String fenceName; - - @Schema(description = "电子围栏名称") - @TableField(exist = false) - private HjmFence fence; - - @Schema(description = "是否在围栏内") - private Boolean inFence; - - @Schema(description = "位置") - private String location; - - @Schema(description = "纬度") - private String latitude; - - @Schema(description = "经度") - private String longitude; - - @Schema(description = "速度") - private String speed; - - @Schema(description = "区域") - private String district; - - @Schema(description = "地址") - private String address; - - @Schema(description = "组织ID") - private Integer organizationId; - - @Schema(description = "机构名称") - private String organizationName; - - @Schema(description = "机构名称") - @TableField(exist = false) - private String organization; - - @Schema(description = "父级组织ID") - private Integer organizationParentId; - - @Schema(description = "父级机构名称") - private String organizationParentName; - - @Schema(description = "父级机构名称") - @TableField(exist = false) - private String parentOrganization; - - @Schema(description = "快递公司管理员") - @TableField(exist = false) - private String parentOrganizationAdmin; - - @Schema(description = "微信小程序码") - private String mpCode; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "安装工ID") - private Integer installerId; - - @Schema(description = "安装时间") - private String installTime; - - @Schema(description = "接受推送消息的微信openId") - private String toUser; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "appId") - @TableField(exist = false) - private String appId; - - @Schema(description = "是否认领, 0未认领, 1已认领") - private Integer claim; - - @Schema(description = "认领时间") - private String claimTime; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/entity/HjmChoices.java b/src/main/java/com/gxwebsoft/hjm/entity/HjmChoices.java deleted file mode 100644 index 550be7e..0000000 --- a/src/main/java/com/gxwebsoft/hjm/entity/HjmChoices.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.gxwebsoft.hjm.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_选择题选项 - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HjmChoices对象", description = "黄家明_选择题选项") -public class HjmChoices implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "题目ID") - private Integer questionId; - - @Schema(description = "题目") - private String content; - - @Schema(description = "是否正确") - private Boolean isCorrect; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/entity/HjmCourses.java b/src/main/java/com/gxwebsoft/hjm/entity/HjmCourses.java deleted file mode 100644 index 6871cca..0000000 --- a/src/main/java/com/gxwebsoft/hjm/entity/HjmCourses.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.gxwebsoft.hjm.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_课程 - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HjmCourses对象", description = "黄家明_课程") -public class HjmCourses implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "课程名称") - private String name; - - @Schema(description = "类型") - private Integer type; - - @Schema(description = "课程编号") - private String code; - - @Schema(description = "课程封面图") - private String image; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/entity/HjmExamLog.java b/src/main/java/com/gxwebsoft/hjm/entity/HjmExamLog.java deleted file mode 100644 index b5d9a45..0000000 --- a/src/main/java/com/gxwebsoft/hjm/entity/HjmExamLog.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.gxwebsoft.hjm.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_学习记录 - * - * @author 科技小王子 - * @since 2025-06-05 14:32:03 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HjmExamLog对象", description = "黄家明_学习记录") -public class HjmExamLog implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "用户昵称") - @TableField(exist = false) - private String nickname; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "手机号码") - @TableField(exist = false) - private String phone; - - @Schema(description = "得分") - private BigDecimal total; - - @Schema(description = "用时") - private String useTime; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/entity/HjmFence.java b/src/main/java/com/gxwebsoft/hjm/entity/HjmFence.java deleted file mode 100644 index 548e889..0000000 --- a/src/main/java/com/gxwebsoft/hjm/entity/HjmFence.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.gxwebsoft.hjm.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_电子围栏 - * - * @author 科技小王子 - * @since 2025-06-03 02:08:03 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HjmFence对象", description = "黄家明_电子围栏") -public class HjmFence implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "围栏名称") - private String name; - - @Schema(description = "类型 1多边形") - private Integer type; - - @Schema(description = "位置") - private String location; - - @Schema(description = "经度") - private Double longitude; - - @Schema(description = "纬度") - private Double latitude; - - @Schema(description = "区域") - private String district; - - @Schema(description = "轮廓") - private String points; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/entity/HjmGpsLog.java b/src/main/java/com/gxwebsoft/hjm/entity/HjmGpsLog.java deleted file mode 100644 index 86b67b2..0000000 --- a/src/main/java/com/gxwebsoft/hjm/entity/HjmGpsLog.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.gxwebsoft.hjm.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; -import java.io.Serializable; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_gps轨迹 - * - * @author 科技小王子 - * @since 2025-06-11 12:03:50 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HjmGpsLog对象", description = "黄家明_gps轨迹") -public class HjmGpsLog implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "车辆ID") - private Integer carId; - - @Schema(description = "gps编号") - private String gpsNo; - - @Schema(description = "经度") - private String longitude; - - @Schema(description = "纬度") - private String latitude; - - @Schema(description = "设备当前时间") - private String ddmmyy; - - @Schema(description = "时分秒") - private String hhmmss; - - @Schema(description = "速度") - private String speed; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "操作员电话") - @TableField(exist = false) - private String phone; - - @Schema(description = "车辆编号") - @TableField(exist = false) - private String carNo; - - @Schema(description = "司机ID") - @TableField(exist = false) - private Integer driverId; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/entity/HjmQuestions.java b/src/main/java/com/gxwebsoft/hjm/entity/HjmQuestions.java deleted file mode 100644 index 8bb5796..0000000 --- a/src/main/java/com/gxwebsoft/hjm/entity/HjmQuestions.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.gxwebsoft.hjm.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; -import java.util.List; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_题目 - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HjmQuestions对象", description = "黄家明_题目") -public class HjmQuestions implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "课程ID") - private Integer courseId; - - @Schema(description = "课程名称") - @TableField(exist = false) - private String courseName; - - @Schema(description = "类型 0choice 1fill 2essay") - private Integer type; - - @Schema(description = "题目") - private String question; - - @Schema(description = "正确答案") - private String correctAnswer; - - @Schema(description = "难度,0简单 1中等 2难") - private Integer difficulty; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - - @Schema(description = "正确答案") - @TableField(exist = false) - private Integer choices; -// -// @Schema(description = "选项A") -// @TableField(exist = false) -// private String choicesA; -// -// @Schema(description = "选项B") -// @TableField(exist = false) -// private String choicesB; -// -// @Schema(description = "选项C") -// @TableField(exist = false) -// private String choicesC; -// -// @Schema(description = "选项D") -// @TableField(exist = false) -// private String choicesD; - - @Schema(description = "选项列表") - @TableField(exist = false) - private List choicesList; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/entity/HjmViolation.java b/src/main/java/com/gxwebsoft/hjm/entity/HjmViolation.java deleted file mode 100644 index a498731..0000000 --- a/src/main/java/com/gxwebsoft/hjm/entity/HjmViolation.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.gxwebsoft.hjm.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_违章记录 - * - * @author 科技小王子 - * @since 2025-06-20 13:48:43 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HjmViolation对象", description = "黄家明_违章记录") -public class HjmViolation implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "标题") - private String title; - - @Schema(description = "车辆编号") - private String code; - - @Schema(description = "车辆头像") - @TableField(exist = false) - private String image; - - @Schema(description = "文章分类ID") - private Integer categoryId; - - @Schema(description = "处罚金额") - private BigDecimal money; - - @Schema(description = "扣分") - private BigDecimal score; - - @Schema(description = "录入员") - private Integer adminId; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0未处理, 1已处理") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/mapper/HjmBxLogMapper.java b/src/main/java/com/gxwebsoft/hjm/mapper/HjmBxLogMapper.java deleted file mode 100644 index 0e525fc..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/HjmBxLogMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.hjm.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.hjm.entity.HjmBxLog; -import com.gxwebsoft.hjm.param.HjmBxLogParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 黄家明_报险记录Mapper - * - * @author 科技小王子 - * @since 2025-06-06 13:08:29 - */ -public interface HjmBxLogMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HjmBxLogParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HjmBxLogParam param); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/mapper/HjmCarMapper.java b/src/main/java/com/gxwebsoft/hjm/mapper/HjmCarMapper.java deleted file mode 100644 index 1ef6a43..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/HjmCarMapper.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.gxwebsoft.hjm.mapper; - -import com.baomidou.mybatisplus.annotation.InterceptorIgnore; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.hjm.entity.HjmCar; -import com.gxwebsoft.hjm.param.HjmCarParam; -import org.apache.ibatis.annotations.Delete; -import org.apache.ibatis.annotations.Param; - -import java.util.Collection; -import java.util.List; - -/** - * 黄家明_车辆管理Mapper - * - * @author 科技小王子 - * @since 2025-04-14 16:43:26 - */ -public interface HjmCarMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HjmCarParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HjmCarParam param); - - - @InterceptorIgnore(tenantLine = "true") - HjmCar getByGpsNo(@Param("gpsNo") String gpsNo); - - @InterceptorIgnore(tenantLine = "true") - boolean updateByGpsNo(@Param("param") HjmCar param); - - @InterceptorIgnore(tenantLine = "true") - HjmCar getByCode(String code); - - /** - * 硬删除:绕过 MyBatis-Plus 逻辑删除(@TableLogic)。 - */ - @Delete("DELETE FROM hjm_car WHERE id = #{id}") - int hardDeleteById(@Param("id") Integer id); - - /** - * 硬删除:批量删除,绕过 MyBatis-Plus 逻辑删除(@TableLogic)。 - */ - @Delete({ - "" - }) - int hardDeleteBatchIds(@Param("ids") Collection ids); -} diff --git a/src/main/java/com/gxwebsoft/hjm/mapper/HjmChoicesMapper.java b/src/main/java/com/gxwebsoft/hjm/mapper/HjmChoicesMapper.java deleted file mode 100644 index 5ca7ae8..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/HjmChoicesMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.hjm.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.hjm.entity.HjmChoices; -import com.gxwebsoft.hjm.param.HjmChoicesParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 黄家明_选择题选项Mapper - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -public interface HjmChoicesMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HjmChoicesParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HjmChoicesParam param); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/mapper/HjmCoursesMapper.java b/src/main/java/com/gxwebsoft/hjm/mapper/HjmCoursesMapper.java deleted file mode 100644 index 81127d0..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/HjmCoursesMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.hjm.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.hjm.entity.HjmCourses; -import com.gxwebsoft.hjm.param.HjmCoursesParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 黄家明_课程Mapper - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -public interface HjmCoursesMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HjmCoursesParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HjmCoursesParam param); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/mapper/HjmExamLogMapper.java b/src/main/java/com/gxwebsoft/hjm/mapper/HjmExamLogMapper.java deleted file mode 100644 index ab875fa..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/HjmExamLogMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.hjm.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.hjm.entity.HjmExamLog; -import com.gxwebsoft.hjm.param.HjmExamLogParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 黄家明_学习记录Mapper - * - * @author 科技小王子 - * @since 2025-06-05 14:32:03 - */ -public interface HjmExamLogMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HjmExamLogParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HjmExamLogParam param); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/mapper/HjmFenceMapper.java b/src/main/java/com/gxwebsoft/hjm/mapper/HjmFenceMapper.java deleted file mode 100644 index ab0c9af..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/HjmFenceMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.hjm.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.hjm.entity.HjmFence; -import com.gxwebsoft.hjm.param.HjmFenceParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 黄家明_电子围栏Mapper - * - * @author 科技小王子 - * @since 2025-06-03 02:08:03 - */ -public interface HjmFenceMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HjmFenceParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HjmFenceParam param); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/mapper/HjmGpsLogMapper.java b/src/main/java/com/gxwebsoft/hjm/mapper/HjmGpsLogMapper.java deleted file mode 100644 index caaae06..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/HjmGpsLogMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.hjm.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.hjm.entity.HjmGpsLog; -import com.gxwebsoft.hjm.param.HjmGpsLogParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 黄家明_gps轨迹Mapper - * - * @author 科技小王子 - * @since 2025-06-11 12:03:50 - */ -public interface HjmGpsLogMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HjmGpsLogParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HjmGpsLogParam param); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/mapper/HjmQuestionsMapper.java b/src/main/java/com/gxwebsoft/hjm/mapper/HjmQuestionsMapper.java deleted file mode 100644 index 980dd4f..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/HjmQuestionsMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.hjm.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.hjm.entity.HjmQuestions; -import com.gxwebsoft.hjm.param.HjmQuestionsParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 黄家明_题目Mapper - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -public interface HjmQuestionsMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HjmQuestionsParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HjmQuestionsParam param); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/mapper/HjmViolationMapper.java b/src/main/java/com/gxwebsoft/hjm/mapper/HjmViolationMapper.java deleted file mode 100644 index 539c87e..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/HjmViolationMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.hjm.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.hjm.entity.HjmViolation; -import com.gxwebsoft.hjm.param.HjmViolationParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 黄家明_违章记录Mapper - * - * @author 科技小王子 - * @since 2025-06-20 13:48:43 - */ -public interface HjmViolationMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HjmViolationParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HjmViolationParam param); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmBxLogMapper.xml b/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmBxLogMapper.xml deleted file mode 100644 index d008f01..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmBxLogMapper.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - SELECT a.*, b.name as carName,b.code as carNo, b.image as carAvatar, u.real_name as realName, u.nickname - FROM hjm_bx_log a - LEFT JOIN hjm_car b ON a.car_id = b.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.user_id = #{param.userId} - - - AND a.car_id = #{param.carId} - - - AND a.image LIKE CONCAT('%', #{param.image}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - 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/hjm/mapper/xml/HjmCarMapper.xml b/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmCarMapper.xml deleted file mode 100644 index 1264372..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmCarMapper.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - SELECT a.*,b.organization_name as organization,e.name as fence, f.organization_name as parentOrganization, - f.comments as - parentOrganizationAdmin, u.real_name as driver,u.phone as driverPhone - FROM hjm_car a - LEFT JOIN gxwebsoft_core.sys_organization b ON a.organization_id = b.organization_id - LEFT JOIN gxwebsoft_core.sys_organization f ON a.organization_parent_id = f.organization_id - LEFT JOIN hjm_fence e ON a.fence_id = e.id - LEFT JOIN gxwebsoft_core.sys_user u ON a.driver_id = u.user_id - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.image LIKE CONCAT('%', #{param.image}, '%') - - - AND a.type = #{param.type} - - - AND a.organization_id IN - - #{orgId} - - - - AND a.organization_id = #{param.organizationId} - - - AND a.organization_parent_id = #{param.organizationParentId} - - - AND a.driver_id = #{param.driverId} - - - AND a.kuaidi LIKE CONCAT('%', #{param.kuaidi}, '%') - - - AND a.kuaidi_admin LIKE CONCAT('%', #{param.kuaidiAdmin}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.vin_code LIKE CONCAT('%', #{param.vinCode}, '%') - - - - AND a.driver = #{param.driver} - - - AND a.insurance_status = #{param.insuranceStatus} - - - AND a.gps_no LIKE CONCAT('%', #{param.gpsNo}, '%') - - - AND a.fence LIKE CONCAT('%', #{param.fence}, '%') - - - AND a.district LIKE CONCAT('%', #{param.district}, '%') - - - AND a.claim = #{param.claim} - - - AND a.installer_id = #{param.installerId} - - - AND a.user_id = #{param.userId} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.code LIKE CONCAT('%', #{param.keywords}, '%') - OR a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR a.gps_no = #{param.keywords} - OR a.driver_name = #{param.keywords} - OR u.phone = #{param.keywords} - ) - - - - - - - - - - - - - - - - UPDATE hjm_car - - - longitude = #{param.longitude}, - - - latitude = #{param.latitude}, - - - speed = #{param.speed}, - - - - gps_no = #{param.gpsNo} - - - - diff --git a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmChoicesMapper.xml b/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmChoicesMapper.xml deleted file mode 100644 index 9999614..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmChoicesMapper.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - SELECT a.* - FROM hjm_choices a - - - AND a.id = #{param.id} - - - AND a.question_id = #{param.questionId} - - - AND a.choice_content LIKE CONCAT('%', #{param.choiceContent}, '%') - - - AND a.is_correct = #{param.isCorrect} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - 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/hjm/mapper/xml/HjmCoursesMapper.xml b/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmCoursesMapper.xml deleted file mode 100644 index bc58532..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmCoursesMapper.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - SELECT a.* - FROM hjm_courses a - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.type = #{param.type} - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.image LIKE CONCAT('%', #{param.image}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - 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/hjm/mapper/xml/HjmExamLogMapper.xml b/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmExamLogMapper.xml deleted file mode 100644 index 1b869e0..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmExamLogMapper.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - SELECT a.*, b.nickname, b.phone, b.real_name - FROM hjm_exam_log a - LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id - - - AND a.id = #{param.id} - - - AND a.user_id = #{param.userId} - - - AND a.total = #{param.total} - - - AND a.use_time LIKE CONCAT('%', #{param.useTime}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - 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/hjm/mapper/xml/HjmFenceMapper.xml b/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmFenceMapper.xml deleted file mode 100644 index 6bff929..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmFenceMapper.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - SELECT a.* - FROM hjm_fence a - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.type = #{param.type} - - - AND a.longitude LIKE CONCAT('%', #{param.longitude}, '%') - - - AND a.latitude LIKE CONCAT('%', #{param.latitude}, '%') - - - AND a.district LIKE CONCAT('%', #{param.district}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - 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/hjm/mapper/xml/HjmGpsLogMapper.xml b/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmGpsLogMapper.xml deleted file mode 100644 index b6cb487..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmGpsLogMapper.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - SELECT a.* - FROM hjm_gps_log a - - - AND a.id = #{param.id} - - - AND a.car_id = #{param.carId} - - - AND a.gps_no = #{param.gpsNo} - - - AND a.longitude LIKE CONCAT('%', #{param.longitude}, '%') - - - AND a.latitude LIKE CONCAT('%', #{param.latitude}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.ddmmyy LIKE CONCAT('%', #{param.ddmmyy}, '%') - - - AND a.hhmmss LIKE CONCAT(#{param.hhmmss}, '%') - - - AND a.speed = #{param.speed} - - - AND a.status = #{param.status} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND a.create_time LIKE CONCAT('%', #{param.dateTime}, '%') - - - AND a.gps_no = #{param.keywords} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmQuestionsMapper.xml b/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmQuestionsMapper.xml deleted file mode 100644 index 88cb559..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmQuestionsMapper.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - SELECT a.*, b.title as courseName - FROM hjm_questions a - LEFT JOIN cms_navigation b ON a.course_id = b.navigation_id - - - AND a.id = #{param.id} - - - AND a.course_id = #{param.courseId} - - - AND a.type = #{param.type} - - - AND a.question LIKE CONCAT('%', #{param.question}, '%') - - - AND a.correct_answer LIKE CONCAT('%', #{param.correctAnswer}, '%') - - - AND a.difficulty LIKE CONCAT('%', #{param.difficulty}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - 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/hjm/mapper/xml/HjmViolationMapper.xml b/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmViolationMapper.xml deleted file mode 100644 index 2c8f616..0000000 --- a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmViolationMapper.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - SELECT DISTINCT a.*,b.image - FROM hjm_violation a - LEFT JOIN hjm_car b ON a.code = b.code - LEFT JOIN gxwebsoft_core.sys_organization c ON b.organization_id = c.organization_id - LEFT JOIN gxwebsoft_core.sys_organization f ON b.organization_parent_id = f.organization_id - - - AND a.id = #{param.id} - - - AND a.title LIKE CONCAT('%', #{param.title}, '%') - - - AND a.code = #{param.code} - - - AND a.category_id = #{param.categoryId} - - - AND a.money = #{param.money} - - - AND a.score = #{param.score} - - - AND b.organization_id = #{param.organizationId} - - - AND b.organization_parent_id = #{param.organizationParentId} - - - AND a.admin_id = #{param.adminId} - - - AND a.user_id = #{param.userId} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR a.code = #{param.keywords} - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/hjm/param/HjmBxLogParam.java b/src/main/java/com/gxwebsoft/hjm/param/HjmBxLogParam.java deleted file mode 100644 index 6f777f6..0000000 --- a/src/main/java/com/gxwebsoft/hjm/param/HjmBxLogParam.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.gxwebsoft.hjm.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_报险记录查询参数 - * - * @author 科技小王子 - * @since 2025-06-06 13:08:29 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HjmBxLogParam对象", description = "黄家明_报险记录查询参数") -public class HjmBxLogParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "车辆ID") - @QueryField(type = QueryType.EQ) - private Integer carId; - - @Schema(description = "保险图片") - private String image; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/param/HjmCarImportParam.java b/src/main/java/com/gxwebsoft/hjm/param/HjmCarImportParam.java deleted file mode 100644 index afea961..0000000 --- a/src/main/java/com/gxwebsoft/hjm/param/HjmCarImportParam.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.gxwebsoft.hjm.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import lombok.Data; - -import java.io.Serializable; - -/** - * 车辆导入参数 - * - * @author 科技小王子 - * @since 2025-04-14 16:43:26 - */ -@Data -public class HjmCarImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "车辆名称") - private String name; - - @Excel(name = "车辆图片") - private String image; - - @Excel(name = "类型") - private Integer type; - - @Excel(name = "管理负责人") - private String kuaidiAdmin; - - @Excel(name = "车辆编号") - private String code; - - @Excel(name = "司机ID") - private Integer driverId; - - @Excel(name = "保险状态") - private String insuranceStatus; - - @Excel(name = "GPS设备编号") - private String gpsNo; - - @Excel(name = "电子围栏ID") - private Integer fenceId; - - @Excel(name = "电子围栏名称") - private String fenceName; - - @Excel(name = "位置") - private String location; - - @Excel(name = "纬度") - private String latitude; - - @Excel(name = "经度") - private String longitude; - - @Excel(name = "区域") - private String district; - - @Excel(name = "地址") - private String address; - - @Excel(name = "站点ID") - private Integer organizationId; - - @Excel(name = "所属快递公司ID") - private Integer organizationParentId; - - @Excel(name = "微信小程序码") - private String mpCode; - - @Excel(name = "用户ID") - private Integer userId; - - @Excel(name = "排序") - private Integer sortNumber; - - @Excel(name = "备注") - private String comments; - - @Excel(name = "状态") - private Integer status; -} diff --git a/src/main/java/com/gxwebsoft/hjm/param/HjmCarParam.java b/src/main/java/com/gxwebsoft/hjm/param/HjmCarParam.java deleted file mode 100644 index 923dfaf..0000000 --- a/src/main/java/com/gxwebsoft/hjm/param/HjmCarParam.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.gxwebsoft.hjm.param; - -import java.math.BigDecimal; -import java.util.Set; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_车辆管理查询参数 - * - * @author 科技小王子 - * @since 2025-04-14 16:43:26 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HjmCarParam对象", description = "黄家明_车辆管理查询参数") -public class HjmCarParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "车辆名称") - private String name; - - @Schema(description = "车辆图片") - private String image; - - @Schema(description = "类型 0汽车 1其他车") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "快递公司") - private String kuaidi; - - @Schema(description = "管理负责人") - private String kuaidiAdmin; - - @Schema(description = "车辆编号") - private String code; - - @Schema(description = "车辆车架号") - private String vinCode; - - @Schema(description = "司机ID") - @QueryField(type = QueryType.EQ) - private Integer driverId; - - @Schema(description = "司机") - @QueryField(type = QueryType.EQ) - private Integer driver; - - @Schema(description = "保险状态") - @QueryField(type = QueryType.EQ) - private String insuranceStatus; - - @Schema(description = "保险图片") - private String bdImg; - - @Schema(description = "GPS设备编号") - private String gpsNo; - - @Schema(description = "电子围栏") - private String fence; - - @Schema(description = "所在区域") - @QueryField(type = QueryType.EQ) - private String district; - - @Schema(description = "纬度") - @QueryField(type = QueryType.EQ) - private String latitude; - - @Schema(description = "经度") - @QueryField(type = QueryType.EQ) - private String longitude; - - @Schema(description = "组织ID") - @QueryField(type = QueryType.EQ) - private Integer organizationId; - - @Schema(description = "组织ID集") - @QueryField(type = QueryType.IN) - private Set organizationIds; - - @Schema(description = "父级组织ID") - @QueryField(type = QueryType.EQ) - private Integer organizationParentId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "安装人员ID") - @QueryField(type = QueryType.EQ) - private Integer installerId; - - @Schema(description = "安装时间") - private String installTime; - - @Schema(description = "是否认领, 0未认领, 1已认领") - @QueryField(type = QueryType.EQ) - private Integer claim; - - @Schema(description = "认领时间") - private String claimTime; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "所属站点") - @QueryField(type = QueryType.EQ) - private String organizationName; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/param/HjmChoicesParam.java b/src/main/java/com/gxwebsoft/hjm/param/HjmChoicesParam.java deleted file mode 100644 index 76398e7..0000000 --- a/src/main/java/com/gxwebsoft/hjm/param/HjmChoicesParam.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.gxwebsoft.hjm.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_选择题选项查询参数 - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HjmChoicesParam对象", description = "黄家明_选择题选项查询参数") -public class HjmChoicesParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "题目ID") - @QueryField(type = QueryType.EQ) - private Integer questionId; - - @Schema(description = "题目") - private String choiceContent; - - @Schema(description = "是否正确") - @QueryField(type = QueryType.EQ) - private Integer isCorrect; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/param/HjmCoursesParam.java b/src/main/java/com/gxwebsoft/hjm/param/HjmCoursesParam.java deleted file mode 100644 index 5992687..0000000 --- a/src/main/java/com/gxwebsoft/hjm/param/HjmCoursesParam.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.gxwebsoft.hjm.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_课程查询参数 - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HjmCoursesParam对象", description = "黄家明_课程查询参数") -public class HjmCoursesParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "课程名称") - private String name; - - @Schema(description = "类型") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "课程编号") - private String code; - - @Schema(description = "课程封面图") - private String image; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/param/HjmExamLogParam.java b/src/main/java/com/gxwebsoft/hjm/param/HjmExamLogParam.java deleted file mode 100644 index 2b37098..0000000 --- a/src/main/java/com/gxwebsoft/hjm/param/HjmExamLogParam.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.gxwebsoft.hjm.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_学习记录查询参数 - * - * @author 科技小王子 - * @since 2025-06-05 14:32:03 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HjmExamLogParam对象", description = "黄家明_学习记录查询参数") -public class HjmExamLogParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "得分") - @QueryField(type = QueryType.EQ) - private BigDecimal total; - - @Schema(description = "用时") - private String useTime; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/param/HjmFenceParam.java b/src/main/java/com/gxwebsoft/hjm/param/HjmFenceParam.java deleted file mode 100644 index a67e93f..0000000 --- a/src/main/java/com/gxwebsoft/hjm/param/HjmFenceParam.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.gxwebsoft.hjm.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_电子围栏查询参数 - * - * @author 科技小王子 - * @since 2025-06-03 02:08:03 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HjmFenceParam对象", description = "黄家明_电子围栏查询参数") -public class HjmFenceParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "围栏名称") - private String name; - - @Schema(description = "类型 0圆形 1方形") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "经度") - private String longitude; - - @Schema(description = "纬度") - private String latitude; - - @Schema(description = "区域") - private String district; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/param/HjmGpsLogParam.java b/src/main/java/com/gxwebsoft/hjm/param/HjmGpsLogParam.java deleted file mode 100644 index 50d42d5..0000000 --- a/src/main/java/com/gxwebsoft/hjm/param/HjmGpsLogParam.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.gxwebsoft.hjm.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_gps轨迹查询参数 - * - * @author 科技小王子 - * @since 2025-06-11 12:03:50 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HjmGpsLogParam对象", description = "黄家明_gps轨迹查询参数") -public class HjmGpsLogParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "车辆ID") - @QueryField(type = QueryType.EQ) - private Integer carId; - - @Schema(description = "gps编号") - @QueryField(type = QueryType.EQ) - private String gpsNo; - - @Schema(description = "经度") - private String longitude; - - @Schema(description = "纬度") - private String latitude; - - @Schema(description = "速度") - private String speed; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "按日期查询") - @QueryField(type = QueryType.EQ) - private String dateTime; - - @Schema(description = "设备当前时间") - @QueryField(type = QueryType.EQ) - private String ddmmyy; - - @Schema(description = "时分秒") - @QueryField(type = QueryType.LIKE) - private String hhmmss; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/param/HjmQuestionsParam.java b/src/main/java/com/gxwebsoft/hjm/param/HjmQuestionsParam.java deleted file mode 100644 index 27c80d5..0000000 --- a/src/main/java/com/gxwebsoft/hjm/param/HjmQuestionsParam.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.gxwebsoft.hjm.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_题目查询参数 - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HjmQuestionsParam对象", description = "黄家明_题目查询参数") -public class HjmQuestionsParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "课程ID") - @QueryField(type = QueryType.EQ) - private Integer courseId; - - @Schema(description = "类型 0choice 1fill 2essay") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "题目") - private String question; - - @Schema(description = "正确答案") - private String correctAnswer; - - @Schema(description = "难度,'easy', 'medium', 'hard'") - private String difficulty; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/param/HjmViolationParam.java b/src/main/java/com/gxwebsoft/hjm/param/HjmViolationParam.java deleted file mode 100644 index f9f2d7a..0000000 --- a/src/main/java/com/gxwebsoft/hjm/param/HjmViolationParam.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.gxwebsoft.hjm.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 黄家明_违章记录查询参数 - * - * @author 科技小王子 - * @since 2025-06-20 13:48:43 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HjmViolationParam对象", description = "黄家明_违章记录查询参数") -public class HjmViolationParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "标题") - private String title; - - @Schema(description = "车牌号") - @QueryField(type = QueryType.EQ) - private String code; - - @Schema(description = "文章分类ID") - @QueryField(type = QueryType.EQ) - private Integer categoryId; - - @Schema(description = "处罚金额") - @QueryField(type = QueryType.EQ) - private BigDecimal money; - - @Schema(description = "扣分") - @QueryField(type = QueryType.EQ) - private BigDecimal score; - - @Schema(description = "录入员") - @QueryField(type = QueryType.EQ) - private Integer adminId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0未处理, 1已处理") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "组织ID") - @QueryField(type = QueryType.EQ) - private Integer organizationId; - - @Schema(description = "父级组织ID") - @QueryField(type = QueryType.EQ) - private Integer organizationParentId; - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/GpsDiagnosticService.java b/src/main/java/com/gxwebsoft/hjm/service/GpsDiagnosticService.java deleted file mode 100644 index 28d648a..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/GpsDiagnosticService.java +++ /dev/null @@ -1,289 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import cn.hutool.core.util.StrUtil; -import com.gxwebsoft.common.core.utils.RedisUtil; -import com.gxwebsoft.hjm.entity.HjmCar; -import com.gxwebsoft.hjm.entity.HjmGpsLog; -import com.gxwebsoft.hjm.param.HjmCarParam; -import com.gxwebsoft.hjm.param.HjmGpsLogParam; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * GPS诊断服务 - * - * @author 科技小王子 - * @since 2025-07-02 - */ -@Service -public class GpsDiagnosticService { - - private static final Logger logger = LoggerFactory.getLogger(GpsDiagnosticService.class); - - @Resource - private HjmCarService hjmCarService; - - @Resource - private HjmGpsLogService hjmGpsLogService; - - @Resource - private RedisUtil redisUtil; - - /** - * 诊断GPS数据上送问题 - * - * @return 诊断报告 - */ - public Map diagnoseGpsDataIssues() { - Map report = new HashMap<>(); - - logger.info("开始GPS数据诊断..."); - - // 1. 检查所有车辆的GPS配置 - Map carGpsConfig = checkCarGpsConfiguration(); - report.put("车辆GPS配置检查", carGpsConfig); - - // 2. 检查GPS日志数据 - Map gpsLogAnalysis = analyzeGpsLogData(); - report.put("GPS日志分析", gpsLogAnalysis); - - // 3. 检查Redis缓存状态 - Map redisStatus = checkRedisCache(); - report.put("Redis缓存状态", redisStatus); - - // 4. 检查有数据的GPS设备 - Map activeGpsDevices = checkActiveGpsDevices(); - report.put("活跃GPS设备", activeGpsDevices); - - logger.info("GPS数据诊断完成"); - - return report; - } - - /** - * 检查车辆GPS配置 - */ - private Map checkCarGpsConfiguration() { - Map result = new HashMap<>(); - - try { - // 查询所有车辆 - HjmCarParam param = new HjmCarParam(); - List allCars = hjmCarService.listRel(param); - - int totalCars = allCars.size(); - int carsWithGps = 0; - int carsWithoutGps = 0; - - Map gpsDeviceMapping = new HashMap<>(); - - for (HjmCar car : allCars) { - if (StrUtil.isNotBlank(car.getGpsNo())) { - carsWithGps++; - gpsDeviceMapping.put(car.getGpsNo(), car.getCode()); - } else { - carsWithoutGps++; - logger.warn("车辆 {} (ID: {}) 未配置GPS设备编号", car.getCode(), car.getId()); - } - } - - result.put("总车辆数", totalCars); - result.put("已配置GPS的车辆数", carsWithGps); - result.put("未配置GPS的车辆数", carsWithoutGps); - result.put("GPS设备映射", gpsDeviceMapping); - - logger.info("车辆GPS配置检查完成 - 总数: {}, 已配置GPS: {}, 未配置GPS: {}", - totalCars, carsWithGps, carsWithoutGps); - - } catch (Exception e) { - logger.error("检查车辆GPS配置失败", e); - result.put("错误", e.getMessage()); - } - - return result; - } - - /** - * 分析GPS日志数据 - */ - private Map analyzeGpsLogData() { - Map result = new HashMap<>(); - - try { - // 查询最近的GPS日志 - HjmGpsLogParam param = new HjmGpsLogParam(); - List recentLogs = hjmGpsLogService.listRel(param); - - Map gpsDeviceLogCount = new HashMap<>(); - Map latestLogTime = new HashMap<>(); - - for (HjmGpsLog log : recentLogs) { - String gpsNo = log.getGpsNo(); - if (StrUtil.isNotBlank(gpsNo)) { - gpsDeviceLogCount.put(gpsNo, gpsDeviceLogCount.getOrDefault(gpsNo, 0) + 1); - - if (log.getCreateTime() != null) { - String currentTime = latestLogTime.get(gpsNo); - String logTime = log.getCreateTime().toString(); - if (currentTime == null || logTime.compareTo(currentTime) > 0) { - latestLogTime.put(gpsNo, logTime); - } - } - } - } - - result.put("总日志条数", recentLogs.size()); - result.put("各GPS设备日志数量", gpsDeviceLogCount); - result.put("各GPS设备最新日志时间", latestLogTime); - - // 找出有数据的GPS设备 - if (!gpsDeviceLogCount.isEmpty()) { - String mostActiveGps = gpsDeviceLogCount.entrySet().stream() - .max(Map.Entry.comparingByValue()) - .map(Map.Entry::getKey) - .orElse("无"); - result.put("最活跃的GPS设备", mostActiveGps); - result.put("最活跃设备日志数", gpsDeviceLogCount.getOrDefault(mostActiveGps, 0)); - } - - logger.info("GPS日志分析完成 - 总日志数: {}, 活跃设备数: {}", - recentLogs.size(), gpsDeviceLogCount.size()); - - } catch (Exception e) { - logger.error("分析GPS日志数据失败", e); - result.put("错误", e.getMessage()); - } - - return result; - } - - /** - * 检查Redis缓存状态 - */ - private Map checkRedisCache() { - Map result = new HashMap<>(); - - try { - // 检查围栏缓存 - String testGpsNo = "862317042719778"; - String fenceKey = "inFence:" + testGpsNo; - String fenceCache = redisUtil.get(fenceKey); - - result.put("测试GPS围栏缓存键", fenceKey); - result.put("测试GPS围栏缓存值", fenceCache != null ? fenceCache : "无缓存"); - - // 检查GPS日志缓存 - String gpsLogCache = redisUtil.get(testGpsNo); - result.put("测试GPS日志缓存", gpsLogCache != null ? gpsLogCache : "无缓存"); - - logger.info("Redis缓存状态检查完成"); - - } catch (Exception e) { - logger.error("检查Redis缓存状态失败", e); - result.put("错误", e.getMessage()); - } - - return result; - } - - /** - * 检查活跃的GPS设备 - */ - private Map checkActiveGpsDevices() { - Map result = new HashMap<>(); - - try { - // 检查特定GPS设备的车辆信息 - String activeGpsNo = "862317042719778"; - HjmCar activeCar = hjmCarService.getByGpsNo(activeGpsNo); - - if (activeCar != null) { - Map activeCarInfo = new HashMap<>(); - activeCarInfo.put("车辆编号", activeCar.getCode()); - activeCarInfo.put("车辆名称", activeCar.getName()); - activeCarInfo.put("车辆ID", activeCar.getId()); - activeCarInfo.put("GPS设备编号", activeCar.getGpsNo()); - activeCarInfo.put("最新经度", activeCar.getLongitude()); - activeCarInfo.put("最新纬度", activeCar.getLatitude()); - activeCarInfo.put("最新速度", activeCar.getSpeed()); - activeCarInfo.put("更新时间", activeCar.getUpdateTime()); - activeCarInfo.put("围栏ID", activeCar.getFenceId()); - activeCarInfo.put("是否在围栏内", activeCar.getInFence()); - - result.put("活跃GPS设备信息", activeCarInfo); - } else { - result.put("活跃GPS设备信息", "未找到对应车辆"); - } - - // 检查其他GPS设备 - HjmCarParam param = new HjmCarParam(); - List allCars = hjmCarService.listRel(param); - - Map otherGpsDevices = new HashMap<>(); - for (HjmCar car : allCars) { - if (StrUtil.isNotBlank(car.getGpsNo()) && !activeGpsNo.equals(car.getGpsNo())) { - otherGpsDevices.put(car.getGpsNo(), car.getCode()); - } - } - - result.put("其他GPS设备", otherGpsDevices); - - logger.info("活跃GPS设备检查完成"); - - } catch (Exception e) { - logger.error("检查活跃GPS设备失败", e); - result.put("错误", e.getMessage()); - } - - return result; - } - - /** - * 检查特定GPS设备的详细信息 - * - * @param gpsNo GPS设备编号 - * @return 设备详细信息 - */ - public Map checkSpecificGpsDevice(String gpsNo) { - Map result = new HashMap<>(); - - try { - logger.info("检查GPS设备详细信息: {}", gpsNo); - - // 检查车辆信息 - HjmCar car = hjmCarService.getByGpsNo(gpsNo); - if (car != null) { - result.put("车辆信息", car); - } else { - result.put("车辆信息", "未找到对应车辆"); - } - - // 检查GPS日志 - HjmGpsLogParam logParam = new HjmGpsLogParam(); - logParam.setGpsNo(gpsNo); - List logs = hjmGpsLogService.listRel(logParam); - result.put("GPS日志数量", logs.size()); - if (!logs.isEmpty()) { - result.put("最新GPS日志", logs.get(0)); - } - - // 检查Redis缓存 - String fenceCache = redisUtil.get("inFence:" + gpsNo); - String logCache = redisUtil.get(gpsNo); - result.put("围栏缓存", fenceCache); - result.put("日志缓存", logCache); - - } catch (Exception e) { - logger.error("检查GPS设备详细信息失败: {}", gpsNo, e); - result.put("错误", e.getMessage()); - } - - return result; - } -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/GpsMessageCallback.java b/src/main/java/com/gxwebsoft/hjm/service/GpsMessageCallback.java deleted file mode 100644 index de2247c..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/GpsMessageCallback.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import org.eclipse.paho.client.mqttv3.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -/** - * GPS消息回调处理器 - * - * @author 科技小王子 - * @since 2025-07-02 - */ -@Component -public class GpsMessageCallback implements MqttCallback { - - private static final Logger logger = LoggerFactory.getLogger(GpsMessageCallback.class); - - @Resource - private GpsMessageProcessor gpsMessageProcessor; - - @Override - public void connectionLost(Throwable cause) { - logger.error("MQTT连接丢失", cause); - - // 可以在这里添加告警通知逻辑 - // 例如:发送邮件、短信通知管理员 - notifyConnectionLost(cause); - } - - @Override - public void messageArrived(String topic, MqttMessage message) throws Exception { - try { - String payload = new String(message.getPayload()); - - logger.debug("接收到MQTT消息 - 主题: {}, QoS: {}, 消息长度: {}", - topic, message.getQos(), payload.length()); - - // 记录详细的消息内容(仅在DEBUG级别) - if (logger.isDebugEnabled()) { - logger.debug("消息内容: {}", payload); - } - - // 委托给专门的处理器处理 - gpsMessageProcessor.processGpsMessage(payload); - - } catch (Exception e) { - logger.error("处理MQTT消息失败 - 主题: {}, 错误: {}", topic, e.getMessage(), e); - - // 不要重新抛出异常,避免影响其他消息的处理 - // 可以在这里添加失败消息的重试机制或死信队列 - handleMessageProcessingFailure(topic, message, e); - } - } - - @Override - public void deliveryComplete(IMqttDeliveryToken token) { - logger.debug("MQTT消息发送完成: {}", token.isComplete()); - - try { - if (token.getTopics() != null && token.getTopics().length > 0) { - logger.debug("发送完成的主题: {}", String.join(", ", token.getTopics())); - } - } catch (Exception e) { - logger.warn("获取发送完成的主题信息失败", e); - } - } - - /** - * 处理连接丢失的通知 - * - * @param cause 连接丢失的原因 - */ - private void notifyConnectionLost(Throwable cause) { - try { - // 这里可以实现具体的通知逻辑 - // 例如: - // 1. 发送邮件通知 - // 2. 发送短信通知 - // 3. 写入告警日志 - // 4. 调用监控系统API - - logger.warn("MQTT连接丢失通知已触发,原因: {}", cause.getMessage()); - - // 示例:可以调用告警服务 - // alertService.sendAlert("MQTT连接丢失", cause.getMessage()); - - } catch (Exception e) { - logger.error("发送MQTT连接丢失通知失败", e); - } - } - - /** - * 处理消息处理失败的情况 - * - * @param topic 消息主题 - * @param message 消息内容 - * @param error 错误信息 - */ - private void handleMessageProcessingFailure(String topic, MqttMessage message, Exception error) { - try { - // 这里可以实现失败消息的处理逻辑 - // 例如: - // 1. 将失败的消息保存到数据库 - // 2. 发送到死信队列 - // 3. 记录到失败日志文件 - // 4. 实现重试机制 - - String payload = new String(message.getPayload()); - logger.warn("消息处理失败记录 - 主题: {}, 消息: {}, 错误: {}", - topic, payload.length() > 100 ? payload.substring(0, 100) + "..." : payload, - error.getMessage()); - - // 示例:可以保存失败消息到数据库 - // failedMessageService.saveFailedMessage(topic, payload, error.getMessage()); - - } catch (Exception e) { - logger.error("处理消息失败记录时发生错误", e); - } - } -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/GpsMessageProcessor.java b/src/main/java/com/gxwebsoft/hjm/service/GpsMessageProcessor.java deleted file mode 100644 index 51ab24c..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/GpsMessageProcessor.java +++ /dev/null @@ -1,319 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.support.geo.Point; -import com.gxwebsoft.common.core.utils.JSONUtil; -import com.gxwebsoft.common.core.utils.RedisUtil; -import com.gxwebsoft.hjm.entity.Gps; -import com.gxwebsoft.hjm.entity.HjmCar; -import com.gxwebsoft.hjm.entity.HjmFence; -import com.gxwebsoft.hjm.entity.HjmGpsLog; -import com.gxwebsoft.hjm.service.impl.HjmCarServiceImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.util.concurrent.TimeUnit; - -/** - * GPS消息处理器 - * - * @author 科技小王子 - * @since 2025-07-02 - */ -@Service -public class GpsMessageProcessor { - - private static final Logger logger = LoggerFactory.getLogger(GpsMessageProcessor.class); - - @Resource - private HjmCarService hjmCarService; - - @Resource - private HjmGpsLogService hjmGpsLogService; - - @Resource - private HjmFenceService hjmFenceService; - - @Resource - private RedisUtil redisUtil; - - @Resource - private StringRedisTemplate stringRedisTemplate; - - @Resource - private HjmCarServiceImpl hjmCarServiceImpl; - - /** - * 处理GPS消息 - * - * @param payload 消息内容 - */ - public void processGpsMessage(String payload) { - try { - logger.debug("开始处理GPS消息: {}", payload); - - // 检查消息内容是否为空 - if (StrUtil.isBlank(payload)) { - logger.warn("接收到空消息,跳过处理"); - return; - } - - // 检查是否为心跳或状态消息(非JSON格式) - if (isHeartbeatOrStatusMessage(payload)) { - logger.info("接收到心跳或状态消息: {}", payload); - return; - } - - // 尝试解析JSON格式的GPS数据 - Gps gps = JSONUtil.parseObject(payload, Gps.class); - if (ObjectUtil.isEmpty(gps)) { - logger.warn("GPS数据解析为空,跳过处理。消息内容: {}", payload); - return; - } - - processGpsData(gps); - - } catch (Exception e) { - logger.error("处理GPS数据失败: {}", payload, e); - } - } - - /** - * 检查是否为心跳或状态消息 - * - * @param payload 消息内容 - * @return true 如果是心跳或状态消息 - */ - private boolean isHeartbeatOrStatusMessage(String payload) { - // 去除前后空格和引号 - String cleanPayload = payload.trim(); - if (cleanPayload.startsWith("\"") && cleanPayload.endsWith("\"")) { - cleanPayload = cleanPayload.substring(1, cleanPayload.length() - 1); - } - - // 检查常见的心跳或状态消息 - return "online".equalsIgnoreCase(cleanPayload) || - "offline".equalsIgnoreCase(cleanPayload) || - "ping".equalsIgnoreCase(cleanPayload) || - "pong".equalsIgnoreCase(cleanPayload) || - "heartbeat".equalsIgnoreCase(cleanPayload) || - "status".equalsIgnoreCase(cleanPayload) || - cleanPayload.startsWith("status:") || - cleanPayload.startsWith("heartbeat:"); - } - - /** - * 处理GPS数据 - * - * @param gps GPS数据 - */ - private void processGpsData(Gps gps) { - try { - String gpsNo = gps.getImei(); - if (StrUtil.isBlank(gpsNo)) { - logger.warn("GPS设备编号为空,跳过处理"); - return; - } - - // 详细记录GPS数据处理过程 - logger.info("处理GPS数据 - 设备编号: {}, Fixed: {}, 经度: {}, 纬度: {}, 速度: {}", - gpsNo, gps.getFixed(), gps.getLng(), gps.getLat(), gps.getSpeed()); - - HjmCar car = hjmCarService.getByGpsNo(gpsNo); - - if (car == null) { - logger.warn("GPS设备编号: {} 在数据库中未找到对应车辆,请检查车辆配置", gpsNo); - return; - } - - logger.info("GPS设备编号: {} 对应车辆: {} (ID: {})", gpsNo, car.getCode(), car.getId()); - - if (!gps.getFixed()) { - logger.warn("GPS设备编号: {} 定位未固定(Fixed=false),跳过处理", gpsNo); - return; - } - - // 更新车辆GPS定位信息 - updateCarLocation(car, gps); - - // 保存GPS轨迹日志 - saveGpsLog(car, gps); - - // 检查电子围栏 - checkFence(car, gps); - - } catch (Exception e) { - logger.error("处理GPS数据时发生错误", e); - } - } - - /** - * 更新车辆位置信息 - */ - private void updateCarLocation(HjmCar car, Gps gps) { - try { - car.setLongitude(gps.getLng()); - car.setLatitude(gps.getLat()); - car.setSpeed(gps.getSpeed()); - car.setUpdateTime(LocalDateTime.ofInstant(Instant.ofEpochMilli(gps.getTime() * 1000), ZoneId.systemDefault())); - car.setGpsNo(gps.getImei()); - - if (hjmCarService.updateByGpsNo(car)) { - logger.debug("更新车辆GPS定位信息成功: {}", car.getCode()); - - // 保存GPS轨迹日志(通过Redis控制频率) - saveGpsLogRecord(car, gps); - } else { - logger.warn("更新车辆GPS定位信息失败: {}", car.getCode()); - } - - } catch (Exception e) { - logger.error("更新车辆位置信息失败", e); - } - } - - /** - * 保存GPS轨迹日志记录 - * 使用Redis控制保存频率,同一GPS设备2分钟内只保存一次 - */ - private void saveGpsLogRecord(HjmCar car, Gps gps) { - try { - // 只有速度不为0时才保存GPS轨迹 - if (gps.getSpeed().equals("0.000")) { - logger.debug("GPS设备{}速度为0,跳过保存轨迹日志", gps.getImei()); - return; - } - - // 构造Redis key,使用GPS设备编号作为key - String redisKey = "gps_log:" + gps.getImei(); - - // 使用Redis的setIfAbsent原子操作实现分布式锁 - // 只有key不存在时才设置成功,返回true;key已存在时返回false - Boolean lockAcquired = stringRedisTemplate.opsForValue() - .setIfAbsent(redisKey, "locked", 2, TimeUnit.MINUTES); - - if (Boolean.FALSE.equals(lockAcquired)) { - // 获取锁失败,说明2分钟内已经保存过 - logger.debug("GPS设备{}在2分钟内已保存过轨迹日志,跳过本次保存", gps.getImei()); - return; - } - - // 获取锁成功,执行保存操作 - HjmGpsLog log = new HjmGpsLog(); - log.setTenantId(10519); - log.setCarId(car.getId()); - log.setGpsNo(gps.getImei()); - log.setLatitude(gps.getLat()); - log.setLongitude(gps.getLng()); - log.setDdmmyy(gps.getDdmmyy()); - log.setHhmmss(gps.getHhmmss()); - log.setSpeed(gps.getSpeed()); - - // 保存数据库 - hjmGpsLogService.save(log); - - logger.info("保存GPS轨迹日志成功: 设备={}, 速度={}, 经度={}, 纬度={}", - gps.getImei(), gps.getSpeed(), gps.getLng(), gps.getLat()); - - } catch (Exception e) { - logger.error("保存GPS轨迹日志失败: 设备={}", gps.getImei(), e); - } - } - - /** - * 保存GPS日志(兼容原有方法) - */ - private void saveGpsLog(HjmCar car, Gps gps) { - // 这里可以添加其他GPS日志相关的处理逻辑 - logger.debug("处理GPS日志: 车辆={}, GPS={}", car.getCode(), gps.getImei()); - } - - /** - * 检查电子围栏 - */ - private void checkFence(HjmCar car, Gps gps) { - try { - String gpsNo = gps.getImei(); - - // 检查围栏缓存,避免频繁计算 - String inFenceKey = redisUtil.get("inFence:" + gpsNo); - if (StrUtil.isNotBlank(inFenceKey)) { - logger.debug("围栏检查缓存命中,跳过计算: {}", gpsNo); - return; - } - - // 设置围栏检查缓存(1天) - redisUtil.set("inFence:" + gpsNo, "1", 1L, TimeUnit.DAYS); - - // 检查是否配置了围栏 - if (car.getFenceId() == null) { - logger.debug("车辆未配置围栏: {}", car.getCode()); - return; - } - - HjmFence fence = hjmFenceService.getById(car.getFenceId()); - if (fence == null) { - logger.warn("围栏不存在: {}", car.getFenceId()); - return; - } - - // 检查坐标有效性 - if (!isValidCoordinate(car.getLongitude(), car.getLatitude())) { - logger.warn("车辆坐标无效: 经度={}, 纬度={}", car.getLongitude(), car.getLatitude()); - return; - } - - // 执行围栏判断 - performFenceCheck(car, fence); - - } catch (Exception e) { - logger.error("检查电子围栏时发生错误", e); - } - } - - /** - * 检查坐标有效性 - */ - private boolean isValidCoordinate(String longitude, String latitude) { - return longitude != null && latitude != null && - !longitude.trim().isEmpty() && !latitude.trim().isEmpty(); - } - - /** - * 执行围栏判断 - */ - private void performFenceCheck(HjmCar car, HjmFence fence) { - try { - double lng = Double.parseDouble(car.getLongitude()); - double lat = Double.parseDouble(car.getLatitude()); - - Point carPoint = new Point(); - carPoint.setLongitude(lng); - carPoint.setLatitude(lat); - - // 使用多边形围栏判断 - boolean isInFence = hjmCarServiceImpl.checkPolygonFence(carPoint, fence); - - // 更新围栏状态 - car.setInFence(isInFence); - car.setUpdateTime(LocalDateTime.now()); - hjmCarService.updateById(car); - - logger.info("车辆围栏检查完成: 车辆={}, 围栏={}, 是否在围栏内={}", - car.getCode(), fence.getId(), isInFence); - - } catch (NumberFormatException e) { - logger.error("车辆坐标格式错误: 经度={}, 纬度={}", car.getLongitude(), car.getLatitude(), e); - } catch (Exception e) { - logger.error("执行围栏判断时发生错误", e); - } - } -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/HjmBxLogService.java b/src/main/java/com/gxwebsoft/hjm/service/HjmBxLogService.java deleted file mode 100644 index 4dd762d..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/HjmBxLogService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.hjm.entity.HjmBxLog; -import com.gxwebsoft.hjm.param.HjmBxLogParam; - -import java.util.List; - -/** - * 黄家明_报险记录Service - * - * @author 科技小王子 - * @since 2025-06-06 13:08:29 - */ -public interface HjmBxLogService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HjmBxLogParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HjmBxLogParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return HjmBxLog - */ - HjmBxLog getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/HjmCarService.java b/src/main/java/com/gxwebsoft/hjm/service/HjmCarService.java deleted file mode 100644 index 9dd81c1..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/HjmCarService.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.hjm.entity.HjmCar; -import com.gxwebsoft.hjm.param.HjmCarParam; - -import java.util.List; - -/** - * 黄家明_车辆管理Service - * - * @author 科技小王子 - * @since 2025-04-14 16:43:26 - */ -public interface HjmCarService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HjmCarParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HjmCarParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return HjmCar - */ - HjmCar getByIdRel(Integer id); - - HjmCar getByGpsNo(String gpsNo); - - boolean updateByGpsNo(HjmCar byGpsNo); - - HjmCar getByCode(String code); - - /** - * 硬删除(物理删除),绕过 @TableLogic 逻辑删除。 - */ - boolean hardRemoveById(Integer id); - - /** - * 硬删除(物理删除),绕过 @TableLogic 逻辑删除。 - */ - boolean hardRemoveByIds(List ids); -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/HjmChoicesService.java b/src/main/java/com/gxwebsoft/hjm/service/HjmChoicesService.java deleted file mode 100644 index 1fb113d..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/HjmChoicesService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.hjm.entity.HjmChoices; -import com.gxwebsoft.hjm.param.HjmChoicesParam; - -import java.util.List; - -/** - * 黄家明_选择题选项Service - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -public interface HjmChoicesService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HjmChoicesParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HjmChoicesParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return HjmChoices - */ - HjmChoices getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/HjmCoursesService.java b/src/main/java/com/gxwebsoft/hjm/service/HjmCoursesService.java deleted file mode 100644 index 25b8984..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/HjmCoursesService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.hjm.entity.HjmCourses; -import com.gxwebsoft.hjm.param.HjmCoursesParam; - -import java.util.List; - -/** - * 黄家明_课程Service - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -public interface HjmCoursesService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HjmCoursesParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HjmCoursesParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return HjmCourses - */ - HjmCourses getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/HjmExamLogService.java b/src/main/java/com/gxwebsoft/hjm/service/HjmExamLogService.java deleted file mode 100644 index 6340bdb..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/HjmExamLogService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.hjm.entity.HjmExamLog; -import com.gxwebsoft.hjm.param.HjmExamLogParam; - -import java.util.List; - -/** - * 黄家明_学习记录Service - * - * @author 科技小王子 - * @since 2025-06-05 14:32:03 - */ -public interface HjmExamLogService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HjmExamLogParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HjmExamLogParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return HjmExamLog - */ - HjmExamLog getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/HjmFenceService.java b/src/main/java/com/gxwebsoft/hjm/service/HjmFenceService.java deleted file mode 100644 index 6b353ba..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/HjmFenceService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.hjm.entity.HjmFence; -import com.gxwebsoft.hjm.param.HjmFenceParam; - -import java.util.List; - -/** - * 黄家明_电子围栏Service - * - * @author 科技小王子 - * @since 2025-06-03 02:08:03 - */ -public interface HjmFenceService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HjmFenceParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HjmFenceParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return HjmFence - */ - HjmFence getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/HjmGpsLogService.java b/src/main/java/com/gxwebsoft/hjm/service/HjmGpsLogService.java deleted file mode 100644 index 04537d8..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/HjmGpsLogService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.hjm.entity.HjmGpsLog; -import com.gxwebsoft.hjm.param.HjmGpsLogParam; - -import java.util.List; - -/** - * 黄家明_gps轨迹Service - * - * @author 科技小王子 - * @since 2025-06-11 12:03:50 - */ -public interface HjmGpsLogService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HjmGpsLogParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HjmGpsLogParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return HjmGpsLog - */ - HjmGpsLog getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/HjmQuestionsService.java b/src/main/java/com/gxwebsoft/hjm/service/HjmQuestionsService.java deleted file mode 100644 index 442a252..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/HjmQuestionsService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.hjm.entity.HjmQuestions; -import com.gxwebsoft.hjm.param.HjmQuestionsParam; - -import java.util.List; - -/** - * 黄家明_题目Service - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -public interface HjmQuestionsService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HjmQuestionsParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HjmQuestionsParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return HjmQuestions - */ - HjmQuestions getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/HjmViolationService.java b/src/main/java/com/gxwebsoft/hjm/service/HjmViolationService.java deleted file mode 100644 index 731f8e8..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/HjmViolationService.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.hjm.entity.HjmViolation; -import com.gxwebsoft.hjm.param.HjmViolationParam; - -import java.util.List; - -/** - * 黄家明_违章记录Service - * - * @author 科技小王子 - * @since 2025-06-20 13:48:43 - */ -public interface HjmViolationService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HjmViolationParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HjmViolationParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return HjmViolation - */ - HjmViolation getByIdRel(Integer id); - - void send(HjmViolation hjmViolation); -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/MqttService.java b/src/main/java/com/gxwebsoft/hjm/service/MqttService.java deleted file mode 100644 index 7dba245..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/MqttService.java +++ /dev/null @@ -1,330 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import com.gxwebsoft.common.core.config.MqttProperties; -import org.eclipse.paho.client.mqttv3.*; -import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.annotation.Resource; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; - -/** - * MQTT服务类 - * - * @author 科技小王子 - * @since 2025-07-02 - */ -@Service -public class MqttService { - - private static final Logger logger = LoggerFactory.getLogger(MqttService.class); - - @Resource - private MqttProperties mqttProperties; - - @Resource - private GpsMessageCallback gpsMessageCallback; - - private MqttClient client; - private String clientId; - private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(); - - @PostConstruct - public void init() { - try { - logger.info("开始初始化MQTT服务..."); - - // 检查是否启用MQTT服务 - if (!mqttProperties.isEnabled()) { - logger.info("MQTT服务已禁用,跳过初始化"); - return; - } - - // 验证配置属性 - validateMqttProperties(); - - // 生成唯一的客户端ID - clientId = mqttProperties.getClientIdPrefix() + System.currentTimeMillis(); - logger.info("生成客户端ID: {}", clientId); - - // 连接MQTT服务器 - connect(); - - // 订阅主题 - subscribe(); - - // 启动连接状态监控 - startConnectionMonitor(); - - logger.info("MQTT服务初始化完成"); - - } catch (Exception e) { - logger.error("MQTT服务初始化失败", e); - // 不要抛出异常,避免影响应用启动 - // 可以在后台定期重试连接 - scheduleReconnect(); - } - } - - /** - * 验证MQTT配置属性 - */ - private void validateMqttProperties() { - if (mqttProperties == null) { - throw new IllegalArgumentException("MQTT配置属性为null,请检查配置文件和@EnableConfigurationProperties注解"); - } - - if (gpsMessageCallback == null) { - throw new IllegalArgumentException("GPS消息回调处理器为null,请检查@Component注解"); - } - - logger.info("MQTT配置验证:"); - logger.info(" Host: {}", mqttProperties.getHost()); - logger.info(" Username: {}", mqttProperties.getUsername()); - logger.info(" Password: {}", mqttProperties.getPassword() != null ? "***" : "null"); - logger.info(" ClientIdPrefix: {}", mqttProperties.getClientIdPrefix()); - logger.info(" Topic: {}", mqttProperties.getTopic()); - logger.info(" QoS: {}", mqttProperties.getQos()); - logger.info(" ConnectionTimeout: {}", mqttProperties.getConnectionTimeout()); - logger.info(" KeepAliveInterval: {}", mqttProperties.getKeepAliveInterval()); - logger.info(" AutoReconnect: {}", mqttProperties.isAutoReconnect()); - logger.info(" CleanSession: {}", mqttProperties.isCleanSession()); - - if (mqttProperties.getHost() == null || mqttProperties.getHost().trim().isEmpty()) { - throw new IllegalArgumentException("MQTT服务器地址不能为空"); - } - - if (mqttProperties.getClientIdPrefix() == null) { - throw new IllegalArgumentException("MQTT客户端ID前缀不能为空"); - } - - if (mqttProperties.getTopic() == null || mqttProperties.getTopic().trim().isEmpty()) { - throw new IllegalArgumentException("MQTT订阅主题不能为空"); - } - - logger.info("MQTT配置验证通过"); - } - - /** - * 连接MQTT服务器 - */ - private void connect() throws MqttException { - if (client != null && client.isConnected()) { - logger.debug("MQTT客户端已连接,跳过连接操作"); - return; - } - - logger.info("正在连接MQTT服务器: {}", mqttProperties.getHost()); - - // 创建MQTT客户端 - client = new MqttClient(mqttProperties.getHost(), clientId, new MemoryPersistence()); - - // 设置连接选项 - MqttConnectOptions options = createConnectOptions(); - - // 设置回调 - client.setCallback(gpsMessageCallback); - - // 连接服务器 - client.connect(options); - - logger.info("MQTT连接成功 - 服务器: {}, 客户端ID: {}", mqttProperties.getHost(), clientId); - } - - /** - * 创建连接选项 - */ - private MqttConnectOptions createConnectOptions() { - MqttConnectOptions options = new MqttConnectOptions(); - - // 基本连接参数 - options.setCleanSession(mqttProperties.isCleanSession()); - options.setUserName(mqttProperties.getUsername()); - options.setPassword(mqttProperties.getPassword().toCharArray()); - - // 超时和心跳设置 - options.setConnectionTimeout(mqttProperties.getConnectionTimeout()); - options.setKeepAliveInterval(mqttProperties.getKeepAliveInterval()); - - // 自动重连设置 - options.setAutomaticReconnect(mqttProperties.isAutoReconnect()); - - // 遗嘱消息设置(可选) - // options.setWill("client/disconnect", "Client disconnected".getBytes(), 1, false); - - logger.debug("MQTT连接选项配置完成 - 自动重连: {}, 清除会话: {}", - options.isAutomaticReconnect(), options.isCleanSession()); - - return options; - } - - /** - * 订阅主题 - */ - public void subscribe() throws MqttException { - if (client == null || !client.isConnected()) { - logger.warn("MQTT客户端未连接,无法订阅主题"); - return; - } - - String topic = mqttProperties.getTopic(); - int qos = mqttProperties.getQos(); - - client.subscribe(topic, qos); - logger.info("MQTT主题订阅成功 - 主题: {}, QoS: {}", topic, qos); - } - - /** - * 发布消息 - */ - public void publish(String topic, String payload) throws MqttException { - publish(topic, payload, mqttProperties.getQos(), false); - } - - /** - * 发布消息(指定QoS和保留标志) - */ - public void publish(String topic, String payload, int qos, boolean retained) throws MqttException { - if (client == null || !client.isConnected()) { - throw new MqttException(MqttException.REASON_CODE_CLIENT_NOT_CONNECTED); - } - - MqttMessage message = new MqttMessage(); - message.setPayload(payload.getBytes()); - message.setQos(qos); - message.setRetained(retained); - - client.publish(topic, message); - - logger.debug("MQTT消息发布 - 主题: {}, QoS: {}, 保留: {}, 消息长度: {}", - topic, qos, retained, payload.length()); - - // 可选:等待发布完成 - // token.waitForCompletion(); - } - - /** - * 检查连接状态 - */ - public boolean isConnected() { - return client != null && client.isConnected(); - } - - /** - * 获取客户端信息 - */ - public String getClientInfo() { - if (client == null) { - return "MQTT客户端未初始化"; - } - - return String.format("客户端ID: %s, 连接状态: %s, 服务器: %s", - clientId, - client.isConnected() ? "已连接" : "未连接", - mqttProperties.getHost()); - } - - /** - * 启动连接状态监控 - */ - private void startConnectionMonitor() { - scheduler.scheduleWithFixedDelay(() -> { - try { - if (!isConnected()) { - logger.warn("检测到MQTT连接断开,尝试重新连接..."); - reconnect(); - } - } catch (Exception e) { - logger.error("MQTT连接监控异常", e); - } - }, 30, 30, TimeUnit.SECONDS); // 每30秒检查一次连接状态 - - logger.debug("MQTT连接状态监控已启动"); - } - - /** - * 重新连接 - */ - public void reconnect() { - try { - if (client != null && client.isConnected()) { - return; - } - - logger.info("正在重新连接MQTT服务器..."); - - // 先断开现有连接 - disconnect(); - - // 重新连接 - connect(); - subscribe(); - - logger.info("MQTT重新连接成功"); - - } catch (Exception e) { - logger.error("MQTT重新连接失败", e); - // 安排下次重试 - scheduleReconnect(); - } - } - - /** - * 安排重新连接 - */ - private void scheduleReconnect() { - scheduler.schedule(() -> { - logger.info("执行定时重连任务..."); - reconnect(); - }, 60, TimeUnit.SECONDS); // 60秒后重试 - } - - /** - * 断开连接 - */ - public void disconnect() { - try { - if (client != null && client.isConnected()) { - client.disconnect(); - logger.info("MQTT连接已断开"); - } - } catch (MqttException e) { - logger.error("断开MQTT连接失败", e); - } - } - - /** - * 应用关闭时清理资源 - */ - @PreDestroy - public void destroy() { - logger.info("正在关闭MQTT服务..."); - - try { - // 关闭定时任务 - scheduler.shutdown(); - if (!scheduler.awaitTermination(5, TimeUnit.SECONDS)) { - scheduler.shutdownNow(); - } - - // 断开MQTT连接 - if (client != null) { - if (client.isConnected()) { - client.disconnect(); - } - client.close(); - } - - logger.info("MQTT服务已关闭"); - - } catch (Exception e) { - logger.error("关闭MQTT服务时发生错误", e); - } - } -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/WxNotificationService.java b/src/main/java/com/gxwebsoft/hjm/service/WxNotificationService.java deleted file mode 100644 index 42873a7..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/WxNotificationService.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.gxwebsoft.hjm.service; - -import com.gxwebsoft.hjm.dto.SubscribeMessageRequest; -import com.gxwebsoft.hjm.dto.TemplateMessageRequest; - -import java.util.List; - -/** - * 微信通知服务接口 - * - * @author 科技小王子 - * @since 2025-06-15 - */ -public interface WxNotificationService { - - /** - * 发送微信公众号模板消息 - * - * @param tenantId 租户ID - * @param request 模板消息请求 - * @return 发送结果 - */ - boolean sendTemplateMessage(Integer tenantId, TemplateMessageRequest request); - - /** - * 发送微信小程序订阅消息 - * - * @param tenantId 租户ID - * @param request 订阅消息请求 - * @return 发送结果 - */ - boolean sendSubscribeMessage(Integer tenantId, SubscribeMessageRequest request); - - /** - * 批量发送模板消息 - * - * @param tenantId 租户ID - * @param requests 模板消息请求列表 - * @return 发送结果统计 - */ - BatchSendResult batchSendTemplateMessage(Integer tenantId, List requests); - - /** - * 获取微信公众号模板列表 - * - * @param tenantId 租户ID - * @return 模板列表 - */ - String getTemplateList(Integer tenantId); - - /** - * 批量发送结果 - */ - class BatchSendResult { - private int successCount; - private int failCount; - private int totalCount; - - public BatchSendResult(int successCount, int failCount) { - this.successCount = successCount; - this.failCount = failCount; - this.totalCount = successCount + failCount; - } - - public int getSuccessCount() { - return successCount; - } - - public int getFailCount() { - return failCount; - } - - public int getTotalCount() { - return totalCount; - } - - @Override - public String toString() { - return String.format("总计:%d,成功:%d,失败:%d", totalCount, successCount, failCount); - } - } -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmBxLogServiceImpl.java b/src/main/java/com/gxwebsoft/hjm/service/impl/HjmBxLogServiceImpl.java deleted file mode 100644 index edae174..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmBxLogServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.hjm.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.hjm.mapper.HjmBxLogMapper; -import com.gxwebsoft.hjm.service.HjmBxLogService; -import com.gxwebsoft.hjm.entity.HjmBxLog; -import com.gxwebsoft.hjm.param.HjmBxLogParam; -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 科技小王子 - * @since 2025-06-06 13:08:29 - */ -@Service -public class HjmBxLogServiceImpl extends ServiceImpl implements HjmBxLogService { - - @Override - public PageResult pageRel(HjmBxLogParam 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(HjmBxLogParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public HjmBxLog getByIdRel(Integer id) { - HjmBxLogParam param = new HjmBxLogParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmCarServiceImpl.java b/src/main/java/com/gxwebsoft/hjm/service/impl/HjmCarServiceImpl.java deleted file mode 100644 index 0d6b1df..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmCarServiceImpl.java +++ /dev/null @@ -1,419 +0,0 @@ -package com.gxwebsoft.hjm.service.impl; - -import cn.hutool.core.date.DateUtil; -import com.alibaba.fastjson.support.geo.Point; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.hjm.entity.HjmFence; -import com.gxwebsoft.hjm.mapper.HjmCarMapper; -import com.gxwebsoft.hjm.service.HjmCarService; -import com.gxwebsoft.hjm.entity.HjmCar; -import com.gxwebsoft.hjm.param.HjmCarParam; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.hjm.service.HjmFenceService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; - -/** - * 黄家明_车辆管理Service实现 - * - * @author 科技小王子 - * @since 2025-04-14 16:43:26 - */ -@Service -public class HjmCarServiceImpl extends ServiceImpl implements HjmCarService { - @Resource - private HjmFenceService hjmFenceService; - @Autowired - private HjmCarService hjmCarService; - - - @Override - public PageResult pageRel(HjmCarParam 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(HjmCarParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public HjmCar getByIdRel(Integer id) { - HjmCarParam param = new HjmCarParam(); - param.setId(id); - final HjmCar hjmCar = param.getOne(baseMapper.selectListRel(param)); - hjmCar.setFence(hjmFenceService.getById(hjmCar.getFenceId())); - return hjmCar; - } - - @Override - public HjmCar getByGpsNo(String gpsNo) { - return baseMapper.getByGpsNo(gpsNo); - } - - @Override - public boolean updateByGpsNo(HjmCar byGpsNo) { - return baseMapper.updateByGpsNo(byGpsNo); - } - - @Override - public HjmCar getByCode(String code) { - final HjmCar byCode = baseMapper.getByCode(code); - - // 检查车辆是否存在 - if (byCode == null) { - return null; - } - - // 检查是否有围栏ID - if (byCode.getFenceId() == null) { - return byCode; - } - - final HjmFence fence = hjmFenceService.getById(byCode.getFenceId()); - byCode.setFence(fence); - - // 检查围栏是否存在 - if (fence == null) { - return byCode; - } - - // 检查车辆坐标是否有效 - if (byCode.getLongitude() == null || byCode.getLatitude() == null || - byCode.getLongitude().trim().isEmpty() || byCode.getLatitude().trim().isEmpty()) { - return byCode; - } - - try { - // 字符串转为浮点 - final double lng = Double.parseDouble(byCode.getLongitude()); - final double lat = Double.parseDouble(byCode.getLatitude()); - Point carPoint = new Point(); - carPoint.setLongitude(lng); - carPoint.setLatitude(lat); - - boolean isInFence = false; - - // 使用多边形围栏判断 - isInFence = checkPolygonFence(carPoint, fence); - - // 将围栏判断结果保存到车辆对象中 - byCode.setInFence(isInFence); - System.out.println("车辆 " + code + " 是否在围栏内: " + isInFence); - byCode.setUpdateTime(LocalDateTime.now()); - hjmCarService.updateById(byCode); - return byCode; - - } catch (NumberFormatException e) { - System.err.println("车辆坐标格式错误: " + e.getMessage()); - return byCode; - } catch (Exception e) { - System.err.println("判断围栏时发生错误: " + e.getMessage()); - e.printStackTrace(); - return byCode; - } - } - - @Override - public boolean hardRemoveById(Integer id) { - if (id == null) { - return false; - } - return baseMapper.hardDeleteById(id) > 0; - } - - @Override - public boolean hardRemoveByIds(List ids) { - if (ids == null || ids.isEmpty()) { - return false; - } - return baseMapper.hardDeleteBatchIds(ids) > 0; - } - - - - /** - * 判断点是否在多边形内 - * @param point 测试点 - * @param pts 多边形的点 - * @return boolean true:在多边形内, false:在多边形外 - * @throws - * @Title: IsPointInPoly - */ - public static boolean isInPolygon(Point point, List pts) { - - int N = pts.size(); - boolean boundOrVertex = true; - //交叉点数量 - int intersectCount = 0; - //浮点类型计算时候与0比较时候的容差 - double precision = 2e-10; - //临近顶点 - Point p1, p2; - //当前点 - Point p = point; - - p1 = pts.get(0); - for (int i = 1; i <= N; ++i) { - if (p.equals(p1)) { - return boundOrVertex; - } - - p2 = pts.get(i % N); - if (p.getLongitude() < Math.min(p1.getLongitude(), p2.getLongitude()) || p.getLongitude() > Math.max(p1.getLongitude(), p2.getLongitude())) { - p1 = p2; - continue; - } - - //射线穿过算法 - if (p.getLongitude() > Math.min(p1.getLongitude(), p2.getLongitude()) && p.getLongitude() < Math.max(p1.getLongitude(), p2.getLongitude())) { - if (p.getLatitude() <= Math.max(p1.getLatitude(), p2.getLatitude())) { - if (p1.getLongitude() == p2.getLongitude() && p.getLatitude() >= Math.min(p1.getLatitude(), p2.getLatitude())) { - return boundOrVertex; - } - - if (p1.getLatitude() == p2.getLatitude()) { - if (p1.getLatitude() == p.getLatitude()) { - return boundOrVertex; - } else { - ++intersectCount; - } - } else { - double xinters = (p.getLongitude() - p1.getLongitude()) * (p2.getLatitude() - p1.getLatitude()) / (p2.getLongitude() - p1.getLongitude()) + p1.getLatitude(); - if (Math.abs(p.getLatitude() - xinters) < precision) { - return boundOrVertex; - } - - if (p.getLatitude() < xinters) { - ++intersectCount; - } - } - } - } else { - if (p.getLongitude() == p2.getLongitude() && p.getLatitude() <= p2.getLatitude()) { - Point p3 = pts.get((i + 1) % N); - if (p.getLongitude() >= Math.min(p1.getLongitude(), p3.getLongitude()) && p.getLongitude() <= Math.max(p1.getLongitude(), p3.getLongitude())) { - ++intersectCount; - } else { - intersectCount += 2; - } - } - } - p1 = p2; - } - return intersectCount % 2 != 0; - } - - - - /** - * 检查点是否在多边形围栏内 - * @param carPoint 车辆位置点 - * @param fence 围栏信息 - * @return boolean true:在围栏内, false:在围栏外 - */ - public boolean checkPolygonFence(Point carPoint, HjmFence fence) { - if (fence.getPoints() == null || fence.getPoints().trim().isEmpty()) { - System.err.println("多边形围栏点数据为空"); - return false; - } - - try { - final String points = fence.getPoints(); - - // 支持多种分隔符格式:逗号、分号、空格等 - String[] coordinates = parseCoordinates(points); - - // 检查点数据是否为偶数(经度,纬度 成对出现) - if (coordinates.length % 2 != 0) { - System.err.println("多边形围栏点数据格式错误,应为偶数个数值。当前数据: " + points); - return false; - } - - List pts = new ArrayList<>(); - for (int i = 0; i < coordinates.length; i += 2) { - try { - Point point = new Point(); - double lng = Double.parseDouble(coordinates[i].trim()); - double lat = Double.parseDouble(coordinates[i + 1].trim()); - - // 验证坐标范围 - if (lng < -180 || lng > 180) { - System.err.println("经度超出有效范围[-180,180]: " + lng); - return false; - } - if (lat < -90 || lat > 90) { - System.err.println("纬度超出有效范围[-90,90]: " + lat); - return false; - } - - point.setLongitude(lng); - point.setLatitude(lat); - pts.add(point); - - System.out.println("解析坐标点 " + (i/2 + 1) + ": (" + lng + ", " + lat + ")"); - - } catch (NumberFormatException e) { - System.err.println("坐标解析失败,位置 " + (i/2 + 1) + ": [" + coordinates[i] + ", " + coordinates[i + 1] + "]"); - throw e; - } - } - - // 至少需要3个点才能构成多边形 - if (pts.size() < 3) { - System.err.println("多边形围栏至少需要3个点"); - return false; - } - - return isInPolygon(carPoint, pts); - - } catch (NumberFormatException e) { - System.err.println("多边形围栏点坐标格式错误: " + e.getMessage()); - return false; - } catch (Exception e) { - System.err.println("检查多边形围栏时发生错误: " + e.getMessage()); - e.printStackTrace(); - return false; - } - } - - /** - * 解析坐标字符串,支持多种分隔符格式 - * @param coordinatesStr 坐标字符串 - * @return 坐标数组 - */ - private String[] parseCoordinates(String coordinatesStr) { - if (coordinatesStr == null || coordinatesStr.trim().isEmpty()) { - return new String[0]; - } - - // 移除首尾空格 - String cleanStr = coordinatesStr.trim(); - System.out.println("原始坐标数据: " + cleanStr); - - // 检查是否是混合分隔符格式:纬度,经度;纬度,经度;... - if (cleanStr.contains(";") && cleanStr.contains(",")) { - System.out.println("检测到混合分隔符格式(分号分隔点,逗号分隔经纬度)"); - return parseMixedFormat(cleanStr); - } - - // 支持的单一分隔符格式 - String[] coordinates; - - if (cleanStr.contains(";")) { - // 使用分号分隔 - coordinates = cleanStr.split(";"); - System.out.println("使用分号分隔符解析坐标"); - } else if (cleanStr.contains(",")) { - // 使用逗号分隔 - coordinates = cleanStr.split(","); - System.out.println("使用逗号分隔符解析坐标"); - } else { - // 使用空格或制表符分隔 - coordinates = cleanStr.split("\\s+"); - System.out.println("使用空格分隔符解析坐标"); - } - - // 清理每个坐标值的空格 - for (int i = 0; i < coordinates.length; i++) { - coordinates[i] = coordinates[i].trim(); - } - - return coordinates; - } - - /** - * 解析混合分隔符格式:纬度,经度;纬度,经度;... - * @param coordinatesStr 坐标字符串 - * @return 坐标数组(按经度,纬度顺序) - */ - private String[] parseMixedFormat(String coordinatesStr) { - // 先按分号分隔得到各个坐标点 - String[] points = coordinatesStr.split(";"); - System.out.println("分解出 " + points.length + " 个坐标点"); - - // 创建结果数组,每个点有2个坐标值 - String[] coordinates = new String[points.length * 2]; - - for (int i = 0; i < points.length; i++) { - String point = points[i].trim(); - String[] latLng = point.split(","); - - if (latLng.length != 2) { - throw new IllegalArgumentException("坐标点格式错误: " + point + ",应为 '纬度,经度' 格式"); - } - - String lat = latLng[0].trim(); - String lng = latLng[1].trim(); - - // 注意:输入格式是纬度,经度,但我们需要按经度,纬度的顺序存储 - coordinates[i * 2] = lng; // 经度 - coordinates[i * 2 + 1] = lat; // 纬度 - - System.out.println("坐标点 " + (i + 1) + ": 纬度=" + lat + ", 经度=" + lng + " -> 存储为 (" + lng + ", " + lat + ")"); - } - - return coordinates; - } - - /** - * 通用的围栏判断方法(只支持多边形围栏) - * @param carPoint 车辆位置点 - * @param fence 围栏信息 - * @return boolean true:在围栏内, false:在围栏外 - */ - public boolean isPointInFence(Point carPoint, HjmFence fence) { - if (carPoint == null || fence == null) { - return false; - } - - // 只使用多边形围栏判断 - return checkPolygonFence(carPoint, fence); - } - - /** - * 测试坐标解析功能 - * @param coordinatesStr 坐标字符串 - */ - public void testCoordinateParsing(String coordinatesStr) { - System.out.println("=== 测试坐标解析 ==="); - System.out.println("输入: " + coordinatesStr); - - try { - String[] coordinates = parseCoordinates(coordinatesStr); - System.out.println("解析结果: " + java.util.Arrays.toString(coordinates)); - System.out.println("坐标点数量: " + coordinates.length / 2); - - if (coordinates.length % 2 == 0 && coordinates.length >= 6) { - System.out.println("格式验证: ✓ 通过"); - for (int i = 0; i < coordinates.length; i += 2) { - double lng = Double.parseDouble(coordinates[i].trim()); - double lat = Double.parseDouble(coordinates[i + 1].trim()); - System.out.println("最终坐标点 " + (i/2 + 1) + ": 经度=" + lng + ", 纬度=" + lat); - } - } else { - System.out.println("格式验证: ✗ 失败 - 需要至少3个点(6个数值),当前有 " + coordinates.length + " 个数值"); - } - } catch (Exception e) { - System.err.println("解析失败: " + e.getMessage()); - e.printStackTrace(); - } - System.out.println("=================="); - } - - - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmChoicesServiceImpl.java b/src/main/java/com/gxwebsoft/hjm/service/impl/HjmChoicesServiceImpl.java deleted file mode 100644 index b777b12..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmChoicesServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.hjm.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.hjm.mapper.HjmChoicesMapper; -import com.gxwebsoft.hjm.service.HjmChoicesService; -import com.gxwebsoft.hjm.entity.HjmChoices; -import com.gxwebsoft.hjm.param.HjmChoicesParam; -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 科技小王子 - * @since 2025-06-02 12:59:49 - */ -@Service -public class HjmChoicesServiceImpl extends ServiceImpl implements HjmChoicesService { - - @Override - public PageResult pageRel(HjmChoicesParam 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(HjmChoicesParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public HjmChoices getByIdRel(Integer id) { - HjmChoicesParam param = new HjmChoicesParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmCoursesServiceImpl.java b/src/main/java/com/gxwebsoft/hjm/service/impl/HjmCoursesServiceImpl.java deleted file mode 100644 index 78ff215..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmCoursesServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.hjm.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.hjm.mapper.HjmCoursesMapper; -import com.gxwebsoft.hjm.service.HjmCoursesService; -import com.gxwebsoft.hjm.entity.HjmCourses; -import com.gxwebsoft.hjm.param.HjmCoursesParam; -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 科技小王子 - * @since 2025-06-02 12:59:49 - */ -@Service -public class HjmCoursesServiceImpl extends ServiceImpl implements HjmCoursesService { - - @Override - public PageResult pageRel(HjmCoursesParam 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(HjmCoursesParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public HjmCourses getByIdRel(Integer id) { - HjmCoursesParam param = new HjmCoursesParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmExamLogServiceImpl.java b/src/main/java/com/gxwebsoft/hjm/service/impl/HjmExamLogServiceImpl.java deleted file mode 100644 index 3ae9dff..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmExamLogServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.hjm.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.hjm.mapper.HjmExamLogMapper; -import com.gxwebsoft.hjm.service.HjmExamLogService; -import com.gxwebsoft.hjm.entity.HjmExamLog; -import com.gxwebsoft.hjm.param.HjmExamLogParam; -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 科技小王子 - * @since 2025-06-05 14:32:03 - */ -@Service -public class HjmExamLogServiceImpl extends ServiceImpl implements HjmExamLogService { - - @Override - public PageResult pageRel(HjmExamLogParam 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(HjmExamLogParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public HjmExamLog getByIdRel(Integer id) { - HjmExamLogParam param = new HjmExamLogParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmFenceServiceImpl.java b/src/main/java/com/gxwebsoft/hjm/service/impl/HjmFenceServiceImpl.java deleted file mode 100644 index 4d71a3c..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmFenceServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.hjm.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.hjm.mapper.HjmFenceMapper; -import com.gxwebsoft.hjm.service.HjmFenceService; -import com.gxwebsoft.hjm.entity.HjmFence; -import com.gxwebsoft.hjm.param.HjmFenceParam; -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 科技小王子 - * @since 2025-06-03 02:08:03 - */ -@Service -public class HjmFenceServiceImpl extends ServiceImpl implements HjmFenceService { - - @Override - public PageResult pageRel(HjmFenceParam 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(HjmFenceParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public HjmFence getByIdRel(Integer id) { - HjmFenceParam param = new HjmFenceParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmGpsLogServiceImpl.java b/src/main/java/com/gxwebsoft/hjm/service/impl/HjmGpsLogServiceImpl.java deleted file mode 100644 index 641afb6..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmGpsLogServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.hjm.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.hjm.mapper.HjmGpsLogMapper; -import com.gxwebsoft.hjm.service.HjmGpsLogService; -import com.gxwebsoft.hjm.entity.HjmGpsLog; -import com.gxwebsoft.hjm.param.HjmGpsLogParam; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 黄家明_gps轨迹Service实现 - * - * @author 科技小王子 - * @since 2025-06-11 12:03:50 - */ -@Service -public class HjmGpsLogServiceImpl extends ServiceImpl implements HjmGpsLogService { - - @Override - public PageResult pageRel(HjmGpsLogParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(HjmGpsLogParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public HjmGpsLog getByIdRel(Integer id) { - HjmGpsLogParam param = new HjmGpsLogParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmQuestionsServiceImpl.java b/src/main/java/com/gxwebsoft/hjm/service/impl/HjmQuestionsServiceImpl.java deleted file mode 100644 index 50903af..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmQuestionsServiceImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.gxwebsoft.hjm.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.hjm.entity.HjmChoices; -import com.gxwebsoft.hjm.mapper.HjmQuestionsMapper; -import com.gxwebsoft.hjm.service.HjmChoicesService; -import com.gxwebsoft.hjm.service.HjmQuestionsService; -import com.gxwebsoft.hjm.entity.HjmQuestions; -import com.gxwebsoft.hjm.param.HjmQuestionsParam; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * 黄家明_题目Service实现 - * - * @author 科技小王子 - * @since 2025-06-02 12:59:49 - */ -@Service -public class HjmQuestionsServiceImpl extends ServiceImpl implements HjmQuestionsService { - @Resource - private HjmChoicesService hjmChoicesService; - - @Override - public PageResult pageRel(HjmQuestionsParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("sort_number asc, create_time desc"); - List list = baseMapper.selectPageRel(page, param); - final Set collectByIds = list.stream().map(HjmQuestions::getId).collect(Collectors.toSet()); - final List choices = hjmChoicesService.list(new LambdaQueryWrapper().in(HjmChoices::getQuestionId, collectByIds)); - final Map> collectByQuestionId = choices.stream().collect(Collectors.groupingBy(HjmChoices::getQuestionId)); - list.forEach(item -> { - final List choicesList = collectByQuestionId.get(item.getId()); - item.setChoicesList(choicesList); - }); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(HjmQuestionsParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public HjmQuestions getByIdRel(Integer id) { - HjmQuestionsParam param = new HjmQuestionsParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmViolationServiceImpl.java b/src/main/java/com/gxwebsoft/hjm/service/impl/HjmViolationServiceImpl.java deleted file mode 100644 index 7619672..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/impl/HjmViolationServiceImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.gxwebsoft.hjm.service.impl; - -import cn.hutool.core.util.ObjUtil; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.common.system.service.impl.UserServiceImpl; -import com.gxwebsoft.hjm.dto.TemplateMessageRequest; -import com.gxwebsoft.hjm.entity.HjmCar; -import com.gxwebsoft.hjm.entity.HjmViolation; -import com.gxwebsoft.hjm.mapper.HjmViolationMapper; -import com.gxwebsoft.hjm.param.HjmViolationParam; -import com.gxwebsoft.hjm.service.HjmCarService; -import com.gxwebsoft.hjm.service.HjmViolationService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.text.SimpleDateFormat; -import java.time.LocalDateTime; -import java.util.Date; -import java.util.HashMap; -import java.util.List; - -/** - * 黄家明_违章记录Service实现 - * - * @author 科技小王子 - * @since 2025-06-20 13:48:43 - */ -@Service -public class HjmViolationServiceImpl extends ServiceImpl implements HjmViolationService { - - @Resource - private HjmCarService hjmCarService; - @Resource - private WxNotificationServiceImpl wxNotificationService; - @Resource - private UserServiceImpl userService; - - @Override - public PageResult pageRel(HjmViolationParam 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(HjmViolationParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public HjmViolation getByIdRel(Integer id) { - HjmViolationParam param = new HjmViolationParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - - @Override - public void send(HjmViolation hjmViolation) { - final HjmCar item = hjmCarService.getByCode(hjmViolation.getCode()); - - // 获取所有的邮政协会/管局工作人员 - final List users = userService.listByAlert(); - if (ObjUtil.isEmpty(item)) { - return; - } - users.forEach(d -> { - item.setToUser(d.getOfficeOpenid()); - item.setAppId("wxd2723d1afd9c4553"); - sendTemplateMessage(item, hjmViolation); - }); - - } - - public void sendTemplateMessage(HjmCar item, HjmViolation violation) { - // 发送模板消息 - final TemplateMessageRequest templateMessageRequest = new TemplateMessageRequest(); - templateMessageRequest.setToUser(item.getToUser()); - templateMessageRequest.setTemplateId("gZshS5yJs47BhIFodo9yenZcmsVwJOCKkL-SYaZTioU"); - final TemplateMessageRequest.MiniProgram miniProgram = new TemplateMessageRequest.MiniProgram(); - miniProgram.setAppid(item.getAppId()); - miniProgram.setPagepath("hjm/violation/detail?id=".concat(item.getCode())); -// miniProgram.setPagepath("hjm/query?id=".concat(item.getCode())); - templateMessageRequest.setMiniprogram(miniProgram); - HashMap map = new HashMap<>(); - map.put("thing7", new TemplateMessageRequest.TemplateDataItem(item.getDriverName())); - map.put("phone_number8", new TemplateMessageRequest.TemplateDataItem(item.getDriverPhone())); - map.put("const4", new TemplateMessageRequest.TemplateDataItem("违章")); - map.put("car_number1", new TemplateMessageRequest.TemplateDataItem(item.getCode())); - // 获取当前时间,格式2024年1月1号 10:20 - map.put("time2", new TemplateMessageRequest.TemplateDataItem( - new SimpleDateFormat("yyyy年M月d日 HH:mm").format(new Date()), "#173177") - ); - System.out.println("map = " + map); - templateMessageRequest.setData(map); - boolean success = wxNotificationService.sendTemplateMessage(10519, templateMessageRequest); - System.out.println("2向 = " + item.getDriverName() + "发送消息成功:" + success); - } - -} diff --git a/src/main/java/com/gxwebsoft/hjm/service/impl/WxNotificationServiceImpl.java b/src/main/java/com/gxwebsoft/hjm/service/impl/WxNotificationServiceImpl.java deleted file mode 100644 index 4ab0c66..0000000 --- a/src/main/java/com/gxwebsoft/hjm/service/impl/WxNotificationServiceImpl.java +++ /dev/null @@ -1,289 +0,0 @@ -package com.gxwebsoft.hjm.service.impl; - -import cn.hutool.core.util.CharsetUtil; -import cn.hutool.http.HttpUtil; -import com.alibaba.fastjson.JSONObject; -import com.gxwebsoft.cms.entity.CmsWebsiteField; -import com.gxwebsoft.cms.service.CmsWebsiteFieldService; -import com.gxwebsoft.common.core.utils.WxOfficialUtil; -import com.gxwebsoft.common.system.entity.Setting; -import com.gxwebsoft.common.system.service.SettingService; -import com.gxwebsoft.hjm.dto.SubscribeMessageRequest; -import com.gxwebsoft.hjm.dto.SubscribeMessageRequest.SubscribeDataItem; -import com.gxwebsoft.hjm.dto.TemplateMessageRequest; -import com.gxwebsoft.hjm.dto.TemplateMessageRequest.TemplateDataItem; -import com.gxwebsoft.hjm.service.WxNotificationService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -/** - * 微信通知服务实现 - * - * @author 科技小王子 - * @since 2025-06-15 - */ -@Slf4j -@Service -public class WxNotificationServiceImpl implements WxNotificationService { - - @Resource - private SettingService settingService; - - @Resource - private WxOfficialUtil wxOfficialUtil; - - @Resource - private StringRedisTemplate stringRedisTemplate; - - @Resource - private CmsWebsiteFieldService cmsWebsiteFieldService; - - @Override - public boolean sendTemplateMessage(Integer tenantId, TemplateMessageRequest request) { - try { - String accessToken = getWxAccessToken(tenantId); - System.out.println("发送模板消息 accessToken = " + accessToken); - return sendWxTemplateMessage(accessToken, request); - } catch (Exception e) { - log.error("发送模板消息失败", e); - return false; - } - } - - @Override - public boolean sendSubscribeMessage(Integer tenantId, SubscribeMessageRequest request) { - try { - String accessToken = getWxAccessToken(tenantId); - return sendWxSubscribeMessage(accessToken, request); - } catch (Exception e) { - log.error("发送订阅消息失败", e); - return false; - } - } - - @Override - public BatchSendResult batchSendTemplateMessage(Integer tenantId, List requests) { - int successCount = 0; - int failCount = 0; - - try { - String accessToken = getWxAccessToken(tenantId); - - for (TemplateMessageRequest request : requests) { - boolean success = sendWxTemplateMessage(accessToken, request); - if (success) { - successCount++; - } else { - failCount++; - } - - // 避免频率限制,每次发送间隔100ms - Thread.sleep(100); - } - } catch (Exception e) { - log.error("批量发送模板消息失败", e); - failCount += (requests.size() - successCount - failCount); - } - - return new BatchSendResult(successCount, failCount); - } - - @Override - public String getTemplateList(Integer tenantId) { - try { - String accessToken = getWxAccessToken(tenantId); - String url = "https://api.weixin.qq.com/cgi-bin/template/get_all_private_template?access_token=" + accessToken; - - String response = HttpUtil.get(url, CharsetUtil.CHARSET_UTF_8); - return response; - } catch (Exception e) { - log.error("获取模板列表失败", e); - return null; - } - } - - /** - * 获取微信公众号Access Token - */ - private String getWxAccessToken(Integer tenantId) { - String cacheKey = "wx_official_access_token:" + tenantId; - - // 先从缓存获取,支持JSON格式 - String cachedValue = stringRedisTemplate.opsForValue().get(cacheKey); - if (cachedValue != null) { - try { - // 尝试解析JSON格式的缓存 - JSONObject cachedJson = JSONObject.parseObject(cachedValue); - String accessToken = cachedJson.getString("access_token"); - if (accessToken != null) { - System.out.println("从缓存获取到微信公众号access_token: " + accessToken.substring(0, Math.min(10, accessToken.length())) + "..."); - return accessToken; - } - } catch (Exception e) { - // 如果解析失败,可能是旧格式的纯字符串token - System.out.println("微信公众号缓存token格式异常,使用原值: " + e.getMessage()); - return cachedValue; - } - } - - // 缓存中没有,重新获取 - try { - // 获取微信公众号配置 - String appId = "wx100365d412078b8c"; - String appSecret = "bba73c9fc8f5f7d0edc4de50786a8c62"; - - if (appId == null || appSecret == null) { - throw new RuntimeException("微信公众号配置不完整"); - } - - final CmsWebsiteField officialAppId = cmsWebsiteFieldService.getByCodeRel("OfficialAppId"); - final CmsWebsiteField officialAppSecret = cmsWebsiteFieldService.getByCodeRel("OfficialAppSecret"); - - System.out.println("officialAppSecret = " + officialAppSecret); - System.out.println("officialAppId = " + officialAppId); - - if(officialAppId != null){ - appId = officialAppId.getValue(); - } - if(officialAppSecret != null){ - appSecret = officialAppSecret.getValue(); - } - - // 调用微信API获取access_token - String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" - + appId + "&secret=" + appSecret; - - System.out.println("调用微信公众号API获取token - 租户ID: " + tenantId); - String response = HttpUtil.get(url, CharsetUtil.CHARSET_UTF_8); - System.out.println("微信公众号API响应: " + response); - JSONObject jsonObject = JSONObject.parseObject(response); - - String accessToken = jsonObject.getString("access_token"); - Integer expiresIn = jsonObject.getInteger("expires_in"); - - if (accessToken == null) { - String errorMsg = jsonObject.getString("errmsg"); - throw new RuntimeException("获取access_token失败: " + errorMsg); - } - - // 缓存完整的JSON响应,与其他方法保持一致 - int cacheSeconds = expiresIn != null ? expiresIn - 300 : 7200 - 300; - stringRedisTemplate.opsForValue().set(cacheKey, response, cacheSeconds, TimeUnit.SECONDS); - - System.out.println("获取微信公众号access_token成功,租户ID: " + tenantId); - return accessToken; - - } catch (Exception e) { - log.error("获取微信公众号access_token失败", e); - throw new RuntimeException("获取access_token失败: " + e.getMessage()); - } - } - - /** - * 发送微信模板消息 - */ - private boolean sendWxTemplateMessage(String accessToken, TemplateMessageRequest request) { - try { - String url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + accessToken; - - // 构建请求数据 - JSONObject data = new JSONObject(); - data.put("touser", request.getToUser()); - data.put("template_id", request.getTemplateId()); - data.put("url", request.getUrl()); - data.put("topcolor", request.getTopColor()); - - // 构建模板数据 - JSONObject templateData = new JSONObject(); - if (request.getData() != null) { - for (Map.Entry entry : request.getData().entrySet()) { - JSONObject item = new JSONObject(); - item.put("value", entry.getValue().getValue()); - item.put("color", entry.getValue().getColor()); - templateData.put(entry.getKey(), item); - } - } - data.put("data", templateData); - - // 小程序跳转 - if (request.getMiniprogram() != null) { - JSONObject miniprogram = new JSONObject(); - miniprogram.put("appid", request.getMiniprogram().getAppid()); - miniprogram.put("pagepath", request.getMiniprogram().getPagepath()); - data.put("miniprogram", miniprogram); - } - - // 发送请求 - String response = HttpUtil.post(url, data.toJSONString()); - JSONObject result = JSONObject.parseObject(response); - - Integer errcode = result.getInteger("errcode"); - String errmsg = result.getString("errmsg"); - - if (errcode != null && errcode == 0) { - log.info("模板消息发送成功: {}", result.getString("msgid")); - return true; - } else { - log.error("模板消息发送失败: errcode={}, errmsg={}", errcode, errmsg); - return false; - } - - } catch (Exception e) { - log.error("发送微信模板消息异常", e); - return false; - } - } - - /** - * 发送微信订阅消息 - */ - private boolean sendWxSubscribeMessage(String accessToken, SubscribeMessageRequest request) { - try { - String url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + accessToken; - - // 构建请求数据 - JSONObject data = new JSONObject(); - data.put("touser", request.getToUser()); - data.put("template_id", request.getTemplateId()); - data.put("page", request.getPage()); - data.put("miniprogram_state", request.getMiniprogramState()); - data.put("lang", request.getLang()); - - // 构建订阅消息数据 - JSONObject subscribeData = new JSONObject(); - if (request.getData() != null) { - for (Map.Entry entry : request.getData().entrySet()) { - JSONObject item = new JSONObject(); - item.put("value", entry.getValue().getValue()); - subscribeData.put(entry.getKey(), item); - } - } - data.put("data", subscribeData); - - // 发送请求 - String response = HttpUtil.post(url, data.toJSONString()); - JSONObject result = JSONObject.parseObject(response); - - Integer errcode = result.getInteger("errcode"); - String errmsg = result.getString("errmsg"); - - if (errcode != null && errcode == 0) { - log.info("订阅消息发送成功"); - return true; - } else { - log.error("订阅消息发送失败: errcode={}, errmsg={}", errcode, errmsg); - return false; - } - - } catch (Exception e) { - log.error("发送微信订阅消息异常", e); - return false; - } - } -} diff --git a/src/main/java/com/gxwebsoft/hjm/task/PushHjmFenceOutController.java b/src/main/java/com/gxwebsoft/hjm/task/PushHjmFenceOutController.java deleted file mode 100644 index b31737e..0000000 --- a/src/main/java/com/gxwebsoft/hjm/task/PushHjmFenceOutController.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.gxwebsoft.hjm.task; - -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.common.system.service.UserService; -import com.gxwebsoft.hjm.dto.TemplateMessageRequest; -import com.gxwebsoft.hjm.entity.HjmCar; -import com.gxwebsoft.hjm.service.HjmCarService; -import com.gxwebsoft.hjm.service.WxNotificationService; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import java.text.SimpleDateFormat; -import java.util.HashMap; -import java.util.List; - -/** - * 定时任务 - * - * @author 科技小王子 - * @since 2022-12-15 19:11:07 - */ -@Tag(name = "定时任务") -@RestController -@RequestMapping("/api/hjm/scheduling") -public class PushHjmFenceOutController extends BaseController { - @Resource - private HjmCarService hjmCarService; - @Resource - private UserService userService; - @Resource - private WxNotificationService wxNotificationService; - @Value("${spring.profiles.active}") - String active; - - /** - * 定时推送订阅消息 - * @Scheduled(fixedDelay = 2000, initialDelay = 2000) - * @Scheduled(cron = "0 0 9 * * ?") - */ -// @Scheduled(cron = "0 0/10 * * * ?") - public void index() { - final List list = hjmCarService.list(new LambdaQueryWrapper() - .eq(HjmCar::getStatus, 1) - .eq(HjmCar::getDeleted, 0) - .eq(HjmCar::getInFence, false) - ); - - // 开发环境 - if (active.equals("dev")){ - return; - } - - // 获取所有的邮政协会/管局工作人员 - final List users = userService.listByAlert(); - - list.forEach(item -> { - // 执行推送 - users.forEach(d -> { - if(StrUtil.isNotBlank(d.getOfficeOpenid())){ - item.setToUser(d.getOfficeOpenid()); - item.setAppId("wxd2723d1afd9c4553"); - sendTemplateMessage(item); - } - }); - }); - } - - public void sendTemplateMessage(HjmCar item) { - // 发送模板消息 - final TemplateMessageRequest templateMessageRequest = new TemplateMessageRequest(); - templateMessageRequest.setToUser(item.getToUser()); - templateMessageRequest.setTemplateId("oMckHaNgNT-ivInYF5DtCcqyd9O-i1hP_G0jQALsx54"); -// templateMessageRequest.setUrl("https://mp.websoft.top"); - final TemplateMessageRequest.MiniProgram miniProgram = new TemplateMessageRequest.MiniProgram(); - miniProgram.setAppid(item.getAppId()); - miniProgram.setPagepath("hjm/query?id=".concat(item.getCode())); - templateMessageRequest.setMiniprogram(miniProgram); - HashMap map = new HashMap<>(); - map.put("phrase6", new TemplateMessageRequest.TemplateDataItem(item.getDriverName())); - map.put("time4", new TemplateMessageRequest.TemplateDataItem( - new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(item.getCreateTime()), "#173177")); - map.put("phrase7", new TemplateMessageRequest.TemplateDataItem("离开围栏")); - map.put("thing11", new TemplateMessageRequest.TemplateDataItem(item.getFenceName())); - map.put("car_number12", new TemplateMessageRequest.TemplateDataItem(item.getCode())); - templateMessageRequest.setData(map); - boolean success = wxNotificationService.sendTemplateMessage(10519, templateMessageRequest); - System.out.println("向 = " + item.getDriverName() + "发送消息成功:" + success); - } - -} diff --git a/src/main/java/com/gxwebsoft/house/controller/HouseInfoController.java b/src/main/java/com/gxwebsoft/house/controller/HouseInfoController.java deleted file mode 100644 index 05a4758..0000000 --- a/src/main/java/com/gxwebsoft/house/controller/HouseInfoController.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.gxwebsoft.house.controller; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.gxwebsoft.bszx.entity.BszxBm; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.house.entity.HouseLikeLog; -import com.gxwebsoft.house.entity.HouseViewsLog; -import com.gxwebsoft.house.service.HouseInfoService; -import com.gxwebsoft.house.entity.HouseInfo; -import com.gxwebsoft.house.param.HouseInfoParam; -import com.gxwebsoft.house.util.SortSceneUtil; -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 com.gxwebsoft.house.service.HouseLikeLogService; -import com.gxwebsoft.house.service.HouseViewsLogService; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 房源信息表控制器 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:14 - */ -@Tag(name = "房源信息表管理") -@RestController -@RequestMapping("/api/house/house-info") -public class HouseInfoController extends BaseController { - @Resource - private HouseInfoService houseInfoService; - @Resource - private HouseLikeLogService houseLikeLogService; - @Resource - private HouseViewsLogService houseViewsLogService; - - @Operation(summary = "分页查询房源信息表") - @GetMapping("/page") - public ApiResult> page(HouseInfoParam param) { - // 标准化排序参数,解决URL编码问题 - if (param.getSortScene() != null) { - String normalizedSortScene = SortSceneUtil.normalizeSortScene(param.getSortScene()); - param.setSortScene(normalizedSortScene); - } - - // 使用关联查询 - return success(houseInfoService.pageRel(param)); - } - - - @PreAuthorize("hasAuthority('house:houseInfo:list')") - @Operation(summary = "查询全部房源信息表") - @GetMapping() - public ApiResult> list(HouseInfoParam param) { - // 使用关联查询 - return success(houseInfoService.listRel(param)); - } - - @Operation(summary = "根据id查询房源信息表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - HouseInfo byIdRel = houseInfoService.getByIdRel(id); - Integer loginUserId = getLoginUserId(); - if(loginUserId != null) { - // 是否喜欢 - HouseLikeLog log = houseLikeLogService.getByIdRel(id, loginUserId); - byIdRel.setLiked(log != null); - // 添加浏览记录 - houseViewsLogService.add(byIdRel, loginUserId); - } - // 使用关联查询 - return success(byIdRel); - } - - @PreAuthorize("hasAuthority('house:houseInfo:save')") - @Operation(summary = "添加房源信息表") - @PostMapping() - public ApiResult save(@RequestBody HouseInfo houseInfo) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - houseInfo.setUserId(loginUser.getUserId()); - } - if (houseInfoService.save(houseInfo)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('house:houseInfo:update')") - @Operation(summary = "修改房源信息表") - @PutMapping() - public ApiResult update(@RequestBody HouseInfo houseInfo) { - if (houseInfoService.updateById(houseInfo)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('house:houseInfo:remove')") - @Operation(summary = "删除房源信息表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (houseInfoService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('house:houseInfo:save')") - @Operation(summary = "批量添加房源信息表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (houseInfoService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('house:houseInfo:update')") - @Operation(summary = "批量修改房源信息表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(houseInfoService, "house_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('house:houseInfo:remove')") - @Operation(summary = "批量删除房源信息表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (houseInfoService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "获取海报地址") - @GetMapping("/generatePoster/{id}") - public ApiResult generatePoster(@PathVariable("id") Integer id) throws Exception { - final HouseInfo houseInfo = houseInfoService.getOne(new LambdaQueryWrapper().eq(HouseInfo::getHouseId, id).last("limit 1")); - return success("生成房源海报",houseInfoService.generatePoster(houseInfo)); - } - -} diff --git a/src/main/java/com/gxwebsoft/house/controller/HouseLikeLogController.java b/src/main/java/com/gxwebsoft/house/controller/HouseLikeLogController.java deleted file mode 100644 index 44b045d..0000000 --- a/src/main/java/com/gxwebsoft/house/controller/HouseLikeLogController.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.gxwebsoft.house.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.house.service.HouseLikeLogService; -import com.gxwebsoft.house.entity.HouseLikeLog; -import com.gxwebsoft.house.param.HouseLikeLogParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 房源点赞表控制器 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:14 - */ -@Tag(name = "房源点赞表管理") -@RestController -@RequestMapping("/api/house/house-like-log") -public class HouseLikeLogController extends BaseController { - @Resource - private HouseLikeLogService houseLikeLogService; - - @Operation(summary = "分页查询房源点赞表") - @GetMapping("/page") - public ApiResult> page(HouseLikeLogParam param) { - // 使用关联查询 - return success(houseLikeLogService.pageRel(param)); - } - - @Operation(summary = "查询全部房源点赞表") - @GetMapping() - public ApiResult> list(HouseLikeLogParam param) { - // 使用关联查询 - return success(houseLikeLogService.listRel(param)); - } - - @PreAuthorize("hasAuthority('house:houseLikeLog:list')") - @Operation(summary = "根据id查询房源点赞表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(houseLikeLogService.getById(id)); - } - - @Operation(summary = "添加房源点赞表") - @PostMapping() - public ApiResult save(@RequestBody HouseLikeLog houseLikeLog) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - houseLikeLog.setUserId(loginUser.getUserId()); - } - if (houseLikeLogService.save(houseLikeLog)) { - return success("添加成功"); - } - return fail("添加失败"); - } - @PreAuthorize("hasAuthority('house:houseLikeLog:update')") - @Operation(summary = "修改房源点赞表") - @PutMapping() - public ApiResult update(@RequestBody HouseLikeLog houseLikeLog) { - if (houseLikeLogService.updateById(houseLikeLog)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('house:houseLikeLog:remove')") - @Operation(summary = "删除房源点赞表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (houseLikeLogService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('house:houseLikeLog:save')") - @Operation(summary = "批量添加房源点赞表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (houseLikeLogService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('house:houseLikeLog:update')") - @Operation(summary = "批量修改房源点赞表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(houseLikeLogService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('house:houseLikeLog:remove')") - @Operation(summary = "批量删除房源点赞表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (houseLikeLogService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/house/controller/HouseReservationController.java b/src/main/java/com/gxwebsoft/house/controller/HouseReservationController.java deleted file mode 100644 index 941dae7..0000000 --- a/src/main/java/com/gxwebsoft/house/controller/HouseReservationController.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.gxwebsoft.house.controller; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.house.service.HouseReservationService; -import com.gxwebsoft.house.entity.HouseReservation; -import com.gxwebsoft.house.param.HouseReservationParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 预约记录表控制器 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:15 - */ -@Tag(name = "预约记录表管理") -@RestController -@RequestMapping("/api/house/house-reservation") -public class HouseReservationController extends BaseController { - @Resource - private HouseReservationService houseReservationService; - - @Operation(summary = "分页查询预约记录表") - @GetMapping("/page") - public ApiResult> page(HouseReservationParam param) { - // 使用关联查询 - return success(houseReservationService.pageRel(param)); - } - - @Operation(summary = "查询全部预约记录表") - @GetMapping() - public ApiResult> list(HouseReservationParam param) { - // 使用关联查询 - return success(houseReservationService.listRel(param)); - } - - @PreAuthorize("hasAuthority('house:houseReservation:list')") - @Operation(summary = "根据id查询预约记录表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(houseReservationService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('house:houseReservation:save')") - @Operation(summary = "添加预约记录表") - @PostMapping() - public ApiResult save(@RequestBody HouseReservation houseReservation) { -// 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - houseReservation.setUserId(loginUser.getUserId()); - } - if (houseReservationService.count(new LambdaQueryWrapper().eq(HouseReservation::getHouseId,houseReservation.getHouseId()).eq(HouseReservation::getUserId,loginUser.getUserId()).eq(HouseReservation::getStatus,0)) > 0){ - return fail("请勿重复提交"); - } - if (houseReservationService.save(houseReservation)) { - return success("提交成功"); - } - return fail("提交失败"); - } - - @PreAuthorize("hasAuthority('house:houseReservation:update')") - @Operation(summary = "修改预约记录表") - @PutMapping() - public ApiResult update(@RequestBody HouseReservation houseReservation) { - if (houseReservationService.updateById(houseReservation)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('house:houseReservation:remove')") - @Operation(summary = "删除预约记录表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (houseReservationService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('house:houseReservation:save')") - @Operation(summary = "批量添加预约记录表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (houseReservationService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('house:houseReservation:update')") - @Operation(summary = "批量修改预约记录表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(houseReservationService, "log_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('house:houseReservation:remove')") - @Operation(summary = "批量删除预约记录表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (houseReservationService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/house/controller/HouseUserController.java b/src/main/java/com/gxwebsoft/house/controller/HouseUserController.java deleted file mode 100644 index 9a4efa1..0000000 --- a/src/main/java/com/gxwebsoft/house/controller/HouseUserController.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.gxwebsoft.house.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.house.service.HouseUserService; -import com.gxwebsoft.house.entity.HouseUser; -import com.gxwebsoft.house.param.HouseUserParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 用户表控制器 - * - * @author 科技小王子 - * @since 2025-03-05 15:13:05 - */ -@Tag(name = "用户表管理") -@RestController -@RequestMapping("/api/house/house-user") -public class HouseUserController extends BaseController { - @Resource - private HouseUserService houseUserService; - - @Operation(summary = "分页查询用户表") - @GetMapping("/page") - public ApiResult> page(HouseUserParam param) { - // 使用关联查询 - return success(houseUserService.pageRel(param)); - } - - @Operation(summary = "查询全部用户表") - @GetMapping() - public ApiResult> list(HouseUserParam param) { - // 使用关联查询 - return success(houseUserService.listRel(param)); - } - - @PreAuthorize("hasAuthority('house:houseUser:list')") - @Operation(summary = "根据id查询用户表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(houseUserService.getByIdRel(id)); - } - - @Operation(summary = "添加用户表") - @PostMapping() - public ApiResult save(@RequestBody HouseUser houseUser) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - houseUser.setUserId(loginUser.getUserId()); - } - if (houseUserService.save(houseUser)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改用户表") - @PutMapping() - public ApiResult update(@RequestBody HouseUser houseUser) { - if (houseUserService.updateById(houseUser)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除用户表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (houseUserService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加用户表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (houseUserService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改用户表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(houseUserService, "user_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除用户表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (houseUserService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/house/controller/HouseViewsLogController.java b/src/main/java/com/gxwebsoft/house/controller/HouseViewsLogController.java deleted file mode 100644 index dc3b3a4..0000000 --- a/src/main/java/com/gxwebsoft/house/controller/HouseViewsLogController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.gxwebsoft.house.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.house.service.HouseViewsLogService; -import com.gxwebsoft.house.entity.HouseViewsLog; -import com.gxwebsoft.house.param.HouseViewsLogParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 看房记录表控制器 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:15 - */ -@Tag(name = "看房记录表管理") -@RestController -@RequestMapping("/api/house/house-views-log") -public class HouseViewsLogController extends BaseController { - @Resource - private HouseViewsLogService houseViewsLogService; - - @Operation(summary = "分页查询看房记录表") - @GetMapping("/page") - public ApiResult> page(HouseViewsLogParam param) { - // 使用关联查询 - return success(houseViewsLogService.pageRel(param)); - } - - @Operation(summary = "查询全部看房记录表") - @GetMapping() - public ApiResult> list(HouseViewsLogParam param) { - // 使用关联查询 - return success(houseViewsLogService.listRel(param)); - } - - @Operation(summary = "根据id查询看房记录表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(houseViewsLogService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('house:houseViewsLog:save')") - @Operation(summary = "添加看房记录表") - @PostMapping() - public ApiResult save(@RequestBody HouseViewsLog houseViewsLog) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - houseViewsLog.setUserId(loginUser.getUserId()); - } - if (houseViewsLogService.save(houseViewsLog)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('house:houseViewsLog:update')") - @Operation(summary = "修改看房记录表") - @PutMapping() - public ApiResult update(@RequestBody HouseViewsLog houseViewsLog) { - if (houseViewsLogService.updateById(houseViewsLog)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('house:houseViewsLog:remove')") - @Operation(summary = "删除看房记录表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (houseViewsLogService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('house:houseViewsLog:save')") - @Operation(summary = "批量添加看房记录表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (houseViewsLogService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('house:houseViewsLog:update')") - @Operation(summary = "批量修改看房记录表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(houseViewsLogService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('house:houseViewsLog:remove')") - @Operation(summary = "批量删除看房记录表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (houseViewsLogService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/house/entity/HouseFile.java b/src/main/java/com/gxwebsoft/house/entity/HouseFile.java deleted file mode 100644 index e277c19..0000000 --- a/src/main/java/com/gxwebsoft/house/entity/HouseFile.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.house.entity; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.util.List; - -/** - * 看房记录表 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:15 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HouseFiles对象", description = "房源图片") -public class HouseFile implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "文件大小") - private Integer size; - - @Schema(description = "图片类型") - private String type; - - @Schema(description = "图片链接") - private String url; - - @Schema(description = "状态") - private String status; - - @Schema(description = "描述") - private String message; -} diff --git a/src/main/java/com/gxwebsoft/house/entity/HouseFiles.java b/src/main/java/com/gxwebsoft/house/entity/HouseFiles.java deleted file mode 100644 index 9a67e0e..0000000 --- a/src/main/java/com/gxwebsoft/house/entity/HouseFiles.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.gxwebsoft.house.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 看房记录表 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:15 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HouseFiles对象", description = "房源图片") -public class HouseFiles implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "文件列表") - private List files; -} diff --git a/src/main/java/com/gxwebsoft/house/entity/HouseInfo.java b/src/main/java/com/gxwebsoft/house/entity/HouseInfo.java deleted file mode 100644 index d26ea14..0000000 --- a/src/main/java/com/gxwebsoft/house/entity/HouseInfo.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.gxwebsoft.house.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 房源信息表 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HouseInfo对象", description = "房源信息表") -public class HouseInfo implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "house_id", type = IdType.AUTO) - private Integer houseId; - - @Schema(description = "房源标题") - private String houseTitle; - - @Schema(description = "房源类型") - private Integer type; - - @Schema(description = "房产所在的城市") - private String cityByHouse; - - @Schema(description = "户型") - private String houseType; - - @Schema(description = "租赁方式") - private String leaseMethod; - - @Schema(description = "租金") - private BigDecimal rent; - - @Schema(description = "租金单位") - private String rentUnit; - - @Schema(description = "月租金") - private BigDecimal monthlyRent; - - @Schema(description = "租金单位") - private String monthlyRentUnit; - - @Schema(description = "佣金") - private BigDecimal commission; - - @Schema(description = "物业费") - private BigDecimal propertyFees; - - @Schema(description = "面积") - private String extent; - - @Schema(description = "面积") - private String extentUnit; - - @Schema(description = "楼层") - private String floor; - - @Schema(description = "卖价") - private String salePrice; - - @Schema(description = "总价") - private String totalPrice; - - @Schema(description = "房号") - private String roomNumber; - - @Schema(description = "真实姓名") - private String realName; - - @Schema(description = "联系电话") - private String phone; - - @Schema(description = "进入房屋的密码") - private String password; - - @Schema(description = "房屋朝向") - private String toward; - - @Schema(description = "房屋标签") - private String houseLabel; - - @Schema(description = "办公室配套") - private String supporting; - - @Schema(description = "产权信息") - private String property; - - @Schema(description = "房源视频") - private String videoUrl; - - @Schema(description = "图片附件") - private String files; - - @Schema(description = "房源介绍") - private String content; - - @Schema(description = "到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expirationTime; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "所在地区") - private String area; - - @Schema(description = "详细地址") - private String address; - - @Schema(description = "经度") - private String longitude; - - @Schema(description = "纬度") - private String latitude; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "是否必看") - private Integer mustSee; - - @Schema(description = "是否可溢价") - private String premium; - - @Schema(description = "租期") - private String tenancy; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否实名认证") - private Integer authentication; - - @Schema(description = "状态 10待审核 20驳回 30通过") - private Integer status; - - @Schema(description = "排序号") - private Integer sortNumber; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "用户手机号") - @TableField(exist = false) - private String userPhone; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - - @Schema(description = "昵称") - @TableField(exist = false) - private String nickname; - - @Schema(description = "用户头像") - @TableField(exist = false) - private String avatar; - - @Schema(description = "用户等级") - @TableField(exist = false) - private String gradeName; - - @Schema(description = "是否选中") - @TableField(exist = false) - private Boolean selected; - - @Schema(description = "是否喜欢") - @TableField(exist = false) - private Boolean liked; - -} diff --git a/src/main/java/com/gxwebsoft/house/entity/HouseLikeLog.java b/src/main/java/com/gxwebsoft/house/entity/HouseLikeLog.java deleted file mode 100644 index d73397f..0000000 --- a/src/main/java/com/gxwebsoft/house/entity/HouseLikeLog.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.gxwebsoft.house.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 房源点赞表 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HouseLikeLog对象", description = "房源点赞表") -public class HouseLikeLog implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "房源ID") - private Integer houseId; - - @Schema(description = "房主ID") - private Integer houseUserId; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "注册时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "更新时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - - @Schema(description = "删除") - @TableLogic - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/house/entity/HouseReservation.java b/src/main/java/com/gxwebsoft/house/entity/HouseReservation.java deleted file mode 100644 index 1eb0f42..0000000 --- a/src/main/java/com/gxwebsoft/house/entity/HouseReservation.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.gxwebsoft.house.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 预约记录表 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:15 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HouseReservation对象", description = "预约记录表") -public class HouseReservation implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "log_id", type = IdType.AUTO) - private Integer logId; - - @Schema(description = "订单号") - private String logNo; - - @Schema(description = "类型") - private Integer type; - - @Schema(description = "付款金额") - private BigDecimal money; - - @Schema(description = "房源ID") - private Integer houseId; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "真实姓名") - private String realName; - - @Schema(description = "联系电话") - private String phone; - - @Schema(description = "付款时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime payTime; - - @Schema(description = "付款状态(10未付款 20已付款)") - private Integer payStatus; - - @Schema(description = "到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expirationTime; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "所在地区") - private String area; - - @Schema(description = "街道地址") - private String address; - - @Schema(description = "订单是否已结算(0未结算 1已结算)") - private Integer isSettled; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "注册时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - - @Schema(description = "昵称") - @TableField(exist = false) - private String nickname; - - @Schema(description = "用户头像") - @TableField(exist = false) - private String avatar; - -} diff --git a/src/main/java/com/gxwebsoft/house/entity/HouseUser.java b/src/main/java/com/gxwebsoft/house/entity/HouseUser.java deleted file mode 100644 index 2b0969f..0000000 --- a/src/main/java/com/gxwebsoft/house/entity/HouseUser.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.gxwebsoft.house.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import java.time.LocalDate; -import com.baomidou.mybatisplus.annotation.TableId; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 用户表 - * - * @author 科技小王子 - * @since 2025-03-05 15:13:05 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HouseUser对象", description = "用户表") -public class HouseUser implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "用户id") - @TableId(value = "user_id", type = IdType.AUTO) - private Integer userId; - - @Schema(description = "用户类型,0个人用户 6开发者 10企业") - private Integer type; - - @Schema(description = "账号") - private String username; - - @Schema(description = "密码") - private String password; - - @Schema(description = "昵称") - private String nickname; - - @Schema(description = "手机号") - private String phone; - - @Schema(description = "性别 1男 2女") - private Integer sex; - - @Schema(description = "职务") - private String position; - - @Schema(description = "注册来源客户端 (APP、H5、小程序等)") - private String platform; - - @Schema(description = "邮箱") - private String email; - - @Schema(description = "邮箱是否验证, 0否, 1是") - private Integer emailVerified; - - @Schema(description = "别名") - private String alias; - - @Schema(description = "真实姓名") - private String realName; - - @Schema(description = "单位姓名") - private String companyName; - - @Schema(description = "证件号码") - private String idCard; - - @Schema(description = "出生日期") - private LocalDate birthday; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "街道地址") - private String address; - - @Schema(description = "经度") - private String longitude; - - @Schema(description = "纬度") - private String latitude; - - @Schema(description = "用户可用余额") - private BigDecimal balance; - - @Schema(description = "用户可用积分") - private Integer points; - - @Schema(description = "用户总支付的金额") - private BigDecimal payMoney; - - @Schema(description = "实际消费的金额(不含退款)") - private BigDecimal expendMoney; - - @Schema(description = "会员等级ID") - private Integer gradeId; - - @Schema(description = "个人简介") - private String introduction; - - @Schema(description = "机构id") - private Integer organizationId; - - @Schema(description = "头像") - private String avatar; - - @Schema(description = "背景图") - private String bgImage; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "客户ID") - private Integer customerId; - - @Schema(description = "用户编码") - private String userCode; - - @Schema(description = "是否已实名认证") - private Integer certification; - - @Schema(description = "兴趣爱好") - private String interest; - - @Schema(description = "身高") - private String height; - - @Schema(description = "体重") - private String weight; - - @Schema(description = "月薪") - private String monthlyPay; - - @Schema(description = "学历") - private String education; - - @Schema(description = "职业") - private String vocation; - - @Schema(description = "年龄") - private Integer age; - - @Schema(description = "是否线下会员") - private Boolean offline; - - @Schema(description = "关注数") - private Integer followers; - - @Schema(description = "粉丝数") - private Integer fans; - - @Schema(description = "点赞数") - private Integer likes; - - @Schema(description = "评论数") - private Integer commentNumbers; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0在线, 1离线") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "商户编码") - private String merchantCode; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "最后结算时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime settlementTime; - - @Schema(description = "注册时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/house/entity/HouseViewsLog.java b/src/main/java/com/gxwebsoft/house/entity/HouseViewsLog.java deleted file mode 100644 index 3ff9eb2..0000000 --- a/src/main/java/com/gxwebsoft/house/entity/HouseViewsLog.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.gxwebsoft.house.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 看房记录表 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:15 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "HouseViewsLog对象", description = "看房记录表") -public class HouseViewsLog implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "房源ID") - private Integer houseId; - - @Schema(description = "房主ID") - private Integer houseUserId; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "注册时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "更新时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - - @Schema(description = "删除") - @TableLogic - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/house/mapper/HouseInfoMapper.java b/src/main/java/com/gxwebsoft/house/mapper/HouseInfoMapper.java deleted file mode 100644 index 3a15558..0000000 --- a/src/main/java/com/gxwebsoft/house/mapper/HouseInfoMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.house.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.house.entity.HouseInfo; -import com.gxwebsoft.house.param.HouseInfoParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 房源信息表Mapper - * - * @author 科技小王子 - * @since 2025-03-05 13:47:14 - */ -public interface HouseInfoMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HouseInfoParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HouseInfoParam param); - -} diff --git a/src/main/java/com/gxwebsoft/house/mapper/HouseLikeLogMapper.java b/src/main/java/com/gxwebsoft/house/mapper/HouseLikeLogMapper.java deleted file mode 100644 index ea43c42..0000000 --- a/src/main/java/com/gxwebsoft/house/mapper/HouseLikeLogMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.house.mapper; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.yulichang.base.MPJBaseMapper; -import com.gxwebsoft.house.entity.HouseLikeLog; -import com.gxwebsoft.house.param.HouseLikeLogParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 房源点赞表Mapper - * - * @author 科技小王子 - * @since 2025-03-05 13:47:14 - */ -public interface HouseLikeLogMapper extends MPJBaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HouseLikeLogParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HouseLikeLogParam param); - -} diff --git a/src/main/java/com/gxwebsoft/house/mapper/HouseReservationMapper.java b/src/main/java/com/gxwebsoft/house/mapper/HouseReservationMapper.java deleted file mode 100644 index aa3b3fe..0000000 --- a/src/main/java/com/gxwebsoft/house/mapper/HouseReservationMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.house.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.house.entity.HouseReservation; -import com.gxwebsoft.house.param.HouseReservationParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 预约记录表Mapper - * - * @author 科技小王子 - * @since 2025-03-05 13:47:15 - */ -public interface HouseReservationMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HouseReservationParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HouseReservationParam param); - -} diff --git a/src/main/java/com/gxwebsoft/house/mapper/HouseUserMapper.java b/src/main/java/com/gxwebsoft/house/mapper/HouseUserMapper.java deleted file mode 100644 index 901c5ed..0000000 --- a/src/main/java/com/gxwebsoft/house/mapper/HouseUserMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.house.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.house.entity.HouseUser; -import com.gxwebsoft.house.param.HouseUserParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 用户表Mapper - * - * @author 科技小王子 - * @since 2025-03-05 15:13:05 - */ -public interface HouseUserMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HouseUserParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HouseUserParam param); - -} diff --git a/src/main/java/com/gxwebsoft/house/mapper/HouseViewsLogMapper.java b/src/main/java/com/gxwebsoft/house/mapper/HouseViewsLogMapper.java deleted file mode 100644 index 32f7df7..0000000 --- a/src/main/java/com/gxwebsoft/house/mapper/HouseViewsLogMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.house.mapper; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.github.yulichang.base.MPJBaseMapper; -import com.gxwebsoft.house.entity.HouseViewsLog; -import com.gxwebsoft.house.param.HouseViewsLogParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 看房记录表Mapper - * - * @author 科技小王子 - * @since 2025-03-05 13:47:15 - */ -public interface HouseViewsLogMapper extends MPJBaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") HouseViewsLogParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") HouseViewsLogParam param); - -} diff --git a/src/main/java/com/gxwebsoft/house/mapper/xml/HouseInfoMapper.xml b/src/main/java/com/gxwebsoft/house/mapper/xml/HouseInfoMapper.xml deleted file mode 100644 index ea10913..0000000 --- a/src/main/java/com/gxwebsoft/house/mapper/xml/HouseInfoMapper.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - SELECT a.*, - b.nickname,b.avatar,b.grade_id, b.phone as userPhone - FROM house_info a - LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id - - - AND a.house_id = #{param.houseId} - - - AND a.house_title LIKE CONCAT('%', #{param.houseTitle}, '%') - - - AND a.type = #{param.type} - - - AND a.city_by_house LIKE CONCAT('%', #{param.cityByHouse}, '%') - - - AND a.house_type LIKE CONCAT('%', #{param.houseType}, '%') - - - AND a.lease_method LIKE CONCAT('%', #{param.leaseMethod}, '%') - - - AND a.rent = #{param.rent} - - - AND a.monthly_rent = #{param.monthlyRent} - - - AND a.extent >= #{param.extentStart} - - - AND a.extent <= #{param.extentEnd} - - - AND a.floor LIKE CONCAT('%', #{param.floor}, '%') - - - AND a.room_number LIKE CONCAT('%', #{param.roomNumber}, '%') - - - AND a.sale_price = #{param.salePrice} - - - AND a.total_Price = #{param.totalPrice} - - - AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') - - - AND a.phone LIKE CONCAT('%', #{param.phone}, '%') - - - AND a.password LIKE CONCAT('%', #{param.password}, '%') - - - AND a.toward LIKE CONCAT('%', #{param.toward}, '%') - - - AND a.house_label LIKE CONCAT('%', #{param.houseLabel}, '%') - - - AND a.files LIKE CONCAT('%', #{param.files}, '%') - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') - - - AND a.province LIKE CONCAT('%', #{param.province}, '%') - - - AND a.city LIKE CONCAT('%', #{param.city}, '%') - - - AND a.region LIKE CONCAT('%', #{param.region}, '%') - - - AND a.area LIKE CONCAT('%', #{param.area}, '%') - - - AND a.address LIKE CONCAT('%', #{param.address}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.authentication = #{param.authentication} - - - AND a.status = #{param.status} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.recommend = #{param.recommend} - - - AND a.must_see = #{param.mustSee} - - - AND a.user_id = #{param.userId} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND ( - a.house_title LIKE CONCAT('%', #{param.keywords}, '%') - OR a.house_id = #{param.keywords} - OR b.nickname = #{param.keywords} - OR a.room_number LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - a.sort_number asc, - - - a.create_time desc, - - - a.monthly_rent asc, - - - a.monthly_rent desc, - - - a.extent asc, - - - a.extent desc, - - - ABS(a.monthly_rent - #{param.priceScene}), - - - - ABS(a.extent - #{param.extentScene}), - - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/house/mapper/xml/HouseLikeLogMapper.xml b/src/main/java/com/gxwebsoft/house/mapper/xml/HouseLikeLogMapper.xml deleted file mode 100644 index 5d7f6fb..0000000 --- a/src/main/java/com/gxwebsoft/house/mapper/xml/HouseLikeLogMapper.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - SELECT a.* - FROM house_like_log a - - - AND a.id = #{param.id} - - - AND a.house_id = #{param.houseId} - - - AND a.house_user_id = #{param.houseUserId} - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/house/mapper/xml/HouseReservationMapper.xml b/src/main/java/com/gxwebsoft/house/mapper/xml/HouseReservationMapper.xml deleted file mode 100644 index 093c28b..0000000 --- a/src/main/java/com/gxwebsoft/house/mapper/xml/HouseReservationMapper.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - SELECT a.* - FROM house_reservation a - - - AND a.log_id = #{param.logId} - - - AND a.log_no LIKE CONCAT('%', #{param.logNo}, '%') - - - AND a.type = #{param.type} - - - AND a.money = #{param.money} - - - AND a.house_id = #{param.houseId} - - - AND a.user_id = #{param.userId} - - - AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') - - - AND a.phone LIKE CONCAT('%', #{param.phone}, '%') - - - AND a.pay_time LIKE CONCAT('%', #{param.payTime}, '%') - - - AND a.pay_status = #{param.payStatus} - - - AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') - - - AND a.province LIKE CONCAT('%', #{param.province}, '%') - - - AND a.city LIKE CONCAT('%', #{param.city}, '%') - - - AND a.region LIKE CONCAT('%', #{param.region}, '%') - - - AND a.area LIKE CONCAT('%', #{param.area}, '%') - - - AND a.address LIKE CONCAT('%', #{param.address}, '%') - - - AND a.is_settled = #{param.isSettled} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - 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/house/mapper/xml/HouseUserMapper.xml b/src/main/java/com/gxwebsoft/house/mapper/xml/HouseUserMapper.xml deleted file mode 100644 index 0af9ccd..0000000 --- a/src/main/java/com/gxwebsoft/house/mapper/xml/HouseUserMapper.xml +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - SELECT a.* - FROM house_user a - - - AND a.user_id = #{param.userId} - - - AND a.type = #{param.type} - - - AND a.username LIKE CONCAT('%', #{param.username}, '%') - - - AND a.password LIKE CONCAT('%', #{param.password}, '%') - - - AND a.nickname LIKE CONCAT('%', #{param.nickname}, '%') - - - AND a.phone LIKE CONCAT('%', #{param.phone}, '%') - - - AND a.sex = #{param.sex} - - - AND a.position LIKE CONCAT('%', #{param.position}, '%') - - - AND a.platform LIKE CONCAT('%', #{param.platform}, '%') - - - AND a.email LIKE CONCAT('%', #{param.email}, '%') - - - AND a.email_verified = #{param.emailVerified} - - - AND a.alias LIKE CONCAT('%', #{param.alias}, '%') - - - AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') - - - AND a.company_name LIKE CONCAT('%', #{param.companyName}, '%') - - - AND a.id_card LIKE CONCAT('%', #{param.idCard}, '%') - - - AND a.birthday LIKE CONCAT('%', #{param.birthday}, '%') - - - AND a.country LIKE CONCAT('%', #{param.country}, '%') - - - AND a.province LIKE CONCAT('%', #{param.province}, '%') - - - AND a.city LIKE CONCAT('%', #{param.city}, '%') - - - AND a.region LIKE CONCAT('%', #{param.region}, '%') - - - AND a.address LIKE CONCAT('%', #{param.address}, '%') - - - AND a.longitude LIKE CONCAT('%', #{param.longitude}, '%') - - - AND a.latitude LIKE CONCAT('%', #{param.latitude}, '%') - - - AND a.balance = #{param.balance} - - - AND a.points = #{param.points} - - - AND a.pay_money = #{param.payMoney} - - - AND a.expend_money = #{param.expendMoney} - - - AND a.grade_id = #{param.gradeId} - - - AND a.introduction LIKE CONCAT('%', #{param.introduction}, '%') - - - AND a.organization_id = #{param.organizationId} - - - AND a.avatar LIKE CONCAT('%', #{param.avatar}, '%') - - - AND a.bg_image LIKE CONCAT('%', #{param.bgImage}, '%') - - - AND a.company_id = #{param.companyId} - - - AND a.customer_id = #{param.customerId} - - - AND a.user_code LIKE CONCAT('%', #{param.userCode}, '%') - - - AND a.certification = #{param.certification} - - - AND a.interest LIKE CONCAT('%', #{param.interest}, '%') - - - AND a.height LIKE CONCAT('%', #{param.height}, '%') - - - AND a.weight LIKE CONCAT('%', #{param.weight}, '%') - - - AND a.monthly_pay LIKE CONCAT('%', #{param.monthlyPay}, '%') - - - AND a.education LIKE CONCAT('%', #{param.education}, '%') - - - AND a.vocation LIKE CONCAT('%', #{param.vocation}, '%') - - - AND a.age = #{param.age} - - - AND a.offline = #{param.offline} - - - AND a.followers = #{param.followers} - - - AND a.fans = #{param.fans} - - - AND a.likes = #{param.likes} - - - AND a.comment_numbers = #{param.commentNumbers} - - - AND a.recommend = #{param.recommend} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%') - - - AND a.settlement_time LIKE CONCAT('%', #{param.settlementTime}, '%') - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND ( - a.nickname LIKE CONCAT('%', #{param.keywords}, '%') - OR a.user_id = #{param.keywords} - OR b.nickname = #{param.keywords} - OR a.phone = #{param.keywords} - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/house/mapper/xml/HouseViewsLogMapper.xml b/src/main/java/com/gxwebsoft/house/mapper/xml/HouseViewsLogMapper.xml deleted file mode 100644 index 53fcf8a..0000000 --- a/src/main/java/com/gxwebsoft/house/mapper/xml/HouseViewsLogMapper.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - SELECT a.* - FROM house_views_log a - - - AND a.id = #{param.id} - - - AND a.house_id = #{param.houseId} - - - AND a.house_user_id = #{param.houseUserId} - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/house/param/HouseInfoParam.java b/src/main/java/com/gxwebsoft/house/param/HouseInfoParam.java deleted file mode 100644 index 27da492..0000000 --- a/src/main/java/com/gxwebsoft/house/param/HouseInfoParam.java +++ /dev/null @@ -1,185 +0,0 @@ -package com.gxwebsoft.house.param; - -import java.math.BigDecimal; - -import com.baomidou.mybatisplus.annotation.TableField; -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.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 房源信息表查询参数 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HouseInfoParam对象", description = "房源信息表查询参数") -public class HouseInfoParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer houseId; - - @Schema(description = "房源标题") - private String houseTitle; - - @Schema(description = "房源类型") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "房产所在的城市") - private String cityByHouse; - - @Schema(description = "户型") - private String houseType; - - @Schema(description = "租赁方式") - private String leaseMethod; - - @Schema(description = "租金") - @QueryField(type = QueryType.EQ) - private BigDecimal rent; - - @Schema(description = "面积起始值") - @QueryField(type = QueryType.GE) - private Integer extentStart; - - @Schema(description = "面积结束值") - @QueryField(type = QueryType.LE) - private Integer extentEnd; - - @Schema(description = "月租金") - @QueryField(type = QueryType.EQ) - private BigDecimal monthlyRent; - - @Schema(description = "物业费") - @QueryField(type = QueryType.EQ) - private BigDecimal propertyFees; - - @Schema(description = "面积") - private String extent; - - @Schema(description = "楼层") - private String floor; - - @Schema(description = "卖价") - private String salePrice; - - @Schema(description = "总价") - private String totalPrice; - - @Schema(description = "房号") - private String roomNumber; - - @Schema(description = "真实姓名") - private String realName; - - @Schema(description = "联系电话") - private String phone; - - @Schema(description = "进入房屋的密码") - private String password; - - @Schema(description = "房屋朝向") - private String toward; - - @Schema(description = "房屋标签") - private String houseLabel; - - @Schema(description = "图片附件") - private String files; - - @Schema(description = "房源介绍") - private String content; - - @Schema(description = "到期时间") - private String expirationTime; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "所在地区") - private String area; - - @Schema(description = "详细地址") - private String address; - - @Schema(description = "经度") - private String longitude; - - @Schema(description = "纬度") - private String latitude; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否实名认证") - @QueryField(type = QueryType.EQ) - private Integer authentication; - - @Schema(description = "状态 10待审核 20驳回 30通过") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "排序号") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "昵称") - @TableField(exist = false) - private String nickname; - - @Schema(description = "用户头像") - @TableField(exist = false) - private String avatar; - - @Schema(description = "价格起始值") - @TableField(exist = false) - private String priceScene; - - @Schema(description = "面积筛选") - @TableField(exist = false) - private String extentScene; - - @Schema(description = "排序") - @TableField(exist = false) - private String sortScene; - - @Schema(description = "是否推荐") - @TableField(exist = false) - private Integer recommend; - - @Schema(description = "是否必看") - @TableField(exist = false) - private Integer mustSee; - - @Schema(description = "是否可溢价") - @TableField(exist = false) - private String premium; - - @Schema(description = "产权信息") - private String property; - -} diff --git a/src/main/java/com/gxwebsoft/house/param/HouseLikeLogParam.java b/src/main/java/com/gxwebsoft/house/param/HouseLikeLogParam.java deleted file mode 100644 index 3ff4a55..0000000 --- a/src/main/java/com/gxwebsoft/house/param/HouseLikeLogParam.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.gxwebsoft.house.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 房源点赞表查询参数 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HouseLikeLogParam对象", description = "房源点赞表查询参数") -public class HouseLikeLogParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "房源ID") - @QueryField(type = QueryType.EQ) - private Integer houseId; - - @Schema(description = "房主ID") - @QueryField(type = QueryType.EQ) - private Integer houseUserId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "删除") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/house/param/HouseReservationParam.java b/src/main/java/com/gxwebsoft/house/param/HouseReservationParam.java deleted file mode 100644 index 43d0487..0000000 --- a/src/main/java/com/gxwebsoft/house/param/HouseReservationParam.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.gxwebsoft.house.param; - -import java.math.BigDecimal; - -import com.baomidou.mybatisplus.annotation.TableField; -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 预约记录表查询参数 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HouseReservationParam对象", description = "预约记录表查询参数") -public class HouseReservationParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer logId; - - @Schema(description = "订单号") - private String logNo; - - @Schema(description = "类型") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "付款金额") - @QueryField(type = QueryType.EQ) - private BigDecimal money; - - @Schema(description = "房源ID") - @QueryField(type = QueryType.EQ) - private Integer houseId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "真实姓名") - private String realName; - - @Schema(description = "联系电话") - private String phone; - - @Schema(description = "付款时间") - private String payTime; - - @Schema(description = "付款状态(10未付款 20已付款)") - @QueryField(type = QueryType.EQ) - private Integer payStatus; - - @Schema(description = "到期时间") - private String expirationTime; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "所在地区") - private String area; - - @Schema(description = "街道地址") - private String address; - - @Schema(description = "订单是否已结算(0未结算 1已结算)") - @QueryField(type = QueryType.EQ) - private Integer isSettled; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "昵称") - @TableField(exist = false) - private String nickname; - - @Schema(description = "用户头像") - @TableField(exist = false) - private String avatar; - -} diff --git a/src/main/java/com/gxwebsoft/house/param/HouseUserParam.java b/src/main/java/com/gxwebsoft/house/param/HouseUserParam.java deleted file mode 100644 index 25ce014..0000000 --- a/src/main/java/com/gxwebsoft/house/param/HouseUserParam.java +++ /dev/null @@ -1,210 +0,0 @@ -package com.gxwebsoft.house.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 用户表查询参数 - * - * @author 科技小王子 - * @since 2025-03-05 15:13:05 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HouseUserParam对象", description = "用户表查询参数") -public class HouseUserParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "用户id") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "用户类型,0个人用户 6开发者 10企业") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "账号") - private String username; - - @Schema(description = "密码") - private String password; - - @Schema(description = "昵称") - private String nickname; - - @Schema(description = "手机号") - private String phone; - - @Schema(description = "性别 1男 2女") - @QueryField(type = QueryType.EQ) - private Integer sex; - - @Schema(description = "职务") - private String position; - - @Schema(description = "注册来源客户端 (APP、H5、小程序等)") - private String platform; - - @Schema(description = "邮箱") - private String email; - - @Schema(description = "邮箱是否验证, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer emailVerified; - - @Schema(description = "别名") - private String alias; - - @Schema(description = "真实姓名") - private String realName; - - @Schema(description = "单位姓名") - private String companyName; - - @Schema(description = "证件号码") - private String idCard; - - @Schema(description = "出生日期") - private String birthday; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "街道地址") - private String address; - - @Schema(description = "经度") - private String longitude; - - @Schema(description = "纬度") - private String latitude; - - @Schema(description = "用户可用余额") - @QueryField(type = QueryType.EQ) - private BigDecimal balance; - - @Schema(description = "用户可用积分") - @QueryField(type = QueryType.EQ) - private Integer points; - - @Schema(description = "用户总支付的金额") - @QueryField(type = QueryType.EQ) - private BigDecimal payMoney; - - @Schema(description = "实际消费的金额(不含退款)") - @QueryField(type = QueryType.EQ) - private BigDecimal expendMoney; - - @Schema(description = "会员等级ID") - @QueryField(type = QueryType.EQ) - private Integer gradeId; - - @Schema(description = "个人简介") - private String introduction; - - @Schema(description = "机构id") - @QueryField(type = QueryType.EQ) - private Integer organizationId; - - @Schema(description = "头像") - private String avatar; - - @Schema(description = "背景图") - private String bgImage; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "客户ID") - @QueryField(type = QueryType.EQ) - private Integer customerId; - - @Schema(description = "用户编码") - private String userCode; - - @Schema(description = "是否已实名认证") - @QueryField(type = QueryType.EQ) - private Integer certification; - - @Schema(description = "兴趣爱好") - private String interest; - - @Schema(description = "身高") - private String height; - - @Schema(description = "体重") - private String weight; - - @Schema(description = "月薪") - private String monthlyPay; - - @Schema(description = "学历") - private String education; - - @Schema(description = "职业") - private String vocation; - - @Schema(description = "年龄") - @QueryField(type = QueryType.EQ) - private Integer age; - - @Schema(description = "是否线下会员") - @QueryField(type = QueryType.EQ) - private Boolean offline; - - @Schema(description = "关注数") - @QueryField(type = QueryType.EQ) - private Integer followers; - - @Schema(description = "粉丝数") - @QueryField(type = QueryType.EQ) - private Integer fans; - - @Schema(description = "点赞数") - @QueryField(type = QueryType.EQ) - private Integer likes; - - @Schema(description = "评论数") - @QueryField(type = QueryType.EQ) - private Integer commentNumbers; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0在线, 1离线") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "商户编码") - private String merchantCode; - - @Schema(description = "最后结算时间") - private String settlementTime; - -} diff --git a/src/main/java/com/gxwebsoft/house/param/HouseViewsLogParam.java b/src/main/java/com/gxwebsoft/house/param/HouseViewsLogParam.java deleted file mode 100644 index b1c2590..0000000 --- a/src/main/java/com/gxwebsoft/house/param/HouseViewsLogParam.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.gxwebsoft.house.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 看房记录表查询参数 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:15 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "HouseViewsLogParam对象", description = "看房记录表查询参数") -public class HouseViewsLogParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "房源ID") - @QueryField(type = QueryType.EQ) - private Integer houseId; - - @Schema(description = "房主ID") - @QueryField(type = QueryType.EQ) - private Integer houseUserId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "删除") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/house/service/HouseInfoService.java b/src/main/java/com/gxwebsoft/house/service/HouseInfoService.java deleted file mode 100644 index 4f1f2a5..0000000 --- a/src/main/java/com/gxwebsoft/house/service/HouseInfoService.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.gxwebsoft.house.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.github.yulichang.base.MPJBaseService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.house.entity.HouseInfo; -import com.gxwebsoft.house.param.HouseInfoParam; - -import java.util.List; - -/** - * 房源信息表Service - * - * @author 科技小王子 - * @since 2025-03-05 13:47:14 - */ -public interface HouseInfoService extends MPJBaseService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HouseInfoParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HouseInfoParam param); - - /** - * 根据id查询 - * - * @param houseId 自增ID - * @return HouseInfo - */ - HouseInfo getByIdRel(Integer houseId); - - String generatePoster(HouseInfo houseInfo) throws Exception; -} diff --git a/src/main/java/com/gxwebsoft/house/service/HouseLikeLogService.java b/src/main/java/com/gxwebsoft/house/service/HouseLikeLogService.java deleted file mode 100644 index d04bc0c..0000000 --- a/src/main/java/com/gxwebsoft/house/service/HouseLikeLogService.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.gxwebsoft.house.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.github.yulichang.base.MPJBaseService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.house.entity.HouseLikeLog; -import com.gxwebsoft.house.param.HouseLikeLogParam; - -import java.util.List; - -/** - * 房源点赞表Service - * - * @author 科技小王子 - * @since 2025-03-05 13:47:14 - */ -public interface HouseLikeLogService extends MPJBaseService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HouseLikeLogParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HouseLikeLogParam param); - - /** - * 根据id查询 - * - * @param houseId ID - * @return LikeLog - */ - HouseLikeLog getByIdRel(Integer houseId, Integer userId); - - boolean add(HouseLikeLog likeLog); - -} diff --git a/src/main/java/com/gxwebsoft/house/service/HouseReservationService.java b/src/main/java/com/gxwebsoft/house/service/HouseReservationService.java deleted file mode 100644 index e7f9e5a..0000000 --- a/src/main/java/com/gxwebsoft/house/service/HouseReservationService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.house.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.house.entity.HouseReservation; -import com.gxwebsoft.house.param.HouseReservationParam; - -import java.util.List; - -/** - * 预约记录表Service - * - * @author 科技小王子 - * @since 2025-03-05 13:47:15 - */ -public interface HouseReservationService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HouseReservationParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HouseReservationParam param); - - /** - * 根据id查询 - * - * @param logId ID - * @return HouseReservation - */ - HouseReservation getByIdRel(Integer logId); - -} diff --git a/src/main/java/com/gxwebsoft/house/service/HouseUserService.java b/src/main/java/com/gxwebsoft/house/service/HouseUserService.java deleted file mode 100644 index 40b8559..0000000 --- a/src/main/java/com/gxwebsoft/house/service/HouseUserService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.house.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.house.entity.HouseUser; -import com.gxwebsoft.house.param.HouseUserParam; - -import java.util.List; - -/** - * 用户表Service - * - * @author 科技小王子 - * @since 2025-03-05 15:13:05 - */ -public interface HouseUserService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HouseUserParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HouseUserParam param); - - /** - * 根据id查询 - * - * @param userId 用户id - * @return HouseUser - */ - HouseUser getByIdRel(Integer userId); - -} diff --git a/src/main/java/com/gxwebsoft/house/service/HouseViewsLogService.java b/src/main/java/com/gxwebsoft/house/service/HouseViewsLogService.java deleted file mode 100644 index 0424c03..0000000 --- a/src/main/java/com/gxwebsoft/house/service/HouseViewsLogService.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.gxwebsoft.house.service; - -import com.github.yulichang.base.MPJBaseService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.house.entity.HouseInfo; -import com.gxwebsoft.house.entity.HouseViewsLog; -import com.gxwebsoft.house.param.HouseViewsLogParam; - -import java.util.List; - -/** - * 看房记录表Service - * - * @author 科技小王子 - * @since 2025-03-05 13:47:15 - */ -public interface HouseViewsLogService extends MPJBaseService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(HouseViewsLogParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(HouseViewsLogParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return HouseViewsLog - */ - HouseViewsLog getByIdRel(Integer id); - - void add(HouseInfo houseInfo, Integer loginUserId); -} diff --git a/src/main/java/com/gxwebsoft/house/service/impl/HouseInfoServiceImpl.java b/src/main/java/com/gxwebsoft/house/service/impl/HouseInfoServiceImpl.java deleted file mode 100644 index 5d3357e..0000000 --- a/src/main/java/com/gxwebsoft/house/service/impl/HouseInfoServiceImpl.java +++ /dev/null @@ -1,324 +0,0 @@ -package com.gxwebsoft.house.service.impl; - -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.RandomUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpRequest; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.freewayso.image.combiner.ImageCombiner; -import com.freewayso.image.combiner.enums.OutputFormat; -import com.freewayso.image.combiner.enums.ZoomMode; -import com.gxwebsoft.common.core.config.ConfigProperties; -import com.gxwebsoft.common.core.utils.CommonUtil; -import com.gxwebsoft.common.core.utils.ImageUtil; -import com.gxwebsoft.common.core.utils.RedisUtil; -import com.gxwebsoft.common.system.controller.WxLoginController; -import com.gxwebsoft.common.system.service.SettingService; -import com.gxwebsoft.house.mapper.HouseInfoMapper; -import com.gxwebsoft.house.service.HouseInfoService; -import com.gxwebsoft.house.entity.HouseInfo; -import com.gxwebsoft.house.param.HouseInfoParam; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import org.springframework.beans.factory.annotation.Value; - -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.awt.*; -import java.io.File; -import java.util.HashMap; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * 房源信息表Service实现 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:14 - */ -@Service -public class HouseInfoServiceImpl extends ServiceImpl implements HouseInfoService { - - @Value("${config.upload-path}") - private String uploadPath; - - @Value("${config.file-server}") - private String fileServer; - - @Resource - private ConfigProperties config; - - @Resource - private SettingService settingService; - - @Resource - private RedisUtil redisUtil; - @Resource - private WxLoginController wxLoginController; - - private static final String ACCESS_TOKEN_KEY = "cache:wx:access_token"; - - @Override - public PageResult pageRel(HouseInfoParam param) { - PageParam page = new PageParam<>(param); - // 只有在没有指定排序场景时才设置默认排序 - if (param.getSortScene() == null || param.getSortScene().isEmpty()) { - page.setDefaultOrder("create_time desc"); - } - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(HouseInfoParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - // 只有在没有指定排序场景时才使用默认排序 - if (param.getSortScene() == null || param.getSortScene().isEmpty()) { - page.setDefaultOrder("create_time desc"); - } - return page.sortRecords(list); - } - - @Override - public HouseInfo getByIdRel(Integer houseId) { - HouseInfoParam param = new HouseInfoParam(); - param.setHouseId(houseId); - return param.getOne(baseMapper.selectListRel(param)); - } - - /** - * 生成房产海报 ... - * - * @param houseInfo 房源信息 - * @return 海报图片URL - * @throws Exception 异常 - */ - @Override - public String generatePoster(HouseInfo houseInfo) throws Exception { - if (ObjectUtil.isEmpty(houseInfo)) { - return null; - } - - // 解析房源图片文件 - final String files = houseInfo.getFiles(); - if (StrUtil.isBlank(files)) { - return null; - } - - System.out.println("房源图片文件: " + files); - - try { - // 解析JSON数组格式的图片文件 - JSONArray fileArray = JSONArray.parseArray(files); - if (fileArray == null || fileArray.isEmpty()) { - return null; - } - - // 获取第一张图片作为主图 - JSONObject firstFile = fileArray.getJSONObject(0); - if (firstFile == null) { - return null; - } - - String mainImageUrl = firstFile.getString("url"); - if (StrUtil.isBlank(mainImageUrl)) { - return null; - } - - ImageCombiner combiner = new ImageCombiner(mainImageUrl, OutputFormat.JPG); - // 房源信息区域开始Y坐标 - int infoStartY = 330; - int lineHeight = 40; // 增加行高 - int currentY = infoStartY; - - // 添加房源标题(黑色文字,居中) - if (StrUtil.isNotBlank(houseInfo.getHouseTitle())) { - combiner.addTextElement(houseInfo.getHouseTitle(), 32, 50, currentY) - .setColor(Color.YELLOW) - .setCenter(true); - currentY += lineHeight + 10; // 标题后多留空间 - } - - // 添加房源价格信息(红色突出显示,居中) - if (houseInfo.getRent() != null) { - String priceText = "租金: ¥" + houseInfo.getRent(); - if (houseInfo.getMonthlyRent() != null) { - priceText += "/月"; - } - combiner.addTextElement(priceText, 26, 50, currentY) - .setColor(Color.RED) - .setCenter(true); - currentY += lineHeight; - } - - // 添加房源基本信息 - StringBuilder infoText = new StringBuilder(); - if (StrUtil.isNotBlank(houseInfo.getHouseType())) { - infoText.append(houseInfo.getHouseType()); - } - if (StrUtil.isNotBlank(houseInfo.getExtent())) { - if (infoText.length() > 0) infoText.append(" | "); - infoText.append(houseInfo.getExtent()); - } - if (StrUtil.isNotBlank(houseInfo.getFloor())) { - if (infoText.length() > 0) infoText.append(" | "); - infoText.append(houseInfo.getFloor()); - } - -// if (infoText.length() > 0) { -// combiner.addTextElement(infoText.toString(), 22, 50, currentY) -// .setColor(Color.LIGHT_GRAY) -// .setCenter(true); -// } - - // 生成并添加小程序码(左上角) - String qrCodeUrl = generateMiniProgramQRCode(houseInfo.getHouseId()); - if (StrUtil.isNotBlank(qrCodeUrl)) { - // 小程序码放在左上角,尺寸占宽度20%(600*0.2=120px) -// combiner.addImageElement(qrCodeUrl, 30, 30) -// .setX(5); - combiner.addImageElement(qrCodeUrl,40,40,150,150, ZoomMode.Width); - } - - // 执行图片合并 - combiner.combine(); - - // 创建保存目录 - String posterDir = uploadPath + "/poster/" + houseInfo.getTenantId() + "/house"; - if (!FileUtil.exist(posterDir)) { - FileUtil.mkdir(posterDir); - } - - // 生成文件路径 - String basePath = "/poster/" + houseInfo.getTenantId() + "/house/big-" + houseInfo.getHouseId() + ".jpg"; - String smallPath = "/poster/" + houseInfo.getTenantId() + "/house/" + houseInfo.getHouseId() + ".jpg"; - String filename = uploadPath + "/file" + basePath; - String smallFileName = uploadPath + "/file" + smallPath; - - // 保存原图 - combiner.save(filename); - - // 压缩图片 - File input = new File(filename); - File output = new File(smallFileName); - ImageUtil.adjustQuality(input, output, 0.8f); - - // 删除原图,保留压缩后的图片 - if (input.exists()) { - input.delete(); - } - - // 返回图片访问URL - return fileServer + smallPath + "?r=" + RandomUtil.randomNumbers(4); - - } catch (Exception e) { - System.err.println("生成房产海报失败: " + e.getMessage()); - e.printStackTrace(); - throw e; - } - } - - /** - * 生成房源详情页小程序码 - * - * @param houseId 房源ID - * @return 小程序码图片URL - */ - private String generateMiniProgramQRCode(Integer houseId) { - try { - String apiUrl = "https://api.weixin.qq.com/wxa/getwxacode?access_token=" + wxLoginController.getAccessToken(); - final HashMap map = new HashMap<>(); - // 设置小程序页面路径:sub_pages/house/detail/ + houseId - map.put("path", "sub_pages/house/detail/?houseId=" + houseId); - // 可以设置环境版本,如果需要的话 -// map.put("env_version", "trial"); - - // 获取图片 Buffer - byte[] qrCode = HttpRequest.post(apiUrl) - .body(JSON.toJSONString(map)) - .execute().bodyBytes(); - - // 保存的文件名称 - final String fileName = CommonUtil.randomUUID8().concat(".png"); - // 保存路径 - String filePath = getUploadDir().concat("qrcode/house/") + fileName; - - // 确保目录存在 - String qrCodeDir = getUploadDir().concat("qrcode/house/"); - if (!FileUtil.exist(qrCodeDir)) { - FileUtil.mkdir(qrCodeDir); - } - - File file = FileUtil.writeBytes(qrCode, filePath); - if (file != null) { - return config.getFileServer().concat("/qrcode/house/").concat(fileName); - } - } catch (Exception e) { - System.err.println("生成房源小程序码失败: " + e.getMessage()); - e.printStackTrace(); - } - return null; - } - - /** - * 获取微信小程序Access Token - * - * @return access_token - */ -// private String getAccessToken() { -// String key = ACCESS_TOKEN_KEY.concat(":").concat("1"); // 这里可以根据实际情况获取tenantId -// System.out.println("key = " + key); -// // 获取微信小程序配置信息 -// JSONObject setting = settingService.getBySettingKey("mp-weixin"); -// if (setting == null) { -// throw new RuntimeException("请先配置小程序"); -// } -// -// // 从缓存获取access_token -// String value = redisUtil.get(key); -// System.out.println("redisTemplate-value = " + value); -// if (value != null) { -// JSONObject response = JSON.parseObject(value); -// String accessToken = response.getString("access_token"); -// if (StrUtil.isNotBlank(accessToken)) { -// return accessToken; -// } -// } -// -// // 微信获取凭证接口 -// String apiUrl = "https://api.weixin.qq.com/cgi-bin/token"; -// // 组装url参数 -// String url = apiUrl.concat("?grant_type=client_credential") -// .concat("&appid=").concat(setting.getString("appId")) -// .concat("&secret=").concat(setting.getString("appSecret")); -// -// // 执行get请求 -// String result = cn.hutool.http.HttpUtil.get(url); -// System.out.println("获取access_token结果: " + result); -// -// // 解析access_token -// JSONObject response = JSON.parseObject(result); -// if (response.getString("access_token") != null) { -// // 存入缓存 -// redisUtil.set(key, result, 7000L, TimeUnit.SECONDS); -// return response.getString("access_token"); -// } -// -// throw new RuntimeException("小程序配置不正确"); -// } - - /** - * 文件上传位置(服务器) - */ - private String getUploadDir() { - return config.getUploadPath(); - } - -} diff --git a/src/main/java/com/gxwebsoft/house/service/impl/HouseLikeLogServiceImpl.java b/src/main/java/com/gxwebsoft/house/service/impl/HouseLikeLogServiceImpl.java deleted file mode 100644 index 6670d85..0000000 --- a/src/main/java/com/gxwebsoft/house/service/impl/HouseLikeLogServiceImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.gxwebsoft.house.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.github.yulichang.base.MPJBaseServiceImpl; -import com.gxwebsoft.house.mapper.HouseLikeLogMapper; -import com.gxwebsoft.house.service.HouseLikeLogService; -import com.gxwebsoft.house.entity.HouseLikeLog; -import com.gxwebsoft.house.param.HouseLikeLogParam; -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 科技小王子 - * @since 2025-03-05 13:47:14 - */ -@Service -public class HouseLikeLogServiceImpl extends MPJBaseServiceImpl implements HouseLikeLogService { - - @Override - public PageResult pageRel(HouseLikeLogParam 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(HouseLikeLogParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public HouseLikeLog getByIdRel(Integer houseId, Integer userId) { - LambdaQueryWrapper wr = Wrappers.lambdaQuery(HouseLikeLog.class).eq(HouseLikeLog::getHouseId, houseId).eq(HouseLikeLog::getUserId, userId); - HouseLikeLog likeLogs = getBaseMapper().selectOne(wr); - return likeLogs; - } - - @Override - public boolean add( HouseLikeLog likeLog) { - LambdaQueryWrapper wr = Wrappers.lambdaQuery(HouseLikeLog.class).eq(HouseLikeLog::getHouseId, likeLog.getHouseId()).eq(HouseLikeLog::getUserId, likeLog.getUserId()); - - List likeLogs = getBaseMapper().selectList(wr); - if(CollectionUtils.isNotEmpty(likeLogs)) { - baseMapper.delete(wr); - return false; - }else { - int insert = baseMapper.insert(likeLog); - return true; - } - } - -} diff --git a/src/main/java/com/gxwebsoft/house/service/impl/HouseReservationServiceImpl.java b/src/main/java/com/gxwebsoft/house/service/impl/HouseReservationServiceImpl.java deleted file mode 100644 index 343b3d6..0000000 --- a/src/main/java/com/gxwebsoft/house/service/impl/HouseReservationServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.house.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.house.mapper.HouseReservationMapper; -import com.gxwebsoft.house.service.HouseReservationService; -import com.gxwebsoft.house.entity.HouseReservation; -import com.gxwebsoft.house.param.HouseReservationParam; -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 科技小王子 - * @since 2025-03-05 13:47:15 - */ -@Service -public class HouseReservationServiceImpl extends ServiceImpl implements HouseReservationService { - - @Override - public PageResult pageRel(HouseReservationParam 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(HouseReservationParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public HouseReservation getByIdRel(Integer logId) { - HouseReservationParam param = new HouseReservationParam(); - param.setLogId(logId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/house/service/impl/HouseUserServiceImpl.java b/src/main/java/com/gxwebsoft/house/service/impl/HouseUserServiceImpl.java deleted file mode 100644 index 93f0f56..0000000 --- a/src/main/java/com/gxwebsoft/house/service/impl/HouseUserServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.house.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.house.mapper.HouseUserMapper; -import com.gxwebsoft.house.service.HouseUserService; -import com.gxwebsoft.house.entity.HouseUser; -import com.gxwebsoft.house.param.HouseUserParam; -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 科技小王子 - * @since 2025-03-05 15:13:05 - */ -@Service -public class HouseUserServiceImpl extends ServiceImpl implements HouseUserService { - - @Override - public PageResult pageRel(HouseUserParam 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(HouseUserParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public HouseUser getByIdRel(Integer userId) { - HouseUserParam param = new HouseUserParam(); - param.setUserId(userId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/house/service/impl/HouseViewsLogServiceImpl.java b/src/main/java/com/gxwebsoft/house/service/impl/HouseViewsLogServiceImpl.java deleted file mode 100644 index 8ae54b1..0000000 --- a/src/main/java/com/gxwebsoft/house/service/impl/HouseViewsLogServiceImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.gxwebsoft.house.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.gxwebsoft.house.entity.HouseInfo; -import com.gxwebsoft.house.mapper.HouseViewsLogMapper; -import com.gxwebsoft.house.service.HouseViewsLogService; -import com.github.yulichang.base.MPJBaseServiceImpl; -import com.gxwebsoft.house.entity.HouseViewsLog; -import com.gxwebsoft.house.param.HouseViewsLogParam; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import org.springframework.stereotype.Service; - -import java.time.LocalDateTime; -import java.util.List; - -/** - * 看房记录表Service实现 - * - * @author 科技小王子 - * @since 2025-03-05 13:47:15 - */ -@Service -public class HouseViewsLogServiceImpl extends MPJBaseServiceImpl implements HouseViewsLogService { - - @Override - public PageResult pageRel(HouseViewsLogParam 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(HouseViewsLogParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public HouseViewsLog getByIdRel(Integer id) { - HouseViewsLogParam param = new HouseViewsLogParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - - @Override - public void add(HouseInfo houseInfo, Integer loginUserId) { - LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(HouseViewsLog.class).eq(HouseViewsLog::getUserId, loginUserId).eq(HouseViewsLog::getHouseId, houseInfo.getHouseId()); - HouseViewsLog viewsLog = baseMapper.selectOne(wrapper); - if(viewsLog == null){ - viewsLog = new HouseViewsLog(); - viewsLog.setUserId(loginUserId); - viewsLog.setHouseId(houseInfo.getHouseId()); - viewsLog.setHouseUserId(houseInfo.getUserId()); - } - viewsLog.setUpdateTime(LocalDateTime.now()); - saveOrUpdate(viewsLog); - } - -} diff --git a/src/main/java/com/gxwebsoft/house/util/SortSceneUtil.java b/src/main/java/com/gxwebsoft/house/util/SortSceneUtil.java deleted file mode 100644 index b9873a9..0000000 --- a/src/main/java/com/gxwebsoft/house/util/SortSceneUtil.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.gxwebsoft.house.util; - -import cn.hutool.core.util.StrUtil; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; - -/** - * 排序场景工具类 - * 用于处理前端传递的排序参数,解决URL编码和字符串匹配问题 - * - * @author 科技小王子 - * @since 2025-08-04 - */ -public class SortSceneUtil { - - /** - * 标准化排序场景参数 - * @param sortScene 原始排序场景参数 - * @return 标准化后的排序场景参数 - */ - public static String normalizeSortScene(String sortScene) { - if (StrUtil.isBlank(sortScene)) { - return null; - } - - // 尝试URL解码 - String decoded = sortScene; - try { - // 如果包含%,尝试URL解码 - if (sortScene.contains("%")) { - decoded = URLDecoder.decode(sortScene, "UTF-8"); - } - } catch (UnsupportedEncodingException e) { - // 解码失败,使用原始值 - decoded = sortScene; - } - - // 去除首尾空格 - decoded = decoded.trim(); - - // 标准化常见的排序场景 - if (decoded.contains("价格") && decoded.contains("低") && decoded.contains("高")) { - if (decoded.contains("低-高") || decoded.contains("低到高") || decoded.contains("升序")) { - return "价格(低-高)"; - } else if (decoded.contains("高-低") || decoded.contains("高到低") || decoded.contains("降序")) { - return "价格(高-低)"; - } - } - - if (decoded.contains("面积") && decoded.contains("小") && decoded.contains("大")) { - if (decoded.contains("小-大") || decoded.contains("小到大") || decoded.contains("升序")) { - return "面积(小-大)"; - } else if (decoded.contains("大-小") || decoded.contains("大到小") || decoded.contains("降序")) { - return "面积(大-小)"; - } - } - - if (decoded.contains("最新") || decoded.contains("时间") || decoded.contains("发布")) { - return "最新发布"; - } - - if (decoded.contains("综合") || decoded.contains("默认")) { - return "综合排序"; - } - - return decoded; - } - - /** - * 判断是否为价格升序排序 - * @param sortScene 排序场景参数 - * @return true表示价格升序 - */ - public static boolean isPriceAsc(String sortScene) { - String normalized = normalizeSortScene(sortScene); - return "价格(低-高)".equals(normalized); - } - - /** - * 判断是否为价格降序排序 - * @param sortScene 排序场景参数 - * @return true表示价格降序 - */ - public static boolean isPriceDesc(String sortScene) { - String normalized = normalizeSortScene(sortScene); - return "价格(高-低)".equals(normalized); - } - - /** - * 判断是否为面积升序排序 - * @param sortScene 排序场景参数 - * @return true表示面积升序 - */ - public static boolean isAreaAsc(String sortScene) { - String normalized = normalizeSortScene(sortScene); - return "面积(小-大)".equals(normalized); - } - - /** - * 判断是否为面积降序排序 - * @param sortScene 排序场景参数 - * @return true表示面积降序 - */ - public static boolean isAreaDesc(String sortScene) { - String normalized = normalizeSortScene(sortScene); - return "面积(大-小)".equals(normalized); - } - - /** - * 判断是否为最新发布排序 - * @param sortScene 排序场景参数 - * @return true表示最新发布排序 - */ - public static boolean isLatest(String sortScene) { - String normalized = normalizeSortScene(sortScene); - return "最新发布".equals(normalized); - } - - /** - * 判断是否为综合排序 - * @param sortScene 排序场景参数 - * @return true表示综合排序 - */ - public static boolean isComprehensive(String sortScene) { - String normalized = normalizeSortScene(sortScene); - return "综合排序".equals(normalized); - } -} diff --git a/src/main/java/com/gxwebsoft/led/config/BmeApiProperties.java b/src/main/java/com/gxwebsoft/led/config/BmeApiProperties.java deleted file mode 100644 index f0221d6..0000000 --- a/src/main/java/com/gxwebsoft/led/config/BmeApiProperties.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.gxwebsoft.led.config; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -/** - * 业务中台(排班接口)调用配置。 - */ -@Data -@Component -@ConfigurationProperties(prefix = "led.bme") -public class BmeApiProperties { - - /** - * 中台基础地址,例如:http://16.1.4.201:7979 - */ - private String baseUrl; - - /** - * 授权应用ID(文档中的 APPID)。 - */ - private String appid; - - /** - * 应用密钥(文档中的 secret_key)。 - */ - private String secretKey; - - /** - * 机构ID,默认按文档要求传 10001。 - */ - private String mechanismId = "10001"; - - /** - * 默认操作员代码。 - */ - private String defaultExtUserId; - - /** - * 默认医院代码,可留空。 - */ - private String defaultHospitalId; - - /** - * 连接/读取超时时间(毫秒)。 - */ - private int timeoutMs = 10000; -} diff --git a/src/main/java/com/gxwebsoft/led/controller/LedApiController.java b/src/main/java/com/gxwebsoft/led/controller/LedApiController.java deleted file mode 100644 index 70310c4..0000000 --- a/src/main/java/com/gxwebsoft/led/controller/LedApiController.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.gxwebsoft.led.controller; - -import com.alibaba.fastjson.JSONObject; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.led.param.BmeNumberSourcesParam; -import com.gxwebsoft.led.param.BmeStopReplaceParam; -import com.gxwebsoft.led.service.LedScheduleService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -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.util.Optional; - -@Tag(name = "LED-排班接口") -@RestController -@RequestMapping("/api/led/bme") -public class LedApiController extends BaseController { - - @Resource - private LedScheduleService ledScheduleService; - - @Operation(summary = "查询一周内停替诊医生排班信息(10017)") - @PostMapping("/stop-replace") - public ApiResult searchStopAndReplace(@RequestBody BmeStopReplaceParam param) { - return success(extractScheduleData(ledScheduleService.searchStopAndReplace(param))); - } - - @Operation(summary = "查询医生排班信息当日剩余号源(10018)") - @PostMapping("/number-sources") - public ApiResult searchNumberSources(@RequestBody BmeNumberSourcesParam param) { - return success(extractScheduleData(ledScheduleService.searchNumberSources(param))); - } - - /** - * 将中台层层嵌套的响应简化为单层:tid、resultCode/resultMsg、data(主要数据)。 - */ - private JSONObject flattenScheduleResponse(JSONObject raw) { - JSONObject current = Optional.ofNullable(raw).orElseGet(JSONObject::new); - String tid = current.getString("tid"); - - // 下钻 data 层级 - while (current.getJSONObject("data") != null) { - current = current.getJSONObject("data"); - if (current.containsKey("tid")) { - tid = current.getString("tid"); - } - } - - JSONObject result = new JSONObject(); - result.put("tid", tid); - result.put("resultCode", firstNonEmpty(current.getString("resultCode"), current.getString("code"))); - result.put("resultMsg", firstNonEmpty(current.getString("resultMsg"), current.getString("msg"))); - - // 主体数据:优先 dataList.data,其次 data - if (current.containsKey("dataList") && current.getJSONObject("dataList") != null) { - result.put("data", current.getJSONObject("dataList").get("data")); - } else if (current.containsKey("data")) { - result.put("data", current.get("data")); - } else { - result.put("data", current); - } - return result; - } - - /** - * 直接返回核心数据字段(即扁平化后的 result.data)。 - */ - private Object extractScheduleData(JSONObject raw) { - JSONObject flattened = flattenScheduleResponse(raw); - return flattened.get("data"); - } - - private String firstNonEmpty(String... values) { - for (String v : values) { - if (v != null && !v.isEmpty()) { - return v; - } - } - return ""; - } -} diff --git a/src/main/java/com/gxwebsoft/led/model/BmeToken.java b/src/main/java/com/gxwebsoft/led/model/BmeToken.java deleted file mode 100644 index 9ac429d..0000000 --- a/src/main/java/com/gxwebsoft/led/model/BmeToken.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.gxwebsoft.led.model; - -import lombok.Data; - -import java.io.Serializable; - -/** - * 业务中台授权令牌缓存实体。 - */ -@Data -public class BmeToken implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * 接口调用凭证 access_token。 - */ - private String accessToken; - - /** - * 刷新 access_token 的 refresh_token。 - */ - private String refreshToken; - - /** - * access_token 过期时间戳(秒级)。 - */ - private long expireAt; -} diff --git a/src/main/java/com/gxwebsoft/led/param/BmeNumberSourcesParam.java b/src/main/java/com/gxwebsoft/led/param/BmeNumberSourcesParam.java deleted file mode 100644 index 9391be3..0000000 --- a/src/main/java/com/gxwebsoft/led/param/BmeNumberSourcesParam.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.gxwebsoft.led.param; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * 查询医生排班信息当日剩余号源(10018)入参。 - */ -@Data -public class BmeNumberSourcesParam { - - @Schema(description = "开始日期,yyyy-MM-dd") - private String startDate; - - @Schema(description = "结束日期,yyyy-MM-dd") - private String endDate; - - @Schema(description = "科室代码,可选") - private String deptCode; - - @Schema(description = "医生工号,可选") - private String userCode; - - @Schema(description = "时段,可选:01上午 02下午 03全天 04中午") - @JsonProperty("aSTimeRange") - private String aSTimeRange; - - @Schema(description = "医院代码,可选") - private String hospitalId; - - @Schema(description = "机构ID,默认10001") - private String mechanismId; - - @Schema(description = "操作员代码") - private String extUserID; - - @Schema(description = "交易代码,默认10018") - private String tradeCode; - - public String getASTimeRange() { - return aSTimeRange; - } - - public void setASTimeRange(String aSTimeRange) { - this.aSTimeRange = aSTimeRange; - } -} diff --git a/src/main/java/com/gxwebsoft/led/param/BmeStopReplaceParam.java b/src/main/java/com/gxwebsoft/led/param/BmeStopReplaceParam.java deleted file mode 100644 index 27a53c1..0000000 --- a/src/main/java/com/gxwebsoft/led/param/BmeStopReplaceParam.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.gxwebsoft.led.param; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -/** - * 查询一周内停替诊排班(10017)入参。 - */ -@Data -public class BmeStopReplaceParam { - - @Schema(description = "开始日期,yyyy-MM-dd") - private String startDate; - - @Schema(description = "结束日期,yyyy-MM-dd") - private String endDate; - - @Schema(description = "科室代码,可选") - private String deptCode; - - @Schema(description = "医生工号,可选") - private String userCode; - - @Schema(description = "医院代码,可选") - private String hospitalId; - - @Schema(description = "机构ID,默认10001") - private String mechanismId; - - @Schema(description = "操作员代码") - private String extUserID; - - @Schema(description = "交易代码,默认10017") - private String tradeCode; -} diff --git a/src/main/java/com/gxwebsoft/led/service/LedScheduleService.java b/src/main/java/com/gxwebsoft/led/service/LedScheduleService.java deleted file mode 100644 index 34f263e..0000000 --- a/src/main/java/com/gxwebsoft/led/service/LedScheduleService.java +++ /dev/null @@ -1,288 +0,0 @@ -package com.gxwebsoft.led.service; - -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.RandomUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.crypto.digest.DigestUtil; -import cn.hutool.http.HttpRequest; -import cn.hutool.http.HttpResponse; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; -import com.gxwebsoft.common.core.exception.BusinessException; -import com.gxwebsoft.common.core.utils.JSONUtil; -import com.gxwebsoft.common.core.utils.RedisUtil; -import com.gxwebsoft.led.config.BmeApiProperties; -import com.gxwebsoft.led.model.BmeToken; -import com.gxwebsoft.led.param.BmeNumberSourcesParam; -import com.gxwebsoft.led.param.BmeStopReplaceParam; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -import java.time.Duration; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -/** - * 排班接口对接服务。 - */ -@Slf4j -@Service -@RequiredArgsConstructor -public class LedScheduleService { - - private static final String TOKEN_CACHE_KEY = "led:bme:auth"; - private static final long TOKEN_EXPIRE_MARGIN_SECONDS = 60L; - - private final BmeApiProperties properties; - private final RedisUtil redisUtil; - - public JSONObject searchStopAndReplace(BmeStopReplaceParam param) { - BmeStopReplaceParam requestParam = fillStopReplaceDefaults(param); - BmeToken token = ensureToken(); - String body = buildStopReplaceBody(requestParam); - return doSignedPost("/cgi-bin/bme-app-register/outpatient/registered/searchDoctorsStopAndReplaceInfo", body, token); - } - - public JSONObject searchNumberSources(BmeNumberSourcesParam param) { - BmeNumberSourcesParam requestParam = fillNumberSourcesDefaults(param); - BmeToken token = ensureToken(); - String body = buildNumberSourcesBody(requestParam); - return doSignedPost("/cgi-bin/bme-app-register/outpatient/registered/searchDoctorsNumberSources", body, token); - } - - private JSONObject doSignedPost(String path, String body, BmeToken token) { - if (StrUtil.isBlank(body)) { - throw new BusinessException("请求体为空"); - } - ensureConfig(); - long timestamp = System.currentTimeMillis() / 1000; - String nonce = RandomUtil.randomString(16); - String signStr = body + "|" + token.getAccessToken() + "|" + token.getRefreshToken() + "|" + timestamp + "|" + nonce; - String sig = DigestUtil.md5Hex(signStr); - HttpResponse response = HttpRequest.post(buildUrl(path)) - .header("sig", sig) - .header("timestamp", String.valueOf(timestamp)) - .header("nonce", nonce) - .header("access-token", token.getAccessToken()) - .contentType("application/json") - .body(body) - .timeout(properties.getTimeoutMs()) - .execute(); - if (response.getStatus() != 200) { - throw new BusinessException("调用中台接口失败,HTTP状态码:" + response.getStatus()); - } - String respBody = response.body(); - JSONObject respJson; - try { - respJson = JSON.parseObject(respBody); - } catch (Exception e) { - throw new BusinessException("解析中台响应失败"); - } - if (respJson == null || !"0".equals(respJson.getString("code"))) { - String message = respJson != null ? respJson.getString("msg") : "未知错误"; - throw new BusinessException("中台接口调用失败:" + message); - } - return respJson; - } - - private BmeStopReplaceParam fillStopReplaceDefaults(BmeStopReplaceParam param) { - if (param == null) { - throw new BusinessException("请求参数不能为空"); - } - if (StrUtil.isBlank(param.getStartDate()) || StrUtil.isBlank(param.getEndDate())) { - throw new BusinessException("开始日期和结束日期必填"); - } - if (StrUtil.isBlank(param.getMechanismId())) { - param.setMechanismId(properties.getMechanismId()); - } - if (StrUtil.isBlank(param.getExtUserID())) { - param.setExtUserID(properties.getDefaultExtUserId()); - } - if (StrUtil.isBlank(param.getHospitalId())) { - param.setHospitalId(properties.getDefaultHospitalId()); - } - if (StrUtil.isBlank(param.getTradeCode())) { - param.setTradeCode("10017"); - } - if (StrUtil.hasBlank(param.getMechanismId(), param.getExtUserID(), param.getTradeCode())) { - throw new BusinessException("机构ID、操作员代码、交易代码必填"); - } - return param; - } - - private BmeNumberSourcesParam fillNumberSourcesDefaults(BmeNumberSourcesParam param) { - if (param == null) { - throw new BusinessException("请求参数不能为空"); - } - if (StrUtil.isBlank(param.getStartDate()) || StrUtil.isBlank(param.getEndDate())) { - throw new BusinessException("开始日期和结束日期必填"); - } - if (StrUtil.isBlank(param.getMechanismId())) { - param.setMechanismId(properties.getMechanismId()); - } - if (StrUtil.isBlank(param.getExtUserID())) { - param.setExtUserID(properties.getDefaultExtUserId()); - } - if (StrUtil.isBlank(param.getHospitalId())) { - param.setHospitalId(properties.getDefaultHospitalId()); - } - if (StrUtil.isBlank(param.getTradeCode())) { - param.setTradeCode("10018"); - } - if (StrUtil.hasBlank(param.getMechanismId(), param.getExtUserID(), param.getTradeCode())) { - throw new BusinessException("机构ID、操作员代码、交易代码必填"); - } - return param; - } - - private String buildStopReplaceBody(BmeStopReplaceParam param) { - Map body = new LinkedHashMap<>(); - body.put("mechanismId", param.getMechanismId()); - body.put("tradeCode", param.getTradeCode()); - body.put("startDate", param.getStartDate()); - body.put("endDate", param.getEndDate()); - putIfNotBlank(body, "deptCode", param.getDeptCode()); - putIfNotBlank(body, "userCode", param.getUserCode()); - putIfNotBlank(body, "hospitalId", param.getHospitalId()); - body.put("extUserID", param.getExtUserID()); - return JSONUtil.toJSONString(body); - } - - private String buildNumberSourcesBody(BmeNumberSourcesParam param) { - Map body = new LinkedHashMap<>(); - body.put("mechanismId", param.getMechanismId()); - body.put("tradeCode", param.getTradeCode()); - body.put("startDate", param.getStartDate()); - body.put("endDate", param.getEndDate()); - putIfNotBlank(body, "deptCode", param.getDeptCode()); - putIfNotBlank(body, "userCode", param.getUserCode()); - putIfNotBlank(body, "aSTimeRange", param.getASTimeRange()); - putIfNotBlank(body, "hospitalId", param.getHospitalId()); - body.put("extUserID", param.getExtUserID()); - return JSONUtil.toJSONString(body); - } - - private void putIfNotBlank(Map body, String key, String value) { - if (StrUtil.isNotBlank(value)) { - body.put(key, value); - } - } - - private BmeToken ensureToken() { - ensureConfig(); - long now = System.currentTimeMillis() / 1000; - BmeToken cached = redisUtil.get(TOKEN_CACHE_KEY, BmeToken.class); - if (cached != null && cached.getExpireAt() > now + TOKEN_EXPIRE_MARGIN_SECONDS) { - return cached; - } - if (cached != null && StrUtil.isNotBlank(cached.getRefreshToken())) { - try { - return refreshToken(cached.getRefreshToken()); - } catch (Exception e) { - log.warn("刷新 access_token 失败,尝试重新申请: {}", e.getMessage()); - } - } - return fetchToken(); - } - - private BmeToken fetchToken() { - long timestamp = System.currentTimeMillis() / 1000; - String nonce = IdUtil.fastSimpleUUID(); - String grantType = "secret"; - Map form = new HashMap<>(); - form.put("appid", properties.getAppid()); - form.put("grant_type", grantType); - form.put("secret_key", properties.getSecretKey()); - form.put("timestamp", timestamp); - form.put("nonce", nonce); - String signStr = properties.getAppid() + "|" + properties.getSecretKey() + "|" + grantType + "|" + timestamp + "|" + nonce; - form.put("sign", DigestUtil.md5Hex(signStr)); - - HttpResponse response = HttpRequest.get(buildUrl("/cgi-bin/bme-auth/auth/access_token")) - .form(form) - .timeout(properties.getTimeoutMs()) - .execute(); - return handleTokenResponse(response); - } - - private BmeToken refreshToken(String refreshToken) { - long timestamp = System.currentTimeMillis() / 1000; - String nonce = IdUtil.fastSimpleUUID(); - String grantType = "refresh_token"; - Map form = new HashMap<>(); - form.put("appid", properties.getAppid()); - form.put("grant_type", grantType); - form.put("refresh_token", refreshToken); - form.put("timestamp", timestamp); - form.put("nonce", nonce); - String signStr = properties.getAppid() + "|" + properties.getSecretKey() + "|" + refreshToken + "|" + grantType + "|" + timestamp + "|" + nonce; - form.put("sign", DigestUtil.md5Hex(signStr)); - HttpResponse response = HttpRequest.get(buildUrl("/cgi-bin/bme-auth/auth/refresh_token")) - .form(form) - .timeout(properties.getTimeoutMs()) - .execute(); - return handleTokenResponse(response); - } - - private BmeToken handleTokenResponse(HttpResponse response) { - if (response.getStatus() != 200) { - throw new BusinessException("获取中台token失败,HTTP状态码:" + response.getStatus()); - } - JSONObject resp; - try { - resp = JSON.parseObject(response.body()); - } catch (Exception e) { - throw new BusinessException("解析中台token响应失败"); - } - if (resp == null || !"0".equals(resp.getString("code"))) { - String message = resp != null ? resp.getString("msg") : "未知错误"; - throw new BusinessException("获取中台token失败:" + message); - } - JSONObject data = resp.getJSONObject("data"); - if (data == null) { - throw new BusinessException("中台token响应缺少数据"); - } - String accessToken = data.getString("access_token"); - String refreshToken = data.getString("refresh_token"); - int expiresIn = data.getIntValue("expires_in"); - if (StrUtil.hasBlank(accessToken, refreshToken) || expiresIn <= 0) { - throw new BusinessException("中台token响应不完整"); - } - long expireAt = System.currentTimeMillis() / 1000 + expiresIn - TOKEN_EXPIRE_MARGIN_SECONDS; - BmeToken token = new BmeToken(); - token.setAccessToken(accessToken); - token.setRefreshToken(refreshToken); - token.setExpireAt(expireAt); - // refresh_token有效期5天,这里缓存5天 - redisUtil.set(TOKEN_CACHE_KEY, token, Duration.ofDays(5).getSeconds(), TimeUnit.SECONDS); - System.out.println("token = " + token); - return token; - } - - private void ensureConfig() { - if (StrUtil.hasBlank(properties.getBaseUrl(), properties.getAppid(), properties.getSecretKey())) { - throw new BusinessException("排班接口配置缺失,请检查 led.bme 配置"); - } - } - - private String buildUrl(String path) { - String base = properties.getBaseUrl(); - if (StrUtil.isBlank(base)) { - throw new BusinessException("排班接口基础地址未配置"); - } - if (base.endsWith("/")) { - base = base.substring(0, base.length() - 1); - } - if (!path.startsWith("/")) { - path = "/" + path; - } - // 兼容 baseUrl 已包含 /cgi-bin 的场景,避免拼接成 /cgi-bin/cgi-bin - if (base.endsWith("/cgi-bin") && path.startsWith("/cgi-bin/")) { - path = path.substring("/cgi-bin".length()); - } - return base + path; - } -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAppController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAppController.java deleted file mode 100644 index 001c3f8..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAppController.java +++ /dev/null @@ -1,328 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import cn.hutool.core.net.url.UrlBuilder; -import cn.hutool.core.net.url.UrlQuery; -import cn.hutool.core.util.DesensitizedUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpRequest; -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.TypeReference; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.gxwebsoft.common.core.security.JwtUtil; -import com.gxwebsoft.common.core.utils.CommonUtil; -import com.gxwebsoft.common.core.utils.RedisUtil; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.FileRecord; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.entity.OaAppUrl; -import com.gxwebsoft.oa.entity.OaAppUser; -import com.gxwebsoft.oa.service.OaAppService; -import com.gxwebsoft.oa.entity.OaApp; -import com.gxwebsoft.oa.param.OaAppParam; -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.oa.service.OaAppUrlService; -import com.gxwebsoft.oa.service.OaAppUserService; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -import static com.gxwebsoft.common.core.constants.AppUserConstants.ADMINISTRATOR; - -/** - * 应用控制器 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Tag(name = "应用管理") -@RestController -@RequestMapping("/api/oa/oa-app") -public class OaAppController extends BaseController { - @Resource - private OaAppService oaAppService; - @Resource - private OaAppUrlService oaAppUrlService; - @Resource - private OaAppUserService oaAppUserService; - @Resource - private RedisUtil redisUtil; - - @PreAuthorize("hasAuthority('oa:app:list')") - @Operation(summary = "分页查询应用") - @GetMapping("/page") - public ApiResult> page(OaAppParam param, HttpServletRequest request) { - final User loginUser = getLoginUser(); - // 未登录情况 - if(loginUser == null){ - String access_token = JwtUtil.getAccessToken(request); - param.setToken(access_token); - return success("案例列表",caseList(param)); - } - final Integer userId = loginUser.getUserId(); - loginUser.getRoles().forEach(d -> { - if(!StrUtil.equals(d.getRoleCode(),"superAdmin") && !StrUtil.equals(d.getRoleCode(),"admin")){ - // 非管理员按项目成员权限显示 - final List list = oaAppUserService.list(new LambdaQueryWrapper().eq(OaAppUser::getUserId, userId)); - System.out.println("非管理员按项目成员权限显示 list = " + list); - final Set collect = list.stream().map(OaAppUser::getAppId).collect(Collectors.toSet()); - param.setAppIds(collect); - } - }); - // 过滤续费提醒参数 - if (param.getAppStatus() != null && param.getAppStatus().equals("续费中")) { - param.setAppStatus(null); - } - // 使用关联查询 - return success(oaAppService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('oa:app:list')") - @Operation(summary = "查询全部应用") - @GetMapping() - public ApiResult> list(OaAppParam param) { - // 使用关联查询 - return success(oaAppService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:app:list')") - @Operation(summary = "根据id查询应用") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - final User loginUser = getLoginUser(); - // 未登录情况 - if(loginUser == null){ - return success("案例详情",getDesensitizedApp(id)); - } - if (!CommonUtil.hasRole(loginUser.getRoles(),"superAdmin") && !CommonUtil.hasRole(loginUser.getRoles(),"admin")) { - // 查询权限 - if (oaAppUserService.count(new LambdaQueryWrapper().eq(OaAppUser::getUserId, getLoginUserId()).eq(OaAppUser::getAppId,id)) == 0) { - return fail("无查看权限",null); - } - } - // 使用关联查询 - return success(oaAppService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('oa:app:save')") - @Operation(summary = "添加应用") - @PostMapping() - public ApiResult save(@RequestBody OaApp app) { - // 记录当前登录用户id、租户id、商户编号 - User loginUser = getLoginUser(); - OaAppUser appUser = new OaAppUser(); - if (loginUser != null) { - app.setUserId(loginUser.getUserId()); - app.setTenantId(loginUser.getTenantId()); - } - if (oaAppService.count(new LambdaQueryWrapper() - .eq(OaApp::getAppCode, app.getAppCode())) > 0) { - return fail("应用标识已存在"); - } - if (oaAppService.save(app)) { - // 添加应用管理员 - if (loginUser != null) { - appUser.setUserId(loginUser.getUserId()); - appUser.setNickname(loginUser.getNickname()); - appUser.setAppId(app.getAppId()); - appUser.setRole(ADMINISTRATOR); - oaAppUserService.save(appUser); - } - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:app:update')") - @Operation(summary = "修改应用") - @PutMapping() - public ApiResult update(@RequestBody OaApp oaApp) { - if (oaAppService.updateById(oaApp)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:app:remove')") - @Operation(summary = "删除应用") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAppService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('oa:app:save')") - @Operation(summary = "批量添加应用") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAppService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:app:update')") - @Operation(summary = "批量修改应用") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAppService, "app_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:app:remove')") - @Operation(summary = "批量删除应用") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAppService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "统计信息") - @GetMapping("/data") - public ApiResult> data() { - Map data = new HashMap<>(); - Integer totalNum = oaAppService.count( - new LambdaQueryWrapper<>() - ); - Integer totalNum2 = oaAppService.count( - new LambdaQueryWrapper() - .eq(OaApp::getAppStatus, "开发中") - ); - Integer totalNum3 = oaAppService.count( - new LambdaQueryWrapper() - .eq(OaApp::getAppStatus, "已上架") - ); - Integer totalNum4 = oaAppService.count( - new LambdaQueryWrapper() - .eq(OaApp::getAppStatus, "已上架") - .eq(OaApp::getShowExpiration,false) - ); - Integer totalNum5 = oaAppService.count( - new LambdaQueryWrapper() - .eq(OaApp::getAppStatus, "已下架") - ); - Integer totalNum6 = oaAppService.count( - new LambdaQueryWrapper() - .eq(OaApp::getShowCase,true) - ); - Integer totalNum7 = oaAppService.count( - new LambdaQueryWrapper() - .eq(OaApp::getShowIndex, true) - ); - - data.put("totalNum", totalNum); - data.put("totalNum2", totalNum2); - data.put("totalNum3", totalNum3); - data.put("totalNum4", totalNum4); - data.put("totalNum5", totalNum5); - data.put("totalNum6", totalNum6); - data.put("totalNum7", totalNum7); - return success(data); - } - - - // 读取案例列表 - private PageResult caseList(OaAppParam param){ - param.setShowCase(true); - final PageResult appPageResult = oaAppService.pageRel(param); - appPageResult.getList().forEach(d -> { - d.setContent(null); - // 读取账号列表 - d.setAppUrlList(oaAppUrlService.list(new LambdaQueryWrapper().eq(OaAppUrl::getAppId,d.getAppId()))); - // 读取项目附件(链式构建GET请求) - HashMap map = new HashMap<>(); - map.put("appId", d.getAppId()); - final String build = UrlBuilder.of("https://server.gxwebsoft.com/api/file/page").setQuery(new UrlQuery(map)).build(); - String response = HttpRequest.get(build) - .header("Authorization", param.getToken()) - .header("Tenantid", d.getTenantId().toString()) - .body(JSONObject.toJSONString(map))//表单内容 - .timeout(20000)//超时,毫秒 - .execute().body(); - - final ApiResult> userResult = JSONObject.parseObject(response, new TypeReference>>() { - }); - d.setAppFiles(userResult.getData().getList()); - }); - return appPageResult; - } - - private OaApp getDesensitizedApp(Integer id) { - final OaApp app = oaAppService.getByIdRel(id); - app.setPhone(DesensitizedUtil.mobilePhone(app.getPhone())); - app.setCompanyName( - StrUtil.hide(app.getCompanyName(), 2, app.getCompanyName().length() - 2)); - app.setRequirement(DesensitizedUtil.chineseName(app.getCompanyName())); - return app; - } - - @PreAuthorize("hasAuthority('oa:app:update')") - @Operation(summary = "重置秘钥") - @PostMapping("/updateAppSecret") - public ApiResult updateAppSecret(@RequestBody OaApp app) { - String key = "code:" + app.getPhone(); - final String code = redisUtil.get(key); - if (app.getAppId() == null) { - return fail("appId不合法"); - } - if(app.getAppSecret() == null){ - return fail("appSecret不合法"); - } - if(app.getAppCode() == null){ - return fail("短信验证码不正确"); - } -// && !app.getAppCode().equals("170083") - if(!app.getAppCode().equals(code)){ - return fail("短信验证码不正确"); - } - oaAppService.updateById(app); - // 保存到redis - redisUtil.set("AppSecret:" + app.getAppId(),app.getAppSecret()); - redisUtil.delete(key); - return success("重置成功",app.getAppSecret()); - } - - @PreAuthorize("hasAuthority('oa:app:list')") - @Operation(summary = "APP应用授权身份效验") - @GetMapping("/authentication/{appid}") - public ApiResult authentication(@PathVariable("appid") String appid) { - final OaApp appInfo = oaAppService.getById(appid); - if(appInfo == null){ - return fail("应用不存在:".concat(appid)); - } - return success("应用信息",appInfo); - } - - @Operation(summary = "查询我的项目信息") - @GetMapping("/getMyApp") - public ApiResult getMyApp() { - final User loginUser = getLoginUser(); - // 未登录情况 - if(loginUser == null){ - return fail("请先登录",null); - } - oaAppService.list(); - - // 使用关联查询 - return success("查询成功",null); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAppFieldController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAppFieldController.java deleted file mode 100644 index 7805e3c..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAppFieldController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAppFieldService; -import com.gxwebsoft.oa.entity.OaAppField; -import com.gxwebsoft.oa.param.OaAppFieldParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 应用参数控制器 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Tag(name = "应用参数管理") -@RestController -@RequestMapping("/api/oa/oa-app-field") -public class OaAppFieldController extends BaseController { - @Resource - private OaAppFieldService oaAppFieldService; - - @Operation(summary = "分页查询应用参数") - @GetMapping("/page") - public ApiResult> page(OaAppFieldParam param) { - // 使用关联查询 - return success(oaAppFieldService.pageRel(param)); - } - - @Operation(summary = "查询全部应用参数") - @GetMapping() - public ApiResult> list(OaAppFieldParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaAppFieldService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaAppFieldService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAppField:list')") - @OperationLog - @Operation(summary = "根据id查询应用参数") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaAppFieldService.getById(id)); - // 使用关联查询 - //return success(oaAppFieldService.getByIdRel(id)); - } - - @Operation(summary = "添加应用参数") - @PostMapping() - public ApiResult save(@RequestBody OaAppField oaAppField) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAppField.setUserId(loginUser.getUserId()); - } - if (oaAppFieldService.save(oaAppField)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改应用参数") - @PutMapping() - public ApiResult update(@RequestBody OaAppField oaAppField) { - if (oaAppFieldService.updateById(oaAppField)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除应用参数") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAppFieldService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加应用参数") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAppFieldService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改应用参数") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAppFieldService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除应用参数") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAppFieldService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAppRenewController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAppRenewController.java deleted file mode 100644 index bcd62bc..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAppRenewController.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.entity.OaApp; -import com.gxwebsoft.oa.service.OaAppRenewService; -import com.gxwebsoft.oa.entity.OaAppRenew; -import com.gxwebsoft.oa.param.OaAppRenewParam; -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.oa.service.OaAppService; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * 续费管理控制器 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Tag(name = "续费管理管理") -@RestController -@RequestMapping("/api/oa/oa-app-renew") -public class OaAppRenewController extends BaseController { - @Resource - private OaAppRenewService oaAppRenewService; - @Resource - private OaAppService oaAppService; - - @Operation(summary = "分页查询续费管理") - @GetMapping("/page") - public ApiResult> page(OaAppRenewParam param) { - // 使用关联查询 - return success(oaAppRenewService.pageRel(param)); - } - - @Operation(summary = "查询全部续费管理") - @GetMapping() - public ApiResult> list(OaAppRenewParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaAppRenewService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaAppRenewService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAppRenew:list')") - @OperationLog - @Operation(summary = "根据id查询续费管理") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaAppRenewService.getById(id)); - // 使用关联查询 - //return success(oaAppRenewService.getByIdRel(id)); - } - - @Operation(summary = "添加续费管理") - @PostMapping() - public ApiResult save(@RequestBody OaAppRenew oaAppRenew) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAppRenew.setUserId(loginUser.getUserId()); - } - if (oaAppRenewService.save(oaAppRenew)) { - oaAppService.update(new LambdaUpdateWrapper().eq(OaApp::getAppId, oaAppRenew.getAppId()).set(OaApp::getShowExpiration, true)); - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改续费管理") - @PutMapping() - public ApiResult update(@RequestBody OaAppRenew oaAppRenew) { - if (oaAppRenewService.updateById(oaAppRenew)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除续费管理") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAppRenewService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加续费管理") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAppRenewService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改续费管理") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAppRenewService, "app_renew_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除续费管理") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAppRenewService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - - @Operation(summary = "统计信息") - @GetMapping("/data") - public ApiResult> data() { - Map data = new HashMap<>(); - final User loginUser = getLoginUser(); - if(loginUser == null){ - return fail("请先登录",null); - } - - // 获取当前年份的起止时间 - LocalDateTime startOfYear = LocalDateTime.now().withMonth(1).withDayOfMonth(1) - .withHour(0).withMinute(0).withSecond(0); - LocalDateTime endOfYear = startOfYear.plusYears(1).minusNanos(1); - - // 今年应收续费总金额(到期时间在今年的记录) - BigDecimal totalNum1 = oaAppService.sumMoney(new LambdaQueryWrapper() - .between(OaApp::getExpirationTime, startOfYear, endOfYear)); - // 今年已收续费总金额(到期时间在今年的记录) - BigDecimal totalNum2 = oaAppRenewService.sumMoney(new LambdaQueryWrapper() - .between(OaAppRenew::getEndTime, startOfYear, endOfYear)); - - // 今年已收续费总金额(创建时间在今年且已支付的记录) - BigDecimal totalNum3 = oaAppRenewService.sumMoney(new LambdaQueryWrapper() - .between(OaAppRenew::getCreateTime, startOfYear, endOfYear) - .isNotNull(OaAppRenew::getMoney)); - - data.put("totalNum1", totalNum1 != null ? totalNum1 : BigDecimal.ZERO); - data.put("totalNum2", totalNum2 != null ? totalNum2 : BigDecimal.ZERO); - return success(data); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAppUrlController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAppUrlController.java deleted file mode 100644 index 49bf27b..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAppUrlController.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAppUrlService; -import com.gxwebsoft.oa.entity.OaAppUrl; -import com.gxwebsoft.oa.param.OaAppUrlParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 项目域名控制器 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Tag(name = "项目域名管理") -@RestController -@RequestMapping("/api/oa/oa-app-url") -public class OaAppUrlController extends BaseController { - @Resource - private OaAppUrlService oaAppUrlService; - - @Operation(summary = "分页查询项目域名") - @GetMapping("/page") - public ApiResult> page(OaAppUrlParam param) { - // 使用关联查询 - return success(oaAppUrlService.pageRel(param)); - } - - @Operation(summary = "查询全部项目域名") - @GetMapping() - public ApiResult> list(OaAppUrlParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaAppUrlService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaAppUrlService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAppUrl:list')") - @OperationLog - @Operation(summary = "根据id查询项目域名") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaAppUrlService.getById(id)); - // 使用关联查询 - //return success(oaAppUrlService.getByIdRel(id)); - } - - @Operation(summary = "添加项目域名") - @PostMapping() - public ApiResult save(@RequestBody OaAppUrl oaAppUrl) { - if (oaAppUrlService.save(oaAppUrl)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改项目域名") - @PutMapping() - public ApiResult update(@RequestBody OaAppUrl oaAppUrl) { - if (oaAppUrlService.updateById(oaAppUrl)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除项目域名") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAppUrlService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加项目域名") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAppUrlService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改项目域名") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAppUrlService, "app_url_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除项目域名") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAppUrlService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAppUserController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAppUserController.java deleted file mode 100644 index ab3687d..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAppUserController.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAppUserService; -import com.gxwebsoft.oa.entity.OaAppUser; -import com.gxwebsoft.oa.param.OaAppUserParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 应用成员控制器 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Tag(name = "应用成员管理") -@RestController -@RequestMapping("/api/oa/oa-app-user") -public class OaAppUserController extends BaseController { - @Resource - private OaAppUserService oaAppUserService; - - @Operation(summary = "分页查询应用成员") - @GetMapping("/page") - public ApiResult> page(OaAppUserParam param) { - // 使用关联查询 - return success(oaAppUserService.pageRel(param)); - } - - @Operation(summary = "查询全部应用成员") - @GetMapping() - public ApiResult> list(OaAppUserParam param) { - // 使用关联查询 - return success(oaAppUserService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAppUser:list')") - @OperationLog - @Operation(summary = "根据id查询应用成员") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(oaAppUserService.getByIdRel(id)); - } - - @Operation(summary = "添加应用成员") - @PostMapping() - public ApiResult save(@RequestBody OaAppUser oaAppUser) { - if (oaAppUserService.save(oaAppUser)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改应用成员") - @PutMapping() - public ApiResult update(@RequestBody OaAppUser oaAppUser) { - if (oaAppUserService.updateById(oaAppUser)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除应用成员") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAppUserService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加应用成员") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAppUserService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改应用成员") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAppUserService, "app_user_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除应用成员") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAppUserService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsCodeController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAssetsCodeController.java deleted file mode 100644 index bee4518..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsCodeController.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAssetsCodeService; -import com.gxwebsoft.oa.entity.OaAssetsCode; -import com.gxwebsoft.oa.param.OaAssetsCodeParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 代码仓库控制器 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:01 - */ -@Tag(name = "代码仓库管理") -@RestController -@RequestMapping("/api/oa/oa-assets-code") -public class OaAssetsCodeController extends BaseController { - @Resource - private OaAssetsCodeService oaAssetsCodeService; - - @PreAuthorize("hasAuthority('oa:oaAssetsCode:list')") - @Operation(summary = "分页查询代码仓库") - @GetMapping("/page") - public ApiResult> page(OaAssetsCodeParam param) { - // 使用关联查询 - return success(oaAssetsCodeService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsCode:list')") - @Operation(summary = "查询全部代码仓库") - @GetMapping() - public ApiResult> list(OaAssetsCodeParam param) { - // 使用关联查询 - return success(oaAssetsCodeService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsCode:list')") - @Operation(summary = "根据id查询代码仓库") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(oaAssetsCodeService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsCode:save')") - @OperationLog - @Operation(summary = "添加代码仓库") - @PostMapping() - public ApiResult save(@RequestBody OaAssetsCode oaAssetsCode) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAssetsCode.setUserId(loginUser.getUserId()); - } - if (oaAssetsCodeService.save(oaAssetsCode)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsCode:update')") - @Operation(summary = "修改代码仓库") - @PutMapping() - public ApiResult update(@RequestBody OaAssetsCode oaAssetsCode) { - if (oaAssetsCodeService.updateById(oaAssetsCode)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsCode:remove')") - @Operation(summary = "删除代码仓库") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAssetsCodeService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsCode:save')") - @Operation(summary = "批量添加代码仓库") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAssetsCodeService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsCode:update')") - @Operation(summary = "批量修改代码仓库") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAssetsCodeService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsCode:remove')") - @Operation(summary = "批量删除代码仓库") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAssetsCodeService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAssetsController.java deleted file mode 100644 index 6f66706..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsController.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAssetsService; -import com.gxwebsoft.oa.entity.OaAssets; -import com.gxwebsoft.oa.param.OaAssetsParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 云服务器控制器 - * - * @author 科技小王子 - * @since 2024-10-18 18:34:15 - */ -@Tag(name = "云服务器管理") -@RestController -@RequestMapping("/api/oa/oa-assets") -public class OaAssetsController extends BaseController { - @Resource - private OaAssetsService oaAssetsService; - - @PreAuthorize("hasAuthority('oa:oaAssets:list')") - @Operation(summary = "分页查询云服务器") - @GetMapping("/page") - public ApiResult> page(OaAssetsParam param) { - // 使用关联查询 - return success(oaAssetsService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssets:list')") - @Operation(summary = "查询全部云服务器") - @GetMapping() - public ApiResult> list(OaAssetsParam param) { - // 使用关联查询 - return success(oaAssetsService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssets:list')") - @Operation(summary = "根据id查询云服务器") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(oaAssetsService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('oa:oaAssets:save')") - @OperationLog - @Operation(summary = "添加云服务器") - @PostMapping() - public ApiResult save(@RequestBody OaAssets oaAssets) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAssets.setUserId(loginUser.getUserId()); - } - if (oaAssetsService.save(oaAssets)) { - return success("添加成功"); - } - return fail("添加失败"); - } - @PreAuthorize("hasAuthority('oa:oaAssets:update')") - @Operation(summary = "修改云服务器") - @PutMapping() - public ApiResult update(@RequestBody OaAssets oaAssets) { - if (oaAssetsService.updateById(oaAssets)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssets:remvoe')") - @Operation(summary = "删除云服务器") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAssetsService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssets:save')") - @Operation(summary = "批量添加云服务器") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAssetsService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssets:update')") - @Operation(summary = "批量修改云服务器") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAssetsService, "assets_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssets:remove')") - @Operation(summary = "批量删除云服务器") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAssetsService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsDomainController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAssetsDomainController.java deleted file mode 100644 index bacd540..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsDomainController.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAssetsDomainService; -import com.gxwebsoft.oa.entity.OaAssetsDomain; -import com.gxwebsoft.oa.param.OaAssetsDomainParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 域名控制器 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Tag(name = "域名管理") -@RestController -@RequestMapping("/api/oa/oa-assets-domain") -public class OaAssetsDomainController extends BaseController { - @Resource - private OaAssetsDomainService oaAssetsDomainService; - - @PreAuthorize("hasAuthority('oa:oaAssetsDomain:list')") - @Operation(summary = "分页查询域名") - @GetMapping("/page") - public ApiResult> page(OaAssetsDomainParam param) { - // 使用关联查询 - return success(oaAssetsDomainService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsDomain:list')") - @Operation(summary = "查询全部域名") - @GetMapping() - public ApiResult> list(OaAssetsDomainParam param) { - // 使用关联查询 - return success(oaAssetsDomainService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsDomain:list')") - @Operation(summary = "根据id查询域名") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(oaAssetsDomainService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsDomain:save')") - @OperationLog - @Operation(summary = "添加域名") - @PostMapping() - public ApiResult save(@RequestBody OaAssetsDomain oaAssetsDomain) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAssetsDomain.setUserId(loginUser.getUserId()); - } - if (oaAssetsDomainService.save(oaAssetsDomain)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsDomain:update')") - @Operation(summary = "修改域名") - @PutMapping() - public ApiResult update(@RequestBody OaAssetsDomain oaAssetsDomain) { - if (oaAssetsDomainService.updateById(oaAssetsDomain)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsDomain:remove')") - @Operation(summary = "删除域名") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAssetsDomainService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsDomain:save')") - @Operation(summary = "批量添加域名") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAssetsDomainService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsDomain:update')") - @Operation(summary = "批量修改域名") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAssetsDomainService, "domain_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsDomain:remove')") - @Operation(summary = "批量删除域名") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAssetsDomainService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsEmailController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAssetsEmailController.java deleted file mode 100644 index 551905c..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsEmailController.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAssetsEmailService; -import com.gxwebsoft.oa.entity.OaAssetsEmail; -import com.gxwebsoft.oa.param.OaAssetsEmailParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 企业邮箱记录表控制器 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Tag(name = "企业邮箱记录表管理") -@RestController -@RequestMapping("/api/oa/oa-assets-email") -public class OaAssetsEmailController extends BaseController { - @Resource - private OaAssetsEmailService oaAssetsEmailService; - - @PreAuthorize("hasAuthority('oa:oaAssetsEmail:list')") - @Operation(summary = "分页查询企业邮箱记录表") - @GetMapping("/page") - public ApiResult> page(OaAssetsEmailParam param) { - // 使用关联查询 - return success(oaAssetsEmailService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsEmail:list')") - @Operation(summary = "查询全部企业邮箱记录表") - @GetMapping() - public ApiResult> list(OaAssetsEmailParam param) { - // 使用关联查询 - return success(oaAssetsEmailService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsEmail:list')") - @OperationLog - @Operation(summary = "根据id查询企业邮箱记录表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(oaAssetsEmailService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsEmail:save')") - @OperationLog - @Operation(summary = "添加企业邮箱记录表") - @PostMapping() - public ApiResult save(@RequestBody OaAssetsEmail oaAssetsEmail) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAssetsEmail.setUserId(loginUser.getUserId()); - } - if (oaAssetsEmailService.save(oaAssetsEmail)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsEmail:update')") - @Operation(summary = "修改企业邮箱记录表") - @PutMapping() - public ApiResult update(@RequestBody OaAssetsEmail oaAssetsEmail) { - if (oaAssetsEmailService.updateById(oaAssetsEmail)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsEmail:remove')") - @Operation(summary = "删除企业邮箱记录表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAssetsEmailService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsEmail:save')") - @Operation(summary = "批量添加企业邮箱记录表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAssetsEmailService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsEmail:update')") - @Operation(summary = "批量修改企业邮箱记录表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAssetsEmailService, "email_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsEmail:remove')") - @Operation(summary = "批量删除企业邮箱记录表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAssetsEmailService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsMysqlController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAssetsMysqlController.java deleted file mode 100644 index db6dc1c..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsMysqlController.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAssetsMysqlService; -import com.gxwebsoft.oa.entity.OaAssetsMysql; -import com.gxwebsoft.oa.param.OaAssetsMysqlParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 云数据库控制器 - * - * @author 科技小王子 - * @since 2024-10-18 19:00:20 - */ -@Tag(name = "云数据库管理") -@RestController -@RequestMapping("/api/oa/oa-assets-mysql") -public class OaAssetsMysqlController extends BaseController { - @Resource - private OaAssetsMysqlService oaAssetsMysqlService; - - @PreAuthorize("hasAuthority('oa:oaAssetsMysql:list')") - @Operation(summary = "分页查询云数据库") - @GetMapping("/page") - public ApiResult> page(OaAssetsMysqlParam param) { - // 使用关联查询 - return success(oaAssetsMysqlService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsMysql:list')") - @Operation(summary = "查询全部云数据库") - @GetMapping() - public ApiResult> list(OaAssetsMysqlParam param) { - // 使用关联查询 - return success(oaAssetsMysqlService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsMysql:list')") - @Operation(summary = "根据id查询云数据库") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(oaAssetsMysqlService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsMysql:save')") - @Operation(summary = "添加云数据库") - @OperationLog - @PostMapping() - public ApiResult save(@RequestBody OaAssetsMysql oaAssetsMysql) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAssetsMysql.setUserId(loginUser.getUserId()); - } - if (oaAssetsMysqlService.save(oaAssetsMysql)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsMysql:update')") - @Operation(summary = "修改云数据库") - @PutMapping() - public ApiResult update(@RequestBody OaAssetsMysql oaAssetsMysql) { - if (oaAssetsMysqlService.updateById(oaAssetsMysql)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsMysql:remove')") - @Operation(summary = "删除云数据库") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAssetsMysqlService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - @PreAuthorize("hasAuthority('oa:oaAssetsMysql:save')") - @Operation(summary = "批量添加云数据库") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAssetsMysqlService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsMysql:update')") - @Operation(summary = "批量修改云数据库") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAssetsMysqlService, "mysql_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - @PreAuthorize("hasAuthority('oa:oaAssetsMysql:remove')") - @Operation(summary = "批量删除云数据库") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAssetsMysqlService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsServerController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAssetsServerController.java deleted file mode 100644 index f8d4275..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsServerController.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.entity.OaAssetsServer; -import com.gxwebsoft.oa.param.OaAssetsServerParam; -import com.gxwebsoft.oa.service.OaAssetsServerService; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 服务控制器 - * - * @author 科技小王子 - * @since 2024-10-21 19:15:26 - */ -@Tag(name = "服务管理") -@RestController -@RequestMapping("/api/oa/oa-assets-server") -public class OaAssetsServerController extends BaseController { - @Resource - private OaAssetsServerService oaAssetsServerService; - - @Operation(summary = "分页查询服务") - @GetMapping("/page") - public ApiResult> page(OaAssetsServerParam param) { - // 使用关联查询 - return success(oaAssetsServerService.pageRel(param)); - } - - @Operation(summary = "查询全部服务") - @GetMapping() - public ApiResult> list(OaAssetsServerParam param) { - // 使用关联查询 - return success(oaAssetsServerService.listRel(param)); - } - - @Operation(summary = "根据id查询服务") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(oaAssetsServerService.getByIdRel(id)); - } - @PreAuthorize("hasAuthority('oa:oaAssetsServer:save')") - @Operation(summary = "添加服务") - @PostMapping() - public ApiResult save(@RequestBody OaAssetsServer oaAssetsServer) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAssetsServer.setUserId(loginUser.getUserId()); - oaAssetsServer.setTenantId(loginUser.getTenantId()); - } - if (oaAssetsServerService.save(oaAssetsServer)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsServer:update')") - @Operation(summary = "修改服务") - @PutMapping() - public ApiResult update(@RequestBody OaAssetsServer oaAssetsServer) { - if (oaAssetsServerService.updateById(oaAssetsServer)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsServer:remove')") - @Operation(summary = "删除服务") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAssetsServerService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsServer:save')") - @Operation(summary = "批量添加服务") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAssetsServerService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsServer:update')") - @Operation(summary = "批量修改服务") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAssetsServerService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsServer:remove')") - @Operation(summary = "批量删除服务") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAssetsServerService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsSiteController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAssetsSiteController.java deleted file mode 100644 index a1f8286..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsSiteController.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAssetsSiteService; -import com.gxwebsoft.oa.entity.OaAssetsSite; -import com.gxwebsoft.oa.param.OaAssetsSiteParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 网站信息记录表控制器 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Tag(name = "网站信息记录表管理") -@RestController -@RequestMapping("/api/oa/oa-assets-site") -public class OaAssetsSiteController extends BaseController { - @Resource - private OaAssetsSiteService oaAssetsSiteService; - - @PreAuthorize("hasAuthority('oa:oaAssetsSite:list')") - @Operation(summary = "分页查询网站信息记录表") - @GetMapping("/page") - public ApiResult> page(OaAssetsSiteParam param) { - // 使用关联查询 - return success(oaAssetsSiteService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSite:list')") - @Operation(summary = "查询全部网站信息记录表") - @GetMapping() - public ApiResult> list(OaAssetsSiteParam param) { - // 使用关联查询 - return success(oaAssetsSiteService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSite:list')") - @Operation(summary = "根据id查询网站信息记录表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(oaAssetsSiteService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSite:save')") - @OperationLog - @Operation(summary = "添加网站信息记录表") - @PostMapping() - public ApiResult save(@RequestBody OaAssetsSite oaAssetsSite) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAssetsSite.setUserId(loginUser.getUserId()); - } - if (oaAssetsSiteService.save(oaAssetsSite)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSite:update')") - @Operation(summary = "修改网站信息记录表") - @PutMapping() - public ApiResult update(@RequestBody OaAssetsSite oaAssetsSite) { - if (oaAssetsSiteService.updateById(oaAssetsSite)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSite:remove')") - @Operation(summary = "删除网站信息记录表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAssetsSiteService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSite:save')") - @Operation(summary = "批量添加网站信息记录表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAssetsSiteService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSite:update')") - @Operation(summary = "批量修改网站信息记录表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAssetsSiteService, "website_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSite:remove')") - @Operation(summary = "批量删除网站信息记录表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAssetsSiteService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsSoftwareCertController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAssetsSoftwareCertController.java deleted file mode 100644 index 4cd4b82..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsSoftwareCertController.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAssetsSoftwareCertService; -import com.gxwebsoft.oa.entity.OaAssetsSoftwareCert; -import com.gxwebsoft.oa.param.OaAssetsSoftwareCertParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 计算机软件著作权登记控制器 - * - * @author 科技小王子 - * @since 2024-10-18 19:46:21 - */ -@Tag(name = "计算机软件著作权登记管理") -@RestController -@RequestMapping("/api/oa/oa-assets-software-cert") -public class OaAssetsSoftwareCertController extends BaseController { - @Resource - private OaAssetsSoftwareCertService oaAssetsSoftwareCertService; - - @PreAuthorize("hasAuthority('oa:oaAssetsSoftwareCert:list')") - @Operation(summary = "分页查询计算机软件著作权登记") - @GetMapping("/page") - public ApiResult> page(OaAssetsSoftwareCertParam param) { - // 使用关联查询 - return success(oaAssetsSoftwareCertService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSoftwareCert:list')") - @Operation(summary = "查询全部计算机软件著作权登记") - @GetMapping() - public ApiResult> list(OaAssetsSoftwareCertParam param) { - // 使用关联查询 - return success(oaAssetsSoftwareCertService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSoftwareCert:list')") - @Operation(summary = "根据id查询计算机软件著作权登记") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(oaAssetsSoftwareCertService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSoftwareCert:save')") - @OperationLog - @Operation(summary = "添加计算机软件著作权登记") - @PostMapping() - public ApiResult save(@RequestBody OaAssetsSoftwareCert oaAssetsSoftwareCert) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAssetsSoftwareCert.setUserId(loginUser.getUserId()); - } - if (oaAssetsSoftwareCertService.save(oaAssetsSoftwareCert)) { - return success("添加成功"); - } - return fail("添加失败"); - } - @PreAuthorize("hasAuthority('oa:oaAssetsSoftwareCert:update')") - @Operation(summary = "修改计算机软件著作权登记") - @PutMapping() - public ApiResult update(@RequestBody OaAssetsSoftwareCert oaAssetsSoftwareCert) { - if (oaAssetsSoftwareCertService.updateById(oaAssetsSoftwareCert)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSoftwareCert:remove')") - @Operation(summary = "删除计算机软件著作权登记") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAssetsSoftwareCertService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSoftwareCert:save')") - @Operation(summary = "批量添加计算机软件著作权登记") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAssetsSoftwareCertService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSoftwareCert:update')") - @Operation(summary = "批量修改计算机软件著作权登记") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAssetsSoftwareCertService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSoftwareCert:remove')") - @Operation(summary = "批量删除计算机软件著作权登记") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAssetsSoftwareCertService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsSslController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAssetsSslController.java deleted file mode 100644 index 0d27eb2..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsSslController.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAssetsSslService; -import com.gxwebsoft.oa.entity.OaAssetsSsl; -import com.gxwebsoft.oa.param.OaAssetsSslParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.time.LocalDateTime; -import java.util.List; - -/** - * ssl证书控制器 - * - * @author 科技小王子 - * @since 2024-10-18 19:25:40 - */ -@Tag(name = "ssl证书管理") -@RestController -@RequestMapping("/api/oa/oa-assets-ssl") -public class OaAssetsSslController extends BaseController { - @Resource - private OaAssetsSslService oaAssetsSslService; - - @PreAuthorize("hasAuthority('oa:oaAssetsSsl:list')") - @Operation(summary = "分页查询ssl证书") - @GetMapping("/page") - public ApiResult> page(OaAssetsSslParam param) { - // 使用关联查询 - return success(oaAssetsSslService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSsl:list')") - @Operation(summary = "查询全部ssl证书") - @GetMapping() - public ApiResult> list(OaAssetsSslParam param) { - // 使用关联查询 - return success(oaAssetsSslService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSsl:list')") - @OperationLog - @Operation(summary = "根据id查询ssl证书") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(oaAssetsSslService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSsl:save')") - @Operation(summary = "添加ssl证书") - @PostMapping() - public ApiResult save(@RequestBody OaAssetsSsl oaAssetsSsl) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAssetsSsl.setUserId(loginUser.getUserId()); - oaAssetsSsl.setTenantId(loginUser.getTenantId()); - } - if (oaAssetsSslService.save(oaAssetsSsl)) { - return success("添加成功"); - } - return fail("添加失败"); - } - @PreAuthorize("hasAuthority('oa:oaAssetsSsl:update')") - @Operation(summary = "修改ssl证书") - @PutMapping() - public ApiResult update(@RequestBody OaAssetsSsl oaAssetsSsl) { - if (oaAssetsSslService.updateById(oaAssetsSsl)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSsl:remove')") - @Operation(summary = "删除ssl证书") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAssetsSslService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSsl:save')") - @Operation(summary = "批量添加ssl证书") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAssetsSslService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSsl:update')") - @Operation(summary = "批量修改ssl证书") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAssetsSslService, "ssl_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsSsl:remove')") - @Operation(summary = "批量删除ssl证书") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAssetsSslService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsTrademarkController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAssetsTrademarkController.java deleted file mode 100644 index 18a5bf6..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsTrademarkController.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAssetsTrademarkService; -import com.gxwebsoft.oa.entity.OaAssetsTrademark; -import com.gxwebsoft.oa.param.OaAssetsTrademarkParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 商标注册控制器 - * - * @author 科技小王子 - * @since 2024-10-18 19:46:21 - */ -@Tag(name = "商标注册管理") -@RestController -@RequestMapping("/api/oa/oa-assets-trademark") -public class OaAssetsTrademarkController extends BaseController { - @Resource - private OaAssetsTrademarkService oaAssetsTrademarkService; - - @PreAuthorize("hasAuthority('oa:oaAssetsTrademark:list')") - @Operation(summary = "分页查询商标注册") - @GetMapping("/page") - public ApiResult> page(OaAssetsTrademarkParam param) { - // 使用关联查询 - return success(oaAssetsTrademarkService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsTrademark:list')") - @Operation(summary = "查询全部商标注册") - @GetMapping() - public ApiResult> list(OaAssetsTrademarkParam param) { - // 使用关联查询 - return success(oaAssetsTrademarkService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsTrademark:list')") - @Operation(summary = "根据id查询商标注册") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(oaAssetsTrademarkService.getByIdRel(id)); - } - @PreAuthorize("hasAuthority('oa:oaAssetsTrademark:save')") - @Operation(summary = "添加商标注册") - @OperationLog - @PostMapping() - public ApiResult save(@RequestBody OaAssetsTrademark oaAssetsTrademark) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAssetsTrademark.setUserId(loginUser.getUserId()); - } - if (oaAssetsTrademarkService.save(oaAssetsTrademark)) { - return success("添加成功"); - } - return fail("添加失败"); - } - @PreAuthorize("hasAuthority('oa:oaAssetsTrademark:update')") - @Operation(summary = "修改商标注册") - @PutMapping() - public ApiResult update(@RequestBody OaAssetsTrademark oaAssetsTrademark) { - if (oaAssetsTrademarkService.updateById(oaAssetsTrademark)) { - return success("修改成功"); - } - return fail("修改失败"); - } - @PreAuthorize("hasAuthority('oa:oaAssetsTrademark:remove')") - @Operation(summary = "删除商标注册") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAssetsTrademarkService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsTrademark:save')") - @Operation(summary = "批量添加商标注册") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAssetsTrademarkService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsTrademark:update')") - @Operation(summary = "批量修改商标注册") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAssetsTrademarkService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsTrademark:remove')") - @Operation(summary = "批量删除商标注册") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAssetsTrademarkService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsUserController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAssetsUserController.java deleted file mode 100644 index 30f47db..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsUserController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAssetsUserService; -import com.gxwebsoft.oa.entity.OaAssetsUser; -import com.gxwebsoft.oa.param.OaAssetsUserParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 服务器成员管理控制器 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Tag(name = "服务器成员管理管理") -@RestController -@RequestMapping("/api/oa/oa-assets-user") -public class OaAssetsUserController extends BaseController { - @Resource - private OaAssetsUserService oaAssetsUserService; - - @Operation(summary = "分页查询服务器成员管理") - @GetMapping("/page") - public ApiResult> page(OaAssetsUserParam param) { - // 使用关联查询 - return success(oaAssetsUserService.pageRel(param)); - } - - @Operation(summary = "查询全部服务器成员管理") - @GetMapping() - public ApiResult> list(OaAssetsUserParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaAssetsUserService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaAssetsUserService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsUser:list')") - @OperationLog - @Operation(summary = "根据id查询服务器成员管理") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaAssetsUserService.getById(id)); - // 使用关联查询 - //return success(oaAssetsUserService.getByIdRel(id)); - } - - @Operation(summary = "添加服务器成员管理") - @PostMapping() - public ApiResult save(@RequestBody OaAssetsUser oaAssetsUser) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAssetsUser.setUserId(loginUser.getUserId()); - } - if (oaAssetsUserService.save(oaAssetsUser)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改服务器成员管理") - @PutMapping() - public ApiResult update(@RequestBody OaAssetsUser oaAssetsUser) { - if (oaAssetsUserService.updateById(oaAssetsUser)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除服务器成员管理") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAssetsUserService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加服务器成员管理") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAssetsUserService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改服务器成员管理") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAssetsUserService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除服务器成员管理") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAssetsUserService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsVhostController.java b/src/main/java/com/gxwebsoft/oa/controller/OaAssetsVhostController.java deleted file mode 100644 index 17b5875..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaAssetsVhostController.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaAssetsVhostService; -import com.gxwebsoft.oa.entity.OaAssetsVhost; -import com.gxwebsoft.oa.param.OaAssetsVhostParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 虚拟主机记录表控制器 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Tag(name = "虚拟主机记录表管理") -@RestController -@RequestMapping("/api/oa/oa-assets-vhost") -public class OaAssetsVhostController extends BaseController { - @Resource - private OaAssetsVhostService oaAssetsVhostService; - - @PreAuthorize("hasAuthority('oa:oaAssetsVhost:list')") - @Operation(summary = "分页查询虚拟主机记录表") - @GetMapping("/page") - public ApiResult> page(OaAssetsVhostParam param) { - // 使用关联查询 - return success(oaAssetsVhostService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsVhost:list')") - @Operation(summary = "查询全部虚拟主机记录表") - @GetMapping() - public ApiResult> list(OaAssetsVhostParam param) { - // 使用关联查询 - return success(oaAssetsVhostService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsVhost:list')") - @Operation(summary = "根据id查询虚拟主机记录表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(oaAssetsVhostService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsVhost:save')") - @OperationLog - @Operation(summary = "添加虚拟主机记录表") - @PostMapping() - public ApiResult save(@RequestBody OaAssetsVhost oaAssetsVhost) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaAssetsVhost.setUserId(loginUser.getUserId()); - } - if (oaAssetsVhostService.save(oaAssetsVhost)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsVhost:update')") - @Operation(summary = "修改虚拟主机记录表") - @PutMapping() - public ApiResult update(@RequestBody OaAssetsVhost oaAssetsVhost) { - if (oaAssetsVhostService.updateById(oaAssetsVhost)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsVhost:remove')") - @Operation(summary = "删除虚拟主机记录表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaAssetsVhostService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsVhost:save')") - @Operation(summary = "批量添加虚拟主机记录表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaAssetsVhostService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsVhost:update')") - @Operation(summary = "批量修改虚拟主机记录表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaAssetsVhostService, "vhost_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('oa:oaAssetsVhost:remove')") - @Operation(summary = "批量删除虚拟主机记录表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaAssetsVhostService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaCompanyController.java b/src/main/java/com/gxwebsoft/oa/controller/OaCompanyController.java deleted file mode 100644 index 338baad..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaCompanyController.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.oa.service.OaCompanyService; -import com.gxwebsoft.oa.entity.OaCompany; -import com.gxwebsoft.oa.param.OaCompanyParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 企业信息控制器 - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -@Tag(name = "企业信息管理") -@RestController -@RequestMapping("/api/oa/oa-company") -public class OaCompanyController extends BaseController { - @Resource - private OaCompanyService oaCompanyService; - - @Operation(summary = "分页查询企业信息") - @GetMapping("/page") - public ApiResult> page(OaCompanyParam param) { - // 使用关联查询 - return success(oaCompanyService.pageRel(param)); - } - - @Operation(summary = "查询全部企业信息") - @GetMapping() - public ApiResult> list(OaCompanyParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaCompanyService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaCompanyService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaCompany:list')") - @OperationLog - @Operation(summary = "根据id查询企业信息") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaCompanyService.getById(id)); - // 使用关联查询 - //return success(oaCompanyService.getByIdRel(id)); - } - - @Operation(summary = "添加企业信息") - @PostMapping() - public ApiResult save(@RequestBody OaCompany oaCompany) { - if (oaCompanyService.save(oaCompany)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改企业信息") - @PutMapping() - public ApiResult update(@RequestBody OaCompany oaCompany) { - if (oaCompanyService.updateById(oaCompany)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除企业信息") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaCompanyService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加企业信息") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaCompanyService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改企业信息") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaCompanyService, "company_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除企业信息") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaCompanyService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaCompanyFieldController.java b/src/main/java/com/gxwebsoft/oa/controller/OaCompanyFieldController.java deleted file mode 100644 index f24b320..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaCompanyFieldController.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.oa.service.OaCompanyFieldService; -import com.gxwebsoft.oa.entity.OaCompanyField; -import com.gxwebsoft.oa.param.OaCompanyFieldParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 企业参数控制器 - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -@Tag(name = "企业参数管理") -@RestController -@RequestMapping("/api/oa/oa-company-field") -public class OaCompanyFieldController extends BaseController { - @Resource - private OaCompanyFieldService oaCompanyFieldService; - - @Operation(summary = "分页查询企业参数") - @GetMapping("/page") - public ApiResult> page(OaCompanyFieldParam param) { - // 使用关联查询 - return success(oaCompanyFieldService.pageRel(param)); - } - - @Operation(summary = "查询全部企业参数") - @GetMapping() - public ApiResult> list(OaCompanyFieldParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaCompanyFieldService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaCompanyFieldService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaCompanyField:list')") - @OperationLog - @Operation(summary = "根据id查询企业参数") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaCompanyFieldService.getById(id)); - // 使用关联查询 - //return success(oaCompanyFieldService.getByIdRel(id)); - } - - @Operation(summary = "添加企业参数") - @PostMapping() - public ApiResult save(@RequestBody OaCompanyField oaCompanyField) { - if (oaCompanyFieldService.save(oaCompanyField)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改企业参数") - @PutMapping() - public ApiResult update(@RequestBody OaCompanyField oaCompanyField) { - if (oaCompanyFieldService.updateById(oaCompanyField)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除企业参数") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaCompanyFieldService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加企业参数") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaCompanyFieldService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改企业参数") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaCompanyFieldService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除企业参数") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaCompanyFieldService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaCompanyUserController.java b/src/main/java/com/gxwebsoft/oa/controller/OaCompanyUserController.java deleted file mode 100644 index dcb2653..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaCompanyUserController.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.oa.service.OaCompanyUserService; -import com.gxwebsoft.oa.entity.OaCompanyUser; -import com.gxwebsoft.oa.param.OaCompanyUserParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 成员管理控制器 - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -@Tag(name = "成员管理管理") -@RestController -@RequestMapping("/api/oa/oa-company-user") -public class OaCompanyUserController extends BaseController { - @Resource - private OaCompanyUserService oaCompanyUserService; - - @Operation(summary = "分页查询成员管理") - @GetMapping("/page") - public ApiResult> page(OaCompanyUserParam param) { - // 使用关联查询 - return success(oaCompanyUserService.pageRel(param)); - } - - @Operation(summary = "查询全部成员管理") - @GetMapping() - public ApiResult> list(OaCompanyUserParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaCompanyUserService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaCompanyUserService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaCompanyUser:list')") - @OperationLog - @Operation(summary = "根据id查询成员管理") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaCompanyUserService.getById(id)); - // 使用关联查询 - //return success(oaCompanyUserService.getByIdRel(id)); - } - - @Operation(summary = "添加成员管理") - @PostMapping() - public ApiResult save(@RequestBody OaCompanyUser oaCompanyUser) { - if (oaCompanyUserService.save(oaCompanyUser)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改成员管理") - @PutMapping() - public ApiResult update(@RequestBody OaCompanyUser oaCompanyUser) { - if (oaCompanyUserService.updateById(oaCompanyUser)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除成员管理") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaCompanyUserService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加成员管理") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaCompanyUserService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改成员管理") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaCompanyUserService, "company_user_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除成员管理") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaCompanyUserService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaLinkController.java b/src/main/java/com/gxwebsoft/oa/controller/OaLinkController.java deleted file mode 100644 index 9a7286e..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaLinkController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaLinkService; -import com.gxwebsoft.oa.entity.OaLink; -import com.gxwebsoft.oa.param.OaLinkParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 常用链接控制器 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Tag(name = "常用链接管理") -@RestController -@RequestMapping("/api/oa/oa-link") -public class OaLinkController extends BaseController { - @Resource - private OaLinkService oaLinkService; - - @Operation(summary = "分页查询常用链接") - @GetMapping("/page") - public ApiResult> page(OaLinkParam param) { - // 使用关联查询 - return success(oaLinkService.pageRel(param)); - } - - @Operation(summary = "查询全部常用链接") - @GetMapping() - public ApiResult> list(OaLinkParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaLinkService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaLinkService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaLink:list')") - @OperationLog - @Operation(summary = "根据id查询常用链接") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaLinkService.getById(id)); - // 使用关联查询 - //return success(oaLinkService.getByIdRel(id)); - } - - @Operation(summary = "添加常用链接") - @PostMapping() - public ApiResult save(@RequestBody OaLink oaLink) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaLink.setUserId(loginUser.getUserId()); - } - if (oaLinkService.save(oaLink)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改常用链接") - @PutMapping() - public ApiResult update(@RequestBody OaLink oaLink) { - if (oaLinkService.updateById(oaLink)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除常用链接") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaLinkService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加常用链接") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaLinkService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改常用链接") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaLinkService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除常用链接") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaLinkService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaProductController.java b/src/main/java/com/gxwebsoft/oa/controller/OaProductController.java deleted file mode 100644 index 0996cb6..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaProductController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaProductService; -import com.gxwebsoft.oa.entity.OaProduct; -import com.gxwebsoft.oa.param.OaProductParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 产品记录表控制器 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Tag(name = "产品记录表管理") -@RestController -@RequestMapping("/api/oa/oa-product") -public class OaProductController extends BaseController { - @Resource - private OaProductService oaProductService; - - @Operation(summary = "分页查询产品记录表") - @GetMapping("/page") - public ApiResult> page(OaProductParam param) { - // 使用关联查询 - return success(oaProductService.pageRel(param)); - } - - @Operation(summary = "查询全部产品记录表") - @GetMapping() - public ApiResult> list(OaProductParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaProductService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaProductService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaProduct:list')") - @OperationLog - @Operation(summary = "根据id查询产品记录表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaProductService.getById(id)); - // 使用关联查询 - //return success(oaProductService.getByIdRel(id)); - } - - @Operation(summary = "添加产品记录表") - @PostMapping() - public ApiResult save(@RequestBody OaProduct oaProduct) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaProduct.setUserId(loginUser.getUserId()); - } - if (oaProductService.save(oaProduct)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改产品记录表") - @PutMapping() - public ApiResult update(@RequestBody OaProduct oaProduct) { - if (oaProductService.updateById(oaProduct)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除产品记录表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaProductService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加产品记录表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaProductService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改产品记录表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaProductService, "product_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除产品记录表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaProductService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaProductTabsController.java b/src/main/java/com/gxwebsoft/oa/controller/OaProductTabsController.java deleted file mode 100644 index ac7836e..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaProductTabsController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaProductTabsService; -import com.gxwebsoft.oa.entity.OaProductTabs; -import com.gxwebsoft.oa.param.OaProductTabsParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 产品标签记录表控制器 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Tag(name = "产品标签记录表管理") -@RestController -@RequestMapping("/api/oa/oa-product-tabs") -public class OaProductTabsController extends BaseController { - @Resource - private OaProductTabsService oaProductTabsService; - - @Operation(summary = "分页查询产品标签记录表") - @GetMapping("/page") - public ApiResult> page(OaProductTabsParam param) { - // 使用关联查询 - return success(oaProductTabsService.pageRel(param)); - } - - @Operation(summary = "查询全部产品标签记录表") - @GetMapping() - public ApiResult> list(OaProductTabsParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaProductTabsService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaProductTabsService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaProductTabs:list')") - @OperationLog - @Operation(summary = "根据id查询产品标签记录表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaProductTabsService.getById(id)); - // 使用关联查询 - //return success(oaProductTabsService.getByIdRel(id)); - } - - @Operation(summary = "添加产品标签记录表") - @PostMapping() - public ApiResult save(@RequestBody OaProductTabs oaProductTabs) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaProductTabs.setUserId(loginUser.getUserId()); - } - if (oaProductTabsService.save(oaProductTabs)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改产品标签记录表") - @PutMapping() - public ApiResult update(@RequestBody OaProductTabs oaProductTabs) { - if (oaProductTabsService.updateById(oaProductTabs)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除产品标签记录表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaProductTabsService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加产品标签记录表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaProductTabsService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改产品标签记录表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaProductTabsService, "tab_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除产品标签记录表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaProductTabsService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaTaskController.java b/src/main/java/com/gxwebsoft/oa/controller/OaTaskController.java deleted file mode 100644 index fab3f41..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaTaskController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaTaskService; -import com.gxwebsoft.oa.entity.OaTask; -import com.gxwebsoft.oa.param.OaTaskParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 任务记录表控制器 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Tag(name = "任务记录表管理") -@RestController -@RequestMapping("/api/oa/oa-task") -public class OaTaskController extends BaseController { - @Resource - private OaTaskService oaTaskService; - - @Operation(summary = "分页查询任务记录表") - @GetMapping("/page") - public ApiResult> page(OaTaskParam param) { - // 使用关联查询 - return success(oaTaskService.pageRel(param)); - } - - @Operation(summary = "查询全部任务记录表") - @GetMapping() - public ApiResult> list(OaTaskParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaTaskService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaTaskService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaTask:list')") - @OperationLog - @Operation(summary = "根据id查询任务记录表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaTaskService.getById(id)); - // 使用关联查询 - //return success(oaTaskService.getByIdRel(id)); - } - - @Operation(summary = "添加任务记录表") - @PostMapping() - public ApiResult save(@RequestBody OaTask oaTask) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaTask.setUserId(loginUser.getUserId()); - } - if (oaTaskService.save(oaTask)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改任务记录表") - @PutMapping() - public ApiResult update(@RequestBody OaTask oaTask) { - if (oaTaskService.updateById(oaTask)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除任务记录表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaTaskService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加任务记录表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaTaskService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改任务记录表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaTaskService, "task_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除任务记录表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaTaskService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaTaskCountController.java b/src/main/java/com/gxwebsoft/oa/controller/OaTaskCountController.java deleted file mode 100644 index d4ba413..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaTaskCountController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaTaskCountService; -import com.gxwebsoft.oa.entity.OaTaskCount; -import com.gxwebsoft.oa.param.OaTaskCountParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 数据统计控制器 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Tag(name = "数据统计管理") -@RestController -@RequestMapping("/api/oa/oa-task-count") -public class OaTaskCountController extends BaseController { - @Resource - private OaTaskCountService oaTaskCountService; - - @Operation(summary = "分页查询数据统计") - @GetMapping("/page") - public ApiResult> page(OaTaskCountParam param) { - // 使用关联查询 - return success(oaTaskCountService.pageRel(param)); - } - - @Operation(summary = "查询全部数据统计") - @GetMapping() - public ApiResult> list(OaTaskCountParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaTaskCountService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaTaskCountService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaTaskCount:list')") - @OperationLog - @Operation(summary = "根据id查询数据统计") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaTaskCountService.getById(id)); - // 使用关联查询 - //return success(oaTaskCountService.getByIdRel(id)); - } - - @Operation(summary = "添加数据统计") - @PostMapping() - public ApiResult save(@RequestBody OaTaskCount oaTaskCount) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaTaskCount.setUserId(loginUser.getUserId()); - } - if (oaTaskCountService.save(oaTaskCount)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改数据统计") - @PutMapping() - public ApiResult update(@RequestBody OaTaskCount oaTaskCount) { - if (oaTaskCountService.updateById(oaTaskCount)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除数据统计") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaTaskCountService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加数据统计") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaTaskCountService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改数据统计") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaTaskCountService, "task_count_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除数据统计") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaTaskCountService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaTaskRecordController.java b/src/main/java/com/gxwebsoft/oa/controller/OaTaskRecordController.java deleted file mode 100644 index 8fa9d1d..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaTaskRecordController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaTaskRecordService; -import com.gxwebsoft.oa.entity.OaTaskRecord; -import com.gxwebsoft.oa.param.OaTaskRecordParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 工单回复记录表控制器 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Tag(name = "工单回复记录表管理") -@RestController -@RequestMapping("/api/oa/oa-task-record") -public class OaTaskRecordController extends BaseController { - @Resource - private OaTaskRecordService oaTaskRecordService; - - @Operation(summary = "分页查询工单回复记录表") - @GetMapping("/page") - public ApiResult> page(OaTaskRecordParam param) { - // 使用关联查询 - return success(oaTaskRecordService.pageRel(param)); - } - - @Operation(summary = "查询全部工单回复记录表") - @GetMapping() - public ApiResult> list(OaTaskRecordParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaTaskRecordService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaTaskRecordService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaTaskRecord:list')") - @OperationLog - @Operation(summary = "根据id查询工单回复记录表") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaTaskRecordService.getById(id)); - // 使用关联查询 - //return success(oaTaskRecordService.getByIdRel(id)); - } - - @Operation(summary = "添加工单回复记录表") - @PostMapping() - public ApiResult save(@RequestBody OaTaskRecord oaTaskRecord) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaTaskRecord.setUserId(loginUser.getUserId()); - } - if (oaTaskRecordService.save(oaTaskRecord)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改工单回复记录表") - @PutMapping() - public ApiResult update(@RequestBody OaTaskRecord oaTaskRecord) { - if (oaTaskRecordService.updateById(oaTaskRecord)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除工单回复记录表") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaTaskRecordService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加工单回复记录表") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaTaskRecordService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改工单回复记录表") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaTaskRecordService, "task_record_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除工单回复记录表") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaTaskRecordService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/controller/OaTaskUserController.java b/src/main/java/com/gxwebsoft/oa/controller/OaTaskUserController.java deleted file mode 100644 index 59423c9..0000000 --- a/src/main/java/com/gxwebsoft/oa/controller/OaTaskUserController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.gxwebsoft.oa.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.oa.service.OaTaskUserService; -import com.gxwebsoft.oa.entity.OaTaskUser; -import com.gxwebsoft.oa.param.OaTaskUserParam; -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 io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 工单成员控制器 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Tag(name = "工单成员管理") -@RestController -@RequestMapping("/api/oa/oa-task-user") -public class OaTaskUserController extends BaseController { - @Resource - private OaTaskUserService oaTaskUserService; - - @Operation(summary = "分页查询工单成员") - @GetMapping("/page") - public ApiResult> page(OaTaskUserParam param) { - // 使用关联查询 - return success(oaTaskUserService.pageRel(param)); - } - - @Operation(summary = "查询全部工单成员") - @GetMapping() - public ApiResult> list(OaTaskUserParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - return success(oaTaskUserService.list(page.getOrderWrapper())); - // 使用关联查询 - //return success(oaTaskUserService.listRel(param)); - } - - @PreAuthorize("hasAuthority('oa:oaTaskUser:list')") - @OperationLog - @Operation(summary = "根据id查询工单成员") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - return success(oaTaskUserService.getById(id)); - // 使用关联查询 - //return success(oaTaskUserService.getByIdRel(id)); - } - - @Operation(summary = "添加工单成员") - @PostMapping() - public ApiResult save(@RequestBody OaTaskUser oaTaskUser) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - oaTaskUser.setUserId(loginUser.getUserId()); - } - if (oaTaskUserService.save(oaTaskUser)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "修改工单成员") - @PutMapping() - public ApiResult update(@RequestBody OaTaskUser oaTaskUser) { - if (oaTaskUserService.updateById(oaTaskUser)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "删除工单成员") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (oaTaskUserService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @Operation(summary = "批量添加工单成员") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (oaTaskUserService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @Operation(summary = "批量修改工单成员") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(oaTaskUserService, "task_user_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @Operation(summary = "批量删除工单成员") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (oaTaskUserService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaApp.java b/src/main/java/com/gxwebsoft/oa/entity/OaApp.java deleted file mode 100644 index 4f2d41c..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaApp.java +++ /dev/null @@ -1,266 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -import com.gxwebsoft.common.system.entity.FileRecord; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 应用 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaApp对象", description = "应用") -public class OaApp implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "应用ID") - @TableId(value = "app_id", type = IdType.AUTO) - private Integer appId; - - @Schema(description = "应用名称") - private String appName; - - @Schema(description = "应用标识") - private String appCode; - - @Schema(description = "应用秘钥") - private String appSecret; - - @Schema(description = "上级id, 0是顶级") - private Integer parentId; - - @Schema(description = "应用类型") - private String appType; - - @Schema(description = "应用类型") - private String appTypeMultiple; - - @Schema(description = "类型, 0菜单, 1按钮") - private Integer menuType; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "企业名称") - private String companyName; - - @Schema(description = "应用图标") - private String appIcon; - - @Schema(description = "二维码") - private String appQrcode; - - @Schema(description = "链接地址") - private String appUrl; - - @Schema(description = "后台管理地址") - private String adminUrl; - - @Schema(description = "下载地址") - private String downUrl; - - @Schema(description = "链接地址") - private String serverUrl; - - @Schema(description = "文件服务器") - private String fileUrl; - - @Schema(description = "回调地址") - private String callbackUrl; - - @Schema(description = "腾讯文档地址") - private String docsUrl; - - @Schema(description = "代码仓库地址") - private String gitUrl; - - @Schema(description = "原型图地址") - private String prototypeUrl; - - @Schema(description = "IP白名单") - private String ipAddress; - - @Schema(description = "应用截图") - private String images; - - @Schema(description = "应用包名") - private String packageName; - - @Schema(description = "下载次数") - private Integer clicks; - - @Schema(description = "安装次数") - private Integer installs; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "应用介绍") - private String content; - - @Schema(description = "项目需求") - private String requirement; - - @Schema(description = "开发者(个人或公司)") - private String developer; - - @Schema(description = "项目负责人") - private String director; - - @Schema(description = "项目经理") - private String projectDirector; - - @Schema(description = "业务员") - private String salesman; - - @Schema(description = "软件定价") - private BigDecimal price; - - @Schema(description = "划线价格") - private BigDecimal linePrice; - - @Schema(description = "评分") - private String score; - - @Schema(description = "星级") - private String star; - - @Schema(description = "菜单路由地址") - private String path; - - @Schema(description = "菜单组件地址, 目录可为空") - private String component; - - @Schema(description = "权限标识") - private String authority; - - @Schema(description = "打开位置") - private String target; - - @Schema(description = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)") - private Integer hide; - - @Schema(description = "禁止搜索,1禁止 0 允许") - private Integer search; - - @Schema(description = "菜单侧栏选中的path") - private String active; - - @Schema(description = "其它路由元信息") - private String meta; - - @Schema(description = "版本,0正式版 1体验版 2开发版") - private String edition; - - @Schema(description = "版本号") - private String version; - - @Schema(description = "是否已安装") - private Integer isUse; - - @Schema(description = "附近1") - private String file1; - - @Schema(description = "附件2") - private String file2; - - @Schema(description = "附件3") - private String file3; - - @Schema(description = "是否显示续费提醒") - private Boolean showExpiration; - - @Schema(description = "是否作为案例展示") - private Integer showCase; - - @Schema(description = "是否显示在首页") - private Integer showIndex; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "到期时间") - private Date expirationTime; - - @Schema(description = "续费金额") - private BigDecimal renewMoney; - - @Schema(description = "应用状态") - private String appStatus; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "机构id") - private Integer organizationId; - - @Schema(description = "租户编号") - private String tenantCode; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - - @Schema(description = "成员管理") - @TableField(exist = false) - private List users; - - @Schema(description = "链接列表") - @TableField(exist = false) - private List appUrlList; - - @Schema(description = "项目附件") - @TableField(exist = false) - private List appFiles; - - @Schema(description = "主体名称") - @TableField(exist = false) - private String tenantName; - - @Schema(description = "开发者名称") - @TableField(exist = false) - private String realName; - - @Schema(description = "开发者名称") - @TableField(exist = false) - private String nickname; - - @Schema(description = "开发者头像") - @TableField(exist = false) - private String avatar; - - @Schema(description = "手机号码") - @TableField(exist = false) - private String phone; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAppField.java b/src/main/java/com/gxwebsoft/oa/entity/OaAppField.java deleted file mode 100644 index 2245088..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAppField.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.util.Date; -import java.io.Serializable; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 应用参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAppField对象", description = "应用参数") -public class OaAppField implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "应用ID") - private Integer appId; - - @Schema(description = "名称") - private String name; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "状态, 0正常, 1删除") - private Integer status; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private Date createTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAppRenew.java b/src/main/java/com/gxwebsoft/oa/entity/OaAppRenew.java deleted file mode 100644 index f7be2ca..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAppRenew.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.util.Date; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 续费管理 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAppRenew对象", description = "续费管理") -public class OaAppRenew implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "app_renew_id", type = IdType.AUTO) - private Integer appRenewId; - - @Schema(description = "应用ID") - private Integer appId; - - @Schema(description = "续费金额") - private BigDecimal money; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "开始时间") - private Date startTime; - - @Schema(description = "到期时间") - private Date endTime; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "付款凭证") - private String images; - - @Schema(description = "用户姓名") - private String nickname; - - @Schema(description = "状态, 0正常, 1待确认") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private Date createTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAppUrl.java b/src/main/java/com/gxwebsoft/oa/entity/OaAppUrl.java deleted file mode 100644 index c3369ed..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAppUrl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.util.Date; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 项目域名 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAppUrl对象", description = "项目域名") -public class OaAppUrl implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "app_url_id", type = IdType.AUTO) - private Integer appUrlId; - - @Schema(description = "应用ID") - private Integer appId; - - @Schema(description = "域名类型") - private String name; - - @Schema(description = "域名") - private String domain; - - @Schema(description = "账号") - private String account; - - @Schema(description = "密码") - private String password; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1待确认") - private Integer status; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "租户id") - private Integer tenantId; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAppUser.java b/src/main/java/com/gxwebsoft/oa/entity/OaAppUser.java deleted file mode 100644 index eaf1a08..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAppUser.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.util.Date; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 应用成员 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAppUser对象", description = "应用成员") -public class OaAppUser implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "app_user_id", type = IdType.AUTO) - private Integer appUserId; - - @Schema(description = "角色,10体验成员 20开发者成员 30管理员 ") - private Integer role; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "应用ID") - private Integer appId; - - @Schema(description = "昵称") - private String nickname; - - @Schema(description = "状态, 0正常, 1待确认") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private Date createTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAssets.java b/src/main/java/com/gxwebsoft/oa/entity/OaAssets.java deleted file mode 100644 index d4afe3e..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAssets.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 云服务器 - * - * @author 科技小王子 - * @since 2024-10-18 18:34:15 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAssets对象", description = "云服务器") -public class OaAssets implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "资产ID") - @TableId(value = "assets_id", type = IdType.AUTO) - private Integer assetsId; - - @Schema(description = "资产名称") - private String name; - - @Schema(description = "资产标识") - private String code; - - @Schema(description = "资产类型") - private String type; - - @Schema(description = "服务器厂商") - private String brand; - - @Schema(description = "服务器配置") - private String configuration; - - @Schema(description = "初始账号") - private String account; - - @Schema(description = "初始密码") - private String password; - - @Schema(description = "(阿里云/腾讯云)登录账号") - private String brandAccount; - - @Schema(description = "(阿里云/腾讯云)登录密码") - private String brandPassword; - - @Schema(description = "宝塔面板") - private String panel; - - @Schema(description = "宝塔面板账号") - private String panelAccount; - - @Schema(description = "宝塔面板密码") - private String panelPassword; - - @Schema(description = "财务信息-合同金额") - private BigDecimal financeAmount; - - @Schema(description = "购买年限") - private Integer financeYears; - - @Schema(description = "续费金额") - private BigDecimal financeRenew; - - @Schema(description = "客户名称") - private String financeCustomerName; - - @Schema(description = "客户联系人") - private String financeCustomerContact; - - @Schema(description = "客户联系电话") - private String financeCustomerPhone; - - @Schema(description = "客户ID") - private Integer customerId; - - @Schema(description = "客户名称") - private String customerName; - - @Schema(description = "开放端口") - private String openPort; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "购买时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date startTime; - - @Schema(description = "到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "可见性(public,private,protected)") - private String visibility; - - @Schema(description = "宝塔接口秘钥") - private String btSign; - - @Schema(description = "文章排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "客户ID") - private Integer companyId; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "机构id") - private Integer organizationId; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "应用名称") - @TableField(exist = false) - private String tenantName; - - @Schema(description = "应用图标") - @TableField(exist = false) - private String logo; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsCode.java b/src/main/java/com/gxwebsoft/oa/entity/OaAssetsCode.java deleted file mode 100644 index f304395..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsCode.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.util.Date; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 代码仓库 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:01 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAssetsCode对象", description = "代码仓库") -public class OaAssetsCode implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "服务器ID") - private Integer assetsId; - - @Schema(description = "名称") - private String name; - - @Schema(description = "英文标识") - private String code; - - @Schema(description = "仓库地址") - private String gitUrl; - - @Schema(description = "仓库品牌") - private String brand; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "应用名称") - @TableField(exist = false) - private String tenantName; - - @Schema(description = "应用图标") - @TableField(exist = false) - private String logo; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsDomain.java b/src/main/java/com/gxwebsoft/oa/entity/OaAssetsDomain.java deleted file mode 100644 index 5943d6a..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsDomain.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 域名 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAssetsDomain对象", description = "域名") -public class OaAssetsDomain implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "domain_id", type = IdType.AUTO) - private Integer domainId; - - @Schema(description = "服务器ID") - private Integer assetsId; - - @Schema(description = "域名") - private String name; - - @Schema(description = "域名标识") - private String code; - - @Schema(description = "注册厂商") - private String brand; - - @Schema(description = "初始账号") - private String account; - - @Schema(description = "初始密码") - private String password; - - @Schema(description = "价格") - private BigDecimal price; - - @Schema(description = "购买时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date startTime; - - @Schema(description = "到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "应用名称") - @TableField(exist = false) - private String tenantName; - - @Schema(description = "应用图标") - @TableField(exist = false) - private String logo; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsEmail.java b/src/main/java/com/gxwebsoft/oa/entity/OaAssetsEmail.java deleted file mode 100644 index a0e805b..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsEmail.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 企业邮箱记录表 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAssetsEmail对象", description = "企业邮箱记录表") -public class OaAssetsEmail implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "email_id", type = IdType.AUTO) - private Integer emailId; - - @Schema(description = "邮箱名称") - private String name; - - @Schema(description = "域名标识") - private String code; - - @Schema(description = "邮箱型号") - private String type; - - @Schema(description = "品牌厂商") - private String brand; - - @Schema(description = "初始账号") - private String system; - - @Schema(description = "价格") - private BigDecimal price; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "购买时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date startTime; - - @Schema(description = "到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "应用名称") - @TableField(exist = false) - private String tenantName; - - @Schema(description = "应用图标") - @TableField(exist = false) - private String logo; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsMysql.java b/src/main/java/com/gxwebsoft/oa/entity/OaAssetsMysql.java deleted file mode 100644 index b39315c..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsMysql.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 云数据库 - * - * @author 科技小王子 - * @since 2024-10-18 19:00:20 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAssetsMysql对象", description = "云数据库") -public class OaAssetsMysql implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "mysql_id", type = IdType.AUTO) - private Integer mysqlId; - - @Schema(description = "服务器ID") - private Integer assetsId; - - @Schema(description = "数据库名") - private String name; - - @Schema(description = "数据库标识") - private String code; - - @Schema(description = "注册厂商") - private String brand; - - @Schema(description = "ip地址") - private String ip; - - @Schema(description = "端口") - private String port; - - @Schema(description = "初始账号") - private String account; - - @Schema(description = "初始密码") - private String password; - - @Schema(description = "价格") - private BigDecimal price; - - @Schema(description = "购买时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date startTime; - - @Schema(description = "到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "应用名称") - @TableField(exist = false) - private String tenantName; - - @Schema(description = "应用图标") - @TableField(exist = false) - private String logo; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsServer.java b/src/main/java/com/gxwebsoft/oa/entity/OaAssetsServer.java deleted file mode 100644 index d389f06..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsServer.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.util.Date; - -/** - * 服务 - * - * @author 科技小王子 - * @since 2024-10-21 19:15:26 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAssetsServer对象", description = "服务") -public class OaAssetsServer implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "插件id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "服务名称") - private String server; - - @Schema(description = "接口地址") - private String serverUrl; - - @Schema(description = "排序号") - private Integer sortNumber; - - @Schema(description = "服务器ID") - private Integer assetsId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 10待审核 20已通过 30已驳回") - private Integer status; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "应用名称") - @TableField(exist = false) - private String tenantName; - - @Schema(description = "应用图标") - @TableField(exist = false) - private String logo; - - @Schema(description = "创建时间") - private Date createTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsSite.java b/src/main/java/com/gxwebsoft/oa/entity/OaAssetsSite.java deleted file mode 100644 index 705a419..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsSite.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.util.Date; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 网站信息记录表 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAssetsSite对象", description = "网站信息记录表") -public class OaAssetsSite implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "站点ID") - @TableId(value = "website_id", type = IdType.AUTO) - private Integer websiteId; - - @Schema(description = "网站名称") - private String websiteName; - - @Schema(description = "网站标识") - private String websiteCode; - - @Schema(description = "网站LOGO") - private String websiteIcon; - - @Schema(description = "网站LOGO") - private String websiteLogo; - - @Schema(description = "网站LOGO(深色模式)") - private String websiteDarkLogo; - - @Schema(description = "网站类型") - private String websiteType; - - @Schema(description = "网站关键词") - private String keywords; - - @Schema(description = "域名前缀") - private String prefix; - - @Schema(description = "绑定域名") - private String domain; - - @Schema(description = "全局样式") - private String style; - - @Schema(description = "后台管理地址") - private String adminUrl; - - @Schema(description = "应用版本 10免费版 20授权版 30永久授权") - private Integer version; - - @Schema(description = "服务到期时间") - private Date expirationTime; - - @Schema(description = "模版ID") - private Integer templateId; - - @Schema(description = "行业类型(父级)") - private String industryParent; - - @Schema(description = "行业类型(子级)") - private String industryChild; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "经度") - private String longitude; - - @Schema(description = "纬度") - private String latitude; - - @Schema(description = "街道地址") - private String address; - - @Schema(description = "联系电话") - private String phone; - - @Schema(description = "电子邮箱") - private String email; - - @Schema(description = "ICP备案号") - private String icpNo; - - @Schema(description = "公安备案") - private String policeNo; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "状态 0未开通 1运行中 2维护中 3已关闭 4已欠费停机 5违规关停") - private Integer status; - - @Schema(description = "维护说明") - private String statusText; - - @Schema(description = "关闭说明") - private String statusClose; - - @Schema(description = "全局样式") - private String styles; - - @Schema(description = "排序号") - private Integer sortNumber; - - @Schema(description = "服务器ID") - private Integer assetsId; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "应用名称") - @TableField(exist = false) - private String tenantName; - - @Schema(description = "应用图标") - @TableField(exist = false) - private String logo; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsSoftwareCert.java b/src/main/java/com/gxwebsoft/oa/entity/OaAssetsSoftwareCert.java deleted file mode 100644 index 78e2938..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsSoftwareCert.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 计算机软件著作权登记 - * - * @author 科技小王子 - * @since 2024-10-18 19:46:21 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAssetsSoftwareCert对象", description = "计算机软件著作权登记") -public class OaAssetsSoftwareCert implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "名称") - private String name; - - @Schema(description = "软件著作权标识") - private String code; - - @Schema(description = "证书类型") - private String type; - - @Schema(description = "品牌厂商") - private String brand; - - @Schema(description = "价格") - private BigDecimal price; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "证书下载地址") - private String certUrl; - - @Schema(description = "购买时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date startTime; - - @Schema(description = "到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "应用名称") - @TableField(exist = false) - private String tenantName; - - @Schema(description = "应用图标") - @TableField(exist = false) - private String logo; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsSsl.java b/src/main/java/com/gxwebsoft/oa/entity/OaAssetsSsl.java deleted file mode 100644 index b89e837..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsSsl.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * ssl证书 - * - * @author 科技小王子 - * @since 2024-10-18 19:25:40 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAssetsSsl对象", description = "ssl证书") -public class OaAssetsSsl implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "ssl_id", type = IdType.AUTO) - private Integer sslId; - - @Schema(description = "证书名称") - private String name; - - @Schema(description = "证书标识") - private String code; - - @Schema(description = "证书类型") - private String type; - - @Schema(description = "品牌厂商") - private String brand; - - @Schema(description = "价格") - private BigDecimal price; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "证书key") - private String certKey; - - @Schema(description = "证书pem") - private String certPem; - - @Schema(description = "证书下载地址") - private String certUrl; - - @Schema(description = "证书crt") - private String certCrt; - - @Schema(description = "购买时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date startTime; - - @Schema(description = "到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "即将过期") - private Integer soon; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "应用名称") - @TableField(exist = false) - private String tenantName; - - @Schema(description = "应用图标") - @TableField(exist = false) - private String logo; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsTrademark.java b/src/main/java/com/gxwebsoft/oa/entity/OaAssetsTrademark.java deleted file mode 100644 index 2b52097..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsTrademark.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 商标注册 - * - * @author 科技小王子 - * @since 2024-10-18 19:46:21 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAssetsTrademark对象", description = "商标注册") -public class OaAssetsTrademark implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "商标名称") - private String name; - - @Schema(description = "商标标识") - private String code; - - @Schema(description = "商标类型") - private String type; - - @Schema(description = "品牌厂商") - private String brand; - - @Schema(description = "价格") - private BigDecimal price; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "证书下载") - private String certUrl; - - @Schema(description = "购买时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date startTime; - - @Schema(description = "到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "应用名称") - @TableField(exist = false) - private String tenantName; - - @Schema(description = "应用图标") - @TableField(exist = false) - private String logo; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsUser.java b/src/main/java/com/gxwebsoft/oa/entity/OaAssetsUser.java deleted file mode 100644 index f38b406..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsUser.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.util.Date; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 服务器成员管理 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAssetsUser对象", description = "服务器成员管理") -public class OaAssetsUser implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "角色,10体验成员 20开发者成员 30管理员 ") - private Integer role; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "应用ID") - private Integer assetsId; - - @Schema(description = "昵称") - private String nickname; - - @Schema(description = "状态, 0正常, 1待确认") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private Date createTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsVhost.java b/src/main/java/com/gxwebsoft/oa/entity/OaAssetsVhost.java deleted file mode 100644 index 43d8628..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaAssetsVhost.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 虚拟主机记录表 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaAssetsVhost对象", description = "虚拟主机记录表") -public class OaAssetsVhost implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "vhost_id", type = IdType.AUTO) - private Integer vhostId; - - @Schema(description = "域名") - private String name; - - @Schema(description = "域名标识") - private String code; - - @Schema(description = "主机型号") - private String type; - - @Schema(description = "品牌厂商") - private String brand; - - @Schema(description = "初始账号") - private String account; - - @Schema(description = "初始密码") - private String password; - - @Schema(description = "价格") - private BigDecimal price; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "ssl证书") - private String ssl; - - @Schema(description = "购买时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date startTime; - - @Schema(description = "到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "服务器ID") - private Integer assetsId; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "应用名称") - @TableField(exist = false) - private String tenantName; - - @Schema(description = "应用图标") - @TableField(exist = false) - private String logo; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaCompany.java b/src/main/java/com/gxwebsoft/oa/entity/OaCompany.java deleted file mode 100644 index 5949c02..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaCompany.java +++ /dev/null @@ -1,192 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; -import java.util.Date; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 企业信息 - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaCompany对象", description = "企业信息") -public class OaCompany implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "企业id") - @TableId(value = "company_id", type = IdType.AUTO) - private Integer companyId; - - @Schema(description = "企业简称") - private String shortName; - - @Schema(description = "企业全称") - private String companyName; - - @Schema(description = "企业标识") - private String companyCode; - - @Schema(description = "类型 10企业 20政府单位") - private String companyType; - - @Schema(description = "企业类型多选") - private String companyTypeMultiple; - - @Schema(description = "应用标识") - private String companyLogo; - - @Schema(description = "应用类型") - private String appType; - - @Schema(description = "绑定域名") - private String domain; - - @Schema(description = "联系电话") - private String phone; - - @Schema(description = "座机电话") - private String tel; - - @Schema(description = "邮箱") - private String email; - - @Schema(description = "发票抬头") - @TableField("Invoice_header") - private String invoiceHeader; - - @Schema(description = "企业法人") - private String businessEntity; - - @Schema(description = "服务开始时间") - private Date startTime; - - @Schema(description = "服务到期时间") - private Date expirationTime; - - @Schema(description = "应用版本 10体验版 20授权版 30旗舰版") - private Integer version; - - @Schema(description = "成员数量(人数上限)") - private Integer members; - - @Schema(description = "成员数量(当前)") - private Integer users; - - @Schema(description = "行业类型(父级)") - private String industryParent; - - @Schema(description = "行业类型(子级)") - private String industryChild; - - @Schema(description = "部门数量") - private Integer departments; - - @Schema(description = "存储空间") - private Long storage; - - @Schema(description = "存储空间(上限)") - private Long storageMax; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "街道地址") - private String address; - - @Schema(description = "经度") - private String longitude; - - @Schema(description = "纬度") - private String latitude; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否实名认证") - private Integer authentication; - - @Schema(description = "企业默认主体") - private Integer authoritative; - - @Schema(description = "request合法域名") - private String requestUrl; - - @Schema(description = "socket合法域名") - private String socketUrl; - - @Schema(description = "主控端域名") - private String serverUrl; - - @Schema(description = "业务域名") - private String modulesUrl; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "点赞数量") - private Integer likes; - - @Schema(description = "点击数量") - private Integer clicks; - - @Schema(description = "购买数量") - private Integer buys; - - @Schema(description = "是否含税, 0不含, 1含") - private Integer isTax; - - @Schema(description = "当前克隆的租户ID") - private Integer planId; - - @Schema(description = "状态") - private Integer status; - - @Schema(description = "排序号") - private Integer sortNumber; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "应用名称") - @TableField(exist = false) - private String tenantName; - - @Schema(description = "应用图标") - @TableField(exist = false) - private String logo; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaCompanyField.java b/src/main/java/com/gxwebsoft/oa/entity/OaCompanyField.java deleted file mode 100644 index 57029bd..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaCompanyField.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; -import java.util.Date; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 企业参数 - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaCompanyField对象", description = "企业参数") -public class OaCompanyField implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "名称") - private String name; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "状态, 0正常, 1删除") - private Integer status; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private Date createTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaCompanyUser.java b/src/main/java/com/gxwebsoft/oa/entity/OaCompanyUser.java deleted file mode 100644 index 6eee867..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaCompanyUser.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; -import java.util.Date; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 成员管理 - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaCompanyUser对象", description = "成员管理") -public class OaCompanyUser implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "company_user_id", type = IdType.AUTO) - private Integer companyUserId; - - @Schema(description = "角色,10体验成员 20开发者成员 30管理员 ") - private Integer role; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "昵称") - private String nickname; - - @Schema(description = "状态, 0正常, 1待确认") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private Date createTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaLink.java b/src/main/java/com/gxwebsoft/oa/entity/OaLink.java deleted file mode 100644 index 416ad21..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaLink.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 常用链接 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaLink对象", description = "常用链接") -public class OaLink implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "链接名称") - private String name; - - @Schema(description = "图标") - private String icon; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "链接分类") - private String linkType; - - @Schema(description = "应用ID") - private Integer appId; - - @Schema(description = "所属栏目") - private Integer categoryId; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "状态, 0正常, 1待确认") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private Date createTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaProduct.java b/src/main/java/com/gxwebsoft/oa/entity/OaProduct.java deleted file mode 100644 index 919c2b6..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaProduct.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 产品记录表 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaProduct对象", description = "产品记录表") -public class OaProduct implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "产品ID") - @TableId(value = "product_id", type = IdType.AUTO) - private Integer productId; - - @Schema(description = "产品名称") - private String name; - - @Schema(description = "产品标识") - private String code; - - @Schema(description = "产品详情") - private String content; - - @Schema(description = "产品类型") - private String type; - - @Schema(description = "产品图标") - private String logo; - - @Schema(description = "产品金额") - private BigDecimal money; - - @Schema(description = "初始销量") - private Integer salesInitial; - - @Schema(description = "实际销量") - private Integer salesActual; - - @Schema(description = "库存总量(包含所有sku)") - private Integer stockTotal; - - @Schema(description = "背景颜色") - private String backgroundColor; - - @Schema(description = "背景图片") - private String backgroundImage; - - @Schema(description = "背景图片(gif)") - private String backgroundGif; - - @Schema(description = "购买链接") - private String buyUrl; - - @Schema(description = "控制台链接") - private String adminUrl; - - @Schema(description = "附件") - private String files; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0已上架, 1已下架") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaProductTabs.java b/src/main/java/com/gxwebsoft/oa/entity/OaProductTabs.java deleted file mode 100644 index a46f516..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaProductTabs.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 产品标签记录表 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaProductTabs对象", description = "产品标签记录表") -public class OaProductTabs implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "产品标签ID") - @TableId(value = "tab_id", type = IdType.AUTO) - private Integer tabId; - - @Schema(description = "产品ID") - private Integer productId; - - @Schema(description = "标签名称") - private String name; - - @Schema(description = "标签类型") - private String type; - - @Schema(description = "产品标签详情") - private String content; - - @Schema(description = "背景颜色") - private String backgroundColor; - - @Schema(description = "背景图片") - private String backgroundImage; - - @Schema(description = "附件") - private String files; - - @Schema(description = "企业ID") - private Integer companyId; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0已上架, 1已下架") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaTask.java b/src/main/java/com/gxwebsoft/oa/entity/OaTask.java deleted file mode 100644 index dd0babd..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaTask.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import java.time.LocalDate; -import com.baomidou.mybatisplus.annotation.TableId; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 任务记录表 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaTask对象", description = "任务记录表") -public class OaTask implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "工单ID") - @TableId(value = "task_id", type = IdType.AUTO) - private Integer taskId; - - @Schema(description = "工单类型") - private String taskType; - - @Schema(description = "任务内容") - private String name; - - @Schema(description = "问题描述") - private String content; - - @Schema(description = "工单附件") - private String files; - - @Schema(description = "工单发起人") - private Integer promoter; - - @Schema(description = "受理人") - private Integer commander; - - @Schema(description = "工单状态, 0未开始 1已指派 ") - private Integer progress; - - @Schema(description = "优先级") - private String priority; - - @Schema(description = "品质要求") - private String quality; - - @Schema(description = "时限(天)") - private Integer day; - - @Schema(description = "手机号") - private String phone; - - @Schema(description = "开始时间") - private LocalDate startTime; - - @Schema(description = "结束时间") - private LocalDate endTime; - - @Schema(description = "逾期天数") - private Integer overdueDays; - - @Schema(description = "项目ID") - private Integer appId; - - @Schema(description = "机构id") - private Integer organizationId; - - @Schema(description = "项目ID") - private Integer projectId; - - @Schema(description = "客户ID") - private Integer customerId; - - @Schema(description = "资产ID") - private Integer assetsId; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "是否已查阅") - private Integer isRead; - - @Schema(description = "最后回复人") - private Integer lastReadUser; - - @Schema(description = "发起人昵称") - private String nickname; - - @Schema(description = "发起人头像") - private String avatar; - - @Schema(description = "最后回复人头像") - private String lastAvatar; - - @Schema(description = "最后回复人昵称") - private String lastNickname; - - @Schema(description = "订单是否已结算(0未结算 1已结算)") - private Integer isSettled; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0待处理, 1已完成") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaTaskCount.java b/src/main/java/com/gxwebsoft/oa/entity/OaTaskCount.java deleted file mode 100644 index c84a00a..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaTaskCount.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.util.Date; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 数据统计 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaTaskCount对象", description = "数据统计") -public class OaTaskCount implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "task_count_id", type = IdType.AUTO) - private Integer taskCountId; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "待处理数") - private Integer pending; - - @Schema(description = "闲置的工单(废弃)") - private Integer unused; - - @Schema(description = "已完成数(废弃)") - private Integer completed; - - @Schema(description = "今天处理数") - private Integer today; - - @Schema(description = "本月处理数") - private Integer month; - - @Schema(description = "今年处理数") - private Integer year; - - @Schema(description = "总工单数") - private Integer total; - - @Schema(description = "部门ID") - private Integer organizationId; - - @Schema(description = "角色ID") - private Integer roleId; - - @Schema(description = "角色标识") - private String roleCode; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "更新时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaTaskRecord.java b/src/main/java/com/gxwebsoft/oa/entity/OaTaskRecord.java deleted file mode 100644 index 568b5e4..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaTaskRecord.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.util.Date; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 工单回复记录表 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaTaskRecord对象", description = "工单回复记录表") -public class OaTaskRecord implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "回复ID") - @TableId(value = "task_record_id", type = IdType.AUTO) - private Integer taskRecordId; - - @Schema(description = "上级id, 0是顶级") - private Integer parentId; - - @Schema(description = "工单ID") - private Integer taskId; - - @Schema(description = "内容") - private String content; - - @Schema(description = "机密信息") - private String confidential; - - @Schema(description = "联系电话") - private String phone; - - @Schema(description = "工单附件") - private String files; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0待处理, 1已完成") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - private Date createTime; - - @Schema(description = "修改时间") - private Date updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/entity/OaTaskUser.java b/src/main/java/com/gxwebsoft/oa/entity/OaTaskUser.java deleted file mode 100644 index b82227b..0000000 --- a/src/main/java/com/gxwebsoft/oa/entity/OaTaskUser.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.gxwebsoft.oa.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.util.Date; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 工单成员 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "OaTaskUser对象", description = "工单成员") -public class OaTaskUser implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "task_user_id", type = IdType.AUTO) - private Integer taskUserId; - - @Schema(description = "角色,10体验成员 20开发者成员 30管理员 ") - private Integer role; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "工单ID") - private Integer taskId; - - @Schema(description = "昵称") - private String nickname; - - @Schema(description = "状态, 0待处理, 1已完成") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "加入时间") - private Date createTime; - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAppFieldMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAppFieldMapper.java deleted file mode 100644 index 5d66286..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAppFieldMapper.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAppField; -import com.gxwebsoft.oa.param.OaAppFieldParam; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 应用参数Mapper - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -public interface OaAppFieldMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAppFieldParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAppFieldParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAppMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAppMapper.java deleted file mode 100644 index 8975d8b..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAppMapper.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaApp; -import com.gxwebsoft.oa.param.OaAppParam; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 应用Mapper - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -public interface OaAppMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAppParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAppParam param); - - /** - * 统计金额总和 - * - * @param wrapper 查询条件 - * @return 金额总和 - */ - BigDecimal selectSumMoney(@Param("ew") Wrapper wrapper); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAppRenewMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAppRenewMapper.java deleted file mode 100644 index 40ceb78..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAppRenewMapper.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAppRenew; -import com.gxwebsoft.oa.param.OaAppRenewParam; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 续费管理Mapper - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -public interface OaAppRenewMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAppRenewParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAppRenewParam param); - - /** - * 统计金额总和 - * - * @param wrapper 查询条件 - * @return 金额总和 - */ - BigDecimal selectSumMoney(@Param("ew") Wrapper wrapper); -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAppUrlMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAppUrlMapper.java deleted file mode 100644 index af8f851..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAppUrlMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAppUrl; -import com.gxwebsoft.oa.param.OaAppUrlParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 项目域名Mapper - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -public interface OaAppUrlMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAppUrlParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAppUrlParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAppUserMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAppUserMapper.java deleted file mode 100644 index 8d416bf..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAppUserMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAppUser; -import com.gxwebsoft.oa.param.OaAppUserParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 应用成员Mapper - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -public interface OaAppUserMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAppUserParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAppUserParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsCodeMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsCodeMapper.java deleted file mode 100644 index 8108c1c..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsCodeMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAssetsCode; -import com.gxwebsoft.oa.param.OaAssetsCodeParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 代码仓库Mapper - * - * @author 科技小王子 - * @since 2024-10-18 18:27:01 - */ -public interface OaAssetsCodeMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAssetsCodeParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAssetsCodeParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsDomainMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsDomainMapper.java deleted file mode 100644 index 6f9c571..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsDomainMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAssetsDomain; -import com.gxwebsoft.oa.param.OaAssetsDomainParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 域名Mapper - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -public interface OaAssetsDomainMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAssetsDomainParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAssetsDomainParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsEmailMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsEmailMapper.java deleted file mode 100644 index 6457bb8..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsEmailMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAssetsEmail; -import com.gxwebsoft.oa.param.OaAssetsEmailParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 企业邮箱记录表Mapper - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -public interface OaAssetsEmailMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAssetsEmailParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAssetsEmailParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsMapper.java deleted file mode 100644 index b1b2879..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAssets; -import com.gxwebsoft.oa.param.OaAssetsParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 云服务器Mapper - * - * @author 科技小王子 - * @since 2024-10-18 18:34:15 - */ -public interface OaAssetsMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAssetsParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAssetsParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsMysqlMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsMysqlMapper.java deleted file mode 100644 index 168f28b..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsMysqlMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAssetsMysql; -import com.gxwebsoft.oa.param.OaAssetsMysqlParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 云数据库Mapper - * - * @author 科技小王子 - * @since 2024-10-18 19:00:20 - */ -public interface OaAssetsMysqlMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAssetsMysqlParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAssetsMysqlParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsServerMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsServerMapper.java deleted file mode 100644 index fd08087..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsServerMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAssetsServer; -import com.gxwebsoft.oa.param.OaAssetsServerParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 服务Mapper - * - * @author 科技小王子 - * @since 2024-10-21 19:15:26 - */ -public interface OaAssetsServerMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAssetsServerParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAssetsServerParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsSiteMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsSiteMapper.java deleted file mode 100644 index 641dad9..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsSiteMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAssetsSite; -import com.gxwebsoft.oa.param.OaAssetsSiteParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 网站信息记录表Mapper - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -public interface OaAssetsSiteMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAssetsSiteParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAssetsSiteParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsSoftwareCertMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsSoftwareCertMapper.java deleted file mode 100644 index a861aec..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsSoftwareCertMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAssetsSoftwareCert; -import com.gxwebsoft.oa.param.OaAssetsSoftwareCertParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 计算机软件著作权登记Mapper - * - * @author 科技小王子 - * @since 2024-10-18 19:46:21 - */ -public interface OaAssetsSoftwareCertMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAssetsSoftwareCertParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAssetsSoftwareCertParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsSslMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsSslMapper.java deleted file mode 100644 index 7912f86..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsSslMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAssetsSsl; -import com.gxwebsoft.oa.param.OaAssetsSslParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * ssl证书Mapper - * - * @author 科技小王子 - * @since 2024-10-18 19:25:40 - */ -public interface OaAssetsSslMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAssetsSslParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAssetsSslParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsTrademarkMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsTrademarkMapper.java deleted file mode 100644 index 371ab97..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsTrademarkMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAssetsTrademark; -import com.gxwebsoft.oa.param.OaAssetsTrademarkParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 商标注册Mapper - * - * @author 科技小王子 - * @since 2024-10-18 19:46:21 - */ -public interface OaAssetsTrademarkMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAssetsTrademarkParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAssetsTrademarkParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsUserMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsUserMapper.java deleted file mode 100644 index 56cd088..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsUserMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAssetsUser; -import com.gxwebsoft.oa.param.OaAssetsUserParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 服务器成员管理Mapper - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -public interface OaAssetsUserMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAssetsUserParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAssetsUserParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsVhostMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsVhostMapper.java deleted file mode 100644 index c45a874..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaAssetsVhostMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaAssetsVhost; -import com.gxwebsoft.oa.param.OaAssetsVhostParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 虚拟主机记录表Mapper - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -public interface OaAssetsVhostMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaAssetsVhostParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaAssetsVhostParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaCompanyFieldMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaCompanyFieldMapper.java deleted file mode 100644 index 6471da9..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaCompanyFieldMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaCompanyField; -import com.gxwebsoft.oa.param.OaCompanyFieldParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 企业参数Mapper - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -public interface OaCompanyFieldMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaCompanyFieldParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaCompanyFieldParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaCompanyMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaCompanyMapper.java deleted file mode 100644 index 59d6d85..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaCompanyMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaCompany; -import com.gxwebsoft.oa.param.OaCompanyParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 企业信息Mapper - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -public interface OaCompanyMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaCompanyParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaCompanyParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaCompanyUserMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaCompanyUserMapper.java deleted file mode 100644 index 65e6a8e..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaCompanyUserMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaCompanyUser; -import com.gxwebsoft.oa.param.OaCompanyUserParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 成员管理Mapper - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -public interface OaCompanyUserMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaCompanyUserParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaCompanyUserParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaLinkMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaLinkMapper.java deleted file mode 100644 index 57497a8..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaLinkMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaLink; -import com.gxwebsoft.oa.param.OaLinkParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 常用链接Mapper - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaLinkMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaLinkParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaLinkParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaProductMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaProductMapper.java deleted file mode 100644 index 9d1d9af..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaProductMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaProduct; -import com.gxwebsoft.oa.param.OaProductParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 产品记录表Mapper - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaProductMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaProductParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaProductParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaProductTabsMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaProductTabsMapper.java deleted file mode 100644 index 39e03c7..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaProductTabsMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaProductTabs; -import com.gxwebsoft.oa.param.OaProductTabsParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 产品标签记录表Mapper - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaProductTabsMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaProductTabsParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaProductTabsParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaTaskCountMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaTaskCountMapper.java deleted file mode 100644 index 0e139df..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaTaskCountMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaTaskCount; -import com.gxwebsoft.oa.param.OaTaskCountParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 数据统计Mapper - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaTaskCountMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaTaskCountParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaTaskCountParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaTaskMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaTaskMapper.java deleted file mode 100644 index 963f5f8..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaTaskMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaTask; -import com.gxwebsoft.oa.param.OaTaskParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 任务记录表Mapper - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaTaskMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaTaskParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaTaskParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaTaskRecordMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaTaskRecordMapper.java deleted file mode 100644 index f12d10e..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaTaskRecordMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaTaskRecord; -import com.gxwebsoft.oa.param.OaTaskRecordParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 工单回复记录表Mapper - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaTaskRecordMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaTaskRecordParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaTaskRecordParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/OaTaskUserMapper.java b/src/main/java/com/gxwebsoft/oa/mapper/OaTaskUserMapper.java deleted file mode 100644 index d894bb6..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/OaTaskUserMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.oa.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.oa.entity.OaTaskUser; -import com.gxwebsoft.oa.param.OaTaskUserParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 工单成员Mapper - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaTaskUserMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") OaTaskUserParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") OaTaskUserParam param); - -} diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppFieldMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppFieldMapper.xml deleted file mode 100644 index c7ded82..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppFieldMapper.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_app_field a - - - AND a.id = #{param.id} - - - AND a.app_id = #{param.appId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.status = #{param.status} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppMapper.xml deleted file mode 100644 index e21d750..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppMapper.xml +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - - SELECT a.*, b.company_name,b.short_name,b.company_logo - FROM oa_app a - LEFT JOIN oa_company b ON a.company_id = b.company_id - - - AND a.app_id = #{param.appId} - - - AND a.app_name LIKE CONCAT('%', #{param.appName}, '%') - - - AND a.app_code LIKE CONCAT('%', #{param.appCode}, '%') - - - AND a.show_case = #{param.showCase} - - - AND a.recommend = #{param.recommend} - - - AND a.show_index = #{param.showIndex} - - - AND a.parent_id = #{param.parentId} - - - AND a.app_type LIKE CONCAT('%', #{param.appType}, '%') - - - AND a.app_type_multiple LIKE CONCAT('%', #{param.appTypeMultiple}, '%') - - - AND a.menu_type = #{param.menuType} - - - AND a.company_id = #{param.companyId} - - - AND a.company_name LIKE CONCAT('%', #{param.companyName}, '%') - - - AND a.app_icon LIKE CONCAT('%', #{param.appIcon}, '%') - - - AND a.app_qrcode LIKE CONCAT('%', #{param.appQrcode}, '%') - - - AND a.app_url LIKE CONCAT('%', #{param.appUrl}, '%') - - - AND a.admin_url LIKE CONCAT('%', #{param.adminUrl}, '%') - - - AND a.down_url LIKE CONCAT('%', #{param.downUrl}, '%') - - - AND a.server_url LIKE CONCAT('%', #{param.serverUrl}, '%') - - - AND a.file_url LIKE CONCAT('%', #{param.fileUrl}, '%') - - - AND a.callback_url LIKE CONCAT('%', #{param.callbackUrl}, '%') - - - AND a.docs_url LIKE CONCAT('%', #{param.docsUrl}, '%') - - - AND a.git_url LIKE CONCAT('%', #{param.gitUrl}, '%') - - - AND a.prototype_url LIKE CONCAT('%', #{param.prototypeUrl}, '%') - - - AND a.ip_address LIKE CONCAT('%', #{param.ipAddress}, '%') - - - AND a.images LIKE CONCAT('%', #{param.images}, '%') - - - AND a.package_name LIKE CONCAT('%', #{param.packageName}, '%') - - - AND a.clicks = #{param.clicks} - - - AND a.installs = #{param.installs} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.requirement LIKE CONCAT('%', #{param.requirement}, '%') - - - AND a.developer LIKE CONCAT('%', #{param.developer}, '%') - - - AND a.director LIKE CONCAT('%', #{param.director}, '%') - - - AND a.project_director LIKE CONCAT('%', #{param.projectDirector}, '%') - - - AND a.salesman LIKE CONCAT('%', #{param.salesman}, '%') - - - AND a.price = #{param.price} - - - AND a.line_price = #{param.linePrice} - - - AND a.score LIKE CONCAT('%', #{param.score}, '%') - - - AND a.star LIKE CONCAT('%', #{param.star}, '%') - - - AND a.path LIKE CONCAT('%', #{param.path}, '%') - - - AND a.component LIKE CONCAT('%', #{param.component}, '%') - - - AND a.authority LIKE CONCAT('%', #{param.authority}, '%') - - - AND a.target LIKE CONCAT('%', #{param.target}, '%') - - - AND a.hide = #{param.hide} - - - AND a.search = #{param.search} - - - AND a.active LIKE CONCAT('%', #{param.active}, '%') - - - AND a.meta LIKE CONCAT('%', #{param.meta}, '%') - - - AND a.edition LIKE CONCAT('%', #{param.edition}, '%') - - - AND a.version LIKE CONCAT('%', #{param.version}, '%') - - - AND a.is_use = #{param.isUse} - - - AND a.file1 LIKE CONCAT('%', #{param.file1}, '%') - - - AND a.file2 LIKE CONCAT('%', #{param.file2}, '%') - - - AND a.file3 LIKE CONCAT('%', #{param.file3}, '%') - - - AND a.app_status LIKE CONCAT('%', #{param.appStatus}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.app_id IN - - #{item} - - - - AND a.organization_id = #{param.organizationId} - - - AND a.show_expiration = #{param.showExpiration} - - - AND a.tenant_code LIKE CONCAT('%', #{param.tenantCode}, '%') - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.app_name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.app_code LIKE CONCAT('%', #{param.keywords}, '%') - OR a.company_name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.app_url LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppRenewMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppRenewMapper.xml deleted file mode 100644 index d949637..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppRenewMapper.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - SELECT a.*, - b.company_name,b.short_name,b.company_logo, - c.app_name - FROM oa_app_renew a - LEFT JOIN oa_company b ON a.company_id = b.company_id - LEFT JOIN oa_app c ON a.app_id = c.app_id - - - AND a.app_renew_id = #{param.appRenewId} - - - AND a.money = #{param.money} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') - - - AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.app_id = #{param.appId} - - - AND a.company_id = #{param.companyId} - - - - AND a.status = #{param.status} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppUrlMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppUrlMapper.xml deleted file mode 100644 index 24865f4..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppUrlMapper.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_app_url a - - - AND a.app_url_id = #{param.appUrlId} - - - AND a.app_id = #{param.appId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.domain LIKE CONCAT('%', #{param.domain}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - 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/oa/mapper/xml/OaAppUserMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppUserMapper.xml deleted file mode 100644 index 83cf18a..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAppUserMapper.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_app_user a - - - AND a.app_user_id = #{param.appUserId} - - - AND a.role = #{param.role} - - - AND a.user_id = #{param.userId} - - - AND a.app_id = #{param.appId} - - - AND a.status = #{param.status} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (b.nickname LIKE CONCAT('%', #{param.keywords}, '%') - OR b.email LIKE CONCAT('%', #{param.keywords}, '%') - OR b.username LIKE CONCAT('%', #{param.keywords}, '%') - OR b.phone LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsCodeMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsCodeMapper.xml deleted file mode 100644 index 482f9cf..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsCodeMapper.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - SELECT a.*, b.short_name AS tenantName,b.company_logo as logo - FROM oa_assets_code a - LEFT JOIN gxwebsoft_core.sys_company b ON a.tenant_id = b.tenant_id - - - AND a.id = #{param.id} - - - AND a.assets_id = #{param.assetsId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.git_url LIKE CONCAT('%', #{param.gitUrl}, '%') - - - AND a.brand LIKE CONCAT('%', #{param.brand}, '%') - - - AND a.is_top LIKE CONCAT('%', #{param.isTop}, '%') - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.user_ids LIKE CONCAT('%', #{param.userIds}, '%') - - - AND a.status LIKE CONCAT('%', #{param.status}, '%') - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsDomainMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsDomainMapper.xml deleted file mode 100644 index af8d0c4..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsDomainMapper.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - SELECT a.*, b.short_name AS tenantName,b.company_logo as logo - FROM oa_assets_domain a - LEFT JOIN gxwebsoft_core.sys_company b ON a.tenant_id = b.tenant_id - - - AND a.domain_id = #{param.domainId} - - - AND a.assets_id = #{param.assetsId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.brand LIKE CONCAT('%', #{param.brand}, '%') - - - AND a.account LIKE CONCAT('%', #{param.account}, '%') - - - AND a.password LIKE CONCAT('%', #{param.password}, '%') - - - AND a.price = #{param.price} - - - AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') - - - AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%') - - - AND a.is_top LIKE CONCAT('%', #{param.isTop}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.user_ids LIKE CONCAT('%', #{param.userIds}, '%') - - - AND a.status LIKE CONCAT('%', #{param.status}, '%') - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsEmailMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsEmailMapper.xml deleted file mode 100644 index da6012b..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsEmailMapper.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - SELECT a.*, b.short_name AS tenantName,b.company_logo as logo - FROM oa_assets_email a - LEFT JOIN gxwebsoft_core.sys_company b ON a.tenant_id = b.tenant_id - - - AND a.email_id = #{param.emailId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.type LIKE CONCAT('%', #{param.type}, '%') - - - AND a.brand LIKE CONCAT('%', #{param.brand}, '%') - - - AND a.system LIKE CONCAT('%', #{param.system}, '%') - - - AND a.price = #{param.price} - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') - - - AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%') - - - AND a.is_top LIKE CONCAT('%', #{param.isTop}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.user_ids LIKE CONCAT('%', #{param.userIds}, '%') - - - AND a.status LIKE CONCAT('%', #{param.status}, '%') - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsMapper.xml deleted file mode 100644 index b6b4fc5..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsMapper.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - SELECT a.*, b.short_name AS tenantName,b.company_logo as logo - FROM oa_assets a - LEFT JOIN gxwebsoft_core.sys_company b ON a.tenant_id = b.tenant_id - - - AND a.assets_id = #{param.assetsId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.type LIKE CONCAT('%', #{param.type}, '%') - - - AND a.brand LIKE CONCAT('%', #{param.brand}, '%') - - - AND a.configuration LIKE CONCAT('%', #{param.configuration}, '%') - - - AND a.account LIKE CONCAT('%', #{param.account}, '%') - - - AND a.password LIKE CONCAT('%', #{param.password}, '%') - - - AND a.brand_account LIKE CONCAT('%', #{param.brandAccount}, '%') - - - AND a.brand_password LIKE CONCAT('%', #{param.brandPassword}, '%') - - - AND a.panel LIKE CONCAT('%', #{param.panel}, '%') - - - AND a.panel_account LIKE CONCAT('%', #{param.panelAccount}, '%') - - - AND a.panel_password LIKE CONCAT('%', #{param.panelPassword}, '%') - - - AND a.finance_amount = #{param.financeAmount} - - - AND a.finance_years = #{param.financeYears} - - - AND a.finance_renew = #{param.financeRenew} - - - AND a.finance_customer_name LIKE CONCAT('%', #{param.financeCustomerName}, '%') - - - AND a.finance_customer_contact LIKE CONCAT('%', #{param.financeCustomerContact}, '%') - - - AND a.finance_customer_phone LIKE CONCAT('%', #{param.financeCustomerPhone}, '%') - - - AND a.customer_id = #{param.customerId} - - - AND a.customer_name LIKE CONCAT('%', #{param.customerName}, '%') - - - AND a.open_port LIKE CONCAT('%', #{param.openPort}, '%') - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') - - - AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%') - - - AND a.is_top LIKE CONCAT('%', #{param.isTop}, '%') - - - AND a.visibility LIKE CONCAT('%', #{param.visibility}, '%') - - - AND a.bt_sign LIKE CONCAT('%', #{param.btSign}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.company_id = #{param.companyId} - - - AND a.user_id = #{param.userId} - - - AND a.user_ids LIKE CONCAT('%', #{param.userIds}, '%') - - - AND a.organization_id = #{param.organizationId} - - - AND a.status LIKE CONCAT('%', #{param.status}, '%') - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.tenant_id = #{param.keywords} - OR a.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.code LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsMysqlMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsMysqlMapper.xml deleted file mode 100644 index 98fbbe4..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsMysqlMapper.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - SELECT a.*, b.short_name AS tenantName,b.company_logo as logo - FROM oa_assets_mysql a - LEFT JOIN gxwebsoft_core.sys_company b ON a.tenant_id = b.tenant_id - - - AND a.mysql_id = #{param.mysqlId} - - - AND a.assets_id = #{param.assetsId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.brand LIKE CONCAT('%', #{param.brand}, '%') - - - AND a.ip LIKE CONCAT('%', #{param.ip}, '%') - - - AND a.port LIKE CONCAT('%', #{param.port}, '%') - - - AND a.account LIKE CONCAT('%', #{param.account}, '%') - - - AND a.password LIKE CONCAT('%', #{param.password}, '%') - - - AND a.price = #{param.price} - - - AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') - - - AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%') - - - AND a.is_top LIKE CONCAT('%', #{param.isTop}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.user_ids LIKE CONCAT('%', #{param.userIds}, '%') - - - AND a.status LIKE CONCAT('%', #{param.status}, '%') - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsServerMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsServerMapper.xml deleted file mode 100644 index 1e7770e..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsServerMapper.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_assets_server a - - - AND a.id = #{param.id} - - - AND a.server LIKE CONCAT('%', #{param.server}, '%') - - - AND a.server_url LIKE CONCAT('%', #{param.serverUrl}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.assets_id = #{param.assetsId} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - AND a.user_id = #{param.userId} - - - AND a.user_ids LIKE CONCAT('%', #{param.userIds}, '%') - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.tenant_id = #{param.keywords} - OR a.server_url LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsSiteMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsSiteMapper.xml deleted file mode 100644 index 4ac42c5..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsSiteMapper.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - SELECT a.*, b.short_name AS tenantName,b.company_logo as logo - FROM oa_assets_site a - LEFT JOIN gxwebsoft_core.sys_company b ON a.tenant_id = b.tenant_id - - - AND a.website_id = #{param.websiteId} - - - AND a.website_name LIKE CONCAT('%', #{param.websiteName}, '%') - - - AND a.website_code LIKE CONCAT('%', #{param.websiteCode}, '%') - - - AND a.website_icon LIKE CONCAT('%', #{param.websiteIcon}, '%') - - - AND a.website_logo LIKE CONCAT('%', #{param.websiteLogo}, '%') - - - AND a.website_dark_logo LIKE CONCAT('%', #{param.websiteDarkLogo}, '%') - - - AND a.website_type LIKE CONCAT('%', #{param.websiteType}, '%') - - - AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%') - - - AND a.prefix LIKE CONCAT('%', #{param.prefix}, '%') - - - AND a.domain LIKE CONCAT('%', #{param.domain}, '%') - - - AND a.style LIKE CONCAT('%', #{param.style}, '%') - - - AND a.admin_url LIKE CONCAT('%', #{param.adminUrl}, '%') - - - AND a.version = #{param.version} - - - AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') - - - AND a.template_id = #{param.templateId} - - - AND a.industry_parent LIKE CONCAT('%', #{param.industryParent}, '%') - - - AND a.industry_child LIKE CONCAT('%', #{param.industryChild}, '%') - - - AND a.company_id = #{param.companyId} - - - AND a.country LIKE CONCAT('%', #{param.country}, '%') - - - AND a.province LIKE CONCAT('%', #{param.province}, '%') - - - AND a.city LIKE CONCAT('%', #{param.city}, '%') - - - AND a.region LIKE CONCAT('%', #{param.region}, '%') - - - AND a.longitude LIKE CONCAT('%', #{param.longitude}, '%') - - - AND a.latitude LIKE CONCAT('%', #{param.latitude}, '%') - - - AND a.address LIKE CONCAT('%', #{param.address}, '%') - - - AND a.phone LIKE CONCAT('%', #{param.phone}, '%') - - - AND a.email LIKE CONCAT('%', #{param.email}, '%') - - - AND a.icp_no LIKE CONCAT('%', #{param.icpNo}, '%') - - - AND a.police_no LIKE CONCAT('%', #{param.policeNo}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.status = #{param.status} - - - AND a.status_text LIKE CONCAT('%', #{param.statusText}, '%') - - - AND a.status_close LIKE CONCAT('%', #{param.statusClose}, '%') - - - AND a.styles LIKE CONCAT('%', #{param.styles}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.assets_id = #{param.assetsId} - - - AND a.user_id = #{param.userId} - - - AND a.user_ids LIKE CONCAT('%', #{param.userIds}, '%') - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsSoftwareCertMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsSoftwareCertMapper.xml deleted file mode 100644 index 2ac29a1..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsSoftwareCertMapper.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - SELECT a.*, b.short_name AS tenantName,b.company_logo as logo - FROM oa_assets_software_cert a - LEFT JOIN gxwebsoft_core.sys_company b ON a.tenant_id = b.tenant_id - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.type LIKE CONCAT('%', #{param.type}, '%') - - - AND a.brand LIKE CONCAT('%', #{param.brand}, '%') - - - AND a.price = #{param.price} - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.cert_url LIKE CONCAT('%', #{param.certUrl}, '%') - - - AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') - - - AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%') - - - AND a.is_top LIKE CONCAT('%', #{param.isTop}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.user_ids LIKE CONCAT('%', #{param.userIds}, '%') - - - AND a.status LIKE CONCAT('%', #{param.status}, '%') - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsSslMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsSslMapper.xml deleted file mode 100644 index e6563a7..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsSslMapper.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - SELECT a.*, b.short_name AS tenantName,b.company_logo as logo - FROM oa_assets_ssl a - LEFT JOIN gxwebsoft_core.sys_company b ON a.tenant_id = b.tenant_id - - - AND a.ssl_id = #{param.sslId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.type LIKE CONCAT('%', #{param.type}, '%') - - - AND a.brand LIKE CONCAT('%', #{param.brand}, '%') - - - AND a.price = #{param.price} - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.cert_key LIKE CONCAT('%', #{param.certKey}, '%') - - - AND a.cert_pem LIKE CONCAT('%', #{param.certPem}, '%') - - - AND a.cert_url LIKE CONCAT('%', #{param.certUrl}, '%') - - - AND a.cert_crt LIKE CONCAT('%', #{param.certCrt}, '%') - - - AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') - - - AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%') - - - AND a.is_top LIKE CONCAT('%', #{param.isTop}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.user_ids LIKE CONCAT('%', #{param.userIds}, '%') - - - AND a.status LIKE CONCAT('%', #{param.status}, '%') - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.tenant_id = #{param.keywords} - OR a.name LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsTrademarkMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsTrademarkMapper.xml deleted file mode 100644 index 5028926..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsTrademarkMapper.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - SELECT a.*, b.short_name AS tenantName,b.company_logo as logo - FROM oa_assets_trademark a - LEFT JOIN gxwebsoft_core.sys_company b ON a.tenant_id = b.tenant_id - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.type LIKE CONCAT('%', #{param.type}, '%') - - - AND a.brand LIKE CONCAT('%', #{param.brand}, '%') - - - AND a.price = #{param.price} - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.cert_url LIKE CONCAT('%', #{param.certUrl}, '%') - - - AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') - - - AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%') - - - AND a.is_top LIKE CONCAT('%', #{param.isTop}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.user_ids LIKE CONCAT('%', #{param.userIds}, '%') - - - AND a.status LIKE CONCAT('%', #{param.status}, '%') - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsUserMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsUserMapper.xml deleted file mode 100644 index 0306c98..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsUserMapper.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_assets_user a - - - AND a.id = #{param.id} - - - AND a.role = #{param.role} - - - AND a.user_id = #{param.userId} - - - AND a.assets_id = #{param.assetsId} - - - AND a.status = #{param.status} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsVhostMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsVhostMapper.xml deleted file mode 100644 index 682f29d..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaAssetsVhostMapper.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - SELECT a.*, b.short_name AS tenantName,b.company_logo as logo - FROM oa_assets_vhost a - LEFT JOIN gxwebsoft_core.sys_company b ON a.tenant_id = b.tenant_id - - - AND a.vhost_id = #{param.vhostId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.type LIKE CONCAT('%', #{param.type}, '%') - - - AND a.brand LIKE CONCAT('%', #{param.brand}, '%') - - - AND a.account LIKE CONCAT('%', #{param.account}, '%') - - - AND a.password LIKE CONCAT('%', #{param.password}, '%') - - - AND a.price = #{param.price} - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.ssl LIKE CONCAT('%', #{param.ssl}, '%') - - - AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') - - - AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%') - - - AND a.is_top LIKE CONCAT('%', #{param.isTop}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.assets_id = #{param.assetsId} - - - AND a.user_id = #{param.userId} - - - AND a.user_ids LIKE CONCAT('%', #{param.userIds}, '%') - - - AND a.status LIKE CONCAT('%', #{param.status}, '%') - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaCompanyFieldMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaCompanyFieldMapper.xml deleted file mode 100644 index 4cdb978..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaCompanyFieldMapper.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_company_field a - - - AND a.id = #{param.id} - - - AND a.company_id = #{param.companyId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.status = #{param.status} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaCompanyMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaCompanyMapper.xml deleted file mode 100644 index 682f772..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaCompanyMapper.xml +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_company a - - - AND a.company_id = #{param.companyId} - - - AND a.short_name LIKE CONCAT('%', #{param.shortName}, '%') - - - AND a.company_name LIKE CONCAT('%', #{param.companyName}, '%') - - - AND a.company_code LIKE CONCAT('%', #{param.companyCode}, '%') - - - AND a.company_type LIKE CONCAT('%', #{param.companyType}, '%') - - - AND a.company_type_multiple LIKE CONCAT('%', #{param.companyTypeMultiple}, '%') - - - AND a.company_logo LIKE CONCAT('%', #{param.companyLogo}, '%') - - - AND a.app_type LIKE CONCAT('%', #{param.appType}, '%') - - - AND a.domain LIKE CONCAT('%', #{param.domain}, '%') - - - AND a.phone LIKE CONCAT('%', #{param.phone}, '%') - - - AND a.tel LIKE CONCAT('%', #{param.tel}, '%') - - - AND a.email LIKE CONCAT('%', #{param.email}, '%') - - - AND a.Invoice_header LIKE CONCAT('%', #{param.invoiceHeader}, '%') - - - AND a.business_entity LIKE CONCAT('%', #{param.businessEntity}, '%') - - - AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') - - - AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') - - - AND a.version = #{param.version} - - - AND a.members = #{param.members} - - - AND a.users = #{param.users} - - - AND a.industry_parent LIKE CONCAT('%', #{param.industryParent}, '%') - - - AND a.industry_child LIKE CONCAT('%', #{param.industryChild}, '%') - - - AND a.departments = #{param.departments} - - - AND a.storage LIKE CONCAT('%', #{param.storage}, '%') - - - AND a.storage_max LIKE CONCAT('%', #{param.storageMax}, '%') - - - AND a.country LIKE CONCAT('%', #{param.country}, '%') - - - AND a.province LIKE CONCAT('%', #{param.province}, '%') - - - AND a.city LIKE CONCAT('%', #{param.city}, '%') - - - AND a.region LIKE CONCAT('%', #{param.region}, '%') - - - AND a.address LIKE CONCAT('%', #{param.address}, '%') - - - AND a.longitude LIKE CONCAT('%', #{param.longitude}, '%') - - - AND a.latitude LIKE CONCAT('%', #{param.latitude}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.authentication = #{param.authentication} - - - AND a.authoritative = #{param.authoritative} - - - AND a.request_url LIKE CONCAT('%', #{param.requestUrl}, '%') - - - AND a.socket_url LIKE CONCAT('%', #{param.socketUrl}, '%') - - - AND a.server_url LIKE CONCAT('%', #{param.serverUrl}, '%') - - - AND a.modules_url LIKE CONCAT('%', #{param.modulesUrl}, '%') - - - AND a.recommend = #{param.recommend} - - - AND a.likes = #{param.likes} - - - AND a.clicks = #{param.clicks} - - - AND a.buys = #{param.buys} - - - AND a.is_tax = #{param.isTax} - - - AND a.plan_id = #{param.planId} - - - AND a.status = #{param.status} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.user_id = #{param.userId} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaCompanyUserMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaCompanyUserMapper.xml deleted file mode 100644 index e4aeb35..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaCompanyUserMapper.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_company_user a - - - AND a.company_user_id = #{param.companyUserId} - - - AND a.role = #{param.role} - - - AND a.user_id = #{param.userId} - - - AND a.company_id = #{param.companyId} - - - AND a.nickname LIKE CONCAT('%', #{param.nickname}, '%') - - - AND a.status = #{param.status} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaLinkMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaLinkMapper.xml deleted file mode 100644 index 55a4a1e..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaLinkMapper.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_link a - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.icon LIKE CONCAT('%', #{param.icon}, '%') - - - AND a.url LIKE CONCAT('%', #{param.url}, '%') - - - AND a.link_type LIKE CONCAT('%', #{param.linkType}, '%') - - - AND a.app_id = #{param.appId} - - - AND a.category_id = #{param.categoryId} - - - AND a.user_id = #{param.userId} - - - AND a.recommend = #{param.recommend} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.status = #{param.status} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaProductMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaProductMapper.xml deleted file mode 100644 index 0bca9c6..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaProductMapper.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_product a - - - AND a.product_id = #{param.productId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.type LIKE CONCAT('%', #{param.type}, '%') - - - AND a.logo LIKE CONCAT('%', #{param.logo}, '%') - - - AND a.money = #{param.money} - - - AND a.sales_initial = #{param.salesInitial} - - - AND a.sales_actual = #{param.salesActual} - - - AND a.stock_total = #{param.stockTotal} - - - AND a.background_color LIKE CONCAT('%', #{param.backgroundColor}, '%') - - - AND a.background_image LIKE CONCAT('%', #{param.backgroundImage}, '%') - - - AND a.background_gif LIKE CONCAT('%', #{param.backgroundGif}, '%') - - - AND a.buy_url LIKE CONCAT('%', #{param.buyUrl}, '%') - - - AND a.admin_url LIKE CONCAT('%', #{param.adminUrl}, '%') - - - AND a.files LIKE CONCAT('%', #{param.files}, '%') - - - AND a.company_id = #{param.companyId} - - - AND a.user_id = #{param.userId} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaProductTabsMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaProductTabsMapper.xml deleted file mode 100644 index 075457c..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaProductTabsMapper.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_product_tabs a - - - AND a.tab_id = #{param.tabId} - - - AND a.product_id = #{param.productId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.type LIKE CONCAT('%', #{param.type}, '%') - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.background_color LIKE CONCAT('%', #{param.backgroundColor}, '%') - - - AND a.background_image LIKE CONCAT('%', #{param.backgroundImage}, '%') - - - AND a.files LIKE CONCAT('%', #{param.files}, '%') - - - AND a.company_id = #{param.companyId} - - - AND a.user_id = #{param.userId} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaTaskCountMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaTaskCountMapper.xml deleted file mode 100644 index 5e5cf81..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaTaskCountMapper.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_task_count a - - - AND a.task_count_id = #{param.taskCountId} - - - AND a.user_id = #{param.userId} - - - AND a.pending = #{param.pending} - - - AND a.unused = #{param.unused} - - - AND a.completed = #{param.completed} - - - AND a.today = #{param.today} - - - AND a.month = #{param.month} - - - AND a.year = #{param.year} - - - AND a.total = #{param.total} - - - AND a.organization_id = #{param.organizationId} - - - AND a.role_id = #{param.roleId} - - - AND a.role_code LIKE CONCAT('%', #{param.roleCode}, '%') - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaTaskMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaTaskMapper.xml deleted file mode 100644 index e068988..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaTaskMapper.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_task a - - - AND a.task_id = #{param.taskId} - - - AND a.task_type LIKE CONCAT('%', #{param.taskType}, '%') - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.files LIKE CONCAT('%', #{param.files}, '%') - - - AND a.promoter = #{param.promoter} - - - AND a.commander = #{param.commander} - - - AND a.progress = #{param.progress} - - - AND a.priority LIKE CONCAT('%', #{param.priority}, '%') - - - AND a.quality LIKE CONCAT('%', #{param.quality}, '%') - - - AND a.day = #{param.day} - - - AND a.phone LIKE CONCAT('%', #{param.phone}, '%') - - - AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') - - - AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%') - - - AND a.overdue_days = #{param.overdueDays} - - - AND a.app_id = #{param.appId} - - - AND a.organization_id = #{param.organizationId} - - - AND a.project_id = #{param.projectId} - - - AND a.customer_id = #{param.customerId} - - - AND a.assets_id = #{param.assetsId} - - - AND a.user_id = #{param.userId} - - - AND a.is_read = #{param.isRead} - - - AND a.last_read_user = #{param.lastReadUser} - - - AND a.nickname LIKE CONCAT('%', #{param.nickname}, '%') - - - AND a.avatar LIKE CONCAT('%', #{param.avatar}, '%') - - - AND a.last_avatar LIKE CONCAT('%', #{param.lastAvatar}, '%') - - - AND a.last_nickname LIKE CONCAT('%', #{param.lastNickname}, '%') - - - AND a.is_settled = #{param.isSettled} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaTaskRecordMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaTaskRecordMapper.xml deleted file mode 100644 index b9bd366..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaTaskRecordMapper.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_task_record a - - - AND a.task_record_id = #{param.taskRecordId} - - - AND a.parent_id = #{param.parentId} - - - AND a.task_id = #{param.taskId} - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.confidential LIKE CONCAT('%', #{param.confidential}, '%') - - - AND a.phone LIKE CONCAT('%', #{param.phone}, '%') - - - AND a.files LIKE CONCAT('%', #{param.files}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaTaskUserMapper.xml b/src/main/java/com/gxwebsoft/oa/mapper/xml/OaTaskUserMapper.xml deleted file mode 100644 index c620f5c..0000000 --- a/src/main/java/com/gxwebsoft/oa/mapper/xml/OaTaskUserMapper.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - SELECT a.* - FROM oa_task_user a - - - AND a.task_user_id = #{param.taskUserId} - - - AND a.role = #{param.role} - - - AND a.user_id = #{param.userId} - - - AND a.task_id = #{param.taskId} - - - AND a.nickname LIKE CONCAT('%', #{param.nickname}, '%') - - - AND a.status = #{param.status} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAppFieldParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAppFieldParam.java deleted file mode 100644 index 17eb253..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAppFieldParam.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 应用参数查询参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAppFieldParam对象", description = "应用参数查询参数") -public class OaAppFieldParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "应用ID") - @QueryField(type = QueryType.EQ) - private Integer appId; - - @Schema(description = "名称") - private String name; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "状态, 0正常, 1删除") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAppParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAppParam.java deleted file mode 100644 index 589b255..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAppParam.java +++ /dev/null @@ -1,250 +0,0 @@ -package com.gxwebsoft.oa.param; - -import com.baomidou.mybatisplus.annotation.TableField; -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; -import java.util.Set; - -/** - * 应用查询参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAppParam对象", description = "应用查询参数") -public class OaAppParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "应用ID") - @QueryField(type = QueryType.EQ) - private Integer appId; - - @Schema(description = "应用名称") - private String appName; - - @Schema(description = "应用标识") - private String appCode; - - @Schema(description = "应用秘钥") - private String appSecret; - - @Schema(description = "上级id, 0是顶级") - @QueryField(type = QueryType.EQ) - private Integer parentId; - - @Schema(description = "应用类型") - private String appType; - - @Schema(description = "应用类型") - private String appTypeMultiple; - - @Schema(description = "类型, 0菜单, 1按钮") - @QueryField(type = QueryType.EQ) - private Integer menuType; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "企业名称") - private String companyName; - - @Schema(description = "应用图标") - private String appIcon; - - @Schema(description = "二维码") - private String appQrcode; - - @Schema(description = "链接地址") - private String appUrl; - - @Schema(description = "后台管理地址") - private String adminUrl; - - @Schema(description = "下载地址") - private String downUrl; - - @Schema(description = "链接地址") - private String serverUrl; - - @Schema(description = "文件服务器") - private String fileUrl; - - @Schema(description = "回调地址") - private String callbackUrl; - - @Schema(description = "腾讯文档地址") - private String docsUrl; - - @Schema(description = "代码仓库地址") - private String gitUrl; - - @Schema(description = "原型图地址") - private String prototypeUrl; - - @Schema(description = "IP白名单") - private String ipAddress; - - @Schema(description = "应用截图") - private String images; - - @Schema(description = "应用包名") - private String packageName; - - @Schema(description = "下载次数") - @QueryField(type = QueryType.EQ) - private Integer clicks; - - @Schema(description = "安装次数") - @QueryField(type = QueryType.EQ) - private Integer installs; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "应用介绍") - private String content; - - @Schema(description = "项目需求") - private String requirement; - - @Schema(description = "开发者(个人或公司)") - private String developer; - - @Schema(description = "项目负责人") - private String director; - - @Schema(description = "项目经理") - private String projectDirector; - - @Schema(description = "业务员") - private String salesman; - - @Schema(description = "软件定价") - @QueryField(type = QueryType.EQ) - private BigDecimal price; - - @Schema(description = "划线价格") - @QueryField(type = QueryType.EQ) - private BigDecimal linePrice; - - @Schema(description = "评分") - private String score; - - @Schema(description = "星级") - private String star; - - @Schema(description = "菜单路由地址") - private String path; - - @Schema(description = "菜单组件地址, 目录可为空") - private String component; - - @Schema(description = "权限标识") - private String authority; - - @Schema(description = "打开位置") - private String target; - - @Schema(description = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)") - @QueryField(type = QueryType.EQ) - private Integer hide; - - @Schema(description = "禁止搜索,1禁止 0 允许") - @QueryField(type = QueryType.EQ) - private Integer search; - - @Schema(description = "菜单侧栏选中的path") - private String active; - - @Schema(description = "其它路由元信息") - private String meta; - - @Schema(description = "版本,0正式版 1体验版 2开发版") - private String edition; - - @Schema(description = "版本号") - private String version; - - @Schema(description = "是否已安装") - @QueryField(type = QueryType.EQ) - private Integer isUse; - - @Schema(description = "附近1") - private String file1; - - @Schema(description = "附件2") - private String file2; - - @Schema(description = "附件3") - private String file3; - - @Schema(description = "是否显示续费提醒") - @QueryField(type = QueryType.EQ) - private Boolean showExpiration; - - @Schema(description = "是否作为案例展示") - @QueryField(type = QueryType.EQ) - private Boolean showCase; - - @Schema(description = "是否显示在首页") - @QueryField(type = QueryType.EQ) - private Integer showIndex; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "到期时间") - private String expirationTime; - - @Schema(description = "续费金额") - @QueryField(type = QueryType.EQ) - private BigDecimal renewMoney; - - @Schema(description = "应用状态") - private String appStatus; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "机构id") - @QueryField(type = QueryType.EQ) - private Integer organizationId; - - @Schema(description = "租户编号") - private String tenantCode; - - @Schema(description = "按APPID集搜索") - @TableField(exist = false) - private Set appIds; - - @Schema(description = "访问令牌") - @TableField(exist = false) - private String token; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAppRenewParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAppRenewParam.java deleted file mode 100644 index 7a2d2b0..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAppRenewParam.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 续费管理查询参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAppRenewParam对象", description = "续费管理查询参数") -public class OaAppRenewParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer appRenewId; - - @Schema(description = "应用ID") - @QueryField(type = QueryType.EQ) - private Integer appId; - - @Schema(description = "续费金额") - @QueryField(type = QueryType.EQ) - private BigDecimal money; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "开始时间") - private String startTime; - - @Schema(description = "到期时间") - private String endTime; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "付款凭证") - private String images; - - @Schema(description = "用户姓名") - private String nickname; - - @Schema(description = "状态, 0正常, 1待确认") - @QueryField(type = QueryType.EQ) - private Integer status; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAppUrlParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAppUrlParam.java deleted file mode 100644 index 1fd4639..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAppUrlParam.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 项目域名查询参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAppUrlParam对象", description = "项目域名查询参数") -public class OaAppUrlParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer appUrlId; - - @Schema(description = "应用ID") - @QueryField(type = QueryType.EQ) - private Integer appId; - - @Schema(description = "域名类型") - private String name; - - @Schema(description = "域名") - private String domain; - - @Schema(description = "账号") - private String account; - - @Schema(description = "密码") - private String password; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1待确认") - @QueryField(type = QueryType.EQ) - private Integer status; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAppUserParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAppUserParam.java deleted file mode 100644 index c4ee26d..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAppUserParam.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 应用成员查询参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAppUserParam对象", description = "应用成员查询参数") -public class OaAppUserParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer appUserId; - - @Schema(description = "角色,10体验成员 20开发者成员 30管理员 ") - @QueryField(type = QueryType.EQ) - private Integer role; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "应用ID") - @QueryField(type = QueryType.EQ) - private Integer appId; - - @Schema(description = "昵称") - private String nickname; - - @Schema(description = "状态, 0正常, 1待确认") - @QueryField(type = QueryType.EQ) - private Integer status; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAssetsCodeParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAssetsCodeParam.java deleted file mode 100644 index 2723b78..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAssetsCodeParam.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 代码仓库查询参数 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:01 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAssetsCodeParam对象", description = "代码仓库查询参数") -public class OaAssetsCodeParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "服务器ID") - @QueryField(type = QueryType.EQ) - private Integer assetsId; - - @Schema(description = "名称") - private String name; - - @Schema(description = "英文标识") - private String code; - - @Schema(description = "仓库地址") - private String gitUrl; - - @Schema(description = "仓库品牌") - private String brand; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAssetsDomainParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAssetsDomainParam.java deleted file mode 100644 index a33902c..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAssetsDomainParam.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 域名查询参数 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:01 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAssetsDomainParam对象", description = "域名查询参数") -public class OaAssetsDomainParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer domainId; - - @Schema(description = "服务器ID") - @QueryField(type = QueryType.EQ) - private Integer assetsId; - - @Schema(description = "域名") - private String name; - - @Schema(description = "域名标识") - private String code; - - @Schema(description = "注册厂商") - private String brand; - - @Schema(description = "初始账号") - private String account; - - @Schema(description = "初始密码") - private String password; - - @Schema(description = "价格") - @QueryField(type = QueryType.EQ) - private BigDecimal price; - - @Schema(description = "购买时间") - private String startTime; - - @Schema(description = "到期时间") - private String endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAssetsEmailParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAssetsEmailParam.java deleted file mode 100644 index 2477a23..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAssetsEmailParam.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 企业邮箱记录表查询参数 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAssetsEmailParam对象", description = "企业邮箱记录表查询参数") -public class OaAssetsEmailParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer emailId; - - @Schema(description = "邮箱名称") - private String name; - - @Schema(description = "域名标识") - private String code; - - @Schema(description = "邮箱型号") - private String type; - - @Schema(description = "品牌厂商") - private String brand; - - @Schema(description = "初始账号") - private String system; - - @Schema(description = "价格") - @QueryField(type = QueryType.EQ) - private BigDecimal price; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "购买时间") - private String startTime; - - @Schema(description = "到期时间") - private String endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAssetsMysqlParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAssetsMysqlParam.java deleted file mode 100644 index ccbc789..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAssetsMysqlParam.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 云数据库查询参数 - * - * @author 科技小王子 - * @since 2024-10-18 19:00:20 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAssetsMysqlParam对象", description = "云数据库查询参数") -public class OaAssetsMysqlParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer mysqlId; - - @Schema(description = "服务器ID") - @QueryField(type = QueryType.EQ) - private Integer assetsId; - - @Schema(description = "数据库名") - private String name; - - @Schema(description = "数据库标识") - private String code; - - @Schema(description = "注册厂商") - private String brand; - - @Schema(description = "ip地址") - private String ip; - - @Schema(description = "端口") - private String port; - - @Schema(description = "初始账号") - private String account; - - @Schema(description = "初始密码") - private String password; - - @Schema(description = "价格") - @QueryField(type = QueryType.EQ) - private BigDecimal price; - - @Schema(description = "购买时间") - private String startTime; - - @Schema(description = "到期时间") - private String endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAssetsParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAssetsParam.java deleted file mode 100644 index 66456d1..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAssetsParam.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 云服务器查询参数 - * - * @author 科技小王子 - * @since 2024-10-18 18:34:14 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAssetsParam对象", description = "云服务器查询参数") -public class OaAssetsParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "资产ID") - @QueryField(type = QueryType.EQ) - private Integer assetsId; - - @Schema(description = "资产名称") - private String name; - - @Schema(description = "资产标识") - private String code; - - @Schema(description = "资产类型") - private String type; - - @Schema(description = "服务器厂商") - private String brand; - - @Schema(description = "服务器配置") - private String configuration; - - @Schema(description = "初始账号") - private String account; - - @Schema(description = "初始密码") - private String password; - - @Schema(description = "(阿里云/腾讯云)登录账号") - private String brandAccount; - - @Schema(description = "(阿里云/腾讯云)登录密码") - private String brandPassword; - - @Schema(description = "宝塔面板") - private String panel; - - @Schema(description = "宝塔面板账号") - private String panelAccount; - - @Schema(description = "宝塔面板密码") - private String panelPassword; - - @Schema(description = "财务信息-合同金额") - @QueryField(type = QueryType.EQ) - private BigDecimal financeAmount; - - @Schema(description = "购买年限") - @QueryField(type = QueryType.EQ) - private Integer financeYears; - - @Schema(description = "续费金额") - @QueryField(type = QueryType.EQ) - private BigDecimal financeRenew; - - @Schema(description = "客户名称") - private String financeCustomerName; - - @Schema(description = "客户联系人") - private String financeCustomerContact; - - @Schema(description = "客户联系电话") - private String financeCustomerPhone; - - @Schema(description = "客户ID") - @QueryField(type = QueryType.EQ) - private Integer customerId; - - @Schema(description = "客户名称") - private String customerName; - - @Schema(description = "开放端口") - private String openPort; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "购买时间") - private String startTime; - - @Schema(description = "到期时间") - private String endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "可见性(public,private,protected)") - private String visibility; - - @Schema(description = "宝塔接口秘钥") - private String btSign; - - @Schema(description = "文章排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "客户ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "机构id") - @QueryField(type = QueryType.EQ) - private Integer organizationId; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAssetsServerParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAssetsServerParam.java deleted file mode 100644 index 47316f4..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAssetsServerParam.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.gxwebsoft.oa.param; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.gxwebsoft.common.core.annotation.QueryField; -import com.gxwebsoft.common.core.annotation.QueryType; -import com.gxwebsoft.common.core.web.BaseParam; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 服务查询参数 - * - * @author 科技小王子 - * @since 2024-10-21 19:15:26 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAssetsServerParam对象", description = "服务查询参数") -public class OaAssetsServerParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "插件id") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "服务名称") - private String server; - - @Schema(description = "接口地址") - private String serverUrl; - - @Schema(description = "排序号") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "服务器ID") - @QueryField(type = QueryType.EQ) - private Integer assetsId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 10待审核 20已通过 30已驳回") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAssetsSiteParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAssetsSiteParam.java deleted file mode 100644 index 2b28bea..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAssetsSiteParam.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 网站信息记录表查询参数 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAssetsSiteParam对象", description = "网站信息记录表查询参数") -public class OaAssetsSiteParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "站点ID") - @QueryField(type = QueryType.EQ) - private Integer websiteId; - - @Schema(description = "网站名称") - private String websiteName; - - @Schema(description = "网站标识") - private String websiteCode; - - @Schema(description = "网站LOGO") - private String websiteIcon; - - @Schema(description = "网站LOGO") - private String websiteLogo; - - @Schema(description = "网站LOGO(深色模式)") - private String websiteDarkLogo; - - @Schema(description = "网站类型") - private String websiteType; - - @Schema(description = "网站关键词") - private String keywords; - - @Schema(description = "域名前缀") - private String prefix; - - @Schema(description = "绑定域名") - private String domain; - - @Schema(description = "全局样式") - private String style; - - @Schema(description = "后台管理地址") - private String adminUrl; - - @Schema(description = "应用版本 10免费版 20授权版 30永久授权") - @QueryField(type = QueryType.EQ) - private Integer version; - - @Schema(description = "服务到期时间") - private String expirationTime; - - @Schema(description = "模版ID") - @QueryField(type = QueryType.EQ) - private Integer templateId; - - @Schema(description = "行业类型(父级)") - private String industryParent; - - @Schema(description = "行业类型(子级)") - private String industryChild; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "经度") - private String longitude; - - @Schema(description = "纬度") - private String latitude; - - @Schema(description = "街道地址") - private String address; - - @Schema(description = "联系电话") - private String phone; - - @Schema(description = "电子邮箱") - private String email; - - @Schema(description = "ICP备案号") - private String icpNo; - - @Schema(description = "公安备案") - private String policeNo; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "状态 0未开通 1运行中 2维护中 3已关闭 4已欠费停机 5违规关停") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "维护说明") - private String statusText; - - @Schema(description = "关闭说明") - private String statusClose; - - @Schema(description = "全局样式") - private String styles; - - @Schema(description = "排序号") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "服务器ID") - @QueryField(type = QueryType.EQ) - private Integer assetsId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAssetsSoftwareCertParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAssetsSoftwareCertParam.java deleted file mode 100644 index 22c7937..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAssetsSoftwareCertParam.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 计算机软件著作权登记查询参数 - * - * @author 科技小王子 - * @since 2024-10-18 19:46:21 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAssetsSoftwareCertParam对象", description = "计算机软件著作权登记查询参数") -public class OaAssetsSoftwareCertParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "名称") - private String name; - - @Schema(description = "软件著作权标识") - private String code; - - @Schema(description = "证书类型") - private String type; - - @Schema(description = "品牌厂商") - private String brand; - - @Schema(description = "价格") - @QueryField(type = QueryType.EQ) - private BigDecimal price; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "证书下载地址") - private String certUrl; - - @Schema(description = "购买时间") - private String startTime; - - @Schema(description = "到期时间") - private String endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAssetsSslParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAssetsSslParam.java deleted file mode 100644 index a11a568..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAssetsSslParam.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * ssl证书查询参数 - * - * @author 科技小王子 - * @since 2024-10-18 19:25:40 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAssetsSslParam对象", description = "ssl证书查询参数") -public class OaAssetsSslParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer sslId; - - @Schema(description = "证书名称") - private String name; - - @Schema(description = "证书标识") - private String code; - - @Schema(description = "证书类型") - private String type; - - @Schema(description = "品牌厂商") - private String brand; - - @Schema(description = "价格") - @QueryField(type = QueryType.EQ) - private BigDecimal price; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "证书key") - private String certKey; - - @Schema(description = "证书pem") - private String certPem; - - @Schema(description = "证书下载地址") - private String certUrl; - - @Schema(description = "证书crt") - private String certCrt; - - @Schema(description = "购买时间") - private String startTime; - - @Schema(description = "到期时间") - private String endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAssetsTrademarkParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAssetsTrademarkParam.java deleted file mode 100644 index fa3b93a..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAssetsTrademarkParam.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 商标注册查询参数 - * - * @author 科技小王子 - * @since 2024-10-18 19:46:21 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAssetsTrademarkParam对象", description = "商标注册查询参数") -public class OaAssetsTrademarkParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "商标名称") - private String name; - - @Schema(description = "商标标识") - private String code; - - @Schema(description = "商标类型") - private String type; - - @Schema(description = "品牌厂商") - private String brand; - - @Schema(description = "价格") - @QueryField(type = QueryType.EQ) - private BigDecimal price; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "证书下载") - private String certUrl; - - @Schema(description = "购买时间") - private String startTime; - - @Schema(description = "到期时间") - private String endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAssetsUserParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAssetsUserParam.java deleted file mode 100644 index 26b3ec7..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAssetsUserParam.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 服务器成员管理查询参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAssetsUserParam对象", description = "服务器成员管理查询参数") -public class OaAssetsUserParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "角色,10体验成员 20开发者成员 30管理员 ") - @QueryField(type = QueryType.EQ) - private Integer role; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "应用ID") - @QueryField(type = QueryType.EQ) - private Integer assetsId; - - @Schema(description = "昵称") - private String nickname; - - @Schema(description = "状态, 0正常, 1待确认") - @QueryField(type = QueryType.EQ) - private Integer status; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaAssetsVhostParam.java b/src/main/java/com/gxwebsoft/oa/param/OaAssetsVhostParam.java deleted file mode 100644 index 2e90dbf..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaAssetsVhostParam.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 虚拟主机记录表查询参数 - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaAssetsVhostParam对象", description = "虚拟主机记录表查询参数") -public class OaAssetsVhostParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer vhostId; - - @Schema(description = "域名") - private String name; - - @Schema(description = "域名标识") - private String code; - - @Schema(description = "主机型号") - private String type; - - @Schema(description = "品牌厂商") - private String brand; - - @Schema(description = "初始账号") - private String account; - - @Schema(description = "初始密码") - private String password; - - @Schema(description = "价格") - @QueryField(type = QueryType.EQ) - private BigDecimal price; - - @Schema(description = "详情内容") - private String content; - - @Schema(description = "ssl证书") - private String ssl; - - @Schema(description = "购买时间") - private String startTime; - - @Schema(description = "到期时间") - private String endTime; - - @Schema(description = "置顶状态") - private String isTop; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "描述") - private String comments; - - @Schema(description = "服务器ID") - @QueryField(type = QueryType.EQ) - private Integer assetsId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "可见用户") - private String userIds; - - @Schema(description = "状态, 0正常, 1冻结") - private String status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaCompanyFieldParam.java b/src/main/java/com/gxwebsoft/oa/param/OaCompanyFieldParam.java deleted file mode 100644 index c81f21b..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaCompanyFieldParam.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 企业参数查询参数 - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaCompanyFieldParam对象", description = "企业参数查询参数") -public class OaCompanyFieldParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "名称") - private String name; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "状态, 0正常, 1删除") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaCompanyParam.java b/src/main/java/com/gxwebsoft/oa/param/OaCompanyParam.java deleted file mode 100644 index c63b531..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaCompanyParam.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 企业信息查询参数 - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaCompanyParam对象", description = "企业信息查询参数") -public class OaCompanyParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "企业id") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "企业简称") - private String shortName; - - @Schema(description = "企业全称") - private String companyName; - - @Schema(description = "企业标识") - private String companyCode; - - @Schema(description = "类型 10企业 20政府单位") - private String companyType; - - @Schema(description = "企业类型多选") - private String companyTypeMultiple; - - @Schema(description = "应用标识") - private String companyLogo; - - @Schema(description = "应用类型") - private String appType; - - @Schema(description = "绑定域名") - private String domain; - - @Schema(description = "联系电话") - private String phone; - - @Schema(description = "座机电话") - private String tel; - - @Schema(description = "邮箱") - private String email; - - @Schema(description = "发票抬头") - private String invoiceHeader; - - @Schema(description = "企业法人") - private String businessEntity; - - @Schema(description = "服务开始时间") - private String startTime; - - @Schema(description = "服务到期时间") - private String expirationTime; - - @Schema(description = "应用版本 10体验版 20授权版 30旗舰版") - @QueryField(type = QueryType.EQ) - private Integer version; - - @Schema(description = "成员数量(人数上限)") - @QueryField(type = QueryType.EQ) - private Integer members; - - @Schema(description = "成员数量(当前)") - @QueryField(type = QueryType.EQ) - private Integer users; - - @Schema(description = "行业类型(父级)") - private String industryParent; - - @Schema(description = "行业类型(子级)") - private String industryChild; - - @Schema(description = "部门数量") - @QueryField(type = QueryType.EQ) - private Integer departments; - - @Schema(description = "存储空间") - private Long storage; - - @Schema(description = "存储空间(上限)") - private Long storageMax; - - @Schema(description = "所在国家") - private String country; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "街道地址") - private String address; - - @Schema(description = "经度") - private String longitude; - - @Schema(description = "纬度") - private String latitude; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "是否实名认证") - @QueryField(type = QueryType.EQ) - private Integer authentication; - - @Schema(description = "企业默认主体") - @QueryField(type = QueryType.EQ) - private Integer authoritative; - - @Schema(description = "request合法域名") - private String requestUrl; - - @Schema(description = "socket合法域名") - private String socketUrl; - - @Schema(description = "主控端域名") - private String serverUrl; - - @Schema(description = "业务域名") - private String modulesUrl; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "点赞数量") - @QueryField(type = QueryType.EQ) - private Integer likes; - - @Schema(description = "点击数量") - @QueryField(type = QueryType.EQ) - private Integer clicks; - - @Schema(description = "购买数量") - @QueryField(type = QueryType.EQ) - private Integer buys; - - @Schema(description = "是否含税, 0不含, 1含") - @QueryField(type = QueryType.EQ) - private Integer isTax; - - @Schema(description = "当前克隆的租户ID") - @QueryField(type = QueryType.EQ) - private Integer planId; - - @Schema(description = "状态") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "排序号") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaCompanyUserParam.java b/src/main/java/com/gxwebsoft/oa/param/OaCompanyUserParam.java deleted file mode 100644 index bcba114..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaCompanyUserParam.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 成员管理查询参数 - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaCompanyUserParam对象", description = "成员管理查询参数") -public class OaCompanyUserParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer companyUserId; - - @Schema(description = "角色,10体验成员 20开发者成员 30管理员 ") - @QueryField(type = QueryType.EQ) - private Integer role; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "昵称") - private String nickname; - - @Schema(description = "状态, 0正常, 1待确认") - @QueryField(type = QueryType.EQ) - private Integer status; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaLinkParam.java b/src/main/java/com/gxwebsoft/oa/param/OaLinkParam.java deleted file mode 100644 index 08a965b..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaLinkParam.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 常用链接查询参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaLinkParam对象", description = "常用链接查询参数") -public class OaLinkParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "链接名称") - private String name; - - @Schema(description = "图标") - private String icon; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "链接分类") - private String linkType; - - @Schema(description = "应用ID") - @QueryField(type = QueryType.EQ) - private Integer appId; - - @Schema(description = "所属栏目") - @QueryField(type = QueryType.EQ) - private Integer categoryId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "状态, 0正常, 1待确认") - @QueryField(type = QueryType.EQ) - private Integer status; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaProductParam.java b/src/main/java/com/gxwebsoft/oa/param/OaProductParam.java deleted file mode 100644 index f200fe1..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaProductParam.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.math.BigDecimal; - -/** - * 产品记录表查询参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaProductParam对象", description = "产品记录表查询参数") -public class OaProductParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "产品ID") - @QueryField(type = QueryType.EQ) - private Integer productId; - - @Schema(description = "产品名称") - private String name; - - @Schema(description = "产品标识") - private String code; - - @Schema(description = "产品详情") - private String content; - - @Schema(description = "产品类型") - private String type; - - @Schema(description = "产品图标") - private String logo; - - @Schema(description = "产品金额") - @QueryField(type = QueryType.EQ) - private BigDecimal money; - - @Schema(description = "初始销量") - @QueryField(type = QueryType.EQ) - private Integer salesInitial; - - @Schema(description = "实际销量") - @QueryField(type = QueryType.EQ) - private Integer salesActual; - - @Schema(description = "库存总量(包含所有sku)") - @QueryField(type = QueryType.EQ) - private Integer stockTotal; - - @Schema(description = "背景颜色") - private String backgroundColor; - - @Schema(description = "背景图片") - private String backgroundImage; - - @Schema(description = "背景图片(gif)") - private String backgroundGif; - - @Schema(description = "购买链接") - private String buyUrl; - - @Schema(description = "控制台链接") - private String adminUrl; - - @Schema(description = "附件") - private String files; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0已上架, 1已下架") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaProductTabsParam.java b/src/main/java/com/gxwebsoft/oa/param/OaProductTabsParam.java deleted file mode 100644 index bf42fa9..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaProductTabsParam.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 产品标签记录表查询参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaProductTabsParam对象", description = "产品标签记录表查询参数") -public class OaProductTabsParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "产品标签ID") - @QueryField(type = QueryType.EQ) - private Integer tabId; - - @Schema(description = "产品ID") - @QueryField(type = QueryType.EQ) - private Integer productId; - - @Schema(description = "标签名称") - private String name; - - @Schema(description = "标签类型") - private String type; - - @Schema(description = "产品标签详情") - private String content; - - @Schema(description = "背景颜色") - private String backgroundColor; - - @Schema(description = "背景图片") - private String backgroundImage; - - @Schema(description = "附件") - private String files; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0已上架, 1已下架") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaTaskCountParam.java b/src/main/java/com/gxwebsoft/oa/param/OaTaskCountParam.java deleted file mode 100644 index d60bcb4..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaTaskCountParam.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 数据统计查询参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaTaskCountParam对象", description = "数据统计查询参数") -public class OaTaskCountParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer taskCountId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "待处理数") - @QueryField(type = QueryType.EQ) - private Integer pending; - - @Schema(description = "闲置的工单(废弃)") - @QueryField(type = QueryType.EQ) - private Integer unused; - - @Schema(description = "已完成数(废弃)") - @QueryField(type = QueryType.EQ) - private Integer completed; - - @Schema(description = "今天处理数") - @QueryField(type = QueryType.EQ) - private Integer today; - - @Schema(description = "本月处理数") - @QueryField(type = QueryType.EQ) - private Integer month; - - @Schema(description = "今年处理数") - @QueryField(type = QueryType.EQ) - private Integer year; - - @Schema(description = "总工单数") - @QueryField(type = QueryType.EQ) - private Integer total; - - @Schema(description = "部门ID") - @QueryField(type = QueryType.EQ) - private Integer organizationId; - - @Schema(description = "角色ID") - @QueryField(type = QueryType.EQ) - private Integer roleId; - - @Schema(description = "角色标识") - private String roleCode; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaTaskParam.java b/src/main/java/com/gxwebsoft/oa/param/OaTaskParam.java deleted file mode 100644 index 85129f7..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaTaskParam.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 任务记录表查询参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaTaskParam对象", description = "任务记录表查询参数") -public class OaTaskParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "工单ID") - @QueryField(type = QueryType.EQ) - private Integer taskId; - - @Schema(description = "工单类型") - private String taskType; - - @Schema(description = "任务内容") - private String name; - - @Schema(description = "问题描述") - private String content; - - @Schema(description = "工单附件") - private String files; - - @Schema(description = "工单发起人") - @QueryField(type = QueryType.EQ) - private Integer promoter; - - @Schema(description = "受理人") - @QueryField(type = QueryType.EQ) - private Integer commander; - - @Schema(description = "工单状态, 0未开始 1已指派 ") - @QueryField(type = QueryType.EQ) - private Integer progress; - - @Schema(description = "优先级") - private String priority; - - @Schema(description = "品质要求") - private String quality; - - @Schema(description = "时限(天)") - @QueryField(type = QueryType.EQ) - private Integer day; - - @Schema(description = "手机号") - private String phone; - - @Schema(description = "开始时间") - private String startTime; - - @Schema(description = "结束时间") - private String endTime; - - @Schema(description = "逾期天数") - @QueryField(type = QueryType.EQ) - private Integer overdueDays; - - @Schema(description = "项目ID") - @QueryField(type = QueryType.EQ) - private Integer appId; - - @Schema(description = "机构id") - @QueryField(type = QueryType.EQ) - private Integer organizationId; - - @Schema(description = "项目ID") - @QueryField(type = QueryType.EQ) - private Integer projectId; - - @Schema(description = "客户ID") - @QueryField(type = QueryType.EQ) - private Integer customerId; - - @Schema(description = "资产ID") - @QueryField(type = QueryType.EQ) - private Integer assetsId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "是否已查阅") - @QueryField(type = QueryType.EQ) - private Integer isRead; - - @Schema(description = "最后回复人") - @QueryField(type = QueryType.EQ) - private Integer lastReadUser; - - @Schema(description = "发起人昵称") - private String nickname; - - @Schema(description = "发起人头像") - private String avatar; - - @Schema(description = "最后回复人头像") - private String lastAvatar; - - @Schema(description = "最后回复人昵称") - private String lastNickname; - - @Schema(description = "订单是否已结算(0未结算 1已结算)") - @QueryField(type = QueryType.EQ) - private Integer isSettled; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0待处理, 1已完成") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaTaskRecordParam.java b/src/main/java/com/gxwebsoft/oa/param/OaTaskRecordParam.java deleted file mode 100644 index 8d5f275..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaTaskRecordParam.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 工单回复记录表查询参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaTaskRecordParam对象", description = "工单回复记录表查询参数") -public class OaTaskRecordParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "回复ID") - @QueryField(type = QueryType.EQ) - private Integer taskRecordId; - - @Schema(description = "上级id, 0是顶级") - @QueryField(type = QueryType.EQ) - private Integer parentId; - - @Schema(description = "工单ID") - @QueryField(type = QueryType.EQ) - private Integer taskId; - - @Schema(description = "内容") - private String content; - - @Schema(description = "机密信息") - private String confidential; - - @Schema(description = "联系电话") - private String phone; - - @Schema(description = "工单附件") - private String files; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "状态, 0待处理, 1已完成") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/oa/param/OaTaskUserParam.java b/src/main/java/com/gxwebsoft/oa/param/OaTaskUserParam.java deleted file mode 100644 index 3fdfbeb..0000000 --- a/src/main/java/com/gxwebsoft/oa/param/OaTaskUserParam.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.gxwebsoft.oa.param; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 工单成员查询参数 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "OaTaskUserParam对象", description = "工单成员查询参数") -public class OaTaskUserParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer taskUserId; - - @Schema(description = "角色,10体验成员 20开发者成员 30管理员 ") - @QueryField(type = QueryType.EQ) - private Integer role; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "工单ID") - @QueryField(type = QueryType.EQ) - private Integer taskId; - - @Schema(description = "昵称") - private String nickname; - - @Schema(description = "状态, 0待处理, 1已完成") - @QueryField(type = QueryType.EQ) - private Integer status; - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAppFieldService.java b/src/main/java/com/gxwebsoft/oa/service/OaAppFieldService.java deleted file mode 100644 index 94d905f..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAppFieldService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAppField; -import com.gxwebsoft.oa.param.OaAppFieldParam; - -import java.util.List; - -/** - * 应用参数Service - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -public interface OaAppFieldService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAppFieldParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAppFieldParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return OaAppField - */ - OaAppField getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAppRenewService.java b/src/main/java/com/gxwebsoft/oa/service/OaAppRenewService.java deleted file mode 100644 index c41f20f..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAppRenewService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAppRenew; -import com.gxwebsoft.oa.param.OaAppRenewParam; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 续费管理Service - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -public interface OaAppRenewService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAppRenewParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAppRenewParam param); - - /** - * 根据id查询 - * - * @param appRenewId 自增ID - * @return OaAppRenew - */ - OaAppRenew getByIdRel(Integer appRenewId); - - /** - * 统计金额总和 - * @param wrapper 查询条件 - * @return 金额总和 - */ - BigDecimal sumMoney(LambdaQueryWrapper wrapper); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAppService.java b/src/main/java/com/gxwebsoft/oa/service/OaAppService.java deleted file mode 100644 index e9c76b2..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAppService.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaApp; -import com.gxwebsoft.oa.param.OaAppParam; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 应用Service - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -public interface OaAppService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAppParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAppParam param); - - /** - * 根据id查询 - * - * @param appId 应用ID - * @return OaApp - */ - OaApp getByIdRel(Integer appId); - - /** - * 统计金额总和 - * - * @param wrapper 查询条件 - * @return 金额总和 - */ - BigDecimal sumMoney(LambdaQueryWrapper wrapper); -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAppUrlService.java b/src/main/java/com/gxwebsoft/oa/service/OaAppUrlService.java deleted file mode 100644 index eef2650..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAppUrlService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAppUrl; -import com.gxwebsoft.oa.param.OaAppUrlParam; - -import java.util.List; - -/** - * 项目域名Service - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -public interface OaAppUrlService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAppUrlParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAppUrlParam param); - - /** - * 根据id查询 - * - * @param appUrlId 自增ID - * @return OaAppUrl - */ - OaAppUrl getByIdRel(Integer appUrlId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAppUserService.java b/src/main/java/com/gxwebsoft/oa/service/OaAppUserService.java deleted file mode 100644 index 1dd7f82..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAppUserService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAppUser; -import com.gxwebsoft.oa.param.OaAppUserParam; - -import java.util.List; - -/** - * 应用成员Service - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -public interface OaAppUserService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAppUserParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAppUserParam param); - - /** - * 根据id查询 - * - * @param appUserId 自增ID - * @return OaAppUser - */ - OaAppUser getByIdRel(Integer appUserId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAssetsCodeService.java b/src/main/java/com/gxwebsoft/oa/service/OaAssetsCodeService.java deleted file mode 100644 index 681ef81..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAssetsCodeService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAssetsCode; -import com.gxwebsoft.oa.param.OaAssetsCodeParam; - -import java.util.List; - -/** - * 代码仓库Service - * - * @author 科技小王子 - * @since 2024-10-18 18:27:01 - */ -public interface OaAssetsCodeService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAssetsCodeParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAssetsCodeParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return OaAssetsCode - */ - OaAssetsCode getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAssetsDomainService.java b/src/main/java/com/gxwebsoft/oa/service/OaAssetsDomainService.java deleted file mode 100644 index 735df28..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAssetsDomainService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAssetsDomain; -import com.gxwebsoft.oa.param.OaAssetsDomainParam; - -import java.util.List; - -/** - * 域名Service - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -public interface OaAssetsDomainService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAssetsDomainParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAssetsDomainParam param); - - /** - * 根据id查询 - * - * @param domainId ID - * @return OaAssetsDomain - */ - OaAssetsDomain getByIdRel(Integer domainId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAssetsEmailService.java b/src/main/java/com/gxwebsoft/oa/service/OaAssetsEmailService.java deleted file mode 100644 index 84c1ab7..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAssetsEmailService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAssetsEmail; -import com.gxwebsoft.oa.param.OaAssetsEmailParam; - -import java.util.List; - -/** - * 企业邮箱记录表Service - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -public interface OaAssetsEmailService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAssetsEmailParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAssetsEmailParam param); - - /** - * 根据id查询 - * - * @param emailId ID - * @return OaAssetsEmail - */ - OaAssetsEmail getByIdRel(Integer emailId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAssetsMysqlService.java b/src/main/java/com/gxwebsoft/oa/service/OaAssetsMysqlService.java deleted file mode 100644 index 7263afd..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAssetsMysqlService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAssetsMysql; -import com.gxwebsoft.oa.param.OaAssetsMysqlParam; - -import java.util.List; - -/** - * 云数据库Service - * - * @author 科技小王子 - * @since 2024-10-18 19:00:20 - */ -public interface OaAssetsMysqlService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAssetsMysqlParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAssetsMysqlParam param); - - /** - * 根据id查询 - * - * @param mysqlId ID - * @return OaAssetsMysql - */ - OaAssetsMysql getByIdRel(Integer mysqlId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAssetsServerService.java b/src/main/java/com/gxwebsoft/oa/service/OaAssetsServerService.java deleted file mode 100644 index 8e1c558..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAssetsServerService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAssetsServer; -import com.gxwebsoft.oa.param.OaAssetsServerParam; - -import java.util.List; - -/** - * 服务Service - * - * @author 科技小王子 - * @since 2024-10-21 19:15:26 - */ -public interface OaAssetsServerService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAssetsServerParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAssetsServerParam param); - - /** - * 根据id查询 - * - * @param id 插件id - * @return OaAssetsServer - */ - OaAssetsServer getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAssetsService.java b/src/main/java/com/gxwebsoft/oa/service/OaAssetsService.java deleted file mode 100644 index 4142d5f..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAssetsService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAssets; -import com.gxwebsoft.oa.param.OaAssetsParam; - -import java.util.List; - -/** - * 云服务器Service - * - * @author 科技小王子 - * @since 2024-10-18 18:34:15 - */ -public interface OaAssetsService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAssetsParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAssetsParam param); - - /** - * 根据id查询 - * - * @param assetsId 资产ID - * @return OaAssets - */ - OaAssets getByIdRel(Integer assetsId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAssetsSiteService.java b/src/main/java/com/gxwebsoft/oa/service/OaAssetsSiteService.java deleted file mode 100644 index c8ec714..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAssetsSiteService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAssetsSite; -import com.gxwebsoft.oa.param.OaAssetsSiteParam; - -import java.util.List; - -/** - * 网站信息记录表Service - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -public interface OaAssetsSiteService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAssetsSiteParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAssetsSiteParam param); - - /** - * 根据id查询 - * - * @param websiteId 站点ID - * @return OaAssetsSite - */ - OaAssetsSite getByIdRel(Integer websiteId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAssetsSoftwareCertService.java b/src/main/java/com/gxwebsoft/oa/service/OaAssetsSoftwareCertService.java deleted file mode 100644 index 039f97d..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAssetsSoftwareCertService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAssetsSoftwareCert; -import com.gxwebsoft.oa.param.OaAssetsSoftwareCertParam; - -import java.util.List; - -/** - * 计算机软件著作权登记Service - * - * @author 科技小王子 - * @since 2024-10-18 19:46:21 - */ -public interface OaAssetsSoftwareCertService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAssetsSoftwareCertParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAssetsSoftwareCertParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return OaAssetsSoftwareCert - */ - OaAssetsSoftwareCert getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAssetsSslService.java b/src/main/java/com/gxwebsoft/oa/service/OaAssetsSslService.java deleted file mode 100644 index 3d150e7..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAssetsSslService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAssetsSsl; -import com.gxwebsoft.oa.param.OaAssetsSslParam; - -import java.util.List; - -/** - * ssl证书Service - * - * @author 科技小王子 - * @since 2024-10-18 19:25:40 - */ -public interface OaAssetsSslService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAssetsSslParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAssetsSslParam param); - - /** - * 根据id查询 - * - * @param sslId ID - * @return OaAssetsSsl - */ - OaAssetsSsl getByIdRel(Integer sslId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAssetsTrademarkService.java b/src/main/java/com/gxwebsoft/oa/service/OaAssetsTrademarkService.java deleted file mode 100644 index 838ed04..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAssetsTrademarkService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAssetsTrademark; -import com.gxwebsoft.oa.param.OaAssetsTrademarkParam; - -import java.util.List; - -/** - * 商标注册Service - * - * @author 科技小王子 - * @since 2024-10-18 19:46:21 - */ -public interface OaAssetsTrademarkService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAssetsTrademarkParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAssetsTrademarkParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return OaAssetsTrademark - */ - OaAssetsTrademark getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAssetsUserService.java b/src/main/java/com/gxwebsoft/oa/service/OaAssetsUserService.java deleted file mode 100644 index f976095..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAssetsUserService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAssetsUser; -import com.gxwebsoft.oa.param.OaAssetsUserParam; - -import java.util.List; - -/** - * 服务器成员管理Service - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -public interface OaAssetsUserService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAssetsUserParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAssetsUserParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return OaAssetsUser - */ - OaAssetsUser getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaAssetsVhostService.java b/src/main/java/com/gxwebsoft/oa/service/OaAssetsVhostService.java deleted file mode 100644 index 4b54c43..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaAssetsVhostService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAssetsVhost; -import com.gxwebsoft.oa.param.OaAssetsVhostParam; - -import java.util.List; - -/** - * 虚拟主机记录表Service - * - * @author 科技小王子 - * @since 2024-10-18 18:27:02 - */ -public interface OaAssetsVhostService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaAssetsVhostParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaAssetsVhostParam param); - - /** - * 根据id查询 - * - * @param vhostId ID - * @return OaAssetsVhost - */ - OaAssetsVhost getByIdRel(Integer vhostId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaCompanyFieldService.java b/src/main/java/com/gxwebsoft/oa/service/OaCompanyFieldService.java deleted file mode 100644 index 66ac876..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaCompanyFieldService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaCompanyField; -import com.gxwebsoft.oa.param.OaCompanyFieldParam; - -import java.util.List; - -/** - * 企业参数Service - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -public interface OaCompanyFieldService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaCompanyFieldParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaCompanyFieldParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return OaCompanyField - */ - OaCompanyField getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaCompanyService.java b/src/main/java/com/gxwebsoft/oa/service/OaCompanyService.java deleted file mode 100644 index fb91784..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaCompanyService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaCompany; -import com.gxwebsoft.oa.param.OaCompanyParam; - -import java.util.List; - -/** - * 企业信息Service - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -public interface OaCompanyService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaCompanyParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaCompanyParam param); - - /** - * 根据id查询 - * - * @param companyId 企业id - * @return OaCompany - */ - OaCompany getByIdRel(Integer companyId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaCompanyUserService.java b/src/main/java/com/gxwebsoft/oa/service/OaCompanyUserService.java deleted file mode 100644 index ff2c147..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaCompanyUserService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaCompanyUser; -import com.gxwebsoft.oa.param.OaCompanyUserParam; - -import java.util.List; - -/** - * 成员管理Service - * - * @author 科技小王子 - * @since 2024-09-20 12:33:12 - */ -public interface OaCompanyUserService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaCompanyUserParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaCompanyUserParam param); - - /** - * 根据id查询 - * - * @param companyUserId 自增ID - * @return OaCompanyUser - */ - OaCompanyUser getByIdRel(Integer companyUserId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaLinkService.java b/src/main/java/com/gxwebsoft/oa/service/OaLinkService.java deleted file mode 100644 index 6d8738f..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaLinkService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaLink; -import com.gxwebsoft.oa.param.OaLinkParam; - -import java.util.List; - -/** - * 常用链接Service - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaLinkService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaLinkParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaLinkParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return OaLink - */ - OaLink getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaProductService.java b/src/main/java/com/gxwebsoft/oa/service/OaProductService.java deleted file mode 100644 index 305cbd2..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaProductService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaProduct; -import com.gxwebsoft.oa.param.OaProductParam; - -import java.util.List; - -/** - * 产品记录表Service - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaProductService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaProductParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaProductParam param); - - /** - * 根据id查询 - * - * @param productId 产品ID - * @return OaProduct - */ - OaProduct getByIdRel(Integer productId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaProductTabsService.java b/src/main/java/com/gxwebsoft/oa/service/OaProductTabsService.java deleted file mode 100644 index e1725ff..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaProductTabsService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaProductTabs; -import com.gxwebsoft.oa.param.OaProductTabsParam; - -import java.util.List; - -/** - * 产品标签记录表Service - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaProductTabsService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaProductTabsParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaProductTabsParam param); - - /** - * 根据id查询 - * - * @param tabId 产品标签ID - * @return OaProductTabs - */ - OaProductTabs getByIdRel(Integer tabId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaTaskCountService.java b/src/main/java/com/gxwebsoft/oa/service/OaTaskCountService.java deleted file mode 100644 index 903f7cc..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaTaskCountService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaTaskCount; -import com.gxwebsoft.oa.param.OaTaskCountParam; - -import java.util.List; - -/** - * 数据统计Service - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaTaskCountService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaTaskCountParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaTaskCountParam param); - - /** - * 根据id查询 - * - * @param taskCountId 自增ID - * @return OaTaskCount - */ - OaTaskCount getByIdRel(Integer taskCountId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaTaskRecordService.java b/src/main/java/com/gxwebsoft/oa/service/OaTaskRecordService.java deleted file mode 100644 index 8045be0..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaTaskRecordService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaTaskRecord; -import com.gxwebsoft.oa.param.OaTaskRecordParam; - -import java.util.List; - -/** - * 工单回复记录表Service - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaTaskRecordService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaTaskRecordParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaTaskRecordParam param); - - /** - * 根据id查询 - * - * @param taskRecordId 回复ID - * @return OaTaskRecord - */ - OaTaskRecord getByIdRel(Integer taskRecordId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaTaskService.java b/src/main/java/com/gxwebsoft/oa/service/OaTaskService.java deleted file mode 100644 index 4f06f34..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaTaskService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaTask; -import com.gxwebsoft.oa.param.OaTaskParam; - -import java.util.List; - -/** - * 任务记录表Service - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaTaskService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaTaskParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaTaskParam param); - - /** - * 根据id查询 - * - * @param taskId 工单ID - * @return OaTask - */ - OaTask getByIdRel(Integer taskId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/OaTaskUserService.java b/src/main/java/com/gxwebsoft/oa/service/OaTaskUserService.java deleted file mode 100644 index 9c33890..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/OaTaskUserService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.oa.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaTaskUser; -import com.gxwebsoft.oa.param.OaTaskUserParam; - -import java.util.List; - -/** - * 工单成员Service - * - * @author 科技小王子 - * @since 2024-09-10 20:57:42 - */ -public interface OaTaskUserService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(OaTaskUserParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(OaTaskUserParam param); - - /** - * 根据id查询 - * - * @param taskUserId 自增ID - * @return OaTaskUser - */ - OaTaskUser getByIdRel(Integer taskUserId); - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAppFieldServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAppFieldServiceImpl.java deleted file mode 100644 index d70ecf7..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAppFieldServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAppFieldMapper; -import com.gxwebsoft.oa.service.OaAppFieldService; -import com.gxwebsoft.oa.entity.OaAppField; -import com.gxwebsoft.oa.param.OaAppFieldParam; -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 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Service -public class OaAppFieldServiceImpl extends ServiceImpl implements OaAppFieldService { - - @Override - public PageResult pageRel(OaAppFieldParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAppFieldParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAppField getByIdRel(Integer id) { - OaAppFieldParam param = new OaAppFieldParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAppRenewServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAppRenewServiceImpl.java deleted file mode 100644 index 682e7e2..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAppRenewServiceImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAppRenewMapper; -import com.gxwebsoft.oa.service.OaAppRenewService; -import com.gxwebsoft.oa.entity.OaAppRenew; -import com.gxwebsoft.oa.param.OaAppRenewParam; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 续费管理Service实现 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Service -public class OaAppRenewServiceImpl extends ServiceImpl implements OaAppRenewService { - - @Override - public PageResult pageRel(OaAppRenewParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAppRenewParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAppRenew getByIdRel(Integer appRenewId) { - OaAppRenewParam param = new OaAppRenewParam(); - param.setAppRenewId(appRenewId); - return param.getOne(baseMapper.selectListRel(param)); - } - - @Override - public BigDecimal sumMoney(LambdaQueryWrapper wrapper) { - return baseMapper.selectSumMoney(wrapper); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAppServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAppServiceImpl.java deleted file mode 100644 index bdc1596..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAppServiceImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAppMapper; -import com.gxwebsoft.oa.service.OaAppService; -import com.gxwebsoft.oa.entity.OaApp; -import com.gxwebsoft.oa.param.OaAppParam; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import org.springframework.stereotype.Service; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 应用Service实现 - * - * @author 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Service -public class OaAppServiceImpl extends ServiceImpl implements OaAppService { - - @Override - public PageResult pageRel(OaAppParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAppParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaApp getByIdRel(Integer appId) { - OaAppParam param = new OaAppParam(); - param.setAppId(appId); - return param.getOne(baseMapper.selectListRel(param)); - } - - @Override - public BigDecimal sumMoney(LambdaQueryWrapper wrapper) { - return baseMapper.selectSumMoney(wrapper); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAppUrlServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAppUrlServiceImpl.java deleted file mode 100644 index 1adab2c..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAppUrlServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAppUrlMapper; -import com.gxwebsoft.oa.service.OaAppUrlService; -import com.gxwebsoft.oa.entity.OaAppUrl; -import com.gxwebsoft.oa.param.OaAppUrlParam; -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 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Service -public class OaAppUrlServiceImpl extends ServiceImpl implements OaAppUrlService { - - @Override - public PageResult pageRel(OaAppUrlParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAppUrlParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAppUrl getByIdRel(Integer appUrlId) { - OaAppUrlParam param = new OaAppUrlParam(); - param.setAppUrlId(appUrlId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAppUserServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAppUserServiceImpl.java deleted file mode 100644 index 9372af0..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAppUserServiceImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAppUserMapper; -import com.gxwebsoft.oa.service.OaAppUserService; -import com.gxwebsoft.oa.entity.OaAppUser; -import com.gxwebsoft.oa.param.OaAppUserParam; -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 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Service -public class OaAppUserServiceImpl extends ServiceImpl implements OaAppUserService { - - @Override - public PageResult pageRel(OaAppUserParam param) { - PageParam page = new PageParam<>(param); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAppUserParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - return page.sortRecords(list); - } - - @Override - public OaAppUser getByIdRel(Integer appUserId) { - OaAppUserParam param = new OaAppUserParam(); - param.setAppUserId(appUserId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsCodeServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsCodeServiceImpl.java deleted file mode 100644 index 5d37730..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsCodeServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAssetsCodeMapper; -import com.gxwebsoft.oa.service.OaAssetsCodeService; -import com.gxwebsoft.oa.entity.OaAssetsCode; -import com.gxwebsoft.oa.param.OaAssetsCodeParam; -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 科技小王子 - * @since 2024-10-18 18:27:01 - */ -@Service -public class OaAssetsCodeServiceImpl extends ServiceImpl implements OaAssetsCodeService { - - @Override - public PageResult pageRel(OaAssetsCodeParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAssetsCodeParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAssetsCode getByIdRel(Integer id) { - OaAssetsCodeParam param = new OaAssetsCodeParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsDomainServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsDomainServiceImpl.java deleted file mode 100644 index ac207c6..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsDomainServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAssetsDomainMapper; -import com.gxwebsoft.oa.service.OaAssetsDomainService; -import com.gxwebsoft.oa.entity.OaAssetsDomain; -import com.gxwebsoft.oa.param.OaAssetsDomainParam; -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 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Service -public class OaAssetsDomainServiceImpl extends ServiceImpl implements OaAssetsDomainService { - - @Override - public PageResult pageRel(OaAssetsDomainParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAssetsDomainParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAssetsDomain getByIdRel(Integer domainId) { - OaAssetsDomainParam param = new OaAssetsDomainParam(); - param.setDomainId(domainId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsEmailServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsEmailServiceImpl.java deleted file mode 100644 index 7c3f4bc..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsEmailServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAssetsEmailMapper; -import com.gxwebsoft.oa.service.OaAssetsEmailService; -import com.gxwebsoft.oa.entity.OaAssetsEmail; -import com.gxwebsoft.oa.param.OaAssetsEmailParam; -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 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Service -public class OaAssetsEmailServiceImpl extends ServiceImpl implements OaAssetsEmailService { - - @Override - public PageResult pageRel(OaAssetsEmailParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAssetsEmailParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAssetsEmail getByIdRel(Integer emailId) { - OaAssetsEmailParam param = new OaAssetsEmailParam(); - param.setEmailId(emailId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsMysqlServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsMysqlServiceImpl.java deleted file mode 100644 index fc17f9a..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsMysqlServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAssetsMysqlMapper; -import com.gxwebsoft.oa.service.OaAssetsMysqlService; -import com.gxwebsoft.oa.entity.OaAssetsMysql; -import com.gxwebsoft.oa.param.OaAssetsMysqlParam; -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 科技小王子 - * @since 2024-10-18 19:00:20 - */ -@Service -public class OaAssetsMysqlServiceImpl extends ServiceImpl implements OaAssetsMysqlService { - - @Override - public PageResult pageRel(OaAssetsMysqlParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAssetsMysqlParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAssetsMysql getByIdRel(Integer mysqlId) { - OaAssetsMysqlParam param = new OaAssetsMysqlParam(); - param.setMysqlId(mysqlId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsServerServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsServerServiceImpl.java deleted file mode 100644 index b2e327b..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsServerServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.oa.entity.OaAssetsServer; -import com.gxwebsoft.oa.mapper.OaAssetsServerMapper; -import com.gxwebsoft.oa.param.OaAssetsServerParam; -import com.gxwebsoft.oa.service.OaAssetsServerService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 服务Service实现 - * - * @author 科技小王子 - * @since 2024-10-21 19:15:26 - */ -@Service -public class OaAssetsServerServiceImpl extends ServiceImpl implements OaAssetsServerService { - - @Override - public PageResult pageRel(OaAssetsServerParam 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(OaAssetsServerParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAssetsServer getByIdRel(Integer id) { - OaAssetsServerParam param = new OaAssetsServerParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsServiceImpl.java deleted file mode 100644 index 3c64144..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAssetsMapper; -import com.gxwebsoft.oa.service.OaAssetsService; -import com.gxwebsoft.oa.entity.OaAssets; -import com.gxwebsoft.oa.param.OaAssetsParam; -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 科技小王子 - * @since 2024-10-18 18:34:15 - */ -@Service -public class OaAssetsServiceImpl extends ServiceImpl implements OaAssetsService { - - @Override - public PageResult pageRel(OaAssetsParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAssetsParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAssets getByIdRel(Integer assetsId) { - OaAssetsParam param = new OaAssetsParam(); - param.setAssetsId(assetsId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsSiteServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsSiteServiceImpl.java deleted file mode 100644 index b94667d..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsSiteServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAssetsSiteMapper; -import com.gxwebsoft.oa.service.OaAssetsSiteService; -import com.gxwebsoft.oa.entity.OaAssetsSite; -import com.gxwebsoft.oa.param.OaAssetsSiteParam; -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 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Service -public class OaAssetsSiteServiceImpl extends ServiceImpl implements OaAssetsSiteService { - - @Override - public PageResult pageRel(OaAssetsSiteParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAssetsSiteParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAssetsSite getByIdRel(Integer websiteId) { - OaAssetsSiteParam param = new OaAssetsSiteParam(); - param.setWebsiteId(websiteId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsSoftwareCertServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsSoftwareCertServiceImpl.java deleted file mode 100644 index 2ac941c..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsSoftwareCertServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAssetsSoftwareCertMapper; -import com.gxwebsoft.oa.service.OaAssetsSoftwareCertService; -import com.gxwebsoft.oa.entity.OaAssetsSoftwareCert; -import com.gxwebsoft.oa.param.OaAssetsSoftwareCertParam; -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 科技小王子 - * @since 2024-10-18 19:46:21 - */ -@Service -public class OaAssetsSoftwareCertServiceImpl extends ServiceImpl implements OaAssetsSoftwareCertService { - - @Override - public PageResult pageRel(OaAssetsSoftwareCertParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAssetsSoftwareCertParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAssetsSoftwareCert getByIdRel(Integer id) { - OaAssetsSoftwareCertParam param = new OaAssetsSoftwareCertParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsSslServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsSslServiceImpl.java deleted file mode 100644 index c705669..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsSslServiceImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import cn.hutool.core.date.DateUtil; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAssetsSslMapper; -import com.gxwebsoft.oa.service.OaAssetsSslService; -import com.gxwebsoft.oa.entity.OaAssetsSsl; -import com.gxwebsoft.oa.param.OaAssetsSslParam; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import org.springframework.stereotype.Service; - -import java.time.LocalDateTime; -import java.util.List; - -/** - * ssl证书Service实现 - * - * @author 科技小王子 - * @since 2024-10-18 19:25:40 - */ -@Service -public class OaAssetsSslServiceImpl extends ServiceImpl implements OaAssetsSslService { - - @Override - public PageResult pageRel(OaAssetsSslParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - list.forEach(d -> { - // 即将过期(一周内过期的) - d.setSoon(DateUtil.offsetDay(d.getEndTime(), -7).compareTo(DateUtil.date())); - // 是否过期 -1已过期 大于0 未过期 - d.setStatus(d.getEndTime().compareTo(DateUtil.date())); - }); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAssetsSslParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAssetsSsl getByIdRel(Integer sslId) { - OaAssetsSslParam param = new OaAssetsSslParam(); - param.setSslId(sslId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsTrademarkServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsTrademarkServiceImpl.java deleted file mode 100644 index 7baede1..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsTrademarkServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAssetsTrademarkMapper; -import com.gxwebsoft.oa.service.OaAssetsTrademarkService; -import com.gxwebsoft.oa.entity.OaAssetsTrademark; -import com.gxwebsoft.oa.param.OaAssetsTrademarkParam; -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 科技小王子 - * @since 2024-10-18 19:46:21 - */ -@Service -public class OaAssetsTrademarkServiceImpl extends ServiceImpl implements OaAssetsTrademarkService { - - @Override - public PageResult pageRel(OaAssetsTrademarkParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAssetsTrademarkParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAssetsTrademark getByIdRel(Integer id) { - OaAssetsTrademarkParam param = new OaAssetsTrademarkParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsUserServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsUserServiceImpl.java deleted file mode 100644 index 4869455..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsUserServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAssetsUserMapper; -import com.gxwebsoft.oa.service.OaAssetsUserService; -import com.gxwebsoft.oa.entity.OaAssetsUser; -import com.gxwebsoft.oa.param.OaAssetsUserParam; -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 科技小王子 - * @since 2024-09-10 20:57:41 - */ -@Service -public class OaAssetsUserServiceImpl extends ServiceImpl implements OaAssetsUserService { - - @Override - public PageResult pageRel(OaAssetsUserParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAssetsUserParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAssetsUser getByIdRel(Integer id) { - OaAssetsUserParam param = new OaAssetsUserParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsVhostServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsVhostServiceImpl.java deleted file mode 100644 index 87b1a08..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaAssetsVhostServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaAssetsVhostMapper; -import com.gxwebsoft.oa.service.OaAssetsVhostService; -import com.gxwebsoft.oa.entity.OaAssetsVhost; -import com.gxwebsoft.oa.param.OaAssetsVhostParam; -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 科技小王子 - * @since 2024-10-18 18:27:02 - */ -@Service -public class OaAssetsVhostServiceImpl extends ServiceImpl implements OaAssetsVhostService { - - @Override - public PageResult pageRel(OaAssetsVhostParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaAssetsVhostParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaAssetsVhost getByIdRel(Integer vhostId) { - OaAssetsVhostParam param = new OaAssetsVhostParam(); - param.setVhostId(vhostId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaCompanyFieldServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaCompanyFieldServiceImpl.java deleted file mode 100644 index e7b76d6..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaCompanyFieldServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaCompanyFieldMapper; -import com.gxwebsoft.oa.service.OaCompanyFieldService; -import com.gxwebsoft.oa.entity.OaCompanyField; -import com.gxwebsoft.oa.param.OaCompanyFieldParam; -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 科技小王子 - * @since 2024-09-20 12:33:12 - */ -@Service -public class OaCompanyFieldServiceImpl extends ServiceImpl implements OaCompanyFieldService { - - @Override - public PageResult pageRel(OaCompanyFieldParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaCompanyFieldParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaCompanyField getByIdRel(Integer id) { - OaCompanyFieldParam param = new OaCompanyFieldParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaCompanyServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaCompanyServiceImpl.java deleted file mode 100644 index 1c53913..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaCompanyServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaCompanyMapper; -import com.gxwebsoft.oa.service.OaCompanyService; -import com.gxwebsoft.oa.entity.OaCompany; -import com.gxwebsoft.oa.param.OaCompanyParam; -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 科技小王子 - * @since 2024-09-20 12:33:12 - */ -@Service -public class OaCompanyServiceImpl extends ServiceImpl implements OaCompanyService { - - @Override - public PageResult pageRel(OaCompanyParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaCompanyParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaCompany getByIdRel(Integer companyId) { - OaCompanyParam param = new OaCompanyParam(); - param.setCompanyId(companyId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaCompanyUserServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaCompanyUserServiceImpl.java deleted file mode 100644 index 43b4230..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaCompanyUserServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaCompanyUserMapper; -import com.gxwebsoft.oa.service.OaCompanyUserService; -import com.gxwebsoft.oa.entity.OaCompanyUser; -import com.gxwebsoft.oa.param.OaCompanyUserParam; -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 科技小王子 - * @since 2024-09-20 12:33:12 - */ -@Service -public class OaCompanyUserServiceImpl extends ServiceImpl implements OaCompanyUserService { - - @Override - public PageResult pageRel(OaCompanyUserParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaCompanyUserParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaCompanyUser getByIdRel(Integer companyUserId) { - OaCompanyUserParam param = new OaCompanyUserParam(); - param.setCompanyUserId(companyUserId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaLinkServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaLinkServiceImpl.java deleted file mode 100644 index 4050f49..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaLinkServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaLinkMapper; -import com.gxwebsoft.oa.service.OaLinkService; -import com.gxwebsoft.oa.entity.OaLink; -import com.gxwebsoft.oa.param.OaLinkParam; -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 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Service -public class OaLinkServiceImpl extends ServiceImpl implements OaLinkService { - - @Override - public PageResult pageRel(OaLinkParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaLinkParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaLink getByIdRel(Integer id) { - OaLinkParam param = new OaLinkParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaProductServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaProductServiceImpl.java deleted file mode 100644 index 09506a3..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaProductServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaProductMapper; -import com.gxwebsoft.oa.service.OaProductService; -import com.gxwebsoft.oa.entity.OaProduct; -import com.gxwebsoft.oa.param.OaProductParam; -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 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Service -public class OaProductServiceImpl extends ServiceImpl implements OaProductService { - - @Override - public PageResult pageRel(OaProductParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaProductParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaProduct getByIdRel(Integer productId) { - OaProductParam param = new OaProductParam(); - param.setProductId(productId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaProductTabsServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaProductTabsServiceImpl.java deleted file mode 100644 index 98a4203..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaProductTabsServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaProductTabsMapper; -import com.gxwebsoft.oa.service.OaProductTabsService; -import com.gxwebsoft.oa.entity.OaProductTabs; -import com.gxwebsoft.oa.param.OaProductTabsParam; -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 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Service -public class OaProductTabsServiceImpl extends ServiceImpl implements OaProductTabsService { - - @Override - public PageResult pageRel(OaProductTabsParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaProductTabsParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaProductTabs getByIdRel(Integer tabId) { - OaProductTabsParam param = new OaProductTabsParam(); - param.setTabId(tabId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaTaskCountServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaTaskCountServiceImpl.java deleted file mode 100644 index 8da15ca..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaTaskCountServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaTaskCountMapper; -import com.gxwebsoft.oa.service.OaTaskCountService; -import com.gxwebsoft.oa.entity.OaTaskCount; -import com.gxwebsoft.oa.param.OaTaskCountParam; -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 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Service -public class OaTaskCountServiceImpl extends ServiceImpl implements OaTaskCountService { - - @Override - public PageResult pageRel(OaTaskCountParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaTaskCountParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaTaskCount getByIdRel(Integer taskCountId) { - OaTaskCountParam param = new OaTaskCountParam(); - param.setTaskCountId(taskCountId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaTaskRecordServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaTaskRecordServiceImpl.java deleted file mode 100644 index bdaee94..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaTaskRecordServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaTaskRecordMapper; -import com.gxwebsoft.oa.service.OaTaskRecordService; -import com.gxwebsoft.oa.entity.OaTaskRecord; -import com.gxwebsoft.oa.param.OaTaskRecordParam; -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 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Service -public class OaTaskRecordServiceImpl extends ServiceImpl implements OaTaskRecordService { - - @Override - public PageResult pageRel(OaTaskRecordParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaTaskRecordParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaTaskRecord getByIdRel(Integer taskRecordId) { - OaTaskRecordParam param = new OaTaskRecordParam(); - param.setTaskRecordId(taskRecordId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaTaskServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaTaskServiceImpl.java deleted file mode 100644 index 1ea3691..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaTaskServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaTaskMapper; -import com.gxwebsoft.oa.service.OaTaskService; -import com.gxwebsoft.oa.entity.OaTask; -import com.gxwebsoft.oa.param.OaTaskParam; -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 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Service -public class OaTaskServiceImpl extends ServiceImpl implements OaTaskService { - - @Override - public PageResult pageRel(OaTaskParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaTaskParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaTask getByIdRel(Integer taskId) { - OaTaskParam param = new OaTaskParam(); - param.setTaskId(taskId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/oa/service/impl/OaTaskUserServiceImpl.java b/src/main/java/com/gxwebsoft/oa/service/impl/OaTaskUserServiceImpl.java deleted file mode 100644 index c7a15ef..0000000 --- a/src/main/java/com/gxwebsoft/oa/service/impl/OaTaskUserServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.oa.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.oa.mapper.OaTaskUserMapper; -import com.gxwebsoft.oa.service.OaTaskUserService; -import com.gxwebsoft.oa.entity.OaTaskUser; -import com.gxwebsoft.oa.param.OaTaskUserParam; -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 科技小王子 - * @since 2024-09-10 20:57:42 - */ -@Service -public class OaTaskUserServiceImpl extends ServiceImpl implements OaTaskUserService { - - @Override - public PageResult pageRel(OaTaskUserParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(OaTaskUserParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public OaTaskUser getByIdRel(Integer taskUserId) { - OaTaskUserParam param = new OaTaskUserParam(); - param.setTaskUserId(taskUserId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/project/controller/ProjectCollectionController.java b/src/main/java/com/gxwebsoft/project/controller/ProjectCollectionController.java deleted file mode 100644 index 1a61c7c..0000000 --- a/src/main/java/com/gxwebsoft/project/controller/ProjectCollectionController.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.gxwebsoft.project.controller; - -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.project.service.ProjectCollectionService; -import com.gxwebsoft.project.entity.ProjectCollection; -import com.gxwebsoft.project.param.ProjectCollectionParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 我的收藏控制器 - * - * @author 科技小王子 - * @since 2025-03-16 12:12:13 - */ -@Tag(name = "我的收藏管理") -@RestController -@RequestMapping("/api/project/project-collection") -public class ProjectCollectionController extends BaseController { - @Resource - private ProjectCollectionService projectCollectionService; - - @Operation(summary = "分页查询我的收藏") - @GetMapping("/page") - public ApiResult> page(ProjectCollectionParam param) { - // 使用关联查询 - return success(projectCollectionService.pageRel(param)); - } - - @Operation(summary = "查询全部我的收藏") - @GetMapping() - public ApiResult> list(ProjectCollectionParam param) { - // 使用关联查询 - return success(projectCollectionService.listRel(param)); - } - - @Operation(summary = "是否收藏") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - final ProjectCollection projectCollection = projectCollectionService.getOne(new LambdaQueryWrapper().eq(ProjectCollection::getAppId, id).eq(ProjectCollection::getUserId, getLoginUserId()).last("limit 1")); - if(ObjectUtil.isNotEmpty(projectCollection)){ - return success(true); - } - return success(false); - } - - @OperationLog - @Operation(summary = "加入收藏") - @PostMapping() - public ApiResult save(@RequestBody ProjectCollection projectCollection) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - projectCollection.setUserId(loginUser.getUserId()); - } - if (projectCollectionService.save(projectCollection)) { - return success("收藏成功"); - } - return fail("操作失败"); - } - - @OperationLog - @Operation(summary = "修改我的收藏") - @PutMapping() - public ApiResult update(@RequestBody ProjectCollection projectCollection) { - if (projectCollectionService.updateById(projectCollection)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @OperationLog - @Operation(summary = "取消收藏") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (projectCollectionService.remove(new LambdaQueryWrapper().eq(ProjectCollection::getAppId,id).eq(ProjectCollection::getUserId,getLoginUserId()))) { - return success("已取消收藏"); - } - return fail("操作失败"); - } - - @PreAuthorize("hasAuthority('project:projectCollection:save')") - @OperationLog - @Operation(summary = "批量添加我的收藏") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (projectCollectionService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('project:projectCollection:update')") - @OperationLog - @Operation(summary = "批量修改我的收藏") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(projectCollectionService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('project:projectCollection:remove')") - @OperationLog - @Operation(summary = "批量删除我的收藏") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (projectCollectionService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/project/controller/ProjectController.java b/src/main/java/com/gxwebsoft/project/controller/ProjectController.java deleted file mode 100644 index ae031dd..0000000 --- a/src/main/java/com/gxwebsoft/project/controller/ProjectController.java +++ /dev/null @@ -1,297 +0,0 @@ -package com.gxwebsoft.project.controller; - -import cn.hutool.core.date.DateTime; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.gxwebsoft.cms.entity.CmsWebsite; -import com.gxwebsoft.cms.param.CmsWebsiteParam; -import com.gxwebsoft.cms.service.CmsWebsiteService; -import com.gxwebsoft.common.core.utils.CommonUtil; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.Role; -import com.gxwebsoft.project.entity.ProjectUser; -import com.gxwebsoft.project.service.ProjectService; -import com.gxwebsoft.project.entity.Project; -import com.gxwebsoft.project.param.ProjectParam; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.project.service.ProjectUserService; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * 应用控制器 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Tag(name = "应用管理") -@RestController -@RequestMapping("/api/project/project") -public class ProjectController extends BaseController { - @Resource - private ProjectService projectService; - @Resource - private ProjectUserService projectUserService; - @Resource - private CmsWebsiteService cmsWebsiteService; - - @PreAuthorize("hasAuthority('project:project:list')") - @Operation(summary = "分页查询应用") - @GetMapping("/page") - public ApiResult> page(ProjectParam param) { - final User loginUser = getLoginUser(); - if (loginUser != null) { - param.setLoginUserId(loginUser.getUserId()); - final List roles = loginUser.getRoles(); - if (!CommonUtil.hasRole(roles, "admin") && !CommonUtil.hasRole(roles, "superAdmin")) { - final List projectUsers = projectUserService.list(new LambdaQueryWrapper().eq(ProjectUser::getUserId, loginUser.getUserId())); - final Set appIds = projectUsers.stream().map(ProjectUser::getAppId).collect(Collectors.toSet()); - param.setAppIds(appIds); - } - final PageResult result = projectService.pageRel(param); - final CmsWebsiteParam websiteParam = new CmsWebsiteParam(); - final List projects = result.getList(); - if(!CollectionUtils.isEmpty(projects)){ - final Set collectByProject = projects.stream().map(Project::getWebsiteId).collect(Collectors.toSet()); - websiteParam.setWebsiteIds(collectByProject); - final PageResult websitePageResult = cmsWebsiteService.pageRelAll(websiteParam); - if (!CollectionUtils.isEmpty(websitePageResult.getList())) { - final Map> collectByWebsite = websitePageResult.getList().stream().collect(Collectors.groupingBy(CmsWebsite::getWebsiteId)); - result.getList().forEach(item -> { - final List cmsWebsites = collectByWebsite.get(item.getWebsiteId()); - if (!CollectionUtils.isEmpty(cmsWebsites)) { - final CmsWebsite website = cmsWebsites.get(0); - item.setAppUrl(website.getDomain()); - item.setAdminUrl(website.getAdminUrl()); - item.setAppIcon(website.getWebsiteLogo()); - item.setAppType(website.getWebsiteType()); - item.setSuperAdminPhone(website.getSuperAdminPhone()); - } - }); - } - } - return success(result); - } - return fail("获取失败",null); - } - - @PreAuthorize("hasAuthority('project:project:list')") - @Operation(summary = "查询全部应用") - @GetMapping() - public ApiResult> list(ProjectParam param) { - // 使用关联查询 - return success(projectService.listRel(param)); - } - - @PreAuthorize("hasAuthority('project:project:list')") - @Operation(summary = "根据id查询应用") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(projectService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('project:project:save')") - @OperationLog - @Operation(summary = "添加应用") - @PostMapping() - public ApiResult save(@RequestBody Project project) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - project.setUserId(loginUser.getUserId()); - final Project one = projectService.getOne(new LambdaQueryWrapper().eq(Project::getAppCode, project.getAppCode()).last("limit 1")); - if (!ObjectUtil.isEmpty(one)) { - return fail("应用标识已存在"); - } - if (projectService.save(project)) { - final ProjectUser user = new ProjectUser(); - user.setUserId(loginUser.getUserId()); - user.setAppId(project.getAppId()); - user.setRole(30); - user.setNickname(loginUser.getNickname()); - projectUserService.save(user); - return success("添加成功"); - } - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('project:project:update')") - @OperationLog - @Operation(summary = "修改应用") - @PutMapping() - public ApiResult update(@RequestBody Project project) { - if(project.getAppStatus() != null && project.getAppStatus().equals("已上架")){ - project.setProgress(100); - } - if (projectService.updateById(project)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('project:project:remove')") - @OperationLog - @Operation(summary = "删除应用") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (projectService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('project:project:save')") - @OperationLog - @Operation(summary = "批量添加应用") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (projectService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('project:project:update')") - @OperationLog - @Operation(summary = "批量修改应用") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(projectService, "app_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('project:project:remove')") - @OperationLog - @Operation(summary = "批量删除应用") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (projectService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - - @Operation(summary = "统计信息") - @GetMapping("/data") - public ApiResult> data() { - Map data = new HashMap<>(); - final LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - final User loginUser = getLoginUser(); - if(loginUser != null){ - - final List roles = loginUser.getRoles(); - if (!CommonUtil.hasRole(roles, "admin") && !CommonUtil.hasRole(roles, "superAdmin")) { - final List projectUsers = projectUserService.list(new LambdaQueryWrapper().eq(ProjectUser::getUserId, loginUser.getUserId())); - final Set userIds = projectUsers.stream().map(ProjectUser::getAppId).collect(Collectors.toSet()); - wrapper.in(Project::getUserId,userIds); - } - - Integer totalNum = Math.toIntExact(projectService.count(wrapper)); - - wrapper.eq(Project::getAppStatus, "开发中"); - Integer totalNum2 = Math.toIntExact(projectService.count(wrapper)); - - wrapper.clear(); - wrapper.eq(Project::getAppStatus,"已上架"); - Integer totalNum3 = Math.toIntExact(projectService.count(wrapper)); - - wrapper.clear(); - wrapper.eq(Project::getAppStatus,"已上架").eq(Project::getShowExpiration,true); - Integer totalNum4 = Math.toIntExact(projectService.count(wrapper)); - - wrapper.clear(); - wrapper.eq(Project::getAppStatus, "已下架"); - Integer totalNum5 = Math.toIntExact(projectService.count(wrapper)); - - wrapper.clear(); - wrapper.eq(Project::getShowCase,true); - Integer totalNum6 = Math.toIntExact(projectService.count(wrapper)); - - wrapper.clear(); - wrapper.eq(Project::getShowIndex,true); - Integer totalNum7 = Math.toIntExact(projectService.count(wrapper)); - - data.put("totalNum", totalNum); - data.put("totalNum2", totalNum2); - data.put("totalNum3", totalNum3); - data.put("totalNum4", totalNum4); - data.put("totalNum5", totalNum5); - data.put("totalNum6", totalNum6); - data.put("totalNum7", totalNum7); - } - return success(data); - } - - @Operation(summary = "统计信息") - @GetMapping("/count") - public ApiResult> count() { - Map data = new HashMap<>(); - final User loginUser = getLoginUser(); - if (loginUser == null) { - return fail("请先登录", null); - } - - // 今天日期 - DateTime date = DateUtil.date(); - // 获取当前年份的起止时间 - LocalDateTime startOfYear = LocalDateTime.now().withMonth(1).withDayOfMonth(1) - .withHour(0).withMinute(0).withSecond(0); - LocalDateTime endOfYear = startOfYear.plusYears(1).minusNanos(1); - // 去年的起止时间 - LocalDateTime startOfLastYear = LocalDateTime.now().minusYears(1).withMonth(1).withDayOfMonth(1) - .withHour(0).withMinute(0).withSecond(0); - LocalDateTime endOfLastYear = startOfLastYear.plusYears(1).minusNanos(1); - - // TODO 近30天可催收的续费总额 - // 下个月的今天 - final DateTime nextMonth = DateUtil.nextMonth(); - final BigDecimal totalPrice30 = projectService.sumMoney(new LambdaQueryWrapper() - .lt(Project::getExpirationTime, nextMonth) - .gt(Project::getExpirationTime, date) - .eq(Project::getDeleted, 0) - ); - data.put("totalPrice30", totalPrice30); - - - // TODO 今年已收续费总额 - BigDecimal yearTotalPrice = projectService.sumMoney(new LambdaQueryWrapper() - .between(Project::getUpdateTime, startOfYear, endOfYear) - .eq(Project::getDeleted, 0) - ); - data.put("yearTotalPrice", yearTotalPrice); - - // TODO 去年已收续费总额 - BigDecimal lastTotalPrice = projectService.sumMoney(new LambdaQueryWrapper() - .between(Project::getUpdateTime, startOfLastYear, endOfLastYear) - .eq(Project::getDeleted, 0) - .eq(Project::getDeleted,0) - ); - // 去年已收续费总额 - data.put("lastTotalPrice", lastTotalPrice); - - return success(data); - } - -} diff --git a/src/main/java/com/gxwebsoft/project/controller/ProjectFieldController.java b/src/main/java/com/gxwebsoft/project/controller/ProjectFieldController.java deleted file mode 100644 index d1cf3d5..0000000 --- a/src/main/java/com/gxwebsoft/project/controller/ProjectFieldController.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.gxwebsoft.project.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.project.service.ProjectFieldService; -import com.gxwebsoft.project.entity.ProjectField; -import com.gxwebsoft.project.param.ProjectFieldParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 应用参数控制器 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Tag(name = "应用参数管理") -@RestController -@RequestMapping("/api/project/project-field") -public class ProjectFieldController extends BaseController { - @Resource - private ProjectFieldService projectFieldService; - - @PreAuthorize("hasAuthority('project:project:list')") - @Operation(summary = "分页查询应用参数") - @GetMapping("/page") - public ApiResult> page(ProjectFieldParam param) { - // 使用关联查询 - return success(projectFieldService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('project:project:list')") - @Operation(summary = "查询全部应用参数") - @GetMapping() - public ApiResult> list(ProjectFieldParam param) { - // 使用关联查询 - return success(projectFieldService.listRel(param)); - } - - @PreAuthorize("hasAuthority('project:project:list')") - @Operation(summary = "根据id查询应用参数") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(projectFieldService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('project:project:save')") - @OperationLog - @Operation(summary = "添加应用参数") - @PostMapping() - public ApiResult save(@RequestBody ProjectField projectField) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - projectField.setUserId(loginUser.getUserId()); - } - if (projectFieldService.save(projectField)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('project:project:update')") - @OperationLog - @Operation(summary = "修改应用参数") - @PutMapping() - public ApiResult update(@RequestBody ProjectField projectField) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - projectField.setUpdateUserId(loginUser.getUserId()); - } - if (projectFieldService.updateById(projectField)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('project:project:remove')") - @OperationLog - @Operation(summary = "删除应用参数") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (projectFieldService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('project:project:save')") - @OperationLog - @Operation(summary = "批量添加应用参数") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (projectFieldService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('project:project:update')") - @OperationLog - @Operation(summary = "批量修改应用参数") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(projectFieldService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('project:project:remove')") - @OperationLog - @Operation(summary = "批量删除应用参数") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (projectFieldService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/project/controller/ProjectRenewController.java b/src/main/java/com/gxwebsoft/project/controller/ProjectRenewController.java deleted file mode 100644 index 8910d02..0000000 --- a/src/main/java/com/gxwebsoft/project/controller/ProjectRenewController.java +++ /dev/null @@ -1,290 +0,0 @@ -package com.gxwebsoft.project.controller; - -import cn.hutool.core.date.DateField; -import cn.hutool.core.date.DateTime; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.project.entity.Project; -import com.gxwebsoft.project.param.ProjectParam; -import com.gxwebsoft.project.service.ProjectRenewService; -import com.gxwebsoft.project.entity.ProjectRenew; -import com.gxwebsoft.project.param.ProjectRenewParam; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.project.service.ProjectService; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.util.*; - -/** - * 续费管理控制器 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Tag(name = "续费管理管理") -@RestController -@RequestMapping("/api/project/project-renew") -public class ProjectRenewController extends BaseController { - @Resource - private ProjectRenewService projectRenewService; - @Resource - private ProjectService projectService; - - @PreAuthorize("hasAuthority('project:projectRenew:list')") - @Operation(summary = "分页查询续费管理") - @GetMapping("/page") - public ApiResult> page(ProjectRenewParam param) { - return success(projectRenewService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('project:projectRenew:list')") - @Operation(summary = "查询全部续费管理") - @GetMapping() - public ApiResult> list(ProjectRenewParam param) { - // 使用关联查询 - return success(projectRenewService.listRel(param)); - } - - @PreAuthorize("hasAuthority('project:projectRenew:list')") - @Operation(summary = "根据id查询续费管理") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(projectRenewService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('project:projectRenew:save')") - @OperationLog - @Operation(summary = "添加续费管理") - @PostMapping() - public ApiResult save(@RequestBody ProjectRenew projectRenew) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - projectRenew.setUserId(loginUser.getUserId()); - } - // 更新项目状态 - if (projectRenewService.save(projectRenew)) { - projectService.updateByRenew(projectRenew); - return success("操作成功"); - } - return fail("操作失败"); - } - - @PreAuthorize("hasAuthority('project:projectRenew:update')") - @OperationLog - @Operation(summary = "修改续费管理") - @PutMapping() - public ApiResult update(@RequestBody ProjectRenew projectRenew) { - if (projectRenewService.updateById(projectRenew)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('project:projectRenew:remove')") - @OperationLog - @Operation(summary = "删除续费管理") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - // 撤销操作 - final ProjectRenew renew = projectRenewService.getByIdRel(id); - if (ObjectUtil.isNotEmpty(renew)) { - final Project project = projectService.getOne(new LambdaQueryWrapper().eq(Project::getAppId, renew.getAppId())); - if (renew.getDays() > 0) { - // 按天续费 - project.setExpirationTime(project.getExpirationTime().minusDays(renew.getDays())); - } else { - // 按年续费 - project.setExpirationTime(project.getExpirationTime().minusMonths(12 * renew.getDuration())); - // 回退上一年的续费金额 - final List renews = projectRenewService.list(new LambdaQueryWrapper().eq(ProjectRenew::getAppId, renew.getAppId()).orderByDesc(ProjectRenew::getAppRenewId).last("limit 2")); - if(renews.size() > 1){ - final ProjectRenew projectRenew = renews.get(1); - project.setRenewMoney(projectRenew.getPayPrice()); - } - projectService.updateById(project); - } - // 保存到期时间所在的年月日 - final LocalDateTime expirationTime = project.getExpirationTime(); - LocalDate localDate = expirationTime.toLocalDate(); - int year = localDate.getYear(); - int month = localDate.getMonthValue(); // 获取月份,范围是1到12 - int day = localDate.getDayOfMonth(); // 获取日,范围是1到31 - project.setYear(year); - project.setMonth(month); - project.setDay(day); - } - - if (projectRenewService.removeById(id)) { - return success("该笔续费操作已撤销"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('project:projectRenew:save')") - @OperationLog - @Operation(summary = "批量添加续费管理") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (projectRenewService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('project:projectRenew:update')") - @OperationLog - @Operation(summary = "批量修改续费管理") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(projectRenewService, "app_renew_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('project:projectRenew:remove')") - @OperationLog - @Operation(summary = "批量删除续费管理") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (projectRenewService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - - @Operation(summary = "统计信息") - @GetMapping("/data") - public ApiResult> data(ProjectParam param) { - Map data = new HashMap<>(); - final User loginUser = getLoginUser(); - if (loginUser == null) { - return fail("请先登录", null); - } - - // 今天日期 - DateTime date = DateUtil.date(); - // 获取当前年份的起止时间 - LocalDateTime startOfYear = LocalDateTime.now().withMonth(1).withDayOfMonth(1) - .withHour(0).withMinute(0).withSecond(0); - LocalDateTime endOfYear = startOfYear.plusYears(1).minusNanos(1); - // 去年的起止时间 - LocalDateTime startOfLastYear = LocalDateTime.now().minusYears(1).withMonth(1).withDayOfMonth(1) - .withHour(0).withMinute(0).withSecond(0); - LocalDateTime endOfLastYear = startOfLastYear.plusYears(1).minusNanos(1); - // 本月起止时间 - LocalDateTime startOfMonth = LocalDateTime.now().withDayOfMonth(1) - .withHour(0).withMinute(0).withSecond(0); - LocalDateTime endOfMonth = startOfMonth.plusMonths(1).minusNanos(1); - - - // TODO 近30天可催收的续费总额 - // 下个月的今天 - final DateTime nextMonth = DateUtil.nextMonth(); - BigDecimal totalPrice30 = projectService.sumMoney(new LambdaQueryWrapper() - .lt(Project::getExpirationTime, nextMonth) - .gt(Project::getExpirationTime, date) - .lt(Project::getCreateTime, date) - .eq(Project::getShowExpiration, true) - .eq(Project::getAppStatus, "已上架") - .eq(Project::getDeleted, 0) - ); - data.put("totalPrice30", totalPrice30); - - // TODO 按所属月份查询续费总金额 - if(param.getMonth() != null){ - BigDecimal currentQueryTotalPrice = projectService.sumMoney(new LambdaQueryWrapper() - .eq(Project::getMonth, param.getMonth()) - .eq(Project::getShowExpiration, true) - .eq(Project::getAppStatus, "已上架") - .eq(Project::getDeleted, 0) - ); - data.put("currentQueryTotalPrice", currentQueryTotalPrice); - } - - // TODO 有效的续费总金额 - final BigDecimal effectiveTotalPrice = projectService.sumMoney(new LambdaQueryWrapper() - .eq(Project::getDeleted, 0) - .eq(Project::getShowExpiration, true) - .eq(Project::getAppStatus, "已上架") - .gt(Project::getExpirationTime, date)); - data.put("effectiveTotalPrice", effectiveTotalPrice); - - // TODO 已超过催收时间的续费总额 - final BigDecimal expiredPrice = projectService.sumMoney(new LambdaQueryWrapper() - .eq(Project::getDeleted, 0) - .eq(Project::getShowExpiration, true) - .eq(Project::getAppStatus, "已上架") - .lt(Project::getExpirationTime, date)); - data.put("expiredPrice", expiredPrice); - - // TODO 计算每年可收续费总额 - final BigDecimal totalRenewPrice = projectService.sumMoney(new LambdaQueryWrapper() - .eq(Project::getDeleted, 0) - .eq(Project::getShowExpiration, true) - .eq(Project::getAppStatus, "已上架") - ); - - // TODO 本月已收续费总额 - final BigDecimal monthTotalPrice = projectRenewService.sumMoney(new LambdaQueryWrapper() - .between(ProjectRenew::getCreateTime, startOfMonth, endOfMonth) - .eq(ProjectRenew::getDeleted, 0) - ); - data.put("monthTotalPrice", monthTotalPrice); - - // TODO 今年已收续费总额 - BigDecimal yearTotalPrice = projectRenewService.sumMoney(new LambdaQueryWrapper() - .between(ProjectRenew::getCreateTime, startOfYear, endOfYear) - .eq(ProjectRenew::getDeleted, 0) - ); - data.put("yearTotalPrice", yearTotalPrice); - - // TODO 去年已收续费总额 - BigDecimal lastTotalPrice = projectRenewService.sumMoney(new LambdaQueryWrapper() - .eq(ProjectRenew::getDeleted, 0) - .between(ProjectRenew::getEndTime, startOfLastYear, endOfLastYear)); - // 去年已收续费总额 - data.put("lastTotalPrice", lastTotalPrice); - - data.put("totalRenewPrice", totalRenewPrice); - - return success(data); - } - - @Operation(summary = "统计每个月的续费总金额") - @GetMapping("/listMonthRenewPrice") - public ApiResult> listMonthRenewPrice() { - final User loginUser = getLoginUser(); - if (loginUser != null) { - final LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - List monthPrice = new ArrayList<>(); - for (int i = 1; i < 13; i++) { - wrapper.clear(); - wrapper.eq(Project::getDeleted, 0) - .eq(Project::getShowExpiration, true) - .eq(Project::getAppStatus, "已上架"); - monthPrice.add(projectService.sumMoney(wrapper.eq(Project::getMonth,i))); - } - return success(monthPrice); - } - return fail("请先登录", null); - } - -} diff --git a/src/main/java/com/gxwebsoft/project/controller/ProjectUrlController.java b/src/main/java/com/gxwebsoft/project/controller/ProjectUrlController.java deleted file mode 100644 index 4300e9f..0000000 --- a/src/main/java/com/gxwebsoft/project/controller/ProjectUrlController.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.gxwebsoft.project.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.project.service.ProjectUrlService; -import com.gxwebsoft.project.entity.ProjectUrl; -import com.gxwebsoft.project.param.ProjectUrlParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 项目域名控制器 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Tag(name = "项目域名管理") -@RestController -@RequestMapping("/api/project/project-url") -public class ProjectUrlController extends BaseController { - @Resource - private ProjectUrlService projectUrlService; - - @PreAuthorize("hasAuthority('project:projectUrl:list')") - @Operation(summary = "分页查询项目域名") - @GetMapping("/page") - public ApiResult> page(ProjectUrlParam param) { - // 使用关联查询 - return success(projectUrlService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('project:projectUrl:list')") - @Operation(summary = "查询全部项目域名") - @GetMapping() - public ApiResult> list(ProjectUrlParam param) { - // 使用关联查询 - return success(projectUrlService.listRel(param)); - } - - @PreAuthorize("hasAuthority('project:projectUrl:list')") - @Operation(summary = "根据id查询项目域名") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(projectUrlService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('project:projectUrl:save')") - @OperationLog - @Operation(summary = "添加项目域名") - @PostMapping() - public ApiResult save(@RequestBody ProjectUrl projectUrl) { - if (projectUrlService.save(projectUrl)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('project:projectUrl:update')") - @OperationLog - @Operation(summary = "修改项目域名") - @PutMapping() - public ApiResult update(@RequestBody ProjectUrl projectUrl) { - if (projectUrlService.updateById(projectUrl)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('project:projectUrl:remove')") - @OperationLog - @Operation(summary = "删除项目域名") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (projectUrlService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('project:projectUrl:save')") - @OperationLog - @Operation(summary = "批量添加项目域名") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (projectUrlService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('project:projectUrl:update')") - @OperationLog - @Operation(summary = "批量修改项目域名") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(projectUrlService, "app_url_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('project:projectUrl:remove')") - @OperationLog - @Operation(summary = "批量删除项目域名") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (projectUrlService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/project/controller/ProjectUserController.java b/src/main/java/com/gxwebsoft/project/controller/ProjectUserController.java deleted file mode 100644 index 0697174..0000000 --- a/src/main/java/com/gxwebsoft/project/controller/ProjectUserController.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.gxwebsoft.project.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.project.service.ProjectUserService; -import com.gxwebsoft.project.entity.ProjectUser; -import com.gxwebsoft.project.param.ProjectUserParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 应用成员控制器 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Tag(name = "应用成员管理") -@RestController -@RequestMapping("/api/project/project-user") -public class ProjectUserController extends BaseController { - @Resource - private ProjectUserService projectUserService; - - @PreAuthorize("hasAuthority('project:projectUser:list')") - @Operation(summary = "分页查询应用成员") - @GetMapping("/page") - public ApiResult> page(ProjectUserParam param) { - // 使用关联查询 - return success(projectUserService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('project:projectUser:list')") - @Operation(summary = "查询全部应用成员") - @GetMapping() - public ApiResult> list(ProjectUserParam param) { - // 使用关联查询 - return success(projectUserService.listRel(param)); - } - - @PreAuthorize("hasAuthority('project:projectUser:list')") - @Operation(summary = "根据id查询应用成员") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(projectUserService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('project:projectUser:save')") - @OperationLog - @Operation(summary = "添加应用成员") - @PostMapping() - public ApiResult save(@RequestBody ProjectUser projectUser) { - if (projectUserService.save(projectUser)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('project:projectUser:update')") - @OperationLog - @Operation(summary = "修改应用成员") - @PutMapping() - public ApiResult update(@RequestBody ProjectUser projectUser) { - if (projectUserService.updateById(projectUser)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('project:projectUser:remove')") - @OperationLog - @Operation(summary = "删除应用成员") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (projectUserService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('project:projectUser:save')") - @OperationLog - @Operation(summary = "批量添加应用成员") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (projectUserService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('project:projectUser:update')") - @OperationLog - @Operation(summary = "批量修改应用成员") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(projectUserService, "app_user_id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('project:projectUser:remove')") - @OperationLog - @Operation(summary = "批量删除应用成员") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (projectUserService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/project/entity/Project.java b/src/main/java/com/gxwebsoft/project/entity/Project.java deleted file mode 100644 index 55ad688..0000000 --- a/src/main/java/com/gxwebsoft/project/entity/Project.java +++ /dev/null @@ -1,287 +0,0 @@ -package com.gxwebsoft.project.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; -import java.util.List; -import java.util.Set; - -import com.gxwebsoft.cms.entity.CmsWebsite; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 应用 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "Project对象", description = "应用") -public class Project implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "应用ID") - @TableId(value = "app_id", type = IdType.AUTO) - private Integer appId; - - @Schema(description = "应用名称") - private String appName; - - @Schema(description = "应用标识") - private String appCode; - - @Schema(description = "应用秘钥") - private String appSecret; - - @Schema(description = "上级id, 0是顶级") - private Integer parentId; - - @Schema(description = "应用类型") - private String appType; - - @Schema(description = "应用类型") - private String appTypeMultiple; - - @Schema(description = "类型, 0菜单, 1按钮") - private Integer menuType; - - @Schema(description = "企业(存用户ID)") - private Integer companyId; - - @Schema(description = "企业名称") - @TableField(exist = false) - private String companyName; - - @Schema(description = "超管账号") - @TableField(exist = false) - private String superAdminPhone; - - @Schema(description = "应用图标") - private String appIcon; - - @Schema(description = "二维码") - private String appQrcode; - - @Schema(description = "链接地址") - private String appUrl; - - @Schema(description = "后台管理地址") - private String adminUrl; - - @Schema(description = "下载地址") - private String downUrl; - - @Schema(description = "链接地址") - private String serverUrl; - - @Schema(description = "文件服务器") - private String fileUrl; - - @Schema(description = "回调地址") - private String callbackUrl; - - @Schema(description = "腾讯文档地址") - private String docsUrl; - - @Schema(description = "代码仓库地址") - private String gitUrl; - - @Schema(description = "原型图地址") - private String prototypeUrl; - - @Schema(description = "IP白名单") - private String ipAddress; - - @Schema(description = "应用截图") - private String images; - - @Schema(description = "应用包名") - private String packageName; - - @Schema(description = "下载次数") - private Integer clicks; - - @Schema(description = "安装次数") - private Integer installs; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "应用介绍") - private String content; - - @Schema(description = "项目需求") - private String requirement; - - @Schema(description = "开发者(个人或公司)") - private String developer; - - @Schema(description = "项目负责人") - private String director; - - @Schema(description = "项目经理") - private String projectDirector; - - @Schema(description = "业务员") - private String salesman; - - @Schema(description = "软件定价") - private BigDecimal price; - - @Schema(description = "划线价格") - private BigDecimal linePrice; - - @Schema(description = "评分") - private String score; - - @Schema(description = "星级") - private String star; - - @Schema(description = "菜单路由地址") - private String path; - - @Schema(description = "菜单组件地址, 目录可为空") - private String component; - - @Schema(description = "权限标识") - private String authority; - - @Schema(description = "打开位置") - private String target; - - @Schema(description = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)") - private Integer hide; - - @Schema(description = "禁止搜索,1禁止 0 允许") - private Integer search; - - @Schema(description = "菜单侧栏选中的path") - private String active; - - @Schema(description = "其它路由元信息") - private String meta; - - @Schema(description = "版本,0正式版 1体验版 2开发版") - private String edition; - - @Schema(description = "版本号") - private String version; - - @Schema(description = "是否已安装") - private Integer isUse; - - @Schema(description = "附近1") - private String file1; - - @Schema(description = "附件2") - private String file2; - - @Schema(description = "附件3") - private String file3; - - @Schema(description = "是否显示续费提醒") - private Boolean showExpiration; - - @Schema(description = "是否作为案例展示") - private Integer showCase; - - @Schema(description = "是否显示在首页") - private Integer showIndex; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expirationTime; - - @Schema(description = "所属年份") - private Integer year; - - @Schema(description = "所属月份") - private Integer month; - - @Schema(description = "所属日期") - private Integer day; - - @Schema(description = "状态, 0正常, 1 即将过期") - private Integer soon; - - @Schema(description = "是否过期") - @TableField(exist = false) - private Integer expired; - - @Schema(description = "剩余天数") - @TableField(exist = false) - private Long expiredDays; - - @Schema(description = "续费金额") - private BigDecimal renewMoney; - - @Schema(description = "续费总金额") - @TableField(exist = false) - private BigDecimal totalRenewMoney; - - @Schema(description = "续费次数") - private Long renewCount; - - @Schema(description = "应用状态") - private String appStatus; - - @Schema(description = "开发进度") - private Integer progress; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "昵称") - @TableField(exist = false) - private String nickname; - - @Schema(description = "头像") - @TableField(exist = false) - private String avatar; - - @Schema(description = "网站id") - private Integer websiteId; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - - @Schema(description = "是否收藏") - @TableField(exist = false) - private Boolean collection; - - @Schema(description = "应用成员") - @TableField(exist = false) - private List projectUsers; - -} diff --git a/src/main/java/com/gxwebsoft/project/entity/ProjectCollection.java b/src/main/java/com/gxwebsoft/project/entity/ProjectCollection.java deleted file mode 100644 index bf80392..0000000 --- a/src/main/java/com/gxwebsoft/project/entity/ProjectCollection.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.gxwebsoft.project.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 我的收藏 - * - * @author 科技小王子 - * @since 2025-03-16 12:12:13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ProjectCollection对象", description = "我的收藏") -public class ProjectCollection implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "应用ID") - private Integer appId; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - -} diff --git a/src/main/java/com/gxwebsoft/project/entity/ProjectField.java b/src/main/java/com/gxwebsoft/project/entity/ProjectField.java deleted file mode 100644 index c3944ec..0000000 --- a/src/main/java/com/gxwebsoft/project/entity/ProjectField.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.gxwebsoft.project.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 应用参数 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ProjectField对象", description = "应用参数") -public class ProjectField implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "应用ID") - private Integer appId; - - @Schema(description = "类型") - private String type; - - @Schema(description = "名称") - private String name; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "用户昵称") - @TableField(exist = false) - private String nickname; - - @Schema(description = "用户头像") - @TableField(exist = false) - private String avatar; - - @Schema(description = "最后修改人") - private Integer updateUserId; - - @Schema(description = "最后修改人") - @TableField(exist = false) - private String updateUserName; - - @Schema(description = "最后修改人") - @TableField(exist = false) - private String updateUserAvatar; - - @Schema(description = "状态, 0正常, 1删除") - private Integer status; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/project/entity/ProjectRenew.java b/src/main/java/com/gxwebsoft/project/entity/ProjectRenew.java deleted file mode 100644 index cd3336b..0000000 --- a/src/main/java/com/gxwebsoft/project/entity/ProjectRenew.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.gxwebsoft.project.entity; - -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import com.baomidou.mybatisplus.annotation.TableLogic; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 续费管理 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ProjectRenew对象", description = "续费管理") -public class ProjectRenew implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "app_renew_id", type = IdType.AUTO) - private Integer appRenewId; - - @Schema(description = "应用ID") - private Integer appId; - - @Schema(description = "类型, 0续费, 1新购") - private Integer type; - - @Schema(description = "订单编号") - private String orderNo; - - @Schema(description = "应用名称") - @TableField(exist = false) - private String appName; - - @Schema(description = "应用图标") - @TableField(exist = false) - private String appIcon; - - @Schema(description = "续费金额") - private BigDecimal money; - - @Schema(description = "订单总额") - private BigDecimal totalPrice; - - @Schema(description = "实际付款") - private BigDecimal payPrice; - - @Schema(description = "优惠金额") - private BigDecimal reducePrice; - - @Schema(description = "续费时长(按年)") - private Integer duration; - - @Schema(description = "续费时长(按天)") - private Integer days; - - @Schema(description = "支付方式, 0余额, 1微信,102微信Native, 3支付宝, 4现金") - private Integer payType; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "开始时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime startTime; - - @Schema(description = "到期时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime endTime; - - @Schema(description = "到期时间") - @TableField(exist = false) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime expirationTime; - - @Schema(description = "状态, 0正常, 1 即将过期") - private Integer soon; - - @Schema(description = "客户(用户ID)") - @TableField(exist = false) - private Integer customerId; - - @Schema(description = "客户名称") - @TableField(exist = false) - private String customerName; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "付款凭证") - private String images; - - @Schema(description = "操作员姓名") - @TableField(exist = false) - private String nickname; - - @Schema(description = "操作员头像") - @TableField(exist = false) - private String avatar; - - @Schema(description = "状态, 0正常, 1待确认") - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - -} diff --git a/src/main/java/com/gxwebsoft/project/entity/ProjectUrl.java b/src/main/java/com/gxwebsoft/project/entity/ProjectUrl.java deleted file mode 100644 index 6e7b177..0000000 --- a/src/main/java/com/gxwebsoft/project/entity/ProjectUrl.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.gxwebsoft.project.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 项目域名 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ProjectUrl对象", description = "项目域名") -public class ProjectUrl implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "app_url_id", type = IdType.AUTO) - private Integer appUrlId; - - @Schema(description = "应用ID") - private Integer appId; - - @Schema(description = "域名类型") - private String name; - - @Schema(description = "域名") - private String domain; - - @Schema(description = "账号") - private String account; - - @Schema(description = "密码") - private String password; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1待确认") - private Integer status; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "租户id") - private Integer tenantId; - -} diff --git a/src/main/java/com/gxwebsoft/project/entity/ProjectUser.java b/src/main/java/com/gxwebsoft/project/entity/ProjectUser.java deleted file mode 100644 index 455099f..0000000 --- a/src/main/java/com/gxwebsoft/project/entity/ProjectUser.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.gxwebsoft.project.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; - -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; -import java.util.Set; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 应用成员 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ProjectUser对象", description = "应用成员") -public class ProjectUser implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "app_user_id", type = IdType.AUTO) - private Integer appUserId; - - @Schema(description = "角色,10体验成员 20开发者成员 30管理员 ") - private Integer role; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "应用ID") - private Integer appId; - - @Schema(description = "昵称") - private String nickname; - - @Schema(description = "头像") - private String avatar; - - @Schema(description = "状态, 0正常, 1待确认") - private Integer status; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - -} diff --git a/src/main/java/com/gxwebsoft/project/mapper/ProjectCollectionMapper.java b/src/main/java/com/gxwebsoft/project/mapper/ProjectCollectionMapper.java deleted file mode 100644 index c16dc51..0000000 --- a/src/main/java/com/gxwebsoft/project/mapper/ProjectCollectionMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.project.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.project.entity.ProjectCollection; -import com.gxwebsoft.project.param.ProjectCollectionParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 我的收藏Mapper - * - * @author 科技小王子 - * @since 2025-03-16 12:12:13 - */ -public interface ProjectCollectionMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ProjectCollectionParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ProjectCollectionParam param); - -} diff --git a/src/main/java/com/gxwebsoft/project/mapper/ProjectFieldMapper.java b/src/main/java/com/gxwebsoft/project/mapper/ProjectFieldMapper.java deleted file mode 100644 index a8fc6b5..0000000 --- a/src/main/java/com/gxwebsoft/project/mapper/ProjectFieldMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.project.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.project.entity.ProjectField; -import com.gxwebsoft.project.param.ProjectFieldParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 应用参数Mapper - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -public interface ProjectFieldMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ProjectFieldParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ProjectFieldParam param); - -} diff --git a/src/main/java/com/gxwebsoft/project/mapper/ProjectMapper.java b/src/main/java/com/gxwebsoft/project/mapper/ProjectMapper.java deleted file mode 100644 index f7f080e..0000000 --- a/src/main/java/com/gxwebsoft/project/mapper/ProjectMapper.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.project.mapper; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.project.entity.Project; -import com.gxwebsoft.project.param.ProjectParam; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 应用Mapper - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -public interface ProjectMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ProjectParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ProjectParam param); - - - /** - * 统计金额总和 - * - * @param wrapper 查询条件 - * @return 金额总和 - */ - BigDecimal selectSumMoney(@Param("ew") Wrapper wrapper); -} diff --git a/src/main/java/com/gxwebsoft/project/mapper/ProjectRenewMapper.java b/src/main/java/com/gxwebsoft/project/mapper/ProjectRenewMapper.java deleted file mode 100644 index 4881b00..0000000 --- a/src/main/java/com/gxwebsoft/project/mapper/ProjectRenewMapper.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.gxwebsoft.project.mapper; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.project.entity.ProjectRenew; -import com.gxwebsoft.project.param.ProjectRenewParam; -import org.apache.ibatis.annotations.Param; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 续费管理Mapper - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -public interface ProjectRenewMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ProjectRenewParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ProjectRenewParam param); - - - /** - * 统计金额总和 - * - * @param wrapper 查询条件 - * @return 金额总和 - */ - BigDecimal selectSumMoney(@Param("ew") Wrapper wrapper); - -} diff --git a/src/main/java/com/gxwebsoft/project/mapper/ProjectUrlMapper.java b/src/main/java/com/gxwebsoft/project/mapper/ProjectUrlMapper.java deleted file mode 100644 index 22ba4e2..0000000 --- a/src/main/java/com/gxwebsoft/project/mapper/ProjectUrlMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.project.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.project.entity.ProjectUrl; -import com.gxwebsoft.project.param.ProjectUrlParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 项目域名Mapper - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -public interface ProjectUrlMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ProjectUrlParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ProjectUrlParam param); - -} diff --git a/src/main/java/com/gxwebsoft/project/mapper/ProjectUserMapper.java b/src/main/java/com/gxwebsoft/project/mapper/ProjectUserMapper.java deleted file mode 100644 index aa29153..0000000 --- a/src/main/java/com/gxwebsoft/project/mapper/ProjectUserMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.project.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.project.entity.ProjectUser; -import com.gxwebsoft.project.param.ProjectUserParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 应用成员Mapper - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -public interface ProjectUserMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ProjectUserParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ProjectUserParam param); - -} diff --git a/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectCollectionMapper.xml b/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectCollectionMapper.xml deleted file mode 100644 index 74d6f66..0000000 --- a/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectCollectionMapper.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - SELECT a.* - FROM project_collection a - - - AND a.id = #{param.id} - - - AND a.user_id = #{param.userId} - - - AND a.app_id = #{param.appId} - - - 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/project/mapper/xml/ProjectFieldMapper.xml b/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectFieldMapper.xml deleted file mode 100644 index 39af3c1..0000000 --- a/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectFieldMapper.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - SELECT a.*, b.avatar AS avatar, b.nickname, c.nickname as updateUserName, c.avatar as updateUserAvatar - FROM project_field a - LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id - LEFT JOIN gxwebsoft_core.sys_user c ON a.update_user_id = c.user_id - - - AND a.id = #{param.id} - - - AND a.app_id = #{param.appId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.user_id = #{param.userId} - - - AND c.update_user_id = #{param.updateUserId} - - - AND a.status = #{param.status} - - - AND a.sort_number = #{param.sortNumber} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - OR a.name LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectMapper.xml b/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectMapper.xml deleted file mode 100644 index 51b6c85..0000000 --- a/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectMapper.xml +++ /dev/null @@ -1,275 +0,0 @@ - - - - - - - SELECT a.*, b.real_name as nickname, b.avatar,c.website_type as appType, u.real_name as companyName, u.phone as superAdminPhone - FROM project a - LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id - LEFT JOIN cms_website c ON a.website_id = c.website_id - LEFT JOIN gxwebsoft_core.sys_user u ON a.company_id = u.user_id - - - AND a.app_id = #{param.appId} - - - AND a.app_name LIKE CONCAT('%', #{param.appName}, '%') - - - AND a.app_code LIKE CONCAT('%', #{param.appCode}, '%') - - - AND a.app_secret LIKE CONCAT('%', #{param.appSecret}, '%') - - - AND a.parent_id = #{param.parentId} - - - AND a.website_id = #{param.websiteId} - - - AND a.app_type LIKE CONCAT('%', #{param.appType}, '%') - - - AND a.app_type_multiple LIKE CONCAT('%', #{param.appTypeMultiple}, '%') - - - AND a.menu_type = #{param.menuType} - - - AND a.company_id = #{param.companyId} - - - AND a.company_name LIKE CONCAT('%', #{param.companyName}, '%') - - - AND u.phone = #{param.loginPhone} - - - AND a.app_icon LIKE CONCAT('%', #{param.appIcon}, '%') - - - AND a.app_qrcode LIKE CONCAT('%', #{param.appQrcode}, '%') - - - AND a.app_url LIKE CONCAT('%', #{param.appUrl}, '%') - - - AND a.admin_url LIKE CONCAT('%', #{param.adminUrl}, '%') - - - AND a.down_url LIKE CONCAT('%', #{param.downUrl}, '%') - - - AND a.server_url LIKE CONCAT('%', #{param.serverUrl}, '%') - - - AND a.file_url LIKE CONCAT('%', #{param.fileUrl}, '%') - - - AND a.callback_url LIKE CONCAT('%', #{param.callbackUrl}, '%') - - - AND a.docs_url LIKE CONCAT('%', #{param.docsUrl}, '%') - - - AND a.git_url LIKE CONCAT('%', #{param.gitUrl}, '%') - - - AND a.prototype_url LIKE CONCAT('%', #{param.prototypeUrl}, '%') - - - AND a.ip_address LIKE CONCAT('%', #{param.ipAddress}, '%') - - - AND a.images LIKE CONCAT('%', #{param.images}, '%') - - - AND a.package_name LIKE CONCAT('%', #{param.packageName}, '%') - - - AND a.clicks = #{param.clicks} - - - AND a.installs = #{param.installs} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.requirement LIKE CONCAT('%', #{param.requirement}, '%') - - - AND a.developer LIKE CONCAT('%', #{param.developer}, '%') - - - AND a.director LIKE CONCAT('%', #{param.director}, '%') - - - AND a.project_director LIKE CONCAT('%', #{param.projectDirector}, '%') - - - AND a.salesman LIKE CONCAT('%', #{param.salesman}, '%') - - - AND a.price = #{param.price} - - - AND a.line_price = #{param.linePrice} - - - AND a.score LIKE CONCAT('%', #{param.score}, '%') - - - AND a.star LIKE CONCAT('%', #{param.star}, '%') - - - AND a.year = #{param.year} - - - AND a.month = #{param.month} - - - AND a.day = #{param.day} - - - AND a.path LIKE CONCAT('%', #{param.path}, '%') - - - AND a.component LIKE CONCAT('%', #{param.component}, '%') - - - AND a.authority LIKE CONCAT('%', #{param.authority}, '%') - - - AND a.target LIKE CONCAT('%', #{param.target}, '%') - - - AND a.hide = #{param.hide} - - - AND a.search = #{param.search} - - - AND a.active LIKE CONCAT('%', #{param.active}, '%') - - - AND a.meta LIKE CONCAT('%', #{param.meta}, '%') - - - AND a.edition LIKE CONCAT('%', #{param.edition}, '%') - - - AND a.version LIKE CONCAT('%', #{param.version}, '%') - - - AND a.is_use = #{param.isUse} - - - AND a.file1 LIKE CONCAT('%', #{param.file1}, '%') - - - AND a.file2 LIKE CONCAT('%', #{param.file2}, '%') - - - AND a.file3 LIKE CONCAT('%', #{param.file3}, '%') - - - AND a.show_expiration = #{param.showExpiration} - - - AND a.show_case = #{param.showCase} - - - AND a.show_index = #{param.showIndex} - - - AND a.recommend = #{param.recommend} - - - AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') - - - AND a.soon = #{param.soon} - - - AND a.renew_money = #{param.renewMoney} - - - AND a.app_status LIKE CONCAT('%', #{param.appStatus}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.organization_id = #{param.organizationId} - - - AND a.tenant_code LIKE CONCAT('%', #{param.tenantCode}, '%') - - - AND a.expiration_time >= #{param.expirationTimeStart} - - - AND a.expiration_time <= #{param.expirationTimeEnd} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND a.app_id IN - - #{item} - - - - AND (a.app_name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.app_id = #{param.keywords} - OR a.app_code = #{param.keywords} - OR a.app_name LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectRenewMapper.xml b/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectRenewMapper.xml deleted file mode 100644 index 54a7e29..0000000 --- a/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectRenewMapper.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - SELECT a.*, b.app_icon, b.app_name, b.expiration_time,c.real_name as nickname - FROM project_renew a - LEFT JOIN project b ON a.app_id = b.app_id - LEFT JOIN gxwebsoft_core.sys_user c ON a.user_id = c.user_id - - - AND a.app_renew_id = #{param.appRenewId} - - - AND a.app_id = #{param.appId} - - - AND a.type = #{param.type} - - - AND a.order_no = #{param.} - - - AND a.money = #{param.money} - - - AND a.duration = #{param.duration} - - - AND a.days = #{param.days} - - - AND a.pay_type = #{param.payType} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%') - - - AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%') - - - AND a.soon = #{param.soon} - - - AND a.renew_count = #{param.renewCount} - - - AND a.user_id = #{param.userId} - - - AND a.images LIKE CONCAT('%', #{param.images}, '%') - - - AND a.nickname LIKE CONCAT('%', #{param.nickname}, '%') - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND (b.app_name LIKE CONCAT('%', #{param.keywords}, '%') - OR b.app_id = #{param.keywords} - OR b.app_code = #{param.keywords} - ) - - - - - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectUrlMapper.xml b/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectUrlMapper.xml deleted file mode 100644 index 9e16161..0000000 --- a/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectUrlMapper.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - SELECT a.* - FROM project_url a - - - AND a.app_url_id = #{param.appUrlId} - - - AND a.app_id = #{param.appId} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.domain LIKE CONCAT('%', #{param.domain}, '%') - - - AND a.account LIKE CONCAT('%', #{param.account}, '%') - - - AND a.password LIKE CONCAT('%', #{param.password}, '%') - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - 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/project/mapper/xml/ProjectUserMapper.xml b/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectUserMapper.xml deleted file mode 100644 index ffdd4bc..0000000 --- a/src/main/java/com/gxwebsoft/project/mapper/xml/ProjectUserMapper.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - SELECT a.* - FROM project_user a - - - AND a.app_user_id = #{param.appUserId} - - - AND a.role = #{param.role} - - - AND a.user_id = #{param.userId} - - - AND a.app_id = #{param.appId} - - - AND a.nickname LIKE CONCAT('%', #{param.nickname}, '%') - - - AND a.status = #{param.status} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND a.app_id IN - - #{item} - - - - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') - ) - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/project/param/ProjectCollectionParam.java b/src/main/java/com/gxwebsoft/project/param/ProjectCollectionParam.java deleted file mode 100644 index 073b886..0000000 --- a/src/main/java/com/gxwebsoft/project/param/ProjectCollectionParam.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.gxwebsoft.project.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 我的收藏查询参数 - * - * @author 科技小王子 - * @since 2025-03-16 12:12:13 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ProjectCollectionParam对象", description = "我的收藏查询参数") -public class ProjectCollectionParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "应用ID") - @QueryField(type = QueryType.EQ) - private Integer appId; - -} diff --git a/src/main/java/com/gxwebsoft/project/param/ProjectFieldParam.java b/src/main/java/com/gxwebsoft/project/param/ProjectFieldParam.java deleted file mode 100644 index 50b8068..0000000 --- a/src/main/java/com/gxwebsoft/project/param/ProjectFieldParam.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.gxwebsoft.project.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 应用参数查询参数 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ProjectFieldParam对象", description = "应用参数查询参数") -public class ProjectFieldParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "类型") - @QueryField(type = QueryType.EQ) - private String type; - - @Schema(description = "应用ID") - @QueryField(type = QueryType.EQ) - private Integer appId; - - @Schema(description = "名称") - private String name; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "最后更新用户ID") - @QueryField(type = QueryType.EQ) - private Integer updateUserId; - - @Schema(description = "状态, 0正常, 1删除") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - -} diff --git a/src/main/java/com/gxwebsoft/project/param/ProjectParam.java b/src/main/java/com/gxwebsoft/project/param/ProjectParam.java deleted file mode 100644 index 7b430c2..0000000 --- a/src/main/java/com/gxwebsoft/project/param/ProjectParam.java +++ /dev/null @@ -1,285 +0,0 @@ -package com.gxwebsoft.project.param; - -import java.math.BigDecimal; -import java.util.List; -import java.util.Set; - -import com.baomidou.mybatisplus.annotation.TableField; -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.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 应用查询参数 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ProjectParam对象", description = "应用查询参数") -public class ProjectParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "应用ID") - @QueryField(type = QueryType.EQ) - private Integer appId; - - @Schema(description = "应用名称") - private String appName; - - @Schema(description = "应用标识") - private String appCode; - - @Schema(description = "应用秘钥") - private String appSecret; - - @Schema(description = "上级id, 0是顶级") - @QueryField(type = QueryType.EQ) - private Integer parentId; - - @Schema(description = "应用类型") - private String appType; - - @Schema(description = "应用类型") - private String appTypeMultiple; - - @Schema(description = "类型, 0菜单, 1按钮") - @QueryField(type = QueryType.EQ) - private Integer menuType; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "企业名称") - private String companyName; - - @Schema(description = "应用图标") - private String appIcon; - - @Schema(description = "二维码") - private String appQrcode; - - @Schema(description = "链接地址") - private String appUrl; - - @Schema(description = "后台管理地址") - private String adminUrl; - - @Schema(description = "下载地址") - private String downUrl; - - @Schema(description = "链接地址") - private String serverUrl; - - @Schema(description = "文件服务器") - private String fileUrl; - - @Schema(description = "回调地址") - private String callbackUrl; - - @Schema(description = "腾讯文档地址") - private String docsUrl; - - @Schema(description = "代码仓库地址") - private String gitUrl; - - @Schema(description = "原型图地址") - private String prototypeUrl; - - @Schema(description = "IP白名单") - private String ipAddress; - - @Schema(description = "应用截图") - private String images; - - @Schema(description = "应用包名") - private String packageName; - - @Schema(description = "下载次数") - @QueryField(type = QueryType.EQ) - private Integer clicks; - - @Schema(description = "安装次数") - @QueryField(type = QueryType.EQ) - private Integer installs; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "应用介绍") - private String content; - - @Schema(description = "项目需求") - private String requirement; - - @Schema(description = "开发者(个人或公司)") - private String developer; - - @Schema(description = "项目负责人") - private String director; - - @Schema(description = "项目经理") - private String projectDirector; - - @Schema(description = "业务员") - private String salesman; - - @Schema(description = "软件定价") - @QueryField(type = QueryType.EQ) - private BigDecimal price; - - @Schema(description = "划线价格") - @QueryField(type = QueryType.EQ) - private BigDecimal linePrice; - - @Schema(description = "评分") - private String score; - - @Schema(description = "星级") - private String star; - - @Schema(description = "菜单路由地址") - private String path; - - @Schema(description = "菜单组件地址, 目录可为空") - private String component; - - @Schema(description = "权限标识") - private String authority; - - @Schema(description = "打开位置") - private String target; - - @Schema(description = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)") - @QueryField(type = QueryType.EQ) - private Integer hide; - - @Schema(description = "禁止搜索,1禁止 0 允许") - @QueryField(type = QueryType.EQ) - private Integer search; - - @Schema(description = "菜单侧栏选中的path") - private String active; - - @Schema(description = "其它路由元信息") - private String meta; - - @Schema(description = "版本,0正式版 1体验版 2开发版") - private String edition; - - @Schema(description = "版本号") - private String version; - - @Schema(description = "是否已安装") - @QueryField(type = QueryType.EQ) - private Integer isUse; - - @Schema(description = "附近1") - private String file1; - - @Schema(description = "附件2") - private String file2; - - @Schema(description = "附件3") - private String file3; - - @Schema(description = "是否显示续费提醒") - @QueryField(type = QueryType.EQ) - private Boolean showExpiration; - - @Schema(description = "是否作为案例展示") - @QueryField(type = QueryType.EQ) - private Integer showCase; - - @Schema(description = "是否显示在首页") - @QueryField(type = QueryType.EQ) - private Integer showIndex; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "到期时间") - private String expirationTime; - - @Schema(description = "所属年份") - @QueryField(type = QueryType.EQ) - private Integer year; - - @Schema(description = "所属月份") - @QueryField(type = QueryType.EQ) - private Integer month; - - @Schema(description = "所属日期") - @QueryField(type = QueryType.EQ) - private Integer day; - - @Schema(description = "状态, 0正常, 1 即将过期") - @QueryField(type = QueryType.EQ) - private Integer soon; - - @Schema(description = "续费金额") - @QueryField(type = QueryType.EQ) - private BigDecimal renewMoney; - - @Schema(description = "应用状态") - private String appStatus; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "ID集合") - @QueryField(type = QueryType.IN) - private Set appIds; - - @Schema(description = "机构id") - @QueryField(type = QueryType.EQ) - private Integer organizationId; - - @Schema(description = "租户编号") - private String tenantCode; - - @Schema(description = "登录用户ID") - @QueryField(type = QueryType.EQ) - private Integer loginUserId; - - @Schema(description = "登录手机号") - @QueryField(type = QueryType.EQ) - private String loginPhone; - - @Schema(description = "网站id") - @QueryField(type = QueryType.EQ) - private Integer websiteId; - - @QueryField(value = "expiration_time", type = QueryType.GE) - @TableField(exist = false) - @Schema(description = "到期时间起始值") - private String expirationTimeStart; - - @QueryField(value = "expiration_time", type = QueryType.LE) - @TableField(exist = false) - @Schema(description = "到期时间结束值") - private String expirationTimeEnd; - - -} diff --git a/src/main/java/com/gxwebsoft/project/param/ProjectRenewParam.java b/src/main/java/com/gxwebsoft/project/param/ProjectRenewParam.java deleted file mode 100644 index 04fd922..0000000 --- a/src/main/java/com/gxwebsoft/project/param/ProjectRenewParam.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.gxwebsoft.project.param; - -import java.math.BigDecimal; - -import com.baomidou.mybatisplus.annotation.TableField; -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 续费管理查询参数 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ProjectRenewParam对象", description = "续费管理查询参数") -public class ProjectRenewParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer appRenewId; - - @Schema(description = "应用ID") - @QueryField(type = QueryType.EQ) - private Integer appId; - - @Schema(description = "类型, 0续费, 1新购") - @QueryField(type = QueryType.EQ) - private Integer type; - - @Schema(description = "订单编号") - @QueryField(type = QueryType.EQ) - private String orderNo; - - @Schema(description = "续费金额") - @QueryField(type = QueryType.EQ) - private BigDecimal money; - - @Schema(description = "订单总额") - @QueryField(type = QueryType.EQ) - private BigDecimal totalPrice; - - @Schema(description = "实际付款") - @QueryField(type = QueryType.EQ) - private BigDecimal payPrice; - - @Schema(description = "优惠金额") - @QueryField(type = QueryType.EQ) - private BigDecimal reducePrice; - - @Schema(description = "续费时长") - @QueryField(type = QueryType.EQ) - private BigDecimal duration; - - @Schema(description = "续费时长(按天)") - @QueryField(type = QueryType.EQ) - private Integer days; - - @Schema(description = "支付方式") - @QueryField(type = QueryType.EQ) - private Integer payType; - - @Schema(description = "续费次数") - @QueryField(type = QueryType.EQ) - private Integer renewCount; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "开始时间") - private String startTime; - - @Schema(description = "到期时间") - private String endTime; - - @Schema(description = "状态, 0正常, 1 即将过期") - @QueryField(type = QueryType.EQ) - private Integer soon; - - @Schema(description = "企业ID") - @QueryField(type = QueryType.EQ) - private Integer companyId; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "付款凭证") - private String images; - - @Schema(description = "用户姓名") - private String nickname; - - @Schema(description = "状态, 0正常, 1待确认") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - -} diff --git a/src/main/java/com/gxwebsoft/project/param/ProjectUrlParam.java b/src/main/java/com/gxwebsoft/project/param/ProjectUrlParam.java deleted file mode 100644 index 766a4ba..0000000 --- a/src/main/java/com/gxwebsoft/project/param/ProjectUrlParam.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.gxwebsoft.project.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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 项目域名查询参数 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ProjectUrlParam对象", description = "项目域名查询参数") -public class ProjectUrlParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer appUrlId; - - @Schema(description = "应用ID") - @QueryField(type = QueryType.EQ) - private Integer appId; - - @Schema(description = "域名类型") - private String name; - - @Schema(description = "域名") - private String domain; - - @Schema(description = "账号") - private String account; - - @Schema(description = "密码") - private String password; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1待确认") - @QueryField(type = QueryType.EQ) - private Integer status; - -} diff --git a/src/main/java/com/gxwebsoft/project/param/ProjectUserParam.java b/src/main/java/com/gxwebsoft/project/param/ProjectUserParam.java deleted file mode 100644 index b3c08e6..0000000 --- a/src/main/java/com/gxwebsoft/project/param/ProjectUserParam.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.gxwebsoft.project.param; - -import java.math.BigDecimal; -import java.util.Set; - -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.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 应用成员查询参数 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ProjectUserParam对象", description = "应用成员查询参数") -public class ProjectUserParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer appUserId; - - @Schema(description = "角色,10体验成员 20开发者成员 30管理员 ") - @QueryField(type = QueryType.EQ) - private Integer role; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "应用ID") - @QueryField(type = QueryType.EQ) - private Integer appId; - - @Schema(description = "应用ID集合") - @QueryField(type = QueryType.IN) - private Set appIds; - - @Schema(description = "昵称") - private String nickname; - - @Schema(description = "状态, 0正常, 1待确认") - @QueryField(type = QueryType.EQ) - private Integer status; - -} diff --git a/src/main/java/com/gxwebsoft/project/service/ProjectCollectionService.java b/src/main/java/com/gxwebsoft/project/service/ProjectCollectionService.java deleted file mode 100644 index fe1afba..0000000 --- a/src/main/java/com/gxwebsoft/project/service/ProjectCollectionService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.project.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.project.entity.ProjectCollection; -import com.gxwebsoft.project.param.ProjectCollectionParam; - -import java.util.List; - -/** - * 我的收藏Service - * - * @author 科技小王子 - * @since 2025-03-16 12:12:13 - */ -public interface ProjectCollectionService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ProjectCollectionParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ProjectCollectionParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return ProjectCollection - */ - ProjectCollection getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/project/service/ProjectFieldService.java b/src/main/java/com/gxwebsoft/project/service/ProjectFieldService.java deleted file mode 100644 index 1fd2a5a..0000000 --- a/src/main/java/com/gxwebsoft/project/service/ProjectFieldService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.project.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.project.entity.ProjectField; -import com.gxwebsoft.project.param.ProjectFieldParam; - -import java.util.List; - -/** - * 应用参数Service - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -public interface ProjectFieldService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ProjectFieldParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ProjectFieldParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return ProjectField - */ - ProjectField getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/project/service/ProjectRenewService.java b/src/main/java/com/gxwebsoft/project/service/ProjectRenewService.java deleted file mode 100644 index a607ddd..0000000 --- a/src/main/java/com/gxwebsoft/project/service/ProjectRenewService.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.gxwebsoft.project.service; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.project.entity.ProjectRenew; -import com.gxwebsoft.project.param.ProjectRenewParam; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 续费管理Service - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -public interface ProjectRenewService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ProjectRenewParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ProjectRenewParam param); - - /** - * 根据id查询 - * - * @param appRenewId 自增ID - * @return ProjectRenew - */ - ProjectRenew getByIdRel(Integer appRenewId); - - BigDecimal sumMoney(LambdaQueryWrapper between); -} diff --git a/src/main/java/com/gxwebsoft/project/service/ProjectService.java b/src/main/java/com/gxwebsoft/project/service/ProjectService.java deleted file mode 100644 index 7438170..0000000 --- a/src/main/java/com/gxwebsoft/project/service/ProjectService.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.gxwebsoft.project.service; - -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.project.entity.Project; -import com.gxwebsoft.project.entity.ProjectRenew; -import com.gxwebsoft.project.param.ProjectParam; - -import java.math.BigDecimal; -import java.util.List; - -/** - * 应用Service - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -public interface ProjectService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ProjectParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ProjectParam param); - - /** - * 根据id查询 - * - * @param appId 应用ID - * @return Project - */ - Project getByIdRel(Integer appId); - - BigDecimal sumMoney(LambdaQueryWrapper between); - - void updateByRenew(ProjectRenew projectRenew); - - -} diff --git a/src/main/java/com/gxwebsoft/project/service/ProjectUrlService.java b/src/main/java/com/gxwebsoft/project/service/ProjectUrlService.java deleted file mode 100644 index f67069a..0000000 --- a/src/main/java/com/gxwebsoft/project/service/ProjectUrlService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.project.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.project.entity.ProjectUrl; -import com.gxwebsoft.project.param.ProjectUrlParam; - -import java.util.List; - -/** - * 项目域名Service - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -public interface ProjectUrlService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ProjectUrlParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ProjectUrlParam param); - - /** - * 根据id查询 - * - * @param appUrlId 自增ID - * @return ProjectUrl - */ - ProjectUrl getByIdRel(Integer appUrlId); - -} diff --git a/src/main/java/com/gxwebsoft/project/service/ProjectUserService.java b/src/main/java/com/gxwebsoft/project/service/ProjectUserService.java deleted file mode 100644 index 5e8407e..0000000 --- a/src/main/java/com/gxwebsoft/project/service/ProjectUserService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.project.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.project.entity.ProjectUser; -import com.gxwebsoft.project.param.ProjectUserParam; - -import java.util.List; - -/** - * 应用成员Service - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -public interface ProjectUserService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ProjectUserParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ProjectUserParam param); - - /** - * 根据id查询 - * - * @param appUserId 自增ID - * @return ProjectUser - */ - ProjectUser getByIdRel(Integer appUserId); - -} diff --git a/src/main/java/com/gxwebsoft/project/service/impl/ProjectCollectionServiceImpl.java b/src/main/java/com/gxwebsoft/project/service/impl/ProjectCollectionServiceImpl.java deleted file mode 100644 index 7cd076d..0000000 --- a/src/main/java/com/gxwebsoft/project/service/impl/ProjectCollectionServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.project.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.project.mapper.ProjectCollectionMapper; -import com.gxwebsoft.project.service.ProjectCollectionService; -import com.gxwebsoft.project.entity.ProjectCollection; -import com.gxwebsoft.project.param.ProjectCollectionParam; -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 科技小王子 - * @since 2025-03-16 12:12:13 - */ -@Service -public class ProjectCollectionServiceImpl extends ServiceImpl implements ProjectCollectionService { - - @Override - public PageResult pageRel(ProjectCollectionParam 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(ProjectCollectionParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public ProjectCollection getByIdRel(Integer id) { - ProjectCollectionParam param = new ProjectCollectionParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/project/service/impl/ProjectFieldServiceImpl.java b/src/main/java/com/gxwebsoft/project/service/impl/ProjectFieldServiceImpl.java deleted file mode 100644 index 081c013..0000000 --- a/src/main/java/com/gxwebsoft/project/service/impl/ProjectFieldServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.project.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.project.mapper.ProjectFieldMapper; -import com.gxwebsoft.project.service.ProjectFieldService; -import com.gxwebsoft.project.entity.ProjectField; -import com.gxwebsoft.project.param.ProjectFieldParam; -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 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Service -public class ProjectFieldServiceImpl extends ServiceImpl implements ProjectFieldService { - - @Override - public PageResult pageRel(ProjectFieldParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(ProjectFieldParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public ProjectField getByIdRel(Integer id) { - ProjectFieldParam param = new ProjectFieldParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/project/service/impl/ProjectRenewServiceImpl.java b/src/main/java/com/gxwebsoft/project/service/impl/ProjectRenewServiceImpl.java deleted file mode 100644 index 98665c4..0000000 --- a/src/main/java/com/gxwebsoft/project/service/impl/ProjectRenewServiceImpl.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.gxwebsoft.project.service.impl; - -import cn.hutool.core.date.DateTime; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.github.yulichang.wrapper.MPJLambdaWrapper; -import com.gxwebsoft.oa.entity.OaAppRenew; -import com.gxwebsoft.project.entity.Project; -import com.gxwebsoft.project.mapper.ProjectRenewMapper; -import com.gxwebsoft.project.param.ProjectParam; -import com.gxwebsoft.project.service.ProjectRenewService; -import com.gxwebsoft.project.entity.ProjectRenew; -import com.gxwebsoft.project.param.ProjectRenewParam; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.project.service.ProjectService; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * 续费管理Service实现 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Service -public class ProjectRenewServiceImpl extends ServiceImpl implements ProjectRenewService { - @Resource - private ProjectService projectService; - - @Override - public PageResult pageRel(ProjectRenewParam param) { - final String sceneType = param.getSceneType(); - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - - // TODO 默认查询条件:读取符合续费条件的项目 - if (sceneType == null) { - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - - - // 特殊场景查询 - List list = null; - DateTime date = DateUtil.date(); - final DateTime nextMonth = DateUtil.nextMonth(); - // 获取当前年份的起止时间 - LocalDateTime startOfYear = LocalDateTime.now().withMonth(1).withDayOfMonth(1) - .withHour(0).withMinute(0).withSecond(0); - LocalDateTime endOfYear = startOfYear.plusYears(1).minusNanos(1); - // 去年的起止时间 - LocalDateTime startOfLastYear = LocalDateTime.now().minusYears(1).withMonth(1).withDayOfMonth(1) - .withHour(0).withMinute(0).withSecond(0); - LocalDateTime endOfLastYear = startOfLastYear.plusYears(1).minusNanos(1); - // 本月起止时间 - LocalDateTime startOfMonth = LocalDateTime.now().withDayOfMonth(1) - .withHour(0).withMinute(0).withSecond(0); - LocalDateTime endOfMonth = startOfMonth.plusMonths(1).minusNanos(1); - - if (StrUtil.isNotBlank(sceneType)) { - // TODO 近30天可催收的续费总额 - if (sceneType.equals("totalPrice30")) { - list = list(new LambdaQueryWrapper() - .lt(ProjectRenew::getEndTime, nextMonth) - .gt(ProjectRenew::getEndTime, date) - .lt(ProjectRenew::getCreateTime, date) - .eq(ProjectRenew::getDeleted, 0) - .orderByAsc(ProjectRenew::getEndTime) - ); - } - - // TODO 本月已收续费总额 - if (sceneType.equals("monthTotalPrice")) { - list = list(new LambdaQueryWrapper() - .between(ProjectRenew::getCreateTime, startOfYear, endOfMonth) - .eq(ProjectRenew::getDeleted, 0) - .orderByDesc(ProjectRenew::getEndTime) - ); - } - - // TODO 今年已收续费总额 - if (sceneType.equals("yearTotalPrice")) { - list = list(new LambdaQueryWrapper() - .between(ProjectRenew::getCreateTime, startOfMonth, endOfYear) - .eq(ProjectRenew::getDeleted, 0) - .orderByDesc(ProjectRenew::getEndTime) - ); - } - - // TODO 去年已收续费列表 - if (sceneType.equals("lastTotalPrice")) { - list = list(new LambdaQueryWrapper() - .between(ProjectRenew::getCreateTime, startOfLastYear, endOfLastYear) - .eq(ProjectRenew::getDeleted, 0) - .orderByDesc(ProjectRenew::getEndTime) - ); - } - } - - // TODO 获取项目名称 - assert list != null; - final Set collectByAppIds = list.stream().map(ProjectRenew::getAppId).collect(Collectors.toSet()); - final ProjectParam projectParam = new ProjectParam(); - projectParam.setAppIds(collectByAppIds); - final List projects = projectService.listRel(projectParam); - - final Map> collect = projects.stream().collect(Collectors.groupingBy(Project::getAppId)); - list.forEach(d -> { - final List projectsItem = collect.get(d.getAppId()); - if (!CollectionUtils.isEmpty(projectsItem)) { - final Project project = projectsItem.get(0); - d.setAppName(project.getAppName()); - d.setNickname(project.getNickname()); - d.setAvatar(project.getAvatar()); - d.setCustomerId(project.getCompanyId()); - d.setCustomerName(project.getCompanyName()); - } - }); - return new PageResult<>(list, (long) list.size()); - } - - @Override - public List listRel(ProjectRenewParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); - return page.sortRecords(list); - } - - @Override - public ProjectRenew getByIdRel(Integer appRenewId) { - ProjectRenewParam param = new ProjectRenewParam(); - param.setAppRenewId(appRenewId); - return param.getOne(baseMapper.selectListRel(param)); - } - - @Override - public BigDecimal sumMoney(LambdaQueryWrapper wrapper) { - return baseMapper.selectSumMoney(wrapper); - } - -} diff --git a/src/main/java/com/gxwebsoft/project/service/impl/ProjectServiceImpl.java b/src/main/java/com/gxwebsoft/project/service/impl/ProjectServiceImpl.java deleted file mode 100644 index fee93fb..0000000 --- a/src/main/java/com/gxwebsoft/project/service/impl/ProjectServiceImpl.java +++ /dev/null @@ -1,269 +0,0 @@ -package com.gxwebsoft.project.service.impl; - -import cn.hutool.core.date.DateField; -import cn.hutool.core.date.DateTime; -import cn.hutool.core.date.DateUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.cms.entity.CmsWebsite; -import com.gxwebsoft.cms.service.CmsWebsiteService; -import com.gxwebsoft.project.entity.*; -import com.gxwebsoft.project.mapper.ProjectMapper; -import com.gxwebsoft.project.param.ProjectUserParam; -import com.gxwebsoft.project.service.ProjectCollectionService; -import com.gxwebsoft.project.service.ProjectRenewService; -import com.gxwebsoft.project.service.ProjectService; -import com.gxwebsoft.project.param.ProjectParam; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.project.service.ProjectUserService; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.time.Instant; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.util.*; -import java.util.stream.Collectors; - -/** - * 应用Service实现 - * - * @author 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Service -public class ProjectServiceImpl extends ServiceImpl implements ProjectService { - - @Resource - private ProjectService projectService; - @Resource - private ProjectUserService projectUserService; - @Resource - private ProjectCollectionService projectCollectionService; - @Resource - private ProjectRenewService projectRenewService; - @Resource - private CmsWebsiteService cmsWebsiteService; - - @Override - public PageResult pageRel(ProjectParam param) { - final String sceneType = param.getSceneType(); - - // TODO 特殊场景查询 - if (sceneType != null) { - param.setUserId(null); - param.setAppStatus(null); - param.setAppIds(null); - - List list = null; - DateTime date = DateUtil.date(); - final DateTime nextMonth = DateUtil.nextMonth(); - // 获取当前年份的起止时间 - LocalDateTime startOfYear = LocalDateTime.now().withMonth(1).withDayOfMonth(1) - .withHour(0).withMinute(0).withSecond(0); - LocalDateTime endOfYear = startOfYear.plusYears(1).minusNanos(1); - // 去年的起止时间 - LocalDateTime startOfLastYear = LocalDateTime.now().minusYears(1).withMonth(1).withDayOfMonth(1) - .withHour(0).withMinute(0).withSecond(0); - LocalDateTime endOfLastYear = startOfLastYear.plusYears(1).minusNanos(1); - - // TODO 我的项目 - if (sceneType.equals("myProject")) { - param.setUserId(param.getLoginUserId()); - list = listRel(param); - } - - // TODO 我的参与 - if (sceneType.equals("involved")) { - final List projectUsers = projectUserService.list(new LambdaQueryWrapper().eq(ProjectUser::getUserId, param.getLoginUserId())); - final Set collect = projectUsers.stream().map(ProjectUser::getAppId).collect(Collectors.toSet()); - param.setAppIds(collect); - list = listRel(param); - } - // TODO 我的收藏 - if (sceneType.equals("collection")) { - final List projectCollections = projectCollectionService.list(new LambdaQueryWrapper().eq(ProjectCollection::getUserId, param.getLoginUserId())); - final Set collect = projectCollections.stream().map(ProjectCollection::getAppId).collect(Collectors.toSet()); - param.setAppIds(collect); - param.setUserId(null); - list = listRel(param); - list.forEach(d -> { - d.setCollection(true); - }); - } - - if (param.getAppStatus() != null && param.getAppStatus().equals("全部")) { - param.setAppStatus(null); - } - - - // TODO 近30天可催收的续费总额 - if (sceneType.equals("totalPrice30")) { - list = list(new LambdaQueryWrapper() - .lt(Project::getExpirationTime, nextMonth) - .gt(Project::getExpirationTime, date) - .eq(Project::getDeleted, 0) - .orderByAsc(Project::getExpirationTime) - ); - } - - // TODO 今年已收续费总额 - if (sceneType.equals("yearTotalPrice")) { - list = list(new LambdaQueryWrapper() - .between(Project::getUpdateTime, startOfYear, endOfYear) - .eq(Project::getDeleted, 0) - .orderByDesc(Project::getCreateTime) - ); - } - - // TODO 去年已收续费列表 - if (sceneType.equals("lastTotalPrice")) { - list = list(new LambdaQueryWrapper() - .between(Project::getUpdateTime, startOfLastYear, endOfLastYear) - .eq(Project::getDeleted, 0) - .orderByDesc(Project::getCreateTime) - ); - } - - // TODO 已流失的续费总额 - if(sceneType.equals("Expired")){ - list = list(new LambdaQueryWrapper() - .lt(Project::getExpirationTime, date) - .eq(Project::getDeleted, 0) - .eq(Project::getAppStatus,"已上架") - .eq(Project::getShowExpiration,true) - .orderByAsc(Project::getExpirationTime) - ); - } - - // TODO 有效续费总金额 - if (sceneType.equals("effectiveTotalPrice")) { - list = list(new LambdaQueryWrapper() - .gt(Project::getExpirationTime, date) - .eq(Project::getDeleted, 0) - .eq(Project::getAppStatus,"已上架") - .eq(Project::getShowExpiration,true) - .orderByAsc(Project::getExpirationTime) - ); - } - - // TODO 全部续费总额 - if (sceneType.equals("AllRenewPrice")) { - list = list(new LambdaQueryWrapper() - .eq(Project::getDeleted, 0) - .eq(Project::getAppStatus,"已上架") - .eq(Project::getShowExpiration,true) - .orderByAsc(Project::getExpirationTime) - ); - } - - assert list != null; - return new PageResult<>(getProjectList(list, param.getLoginUserId()), (long) list.size()); - } - - // 常规搜索 - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); - List list = baseMapper.selectPageRel(page, param); - - return new PageResult<>(getProjectList(list, param.getLoginUserId()), page.getTotal()); - } - - @Override - public List listRel(ProjectParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public Project getByIdRel(Integer appId) { - ProjectParam param = new ProjectParam(); - param.setAppId(appId); - return param.getOne(baseMapper.selectListRel(param)); - } - - @Override - public BigDecimal sumMoney(LambdaQueryWrapper wrapper) { - return baseMapper.selectSumMoney(wrapper); - } - - @Override - public void updateByRenew(ProjectRenew projectRenew) { - final Project project = projectService.getByIdRel(projectRenew.getAppId()); - if(project.getExpirationTime() != null){ - if (projectRenew.getDays() != null) { - // 按天续费 - project.setExpirationTime(project.getExpirationTime().plusDays(projectRenew.getDays())); - } else { - // 按年续费 - project.setExpirationTime(project.getExpirationTime().plusMonths(12 * projectRenew.getDuration().intValue())); - // 更新下一年的续费金额 - project.setRenewMoney(projectRenew.getPayPrice()); - project.setShowExpiration(true); - } - project.setRenewCount(project.getRenewCount() + 1); - - // 保存到期时间所在的年月日 - final LocalDateTime expirationTime = project.getExpirationTime(); - LocalDate localDate = expirationTime.toLocalDate(); - int year = localDate.getYear(); - int month = localDate.getMonthValue(); // 获取月份,范围是1到12 - int day = localDate.getDayOfMonth(); // 获取日,范围是1到31 - project.setYear(year); - project.setMonth(month); - project.setDay(day); - projectService.updateById(project); - // 更新明细的到期时间 - projectRenew.setStartTime(expirationTime); - projectRenew.setEndTime(expirationTime); - // 同步网站状态 - if (!project.getWebsiteId().equals(0)) { - final CmsWebsite website = new CmsWebsite(); - website.setVersion(20); - // 将LocalDateTime转换为Date - Date expirationDate = Date.from(expirationTime.atZone(ZoneId.systemDefault()).toInstant()); - website.setExpirationTime(expirationDate); - website.setWebsiteId(project.getWebsiteId()); - cmsWebsiteService.updateByIdAll(website); - } - } - projectRenewService.updateById(projectRenew); - } - - /** - * 整理列表数据并返回 - * @return List - */ - private List getProjectList(List list, Integer loginUserId) { - - final List projectCollections = projectCollectionService.list(new LambdaQueryWrapper().eq(ProjectCollection::getUserId, loginUserId)); - final Set collect = projectCollections.stream().map(ProjectCollection::getAppId).collect(Collectors.toSet()); - - list.forEach(d -> { - // 收藏状态 - if (collect.contains(d.getAppId())) { - d.setCollection(true); - } - // 应用成员 - d.setProjectUsers(projectUserService.list(new LambdaQueryWrapper().eq(ProjectUser::getAppId, d.getAppId()))); - LocalDateTime now = LocalDateTime.now(); - // 即将过期(30天内过期的) - d.setSoon(d.getExpirationTime().minusDays(30).compareTo(now)); - // 是否过期 -1已过期 大于0 未过期 - d.setExpired(d.getExpirationTime().compareTo(now)); - // 剩余天数 - d.setExpiredDays(java.time.temporal.ChronoUnit.DAYS.between(now, d.getExpirationTime())); - // 续费次数 - d.setRenewCount((long) projectRenewService.count(new LambdaQueryWrapper().eq(ProjectRenew::getAppId, d.getAppId()).eq(ProjectRenew::getDeleted, 0))); - }); - return list; - } - -} diff --git a/src/main/java/com/gxwebsoft/project/service/impl/ProjectUrlServiceImpl.java b/src/main/java/com/gxwebsoft/project/service/impl/ProjectUrlServiceImpl.java deleted file mode 100644 index 462e04d..0000000 --- a/src/main/java/com/gxwebsoft/project/service/impl/ProjectUrlServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.project.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.project.mapper.ProjectUrlMapper; -import com.gxwebsoft.project.service.ProjectUrlService; -import com.gxwebsoft.project.entity.ProjectUrl; -import com.gxwebsoft.project.param.ProjectUrlParam; -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 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Service -public class ProjectUrlServiceImpl extends ServiceImpl implements ProjectUrlService { - - @Override - public PageResult pageRel(ProjectUrlParam 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(ProjectUrlParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public ProjectUrl getByIdRel(Integer appUrlId) { - ProjectUrlParam param = new ProjectUrlParam(); - param.setAppUrlId(appUrlId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/project/service/impl/ProjectUserServiceImpl.java b/src/main/java/com/gxwebsoft/project/service/impl/ProjectUserServiceImpl.java deleted file mode 100644 index 223cb38..0000000 --- a/src/main/java/com/gxwebsoft/project/service/impl/ProjectUserServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.project.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.project.mapper.ProjectUserMapper; -import com.gxwebsoft.project.service.ProjectUserService; -import com.gxwebsoft.project.entity.ProjectUser; -import com.gxwebsoft.project.param.ProjectUserParam; -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 科技小王子 - * @since 2025-03-14 16:21:11 - */ -@Service -public class ProjectUserServiceImpl extends ServiceImpl implements ProjectUserService { - - @Override - public PageResult pageRel(ProjectUserParam param) { - PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time asc"); - List list = baseMapper.selectPageRel(page, param); - return new PageResult<>(list, page.getTotal()); - } - - @Override - public List listRel(ProjectUserParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time asc"); - return page.sortRecords(list); - } - - @Override - public ProjectUser getByIdRel(Integer appUserId) { - ProjectUserParam param = new ProjectUserParam(); - param.setAppUserId(appUserId); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/pwl/controller/PwlProjectController.java b/src/main/java/com/gxwebsoft/pwl/controller/PwlProjectController.java deleted file mode 100644 index f871a4c..0000000 --- a/src/main/java/com/gxwebsoft/pwl/controller/PwlProjectController.java +++ /dev/null @@ -1,243 +0,0 @@ -package com.gxwebsoft.pwl.controller; - -import cn.afterturn.easypoi.excel.ExcelImportUtil; -import cn.afterturn.easypoi.excel.entity.ImportParams; -import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.gxwebsoft.cms.entity.CmsArticle; -import com.gxwebsoft.cms.entity.CmsArticleContent; -import com.gxwebsoft.cms.param.CmsArticleImportParam; -import com.gxwebsoft.common.core.utils.CommonUtil; -import com.gxwebsoft.common.core.utils.JSONUtil; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.Role; -import com.gxwebsoft.common.system.service.UserService; -import com.gxwebsoft.project.entity.ProjectUser; -import com.gxwebsoft.pwl.param.PwlProjectImportParam; -import com.gxwebsoft.pwl.service.PwlProjectService; -import com.gxwebsoft.pwl.entity.PwlProject; -import com.gxwebsoft.pwl.param.PwlProjectParam; -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.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * 卫兰的项目项目系统控制器 - * - * @author 科技小王子 - * @since 2025-03-22 14:34:35 - */ -@Tag(name = "卫兰的项目项目系统管理") -@RestController -@RequestMapping("/api/pwl/pwl-project") -public class PwlProjectController extends BaseController { - @Resource - private PwlProjectService pwlProjectService; - - @PreAuthorize("hasAuthority('pwl:pwlProject:list')") - @Operation(summary = "分页查询卫兰的项目项目系统") - @GetMapping("/page") - public ApiResult> page(PwlProjectParam param) { - final User loginUser = getLoginUser(); - if (loginUser != null) { - param.setLoginUserId(loginUser.getUserId()); - final List roles = loginUser.getRoles(); - if (!CommonUtil.hasRole(roles, "admin") && !CommonUtil.hasRole(roles, "superAdmin")) { - final List projectUsers = pwlProjectService.list(new LambdaQueryWrapper() - .like(PwlProject::getUserIds, loginUser.getUserId()) - .or() - .eq(PwlProject::getUserId, loginUser.getUserId()) - ); - if (!CollectionUtils.isEmpty(projectUsers)) { - final Set appIds = projectUsers.stream().map(PwlProject::getId).collect(Collectors.toSet()); - param.setProjectIds(appIds); - } else { - param.setUserId(loginUser.getUserId()); - } - } - } - return success(pwlProjectService.pageRel(param)); - } - - @PreAuthorize("hasAuthority('pwl:pwlProject:list')") - @Operation(summary = "查询全部卫兰的项目项目系统") - @GetMapping() - public ApiResult> list(PwlProjectParam param) { - // 使用关联查询 - return success(pwlProjectService.listRel(param)); - } - - @PreAuthorize("hasAuthority('pwl:pwlProject:list')") - @Operation(summary = "根据id查询卫兰的项目项目系统") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(pwlProjectService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('pwl:pwlProject:save')") - @OperationLog - @Operation(summary = "添加卫兰的项目项目系统") - @PostMapping() - public ApiResult save(@RequestBody PwlProject pwlProject) { - // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - pwlProject.setUserId(loginUser.getUserId()); - } - if (pwlProject.getCode() != null) { - final PwlProject one = pwlProjectService.getOne(new LambdaQueryWrapper().eq(PwlProject::getCode, pwlProject.getCode())); - if (ObjectUtil.isNotEmpty(one)) { - return fail("报告编号不能重复"); - } - } - if (pwlProjectService.save(pwlProject)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('pwl:pwlProject:update')") - @OperationLog - @Operation(summary = "修改卫兰的项目项目系统") - @PutMapping() - public ApiResult update(@RequestBody PwlProject pwlProject) { - if (pwlProjectService.updateById(pwlProject)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('pwl:pwlProject:remove')") - @OperationLog - @Operation(summary = "删除卫兰的项目项目系统") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (pwlProjectService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('pwl:pwlProject:save')") - @OperationLog - @Operation(summary = "批量添加卫兰的项目项目系统") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (pwlProjectService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('pwl:pwlProject:update')") - @OperationLog - @Operation(summary = "批量修改卫兰的项目项目系统") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(pwlProjectService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('pwl:pwlProject:remove')") - @OperationLog - @Operation(summary = "批量删除卫兰的项目项目系统") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (pwlProjectService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('pwl:pwlProject:save')") - @Operation(summary = "批量导入项目") - @Transactional(rollbackFor = {Exception.class}) - @PostMapping("/import") - public ApiResult> importBatch(MultipartFile file) { - ImportParams importParams = new ImportParams(); - importParams.setHeadRows(2); - importParams.setTitleRows(1); - importParams.setSheetNum(1); - try { - List list = ExcelImportUtil.importExcel(file.getInputStream(), PwlProjectImportParam.class, importParams); - list.forEach(d -> { - PwlProject item = JSONUtil.parseObject(JSONUtil.toJSONString(d), PwlProject.class); - assert item != null; - if (ObjectUtil.isNotEmpty(item)) { - if (item.getStatus() == null) { - item.setStatus(0); - item.setUserId(getLoginUserId()); - } - if (item.getName() != null) { - pwlProjectService.save(item); - } - } - }); - return success("成功导入" + list.size() + "条", null); - } catch (Exception e) { - e.printStackTrace(); - } - return fail("导入失败", null); - } - - @Operation(summary = "统计项目完成情况") - @GetMapping("/count") - public ApiResult count() { - final User loginUser = getLoginUser(); - if (loginUser != null) { - final List list = pwlProjectService.listByCount(); - list.forEach(d -> { - // 已完成项目数量 - final long completed = pwlProjectService.count(new LambdaQueryWrapper() - .like(PwlProject::getDraftUserId, d.getUserId()) - .and( - i -> i.eq(PwlProject::getStatus, 0) - .isNotNull(PwlProject::getDraftUserId) - ) - ); - d.setBalance(new BigDecimal(completed)); - // 未完成项目数量 - final long incomplete = pwlProjectService.count(new LambdaQueryWrapper() - .like(PwlProject::getDraftUserId, d.getUserId()) - .and( - i -> i.eq(PwlProject::getStatus, 1) - .isNotNull(PwlProject::getDraftUserId) - ) - ); - // 签字会计数量 - final long signUsers = pwlProjectService.count(new LambdaQueryWrapper() - .like(PwlProject::getSignUserId, d.getUserId()) - .and( - i -> i.eq(PwlProject::getStatus, 1) - .isNotNull(PwlProject::getSignUserId) - ) - ); - d.setPoints(Math.toIntExact(incomplete)); - d.setFans(Math.toIntExact(signUsers)); - }); - return success(list); - } - return fail("没有找到结果", null); - } - -} diff --git a/src/main/java/com/gxwebsoft/pwl/entity/PwlProject.java b/src/main/java/com/gxwebsoft/pwl/entity/PwlProject.java deleted file mode 100644 index 20b3335..0000000 --- a/src/main/java/com/gxwebsoft/pwl/entity/PwlProject.java +++ /dev/null @@ -1,204 +0,0 @@ -package com.gxwebsoft.pwl.entity; - -import java.math.BigDecimal; - -import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableLogic; -import java.io.Serializable; -import java.time.LocalDateTime; -import com.fasterxml.jackson.annotation.JsonFormat; - -import com.gxwebsoft.common.core.utils.JSONUtil; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 卫兰的项目项目系统 - * - * @author 科技小王子 - * @since 2025-03-22 14:34:35 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "PwlProject对象", description = "卫兰的项目项目系统") -public class PwlProject implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "项目名称") - private String name; - - @Schema(description = "项目标识") - private String code; - - @Schema(description = "上级id, 0是顶级") - private Integer parentId; - - @Schema(description = "项目类型") - private String type; - - @Schema(description = "项目图标") - private String image; - - @Schema(description = "二维码") - private String qrcode; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "应用截图") - private String images; - - @Schema(description = "底稿情况") - private String files; - - @Schema(description = "应用介绍") - private String content; - - @Schema(description = "年末资产总额(万元)") - private BigDecimal totalAssets; - - @Schema(description = "合同金额") - private BigDecimal contractPrice; - - @Schema(description = "实收金额") - private BigDecimal payPrice; - - @Schema(description = "软件定价") - private BigDecimal price; - - @Schema(description = "是否推荐") - private Integer recommend; - - @Schema(description = "到期时间") - private String expirationTime; - - @Schema(description = "项目信息-开票单位/汇款人") - private String itemName; - - @Schema(description = "项目信息-年度") - private String itemYear; - - @Schema(description = "项目信息-类型") - private String itemType; - - @Schema(description = "项目信息-审计意见") - private String itemOpinion; - - @Schema(description = "到账信息-银行名称") - private String bankName; - - @Schema(description = "到账日期") - private String bankPayTime; - - @Schema(description = "到账金额") - private BigDecimal bankPrice; - - @Schema(description = "发票类型") - private String invoiceType; - - @Schema(description = "发票类型") - @TableField(exist = false) - private String invoiceTypeName; - - @Schema(description = "开票日期") - private String invoiceTime; - - @Schema(description = "开票金额") - private BigDecimal invoicePrice; - - @Schema(description = "报告份数") - private String reportNum; - - @Schema(description = "底稿人员") - private String draftUserId; - - @Schema(description = "底稿人员") - private String draftUser; - - @Schema(description = "参与成员") - private String userIds; - - @Schema(description = "参与成员") - private String users; - - @Schema(description = "签字注会") - private String signUserId; - - @Schema(description = "签字注会") - private String signUser; - - @Schema(description = "展业人员") - private String saleUserId; - - @Schema(description = "展业人员") - private String saleUser; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序(数字越小越靠前)") - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - private Integer status; - - @Schema(description = "纸质底稿完成情况") - private Integer paper; - - @Schema(description = "电子底稿完成情况") - private Integer electron; - - @Schema(description = "是否删除, 0否, 1是") - @TableLogic - private Integer deleted; - - @Schema(description = "客户ID") - private Integer userId; - - @Schema(description = "真实姓名") - @TableField(exist = false) - private String realName; - - @Schema(description = "头像") - @TableField(exist = false) - private String avatar; - - @Schema(description = "手机号") - @TableField(exist = false) - private String phone; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -// public Object getDraftUser() { -// return JSON.parse(draftUser); -// } -// public Object getUsers() { -// return JSON.parse(users); -// } -// public Object getSignUser() { -// return JSON.parse(signUser); -// } -// public Object getSaleUser() { -// return JSON.parse(saleUser); -// } -// public Object setDraftUser() { -// return JSON.toJSON(draftUser); -// } -} diff --git a/src/main/java/com/gxwebsoft/pwl/mapper/PwlProjectMapper.java b/src/main/java/com/gxwebsoft/pwl/mapper/PwlProjectMapper.java deleted file mode 100644 index 138b719..0000000 --- a/src/main/java/com/gxwebsoft/pwl/mapper/PwlProjectMapper.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.gxwebsoft.pwl.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.pwl.entity.PwlProject; -import com.gxwebsoft.pwl.param.PwlProjectParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 卫兰的项目项目系统Mapper - * - * @author 科技小王子 - * @since 2025-03-22 14:34:35 - */ -public interface PwlProjectMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") PwlProjectParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") PwlProjectParam param); - - - List listByCount(); -} diff --git a/src/main/java/com/gxwebsoft/pwl/mapper/xml/PwlProjectMapper.xml b/src/main/java/com/gxwebsoft/pwl/mapper/xml/PwlProjectMapper.xml deleted file mode 100644 index f24fc7f..0000000 --- a/src/main/java/com/gxwebsoft/pwl/mapper/xml/PwlProjectMapper.xml +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - SELECT a.*, u.real_name as realName, u.phone, u.avatar, dt.dict_data_name as invoiceTypeName - FROM pwl_project a - LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id - LEFT JOIN gxwebsoft_core.sys_dict_data dt ON a.invoice_type = dt.dict_data_id - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.parent_id = #{param.parentId} - - - AND a.type = #{param.type} - - - AND a.avatar LIKE CONCAT('%', #{param.avatar}, '%') - - - AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%') - - - AND a.url LIKE CONCAT('%', #{param.url}, '%') - - - AND a.images LIKE CONCAT('%', #{param.images}, '%') - - - AND a.files LIKE CONCAT('%', #{param.files}, '%') - - - AND a.content LIKE CONCAT('%', #{param.content}, '%') - - - AND a.total_assets = #{param.totalAssets} - - - AND a.contract_price = #{param.contractPrice} - - - AND a.pay_price = #{param.payPrice} - - - AND a.price = #{param.price} - - - AND a.recommend = #{param.recommend} - - - AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%') - - - AND a.item_name LIKE CONCAT('%', #{param.itemName}, '%') - - - AND a.expiration_time LIKE CONCAT('%', #{param.itemYear}, '%') - - - AND a.item_type LIKE CONCAT('%', #{param.itemType}, '%') - - - AND a.item_opinion LIKE CONCAT('%', #{param.itemOpinion}, '%') - - - AND a.bank_name LIKE CONCAT('%', #{param.bankName}, '%') - - - AND a.bank_pay_time LIKE CONCAT('%', #{param.bankPayTime}, '%') - - - AND a.bank_price = #{param.bankPrice} - - - AND a.invoice_type LIKE CONCAT('%', #{param.invoiceType}, '%') - - - AND a.invoice_time LIKE CONCAT('%', #{param.invoiceTime}, '%') - - - AND a.invoice_price = #{param.invoicePrice} - - - AND a.report_num = #{param.reportNum} - - - AND a.draft_user_id = #{param.draftUserId} - - - AND a.user_ids LIKE CONCAT('%', #{param.userIds}, '%') - - - AND a.sign_user_id = #{param.signUserId} - - - AND a.sale_user_id = #{param.saleUserId} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.status = #{param.status} - - - AND a.deleted = #{param.deleted} - - - AND a.deleted = 0 - - - AND a.user_id = #{param.userId} - - - AND a.create_time >= #{param.createTimeStart} - - - AND a.create_time <= #{param.createTimeEnd} - - - AND a.id IN - - #{item} - - - - AND (a.name LIKE CONCAT('%', #{param.keywords}, '%') - OR a.id = #{param.keywords} - OR a.code = #{param.keywords} - ) - - - - - - - - - - - - - - - diff --git a/src/main/java/com/gxwebsoft/pwl/param/PwlProjectImportParam.java b/src/main/java/com/gxwebsoft/pwl/param/PwlProjectImportParam.java deleted file mode 100644 index b0b2517..0000000 --- a/src/main/java/com/gxwebsoft/pwl/param/PwlProjectImportParam.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.gxwebsoft.pwl.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import com.baomidou.mybatisplus.annotation.TableField; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; - -import java.io.Serializable; -import java.time.LocalDateTime; - -/** - * 用户导入参数 - * - * @author WebSoft - * @since 2011-10-15 17:33:34 - */ -@Data -public class PwlProjectImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "报告时间") - @JsonFormat(pattern = "yyyy.MM.dd", timezone = "GMT+8") - private String expirationTime; - - @Excel(name = "报告编号") - private String code; - - @Excel(name = "审计单位") - private String name; - - @Excel(name = "开项目信息") - private String itemName; - - @Excel(name = "所属年度") - private String itemYear; - - @Excel(name = "类型") - private String itemType; - - @Excel(name = "审计意见") - private String itemOpinion; - - @Excel(name = "年末资产总额(万元)") - private String totalAssets; - - @Excel(name = "合同金额") - private String contractPrice; - - @Excel(name = "实收金额") - private String payPrice; - - @Excel(name = "到账银行") - private String bankName; - - @Excel(name = "到账日期") - @JsonFormat(pattern = "yyyy.MM.dd", timezone = "GMT+8") - private String bankPayTime; - - @Excel(name = "到账金额") - private String bankPrice; - - @Excel(name = "日期") - @JsonFormat(pattern = "yyyy.MM.dd", timezone = "GMT+8") - private String invoiceTime; - - @Excel(name = "金额") - private String invoicePrice; - - @Excel(name = "发票类型") - private String invoiceType; - - @Excel(name = "报告份数") - private String reportNum; - - -} diff --git a/src/main/java/com/gxwebsoft/pwl/param/PwlProjectParam.java b/src/main/java/com/gxwebsoft/pwl/param/PwlProjectParam.java deleted file mode 100644 index 875eca7..0000000 --- a/src/main/java/com/gxwebsoft/pwl/param/PwlProjectParam.java +++ /dev/null @@ -1,167 +0,0 @@ -package com.gxwebsoft.pwl.param; - -import java.math.BigDecimal; -import java.util.Set; - -import com.baomidou.mybatisplus.annotation.TableField; -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 com.gxwebsoft.common.system.entity.User; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 卫兰的项目项目系统查询参数 - * - * @author 科技小王子 - * @since 2025-03-22 14:34:35 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "PwlProjectParam对象", description = "卫兰的项目项目系统查询参数") -public class PwlProjectParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "项目名称") - private String name; - - @Schema(description = "项目标识") - private String code; - - @Schema(description = "上级id, 0是顶级") - @QueryField(type = QueryType.EQ) - private Integer parentId; - - @Schema(description = "项目类型") - @QueryField(type = QueryType.EQ) - private String type; - - @Schema(description = "项目图标") - private String avatar; - - @Schema(description = "二维码") - private String qrcode; - - @Schema(description = "链接地址") - private String url; - - @Schema(description = "应用截图") - private String images; - - @Schema(description = "底稿情况") - private String files; - - @Schema(description = "应用介绍") - private String content; - - @Schema(description = "年末资产总额(万元)") - @QueryField(type = QueryType.EQ) - private BigDecimal totalAssets; - - @Schema(description = "合同金额") - @QueryField(type = QueryType.EQ) - private BigDecimal contractPrice; - - @Schema(description = "实收金额") - @QueryField(type = QueryType.EQ) - private BigDecimal payPrice; - - @Schema(description = "软件定价") - @QueryField(type = QueryType.EQ) - private BigDecimal price; - - @Schema(description = "是否推荐") - @QueryField(type = QueryType.EQ) - private Integer recommend; - - @Schema(description = "到期时间") - private String expirationTime; - - @Schema(description = "项目信息-开票单位/汇款人") - private String itemName; - - @Schema(description = "项目信息-年度") - private String itemYear; - - @Schema(description = "项目信息-类型") - private String itemType; - - @Schema(description = "项目信息-审计意见") - private String itemOpinion; - - @Schema(description = "到账信息-银行名称") - private String bankName; - - @Schema(description = "到账日期") - private String bankPayTime; - - @Schema(description = "到账金额") - @QueryField(type = QueryType.EQ) - private BigDecimal bankPrice; - - @Schema(description = "发票类型") - private String invoiceType; - - @Schema(description = "开票日期") - private String invoiceTime; - - @Schema(description = "开票金额") - @QueryField(type = QueryType.EQ) - private BigDecimal invoicePrice; - - @Schema(description = "报告份数") - @QueryField(type = QueryType.EQ) - private String reportNum; - - @Schema(description = "底稿人员") - @QueryField(type = QueryType.EQ) - private Integer draftUserId; - - @Schema(description = "参与成员") - private String userIds; - - @Schema(description = "签字注会") - @QueryField(type = QueryType.EQ) - private Integer signUserId; - - @Schema(description = "展业人员") - @QueryField(type = QueryType.EQ) - private Integer saleUserId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序(数字越小越靠前)") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "状态, 0正常, 1冻结") - @QueryField(type = QueryType.EQ) - private Integer status; - - @Schema(description = "是否删除, 0否, 1是") - @QueryField(type = QueryType.EQ) - private Integer deleted; - - @Schema(description = "客户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "当前登录用户") - @TableField(exist = false) - private Integer loginUserId; - - @Schema(description = "项目ID集合") - @TableField(exist = false) - private Set projectIds; - -} diff --git a/src/main/java/com/gxwebsoft/pwl/service/PwlProjectService.java b/src/main/java/com/gxwebsoft/pwl/service/PwlProjectService.java deleted file mode 100644 index 3261ec1..0000000 --- a/src/main/java/com/gxwebsoft/pwl/service/PwlProjectService.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.gxwebsoft.pwl.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.pwl.entity.PwlProject; -import com.gxwebsoft.pwl.param.PwlProjectParam; - -import java.util.List; - -/** - * 卫兰的项目项目系统Service - * - * @author 科技小王子 - * @since 2025-03-22 14:34:35 - */ -public interface PwlProjectService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(PwlProjectParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(PwlProjectParam param); - - /** - * 根据id查询 - * - * @param id ID - * @return PwlProject - */ - PwlProject getByIdRel(Integer id); - - List listByCount(); -} diff --git a/src/main/java/com/gxwebsoft/pwl/service/impl/PwlProjectServiceImpl.java b/src/main/java/com/gxwebsoft/pwl/service/impl/PwlProjectServiceImpl.java deleted file mode 100644 index 01a3b00..0000000 --- a/src/main/java/com/gxwebsoft/pwl/service/impl/PwlProjectServiceImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.gxwebsoft.pwl.service.impl; - -import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.common.system.service.UserService; -import com.gxwebsoft.pwl.mapper.PwlProjectMapper; -import com.gxwebsoft.pwl.service.PwlProjectService; -import com.gxwebsoft.pwl.entity.PwlProject; -import com.gxwebsoft.pwl.param.PwlProjectParam; -import com.gxwebsoft.common.core.web.PageParam; -import com.gxwebsoft.common.core.web.PageResult; - -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.util.Arrays; -import java.util.List; - -/** - * 卫兰的项目项目系统Service实现 - * - * @author 科技小王子 - * @since 2025-03-22 14:34:35 - */ -@Service -public class PwlProjectServiceImpl extends ServiceImpl implements PwlProjectService { - @Override - public PageResult pageRel(PwlProjectParam 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(PwlProjectParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public PwlProject getByIdRel(Integer id) { - PwlProjectParam param = new PwlProjectParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - - @Override - public List listByCount() { - return baseMapper.listByCount(); - } - -} diff --git a/src/main/java/com/gxwebsoft/sdy/controller/PushTemplateMessageController.java b/src/main/java/com/gxwebsoft/sdy/controller/PushTemplateMessageController.java deleted file mode 100644 index d4c179c..0000000 --- a/src/main/java/com/gxwebsoft/sdy/controller/PushTemplateMessageController.java +++ /dev/null @@ -1,209 +0,0 @@ -package com.gxwebsoft.sdy.controller; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.common.system.entity.UserVerify; -import com.gxwebsoft.common.system.param.UserParam; -import com.gxwebsoft.common.system.service.UserService; -import com.gxwebsoft.hjm.dto.TemplateMessageRequest; -import com.gxwebsoft.hjm.entity.HjmCar; -import com.gxwebsoft.hjm.entity.HjmCourses; -import com.gxwebsoft.hjm.service.HjmCarService; -import com.gxwebsoft.hjm.service.WxNotificationService; -import com.gxwebsoft.pwl.entity.PwlProject; -import com.gxwebsoft.shop.entity.ShopDealerUser; -import com.gxwebsoft.shop.entity.ShopDealerWithdraw; -import com.gxwebsoft.shop.service.ShopDealerUserService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.HashMap; - -/** - * 定时任务 - * - * @author 科技小王子 - * @since 2022-12-15 19:11:07 - */ -@Tag(name = "定时任务") -@RestController -@RequestMapping("/api/sdy/sdy-template-message") -public class PushTemplateMessageController extends BaseController { - @Resource - private UserService userService; - @Resource - private WxNotificationService wxNotificationService; - @Resource - private ShopDealerUserService shopDealerUserService; - - - final static Integer tenantId = 10560; - final static String appId = "wx51962d6ac21f2ed2"; - final static String toUser = "oKGr42It8OcS1Bl-KpiQj7MM43o8"; - - @Operation(summary = "升级为管理员") - @GetMapping("/{id}") - public ApiResult pushByUpdateAdmin(@PathVariable("id") Integer id) { - // 发送模板消息 - boolean success = updateToAdmin(); - System.out.println("success = " + success); -// try { -// // 查询分销商用户信息 -// final ShopDealerUser dealerUser = shopDealerUserService.getByUserIdRel(id); -// -// // 判断用户是否存在 -// if (ObjectUtil.isEmpty(dealerUser)) { -//// return fail("用户不存在"); -// } -// -// // 发送模板消息 -// boolean success = updateToAdmin(dealerUser); -// -// if (success) { -// return success("模板消息发送成功"); -// } else { -// return fail("模板消息发送失败"); -// } -// -// } catch (Exception e) { -// System.err.println("发送升级管理员通知失败: " + e.getMessage()); -// e.printStackTrace(); -// return fail("发送失败:" + e.getMessage()); -// } - return success("模板消息发送成功",success); - } - - /** - * 升级为管理员 - * - * @return 发送是否成功 - */ - public boolean updateToAdmin() { - try { - // 发送模板消息 - final TemplateMessageRequest templateMessageRequest = new TemplateMessageRequest(); - templateMessageRequest.setToUser(toUser); - templateMessageRequest.setTemplateId("KxGoeBpHW60QFUIU7Vo3c_48g_3V55tWWr23tUUl8gI"); -// templateMessageRequest.setUrl("https://mp.websoft.top"); - final TemplateMessageRequest.MiniProgram miniProgram = new TemplateMessageRequest.MiniProgram(); - miniProgram.setAppid(appId); - miniProgram.setPagepath("pages/index/index"); - templateMessageRequest.setMiniprogram(miniProgram); - HashMap map = new HashMap<>(); - map.put("thing1", new TemplateMessageRequest.TemplateDataItem("唐任节")); - map.put("thing2", new TemplateMessageRequest.TemplateDataItem("升级为管理员")); - templateMessageRequest.setData(map); - System.out.println("发送升级管理员通知,数据: " + map); - - // 调用微信通知服务发送模板消息 - return wxNotificationService.sendTemplateMessage(tenantId, templateMessageRequest); - - } catch (Exception e) { - System.err.println("发送模板消息异常: " + e.getMessage()); - e.printStackTrace(); - return false; - } - } - - @Operation(summary = "发送实名审核提醒") - @PostMapping("/pushReviewReminder") - public ApiResult pushReviewReminder(@RequestBody UserVerify userVerify) { - try { - // 发送模板消息 - final TemplateMessageRequest templateMessageRequest = new TemplateMessageRequest(); - templateMessageRequest.setToUser(toUser); - templateMessageRequest.setTemplateId("0FBKFCWXe8WyjReYXwSDEXf1-pxYKQXE0quZre3GYIM"); - final TemplateMessageRequest.MiniProgram miniProgram = new TemplateMessageRequest.MiniProgram(); - miniProgram.setAppid(appId); - miniProgram.setPagepath("admin/userVerify/index"); - templateMessageRequest.setMiniprogram(miniProgram); - HashMap map = new HashMap<>(); - map.put("thing5", new TemplateMessageRequest.TemplateDataItem(userVerify.getRealName())); - // 当前日期 - map.put("time6", new TemplateMessageRequest.TemplateDataItem(new SimpleDateFormat("yyyy-MM-dd").format(System.currentTimeMillis()))); - templateMessageRequest.setData(map); - System.out.println("map = " + map); - // 调用微信通知服务发送模板消息 - wxNotificationService.sendTemplateMessage(tenantId, templateMessageRequest); - return success("发送成功"); - - } catch (Exception e) { - System.err.println("发送模板消息异常: " + e.getMessage()); - e.printStackTrace(); - return fail("发送失败:" + e.getMessage()); - } - } - - @Operation(summary = "提现审核提醒") - @PostMapping("/pushWithdrawalReviewReminder") - public ApiResult pushWithdrawalReviewReminder(@RequestBody ShopDealerWithdraw shopDealerWithdraw) { - try { - // 发送模板消息 - final TemplateMessageRequest templateMessageRequest = new TemplateMessageRequest(); - templateMessageRequest.setToUser(toUser); - templateMessageRequest.setTemplateId("fJOb0ZPs_HCQO6tdqPRTfaELGgjH5s8a6Vm9X9Hxgrk"); - final TemplateMessageRequest.MiniProgram miniProgram = new TemplateMessageRequest.MiniProgram(); - miniProgram.setAppid(appId); - miniProgram.setPagepath("dealer/withdraw/admin"); -// miniProgram.setPagepath("pages/index/index"); - templateMessageRequest.setMiniprogram(miniProgram); - HashMap map = new HashMap<>(); - map.put("amount1", new TemplateMessageRequest.TemplateDataItem(shopDealerWithdraw.getMoney().toString())); - map.put("thing7", new TemplateMessageRequest.TemplateDataItem(shopDealerWithdraw.getBankAccount())); - templateMessageRequest.setData(map); - System.out.println("map = " + map); - // 调用微信通知服务发送模板消息 - wxNotificationService.sendTemplateMessage(tenantId, templateMessageRequest); - return success("发送成功"); - - } catch (Exception e) { - System.err.println("发送模板消息异常: " + e.getMessage()); - e.printStackTrace(); - return fail("发送失败:" + e.getMessage()); - } - } - - - @Operation(summary = "提现到账通知提醒") - @PostMapping("/pushNoticeOfWithdrawalToAccount") - public ApiResult pushNoticeOfWithdrawalToAccount(@RequestBody ShopDealerWithdraw shopDealerWithdraw) { - if (StrUtil.isBlank(shopDealerWithdraw.getOfficeOpenid())) { - return fail("请传入公众号openid"); - } - try { - // 发送模板消息 - final TemplateMessageRequest templateMessageRequest = new TemplateMessageRequest(); - templateMessageRequest.setToUser(shopDealerWithdraw.getOfficeOpenid()); - templateMessageRequest.setTemplateId("QnmEjyEBmodtfnDsflDwVS1mmh4v_hql-TCDxi2ADs8"); - final TemplateMessageRequest.MiniProgram miniProgram = new TemplateMessageRequest.MiniProgram(); - miniProgram.setAppid(appId); - miniProgram.setPagepath("dealer/withdraw/admin"); - templateMessageRequest.setMiniprogram(miniProgram); - HashMap map = new HashMap<>(); - map.put("thing13", new TemplateMessageRequest.TemplateDataItem(shopDealerWithdraw.getBankAccount())); - map.put("amount4", new TemplateMessageRequest.TemplateDataItem(shopDealerWithdraw.getMoney().toString())); - map.put("amount5", new TemplateMessageRequest.TemplateDataItem(shopDealerWithdraw.getMoney().subtract(new BigDecimal(3)).toString())); - map.put("amount9", new TemplateMessageRequest.TemplateDataItem(new BigDecimal(3).toString())); - - templateMessageRequest.setData(map); - System.out.println("map = " + map); - // 调用微信通知服务发送模板消息 - wxNotificationService.sendTemplateMessage(tenantId, templateMessageRequest); - return success("发送成功"); - - } catch (Exception e) { - System.err.println("发送模板消息异常: " + e.getMessage()); - e.printStackTrace(); - return fail("发送失败:" + e.getMessage()); - } - } - -} diff --git a/src/main/java/com/gxwebsoft/sdy/controller/SdyDealerOrderController.java b/src/main/java/com/gxwebsoft/sdy/controller/SdyDealerOrderController.java deleted file mode 100644 index aceb01b..0000000 --- a/src/main/java/com/gxwebsoft/sdy/controller/SdyDealerOrderController.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.gxwebsoft.sdy.controller; - -import cn.afterturn.easypoi.excel.ExcelImportUtil; -import cn.afterturn.easypoi.excel.entity.ImportParams; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ObjectUtil; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.sdy.param.SdyDealerOrderImportParam; -import com.gxwebsoft.shop.entity.*; -import com.gxwebsoft.shop.service.*; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.annotation.Resource; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; - -/** - * 售电云分销订单控制器 - * - * @author 科技小王子 - * @since 2025-08-12 11:55:18 - */ -@Tag(name = "售电云分销订单管理") -@RestController -@RequestMapping("/api/sdy/sdy-dealer-order") -public class SdyDealerOrderController extends BaseController { - @Resource - private ShopDealerOrderService shopDealerOrderService; - @Resource - private ShopDealerApplyService shopDealerApplyService; - @Resource - private ShopDealerRefereeService shopDealerRefereeService; - @Resource - private ShopDealerCapitalService shopDealerCapitalService; - @Resource - private ShopDealerUserService shopDealerUserService; - - /** - * excel批量导入售电云分销订单 - */ - @PreAuthorize("hasAuthority('shop:shopDealerOrder:save')") - @OperationLog - @Operation(summary = "批量导入售电云分销订单") - @Transactional(rollbackFor = {Exception.class}) - @PostMapping("/import") - public ApiResult> importBatch(MultipartFile file) { - ImportParams importParams = new ImportParams(); - try { - System.out.println("开始导入数据..."); - System.out.println("文件大小: " + (file != null ? file.getSize() : "null")); - - // 导入XLS文件的内容 - List list = ExcelImportUtil.importExcel(file.getInputStream(), SdyDealerOrderImportParam.class, importParams); - - // 打印导入的数据条数用于调试 - System.out.println("导入数据条数: " + (list != null ? list.size() : 0)); - - // 打印第一条数据用于调试 - if (list != null && !list.isEmpty()) { - SdyDealerOrderImportParam first = list.get(0); - System.out.println("第一条数据: " + first); - System.out.println("title: " + first.getTitle()); - System.out.println("userId: " + first.getUserId()); - } - - if (list == null || list.isEmpty()) { - return fail("未读取到任何数据,请检查Excel文件格式和数据行位置", null); - } - - int importedCount = 0; - - for (SdyDealerOrderImportParam d : list) { - // 检查是否已存在相同的记录(根据comments字段和未结算状态) - com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper queryWrapper = new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<>(); - queryWrapper.eq(ShopDealerOrder::getTitle, d.getTitle()); // 使用comments字段 - queryWrapper.eq(ShopDealerOrder::getIsSettled, 0); // 未结算状态 - - if (shopDealerOrderService.count(queryWrapper) == 0) { - // 不存在相同记录,可以导入 - ShopDealerOrder item = new ShopDealerOrder(); - - // 生成订单号 - String orderNo = Long.toString(IdUtil.getSnowflakeNextId()); - - // 手动映射字段 - item.setUserId(d.getUserId()); - item.setOrderNo(orderNo); - item.setOrderPrice(d.getOrderPrice()); - item.setDegreePrice(d.getOrderPrice().multiply(new BigDecimal(1000))); - item.setFirstUserId(d.getFirstUserId()); - item.setSecondUserId(d.getSecondUserId()); - item.setThirdUserId(d.getThirdUserId()); - item.setFirstMoney(d.getFirstMoney()); - item.setSecondMoney(d.getSecondMoney()); - item.setThirdMoney(d.getThirdMoney()); - item.setTenantId(d.getTenantId()); - item.setTitle(d.getTitle()); - item.setComments(d.getComments()); - // 假设d.getPrice()返回的BigDecimal未设置精度 - item.setPrice(d.getPrice()); - item.setSettledPrice(d.getSettledPrice()); - item.setPayPrice(d.getPayPrice()); - item.setRate(d.getRate()); - item.setMonth(d.getMonth()); - item.setIsInvalid(0); - item.setIsSettled(0); // 新导入的数据设为未结算 - - System.out.println("准备导入数据: " + item); - if (ObjectUtil.isNotEmpty(item)) { - shopDealerOrderService.save(item); - importedCount++; - } - } else { - System.out.println("跳过重复数据: " + d.getComments()); - } - } - return success("成功导入" + importedCount + "条,重复或已存在" + (list.size() - importedCount) + "条", null); - } catch (Exception e) { - e.printStackTrace(); - return fail("导入失败: " + e.getMessage(), null); - } - } - - @PreAuthorize("hasAuthority('shop:shopDealerOrder:update')") - @Operation(summary = "结算订单") - @PutMapping() - public ApiResult saveSettled(@RequestBody ShopDealerOrder shopDealerOrder) { - shopDealerOrder.setSettleTime(LocalDateTime.now()); - shopDealerOrder.setIsSettled(1); - if (shopDealerOrderService.updateById(shopDealerOrder)) { - - // 一级分成 - ShopDealerUser dealerUser = shopDealerUserService.getByUserIdRel(shopDealerOrder.getFirstUserId()); - dealerUser.setMoney(dealerUser.getMoney().add(shopDealerOrder.getFirstMoney())); - if(shopDealerUserService.updateById(dealerUser)){ - System.out.println("一级分成 = 1"); - ShopDealerCapital shopDealerCapital = new ShopDealerCapital(); - shopDealerCapital.setUserId(shopDealerOrder.getFirstUserId()); - shopDealerCapital.setOrderNo(shopDealerOrder.getOrderNo()); - shopDealerCapital.setMoney(shopDealerOrder.getFirstMoney()); - shopDealerCapital.setMonth(shopDealerOrder.getMonth()); - shopDealerCapital.setComments("分销订单结算"); - shopDealerCapital.setToUserId(shopDealerOrder.getUserId()); - shopDealerCapitalService.save(shopDealerCapital); - } - - // 二级分成 - ShopDealerUser dealerUser2 = shopDealerUserService.getByUserIdRel(shopDealerOrder.getSecondUserId()); - if(ObjectUtil.isNotEmpty(dealerUser2)){ - dealerUser2.setMoney(dealerUser2.getMoney().add(shopDealerOrder.getSecondMoney())); - if (shopDealerUserService.updateById(dealerUser2)) { - System.out.println("二级分成 = 2"); - ShopDealerCapital shopDealerCapital2 = new ShopDealerCapital(); - shopDealerCapital2.setUserId(shopDealerOrder.getSecondUserId()); - shopDealerCapital2.setOrderNo(shopDealerOrder.getOrderNo()); - shopDealerCapital2.setMoney(shopDealerOrder.getSecondMoney()); - shopDealerCapital2.setMonth(shopDealerOrder.getMonth()); - shopDealerCapital2.setComments("分销订单结算"); - shopDealerCapital2.setToUserId(shopDealerOrder.getUserId()); - shopDealerCapitalService.save(shopDealerCapital2); - } - } - - // 三级分成 - ShopDealerUser dealerUser3 = shopDealerUserService.getByUserIdRel(shopDealerOrder.getThirdUserId()); - if(ObjectUtil.isNotEmpty(dealerUser3)){ - dealerUser3.setMoney(dealerUser3.getMoney().add(shopDealerOrder.getThirdMoney())); - if (shopDealerUserService.updateById(dealerUser3)) { - System.out.println("三级分成 = 3"); - ShopDealerCapital shopDealerCapital3 = new ShopDealerCapital(); - shopDealerCapital3.setUserId(shopDealerOrder.getThirdUserId()); - shopDealerCapital3.setOrderNo(shopDealerOrder.getOrderNo()); - shopDealerCapital3.setMoney(shopDealerOrder.getThirdMoney()); - shopDealerCapital3.setMonth(shopDealerOrder.getMonth()); - shopDealerCapital3.setComments("分销订单结算"); - shopDealerCapital3.setToUserId(shopDealerOrder.getUserId()); - shopDealerCapitalService.save(shopDealerCapital3); - } - } - - return success("结算成功"); - } - return fail("结算失败"); - } -} diff --git a/src/main/java/com/gxwebsoft/sdy/param/SdyDealerOrderImportParam.java b/src/main/java/com/gxwebsoft/sdy/param/SdyDealerOrderImportParam.java deleted file mode 100644 index 4f66cae..0000000 --- a/src/main/java/com/gxwebsoft/sdy/param/SdyDealerOrderImportParam.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.gxwebsoft.sdy.param; - -import cn.afterturn.easypoi.excel.annotation.Excel; -import com.baomidou.mybatisplus.annotation.TableField; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * 售电云分销订单导入参数 - * - * @author 科技小王子 - * @since 2025-08-12 11:55:18 - */ -@Data -public class SdyDealerOrderImportParam implements Serializable { - private static final long serialVersionUID = 1L; - - @Excel(name = "业务员ID") - private Integer userId; - - @Excel(name = "公司名称") - private String title; - - @Excel(name = "订单编号") - private String orderNo; - - @Excel(name = "结算电量") - private BigDecimal orderPrice; - - @Excel(name = "换算成度") - private BigDecimal degreePrice; - - @Excel(name = "结算金额") - private BigDecimal settledPrice; - - @Excel(name = "实发金额") - private BigDecimal payPrice; - - @Excel(name = "结算单价") - private BigDecimal price; - - @Excel(name = "税费") - private BigDecimal rate; - - @Excel(name = "月份") - private String month; - - @Excel(name = "一级分销商ID") - private Integer firstUserId; - - @Excel(name = "二级分销商ID") - private Integer secondUserId; - - @Excel(name = "三级分销商ID") - private Integer thirdUserId; - - @Excel(name = "一级佣金30%") - private BigDecimal firstMoney; - - @Excel(name = "二级佣金10%") - private BigDecimal secondMoney; - - @Excel(name = "三级佣金60%") - private BigDecimal thirdMoney; - - @Excel(name = "备注") - private String comments; - - @Excel(name = "租户ID") - private Integer tenantId; -} diff --git a/src/main/java/com/gxwebsoft/shop/controller/ShopDealerWithdrawController.java b/src/main/java/com/gxwebsoft/shop/controller/ShopDealerWithdrawController.java index 081c7e6..b13ef3a 100644 --- a/src/main/java/com/gxwebsoft/shop/controller/ShopDealerWithdrawController.java +++ b/src/main/java/com/gxwebsoft/shop/controller/ShopDealerWithdrawController.java @@ -97,10 +97,24 @@ public class ShopDealerWithdrawController extends BaseController { return fail("提现方式不能为空"); } - // 资金安全:用户申请后统一进入“待审核(10)”,审核通过后再由用户主动领取 + // 资金安全:默认进入“待审核(10)”,部分租户/小额提现可自动审核通过,再由用户主动领取 shopDealerWithdraw.setApplyStatus(10); shopDealerWithdraw.setAuditTime(null); + if (Integer.valueOf(10584).equals(shopDealerWithdraw.getTenantId())) { + // 如果体现金额小于 100,则自动审核通过;否则进入待审核 + if (shopDealerWithdraw.getMoney().compareTo(java.math.BigDecimal.valueOf(100)) < 0) { + shopDealerWithdraw.setApplyStatus(20); + shopDealerWithdraw.setAuditTime(LocalDateTime.now()); + } else { + shopDealerWithdraw.setApplyStatus(10); + shopDealerWithdraw.setAuditTime(null); + // 3.如果金额大于100,小于1000,则需要userId=35083审核 + // 4.如果金额1000~10000之间,则需要userId=35083和userId=35230一起审核 + // 5.10000以上,则需要userId=35083和userId=35230和userId=35231一起审核 + } + } + final ShopDealerUser dealerUser = shopDealerUserService.getByUserIdRel(loginUser.getUserId()); if (dealerUser == null) { return fail("分销商信息不存在"); @@ -223,16 +237,17 @@ public class ShopDealerWithdrawController extends BaseController { return fail("tenantId为空,无法发起微信转账"); } - String openid = StrUtil.isNotBlank(db.getOpenId()) ? db.getOpenId() : db.getOfficeOpenid(); + // 小程序“收款确认页”只能使用小程序openid;公众号openid传入会导致微信侧 400(INVALID_REQUEST)。 + String openid = db.getOpenId(); if (StrUtil.isBlank(openid)) { - // 兜底:从分销商信息关联获取openid + // 兜底:从分销商信息关联获取openid(同样应为小程序openid) ShopDealerUser dealerUser = shopDealerUserService.getByUserIdRel(db.getUserId()); if (dealerUser != null && StrUtil.isNotBlank(dealerUser.getOpenid())) { openid = dealerUser.getOpenid(); } } if (StrUtil.isBlank(openid)) { - return fail("用户openid为空,无法拉起微信收款确认页"); + return fail("用户小程序openid为空,无法拉起微信收款确认页"); } // 使用提现记录ID构造单号,保持幂等;微信要求 5-32 且仅字母/数字 diff --git a/src/main/java/com/gxwebsoft/shop/controller/ShopOrderController.java b/src/main/java/com/gxwebsoft/shop/controller/ShopOrderController.java index 1670772..ae553dc 100644 --- a/src/main/java/com/gxwebsoft/shop/controller/ShopOrderController.java +++ b/src/main/java/com/gxwebsoft/shop/controller/ShopOrderController.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.gxwebsoft.common.core.config.ConfigProperties; import com.gxwebsoft.common.core.config.CertificateProperties; import com.gxwebsoft.common.core.utils.RedisUtil; @@ -13,7 +14,9 @@ import com.gxwebsoft.common.core.utils.WechatPayConfigValidator; import com.gxwebsoft.common.core.web.BaseController; import com.gxwebsoft.common.system.entity.Payment; import com.gxwebsoft.shop.entity.ShopOrderDelivery; +import com.gxwebsoft.shop.entity.ShopUserAddress; import com.gxwebsoft.shop.service.*; +import com.gxwebsoft.glt.service.GltTicketRevokeService; import com.gxwebsoft.shop.service.impl.KuaiDi100Impl; import com.gxwebsoft.shop.task.OrderAutoCancelTask; import com.gxwebsoft.shop.entity.ShopOrder; @@ -95,7 +98,15 @@ public class ShopOrderController extends BaseController { @Resource private ShopOrderDeliveryService shopOrderDeliveryService; @Resource + private ShopWechatShippingSyncService shopWechatShippingSyncService; + @Resource private PaymentService paymentService; + @Resource + private ShopStoreFenceService shopStoreFenceService; + @Resource + private GltTicketRevokeService gltTicketRevokeService; + @Resource + private ShopDealerCommissionRollbackService shopDealerCommissionRollbackService; @Operation(summary = "分页查询订单") @GetMapping("/page") @@ -145,6 +156,20 @@ public class ShopOrderController extends BaseController { shopOrder.setUserId(loginUser.getUserId()); shopOrder.setOpenid(loginUser.getOpenid()); shopOrder.setPayUserId(loginUser.getUserId()); + if (shopOrder.getTenantId() == null) { + shopOrder.setTenantId(loginUser.getTenantId()); + } + + // 下单时间 & 订单过期时间:默认下单后10分钟过期(用于发起支付等场景校验) + LocalDateTime now = LocalDateTime.now(); + if (shopOrder.getCreateTime() == null) { + shopOrder.setCreateTime(now); + } + if (shopOrder.getUpdateTime() == null) { + shopOrder.setUpdateTime(now); + } + shopOrder.setExpirationTime(shopOrder.getCreateTime().plusMinutes(60)); + if (shopOrder.getOrderNo() == null) { shopOrder.setOrderNo(Long.toString(IdUtil.getSnowflakeNextId())); } @@ -164,6 +189,39 @@ public class ShopOrderController extends BaseController { shopOrder.setPrice(new BigDecimal("0.01")); shopOrder.setTotalPrice(new BigDecimal("0.01")); } + + // 下单时校验配送范围(电子围栏):不信任前端传经纬度,使用 addressId 反查地址表坐标 + try { + // 自提/无需物流跳过 + boolean needFenceCheck = !(shopOrder.getSelfTakeMerchantId() != null && shopOrder.getSelfTakeMerchantId() > 0) + && !(shopOrder.getDeliveryType() != null && shopOrder.getDeliveryType().equals(1)); + if (needFenceCheck && shopOrder.getAddressId() == null) { + if (shopStoreFenceService.hasEnabledFences(shopOrder.getTenantId())) { + return fail("请先选择收货地址"); + } + } + if (needFenceCheck && shopOrder.getAddressId() != null) { + ShopUserAddress address = shopUserAddressService.getById(shopOrder.getAddressId()); + if (address == null || address.getUserId() == null || !address.getUserId().equals(loginUser.getUserId())) { + return fail("收货地址不存在"); + } + if (address.getTenantId() != null && shopOrder.getTenantId() != null && !address.getTenantId().equals(shopOrder.getTenantId())) { + return fail("收货地址不存在"); + } + if (StrUtil.isBlank(address.getLat()) || StrUtil.isBlank(address.getLng())) { + return fail("收货地址坐标缺失,请重新选择收货地址"); + } + double lat = Double.parseDouble(address.getLat().trim()); + double lng = Double.parseDouble(address.getLng().trim()); + shopOrder.setAddressLat(address.getLat()); + shopOrder.setAddressLng(address.getLng()); + shopStoreFenceService.validatePointInEnabledFences(shopOrder.getTenantId(), lng, lat); + } + } catch (Exception e) { + // BusinessException message 直接透出;其他异常做兜底 + return fail(e.getMessage() == null ? "收货地址不在配送范围内" : e.getMessage()); + } + if (shopOrderService.save(shopOrder)) { return success("下单成功", shopOrderService.createWxOrder(shopOrder)); } @@ -265,7 +323,9 @@ public class ShopOrderController extends BaseController { return fail("订单不存在"); } // 退款相关操作单独走退款接口,便于做财务权限隔离 - if (Objects.equals(shopOrder.getOrderStatus(), 4) || Objects.equals(shopOrder.getOrderStatus(), 6)) { + if (Objects.equals(shopOrder.getOrderStatus(), 4) + || Objects.equals(shopOrder.getOrderStatus(), 5) + || Objects.equals(shopOrder.getOrderStatus(), 6)) { return fail("退款相关操作请使用退款接口: PUT /api/shop/shop-order/refund"); } ShopOrder shopOrderNow = shopOrderService.getById(shopOrder.getOrderId()); @@ -274,19 +334,104 @@ public class ShopOrderController extends BaseController { } // 发货状态从“未发货(10)”变更为“已发货(20)”时,记录发货信息 if (Objects.equals(shopOrderNow.getDeliveryStatus(), 10) && Objects.equals(shopOrder.getDeliveryStatus(), 20)) { - ShopOrderDelivery shopOrderDelivery = new ShopOrderDelivery(); - shopOrderDelivery.setOrderId(shopOrder.getOrderId()); - shopOrderDelivery.setDeliveryMethod(30); - shopOrderDelivery.setExpressId(shopOrder.getExpressId()); - shopOrderDelivery.setSendName(shopOrder.getSendName()); - shopOrderDelivery.setSendPhone(shopOrder.getSendPhone()); - shopOrderDelivery.setSendAddress(shopOrder.getSendAddress()); - shopOrderDeliveryService.save(shopOrderDelivery); + // 1) 无需物流/自提:不走快递100下单,直接置为已发货并同步到微信后台 + if (shopOrder.getExpressId() == null || shopOrder.getExpressId() == 0) { + ShopOrderDelivery shopOrderDelivery = new ShopOrderDelivery(); + shopOrderDelivery.setOrderId(shopOrder.getOrderId()); + shopOrderDelivery.setDeliveryMethod(20); + shopOrderDelivery.setSendName(shopOrder.getSendName()); + shopOrderDelivery.setSendPhone(shopOrder.getSendPhone()); + shopOrderDelivery.setSendAddress(shopOrder.getSendAddress()); + shopOrderDeliveryService.save(shopOrderDelivery); - shopOrderDeliveryService.setExpress(getLoginUser(), shopOrderDelivery, shopOrder); + ShopOrder patch = new ShopOrder(); + patch.setOrderId(shopOrder.getOrderId()); + patch.setDeliveryStatus(20); + patch.setDeliveryTime(LocalDateTime.now()); + shopOrderService.updateById(patch); + + // 同步到微信后台(发货信息录入) + ShopOrder syncOrder = shopOrderNow; + syncOrder.setDeliveryStatus(20); + syncOrder.setDeliveryTime(patch.getDeliveryTime()); + try { + shopWechatShippingSyncService.uploadNoLogisticsShippingInfo(syncOrder); + } catch (Exception e) { + logger.warn("同步微信发货信息失败(无需物流,不影响发货成功) - orderId={}", shopOrder.getOrderId(), e); + } + } else { + // 2) 实物快递:创建发货单并走快递100电子面单,发货成功后同步微信后台 + ShopOrderDelivery shopOrderDelivery = new ShopOrderDelivery(); + shopOrderDelivery.setOrderId(shopOrder.getOrderId()); + shopOrderDelivery.setDeliveryMethod(30); + shopOrderDelivery.setExpressId(shopOrder.getExpressId()); + shopOrderDelivery.setSendName(shopOrder.getSendName()); + shopOrderDelivery.setSendPhone(shopOrder.getSendPhone()); + shopOrderDelivery.setSendAddress(shopOrder.getSendAddress()); + shopOrderDeliveryService.save(shopOrderDelivery); + + // 需要用订单的持久化字段(例如 addressId/tenantId/userId/transactionId),同时补齐临时的发货地址 + ShopOrder orderForDelivery = shopOrderNow; + orderForDelivery.setSendAddress(shopOrder.getSendAddress()); + shopOrderDeliveryService.setExpress(getLoginUser(), shopOrderDelivery, orderForDelivery); + } } if (shopOrderService.updateById(shopOrder)) { + // 后台手工将订单改为“已取消”(2)时,需同步撤销可能已发放的水票/释放计划/送水订单 + try { + if (Objects.equals(shopOrder.getOrderStatus(), 2) && !Objects.equals(shopOrderNow.getOrderStatus(), 2)) { + gltTicketRevokeService.revokeByShopOrder( + ObjectUtil.defaultIfNull(shopOrder.getTenantId(), shopOrderNow.getTenantId()), + shopOrderNow.getOrderId(), + shopOrderNow.getOrderNo(), + "订单取消撤销水票" + ); + } + } catch (Exception e) { + logger.error("订单更新为取消后撤销水票失败 - orderId={}, orderNo={}", + shopOrderNow.getOrderId(), shopOrderNow.getOrderNo(), e); + } + + // 如果订单上带了快递单号(常见于后台手工修正/补录),同步到发货单表,避免发货单还是旧单号 + if (StrUtil.isNotBlank(shopOrder.getExpressNo()) && shopOrder.getOrderId() != null) { + try { + List deliveryList = shopOrderDeliveryService.list( + new LambdaQueryWrapper() + .eq(ShopOrderDelivery::getOrderId, shopOrder.getOrderId()) + ); + if (deliveryList == null || deliveryList.isEmpty()) { + ShopOrderDelivery delivery = new ShopOrderDelivery(); + delivery.setOrderId(shopOrder.getOrderId()); + delivery.setTenantId(ObjectUtil.defaultIfNull(shopOrder.getTenantId(), shopOrderNow.getTenantId())); + delivery.setExpressId(ObjectUtil.defaultIfNull(shopOrder.getExpressId(), shopOrderNow.getExpressId())); + delivery.setExpressNo(shopOrder.getExpressNo()); + // 10手动录入 / 20无需物流 + if (delivery.getExpressId() == null || delivery.getExpressId() == 0) { + delivery.setDeliveryMethod(20); + } else { + delivery.setDeliveryMethod(10); + } + delivery.setSendName(ObjectUtil.defaultIfNull(shopOrder.getSendName(), shopOrderNow.getSendName())); + delivery.setSendPhone(ObjectUtil.defaultIfNull(shopOrder.getSendPhone(), shopOrderNow.getSendPhone())); + delivery.setSendAddress(ObjectUtil.defaultIfNull(shopOrder.getSendAddress(), shopOrderNow.getSendAddress())); + shopOrderDeliveryService.save(delivery); + } else { + for (ShopOrderDelivery d : deliveryList) { + if (d == null || d.getDeliveryId() == null) { + continue; + } + ShopOrderDelivery patch = new ShopOrderDelivery(); + patch.setDeliveryId(d.getDeliveryId()); + patch.setExpressNo(shopOrder.getExpressNo()); + shopOrderDeliveryService.updateById(patch); + } + } + } catch (Exception e) { + logger.warn("同步更新发货单运单号失败 - orderId={}, expressNo={}", + shopOrder.getOrderId(), shopOrder.getExpressNo(), e); + } + } return success("修改成功"); } return fail("修改失败"); @@ -299,8 +444,8 @@ public class ShopOrderController extends BaseController { if (req == null || req.getOrderId() == null || req.getOrderStatus() == null) { return fail("orderId 和 orderStatus 不能为空"); } - if (!Objects.equals(req.getOrderStatus(), 4) && !Objects.equals(req.getOrderStatus(), 6)) { - return fail("orderStatus 仅支持 4(申请退款) 或 6(同意退款)"); + if (!Objects.equals(req.getOrderStatus(), 4) && !Objects.equals(req.getOrderStatus(), 6) && !Objects.equals(req.getOrderStatus(), 7)) { + return fail("orderStatus 仅支持 4(申请退款) 或 6(同意退款) 或 7(客户端申请退款)"); } ShopOrder current = shopOrderService.getById(req.getOrderId()); @@ -310,6 +455,20 @@ public class ShopOrderController extends BaseController { // 申请退款:只记录申请时间/原因/金额(如有) if (Objects.equals(req.getOrderStatus(), 4)) { + // 未支付订单不允许进入退款流程(否则会出现“取消订单/超时取消后变成退款申请中”的严重脏状态) + if (!Boolean.TRUE.equals(current.getPayStatus())) { + return fail("订单未支付,无法申请退款"); + } + if (Objects.equals(current.getOrderStatus(), 2)) { + return fail("订单已取消,无法申请退款"); + } + if (Objects.equals(current.getOrderStatus(), 4) + || Objects.equals(current.getOrderStatus(), 5) + || Objects.equals(current.getOrderStatus(), 6) + || Objects.equals(current.getOrderStatus(), 7)) { + return fail("订单已在退款流程中,请勿重复申请"); + } + ShopOrder patch = new ShopOrder(); patch.setOrderId(req.getOrderId()); patch.setOrderStatus(4); @@ -388,6 +547,38 @@ public class ShopOrderController extends BaseController { return fail("退款成功,但订单状态更新失败,请联系管理员"); } + // 退款成功后撤销水票相关数据(幂等;无水票则无副作用) + try { + gltTicketRevokeService.revokeByShopOrder( + current.getTenantId(), + current.getOrderId(), + current.getOrderNo(), + "订单退款成功撤销水票" + ); + } catch (Exception e) { + // 退款已完成,不能因为撤销失败而回滚;记录日志以便人工补偿 + logger.error("退款成功但撤销水票失败 - tenantId={}, orderId={}, orderNo={}", + current.getTenantId(), current.getOrderId(), current.getOrderNo(), e); + } + + // 退款成功后回退分红/分润/佣金(从 ShopDealerUser 中扣回;以 ShopDealerCapital 明细为准) + try { + Integer tenantId = ObjectUtil.defaultIfNull(current.getTenantId(), getTenantId()); + ShopOrder rollbackOrder = new ShopOrder(); + rollbackOrder.setTenantId(tenantId); + rollbackOrder.setOrderNo(current.getOrderNo()); + rollbackOrder.setPayPrice(current.getPayPrice()); + rollbackOrder.setTotalPrice(current.getTotalPrice()); + boolean rollbackOk = shopDealerCommissionRollbackService.rollbackOnOrderRefund(rollbackOrder, refundAmount); + if (!rollbackOk) { + logger.error("退款成功但回退分红/分润/佣金失败 - tenantId={}, orderId={}, orderNo={}", + tenantId, current.getOrderId(), current.getOrderNo()); + } + } catch (Exception e) { + logger.error("退款成功但回退分红/分润/佣金异常 - tenantId={}, orderId={}, orderNo={}", + current.getTenantId(), current.getOrderId(), current.getOrderNo(), e); + } + logger.info("订单退款请求成功 - 订单号: {}, 退款单号: {}, 微信退款单号: {}", current.getOrderNo(), refundNo, refundResponse.getTransactionId()); return success("退款成功"); @@ -422,11 +613,49 @@ public class ShopOrderController extends BaseController { if (batchParam != null && batchParam.getData() != null) { Integer status = batchParam.getData().getOrderStatus(); // 退款相关操作单独走退款接口,避免绕过财务权限 - if (Objects.equals(status, 4) || Objects.equals(status, 6)) { + if (Objects.equals(status, 4) + || Objects.equals(status, 5) + || Objects.equals(status, 6) + || Objects.equals(status, 7)) { return fail("退款相关操作请使用退款接口: PUT /api/shop/shop-order/refund"); } } - if (batchParam.update(shopOrderService, "order_id")) { + boolean ok = batchParam.update(shopOrderService, "order_id"); + if (ok) { + // 兼容后台直接将订单改为“已取消”(2)的场景:同步撤销可能已发放的水票/释放计划/送水订单 + try { + if (batchParam != null && batchParam.getData() != null + && Objects.equals(batchParam.getData().getOrderStatus(), 2) + && batchParam.getIds() != null && !batchParam.getIds().isEmpty()) { + for (Object rawId : batchParam.getIds()) { + Integer orderId = null; + if (rawId instanceof Integer) { + orderId = (Integer) rawId; + } else if (rawId != null) { + try { + orderId = Integer.valueOf(rawId.toString()); + } catch (Exception ignore) { + // ignore malformed id + } + } + if (orderId == null) { + continue; + } + ShopOrder order = shopOrderService.getById(orderId); + if (order == null) { + continue; + } + gltTicketRevokeService.revokeByShopOrder( + order.getTenantId(), + order.getOrderId(), + order.getOrderNo(), + "订单取消撤销水票" + ); + } + } + } catch (Exception e) { + logger.error("批量取消订单后撤销水票失败", e); + } return success("修改成功"); } return fail("修改失败"); @@ -487,6 +716,8 @@ public class ShopOrderController extends BaseController { return fail("订单状态不允许取消"); } + // 标记为用户主动取消(定时任务/系统取消会走默认文案) + order.setCancelReason("用户取消"); boolean success = orderCancelService.cancelOrder(order); if (success) { return success("订单取消成功"); diff --git a/src/main/java/com/gxwebsoft/shop/controller/ShopOrderGltRepairController.java b/src/main/java/com/gxwebsoft/shop/controller/ShopOrderGltRepairController.java new file mode 100644 index 0000000..b717fb9 --- /dev/null +++ b/src/main/java/com/gxwebsoft/shop/controller/ShopOrderGltRepairController.java @@ -0,0 +1,72 @@ +package com.gxwebsoft.shop.controller; + +import cn.hutool.core.util.ObjectUtil; +import com.gxwebsoft.common.core.web.ApiResult; +import com.gxwebsoft.common.core.web.BaseController; +import com.gxwebsoft.shop.dto.RefundedOrderGltRepairRequest; +import com.gxwebsoft.shop.service.ShopOrderGltRepairService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +/** + * 历史订单修复:用于对“已退款的旧订单”补偿撤销水票相关数据。 + */ +@Tag(name = "订单修复") +@RestController +@RequestMapping("/api/shop/shop-order/repair") +public class ShopOrderGltRepairController extends BaseController { + + @Resource + private ShopOrderGltRepairService shopOrderGltRepairService; + + @PreAuthorize("hasAuthority('shop:shopOrder:manage')") + @Operation(summary = "修复:已退款旧订单补偿撤销水票/释放计划/送水单(支持dryRun预览)") + @PostMapping("/revoke-glt-after-refund") + public ApiResult revokeGltAfterRefund(@RequestBody RefundedOrderGltRepairRequest req) { + if (req == null) { + return fail("请求体不能为空"); + } + + Integer tenantId = ObjectUtil.defaultIfNull(req.getTenantId(), getTenantId()); + if (tenantId == null) { + return fail("tenantId不能为空"); + } + + boolean dryRun = req.getDryRun() == null || req.getDryRun(); + + // 防误操作:既未指定订单,也未指定时间窗口时,只允许 dryRun + boolean noTargets = (req.getOrderIds() == null || req.getOrderIds().isEmpty()) + && (req.getOrderNos() == null || req.getOrderNos().isEmpty()) + && req.getRefundTimeStart() == null + && req.getRefundTimeEnd() == null; + if (noTargets && !dryRun) { + return fail("请指定 orderIds/orderNos 或 refundTimeStart/refundTimeEnd;否则仅允许 dryRun=true 预览"); + } + + ShopOrderGltRepairService.RepairResult r = shopOrderGltRepairService.revokeTicketsForRefundedOrders( + tenantId, + req.getOrderIds(), + req.getOrderNos(), + req.getRefundTimeStart(), + req.getRefundTimeEnd(), + req.getBatchSize(), + dryRun + ); + + Map data = new HashMap<>(); + data.put("tenantId", tenantId); + data.put("dryRun", r.dryRun()); + data.put("scannedOrders", r.scannedOrders()); + data.put("ordersWithTicketsRevoked", r.ordersWithTicketsRevoked()); + data.put("revokedTicketCount", r.revokedTicketCount()); + data.put("processedOrderIds", r.processedOrderIds()); + return success(data); + } +} + diff --git a/src/main/java/com/gxwebsoft/shop/controller/ShopUserController.java b/src/main/java/com/gxwebsoft/shop/controller/ShopUserController.java index 10f53a5..7926f98 100644 --- a/src/main/java/com/gxwebsoft/shop/controller/ShopUserController.java +++ b/src/main/java/com/gxwebsoft/shop/controller/ShopUserController.java @@ -1,14 +1,14 @@ package com.gxwebsoft.shop.controller; -import com.gxwebsoft.common.core.annotation.OperationLog; -import com.gxwebsoft.common.core.web.ApiResult; import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.common.core.web.BatchParam; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.User; +import com.gxwebsoft.shop.service.ShopUserService; import com.gxwebsoft.shop.entity.ShopUser; import com.gxwebsoft.shop.param.ShopUserParam; -import com.gxwebsoft.shop.service.ShopUserService; +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 io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; @@ -21,7 +21,7 @@ import java.util.List; * 用户记录表控制器 * * @author 科技小王子 - * @since 2025-10-03 13:41:09 + * @since 2026-02-10 00:37:07 */ @Tag(name = "用户记录表管理") @RestController @@ -46,11 +46,12 @@ public class ShopUserController extends BaseController { return success(shopUserService.listRel(param)); } - @Operation(summary = "根据userId查询用户记录表") - @GetMapping("/{userId}") - public ApiResult get(@PathVariable("userId") Integer userId) { + @PreAuthorize("hasAuthority('shop:shopUser:list')") + @Operation(summary = "根据id查询用户记录表") + @GetMapping("/{id}") + public ApiResult get(@PathVariable("id") Integer id) { // 使用关联查询 - return success(shopUserService.getByIdRel(userId)); + return success(shopUserService.getByIdRel(id)); } @PreAuthorize("hasAuthority('shop:shopUser:save')") @@ -59,10 +60,10 @@ public class ShopUserController extends BaseController { @PostMapping() public ApiResult save(@RequestBody ShopUser shopUser) { // 记录当前登录用户id - User loginUser = getLoginUser(); - if (loginUser != null) { - shopUser.setUserId(loginUser.getUserId()); - } + // User loginUser = getLoginUser(); + // if (loginUser != null) { + // shopUser.setUserId(loginUser.getUserId()); + // } if (shopUserService.save(shopUser)) { return success("添加成功"); } diff --git a/src/main/java/com/gxwebsoft/shop/controller/ShopWarehouseController.java b/src/main/java/com/gxwebsoft/shop/controller/ShopWarehouseController.java deleted file mode 100644 index 727d51d..0000000 --- a/src/main/java/com/gxwebsoft/shop/controller/ShopWarehouseController.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.gxwebsoft.shop.controller; - -import com.gxwebsoft.common.core.web.BaseController; -import com.gxwebsoft.shop.service.ShopWarehouseService; -import com.gxwebsoft.shop.entity.ShopWarehouse; -import com.gxwebsoft.shop.param.ShopWarehouseParam; -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 io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 仓库控制器 - * - * @author 科技小王子 - * @since 2026-01-30 17:46:48 - */ -@Tag(name = "仓库管理") -@RestController -@RequestMapping("/api/shop/shop-warehouse") -public class ShopWarehouseController extends BaseController { - @Resource - private ShopWarehouseService shopWarehouseService; - - @Operation(summary = "分页查询仓库") - @GetMapping("/page") - public ApiResult> page(ShopWarehouseParam param) { - // 使用关联查询 - return success(shopWarehouseService.pageRel(param)); - } - - @Operation(summary = "查询全部仓库") - @GetMapping() - public ApiResult> list(ShopWarehouseParam param) { - // 使用关联查询 - return success(shopWarehouseService.listRel(param)); - } - - @Operation(summary = "根据id查询仓库") - @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { - // 使用关联查询 - return success(shopWarehouseService.getByIdRel(id)); - } - - @PreAuthorize("hasAuthority('shop:shopWarehouse:save')") - @OperationLog - @Operation(summary = "添加仓库") - @PostMapping() - public ApiResult save(@RequestBody ShopWarehouse shopWarehouse) { - // 记录当前登录用户id - // User loginUser = getLoginUser(); - // if (loginUser != null) { - // shopWarehouse.setUserId(loginUser.getUserId()); - // } - if (shopWarehouseService.save(shopWarehouse)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('shop:shopWarehouse:update')") - @OperationLog - @Operation(summary = "修改仓库") - @PutMapping() - public ApiResult update(@RequestBody ShopWarehouse shopWarehouse) { - if (shopWarehouseService.updateById(shopWarehouse)) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('shop:shopWarehouse:remove')") - @OperationLog - @Operation(summary = "删除仓库") - @DeleteMapping("/{id}") - public ApiResult remove(@PathVariable("id") Integer id) { - if (shopWarehouseService.removeById(id)) { - return success("删除成功"); - } - return fail("删除失败"); - } - - @PreAuthorize("hasAuthority('shop:shopWarehouse:save')") - @OperationLog - @Operation(summary = "批量添加仓库") - @PostMapping("/batch") - public ApiResult saveBatch(@RequestBody List list) { - if (shopWarehouseService.saveBatch(list)) { - return success("添加成功"); - } - return fail("添加失败"); - } - - @PreAuthorize("hasAuthority('shop:shopWarehouse:update')") - @OperationLog - @Operation(summary = "批量修改仓库") - @PutMapping("/batch") - public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(shopWarehouseService, "id")) { - return success("修改成功"); - } - return fail("修改失败"); - } - - @PreAuthorize("hasAuthority('shop:shopWarehouse:remove')") - @OperationLog - @Operation(summary = "批量删除仓库") - @DeleteMapping("/batch") - public ApiResult removeBatch(@RequestBody List ids) { - if (shopWarehouseService.removeByIds(ids)) { - return success("删除成功"); - } - return fail("删除失败"); - } - -} diff --git a/src/main/java/com/gxwebsoft/shop/entity/ShopDealerCapital.java b/src/main/java/com/gxwebsoft/shop/entity/ShopDealerCapital.java index 11707ba..0dadc24 100644 --- a/src/main/java/com/gxwebsoft/shop/entity/ShopDealerCapital.java +++ b/src/main/java/com/gxwebsoft/shop/entity/ShopDealerCapital.java @@ -37,7 +37,11 @@ public class ShopDealerCapital implements Serializable { @Schema(description = "订单编号") private String orderNo; - @Schema(description = "资金流动类型 (10佣金收入 20提现支出 30转账支出 40转账收入)") + @Schema(description = "订单状态") + @TableField(exist = false) + private Integer orderStatus; + + @Schema(description = "资金流动类型 (10佣金收入 20提现支出 30转账支出 40转账收入 50佣金解冻 60配送奖励)") private Integer flowType; @Schema(description = "金额") diff --git a/src/main/java/com/gxwebsoft/shop/entity/ShopDealerOrder.java b/src/main/java/com/gxwebsoft/shop/entity/ShopDealerOrder.java index e7a8a77..43bbff8 100644 --- a/src/main/java/com/gxwebsoft/shop/entity/ShopDealerOrder.java +++ b/src/main/java/com/gxwebsoft/shop/entity/ShopDealerOrder.java @@ -1,18 +1,19 @@ package com.gxwebsoft.shop.entity; +import java.math.BigDecimal; + import cn.afterturn.easypoi.excel.annotation.Excel; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; import com.fasterxml.jackson.annotation.JsonFormat; +import java.io.Serializable; + import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDateTime; - /** * 分销商订单记录表 * @@ -38,6 +39,10 @@ public class ShopDealerOrder implements Serializable { @Excel(name = "订单编号") private String orderNo; + @Excel(name = "订单状态") + @TableField(exist = false) + private Integer orderStatus; + @Schema(description = "买家用户昵称") @TableField(exist = false) private String nickname; diff --git a/src/main/java/com/gxwebsoft/shop/entity/ShopGoods.java b/src/main/java/com/gxwebsoft/shop/entity/ShopGoods.java index 9d3f303..7d31385 100644 --- a/src/main/java/com/gxwebsoft/shop/entity/ShopGoods.java +++ b/src/main/java/com/gxwebsoft/shop/entity/ShopGoods.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonFormat; import java.io.Serializable; import io.swagger.v3.oas.annotations.media.Schema; @@ -100,7 +101,11 @@ public class ShopGoods implements Serializable { @Schema(description = "分红(二级)") private BigDecimal secondDividend; + @Schema(description = "配送奖金") + private BigDecimal deliveryMoney; + @Schema(description = "库存计算方式(10下单减库存 20付款减库存)") + @JsonAlias({"cdeductStockType"}) private Integer deductStockType; @Schema(description = "交付方式(0不启用)") diff --git a/src/main/java/com/gxwebsoft/shop/entity/ShopStore.java b/src/main/java/com/gxwebsoft/shop/entity/ShopStore.java index 5c42c0b..c0fd540 100644 --- a/src/main/java/com/gxwebsoft/shop/entity/ShopStore.java +++ b/src/main/java/com/gxwebsoft/shop/entity/ShopStore.java @@ -1,6 +1,7 @@ package com.gxwebsoft.shop.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import java.io.Serializable; @@ -64,6 +65,13 @@ public class ShopStore implements Serializable { @Schema(description = "轮廓") private String points; + @Schema(description = "仓库ID") + private Integer warehouseId; + + @Schema(description = "仓库名称") + @TableField(exist = false) + private String warehouseName; + @Schema(description = "用户ID") private Integer userId; diff --git a/src/main/java/com/gxwebsoft/shop/entity/ShopStoreRider.java b/src/main/java/com/gxwebsoft/shop/entity/ShopStoreRider.java index b0821a6..48e1df4 100644 --- a/src/main/java/com/gxwebsoft/shop/entity/ShopStoreRider.java +++ b/src/main/java/com/gxwebsoft/shop/entity/ShopStoreRider.java @@ -55,6 +55,12 @@ public class ShopStoreRider implements Serializable { @Schema(description = "接单状态:0休息/下线;1在线;2忙碌") private Integer workStatus; + @Schema(description = "经度") + private String longitude; + + @Schema(description = "纬度") + private String latitude; + @Schema(description = "是否开启自动派单:1是;0否") private Integer autoDispatchEnabled; diff --git a/src/main/java/com/gxwebsoft/shop/entity/ShopUser.java b/src/main/java/com/gxwebsoft/shop/entity/ShopUser.java index f540f64..cd90cb4 100644 --- a/src/main/java/com/gxwebsoft/shop/entity/ShopUser.java +++ b/src/main/java/com/gxwebsoft/shop/entity/ShopUser.java @@ -1,37 +1,34 @@ package com.gxwebsoft.shop.entity; +import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.IdType; +import java.time.LocalDate; import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; +import com.fasterxml.jackson.annotation.JsonFormat; /** * 用户记录表 * * @author 科技小王子 - * @since 2025-10-03 13:41:09 + * @since 2026-02-10 00:37:07 */ @Data @EqualsAndHashCode(callSuper = false) -@Schema(description = "用户记录表") +@Schema(name = "ShopUser对象", description = "用户记录表") public class ShopUser implements Serializable { private static final long serialVersionUID = 1L; - @Schema(description = "id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - @Schema(description = "用户id") + @TableId(value = "user_id", type = IdType.AUTO) private Integer userId; - @Schema(description = "用户类型 0个人用户 1企业用户 2其他") + @Schema(description = "用户类型 0普通用户 1企业用户 2特殊用户") private Integer type; @Schema(description = "账号") @@ -71,6 +68,7 @@ public class ShopUser implements Serializable { private String idCard; @Schema(description = "出生日期") + @JsonFormat(pattern = "yyyy-MM-dd") private LocalDate birthday; @Schema(description = "所在国家") @@ -143,7 +141,7 @@ public class ShopUser implements Serializable { private Integer age; @Schema(description = "是否线下会员") - private Boolean offline; + private Integer offline; @Schema(description = "关注数") private Integer followers; @@ -178,6 +176,9 @@ public class ShopUser implements Serializable { @Schema(description = "是否管理员") private Boolean isAdmin; + @Schema(description = "默认账号(适用于不同租户存在相同的手机号码)") + private Boolean isDefault; + @Schema(description = "是否企业管理员") private Boolean isOrganizationAdmin; @@ -209,6 +210,7 @@ public class ShopUser implements Serializable { private Integer expireTime; @Schema(description = "最后结算时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime settlementTime; @Schema(description = "资质") @@ -246,9 +248,11 @@ public class ShopUser implements Serializable { private Integer tenantId; @Schema(description = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTime; @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime updateTime; } diff --git a/src/main/java/com/gxwebsoft/shop/entity/ShopUserAddress.java b/src/main/java/com/gxwebsoft/shop/entity/ShopUserAddress.java index a033356..490e45b 100644 --- a/src/main/java/com/gxwebsoft/shop/entity/ShopUserAddress.java +++ b/src/main/java/com/gxwebsoft/shop/entity/ShopUserAddress.java @@ -77,4 +77,8 @@ public class ShopUserAddress implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTime; + @Schema(description = "修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + } diff --git a/src/main/java/com/gxwebsoft/shop/entity/ShopWarehouse.java b/src/main/java/com/gxwebsoft/shop/entity/ShopWarehouse.java deleted file mode 100644 index 55f83e8..0000000 --- a/src/main/java/com/gxwebsoft/shop/entity/ShopWarehouse.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.gxwebsoft.shop.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import java.io.Serializable; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import com.fasterxml.jackson.annotation.JsonFormat; - -/** - * 仓库 - * - * @author 科技小王子 - * @since 2026-01-30 17:46:47 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Schema(name = "ShopWarehouse对象", description = "仓库") -public class ShopWarehouse implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - - @Schema(description = "仓库名称") - private String name; - - @Schema(description = "唯一标识") - private String code; - - @Schema(description = "类型 中心仓,区域仓,门店仓") - private String type; - - @Schema(description = "仓库地址") - private String address; - - @Schema(description = "真实姓名") - private String realName; - - @Schema(description = "联系电话") - private String phone; - - @Schema(description = "所在省份") - private String province; - - @Schema(description = "所在城市") - private String city; - - @Schema(description = "所在辖区") - private String region; - - @Schema(description = "经纬度") - private String lngAndLat; - - @Schema(description = "用户ID") - private Integer userId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序号") - private Integer sortNumber; - - @Schema(description = "是否删除") - private Integer isDelete; - - @Schema(description = "租户id") - private Integer tenantId; - - @Schema(description = "创建时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime createTime; - - @Schema(description = "修改时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime updateTime; - -} diff --git a/src/main/java/com/gxwebsoft/shop/enums/OrderStatusEnum.class b/src/main/java/com/gxwebsoft/shop/enums/OrderStatusEnum.class new file mode 100644 index 0000000..48a4a6c Binary files /dev/null and b/src/main/java/com/gxwebsoft/shop/enums/OrderStatusEnum.class differ diff --git a/src/main/java/com/gxwebsoft/shop/mapper/ShopWarehouseMapper.java b/src/main/java/com/gxwebsoft/shop/mapper/ShopWarehouseMapper.java deleted file mode 100644 index 05c72b1..0000000 --- a/src/main/java/com/gxwebsoft/shop/mapper/ShopWarehouseMapper.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.gxwebsoft.shop.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.gxwebsoft.shop.entity.ShopWarehouse; -import com.gxwebsoft.shop.param.ShopWarehouseParam; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 仓库Mapper - * - * @author 科技小王子 - * @since 2026-01-30 17:46:47 - */ -public interface ShopWarehouseMapper extends BaseMapper { - - /** - * 分页查询 - * - * @param page 分页对象 - * @param param 查询参数 - * @return List - */ - List selectPageRel(@Param("page") IPage page, - @Param("param") ShopWarehouseParam param); - - /** - * 查询全部 - * - * @param param 查询参数 - * @return List - */ - List selectListRel(@Param("param") ShopWarehouseParam param); - -} diff --git a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerCapitalMapper.xml b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerCapitalMapper.xml index 98e03f8..d1fa10e 100644 --- a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerCapitalMapper.xml +++ b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerCapitalMapper.xml @@ -4,11 +4,12 @@ - SELECT a.*, b.order_no, b.month, c.nickname AS nickName, d.nickname AS toNickName + SELECT a.*, b.order_no, b.month, c.nickname AS nickName, d.nickname AS toNickName, e.order_status AS orderStatus FROM shop_dealer_capital a LEFT JOIN shop_dealer_order b ON a.order_no = b.order_no LEFT JOIN gxwebsoft_core.sys_user c ON a.user_id = c.user_id and c.deleted = 0 LEFT JOIN gxwebsoft_core.sys_user d ON a.to_user_id = d.user_id and d.deleted = 0 + LEFT JOIN shop_order e ON a.order_no = e.order_no AND a.id = #{param.id} diff --git a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerOrderMapper.xml b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerOrderMapper.xml index 7b4a182..b49c42d 100644 --- a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerOrderMapper.xml +++ b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerOrderMapper.xml @@ -4,7 +4,7 @@ - SELECT a.*, b.nickname, c.nickname AS firstNickname, d.nickname AS secondNickname, e.nickname AS thirdNickname, f.rate, f.price, g.nickname AS firstDividendUserName, h.nickname AS secondDividendUserName + SELECT a.*, b.nickname, c.nickname AS firstNickname, d.nickname AS secondNickname, e.nickname AS thirdNickname, f.rate, f.price, g.nickname AS firstDividendUserName, h.nickname AS secondDividendUserName, o.order_status AS orderStatus FROM shop_dealer_order a LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id LEFT JOIN gxwebsoft_core.sys_user c ON a.first_user_id = c.user_id @@ -12,6 +12,7 @@ LEFT JOIN gxwebsoft_core.sys_user e ON a.third_user_id = e.user_id LEFT JOIN gxwebsoft_core.sys_user g ON a.first_dividend_user = g.user_id LEFT JOIN gxwebsoft_core.sys_user h ON a.second_dividend_user = h.user_id + LEFT JOIN shop_order o ON a.order_no = o.order_no LEFT JOIN shop_dealer_user f ON a.user_id = f.user_id diff --git a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerWithdrawMapper.xml b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerWithdrawMapper.xml index 767ee27..180f9d4 100644 --- a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerWithdrawMapper.xml +++ b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopDealerWithdrawMapper.xml @@ -4,7 +4,13 @@ - SELECT a.*, b.nickname, b.phone AS phone, b.avatar,b.openid,b.office_openid, c.real_name as realName + SELECT a.*, + b.nickname, + b.phone AS phone, + b.avatar, + b.openid AS openId, + b.office_openid AS officeOpenid, + c.real_name AS realName FROM shop_dealer_withdraw a LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id LEFT JOIN gxwebsoft_core.sys_user_verify c ON a.user_id = c.user_id AND c.status = 1 diff --git a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopStoreMapper.xml b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopStoreMapper.xml index 9fe6da1..de6074b 100644 --- a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopStoreMapper.xml +++ b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopStoreMapper.xml @@ -56,7 +56,8 @@ AND a.create_time <= #{param.createTimeEnd} - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') + AND (a.name LIKE CONCAT('%', #{param.keywords}, '%') + OR a.phone LIKE CONCAT('%', #{param.keywords}, '%') ) diff --git a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopWarehouseMapper.xml b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopWarehouseMapper.xml deleted file mode 100644 index 121edaf..0000000 --- a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopWarehouseMapper.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - SELECT a.* - FROM shop_store_warehouse a - - - AND a.id = #{param.id} - - - AND a.name LIKE CONCAT('%', #{param.name}, '%') - - - AND a.code LIKE CONCAT('%', #{param.code}, '%') - - - AND a.type LIKE CONCAT('%', #{param.type}, '%') - - - AND a.address LIKE CONCAT('%', #{param.address}, '%') - - - AND a.real_name LIKE CONCAT('%', #{param.realName}, '%') - - - AND a.phone LIKE CONCAT('%', #{param.phone}, '%') - - - AND a.province LIKE CONCAT('%', #{param.province}, '%') - - - AND a.city LIKE CONCAT('%', #{param.city}, '%') - - - AND a.region LIKE CONCAT('%', #{param.region}, '%') - - - AND a.lng_and_lat LIKE CONCAT('%', #{param.lngAndLat}, '%') - - - AND a.user_id = #{param.userId} - - - AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - - AND a.sort_number = #{param.sortNumber} - - - AND a.is_delete = #{param.isDelete} - - - 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/shop/param/ShopWarehouseParam.java b/src/main/java/com/gxwebsoft/shop/param/ShopWarehouseParam.java deleted file mode 100644 index af4d819..0000000 --- a/src/main/java/com/gxwebsoft/shop/param/ShopWarehouseParam.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.gxwebsoft.shop.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.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 仓库查询参数 - * - * @author 科技小王子 - * @since 2026-01-30 17:46:47 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Schema(name = "ShopWarehouseParam对象", description = "仓库查询参数") -public class ShopWarehouseParam extends BaseParam { - private static final long serialVersionUID = 1L; - - @Schema(description = "自增ID") - @QueryField(type = QueryType.EQ) - private Integer id; - - @Schema(description = "仓库名称") - private String name; - - @Schema(description = "唯一标识") - private String code; - - @Schema(description = "类型 中心仓,区域仓,门店仓") - private String type; - - @Schema(description = "仓库地址") - private String address; - - @Schema(description = "真实姓名") - private String realName; - - @Schema(description = "联系电话") - private String phone; - - @Schema(description = "所在省份") - @QueryField(type = QueryType.EQ) - private String province; - - @Schema(description = "所在城市") - @QueryField(type = QueryType.EQ) - private String city; - - @Schema(description = "所在辖区") - @QueryField(type = QueryType.EQ) - private String region; - - @Schema(description = "经纬度") - private String lngAndLat; - - @Schema(description = "用户ID") - @QueryField(type = QueryType.EQ) - private Integer userId; - - @Schema(description = "备注") - private String comments; - - @Schema(description = "排序号") - @QueryField(type = QueryType.EQ) - private Integer sortNumber; - - @Schema(description = "是否删除") - @QueryField(type = QueryType.EQ) - private Integer isDelete; - -} diff --git a/src/main/java/com/gxwebsoft/shop/service/OrderBusinessService.java b/src/main/java/com/gxwebsoft/shop/service/OrderBusinessService.java index 81f772f..ed8b43c 100644 --- a/src/main/java/com/gxwebsoft/shop/service/OrderBusinessService.java +++ b/src/main/java/com/gxwebsoft/shop/service/OrderBusinessService.java @@ -7,6 +7,7 @@ import com.gxwebsoft.common.system.entity.User; import com.gxwebsoft.shop.config.OrderConfigProperties; import com.gxwebsoft.shop.dto.OrderCreateRequest; import com.gxwebsoft.shop.entity.*; +import com.gxwebsoft.shop.service.ShopStoreFenceService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -16,6 +17,7 @@ import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.math.BigDecimal; import java.math.RoundingMode; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -30,6 +32,8 @@ import java.util.Map; @Slf4j @Service public class OrderBusinessService { + private static final int DEDUCT_STOCK_TYPE_ORDER = 10; // 下单减库存 + private static final int DEDUCT_STOCK_TYPE_PAY = 20; // 付款减库存 @Resource private ShopOrderService shopOrderService; @@ -50,6 +54,8 @@ public class OrderBusinessService { private ShopUserAddressService shopUserAddressService; @Resource private ShopUserCouponService shopUserCouponService; + @Resource + private ShopStoreFenceService shopStoreFenceService; /** * 创建订单 @@ -70,6 +76,9 @@ public class OrderBusinessService { // 3. 处理收货地址信息 processDeliveryAddress(shopOrder, request, loginUser); + // 3.1 下单时校验配送范围(电子围栏) + validateDeliveryFenceIfNeeded(shopOrder, loginUser); + // 4. 应用业务规则 applyBusinessRules(shopOrder, loginUser); @@ -244,6 +253,16 @@ public class OrderBusinessService { // 复制请求参数到订单对象 BeanUtils.copyProperties(request, shopOrder); + // 下单时间 & 订单过期时间:默认下单后10分钟过期(用于发起支付等场景校验) + LocalDateTime now = LocalDateTime.now(); + if (shopOrder.getCreateTime() == null) { + shopOrder.setCreateTime(now); + } + if (shopOrder.getUpdateTime() == null) { + shopOrder.setUpdateTime(now); + } + shopOrder.setExpirationTime(shopOrder.getCreateTime().plusMinutes(10)); + // 确保租户ID正确设置(关键字段,影响微信支付证书路径) shopOrder.setTenantId(loginUser.getTenantId()); @@ -391,13 +410,9 @@ public class OrderBusinessService { */ private void processDeliveryAddress(ShopOrder shopOrder, OrderCreateRequest request, User loginUser) { try { - // 1. 如果前端已经传入了完整的收货地址信息,直接使用 - if (isAddressInfoComplete(request)) { - log.info("使用前端传入的收货地址信息,用户ID:{}", loginUser.getUserId()); - return; - } + // 前端可能会传 addressLat/addressLng,但不可信;这里一律以地址表中的坐标为准(需 addressId)。 - // 2. 如果指定了地址ID,获取该地址信息 + // 1. 如果指定了地址ID,优先使用该地址 if (request.getAddressId() != null) { ShopUserAddress userAddress = shopUserAddressService.getById(request.getAddressId()); if (userAddress != null && userAddress.getUserId().equals(loginUser.getUserId())) { @@ -409,6 +424,13 @@ public class OrderBusinessService { request.getAddressId(), loginUser.getUserId()); } + // 2. 若前端已传完整地址快照但没传 addressId:保持快照,不在这里“猜测”绑定地址。 + // 围栏校验会根据是否配置围栏决定是否强制要求 addressId。 + if (isAddressInfoComplete(request)) { + log.warn("前端传入了收货地址快照字段,但未传 addressId,用户ID:{}", loginUser.getUserId()); + return; + } + // 3. 获取用户默认收货地址 ShopUserAddress defaultAddress = shopUserAddressService.getDefaultAddress(loginUser.getUserId()); if (defaultAddress != null) { @@ -471,12 +493,12 @@ public class OrderBusinessService { request.setRealName(userAddress.getName()); } - // 复制经纬度信息 - if (request.getAddressLat() == null && userAddress.getLat() != null) { + // 复制经纬度信息(不信任前端传入坐标,一律以地址表为准) + if (userAddress.getLat() != null && !userAddress.getLat().trim().isEmpty()) { shopOrder.setAddressLat(userAddress.getLat()); request.setAddressLat(userAddress.getLat()); } - if (request.getAddressLng() == null && userAddress.getLng() != null) { + if (userAddress.getLng() != null && !userAddress.getLng().trim().isEmpty()) { shopOrder.setAddressLng(userAddress.getLng()); request.setAddressLng(userAddress.getLng()); } @@ -485,6 +507,61 @@ public class OrderBusinessService { userAddress.getId(), userAddress.getName(), shopOrder.getAddress()); } + /** + * 下单时校验配送范围(电子围栏)。 + *

+ * 规则: + * - 仅对需要配送到地址的订单做校验;自提/无需物流跳过; + * - 不信任前端传经纬度:用 addressId 反查地址表中的 lat/lng; + * - 无围栏配置默认放行;围栏配置异常则拒单(避免误送)。 + */ + private void validateDeliveryFenceIfNeeded(ShopOrder shopOrder, User loginUser) { + if (shopOrder == null || loginUser == null) { + return; + } + + // 自提/无需物流:不校验配送围栏 + if (shopOrder.getSelfTakeMerchantId() != null && shopOrder.getSelfTakeMerchantId() > 0) { + return; + } + if (shopOrder.getDeliveryType() != null && shopOrder.getDeliveryType().equals(1)) { + return; + } + + // 若已配置围栏,则必须有 addressId 才能从地址表取坐标进行校验 + if (shopOrder.getAddressId() == null) { + if (shopStoreFenceService.hasEnabledFences(shopOrder.getTenantId())) { + throw new BusinessException("请先选择收货地址"); + } + return; + } + + ShopUserAddress address = shopUserAddressService.getById(shopOrder.getAddressId()); + if (address == null || address.getUserId() == null || !address.getUserId().equals(loginUser.getUserId())) { + throw new BusinessException("收货地址不存在"); + } + if (address.getTenantId() != null && shopOrder.getTenantId() != null && !address.getTenantId().equals(shopOrder.getTenantId())) { + throw new BusinessException("收货地址不存在"); + } + + String latStr = address.getLat(); + String lngStr = address.getLng(); + if (latStr == null || latStr.trim().isEmpty() || lngStr == null || lngStr.trim().isEmpty()) { + throw new BusinessException("收货地址坐标缺失,请重新选择收货地址"); + } + double lat; + double lng; + try { + lat = Double.parseDouble(latStr.trim()); + lng = Double.parseDouble(lngStr.trim()); + } catch (Exception e) { + throw new BusinessException("收货地址坐标异常,请重新选择收货地址"); + } + + // 只做校验;具体围栏列表/points 异常处理由围栏服务统一处理 + shopStoreFenceService.validatePointInEnabledFences(shopOrder.getTenantId(), lng, lat); + } + /** * 应用业务规则 */ @@ -638,6 +715,15 @@ public class OrderBusinessService { */ private void deductStock(OrderCreateRequest request) { for (OrderCreateRequest.OrderGoodsItem item : request.getGoodsItems()) { + // 付款减库存的商品:创建订单时不扣库存 + ShopGoods goodsForType = shopGoodsService.getById(item.getGoodsId()); + Integer deductStockType = goodsForType != null ? goodsForType.getDeductStockType() : null; + if (deductStockType != null && deductStockType == DEDUCT_STOCK_TYPE_PAY) { + log.debug("跳过下单扣库存(付款减库存) - goodsId={}, skuId={}, qty={}", + item.getGoodsId(), item.getSkuId(), item.getQuantity()); + continue; + } + if (item.getSkuId() != null) { // 多规格商品,扣减SKU库存 ShopGoodsSku sku = shopGoodsSkuService.getById(item.getSkuId()); diff --git a/src/main/java/com/gxwebsoft/shop/service/ShopDealerCommissionRollbackService.java b/src/main/java/com/gxwebsoft/shop/service/ShopDealerCommissionRollbackService.java new file mode 100644 index 0000000..e0fca92 --- /dev/null +++ b/src/main/java/com/gxwebsoft/shop/service/ShopDealerCommissionRollbackService.java @@ -0,0 +1,21 @@ +package com.gxwebsoft.shop.service; + +import com.gxwebsoft.shop.entity.ShopOrder; + +import java.math.BigDecimal; + +/** + * 分销/分红/分润:订单退款回退 + */ +public interface ShopDealerCommissionRollbackService { + + /** + * 订单退款成功后,按订单号回退已入账(冻结/可提现)的分销佣金/分红/分润等金额。 + * + * @param order 订单(必须包含 tenantId、orderNo) + * @param refundAmount 退款金额(允许为空;为空则按全额退款处理) + * @return true=执行成功或无可回退数据;false=执行失败 + */ + boolean rollbackOnOrderRefund(ShopOrder order, BigDecimal refundAmount); +} + diff --git a/src/main/java/com/gxwebsoft/shop/service/ShopOrderGltRepairService.java b/src/main/java/com/gxwebsoft/shop/service/ShopOrderGltRepairService.java new file mode 100644 index 0000000..a3951c2 --- /dev/null +++ b/src/main/java/com/gxwebsoft/shop/service/ShopOrderGltRepairService.java @@ -0,0 +1,109 @@ +package com.gxwebsoft.shop.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.gxwebsoft.glt.service.GltTicketRevokeService; +import com.gxwebsoft.shop.entity.ShopOrder; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * 历史订单修复:对已退款订单补偿撤销水票相关数据。 + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class ShopOrderGltRepairService { + + /** shop_order.order_status:退款成功 */ + private static final int ORDER_STATUS_REFUND_SUCCESS = 6; + + private final ShopOrderService shopOrderService; + private final GltTicketRevokeService gltTicketRevokeService; + + public RepairResult revokeTicketsForRefundedOrders(Integer tenantId, + List orderIds, + List orderNos, + LocalDateTime refundTimeStart, + LocalDateTime refundTimeEnd, + Integer batchSize, + boolean dryRun) { + if (tenantId == null) { + throw new IllegalArgumentException("tenantId不能为空"); + } + + int limit = batchSize == null ? 200 : Math.max(1, Math.min(batchSize, 2000)); + List orders = new ArrayList<>(); + + // 1) 精准修复:指定 orderIds / orderNos + if (orderIds != null && !orderIds.isEmpty()) { + orders = shopOrderService.list(new LambdaQueryWrapper() + .eq(ShopOrder::getTenantId, tenantId) + .eq(ShopOrder::getDeleted, 0) + .eq(ShopOrder::getOrderStatus, ORDER_STATUS_REFUND_SUCCESS) + .in(ShopOrder::getOrderId, orderIds) + .last("limit " + limit)); + } else if (orderNos != null && !orderNos.isEmpty()) { + orders = shopOrderService.list(new LambdaQueryWrapper() + .eq(ShopOrder::getTenantId, tenantId) + .eq(ShopOrder::getDeleted, 0) + .eq(ShopOrder::getOrderStatus, ORDER_STATUS_REFUND_SUCCESS) + .in(ShopOrder::getOrderNo, orderNos) + .last("limit " + limit)); + } else { + // 2) 扫描修复:按 refundTime 窗口分页处理 + LambdaQueryWrapper qw = new LambdaQueryWrapper() + .eq(ShopOrder::getTenantId, tenantId) + .eq(ShopOrder::getDeleted, 0) + .eq(ShopOrder::getOrderStatus, ORDER_STATUS_REFUND_SUCCESS); + if (refundTimeStart != null) { + qw.ge(ShopOrder::getRefundTime, refundTimeStart); + } + if (refundTimeEnd != null) { + qw.le(ShopOrder::getRefundTime, refundTimeEnd); + } + orders = shopOrderService.list(qw.orderByAsc(ShopOrder::getRefundTime).orderByAsc(ShopOrder::getOrderId).last("limit " + limit)); + } + + int scanned = orders == null ? 0 : orders.size(); + int revokedTickets = 0; + int revokedOrders = 0; + List processedOrderIds = new ArrayList<>(); + + if (orders != null) { + for (ShopOrder o : orders) { + if (o == null || o.getOrderId() == null) { + continue; + } + processedOrderIds.add(o.getOrderId()); + if (dryRun) { + continue; + } + int revoked = gltTicketRevokeService.revokeByShopOrder( + tenantId, + o.getOrderId(), + o.getOrderNo(), + "历史退款订单补偿撤销水票" + ); + if (revoked > 0) { + revokedTickets += revoked; + revokedOrders++; + } + } + } + + return new RepairResult(scanned, revokedOrders, revokedTickets, processedOrderIds, dryRun); + } + + public record RepairResult(int scannedOrders, + int ordersWithTicketsRevoked, + int revokedTicketCount, + List processedOrderIds, + boolean dryRun) { + } +} + diff --git a/src/main/java/com/gxwebsoft/shop/service/ShopUserService.java b/src/main/java/com/gxwebsoft/shop/service/ShopUserService.java index 52d8fba..03335b3 100644 --- a/src/main/java/com/gxwebsoft/shop/service/ShopUserService.java +++ b/src/main/java/com/gxwebsoft/shop/service/ShopUserService.java @@ -11,7 +11,7 @@ import java.util.List; * 用户记录表Service * * @author 科技小王子 - * @since 2025-10-03 13:41:09 + * @since 2026-02-10 00:37:07 */ public interface ShopUserService extends IService { diff --git a/src/main/java/com/gxwebsoft/shop/service/ShopWarehouseService.java b/src/main/java/com/gxwebsoft/shop/service/ShopWarehouseService.java deleted file mode 100644 index f8f8c1d..0000000 --- a/src/main/java/com/gxwebsoft/shop/service/ShopWarehouseService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gxwebsoft.shop.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.shop.entity.ShopWarehouse; -import com.gxwebsoft.shop.param.ShopWarehouseParam; - -import java.util.List; - -/** - * 仓库Service - * - * @author 科技小王子 - * @since 2026-01-30 17:46:48 - */ -public interface ShopWarehouseService extends IService { - - /** - * 分页关联查询 - * - * @param param 查询参数 - * @return PageResult - */ - PageResult pageRel(ShopWarehouseParam param); - - /** - * 关联查询全部 - * - * @param param 查询参数 - * @return List - */ - List listRel(ShopWarehouseParam param); - - /** - * 根据id查询 - * - * @param id 自增ID - * @return ShopWarehouse - */ - ShopWarehouse getByIdRel(Integer id); - -} diff --git a/src/main/java/com/gxwebsoft/shop/service/impl/OrderCancelServiceImpl.java b/src/main/java/com/gxwebsoft/shop/service/impl/OrderCancelServiceImpl.java index 825afbb..f327838 100644 --- a/src/main/java/com/gxwebsoft/shop/service/impl/OrderCancelServiceImpl.java +++ b/src/main/java/com/gxwebsoft/shop/service/impl/OrderCancelServiceImpl.java @@ -1,6 +1,8 @@ package com.gxwebsoft.shop.service.impl; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.gxwebsoft.common.core.annotation.IgnoreTenant; import com.gxwebsoft.shop.entity.*; import com.gxwebsoft.shop.service.*; @@ -22,6 +24,7 @@ import java.util.List; @Slf4j @Service public class OrderCancelServiceImpl implements OrderCancelService { + private static final int DEDUCT_STOCK_TYPE_PAY = 20; // 付款减库存:下单不扣库存,因此未支付取消无需回退 @Autowired private ShopOrderService shopOrderService; @@ -44,6 +47,11 @@ public class OrderCancelServiceImpl implements OrderCancelService { try { log.info("开始取消订单,订单号:{},订单ID:{}", order.getOrderNo(), order.getOrderId()); + if (order.getOrderId() == null) { + log.warn("订单ID为空,无法取消"); + return false; + } + // 1. 检查订单状态 if (order.getPayStatus() != null && order.getPayStatus()) { log.warn("订单已支付,无法取消,订单号:{}", order.getOrderNo()); @@ -55,17 +63,31 @@ public class OrderCancelServiceImpl implements OrderCancelService { return false; } - // 2. 更新订单状态为已取消 - order.setOrderStatus(2); // 2表示已取消 - order.setCancelTime(LocalDateTime.now()); - order.setCancelReason("系统自动取消(超时未支付)"); + // 2. 更新订单状态为已取消(只更新必要字段 + 加条件,避免并发/越权导致“取消后又被改成退款中”等脏状态) + LocalDateTime now = LocalDateTime.now(); + String reason = StrUtil.isNotBlank(order.getCancelReason()) + ? order.getCancelReason() + : "系统自动取消(超时未支付)"; - boolean updateSuccess = shopOrderService.updateById(order); + boolean updateSuccess = shopOrderService.update( + new LambdaUpdateWrapper() + .eq(ShopOrder::getOrderId, order.getOrderId()) + .eq(ShopOrder::getPayStatus, false) + .eq(ShopOrder::getOrderStatus, 0) + .set(ShopOrder::getOrderStatus, 2) // 2表示已取消 + .set(ShopOrder::getCancelTime, now) + .set(ShopOrder::getCancelReason, reason) + ); if (!updateSuccess) { - log.error("更新订单状态失败,订单号:{}", order.getOrderNo()); + log.error("更新订单状态失败(可能已被支付/退款/取消),订单号:{},订单ID:{}", order.getOrderNo(), order.getOrderId()); return false; } + // 让后续库存/优惠券逻辑使用最新状态(不再依赖 updateById 回写) + order.setOrderStatus(2); + order.setCancelTime(now); + order.setCancelReason(reason); + // 3. 回退库存 boolean stockRestored = restoreOrderStock(order); if (!stockRestored) { @@ -161,6 +183,20 @@ public class OrderCancelServiceImpl implements OrderCancelService { } for (ShopOrderGoods orderGood : orderGoods) { + // 付款减库存的商品:创建订单时未扣库存,未支付取消时无需回退(避免库存被“加多”) + try { + ShopGoods goods = shopGoodsService.getById(orderGood.getGoodsId()); + if (goods != null && goods.getDeductStockType() != null && goods.getDeductStockType() == DEDUCT_STOCK_TYPE_PAY) { + log.debug("跳过未支付取消的库存回退(付款减库存) - orderId={}, goodsId={}, skuId={}, qty={}", + order.getOrderId(), orderGood.getGoodsId(), orderGood.getSkuId(), orderGood.getTotalNum()); + continue; + } + } catch (Exception e) { + // 查不到商品或查询异常时,保持原有回退逻辑,避免出现“库存无法回退”的更坏情况 + log.warn("读取商品扣库存方式失败,继续执行库存回退 - orderId={}, goodsId={}", + order.getOrderId(), orderGood.getGoodsId(), e); + } + if (orderGood.getSkuId() != null && orderGood.getSkuId() > 0) { // 多规格商品,恢复SKU库存 restoreSkuStock(orderGood); diff --git a/src/main/java/com/gxwebsoft/shop/service/impl/ShopDealerCommissionRollbackServiceImpl.java b/src/main/java/com/gxwebsoft/shop/service/impl/ShopDealerCommissionRollbackServiceImpl.java new file mode 100644 index 0000000..d43001a --- /dev/null +++ b/src/main/java/com/gxwebsoft/shop/service/impl/ShopDealerCommissionRollbackServiceImpl.java @@ -0,0 +1,189 @@ +package com.gxwebsoft.shop.service.impl; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.gxwebsoft.shop.entity.ShopDealerCapital; +import com.gxwebsoft.shop.entity.ShopDealerOrder; +import com.gxwebsoft.shop.entity.ShopDealerUser; +import com.gxwebsoft.shop.entity.ShopOrder; +import com.gxwebsoft.shop.service.ShopDealerCapitalService; +import com.gxwebsoft.shop.service.ShopDealerCommissionRollbackService; +import com.gxwebsoft.shop.service.ShopDealerOrderService; +import com.gxwebsoft.shop.service.ShopDealerUserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Slf4j +@Service +public class ShopDealerCommissionRollbackServiceImpl implements ShopDealerCommissionRollbackService { + + private static final int FLOW_TYPE_COMMISSION_INCOME = 10; + private static final int FLOW_TYPE_COMMISSION_UNFREEZE_MARKER = 50; + private static final int FLOW_TYPE_DELIVERY_REWARD = 60; + + @Resource + private ShopDealerCapitalService shopDealerCapitalService; + + @Resource + private ShopDealerUserService shopDealerUserService; + + @Resource + private ShopDealerOrderService shopDealerOrderService; + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean rollbackOnOrderRefund(ShopOrder order, BigDecimal refundAmount) { + if (order == null || order.getTenantId() == null || order.getOrderNo() == null || order.getOrderNo().isBlank()) { + return true; + } + + Integer tenantId = order.getTenantId(); + String orderNo = order.getOrderNo(); + + BigDecimal orderBaseAmount = ObjectUtil.defaultIfNull(order.getPayPrice(), order.getTotalPrice()); + BigDecimal ratio = resolveRefundRatio(orderBaseAmount, refundAmount); + + List capitals = shopDealerCapitalService.list( + new LambdaQueryWrapper() + .eq(ShopDealerCapital::getTenantId, tenantId) + .eq(ShopDealerCapital::getOrderNo, orderNo) + .in(ShopDealerCapital::getFlowType, FLOW_TYPE_COMMISSION_INCOME, FLOW_TYPE_DELIVERY_REWARD) + .isNotNull(ShopDealerCapital::getUserId) + .isNotNull(ShopDealerCapital::getMoney) + .gt(ShopDealerCapital::getMoney, BigDecimal.ZERO) + ); + + if (capitals == null || capitals.isEmpty()) { + // 仍标记分销订单失效,避免后续统计误判 + markDealerOrderInvalid(tenantId, orderNo); + return true; + } + + Map freezeDeductByUser = new HashMap<>(); + Map moneyDeductByUser = new HashMap<>(); + Map totalDeductByUser = new HashMap<>(); + + for (ShopDealerCapital cap : capitals) { + Integer dealerUserId = cap.getUserId(); + BigDecimal amount = cap.getMoney(); + if (dealerUserId == null || amount == null || amount.signum() <= 0) { + continue; + } + + BigDecimal rollbackAmount = amount.multiply(ratio).setScale(2, RoundingMode.HALF_UP); + if (rollbackAmount.signum() <= 0) { + continue; + } + + totalDeductByUser.merge(dealerUserId, rollbackAmount, BigDecimal::add); + + Integer flowType = cap.getFlowType(); + if (flowType != null && flowType == FLOW_TYPE_DELIVERY_REWARD) { + moneyDeductByUser.merge(dealerUserId, rollbackAmount, BigDecimal::add); + continue; + } + + // 佣金收入:若已解冻(有 flowType=50 marker),则从可提现扣回;否则从冻结扣回 + boolean unfrozen = hasUnfreezeMarker(tenantId, cap); + if (unfrozen) { + moneyDeductByUser.merge(dealerUserId, rollbackAmount, BigDecimal::add); + } else { + freezeDeductByUser.merge(dealerUserId, rollbackAmount, BigDecimal::add); + } + } + + LocalDateTime now = LocalDateTime.now(); + for (Map.Entry entry : totalDeductByUser.entrySet()) { + Integer dealerUserId = entry.getKey(); + BigDecimal totalDeduct = entry.getValue(); + if (dealerUserId == null || totalDeduct == null || totalDeduct.signum() <= 0) { + continue; + } + + BigDecimal freezeDeduct = freezeDeductByUser.getOrDefault(dealerUserId, BigDecimal.ZERO); + BigDecimal moneyDeduct = moneyDeductByUser.getOrDefault(dealerUserId, BigDecimal.ZERO); + + LambdaUpdateWrapper uw = new LambdaUpdateWrapper() + .eq(ShopDealerUser::getTenantId, tenantId) + .eq(ShopDealerUser::getUserId, dealerUserId) + .setSql("total_money = IFNULL(total_money,0) - " + totalDeduct.toPlainString()) + .set(ShopDealerUser::getUpdateTime, now); + + if (freezeDeduct.signum() > 0) { + uw.setSql("freeze_money = IFNULL(freeze_money,0) - " + freezeDeduct.toPlainString()); + } + if (moneyDeduct.signum() > 0) { + uw.setSql("money = IFNULL(money,0) - " + moneyDeduct.toPlainString()); + } + + boolean updated = shopDealerUserService.update(uw); + if (!updated) { + log.warn("订单退款扣回分销金额失败:未找到分销账户 - tenantId={}, orderNo={}, dealerUserId={}, totalDeduct={}, freezeDeduct={}, moneyDeduct={}", + tenantId, orderNo, dealerUserId, totalDeduct, freezeDeduct, moneyDeduct); + } + } + + markDealerOrderInvalid(tenantId, orderNo); + return true; + } + + private boolean hasUnfreezeMarker(Integer tenantId, ShopDealerCapital cap) { + if (tenantId == null || cap == null || cap.getId() == null || cap.getUserId() == null || cap.getOrderNo() == null) { + return false; + } + String markerComment = buildUnfreezeMarkerComment(cap.getId()); + return shopDealerCapitalService.count( + new LambdaQueryWrapper() + .eq(ShopDealerCapital::getTenantId, tenantId) + .eq(ShopDealerCapital::getFlowType, FLOW_TYPE_COMMISSION_UNFREEZE_MARKER) + .eq(ShopDealerCapital::getUserId, cap.getUserId()) + .eq(ShopDealerCapital::getOrderNo, cap.getOrderNo()) + .eq(ShopDealerCapital::getComments, markerComment) + ) > 0; + } + + private String buildUnfreezeMarkerComment(Integer capitalId) { + return "佣金解冻(capitalId=" + capitalId + ")"; + } + + private BigDecimal resolveRefundRatio(BigDecimal orderBaseAmount, BigDecimal refundAmount) { + if (refundAmount == null || refundAmount.signum() <= 0) { + return BigDecimal.ONE; + } + if (orderBaseAmount == null || orderBaseAmount.signum() <= 0) { + return BigDecimal.ONE; + } + if (refundAmount.compareTo(orderBaseAmount) >= 0) { + return BigDecimal.ONE; + } + return refundAmount.divide(orderBaseAmount, 10, RoundingMode.HALF_UP); + } + + private void markDealerOrderInvalid(Integer tenantId, String orderNo) { + if (tenantId == null || orderNo == null || orderNo.isBlank()) { + return; + } + try { + shopDealerOrderService.update( + new LambdaUpdateWrapper() + .eq(ShopDealerOrder::getTenantId, tenantId) + .eq(ShopDealerOrder::getOrderNo, orderNo) + .set(ShopDealerOrder::getIsInvalid, 1) + .set(ShopDealerOrder::getUpdateTime, LocalDateTime.now()) + ); + } catch (Exception e) { + log.warn("订单退款标记分销订单失效失败 - tenantId={}, orderNo={}", tenantId, orderNo, e); + } + } +} + diff --git a/src/main/java/com/gxwebsoft/shop/service/impl/ShopOrderDeliveryServiceImpl.java b/src/main/java/com/gxwebsoft/shop/service/impl/ShopOrderDeliveryServiceImpl.java index 41cd996..2b404df 100644 --- a/src/main/java/com/gxwebsoft/shop/service/impl/ShopOrderDeliveryServiceImpl.java +++ b/src/main/java/com/gxwebsoft/shop/service/impl/ShopOrderDeliveryServiceImpl.java @@ -12,6 +12,7 @@ import com.gxwebsoft.common.core.web.PageParam; import com.gxwebsoft.common.core.web.PageResult; import com.kuaidi100.sdk.pojo.HttpResult; import com.kuaidi100.sdk.request.BOrderReq; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -27,6 +28,7 @@ import java.util.Map; * @since 2025-01-11 10:45:12 */ @Service +@Slf4j public class ShopOrderDeliveryServiceImpl extends ServiceImpl implements ShopOrderDeliveryService { @Resource private ShopExpressService expressService; @@ -40,6 +42,8 @@ public class ShopOrderDeliveryServiceImpl extends ServiceImpl pageRel(ShopOrderDeliveryParam param) { @@ -111,45 +115,12 @@ public class ShopOrderDeliveryServiceImpl extends ServiceImpl orderGoodsList = shopOrderGoodsService.getListByOrderId(order.getOrderId()); - // 上传小程序发货信息 -// WxMaOrderShippingInfoUploadRequest uploadRequest = new WxMaOrderShippingInfoUploadRequest(); -// uploadRequest.setLogisticsType(1); -// uploadRequest.setDeliveryMode(1); -// -// OrderKeyBean orderKeyBean = new OrderKeyBean(); -// orderKeyBean.setOrderNumberType(2); -// orderKeyBean.setTransactionId(order.getTransactionId()); -// uploadRequest.setOrderKey(orderKeyBean); -// -// List shippingList = new ArrayList<>(); -// ShippingListBean shippingListBean = new ShippingListBean(); -// shippingListBean.setTrackingNo((String) bOrderData.get("kuaidinum")); -// shippingListBean.setExpressCompany(express.getWxCode()); -// ContactBean contactBean = new ContactBean(); -// contactBean.setReceiverContact(user.getMobile()); -// shippingListBean.setContact(contactBean); -// -// ShopGoods shopGoods = shopGoodsService.getById(orderGoodsList.get(0).getGoodsId()); -// -// String itemDesc = shopGoods.getName(); -// if (orderGoodsList.size() > 1) itemDesc += "等" + orderGoodsList.size() + "件商品"; -// shippingListBean.setItemDesc(itemDesc); -// shippingList.add(shippingListBean); -// uploadRequest.setShippingList(shippingList); -// -// uploadRequest.setUploadTime(new DateTime().toString(DatePattern.UTC_WITH_ZONE_OFFSET_PATTERN)); -// -// PayerBean payerBean = new PayerBean(); -// -// payerBean.setOpenid(user.getOpenid()); -// uploadRequest.setPayer(payerBean); -// -// WxMaService wxMaService = weChatController.wxMaService(); -// WxMaOrderShippingService wxMaOrderShippingService = new WxMaOrderShippingServiceImpl(wxMaService); -// WxMaOrderShippingInfoBaseResponse response = wxMaOrderShippingService.upload(uploadRequest); -// System.out.println("response" + response); + // 同步发货信息到微信小程序后台(发货信息录入),避免人工录入 + try { + shopWechatShippingSyncService.uploadExpressShippingInfo(order, orderDelivery, express); + } catch (Exception e) { + // 不影响本地发货流程,记录日志即可(可配合定时任务后补偿重试) + log.warn("同步微信发货信息失败(不影响发货成功) - orderId={}", order.getOrderId(), e); } return new HashMap<>() {{ put("res", true); diff --git a/src/main/java/com/gxwebsoft/shop/service/impl/ShopOrderServiceImpl.java b/src/main/java/com/gxwebsoft/shop/service/impl/ShopOrderServiceImpl.java index 6c1d60d..da73b60 100644 --- a/src/main/java/com/gxwebsoft/shop/service/impl/ShopOrderServiceImpl.java +++ b/src/main/java/com/gxwebsoft/shop/service/impl/ShopOrderServiceImpl.java @@ -1,8 +1,10 @@ package com.gxwebsoft.shop.service.impl; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.core.context.TenantContext; import com.gxwebsoft.common.core.config.ConfigProperties; import com.gxwebsoft.common.core.config.CertificateProperties; import com.gxwebsoft.common.core.utils.*; @@ -30,13 +32,16 @@ import com.wechat.pay.java.service.payments.jsapi.model.*; import com.wechat.pay.java.service.payments.nativepay.NativePayService; // Native支付的类将使用完全限定名避免冲突 import com.wechat.pay.java.service.payments.model.Transaction; +import lombok.Data; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.math.BigDecimal; +import java.math.RoundingMode; import java.time.LocalDateTime; +import java.time.OffsetDateTime; import java.util.*; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @@ -84,8 +89,188 @@ public class ShopOrderServiceImpl extends ServiceImpl= 0) { + return u.substring(0, idx + "/api".length()); + } + // Fallback: treat notifyUrl itself as base. + return u; + } + + private String prepaySnapshotKey(Payment payment, String outTradeNo) { + return WECHAT_PREPAY_SNAPSHOT_KEY_PREFIX + payment.getMchId() + ":" + outTradeNo; + } + + private WechatPrepaySnapshot getPrepaySnapshot(Payment payment, String outTradeNo) { + try { + return redisUtil.get(prepaySnapshotKey(payment, outTradeNo), WechatPrepaySnapshot.class); + } catch (Exception e) { + // 缓存不可用时不影响支付主流程 + log.warn("读取微信预下单快照失败 - outTradeNo={}, mchId={}", outTradeNo, payment != null ? payment.getMchId() : null, e); + return null; + } + } + + private void savePrepaySnapshot(Payment payment, WechatPrepaySnapshot snapshot) { + if (payment == null || snapshot == null || StrUtil.isBlank(snapshot.getOutTradeNo())) { + return; + } + try { + redisUtil.set(prepaySnapshotKey(payment, snapshot.getOutTradeNo()), snapshot, WECHAT_PREPAY_SNAPSHOT_TTL_MINUTES, TimeUnit.MINUTES); + } catch (Exception e) { + log.warn("保存微信预下单快照失败 - outTradeNo={}, mchId={}", snapshot.getOutTradeNo(), payment.getMchId(), e); + } + } + + private static boolean isIdempotencyParamMismatch(Throwable t) { + Throwable cur = t; + while (cur != null) { + if (cur instanceof ServiceException) { + ServiceException se = (ServiceException) cur; + String code = se.getErrorCode(); + String msg = se.getErrorMessage(); + String body = se.getResponseBody(); + if ("INVALID_REQUEST".equals(code) && ((msg != null && msg.contains("请求重入")) || (body != null && body.contains("请求重入")))) { + return true; + } + } + String m = cur.getMessage(); + if (m != null && m.contains("INVALID_REQUEST") && m.contains("请求重入")) { + return true; + } + cur = cur.getCause(); + } + return false; + } + + private static Integer toFen(BigDecimal amountYuan) { + if (amountYuan == null) { + return null; + } + // 微信支付金额字段使用整数分,这里按两位小数四舍五入再转分 + BigDecimal fen = amountYuan.setScale(2, RoundingMode.HALF_UP).movePointRight(2); + return fen.intValueExact(); + } + + private String defaultShopOrderNotifyUrl(Payment payment, Integer tenantId) { + String base = payment != null ? trimTrailingSlashes(payment.getNotifyUrl()) : null; + if (StrUtil.isBlank(base) || tenantId == null) { + return null; + } + // If DB notifyUrl is already a notify endpoint (recommended), just append tenantId if missing. + if (base.contains("/notify")) { + return ensureTenantSuffix(base, tenantId); + } + // If DB notifyUrl is just the API gateway base, append the standard notify path. + return base + "/shop/shop-order/notify/" + tenantId; + } + + private String legacySystemWxPayNotifyUrl(Payment payment, Integer tenantId) { + String base = baseApiUrlFromNotifyUrl(payment != null ? payment.getNotifyUrl() : null); + if (StrUtil.isBlank(base) || tenantId == null) { + return null; + } + return base + "/system/wx-pay/notify/" + tenantId; + } + + private String legacyShopWxPayNotifyUrl(Integer tenantId) { + // 旧代码曾使用 /api/shop/wx-pay/notify/{tenantId} + if (tenantId == null) { + return null; + } + return "http://jimei-api.natapp1.cc/api/shop/wx-pay/notify/" + tenantId; + } + + private String devShopOrderNotifyUrl(Integer tenantId) { + if (tenantId == null) { + return null; + } + return "http://jimei-api.natapp1.cc/api/shop/shop-order/notify/" + tenantId; + } + + private List buildNotifyUrlCandidates(ShopOrder order, Payment payment, WechatPrepaySnapshot snapshot) { + LinkedHashSet urls = new LinkedHashSet<>(); + if (snapshot != null && StrUtil.isNotBlank(snapshot.getNotifyUrl())) { + urls.add(trimTrailingSlashes(snapshot.getNotifyUrl())); + } + + // 回调地址优先从数据库支付配置读取 + String paymentNotify = defaultShopOrderNotifyUrl(payment, order.getTenantId()); + if (StrUtil.isNotBlank(paymentNotify)) { + urls.add(paymentNotify); + } + + // 兼容历史回调地址(用于已创建订单的“重新支付”重入校验) + String legacySystem = legacySystemWxPayNotifyUrl(payment, order.getTenantId()); + if (StrUtil.isNotBlank(legacySystem)) { + urls.add(legacySystem); + } + + if ("dev".equals(active)) { + String devNotify = devShopOrderNotifyUrl(order.getTenantId()); + if (StrUtil.isNotBlank(devNotify)) { + urls.add(devNotify); + } + String devLegacy = legacyShopWxPayNotifyUrl(order.getTenantId()); + if (StrUtil.isNotBlank(devLegacy)) { + urls.add(devLegacy); + } + } + + return new ArrayList<>(urls); + } @Override @@ -321,13 +506,15 @@ public class ShopOrderServiceImpl extends ServiceImpl orderInfo = new HashMap<>(); - orderInfo.put("provider", "wxpay"); - orderInfo.put("codeUrl", response.getCodeUrl()); // Native支付返回二维码URL - orderInfo.put("orderNo", order.getOrderNo()); - orderInfo.put("payType", WechatPayType.NATIVE); - orderInfo.put("wechatPayType", WechatPayType.NATIVE); + snapshot.setNotifyUrl(notifyUrlUsed); + snapshot.setTotal(amount.getTotal()); + snapshot.setDescription(request.getDescription()); + savePrepaySnapshot(payment, snapshot); - return orderInfo; + final HashMap orderInfo = new HashMap<>(); + orderInfo.put("provider", "wxpay"); + orderInfo.put("codeUrl", response.getCodeUrl()); // Native支付返回二维码URL + orderInfo.put("orderNo", order.getOrderNo()); + orderInfo.put("payType", WechatPayType.NATIVE); + orderInfo.put("wechatPayType", WechatPayType.NATIVE); + + return orderInfo; + } catch (Exception e) { + last = e; + if (!isIdempotencyParamMismatch(e)) { + throw e; + } + log.warn("Native预下单重入参数不一致,尝试切换notifyUrl重试 - outTradeNo={}, notifyUrl={}", outTradeNo, notifyUrl, e); + } + } + if (last != null) { + throw last; + } + throw new RuntimeException("创建Native支付订单失败:notifyUrl为空"); } /** @@ -399,10 +639,12 @@ public class ShopOrderServiceImpl extends ServiceImpl orderInfo = new HashMap<>(); + orderInfo.put("provider", "wxpay"); + orderInfo.put("timeStamp", response.getTimeStamp()); + orderInfo.put("nonceStr", response.getNonceStr()); + orderInfo.put("package", response.getPackageVal()); + orderInfo.put("signType", "RSA"); + orderInfo.put("paySign", response.getPaySign()); + orderInfo.put("orderNo", order.getOrderNo()); + orderInfo.put("payType", WechatPayType.JSAPI); + orderInfo.put("wechatPayType", WechatPayType.JSAPI); + return orderInfo; + } catch (Exception e) { + last = e; + if (!isIdempotencyParamMismatch(e)) { + throw e; + } + log.warn("JSAPI预下单重入参数不一致,尝试切换notifyUrl重试 - outTradeNo={}, notifyUrl={}", outTradeNo, notifyUrl, e); + } } - System.out.println("=== 发起微信支付请求 ==="); - System.out.println("请求参数: " + request); - - PrepayWithRequestPaymentResponse response = service.prepayWithRequestPayment(request); - - System.out.println("=== 微信支付响应成功 ==="); - System.out.println("预支付ID: " + response.getPackageVal()); - - final HashMap orderInfo = new HashMap<>(); - orderInfo.put("provider", "wxpay"); - orderInfo.put("timeStamp", response.getTimeStamp()); - orderInfo.put("nonceStr", response.getNonceStr()); - orderInfo.put("package", response.getPackageVal()); - orderInfo.put("signType", "RSA"); - orderInfo.put("paySign", response.getPaySign()); - orderInfo.put("orderNo", order.getOrderNo()); - orderInfo.put("payType", WechatPayType.JSAPI); - orderInfo.put("wechatPayType", WechatPayType.JSAPI); - return orderInfo; + if (last != null) { + throw last; + } + throw new RuntimeException("创建JSAPI支付订单失败:notifyUrl为空"); } @Override @@ -483,21 +788,43 @@ public class ShopOrderServiceImpl extends ServiceImpl 0) { markCouponAsUsed(order); @@ -538,6 +868,90 @@ public class ShopOrderServiceImpl extends ServiceImpl orderGoodsList = shopOrderGoodsService.getListByOrderIdIgnoreTenant(order.getOrderId()); + if (CollectionUtils.isEmpty(orderGoodsList)) { + return; + } + + TenantContext.runIgnoreTenant(() -> { + for (ShopOrderGoods og : orderGoodsList) { + if (og == null || og.getGoodsId() == null) { + continue; + } + int qty = og.getTotalNum() == null ? 0 : og.getTotalNum(); + if (qty <= 0) { + continue; + } + + ShopGoods goods = shopGoodsService.getById(og.getGoodsId()); + Integer deductStockType = goods != null ? goods.getDeductStockType() : null; + if (deductStockType == null || deductStockType != DEDUCT_STOCK_TYPE_PAY) { + continue; + } + + try { + if (og.getSkuId() != null && og.getSkuId() > 0) { + // 多规格:扣 SKU 库存 + boolean updated = shopGoodsSkuService.update( + new LambdaUpdateWrapper() + .eq(ShopGoodsSku::getId, og.getSkuId()) + .eq(ShopGoodsSku::getTenantId, order.getTenantId()) + .apply("IFNULL(stock,0) >= {0}", qty) + .setSql("stock = IFNULL(stock,0) - " + qty) + ); + if (!updated) { + log.warn("支付成功后扣SKU库存失败 - tenantId={}, orderId={}, skuId={}, goodsId={}, qty={}", + order.getTenantId(), order.getOrderId(), og.getSkuId(), og.getGoodsId(), qty); + // 兜底:库存不足时至少将库存置0,避免出现“明明已售出但库存仍大于0”的情况 + shopGoodsSkuService.update( + new LambdaUpdateWrapper() + .eq(ShopGoodsSku::getId, og.getSkuId()) + .eq(ShopGoodsSku::getTenantId, order.getTenantId()) + .apply("IFNULL(stock,0) < {0}", qty) + .setSql("stock = 0") + ); + } + } else { + // 单规格:扣商品库存 + boolean updated = shopGoodsService.update( + new LambdaUpdateWrapper() + .eq(ShopGoods::getGoodsId, og.getGoodsId()) + .eq(ShopGoods::getTenantId, order.getTenantId()) + .apply("IFNULL(stock,0) >= {0}", qty) + .setSql("stock = IFNULL(stock,0) - " + qty) + ); + if (!updated) { + log.warn("支付成功后扣商品库存失败 - tenantId={}, orderId={}, goodsId={}, qty={}", + order.getTenantId(), order.getOrderId(), og.getGoodsId(), qty); + // 兜底:库存不足时至少将库存置0,避免出现“明明已售出但库存仍大于0”的情况 + shopGoodsService.update( + new LambdaUpdateWrapper() + .eq(ShopGoods::getGoodsId, og.getGoodsId()) + .eq(ShopGoods::getTenantId, order.getTenantId()) + .apply("IFNULL(stock,0) < {0}", qty) + .setSql("stock = 0") + ); + } + } + } catch (Exception e) { + log.warn("支付成功后扣库存异常 - tenantId={}, orderId={}, goodsId={}, skuId={}, qty={}", + order.getTenantId(), order.getOrderId(), og.getGoodsId(), og.getSkuId(), qty, e); + } + } + }); + } + /** * 标记优惠券为已使用 */ @@ -1174,43 +1588,41 @@ public class ShopOrderServiceImpl extends ServiceImpl implements ShopUserService { diff --git a/src/main/java/com/gxwebsoft/shop/service/impl/ShopWarehouseServiceImpl.java b/src/main/java/com/gxwebsoft/shop/service/impl/ShopWarehouseServiceImpl.java deleted file mode 100644 index 6b9e727..0000000 --- a/src/main/java/com/gxwebsoft/shop/service/impl/ShopWarehouseServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gxwebsoft.shop.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.gxwebsoft.shop.mapper.ShopWarehouseMapper; -import com.gxwebsoft.shop.service.ShopWarehouseService; -import com.gxwebsoft.shop.entity.ShopWarehouse; -import com.gxwebsoft.shop.param.ShopWarehouseParam; -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 科技小王子 - * @since 2026-01-30 17:46:48 - */ -@Service -public class ShopWarehouseServiceImpl extends ServiceImpl implements ShopWarehouseService { - - @Override - public PageResult pageRel(ShopWarehouseParam 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(ShopWarehouseParam param) { - List list = baseMapper.selectListRel(param); - // 排序 - PageParam page = new PageParam<>(); - page.setDefaultOrder("sort_number asc, create_time desc"); - return page.sortRecords(list); - } - - @Override - public ShopWarehouse getByIdRel(Integer id) { - ShopWarehouseParam param = new ShopWarehouseParam(); - param.setId(id); - return param.getOne(baseMapper.selectListRel(param)); - } - -} diff --git a/src/main/java/com/gxwebsoft/shop/service/impl/ShopWebsiteServiceImpl.java b/src/main/java/com/gxwebsoft/shop/service/impl/ShopWebsiteServiceImpl.java index d111c10..0d92e1e 100644 --- a/src/main/java/com/gxwebsoft/shop/service/impl/ShopWebsiteServiceImpl.java +++ b/src/main/java/com/gxwebsoft/shop/service/impl/ShopWebsiteServiceImpl.java @@ -51,6 +51,9 @@ public class ShopWebsiteServiceImpl implements ShopWebsiteService { log.info("从缓存获取商城信息,租户ID: {}", tenantId); return cacheVo; } + // 兼容历史缓存:JSON "null" 会被解析为 null;此时清理缓存并回源。 + log.warn("商城信息缓存命中但内容为空(null),清理缓存后回源数据库,租户ID: {}", tenantId); + redisUtil.delete(cacheKey); } catch (Exception e) { log.warn("商城缓存解析失败,清理缓存后重新获取: {}", e.getMessage()); redisUtil.delete(cacheKey); diff --git a/src/main/java/com/gxwebsoft/shop/task/OrderAutoCancelTask.java b/src/main/java/com/gxwebsoft/shop/task/OrderAutoCancelTask.java index d1b71ff..6a5e932 100644 --- a/src/main/java/com/gxwebsoft/shop/task/OrderAutoCancelTask.java +++ b/src/main/java/com/gxwebsoft/shop/task/OrderAutoCancelTask.java @@ -38,7 +38,7 @@ public class OrderAutoCancelTask { * 生产环境:每5分钟执行一次 * 开发环境:每1分钟执行一次(便于测试) */ - @Scheduled(cron = "${shop.order.auto-cancel.cron:0 */5 * * * ?}") + @Scheduled(cron = "${shop.order.auto-cancel.cron:0 */1 * * * ?}") @IgnoreTenant("定时任务需要处理所有租户的超时订单") public void cancelExpiredOrders() { if (!orderConfig.getAutoCancel().isEnabled()) { diff --git a/src/main/resources/application-cms.yml b/src/main/resources/application-cms.yml deleted file mode 100644 index aba37b5..0000000 --- a/src/main/resources/application-cms.yml +++ /dev/null @@ -1,83 +0,0 @@ -# 生产环境配置 - -# 服务器配置 -server: - port: 9100 - -# 数据源配置 -spring: - datasource: - url: jdbc:mysql://1Panel-mysql-Bqdt:3306/modules?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai - username: modules - password: P7KsAyDXG8YdLnkA - driver-class-name: com.mysql.cj.jdbc.Driver - type: com.alibaba.druid.pool.DruidDataSource - druid: - remove-abandoned: true - - # redis - redis: - database: 0 - host: 1Panel-redis-Q1LE - port: 6379 - password: redis_WSDb88 - -# 日志配置 -logging: - file: - name: websoft-modules.log - level: - root: WARN - com.gxwebsoft: ERROR - com.baomidou.mybatisplus: ERROR - -socketio: - host: 0.0.0.0 #IP地址 - -# MQTT配置 -mqtt: - enabled: false # 启用MQTT服务 - host: tcp://132.232.214.96:1883 - username: swdev - password: Sw20250523 - client-id-prefix: hjm_car_ - topic: /SW_GPS/# - qos: 2 - connection-timeout: 10 - keep-alive-interval: 20 - auto-reconnect: true - -# 框架配置 -config: - # 文件服务器 - file-server: https://file-s209.shoplnk.cn - # 生产环境接口 - server-url: https://server.websoft.top/api - upload-path: /www/wwwroot/file.ws - - # 阿里云OSS云存储 - endpoint: https://oss-cn-shenzhen.aliyuncs.com - accessKeyId: LTAI4GKGZ9Z2Z8JZ77c3GNZP - accessKeySecret: BiDkpS7UXj72HWwDWaFZxiXjNFBNCM - bucketName: oss-gxwebsoft - bucketDomain: https://oss.wsdns.cn - aliyunDomain: https://oss-gxwebsoft.oss-cn-shenzhen.aliyuncs.com - -# 生产环境证书配置 -certificate: - load-mode: VOLUME # 生产环境从Docker挂载卷加载 - cert-root-path: /www/wwwroot/file.ws - -# 支付配置缓存 -payment: - cache: - # 支付配置缓存键前缀,生产环境使用 Payment:1* 格式 - key-prefix: "Payment:1" - # 缓存过期时间(小时) - expire-hours: 24 - -# 微信支付-商家转账(升级版)转账场景报备信息(必须与商户平台 transfer_scene_id=1005 的报备信息一致) -wechatpay: - transfer: - scene-id: 1005 - scene-report-infos-json: '[{"info_type":"岗位类型","info_content":"业务员"},{"info_type":"报酬说明","info_content":"配送费"}]' diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 8a221d2..c7ec827 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -7,16 +7,16 @@ server: # 数据源配置 spring: datasource: - url: jdbc:mysql://8.134.55.105:13306/modules?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8 - username: modules - password: tYmmMGh5wpwXR3ae + url: jdbc:mysql://47.107.249.41:13306/gltdb?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8 + username: gltdb + password: EeD4FtzyA5ksj7Bk driver-class-name: com.mysql.cj.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource # redis redis: database: 0 - host: 8.134.55.105 + host: 47.107.249.41 port: 16379 password: redis_t74P8C diff --git a/src/main/resources/application-glt.yml b/src/main/resources/application-glt.yml index 8e5af90..42bbb8e 100644 --- a/src/main/resources/application-glt.yml +++ b/src/main/resources/application-glt.yml @@ -3,9 +3,9 @@ # 数据源配置 spring: datasource: - url: jdbc:mysql://1Panel-mysql-XsWW:3306/modules?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai - username: modules - password: tYmmMGh5wpwXR3ae + url: jdbc:mysql://1Panel-mysql-XsWW:3306/gltdb?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai + username: gltdb + password: EeD4FtzyA5ksj7Bk driver-class-name: com.mysql.cj.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource druid: @@ -49,6 +49,8 @@ config: file-server: https://file-s209.shoplnk.cn # 生产环境接口 server-url: https://glt-server.websoft.top/api + # 业务模块接口 + api-url: https://glt-api.websoft.top/api upload-path: /www/wwwroot/file.ws # 阿里云OSS云存储 diff --git a/src/main/resources/application-glt2.yml b/src/main/resources/application-glt2.yml new file mode 100644 index 0000000..fdcd6ba --- /dev/null +++ b/src/main/resources/application-glt2.yml @@ -0,0 +1,73 @@ +# 开发环境配置 + +# 服务器配置 +server: + port: 9200 + +# 数据源配置 +spring: + datasource: + url: jdbc:mysql://47.107.249.41:13306/gltdb?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai + username: gltdb + password: EeD4FtzyA5ksj7Bk + driver-class-name: com.mysql.cj.jdbc.Driver + type: com.alibaba.druid.pool.DruidDataSource + + # redis + redis: + database: 0 + host: 8.134.55.105 + port: 16379 + password: redis_t74P8C + +# 日志配置 +logging: + level: + com.gxwebsoft: DEBUG + com.baomidou.mybatisplus: DEBUG + +socketio: + host: localhost #IP地址 + +# MQTT配置 +mqtt: + enabled: false # 添加开关来禁用MQTT服务 + host: tcp://132.232.214.96:1883 + username: swdev + password: Sw20250523 + client-id-prefix: hjm_car_ + topic: /SW_GPS/# + qos: 2 + connection-timeout: 10 + keep-alive-interval: 20 + auto-reconnect: true + +# 框架配置 +config: + # 基础模块接口 + server-url: https://glt-server.websoft.top/api + # 业务模块接口 + api-url: https://glt-api.websoft.top/api + upload-path: /Users/gxwebsoft/Documents/uploads/ # window(D:\Temp) + +# 开发环境证书配置 +certificate: + load-mode: CLASSPATH # 开发环境从classpath加载 + wechat-pay: + dev: + private-key-file: "apiclient_key.pem" + apiclient-cert-file: "apiclient_cert.pem" + wechatpay-cert-file: "wechatpay_cert.pem" + +# 阿里云翻译配置 +aliyun: + translate: + access-key-id: LTAI5tEsyhW4GCKbds1qsopg + access-key-secret: zltFlQrYVAoq2KMFDWgLa3GhkMNeyO + endpoint: mt.cn-hangzhou.aliyuncs.com + +# 微信支付-商家转账(升级版)转账场景报备信息(必须与商户平台 transfer_scene_id=1005 的报备信息一致) +wechatpay: + transfer: + scene-id: 1005 + scene-report-infos-json: '[{"info_type":"岗位类型","info_content":"业务员"},{"info_type":"报酬说明","info_content":"配送费"}]' diff --git a/src/main/resources/application-yd.yml b/src/main/resources/application-yd.yml deleted file mode 100644 index 834efcb..0000000 --- a/src/main/resources/application-yd.yml +++ /dev/null @@ -1,83 +0,0 @@ -# 生产环境配置 - -# 服务器配置 -server: - port: 9400 - -# 数据源配置 -spring: - datasource: - url: jdbc:mysql://1Panel-mysql-Bqdt:3306/modules?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai - username: modules - password: P7KsAyDXG8YdLnkA - driver-class-name: com.mysql.cj.jdbc.Driver - type: com.alibaba.druid.pool.DruidDataSource - druid: - remove-abandoned: true - - # redis - redis: - database: 0 - host: 1Panel-redis-Q1LE - port: 6379 - password: redis_WSDb88 - -# 日志配置 -logging: - file: - name: websoft-modules.log - level: - root: WARN - com.gxwebsoft: ERROR - com.baomidou.mybatisplus: ERROR - -socketio: - host: 0.0.0.0 #IP地址 - -# MQTT配置 -mqtt: - enabled: true # 启用MQTT服务 - host: tcp://132.232.214.96:1883 - username: swdev - password: Sw20250523 - client-id-prefix: hjm_car_ - topic: /SW_GPS/# - qos: 2 - connection-timeout: 10 - keep-alive-interval: 20 - auto-reconnect: true - -# 框架配置 -config: - # 文件服务器 - file-server: https://file-s209.shoplnk.cn - # 生产环境接口 - server-url: https://server.websoft.top/api - upload-path: /www/wwwroot/file.ws - - # 阿里云OSS云存储 - endpoint: https://oss-cn-shenzhen.aliyuncs.com - accessKeyId: LTAI4GKGZ9Z2Z8JZ77c3GNZP - accessKeySecret: BiDkpS7UXj72HWwDWaFZxiXjNFBNCM - bucketName: oss-gxwebsoft - bucketDomain: https://oss.wsdns.cn - aliyunDomain: https://oss-gxwebsoft.oss-cn-shenzhen.aliyuncs.com - -# 生产环境证书配置 -certificate: - load-mode: VOLUME # 生产环境从Docker挂载卷加载 - cert-root-path: /www/wwwroot/file.ws - -# 支付配置缓存 -payment: - cache: - # 支付配置缓存键前缀,生产环境使用 Payment:1* 格式 - key-prefix: "Payment:1" - # 缓存过期时间(小时) - expire-hours: 24 - -# 微信支付-商家转账(升级版)转账场景报备信息(必须与商户平台 transfer_scene_id=1005 的报备信息一致) -wechatpay: - transfer: - scene-id: 1005 - scene-report-infos-json: '[{"info_type":"岗位类型","info_content":"业务员"},{"info_type":"报酬说明","info_content":"配送费"}]' diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 368b20f..5be3164 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -4,7 +4,7 @@ server: # 多环境配置 spring: profiles: - active: dev + active: glt2 application: name: server @@ -82,7 +82,10 @@ mybatis-plus: map-underscore-to-camel-case: true cache-enabled: true global-config: - :banner: false + banner: false + # SqlRunner.db().xxx 需要开启该开关,否则会报: + # Mapped Statements collection does not contain value for com.baomidou.mybatisplus.core.mapper.SqlRunner.Delete + enable-sql-runner: true db-config: id-type: auto logic-delete-value: 1 @@ -198,6 +201,22 @@ springdoc: swagger-ui: enabled: true +# AI 模块(Ollama) +ai: + ollama: + base-url: https://ai-api.websoft.top + fallback-url: http://47.119.165.234:11434 + chat-model: qwen3.5:cloud + embed-model: qwen3-embedding:4b + connect-timeout-ms: 10000 + read-timeout-ms: 300000 + write-timeout-ms: 60000 + max-concurrency: 4 + rag-max-candidates: 2000 + rag-top-k: 5 + rag-chunk-size: 800 + rag-chunk-overlap: 120 + # LED - 排班接口(业务中台)对接配置 led: bme: diff --git a/src/test/java/com/gxwebsoft/TestMain.java b/src/test/java/com/gxwebsoft/TestMain.java index 5efb394..1549fc8 100644 --- a/src/test/java/com/gxwebsoft/TestMain.java +++ b/src/test/java/com/gxwebsoft/TestMain.java @@ -1,29 +1,16 @@ package com.gxwebsoft; import cn.hutool.core.util.NumberUtil; -import cn.hutool.core.util.StrUtil; -import com.gxwebsoft.hjm.controller.PushCallback; -import com.gxwebsoft.hjm.entity.HjmCar; -import com.gxwebsoft.hjm.service.HjmCarService; import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.boot.test.context.SpringBootTest; -import javax.annotation.Resource; import java.math.BigDecimal; -import java.text.NumberFormat; -import java.text.ParseException; /** * Created by WebSoft on 2020-03-23 23:37 */ @SpringBootTest public class TestMain { - private static final Logger logger = LoggerFactory.getLogger(PushCallback.class); - - @Resource - private HjmCarService hjmCarService; /** * 生成唯一的key用于jwt工具类 @@ -33,63 +20,5 @@ public class TestMain { BigDecimal bigDecimal = new BigDecimal(NumberUtil.decimalFormat("0.00", 1 * 0.01)); System.out.println("实际付款金额111111111 = " + bigDecimal); - - final HjmCar byGpsNo = hjmCarService.getByGpsNo("gps1"); - System.out.println("byGpsNo = " + byGpsNo.getSpeed()); - if(StrUtil.isBlank(byGpsNo.getSpeed())){ - System.out.println("空的 = "); - } - if(byGpsNo.getSpeed() == null){ - System.out.println("getSpeed = "); - } -// System.out.println(JwtUtil.encodeKey(JwtUtil.randomKey())); - -// final String encrypt = CommonUtil.encrypt("123456"); -// System.out.println("encrypt = " + encrypt); -// -// final String decrypt = CommonUtil.decrypt(encrypt); -// System.out.println("decrypt = " + decrypt); } - -// @Test -// public void mqtt() throws MqttException { -////tcp://MQTT安装的服务器地址:MQTT定义的端口号 -// String HOST = "tcp://1.14.159.185:1883"; -// -// //定义MQTT的ID,可以在MQTT服务配置中指定 -// String clientid = "mqttx_aec633ca2"; -// -// MqttClient client; -// String userName = "swdev"; -// String passWord = "Sw20250523"; -// -// client = new MqttClient(HOST, clientid, new MemoryPersistence()); -// -// final MqttConnectOptions mqttConnectOptions = new MqttConnectOptions(); -// mqttConnectOptions.setUserName(userName); -// mqttConnectOptions.setPassword(passWord.toCharArray()); -// mqttConnectOptions.setCleanSession(true); -// -// client.setCallback(new MqttCallback() { -// @Override -// public void connectionLost(Throwable throwable) { -// logger.info("连接丢失............."); -// } -// -// @Override -// public void messageArrived(String topic, MqttMessage mqttMessage) throws Exception { -// logger.info("接收消息主题 : " + topic); -// logger.info("接收消息Qos : " + mqttMessage.getQos()); -// logger.info("接收消息内容 : " + new String(mqttMessage.getPayload())); -// } -// -// @Override -// public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) { -// logger.info("deliveryComplete............."); -// } -// }); -// client.connect(mqttConnectOptions); -// client.subscribe("/SW_GSP/#", 2); -// while (true); -// } } diff --git a/src/test/java/com/gxwebsoft/bszx/BszxOrderTotalTest.java b/src/test/java/com/gxwebsoft/bszx/BszxOrderTotalTest.java deleted file mode 100644 index 7f769d6..0000000 --- a/src/test/java/com/gxwebsoft/bszx/BszxOrderTotalTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.gxwebsoft.bszx; - -import com.gxwebsoft.bszx.service.BszxPayService; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.ActiveProfiles; - -import javax.annotation.Resource; -import java.math.BigDecimal; - -import static org.junit.jupiter.api.Assertions.*; - -/** - * 百色中学订单总金额统计测试 - * - * @author 科技小王子 - * @since 2025-07-31 - */ -@SpringBootTest -@ActiveProfiles("test") -public class BszxOrderTotalTest { - - @Resource - private BszxPayService bszxPayService; - - @Test - void testBszxOrderTotal() { - // 测试百色中学订单总金额统计 - BigDecimal total = bszxPayService.total(); - - // 验证返回值不为null - assertNotNull(total, "百色中学订单总金额不应该为null"); - - // 验证返回值大于等于0 - assertTrue(total.compareTo(BigDecimal.ZERO) >= 0, "百色中学订单总金额应该大于等于0"); - - System.out.println("百色中学订单总金额统计结果:" + total); - } - - @Test - void testBszxOrderTotalPerformance() { - // 测试性能 - long startTime = System.currentTimeMillis(); - - BigDecimal total = bszxPayService.total(); - - long endTime = System.currentTimeMillis(); - long duration = endTime - startTime; - - System.out.println("百色中学订单总金额统计耗时:" + duration + "ms"); - System.out.println("统计结果:" + total); - - // 验证查询时间在合理范围内(小于5秒) - assertTrue(duration < 5000, "查询时间应该在5秒以内"); - } -} diff --git a/src/test/java/com/gxwebsoft/house/HousePosterTest.java b/src/test/java/com/gxwebsoft/house/HousePosterTest.java deleted file mode 100644 index 247a713..0000000 --- a/src/test/java/com/gxwebsoft/house/HousePosterTest.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.gxwebsoft.house; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.gxwebsoft.house.entity.HouseInfo; -import com.gxwebsoft.house.service.HouseInfoService; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.ActiveProfiles; - -import javax.annotation.Resource; -import java.math.BigDecimal; - -/** - * 房产海报生成测试 - */ -@SpringBootTest -@ActiveProfiles("dev") -public class HousePosterTest { - - @Resource - private HouseInfoService houseInfoService; - - @Test - public void testGeneratePoster() throws Exception { - // 创建测试房源信息 - HouseInfo houseInfo = new HouseInfo(); - houseInfo.setHouseId(1); - houseInfo.setHouseTitle("精装修三室两厅,拎包入住"); - houseInfo.setHouseType("3室2厅1卫"); - houseInfo.setExtent("120㎡"); - houseInfo.setFloor("15/30层"); - houseInfo.setRent(new BigDecimal("3500")); - houseInfo.setMonthlyRent(new BigDecimal("3500")); - houseInfo.setAddress("深圳市南山区科技园南区"); - houseInfo.setPhone("13800138000"); - houseInfo.setHouseLabel("近地铁,精装修,家电齐全"); - houseInfo.setTenantId(1); - - // 创建测试图片文件数据(使用您提供的格式) - JSONArray filesArray = new JSONArray(); - - JSONObject file1 = new JSONObject(); - file1.put("size", 53148); - file1.put("type", "image"); - file1.put("url", "https://oss.wsdns.cn/20250507/3a2f69042a6e41f2882030d7059a4247.jpg?x-oss-process=image/resize,w_1680/quality,Q_90"); - file1.put("status", "success"); - file1.put("message", ""); - filesArray.add(file1); - - JSONObject file2 = new JSONObject(); - file2.put("size", 35301); - file2.put("type", "image"); - file2.put("url", "https://oss.wsdns.cn/20250507/b375176af0b1403da6c4ff66ea4bc503.jpg?x-oss-process=image/resize,w_1680/quality,Q_90"); - file2.put("status", "success"); - file2.put("message", ""); - filesArray.add(file2); - - houseInfo.setFiles(filesArray.toJSONString()); - - // 生成海报 - String posterUrl = houseInfoService.generatePoster(houseInfo); - - System.out.println("生成的海报URL: " + posterUrl); - - // 验证结果 - assert posterUrl != null : "海报生成失败,返回null"; - assert posterUrl.contains("/poster/") : "海报URL格式不正确"; - assert posterUrl.contains(".jpg") : "海报文件格式不正确"; - - System.out.println("房产海报生成测试通过!"); - System.out.println("海报包含小程序码,扫码可查看房源详情页:sub_pages/house/detail/" + houseInfo.getHouseId()); - } - - @Test - public void testGeneratePosterWithMinimalData() throws Exception { - // 测试最小数据集 - HouseInfo houseInfo = new HouseInfo(); - houseInfo.setHouseId(2); - houseInfo.setHouseTitle("简单房源"); - houseInfo.setTenantId(1); - - // 只有一张图片 - JSONArray filesArray = new JSONArray(); - JSONObject file = new JSONObject(); - file.put("size", 53148); - file.put("type", "image"); - file.put("url", "https://oss.wsdns.cn/20250507/3a2f69042a6e41f2882030d7059a4247.jpg?x-oss-process=image/resize,w_1680/quality,Q_90"); - file.put("status", "success"); - file.put("message", ""); - filesArray.add(file); - - houseInfo.setFiles(filesArray.toJSONString()); - - // 生成海报 - String posterUrl = houseInfoService.generatePoster(houseInfo); - - System.out.println("最小数据海报URL: " + posterUrl); - - // 验证结果 - assert posterUrl != null : "最小数据海报生成失败"; - - System.out.println("最小数据房产海报生成测试通过!"); - } - - @Test - public void testGeneratePosterWithEmptyFiles() throws Exception { - // 测试空文件数据 - HouseInfo houseInfo = new HouseInfo(); - houseInfo.setHouseId(3); - houseInfo.setHouseTitle("无图片房源"); - houseInfo.setTenantId(1); - houseInfo.setFiles("[]"); // 空数组 - - // 生成海报 - String posterUrl = houseInfoService.generatePoster(houseInfo); - - System.out.println("空文件海报URL: " + posterUrl); - - // 验证结果 - 应该返回null - assert posterUrl == null : "空文件应该返回null"; - - System.out.println("空文件房产海报测试通过!"); - } - - @Test - public void testGeneratePosterWithNullHouseInfo() throws Exception { - // 测试null房源信息 - String posterUrl = houseInfoService.generatePoster(null); - - // 验证结果 - 应该返回null - assert posterUrl == null : "null房源信息应该返回null"; - - System.out.println("null房源信息测试通过!"); - } -} diff --git a/src/test/java/com/gxwebsoft/house/util/SortSceneUtilManualTest.java b/src/test/java/com/gxwebsoft/house/util/SortSceneUtilManualTest.java deleted file mode 100644 index 4671c8b..0000000 --- a/src/test/java/com/gxwebsoft/house/util/SortSceneUtilManualTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.gxwebsoft.house.util; - -/** - * SortSceneUtil手动测试类 - * 用于验证URL解码功能 - * - * @author 科技小王子 - * @since 2025-08-04 - */ -public class SortSceneUtilManualTest { - - public static void main(String[] args) { - // 测试URL编码的参数 - String urlEncoded = "%E4%BB%B7%E6%A0%BC(%E4%BD%8E-%E9%AB%98)"; - System.out.println("原始URL编码参数: " + urlEncoded); - - String result = SortSceneUtil.normalizeSortScene(urlEncoded); - System.out.println("标准化后的参数: " + result); - System.out.println("是否为价格升序: " + SortSceneUtil.isPriceAsc(urlEncoded)); - - // 测试其他格式 - String[] testCases = { - "价格(低-高)", - "价格(高-低)", - "%E4%BB%B7%E6%A0%BC(%E9%AB%98-%E4%BD%8E)", - "最新发布", - "综合排序", - "面积(小-大)", - "面积(大-小)" - }; - - System.out.println("\n=== 测试各种排序场景 ==="); - for (String testCase : testCases) { - String normalized = SortSceneUtil.normalizeSortScene(testCase); - System.out.println("输入: " + testCase + " -> 输出: " + normalized); - } - } -} diff --git a/src/test/java/com/gxwebsoft/house/util/SortSceneUtilTest.java b/src/test/java/com/gxwebsoft/house/util/SortSceneUtilTest.java deleted file mode 100644 index f15567a..0000000 --- a/src/test/java/com/gxwebsoft/house/util/SortSceneUtilTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.gxwebsoft.house.util; - -import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - -/** - * SortSceneUtil测试类 - * - * @author 科技小王子 - * @since 2025-08-04 - */ -public class SortSceneUtilTest { - - @Test - public void testNormalizeSortScene() { - // 测试URL编码的参数 - String urlEncoded = "%E4%BB%B7%E6%A0%BC(%E4%BD%8E-%E9%AB%98)"; - String result = SortSceneUtil.normalizeSortScene(urlEncoded); - assertEquals("价格(低-高)", result); - - // 测试已解码的参数 - String decoded = "价格(低-高)"; - result = SortSceneUtil.normalizeSortScene(decoded); - assertEquals("价格(低-高)", result); - - // 测试空值 - result = SortSceneUtil.normalizeSortScene(null); - assertNull(result); - - result = SortSceneUtil.normalizeSortScene(""); - assertNull(result); - - result = SortSceneUtil.normalizeSortScene(" "); - assertNull(result); - } - - @Test - public void testIsPriceAsc() { - assertTrue(SortSceneUtil.isPriceAsc("价格(低-高)")); - assertTrue(SortSceneUtil.isPriceAsc("%E4%BB%B7%E6%A0%BC(%E4%BD%8E-%E9%AB%98)")); - assertFalse(SortSceneUtil.isPriceAsc("价格(高-低)")); - assertFalse(SortSceneUtil.isPriceAsc("最新发布")); - } - - @Test - public void testIsPriceDesc() { - assertTrue(SortSceneUtil.isPriceDesc("价格(高-低)")); - assertFalse(SortSceneUtil.isPriceDesc("价格(低-高)")); - assertFalse(SortSceneUtil.isPriceDesc("最新发布")); - } - - @Test - public void testIsLatest() { - assertTrue(SortSceneUtil.isLatest("最新发布")); - assertFalse(SortSceneUtil.isLatest("价格(低-高)")); - } - - @Test - public void testIsComprehensive() { - assertTrue(SortSceneUtil.isComprehensive("综合排序")); - assertFalse(SortSceneUtil.isComprehensive("价格(低-高)")); - } -}