Commit 25e385c5 by lzy

Merge branch 'dev' of git.xmmakeit.com:huangjiay/iot-platform-server into dev

parents 41054ca9 9e7b849f
package com.makeit.controller.plat;
import com.makeit.common.dto.BaseBatchIdDTO;
import com.makeit.common.dto.BaseIdDTO;
import com.makeit.common.dto.StatusDTO;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.common.vo.ExcelImportVo;
import com.makeit.exception.BusinessException;
import com.makeit.global.annotation.Action;
import com.makeit.module.admin.dto.plat.PlatUserDTOVO;
import com.makeit.module.admin.dto.plat.PlatUserQueryDTO;
......@@ -20,7 +23,9 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
......@@ -111,6 +116,14 @@ public class PlatUserController {
return ApiResponseUtils.success();
}
@Action(module = "平台端-人员", name = "批量删除", code = "plat:user:del")
@ApiOperation("批量删除")
@PostMapping("delBatch")
public ApiResponseEntity<Void> delBatch(@RequestBody BaseBatchIdDTO dto) {
platUserService.delBatch(dto.getIdList());
return ApiResponseUtils.success();
}
@Action(module = "平台端-人员", name = "改变状态", code = "plat:user:changeStatus")
@ApiOperation("改变状态")
@PostMapping("changeStatus")
......@@ -143,5 +156,15 @@ public class PlatUserController {
return ApiResponseUtils.success(platUserService.getUserDetail());
}
@Action(module = "平台端-人员", name = "批量导入", code = "plat:user:import")
@ApiOperation("批量导入")
@PostMapping("import")
public ApiResponseEntity<ExcelImportVo> importExcel(@RequestParam(value = "excelFile", required = false) MultipartFile excelFile) throws Exception {
if(excelFile == null ){
throw new BusinessException("请上传excel");
}
ExcelImportVo excelImportVo = platUserService.importExcel(excelFile);
return ApiResponseUtils.success(excelImportVo);
}
}
......@@ -46,7 +46,7 @@ public class SaasUserController {
return ApiResponseUtils.success(saasUserService.page(page));
}
@ApiOperation("分页列表")
@ApiOperation("分页列表-免登录")
@PostMapping("pageAuthIgnore")
public ApiResponseEntity<PageVO<SaasUserDTOVO>> pageAuthIgnore(@RequestBody PageReqDTO<SaasUserQueryDTO> page){
return ApiResponseUtils.success(saasUserService.page(page));
......
......@@ -4,8 +4,11 @@ import com.makeit.utils.data.locale.LocaleUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
@Data
@ApiModel("excel导入错误信息VO")
......@@ -41,4 +44,17 @@ public class ExcelErrorVo implements Serializable {
public ExcelErrorVo() {
}
public static void isNotNull(String value,List<ExcelErrorVo> errorVoList, int i, String title) {
if(StringUtils.isBlank(value)) {
errorVoList.add(new ExcelErrorVo(i, title, "数据不为空"));
}
}
public static void notExists(Object object,List<ExcelErrorVo> errorVoList,int i,String title){
if(Objects.isNull(object)){
errorVoList.add(new ExcelErrorVo(i,title,"数据库数据不存在"));
}
}
}
......@@ -32,20 +32,20 @@ public class PlatUserQueryDTO extends BaseOrgDTO {
@ApiModelProperty(value = "要排除的角色id roleId和notRoleId只能用一个")
private String notRoleId;
@ApiModelProperty(value = "关键词 用来搜姓名或者工号")
private String keyword;
@ApiModelProperty(value = "职级")
private Integer postLevel;
@ApiModelProperty(value = "是否从酒店开始 0否 1是")
private String fromHotel;
@ApiModelProperty(value = "是否常用人员 0否 1是")
private String isFrequent;
@ApiModelProperty(value = "标签id")
private String labelId;
// @ApiModelProperty(value = "关键词 用来搜姓名或者工号")
// private String keyword;
//
// @ApiModelProperty(value = "职级")
// private Integer postLevel;
//
// @ApiModelProperty(value = "是否从酒店开始 0否 1是")
// private String fromHotel;
//
// @ApiModelProperty(value = "是否常用人员 0否 1是")
// private String isFrequent;
//
// @ApiModelProperty(value = "标签id")
// private String labelId;
@ApiModelProperty(value = "用户工号集合")
private List<String> accountList;
......
......@@ -30,15 +30,22 @@ public class SwaggerPlatformConfig {
@Bean
public SwaggerModuleConfig platformModule() {
logger.info("loggerloggerloggerlogger");
SwaggerModuleConfig config = new SwaggerModuleConfig();
config.setPackageList(Arrays.asList("com.makeit.module.controller.elder"));
config.setPackageList(Arrays.asList("com.makeit.module.controller"));
config.setModuleName("平台端");
return config;
}
@Bean
public SwaggerModuleConfig wechatModule() {
SwaggerModuleConfig config = new SwaggerModuleConfig();
config.setPackageList(Arrays.asList("com.makeit.module.controller.wechat"));
config.setModuleName("微信端");
return config;
}
@Bean
public Docket platformApi() {
Docket docket = new Docket(DocumentationType.SWAGGER_2)
......@@ -47,11 +54,26 @@ public class SwaggerPlatformConfig {
ApiSelectorBuilder builder = docket.select();
//api过滤
builder = builder.apis(
RequestHandlerSelectors.basePackage("com.makeit.module.controller.elder")
RequestHandlerSelectors.basePackage("com.makeit.module.controller")
);
return builder.build();
}
@Bean
public Docket wechatApi() {
Docket docket = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.groupName("04-微信端");
ApiSelectorBuilder builder = docket.select();
//api过滤
builder = builder.apis(
RequestHandlerSelectors.basePackage("com.makeit.module.controller.wechat")
);
return builder.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder().title("IOT文档")
.description("服务端接口文档")
......
......@@ -27,7 +27,7 @@ import java.util.List;
* @author eugene young
* @since 2023-08-29
*/
@Api("长者体检报告信息")
@Api(tags = "长者体检报告信息")
@RestController
@RequestMapping("/plat/elder/medical-examination-info")
public class PlatElderMedicalExaminationInfoController {
......
......@@ -5,7 +5,7 @@ import com.makeit.common.dto.BaseIdDTO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.elder.PlatElderDTOVO;
import com.makeit.server.platform.elder.PlatElderService;
import com.makeit.service.platform.elder.PlatElderService;
import com.makeit.vo.wechat.elder.PlatElderWechatSimpleVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -25,9 +25,9 @@ import java.util.List;
* @author eugene young
* @since 2023-08-29
*/
@Api(tags = "长者基本信息")
@Api(tags = "长者基本信息-子女端小程序")
@RestController
@RequestMapping("/plat/elder")
@RequestMapping("/children/elder")
public class PlatElderWechatController {
@Autowired
......
package com.makeit.dto.platform.auth;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
@Data
public class PlatUserImportDTO {
private static final String headDesc = "导入说明:\n" +
"\n" +
"1.带*号为必填项\n" +
"\n" +
"2.手机号和邮箱不可重复\n" +
"\n" +
"3.角色必须为【角色管理】处维护的角色名称\n" +
"\n" +
"4.导入人员默认登录密码为:888888";
@ExcelProperty(value = "姓名*")
private String username;
@ExcelProperty(value = "手机号*")
private String mobile;
@ExcelProperty(value = "邮箱")
private String email;
@ExcelProperty(value = "所属组织*")
private String orgName;
@ExcelProperty(value = "角色*")
private String roleName;
@ExcelProperty(value = "备注")
private String remark;
@ExcelIgnore
private String password = "888888";
}
......@@ -6,6 +6,7 @@ import com.makeit.common.dto.LoginDTO;
import com.makeit.common.dto.StatusDTO;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.common.vo.ExcelImportVo;
import com.makeit.entity.platform.auth.PlatOrg;
import com.makeit.entity.platform.auth.PlatRole;
import com.makeit.entity.platform.auth.PlatUser;
......@@ -16,6 +17,7 @@ import com.makeit.module.admin.dto.plat.PlatUserQueryDTO;
import com.makeit.module.admin.vo.plat.PlatUserLoginVO;
import com.makeit.vo.platform.auth.PlatPersonDTOVO;
import com.makeit.vo.platform.auth.PlatUserCountVO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
......@@ -56,14 +58,10 @@ public interface PlatUserService extends IService<PlatUser> {
PlatUserLoginVO getRoleAndMenuList2();
// PlatUserLoginVO getWechatMenuList();
PlatUserLoginVO getUserVO();
PlatPersonDTOVO getUserDetail();
// List<String> getCustomGroupNameList();
List<PlatRole> getRoleList(String userId);
......@@ -86,10 +84,6 @@ public interface PlatUserService extends IService<PlatUser> {
PlatPersonDTOVO viewPerson(String id);
// void changeDeptMessage(PlatUser tntUser, String oldDeptId, String newDeptId);
//void leaveMessage(PlatUser tntUser);
List<PlatRole> getRoleListWithTag(String userId);
PlatRole getMaxRole(String userId);
......@@ -114,11 +108,6 @@ public interface PlatUserService extends IService<PlatUser> {
List<PlatOrg> getCandidateDeptList();
// List<String> getCustomGroupNameList(String userId);
//
// List<String> getCustomGroupIdList(String userId);
List<PlatMenu> getMenuListByUserId(String userId);
/**
......@@ -137,4 +126,8 @@ public interface PlatUserService extends IService<PlatUser> {
* @param platUserId
*/
void updatePlatUserTenantId(String tenantId,String platUserId);
void delBatch(List<String> idList);
ExcelImportVo importExcel(MultipartFile excelFile) throws Exception;
}
......@@ -128,7 +128,7 @@ implements PlatTenantService {
TntUserJoinUtil.join(platUserService,voList,qw->qw.eq(PlatUser::getIsTenant, IsTenantAccountEnum.YES.getValue()),
PlatTenantVO::getTntUserId,(t, u) -> {
t.setUserAccount(u.getAccount());
t.setUserAccount(u.getMobile());
t.setUserName(u.getUsername());
}, BaseEntity::getId);
......@@ -202,7 +202,7 @@ implements PlatTenantService {
//组织表增加一条数据
PlatOrg platOrg = convertToPlatOrg(tntTenant);
platOrgService.add(platOrg);
platOrgService.save(platOrg);
return tntTenant.getId();
}
......@@ -236,6 +236,8 @@ implements PlatTenantService {
platOrg.setName(platTenant.getName());
platOrg.setStatus(platTenant.getStatus());
platOrg.setId(platTenant.getId());
//租户没有父级
platOrg.setParentId("1");
return platOrg;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment