| | |
| | | |
| | | import com.gkhy.assess.common.annotation.RepeatSubmit; |
| | | import com.gkhy.assess.common.api.CommonResult; |
| | | import com.gkhy.assess.system.domain.AssProjectSupplement; |
| | | import com.gkhy.assess.system.service.AssAccessoryFileService; |
| | | import com.gkhy.assess.system.service.AssProjectSupplementFileService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | public class AssAccessoryFileController { |
| | | @Autowired |
| | | private AssAccessoryFileService assAccessoryFileService; |
| | | @Autowired |
| | | private AssProjectSupplementFileService assProjectSupplementFileService; |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "评估文件上传(图片/文件)") |
| | |
| | | @ApiImplicitParam(paramType = "body", name = "projectId", dataType = "long", required = true, value = "项目id"), |
| | | @ApiImplicitParam(paramType = "body", name = "moduleType", dataType = "int", required = true, value = "上传模块code:1主要装置前的合影照片,2现场勘验照片,3企业陪同人员图片,4现场勘验视频,5编制现场安全检查表,6评审记录附件,7评价结论,8过程控制记录文档附件,9项目归档材料,10报备申请附件,11项目整改情况附件") |
| | | }) |
| | | public CommonResult uploadFile(@RequestParam @NotNull Long projectId,@RequestParam @NotNull Integer moduleType, @RequestParam MultipartFile file){ |
| | | return CommonResult.success(assAccessoryFileService.uploadFile(projectId,moduleType,file)); |
| | | public CommonResult uploadFile(@RequestParam @NotNull Long projectId,@RequestParam @NotNull Integer moduleType,@RequestParam MultipartFile file){ |
| | | return CommonResult.success(assAccessoryFileService.uploadFile(projectId, moduleType, file)); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据项目id获取评估文件") |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.Logical; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | |
| | | @RepeatSubmit |
| | | @RequiresPermissions(value={"system:assess:monitor","system:assess:agency"},logical = Logical.OR) |
| | | @ApiOperation(value = "删除项目") |
| | | @DeleteMapping("/remove/{projectId}") |
| | | public CommonResult deleteProject(@PathVariable(value = "projectId")Long projectId){ |
对比新文件 |
| | |
| | | package com.gkhy.assess.admin.controller.web; |
| | | |
| | | |
| | | import com.gkhy.assess.common.annotation.RepeatSubmit; |
| | | import com.gkhy.assess.common.api.CommonResult; |
| | | import com.gkhy.assess.system.domain.AssProjectSupplement; |
| | | import com.gkhy.assess.system.service.AssProjectSupplementService; |
| | | 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.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目补录表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author kzy |
| | | * @since 2023-12-11 14:16:18 |
| | | */ |
| | | @Api(tags = "项目补录前端控制器") |
| | | @RestController |
| | | @RequestMapping("/manage/project-supplement") |
| | | public class AssProjectSupplementController { |
| | | @Autowired |
| | | private AssProjectSupplementService projectSupplementService; |
| | | |
| | | @ApiOperation(value = "项目列表(分页)") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"), |
| | | @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10,最大50") |
| | | }) |
| | | @GetMapping("/list") |
| | | public CommonResult projectList(AssProjectSupplement projectSupplement){ |
| | | return CommonResult.success(projectSupplementService.projectSupplementList(projectSupplement)); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据id获取项目详情") |
| | | @GetMapping("/detail/{projectId}") |
| | | public CommonResult projectDetail(@PathVariable(value = "projectId") Long projectId){ |
| | | return CommonResult.success(projectSupplementService.getProjectSupplementById(projectId)); |
| | | } |
| | | |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "创建项目补录") |
| | | @PostMapping("/add") |
| | | public CommonResult addProject(@Validated @RequestBody AssProjectSupplement projectSupplement){ |
| | | return CommonResult.success(projectSupplementService.addProjectSupplement(projectSupplement)); |
| | | } |
| | | |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "编辑项目补录") |
| | | @PutMapping("/edit") |
| | | public CommonResult editProject(@Validated @RequestBody AssProjectSupplement projectSupplement){ |
| | | return CommonResult.success(projectSupplementService.editProjectSupplement(projectSupplement)); |
| | | } |
| | | |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation(value = "删除项目") |
| | | @DeleteMapping("/remove/{projectId}") |
| | | public CommonResult deleteProject(@PathVariable(value = "projectId")Long projectId){ |
| | | return CommonResult.success(projectSupplementService.deleteProjectSupplement(projectId)); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | @Api(tags = "通用接口前端控制器") |
| | | @RestController |
| | | @RequestMapping("/system/common") |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "Excel导入") |
| | | @GetMapping("/importExcel") |
| | | public CommonResult importExcel() throws IOException { |
| | | commonService.importExcel(); |
| | | return CommonResult.success(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @RequiresPermissions("system:assess:monitor") |
| | | @RequiresPermissions(value = {"system:assess:monitor","system:assess:agency"},logical = Logical.OR) |
| | | @ApiOperation(value = "编辑机构") |
| | | @PutMapping("/editAgency") |
| | | public CommonResult editAgency(@RequestBody SysUser user){ |
| | |
| | | url: jdbc:mysql://localhost:3306/smart_assess?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&serverTimezone=Asia/Shanghai&useSSL=false |
| | | username: root |
| | | password: password |
| | | # 从库数据源 |
| | | slave: |
| | | enabled: false |
| | | url: |
| | |
| | | multipart: |
| | | enabled: true |
| | | # 单个文件大小 |
| | | max-file-size: 20MB |
| | | max-file-size: 50MB |
| | | # 设置总上传的文件大小 |
| | | max-request-size: 100MB |
| | | mvc: |
对比新文件 |
| | |
| | | |
| | | -- ---------------------------- |
| | | -- 项目补录表 |
| | | -- ---------------------------- |
| | | CREATE TABLE `smart_assess`.`ass_project_supplement` ( |
| | | `id` bigint NOT NULL AUTO_INCREMENT, |
| | | `name` varchar(50) NOT NULL COMMENT '项目名称', |
| | | `writer` varchar(50) NOT NULL COMMENT '报告撰写人', |
| | | `reviewer` varchar(50) NOT NULL COMMENT '报告审批人', |
| | | `filing_date` datetime NOT NULL COMMENT '项目时间', |
| | | `agency_id` bigint NOT NULL COMMENT '机构id', |
| | | `del_flag` tinyint NULL DEFAULT 0 COMMENT '删除标志(0正常,1删除,默认0)', |
| | | `version` int NULL DEFAULT 0 COMMENT '乐观锁', |
| | | `create_by` varchar(20) NULL COMMENT '创建人', |
| | | `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | `update_by` varchar(20) NULL COMMENT '更新人', |
| | | `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| | | `remark` varchar(100) NULL COMMENT '备注', |
| | | PRIMARY KEY (`id`) |
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '项目补录表' ROW_FORMAT = DYNAMIC; |
对比新文件 |
| | |
| | | |
| | | -- ---------------------------- |
| | | -- 项目补录附件表 |
| | | -- ---------------------------- |
| | | CREATE TABLE `smart_assess`.`ass_project_supplement_file` ( |
| | | `id` bigint NOT NULL AUTO_INCREMENT, |
| | | `file_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件名称', |
| | | `origin_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件原始名称', |
| | | `path` varchar(70) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件存放路径', |
| | | `project_id` bigint NOT NULL COMMENT '项目补录id', |
| | | `version` int NULL DEFAULT 0 COMMENT '乐观锁', |
| | | `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '创建人', |
| | | `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, |
| | | `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '更新人', |
| | | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
| | | PRIMARY KEY (`id`) USING BTREE |
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '项目补录附件表' ROW_FORMAT = DYNAMIC; |
对比新文件 |
| | |
| | | ALTER TABLE `smart_assess`.`ass_project_supplement_file` |
| | | MODIFY COLUMN `origin_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件原始名称'; |
对比新文件 |
| | |
| | | ALTER TABLE `smart_assess`.`ass_project` |
| | | ADD INDEX `index_agency_id`(`agency_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_audit` |
| | | ADD INDEX `index_project_id`(`project_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_conclusion` |
| | | ADD INDEX `index_project_id`(`project_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_contract` |
| | | ADD INDEX `index_project_id`(`project_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_estimate_plan` |
| | | ADD INDEX `index_project_id`(`project_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_estimate_task` |
| | | ADD INDEX `index_project_id`(`project_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_filing_apply` |
| | | ADD INDEX `index_project_id`(`project_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_investigation` |
| | | ADD INDEX `index_project_id`(`project_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_process_audit` |
| | | ADD INDEX `index_project_id`(`project_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_project_material` |
| | | ADD INDEX `index_project_id`(`project_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_project_supplement` |
| | | ADD INDEX `index_agency_id`(`agency_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_project_supplement_file` |
| | | ADD INDEX `index_project_id`(`project_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_recitification` |
| | | ADD INDEX `index_project_id`(`project_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_risk_estimate` |
| | | ADD INDEX `index_project_id`(`project_id`) USING BTREE; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_work_notification` |
| | | ADD INDEX `index_project_id`(`project_id`) USING BTREE; |
对比新文件 |
| | |
| | | ALTER TABLE `smart_assess`.`ass_project` |
| | | MODIFY COLUMN `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '项目名称'; |
| | | |
| | | ALTER TABLE `smart_assess`.`ass_project_supplement` |
| | | MODIFY COLUMN `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '项目名称'; |
对比新文件 |
| | |
| | | ALTER TABLE `smart_assess`.`sys_expert_info` |
| | | MODIFY COLUMN `title` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '职称', |
| | | MODIFY COLUMN `company_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位名称', |
| | | MODIFY COLUMN `current_profession` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '现在从事专业或方向', |
| | | ADD COLUMN `domain` varchar(10) NULL COMMENT '专家领域', |
| | | ADD COLUMN `level` varchar(10) NULL COMMENT '入库分级'; |
对比新文件 |
| | |
| | | package com.gkhy.admin; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.gkhy.assess.admin.GkhyAdminApplication; |
| | | import com.gkhy.assess.system.excel.ExpertExcelListener; |
| | | import com.gkhy.assess.system.domain.vo.SysExpertInfoExcelVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.core.io.Resource; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = GkhyAdminApplication.class) |
| | | //@ActiveProfiles("dev") |
| | | @Slf4j |
| | | public class ExcelTest { |
| | | @Autowired |
| | | private ApplicationContext applicationContext; |
| | | |
| | | @Test |
| | | public void testExcel() throws IOException { |
| | | Resource resource = applicationContext.getResource("classpath:abc.xlsx"); |
| | | InputStream resourceAsStream =resource.getInputStream(); |
| | | EasyExcel.read(resourceAsStream, SysExpertInfoExcelVO.class,new ExpertExcelListener()).sheet(0).doRead(); |
| | | } |
| | | } |
| | |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
| | |
| | | @ApiModelProperty(value = "机构Id") |
| | | private Long agentId; |
| | | |
| | | @ApiModelProperty(value = "审批状态(0暂存,1审核中,2审批通过,3审批驳回,4已作废 默认1)") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("用户角色") |
| | | private String role; |
| | | |
对比新文件 |
| | |
| | | package com.gkhy.assess.common.excel; |
| | | |
| | | |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.converters.ReadConverterContext; |
| | | import com.alibaba.excel.enums.CellDataTypeEnum; |
| | | import com.alibaba.excel.metadata.data.DataFormatData; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class BirthdayConvert implements Converter<Date> { |
| | | |
| | | @Override |
| | | public Class<?> supportJavaTypeKey() { |
| | | return Date.class; |
| | | } |
| | | |
| | | @Override |
| | | public CellDataTypeEnum supportExcelTypeKey() { |
| | | return CellDataTypeEnum.STRING; |
| | | } |
| | | |
| | | @Override |
| | | public Date convertToJavaData(ReadConverterContext<?> context) throws Exception { |
| | | DataFormatData dataFormatData = context.getReadCellData().getDataFormatData(); |
| | | Object data = context.getReadCellData().getData(); |
| | | String borthday=dataFormatData.toString(); |
| | | borthday=borthday.trim(); |
| | | String year=borthday.substring(0,4); |
| | | |
| | | return new Date(); |
| | | |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.assess.common.excel; |
| | | |
| | | |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.converters.ReadConverterContext; |
| | | import com.alibaba.excel.enums.CellDataTypeEnum; |
| | | |
| | | public class DutyConvert implements Converter<Integer> { |
| | | |
| | | @Override |
| | | public Class<?> supportJavaTypeKey() { |
| | | return Integer.class; |
| | | } |
| | | |
| | | @Override |
| | | public CellDataTypeEnum supportExcelTypeKey() { |
| | | return CellDataTypeEnum.STRING; |
| | | } |
| | | |
| | | @Override |
| | | public Integer convertToJavaData(ReadConverterContext<?> context) throws Exception { |
| | | String duty=context.getReadCellData().getStringValue(); |
| | | switch (duty){ |
| | | case "在岗": |
| | | return 0; |
| | | case "退休": |
| | | return 1; |
| | | default: |
| | | return 0; |
| | | } |
| | | |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.assess.common.excel; |
| | | |
| | | |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.converters.ReadConverterContext; |
| | | import com.alibaba.excel.enums.CellDataTypeEnum; |
| | | |
| | | public class SexConvert implements Converter<Integer> { |
| | | |
| | | @Override |
| | | public Class<?> supportJavaTypeKey() { |
| | | return Integer.class; |
| | | } |
| | | |
| | | @Override |
| | | public CellDataTypeEnum supportExcelTypeKey() { |
| | | return CellDataTypeEnum.STRING; |
| | | } |
| | | |
| | | @Override |
| | | public Integer convertToJavaData(ReadConverterContext<?> context) throws Exception { |
| | | String sex=context.getReadCellData().getStringValue(); |
| | | switch (sex){ |
| | | case "男": |
| | | return 0; |
| | | case "女": |
| | | return 1; |
| | | default: |
| | | return 2; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | public static String tokenHead=""; |
| | | |
| | | /**Token有效期为1天(Token在reids中缓存时间为两倍) 单位ms*/ |
| | | public static final long EXPIRATION=(1 * 24) * 60 * 60 * 1000; //JWT的超期限时间(60*60*24*1) |
| | | public static final long EXPIRATION=(1 *12) * 60 * 60 * 1000; //JWT的超期限时间(60*60*24*1) |
| | | |
| | | /** |
| | | * token有效期还有30分钟,刷新token 单位ms |
| | |
| | | * @return |
| | | */ |
| | | public static String sign(String username,String secret,Integer identity){ |
| | | Date date=new Date(System.currentTimeMillis()+EXPIRATION*1000); |
| | | Date date=new Date(System.currentTimeMillis()+EXPIRATION); |
| | | Algorithm algorithm=Algorithm.HMAC256(secret); |
| | | return JWT.create().withClaim("username",username) |
| | | .withClaim("identity",identity).withExpiresAt(date).sign(algorithm); |
| | |
| | | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; |
| | | import org.springframework.web.filter.CorsFilter; |
| | | |
| | | import java.lang.reflect.Array; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Arrays; |
| | | import java.util.TimeZone; |
| | | |
| | | /** |
| | |
| | | @Bean |
| | | public CorsFilter corsFilter() { |
| | | final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource(); |
| | | final CorsConfiguration corsConfiguration = new CorsConfiguration(); |
| | | final CorsConfiguration config = new CorsConfiguration(); |
| | | //是否允许请求带有验证信息 |
| | | corsConfiguration.setAllowCredentials(true); |
| | | config.setAllowCredentials(true); |
| | | config.setAllowedOrigins(Arrays.asList("*")); |
| | | config.setAllowedMethods(Arrays.asList("*")); |
| | | config.setAllowCredentials(true); |
| | | config.setMaxAge(168000L); |
| | | |
| | | // 允许访问的客户端域名 |
| | | corsConfiguration.addAllowedOriginPattern("*"); |
| | | // 允许服务端访问的客户端请求头 |
| | | corsConfiguration.addAllowedHeader("*"); |
| | | // 允许访问的方法名,GET POST等 |
| | | corsConfiguration.addAllowedMethod("*"); |
| | | urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration); |
| | | // config.addAllowedOriginPattern("*"); |
| | | // // 允许服务端访问的客户端请求头 |
| | | // config.addAllowedHeader("*"); |
| | | // // 允许访问的方法名,GET POST等 |
| | | // config.addAllowedMethod("*"); |
| | | urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", config); |
| | | return new CorsFilter(urlBasedCorsConfigurationSource); |
| | | } |
| | | } |
| | |
| | | // 配置shiro错误从定向问题 /error 路径的错误处理 |
| | | chain.addPathDefinition("/error", "anon"); |
| | | chain.addPathDefinition("/upload/**", "anon"); |
| | | chain.addPathDefinition("/system/common/importExcel", "anon"); |
| | | |
| | | chain.addPathDefinition("/system/account/login","anon"); |
| | | chain.addPathDefinition("/system/logout", "anon"); |
| | |
| | | import com.gkhy.assess.common.utils.RequestUtil; |
| | | import com.gkhy.assess.common.utils.SpringContextUtils; |
| | | import com.gkhy.assess.common.domain.JwtToken; |
| | | import com.gkhy.assess.common.utils.StringUtils; |
| | | import com.gkhy.assess.framework.shiro.service.SysLoginService; |
| | | import com.gkhy.assess.system.domain.SysUser; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | SysUser sysUser=null; |
| | | if(authenticationToken instanceof JwtToken){ |
| | | String token= (String) authenticationToken.getCredentials(); |
| | | if(token==null){ |
| | | if(StringUtils.isBlank(token)){ |
| | | log.info("————————身份认证失败——————————IP地址: "+ RequestUtil.getRequestIp(req) +",URL:"+req.getRequestURI()); |
| | | throw new AuthenticationException("token为空!"); |
| | | } |
| | |
| | | if(UserStatusEnum.DISABLE.getCode().equals(sysUser.getStatus())){ |
| | | throw new AuthenticationException("用户已被停用"); |
| | | } |
| | | if(UserIdentityEnum.AGENCY.getCode().equals(sysUser.getIdentity())){ |
| | | if(!ApproveStatusEnum.APPROVED.getCode().equals(sysUser.getState())){ |
| | | throw new AuthenticationException("机构账户审批还未通过"); |
| | | } |
| | | } |
| | | // if(UserIdentityEnum.AGENCY.getCode().equals(sysUser.getIdentity())){ |
| | | // if(!ApproveStatusEnum.APPROVED.getCode().equals(sysUser.getState())){ |
| | | // throw new AuthenticationException("机构账户审批还未通过"); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | public SysUser validJwtToken(String jwtToken){ |
| | |
| | | throw new AuthenticationException("token非法无效!"); |
| | | } |
| | | if(!jwtTokenRefresh(jwtToken,username,sysUser.getPassword(),identity)){ |
| | | throw new AuthenticationException("Token已失效,请重新登录!"); |
| | | throw new AuthenticationException("您的账号登录过期,请重新登录!"); |
| | | } |
| | | // setRolePermission(sysUser); |
| | | return sysUser; |
| | |
| | | */ |
| | | public boolean jwtTokenRefresh(String jwtToken, String username, String passWord, Integer identity){ |
| | | String tokenKey=redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN+":"+JwtTokenUtil.md5Encode(jwtToken)); |
| | | String userKey=redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN+":"+username+"_"+identity); |
| | | // String userKey=redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN+":"+username+"_"+identity); |
| | | String cacheToken= (String) redisUtils.get(tokenKey); |
| | | if(StringUtils.isNotEmpty(cacheToken)){ |
| | | // 校验token有效性 |
| | | if(!JwtTokenUtil.isNeedUpdate(cacheToken,username,passWord,identity)){ |
| | | String newToken=JwtTokenUtil.sign(username,passWord,identity); |
| | | // 设置超时时间 |
| | | redisUtils.set(tokenKey,newToken); |
| | | redisUtils.expire(tokenKey,JwtTokenUtil.EXPIRATION*2/1000); |
| | | redisUtils.expire(userKey,(JwtTokenUtil.EXPIRATION*2/1000)+2); |
| | | redisUtils.set(tokenKey,newToken,JwtTokenUtil.EXPIRATION*2/1000); |
| | | // redisUtils.expire(userKey,(JwtTokenUtil.EXPIRATION*2/1000)+2); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | |
| | | @TableField("project_id") |
| | | private Long projectId; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | import lombok.Setter; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL; |
| | |
| | | @TableField("project_id") |
| | | private Long projectId; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | |
| | | @NotEmpty(message = "评价报告不能为空") |
| | | @ApiModelProperty("评价结论附件") |
| | | @TableField(exist = false) |
| | | List<AssAccessoryFile> accessoryFiles; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.gkhy.assess.common.domain.BaseEntity; |
| | |
| | | @TableField("sign_path") |
| | | private String signPath; |
| | | |
| | | @NotBlank(message = "承诺书图片路径不能为空") |
| | | // @NotBlank(message = "承诺书图片路径不能为空") |
| | | @ApiModelProperty(value = "承诺书图片路径",required = true) |
| | | @TableField("insurance_path") |
| | | private String insurancePath; |
| | | |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.gkhy.assess.common.domain.BaseEntity; |
| | |
| | | @TableField("scene") |
| | | private Integer scene; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.gkhy.assess.common.domain.BaseEntity; |
| | |
| | | @TableField("file_id") |
| | | private Long fileId; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.gkhy.assess.common.domain.BaseEntity; |
| | |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | @TableField(exist = false) |
| | | private SysUser person; |
| | | |
| | | @ApiModelProperty("项目担任角色数组") |
| | | @TableField(exist = false) |
| | | private List<Integer> playRoles; |
| | | |
| | | } |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.gkhy.assess.common.domain.BaseEntity; |
| | | import com.gkhy.assess.system.domain.SysUser; |
| | |
| | | @TableField("project_id") |
| | | private Long projectId; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | private Long id; |
| | | |
| | | @NotBlank(message = "项目名称不能为空") |
| | | @Length(min=1,max=100,message = "项目名称不能超过{max}字符") |
| | | @ApiModelProperty(value = "项目名称",required = true) |
| | | @TableField("name") |
| | | private String name; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.gkhy.assess.common.domain.BaseEntity; |
| | |
| | | @TableField("file_id") |
| | | private Long fileId; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
对比新文件 |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目补录表 |
| | | * </p> |
| | | * |
| | | * @author kzy |
| | | * @since 2024-06-11 15:44:14 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("ass_project_supplement") |
| | | @ApiModel(value = "AssProjectSupplement对象", description = "项目补录表") |
| | | public class AssProjectSupplement implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | |
| | | @NotBlank(message = "项目名称不能为空") |
| | | @Length(min=1,max=100,message = "项目名称不能超过{max}字符") |
| | | @ApiModelProperty(value = "项目名称",required = true) |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @NotBlank(message = "报告撰写人不能为空") |
| | | @Length(min=1,max=50,message = "报告撰写人不能超过{max}字符") |
| | | @ApiModelProperty(value = "报告撰写人",required = true) |
| | | @TableField("writer") |
| | | private String writer; |
| | | |
| | | @NotBlank(message = "报告审批人不能为空") |
| | | @Length(min=1,max=50,message = "报告审批人不能超过{max}字符") |
| | | @ApiModelProperty(value = "报告审批人",required = true) |
| | | @TableField("reviewer") |
| | | private String reviewer; |
| | | |
| | | @NotNull(message = "项目时间不能为空") |
| | | @ApiModelProperty(value = "项目时间",required = true) |
| | | @TableField("filing_date") |
| | | private LocalDateTime filingDate; |
| | | |
| | | @NotNull(message = "机构id不能为空") |
| | | @ApiModelProperty(value = "机构id",required = true) |
| | | @TableField("agency_id") |
| | | private Long agencyId; |
| | | |
| | | @ApiModelProperty("删除标志(0正常,1删除,默认0)") |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty("创建人") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("更新人") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @ApiModelProperty("更新时间") |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @NotEmpty(message = "附件列表不能为空") |
| | | @ApiModelProperty(value = "附件列表",required = true) |
| | | @TableField(exist = false) |
| | | private List<AssProjectSupplementFile> files; |
| | | |
| | | @ApiModelProperty("机构名称") |
| | | @TableField(exist = false) |
| | | private String agencyName; |
| | | |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目补录附件表 |
| | | * </p> |
| | | * |
| | | * @author kzy |
| | | * @since 2024-06-11 15:44:15 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("ass_project_supplement_file") |
| | | @ApiModel(value = "AssProjectSupplementFile对象", description = "项目补录附件表") |
| | | public class AssProjectSupplementFile implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("文件名称") |
| | | @TableField("file_name") |
| | | private String fileName; |
| | | |
| | | @Length(min = 0,max = 100,message = "文件名长度不能超过100个字符") |
| | | @ApiModelProperty("文件原始名称") |
| | | @TableField("origin_name") |
| | | private String originName; |
| | | |
| | | @ApiModelProperty("文件存放路径") |
| | | @TableField("path") |
| | | private String path; |
| | | |
| | | @ApiModelProperty("项目补录id") |
| | | @TableField("project_id") |
| | | private Long projectId; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty("创建人") |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("更新人") |
| | | @TableField("update_by") |
| | | private String updateBy; |
| | | |
| | | @TableField("update_time") |
| | | private LocalDateTime updateTime; |
| | | |
| | | |
| | | } |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | |
| | | @TableField("reason") |
| | | private String reason; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | |
| | | @TableField("del_flag") |
| | | private Integer delFlag; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
| | |
| | | private String province; |
| | | |
| | | |
| | | @NotBlank(message = "市不能为空") |
| | | // @NotBlank(message = "市不能为空") |
| | | @ApiModelProperty(value = "市",required = true) |
| | | @TableField("city") |
| | | private String city; |
| | |
| | | @TableField("version") |
| | | private Integer version; |
| | | |
| | | @ApiModelProperty("专家领域") |
| | | @TableField("domain") |
| | | private String domain; |
| | | |
| | | @ApiModelProperty("入库分级") |
| | | @TableField("level") |
| | | private String level; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private SysAgency agency; |
| | | |
| | | @NotNull(message = "社保照片不能为空",groups ={ExpertGroup.class} ) |
| | | |
| | | @ApiModelProperty("社保照片路径列表,创建专家传参") |
| | | @TableField(exist = false) |
| | | private List<SysAttach> socialAttach; |
| | | |
| | | @NotNull(message = "医保照片不能为空",groups ={ExpertGroup.class} ) |
| | | @ApiModelProperty("医保照片路径列表,创建专家传参") |
| | | @TableField(exist = false) |
| | | private List<SysAttach> medicalAttach; |
| | | |
| | | @NotNull(message = "工资照片不能为空",groups ={ExpertGroup.class} ) |
| | | @ApiModelProperty("工资照片路径列表,创建专家传参") |
| | | @TableField(exist = false) |
| | | private List<SysAttach> salaryAttach; |
| | |
| | | @TableField(exist = false) |
| | | private PersonProjectVO personProjectVO; |
| | | |
| | | @ApiModelProperty("机构名称") |
| | | @TableField(exist = false) |
| | | private String agencyName; |
| | | |
| | | } |
| | |
| | | package com.gkhy.assess.system.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | |
| | | @TableField("user_id") |
| | | private Long userId; |
| | | |
| | | @Version |
| | | @ApiModelProperty("乐观锁") |
| | | @TableField("version") |
| | | private Integer version; |
对比新文件 |
| | |
| | | package com.gkhy.assess.system.domain.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.gkhy.assess.common.domain.BaseEntity; |
| | | import com.gkhy.assess.common.excel.BirthdayConvert; |
| | | import com.gkhy.assess.common.excel.DutyConvert; |
| | | import com.gkhy.assess.common.excel.SexConvert; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.experimental.Accessors; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Pattern; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系统专家信息表 |
| | | * </p> |
| | | * |
| | | * @author kzy |
| | | * @since 2023-11-27 16:33:33 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | public class SysExpertInfoExcelVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("序号") |
| | | @ExcelProperty(value = "序号",index = 0) |
| | | private String number; |
| | | |
| | | @ApiModelProperty("专家名称") |
| | | @ExcelProperty(value = "姓名",index = 1) |
| | | private String name; |
| | | |
| | | @ApiModelProperty("身份证号码") |
| | | @ExcelProperty(value = "身份证号",index = 2) |
| | | private String idCard; |
| | | |
| | | |
| | | @ApiModelProperty("出生日期") |
| | | @ExcelProperty(value = "出生年月",index = 3) |
| | | private LocalDateTime birthday; |
| | | |
| | | @ApiModelProperty("性别(0男,1女,2未知,默认2)") |
| | | @ExcelProperty(value = "性别",converter = SexConvert.class,index = 4) |
| | | private Integer sex; |
| | | |
| | | @ApiModelProperty("最高学历") |
| | | @ExcelProperty(value = "学历",index = 5) |
| | | private String degree; |
| | | |
| | | |
| | | @ApiModelProperty("专业") |
| | | @ExcelProperty(value = "所学专业",index = 6) |
| | | private String speciality; |
| | | |
| | | @ApiModelProperty("职称") |
| | | @ExcelProperty(value = "职称",index = 7) |
| | | private String title; |
| | | |
| | | @ApiModelProperty("在岗情况(0在岗,1退休)") |
| | | @ExcelProperty(value = "在岗情况",converter = DutyConvert.class,index = 8) |
| | | private Integer dutyStatus; |
| | | |
| | | |
| | | @ApiModelProperty("单位名称") |
| | | @ExcelProperty(value = "单位全称",index = 9) |
| | | private String companyName; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty("现在从事专业或方向") |
| | | @ExcelProperty(value = "现从事专业及方向",index = 10) |
| | | private String currentProfession; |
| | | |
| | | |
| | | @ApiModelProperty("手机号") |
| | | @ExcelProperty(value = "联系方式",index = 11) |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("支撑方向安全生产") |
| | | @ExcelProperty(value = "支持方向",index = 12) |
| | | private String supportDirectionSafety; |
| | | |
| | | @ApiModelProperty("专家领域") |
| | | @ExcelProperty(value = "专家领域",index = 13) |
| | | private String domain; |
| | | |
| | | @ApiModelProperty("入库分级") |
| | | @ExcelProperty(value = "入库分级",index = 14) |
| | | private String level; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.assess.system.excel; |
| | | |
| | | import cn.hutool.extra.spring.SpringUtil; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.util.ListUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.gkhy.assess.common.utils.StringUtils; |
| | | import com.gkhy.assess.system.domain.SysExpertInfo; |
| | | import com.gkhy.assess.system.domain.vo.SysExpertInfoExcelVO; |
| | | import com.gkhy.assess.system.service.SysExpertInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | |
| | | public class ExpertExcelListener extends AnalysisEventListener<SysExpertInfoExcelVO> { |
| | | |
| | | |
| | | private static final int BATCH_COUNT=100; |
| | | |
| | | private List<SysExpertInfoExcelVO> cachedDateList= ListUtils.newArrayListWithExpectedSize(BATCH_COUNT); |
| | | |
| | | @Override |
| | | public void onException(Exception exception, AnalysisContext context) throws Exception { |
| | | log.error("解析异常:",exception); |
| | | throw exception; |
| | | } |
| | | |
| | | @Override |
| | | public void invoke(SysExpertInfoExcelVO sysExpertInfoExcelVO, AnalysisContext analysisContext) { |
| | | if(!StringUtils.isBlank(sysExpertInfoExcelVO.getName())){ |
| | | cachedDateList.add(sysExpertInfoExcelVO); |
| | | } |
| | | if(cachedDateList.size()>=BATCH_COUNT){ |
| | | saveData(); |
| | | cachedDateList.clear(); |
| | | } |
| | | } |
| | | |
| | | private void saveData(){ |
| | | for(SysExpertInfoExcelVO sysExpertInfoExcelVO:cachedDateList){ |
| | | String direction=sysExpertInfoExcelVO.getSupportDirectionSafety(); |
| | | String name=sysExpertInfoExcelVO.getName(); |
| | | String idCard = sysExpertInfoExcelVO.getIdCard(); |
| | | SysExpertInfo existExpertInfo = SpringUtil.getBean(SysExpertInfoService.class).getOne(Wrappers.<SysExpertInfo>lambdaQuery() |
| | | .eq(true, SysExpertInfo::getIdCard, idCard) |
| | | .last(" limit 1")); |
| | | direction=direction.replace("安全生产:","").trim(); |
| | | String[] splits = direction.split("、"); |
| | | List<String> safetyArray=new ArrayList<>(); |
| | | for(String str:splits){ |
| | | str=str.trim(); |
| | | String code="1"; |
| | | if(str.equals("现场检查")){ |
| | | code="1"; |
| | | }else if(str.equals("调查评估")){ |
| | | code="2"; |
| | | }else if(str.equals("咨询服务")){ |
| | | code="3"; |
| | | }else if(str.equals("教育培训")){ |
| | | code="4"; |
| | | }else{ |
| | | code="5"; |
| | | } |
| | | safetyArray.add(code); |
| | | } |
| | | if(existExpertInfo!=null){ |
| | | existExpertInfo.setState(2); |
| | | existExpertInfo.setSupportDirectionSafety(String.join( ",",safetyArray)); |
| | | existExpertInfo.setDomain(sysExpertInfoExcelVO.getDomain()); |
| | | existExpertInfo.setLevel(sysExpertInfoExcelVO.getLevel()); |
| | | SpringUtil.getBean(SysExpertInfoService.class).updateById(existExpertInfo); |
| | | }else{ |
| | | SysExpertInfo sysExpertInfo=new SysExpertInfo(); |
| | | BeanUtils.copyProperties(sysExpertInfoExcelVO,sysExpertInfo); |
| | | sysExpertInfo.setSupportDirectionSafety(String.join( ",",safetyArray)); |
| | | sysExpertInfo.setState(2); |
| | | SpringUtil.getBean(SysExpertInfoService.class).save(sysExpertInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | saveData(); |
| | | log.info("sheet={}解析完成",analysisContext.readSheetHolder().getSheetName()); |
| | | } |
| | | } |
| | |
| | | */ |
| | | List<PersonRecognitionVO> getPersonAndRecognitionCount(List<Long> projectIds); |
| | | |
| | | /** |
| | | * 查找项目组长人数 |
| | | * @param projectId |
| | | * @return |
| | | */ |
| | | int getMajorPlanPersonCountByProject(Long projectId); |
| | | } |
| | |
| | | * @param name |
| | | * @return |
| | | */ |
| | | AssProject getProjectByName(String name); |
| | | AssProject getProjectByName(@Param("name")String name,@Param("agencyId")Long agencyId); |
| | | |
| | | /** |
| | | * 获取项目状态 |
对比新文件 |
| | |
| | | package com.gkhy.assess.system.mapper; |
| | | |
| | | import com.gkhy.assess.system.domain.AssProjectSupplementFile; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目补录附件表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author kzy |
| | | * @since 2024-06-11 15:44:15 |
| | | */ |
| | | @Mapper |
| | | public interface AssProjectSupplementFileMapper extends BaseMapper<AssProjectSupplementFile> { |
| | | /** |
| | | * 获取项目的附件 |
| | | * @param projectId |
| | | * @return |
| | | */ |
| | | List<AssProjectSupplementFile> getFilesByProjectId(Long projectId); |
| | | |
| | | |
| | | /** |
| | | * 根据项目id删除附件 |
| | | * @param projectId |
| | | * @return |
| | | */ |
| | | int deleteByProjectId(Long projectId); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.assess.system.mapper; |
| | | |
| | | import com.gkhy.assess.system.domain.AssProjectSupplement; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目补录表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author kzy |
| | | * @since 2024-06-11 15:44:14 |
| | | */ |
| | | @Mapper |
| | | public interface AssProjectSupplementMapper extends BaseMapper<AssProjectSupplement> { |
| | | /** |
| | | * 根据名称获取项目 |
| | | * @param name |
| | | * @param agencyId |
| | | * @return |
| | | */ |
| | | AssProjectSupplement getProjectByName(@Param("name") String name, @Param("agencyId") Long agencyId); |
| | | |
| | | /** |
| | | * 分页获取项目列表 |
| | | * @param projectSupplement |
| | | * @return |
| | | */ |
| | | List<AssProjectSupplement> projectList(AssProjectSupplement projectSupplement); |
| | | |
| | | /** |
| | | * 根据id查询项目 |
| | | * @param projectSupplementId |
| | | * @return |
| | | */ |
| | | AssProjectSupplement getProjectSupplementById(Long projectSupplementId); |
| | | } |
| | |
| | | * @param personId |
| | | * @return |
| | | */ |
| | | int deletePlanPersonByPersonId(Long personId); |
| | | int deletePlanPersonByPersonId(Long personId,Long projectId,Integer playCode); |
| | | |
| | | /** |
| | | * 校验项目成员是否唯一 |
| | |
| | | * @return |
| | | */ |
| | | AssPlanPerson getPlanPersonByPersonId(Long personId,Long projectId); |
| | | |
| | | /** |
| | | * 查询项目成员组长人数 |
| | | * @param projectId |
| | | * @return |
| | | */ |
| | | int getMajorPlanPersonCountByProject(Long projectId); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.assess.system.service; |
| | | |
| | | import com.gkhy.assess.system.domain.AssAccessoryFile; |
| | | import com.gkhy.assess.system.domain.AssProjectSupplementFile; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目补录附件表 服务类 |
| | | * </p> |
| | | * |
| | | * @author kzy |
| | | * @since 2024-06-11 15:44:15 |
| | | */ |
| | | public interface AssProjectSupplementFileService extends IService<AssProjectSupplementFile> { |
| | | |
| | | /** |
| | | * 根据项目id获取文件 |
| | | * @param projectId |
| | | * @return |
| | | */ |
| | | List<AssProjectSupplementFile> getSupplementFileByProjectId(Long projectId); |
| | | |
| | | |
| | | /** |
| | | * 根据项目id批量删除文件 |
| | | * @param projectId |
| | | * @return |
| | | */ |
| | | int deleteByProjectId(Long projectId); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.assess.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.gkhy.assess.common.api.CommonPage; |
| | | import com.gkhy.assess.system.domain.AssProjectSupplement; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目补录表 服务类 |
| | | * </p> |
| | | * |
| | | * @author kzy |
| | | * @since 2024-06-11 15:44:14 |
| | | */ |
| | | public interface AssProjectSupplementService extends IService<AssProjectSupplement> { |
| | | /** |
| | | * 新增项目补录 |
| | | * @param projectSupplement |
| | | * @return |
| | | */ |
| | | int addProjectSupplement(AssProjectSupplement projectSupplement); |
| | | |
| | | /** |
| | | * 编辑项目补录 |
| | | * @param projectSupplement |
| | | * @return |
| | | */ |
| | | int editProjectSupplement(AssProjectSupplement projectSupplement); |
| | | |
| | | /** |
| | | * 根据id获取项目补录信息 |
| | | * @param projectSupplementId |
| | | * @return |
| | | */ |
| | | AssProjectSupplement getProjectSupplementById(Long projectSupplementId); |
| | | |
| | | /** |
| | | * 分页获取项目补录 |
| | | * @param projectSupplement |
| | | * @return |
| | | */ |
| | | CommonPage projectSupplementList(AssProjectSupplement projectSupplement); |
| | | |
| | | /** |
| | | * 删除项目补录 |
| | | * @param projectSupplementId |
| | | * @return |
| | | */ |
| | | int deleteProjectSupplement(Long projectSupplementId); |
| | | |
| | | /** |
| | | * 校验名称是否唯一 |
| | | * @param projectSupplement |
| | | * @return |
| | | */ |
| | | Boolean checkNameUnique(AssProjectSupplement projectSupplement); |
| | | |
| | | } |
| | |
| | | import com.gkhy.assess.system.domain.vo.UploadObjectVO; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | public interface SysCommonService { |
| | | |
| | | /** |
| | |
| | | UploadObjectVO doUpload(String imageBase64); |
| | | |
| | | public boolean removeFile(String path); |
| | | |
| | | |
| | | |
| | | public void importExcel() throws IOException; |
| | | } |
| | |
| | | Long projectId=audit.getProjectId(); |
| | | projectService.checkUserAllowed(projectId); |
| | | checkAuditCount(projectId,audit.getAuditType()); |
| | | planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(audit.getAssessorId()).setProjectId(projectId)); |
| | | // planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(audit.getAssessorId()).setProjectId(projectId)); |
| | | //校验项目状态 |
| | | projectService.checkReportProgress(projectId, audit.getAuditType()==1?ReportProgressEnum.INVESTINGATION:ReportProgressEnum.INNER_AUDIT); |
| | | audit.setCreateBy(ShiroUtils.getSysUser().getUsername()); |
| | |
| | | int row=baseMapper.updateById(audit); |
| | | if(row>0){ |
| | | if(audit.getAssessorId()!=null&& !audit.getAssessorId().equals(oldAudit.getAssessorId())){ |
| | | planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(audit.getAssessorId()).setProjectId(oldAudit.getProjectId())); |
| | | // planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(audit.getAssessorId()).setProjectId(oldAudit.getProjectId())); |
| | | //todo 删除旧的项目成员 |
| | | planPersonService.deletePlanPersonByPersonId(oldAudit.getAssessorId()); |
| | | planPersonService.deletePlanPersonByPersonId(oldAudit.getAssessorId(),audit.getProjectId(),audit.getAuditType()==1?PlayRoleEnum.INNER_LEADER.getCode():PlayRoleEnum.TEACH_LEADER.getCode()); |
| | | //todo 新增新的项目成员 |
| | | planPersonService.addPlanPerson(new AssPlanPerson().setPersonId(audit.getAssessorId()) |
| | | .setPlayRole(audit.getAuditType()==1?PlayRoleEnum.INNER_LEADER.getCode():PlayRoleEnum.TEACH_LEADER.getCode()) |
| | |
| | | //校验项目状态 |
| | | projectService.checkReportProgress(projectId, ReportProgressEnum.REVIEW_RECORD); |
| | | conclusion.setCreateBy(ShiroUtils.getSysUser().getUsername()); |
| | | conclusion.setIsReviseManual(true); |
| | | int row=baseMapper.insert(conclusion); |
| | | if(row>0) { |
| | | //更新项目状态 |
| | |
| | | Long projectId=estimatePlan.getProjectId(); |
| | | projectService.checkUserAllowed(projectId); |
| | | checkEstimatePlanCount(projectId); |
| | | planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(estimatePlan.getAuserId()).setProjectId(projectId)); |
| | | //校验项目状态 |
| | | projectService.checkReportProgress(projectId, ReportProgressEnum.ESTIMATE_TASK); |
| | | //校验是否设置了组长 |
| | | checkMajorPlanPersonCount(projectId); |
| | | estimatePlan.setCreateBy(ShiroUtils.getSysUser().getUsername()); |
| | | int row=baseMapper.insert(estimatePlan); |
| | | if(row>0) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 校验项目组成员是否设置了组长 |
| | | * @param projectId |
| | | */ |
| | | public void checkMajorPlanPersonCount(Long projectId){ |
| | | int count=planPersonService.getMajorPlanPersonCountByProject(projectId); |
| | | if(count<1){ |
| | | throw new ApiException("项目组成员中必须有一个人设置为组长"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = RuntimeException.class) |
| | | public int editEstimatePlan(AssEstimatePlan estimatePlan) { |
| | | projectService.checkUserAllowed(estimatePlan.getProjectId()); |
| | | checkMajorPlanPersonCount(estimatePlan.getProjectId()); |
| | | AssEstimatePlan oldPlan=getById(estimatePlan.getId()); |
| | | estimatePlan.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | int row=baseMapper.updateById(estimatePlan); |
| | |
| | | } |
| | | if(row>0) { |
| | | if (estimatePlan.getAuserId() != null && !estimatePlan.getAuserId().equals(oldPlan.getAuserId())) { |
| | | planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(estimatePlan.getAuserId()).setProjectId(oldPlan.getProjectId())); |
| | | // planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(estimatePlan.getAuserId()).setProjectId(oldPlan.getProjectId())); |
| | | //todo 删除旧的项目成员 |
| | | planPersonService.deletePlanPersonByPersonId(oldPlan.getAuserId()); |
| | | planPersonService.deletePlanPersonByPersonId(oldPlan.getAuserId(),estimatePlan.getProjectId(),PlayRoleEnum.ANGENCY_LEADER.getCode()); |
| | | //todo 新增新的项目成员 |
| | | planPersonService.addPlanPerson(new AssPlanPerson().setPersonId(estimatePlan.getAuserId()) |
| | | .setPlayRole(PlayRoleEnum.ANGENCY_LEADER.getCode()) |
| | |
| | | Long projectId=estimateTask.getProjectId(); |
| | | projectService.checkUserAllowed(projectId); |
| | | checkTaskCount(projectId); |
| | | planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(estimateTask.getLeaderId()).setProjectId(projectId)); |
| | | // planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(estimateTask.getLeaderId()).setProjectId(projectId)); |
| | | //校验项目状态 |
| | | projectService.checkReportProgress(projectId, ReportProgressEnum.CONTRACT); |
| | | estimateTask.setCreateBy(ShiroUtils.getSysUser().getUsername()); |
| | |
| | | estimateTask.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | int row=baseMapper.updateById(estimateTask); |
| | | if(row>0 &&estimateTask.getLeaderId()!=null&& !estimateTask.getLeaderId().equals(oldTask.getLeaderId())){ |
| | | planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(estimateTask.getLeaderId()).setProjectId(oldTask.getProjectId())); |
| | | // planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(estimateTask.getLeaderId()).setProjectId(oldTask.getProjectId())); |
| | | //todo 删除旧的项目成员 |
| | | planPersonService.deletePlanPersonByPersonId(oldTask.getLeaderId()); |
| | | planPersonService.deletePlanPersonByPersonId(oldTask.getLeaderId(),estimateTask.getProjectId(),PlayRoleEnum.PROJECT_LEADER.getCode()); |
| | | //todo 新增新的项目成员 |
| | | planPersonService.addPlanPerson(new AssPlanPerson().setPersonId(estimateTask.getLeaderId()) |
| | | .setPlayRole(PlayRoleEnum.PROJECT_LEADER.getCode()) |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | public Boolean checkAllFaceRecongnition(Long projectId){ |
| | | projectService.checkUserAllowed(projectId); |
| | | List<AssPlanPerson> planPersonList=planPersonMapper.getAllPlanPersonByProjectId(projectId); |
| | | Map<Long,AssPlanPerson> planPersonMap=planPersonList.stream().collect(Collectors.toMap(AssPlanPerson::getPersonId,a -> a,(k1,k2) -> k1)); |
| | | planPersonList=planPersonMap.values().stream().collect(Collectors.toList()); |
| | | List<AssFaceRecognition> faceRecognitionList=baseMapper.getSimpleFaceRecognitionByProjectId(projectId); |
| | | Map<Long,AssFaceRecognition> map=faceRecognitionList.stream().collect(Collectors.toMap(AssFaceRecognition::getPersonId,a -> a,(k1,k2) -> k1)); |
| | | String message=""; |
| | |
| | | public List<AssFaceRecognition> getFaceRecognitionByProjectId(Long projectId) { |
| | | projectService.checkUserAllowed(projectId); |
| | | List<AssFaceRecognition> faceRecognitionList= baseMapper.getFaceRecognitionByProjectId(projectId); |
| | | return faceRecognitionList; |
| | | //同一个人员担任多种角色 |
| | | Map<Long,List<Integer>> playRoleMap=faceRecognitionList.stream().collect(Collectors.toMap(AssFaceRecognition::getPersonId,p -> { |
| | | List<Integer> pRoles=new ArrayList<>(); |
| | | pRoles.add(p.getPlanPerson().getPlayRole()); |
| | | return pRoles; |
| | | },(List<Integer>value1,List<Integer> value2) -> { |
| | | value1.addAll(value2); |
| | | return value1; |
| | | })); |
| | | Map<Long,AssFaceRecognition> faceMap=faceRecognitionList.stream().collect(Collectors.toMap(AssFaceRecognition::getPersonId,a -> a,(k1,k2) -> k2)); |
| | | List<AssFaceRecognition> faceRecognitions=faceMap.values().stream().collect(Collectors.toList()); |
| | | for(AssFaceRecognition faceRecognition:faceRecognitions){ |
| | | faceRecognition.getPlanPerson().setPlayRoles(playRoleMap.get(faceRecognition.getPersonId())); |
| | | } |
| | | return faceRecognitions; |
| | | } |
| | | |
| | | |
| | |
| | | faceRecord.setFacePath(uploadObjectVO.getPath()); |
| | | AssFaceRecord existRecord=checkFaceUnique(faceRecord.getPersonId(),faceRecord.getProjectId()); |
| | | if(existRecord!=null){ |
| | | throw new ApiException("已存在人脸识别记录"); |
| | | // existRecord.setFacePath(uploadObjectVO.getPath()); |
| | | // existRecord.setLocation(faceRecord.getLocation()); |
| | | // existRecord.setScene(faceRecord.getScene()); |
| | | // row =baseMapper.updateById(existRecord); |
| | | // throw new ApiException("已存在人脸识别记录"); |
| | | existRecord.setFacePath(uploadObjectVO.getPath()); |
| | | existRecord.setLocation(faceRecord.getLocation()); |
| | | existRecord.setScene(faceRecord.getScene()); |
| | | row =baseMapper.updateById(existRecord); |
| | | }else{ |
| | | faceRecord.setCreateBy(ShiroUtils.getSysUser().getUsername()); |
| | | row=baseMapper.insert(faceRecord); |
| | |
| | | package com.gkhy.assess.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.gkhy.assess.common.enums.DeleteFlagEnum; |
| | | import com.gkhy.assess.common.enums.RequestSourceEnum; |
| | | import com.gkhy.assess.common.exception.ApiException; |
| | | import com.gkhy.assess.system.domain.AssAccessoryFile; |
| | | import com.gkhy.assess.system.domain.AssInvestigation; |
| | | import com.gkhy.assess.system.domain.AssPlanPerson; |
| | | import com.gkhy.assess.system.enums.AccessoryFileTypeEnum; |
| | | import com.gkhy.assess.system.enums.ReportProgressEnum; |
| | | import com.gkhy.assess.system.mapper.AssInvestigationMapper; |
| | |
| | | public Long addInvestigation(AssInvestigation investigation) { |
| | | Long projectId=investigation.getProjectId(); |
| | | projectService.checkUserAllowed(projectId); |
| | | String location=investigation.getLocation(); |
| | | String[] locationArray = location.split(","); |
| | | if(locationArray.length!=2){ |
| | | throw new ApiException("现场勘验位置格式不正确"); |
| | | } |
| | | // checkInvestigationCount(projectId); |
| | | investigation.setCreateBy(ShiroUtils.getSysUser().getUsername()); |
| | | if(investigation.getIsSafetyCheck()!=null&&investigation.getIsSafetyCheck()==1){ |
| | |
| | | } |
| | | fileIds.add(accessoryFile.getId()); |
| | | } |
| | | |
| | | baseMapper.insert(investigation); |
| | | //更新图片过程id |
| | | accessoryFileService.batchUpdateAccessoryFileProcessId(fileIds,investigation.getId()); |
| | |
| | | throw new ApiException("现场勘验记录id不能为空!"); |
| | | } |
| | | projectService.checkUserAllowed(investigation.getProjectId()); |
| | | String location=investigation.getLocation(); |
| | | String[] locationArray = location.split(","); |
| | | if(locationArray.length!=2){ |
| | | throw new ApiException("现场勘验位置格式不正确"); |
| | | } |
| | | investigation.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | List<AssAccessoryFile> accessFiles=new ArrayList<>(); |
| | | accessFiles.addAll(investigation.getCompanyImages()); |
| | |
| | | Long projectId= Long.parseLong(map.get("projectId").toString()); |
| | | projectService.checkUserAllowed(projectId); |
| | | |
| | | LambdaQueryWrapper< AssInvestigation > lambdaQueryWrapper = Wrappers.<AssInvestigation>lambdaQuery() |
| | | .eq(AssInvestigation::getProjectId, projectId) |
| | | .eq(AssInvestigation::getDelFlag, DeleteFlagEnum.UN_DELETE); |
| | | |
| | | Long count= count(lambdaQueryWrapper); |
| | | if(count<1){ |
| | | throw new ApiException("现场勘验记录不能为空"); |
| | | } |
| | | //校验项目状态 |
| | | projectService.checkReportProgress(projectId, ReportProgressEnum.WORK_NOTIFICATION); |
| | | //更新项目状态 |
| | |
| | | package com.gkhy.assess.system.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.gkhy.assess.common.enums.DeleteFlagEnum; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | return baseMapper.insert(planPerson); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void checkPersonUnique(AssPlanPerson planPerson) { |
| | | if(planPerson.getPlayRole()==null){ |
| | | planPerson.setPlayRole(PlayRoleEnum.PROJECT_MEMBER.getCode()); |
| | | } |
| | | LambdaQueryWrapper<AssPlanPerson> lambdaQueryWrapper = Wrappers.<AssPlanPerson>lambdaQuery() |
| | | .eq(AssPlanPerson::getPersonId, planPerson.getPersonId()) |
| | | .eq(AssPlanPerson::getDelFlag, DeleteFlagEnum.UN_DELETE) |
| | | .eq(AssPlanPerson::getProjectId, planPerson.getProjectId()); |
| | | .eq(AssPlanPerson::getProjectId, planPerson.getProjectId()) |
| | | .eq(AssPlanPerson::getPlayRole,planPerson.getPlayRole()); |
| | | if(planPerson.getId()!=null){ |
| | | lambdaQueryWrapper.ne(AssPlanPerson::getId,planPerson.getId()); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int getMajorPlanPersonCountByProject(Long projectId) { |
| | | return baseMapper.getMajorPlanPersonCountByProject(projectId); |
| | | } |
| | | |
| | | @Override |
| | | public int editPlanPerson(AssPlanPerson planPerson) { |
| | | projectService.checkUserAllowed(planPerson.getProjectId()); |
| | | if(planPerson.getPersonId()!=null){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int deletePlanPersonByPersonId(Long personId) { |
| | | public int deletePlanPersonByPersonId(Long personId,Long projectId,Integer playCode) { |
| | | return baseMapper.update(null,Wrappers.<AssPlanPerson>lambdaUpdate() |
| | | .set(AssPlanPerson::getDelFlag,DeleteFlagEnum.DELETED.getCode()) |
| | | .set(AssPlanPerson::getUpdateBy,ShiroUtils.getSysUser().getUsername()) |
| | | .eq(AssPlanPerson::getPersonId,personId)); |
| | | .eq(AssPlanPerson::getPersonId,personId) |
| | | .eq(AssPlanPerson::getProjectId,projectId) |
| | | .eq(AssPlanPerson::getPlayRole,playCode)); |
| | | } |
| | | } |
| | |
| | | Long projectId=processAudit.getProjectId(); |
| | | projectService.checkUserAllowed(projectId); |
| | | checkProcessAuditCount(projectId); |
| | | planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(processAudit.getProcessLeaderId()).setProjectId(projectId)); |
| | | // planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(processAudit.getProcessLeaderId()).setProjectId(projectId)); |
| | | //校验项目状态 |
| | | projectService.checkReportProgress(projectId, ReportProgressEnum.CONCLUSION); |
| | | processAudit.setCreateBy(ShiroUtils.getSysUser().getUsername()); |
| | |
| | | processAudit.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | int row=baseMapper.updateById(processAudit); |
| | | if(row>0 && processAudit.getProcessLeaderId()!=null&& !processAudit.getProcessLeaderId().equals(oldProcess.getProcessLeaderId())){ |
| | | planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(processAudit.getProcessLeaderId()).setProjectId(oldProcess.getProjectId())); |
| | | // planPersonService.checkPersonUnique(new AssPlanPerson().setPersonId(processAudit.getProcessLeaderId()).setProjectId(oldProcess.getProjectId())); |
| | | //todo 删除旧的项目成员 |
| | | planPersonService.deletePlanPersonByPersonId(oldProcess.getProcessLeaderId()); |
| | | planPersonService.deletePlanPersonByPersonId(oldProcess.getProcessLeaderId(),processAudit.getProjectId(),PlayRoleEnum.PROCESS_LEADER.getCode()); |
| | | //todo 新增新的项目成员 |
| | | planPersonService.addPlanPerson(new AssPlanPerson().setPersonId(processAudit.getProcessLeaderId()) |
| | | .setPlayRole(PlayRoleEnum.PROCESS_LEADER.getCode()) |
| | |
| | | if(user.getAgencyId()==null){ |
| | | throw new ApiException("用户机构id为空"); |
| | | } |
| | | project.setAgencyId(user.getAgencyId()); |
| | | if(!checkNameUnique(project)){ |
| | | throw new ApiException("项目名已存在"); |
| | | } |
| | | project.setAgencyId(user.getAgencyId()); |
| | | |
| | | project.setReportProgress(ReportProgressEnum.ADD.getCode()); |
| | | project.setCreateBy(ShiroUtils.getSysUser().getUsername()); |
| | | int row=baseMapper.insert(project); |
| | |
| | | //todo 权限校验 |
| | | SysUser user= ShiroUtils.getSysUser(); |
| | | checkUserAllowed(projectId); |
| | | AssProject project=new AssProject() |
| | | //判断项目流转状态 |
| | | AssProject project=getById(projectId); |
| | | if(project.getReportProgress().equals(ReportProgressEnum.CONFIRM_FINAL.getCode())){ |
| | | if(!user.getIdentity().equals(UserIdentityEnum.MONITOR.getCode())){ |
| | | throw new ApiException("没有权限删除确认完结的项目,请联系监管用户删除"); |
| | | } |
| | | } |
| | | project=new AssProject() |
| | | .setId(projectId) |
| | | .setDelFlag(DeleteFlagEnum.DELETED.getCode()); |
| | | project.setUpdateBy(user.getUsername()); |
| | |
| | | throw new ApiException("项目id不能为空"); |
| | | } |
| | | checkUserAllowed(projectId); |
| | | if(!checkNameUnique(project)){ |
| | | throw new ApiException("项目名已存在"); |
| | | } |
| | | // if(!checkNameUnique(project)){ |
| | | // throw new ApiException("项目名已存在"); |
| | | // } |
| | | project.setAgencyId(null);//机构id不能修改 |
| | | project.setReportProgress(null);//项目状态不能修改 |
| | | project.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | |
| | | @Override |
| | | public boolean checkNameUnique(AssProject project) { |
| | | Long projectId = project.getId()==null? -1L : project.getId(); |
| | | AssProject pro = baseMapper.getProjectByName(project.getName()); |
| | | AssProject pro = baseMapper.getProjectByName(project.getName(),project.getAgencyId()); |
| | | if (pro!=null && pro.getId().longValue() != projectId.longValue()) |
| | | { |
| | | return false; |
对比新文件 |
| | |
| | | package com.gkhy.assess.system.service.impl; |
| | | |
| | | import com.gkhy.assess.common.exception.ApiException; |
| | | import com.gkhy.assess.system.domain.AssAccessoryFile; |
| | | import com.gkhy.assess.system.domain.AssProjectSupplementFile; |
| | | import com.gkhy.assess.system.domain.vo.UploadObjectVO; |
| | | import com.gkhy.assess.system.mapper.AssProjectSupplementFileMapper; |
| | | import com.gkhy.assess.system.service.AssProjectSupplementFileService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.assess.system.utils.ShiroUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目补录附件表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author kzy |
| | | * @since 2024-06-11 15:44:15 |
| | | */ |
| | | @Service |
| | | public class AssProjectSupplementFileServiceImpl extends ServiceImpl<AssProjectSupplementFileMapper, AssProjectSupplementFile> implements AssProjectSupplementFileService { |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<AssProjectSupplementFile> getSupplementFileByProjectId(Long projectId) { |
| | | return baseMapper.getFilesByProjectId(projectId); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int deleteByProjectId(Long projectId) { |
| | | return baseMapper.deleteByProjectId(projectId); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.assess.system.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.assess.common.api.CommonPage; |
| | | import com.gkhy.assess.common.enums.UserIdentityEnum; |
| | | import com.gkhy.assess.common.exception.ApiException; |
| | | import com.gkhy.assess.common.utils.PageUtil; |
| | | import com.gkhy.assess.system.domain.AssProjectSupplement; |
| | | import com.gkhy.assess.system.domain.AssProjectSupplementFile; |
| | | import com.gkhy.assess.system.domain.SysAttach; |
| | | import com.gkhy.assess.system.domain.SysUser; |
| | | import com.gkhy.assess.system.mapper.AssProjectSupplementFileMapper; |
| | | import com.gkhy.assess.system.mapper.AssProjectSupplementMapper; |
| | | import com.gkhy.assess.system.service.AssProjectSupplementFileService; |
| | | import com.gkhy.assess.system.service.AssProjectSupplementService; |
| | | import com.gkhy.assess.system.service.SysCommonService; |
| | | import com.gkhy.assess.system.utils.ShiroUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目补录表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author kzy |
| | | * @since 2024-06-11 15:44:14 |
| | | */ |
| | | @Service |
| | | public class AssProjectSupplementServiceImpl extends ServiceImpl<AssProjectSupplementMapper, AssProjectSupplement> implements AssProjectSupplementService { |
| | | @Autowired |
| | | private AssProjectSupplementFileService projectSupplementFileService; |
| | | @Autowired |
| | | private SysCommonService commonService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = RuntimeException.class) |
| | | public int addProjectSupplement(AssProjectSupplement projectSupplement) { |
| | | if(!checkNameUnique(projectSupplement)){ |
| | | throw new ApiException("补录的项目名称已存在"); |
| | | } |
| | | projectSupplement.setCreateBy(ShiroUtils.getSysUser().getUsername()); |
| | | int row =baseMapper.insert(projectSupplement); |
| | | if(row<1){ |
| | | throw new ApiException("新增项目失败"); |
| | | } |
| | | List<AssProjectSupplementFile> fileList=projectSupplement.getFiles(); |
| | | if(ObjectUtil.isNotEmpty(fileList)) { |
| | | for (AssProjectSupplementFile file : fileList) { |
| | | file.setProjectId(projectSupplement.getId()); |
| | | } |
| | | projectSupplementFileService.saveBatch(fileList); |
| | | } |
| | | return row; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = RuntimeException.class) |
| | | public int editProjectSupplement(AssProjectSupplement projectSupplement) { |
| | | if(!checkNameUnique(projectSupplement)){ |
| | | throw new ApiException("补录的项目名称已存在"); |
| | | } |
| | | projectSupplement.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | int row =baseMapper.updateById(projectSupplement); |
| | | if(row<1){ |
| | | throw new ApiException("编辑项目失败"); |
| | | } |
| | | List<AssProjectSupplementFile> fileList=projectSupplement.getFiles(); |
| | | List<AssProjectSupplementFile> existFileList=projectSupplementFileService.getSupplementFileByProjectId(projectSupplement.getId()); |
| | | if(ObjectUtil.isNotEmpty(fileList)) { |
| | | for (AssProjectSupplementFile psf : fileList) { |
| | | psf.setProjectId(projectSupplement.getId()); |
| | | } |
| | | projectSupplementFileService.saveOrUpdateBatch(fileList); |
| | | } |
| | | //删除附件 |
| | | List<Long> newIds=fileList.stream().map(AssProjectSupplementFile::getId).collect(Collectors.toList()); |
| | | List<Long> delIds = new ArrayList<>(); |
| | | for(AssProjectSupplementFile psf:existFileList){ |
| | | if(!newIds.contains(psf.getId())){ |
| | | delIds.add(psf.getId()); |
| | | } |
| | | } |
| | | if(!delIds.isEmpty()){ |
| | | projectSupplementFileService.removeBatchByIds(delIds); |
| | | } |
| | | return row; |
| | | } |
| | | |
| | | @Override |
| | | public AssProjectSupplement getProjectSupplementById(Long projectSupplementId) { |
| | | return baseMapper.getProjectSupplementById(projectSupplementId); |
| | | } |
| | | |
| | | @Override |
| | | public CommonPage projectSupplementList(AssProjectSupplement projectSupplement) { |
| | | SysUser user= ShiroUtils.getSysUser(); |
| | | if(!user.getIdentity().equals(UserIdentityEnum.MONITOR.getCode())){ |
| | | //机构用户只能查看本机构的项目 |
| | | if(user.getAgencyId()==null){ |
| | | throw new ApiException("用户机构id为空"); |
| | | } |
| | | projectSupplement.setAgencyId(user.getAgencyId()); |
| | | } |
| | | PageUtil.startPage(); |
| | | List<AssProjectSupplement> projects=baseMapper.projectList(projectSupplement); |
| | | return CommonPage.restPage(projects); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteProjectSupplement(Long projectSupplementId) { |
| | | //删除附件 |
| | | List<AssProjectSupplementFile> fileList=projectSupplementFileService.getSupplementFileByProjectId(projectSupplementId); |
| | | if(fileList.size()>0){ |
| | | for(AssProjectSupplementFile file:fileList){ |
| | | commonService.removeFile(file.getPath()); |
| | | projectSupplementFileService.removeById(file.getId()); |
| | | } |
| | | } |
| | | return baseMapper.deleteById(projectSupplementId); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean checkNameUnique(AssProjectSupplement projectSupplement) { |
| | | Long projectId = projectSupplement.getId()==null? -1L : projectSupplement.getId(); |
| | | AssProjectSupplement pro = baseMapper.getProjectByName(projectSupplement.getName(),projectSupplement.getAgencyId()); |
| | | if (pro!=null && pro.getId().longValue() != projectId.longValue()) |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | |
| | | package com.gkhy.assess.system.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.gkhy.assess.common.exception.ApiException; |
| | | import com.gkhy.assess.system.excel.ExpertExcelListener; |
| | | import com.gkhy.assess.system.domain.vo.SysExpertInfoExcelVO; |
| | | import com.gkhy.assess.system.domain.vo.UploadObjectVO; |
| | | import com.gkhy.assess.system.service.SysCommonService; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.core.io.Resource; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import sun.misc.BASE64Decoder; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void importExcel() throws IOException { |
| | | ClassPathResource classPathResource = new ClassPathResource("abc.xlsx"); |
| | | InputStream inputStream = classPathResource.getInputStream(); |
| | | if(inputStream==null){ |
| | | throw new ApiException("获取文件失败"); |
| | | } |
| | | EasyExcel.read(inputStream, SysExpertInfoExcelVO.class,new ExpertExcelListener()).sheet(0).doRead(); |
| | | } |
| | | |
| | | @Override |
| | | public UploadObjectVO doUpload(MultipartFile file){ |
| | | String originName=file.getOriginalFilename(); |
| | | String filename=originName; |
| | |
| | | * 清空旧的登录信息,保证同时只有一个用户再登录,后登录用户会挤掉前一个用户 |
| | | * @param username |
| | | */ |
| | | public void cacheUserToken(String username,Integer identity,String newToken){ |
| | | String userKey = redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN + ":" + username+"_"+identity); |
| | | String oldToken = (String) redisUtils.get(userKey); |
| | | if (StringUtils.isNotBlank(oldToken)) { |
| | | String oldTokenkey = redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN + ":" + JwtTokenUtil.md5Encode(oldToken)); |
| | | redisUtils.del(oldTokenkey); |
| | | redisUtils.del(userKey); |
| | | } |
| | | redisUtils.set(userKey, newToken,(JwtTokenUtil.EXPIRATION*2/1000)+2); |
| | | // public void cacheUserToken(String username,Integer identity,String newToken){ |
| | | // String userKey = redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN + ":" + username+"_"+identity); |
| | | // String oldToken = (String) redisUtils.get(userKey); |
| | | // if (StringUtils.isNotBlank(oldToken)) { |
| | | // String oldTokenkey = redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN + ":" + JwtTokenUtil.md5Encode(oldToken)); |
| | | // redisUtils.del(oldTokenkey); |
| | | // redisUtils.del(userKey); |
| | | // } |
| | | // redisUtils.set(userKey, newToken,(JwtTokenUtil.EXPIRATION*2/1000)+2); |
| | | // |
| | | // |
| | | // String tokenKey= redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN+":"+JwtTokenUtil.md5Encode(newToken)); |
| | | // // 设置超时时间 |
| | | // redisUtils.set(tokenKey,newToken); |
| | | // redisUtils.expire(tokenKey,JwtTokenUtil.EXPIRATION*2/1000); |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 清空旧的登录信息,保证同时只有一个用户再登录,后登录用户会挤掉前一个用户 |
| | | * @param username |
| | | */ |
| | | public void cacheUserToken(String username,Integer identity,String newToken){ |
| | | // String userKey = redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN + ":" + username+"_"+identity); |
| | | // String oldToken = (String) redisUtils.get(userKey); |
| | | // if (StringUtils.isNotBlank(oldToken)) { |
| | | // String oldTokenkey = redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN + ":" + JwtTokenUtil.md5Encode(oldToken)); |
| | | // redisUtils.del(oldTokenkey); |
| | | // redisUtils.del(userKey); |
| | | // } |
| | | // redisUtils.set(userKey, newToken,(JwtTokenUtil.EXPIRATION*2/1000)+2); |
| | | |
| | | String tokenKey= redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN+":"+JwtTokenUtil.md5Encode(newToken)); |
| | | // 设置超时时间 |
| | | redisUtils.set(tokenKey,newToken); |
| | | redisUtils.expire(tokenKey,JwtTokenUtil.EXPIRATION*2/1000); |
| | | redisUtils.set(tokenKey,newToken,JwtTokenUtil.EXPIRATION*2/1000); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 校验验证码 |
| | |
| | | if(StringUtils.isNotBlank(jwtToken)){ |
| | | String username=JwtTokenUtil.getUsername(jwtToken); |
| | | Integer identity=JwtTokenUtil.getIdentity(jwtToken); |
| | | String userKey = redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN + ":" + username+"_"+identity); |
| | | // String userKey = redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN + ":" + username+"_"+identity); |
| | | String tokenKey= redisUtils.generateKey(CacheConstant.SYS_USER_TOKEN+":"+JwtTokenUtil.md5Encode(jwtToken)); |
| | | //删除redis缓存 |
| | | redisUtils.del(tokenKey); |
| | | redisUtils.del(userKey); |
| | | // redisUtils.del(userKey); |
| | | } |
| | | } |
| | | |
| | |
| | | if(!checkPhoneUnique(new SysUser().setUsername(user.getPhone()).setIdentity(UserIdentityEnum.EXPERT.getCode()))){ |
| | | throw new ApiException("手机号已存在"); |
| | | } |
| | | List<SysAttach> socialAttach=user.getSocialAttach(); |
| | | List<SysAttach> medicalAttach=user.getMedicalAttach(); |
| | | List<SysAttach> salaryAttach=user.getSalaryAttach(); |
| | | //疆外企业必须上传社保、医保、薪资 |
| | | SysAgency agency=agencyService.getAgencyById(user.getAgencyId()); |
| | | if(agency.getAttribute()==0){ |
| | | if(ObjectUtil.isEmpty(socialAttach)||ObjectUtil.isEmpty(medicalAttach)||ObjectUtil.isEmpty(salaryAttach)){ |
| | | throw new ApiException("疆内企业必须上传社保、医保、工资照片"); |
| | | } |
| | | } |
| | | |
| | | String major=user.getMajor(); |
| | | List<Integer> majors=new ArrayList<>(); |
| | | JSONObject jsonObject=JSONObject.parseObject(major); |
| | |
| | | if(!b){ |
| | | throw new ApiException("创建专家信息失败"); |
| | | } |
| | | List<SysAttach> socialAttach=user.getSocialAttach(); |
| | | List<SysAttach> medicalAttach=user.getMedicalAttach(); |
| | | List<SysAttach> salaryAttach=user.getSalaryAttach(); |
| | | |
| | | List<SysAttach> attaches=new ArrayList<>(); |
| | | for(SysAttach attach:socialAttach){ |
| | | attach.setType(AttachTypeEnum.SOCIAL.getCode()); |
| | | attach.setUserId(user.getId()); |
| | | attaches.add(attach); |
| | | if(socialAttach!=null&& !socialAttach.isEmpty()) { |
| | | for (SysAttach attach : socialAttach) { |
| | | attach.setType(AttachTypeEnum.SOCIAL.getCode()); |
| | | attach.setUserId(user.getId()); |
| | | attaches.add(attach); |
| | | } |
| | | } |
| | | for(SysAttach attach:medicalAttach){ |
| | | attach.setType(AttachTypeEnum.MEDICAL.getCode()); |
| | | attach.setUserId(user.getId()); |
| | | attaches.add(attach); |
| | | if(medicalAttach!=null&& !medicalAttach.isEmpty()) { |
| | | for (SysAttach attach : medicalAttach) { |
| | | attach.setType(AttachTypeEnum.MEDICAL.getCode()); |
| | | attach.setUserId(user.getId()); |
| | | attaches.add(attach); |
| | | } |
| | | } |
| | | for(SysAttach attach:salaryAttach){ |
| | | attach.setType(AttachTypeEnum.SALARY.getCode()); |
| | | attach.setUserId(user.getId()); |
| | | attaches.add(attach); |
| | | if(salaryAttach!=null&& !salaryAttach.isEmpty()) { |
| | | for (SysAttach attach : salaryAttach) { |
| | | attach.setType(AttachTypeEnum.SALARY.getCode()); |
| | | attach.setUserId(user.getId()); |
| | | attaches.add(attach); |
| | | } |
| | | } |
| | | attachService.saveBatch(attaches); |
| | | if(!attaches.isEmpty()) { |
| | | attachService.saveBatch(attaches); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | delCacheByUsername(user.getUsername(),user.getIdentity()); |
| | | delCacheByUsername(user.getPhone(),user.getIdentity()); |
| | | user=new SysUser().setId(userId); |
| | | user.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | user.setDelFlag(DeleteFlagEnum.DELETED.getCode()); |
| | |
| | | throw new ApiException("手机号已存在"); |
| | | } |
| | | delCacheByUsername(user.getUsername(),UserIdentityEnum.MONITOR.getCode()); |
| | | delCacheByUsername(user.getPhone(),UserIdentityEnum.MONITOR.getCode()); |
| | | user.setPassword(null); |
| | | user.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | boolean b=updateById(user); |
| | |
| | | if(!agencyService.checkAgencyNameUnique(agency)){ |
| | | throw new ApiException("机构名称已存在"); |
| | | } |
| | | SysUser currentUser=ShiroUtils.getSysUser(); |
| | | if(!currentUser.getIdentity().equals(UserIdentityEnum.MONITOR.getCode())){ |
| | | if(!user.getId().equals(currentUser.getId())){ |
| | | throw new ApiException("只能修改自身数据"); |
| | | } |
| | | } |
| | | |
| | | delCacheByUsername(user.getUsername(),UserIdentityEnum.AGENCY.getCode()); |
| | | agency.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | delCacheByUsername(user.getPhone(),UserIdentityEnum.AGENCY.getCode()); |
| | | agency.setUpdateBy(currentUser.getUsername()); |
| | | agencyService.updateById(agency); |
| | | user.setPassword(null); |
| | | user.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | user.setUpdateBy(currentUser.getUsername()); |
| | | boolean b=updateById(user); |
| | | if(!b){ |
| | | throw new ApiException("更新用户失败"); |
| | |
| | | if(!checkPhoneUnique(user.setIdentity(UserIdentityEnum.EXPERT.getCode()))){ |
| | | throw new ApiException("手机号已存在"); |
| | | } |
| | | List<SysAttach> socialAttach=user.getSocialAttach(); |
| | | List<SysAttach> medicalAttach=user.getMedicalAttach(); |
| | | List<SysAttach> salaryAttach=user.getSalaryAttach(); |
| | | //疆外企业必须上传社保、医保、薪资 |
| | | SysAgency agency=agencyService.getAgencyById(user.getAgencyId()); |
| | | if(agency.getAttribute()==0){ |
| | | if(ObjectUtil.isEmpty(socialAttach)||ObjectUtil.isEmpty(medicalAttach)||ObjectUtil.isEmpty(salaryAttach)){ |
| | | throw new ApiException("疆内企业必须上传社保、医保、工资照片"); |
| | | } |
| | | } |
| | | |
| | | String major=user.getMajor(); |
| | | if(StringUtils.isNotBlank(major)){ |
| | | List<Integer> majors=new ArrayList<>(); |
| | |
| | | // 刪除旧数据 |
| | | // attachService.deleteAttachsByUserId(user.getId(),null); |
| | | |
| | | List<SysAttach> socialAttach=user.getSocialAttach(); |
| | | List<SysAttach> medicalAttach=user.getMedicalAttach(); |
| | | List<SysAttach> salaryAttach=user.getSalaryAttach(); |
| | | List<SysAttach> attaches=new ArrayList<>(); |
| | | for(SysAttach attach:socialAttach){ |
| | | attach.setType(AttachTypeEnum.SOCIAL.getCode()); |
| | | attach.setUserId(user.getId()); |
| | | attaches.add(attach); |
| | | if(socialAttach!=null&& !socialAttach.isEmpty()) { |
| | | for (SysAttach attach : socialAttach) { |
| | | attach.setType(AttachTypeEnum.SOCIAL.getCode()); |
| | | attach.setUserId(user.getId()); |
| | | attaches.add(attach); |
| | | } |
| | | } |
| | | for(SysAttach attach:medicalAttach){ |
| | | attach.setType(AttachTypeEnum.MEDICAL.getCode()); |
| | | attach.setUserId(user.getId()); |
| | | attaches.add(attach); |
| | | if(medicalAttach!=null&& !medicalAttach.isEmpty()) { |
| | | for (SysAttach attach : medicalAttach) { |
| | | attach.setType(AttachTypeEnum.MEDICAL.getCode()); |
| | | attach.setUserId(user.getId()); |
| | | attaches.add(attach); |
| | | } |
| | | } |
| | | for(SysAttach attach:salaryAttach){ |
| | | attach.setType(AttachTypeEnum.SALARY.getCode()); |
| | | attach.setUserId(user.getId()); |
| | | attaches.add(attach); |
| | | if(salaryAttach!=null&& !salaryAttach.isEmpty()) { |
| | | for (SysAttach attach : salaryAttach) { |
| | | attach.setType(AttachTypeEnum.SALARY.getCode()); |
| | | attach.setUserId(user.getId()); |
| | | attaches.add(attach); |
| | | } |
| | | } |
| | | attachService.saveOrUpdateBatch(attaches); |
| | | if(!attaches.isEmpty()) { |
| | | attachService.saveOrUpdateBatch(attaches); |
| | | } |
| | | |
| | | List<Long> newIds=attaches.stream().map(SysAttach::getId).collect(Collectors.toList()); |
| | | List<Long> delIds=new ArrayList<>(); |
| | | for(SysAttach attach:existAttaches){ |
| | | if(!newIds.contains(attach.getId())){ |
| | | List<Long> newIds = attaches.stream().map(SysAttach::getId).collect(Collectors.toList()); |
| | | List<Long> delIds = new ArrayList<>(); |
| | | for (SysAttach attach : existAttaches) { |
| | | if (!newIds.contains(attach.getId())) { |
| | | delIds.add(attach.getId()); |
| | | } |
| | | } |
| | | if(!delIds.isEmpty()){ |
| | | if (!delIds.isEmpty()) { |
| | | attachService.deleteAttachsByIds(delIds); |
| | | } |
| | | |
| | | delCacheByUsername(user.getUsername(),UserIdentityEnum.EXPERT.getCode()); |
| | | delCacheByUsername(user.getPhone(),UserIdentityEnum.EXPERT.getCode()); |
| | | return row; |
| | | } |
| | | |
| | |
| | | SysUser newUser=new SysUser().setId(user.getId()).setPassword(JwtTokenUtil.encryptPassword(oldUser.getUsername(),originPsword,oldUser.getSalt())); |
| | | newUser.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | delCacheByUsername(oldUser.getUsername(),oldUser.getIdentity()); |
| | | delCacheByUsername(oldUser.getPhone(),oldUser.getIdentity()); |
| | | return updateById(newUser); |
| | | } |
| | | |
| | |
| | | SysUser su=new SysUser().setId(user.getId()).setStatus(user.getStatus()); |
| | | su.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | delCacheByUsername(existUser.getUsername(),existUser.getIdentity()); |
| | | delCacheByUsername(existUser.getPhone(),existUser.getIdentity()); |
| | | return updateById(su); |
| | | } |
| | | |
| | |
| | | SysUser su=new SysUser().setId(user.getId()).setState(user.getState()); |
| | | su.setUpdateBy(ShiroUtils.getSysUser().getUsername()); |
| | | delCacheByUsername(existUser.getUsername(),existUser.getIdentity()); |
| | | delCacheByUsername(existUser.getPhone(),existUser.getIdentity()); |
| | | return updateById(su); |
| | | } |
| | | } |
| | |
| | | group by a.project_id |
| | | </select> |
| | | |
| | | <select id="getMajorPlanPersonCountByProject" resultType="java.lang.Integer"> |
| | | select count(1) from ass_plan_person where del_flag=0 and job_type=2 and project_id=#{projectId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <select id="projectList" resultMap="projectResult"> |
| | | <include refid="selectProjectVo"/> |
| | | <if test="params.personId != null and params.personId != ''"> |
| | | left join ass_plan_person a on a.project_id=p.id |
| | | left join ass_plan_person pp on pp.project_id=p.id |
| | | </if> |
| | | <if test="params.lostMaterial != null"> |
| | | left join ass_project_material m on m.project_id=p.id |
| | |
| | | and date_format(p.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') |
| | | </if> |
| | | <if test="params.personId != null and params.personId != ''"> |
| | | and a.person_id=#{params.personId} and a.del_flag=0 |
| | | and pp.person_id=#{params.personId} and pp.del_flag=0 |
| | | </if> |
| | | <if test="params.lostMaterial != null and params.lostMaterial==1"> |
| | | and (m.file_id is null) |
| | |
| | | |
| | | <select id="getProjectByName" resultType="com.gkhy.assess.system.domain.AssProject"> |
| | | select id,name from ass_project |
| | | where name=#{name} |
| | | where name=#{name} and agency_id=#{agencyId} and del_flag=0 limit 1 |
| | | </select> |
| | | |
| | | <select id="getReportProgress" resultType="java.lang.Integer"> |
| | |
| | | </select> |
| | | |
| | | <select id="getMemberProjectByUserId" resultMap="projectResult"> |
| | | select p.id,p.name,p.report_progress,p.code,p.client,p.province,p.city,p.district,p.business,p.create_time,a.id as plan_person_id, |
| | | select distinct p.id,p.name,p.report_progress,p.code,p.client,p.province,p.city,p.district,p.business,p.create_time,a.id as plan_person_id, |
| | | e.leader_id,u.name as leader_name |
| | | from ass_project p |
| | | left join ass_plan_person a on a.project_id=p.id |
| | |
| | | </select> |
| | | |
| | | <select id="getLeaderProjectByUserId" resultMap="projectResult"> |
| | | select p.id,p.name,p.report_progress,p.code,p.client,p.province,p.city,p.district,p.business,p.create_time,a.id as plan_person_id, |
| | | select distinct p.id,p.name,p.report_progress,p.code,p.client,p.province,p.city,p.district,p.business,p.create_time,a.id as plan_person_id, |
| | | e.leader_id,u.name as leader_name |
| | | from ass_project p |
| | | left join ass_plan_person a on a.project_id=p.id |
| | |
| | | </select> |
| | | |
| | | <select id="getProjectByPersonIds" resultType="com.gkhy.assess.system.domain.vo.PersonProjectVO"> |
| | | select a.person_id,count(*) as project_count,max(p.create_time) as last_estimate_time from ass_project p |
| | | select d.person_id,count(*) as project_count,max(d.create_time) as last_estimate_time from |
| | | (select a.person_id,a.project_id,max(p.create_time) as create_time from ass_project p |
| | | left join ass_plan_person a on a.project_id=p.id |
| | | where a.del_flag=0 and p.del_flag=0 and a.person_id in |
| | | <foreach collection="personIds" item="personId" open="(" separator="," close=")"> |
| | | #{personId} |
| | | </foreach> |
| | | group by a.person_id |
| | | group by a.person_id,a.project_id) d |
| | | group by d.person_id |
| | | </select> |
| | | |
| | | </mapper> |
对比新文件 |
| | |
| | | <?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="com.gkhy.assess.system.mapper.AssProjectSupplementFileMapper"> |
| | | |
| | | <delete id="deleteByProjectId"> |
| | | delete from ass_project_supplement_file where project_id=#{projectId} |
| | | </delete> |
| | | |
| | | <select id="getFilesByProjectId" resultType="com.gkhy.assess.system.domain.AssProjectSupplementFile"> |
| | | select * from ass_project_supplement_file where project_id=#{projectId} |
| | | </select> |
| | | </mapper> |
对比新文件 |
| | |
| | | <?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="com.gkhy.assess.system.mapper.AssProjectSupplementMapper"> |
| | | <resultMap type="com.gkhy.assess.system.domain.AssProjectSupplement" id="projectResult"> |
| | | <id property="id" column="id" /> |
| | | <result property="name" column="name" /> |
| | | <result property="writer" column="writer" /> |
| | | <result property="reviewer" column="reviewer" /> |
| | | <result property="filingDate" column="filing_date" /> |
| | | <result property="agencyId" column="agency_id" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="version" column="version" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="agencyName" column="agency_name" /> |
| | | <collection property="files" ofType="com.gkhy.assess.system.domain.AssProjectSupplementFile" select="getFileByProjectId" column="{projectId=id}"/> |
| | | </resultMap> |
| | | |
| | | <select id="getProjectByName" resultType="com.gkhy.assess.system.domain.AssProjectSupplement"> |
| | | select id,name,agency_id from ass_project_supplement where name=#{name} and agency_id=#{agencyId} limit 1 |
| | | </select> |
| | | |
| | | <select id="projectList" resultMap="projectResult"> |
| | | select s.*,a.name as agency_name from ass_project_supplement s |
| | | left join sys_agency a on a.id=s.agency_id |
| | | <where> |
| | | <if test="name!=null and name!=''"> |
| | | and s.name like ('%',#{name},'%') |
| | | </if> |
| | | <if test="agencyId!=null"> |
| | | and s.agency_id =#{agencyId} |
| | | </if> |
| | | </where> |
| | | order by s.create_time desc |
| | | </select> |
| | | |
| | | <select id="getFileByProjectId" resultType="com.gkhy.assess.system.domain.AssProjectSupplementFile"> |
| | | select * from ass_project_supplement_file where project_id=#{projectId} |
| | | </select> |
| | | |
| | | <select id="getProjectSupplementById" resultMap="projectResult"> |
| | | select s.*,a.name as agency_name from ass_project_supplement s |
| | | left join sys_agency a on a.id=s.agency_id |
| | | where s.id=#{projectSupplementId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </update> |
| | | |
| | | <select id="expertInfoList" resultType="com.gkhy.assess.system.domain.SysExpertInfo"> |
| | | select id,name,sex,birthday,phone,title,degree,state,speciality,big_classify,small_classify,create_time from sys_expert_info |
| | | select id,name,sex,birthday,phone,title,degree,state,speciality,big_classify,small_classify,id_card,company_name,domain,level,current_profession,duty_status,support_direction_safety,create_time from sys_expert_info |
| | | <where> |
| | | and del_flag = 0 |
| | | <if test="name != null and name != ''"> |
| | |
| | | <id property="id" column="agency_id" /> |
| | | <result property="name" column="agency_name" /> |
| | | <result property="creditCode" column="credit_code" /> |
| | | <result property="attribute" column="attribute" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.id,u.username, u.name,u.identity,u.user_type,u.phone,u.sex,u.status, |
| | | u.del_flag,u.manage_region,u.expert_type,u.agency_id,u.post,u.job_title, |
| | | u.major,u.state,u.create_time,u.remark,u.level,u.id_photo,u.certificate_no, |
| | | a.id as agency_id,a.name as agency_name,a.credit_code |
| | | a.id as agency_id,a.name as agency_name,a.credit_code,a.attribute |
| | | from sys_user u |
| | | left join sys_agency a on u.agency_id=a.id |
| | | </sql> |
| | |
| | | <if test="status != null"> |
| | | AND u.status = #{status} |
| | | </if> |
| | | <if test="state != null"> |
| | | AND u.state = #{state} |
| | | </if> |
| | | <if test="phone != null and phone != ''"> |
| | | AND u.phone like concat('%', #{phone}, '%') |
| | | </if> |
| | | <if test="agencyName != null and agencyName != ''"> |
| | | AND a.name like concat('%', #{agencyName}, '%') |
| | | </if> |
| | | </where> |
| | | order by u.create_time desc |
| | | </select> |
| | |
| | | <caffeine.version>2.9.3</caffeine.version> |
| | | <kaptcha.version>2.3.2</kaptcha.version> |
| | | <commons.io.version>2.13.0</commons.io.version> |
| | | <easyexcel.version>4.0.1</easyexcel.version> |
| | | </properties> |
| | | <dependencyManagement> |
| | | <dependencies> |
| | |
| | | <version>${commons.io.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>${easyexcel.version}</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |