Commit af56b30d by 涂亚平

第一次上线

1 parent 2272b530
Showing with 435 additions and 61 deletions
2024-08-20 14:48:32,117 [schedulerFactoryBean_QuartzSchedulerThread] ERROR org.springframework.scheduling.quartz.LocalDataSourceJobStore:2867 - Error retrieving job, setting trigger state to ERROR.
org.quartz.JobPersistenceException: Couldn't retrieve job because a required class was not found: com.subsidy.job.ProjectSalaryNotificationJob
at org.quartz.impl.jdbcjobstore.JobStoreSupport.retrieveJob(JobStoreSupport.java:1393)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2864)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$41.execute(JobStoreSupport.java:2805)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$41.execute(JobStoreSupport.java:2803)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3864)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2802)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:287)
Caused by: java.lang.ClassNotFoundException: com.subsidy.job.ProjectSalaryNotificationJob
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:275)
at org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper.loadClass(ResourceLoaderClassLoadHelper.java:81)
at org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper.loadClass(ResourceLoaderClassLoadHelper.java:86)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectJobDetail(StdJDBCDelegate.java:852)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.retrieveJob(JobStoreSupport.java:1390)
... 6 common frames omitted
2024-08-20 14:50:40,086 [schedulerFactoryBean_QuartzSchedulerThread] ERROR org.springframework.scheduling.quartz.LocalDataSourceJobStore:2867 - Error retrieving job, setting trigger state to ERROR.
org.quartz.JobPersistenceException: Couldn't retrieve job because a required class was not found: com.subsidy.job.ProjectSalaryNotificationJob
at org.quartz.impl.jdbcjobstore.JobStoreSupport.retrieveJob(JobStoreSupport.java:1393)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2864)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$41.execute(JobStoreSupport.java:2805)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$41.execute(JobStoreSupport.java:2803)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3864)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2802)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:287)
Caused by: java.lang.ClassNotFoundException: com.subsidy.job.ProjectSalaryNotificationJob
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:275)
at org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper.loadClass(ResourceLoaderClassLoadHelper.java:81)
at org.springframework.scheduling.quartz.ResourceLoaderClassLoadHelper.loadClass(ResourceLoaderClassLoadHelper.java:86)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectJobDetail(StdJDBCDelegate.java:852)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.retrieveJob(JobStoreSupport.java:1390)
... 6 common frames omitted
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>subsidy-interShip</finalName> <finalName>subsidy-talent</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -14,9 +14,9 @@ public class WechatConfig { ...@@ -14,9 +14,9 @@ public class WechatConfig {
private String appSecret; private String appSecret;
//private String msgUrl; private String msgUrl;
// //
//private String templateId; private String templateId;
// //
//private String agentId; //private String agentId;
......
...@@ -8,15 +8,15 @@ import io.swagger.annotations.Api; ...@@ -8,15 +8,15 @@ import io.swagger.annotations.Api;
/** /**
* <p> * <p>
* 管理员-项目映射表 前端控制器 * 前端控制器
* </p> * </p>
* *
* @author Tuyp * @author Tuyp
* @since 2024-07-18 * @since 2024-08-09
*/ */
@RestController @RestController
@Api(tags = "管理员-项目映射表") @Api(tags = "")
@RequestMapping("/administer-project-mapping-do") @RequestMapping("/access-token-do")
public class AdministerProjectMappingController { public class AccessTokenController {
} }
...@@ -39,8 +39,14 @@ public class ProjectController { ...@@ -39,8 +39,14 @@ public class ProjectController {
return ResponseData.generateCreatedResponse(0,projectService.sendSms(memberDO)); return ResponseData.generateCreatedResponse(0,projectService.sendSms(memberDO));
} }
@PostMapping("sendNewSms")
@ApiOperation("发送验证码 telephone ")
public ResponseVO sendNewSms(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,projectService.sendNewSms(memberDO));
}
@PostMapping("login") @PostMapping("login")
@ApiOperation("登录 telephone verifyCode") @ApiOperation("登录 telephone verifyCode openId")
public ResponseVO login(@RequestBody VerifyCodeDTO verifyCodeDTO){ public ResponseVO login(@RequestBody VerifyCodeDTO verifyCodeDTO){
return ResponseData.generateCreatedResponse(0,projectService.login(verifyCodeDTO)); return ResponseData.generateCreatedResponse(0,projectService.login(verifyCodeDTO));
} }
...@@ -82,16 +88,22 @@ public class ProjectController { ...@@ -82,16 +88,22 @@ public class ProjectController {
} }
@PostMapping("salaryListSum") @PostMapping("salaryListSum")
@ApiOperation("工资单--笔数+总计 memberId 人才id projectId 项目id ") @ApiOperation("工资单--笔数+总计 memberId 人才id projectMappingId 项目id ")
public ResponseVO salaryListSum(@RequestBody SalaryListSumDTO salaryListSumDTO){ public ResponseVO salaryListSum(@RequestBody SalaryListSumDTO salaryListSumDTO){
return ResponseData.generateCreatedResponse(0,projectService.salaryListSum(salaryListSumDTO)); return ResponseData.generateCreatedResponse(0,projectService.salaryListSum(salaryListSumDTO));
} }
@PostMapping("salaryList") @PostMapping("salaryList")
@ApiOperation("工资单明细 memberId 人才id projectId 项目id pageSize pageNum ") @ApiOperation("工资单明细 memberId 人才id projectMappingId 项目映射id pageSize pageNum ")
public ResponseVO salaryList(@RequestBody SalaryListSumDTO salaryListSumDTO){ public ResponseVO salaryList(@RequestBody SalaryListSumDTO salaryListSumDTO){
return ResponseData.generateCreatedResponse(0,projectService.salaryList(salaryListSumDTO)); return ResponseData.generateCreatedResponse(0,projectService.salaryList(salaryListSumDTO));
} }
@PostMapping("updateUserInfo")
@ApiOperation("变更身份证/银行卡信息 id userName payrollAccount idCard bank")
public ResponseVO updateUserInfo(@RequestBody MemberDO memberDO){
projectService.updateUserInfo(memberDO);
return ResponseData.generateCreatedResponse(0);
}
} }
...@@ -17,6 +17,6 @@ import io.swagger.annotations.Api; ...@@ -17,6 +17,6 @@ import io.swagger.annotations.Api;
@RestController @RestController
@Api(tags = "项目人员映射表") @Api(tags = "项目人员映射表")
@RequestMapping("/project-member-mapping-do") @RequestMapping("/project-member-mapping-do")
public class ProjectMemberMappingController { public class ProjectMemberMappingController {
} }
package com.subsidy.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.configure.RestTemplateConfig;
import com.subsidy.common.configure.WechatConfig;
import com.subsidy.dto.wechat.SignVO;
import com.subsidy.mapper.AccessTokenMapper;
import com.subsidy.mapper.MemberMapper;
import com.subsidy.model.AccessTokenDO;
import com.subsidy.model.MemberDO;
import com.subsidy.util.ConstantUtils;
import com.subsidy.util.JwtUtil;
import com.subsidy.util.Localstorage;
import com.subsidy.util.SecretUtils;
import com.subsidy.vo.administer.UserRoleVO;
import com.subsidy.vo.wechat.AccessToken;
import com.subsidy.vo.wechat.AuthenRequestVO;
import com.subsidy.vo.wechat.AuthenTokenVO;
import com.subsidy.vo.wechat.JsSdkVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
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 java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.List;
@RestController
@RequestMapping("/wechat")
@Api(tags = "微信授权")
public class WechatController {
@Autowired
private RestTemplateConfig restTemplateConfig;
@Autowired
private WechatConfig wechatConfig;
@Autowired
private AccessTokenMapper accessTokenMapper;
@Autowired
private MemberMapper memberMapper;
@PostMapping("/getJsapiTicket")
@ApiOperation("通过token请求获得jsapi_ticket {url}")
public ResponseVO getJsapiTicket(@RequestBody SignVO signVO) {
List<AccessTokenDO> accessTokens = accessTokenMapper.selectList(null);
String accessToken = "";
if (accessTokens.size() == 0) {
String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wechatConfig.getAppId() + "&secret=" + wechatConfig.getAppSecret();
ResponseEntity<AccessToken> response = restTemplateConfig.restTemplate()
.exchange(url, HttpMethod.GET, null, AccessToken.class);
accessToken = response.getBody().getAccess_token();
AccessTokenDO accessToken1 = new AccessTokenDO();
accessToken1.setAccessToken(accessToken);
accessTokenMapper.insert(accessToken1);
} else {
AccessTokenDO accessToken1 = accessTokens.get(0);
long diff = ChronoUnit.SECONDS.between(accessToken1.getCreateDate(), LocalDateTime.now());
if (diff >= 2 * 60 * 60 * 1000 - 5 * 1000) {
String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wechatConfig.getAppId() + "&secret=" + wechatConfig.getAppSecret();
ResponseEntity<AccessToken> response = restTemplateConfig.restTemplate()
.exchange(url, HttpMethod.GET, null, AccessToken.class);
accessToken = response.getBody().getAccess_token();
// AccessToken accessToken2= new AccessToken();
accessToken1.setAccessToken(accessToken);
accessTokenMapper.updateById(accessToken1);
} else {
accessToken = accessToken1.getAccessToken();
}
}
signVO.setAccess_token(accessToken);
String url1 = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + accessToken + "&type=jsapi";
ResponseEntity<JsSdkVO> response1 = restTemplateConfig.restTemplate()
.exchange(url1, HttpMethod.GET, null, JsSdkVO.class);
String ticket = response1.getBody().getTicket();
signVO.setJsapi_ticket(ticket);
signVO.setNoncestr("1rtgtafNdHhxADMD");
signVO.setTimestamp(String.valueOf(System.currentTimeMillis()));
String signStr = "jsapi_ticket=" + signVO.getJsapi_ticket() + "&noncestr=" + signVO.getNoncestr() + "&timestamp=" + signVO.getTimestamp()
+ "&url=" + signVO.getUrl();
signVO.setSign(SecretUtils.getSHAString(signStr));
return ResponseData.generateCreatedResponse(0, signVO);
}
@PostMapping("/webAuthen")
@ApiOperation("网页授权 通过code换取身份信息 {code phone 手机号}")
public ResponseVO webAuthen(@RequestBody AuthenRequestVO authenRequestVO) {
String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + wechatConfig.getAppId() + "&secret=" +
wechatConfig.getAppSecret() + "&code=" + authenRequestVO.getCode() + "&grant_type=authorization_code";
ResponseEntity<AuthenTokenVO> response = restTemplateConfig.restTemplate()
.exchange(url, HttpMethod.GET, null, AuthenTokenVO.class);
AuthenTokenVO authenTokenVO = response.getBody();
//通过openId从库里查询
MemberDO memberDO = memberMapper.selectOne(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getOpenId, authenTokenVO.getOpenid()));
if (null == memberDO) {
UserRoleVO userRoleVO = new UserRoleVO();
String url1 = "https://api.weixin.qq.com/sns/userinfo?access_token=" + authenTokenVO.getAccess_token() + "&openid=" + authenTokenVO.getOpenid() + "&lang=zh_CN";
ResponseEntity<AuthenTokenVO> response1 = restTemplateConfig.restTemplate()
.exchange(url1, HttpMethod.GET, null, AuthenTokenVO.class);
userRoleVO.setOpenId(response1.getBody().getOpenid());
userRoleVO.setOpenIdFlag(false);
return ResponseData.generateCreatedResponse(0, userRoleVO);
} else {
//该openId已存在,查出该用户的角色信息
UserRoleVO userRoleVO = new UserRoleVO();
String token = JwtUtil.generateToken(memberDO.getId(), ConstantUtils.MOBILE_TERMINATE);
Localstorage.setUser(memberDO);
userRoleVO.setToken(token);
BeanUtils.copyProperties(memberDO, userRoleVO);
userRoleVO.setOpenIdFlag(true);
userRoleVO.setOpenId(authenRequestVO.getOpenId());
return ResponseData.generateCreatedResponse(0, userRoleVO);
}
}
public static void main(String[] args) throws Exception {
LocalDateTime now1 = LocalDateTime.now();
Thread.sleep(2560);
LocalDateTime now2 = LocalDateTime.now();
System.out.println(ChronoUnit.SECONDS.between(now1, now2));
}
}
...@@ -8,4 +8,6 @@ public class VerifyCodeDTO { ...@@ -8,4 +8,6 @@ public class VerifyCodeDTO {
private String telephone; private String telephone;
private String verifyCode; private String verifyCode;
private String openId;
} }
...@@ -7,7 +7,7 @@ public class SalaryListSumDTO { ...@@ -7,7 +7,7 @@ public class SalaryListSumDTO {
private Long memberId; private Long memberId;
private Long projectId; private Long projectMappingId;
private Integer pageSize; private Integer pageSize;
......
package com.subsidy.dto.wechat;
import lombok.Data;
@Data
public class SignVO {
private String access_token;
private String noncestr;
private String jsapi_ticket;
private String timestamp;
private String url;
private String sign;
private String code;
}
package com.subsidy.mapper; package com.subsidy.mapper;
import com.subsidy.model.AdministerProjectMappingDO; import com.subsidy.model.AccessTokenDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
/** /**
* <p> * <p>
* 管理员-项目映射表 Mapper 接口 * Mapper 接口
* </p> * </p>
* *
* @author Tuyp * @author Tuyp
* @since 2024-07-18 * @since 2024-08-09
*/ */
@Repository @Repository
public interface AdministerProjectMappingMapper extends BaseMapper<AdministerProjectMappingDO> { public interface AccessTokenMapper extends BaseMapper<AccessTokenDO> {
} }
...@@ -18,7 +18,7 @@ import org.springframework.stereotype.Repository; ...@@ -18,7 +18,7 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface ProjectSalaryHistoryMapper extends BaseMapper<ProjectSalaryHistoryDO> { public interface ProjectSalaryHistoryMapper extends BaseMapper<ProjectSalaryHistoryDO> {
SalaryListSumVO salaryCount(Long project, Long memberId); SalaryListSumVO salaryCount(Long projectId, Long memberId);
IPage<SalaryListVO> salaryList(IPage page, Long projectId, Long memberId); IPage<SalaryListVO> salaryList(IPage page, Long projectId, Long memberId);
......
...@@ -9,25 +9,23 @@ import lombok.EqualsAndHashCode; ...@@ -9,25 +9,23 @@ import lombok.EqualsAndHashCode;
/** /**
* <p> * <p>
* 管理员-项目映射表 *
* </p> * </p>
* *
* @author Tuyp * @author Tuyp
* @since 2024-07-18 * @since 2024-08-09
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName("administer_project_mapping") @TableName("access_token")
public class AdministerProjectMappingDO extends BaseModel { public class AccessTokenDO extends BaseModel {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Integer id;
private Long administerId; private String accessToken;
private Long projectId;
} }
...@@ -41,6 +41,11 @@ public class ProjectMemberMappingDO extends BaseModel { ...@@ -41,6 +41,11 @@ public class ProjectMemberMappingDO extends BaseModel {
private String jobName; private String jobName;
/** /**
* 工资
*/
private String salary;
/**
* 排序 * 排序
*/ */
private Integer orderNo; private Integer orderNo;
......
...@@ -33,7 +33,7 @@ public class ProjectSalaryHistoryDO extends BaseModel { ...@@ -33,7 +33,7 @@ public class ProjectSalaryHistoryDO extends BaseModel {
/** /**
* 项目id * 项目id
*/ */
private Long projectId; private Long projectMappingId;
/** /**
* 工资 * 工资
...@@ -46,6 +46,16 @@ public class ProjectSalaryHistoryDO extends BaseModel { ...@@ -46,6 +46,16 @@ public class ProjectSalaryHistoryDO extends BaseModel {
private String salaryMark; private String salaryMark;
/** /**
* 发放时间
*/
private String salaryDate;
/**
* 几月工资
*/
private String salaryMonth;
/**
* 开户行 * 开户行
*/ */
private String bank; private String bank;
...@@ -55,5 +65,10 @@ public class ProjectSalaryHistoryDO extends BaseModel { ...@@ -55,5 +65,10 @@ public class ProjectSalaryHistoryDO extends BaseModel {
*/ */
private String payrollAccount; private String payrollAccount;
/**
* 提交状态 1已提交 - 0未提交
*/
private Integer commitStatus;
} }
package com.subsidy.service; package com.subsidy.service;
import com.subsidy.model.AdministerProjectMappingDO; import com.subsidy.model.AccessTokenDO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
/** /**
* <p> * <p>
* 管理员-项目映射表 服务类 * 服务类
* </p> * </p>
* *
* @author Tuyp * @author Tuyp
* @since 2024-07-18 * @since 2024-08-09
*/ */
public interface AdministerProjectMappingService extends IService<AdministerProjectMappingDO> { public interface AccessTokenService extends IService<AccessTokenDO> {
} }
...@@ -24,6 +24,8 @@ public interface ProjectService extends IService<ProjectDO> { ...@@ -24,6 +24,8 @@ public interface ProjectService extends IService<ProjectDO> {
String sendSms(MemberDO memberDO); String sendSms(MemberDO memberDO);
String sendNewSms(MemberDO memberDO);
UserRoleVO login(VerifyCodeDTO verifyCodeDTO); UserRoleVO login(VerifyCodeDTO verifyCodeDTO);
CurrentProjectVO currentProject(MemberDO memberDO); CurrentProjectVO currentProject(MemberDO memberDO);
...@@ -42,4 +44,6 @@ public interface ProjectService extends IService<ProjectDO> { ...@@ -42,4 +44,6 @@ public interface ProjectService extends IService<ProjectDO> {
IPage<SalaryListVO> salaryList(SalaryListSumDTO salaryListSumDTO); IPage<SalaryListVO> salaryList(SalaryListSumDTO salaryListSumDTO);
void updateUserInfo(MemberDO memberDO);
} }
package com.subsidy.service.impl; package com.subsidy.service.impl;
import com.subsidy.model.AdministerProjectMappingDO; import com.subsidy.model.AccessTokenDO;
import com.subsidy.mapper.AdministerProjectMappingMapper; import com.subsidy.mapper.AccessTokenMapper;
import com.subsidy.service.AdministerProjectMappingService; import com.subsidy.service.AccessTokenService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
* <p> * <p>
* 管理员-项目映射表 服务实现类 * 服务实现类
* </p> * </p>
* *
* @author Tuyp * @author Tuyp
* @since 2024-07-18 * @since 2024-08-09
*/ */
@Service @Service
public class AdministerProjectMappingServiceImpl extends ServiceImpl<AdministerProjectMappingMapper, AdministerProjectMappingDO> implements AdministerProjectMappingService { public class AccessTokenServiceImpl extends ServiceImpl<AccessTokenMapper, AccessTokenDO> implements AccessTokenService {
} }
...@@ -74,6 +74,32 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectDO> im ...@@ -74,6 +74,32 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectDO> im
return ConstantUtils.SUCCESS_SEND_OUT; return ConstantUtils.SUCCESS_SEND_OUT;
} }
public String sendNewSms(MemberDO memberDO) {
int count = memberMapper.selectCount(new QueryWrapper<MemberDO>()
.lambda()
.eq(MemberDO::getTelephone, memberDO.getTelephone())
.eq(MemberDO::getMemberType, 3));
if (count > 0) {
throw new HttpException(10027);
}
String code = RandomUtil.getRandomCode(6);
smsUtils.send(memberDO.getTelephone(), code);
smsVerifyCodeMapper.delete(new QueryWrapper<SmsVerifyCodeDO>()
.lambda()
.eq(SmsVerifyCodeDO::getTelephone, memberDO.getTelephone()));
SmsVerifyCodeDO smsCodeDO = new SmsVerifyCodeDO();
smsCodeDO.setVerifyCode(code);
smsCodeDO.setTelephone(memberDO.getTelephone());
smsVerifyCodeMapper.insert(smsCodeDO);
return ConstantUtils.SUCCESS_SEND_OUT;
}
public UserRoleVO login(VerifyCodeDTO verifyCodeDTO) { public UserRoleVO login(VerifyCodeDTO verifyCodeDTO) {
UserRoleVO userRoleVO = new UserRoleVO(); UserRoleVO userRoleVO = new UserRoleVO();
...@@ -100,6 +126,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectDO> im ...@@ -100,6 +126,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectDO> im
userRoleVO.setToken(token); userRoleVO.setToken(token);
BeanUtils.copyProperties(memberDO, userRoleVO); BeanUtils.copyProperties(memberDO, userRoleVO);
if (null != verifyCodeDTO.getOpenId()){
memberDO.setOpenId(verifyCodeDTO.getOpenId());
memberMapper.updateById(memberDO);
}
return userRoleVO; return userRoleVO;
} }
...@@ -111,6 +142,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectDO> im ...@@ -111,6 +142,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectDO> im
return projectMemberMappingMapper.historyProjects(memberDO.getId()); return projectMemberMappingMapper.historyProjects(memberDO.getId());
} }
public String verify(VerifyCodeDTO verifyCodeDTO) { public String verify(VerifyCodeDTO verifyCodeDTO) {
SmsVerifyCodeDO smsCodeDO = smsVerifyCodeMapper.selectOne(new QueryWrapper<SmsVerifyCodeDO>() SmsVerifyCodeDO smsCodeDO = smsVerifyCodeMapper.selectOne(new QueryWrapper<SmsVerifyCodeDO>()
...@@ -163,13 +196,20 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectDO> im ...@@ -163,13 +196,20 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectDO> im
} }
public SalaryListSumVO salaryListSum(SalaryListSumDTO salaryListSumDTO) { public SalaryListSumVO salaryListSum(SalaryListSumDTO salaryListSumDTO) {
return projectSalaryHistoryMapper.salaryCount(salaryListSumDTO.getProjectId(), salaryListSumDTO.getMemberId()); return projectSalaryHistoryMapper.salaryCount(salaryListSumDTO.getProjectMappingId(), salaryListSumDTO.getMemberId());
} }
public IPage<SalaryListVO> salaryList(SalaryListSumDTO salaryListSumDTO) { public IPage<SalaryListVO> salaryList(SalaryListSumDTO salaryListSumDTO) {
Page page = new Page(salaryListSumDTO.getPageNum(), salaryListSumDTO.getPageSize()); Page page = new Page(salaryListSumDTO.getPageNum(), salaryListSumDTO.getPageSize());
return projectSalaryHistoryMapper.salaryList(page, salaryListSumDTO.getProjectId(), salaryListSumDTO.getMemberId()); return projectSalaryHistoryMapper.salaryList(page, salaryListSumDTO.getProjectMappingId(), salaryListSumDTO.getMemberId());
} }
public void updateUserInfo(MemberDO memberDO) {
MemberDO memberDO1 = memberMapper.selectById(memberDO.getId());
BeanUtils.copyProperties(memberDO,memberDO1);
memberMapper.updateById(memberDO);
}
} }
...@@ -52,7 +52,7 @@ public class SMSUtils { ...@@ -52,7 +52,7 @@ public class SMSUtils {
//必填:短信签名-可在短信控制台中找到 //必填:短信签名-可在短信控制台中找到
request.setSignName("有课互联"); request.setSignName("有课互联");
//必填:短信模板-可在短信控制台中找到 //必填:短信模板-可在短信控制台中找到
request.setTemplateCode("SMS_190945394"); request.setTemplateCode("SMS_229640297");
//可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
request.setTemplateParam("{\"code\":\""+ code +"\"}"); request.setTemplateParam("{\"code\":\""+ code +"\"}");
......
...@@ -33,4 +33,10 @@ public class UserRoleVO { ...@@ -33,4 +33,10 @@ public class UserRoleVO {
private String superviseName; private String superviseName;
private Boolean checkStatus;
private String openId;
private Boolean openIdFlag;
} }
...@@ -13,7 +13,7 @@ public class SalaryListVO { ...@@ -13,7 +13,7 @@ public class SalaryListVO {
private String salaryMark; private String salaryMark;
private String createDate; private String salaryDate;
private String payrollAccount; private String payrollAccount;
......
package com.subsidy.vo.wechat;
import lombok.Data;
@Data
public class AccessToken {
private String access_token;
private String expires_in;
}
package com.subsidy.vo.wechat;
import lombok.Data;
@Data
public class AuthenRequestVO {
private String code;
// private String phone;
private String openId;
}
package com.subsidy.vo.wechat;
import lombok.Data;
@Data
public class AuthenTokenVO {
private String access_token;
private String openid;
private String nickname;
private String sex;
private String province;
private String city;
private String country;
private String headimgurl;
private Object privilege;
private String unionid;
}
package com.subsidy.vo.wechat;
import lombok.Data;
@Data
public class JsSdkVO {
private String errcode;
private String errmsg;
private String ticket;
private String expires_in;
}
# 本地环境配置 # 本地环境配置
spring.server.port=23507 spring.server.port=23501
# 数据源配置 # 数据源配置
#spring.datasource.url=jdbc:mysql://116.62.57.92:3306/subsidy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 #spring.datasource.url=jdbc:mysql://116.62.57.92:3306/subsidy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
......
# 生产环境配置 # 生产环境配置
spring.server.port=23507 spring.server.port=23501
# 数据源配置 # 数据源配置
spring.datasource.url=jdbc:mysql://rm-uf69w46mo6agw0ahao.mysql.rds.aliyuncs.com:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 spring.datasource.url=jdbc:mysql://rm-uf69w46mo6agw0ahao.mysql.rds.aliyuncs.com:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
......
# 环境配置 顶岗实习 # 环境配置 顶岗实习
spring.profiles.active=dev spring.profiles.active=prod
#和CPU数 #和CPU数
spring.server.acceptorThreadCount=600 spring.server.acceptorThreadCount=600
spring.server.minSpareThreads=100 spring.server.minSpareThreads=100
...@@ -68,11 +68,11 @@ spring.quartz.overwrite-existing-jobs=false ...@@ -68,11 +68,11 @@ spring.quartz.overwrite-existing-jobs=false
#spring.redis.host=r-uf6m4cpkjrgpzywjm3pd.redis.rds.aliyuncs.com #spring.redis.host=r-uf6m4cpkjrgpzywjm3pd.redis.rds.aliyuncs.com
#spring.redis.port=6379 #spring.redis.port=6379
#spring.redis.password=r-uf6m4cpkjrgpzywjm3:Ykhl@208 #spring.redis.password=r-uf6m4cpkjrgpzywjm3:Ykhl@208
wechat= #微信公众号
#pro wechat.appId=wx9e107b8f68c91a0c
appId=wx5e1ecb9c9bd33451 wechat.appSecret= d772631f098ef7b597293c22899671e0
appSecret=4f5e1abb6fb4f68f5273820b6295ec6b wechat.msgUrl= t.youkehulian.cn
wechat.templateId= _zNcTG7euWQbsvK8f0gMjTcNaXx3gBsDautnmuaLURA
#保利威视 #保利威视
polyv.userId=b8f2d3bfdc polyv.userId=b8f2d3bfdc
polyv.appId=g3lrxnzd75 polyv.appId=g3lrxnzd75
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.AdministerProjectMappingMapper"> <mapper namespace="com.subsidy.mapper.AccessTokenMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.AdministerProjectMappingDO"> <resultMap id="BaseResultMap" type="com.subsidy.model.AccessTokenDO">
<id column="id" property="id" /> <id column="id" property="id" />
<result column="create_date" property="createDate" /> <result column="create_date" property="createDate" />
<result column="update_date" property="updateDate" /> <result column="update_date" property="updateDate" />
<result column="delete_date" property="deleteDate" /> <result column="delete_date" property="deleteDate" />
<result column="administer_id" property="administerId" /> <result column="access_token" property="accessToken" />
<result column="project_id" property="projectId" />
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
...@@ -17,7 +16,7 @@ ...@@ -17,7 +16,7 @@
create_date, create_date,
update_date, update_date,
delete_date, delete_date,
id, administer_id, project_id id, access_token
</sql> </sql>
</mapper> </mapper>
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
AND t3.delete_date IS NULL AND t3.delete_date IS NULL
and t.member_id = #{memberId} and t.member_id = #{memberId}
and t.status = 1 and t.status = 1
order by t.create_date desc
limit 1
</select> </select>
<select id="historyProjects" parameterType="long" resultType="com.subsidy.vo.labor.HistoryProjectsVO"> <select id="historyProjects" parameterType="long" resultType="com.subsidy.vo.labor.HistoryProjectsVO">
...@@ -25,7 +27,7 @@ ...@@ -25,7 +27,7 @@
t.id, t.id,
t3.company_name, t3.company_name,
t.job_name, t.job_name,
t2.start_date, t.create_date start_date,
t2.salary_date, t2.salary_date,
t4.labor_service_name t4.labor_service_name
FROM FROM
...@@ -34,8 +36,8 @@ ...@@ -34,8 +36,8 @@
LEFT JOIN company_dict t3 ON t2.company_id = t3.id LEFT JOIN company_dict t3 ON t2.company_id = t3.id
LEFT JOIN labor_service_dict t4 ON t2.labor_service_id = t4.id LEFT JOIN labor_service_dict t4 ON t2.labor_service_id = t4.id
WHERE WHERE
t.delete_date IS NULL t.delete_date is null
AND t2.delete_date IS NULL and t2.delete_date IS NULL
AND t3.delete_date IS NULL AND t3.delete_date IS NULL
AND t4.delete_date IS NULL AND t4.delete_date IS NULL
AND t.member_id = #{memberId} AND t.member_id = #{memberId}
......
...@@ -5,13 +5,14 @@ ...@@ -5,13 +5,14 @@
<select id="salaryCount" resultType="com.subsidy.vo.labor.SalaryListSumVO"> <select id="salaryCount" resultType="com.subsidy.vo.labor.SalaryListSumVO">
SELECT SELECT
count( 1 ) cnt, count( 1 ) cnt,
sum( t.salary ) AS salary round(sum( t.salary ),2) AS salary
FROM FROM
project_salary_history t project_salary_history t
WHERE WHERE
t.delete_date IS NULL t.delete_date IS NULL
AND t.project_id = #{projectId} AND t.project_mapping_id = #{projectId}
AND t.member_id = #{memberId} AND t.member_id = #{memberId}
and t.commit_status = 1
</select> </select>
<select id="salaryList" resultType="com.subsidy.vo.labor.SalaryListVO"> <select id="salaryList" resultType="com.subsidy.vo.labor.SalaryListVO">
...@@ -20,14 +21,15 @@ ...@@ -20,14 +21,15 @@
t.bank, t.bank,
t.salary, t.salary,
t.salary_mark, t.salary_mark,
t.create_date, t.salary_date,
t.payroll_account t.payroll_account
FROM FROM
project_salary_history t project_salary_history t
WHERE WHERE
t.delete_date IS NULL t.delete_date IS NULL
AND t.project_id = #{projectId} AND t.project_mapping_id = #{projectId}
AND t.member_id = #{memberId} AND t.member_id = #{memberId}
and t.commit_status = 1
ORDER BY ORDER BY
t.create_date DESC t.create_date DESC
</select> </select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!