| @ -0,0 +1,116 @@ | |||||
| 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.Announcement; | |||||
| import com.fxzy.warn.service.AnnouncementService; | |||||
| 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("announcement/") | |||||
| @Slf4j | |||||
| public class AnnouncementController { | |||||
| @Resource | |||||
| private AnnouncementService announcementService ; | |||||
| @RequestMapping(value = "save", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| @ApiOperation(value = "新增") | |||||
| public ApiResponse save(@ApiParam("{\n" + | |||||
| "\"title\":\"标题\",\n" + | |||||
| "\"content\":\"公告内容\",\n" + | |||||
| "}") @RequestBody Announcement entity, @RequestHeader String ticket) { | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return announcementService.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 Announcement entity,@RequestHeader String ticket) { | |||||
| log.info("修改==== 参数{" + entity != null ? entity.toString() : "null" + "}"); | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return announcementService.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 announcementService.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(announcementService.queryPage(parameter)); | |||||
| apiResponse.setMessage(ResponseMsgConstants.OPERATE_SUCCESS); | |||||
| } catch (Exception e) { | |||||
| apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return apiResponse; | |||||
| } | |||||
| /** | |||||
| * 发布 | |||||
| * | |||||
| * @param | |||||
| * @return | |||||
| */ | |||||
| @ResponseBody | |||||
| @ApiOperation(value = "发布") | |||||
| @RequestMapping(value = "release", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| public ApiResponse release(@ApiParam("{\n" + | |||||
| "\"id\":\"标题\",\n" + | |||||
| "\"isRelease\":\"是否发布\",\n" + | |||||
| "}") @RequestBody Announcement entity,@RequestHeader String ticket) { | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return announcementService.release(entity,ticket); | |||||
| } catch (Exception e) { | |||||
| response.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return response; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,56 @@ | |||||
| package com.fxzy.warn.controller; | |||||
| import com.alibaba.fastjson.JSONObject; | |||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
| 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.AuditRecords; | |||||
| import com.fxzy.warn.service.AuditRecordsService; | |||||
| 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("auditRecords/") | |||||
| @Slf4j | |||||
| public class AuditRecordsController { | |||||
| @Resource | |||||
| private AuditRecordsService auditRecordsService ; | |||||
| @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(auditRecordsService.queryPage(parameter)); | |||||
| } catch (Exception e) { | |||||
| apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return apiResponse; | |||||
| } | |||||
| @RequestMapping(value = "record", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) | |||||
| @ApiOperation(value = "授权审批记录") | |||||
| public ApiResponse record(@ApiParam() @RequestBody JSONObject jsonObject) { | |||||
| ApiResponse apiResponse = new ApiResponse(); | |||||
| try { | |||||
| apiResponse.setData(auditRecordsService.record(jsonObject.getInteger("id"))); | |||||
| } catch (Exception e) { | |||||
| apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return apiResponse; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,122 @@ | |||||
| 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.NewsManage; | |||||
| import com.fxzy.warn.service.NewsManageService; | |||||
| 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("newsManage/") | |||||
| @Slf4j | |||||
| public class NewsManageController { | |||||
| @Resource | |||||
| private NewsManageService newsManageService ; | |||||
| @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" + | |||||
| "\"authorizationId\":\"内容简述\"\n" + | |||||
| "\"authorizationId\":\"缩略图 URL\"\n" + | |||||
| "\"authorizationId\":\"内容详情\"\n" + | |||||
| "}") @RequestBody NewsManage entity, @RequestHeader String ticket) { | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return newsManageService.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 NewsManage entity,@RequestHeader String ticket) { | |||||
| log.info("修改==== 参数{" + entity != null ? entity.toString() : "null" + "}"); | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return newsManageService.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 newsManageService.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(newsManageService.queryPage(parameter)); | |||||
| apiResponse.setMessage(ResponseMsgConstants.OPERATE_SUCCESS); | |||||
| } catch (Exception e) { | |||||
| apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return apiResponse; | |||||
| } | |||||
| /** | |||||
| * 发布 | |||||
| * | |||||
| * @param | |||||
| * @return | |||||
| */ | |||||
| @ResponseBody | |||||
| @ApiOperation(value = "发布") | |||||
| @RequestMapping(value = "publish", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| public ApiResponse publish(@ApiParam("{\n" + | |||||
| "\"id\":\"id\",\n" + | |||||
| "\"status\":\"0待发布1发布\",\n" + | |||||
| "}") @RequestBody NewsManage entity,@RequestHeader String ticket) { | |||||
| log.info("修改==== 参数{" + entity != null ? entity.toString() : "null" + "}"); | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return newsManageService.publish(entity,ticket); | |||||
| } catch (Exception e) { | |||||
| response.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return response; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,96 @@ | |||||
| 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.Permission; | |||||
| import com.fxzy.warn.service.PermissionService; | |||||
| 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("Permission/") | |||||
| @Slf4j | |||||
| public class PermissionController { | |||||
| @Resource | |||||
| private PermissionService permissionService ; | |||||
| @RequestMapping(value = "save", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| @ApiOperation(value = "新增") | |||||
| public ApiResponse save(@ApiParam("{\n" + | |||||
| "\"name\":\"名称\",\n" + | |||||
| "\"organization\":\"组织\",\n" + | |||||
| "}") @RequestBody Permission entity, @RequestHeader String ticket) { | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return permissionService.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 Permission entity,@RequestHeader String ticket) { | |||||
| log.info("修改==== 参数{" + entity != null ? entity.toString() : "null" + "}"); | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return permissionService.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 permissionService.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(permissionService.queryPage(parameter)); | |||||
| apiResponse.setMessage(ResponseMsgConstants.OPERATE_SUCCESS); | |||||
| } catch (Exception e) { | |||||
| apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return apiResponse; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,96 @@ | |||||
| 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.VersionManage; | |||||
| import com.fxzy.warn.service.VersionManageService; | |||||
| 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("versionManage/") | |||||
| @Slf4j | |||||
| public class VersionManageController { | |||||
| @Resource | |||||
| private VersionManageService versionManageService ; | |||||
| @RequestMapping(value = "save", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) | |||||
| @ApiOperation(value = "新增") | |||||
| public ApiResponse save(@ApiParam("{\n" + | |||||
| "\"versionTitle\":\"版本标题\",\n" + | |||||
| "\"versionNumber\":\"版本号\",\n" + | |||||
| "\"versionInfo\":\"版本信息\",\n" + | |||||
| "}") @RequestBody VersionManage entity, @RequestHeader String ticket) { | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return versionManageService.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 VersionManage entity,@RequestHeader String ticket) { | |||||
| log.info("修改==== 参数{" + entity != null ? entity.toString() : "null" + "}"); | |||||
| ApiResponse response = new ApiResponse(); | |||||
| try { | |||||
| return versionManageService.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 versionManageService.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(versionManageService.queryPage(parameter)); | |||||
| } catch (Exception e) { | |||||
| apiResponse.recordError(ResponseMsgConstants.OPERATE_FAIL); | |||||
| } | |||||
| return apiResponse; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,14 @@ | |||||
| package com.fxzy.warn.mapper; | |||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
| import com.fxzy.warn.model.Announcement; | |||||
| import org.apache.ibatis.annotations.Mapper; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2024/12/04 14:48 | |||||
| * @description | |||||
| */ | |||||
| @Mapper | |||||
| public interface AnnouncementMapper extends BaseMapper<Announcement> { | |||||
| } | |||||
| @ -0,0 +1,14 @@ | |||||
| package com.fxzy.warn.mapper; | |||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
| import com.fxzy.warn.model.NewsManage; | |||||
| import org.apache.ibatis.annotations.Mapper; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2024/12/04 14:48 | |||||
| * @description | |||||
| */ | |||||
| @Mapper | |||||
| public interface NewsManageMapper extends BaseMapper<NewsManage> { | |||||
| } | |||||
| @ -0,0 +1,14 @@ | |||||
| package com.fxzy.warn.mapper; | |||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
| import com.fxzy.warn.model.Permission; | |||||
| import org.apache.ibatis.annotations.Mapper; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2024/12/04 14:48 | |||||
| * @description | |||||
| */ | |||||
| @Mapper | |||||
| public interface PermissionMapper extends BaseMapper<Permission> { | |||||
| } | |||||
| @ -0,0 +1,15 @@ | |||||
| package com.fxzy.warn.mapper; | |||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
| import com.fxzy.warn.model.Permission; | |||||
| import com.fxzy.warn.model.PermissionUser; | |||||
| import org.apache.ibatis.annotations.Mapper; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2024/12/04 14:48 | |||||
| * @description | |||||
| */ | |||||
| @Mapper | |||||
| public interface PermissionUserMapper extends BaseMapper<PermissionUser> { | |||||
| } | |||||
| @ -0,0 +1,14 @@ | |||||
| package com.fxzy.warn.mapper; | |||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
| import com.fxzy.warn.model.VersionManage; | |||||
| import org.apache.ibatis.annotations.Mapper; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2024/12/04 14:48 | |||||
| * @description | |||||
| */ | |||||
| @Mapper | |||||
| public interface VersionManageMapper extends BaseMapper<VersionManage> { | |||||
| } | |||||
| @ -0,0 +1,65 @@ | |||||
| 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_announcement") | |||||
| public class Announcement extends BaseField{ | |||||
| /** | |||||
| * id | |||||
| */ | |||||
| @ApiModelProperty("id") | |||||
| @TableId(type = IdType.AUTO) | |||||
| private Integer id; | |||||
| /** | |||||
| * 版本标题 | |||||
| */ | |||||
| @ApiModelProperty("标题") | |||||
| private String title; | |||||
| /** | |||||
| * 版本信息 | |||||
| */ | |||||
| @ApiModelProperty("公告内容") | |||||
| private String content; | |||||
| /** | |||||
| * 发布时间 | |||||
| */ | |||||
| @ApiModelProperty("公告时间") | |||||
| @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") | |||||
| private Date announcementTime; | |||||
| /** | |||||
| * 发布人id | |||||
| */ | |||||
| @ApiModelProperty("发布人id") | |||||
| private Integer releasedUserId; | |||||
| /** | |||||
| * 发布人姓名 | |||||
| */ | |||||
| @ApiModelProperty("发布人姓名") | |||||
| private String releasedUserName; | |||||
| /** | |||||
| * 发布时间 | |||||
| */ | |||||
| @ApiModelProperty("发布时间") | |||||
| @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") | |||||
| private Date releasedTime; | |||||
| /** | |||||
| * 是否发布 | |||||
| */ | |||||
| @ApiModelProperty("是否发布") | |||||
| private Integer isRelease; | |||||
| } | |||||
| @ -0,0 +1,72 @@ | |||||
| package com.fxzy.warn.model; | |||||
| import com.baomidou.mybatisplus.annotation.IdType; | |||||
| import com.baomidou.mybatisplus.annotation.TableId; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | |||||
| import java.util.Date; | |||||
| /** | |||||
| * 新闻资讯管理 | |||||
| * @author zhangjing | |||||
| * @date 2024/12/05 14:07 | |||||
| * @description | |||||
| */ | |||||
| @Data | |||||
| @TableName("t_news_manage") | |||||
| public class NewsManage extends BaseField{ | |||||
| /** | |||||
| * id | |||||
| */ | |||||
| @ApiModelProperty("id") | |||||
| @TableId(type = IdType.AUTO) | |||||
| private Integer id; | |||||
| /** | |||||
| * 文章标题 | |||||
| */ | |||||
| @ApiModelProperty("文章标题") | |||||
| private String title; | |||||
| /** | |||||
| * 文章类型 | |||||
| */ | |||||
| @ApiModelProperty("文章类型") | |||||
| private String type; | |||||
| /** | |||||
| * 发布范围 | |||||
| */ | |||||
| @ApiModelProperty("发布范围") | |||||
| private String publishScope; | |||||
| /** | |||||
| * 发布时间 | |||||
| */ | |||||
| @ApiModelProperty("发布时间") | |||||
| private Date publishTime; | |||||
| /** | |||||
| * 内容简述 | |||||
| */ | |||||
| @ApiModelProperty("内容简述") | |||||
| private String contentSummary; | |||||
| /** | |||||
| * 缩略图 URL | |||||
| */ | |||||
| @ApiModelProperty("缩略图 URL") | |||||
| private String thumbnail; | |||||
| /** | |||||
| * 内容详情 | |||||
| */ | |||||
| @ApiModelProperty("内容详情") | |||||
| private String contentDetails; | |||||
| /** | |||||
| * 阅读次数 | |||||
| */ | |||||
| @ApiModelProperty("阅读次数") | |||||
| private Integer readCount; | |||||
| /** | |||||
| * 发布状态 | |||||
| */ | |||||
| @ApiModelProperty("发布状态") | |||||
| private Integer status; | |||||
| } | |||||
| @ -0,0 +1,42 @@ | |||||
| package com.fxzy.warn.model; | |||||
| import com.baomidou.mybatisplus.annotation.IdType; | |||||
| import com.baomidou.mybatisplus.annotation.TableId; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | |||||
| import java.util.Date; | |||||
| /** | |||||
| * 新闻资讯管理 | |||||
| * @author zhangjing | |||||
| * @date 2024/12/05 14:07 | |||||
| * @description | |||||
| */ | |||||
| @Data | |||||
| @TableName("t_permission") | |||||
| public class Permission extends BaseField{ | |||||
| /** | |||||
| * id | |||||
| */ | |||||
| @ApiModelProperty("id") | |||||
| @TableId(type = IdType.AUTO) | |||||
| private Integer id; | |||||
| /** | |||||
| * 文章标题 | |||||
| */ | |||||
| @ApiModelProperty("名称") | |||||
| private String name; | |||||
| /** | |||||
| * 文章类型 | |||||
| */ | |||||
| @ApiModelProperty("状态") | |||||
| private String status; | |||||
| /** | |||||
| * 发布范围 | |||||
| */ | |||||
| @ApiModelProperty("组织") | |||||
| private String organization; | |||||
| } | |||||
| @ -0,0 +1,37 @@ | |||||
| 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.baomidou.mybatisplus.extension.activerecord.Model; | |||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | |||||
| /** | |||||
| * 新闻资讯管理 | |||||
| * @author zhangjing | |||||
| * @date 2024/12/05 14:07 | |||||
| * @description | |||||
| */ | |||||
| @Data | |||||
| @TableName("t_permission_user") | |||||
| public class PermissionUser extends Model<PermissionUser> { | |||||
| /** | |||||
| * id | |||||
| */ | |||||
| @ApiModelProperty("id") | |||||
| @TableId(type = IdType.AUTO) | |||||
| private Integer id; | |||||
| /** | |||||
| * 权限id | |||||
| */ | |||||
| @ApiModelProperty("权限id") | |||||
| private Integer permissionId; | |||||
| /** | |||||
| * userId | |||||
| */ | |||||
| @ApiModelProperty("userId") | |||||
| private Integer userId; | |||||
| } | |||||
| @ -0,0 +1,67 @@ | |||||
| package com.fxzy.warn.model; | |||||
| import com.baomidou.mybatisplus.annotation.*; | |||||
| 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_version_manage") | |||||
| public class VersionManage extends BaseField{ | |||||
| /** | |||||
| * id | |||||
| */ | |||||
| @ApiModelProperty("id") | |||||
| @TableId(type = IdType.AUTO) | |||||
| private Integer id; | |||||
| /** | |||||
| * 版本标题 | |||||
| */ | |||||
| @ApiModelProperty("版本标题") | |||||
| private String versionTitle; | |||||
| /** | |||||
| * 版本号 | |||||
| */ | |||||
| @ApiModelProperty("版本号") | |||||
| private String versionNumber; | |||||
| /** | |||||
| * 版本信息 | |||||
| */ | |||||
| @ApiModelProperty("版本信息") | |||||
| private String versionInfo ; | |||||
| /** | |||||
| * 发布时间 | |||||
| */ | |||||
| @ApiModelProperty("发布时间") | |||||
| @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") | |||||
| private Date publishTime; | |||||
| /** | |||||
| * 发布人id | |||||
| */ | |||||
| @ApiModelProperty("发布人id") | |||||
| private String publishUserId; | |||||
| /** | |||||
| * 发布人姓名 | |||||
| */ | |||||
| @ApiModelProperty("发布人姓名") | |||||
| private String publishUserName; | |||||
| /** | |||||
| * 上架时间 | |||||
| */ | |||||
| @ApiModelProperty("上架时间") | |||||
| @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") | |||||
| private Date shelfTime; | |||||
| /** | |||||
| * 是否上架 | |||||
| */ | |||||
| @ApiModelProperty("是否上架") | |||||
| private Integer isShelf; | |||||
| } | |||||
| @ -0,0 +1,116 @@ | |||||
| package com.fxzy.warn.model.vo; | |||||
| 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.fxzy.warn.model.File; | |||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | |||||
| import java.util.Date; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2024/12/06 10:48 | |||||
| * @description | |||||
| */ | |||||
| @Data | |||||
| public class UserVO { | |||||
| /** | |||||
| * id | |||||
| */ | |||||
| @ApiModelProperty("id") | |||||
| @TableId(type = IdType.AUTO) | |||||
| private Integer id; | |||||
| /** | |||||
| * 企业名称 | |||||
| */ | |||||
| @ApiModelProperty("企业名称") | |||||
| private String companyName; | |||||
| /** | |||||
| * 统一社会信用代码 | |||||
| */ | |||||
| @ApiModelProperty("统一社会信用代码") | |||||
| private String creditCode; | |||||
| /** | |||||
| * 企业法人 | |||||
| */ | |||||
| @ApiModelProperty("企业法人") | |||||
| private String legalPerson; | |||||
| /** | |||||
| * 手机号 | |||||
| */ | |||||
| @ApiModelProperty("手机号") | |||||
| private String phoneNumber; | |||||
| /** | |||||
| * 邮箱 | |||||
| */ | |||||
| @ApiModelProperty("邮箱") | |||||
| private String email; | |||||
| /** | |||||
| * 所在省 | |||||
| */ | |||||
| @ApiModelProperty("所在省") | |||||
| private String province; | |||||
| /** | |||||
| * 所在市 | |||||
| */ | |||||
| @ApiModelProperty("所在市") | |||||
| private String city; | |||||
| /** | |||||
| * 所在区 | |||||
| */ | |||||
| @ApiModelProperty("所在区") | |||||
| private String district; | |||||
| /** | |||||
| * 详细地址 | |||||
| */ | |||||
| @ApiModelProperty("详细地址") | |||||
| private String detailedAddress; | |||||
| /** | |||||
| * 商务负责人 | |||||
| */ | |||||
| @ApiModelProperty("商务负责人") | |||||
| private String businessPerson; | |||||
| /** | |||||
| * 备注 | |||||
| */ | |||||
| @ApiModelProperty("备注") | |||||
| private String remarks; | |||||
| /** | |||||
| * 授权id | |||||
| */ | |||||
| @ApiModelProperty("授权id") | |||||
| private Integer authorizationId; | |||||
| /** | |||||
| * 是否为正式账号 | |||||
| */ | |||||
| @ApiModelProperty("是否为正式账号") | |||||
| private Integer isOfficialAccount; | |||||
| /** | |||||
| * 授权状态 0待申请1待审批2授权有效3授权过期 | |||||
| */ | |||||
| @ApiModelProperty("授权状态 0待申请1待审批2授权有效3授权过期") | |||||
| private Integer authorizationStatus; | |||||
| /** | |||||
| * 授权开始日期 | |||||
| */ | |||||
| @ApiModelProperty("授权开始日期") | |||||
| @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") | |||||
| private Date startDate; | |||||
| /** | |||||
| * 授权截止日期 | |||||
| */ | |||||
| @ApiModelProperty("授权截止日期") | |||||
| @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") | |||||
| private Date endDate; | |||||
| /** | |||||
| * 授权书 | |||||
| */ | |||||
| @ApiModelProperty("授权书") | |||||
| private File file; | |||||
| } | |||||
| @ -0,0 +1,53 @@ | |||||
| 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.Announcement; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| public interface AnnouncementService extends IService<Announcement> { | |||||
| /** | |||||
| * 保存 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse saveModel(Announcement entity,String ticket); | |||||
| /** | |||||
| * 修改 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse updateModel(Announcement entity,String ticket); | |||||
| /** | |||||
| * 删除 | |||||
| * @param ids | |||||
| * @return | |||||
| */ | |||||
| ApiResponse deleteModel(List<String> ids); | |||||
| /** | |||||
| * 分页查询 | |||||
| * @param parameter | |||||
| * @return | |||||
| */ | |||||
| Page<Announcement> queryPage(RequestParameter parameter); | |||||
| /** | |||||
| * 修改 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse release(Announcement entity,String ticket); | |||||
| } | |||||
| @ -0,0 +1,53 @@ | |||||
| 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.NewsManage; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| public interface NewsManageService extends IService<NewsManage> { | |||||
| /** | |||||
| * 保存 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse saveModel(NewsManage entity,String ticket); | |||||
| /** | |||||
| * 修改 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse updateModel(NewsManage entity,String ticket); | |||||
| /** | |||||
| * 删除 | |||||
| * @param ids | |||||
| * @return | |||||
| */ | |||||
| ApiResponse deleteModel(List<String> ids); | |||||
| /** | |||||
| * 分页查询 | |||||
| * @param parameter | |||||
| * @return | |||||
| */ | |||||
| Page<NewsManage> queryPage(RequestParameter parameter); | |||||
| /** | |||||
| * 发布 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse publish(NewsManage entity,String ticket); | |||||
| } | |||||
| @ -0,0 +1,53 @@ | |||||
| 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.Permission; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| public interface PermissionService extends IService<Permission> { | |||||
| /** | |||||
| * 保存 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse saveModel(Permission entity,String ticket); | |||||
| /** | |||||
| * 修改 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse updateModel(Permission entity,String ticket); | |||||
| /** | |||||
| * 删除 | |||||
| * @param ids | |||||
| * @return | |||||
| */ | |||||
| ApiResponse deleteModel(List<String> ids); | |||||
| /** | |||||
| * 分页查询 | |||||
| * @param parameter | |||||
| * @return | |||||
| */ | |||||
| Page<Permission> queryPage(RequestParameter parameter); | |||||
| /** | |||||
| * 维护人员 | |||||
| * @param ids | |||||
| * @return | |||||
| */ | |||||
| ApiResponse bindPerson(Integer permissionId,List<Integer> ids); | |||||
| } | |||||
| @ -0,0 +1,44 @@ | |||||
| 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.Permission; | |||||
| import com.fxzy.warn.model.PermissionUser; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| public interface PermissionUserService extends IService<PermissionUser> { | |||||
| /** | |||||
| * 保存 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| void saveModel(PermissionUser entity,String ticket); | |||||
| /** | |||||
| * 修改 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| void updateModel(PermissionUser entity,String ticket); | |||||
| /** | |||||
| * 删除 | |||||
| * @param ids | |||||
| * @return | |||||
| */ | |||||
| void deleteModel(List<String> ids); | |||||
| } | |||||
| @ -0,0 +1,53 @@ | |||||
| 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.VersionManage; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| public interface VersionManageService extends IService<VersionManage> { | |||||
| /** | |||||
| * 保存 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse saveModel(VersionManage entity,String ticket); | |||||
| /** | |||||
| * 修改 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse updateModel(VersionManage entity,String ticket); | |||||
| /** | |||||
| * 删除 | |||||
| * @param ids | |||||
| * @return | |||||
| */ | |||||
| ApiResponse deleteModel(List<String> ids); | |||||
| /** | |||||
| * 分页查询 | |||||
| * @param parameter | |||||
| * @return | |||||
| */ | |||||
| Page<VersionManage> queryPage(RequestParameter parameter); | |||||
| /** | |||||
| * 上架 | |||||
| * @param entity | |||||
| * @return | |||||
| */ | |||||
| ApiResponse shelf(VersionManage entity,String ticket); | |||||
| } | |||||
| @ -0,0 +1,80 @@ | |||||
| 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.AnnouncementMapper; | |||||
| import com.fxzy.warn.model.Announcement; | |||||
| import com.fxzy.warn.model.User; | |||||
| import com.fxzy.warn.model.vo.UserVO; | |||||
| import com.fxzy.warn.service.AnnouncementService; | |||||
| import com.fxzy.warn.service.UserService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| @Service | |||||
| public class AnnouncementServiceImpl extends ServiceImpl<AnnouncementMapper, Announcement> implements | |||||
| AnnouncementService { | |||||
| @Autowired | |||||
| private UserService userService; | |||||
| @Override | |||||
| public ApiResponse saveModel(Announcement entity, String ticket) { | |||||
| save(entity); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public ApiResponse updateModel(Announcement entity,String ticket) { | |||||
| this.updateById(entity); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public ApiResponse deleteModel(List<String> ids) { | |||||
| Announcement entity = new Announcement(); | |||||
| entity.setIsDel(EntityConstants.DEL); | |||||
| QueryWrapper wrapper = new QueryWrapper(); | |||||
| wrapper.in("id", ids); | |||||
| update(entity, wrapper); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public Page<Announcement> queryPage(RequestParameter parameter) { | |||||
| Announcement entity = parameter.getParameter().toJavaObject(Announcement.class); | |||||
| Page<Announcement> page = new Page<Announcement>(parameter.getCurrent(), parameter.getSize()); | |||||
| page.setSearchCount(true); | |||||
| page.setOptimizeCountSql(true); | |||||
| QueryWrapper<Announcement> eWrapper = new QueryWrapper<Announcement>(entity); | |||||
| Page<Announcement> result = this.page(page, eWrapper); | |||||
| return result; | |||||
| } | |||||
| @Override | |||||
| public ApiResponse release(Announcement entity, String ticket) { | |||||
| ApiResponse response = new ApiResponse(); | |||||
| User user = userService.getUserByTicket(ticket); | |||||
| if (user == null) { | |||||
| response.recordError(501); | |||||
| return response; | |||||
| } | |||||
| entity.setReleasedTime(new Date()); | |||||
| entity.setReleasedUserId(user.getId()); | |||||
| entity.setReleasedUserName(user.getBusinessPerson()); | |||||
| updateById(entity); | |||||
| return response; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,68 @@ | |||||
| 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.NewsManageMapper; | |||||
| import com.fxzy.warn.model.NewsManage; | |||||
| import com.fxzy.warn.service.NewsManageService; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| @Service | |||||
| public class NewsManageServiceImpl extends ServiceImpl<NewsManageMapper, NewsManage> implements | |||||
| NewsManageService { | |||||
| @Override | |||||
| public ApiResponse saveModel(NewsManage entity, String ticket) { | |||||
| save(entity); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public ApiResponse updateModel(NewsManage entity,String ticket) { | |||||
| this.updateById(entity); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public ApiResponse deleteModel(List<String> ids) { | |||||
| NewsManage entity = new NewsManage(); | |||||
| entity.setIsDel(EntityConstants.DEL); | |||||
| QueryWrapper wrapper = new QueryWrapper(); | |||||
| wrapper.in("id", ids); | |||||
| update(entity, wrapper); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public Page<NewsManage> queryPage(RequestParameter parameter) { | |||||
| NewsManage entity = parameter.getParameter().toJavaObject(NewsManage.class); | |||||
| Page<NewsManage> page = new Page<NewsManage>(parameter.getCurrent(), parameter.getSize()); | |||||
| page.setSearchCount(true); | |||||
| page.setOptimizeCountSql(true); | |||||
| QueryWrapper<NewsManage> eWrapper = new QueryWrapper<NewsManage>(entity); | |||||
| Page<NewsManage> result = this.page(page, eWrapper); | |||||
| eWrapper.eq("is_del", EntityConstants.NORMAL) | |||||
| .orderByDesc("status") | |||||
| .orderByDesc("create_time"); | |||||
| return result; | |||||
| } | |||||
| @Override | |||||
| public ApiResponse publish(NewsManage entity, String ticket) { | |||||
| ApiResponse response = new ApiResponse(); | |||||
| updateById(entity); | |||||
| return response; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,84 @@ | |||||
| 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.PermissionMapper; | |||||
| import com.fxzy.warn.model.Permission; | |||||
| import com.fxzy.warn.model.PermissionUser; | |||||
| import com.fxzy.warn.service.PermissionService; | |||||
| import com.fxzy.warn.service.PermissionUserService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.ArrayList; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| @Service | |||||
| public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements | |||||
| PermissionService { | |||||
| @Autowired | |||||
| PermissionUserService permissionUserService; | |||||
| @Override | |||||
| public ApiResponse saveModel(Permission entity, String ticket) { | |||||
| save(entity); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public ApiResponse updateModel(Permission entity,String ticket) { | |||||
| this.updateById(entity); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public ApiResponse deleteModel(List<String> ids) { | |||||
| Permission entity = new Permission(); | |||||
| entity.setIsDel(EntityConstants.DEL); | |||||
| QueryWrapper wrapper = new QueryWrapper(); | |||||
| wrapper.in("id", ids); | |||||
| update(entity, wrapper); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public Page<Permission> queryPage(RequestParameter parameter) { | |||||
| Permission entity = parameter.getParameter().toJavaObject(Permission.class); | |||||
| Page<Permission> page = new Page<Permission>(parameter.getCurrent(), parameter.getSize()); | |||||
| page.setSearchCount(true); | |||||
| page.setOptimizeCountSql(true); | |||||
| QueryWrapper<Permission> eWrapper = new QueryWrapper<Permission>(entity); | |||||
| Page<Permission> result = this.page(page, eWrapper); | |||||
| eWrapper.eq("is_del", EntityConstants.NORMAL) | |||||
| .orderByDesc("create_time"); | |||||
| return result; | |||||
| } | |||||
| @Override | |||||
| public ApiResponse bindPerson(Integer permissionId, List<Integer> ids) { | |||||
| ApiResponse response = new ApiResponse(); | |||||
| QueryWrapper<PermissionUser> wrapper = new QueryWrapper(); | |||||
| wrapper.eq("permission_id",permissionId); | |||||
| permissionUserService.remove(wrapper); | |||||
| List<PermissionUser> list = new ArrayList<>(); | |||||
| for (Integer id : ids) { | |||||
| PermissionUser p = new PermissionUser(); | |||||
| p.setUserId(id); | |||||
| p.setPermissionId(permissionId); | |||||
| list.add(p); | |||||
| } | |||||
| permissionUserService.saveBatch(list); | |||||
| return response; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,45 @@ | |||||
| 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.PermissionUserMapper; | |||||
| import com.fxzy.warn.model.PermissionUser; | |||||
| import com.fxzy.warn.service.PermissionUserService; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| @Service | |||||
| public class PermissionUserServiceImpl extends ServiceImpl<PermissionUserMapper, PermissionUser> implements | |||||
| PermissionUserService { | |||||
| @Override | |||||
| public void saveModel(PermissionUser entity, String ticket) { | |||||
| save(entity); | |||||
| } | |||||
| @Override | |||||
| public void updateModel(PermissionUser entity,String ticket) { | |||||
| this.updateById(entity); | |||||
| } | |||||
| @Override | |||||
| public void deleteModel(List<String> ids) { | |||||
| QueryWrapper wrapper = new QueryWrapper(); | |||||
| wrapper.in("id", ids); | |||||
| remove(wrapper); | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,75 @@ | |||||
| 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.VersionManageMapper; | |||||
| import com.fxzy.warn.model.VersionManage; | |||||
| import com.fxzy.warn.service.VersionManageService; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author zhangjing | |||||
| * @date 2023/10/16 18:17 | |||||
| * @description | |||||
| */ | |||||
| @Service | |||||
| public class VersionManageServiceImpl extends ServiceImpl<VersionManageMapper, VersionManage> implements | |||||
| VersionManageService { | |||||
| @Override | |||||
| public ApiResponse saveModel(VersionManage entity, String ticket) { | |||||
| save(entity); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public ApiResponse updateModel(VersionManage entity, String ticket) { | |||||
| this.updateById(entity); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public ApiResponse deleteModel(List<String> ids) { | |||||
| VersionManage entity = new VersionManage(); | |||||
| entity.setIsDel(EntityConstants.DEL); | |||||
| QueryWrapper wrapper = new QueryWrapper(); | |||||
| wrapper.in("id", ids); | |||||
| update(entity, wrapper); | |||||
| return new ApiResponse(); | |||||
| } | |||||
| @Override | |||||
| public Page<VersionManage> queryPage(RequestParameter parameter) { | |||||
| VersionManage entity = parameter.getParameter().toJavaObject(VersionManage.class); | |||||
| Page<VersionManage> page = new Page<VersionManage>(parameter.getCurrent(), parameter.getSize()); | |||||
| page.setSearchCount(true); | |||||
| page.setOptimizeCountSql(true); | |||||
| QueryWrapper<VersionManage> eWrapper = new QueryWrapper<VersionManage>(entity); | |||||
| eWrapper.eq("is_del", EntityConstants.NORMAL) | |||||
| .orderByDesc("is_shelf") | |||||
| .orderByDesc("create_time"); | |||||
| Page<VersionManage> result = this.page(page, eWrapper); | |||||
| return result; | |||||
| } | |||||
| @Override | |||||
| public ApiResponse shelf(VersionManage entity, String ticket) { | |||||
| ApiResponse response = new ApiResponse(); | |||||
| QueryWrapper<VersionManage> wrapper = new QueryWrapper(); | |||||
| wrapper.eq("is_del", EntityConstants.NORMAL); | |||||
| wrapper.eq("is_shelf", EntityConstants.IS_ONLINE); | |||||
| if (entity.getIsShelf().equals(EntityConstants.IS_ONLINE) && getOne(wrapper) != null) { | |||||
| response.recordMsgError(EntityConstants.SHELF_MSG); | |||||
| return response; | |||||
| } | |||||
| updateById(entity); | |||||
| return response; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,24 @@ | |||||
| <?xml version="1.0" encoding="UTF-8" ?> | |||||
| <!DOCTYPE mapper | |||||
| PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||||
| "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
| <!-- 定义mapper接口路径 --> | |||||
| <mapper namespace="com.fxzy.warn.mapper.AuditRecordsMapper"> | |||||
| <select id="queryPage" resultMap="com.fxzy.warn.model.vo.UserVO"> | |||||
| SELECT | |||||
| u.company_name as companyName, | |||||
| u.credit_code as creditCode, | |||||
| u.legal_person as legalPerson, | |||||
| u.phone_number as phoneNumber, | |||||
| u.business_person as businessPerson, | |||||
| u.authorization_status as authorizationStatus, | |||||
| a.start_date as startDate, | |||||
| a.company_name as endDate | |||||
| FROM | |||||
| t_authorization a | |||||
| JOIN | |||||
| t_user u ON u.authorization_Id = a.id | |||||
| ORDER BY | |||||
| u.audit_date; | |||||
| </select> | |||||
| </mapper> | |||||