李林
2024-03-06 d83e2977769b3d56f4ca6fdbf798e22d3940e003
功能完善
已修改3个文件
已添加2个文件
123 ■■■■■ 文件已修改
cnas-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
system-run/src/main/resources/application-dev.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/mom/dto/Custom.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/mom/mapper/CustomMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/mom/pojo/User.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java
@@ -11,9 +11,11 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
@@ -22,13 +24,16 @@
 * è®¾å¤‡(DeviceController)表控制层
 */
@Api(tags = "设备")
@AllArgsConstructor
@RestController
@RequestMapping("/deviceScope")
public class DeviceController {
    @Resource
    private DeviceService deviceService;
    @Value("${file.path}")
    private String filePath;
    @ApiOperation(value = "查询设备详情列表")
    @PostMapping("/selectDeviceParameter")
@@ -78,16 +83,14 @@
    }
    //图片上传
    @ApiOperation(value = "图片上传")
    @ApiOperation(value = "设备图片上传")
    @PostMapping("/uploadFile")
    public Result uploadFile(MultipartFile file) {
        System.out.println(file.getOriginalFilename());
        String urlString = null;
        String pathName = null;
        String urlString;
        String pathName;
        String filename = file.getOriginalFilename();
        try {
            String path = "/Users/gaoaoy/webapp/images";
            String path = filePath;
            File realpath = new File(path);
            if (!realpath.exists()) {
                realpath.mkdirs();
@@ -95,7 +98,6 @@
            pathName = UUID.randomUUID() + "_" + file.getOriginalFilename();
            urlString = realpath + "/" + pathName;
            file.transferTo(new File(urlString));
            System.out.println(pathName);
            HashMap<String, String> map = new HashMap<>();
            map.put("name", filename);
            map.put("url", pathName);
system-run/src/main/resources/application-dev.yml
@@ -18,7 +18,7 @@
# ç…§ç‰‡å­˜å‚¨è·¯å¾„+++++++++++++++++++++++++++运维需要配置+++++++++++++++++++++++++++
file:
  path: D:/webapp/images
  path: D:/Download
  # ä¸Šä¼ æ–‡ä»¶å…è®¸çš„æ‰©å±•名
  allowed: png,jpg,jpeg,gif
user-server/src/main/java/com/yuanchu/mom/dto/Custom.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,79 @@
package com.yuanchu.mom.dto;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yuanchu.mom.annotation.ValueTableShow;
import com.yuanchu.mom.common.OrderBy;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("user")
public class Custom extends OrderBy implements Serializable {
    @ApiModelProperty(value = "主键")
    @TableId(type = IdType.AUTO)
    private Integer id;
    @ValueTableShow(2)
    @ApiModelProperty(value = "账号")
    private String account;
    @ValueTableShow(1)
    @ApiModelProperty(value = "用户名")
    private String name;
    @ValueTableShow(10)
    @ApiModelProperty(value = "状态")
    private Integer state;
    @ValueTableShow(5)
    @ApiModelProperty(value = "邮箱")
    private String email;
    @ValueTableShow(6)
    @ApiModelProperty(value = "电话号码")
    private String phone;
    @ApiModelProperty(value = "部门")
    private String department;
    @ValueTableShow(7)
    @ApiModelProperty(value = "客户单位")
    private String company;
    @ValueTableShow(8)
    @ApiModelProperty(value = "单位地址")
    private String address;
    @ValueTableShow(9)
    @ApiModelProperty(value = "创建日期")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "更新日期")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    @ApiModelProperty(value = "创建用户")
    @TableField(fill = FieldFill.INSERT)
    private Integer createUser;
    @ApiModelProperty(value = "更新用户")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateUser;
    private Integer isCustom;
}
user-server/src/main/java/com/yuanchu/mom/mapper/CustomMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,16 @@
package com.yuanchu.mom.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yuanchu.mom.dto.Custom;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface CustomMapper extends BaseMapper<Custom> {
//    IPage<User> selectUserDtoPageList(IPage<UserPageDto> page, QueryWrapper<UserPageDto> ew);
}
user-server/src/main/java/com/yuanchu/mom/pojo/User.java
@@ -61,8 +61,12 @@
    private String department;
    @ValueTableShow(8)
    @ApiModelProperty(value = "公司")
    @ApiModelProperty(value = "单位")
    private String company;
    @ValueTableShow(8)
    @ApiModelProperty(value = "单位地址")
    private String address;
    @ApiModelProperty(value = "角色主键")
    private Integer roleId;
@@ -87,4 +91,6 @@
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateUser;
    private Integer isCustom;
}