+ * JobFactory实例 + *
+ * + * @author DengMin + * @since 2020/12/9 + */ +@Component +public class JobFactory extends AdaptableJobFactory { + + private AutowireCapableBeanFactory factory; + + public JobFactory(AutowireCapableBeanFactory factory) { + this.factory = factory; + } + + @Override + protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception { + Object job = super.createJobInstance(bundle); + factory.autowireBean(job); + return job; + } +} diff --git b/src/main/java/com/subsidy/common/configure/MyTomcat.java a/src/main/java/com/subsidy/common/configure/MyTomcat.java new file mode 100644 index 0000000..52d1ac7 --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/MyTomcat.java @@ -0,0 +1,89 @@ +package com.subsidy.common.configure; + +import org.apache.catalina.connector.Connector; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer; +import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.web.servlet.MultipartConfigFactory; +import org.springframework.boot.web.servlet.server.ServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.MultipartConfigElement; + +@Configuration +public class MyTomcat { + + + @Value("${spring.server.port}") + private String port; + @Value("${spring.server.acceptorThreadCount}") + private String acceptorThreadCount; + @Value("${spring.server.minSpareThreads}") + private String minSpareThreads; + @Value("${spring.server.maxSpareThreads}") + private String maxSpareThreads; + @Value("${spring.server.maxThreads}") + private String maxThreads; + @Value("${spring.server.maxConnections}") + private String maxConnections; + @Value("${spring.server.protocol}") + private String protocol; + @Value("${spring.server.redirectPort}") + private String redirectPort; + @Value("${spring.server.compression}") + private String compression; + @Value("${spring.server.connectionTimeout}") + private String connectionTimeout; + + @Value("${spring.server.MaxFileSize}") + private String MaxFileSize; + @Value("${spring.server.MaxRequestSize}") + private String MaxRequestSize; + + @Bean + public ServletWebServerFactory servletContainer() { + TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory(); + tomcat.addConnectorCustomizers(new GwsTomcatConnectionCustomizer()); + return tomcat; + } + + @Bean + public MultipartConfigElement multipartConfigElement() { + MultipartConfigFactory factory = new MultipartConfigFactory(); + // 单个数据大小 + factory.setMaxFileSize(MaxFileSize); // KB,MB + /// 总上传数据大小 + factory.setMaxRequestSize(MaxRequestSize); + return factory.createMultipartConfig(); + } + + /** + * + * 默认http连接 + * + * @version + * @author liuyi 2016年7月20日 下午7:59:41 + * + */ + public class GwsTomcatConnectionCustomizer implements TomcatConnectorCustomizer { + + public GwsTomcatConnectionCustomizer() { + } + + @Override + public void customize(Connector connector) { + connector.setPort(Integer.valueOf(port)); + connector.setAttribute("connectionTimeout", connectionTimeout); + connector.setAttribute("acceptorThreadCount", acceptorThreadCount); + connector.setAttribute("minSpareThreads", minSpareThreads); + connector.setAttribute("maxSpareThreads", maxSpareThreads); + connector.setAttribute("maxThreads", maxThreads); + connector.setAttribute("maxConnections", maxConnections); + connector.setAttribute("protocol", protocol); + connector.setAttribute("redirectPort", "redirectPort"); + connector.setAttribute("compression", "compression"); + } + } + +} diff --git b/src/main/java/com/subsidy/common/configure/MybatisPlusConfig.java a/src/main/java/com/subsidy/common/configure/MybatisPlusConfig.java new file mode 100644 index 0000000..c02a5b2 --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/MybatisPlusConfig.java @@ -0,0 +1,54 @@ +package com.subsidy.common.configure; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.core.config.GlobalConfig; +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import com.subsidy.common.handler.MetaHandler; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author: tuyp + * @create: 2020-08-12 12:01 + */ +@Configuration +@ConditionalOnClass(value = {PaginationInterceptor.class}) +public class MybatisPlusConfig { + + /** + * 分页 + * @return + */ + @Bean + public PaginationInterceptor paginationInterceptor(){ + PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); + paginationInterceptor.setDialectType(DbType.MYSQL.getDb()); + return paginationInterceptor; + } +// +// /** +// * 打印 sql +// */ +// @Bean +// public PerformanceInterceptor performanceInterceptor() { +// PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor(); +// //格式化sql语句 +// Properties properties = new Properties(); +// properties.setProperty("format", "false"); +// performanceInterceptor.setProperties(properties); +// return performanceInterceptor; +// } + + /** + * 自动填充功能 + * @return + */ + @Bean + public GlobalConfig globalConfig() { + GlobalConfig globalConfig = new GlobalConfig(); + globalConfig.setMetaObjectHandler(new MetaHandler()); + return globalConfig; + } + +} diff --git b/src/main/java/com/subsidy/common/configure/PolyvConfig.java a/src/main/java/com/subsidy/common/configure/PolyvConfig.java new file mode 100644 index 0000000..8082d40 --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/PolyvConfig.java @@ -0,0 +1,19 @@ +package com.subsidy.common.configure; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Component +@Data +@ConfigurationProperties(prefix = "polyv") +public class PolyvConfig { + + private String userId; + + private String appId; + + private String appSecret; + + private String secretKey; +} diff --git b/src/main/java/com/subsidy/common/configure/QXueYouConfig.java a/src/main/java/com/subsidy/common/configure/QXueYouConfig.java new file mode 100644 index 0000000..0bf6873 --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/QXueYouConfig.java @@ -0,0 +1,18 @@ +package com.subsidy.common.configure; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Data +@Configuration +@ConfigurationProperties(prefix = "qxueyou") +public class QXueYouConfig { + + private String appId; + + private String securityKey; + + private String url; + +} diff --git b/src/main/java/com/subsidy/common/configure/QuartzConfig.java a/src/main/java/com/subsidy/common/configure/QuartzConfig.java new file mode 100644 index 0000000..b9c9a33 --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/QuartzConfig.java @@ -0,0 +1,46 @@ +package com.subsidy.common.configure; + +import org.quartz.Scheduler; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.ClassPathResource; +import org.springframework.scheduling.quartz.SchedulerFactoryBean; + +import javax.sql.DataSource; + +/** + *+ * Quartz配置 + *
+ * + * @author DengMin + * @since 2020/12/8 + */ +@Configuration +public class QuartzConfig { + + @Autowired + private JobFactory jobFactory; + + @Autowired + private DataSource dataSource; + + @Bean + public SchedulerFactoryBean schedulerFactoryBean() { + SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean(); + schedulerFactoryBean.setOverwriteExistingJobs(true); + schedulerFactoryBean.setStartupDelay(60); + schedulerFactoryBean.setJobFactory(jobFactory); + schedulerFactoryBean.setOverwriteExistingJobs(true); + schedulerFactoryBean.setStartupDelay(1); + schedulerFactoryBean.setDataSource(dataSource); + schedulerFactoryBean.setConfigLocation(new ClassPathResource("/application-quartz.properties")); + return schedulerFactoryBean; + } + + @Bean + public Scheduler scheduler() { + return schedulerFactoryBean().getScheduler(); + } +} diff --git b/src/main/java/com/subsidy/common/configure/RedisConfig.java a/src/main/java/com/subsidy/common/configure/RedisConfig.java new file mode 100644 index 0000000..63cf2de --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/RedisConfig.java @@ -0,0 +1,122 @@ +package com.subsidy.common.configure; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.ListOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.SetOperations; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.data.redis.core.ZSetOperations; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +@EnableCaching + +/** + *+ * Redis + *
+ * + * @author DengMin + * @since 2020/12/14 + */ +@Configuration +public class RedisConfig extends CachingConfigurerSupport { + + /** + * retemplate相关配置 + * @param factory + * @return + */ + @Bean + public RedisTemplate+ * 读取状态码 + *
+ * + * @author DengMin + * @date Created in 2020/08/24 + */ +@Component +@ConfigurationProperties(prefix = "meishu") +@PropertySource(value = "classpath:code.properties", encoding = "UTF-8") +public class RemoteProperties { + + private static Map+ * 鉴权拦截器 + *
+ * + * @author DengMin + * @since 2021/4/14 + */ +@Component +public class AuthenticationInterceptor implements HandlerInterceptor { + + @Autowired + private AdministerMapper administerMapper; + + @Override + @CrossOrigin() + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { + // 不需要进行拦截 + if (!(handler instanceof HandlerMethod)) { + return true; + } + + HandlerMethod handlerMethod = (HandlerMethod) handler; + Method method = handlerMethod.getMethod(); + + TimeRequired timeRequired = method.getAnnotation(TimeRequired.class); + if (timeRequired != null) { + Calendar calendar = Calendar.getInstance(); + + int hour = calendar.get(Calendar.HOUR_OF_DAY); + if (hour < 6 || hour >= 23 ) { + throw new HttpException(17001); + } + } + + LoginRequired methodAnnotation = method.getAnnotation(LoginRequired.class); + if (methodAnnotation != null) { + String authorization = request.getHeader("Authorization"); + if (!StringUtils.isBlank(authorization)) { + String token = authorization; + if (authorization.startsWith("Bearer")) { + token = authorization.replace("Bearer ", ""); + } + /*Token不存在*/ + if (token == null || !JwtUtil.verifyToken(token)) { + throw new HttpException(1010); + } + + Map+ * 自定义验证登陆注解 + *
+ * + * @author DengMin + * @since 2020/12/18 + */ +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface LoginRequired { + + //String[] value(); +} \ No newline at end of file diff --git b/src/main/java/com/subsidy/common/interceptor/TimeRequired.java a/src/main/java/com/subsidy/common/interceptor/TimeRequired.java new file mode 100644 index 0000000..d720289 --- /dev/null +++ a/src/main/java/com/subsidy/common/interceptor/TimeRequired.java @@ -0,0 +1,10 @@ +package com.subsidy.common.interceptor; + +import java.lang.annotation.*; + +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +public @interface TimeRequired { +} diff --git b/src/main/java/com/subsidy/controller/AdministerController.java a/src/main/java/com/subsidy/controller/AdministerController.java new file mode 100644 index 0000000..f202862 --- /dev/null +++ a/src/main/java/com/subsidy/controller/AdministerController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *+ * 管理平台用户 前端控制器 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@RestController +@Api(tags = "管理平台用户") +@RequestMapping("/administer-do") +public class AdministerController { + +} diff --git b/src/main/java/com/subsidy/controller/AdministerProjectMappingController.java a/src/main/java/com/subsidy/controller/AdministerProjectMappingController.java new file mode 100644 index 0000000..4187ee8 --- /dev/null +++ a/src/main/java/com/subsidy/controller/AdministerProjectMappingController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *+ * 管理员-项目映射表 前端控制器 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@RestController +@Api(tags = "管理员-项目映射表") +@RequestMapping("/administer-project-mapping-do") +public class AdministerProjectMappingController { + +} diff --git b/src/main/java/com/subsidy/controller/LaborServiceDictController.java a/src/main/java/com/subsidy/controller/LaborServiceDictController.java new file mode 100644 index 0000000..6e36697 --- /dev/null +++ a/src/main/java/com/subsidy/controller/LaborServiceDictController.java @@ -0,0 +1,103 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.dto.labor.AbnormalRecordDTO; +import com.subsidy.dto.labor.AddProjectDTO; +import com.subsidy.dto.labor.ProjectManageDTO; +import com.subsidy.dto.labor.ProjectsDTO; +import com.subsidy.model.AdministerDO; +import com.subsidy.model.ProjectDO; +import com.subsidy.model.ProjectMemberMappingDO; +import com.subsidy.service.LaborServiceDictService; +import com.subsidy.vo.labor.ProjectManageVO; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *+ * 劳务公司字典表 前端控制器 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@RestController +@Api(tags = "劳务公司字典表") +@RequestMapping("/laborServiceDict") +public class LaborServiceDictController { + + @Autowired + private LaborServiceDictService laborServiceDictService; + + @PostMapping("login") + @ApiOperation("登录 accountName password ") + public ResponseVO login(@RequestBody AdministerDO administerDO){ + return ResponseData.generateCreatedResponse(0,laborServiceDictService.login(administerDO)); + } + + @PostMapping("projects") + @ApiOperation("项目列表 userId 当前用户id projectName pageSize pageNum") + public ResponseVO projects(@RequestBody ProjectsDTO projectsDTO){ + return ResponseData.generateCreatedResponse(0,laborServiceDictService.projects(projectsDTO)); + } + + @PostMapping("addProject") + @ApiOperation("添加项目 userId projectName companyId laborServiceId salaryDate startDate endDate") + public ResponseVO addProject(@RequestBody AddProjectDTO addProjectDTO){ + laborServiceDictService.addProject(addProjectDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("updateProject") + @ApiOperation("修改项目 id userId projectName companyId laborServiceId salaryDate startDate endDate") + public ResponseVO updateProject(@RequestBody AddProjectDTO addProjectDTO){ + laborServiceDictService.updateProject(addProjectDTO); + return ResponseData.generateCreatedResponse(0); + } + + + @PostMapping("deleteProject") + @ApiOperation("删除项目 id userId") + public ResponseVO deleteProject(@RequestBody AddProjectDTO addProjectDTO){ + laborServiceDictService.deleteProject(addProjectDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("projectManage") + @ApiOperation("详情--项目管理 projectId 项目id userInfo 姓名或手机号") + public ResponseVO projectManage(@RequestBody ProjectManageDTO projectManageDTO){ + return ResponseData.generateCreatedResponse(0,laborServiceDictService.projectManage(projectManageDTO)); + } + + @PostMapping("updateJobName") + @ApiOperation("id : projectManage接口返回的mappingId jobName 修改职位") + public ResponseVO updateJobName(@RequestBody ProjectMemberMappingDO projectMemberMappingDO){ + laborServiceDictService.updateJobName(projectMemberMappingDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("fireMember") + @ApiOperation("操作离职 id : projectManage接口返回的mappingId ") + public ResponseVO fireMember(@RequestBody ProjectMemberMappingDO projectMemberMappingDO){ + laborServiceDictService.fireMember(projectMemberMappingDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("abnormalRecord") + @ApiOperation("异动记录 projectId 项目id pageSize pageNum userInfo 姓名或者手机号") + public ResponseVO abnormalRecord(@RequestBody AbnormalRecordDTO abnormalRecordDTO ){ + return ResponseData.generateCreatedResponse(0,laborServiceDictService.abnormalRecord(abnormalRecordDTO)); + } + + +} diff --git b/src/main/java/com/subsidy/controller/MemberController.java a/src/main/java/com/subsidy/controller/MemberController.java new file mode 100644 index 0000000..e2b5943 --- /dev/null +++ a/src/main/java/com/subsidy/controller/MemberController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *+ * 前端控制器 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@RestController +@Api(tags = "") +@RequestMapping("/member-do") +public class MemberController { + +} diff --git b/src/main/java/com/subsidy/controller/OssController.java a/src/main/java/com/subsidy/controller/OssController.java new file mode 100644 index 0000000..ff95eae --- /dev/null +++ a/src/main/java/com/subsidy/controller/OssController.java @@ -0,0 +1,201 @@ +package com.subsidy.controller; + +import com.aliyun.oss.ClientException; +import com.aliyun.oss.OSS; +import com.aliyun.oss.OSSClientBuilder; +import com.aliyun.oss.OSSException; +import com.aliyun.oss.model.*; +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.vo.oss.GetSecretVO; +import com.subsidy.vo.oss.UploadFileVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +@Api(tags = "oss") +@RestController +@RequestMapping("/oss") +public class OssController { + + public static final String keyId = "LTAI5tPAH7P7WQVeowo517BE"; + + + public static final String secret = "0ueqhIfdAZyw5lWlBVSLpAxTtx37RY"; + + + @Value("${spring.profiles.active}") + private String env; + + @PostMapping("getSecret") + @ApiOperation("oss秘钥") + public ResponseVO getSecret() { + GetSecretVO getSecretVO = new GetSecretVO(); + getSecretVO.setKey(keyId); + getSecretVO.setSecret(secret); + return ResponseData.generateCreatedResponse(0, getSecretVO); + } + + @PostMapping("uploadFile") + @ApiOperation("分片上传") + public ResponseVO fenpian(@RequestParam("file") MultipartFile file) { + + UploadFileVO uploadFileVO = new UploadFileVO(); + + // Endpoint以华东1(杭州)为例,其它Region请按实际情况填写。 + String endpoint = "http://oss-cn-beijing.aliyuncs.com"; + // 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。 + String accessKeyId = keyId; + String accessKeySecret = secret; + // 填写Bucket名称,例如examplebucket。 +// String bucketName = "zhongzhi-cms"; + // 填写Object完整路径,例如exampledir/exampleobject.txt。Object完整路径中不能包含Bucket名称。 + String objectName = System.currentTimeMillis() + "_" + file.getOriginalFilename(); + + // 创建OSSClient实例。 + OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret); + + if (env.equals("dev")) { + env = "ykhl-bigger-test"; + } + if (env.equals("prod")) { + env = "ykhl-bigger"; + } + + + try { + // 创建InitiateMultipartUploadRequest对象。 + InitiateMultipartUploadRequest request = new InitiateMultipartUploadRequest(env, objectName); + + // 如果需要在初始化分片时设置请求头,请参考以下示例代码。 + ObjectMetadata metadata = new ObjectMetadata(); + metadata.setContentType(file.getContentType()); + metadata.setContentDisposition("inline"); + // 如果需要在初始化分片时设置请求头,请参考以下示例代码。 + // ObjectMetadata metadata = new ObjectMetadata(); + // metadata.setHeader(OSSHeaders.OSS_STORAGE_CLASS, StorageClass.Standard.toString()); + // 指定该Object的网页缓存行为。 + // metadata.setCacheControl("no-cache"); + // 指定该Object被下载时的名称。 + // metadata.setContentDisposition("attachment;filename=oss_MultipartUpload.txt"); + // 指定该Object的内容编码格式。 + // metadata.setContentEncoding(OSSConstants.DEFAULT_CHARSET_NAME); + // 指定初始化分片上传时是否覆盖同名Object。此处设置为true,表示禁止覆盖同名Object。 + // metadata.setHeader("x-oss-forbid-overwrite", "true"); + // 指定上传该Object的每个part时使用的服务器端加密方式。 + // metadata.setHeader(OSSHeaders.OSS_SERVER_SIDE_ENCRYPTION, ObjectMetadata.KMS_SERVER_SIDE_ENCRYPTION); + // 指定Object的加密算法。如果未指定此选项,表明Object使用AES256加密算法。 + // metadata.setHeader(OSSHeaders.OSS_SERVER_SIDE_DATA_ENCRYPTION, ObjectMetadata.KMS_SERVER_SIDE_ENCRYPTION); + // 指定KMS托管的用户主密钥。 + // metadata.setHeader(OSSHeaders.OSS_SERVER_SIDE_ENCRYPTION_KEY_ID, "9468da86-3509-4f8d-a61e-6eab1eac****"); + // 指定Object的存储类型。 + // metadata.setHeader(OSSHeaders.OSS_STORAGE_CLASS, StorageClass.Standard); + // 指定Object的对象标签,可同时设置多个标签。 + // metadata.setHeader(OSSHeaders.OSS_TAGGING, "a:1"); + // request.setObjectMetadata(metadata); + + metadata.setHeader("x-oss-force-download", false); + request.setObjectMetadata(metadata); + + // 初始化分片。 + InitiateMultipartUploadResult upresult = ossClient.initiateMultipartUpload(request); + // 返回uploadId,它是分片上传事件的唯一标识。您可以根据该uploadId发起相关的操作,例如取消分片上传、查询分片上传等。 + String uploadId = upresult.getUploadId(); + + // partETags是PartETag的集合。PartETag由分片的ETag和分片号组成。 + List+ * 项目表 前端控制器 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@RestController +@Api(tags = "项目表") +@RequestMapping("/project") +public class ProjectController { + +} diff --git b/src/main/java/com/subsidy/controller/ProjectMemberMappingController.java a/src/main/java/com/subsidy/controller/ProjectMemberMappingController.java new file mode 100644 index 0000000..12f8a56 --- /dev/null +++ a/src/main/java/com/subsidy/controller/ProjectMemberMappingController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *+ * 项目人员映射表 前端控制器 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@RestController +@Api(tags = "项目人员映射表") +@RequestMapping("/project-member-mapping-do") +public class ProjectMemberMappingController { + +} diff --git b/src/main/java/com/subsidy/dto/administer/VerifyCodeDTO.java a/src/main/java/com/subsidy/dto/administer/VerifyCodeDTO.java new file mode 100644 index 0000000..2d3dd68 --- /dev/null +++ a/src/main/java/com/subsidy/dto/administer/VerifyCodeDTO.java @@ -0,0 +1,11 @@ +package com.subsidy.dto.administer; + +import lombok.Data; + +@Data +public class VerifyCodeDTO { + + private String telephone; + + private String verifyCode; +} diff --git b/src/main/java/com/subsidy/dto/labor/AbnormalRecordDTO.java a/src/main/java/com/subsidy/dto/labor/AbnormalRecordDTO.java new file mode 100644 index 0000000..b77c454 --- /dev/null +++ a/src/main/java/com/subsidy/dto/labor/AbnormalRecordDTO.java @@ -0,0 +1,16 @@ +package com.subsidy.dto.labor; + +import lombok.Data; + +@Data +public class AbnormalRecordDTO { + + private Long projectId; + + private String userInfo; + + private Integer pageSize; + + private Integer pageNum; + +} diff --git b/src/main/java/com/subsidy/dto/labor/AddProjectDTO.java a/src/main/java/com/subsidy/dto/labor/AddProjectDTO.java new file mode 100644 index 0000000..ec64bd8 --- /dev/null +++ a/src/main/java/com/subsidy/dto/labor/AddProjectDTO.java @@ -0,0 +1,11 @@ +package com.subsidy.dto.labor; + +import com.subsidy.model.ProjectDO; +import lombok.Data; + +@Data +public class AddProjectDTO extends ProjectDO { + + private Long userId; + +} diff --git b/src/main/java/com/subsidy/dto/labor/ProjectManageDTO.java a/src/main/java/com/subsidy/dto/labor/ProjectManageDTO.java new file mode 100644 index 0000000..64d4c39 --- /dev/null +++ a/src/main/java/com/subsidy/dto/labor/ProjectManageDTO.java @@ -0,0 +1,15 @@ +package com.subsidy.dto.labor; + +import lombok.Data; + +@Data +public class ProjectManageDTO { + + private Long projectId; + + private String userInfo; + + private Integer pageSize; + + private Integer pageNum; +} diff --git b/src/main/java/com/subsidy/dto/labor/ProjectsDTO.java a/src/main/java/com/subsidy/dto/labor/ProjectsDTO.java new file mode 100644 index 0000000..95fac43 --- /dev/null +++ a/src/main/java/com/subsidy/dto/labor/ProjectsDTO.java @@ -0,0 +1,15 @@ +package com.subsidy.dto.labor; + +import lombok.Data; + +@Data +public class ProjectsDTO { + + private Long userId; + + private Integer pageSize; + + private Integer pageNum; + + private String projectName; +} diff --git b/src/main/java/com/subsidy/mapper/AdministerMapper.java a/src/main/java/com/subsidy/mapper/AdministerMapper.java new file mode 100644 index 0000000..f84ef88 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/AdministerMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.AdministerDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *+ * 管理平台用户 Mapper 接口 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ + @Repository +public interface AdministerMapper extends BaseMapper+ * 管理员-项目映射表 Mapper 接口 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ + @Repository +public interface AdministerProjectMappingMapper extends BaseMapper+ * 劳务公司字典表 Mapper 接口 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Repository +public interface LaborServiceDictMapper extends BaseMapper+ * Mapper 接口 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ + @Repository +public interface MemberMapper extends BaseMapper+ * 项目表 Mapper 接口 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ + @Repository +public interface ProjectMapper extends BaseMapper+ * 项目人员映射表 Mapper 接口 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Repository +public interface ProjectMemberMappingMapper extends BaseMapper+ * 工资单历史表 Mapper 接口 + *
+ * + * @author Tuyp + * @since 2024-07-11 + */ +@Repository +public interface ProjectSalaryHistoryMapper extends BaseMapper+ * 短信验证码记录表 Mapper 接口 + *
+ * + * @author DengMin + * @since 2021-10-14 + */ + @Repository +public interface SmsVerifyCodeMapper extends BaseMapper+ * 管理平台用户 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("administer") +public class AdministerDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 手机号 + */ + private String telephone; + + /** + * 账号 + */ + private String accountName; + + /** + * 密码 + */ + private String password; + + /** + * 公司id + */ + private Long companyId; + + /** + * 成员名称 + */ + private String userName; + + /** + * 头像 + */ + private String img; + + /** + * 1:启用 0:禁用 + */ + private String status; + + /** + * 角色 0:应用 1:企业关联客户 2:中心 3:企业唯一账号,4:院校唯一账号 5:院校关联账号 6:伙伴唯一账号 7:伙伴关联账号 + */ + private Integer role; + + /** + * 备注 + */ + private String remark; + + +} diff --git b/src/main/java/com/subsidy/model/AdministerProjectMappingDO.java a/src/main/java/com/subsidy/model/AdministerProjectMappingDO.java new file mode 100644 index 0000000..f0d71df --- /dev/null +++ a/src/main/java/com/subsidy/model/AdministerProjectMappingDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *+ * 管理员-项目映射表 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("administer_project_mapping") +public class AdministerProjectMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long administerId; + + private Long projectId; + + +} diff --git b/src/main/java/com/subsidy/model/LaborServiceDictDO.java a/src/main/java/com/subsidy/model/LaborServiceDictDO.java new file mode 100644 index 0000000..0381bd8 --- /dev/null +++ a/src/main/java/com/subsidy/model/LaborServiceDictDO.java @@ -0,0 +1,31 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *+ * 劳务公司字典表 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("labor_service_dict") +public class LaborServiceDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private String laborServiceName; + + +} diff --git b/src/main/java/com/subsidy/model/MemberDO.java a/src/main/java/com/subsidy/model/MemberDO.java new file mode 100644 index 0000000..1df8af3 --- /dev/null +++ a/src/main/java/com/subsidy/model/MemberDO.java @@ -0,0 +1,170 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *+ * + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("member") +public class MemberDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 院校id + */ + private Long academyId; + + /** + * 公司名 弃用 + */ + private Long companyId; + + /** + * 姓名 + */ + private String userName; + + /** + * 账号 + */ + private String accountName; + + /** + * 英文名 + */ + private String accountNameEn; + + /** + * 邮箱 + */ + private String email; + + /** + * 工号 + */ + private String workNo; + + /** + * 入职时间 + */ + private String inductionDate; + + /** + * 手机号 + */ + private String telephone; + + /** + * 密码 + */ + private String password; + + /** + * 性别 + */ + private String gender; + + /** + * 头像 + */ + private String image; + + /** + * 人脸核验--照片 + */ + private String checkImage; + + /** + * 采集时间 + */ + private LocalDateTime checkTime; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 身份证照片 + */ + private String idCardPhoto; + + /** + * 启用/冻结 + */ + private String status; + + /** + * 是否登陆过 1 是 0 不是 + */ + private Integer firstLogin; + + /** + * QQ号 + */ + private String qqNo; + + /** + * 微信账号 + */ + private String wechat; + + /** + * 实习状态 + */ + private String practiceStatus; + + /** + * 学院id + */ + private Long collegeId; + + /** + * 专业id + */ + private String major; + + /** + * 入学年份 + */ + private String enrollmentYear; + + /** + * 工资账户 + */ + private String payrollAccount; + + /** + * 开户行 + */ + private String bank; + + /** + * 0:学生 2:职工 3:人才 + */ + private Integer memberType; + + + /** + * 微信的openId + */ + private String openId; + +} diff --git b/src/main/java/com/subsidy/model/ProjectDO.java a/src/main/java/com/subsidy/model/ProjectDO.java new file mode 100644 index 0000000..5eb83f9 --- /dev/null +++ a/src/main/java/com/subsidy/model/ProjectDO.java @@ -0,0 +1,59 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *+ * 项目表 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("project") +public class ProjectDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 项目名称 + */ + private String projectName; + + /** + * 关联企业 + */ + private Long companyId; + + /** + * 伙伴id + */ + private Long laborServiceId; + + /** + * 薪资发放日 + */ + private String salaryDate; + + /** + * 开始时间 + */ + private String startDate; + + /** + * 结束时间 + */ + private String endDate; + + +} diff --git b/src/main/java/com/subsidy/model/ProjectMemberMappingDO.java a/src/main/java/com/subsidy/model/ProjectMemberMappingDO.java new file mode 100644 index 0000000..5d23f54 --- /dev/null +++ a/src/main/java/com/subsidy/model/ProjectMemberMappingDO.java @@ -0,0 +1,54 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *+ * 项目人员映射表 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("project_member_mapping") +public class ProjectMemberMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 人员id + */ + private Long memberId; + + /** + * 项目id + */ + private Long projectId; + + /** + * 职位名称 + */ + private String jobName; + + /** + * 排序 + */ + private Integer orderNo; + + /** + * 1:在职 0 已离职 + */ + private Integer status; + + +} diff --git b/src/main/java/com/subsidy/model/ProjectSalaryHistoryDO.java a/src/main/java/com/subsidy/model/ProjectSalaryHistoryDO.java new file mode 100644 index 0000000..b41d198 --- /dev/null +++ a/src/main/java/com/subsidy/model/ProjectSalaryHistoryDO.java @@ -0,0 +1,59 @@ +package com.subsidy.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.subsidy.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *+ * 工资单历史表 + *
+ * + * @author Tuyp + * @since 2024-07-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("project_salary_history") +public class ProjectSalaryHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 人员id + */ + private Long memberId; + + /** + * 项目id + */ + private Long projectId; + + /** + * 工资 + */ + private String salary; + + /** + * 备注 + */ + private String salaryMark; + + /** + * 开户行 + */ + private String bank; + + /** + * 账户 + */ + private String payrollAccount; + + +} diff --git b/src/main/java/com/subsidy/model/SmsVerifyCodeDO.java a/src/main/java/com/subsidy/model/SmsVerifyCodeDO.java new file mode 100644 index 0000000..902ae10 --- /dev/null +++ a/src/main/java/com/subsidy/model/SmsVerifyCodeDO.java @@ -0,0 +1,39 @@ +package com.subsidy.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.subsidy.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *+ * 短信验证码记录表 + *
+ * + * @author DengMin + * @since 2021-10-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sms_verify_code") +public class SmsVerifyCodeDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 手机号 + */ + private String telephone; + + /** + * 验证码 + */ + private String verifyCode; + + +} diff --git b/src/main/java/com/subsidy/service/AdministerProjectMappingService.java a/src/main/java/com/subsidy/service/AdministerProjectMappingService.java new file mode 100644 index 0000000..def4fd7 --- /dev/null +++ a/src/main/java/com/subsidy/service/AdministerProjectMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.AdministerProjectMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *+ * 管理员-项目映射表 服务类 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +public interface AdministerProjectMappingService extends IService+ * 管理平台用户 服务类 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +public interface AdministerService extends IService+ * 劳务公司字典表 服务类 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +public interface LaborServiceDictService extends IService+ * 服务类 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +public interface MemberService extends IService+ * 项目人员映射表 服务类 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +public interface ProjectMemberMappingService extends IService+ * 项目表 服务类 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +public interface ProjectService extends IService+ * 管理员-项目映射表 服务实现类 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Service +public class AdministerProjectMappingServiceImpl extends ServiceImpl+ * 管理平台用户 服务实现类 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Service +public class AdministerServiceImpl extends ServiceImpl+ * 劳务公司字典表 服务实现类 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Service +public class LaborServiceDictServiceImpl extends ServiceImpl+ * 服务实现类 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Service +public class MemberServiceImpl extends ServiceImpl+ * 项目人员映射表 服务实现类 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Service +public class ProjectMemberMappingServiceImpl extends ServiceImpl+ * 项目表 服务实现类 + *
+ * + * @author Tuyp + * @since 2024-07-18 + */ +@Service +public class ProjectServiceImpl extends ServiceImpl+ * Ehcache + *
+ * + * @author DengMin + * @since 2022/8/1 + */ +public class EhCacheUtil { + + static CacheManager cacheManager = CacheManager.newInstance(ClassUtils.getDefaultClassLoader().getResource("").getPath()+"ehcache.xml"); + + /** + * 添加缓存 + * @param cacheName + * @param key + * @param value + */ + public static void putEhCache(String cacheName, String key, Object value) { + Cache cache = cacheManager.getCache(cacheName); + Element element = new Element(key, value); + cache.put(element); + } + + /** + * 获取缓存数据 + * @param cacheName + * @param key + * @return + */ + public static Object getEhCache(String cacheName, String key) { + Cache cache = cacheManager.getCache(cacheName); + Element element = cache.get(key); + return element == null ? null : element.getObjectValue(); + } + + /** + * 删除缓存 + * @param cacheName + * @param key + */ + public static void deleteEhCache(String cacheName, String key) { + Cache cache = cacheManager.getCache(cacheName); + cache.remove(key); + } +} diff --git b/src/main/java/com/subsidy/util/EncryptUtil.java a/src/main/java/com/subsidy/util/EncryptUtil.java new file mode 100644 index 0000000..9db0ff2 --- /dev/null +++ a/src/main/java/com/subsidy/util/EncryptUtil.java @@ -0,0 +1,35 @@ +//package com.subsidy.util; +// +//import com.amdelamar.jhash.Hash; +//import com.amdelamar.jhash.algorithms.Type; +//import com.amdelamar.jhash.exception.InvalidHashException; +// +//public class EncryptUtil { +// +// /** +// * 设置密文密码 +// * +// * @param password 原始密码 +// * @return 加密密码 +// */ +// public static String encrypt(String password) { +// char[] chars = password.toCharArray(); +// return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).create(); +// } +// +// /** +// * 验证加密密码 +// * +// * @param encryptedPassword 密文密码 +// * @param plainPassword 明文密码 +// * @return 验证是否成功 +// */ +// public static boolean verify(String encryptedPassword, String plainPassword) { +// char[] chars = plainPassword.toCharArray(); +// try { +// return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).verify(encryptedPassword); +// } catch (InvalidHashException e) { +// return false; +// } +// } +//} diff --git b/src/main/java/com/subsidy/util/ExcelFormatUtils.java a/src/main/java/com/subsidy/util/ExcelFormatUtils.java new file mode 100644 index 0000000..c0330e2 --- /dev/null +++ a/src/main/java/com/subsidy/util/ExcelFormatUtils.java @@ -0,0 +1,19 @@ +package com.subsidy.util; + +import java.util.Arrays; +import java.util.List; + +public class ExcelFormatUtils { + + + public static final List+ * Token工具 + *
+ * + * @author DengMin + * @since 2021/4/14 + */ +public class JwtUtil { + + private static Long EXPIRE_TIME = 24 * 60 * 60 * 1000L; + + private static String SECRET = "PBKDF2SHA256:64000:18:24:N:GFHZ6Y0PTEUDYCJI3K6SOOXWYEKPOZED:WBWFJMX5DF252E0HR3BF3P/D"; + + /** + * 生成Token + * @param id + * @return + */ + public static String generateToken(Long id, String type) { + Date expireDate = new Date(System.currentTimeMillis() + EXPIRE_TIME); + return JWT.create() + .withClaim("id", id) + .withClaim("type", type) + .withAudience() + .withExpiresAt(expireDate) + .withIssuedAt(new Date()) + .sign(Algorithm.HMAC256(SECRET)); + } + + /** + * 检验token是否正确 + * @param token + * @return + */ + public static boolean verifyToken(String token) { + try { + Algorithm algorithm = Algorithm.HMAC256(SECRET); + JWTVerifier verifier = JWT.require(algorithm).build(); + verifier.verify(token); + return true; + } catch (Exception e) { + return false; + } + } + + /** + * 获取用户自定义Claim集合 + * @param token + * @return + */ + public static Map