Compare commits
No commits in common. "main" and "master" have entirely different histories.
@ -1,11 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||||
<data-source source="LOCAL" name="demo@106.52.88.120" uuid="162927cd-2825-459f-87c5-04b4b06d32a9">
|
<data-source source="LOCAL" name="demo@106.52.88.120" uuid="494d4563-66cc-49c2-863b-5ab76f35808f">
|
||||||
<driver-ref>mysql.8</driver-ref>
|
<driver-ref>mysql.8</driver-ref>
|
||||||
<synchronize>true</synchronize>
|
<synchronize>true</synchronize>
|
||||||
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
||||||
<jdbc-url>jdbc:mysql://106.52.88.120:3306/demo</jdbc-url>
|
<jdbc-url>jdbc:mysql://106.52.88.120:3306/demo?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai</jdbc-url>
|
||||||
<jdbc-additional-properties>
|
<jdbc-additional-properties>
|
||||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_23" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="SqlDialectMappings">
|
|
||||||
<file url="PROJECT" dialect="MySQL" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
118
common/src/main/java/net/carbon/config/SwaggerConfiguration.java
Normal file
118
common/src/main/java/net/carbon/config/SwaggerConfiguration.java
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
package net.carbon.config;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import springfox.documentation.builders.*;
|
||||||
|
import springfox.documentation.oas.annotations.EnableOpenApi;
|
||||||
|
import springfox.documentation.schema.ScalarType;
|
||||||
|
import springfox.documentation.service.*;
|
||||||
|
import springfox.documentation.spi.DocumentationType;
|
||||||
|
import springfox.documentation.spring.web.plugins.Docket;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@EnableOpenApi
|
||||||
|
@Data
|
||||||
|
public class SwaggerConfiguration {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* C端文档
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public Docket webApiDoc() {
|
||||||
|
|
||||||
|
|
||||||
|
return new Docket(DocumentationType.OAS_30)
|
||||||
|
.groupName("用户端接口文档")
|
||||||
|
.pathMapping("/")
|
||||||
|
// 定义是否开启swagger,false为关闭,可以通过变量控制,线上关闭
|
||||||
|
.enable(true)
|
||||||
|
//配置api文档元信息
|
||||||
|
.apiInfo(apiInfo())
|
||||||
|
// 选择哪些接口作为swagger的doc发布
|
||||||
|
.select()
|
||||||
|
.apis(RequestHandlerSelectors.basePackage("net.carbon"))
|
||||||
|
//正则匹配请求路径,并分配至当前分组
|
||||||
|
.paths(PathSelectors.ant("/api/**"))
|
||||||
|
.build()
|
||||||
|
//新版swagger3.0配置
|
||||||
|
.globalRequestParameters(getGlobalRequestParameters())
|
||||||
|
.globalResponses(HttpMethod.GET, getGlobalResponseMessage())
|
||||||
|
.globalResponses(HttpMethod.POST, getGlobalResponseMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private ApiInfo apiInfo() {
|
||||||
|
return new ApiInfoBuilder()
|
||||||
|
.title("碳中和")
|
||||||
|
.description("接口文档")
|
||||||
|
.contact(new Contact("jieyuu", "https://106.52.88.120", "645634619@qq.com"))
|
||||||
|
.version("12")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理端文档
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public Docket adminApiDoc() {
|
||||||
|
return new Docket(DocumentationType.OAS_30)
|
||||||
|
.groupName("管理端接口文档")
|
||||||
|
.pathMapping("/")
|
||||||
|
// 定义是否开启swagger,false为关闭,可以通过变量控制,线上关闭
|
||||||
|
.enable(true)
|
||||||
|
//配置api文档元信息
|
||||||
|
.apiInfo(apiInfo())
|
||||||
|
// 选择哪些接口作为swagger的doc发布
|
||||||
|
.select()
|
||||||
|
.apis(RequestHandlerSelectors.basePackage("net.jieyuu"))
|
||||||
|
//正则匹配请求路径,并分配至当前分组
|
||||||
|
.paths(PathSelectors.ant("/admin/**"))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成全局通用参数, 支持配置多个响应参数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<RequestParameter> getGlobalRequestParameters() {
|
||||||
|
List<RequestParameter> parameters = new ArrayList<>();
|
||||||
|
parameters.add(new RequestParameterBuilder()
|
||||||
|
.name("token")
|
||||||
|
.description("登录令牌")
|
||||||
|
.in(ParameterType.HEADER)
|
||||||
|
.query(q -> q.model(m -> m.scalarModel(ScalarType.STRING)))
|
||||||
|
.required(false)
|
||||||
|
.build());
|
||||||
|
|
||||||
|
// parameters.add(new RequestParameterBuilder()
|
||||||
|
// .name("version")
|
||||||
|
// .description("版本号")
|
||||||
|
// .required(true)
|
||||||
|
// .in(ParameterType.HEADER)
|
||||||
|
// .query(q -> q.model(m -> m.scalarModel(ScalarType.STRING)))
|
||||||
|
// .required(false)
|
||||||
|
// .build());
|
||||||
|
return parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成通用响应信息
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<Response> getGlobalResponseMessage() {
|
||||||
|
List<Response> responseList = new ArrayList<>();
|
||||||
|
responseList.add(new ResponseBuilder().code("4xx").description("请求错误,根据code和msg检查").build());
|
||||||
|
return responseList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,26 +0,0 @@
|
|||||||
package net.carbon.controller;
|
|
||||||
|
|
||||||
import net.carbon.model.vo.AchievementVO;
|
|
||||||
import net.carbon.result.Result;
|
|
||||||
import net.carbon.service.AchievementService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/achievement/v1")
|
|
||||||
public class AchievementController {
|
|
||||||
@Autowired
|
|
||||||
private AchievementService achievementService;
|
|
||||||
|
|
||||||
@GetMapping("/list")
|
|
||||||
public Result<List<AchievementVO>> getList(@RequestParam("page") Long page, @RequestParam("pageSize") Long pageSize, @RequestParam("projectID") String projectID){
|
|
||||||
List<AchievementVO> list = achievementService.getList(page,pageSize,projectID);
|
|
||||||
return Result.success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -5,7 +5,6 @@ import net.carbon.model.request.EconomicsUpdateRequest;
|
|||||||
import net.carbon.model.vo.EconomicsVO;
|
import net.carbon.model.vo.EconomicsVO;
|
||||||
import net.carbon.result.Result;
|
import net.carbon.result.Result;
|
||||||
import net.carbon.service.EconomicsService;
|
import net.carbon.service.EconomicsService;
|
||||||
import net.carbon.utils.JsonData;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -16,7 +15,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
* @since 2025-02-21 13:44:09
|
* @since 2025-02-21 13:44:09
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/economics/v1")
|
@RequestMapping("/api/economics/v1/")
|
||||||
public class EconomicsController {
|
public class EconomicsController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -115,14 +114,5 @@ public class EconomicsController {
|
|||||||
}
|
}
|
||||||
return Result.error("删除失败");
|
return Result.error("删除失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping
|
|
||||||
public JsonData add(@RequestBody EconomicsUpdateRequest economicsUpdateRequest){
|
|
||||||
int row = economicsService.add(economicsUpdateRequest);
|
|
||||||
if (row > 0) {
|
|
||||||
return JsonData.buildCodeAndMsg(1,"添加成功");
|
|
||||||
}
|
|
||||||
return JsonData.buildError("添加失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ import net.carbon.model.request.LabelUpdateRequest;
|
|||||||
import net.carbon.model.vo.LabelVO;
|
import net.carbon.model.vo.LabelVO;
|
||||||
import net.carbon.result.Result;
|
import net.carbon.result.Result;
|
||||||
import net.carbon.service.LabelService;
|
import net.carbon.service.LabelService;
|
||||||
import net.carbon.utils.JsonData;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -68,14 +67,5 @@ public class LabelController {
|
|||||||
return Result.error("删除失败");
|
return Result.error("删除失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/add")
|
|
||||||
public JsonData add(@RequestBody LabelUpdateRequest labelUpdateRequest){
|
|
||||||
int row = labelService.add(labelUpdateRequest);
|
|
||||||
if (row >0){
|
|
||||||
return JsonData.buildCodeAndMsg(1,"添加成功");
|
|
||||||
}
|
|
||||||
return JsonData.buildError("添加失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
package net.carbon.controller;
|
|
||||||
|
|
||||||
import net.carbon.model.request.AchievementRequest;
|
|
||||||
import net.carbon.model.request.ProjectRequest;
|
|
||||||
import net.carbon.model.vo.ProjectVO;
|
|
||||||
import net.carbon.service.ProjectService;
|
|
||||||
import net.carbon.utils.JsonData;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/project/v1")
|
|
||||||
public class ProjectController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ProjectService projectService;
|
|
||||||
@GetMapping("/info")
|
|
||||||
public JsonData getUserProject(@RequestParam("userProjectId") String userProjectId){
|
|
||||||
List<ProjectVO> projectVOList = projectService.userProject(userProjectId);
|
|
||||||
return JsonData.buildSuccess(projectVOList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/add")
|
|
||||||
public JsonData addProject(@RequestBody ProjectRequest projectRequest){
|
|
||||||
projectService.addProject(projectRequest);
|
|
||||||
return JsonData.buildSuccess();
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/edit")
|
|
||||||
public JsonData editProject(@RequestBody AchievementRequest achievementRequest){
|
|
||||||
projectService.editProject(achievementRequest);
|
|
||||||
return JsonData.buildSuccess();
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
public JsonData deletePropertyAndProjectUser(@RequestParam("id") Long id){
|
|
||||||
projectService.deleteProAndPU(id);
|
|
||||||
return JsonData.buildSuccess();
|
|
||||||
}
|
|
||||||
}
|
|
@ -5,21 +5,19 @@ import net.carbon.model.request.TimelyWarningRequest;
|
|||||||
import net.carbon.model.vo.TimelyWarningVO;
|
import net.carbon.model.vo.TimelyWarningVO;
|
||||||
import net.carbon.result.Result;
|
import net.carbon.result.Result;
|
||||||
import net.carbon.service.TimelyWarningService;
|
import net.carbon.service.TimelyWarningService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@RequestMapping("/api")
|
||||||
public class TimelyWarningController {
|
public class TimelyWarningController {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TimelyWarningService timelyWarningService;
|
private TimelyWarningService timelyWarningService;
|
||||||
|
|
||||||
@GetMapping("/api/TimelyWarning")
|
@GetMapping("/TimelyWarning")
|
||||||
public Result<PageResponse<TimelyWarningVO>> get(@RequestParam("pageSize") Long pageSize, @RequestParam("page") Long page) {
|
public Result<PageResponse<TimelyWarningVO>> get(@RequestParam("pageSize") Long pageSize, @RequestParam("page") Long page) {
|
||||||
return Result.success(timelyWarningService.getList(pageSize, page));
|
return Result.success(timelyWarningService.getList(pageSize, page));
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/api/warn/delete")
|
@DeleteMapping("warn/delete")
|
||||||
public Result<Boolean> delete(@RequestParam("id") Long id) {
|
public Result<Boolean> delete(@RequestParam("id") Long id) {
|
||||||
int row = timelyWarningService.delete(id);
|
int row = timelyWarningService.delete(id);
|
||||||
if (row > 0) {
|
if (row > 0) {
|
||||||
@ -28,7 +26,7 @@ public class TimelyWarningController {
|
|||||||
return Result.error("删除失败");
|
return Result.error("删除失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/api/warn/edit")
|
@PostMapping("warn/edit")
|
||||||
public Result update(@RequestBody TimelyWarningRequest timelyWarningRequest) {
|
public Result update(@RequestBody TimelyWarningRequest timelyWarningRequest) {
|
||||||
int row = timelyWarningService.updateById(timelyWarningRequest);
|
int row = timelyWarningService.updateById(timelyWarningRequest);
|
||||||
if (row > 0) {
|
if (row > 0) {
|
||||||
@ -37,7 +35,7 @@ public class TimelyWarningController {
|
|||||||
return Result.error("修改失败");
|
return Result.error("修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/api/warn/add")
|
@PostMapping("warn/add")
|
||||||
public Result add(@RequestBody TimelyWarningRequest timelyWarningRequest) {
|
public Result add(@RequestBody TimelyWarningRequest timelyWarningRequest) {
|
||||||
timelyWarningService.add(timelyWarningRequest);
|
timelyWarningService.add(timelyWarningRequest);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
|
@ -2,8 +2,6 @@ package net.carbon.controller;
|
|||||||
|
|
||||||
//import io.swagger.annotations.ApiParam;
|
//import io.swagger.annotations.ApiParam;
|
||||||
|
|
||||||
import net.carbon.model.po.UserDO;
|
|
||||||
import net.carbon.model.vo.ProjectVO;
|
|
||||||
import net.carbon.model.vo.UserVO;
|
import net.carbon.model.vo.UserVO;
|
||||||
import net.carbon.model.request.UserRegisterRequest;
|
import net.carbon.model.request.UserRegisterRequest;
|
||||||
import net.carbon.model.request.UserLoginRequest;
|
import net.carbon.model.request.UserLoginRequest;
|
||||||
@ -12,8 +10,6 @@ import net.carbon.utils.JsonData;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/user/v1")
|
@RequestMapping("/api/user/v1")
|
||||||
public class UserController {
|
public class UserController {
|
||||||
@ -61,9 +57,4 @@ public class UserController {
|
|||||||
return JsonData.buildSuccess(userinfo);
|
return JsonData.buildSuccess(userinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/updataUserinfo")
|
|
||||||
public JsonData updateUserinfo(@RequestBody UserDO userDO) {
|
|
||||||
userService.updateUserinfo(userDO);
|
|
||||||
return JsonData.buildCodeAndMsg(200,"修改成功");
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,13 +0,0 @@
|
|||||||
package net.carbon.mapper;
|
|
||||||
|
|
||||||
import net.carbon.model.vo.AchievementVO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface AchievementMapper {
|
|
||||||
|
|
||||||
List<AchievementVO> getList(@Param("startRow") Long startRow,@Param("pageSize") Long pageSize,@Param("projectID") String projectID);
|
|
||||||
}
|
|
@ -3,7 +3,6 @@ package net.carbon.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import net.carbon.model.po.EconomicsDO;
|
import net.carbon.model.po.EconomicsDO;
|
||||||
import org.apache.ibatis.annotations.Insert;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|
||||||
@ -18,7 +17,4 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface EconomicsMapper extends BaseMapper<EconomicsDO> {
|
public interface EconomicsMapper extends BaseMapper<EconomicsDO> {
|
||||||
|
|
||||||
@Insert("insert into economics (name, unit, data, attribute, is_system_date, is_delete) values " +
|
|
||||||
"(#{name},#{unit},#{data},#{attribute},#{isSystemDate},#{isDelete})")
|
|
||||||
Integer add(EconomicsDO economicsDO);
|
|
||||||
}
|
}
|
@ -2,7 +2,6 @@ package net.carbon.mapper;
|
|||||||
|
|
||||||
import net.carbon.model.po.LabelDO;
|
import net.carbon.model.po.LabelDO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Insert;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -16,6 +15,4 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface LabelMapper extends BaseMapper<LabelDO> {
|
public interface LabelMapper extends BaseMapper<LabelDO> {
|
||||||
|
|
||||||
@Insert("insert into label (name, unit, data_value, attribute, is_system_date, is_delete) values (#{name},#{unit},#{dataValue},#{attribute},#{isSystemDate},#{isDeleted})")
|
|
||||||
int add(LabelDO labelDO);
|
|
||||||
}
|
}
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
package net.carbon.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import net.carbon.model.po.AchievementDO;
|
|
||||||
import net.carbon.model.request.ProjectRequest;
|
|
||||||
import net.carbon.model.vo.AchievementVO;
|
|
||||||
import net.carbon.model.vo.ProjectVO;
|
|
||||||
import org.apache.ibatis.annotations.Delete;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Select;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface ProjectMapper extends BaseMapper<ProjectRequest> {
|
|
||||||
|
|
||||||
@Select("select * from project_user where projectId = #{userProjectId}")
|
|
||||||
List<ProjectVO> userProject(String userProjectId);
|
|
||||||
|
|
||||||
void update(AchievementDO achievementDO);
|
|
||||||
|
|
||||||
@Delete("delete from project_property where id = #{id}")
|
|
||||||
void deleteProperty(Long id);
|
|
||||||
|
|
||||||
@Delete("delete from project_user where property_id = #{propertyId}")
|
|
||||||
void deleteProjectUser(Long propertyId);
|
|
||||||
|
|
||||||
@Select("select projectId from project_user where user_id = #{id}")
|
|
||||||
String getProjectIdByUserId(Long id);
|
|
||||||
}
|
|
@ -3,15 +3,10 @@ package net.carbon.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import net.carbon.model.po.TimelyWarningDO;
|
import net.carbon.model.po.TimelyWarningDO;
|
||||||
import net.carbon.model.request.TimelyWarningRequest;
|
|
||||||
import org.apache.ibatis.annotations.Insert;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface TimelyWarningMapper extends BaseMapper<TimelyWarningDO> {
|
public interface TimelyWarningMapper extends BaseMapper<TimelyWarningDO> {
|
||||||
|
|
||||||
@Insert("insert into timely_warning (name, unit, data, direction) values " +
|
|
||||||
"(#{name},#{unit},#{data},#{direction})")
|
|
||||||
void add(TimelyWarningRequest timelyWarningRequest);
|
|
||||||
}
|
}
|
@ -16,5 +16,4 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface UserMapper extends BaseMapper<UserDO> {
|
public interface UserMapper extends BaseMapper<UserDO> {
|
||||||
|
|
||||||
void updateUserinfo(UserDO userDO);
|
|
||||||
}
|
}
|
||||||
|
61
server/src/main/java/net/carbon/model/CarbonEmissionDO.java
Normal file
61
server/src/main/java/net/carbon/model/CarbonEmissionDO.java
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
package net.carbon.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author jieyuu
|
||||||
|
* @since 2024-12-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("carbon_emission")
|
||||||
|
public class CarbonEmissionDO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
private BigDecimal wastewaterDischargeTotal;
|
||||||
|
|
||||||
|
private BigDecimal airQualityAchievementRate;
|
||||||
|
|
||||||
|
private BigDecimal gdpElectricityConsumption;
|
||||||
|
|
||||||
|
private BigDecimal wasteResourceIndustryValue;
|
||||||
|
|
||||||
|
private BigDecimal forestCoverageRate;
|
||||||
|
|
||||||
|
private BigDecimal ecologicalIndex;
|
||||||
|
|
||||||
|
private BigDecimal importExportTotal;
|
||||||
|
|
||||||
|
private Integer foreignInvestmentEnterprises;
|
||||||
|
|
||||||
|
private BigDecimal tourismIncome;
|
||||||
|
|
||||||
|
private Integer overnightTourists;
|
||||||
|
|
||||||
|
private BigDecimal publicManagementDensity;
|
||||||
|
|
||||||
|
private BigDecimal perCapitaServiceFunds;
|
||||||
|
|
||||||
|
private BigDecimal averageAnnualSalary;
|
||||||
|
|
||||||
|
private BigDecimal urbanPerCapitaIncome;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
31
server/src/main/java/net/carbon/model/UserDO.java
Normal file
31
server/src/main/java/net/carbon/model/UserDO.java
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package net.carbon.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author jieyuu
|
||||||
|
* @since 2024-11-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("user")
|
||||||
|
public class UserDO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
private String password;
|
||||||
|
}
|
@ -1,20 +0,0 @@
|
|||||||
package net.carbon.model.po;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class AchievementDO {
|
|
||||||
private Long id;
|
|
||||||
private String nodex;
|
|
||||||
private String unit;
|
|
||||||
private String arribure;
|
|
||||||
private String dataValue;
|
|
||||||
private String updataData;
|
|
||||||
private String leibi;
|
|
||||||
private String indexClassification;
|
|
||||||
private String assess;
|
|
||||||
}
|
|
@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -29,11 +28,4 @@ public class TimelyWarningDO implements Serializable {
|
|||||||
|
|
||||||
@TableField("direction")
|
@TableField("direction")
|
||||||
private String direction;
|
private String direction;
|
||||||
|
|
||||||
@TableField("add_time")
|
|
||||||
private LocalDateTime addTime;
|
|
||||||
|
|
||||||
@TableField("update_time")
|
|
||||||
private LocalDateTime updateTime;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
package net.carbon.model.request;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class AchievementRequest {
|
|
||||||
private Long id;
|
|
||||||
private String nodex;
|
|
||||||
private String unit;
|
|
||||||
private String arribure;
|
|
||||||
private String dataValue;
|
|
||||||
private String updataData;
|
|
||||||
private String leibi;
|
|
||||||
private String indexClassification;
|
|
||||||
private String assess;
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
package net.carbon.model.request;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@TableName("project_user")
|
|
||||||
public class ProjectRequest {
|
|
||||||
@TableField("user_id")
|
|
||||||
private String userid;
|
|
||||||
@TableField("projectName")
|
|
||||||
private String projectName;
|
|
||||||
@TableField("projectTeritory")
|
|
||||||
private String projectTeritory;
|
|
||||||
private String principal;
|
|
||||||
private String type;
|
|
||||||
@TableField("projectId")
|
|
||||||
private String projectId;
|
|
||||||
private Long propertyId;
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
package net.carbon.model.vo;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class AchievementVO {
|
|
||||||
private Long id;
|
|
||||||
private String nodex;
|
|
||||||
private String unit;
|
|
||||||
private String arribure;
|
|
||||||
private String dataValue;
|
|
||||||
private String updataData;
|
|
||||||
private String leibi;
|
|
||||||
private String indexClassification;
|
|
||||||
private String assess;
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
package net.carbon.model.vo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class ProjectVO {
|
|
||||||
private Long id;
|
|
||||||
private String projectName;
|
|
||||||
private String projectTeritory;
|
|
||||||
private String principal;
|
|
||||||
private String type;
|
|
||||||
private String projectId;
|
|
||||||
private String propertyId;
|
|
||||||
}
|
|
@ -1,10 +1,7 @@
|
|||||||
package net.carbon.model.vo;
|
package net.carbon.model.vo;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class TimelyWarningVO {
|
public class TimelyWarningVO {
|
||||||
|
|
||||||
@ -17,10 +14,4 @@ public class TimelyWarningVO {
|
|||||||
private Double data;
|
private Double data;
|
||||||
|
|
||||||
private String direction;
|
private String direction;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime addTime;
|
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private LocalDateTime updateTime;
|
|
||||||
}
|
}
|
||||||
|
@ -42,9 +42,4 @@ public class UserVO {
|
|||||||
* 用户地址
|
* 用户地址
|
||||||
*/
|
*/
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户项目
|
|
||||||
*/
|
|
||||||
private String userProjectId;
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
package net.carbon.request;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "登录对象", description = "用户登录请求对象")
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class UserLoginRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户名", example = "jieyuu")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "密码", example = "123456")
|
||||||
|
private String password;
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package net.carbon.request;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "用户注册实体类")
|
||||||
|
public class UserRegisterRequest {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户名", example = "123456")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "密码", example = "123456")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
}
|
@ -1,9 +0,0 @@
|
|||||||
package net.carbon.service;
|
|
||||||
|
|
||||||
import net.carbon.model.vo.AchievementVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface AchievementService {
|
|
||||||
List<AchievementVO> getList(Long page, Long pageSize, String projectID);
|
|
||||||
}
|
|
@ -20,6 +20,5 @@ public interface EconomicsService extends IService<EconomicsDO> {
|
|||||||
|
|
||||||
Integer updateById(EconomicsUpdateRequest economicsUpdateReq);
|
Integer updateById(EconomicsUpdateRequest economicsUpdateReq);
|
||||||
|
|
||||||
Integer add(EconomicsUpdateRequest economicsUpdateRequest);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,5 +25,4 @@ public interface LabelService extends IService<LabelDO> {
|
|||||||
|
|
||||||
int updateById(LabelUpdateRequest labelUpdateReq);
|
int updateById(LabelUpdateRequest labelUpdateReq);
|
||||||
|
|
||||||
int add(LabelUpdateRequest labelUpdateRequest);
|
|
||||||
}
|
}
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
package net.carbon.service;
|
|
||||||
|
|
||||||
import net.carbon.model.request.AchievementRequest;
|
|
||||||
import net.carbon.model.request.ProjectRequest;
|
|
||||||
import net.carbon.model.vo.ProjectVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface ProjectService {
|
|
||||||
List<ProjectVO> userProject(String userProjectId);
|
|
||||||
|
|
||||||
void addProject(ProjectRequest projectRequest);
|
|
||||||
|
|
||||||
void editProject(AchievementRequest achievementRequest);
|
|
||||||
|
|
||||||
void deleteProAndPU(Long id);
|
|
||||||
}
|
|
@ -3,14 +3,11 @@ package net.carbon.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import net.carbon.model.po.UserDO;
|
import net.carbon.model.po.UserDO;
|
||||||
|
|
||||||
import net.carbon.model.vo.ProjectVO;
|
|
||||||
import net.carbon.model.vo.UserVO;
|
import net.carbon.model.vo.UserVO;
|
||||||
import net.carbon.model.request.UserRegisterRequest;
|
import net.carbon.model.request.UserRegisterRequest;
|
||||||
import net.carbon.model.request.UserLoginRequest;
|
import net.carbon.model.request.UserLoginRequest;
|
||||||
import net.carbon.utils.JsonData;
|
import net.carbon.utils.JsonData;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -39,6 +36,4 @@ public interface UserService extends IService<UserDO> {
|
|||||||
JsonData login(UserLoginRequest loginRequest);
|
JsonData login(UserLoginRequest loginRequest);
|
||||||
|
|
||||||
UserVO userinfo();
|
UserVO userinfo();
|
||||||
|
|
||||||
void updateUserinfo(UserDO userDO);
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
package net.carbon.service.impl;
|
|
||||||
|
|
||||||
import net.carbon.mapper.AchievementMapper;
|
|
||||||
import net.carbon.model.vo.AchievementVO;
|
|
||||||
import net.carbon.service.AchievementService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class AchievementServiceImpl implements AchievementService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private AchievementMapper achievementMapper;
|
|
||||||
@Override
|
|
||||||
public List<AchievementVO> getList(Long page, Long pageSize, String projectID) {
|
|
||||||
Long startRow = (page-1)*pageSize;
|
|
||||||
return achievementMapper.getList(startRow,pageSize,projectID);
|
|
||||||
}
|
|
||||||
}
|
|
@ -70,16 +70,5 @@ public class EconomicsServiceImpl extends ServiceImpl<EconomicsMapper, Economics
|
|||||||
int row = economicsMapper.updateById(economicsDO);
|
int row = economicsMapper.updateById(economicsDO);
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Integer add(EconomicsUpdateRequest economicsUpdateRequest) {
|
|
||||||
EconomicsDO economicsDO = new EconomicsDO();
|
|
||||||
BeanUtils.copyProperties(economicsUpdateRequest, economicsDO);
|
|
||||||
// 设置为0
|
|
||||||
economicsDO.setIsDelete((byte) 0);
|
|
||||||
economicsDO.setIsSystemDate(0);
|
|
||||||
int row = economicsMapper.add(economicsDO);
|
|
||||||
return row;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,14 +73,4 @@ public class LabelServiceImpl extends ServiceImpl<LabelMapper, LabelDO> implemen
|
|||||||
int row = labelMapper.updateById(labelDO);
|
int row = labelMapper.updateById(labelDO);
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int add(LabelUpdateRequest labelUpdateRequest) {
|
|
||||||
LabelDO labelDO = new LabelDO();
|
|
||||||
BeanUtils.copyProperties(labelUpdateRequest,labelDO);
|
|
||||||
labelDO.setIsSystemDate(0);
|
|
||||||
labelDO.setIsDeleted(0);
|
|
||||||
int row = labelMapper.add(labelDO);
|
|
||||||
return row;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
package net.carbon.service.impl;
|
|
||||||
|
|
||||||
import net.carbon.mapper.ProjectMapper;
|
|
||||||
import net.carbon.model.po.AchievementDO;
|
|
||||||
import net.carbon.model.request.AchievementRequest;
|
|
||||||
import net.carbon.model.request.ProjectRequest;
|
|
||||||
import net.carbon.model.vo.ProjectVO;
|
|
||||||
import net.carbon.service.ProjectService;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ProjectServiceImpl implements ProjectService{
|
|
||||||
@Autowired
|
|
||||||
private ProjectMapper projectMapper;
|
|
||||||
@Override
|
|
||||||
public List<ProjectVO> userProject(String userProjectId) {
|
|
||||||
List<ProjectVO> userProjectList = projectMapper.userProject(userProjectId);
|
|
||||||
return userProjectList;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addProject(ProjectRequest projectRequest) {
|
|
||||||
projectMapper.insert(projectRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void editProject(AchievementRequest achievementRequest) {
|
|
||||||
AchievementDO achievementDO = new AchievementDO();
|
|
||||||
BeanUtils.copyProperties(achievementRequest,achievementDO);
|
|
||||||
projectMapper.update(achievementDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional
|
|
||||||
@Override
|
|
||||||
public void deleteProAndPU(Long id) {
|
|
||||||
projectMapper.deleteProperty(id);
|
|
||||||
projectMapper.deleteProjectUser(id);
|
|
||||||
}
|
|
||||||
}
|
|
@ -58,6 +58,8 @@ public class TimelyWarningServiceImpl implements TimelyWarningService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void add(TimelyWarningRequest timelyWarningRequest) {
|
public void add(TimelyWarningRequest timelyWarningRequest) {
|
||||||
timelyWarningMapper.add(timelyWarningRequest);
|
TimelyWarningDO timelyWarningDO = new TimelyWarningDO();
|
||||||
|
BeanUtils.copyProperties(timelyWarningRequest, timelyWarningDO);
|
||||||
|
timelyWarningMapper.insert(timelyWarningDO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,12 +7,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.carbon.enums.BizCodeEnum;
|
import net.carbon.enums.BizCodeEnum;
|
||||||
import net.carbon.interceptor.LoginInterceptor;
|
import net.carbon.interceptor.LoginInterceptor;
|
||||||
import net.carbon.mapper.ProjectMapper;
|
|
||||||
import net.carbon.mapper.UserMapper;
|
import net.carbon.mapper.UserMapper;
|
||||||
import net.carbon.model.LoginUser;
|
import net.carbon.model.LoginUser;
|
||||||
import net.carbon.model.po.UserDO;
|
import net.carbon.model.po.UserDO;
|
||||||
|
|
||||||
import net.carbon.model.vo.ProjectVO;
|
|
||||||
import net.carbon.model.vo.UserVO;
|
import net.carbon.model.vo.UserVO;
|
||||||
import net.carbon.model.request.UserRegisterRequest;
|
import net.carbon.model.request.UserRegisterRequest;
|
||||||
import net.carbon.model.request.UserLoginRequest;
|
import net.carbon.model.request.UserLoginRequest;
|
||||||
@ -27,7 +25,6 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Propagation;
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,8 +41,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserMapper userMapper;
|
private UserMapper userMapper;
|
||||||
@Autowired
|
|
||||||
private ProjectMapper projectMapper;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = RuntimeException.class, propagation = Propagation.REQUIRED)
|
@Transactional(rollbackFor = RuntimeException.class, propagation = Propagation.REQUIRED)
|
||||||
@ -138,14 +133,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements
|
|||||||
UserDO userDO = userMapper.selectOne(queryWrapper);
|
UserDO userDO = userMapper.selectOne(queryWrapper);
|
||||||
UserVO userVO = new UserVO();
|
UserVO userVO = new UserVO();
|
||||||
BeanUtils.copyProperties(userDO, userVO);
|
BeanUtils.copyProperties(userDO, userVO);
|
||||||
userVO.setUserProjectId(projectMapper.getProjectIdByUserId(userVO.getId()));
|
|
||||||
|
|
||||||
return userVO;
|
return userVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateUserinfo(UserDO userDO) {
|
|
||||||
userDO.setUpdateTime(LocalDateTime.now());
|
|
||||||
userMapper.updateUserinfo(userDO);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="net.carbon.mapper.AchievementMapper">
|
|
||||||
<select id="getList" resultType="net.carbon.model.vo.AchievementVO">
|
|
||||||
select * from project_property where project_id = #{projectID} limit #{startRow},#{pageSize}
|
|
||||||
</select>
|
|
||||||
</mapper>
|
|
@ -1,33 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="net.carbon.mapper.ProjectMapper">
|
|
||||||
<update id="update">
|
|
||||||
update project_property
|
|
||||||
<set>
|
|
||||||
<if test="nodex != null and nodex != '' ">
|
|
||||||
nodex = #{nodex},
|
|
||||||
</if>
|
|
||||||
<if test="unit != null and unit != '' ">
|
|
||||||
unit = #{unit},
|
|
||||||
</if>
|
|
||||||
<if test="arribure != null and arribure != '' ">
|
|
||||||
arribure = #{arribure},
|
|
||||||
</if>
|
|
||||||
<if test="dataValue != null and dataValue != '' ">
|
|
||||||
dataValue = #{dataValue},
|
|
||||||
</if>
|
|
||||||
<if test="updataData != null and updataData != '' ">
|
|
||||||
updataData = #{updataData},
|
|
||||||
</if>
|
|
||||||
<if test="leibi != null and leibi != '' ">
|
|
||||||
leibi = #{leibi},
|
|
||||||
</if>
|
|
||||||
<if test="indexClassification != null and indexClassification != '' ">
|
|
||||||
indexClassification = #{indexClassification},
|
|
||||||
</if>
|
|
||||||
<if test="assess != null and assess != '' ">
|
|
||||||
assess = #{assess},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
</update>
|
|
||||||
</mapper>
|
|
@ -23,8 +23,5 @@
|
|||||||
id
|
id
|
||||||
, username, password, avatar, role, description, name, phone, address, creationTime, updateTime, is_delete
|
, username, password, avatar, role, description, name, phone, address, creationTime, updateTime, is_delete
|
||||||
</sql>
|
</sql>
|
||||||
<update id="updateUserinfo">
|
|
||||||
update user set username = #{username},phone = #{phone},address = #{address},avatar = #{avatar},updateTime = #{updateTime} where id = #{id}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user