| @ -0,0 +1,97 @@ | |||||
| package com.fxzy.warn.controller; | |||||
| import com.alibaba.fastjson.JSONObject; | |||||
| import com.fxzy.warn.common.constants.ResponseMsgConstants; | |||||
| import com.fxzy.warn.common.request.RequestParameter; | |||||
| import com.fxzy.warn.common.response.ApiResponse; | |||||
| import com.fxzy.warn.model.Contract; | |||||
| import com.fxzy.warn.service.ContractService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import io.swagger.annotations.ApiParam; | |||||
| import lombok.extern.slf4j.Slf4j; | |||||
| import org.springframework.http.MediaType; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import javax.annotation.Resource; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2024/05/21 11:22 | |||||
| * @description | |||||
| */ | |||||
| @Api(tags = "合同管理") | |||||
| @RestController | |||||
| @RequestMapping("contract/") | |||||
| @Slf4j | |||||
| public class ContractController { | |||||
| @Resource | |||||
| private ContractService contractService ; | |||||
| @RequestMapping(value = "save", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| @ApiOperation(value = "新增") | |||||
| public ApiResponse save(@ApiParam("{\n" + | |||||
| "\"userId\":\"关联用户\",\n" + | |||||
| "\"signingDate\":\"合同签订日期\",\n" + | |||||
| "\"contractAmount\":\"合同金额\",\n" + | |||||
| "}") @RequestBody Contract entity, @RequestHeader String ticket) { | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return contractService.saveModel(entity,ticket); | |||||
| } catch (Exception e) { | |||||
| response.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return response; | |||||
| } | |||||
| /** | |||||
| * 修改 | |||||
| * | |||||
| * @param | |||||
| * @return | |||||
| */ | |||||
| @ResponseBody | |||||
| @ApiOperation(value = "修改") | |||||
| @RequestMapping(value = "edit", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| public ApiResponse edit(@ApiParam() @RequestBody Contract entity,@RequestHeader String ticket) { | |||||
| log.info("修改==== 参数{" + entity != null ? entity.toString() : "null" + "}"); | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return contractService.updateModel(entity,ticket); | |||||
| } catch (Exception e) { | |||||
| response.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return response; | |||||
| } | |||||
| /** | |||||
| * 通过ids删除 | |||||
| * | |||||
| * @param | |||||
| * @return | |||||
| */ | |||||
| @ResponseBody | |||||
| @ApiOperation(value = "删除") | |||||
| @RequestMapping(value = "remove", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| public ApiResponse remove(@ApiParam("{\"ids\":[\"1\",\"2\"]}") @RequestBody JSONObject jsonObject) { | |||||
| ApiResponse apiResponse = new ApiResponse(); | |||||
| try { | |||||
| return contractService.deleteModel(jsonObject.getJSONArray("ids").toJavaList(String.class)); | |||||
| } catch (Exception e) { | |||||
| apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return apiResponse; | |||||
| } | |||||
| @RequestMapping(value = "queryPage", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | |||||
| @ApiOperation(value = "分页查询") | |||||
| public ApiResponse queryPage(@ApiParam() @RequestBody RequestParameter parameter) { | |||||
| ApiResponse apiResponse = new ApiResponse(); | |||||
| try { | |||||
| apiResponse.setData(contractService.queryPage(parameter)); | |||||
| apiResponse.setMessage(ResponseMsgConstants.OPERATE_SUCCESS); | |||||
| } catch (Exception e) { | |||||
| apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return apiResponse; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,99 @@ | |||||
| package com.fxzy.warn.controller; | |||||
| import com.alibaba.fastjson.JSONObject; | |||||
| import com.fxzy.warn.common.constants.ResponseMsgConstants; | |||||
| import com.fxzy.warn.common.request.RequestParameter; | |||||
| import com.fxzy.warn.common.response.ApiResponse; | |||||
| import com.fxzy.warn.model.Report; | |||||
| import com.fxzy.warn.service.ReportService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import io.swagger.annotations.ApiParam; | |||||
| import lombok.extern.slf4j.Slf4j; | |||||
| import org.springframework.http.MediaType; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import javax.annotation.Resource; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2024/05/21 11:22 | |||||
| * @description | |||||
| */ | |||||
| @Api(tags = "司法报告") | |||||
| @RestController | |||||
| @RequestMapping("report/") | |||||
| @Slf4j | |||||
| public class ReportController { | |||||
| @Resource | |||||
| private ReportService reportService ; | |||||
| @RequestMapping(value = "save", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| @ApiOperation(value = "新增") | |||||
| public ApiResponse save(@ApiParam("{\n" + | |||||
| "\"companyName\":\"企业名称\",\n" + | |||||
| "\"creditCode\":\"统一社会信用代码\",\n" + | |||||
| "\"legalPerson\":\"企业法人\",\n" + | |||||
| "\"address\":\"地址\"\n" + | |||||
| "\"authorizationId\":\"授权书id\"\n" + | |||||
| "}") @RequestBody Report entity, @RequestHeader String ticket) { | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return reportService.saveModel(entity,ticket); | |||||
| } catch (Exception e) { | |||||
| response.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return response; | |||||
| } | |||||
| /** | |||||
| * 修改 | |||||
| * | |||||
| * @param | |||||
| * @return | |||||
| */ | |||||
| @ResponseBody | |||||
| @ApiOperation(value = "修改") | |||||
| @RequestMapping(value = "edit", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| public ApiResponse edit(@ApiParam() @RequestBody Report entity,@RequestHeader String ticket) { | |||||
| log.info("修改==== 参数{" + entity != null ? entity.toString() : "null" + "}"); | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return reportService.updateModel(entity,ticket); | |||||
| } catch (Exception e) { | |||||
| response.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return response; | |||||
| } | |||||
| /** | |||||
| * 通过ids删除 | |||||
| * | |||||
| * @param | |||||
| * @return | |||||
| */ | |||||
| @ResponseBody | |||||
| @ApiOperation(value = "删除") | |||||
| @RequestMapping(value = "remove", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| public ApiResponse remove(@ApiParam("{\"ids\":[\"1\",\"2\"]}") @RequestBody JSONObject jsonObject) { | |||||
| ApiResponse apiResponse = new ApiResponse(); | |||||
| try { | |||||
| return reportService.deleteModel(jsonObject.getJSONArray("ids").toJavaList(String.class)); | |||||
| } catch (Exception e) { | |||||
| apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return apiResponse; | |||||
| } | |||||
| @RequestMapping(value = "queryPage", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | |||||
| @ApiOperation(value = "分页查询") | |||||
| public ApiResponse queryPage(@ApiParam() @RequestBody RequestParameter parameter) { | |||||
| ApiResponse apiResponse = new ApiResponse(); | |||||
| try { | |||||
| apiResponse.setData(reportService.queryPage(parameter)); | |||||
| apiResponse.setMessage(ResponseMsgConstants.OPERATE_SUCCESS); | |||||
| } catch (Exception e) { | |||||
| apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return apiResponse; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,94 @@ | |||||
| package com.fxzy.warn.controller; | |||||
| import com.alibaba.fastjson.JSONObject; | |||||
| import com.fxzy.warn.common.constants.ResponseMsgConstants; | |||||
| import com.fxzy.warn.common.request.RequestParameter; | |||||
| import com.fxzy.warn.common.response.ApiResponse; | |||||
| import com.fxzy.warn.model.User; | |||||
| import com.fxzy.warn.service.UserService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import io.swagger.annotations.ApiParam; | |||||
| import lombok.extern.slf4j.Slf4j; | |||||
| import org.springframework.http.MediaType; | |||||
| import org.springframework.web.bind.annotation.RequestBody; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RequestMethod; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import javax.annotation.Resource; | |||||
| import java.util.Objects; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2024/05/21 11:22 | |||||
| * @description | |||||
| */ | |||||
| @Api(tags = "试用授权") | |||||
| @RestController | |||||
| @RequestMapping("trial/") | |||||
| @Slf4j | |||||
| public class TrialController { | |||||
| @Resource | |||||
| private UserService userService ; | |||||
| @RequestMapping(value = "createTrial", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| @ApiOperation(value = "创建试用账号") | |||||
| public ApiResponse createTrial(@ApiParam("{\n" + | |||||
| "\"companyName\":\"企业名称\",\n" + | |||||
| "\"creditCode\":\"统一社会信用代码\",\n" + | |||||
| "\"phoneNumber\":\"手机号\",\n" + | |||||
| "\"email\":\"邮箱\"\n" + | |||||
| "\"province\":\"所在省\"\n" + | |||||
| "\"city\":\"所在市\"\n" + | |||||
| "\"district\":\"所在区\"\n" + | |||||
| "\"detailedAddress\":\"详细地址\"\n" + | |||||
| "\"businessPerson\":\"商务负责人\"\n" + | |||||
| "\"remarks\":\"备注\"\n" + | |||||
| "}") @RequestBody User entity, String ticket) { | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return userService.createTrial(entity,ticket); | |||||
| } catch (Exception e) { | |||||
| response.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return response; | |||||
| } | |||||
| @RequestMapping(value = "queryPage", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | |||||
| @ApiOperation(value = "分页查询") | |||||
| public ApiResponse queryPage(@ApiParam() @RequestBody RequestParameter parameter) { | |||||
| log.info("分页查询 ==== 参数{" + parameter.toString() + "}"); | |||||
| ApiResponse apiResponse = new ApiResponse(); | |||||
| if (!Objects.isNull(parameter) && !Objects.isNull(parameter.getParameter())) { | |||||
| try { | |||||
| apiResponse.setData(userService.queryPageTrial(parameter)); | |||||
| apiResponse.setMessage(ResponseMsgConstants.OPERATE_SUCCESS); | |||||
| } catch (Exception e) { | |||||
| log.error("查询错误,errMsg==={}", e.getMessage()); | |||||
| e.printStackTrace(); | |||||
| apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| } else { | |||||
| apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return apiResponse; | |||||
| } | |||||
| @RequestMapping(value = "setTrial", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| @ApiOperation(value = "配置试用账号") | |||||
| public ApiResponse setTrial(@ApiParam("{\n" + | |||||
| "\"id\":\"id\",\n" + | |||||
| "\"trialStatus\":\"1试用中2冻结\",\n" + | |||||
| "\"trialDay\":\"试用天数\",\n" + | |||||
| "}") @RequestBody User entity, String ticket) { | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return userService.setTrial(entity,ticket); | |||||
| } catch (Exception e) { | |||||
| response.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return response; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,14 @@ | |||||
| package com.fxzy.warn.mapper; | |||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
| import com.fxzy.warn.model.Contract; | |||||
| import org.apache.ibatis.annotations.Mapper; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2024/12/04 14:48 | |||||
| * @description | |||||
| */ | |||||
| @Mapper | |||||
| public interface ContractMapper extends BaseMapper<Contract> { | |||||
| } | |||||
| @ -0,0 +1,14 @@ | |||||
| package com.fxzy.warn.mapper; | |||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
| import com.fxzy.warn.model.Report; | |||||
| import org.apache.ibatis.annotations.Mapper; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2024/12/04 14:48 | |||||
| * @description | |||||
| */ | |||||
| @Mapper | |||||
| public interface ReportMapper extends BaseMapper<Report> { | |||||
| } | |||||
| @ -0,0 +1,55 @@ | |||||
| package com.fxzy.warn.model; | |||||
| import com.baomidou.mybatisplus.annotation.IdType; | |||||
| import com.baomidou.mybatisplus.annotation.TableId; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | |||||
| import java.math.BigDecimal; | |||||
| import java.util.Date; | |||||
| /** | |||||
| * 合同 | |||||
| * | |||||
| * @author zhangjing | |||||
| * @date 2024/12/05 14:07 | |||||
| * @description | |||||
| */ | |||||
| @Data | |||||
| @TableName("t_contract") | |||||
| public class Contract extends BaseField { | |||||
| /** | |||||
| * id | |||||
| */ | |||||
| @ApiModelProperty("id") | |||||
| @TableId(type = IdType.AUTO) | |||||
| private Integer id; | |||||
| /** | |||||
| * 关联用户 | |||||
| */ | |||||
| @ApiModelProperty("关联用户") | |||||
| private Integer userId; | |||||
| /** | |||||
| * 合同签订日期 | |||||
| */ | |||||
| @ApiModelProperty("合同签订日期") | |||||
| @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") | |||||
| private Date signingDate; | |||||
| /** | |||||
| * 合同金额 | |||||
| */ | |||||
| @ApiModelProperty("合同金额") | |||||
| private BigDecimal contractAmount; | |||||
| /** | |||||
| * 合同url | |||||
| */ | |||||
| @ApiModelProperty("合同url") | |||||
| private String fileUrl; | |||||
| /** | |||||
| * 发票url | |||||
| */ | |||||
| @ApiModelProperty("发票url") | |||||
| private String invoiceUrl; | |||||
| } | |||||
| @ -0,0 +1,61 @@ | |||||
| package com.fxzy.warn.model; | |||||
| import com.baomidou.mybatisplus.annotation.IdType; | |||||
| import com.baomidou.mybatisplus.annotation.TableId; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.fasterxml.jackson.annotation.JsonFormat; | |||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | |||||
| import java.util.Date; | |||||
| /** | |||||
| * 司法报告 | |||||
| * @author zhangjing | |||||
| * @date 2024/12/05 14:07 | |||||
| * @description | |||||
| */ | |||||
| @Data | |||||
| @TableName("t_report") | |||||
| public class Report extends BaseField{ | |||||
| /** | |||||
| * id | |||||
| */ | |||||
| @ApiModelProperty("id") | |||||
| @TableId(type = IdType.AUTO) | |||||
| private Integer id; | |||||
| /** | |||||
| * 报告名称 | |||||
| */ | |||||
| @ApiModelProperty("报告名称") | |||||
| private String name; | |||||
| /** | |||||
| * 报告类型 | |||||
| */ | |||||
| @ApiModelProperty("报告类型") | |||||
| private String type; | |||||
| /** | |||||
| * 报告时间 | |||||
| */ | |||||
| @ApiModelProperty("报告时间") | |||||
| @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") | |||||
| private Date reportTime; | |||||
| /** | |||||
| * 企业名称 | |||||
| */ | |||||
| @ApiModelProperty("企业名称") | |||||
| private String companyName; | |||||
| /** | |||||
| * 关联业务id | |||||
| */ | |||||
| @ApiModelProperty("关联业务id") | |||||
| private Integer businessId; | |||||
| /** | |||||
| * 是否已读 | |||||
| */ | |||||
| @ApiModelProperty("是否已读") | |||||
| private Integer isRead; | |||||
| } | |||||
| @ -0,0 +1,48 @@ | |||||
| package com.fxzy.warn.service; | |||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
| import com.baomidou.mybatisplus.extension.service.IService; | |||||
| import com.fxzy.warn.common.request.RequestParameter; | |||||
| import com.fxzy.warn.common.response.ApiResponse; | |||||
| import com.fxzy.warn.model.Contract; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| public interface ContractService extends IService<Contract> { | |||||
| /** | |||||
| * 保存 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse saveModel(Contract entity,String ticket); | |||||
| /** | |||||
| * 修改 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse updateModel(Contract entity,String ticket); | |||||
| /** | |||||
| * 删除 | |||||
| * @param ids | |||||
| * @return | |||||
| */ | |||||
| ApiResponse deleteModel(List<String> ids); | |||||
| /** | |||||
| * 分页查询 | |||||
| * @param parameter | |||||
| * @return | |||||
| */ | |||||
| Page<Contract> queryPage(RequestParameter parameter); | |||||
| } | |||||
| @ -0,0 +1,48 @@ | |||||
| package com.fxzy.warn.service; | |||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
| import com.baomidou.mybatisplus.extension.service.IService; | |||||
| import com.fxzy.warn.common.request.RequestParameter; | |||||
| import com.fxzy.warn.common.response.ApiResponse; | |||||
| import com.fxzy.warn.model.Report; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| public interface ReportService extends IService<Report> { | |||||
| /** | |||||
| * 保存 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse saveModel(Report entity,String ticket); | |||||
| /** | |||||
| * 修改 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse updateModel(Report entity,String ticket); | |||||
| /** | |||||
| * 删除 | |||||
| * @param ids | |||||
| * @return | |||||
| */ | |||||
| ApiResponse deleteModel(List<String> ids); | |||||
| /** | |||||
| * 分页查询 | |||||
| * @param parameter | |||||
| * @return | |||||
| */ | |||||
| Page<Report> queryPage(RequestParameter parameter); | |||||
| } | |||||
| @ -0,0 +1,58 @@ | |||||
| package com.fxzy.warn.service.impl; | |||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
| import com.fxzy.warn.common.constants.EntityConstants; | |||||
| import com.fxzy.warn.common.request.RequestParameter; | |||||
| import com.fxzy.warn.common.response.ApiResponse; | |||||
| import com.fxzy.warn.mapper.ContractMapper; | |||||
| import com.fxzy.warn.model.Contract; | |||||
| import com.fxzy.warn.service.ContractService; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| @Service | |||||
| public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> implements | |||||
| ContractService { | |||||
| @Override | |||||
| public ApiResponse saveModel(Contract entity, String ticket) { | |||||
| save(entity); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public ApiResponse updateModel(Contract entity,String ticket) { | |||||
| this.updateById(entity); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public ApiResponse deleteModel(List<String> ids) { | |||||
| Contract entity = new Contract(); | |||||
| entity.setIsDel(EntityConstants.DEL); | |||||
| QueryWrapper wrapper = new QueryWrapper(); | |||||
| wrapper.in("id", ids); | |||||
| update(entity, wrapper); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public Page<Contract> queryPage(RequestParameter parameter) { | |||||
| Contract entity = parameter.getParameter().toJavaObject(Contract.class); | |||||
| Page<Contract> page = new Page<Contract>(parameter.getCurrent(), parameter.getSize()); | |||||
| page.setSearchCount(true); | |||||
| page.setOptimizeCountSql(true); | |||||
| QueryWrapper<Contract> eWrapper = new QueryWrapper<Contract>(entity); | |||||
| Page<Contract> result = this.page(page, eWrapper); | |||||
| return result; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,58 @@ | |||||
| package com.fxzy.warn.service.impl; | |||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
| import com.fxzy.warn.common.constants.EntityConstants; | |||||
| import com.fxzy.warn.common.request.RequestParameter; | |||||
| import com.fxzy.warn.common.response.ApiResponse; | |||||
| import com.fxzy.warn.mapper.ReportMapper; | |||||
| import com.fxzy.warn.model.Report; | |||||
| import com.fxzy.warn.service.ReportService; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| @Service | |||||
| public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> implements | |||||
| ReportService { | |||||
| @Override | |||||
| public ApiResponse saveModel(Report entity, String ticket) { | |||||
| save(entity); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public ApiResponse updateModel(Report entity,String ticket) { | |||||
| this.updateById(entity); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public ApiResponse deleteModel(List<String> ids) { | |||||
| Report entity = new Report(); | |||||
| entity.setIsDel(EntityConstants.DEL); | |||||
| QueryWrapper wrapper = new QueryWrapper(); | |||||
| wrapper.in("id", ids); | |||||
| update(entity, wrapper); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public Page<Report> queryPage(RequestParameter parameter) { | |||||
| Report entity = parameter.getParameter().toJavaObject(Report.class); | |||||
| Page<Report> page = new Page<Report>(parameter.getCurrent(), parameter.getSize()); | |||||
| page.setSearchCount(true); | |||||
| page.setOptimizeCountSql(true); | |||||
| QueryWrapper<Report> eWrapper = new QueryWrapper<Report>(entity); | |||||
| Page<Report> result = this.page(page, eWrapper); | |||||
| return result; | |||||
| } | |||||
| } | |||||