diff --git a/src/main/java/com/uva/api/entity/UserTab.java b/src/main/java/com/uva/api/entity/UserTab.java index 7f69eca7fce86848fd0e4f8a186b3a2e2336819f..6d2644be934b9d3540c4a6797a21c5da11b80bc5 100644 --- a/src/main/java/com/uva/api/entity/UserTab.java +++ b/src/main/java/com/uva/api/entity/UserTab.java @@ -27,7 +27,7 @@ public class UserTab implements Serializable { private static final long serialVersionUID = 1L; - @TableId(value = "USERID", type = IdType.AUTO) + @TableId(value = "userid", type = IdType.AUTO) private Integer userid; @TableField("USERNAME") diff --git a/src/main/java/com/uva/api/task/TaskService.java b/src/main/java/com/uva/api/task/TaskService.java index ccf203f9943fd7253cd4c50f8bd436ac99ebf3a8..aed28b6a997f3723115c8ff5e9e44aef55568fae 100644 --- a/src/main/java/com/uva/api/task/TaskService.java +++ b/src/main/java/com/uva/api/task/TaskService.java @@ -690,7 +690,7 @@ public class TaskService { cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); String endTime = sdf.format(cal.getTime()); - cal.add(Calendar.MONTH, -6); + cal.add(Calendar.MONTH, -16); String startTime = sdf.format(cal.getTime()); List> taskTimeList = taskMapper.getTaskTimeList(lineName, startTime, endTime); diff --git a/src/main/java/com/uva/api/user/controller/UserTabController.java b/src/main/java/com/uva/api/user/controller/UserTabController.java index 423c9f6c812ffa229a57407e4dc43ee81c2dda6a..ffeaff4928b38c8d90e7d2a126fa0c28484e8051 100644 --- a/src/main/java/com/uva/api/user/controller/UserTabController.java +++ b/src/main/java/com/uva/api/user/controller/UserTabController.java @@ -1,117 +1,127 @@ -package com.uva.api.user.controller; + package com.uva.api.user.controller; -import com.github.pagehelper.PageInfo; -import com.uva.api.entity.ReturnT; -import com.uva.api.entity.UserTab; -import com.uva.api.entity.UserVo; -import com.uva.api.user.service.UserTabService; -import com.uva.api.util.DataUtil; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; + import com.github.pagehelper.PageInfo; + import com.uva.api.entity.ReturnT; + import com.uva.api.entity.UserTab; + import com.uva.api.entity.UserVo; + import com.uva.api.user.service.UserTabService; + import com.uva.api.util.DataUtil; + import io.swagger.annotations.Api; + import io.swagger.annotations.ApiImplicitParam; + import io.swagger.annotations.ApiImplicitParams; + import io.swagger.annotations.ApiOperation; + import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.web.bind.annotation.*; -import javax.servlet.http.HttpServletRequest; -import java.util.Arrays; -import java.util.Date; - -/** - *

- * 前端控制器 - *

- * - * @author hsq - * @since 2023-09-14 - */ -@RestController -@RequestMapping("/user-tab") -@Api(tags = "系统用户", value = "UserTabController") -public class UserTabController { - - @Autowired - private UserTabService userTabService; + import javax.servlet.http.HttpServletRequest; + import java.util.Arrays; + import java.util.Date; + import java.util.List; + import java.util.stream.Collectors; /** - * 列表 + *

+ * 前端控制器 + *

+ * + * @author hsq + * @since 2023-09-14 */ - @ApiOperation("分页查询列表信息") - @PostMapping("/list") - public ReturnT> list(@RequestBody UserVo userVo) { - PageInfo page = userTabService.queryPage(userVo); - return ReturnT.success(page); - } + @RestController + @RequestMapping("/dataapi/task/ndata") + @Api(tags = "系统用户", value = "UserTabController") + public class UserTabController { - /** - * 保存 - */ - @ApiOperation("保存") - @PostMapping("/save") - public ReturnT save(@RequestBody UserTab userTab) { - if (userTab != null) { - userTab.setCreatetime(new Date()); - } - boolean flag = userTabService.save(userTab); - if (flag) { - return ReturnT.success(); - } - return ReturnT.failedMsg("failed to save info"); - } + @Autowired + private UserTabService userTabService; - /** - * 修改 - */ - @ApiOperation("修改") - @PostMapping("/update") - public ReturnT update(@RequestBody UserTab userTab) { - if (userTab != null) { - userTab.setUpdatetime(new Date()); - } - boolean flag = userTabService.updateById(userTab); - if (flag) { - return ReturnT.success(); + /** + * 列表 + */ + @ApiOperation("分页查询列表信息") + @PostMapping("/list") + public ReturnT> list(@RequestBody UserVo userVo) { + PageInfo page = userTabService.queryPage(userVo); + return ReturnT.success(page); } - return ReturnT.failedMsg("failed to update info"); - } - /** - * 删除 - */ - @ApiOperation("删除") - @GetMapping("/delete") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "query", name = "ids", dataTypeClass = String.class, value = "多个ID用逗号分割") - }) - public ReturnT delete(String ids) { - if (DataUtil.isEmpty(ids)) { - return ReturnT.failedMsg("the param is empty"); + /** + * 保存 + */ + @ApiOperation("保存") + @PostMapping("/save") + public ReturnT save(@RequestBody UserTab userTab) { + if (userTab != null) { + userTab.setCreatetime(new Date()); + } + boolean flag = userTabService.save(userTab); + if (flag) { + return ReturnT.success(); + } + return ReturnT.failedMsg("failed to save info"); } - String[] idArr = ids.split(","); - boolean flag = userTabService.removeByIds(Arrays.asList(idArr)); - if (flag) { - return ReturnT.success(); + + /** + * 修改 + */ + @ApiOperation("修改") + @PostMapping("/update") + public ReturnT update(@RequestBody UserTab userTab) { + if (userTab != null) { + userTab.setUpdatetime(new Date()); + } + boolean flag = userTabService.updateById(userTab); + if (flag) { + return ReturnT.success(); + } + return ReturnT.failedMsg("failed to update info"); } - return ReturnT.failedMsg("failed to delete info"); - } - /** - * 用户登录 - */ - @ApiOperation("用户登录") - @GetMapping("/login") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "query", name = "username", dataTypeClass = String.class, required = true, value = "用户名"), - @ApiImplicitParam(paramType = "query", name = "password", dataTypeClass = String.class, required = true, value = "密码") - }) - public ReturnT login(String username, String password, HttpServletRequest request) { - if (DataUtil.isEmpty(username)) { - return ReturnT.failedMsg("用户名为空,请填写!"); + /** + * 删除 + */ + @ApiOperation("删除") + @GetMapping("/deleteUserInfo") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "query", name = "ids", dataTypeClass = String.class, value = "多个ID用逗号分割") + }) + public ReturnT deleteUserInfo(String ids) { + if (DataUtil.isEmpty(ids)) { + return ReturnT.failedMsg("the param is empty"); + } + String[] idArr = ids.split(","); + try { + // 将字符串数组转换为整数列表 + List idList = Arrays.stream(idArr) + .map(Integer::parseInt) + .collect(Collectors.toList()); + boolean flag = userTabService.removeByIds(idList); + if (flag) { + return ReturnT.success(); + } + } catch (NumberFormatException e) { + return ReturnT.failedMsg("参数格式错误,ID 必须为整数"); + } + return ReturnT.failedMsg("failed to delete info"); } - if (DataUtil.isEmpty(password)) { - return ReturnT.failedMsg("密码为空,请填写!"); + + /** + * 用户登录 + */ + @ApiOperation("用户登录") + @GetMapping("/login") + @ApiImplicitParams({ + @ApiImplicitParam(paramType = "query", name = "username", dataTypeClass = String.class, required = true, value = "用户名"), + @ApiImplicitParam(paramType = "query", name = "password", dataTypeClass = String.class, required = true, value = "密码") + }) + public ReturnT login(String username, String password, HttpServletRequest request) { + if (DataUtil.isEmpty(username)) { + return ReturnT.failedMsg("用户名为空,请填写!"); + } + if (DataUtil.isEmpty(password)) { + return ReturnT.failedMsg("密码为空,请填写!"); + } + return userTabService.getDataByUserAndPassWord(username, password, request); } - return userTabService.getDataByUserAndPassWord(username, password, request); - } -} + } diff --git a/src/main/resources/mapper/changePoint.xml b/src/main/resources/mapper/changePoint.xml index 1f60da70251d3a0eb224e25a28a6c01a39c3bded..5e15f5078dd5d91b7431931dca46653ee7952bc0 100644 --- a/src/main/resources/mapper/changePoint.xml +++ b/src/main/resources/mapper/changePoint.xml @@ -81,8 +81,8 @@ t.pic_name2, t1.line_name, t.changepointid as "changepoint_id", - t1.crop_image_path as "file_path1", - t2.crop_image_path as "file_path2", + t1.file_path as "file_path1", + t2.file_path as "file_path2", t1.lon as "lon1", t1.lat as "lat1", t2.lon as "lon2", @@ -91,9 +91,9 @@ to_char(t2.create_time,'yyyyMMddhh24miss') as "create_time2", t.flag from t_uva_change_point_tasklist t, - (select t3.id, t3.crop_image_path, t4.file_name, t3.line_name, t4.lon, t4.lat, t4.create_time + (select t3.id, t3.file_path, t4.file_name, t3.line_name, t4.lon, t4.lat, t4.create_time from t_task_info t3, t_uva_data t4 where t3.id=#{id1} and t3.id=t4.id)t1, - (select t3.id, t3.crop_image_path, t4.file_name, t3.line_name, t4.lon, t4.lat, t4.create_time + (select t3.id, t3.file_path, t4.file_name, t3.line_name, t4.lon, t4.lat, t4.create_time from t_task_info t3, t_uva_data t4 where t3.id=#{id2} and t3.id=t4.id)t2 where t.id1 = t1.id and t.id2 = t2.id