From 477e663589f93896a1cf2a9686e57f9ddb43e40e Mon Sep 17 00:00:00 2001 From: caojianbin <1910336823> Date: Sat, 30 Mar 2024 10:58:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E5=9B=BD=E9=99=85=E5=8C=96,?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=A8=A1=E5=9D=97=E8=AE=BE=E5=A4=87=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../internationalize/system/api/UserFirmApi.java | 20 ++++ .../system/controller/UserController.java | 110 +++++++++++++++++++++ .../controller/UserDeviceBindAppController.java | 19 ++++ .../system/entity/api/dto/UpdateDeviceDisable.java | 41 ++++++++ .../system/mapper/UserDeviceBindAppMapper.java | 16 +++ .../internationalize/system/mapper/UserMapper.java | 33 +++++++ .../system/service/UserDeviceBindAppService.java | 15 +++ .../service/impl/UserDeviceBindServiceAppImpl.java | 20 ++++ .../system/utils/UploadFileUtil.java | 54 ++++++++++ .../system/mapper/UserDeviceBindAppMapper.xml | 25 +++++ .../internationalize/system/mapper/UserMapper.xml | 85 ++++++++++++++++ 11 files changed, 438 insertions(+) create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/api/UserFirmApi.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/UserController.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/UserDeviceBindAppController.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/dto/UpdateDeviceDisable.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/UserDeviceBindAppMapper.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/UserMapper.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/UserDeviceBindAppService.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/UserDeviceBindServiceAppImpl.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/utils/UploadFileUtil.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/UserDeviceBindAppMapper.xml create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/UserMapper.xml diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/api/UserFirmApi.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/api/UserFirmApi.java new file mode 100644 index 0000000..d392207 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/api/UserFirmApi.java @@ -0,0 +1,20 @@ +package com.ecell.internationalize.system.api; +import com.ecell.internationalize.common.system.entity.SysUser; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +@FeignClient(name = "ecell-internationalize-security",path="/sys_user",contextId ="ecell-internationalize-security01") +public interface UserFirmApi { + + /** + * 根据用户名查询 + * @Author: liy + * @Date: 2022/7/18 16:34 + */ + @GetMapping("user/queryByUserName") + SysUser queryByUserName(@RequestParam("userName") String userName); + + + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/UserController.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/UserController.java new file mode 100644 index 0000000..c160d10 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/UserController.java @@ -0,0 +1,110 @@ +package com.ecell.internationalize.system.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ecell.internationalize.common.core.utils.locale.LocaleUtil; +import com.ecell.internationalize.common.core.web.domain.AjaxResult; +import com.ecell.internationalize.common.system.annotation.SystemLog; +import com.ecell.internationalize.common.system.constant.FieldConstant; +import com.ecell.internationalize.common.system.entity.User; +import com.ecell.internationalize.system.service.UserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.Map; + +/** + *

+ * 用户表 前端控制器 + *

+ * @author liy + * @since 2022-07-07 + */ +@Api(value="用户信息",tags={"用户信息接口"}) +@RestController +@RequestMapping("/user") +public class UserController { + @Autowired + private UserService userService; + /** + * 用户信息条件分页查询 + * @Author liy + * @Date 2022/7/7 16:38 + * @param map 分页条件查询体 + * @Return IPage + */ + @ApiOperation("条件分页查询用户信息") + @PostMapping("/page/queryList") + public AjaxResult queryList(@RequestBody Map map){ + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),userService.queryList(map)); + + } + /** + * 用户操作条件分页查询 + * @Author liy + * @Date 2022/7/8 16:38 + * @param map 分页条件查询体 + * @Return IPage + */ + @ApiOperation("条件分页查询用户操作") + @PostMapping("/page/operatorList") + public AjaxResult queryOperatorList(@RequestBody Map map){ + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),userService.queryOperatorList(map)); + } + /** + * 用户操作修改密码 + * @Author liy + * @Date 2022/7/8 16:38 + * @param user 用户 + * @Return AjaxResult + */ + @ApiOperation("用户操作修改密码") + @SystemLog(msg =FieldConstant.USER_OPERATOR,operation = FieldConstant.UPDATE_OPERATOR) + @PostMapping("operator/update") + public AjaxResult updateUser(@RequestBody @Valid User user){ + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),userService.updateById(user)); + } + /** + * 用户操作启用/停用账号 + * @Author liy + * @Date 2022/7/8 16:38 + * @param user 用户 + * @Return AjaxResult + */ + @ApiOperation("用户操作启用/停用账号") + @SystemLog(msg =FieldConstant.USER_OPERATOR,operation = FieldConstant.USER_CHANGE_ACCOUNT) + @PostMapping("operator/changeStatus") + public AjaxResult changeStatus(@RequestBody @ApiParam(value="传整个对象,修改其中status字段,(0:启用,1:停用)",required=true) User user){ + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),userService.updateById(user)); + } + /** + * 用户操作删除 + * @Author liy + * @Date 2022/7/8 16:38 + * @param user 用户 + * @Return AjaxResult + */ + @ApiOperation("用户操作删除") + @SystemLog(msg =FieldConstant.USER_OPERATOR,operation = FieldConstant.DELETE_OPERATOR) + @PostMapping("operator/del") + public AjaxResult del(@RequestBody User user){ + LambdaQueryWrapper lambdaQueryWrapper=new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(User::getUserId,user.getUserId()); + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),userService.getBaseMapper().delete(lambdaQueryWrapper)); + } + /** + * 渠道查询条件 + * @Author liy + * @Date 2022/7/8 16:38 + * @Return AjaxResult + */ + @ApiOperation("渠道查询") + @GetMapping("operator/queryChannel") + public AjaxResult queryChannel(){ + return AjaxResult.success(LocaleUtil.getMessage(FieldConstant.MESSAGES_SUCCESS),userService.queryChannel()); + } +} + diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/UserDeviceBindAppController.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/UserDeviceBindAppController.java new file mode 100644 index 0000000..c7c172f --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/UserDeviceBindAppController.java @@ -0,0 +1,19 @@ +package com.ecell.internationalize.system.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 用户设备绑定表 前端控制器 + *

+ * @author liy + * @since 2022-07-07 + */ +@RestController +@RequestMapping("/user_device_bind_app") +public class UserDeviceBindAppController { + +} + diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/dto/UpdateDeviceDisable.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/dto/UpdateDeviceDisable.java new file mode 100644 index 0000000..26a5357 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/dto/UpdateDeviceDisable.java @@ -0,0 +1,41 @@ +package com.ecell.internationalize.system.entity.api.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + *

+ * 上课禁用(免打扰设置)表 + *

+ * + * @author ${author} + * @since 2022-09-13 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +public class UpdateDeviceDisable implements Serializable { + +private static final long serialVersionUID=1L; + + @ApiModelProperty(example = "主键Id") + private String id; + + @ApiModelProperty(example = "开始响铃时间") + private String alarmStartTime; + + @ApiModelProperty(example = "重复星期数为'0', '1'组成的 7 位长度字符串, 表示周一至周日是否有效 eg: '0000011' 周六日有效, '1110000' 为周一二三有效") + private String alarmWeek; + + @ApiModelProperty(example = "设备imei") + private String imei; + + @ApiModelProperty(example = "结束响铃时间") + private String alarmEndTime; + + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/UserDeviceBindAppMapper.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/UserDeviceBindAppMapper.java new file mode 100644 index 0000000..b6bafa7 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/UserDeviceBindAppMapper.java @@ -0,0 +1,16 @@ +package com.ecell.internationalize.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ecell.internationalize.common.system.entity.UserDeviceBindApp; + +/** + *

+ * 用户设备绑定 Mapper 接口 + *

+ * + * @author liy + * @since 2022-07-07 + */ +public interface UserDeviceBindAppMapper extends BaseMapper { + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/UserMapper.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/UserMapper.java new file mode 100644 index 0000000..b25ce3b --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/UserMapper.java @@ -0,0 +1,33 @@ +package com.ecell.internationalize.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ecell.internationalize.common.system.entity.User; +import com.ecell.internationalize.common.system.entity.VersionRatioHistory; +import com.ecell.internationalize.system.entity.dto.RegisterDto; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + *

+ * 用户 Mapper 接口 + *

+ * + * @author liy + * @since 2022-07-07 + */ +public interface UserMapper extends BaseMapper { + + Page getList(@Param("page") Page page, @Param("map") Map map); + + List queryChannel(); + + int activeCount(@Param("startTime") Date startTime, @Param("endTime") Date endTime); + + List monthActiveCount(@Param("currentDate") String currentDate, @Param("preMonthDate") String preMonthDate); + + List monthRegisterCount(@Param("currentDate") String currentDate, @Param("preMonthDate") String preMonthDate); +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/UserDeviceBindAppService.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/UserDeviceBindAppService.java new file mode 100644 index 0000000..ecba889 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/UserDeviceBindAppService.java @@ -0,0 +1,15 @@ +package com.ecell.internationalize.system.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ecell.internationalize.common.system.entity.UserDeviceBindApp; + +/** + *

+ * 用户设备绑定 服务类 + *

+ * @author liy + * @since 2022-07-07 + */ +public interface UserDeviceBindAppService extends IService { + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/UserDeviceBindServiceAppImpl.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/UserDeviceBindServiceAppImpl.java new file mode 100644 index 0000000..20967c8 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/impl/UserDeviceBindServiceAppImpl.java @@ -0,0 +1,20 @@ +package com.ecell.internationalize.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ecell.internationalize.common.system.entity.UserDeviceBindApp; +import com.ecell.internationalize.system.mapper.UserDeviceBindAppMapper; +import com.ecell.internationalize.system.service.UserDeviceBindAppService; +import org.springframework.stereotype.Service; + +/** + *

+ * 用户设备绑定 服务实现类 + *

+ * + * @author liy + * @since 2022-07-07 + */ +@Service +public class UserDeviceBindServiceAppImpl extends ServiceImpl implements UserDeviceBindAppService { + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/utils/UploadFileUtil.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/utils/UploadFileUtil.java new file mode 100644 index 0000000..636ac8a --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/utils/UploadFileUtil.java @@ -0,0 +1,54 @@ +package com.ecell.internationalize.system.utils; +import com.ecell.internationalize.common.system.constant.FieldConstant; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Random; + +/** + * @Title: UploadFileUtil + * @Author: liy + * @Date: 2022/7/13 17:35 + * @Description: + * @Version:1.0 + */ +public class UploadFileUtil { + public static String upload(MultipartFile file) throws IOException { + //获取文件名+后缀 + String fileName = file.getOriginalFilename(); + File targetFile = null; + if (null != fileName && !"".equals(fileName)) { + //获取后缀 + String fileF = fileName.substring(fileName.lastIndexOf(".")); +// if (!(FieldConstant.JPG.equals(fileF) || FieldConstant.PNG.equals(fileF))) { +// return AjaxResult.error(I18nUtil.getMessage(FieldConstant.UPLOAD_FAIL)); +// } + String curTime = new SimpleDateFormat(FieldConstant.DATE_FORMAT).format(new Date()); + //新的文件名 + fileName = curTime + FieldConstant.CONN_CHAR + new Random().nextInt(1000) + fileF; + //File只会找到项目最外层地址; + File directory = new File(FieldConstant.PATH); + String reportPath = directory.getCanonicalPath(); + //获取根目录 + File path = new File(reportPath); + //获取文件夹路径 + File file1 = new File(path.getAbsolutePath(), FieldConstant.STATIC_IMAGE); + //如果文件夹不存在则创建 + if (!file1.exists() && !file1.isDirectory()) { + file1.mkdirs(); + } + //将图片存入文件夹 + targetFile = new File(file1, fileName); + } + try { + assert targetFile != null; + file.transferTo(targetFile); + } catch (IOException e) { + e.printStackTrace(); + } + return fileName; + } +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/UserDeviceBindAppMapper.xml b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/UserDeviceBindAppMapper.xml new file mode 100644 index 0000000..6f28aa0 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/UserDeviceBindAppMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + id, user_id, i_mei, identity, relation, relation_image_id, create_user, create_time, update_user, update_time,bind_status,approve_status + + + diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/UserMapper.xml b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/UserMapper.xml new file mode 100644 index 0000000..116596c --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/UserMapper.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + user_id, user_email,user_agent,access_token, access_token_time, password, name, status, sex, phone, monitor_watch_phone, image, chat_flag, group_id, unread_msg_total, del_msg_time, del_location_time, del_cost_time, country, country_code, last_use_time, register_time, last_login_time, mobile_type, channel, create_user, create_time, update_user, update_time + + + + + + +