From 3dc3a8b80a57fdc47ff65c016f48dbf33f60dfb7 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Fri, 27 Nov 2020 11:37:33 +0800 Subject: [PATCH 01/33] 20201127v1.3 --- .../main/java/com/ccsens/mt/api/CompeteVideoController.java | 4 ++-- mt/src/main/resources/mapper_dao/CompeteVideoDao.xml | 4 ++-- tall/src/main/java/com/ccsens/tall/service/UserService.java | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java b/mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java index 8b61d6a4..5a625f40 100644 --- a/mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java +++ b/mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java @@ -66,10 +66,10 @@ public class CompeteVideoController { return JsonResponse.newInstance().ok(peoSignStatus); } @MustLogin - @ApiOperation(value = "查看教练签到状态(签到用)", notes = "Mr.王---------查看教练的人的签到状态") + @ApiOperation(value = "查看裁判签到状态(签到用)", notes = "Mr.王---------查看教练的人的签到状态") @RequestMapping(value = "/selectCoachStatus", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse> selectCoachSignStatus(@ApiParam @Validated @RequestBody QueryDto params) { - log.info("查看教练签到状态(签到用):{}",params); + log.info("查看裁判签到状态(签到用):{}",params); PageInfo coachSignStatus = iCompeteVedioService.selectCoachSignStatus(params); return JsonResponse.newInstance().ok(coachSignStatus); } diff --git a/mt/src/main/resources/mapper_dao/CompeteVideoDao.xml b/mt/src/main/resources/mapper_dao/CompeteVideoDao.xml index 47ac4744..8c17e5ee 100644 --- a/mt/src/main/resources/mapper_dao/CompeteVideoDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteVideoDao.xml @@ -68,7 +68,7 @@ tt.`cr` as `time` FROM t_compete_judgment tcj - left join tall.t_pro_member ttpm on tcj.member_id=ttpm.id + left join tall.t_pro_member ttpm on tcj.member_id=ttpm.id and ttpm.user_id != 0 left join ( select @@ -76,7 +76,7 @@ user_id From tall.t_sys_log - where `url`='/users/signin' and `rec_status`=0 + where `url`='/users/signin' and `rec_status`=0 and user_id != 0 and tall.t_sys_log.created_at <= #{param.signEndTime,jdbcType=TIMESTAMP} diff --git a/tall/src/main/java/com/ccsens/tall/service/UserService.java b/tall/src/main/java/com/ccsens/tall/service/UserService.java index 540bd4e2..11986631 100644 --- a/tall/src/main/java/com/ccsens/tall/service/UserService.java +++ b/tall/src/main/java/com/ccsens/tall/service/UserService.java @@ -333,6 +333,9 @@ public class UserService implements IUserService { userSignVo = new UserVo.UserSign(); userSignVo.setUserId(theAuth.getUserId()); userSignVo.setAuthId(theAuth.getId()); + + //给所有手机号一样的角色添加userId + memberHandler(theAuth.getUserId(), phone); } else { throw new BaseException(CodeEnum.SMS_CODE_CORRECT); } From f7059f23731da0daaac5032d1ee603096bd1a0fc Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Fri, 27 Nov 2020 13:48:47 +0800 Subject: [PATCH 02/33] 20201127v1.6 --- mt/src/main/java/com/ccsens/mt/bean/vo/ScoreVo.java | 2 +- .../java/com/ccsens/mt/service/ExcelService.java | 1 - mt/src/main/resources/application.yml | 4 ++-- .../mapper_dao/CompeteProjectConfigDao.xml | 1 + tall/src/main/resources/application.yml | 4 ++-- util/src/main/java/com/ccsens/util/PoiUtil.java | 13 +++++++++---- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/mt/src/main/java/com/ccsens/mt/bean/vo/ScoreVo.java b/mt/src/main/java/com/ccsens/mt/bean/vo/ScoreVo.java index 648516b6..e2577bf9 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/vo/ScoreVo.java +++ b/mt/src/main/java/com/ccsens/mt/bean/vo/ScoreVo.java @@ -251,7 +251,7 @@ public class ScoreVo { @ApiModelProperty("最终成绩") private BigDecimal finalScore; @ApiModelProperty("备注") - private String remark; + private String remark = ""; @ApiModelProperty("名次") private int rangee; } diff --git a/mt/src/main/java/com/ccsens/mt/service/ExcelService.java b/mt/src/main/java/com/ccsens/mt/service/ExcelService.java index 1e64fb7e..f9cc1991 100644 --- a/mt/src/main/java/com/ccsens/mt/service/ExcelService.java +++ b/mt/src/main/java/com/ccsens/mt/service/ExcelService.java @@ -1442,7 +1442,6 @@ public class ExcelService implements IExcelService { } List countScoreCurrentSites = countScoreCurrentSiteList; - List> list = new ArrayList<>(); List zero=new ArrayList<>(); PoiUtil.PoiUtilCell zeroOne=new PoiUtil.PoiUtilCell("比赛成绩公示(计数赛)", 10, 1); diff --git a/mt/src/main/resources/application.yml b/mt/src/main/resources/application.yml index a47f2a7b..1ac895fc 100644 --- a/mt/src/main/resources/application.yml +++ b/mt/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: profiles: - active: dev - include: common, util-dev + active: prod + include: common, util-prod diff --git a/mt/src/main/resources/mapper_dao/CompeteProjectConfigDao.xml b/mt/src/main/resources/mapper_dao/CompeteProjectConfigDao.xml index 3fbc2fe2..acfee8ae 100644 --- a/mt/src/main/resources/mapper_dao/CompeteProjectConfigDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteProjectConfigDao.xml @@ -396,6 +396,7 @@ and(a.ppId is not null or b.teamId is not null) and so.rec_status = 0 and pr.rec_status = 0 + and pc.rec_status = 0 ORDER BY so.start_time @@ -560,7 +562,7 @@ having count(t2.groupName) <= 8 select @@ -111,12 +111,12 @@ insert into t_compete_project_config (id, project_id, project_duration, site_num, start_time, end_time, created_at, updated_at, rec_status, - video_start_time, video_end_time, restrict + video_start_time, video_end_time, video_restrict ) values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, #{projectDuration,jdbcType=BIGINT}, #{siteNum,jdbcType=INTEGER}, #{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, - #{videoStartTime,jdbcType=BIGINT}, #{videoEndTime,jdbcType=BIGINT}, #{restrict,jdbcType=TINYINT} + #{videoStartTime,jdbcType=BIGINT}, #{videoEndTime,jdbcType=BIGINT}, #{videoRestrict,jdbcType=TINYINT} ) @@ -155,8 +155,8 @@ video_end_time, - - restrict, + + video_restrict, @@ -193,8 +193,8 @@ #{videoEndTime,jdbcType=BIGINT}, - - #{restrict,jdbcType=TINYINT}, + + #{videoRestrict,jdbcType=TINYINT}, @@ -240,8 +240,8 @@ video_end_time = #{record.videoEndTime,jdbcType=BIGINT}, - - restrict = #{record.restrict,jdbcType=TINYINT}, + + video_restrict = #{record.videoRestrict,jdbcType=TINYINT}, @@ -261,7 +261,7 @@ rec_status = #{record.recStatus,jdbcType=TINYINT}, video_start_time = #{record.videoStartTime,jdbcType=BIGINT}, video_end_time = #{record.videoEndTime,jdbcType=BIGINT}, - restrict = #{record.restrict,jdbcType=TINYINT} + video_restrict = #{record.videoRestrict,jdbcType=TINYINT} @@ -299,8 +299,8 @@ video_end_time = #{videoEndTime,jdbcType=BIGINT}, - - restrict = #{restrict,jdbcType=TINYINT}, + + video_restrict = #{videoRestrict,jdbcType=TINYINT}, where id = #{id,jdbcType=BIGINT} @@ -317,7 +317,7 @@ rec_status = #{recStatus,jdbcType=TINYINT}, video_start_time = #{videoStartTime,jdbcType=BIGINT}, video_end_time = #{videoEndTime,jdbcType=BIGINT}, - restrict = #{restrict,jdbcType=TINYINT} + video_restrict = #{videoRestrict,jdbcType=TINYINT} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/tall/src/main/resources/application.yml b/tall/src/main/resources/application.yml index e75cc2c3..b5408a3a 100644 --- a/tall/src/main/resources/application.yml +++ b/tall/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: prod - include: util-prod,common + active: dev + include: util-dev,common From eead5ca2dd61831d2be24c4b6f2b2a1d337d00a3 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Fri, 27 Nov 2020 20:11:46 +0800 Subject: [PATCH 07/33] 20201127v1.8 --- mt/src/main/resources/application.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mt/src/main/resources/application.yml b/mt/src/main/resources/application.yml index a47f2a7b..1ac895fc 100644 --- a/mt/src/main/resources/application.yml +++ b/mt/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: profiles: - active: dev - include: common, util-dev + active: prod + include: common, util-prod From 882d0420338fb8adf979ae7415b1f929340a6108 Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Fri, 27 Nov 2020 20:30:58 +0800 Subject: [PATCH 08/33] =?UTF-8?q?=E5=89=8D=E5=85=AB=E5=90=8D=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E6=97=A0=E8=A7=86=E9=A2=91=E7=9A=84=E5=92=8C=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E6=AF=94=E8=B5=9B=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper_dao/CompeteScoreDao.xml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml index e296faad..36fa12e9 100644 --- a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml @@ -252,6 +252,7 @@ FROM t_compete_count_score score, t_compete_start_order startOrder, + t_compete_video video, t_compete_project_player pp, t_compete_player player, t_compete_group competeGroup @@ -260,12 +261,16 @@ AND score.project_id = #{projectId} AND score.site_order_id = startOrder.id AND startOrder.player_id = pp.id + AND video.project_id = startOrder.project_id + AND video.player_id = startOrder.player_id AND pp.player_id = player.id AND player.compete_group_id = competeGroup.id + AND startOrder.waiver = 0 AND score.rec_status = 0 AND player.rec_status = 0 AND startOrder.rec_status = 0 AND competeGroup.rec_status = 0 + AND video.rec_status = 0 ORDER BY competeGroup.id, score.final_score @@ -279,6 +284,7 @@ FROM t_compete_count_score score, t_compete_start_order startOrder, + t_compete_video video, t_compete_project_player pp, t_compete_player player, t_compete_group competeGroup @@ -287,12 +293,16 @@ AND score.project_id = #{projectId} AND score.site_order_id = startOrder.id AND startOrder.player_id = pp.id + AND video.project_id = startOrder.project_id + AND video.player_id = startOrder.player_id AND pp.player_id = player.id AND player.compete_group_id = competeGroup.id + AND startOrder.waiver = 0 AND score.rec_status = 0 AND player.rec_status = 0 AND startOrder.rec_status = 0 AND competeGroup.rec_status = 0 + AND video.rec_status = 0 ORDER BY competeGroup.id, score.final_score @@ -321,6 +331,7 @@ FROM t_compete_count_score score, t_compete_start_order startOrder, + t_compete_video video, t_compete_team team, t_compete_team_member tm, t_compete_player player @@ -329,13 +340,17 @@ AND score.project_id = #{projectId} AND score.site_order_id = startOrder.id AND startOrder.player_id = team.id + AND video.project_id = startOrder.project_id + AND video.player_id = startOrder.player_id AND team.id = tm.compete_team_id AND tm.player_id = player.id + AND startOrder.waiver = 0 AND score.rec_status = 0 AND player.rec_status = 0 AND startOrder.rec_status = 0 AND team.rec_status = 0 AND tm.rec_status = 0 + AND video.rec_status = 0 group by score.id) t1, (SELECT @@ -349,6 +364,7 @@ FROM t_compete_count_score score, t_compete_start_order startOrder, + t_compete_video video, t_compete_team team, t_compete_team_member tm, t_compete_player player @@ -357,13 +373,17 @@ AND score.project_id = #{projectId} AND score.site_order_id = startOrder.id AND startOrder.player_id = team.id + AND video.project_id = startOrder.project_id + AND video.player_id = startOrder.player_id AND team.id = tm.compete_team_id AND tm.player_id = player.id + AND startOrder.waiver = 0 AND score.rec_status = 0 AND player.rec_status = 0 AND startOrder.rec_status = 0 AND team.rec_status = 0 AND tm.rec_status = 0 + AND video.rec_status = 0 group by score.id) t2 WHERE t1.group_name = t2.group_name @@ -407,6 +427,7 @@ site_order_id ) t, t_compete_start_order o, + t_compete_video video, (SELECT t.id, CONCAT( @@ -431,6 +452,10 @@ WHERE t.site_order_id = o.id AND o.player_id = team.id + AND o.waiver = 0 + AND video.project_id = o.project_id + AND video.player_id = o.player_id + AND video.rec_status = 0 AND o.rec_status = 0 order by t. final_score desc limit 8 From 294f668463526bf4b0d05f941244db4e86e7d86e Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Fri, 27 Nov 2020 20:32:31 +0800 Subject: [PATCH 09/33] 20201127v1.8 --- .../mt/persist/dao/CompeteScoreDao.java | 8 +++ .../com/ccsens/mt/service/CompeteService.java | 55 ++++++++++++------- mt/src/main/resources/application.yml | 4 +- .../resources/mapper_dao/CompeteScoreDao.xml | 3 + 4 files changed, 47 insertions(+), 23 deletions(-) diff --git a/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteScoreDao.java b/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteScoreDao.java index c4abbf49..97cbbc1c 100644 --- a/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteScoreDao.java +++ b/mt/src/main/java/com/ccsens/mt/persist/dao/CompeteScoreDao.java @@ -122,4 +122,12 @@ public interface CompeteScoreDao { * @return */ ScoreVo.CountScoreCurrentSite getCountScoreByOrderId(@Param("siteId")Long siteId); + + /** + * 根据组别和项目查找排名 + * @param projectId 项目id + * @param competeGroupId 组别id + * @return + */ + List selectCountPlayer(@Param("projectId")Long projectId, @Param("competeGroupId")Long competeGroupId); } diff --git a/mt/src/main/java/com/ccsens/mt/service/CompeteService.java b/mt/src/main/java/com/ccsens/mt/service/CompeteService.java index 3c888c18..1255482d 100644 --- a/mt/src/main/java/com/ccsens/mt/service/CompeteService.java +++ b/mt/src/main/java/com/ccsens/mt/service/CompeteService.java @@ -1388,7 +1388,7 @@ public class CompeteService implements ICompeteService { @Override public List countScoreDetail(CompeteDto.ProjectIdAndGroupId params) { - List competeScoreList = new ArrayList<>(); +// List competeScoreList = new ArrayList<>(); //判断比赛类型 long ProjectId = params.getProjectId(); long competeGroupId = params.getCompeteGroupId(); @@ -1396,26 +1396,39 @@ public class CompeteService implements ICompeteService { if (ObjectUtil.isNotNull(competeProject)){ int team = competeProject.getTeam(); long fatherId = competeProject.getParentId(); - //如果比赛是个人计数赛 - if (fatherId == 2001 && team == 0){ - List competeScores = competeScoreDao.selectSingleCount(ProjectId, competeGroupId); - competeScoreList.addAll(competeScores); - } - //如果是个人花样赛 - if (fatherId == 2002 && team == 0){ - List competeScores = competeScoreDao.selectSingleVarity(ProjectId, competeGroupId); - competeScoreList.addAll(competeScores); - } - //如果是团队计数赛 - if (fatherId == 2001 && team == 1){ - List competeScores = competeScoreDao.selectGroupCount(ProjectId, competeGroupId); - competeScoreList.addAll(competeScores); - } - //如果是团队花样赛 - if (fatherId == 2002 && team == 1){ - List competeScores = competeScoreDao.selectGroupVarity(ProjectId, competeGroupId); - competeScoreList.addAll(competeScores); - } + if(fatherId == Constant.COMPETE_COUNT) { + if (competeProject.getTeam() == Constant.Compete.TEAM_YES) { + // 团体赛 + List competeScoreList = competeScoreDao.selectCountPlayer(params.getProjectId(),params.getCompeteGroupId()); + competeScoreDao.queryCountScoreTeam(param.getProjectId()); + } else { + // 个人赛 + competeScoreDao.queryCountScorePerson(param.getProjectId()); + } + }else { + + } + +// //如果比赛是个人计数赛 +// if (fatherId == 2001 && team == 0){ +// List competeScores = competeScoreDao.selectSingleCount(ProjectId, competeGroupId); +// competeScoreList.addAll(competeScores); +// } +// //如果是个人花样赛 +// if (fatherId == 2002 && team == 0){ +// List competeScores = competeScoreDao.selectSingleVarity(ProjectId, competeGroupId); +// competeScoreList.addAll(competeScores); +// } +// //如果是团队计数赛 +// if (fatherId == 2001 && team == 1){ +// List competeScores = competeScoreDao.selectGroupCount(ProjectId, competeGroupId); +// competeScoreList.addAll(competeScores); +// } +// //如果是团队花样赛 +// if (fatherId == 2002 && team == 1){ +// List competeScores = competeScoreDao.selectGroupVarity(ProjectId, competeGroupId); +// competeScoreList.addAll(competeScores); +// } } return competeScoreList; } diff --git a/mt/src/main/resources/application.yml b/mt/src/main/resources/application.yml index 1ac895fc..a47f2a7b 100644 --- a/mt/src/main/resources/application.yml +++ b/mt/src/main/resources/application.yml @@ -1,6 +1,6 @@ spring: profiles: - active: prod - include: common, util-prod + active: dev + include: common, util-dev diff --git a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml index fccea8e3..7092ff31 100644 --- a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml @@ -1079,6 +1079,9 @@ and so.rec_status = 0 and cp.rec_status = 0 + + " + len * 100 / fileLength + "%\n"); + } + // 关闭资源 + bin.close(); + out.close(); + System.out.println("文件下载成功!"); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + System.out.println("文件下载失败!"); + } finally { + return file; + } + + } + + /** + * 测试 + * @param args + */ + public static void main(String[] args) { + + // 指定资源地址,下载文件测试 + downloadFile("http://1258473962.vod2.myqcloud.com/1e124671vodcq1258473962/76557f735285890810478037694/VCj25SXUgFsA.mp4", "D:/temp/"); + + } +} From 3ec86f6369b41ddc7a41b8ab121e9a75d77ec2d3 Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Sat, 28 Nov 2020 11:26:26 +0800 Subject: [PATCH 16/33] =?UTF-8?q?video=20=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/java/com/ccsens/util/VideoTest.java | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/util/src/test/java/com/ccsens/util/VideoTest.java b/util/src/test/java/com/ccsens/util/VideoTest.java index f2535fcc..09d212cc 100644 --- a/util/src/test/java/com/ccsens/util/VideoTest.java +++ b/util/src/test/java/com/ccsens/util/VideoTest.java @@ -5,6 +5,7 @@ import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; +import java.util.List; public class VideoTest { @@ -30,7 +31,7 @@ public class VideoTest { //设置超时 httpURLConnection.setConnectTimeout(1000*5); //设置请求方式,默认是GET - httpURLConnection.setRequestMethod("POST"); + httpURLConnection.setRequestMethod("GET"); // 设置字符编码 httpURLConnection.setRequestProperty("Charset", "UTF-8"); // 打开到此 URL引用的资源的通信链接(如果尚未建立这样的连接)。 @@ -46,10 +47,10 @@ public class VideoTest { BufferedInputStream bin = new BufferedInputStream(httpURLConnection.getInputStream()); // 指定文件名称(有需求可以自定义) - String fileFullName=""; - if(urlPath.contains("=")){ - fileFullName=urlPath.substring(urlPath.lastIndexOf("=")+1); - } + String fileFullName=urlPath.substring(urlPath.lastIndexOf("/") + 1); +// if(urlPath.contains("=")){ +// fileFullName=urlPath.substring(urlPath.lastIndexOf("=")+1); +// } // 指定存放位置(有需求可以自定义) String path = downloadDir + File.separatorChar + fileFullName; @@ -58,6 +59,9 @@ public class VideoTest { if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } + if (!file.exists()) { + file.createNewFile(); + } OutputStream out = new FileOutputStream(file); int size = 0; @@ -90,10 +94,26 @@ public class VideoTest { * 测试 * @param args */ - public static void main(String[] args) { + public static void main(String[] args) throws Exception { // 指定资源地址,下载文件测试 - downloadFile("http://1258473962.vod2.myqcloud.com/1e124671vodcq1258473962/76557f735285890810478037694/VCj25SXUgFsA.mp4", "D:/temp/"); +// downloadFile("http://1258473962.vod2.myqcloud.com/1e124671vodcq1258473962/76557f735285890810478037694/VCj25SXUgFsA.mp4", "D:/temp/"); + List objects = PoiUtil.readExce(new File("D:\\temp\\test.xlsx"), 0, null, 0, false); + for (int i = 0; i < objects.size(); i++) { + Object[] obj = objects.get(i); + if (obj == null || obj.length < 3) { + continue; + } + String path = (String)obj[2]; + String dir = "D:\\temp\\" + obj[0] + "\\" + obj[1]; + try{ + downloadFile(path, dir); + } catch (Exception e) { + System.out.println("下载失败:" + dir); + e.printStackTrace(); + + } + } } } From 5e5b6bcd136fb234f1b21c2c321f1cd2054c5d50 Mon Sep 17 00:00:00 2001 From: zhizhi wu <2377881365@qq.com> Date: Sat, 28 Nov 2020 14:13:37 +0800 Subject: [PATCH 17/33] =?UTF-8?q?=E4=BA=91=E7=82=B9=E6=92=AD=E8=BD=AC?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ccsens/mt/api/KCPlayerController.java | 10 +- .../com/ccsens/mt/bean/po/CompeteVideo.java | 22 +++ .../mt/bean/po/CompeteVideoExample.java | 140 ++++++++++++++++++ .../ccsens/mt/service/IKCPlayerService.java | 3 +- .../ccsens/mt/service/KCPlayerService.java | 88 ++++++++--- .../java/com/ccsens/mt/util/Constant.java | 12 ++ .../mapper_raw/CompeteVideoMapper.xml | 42 +++++- .../com/ccsens/util/KCPlayerSignature.java | 2 + 8 files changed, 285 insertions(+), 34 deletions(-) diff --git a/mt/src/main/java/com/ccsens/mt/api/KCPlayerController.java b/mt/src/main/java/com/ccsens/mt/api/KCPlayerController.java index cd19b869..21534c34 100644 --- a/mt/src/main/java/com/ccsens/mt/api/KCPlayerController.java +++ b/mt/src/main/java/com/ccsens/mt/api/KCPlayerController.java @@ -1,25 +1,17 @@ package com.ccsens.mt.api; -import com.ccsens.cloudutil.annotation.MustLogin; -import com.ccsens.mt.bean.dto.CompeteDto; -import com.ccsens.mt.bean.vo.CompeteVo; +import com.alibaba.fastjson.JSONObject; import com.ccsens.mt.service.IKCPlayerService; import com.ccsens.util.JsonResponse; -import com.ccsens.util.bean.dto.QueryDto; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; -import org.json.JSONObject; -import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; -import java.util.List; -import java.util.Map; @Slf4j @Api(tags = "云点播", description = "") diff --git a/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideo.java b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideo.java index 141f20a0..80ec29db 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideo.java +++ b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideo.java @@ -26,6 +26,10 @@ public class CompeteVideo implements Serializable { private Byte recStatus; + private String taskId; + + private String videoUrlOrigin; + private static final long serialVersionUID = 1L; public Long getId() { @@ -116,6 +120,22 @@ public class CompeteVideo implements Serializable { this.recStatus = recStatus; } + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId == null ? null : taskId.trim(); + } + + public String getVideoUrlOrigin() { + return videoUrlOrigin; + } + + public void setVideoUrlOrigin(String videoUrlOrigin) { + this.videoUrlOrigin = videoUrlOrigin == null ? null : videoUrlOrigin.trim(); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -133,6 +153,8 @@ public class CompeteVideo implements Serializable { sb.append(", createdAt=").append(createdAt); sb.append(", updatedAt=").append(updatedAt); sb.append(", recStatus=").append(recStatus); + sb.append(", taskId=").append(taskId); + sb.append(", videoUrlOrigin=").append(videoUrlOrigin); sb.append("]"); return sb.toString(); } diff --git a/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideoExample.java b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideoExample.java index 8764b36d..e097559f 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideoExample.java +++ b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideoExample.java @@ -774,6 +774,146 @@ public class CompeteVideoExample { addCriterion("rec_status not between", value1, value2, "recStatus"); return (Criteria) this; } + + public Criteria andTaskIdIsNull() { + addCriterion("task_id is null"); + return (Criteria) this; + } + + public Criteria andTaskIdIsNotNull() { + addCriterion("task_id is not null"); + return (Criteria) this; + } + + public Criteria andTaskIdEqualTo(String value) { + addCriterion("task_id =", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdNotEqualTo(String value) { + addCriterion("task_id <>", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdGreaterThan(String value) { + addCriterion("task_id >", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdGreaterThanOrEqualTo(String value) { + addCriterion("task_id >=", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdLessThan(String value) { + addCriterion("task_id <", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdLessThanOrEqualTo(String value) { + addCriterion("task_id <=", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdLike(String value) { + addCriterion("task_id like", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdNotLike(String value) { + addCriterion("task_id not like", value, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdIn(List values) { + addCriterion("task_id in", values, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdNotIn(List values) { + addCriterion("task_id not in", values, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdBetween(String value1, String value2) { + addCriterion("task_id between", value1, value2, "taskId"); + return (Criteria) this; + } + + public Criteria andTaskIdNotBetween(String value1, String value2) { + addCriterion("task_id not between", value1, value2, "taskId"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginIsNull() { + addCriterion("video_url_origin is null"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginIsNotNull() { + addCriterion("video_url_origin is not null"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginEqualTo(String value) { + addCriterion("video_url_origin =", value, "videoUrlOrigin"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginNotEqualTo(String value) { + addCriterion("video_url_origin <>", value, "videoUrlOrigin"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginGreaterThan(String value) { + addCriterion("video_url_origin >", value, "videoUrlOrigin"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginGreaterThanOrEqualTo(String value) { + addCriterion("video_url_origin >=", value, "videoUrlOrigin"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginLessThan(String value) { + addCriterion("video_url_origin <", value, "videoUrlOrigin"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginLessThanOrEqualTo(String value) { + addCriterion("video_url_origin <=", value, "videoUrlOrigin"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginLike(String value) { + addCriterion("video_url_origin like", value, "videoUrlOrigin"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginNotLike(String value) { + addCriterion("video_url_origin not like", value, "videoUrlOrigin"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginIn(List values) { + addCriterion("video_url_origin in", values, "videoUrlOrigin"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginNotIn(List values) { + addCriterion("video_url_origin not in", values, "videoUrlOrigin"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginBetween(String value1, String value2) { + addCriterion("video_url_origin between", value1, value2, "videoUrlOrigin"); + return (Criteria) this; + } + + public Criteria andVideoUrlOriginNotBetween(String value1, String value2) { + addCriterion("video_url_origin not between", value1, value2, "videoUrlOrigin"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/mt/src/main/java/com/ccsens/mt/service/IKCPlayerService.java b/mt/src/main/java/com/ccsens/mt/service/IKCPlayerService.java index f3f45cd7..1c909253 100644 --- a/mt/src/main/java/com/ccsens/mt/service/IKCPlayerService.java +++ b/mt/src/main/java/com/ccsens/mt/service/IKCPlayerService.java @@ -1,6 +1,7 @@ package com.ccsens.mt.service; -import org.json.JSONObject; + +import com.alibaba.fastjson.JSONObject; public interface IKCPlayerService { /** diff --git a/mt/src/main/java/com/ccsens/mt/service/KCPlayerService.java b/mt/src/main/java/com/ccsens/mt/service/KCPlayerService.java index cafebab8..e14d7b61 100644 --- a/mt/src/main/java/com/ccsens/mt/service/KCPlayerService.java +++ b/mt/src/main/java/com/ccsens/mt/service/KCPlayerService.java @@ -1,7 +1,9 @@ package com.ccsens.mt.service; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.lang.Snowflake; import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; import com.ccsens.mt.bean.po.CompeteStartOrder; import com.ccsens.mt.bean.po.CompeteVideo; import com.ccsens.mt.bean.po.CompeteVideoExample; @@ -13,12 +15,14 @@ import com.ccsens.util.KCPlayerSignature; import com.ccsens.util.RedisUtil; import com.ccsens.util.exception.BaseException; import lombok.extern.slf4j.Slf4j; -import org.json.JSONObject; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; import java.util.Random; @Slf4j @Service @@ -67,16 +71,53 @@ public class KCPlayerService implements IKCPlayerService{ @Override public void saveVideoUrl(JSONObject jsonObject) { + log.info("云点播事件通知:{}", jsonObject); + + switch (jsonObject.getString(Constant.KCPlayer.EVENT_TYPE)) { + // 任务流状态变更 + case Constant.KCPlayer.FILE_PROCEDURE_CHANGE : procedureChange(jsonObject);break; + // 文件上传 + case Constant.KCPlayer.FILE_UPLOAD : fileUpload(jsonObject);break; + } + + + + } + + private void procedureChange(JSONObject json) { + log.info("任务流变更"); + JSONObject procedure = json.getJSONObject(Constant.KCPlayer.PROCEDURE_STATUS_CHANGE); + String taskId = procedure.getString(Constant.KCPlayer.TASK_ID); + Object result = procedure.getJSONArray(Constant.KCPlayer.PROCEDURE_RESULT).get(0); + JSONObject resultJson = JSONObject.parseObject(JSONObject.toJSONString(result)); + + String url = resultJson.getJSONObject("TranscodeTask").getJSONObject("Output").getString("Url"); + + CompeteVideoExample competeVideoExample = new CompeteVideoExample(); + competeVideoExample.createCriteria().andTaskIdEqualTo(taskId); + + List competeVideos = competeVideoMapper.selectByExample(competeVideoExample); + if (CollectionUtil.isEmpty(competeVideos)) { + log.info("{}未找到,{}", taskId, url); + return; + } + CompeteVideo competeVideo = competeVideos.get(0); + CompeteVideo update = new CompeteVideo(); + update.setId(competeVideo.getId()); + update.setVideoUrl(url); + competeVideoMapper.updateByPrimaryKeySelective(update); + } + + private void fileUpload(JSONObject jsonObject) { + log.info("文件上传"); JSONObject fileUploadEvent = jsonObject.getJSONObject("FileUploadEvent"); JSONObject mediaBasicInfo = fileUploadEvent.getJSONObject("MediaBasicInfo"); // TODO 获取回传的id(场次id) JSONObject sourceInfo = mediaBasicInfo.getJSONObject("SourceInfo"); - JSONObject sourceContext = sourceInfo.getJSONObject("SourceContext"); - Long orderId = Long.parseLong(sourceContext.toString()); + long orderId = sourceInfo.getLongValue("SourceContext"); log.info("获取场次id:{}",orderId); // TODO 获取视频路径 - JSONObject mediaUrl = mediaBasicInfo.getJSONObject("MediaUrl"); - String videoUrl = mediaUrl.toString(); + String videoUrl = mediaBasicInfo.getString("MediaUrl"); log.info("获取视频路径:{}",videoUrl); //通过场次id获取场次信息 CompeteStartOrder startOrder = startOrderMapper.selectByPrimaryKey(orderId); @@ -87,20 +128,29 @@ public class KCPlayerService implements IKCPlayerService{ CompeteVideoExample competeVideoExample = new CompeteVideoExample(); competeVideoExample.createCriteria().andProjectIdEqualTo(startOrder.getProjectId()) .andPlayerIdEqualTo(startOrder.getPlayerId()); - long count = competeVideoMapper.countByExample(competeVideoExample); - log.info("查询以前上传的视频的记录:{}",count); - if(count > 0){ - throw new BaseException(CodeEnum.ALREADY_UPLOAD_VIDEO); - } + List competeVideos = competeVideoMapper.selectByExample(competeVideoExample); - //将视频信息存入视频表 - CompeteVideo competeVideo = new CompeteVideo(); - competeVideo.setId(snowflake.nextId()); - competeVideo.setProjectId(startOrder.getProjectId()); - competeVideo.setPlayerId(startOrder.getPlayerId()); - competeVideo.setVideoUrl(videoUrl); - competeVideo.setUploadTime(System.currentTimeMillis()); - log.info("添加上传视频记录:{}",count); - competeVideoMapper.insertSelective(competeVideo); + log.info("查询以前上传的视频的记录:{}",competeVideos); + if(CollectionUtil.isNotEmpty(competeVideos)){ + CompeteVideo competeVideo = competeVideos.get(0); + CompeteVideo update = new CompeteVideo(); + update.setId(competeVideo.getId()); + update.setVideoUrl(videoUrl); + update.setVideoUrlOrigin(videoUrl); + update.setTaskId(fileUploadEvent.getString(Constant.KCPlayer.PROCEDURE_TASK_ID)); + competeVideoMapper.updateByPrimaryKeySelective(update); + } else { + //将视频信息存入视频表 + CompeteVideo competeVideo = new CompeteVideo(); + competeVideo.setId(snowflake.nextId()); + competeVideo.setProjectId(startOrder.getProjectId()); + competeVideo.setPlayerId(startOrder.getPlayerId()); + competeVideo.setVideoUrl(videoUrl); + competeVideo.setVideoUrlOrigin(videoUrl); + competeVideo.setUploadTime(System.currentTimeMillis()); + competeVideo.setTaskId(fileUploadEvent.getString(Constant.KCPlayer.PROCEDURE_TASK_ID)); + log.info("添加上传视频记录:{}", competeVideo); + competeVideoMapper.insertSelective(competeVideo); + } } } diff --git a/mt/src/main/java/com/ccsens/mt/util/Constant.java b/mt/src/main/java/com/ccsens/mt/util/Constant.java index f99ad96f..d18fd2d3 100644 --- a/mt/src/main/java/com/ccsens/mt/util/Constant.java +++ b/mt/src/main/java/com/ccsens/mt/util/Constant.java @@ -8,6 +8,18 @@ import com.ccsens.util.WebConstant; * @time: 2020/8/13 17:14 */ public class Constant { + + public static class KCPlayer{ + public final static String EVENT_TYPE = "EventType"; + public final static String PROCEDURE_RESULT = "MediaProcessResultSet"; + public final static String PROCEDURE_TASK_ID = "ProcedureTaskId"; + public final static String TASK_ID = "TaskId"; + public final static String FILE_URL = "FileUrl"; + public final static String PROCEDURE_STATUS_CHANGE = "ProcedureStateChangeEvent"; + /**文件上传*/ + public final static String FILE_UPLOAD = "NewFileUpload"; + public final static String FILE_PROCEDURE_CHANGE = "ProcedureStateChanged"; + } public static class Redis{ // 项目正在进行中的题目 项目ID_start_question public final static String START_QUESTION = "_start_question"; diff --git a/mt/src/main/resources/mapper_raw/CompeteVideoMapper.xml b/mt/src/main/resources/mapper_raw/CompeteVideoMapper.xml index 34642f49..f09ae100 100644 --- a/mt/src/main/resources/mapper_raw/CompeteVideoMapper.xml +++ b/mt/src/main/resources/mapper_raw/CompeteVideoMapper.xml @@ -13,6 +13,8 @@ + + @@ -74,7 +76,7 @@ id, compete_time_id, project_id, player_id, user_id, video_url, upload_time, upload_status, - created_at, updated_at, rec_status + created_at, updated_at, rec_status, task_id, video_url_origin @@ -231,6 +247,12 @@ rec_status = #{record.recStatus,jdbcType=TINYINT}, + + task_id = #{record.taskId,jdbcType=VARCHAR}, + + + video_url_origin = #{record.videoUrlOrigin,jdbcType=VARCHAR}, + @@ -248,7 +270,9 @@ upload_status = #{record.uploadStatus,jdbcType=TINYINT}, created_at = #{record.createdAt,jdbcType=TIMESTAMP}, updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, - rec_status = #{record.recStatus,jdbcType=TINYINT} + rec_status = #{record.recStatus,jdbcType=TINYINT}, + task_id = #{record.taskId,jdbcType=VARCHAR}, + video_url_origin = #{record.videoUrlOrigin,jdbcType=VARCHAR} @@ -286,6 +310,12 @@ rec_status = #{recStatus,jdbcType=TINYINT}, + + task_id = #{taskId,jdbcType=VARCHAR}, + + + video_url_origin = #{videoUrlOrigin,jdbcType=VARCHAR}, + where id = #{id,jdbcType=BIGINT} @@ -300,7 +330,9 @@ upload_status = #{uploadStatus,jdbcType=TINYINT}, created_at = #{createdAt,jdbcType=TIMESTAMP}, updated_at = #{updatedAt,jdbcType=TIMESTAMP}, - rec_status = #{recStatus,jdbcType=TINYINT} + rec_status = #{recStatus,jdbcType=TINYINT}, + task_id = #{taskId,jdbcType=VARCHAR}, + video_url_origin = #{videoUrlOrigin,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/util/src/main/java/com/ccsens/util/KCPlayerSignature.java b/util/src/main/java/com/ccsens/util/KCPlayerSignature.java index 0aeef470..c0967ee8 100644 --- a/util/src/main/java/com/ccsens/util/KCPlayerSignature.java +++ b/util/src/main/java/com/ccsens/util/KCPlayerSignature.java @@ -39,7 +39,9 @@ public class KCPlayerSignature{ contextStr += "¤tTimeStamp=" + currentTime; contextStr += "&expireTime=" + endTime; contextStr += "&random=" + random; + contextStr += "&procedure=videoEncode"; contextStr += "&sourceContext=" + id; + System.out.println("------------------contextStr:" + contextStr); try { From 0dd28eb277bf9cdeb1c054f8d07627c804466179 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Sat, 28 Nov 2020 14:20:37 +0800 Subject: [PATCH 18/33] 20201128v1.3 --- .../com/ccsens/mt/service/ExcelService.java | 2 +- .../test/java/com/ccsens/util/VideoTest.java | 34 +++++++++++++++---- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/mt/src/main/java/com/ccsens/mt/service/ExcelService.java b/mt/src/main/java/com/ccsens/mt/service/ExcelService.java index 64b5906e..018ec558 100644 --- a/mt/src/main/java/com/ccsens/mt/service/ExcelService.java +++ b/mt/src/main/java/com/ccsens/mt/service/ExcelService.java @@ -1470,7 +1470,7 @@ public class ExcelService implements IExcelService { PoiUtil.PoiUtilCell oneFive=new PoiUtil.PoiUtilCell("总成绩", 1, 2); PoiUtil.PoiUtilCell oneSix=new PoiUtil.PoiUtilCell("扣除次数", 1, 2); PoiUtil.PoiUtilCell oneSeven=new PoiUtil.PoiUtilCell("最终成绩", 1, 2); - PoiUtil.PoiUtilCell oneEight=new PoiUtil.PoiUtilCell("名词", 1, 2); + PoiUtil.PoiUtilCell oneEight=new PoiUtil.PoiUtilCell("名次", 1, 2); PoiUtil.PoiUtilCell oneNine=new PoiUtil.PoiUtilCell("备注", 1, 2); one.add(oneOne); diff --git a/util/src/test/java/com/ccsens/util/VideoTest.java b/util/src/test/java/com/ccsens/util/VideoTest.java index f2535fcc..70026770 100644 --- a/util/src/test/java/com/ccsens/util/VideoTest.java +++ b/util/src/test/java/com/ccsens/util/VideoTest.java @@ -5,6 +5,7 @@ import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; +import java.util.List; public class VideoTest { @@ -30,7 +31,7 @@ public class VideoTest { //设置超时 httpURLConnection.setConnectTimeout(1000*5); //设置请求方式,默认是GET - httpURLConnection.setRequestMethod("POST"); + httpURLConnection.setRequestMethod("GET"); // 设置字符编码 httpURLConnection.setRequestProperty("Charset", "UTF-8"); // 打开到此 URL引用的资源的通信链接(如果尚未建立这样的连接)。 @@ -46,10 +47,10 @@ public class VideoTest { BufferedInputStream bin = new BufferedInputStream(httpURLConnection.getInputStream()); // 指定文件名称(有需求可以自定义) - String fileFullName=""; - if(urlPath.contains("=")){ - fileFullName=urlPath.substring(urlPath.lastIndexOf("=")+1); - } + String fileFullName=urlPath.substring(urlPath.lastIndexOf("/") + 1); +// if(urlPath.contains("=")){ +// fileFullName=urlPath.substring(urlPath.lastIndexOf("=")+1); +// } // 指定存放位置(有需求可以自定义) String path = downloadDir + File.separatorChar + fileFullName; @@ -58,6 +59,9 @@ public class VideoTest { if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } + if (!file.exists()) { + file.createNewFile(); + } OutputStream out = new FileOutputStream(file); int size = 0; @@ -90,10 +94,26 @@ public class VideoTest { * 测试 * @param args */ - public static void main(String[] args) { + public static void main(String[] args) throws Exception { // 指定资源地址,下载文件测试 - downloadFile("http://1258473962.vod2.myqcloud.com/1e124671vodcq1258473962/76557f735285890810478037694/VCj25SXUgFsA.mp4", "D:/temp/"); + downloadFile("http://1258473962.vod2.myqcloud.com/1e124671vodcq1258473962/d4650b135285890810564491478/wyGRWPX5qlgA.mp4", "D:/temp/"); +// List objects = PoiUtil.readExce(new File("D:\\temp\\test.xlsx"), 0, null, 0, false); +//// for (int i = 0; i < objects.size(); i++) { +//// Object[] obj = objects.get(i); +//// if (obj == null || obj.length < 3) { +//// continue; +//// } +//// String path = (String)obj[2]; +//// String dir = "D:\\temp\\" + obj[0] + "\\" + obj[1]; +//// try{ +//// downloadFile(path, dir); +//// } catch (Exception e) { +//// System.out.println("下载失败:" + dir); +//// e.printStackTrace(); +//// +//// } +//// } } } From 9aed6351770186d5f9f685bd135ab29d19c58467 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Fri, 4 Dec 2020 09:18:30 +0800 Subject: [PATCH 19/33] 20201204 --- .../cloudutil/aspect/MustLoginAspect.java | 4 +- game/src/main/resources/application-dev.yml | 2 +- game/src/main/resources/application-test.yml | 11 +- game/src/main/resources/application.yml | 4 +- game/src/main/resources/druid-test.yml | 5 +- .../ccsens/mt/api/CompeteVideoController.java | 10 +- .../com/ccsens/mt/api/DebugController.java | 21 + .../java/com/ccsens/mt/bean/dto/VideoDto.java | 14 + .../ccsens/mt/bean/po/CompeteSpeedVideo.java | 128 +++ .../mt/bean/po/CompeteSpeedVideoExample.java | 841 ++++++++++++++++++ .../com/ccsens/mt/bean/vo/VideoProjectVo.java | 4 +- .../mapper/CompeteSpeedVideoMapper.java | 30 + .../mt/service/CompeteVedioService.java | 45 +- .../mt/service/ICompeteVedioService.java | 2 + mt/src/main/resources/druid-prod.yml | 2 +- .../resources/mapper_dao/CompeteScoreDao.xml | 726 +++++++++++---- .../resources/mapper_dao/CompeteVideoDao.xml | 4 +- .../mapper_raw/CompeteSpeedVideoMapper.xml | 291 ++++++ .../main/resources/mapper_dao/SysUserDao.xml | 4 +- .../java/com/ccsens/util/wx/WxXcxUtil.java | 4 +- .../test/java/com/ccsens/util/VideoTest.java | 8 +- 21 files changed, 1970 insertions(+), 190 deletions(-) create mode 100644 mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideo.java create mode 100644 mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideoExample.java create mode 100644 mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteSpeedVideoMapper.java create mode 100644 mt/src/main/resources/mapper_raw/CompeteSpeedVideoMapper.xml diff --git a/cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java b/cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java index 1b155c8a..b3e63db6 100644 --- a/cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java +++ b/cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java @@ -48,7 +48,9 @@ public class MustLoginAspect { RequestContextHolder.getRequestAttributes()).getRequest(); final String authHeader = request.getHeader(WebConstant.HEADER_KEY_TOKEN); - + if(StrUtil.isEmpty(authHeader)){ + return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); + } Object[] args = pjp.getArgs(); QueryDto dto = args == null || args.length < 1 ? null : (QueryDto) args[0]; diff --git a/game/src/main/resources/application-dev.yml b/game/src/main/resources/application-dev.yml index acc4b645..b7584d95 100644 --- a/game/src/main/resources/application-dev.yml +++ b/game/src/main/resources/application-dev.yml @@ -8,7 +8,7 @@ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource rabbitmq: - host: 81.70.54.64 + host: 192.168.0.99 password: 111111 port: 5672 username: admin diff --git a/game/src/main/resources/application-test.yml b/game/src/main/resources/application-test.yml index 93232b12..1b3de44e 100644 --- a/game/src/main/resources/application-test.yml +++ b/game/src/main/resources/application-test.yml @@ -8,17 +8,13 @@ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource rabbitmq: -<<<<<<< HEAD - host: 81.70.54.64 -======= host: 127.0.0.1 ->>>>>>> pt password: 111111 port: 5672 username: admin redis: database: 0 - host: 192.168.0.99 + host: 127.0.0.1 jedis: pool: max-active: 200 @@ -32,9 +28,6 @@ swagger: enable: true eureka: instance: -<<<<<<< HEAD - ip-address: 192.168.0.99 -======= ip-address: 192.168.0.99 gatewayUrl: https://test.tall.wiki/gateway/ @@ -42,4 +35,4 @@ notGatewayUrl: https://test.tall.wiki/ file: qrCode: https://test.tall.wiki/gateway/tall/v1.0/uploads/ openWX: 0 ->>>>>>> pt + diff --git a/game/src/main/resources/application.yml b/game/src/main/resources/application.yml index d082c0ea..5889ff7f 100644 --- a/game/src/main/resources/application.yml +++ b/game/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: prod - include: common, util-prod \ No newline at end of file + active: test + include: common, util-test \ No newline at end of file diff --git a/game/src/main/resources/druid-test.yml b/game/src/main/resources/druid-test.yml index 1d5e981e..f5a38592 100644 --- a/game/src/main/resources/druid-test.yml +++ b/game/src/main/resources/druid-test.yml @@ -27,10 +27,9 @@ spring: testOnReturn: false testWhileIdle: true timeBetweenEvictionRunsMillis: 60000 -<<<<<<< HEAD + # url: jdbc:mysql://test.tall.wiki/game?useUnicode=true&characterEncoding=UTF-8 -======= ->>>>>>> pt + url: jdbc:mysql://49.233.89.188:3306/game?useUnicode=true&characterEncoding=UTF-8 username: root validationQuery: SELECT 1 FROM DUAL diff --git a/mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java b/mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java index 5a625f40..319d68ac 100644 --- a/mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java +++ b/mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java @@ -71,6 +71,7 @@ public class CompeteVideoController { public JsonResponse> selectCoachSignStatus(@ApiParam @Validated @RequestBody QueryDto params) { log.info("查看裁判签到状态(签到用):{}",params); PageInfo coachSignStatus = iCompeteVedioService.selectCoachSignStatus(params); + log.info("查看裁判签到状态:{}",coachSignStatus); return JsonResponse.newInstance().ok(coachSignStatus); } @@ -92,6 +93,13 @@ public class CompeteVideoController { return JsonResponse.newInstance().ok(list); } - + @MustLogin + @ApiOperation(value = "上传速度通级赛视频", notes = "zy--保存速度通级赛的视频,只存单位信息,选手名和视频地址") + @RequestMapping(value = "/save/speedVideo", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse saveSpeedVideo(@ApiParam @Validated @RequestBody QueryDto params) { + log.info("上传速度通级赛视频:{}",params); + iCompeteVedioService.saveSpeedVideo(params.getParam(),params.getUserId()); + return JsonResponse.newInstance().ok(true); + } } diff --git a/mt/src/main/java/com/ccsens/mt/api/DebugController.java b/mt/src/main/java/com/ccsens/mt/api/DebugController.java index 6bd68d6e..8f30dd77 100644 --- a/mt/src/main/java/com/ccsens/mt/api/DebugController.java +++ b/mt/src/main/java/com/ccsens/mt/api/DebugController.java @@ -1,11 +1,15 @@ package com.ccsens.mt.api; import com.ccsens.mt.bean.dto.LevelDto; +import com.ccsens.mt.bean.dto.VideoDto; import com.ccsens.mt.bean.po.CompetePlayer; +import com.ccsens.mt.bean.po.CompeteVideo; import com.ccsens.mt.bean.po.LevelUser; import com.ccsens.mt.bean.vo.ProvinceCompeteVo; import com.ccsens.mt.bean.vo.TableVo; +import com.ccsens.mt.bean.vo.VideoProjectVo; import com.ccsens.mt.persist.dao.CompetePlayerDao; +import com.ccsens.mt.persist.dao.CompeteVideoDao; import com.ccsens.mt.service.IExcelService; import com.ccsens.mt.service.ILevelUpService; import com.ccsens.util.JsonResponse; @@ -13,6 +17,7 @@ import com.ccsens.util.RedisUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; import org.springframework.data.redis.core.ZSetOperations; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -29,6 +34,7 @@ import java.util.Set; @Api(tags = "DEBUG" , description = "DebugController | ") @RestController @RequestMapping("/debug") +@Slf4j public class DebugController { @Resource private RedisUtil redisUtil; @@ -37,6 +43,8 @@ public class DebugController { @Resource private CompetePlayerDao competePlayerDao; @Resource + private CompeteVideoDao competeVideoDao; + @Resource private IExcelService excelService; @ApiOperation(value = "/测试",notes = "") @@ -82,4 +90,17 @@ public class DebugController { return JsonResponse.newInstance().ok(competeAllCount); } + + @ApiOperation(value = "/测试",notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value="/time",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) + public JsonResponse debugTime() throws Exception { + VideoDto.GetSignStatus getSignStatus = new VideoDto.GetSignStatus(); + getSignStatus.setId((long) 1); + List coachSignStatus = competeVideoDao.selectCoachSignStatus(getSignStatus); + log.info("查看裁判签到状态:{}",coachSignStatus); + return JsonResponse.newInstance().ok(coachSignStatus); + } + } diff --git a/mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java b/mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java index 627cacb3..0b4424bf 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java +++ b/mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java @@ -8,7 +8,9 @@ import lombok.NonNull; import javax.validation.constraints.Max; import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; import java.util.Date; +import java.util.List; /** @@ -115,4 +117,16 @@ public class VideoDto { private int pageSize = 10; } + @Data + @ApiModel("上传通级赛视频") + public static class SpeedVideoInfo{ + @NotNull(message = "单位信息不正确") + @ApiModelProperty("单位id") + private Long companyId; + @ApiModelProperty("选手名称") + private String playerName; + @ApiModelProperty("签到时间") + private List videoUrlList; + } + } diff --git a/mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideo.java b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideo.java new file mode 100644 index 00000000..455167da --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideo.java @@ -0,0 +1,128 @@ +package com.ccsens.mt.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class CompeteSpeedVideo implements Serializable { + private Long id; + + private Long companyId; + + private String companyName; + + private String playerName; + + private Long userId; + + private String videoUrlOne; + + private String videoUrlTwo; + + private Date createdAt; + + private Date updatedAt; + + private Byte recStatus; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName == null ? null : companyName.trim(); + } + + public String getPlayerName() { + return playerName; + } + + public void setPlayerName(String playerName) { + this.playerName = playerName == null ? null : playerName.trim(); + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getVideoUrlOne() { + return videoUrlOne; + } + + public void setVideoUrlOne(String videoUrlOne) { + this.videoUrlOne = videoUrlOne == null ? null : videoUrlOne.trim(); + } + + public String getVideoUrlTwo() { + return videoUrlTwo; + } + + public void setVideoUrlTwo(String videoUrlTwo) { + this.videoUrlTwo = videoUrlTwo == null ? null : videoUrlTwo.trim(); + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public Byte getRecStatus() { + return recStatus; + } + + public void setRecStatus(Byte recStatus) { + this.recStatus = recStatus; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", companyId=").append(companyId); + sb.append(", companyName=").append(companyName); + sb.append(", playerName=").append(playerName); + sb.append(", userId=").append(userId); + sb.append(", videoUrlOne=").append(videoUrlOne); + sb.append(", videoUrlTwo=").append(videoUrlTwo); + sb.append(", createdAt=").append(createdAt); + sb.append(", updatedAt=").append(updatedAt); + sb.append(", recStatus=").append(recStatus); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideoExample.java b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideoExample.java new file mode 100644 index 00000000..eccec298 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideoExample.java @@ -0,0 +1,841 @@ +package com.ccsens.mt.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class CompeteSpeedVideoExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public CompeteSpeedVideoExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNull() { + addCriterion("company_name is null"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNotNull() { + addCriterion("company_name is not null"); + return (Criteria) this; + } + + public Criteria andCompanyNameEqualTo(String value) { + addCriterion("company_name =", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotEqualTo(String value) { + addCriterion("company_name <>", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThan(String value) { + addCriterion("company_name >", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThanOrEqualTo(String value) { + addCriterion("company_name >=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThan(String value) { + addCriterion("company_name <", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThanOrEqualTo(String value) { + addCriterion("company_name <=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLike(String value) { + addCriterion("company_name like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotLike(String value) { + addCriterion("company_name not like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameIn(List values) { + addCriterion("company_name in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotIn(List values) { + addCriterion("company_name not in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameBetween(String value1, String value2) { + addCriterion("company_name between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotBetween(String value1, String value2) { + addCriterion("company_name not between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andPlayerNameIsNull() { + addCriterion("player_name is null"); + return (Criteria) this; + } + + public Criteria andPlayerNameIsNotNull() { + addCriterion("player_name is not null"); + return (Criteria) this; + } + + public Criteria andPlayerNameEqualTo(String value) { + addCriterion("player_name =", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameNotEqualTo(String value) { + addCriterion("player_name <>", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameGreaterThan(String value) { + addCriterion("player_name >", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameGreaterThanOrEqualTo(String value) { + addCriterion("player_name >=", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameLessThan(String value) { + addCriterion("player_name <", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameLessThanOrEqualTo(String value) { + addCriterion("player_name <=", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameLike(String value) { + addCriterion("player_name like", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameNotLike(String value) { + addCriterion("player_name not like", value, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameIn(List values) { + addCriterion("player_name in", values, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameNotIn(List values) { + addCriterion("player_name not in", values, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameBetween(String value1, String value2) { + addCriterion("player_name between", value1, value2, "playerName"); + return (Criteria) this; + } + + public Criteria andPlayerNameNotBetween(String value1, String value2) { + addCriterion("player_name not between", value1, value2, "playerName"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneIsNull() { + addCriterion("video_url_one is null"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneIsNotNull() { + addCriterion("video_url_one is not null"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneEqualTo(String value) { + addCriterion("video_url_one =", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneNotEqualTo(String value) { + addCriterion("video_url_one <>", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneGreaterThan(String value) { + addCriterion("video_url_one >", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneGreaterThanOrEqualTo(String value) { + addCriterion("video_url_one >=", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneLessThan(String value) { + addCriterion("video_url_one <", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneLessThanOrEqualTo(String value) { + addCriterion("video_url_one <=", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneLike(String value) { + addCriterion("video_url_one like", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneNotLike(String value) { + addCriterion("video_url_one not like", value, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneIn(List values) { + addCriterion("video_url_one in", values, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneNotIn(List values) { + addCriterion("video_url_one not in", values, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneBetween(String value1, String value2) { + addCriterion("video_url_one between", value1, value2, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlOneNotBetween(String value1, String value2) { + addCriterion("video_url_one not between", value1, value2, "videoUrlOne"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoIsNull() { + addCriterion("video_url_two is null"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoIsNotNull() { + addCriterion("video_url_two is not null"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoEqualTo(String value) { + addCriterion("video_url_two =", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoNotEqualTo(String value) { + addCriterion("video_url_two <>", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoGreaterThan(String value) { + addCriterion("video_url_two >", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoGreaterThanOrEqualTo(String value) { + addCriterion("video_url_two >=", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoLessThan(String value) { + addCriterion("video_url_two <", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoLessThanOrEqualTo(String value) { + addCriterion("video_url_two <=", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoLike(String value) { + addCriterion("video_url_two like", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoNotLike(String value) { + addCriterion("video_url_two not like", value, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoIn(List values) { + addCriterion("video_url_two in", values, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoNotIn(List values) { + addCriterion("video_url_two not in", values, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoBetween(String value1, String value2) { + addCriterion("video_url_two between", value1, value2, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andVideoUrlTwoNotBetween(String value1, String value2) { + addCriterion("video_url_two not between", value1, value2, "videoUrlTwo"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Date value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Date value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Date value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Date value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Date value1, Date value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNull() { + addCriterion("rec_status is null"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNotNull() { + addCriterion("rec_status is not null"); + return (Criteria) this; + } + + public Criteria andRecStatusEqualTo(Byte value) { + addCriterion("rec_status =", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotEqualTo(Byte value) { + addCriterion("rec_status <>", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThan(Byte value) { + addCriterion("rec_status >", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("rec_status >=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThan(Byte value) { + addCriterion("rec_status <", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThanOrEqualTo(Byte value) { + addCriterion("rec_status <=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusIn(List values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List values) { + addCriterion("rec_status not in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusBetween(Byte value1, Byte value2) { + addCriterion("rec_status between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { + addCriterion("rec_status not between", value1, value2, "recStatus"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/mt/src/main/java/com/ccsens/mt/bean/vo/VideoProjectVo.java b/mt/src/main/java/com/ccsens/mt/bean/vo/VideoProjectVo.java index 51ca828b..e79c75fc 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/vo/VideoProjectVo.java +++ b/mt/src/main/java/com/ccsens/mt/bean/vo/VideoProjectVo.java @@ -49,8 +49,8 @@ public class VideoProjectVo { private String phone; @ApiModelProperty("裁判类型") private byte chiefJudgment; -// @ApiModelProperty("最近签到时间") -// private Date time; + @ApiModelProperty("最近签到时间") + private Date dateTime; @ApiModelProperty("最近签到时间戳") private Long time; } diff --git a/mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteSpeedVideoMapper.java b/mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteSpeedVideoMapper.java new file mode 100644 index 00000000..aeb4c669 --- /dev/null +++ b/mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteSpeedVideoMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.mt.persist.mapper; + +import com.ccsens.mt.bean.po.CompeteSpeedVideo; +import com.ccsens.mt.bean.po.CompeteSpeedVideoExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface CompeteSpeedVideoMapper { + long countByExample(CompeteSpeedVideoExample example); + + int deleteByExample(CompeteSpeedVideoExample example); + + int deleteByPrimaryKey(Long id); + + int insert(CompeteSpeedVideo record); + + int insertSelective(CompeteSpeedVideo record); + + List selectByExample(CompeteSpeedVideoExample example); + + CompeteSpeedVideo selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") CompeteSpeedVideo record, @Param("example") CompeteSpeedVideoExample example); + + int updateByExample(@Param("record") CompeteSpeedVideo record, @Param("example") CompeteSpeedVideoExample example); + + int updateByPrimaryKeySelective(CompeteSpeedVideo record); + + int updateByPrimaryKey(CompeteSpeedVideo record); +} \ No newline at end of file diff --git a/mt/src/main/java/com/ccsens/mt/service/CompeteVedioService.java b/mt/src/main/java/com/ccsens/mt/service/CompeteVedioService.java index 743113c8..46783fca 100644 --- a/mt/src/main/java/com/ccsens/mt/service/CompeteVedioService.java +++ b/mt/src/main/java/com/ccsens/mt/service/CompeteVedioService.java @@ -1,17 +1,18 @@ package com.ccsens.mt.service; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.ObjectUtil; import com.ccsens.mt.bean.dto.VideoDto; import com.ccsens.mt.bean.po.*; import com.ccsens.mt.bean.vo.VideoProjectVo; import com.ccsens.mt.persist.dao.CompeteTeamDao; import com.ccsens.mt.persist.dao.CompeteTimeDao; import com.ccsens.mt.persist.dao.CompeteVideoDao; -import com.ccsens.mt.persist.mapper.CompeteCompanyMapper; -import com.ccsens.mt.persist.mapper.CompetePlayerLookMapper; -import com.ccsens.mt.persist.mapper.CompeteProjectMapper; -import com.ccsens.mt.persist.mapper.CompeteVideoMapper; +import com.ccsens.mt.persist.mapper.*; +import com.ccsens.util.CodeEnum; import com.ccsens.util.bean.dto.QueryDto; +import com.ccsens.util.exception.BaseException; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -21,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.ArrayList; +import java.util.Base64; import java.util.List; /** @@ -37,9 +39,8 @@ public class CompeteVedioService implements ICompeteVedioService{ private CompetePlayerLookMapper competePlayerLookMapper; @Resource private CompeteVideoMapper competeVideoMapper; - @Resource - private CompeteProjectMapper competeProjectMapper; + private CompeteSpeedVideoMapper speedVideoMapper; @Resource private CompeteCompanyMapper competeCompanyMapper; @Resource @@ -142,6 +143,34 @@ public class CompeteVedioService implements ICompeteVedioService{ return new PageInfo<>(competeVideoDao.selectCoachSignStatus(params.getParam())); } - - + /** + * 上传速度通级赛视频 + * @param param 视频地址和选手名 + * @param userId 上传者的userId + */ + @Override + public void saveSpeedVideo(VideoDto.SpeedVideoInfo param, Long userId) { + //查找单位信息 + CompeteCompany company = competeCompanyMapper.selectByPrimaryKey(param.getCompanyId()); + if(ObjectUtil.isNull(company)){ + throw new BaseException(CodeEnum.PARAM_ERROR); + } + //保存视频信息 + CompeteSpeedVideo speedVideo = new CompeteSpeedVideo(); + speedVideo.setId(snowflake.nextId()); + speedVideo.setCompanyId(param.getCompanyId()); + speedVideo.setCompanyName(company.getName()); + speedVideo.setPlayerName(param.getPlayerName()); + if(CollectionUtil.isNotEmpty(param.getVideoUrlList())){ + for (int i = 0; i < param.getVideoUrlList().size(); i++) { + String url = param.getVideoUrlList().get(i); + if(i == 0){ + speedVideo.setVideoUrlOne(url); + }else { + speedVideo.setVideoUrlTwo(url); + } + } + } + speedVideoMapper.insertSelective(speedVideo); + } } diff --git a/mt/src/main/java/com/ccsens/mt/service/ICompeteVedioService.java b/mt/src/main/java/com/ccsens/mt/service/ICompeteVedioService.java index d999120e..ff4d69f8 100644 --- a/mt/src/main/java/com/ccsens/mt/service/ICompeteVedioService.java +++ b/mt/src/main/java/com/ccsens/mt/service/ICompeteVedioService.java @@ -32,4 +32,6 @@ public interface ICompeteVedioService { PageInfo selectCompanySignStatus(QueryDto params); PageInfo selectCoachSignStatus(QueryDto params); + + void saveSpeedVideo(VideoDto.SpeedVideoInfo param, Long userId); } diff --git a/mt/src/main/resources/druid-prod.yml b/mt/src/main/resources/druid-prod.yml index 56cd9c56..b92b92fe 100644 --- a/mt/src/main/resources/druid-prod.yml +++ b/mt/src/main/resources/druid-prod.yml @@ -27,7 +27,7 @@ spring: testOnReturn: false testWhileIdle: true timeBetweenEvictionRunsMillis: 60000 - url: jdbc:mysql://127.0.0.1/mt?useUnicode=true&characterEncoding=UTF-8 + url: jdbc:mysql://127.0.0.1/mt?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true username: root validationQuery: SELECT 1 FROM DUAL env: CCSENS_GAME \ No newline at end of file diff --git a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml index 06254cf1..19923ae3 100644 --- a/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml +++ b/mt/src/main/resources/mapper_dao/CompeteScoreDao.xml @@ -778,19 +778,217 @@ group by startOrder.id + select + + distinct + + + from t_compete_speed_video + + + + + order by ${orderByClause} + + + + + delete from t_compete_speed_video + where id = #{id,jdbcType=BIGINT} + + + delete from t_compete_speed_video + + + + + + insert into t_compete_speed_video (id, company_id, company_name, + player_name, user_id, video_url_one, + video_url_two, created_at, updated_at, + rec_status) + values (#{id,jdbcType=BIGINT}, #{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, + #{playerName,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, #{videoUrlOne,jdbcType=VARCHAR}, + #{videoUrlTwo,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, + #{recStatus,jdbcType=TINYINT}) + + + insert into t_compete_speed_video + + + id, + + + company_id, + + + company_name, + + + player_name, + + + user_id, + + + video_url_one, + + + video_url_two, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{companyId,jdbcType=BIGINT}, + + + #{companyName,jdbcType=VARCHAR}, + + + #{playerName,jdbcType=VARCHAR}, + + + #{userId,jdbcType=BIGINT}, + + + #{videoUrlOne,jdbcType=VARCHAR}, + + + #{videoUrlTwo,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_compete_speed_video + + + id = #{record.id,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + company_name = #{record.companyName,jdbcType=VARCHAR}, + + + player_name = #{record.playerName,jdbcType=VARCHAR}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + video_url_one = #{record.videoUrlOne,jdbcType=VARCHAR}, + + + video_url_two = #{record.videoUrlTwo,jdbcType=VARCHAR}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_compete_speed_video + set id = #{record.id,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + company_name = #{record.companyName,jdbcType=VARCHAR}, + player_name = #{record.playerName,jdbcType=VARCHAR}, + user_id = #{record.userId,jdbcType=BIGINT}, + video_url_one = #{record.videoUrlOne,jdbcType=VARCHAR}, + video_url_two = #{record.videoUrlTwo,jdbcType=VARCHAR}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_compete_speed_video + + + company_id = #{companyId,jdbcType=BIGINT}, + + + company_name = #{companyName,jdbcType=VARCHAR}, + + + player_name = #{playerName,jdbcType=VARCHAR}, + + + user_id = #{userId,jdbcType=BIGINT}, + + + video_url_one = #{videoUrlOne,jdbcType=VARCHAR}, + + + video_url_two = #{videoUrlTwo,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_compete_speed_video + set company_id = #{companyId,jdbcType=BIGINT}, + company_name = #{companyName,jdbcType=VARCHAR}, + player_name = #{playerName,jdbcType=VARCHAR}, + user_id = #{userId,jdbcType=BIGINT}, + video_url_one = #{videoUrlOne,jdbcType=VARCHAR}, + video_url_two = #{videoUrlTwo,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/tall/src/main/resources/mapper_dao/SysUserDao.xml b/tall/src/main/resources/mapper_dao/SysUserDao.xml index 75854f37..d917ade3 100644 --- a/tall/src/main/resources/mapper_dao/SysUserDao.xml +++ b/tall/src/main/resources/mapper_dao/SysUserDao.xml @@ -145,8 +145,8 @@ + select + + distinct + + + from t_first_aid + + + + + order by ${orderByClause} + + + + + delete from t_first_aid + where id = #{id,jdbcType=BIGINT} + + + delete from t_first_aid + + + + + + insert into t_first_aid (id, car_id, beginTime, + endTime, created_at, updated_at, + rec_status) + values (#{id,jdbcType=BIGINT}, #{carId,jdbcType=BIGINT}, #{begintime,jdbcType=BIGINT}, + #{endtime,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, + #{recStatus,jdbcType=TINYINT}) + + + insert into t_first_aid + + + id, + + + car_id, + + + beginTime, + + + endTime, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{carId,jdbcType=BIGINT}, + + + #{begintime,jdbcType=BIGINT}, + + + #{endtime,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_first_aid + + + id = #{record.id,jdbcType=BIGINT}, + + + car_id = #{record.carId,jdbcType=BIGINT}, + + + beginTime = #{record.begintime,jdbcType=BIGINT}, + + + endTime = #{record.endtime,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_first_aid + set id = #{record.id,jdbcType=BIGINT}, + car_id = #{record.carId,jdbcType=BIGINT}, + beginTime = #{record.begintime,jdbcType=BIGINT}, + endTime = #{record.endtime,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_first_aid + + + car_id = #{carId,jdbcType=BIGINT}, + + + beginTime = #{begintime,jdbcType=BIGINT}, + + + endTime = #{endtime,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_first_aid + set car_id = #{carId,jdbcType=BIGINT}, + beginTime = #{begintime,jdbcType=BIGINT}, + endTime = #{endtime,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/wisdomcar/src/main/resources/mapper_raw/FirstAidRecordMapper.xml b/wisdomcar/src/main/resources/mapper_raw/FirstAidRecordMapper.xml new file mode 100644 index 00000000..810bbf11 --- /dev/null +++ b/wisdomcar/src/main/resources/mapper_raw/FirstAidRecordMapper.xml @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, first_aid_id, type, value, beginTime, endTime, created_at, updated_at, rec_status + + + + + delete from t_first_aid_record + where id = #{id,jdbcType=BIGINT} + + + delete from t_first_aid_record + + + + + + insert into t_first_aid_record (id, first_aid_id, type, + value, beginTime, endTime, + created_at, updated_at, rec_status + ) + values (#{id,jdbcType=BIGINT}, #{firstAidId,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, + #{value,jdbcType=VARCHAR}, #{begintime,jdbcType=BIGINT}, #{endtime,jdbcType=BIGINT}, + #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} + ) + + + insert into t_first_aid_record + + + id, + + + first_aid_id, + + + type, + + + value, + + + beginTime, + + + endTime, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{firstAidId,jdbcType=BIGINT}, + + + #{type,jdbcType=TINYINT}, + + + #{value,jdbcType=VARCHAR}, + + + #{begintime,jdbcType=BIGINT}, + + + #{endtime,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_first_aid_record + + + id = #{record.id,jdbcType=BIGINT}, + + + first_aid_id = #{record.firstAidId,jdbcType=BIGINT}, + + + type = #{record.type,jdbcType=TINYINT}, + + + value = #{record.value,jdbcType=VARCHAR}, + + + beginTime = #{record.begintime,jdbcType=BIGINT}, + + + endTime = #{record.endtime,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_first_aid_record + set id = #{record.id,jdbcType=BIGINT}, + first_aid_id = #{record.firstAidId,jdbcType=BIGINT}, + type = #{record.type,jdbcType=TINYINT}, + value = #{record.value,jdbcType=VARCHAR}, + beginTime = #{record.begintime,jdbcType=BIGINT}, + endTime = #{record.endtime,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_first_aid_record + + + first_aid_id = #{firstAidId,jdbcType=BIGINT}, + + + type = #{type,jdbcType=TINYINT}, + + + value = #{value,jdbcType=VARCHAR}, + + + beginTime = #{begintime,jdbcType=BIGINT}, + + + endTime = #{endtime,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_first_aid_record + set first_aid_id = #{firstAidId,jdbcType=BIGINT}, + type = #{type,jdbcType=TINYINT}, + value = #{value,jdbcType=VARCHAR}, + beginTime = #{begintime,jdbcType=BIGINT}, + endTime = #{endtime,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/wisdomcar/src/main/resources/mapper_raw/FirstAidStandardMapper.xml b/wisdomcar/src/main/resources/mapper_raw/FirstAidStandardMapper.xml new file mode 100644 index 00000000..8686a2e3 --- /dev/null +++ b/wisdomcar/src/main/resources/mapper_raw/FirstAidStandardMapper.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, type, hospital_id, step, duration, created_at, updated_at, rec_status + + + + + delete from t_first_aid_standard + where id = #{id,jdbcType=BIGINT} + + + delete from t_first_aid_standard + + + + + + insert into t_first_aid_standard (id, type, hospital_id, + step, duration, created_at, + updated_at, rec_status) + values (#{id,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, #{hospitalId,jdbcType=BIGINT}, + #{step,jdbcType=TINYINT}, #{duration,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, + #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) + + + insert into t_first_aid_standard + + + id, + + + type, + + + hospital_id, + + + step, + + + duration, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{type,jdbcType=TINYINT}, + + + #{hospitalId,jdbcType=BIGINT}, + + + #{step,jdbcType=TINYINT}, + + + #{duration,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_first_aid_standard + + + id = #{record.id,jdbcType=BIGINT}, + + + type = #{record.type,jdbcType=TINYINT}, + + + hospital_id = #{record.hospitalId,jdbcType=BIGINT}, + + + step = #{record.step,jdbcType=TINYINT}, + + + duration = #{record.duration,jdbcType=VARCHAR}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_first_aid_standard + set id = #{record.id,jdbcType=BIGINT}, + type = #{record.type,jdbcType=TINYINT}, + hospital_id = #{record.hospitalId,jdbcType=BIGINT}, + step = #{record.step,jdbcType=TINYINT}, + duration = #{record.duration,jdbcType=VARCHAR}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_first_aid_standard + + + type = #{type,jdbcType=TINYINT}, + + + hospital_id = #{hospitalId,jdbcType=BIGINT}, + + + step = #{step,jdbcType=TINYINT}, + + + duration = #{duration,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_first_aid_standard + set type = #{type,jdbcType=TINYINT}, + hospital_id = #{hospitalId,jdbcType=BIGINT}, + step = #{step,jdbcType=TINYINT}, + duration = #{duration,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/wisdomcar/src/main/resources/mapper_raw/RfidMapper.xml b/wisdomcar/src/main/resources/mapper_raw/RfidMapper.xml new file mode 100644 index 00000000..cef7a186 --- /dev/null +++ b/wisdomcar/src/main/resources/mapper_raw/RfidMapper.xml @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, rfid, type, name, step, hospital_id, created_at, updated_at, rec_status + + + + + delete from t_rfid + where id = #{id,jdbcType=BIGINT} + + + delete from t_rfid + + + + + + insert into t_rfid (id, rfid, type, + name, step, hospital_id, + created_at, updated_at, rec_status + ) + values (#{id,jdbcType=BIGINT}, #{rfid,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, + #{name,jdbcType=VARCHAR}, #{step,jdbcType=TINYINT}, #{hospitalId,jdbcType=BIGINT}, + #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} + ) + + + insert into t_rfid + + + id, + + + rfid, + + + type, + + + name, + + + step, + + + hospital_id, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{rfid,jdbcType=VARCHAR}, + + + #{type,jdbcType=TINYINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{step,jdbcType=TINYINT}, + + + #{hospitalId,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_rfid + + + id = #{record.id,jdbcType=BIGINT}, + + + rfid = #{record.rfid,jdbcType=VARCHAR}, + + + type = #{record.type,jdbcType=TINYINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + step = #{record.step,jdbcType=TINYINT}, + + + hospital_id = #{record.hospitalId,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_rfid + set id = #{record.id,jdbcType=BIGINT}, + rfid = #{record.rfid,jdbcType=VARCHAR}, + type = #{record.type,jdbcType=TINYINT}, + name = #{record.name,jdbcType=VARCHAR}, + step = #{record.step,jdbcType=TINYINT}, + hospital_id = #{record.hospitalId,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_rfid + + + rfid = #{rfid,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=TINYINT}, + + + name = #{name,jdbcType=VARCHAR}, + + + step = #{step,jdbcType=TINYINT}, + + + hospital_id = #{hospitalId,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_rfid + set rfid = #{rfid,jdbcType=VARCHAR}, + type = #{type,jdbcType=TINYINT}, + name = #{name,jdbcType=VARCHAR}, + step = #{step,jdbcType=TINYINT}, + hospital_id = #{hospitalId,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/wisdomcar/src/main/resources/mapper_raw/ScreenMapper.xml b/wisdomcar/src/main/resources/mapper_raw/ScreenMapper.xml new file mode 100644 index 00000000..5fbdd161 --- /dev/null +++ b/wisdomcar/src/main/resources/mapper_raw/ScreenMapper.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, name, hospital_id, created_at, updated_at, rec_status + + + + + delete from t_screen + where id = #{id,jdbcType=BIGINT} + + + delete from t_screen + + + + + + insert into t_screen (id, name, hospital_id, + created_at, updated_at, rec_status + ) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{hospitalId,jdbcType=BIGINT}, + #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} + ) + + + insert into t_screen + + + id, + + + name, + + + hospital_id, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{hospitalId,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_screen + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + hospital_id = #{record.hospitalId,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_screen + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + hospital_id = #{record.hospitalId,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_screen + + + name = #{name,jdbcType=VARCHAR}, + + + hospital_id = #{hospitalId,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_screen + set name = #{name,jdbcType=VARCHAR}, + hospital_id = #{hospitalId,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/wisdomcar/src/main/resources/mapper_raw/WisdomCarMapper.xml b/wisdomcar/src/main/resources/mapper_raw/WisdomCarMapper.xml new file mode 100644 index 00000000..6ca91ee4 --- /dev/null +++ b/wisdomcar/src/main/resources/mapper_raw/WisdomCarMapper.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, car_number, time, hospital_id, screen_id, created_at, updated_at, rec_status + + + + + delete from t_wisdom_car + where id = #{id,jdbcType=BIGINT} + + + delete from t_wisdom_car + + + + + + insert into t_wisdom_car (id, car_number, time, + hospital_id, screen_id, created_at, + updated_at, rec_status) + values (#{id,jdbcType=BIGINT}, #{carNumber,jdbcType=VARCHAR}, #{time,jdbcType=BIGINT}, + #{hospitalId,jdbcType=BIGINT}, #{screenId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, + #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) + + + insert into t_wisdom_car + + + id, + + + car_number, + + + time, + + + hospital_id, + + + screen_id, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{carNumber,jdbcType=VARCHAR}, + + + #{time,jdbcType=BIGINT}, + + + #{hospitalId,jdbcType=BIGINT}, + + + #{screenId,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_wisdom_car + + + id = #{record.id,jdbcType=BIGINT}, + + + car_number = #{record.carNumber,jdbcType=VARCHAR}, + + + time = #{record.time,jdbcType=BIGINT}, + + + hospital_id = #{record.hospitalId,jdbcType=BIGINT}, + + + screen_id = #{record.screenId,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_wisdom_car + set id = #{record.id,jdbcType=BIGINT}, + car_number = #{record.carNumber,jdbcType=VARCHAR}, + time = #{record.time,jdbcType=BIGINT}, + hospital_id = #{record.hospitalId,jdbcType=BIGINT}, + screen_id = #{record.screenId,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_wisdom_car + + + car_number = #{carNumber,jdbcType=VARCHAR}, + + + time = #{time,jdbcType=BIGINT}, + + + hospital_id = #{hospitalId,jdbcType=BIGINT}, + + + screen_id = #{screenId,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_wisdom_car + set car_number = #{carNumber,jdbcType=VARCHAR}, + time = #{time,jdbcType=BIGINT}, + hospital_id = #{hospitalId,jdbcType=BIGINT}, + screen_id = #{screenId,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/wisdomcar/src/main/resources/mapper_raw/WisdomCarRecordMapper.xml b/wisdomcar/src/main/resources/mapper_raw/WisdomCarRecordMapper.xml new file mode 100644 index 00000000..2931a223 --- /dev/null +++ b/wisdomcar/src/main/resources/mapper_raw/WisdomCarRecordMapper.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, car_id, type, value, time, created_at, updated_at, rec_status + + + + + delete from t_wisdom_car_record + where id = #{id,jdbcType=BIGINT} + + + delete from t_wisdom_car_record + + + + + + insert into t_wisdom_car_record (id, car_id, type, + value, time, created_at, + updated_at, rec_status) + values (#{id,jdbcType=BIGINT}, #{carId,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, + #{value,jdbcType=VARCHAR}, #{time,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, + #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) + + + insert into t_wisdom_car_record + + + id, + + + car_id, + + + type, + + + value, + + + time, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{carId,jdbcType=BIGINT}, + + + #{type,jdbcType=TINYINT}, + + + #{value,jdbcType=VARCHAR}, + + + #{time,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_wisdom_car_record + + + id = #{record.id,jdbcType=BIGINT}, + + + car_id = #{record.carId,jdbcType=BIGINT}, + + + type = #{record.type,jdbcType=TINYINT}, + + + value = #{record.value,jdbcType=VARCHAR}, + + + time = #{record.time,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_wisdom_car_record + set id = #{record.id,jdbcType=BIGINT}, + car_id = #{record.carId,jdbcType=BIGINT}, + type = #{record.type,jdbcType=TINYINT}, + value = #{record.value,jdbcType=VARCHAR}, + time = #{record.time,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_wisdom_car_record + + + car_id = #{carId,jdbcType=BIGINT}, + + + type = #{type,jdbcType=TINYINT}, + + + value = #{value,jdbcType=VARCHAR}, + + + time = #{time,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_wisdom_car_record + set car_id = #{carId,jdbcType=BIGINT}, + type = #{type,jdbcType=TINYINT}, + value = #{value,jdbcType=VARCHAR}, + time = #{time,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/wisdomcar/src/main/resources/mybatis/mybatis-config.xml b/wisdomcar/src/main/resources/mybatis/mybatis-config.xml new file mode 100644 index 00000000..e5a218dd --- /dev/null +++ b/wisdomcar/src/main/resources/mybatis/mybatis-config.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From e37ecd5da88fc14aed274580713ed8ceaed6b388 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Mon, 14 Dec 2020 09:58:31 +0800 Subject: [PATCH 30/33] =?UTF-8?q?20201214=E6=8B=86=E5=88=86=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 1 + signin/.gitignore | 33 + signin/mvnw | 322 ++++ signin/mvnw.cmd | 182 ++ signin/pom.xml | 69 + .../com/ccsens/signin/SigninApplication.java | 24 + .../ccsens/signin/api/DebugController.java | 29 + .../com/ccsens/signin/api/UserController.java | 478 +++++ .../ccsens/signin/api/UserInfoController.java | 89 + .../com/ccsens/signin/bean/dto/UserDto.java | 214 +++ .../com/ccsens/signin/bean/po/SysAuth.java | 128 ++ .../ccsens/signin/bean/po/SysAuthExample.java | 831 +++++++++ .../com/ccsens/signin/bean/po/SysUser.java | 205 +++ .../ccsens/signin/bean/po/SysUserExample.java | 1311 +++++++++++++ .../ccsens/signin/bean/po/SysUserInfo.java | 150 ++ .../signin/bean/po/SysUserInfoExample.java | 991 ++++++++++ .../com/ccsens/signin/bean/vo/UserVo.java | 165 ++ .../com/ccsens/signin/config/BeanConfig.java | 31 + .../ccsens/signin/config/SpringConfig.java | 169 ++ .../signin/config/SwaggerConfigure.java | 56 + .../exception/GetCurrentPartiException.java | 10 + .../exception/GetCurrentUserException.java | 11 + .../signin/exception/GetTaskException.java | 10 + .../signin/exception/PartiLoginException.java | 10 + .../ccsens/signin/exception/SmsException.java | 17 + .../exception/TaskValidateException.java | 10 + .../exception/UnAuthenticationException.java | 10 + .../exception/UnAuthorizationException.java | 10 + .../signin/exception/UserLoginException.java | 10 + .../signin/intercept/MybatisInterceptor.java | 159 ++ .../ccsens/signin/persist/dao/SysAuthDao.java | 18 + .../ccsens/signin/persist/dao/SysUserDao.java | 65 + .../signin/persist/dao/SysUserInfoDao.java | 8 + .../signin/persist/mapper/SysAuthMapper.java | 30 + .../persist/mapper/SysUserInfoMapper.java | 30 + .../signin/persist/mapper/SysUserMapper.java | 30 + .../signin/service/IUserInfoService.java | 48 + .../ccsens/signin/service/IUserService.java | 110 ++ .../signin/service/UserInfoService.java | 258 +++ .../ccsens/signin/service/UserService.java | 1621 +++++++++++++++++ .../com/ccsens/signin/util/TallConstant.java | 55 + .../ccsens/signin/util/WxTemplateUtil.java | 168 ++ .../src/main/resources/application-common.yml | 28 + signin/src/main/resources/application-dev.yml | 41 + .../src/main/resources/application-prod.yml | 48 + .../src/main/resources/application-test.yml | 51 + signin/src/main/resources/application.yml | 5 + signin/src/main/resources/business.yml | 9 + signin/src/main/resources/druid-dev.yml | 34 + signin/src/main/resources/druid-prod.yml | 34 + signin/src/main/resources/druid-test.yml | 35 + signin/src/main/resources/logback-spring.xml | 196 ++ .../main/resources/mapper_dao/SysAuthDao.xml | 15 + .../main/resources/mapper_dao/SysUserDao.xml | 201 ++ .../resources/mapper_raw/SysAuthMapper.xml | 291 +++ .../mapper_raw/SysUserInfoMapper.xml | 323 ++++ .../resources/mapper_raw/SysUserMapper.xml | 400 ++++ .../main/resources/mybatis/mybatis-config.xml | 62 + .../java/com/ccsens/tall/TallApplication.java | 1 - 59 files changed, 9949 insertions(+), 1 deletion(-) create mode 100644 signin/.gitignore create mode 100644 signin/mvnw create mode 100644 signin/mvnw.cmd create mode 100644 signin/pom.xml create mode 100644 signin/src/main/java/com/ccsens/signin/SigninApplication.java create mode 100644 signin/src/main/java/com/ccsens/signin/api/DebugController.java create mode 100644 signin/src/main/java/com/ccsens/signin/api/UserController.java create mode 100644 signin/src/main/java/com/ccsens/signin/api/UserInfoController.java create mode 100644 signin/src/main/java/com/ccsens/signin/bean/dto/UserDto.java create mode 100644 signin/src/main/java/com/ccsens/signin/bean/po/SysAuth.java create mode 100644 signin/src/main/java/com/ccsens/signin/bean/po/SysAuthExample.java create mode 100644 signin/src/main/java/com/ccsens/signin/bean/po/SysUser.java create mode 100644 signin/src/main/java/com/ccsens/signin/bean/po/SysUserExample.java create mode 100644 signin/src/main/java/com/ccsens/signin/bean/po/SysUserInfo.java create mode 100644 signin/src/main/java/com/ccsens/signin/bean/po/SysUserInfoExample.java create mode 100644 signin/src/main/java/com/ccsens/signin/bean/vo/UserVo.java create mode 100644 signin/src/main/java/com/ccsens/signin/config/BeanConfig.java create mode 100644 signin/src/main/java/com/ccsens/signin/config/SpringConfig.java create mode 100644 signin/src/main/java/com/ccsens/signin/config/SwaggerConfigure.java create mode 100644 signin/src/main/java/com/ccsens/signin/exception/GetCurrentPartiException.java create mode 100644 signin/src/main/java/com/ccsens/signin/exception/GetCurrentUserException.java create mode 100644 signin/src/main/java/com/ccsens/signin/exception/GetTaskException.java create mode 100644 signin/src/main/java/com/ccsens/signin/exception/PartiLoginException.java create mode 100644 signin/src/main/java/com/ccsens/signin/exception/SmsException.java create mode 100644 signin/src/main/java/com/ccsens/signin/exception/TaskValidateException.java create mode 100644 signin/src/main/java/com/ccsens/signin/exception/UnAuthenticationException.java create mode 100644 signin/src/main/java/com/ccsens/signin/exception/UnAuthorizationException.java create mode 100644 signin/src/main/java/com/ccsens/signin/exception/UserLoginException.java create mode 100644 signin/src/main/java/com/ccsens/signin/intercept/MybatisInterceptor.java create mode 100644 signin/src/main/java/com/ccsens/signin/persist/dao/SysAuthDao.java create mode 100644 signin/src/main/java/com/ccsens/signin/persist/dao/SysUserDao.java create mode 100644 signin/src/main/java/com/ccsens/signin/persist/dao/SysUserInfoDao.java create mode 100644 signin/src/main/java/com/ccsens/signin/persist/mapper/SysAuthMapper.java create mode 100644 signin/src/main/java/com/ccsens/signin/persist/mapper/SysUserInfoMapper.java create mode 100644 signin/src/main/java/com/ccsens/signin/persist/mapper/SysUserMapper.java create mode 100644 signin/src/main/java/com/ccsens/signin/service/IUserInfoService.java create mode 100644 signin/src/main/java/com/ccsens/signin/service/IUserService.java create mode 100644 signin/src/main/java/com/ccsens/signin/service/UserInfoService.java create mode 100644 signin/src/main/java/com/ccsens/signin/service/UserService.java create mode 100644 signin/src/main/java/com/ccsens/signin/util/TallConstant.java create mode 100644 signin/src/main/java/com/ccsens/signin/util/WxTemplateUtil.java create mode 100644 signin/src/main/resources/application-common.yml create mode 100644 signin/src/main/resources/application-dev.yml create mode 100644 signin/src/main/resources/application-prod.yml create mode 100644 signin/src/main/resources/application-test.yml create mode 100644 signin/src/main/resources/application.yml create mode 100644 signin/src/main/resources/business.yml create mode 100644 signin/src/main/resources/druid-dev.yml create mode 100644 signin/src/main/resources/druid-prod.yml create mode 100644 signin/src/main/resources/druid-test.yml create mode 100644 signin/src/main/resources/logback-spring.xml create mode 100644 signin/src/main/resources/mapper_dao/SysAuthDao.xml create mode 100644 signin/src/main/resources/mapper_dao/SysUserDao.xml create mode 100644 signin/src/main/resources/mapper_raw/SysAuthMapper.xml create mode 100644 signin/src/main/resources/mapper_raw/SysUserInfoMapper.xml create mode 100644 signin/src/main/resources/mapper_raw/SysUserMapper.xml create mode 100644 signin/src/main/resources/mybatis/mybatis-config.xml diff --git a/pom.xml b/pom.xml index fc2c6879..cb73d361 100644 --- a/pom.xml +++ b/pom.xml @@ -13,6 +13,7 @@ game mt wisdomcar + signin diff --git a/signin/.gitignore b/signin/.gitignore new file mode 100644 index 00000000..549e00a2 --- /dev/null +++ b/signin/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/signin/mvnw b/signin/mvnw new file mode 100644 index 00000000..3c8a5537 --- /dev/null +++ b/signin/mvnw @@ -0,0 +1,322 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ]; then + + if [ -f /etc/mavenrc ]; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ]; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false +darwin=false +mingw=false +case "$(uname)" in +CYGWIN*) cygwin=true ;; +MINGW*) mingw=true ;; +Darwin*) + darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="$(/usr/libexec/java_home)" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ]; then + if [ -r /etc/gentoo-release ]; then + JAVA_HOME=$(java-config --jre-home) + fi +fi + +if [ -z "$M2_HOME" ]; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ]; do + ls=$(ls -ld "$PRG") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' >/dev/null; then + PRG="$link" + else + PRG="$(dirname "$PRG")/$link" + fi + done + + saveddir=$(pwd) + + M2_HOME=$(dirname "$PRG")/.. + + # make it fully qualified + M2_HOME=$(cd "$M2_HOME" && pwd) + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=$(cygpath --unix "$M2_HOME") + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --unix "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --unix "$CLASSPATH") +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw; then + [ -n "$M2_HOME" ] && + M2_HOME="$( ( + cd "$M2_HOME" + pwd + ))" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="$( ( + cd "$JAVA_HOME" + pwd + ))" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="$(which javac)" + if [ -n "$javaExecutable" ] && ! [ "$(expr \"$javaExecutable\" : '\([^ ]*\)')" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=$(which readlink) + if [ ! $(expr "$readLink" : '\([^ ]*\)') = "no" ]; then + if $darwin; then + javaHome="$(dirname \"$javaExecutable\")" + javaExecutable="$(cd \"$javaHome\" && pwd -P)/javac" + else + javaExecutable="$(readlink -f \"$javaExecutable\")" + fi + javaHome="$(dirname \"$javaExecutable\")" + javaHome=$(expr "$javaHome" : '\(.*\)/bin') + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ]; then + if [ -n "$JAVA_HOME" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="$(which java)" + fi +fi + +if [ ! -x "$JAVACMD" ]; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ]; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ]; then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ]; do + if [ -d "$wdir"/.mvn ]; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=$( + cd "$wdir/.." + pwd + ) + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' <"$1")" + fi +} + +BASE_DIR=$(find_maven_basedir "$(pwd)") +if [ -z "$BASE_DIR" ]; then + exit 1 +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in wrapperUrl) + jarUrl="$value" + break + ;; + esac + done <"$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") + fi + + if command -v wget >/dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl >/dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=$(cygpath --path --windows "$javaClass") + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=$(cygpath --path --windows "$M2_HOME") + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --windows "$CLASSPATH") + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/signin/mvnw.cmd b/signin/mvnw.cmd new file mode 100644 index 00000000..c8d43372 --- /dev/null +++ b/signin/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/signin/pom.xml b/signin/pom.xml new file mode 100644 index 00000000..392f33fd --- /dev/null +++ b/signin/pom.xml @@ -0,0 +1,69 @@ + + + + ccsenscloud + com.ccsens + 1.0-SNAPSHOT + + 4.0.0 + + signin + + 1.8 + + + + + + cloudutil + com.ccsens + 1.0-SNAPSHOT + + + + util + com.ccsens + 1.0-SNAPSHOT + + + + + + + + org.mybatis.generator + mybatis-generator-maven-plugin + 1.3.7 + + ${basedir}/src/main/resources/mbg.xml + true + + + + mysql + mysql-connector-java + 5.1.34 + + + + + org.springframework.boot + spring-boot-maven-plugin + + com.ccsens.signin.SigninApplication + + + + + + repackage + + + + + + + + + diff --git a/signin/src/main/java/com/ccsens/signin/SigninApplication.java b/signin/src/main/java/com/ccsens/signin/SigninApplication.java new file mode 100644 index 00000000..8c47efb2 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/SigninApplication.java @@ -0,0 +1,24 @@ +package com.ccsens.signin; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.scheduling.annotation.EnableAsync; + +@MapperScan(basePackages = {"com.ccsens.signin.persist.*"}) +@ServletComponentScan +@EnableAsync +//开启断路器功能 +@EnableCircuitBreaker +@EnableFeignClients(basePackages = "com.ccsens.cloudutil.feign") +@SpringBootApplication(scanBasePackages = "com.ccsens") +public class SigninApplication { + + public static void main(String[] args) { + SpringApplication.run(SigninApplication.class, args); + } + +} diff --git a/signin/src/main/java/com/ccsens/signin/api/DebugController.java b/signin/src/main/java/com/ccsens/signin/api/DebugController.java new file mode 100644 index 00000000..846d1f23 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/api/DebugController.java @@ -0,0 +1,29 @@ +package com.ccsens.wisdomcar.api; + +import com.ccsens.util.JsonResponse; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; + +@Api(tags = "DEBUG" , description = "DebugController | ") +@RestController +@RequestMapping("/debug") +@Slf4j +public class DebugController { + + @ApiOperation(value = "/测试",notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) + public JsonResponse debug(HttpServletRequest request) throws Exception { + + return JsonResponse.newInstance().ok("测试"); + } + +} diff --git a/signin/src/main/java/com/ccsens/signin/api/UserController.java b/signin/src/main/java/com/ccsens/signin/api/UserController.java new file mode 100644 index 00000000..6955b390 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/api/UserController.java @@ -0,0 +1,478 @@ +package com.ccsens.signin.api; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.extra.servlet.ServletUtil; +import com.ccsens.signin.bean.dto.UserDto; +import com.ccsens.signin.bean.vo.UserVo; +import com.ccsens.signin.exception.UserLoginException; +import com.ccsens.signin.service.IUserService; +import com.ccsens.util.CodeEnum; +import com.ccsens.util.JsonResponse; +import com.ccsens.util.JwtUtil; +import com.ccsens.util.WebConstant; +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.ExpiredJwtException; +import io.jsonwebtoken.SignatureException; +import io.swagger.annotations.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +@Slf4j +@Api(tags = "用户相关操作API", description = "UserController | 用户操作控制器类") +@RestController +@RequestMapping("/users") +public class UserController { + @Autowired + private IUserService userService; + +// @Autowired +// private IProMemberService proMemberService; + + + @ApiOperation(value = "/用户登录", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/signin", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse userSignin(HttpServletRequest request, + @ApiParam @Validated @RequestBody(required = true) UserDto.UserSginin dto) throws Exception { + log.info("开始登陆:{}",dto); + Long start = System.currentTimeMillis(); + WebConstant.CLIENT_TYPE clientType = WebConstant.CLIENT_TYPE.valueOf(dto.getClient()); + WebConstant.IDENTIFY_TYPE identify_type = WebConstant.IDENTIFY_TYPE.valueOf(dto.getType()); + String identifier = dto.getData().getIdentifier(); + String credential = dto.getData().getCredential(); + + //1.验证参数 + switch (clientType) { + + case Wxmp: + case H5: + case Android: + case IOS: + case WxEnterprise: + break; + default: + throw new UserLoginException(-1, String.format("Not supported client type: %1$d(%2$s)", + clientType.value, clientType)); + } + log.info("登录场景"); + switch (identify_type) { + case WxEnterprise: + case Wxmp: + case OAUTH2_Wx: + case Wx_H5: + case OAUTH2_WeiBo: { + break; + } + case Phone: + case Email: + case Account: { + if (StrUtil.isEmpty(credential)) { + String msg = "credential is required when type is %1$d(%2$s)"; + throw new UserLoginException(-2, String.format(msg, identify_type.value, identify_type.phase)); + } + break; + } + default: { + throw new UserLoginException(-2, String.format("Not supported signin type: %1$d(%2$s)", + identify_type.value, identify_type.phase)); + } + } + log.info("登录方式"); + //2.调用业务方法(注册/添加登陆记录) + UserVo.UserSign userSignVo = userService.signin( + clientType, identify_type, identifier, credential, + ServletUtil.getClientIP(request), dto.getRedirect()); + + //3.生成token(access_token,refresh_token) + if (ObjectUtil.isNotNull(userSignVo)) { + Map theMap = CollectionUtil.newHashMap(); + theMap.put("authId", String.valueOf(userSignVo.getAuthId())); + UserVo.TokenBean tokenBean = userService.getUserInfoAndToken(clientType, identify_type,userSignVo, theMap); + + Long end = System.currentTimeMillis(); + log.info("本次登录使用了{}毫秒",end - start); + log.info("登录返回:{}",tokenBean); + return JsonResponse.newInstance().ok(tokenBean); + } else { + return JsonResponse.newInstance().fail("登陆信息不正确."); + } + } + + @ApiOperation(value = "/发送验证码", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/smscode", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) + public JsonResponse getSmsCode(HttpServletRequest request, + @ApiParam @RequestParam String phone, +// @ApiParam Integer client, + @RequestParam(required = true) String verificationCodeId, String verificationCodeValue) throws Exception { + log.info("发送验证码,手机号:{},图形验证码id:{},值:{}",phone,verificationCodeId,verificationCodeValue); + UserVo.SmsCode smsCodeVo = userService.getSignInSmsCode(phone,verificationCodeId,verificationCodeValue); + + return JsonResponse.newInstance().ok(smsCodeVo); + } + + @ApiOperation(value = "/注册", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/signup", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse registerUser(HttpServletRequest request, + @ApiParam @Validated @RequestBody(required = true) UserDto.UserSignup userSignup) throws Exception { + + UserVo.UserSign userSignVo = userService.registerUser(userSignup); + //3.生成token(access_token,refresh_token) + if (ObjectUtil.isNotNull(userSignVo)) { + WebConstant.CLIENT_TYPE clientType = WebConstant.CLIENT_TYPE.valueOf(1); + WebConstant.IDENTIFY_TYPE identifyType = WebConstant.IDENTIFY_TYPE.valueOf(3); + + Map theMap = CollectionUtil.newHashMap(); + theMap.put("authId", String.valueOf(userSignVo.getAuthId())); + UserVo.TokenBean tokenBean = userService.getUserInfoAndToken(clientType, identifyType,userSignVo, theMap); + + return JsonResponse.newInstance().ok(tokenBean); + } else { + return JsonResponse.newInstance().fail("登陆信息不正确."); + } + } + + @ApiOperation(value = "/注册(不需要手机号)", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/signup/system", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse systemRegister(HttpServletRequest request, + @ApiParam @Validated @RequestBody(required = true) UserDto.UserSignupSystem userSignup) throws Exception { + + UserVo.Account account = userService.systemRegister(userSignup); + return JsonResponse.newInstance().ok(account); + } + + @ApiOperation(value = "/检查账号是否被注册", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/account", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) + public JsonResponse accounts(@ApiParam @RequestParam String account) throws Exception { + + Boolean flag = userService.findAccount(account); + return JsonResponse.newInstance().ok(flag); + } + + + @ApiOperation(value = "/检查手机号是否被注册", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/phone", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) + public JsonResponse findPhone(@ApiParam @RequestParam String phone) throws Exception { + + Boolean flag = userService.findPhone(phone); + return JsonResponse.newInstance().ok(flag); + } + +// @ApiOperation(value = "/修改账号信息",notes = "") +// @ApiImplicitParams({ +// }) +// @RequestMapping(value="/account",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) +// public JsonResponse updateAccount(HttpServletRequest request,@ApiParam @RequestBody UserDto.Account account) throws Exception { +// userService.updateAccount(account); +// return JsonResponse.newInstance().ok(); +// } + + + @ApiOperation(value = "/微信合并已有账号",notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value="/merge",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) + public JsonResponse bindingPhone(HttpServletRequest request, + @ApiParam @RequestBody UserDto.WxMergePhone wxPhone) throws Exception { + Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); + UserVo.UserSign userSignVo = userService.mergeByPhone(currentUserId,wxPhone); + + UserVo.TokenBean tokenBean = null; + if (ObjectUtil.isNotNull(userSignVo)) { + WebConstant.CLIENT_TYPE clientType = WebConstant.CLIENT_TYPE.valueOf(1); + WebConstant.IDENTIFY_TYPE identifyType = WebConstant.IDENTIFY_TYPE.valueOf(3); + Map theMap = CollectionUtil.newHashMap(); + theMap.put("authId", String.valueOf(userSignVo.getAuthId())); + tokenBean = userService.getUserInfoAndToken(clientType, identifyType,userSignVo, theMap); + } + return JsonResponse.newInstance().ok(tokenBean); + } + + @ApiOperation(value = "/微信绑定账号",notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value="/binding",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) + public JsonResponse bindingPhone(HttpServletRequest request, + @ApiParam @RequestBody UserDto.WxBindingPhone wxPhone) throws Exception { + Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); + UserVo.UserSign userSignVo = userService.bindingNewPhone(currentUserId,wxPhone); + + UserVo.TokenBean tokenBean = null; + if (ObjectUtil.isNotNull(userSignVo)) { + WebConstant.CLIENT_TYPE clientType = WebConstant.CLIENT_TYPE.valueOf(1); + WebConstant.IDENTIFY_TYPE identifyType = WebConstant.IDENTIFY_TYPE.valueOf(3); + Map theMap = CollectionUtil.newHashMap(); + theMap.put("authId", String.valueOf(userSignVo.getAuthId())); + tokenBean = userService.getUserInfoAndToken(clientType,identifyType, userSignVo, theMap); + } + return JsonResponse.newInstance().ok(tokenBean); + } + + @ApiOperation(value = "/更改绑定手机", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/upPhone", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse updatePhone(HttpServletRequest request, + @ApiParam @RequestBody UserDto.UpdatePhone updatePhone) throws Exception { + Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); + userService.updatePhone(currentUserId, updatePhone); + return JsonResponse.newInstance().ok(); + } + + @ApiOperation(value = "/修改用户信息", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/userInfo", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse updateUserInfo(HttpServletRequest request, + @ApiParam @RequestBody UserDto.WxInfo userInfo) throws Exception { + log.info("修改用户信息,{}",userInfo); + Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); + UserVo.WxInfo wxInfo = userService.updateUserInfo(currentUserId, userInfo); + return JsonResponse.newInstance().ok(wxInfo); + } + + @ApiOperation(value = "通过手机号修改密码", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/password", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse updatePassword(HttpServletRequest request, + @ApiParam @Validated @RequestBody UserDto.UpdatePassword passwordDto) throws Exception { + userService.updatePassword(passwordDto); + return JsonResponse.newInstance().ok(); + } + + @ApiOperation(value = "通过账号密码修改密码", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/password/account", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse updatePasswordByAccount(HttpServletRequest request, + @ApiParam @Validated @RequestBody UserDto.UpdatePasswordByAccount passwordDto) throws Exception { + userService.updatePasswordByAccount(passwordDto); + return JsonResponse.newInstance().ok(); + } + + @ApiOperation(value = "解绑手机号", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/relievePhone", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse relievePhone(HttpServletRequest request, + @ApiParam @Validated @RequestBody UserDto.WxBindingPhone phoneInfo) throws Exception { + Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); + userService.relievePhone(currentUserId,phoneInfo); + return JsonResponse.newInstance().ok(); + } + + @ApiOperation(value = "直接更改手机号(不用输入密码)", notes = "") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/changePhone", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse changePhone(HttpServletRequest request, + @ApiParam @Validated @RequestBody UserDto.WxBindingPhone phoneInfo) throws Exception { + Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); + UserVo.UserSign userSignVo = userService.changePhoneNotPassword(currentUserId,phoneInfo); + UserVo.TokenBean tokenBean = null; + if (ObjectUtil.isNotNull(userSignVo)) { + WebConstant.CLIENT_TYPE clientType = WebConstant.CLIENT_TYPE.valueOf(1); + WebConstant.IDENTIFY_TYPE identifyType = WebConstant.IDENTIFY_TYPE.valueOf(3); + Map theMap = CollectionUtil.newHashMap(); + theMap.put("authId", String.valueOf(userSignVo.getAuthId())); + tokenBean = userService.getUserInfoAndToken(clientType, identifyType,userSignVo, theMap); + } + return JsonResponse.newInstance().ok(tokenBean); + } + +// @ApiOperation(value = "查询用户是否关注某个项目",notes = "") +// @ApiImplicitParams({ +// @ApiImplicitParam(name="projectId",value = "projectId",required = true,paramType = "query") +// }) +// @RequestMapping(value = "/attention",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) +// public JsonResponse getIsAttention(HttpServletRequest request, +// @RequestParam(required = true) Long projectId) throws Exception { +// Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); +// +// Boolean isAttention = userService.getIsAttention(currentUserId,projectId); +// return JsonResponse.newInstance().ok(isAttention); +// } + +// @ApiOperation(value = "用户关注项目",notes = "") +// @ApiImplicitParams({ +// @ApiImplicitParam(name="projectId",value = "projectId",required = true,paramType = "query") +// }) +// @RequestMapping(value = "/attention",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"}) +// public JsonResponse userAttentionProject(HttpServletRequest request, +// @ApiParam @Validated @RequestBody ProjectDto.ProjectIdDto projectIdDto) throws Exception { +// Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); +// userService.userAttentionProject(currentUserId,projectIdDto); +// return JsonResponse.newInstance().ok(); +// } + + @ApiOperation(value = "输入两个userid将两个账号合并(保留企业用户的id)",notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(name="userId",value = "需要保留的userId",required = true,paramType = "query"), + @ApiImplicitParam(name="uselessId",value = "不需要保留的userId",required = true,paramType = "query") + }) + @RequestMapping(value = "/mergeUserId",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) + public JsonResponse mergeUserId(HttpServletRequest request, + @RequestParam(required = true) Long userId,Long uselessId) throws Exception { + userService.mergeUserId(userId,uselessId); + return JsonResponse.newInstance().ok(); + } + + + @ApiOperation(value = "通过userId获取token",notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(name="userId",value = "用户id",required = true,paramType = "query") + }) + @RequestMapping(value = "/userId",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) + public JsonResponse getTokenByUserId(HttpServletRequest request, + @RequestParam(required = true) Long userId) throws Exception { + + UserVo.TokenBean tokenBean = userService.getTokenByUserId(userId); + return JsonResponse.newInstance().ok(tokenBean); + } + + + /*===============================================================================================*/ + @ApiOperation(value = "根据token获取userId",notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(name="token",value = "token",required = true,paramType = "query") + }) + @RequestMapping(value = "claims",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) + public String getNodeMessage(@RequestParam(required = true) String token) throws Exception { + log.info("根据token获取userId,token:{}",token); + //验证token是否有效 + String userId = null; + Claims claims = null; + boolean flag = false; + if (token != null) { + try { + claims = JwtUtil.parseJWT(token, WebConstant.JWT_ACCESS_TOKEN_SECERT); + flag = true; + }catch(SignatureException e){ + flag = false; + }catch(ExpiredJwtException e){ + flag = false; + }catch(Exception e){ + e.printStackTrace(); + flag = false; + } + } + if(flag){ + userId = claims.getSubject(); + } + return userId; + } + + + @ApiOperation(value = "根据token字符串获取userId",notes = "") + @ApiImplicitParams({ + @ApiImplicitParam(name="token",value = "token",required = true,paramType = "query") + }) + @RequestMapping(value = "token",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) + public JsonResponse getUserByToken(@RequestParam(required = true) String token) throws Exception { + long start = System.currentTimeMillis(); + UserVo.TokenToUserId tokenToUserId = new UserVo.TokenToUserId(); + + // 验证token是否存在 + String tokenStr = token; + if (tokenStr == null || !tokenStr.startsWith(WebConstant.HEADER_KEY_TOKEN_PREFIX)) { + return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); + } + String userToken = tokenStr.substring(WebConstant.HEADER_KEY_TOKEN_PREFIX.length()); + + //验证token是否有效 + Claims claims = null; + try { + claims = JwtUtil.parseJWT(userToken, WebConstant.JWT_ACCESS_TOKEN_SECERT); + }catch(Exception e){ + return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); + } + //验证用户存根 + if(userService.tokenNotExistInCache(Long.valueOf(claims.getSubject()))){ + return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); + } +// //验证用户是否禁用 +// SysUser user = userService.getUserById(Long.valueOf(claims.getSubject())); +// if(user.getRecStatus() == WebConstant.REC_STATUS.Disabled.value){ +// return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); +// } + + tokenToUserId.setId(Long.valueOf(claims.getSubject())); + long end = System.currentTimeMillis(); + log.info("根据token查找userId用时:{}",end - start); + return JsonResponse.newInstance().ok(tokenToUserId); + } + + +// /** +// * 查询user在项目中的member信息 +// */ +// @RequestMapping(value = "member", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) +// public JsonResponse getMemberByUserIdAndProjectId( Long userId,Long projectId) throws Exception { +// +// MemberVo.MemberInfo memberInfo = proMemberService.getMemberByUserIdAndProjectId(userId,projectId); +// return JsonResponse.newInstance().ok(memberInfo); +// } + + +// /** +// * 查询user在项目中的member信息 +// */ +// @RequestMapping(value = "memberByTask", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) +// public JsonResponse getMemberByUserIdAndTaskId( Long userId,Long taskId) throws Exception { +// log.info("根据任务ID和用户ID查询用户信息:{}-{}", userId, taskId); +// MemberVo.MemberInfo memberInfo = proMemberService.getMemberByUserIdAndTaskId(userId,taskId); +// log.info("用户信息:{}", memberInfo); +// return JsonResponse.newInstance().ok(memberInfo); +// } + +// /** +// * 查询user的信息 +// */ +// @RequestMapping(value = "getUserInfo", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) +// public JsonResponse getUserInfoByUserId(Long userId) throws Exception { +// +// MemberVo.MemberInfo memberInfo = proMemberService.getUserInfoByUserId(userId); +// return JsonResponse.newInstance().ok(memberInfo); +// } + +// /** +// * 获取项目下的所有成员ID +// */ +// @RequestMapping(value = "allMemberAll", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) +// public List getMemberIdByProjectId(Long projectId) throws Exception { +// +// List memberIdInfo = proMemberService.getMemberIdByProjectId(projectId); +// return memberIdInfo; +// } + + @ApiOperation(value = "图片验证码") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/code", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) + public JsonResponse vertifyCode(HttpServletRequest request, HttpServletResponse response) throws Exception { + UserVo.VerificationCode vertifyCode = userService.getVertifyCode(); +// ImageCodeGeneratorUtil.generateCodeImage(response.getOutputStream(), (String) codeMap.get("imageCode"), 200, 70); + return JsonResponse.newInstance().ok(vertifyCode); + } +} + + diff --git a/signin/src/main/java/com/ccsens/signin/api/UserInfoController.java b/signin/src/main/java/com/ccsens/signin/api/UserInfoController.java new file mode 100644 index 00000000..cb8d9287 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/api/UserInfoController.java @@ -0,0 +1,89 @@ +package com.ccsens.signin.api; + +import com.ccsens.signin.bean.dto.UserDto; +import com.ccsens.signin.bean.vo.UserVo; +import com.ccsens.signin.service.IUserInfoService; +import com.ccsens.util.JsonResponse; +import com.ccsens.util.WebConstant; +import io.jsonwebtoken.Claims; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.Part; + +/** + * @author 逗 + */ +@Api(tags = "用户详细信息操作API") +@RestController +@RequestMapping("/users/info") +public class UserInfoController { + @Resource + private IUserInfoService userInfoService; + + @ApiOperation(value = "修改登录账号") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/account", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse updateAccount(HttpServletRequest request, + @ApiParam @Validated @RequestBody UserDto.UpdateAccount updateAccount) throws Exception { + Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); + userInfoService.updateAccount(currentUserId, updateAccount); + return JsonResponse.newInstance().ok(); + } + + + @ApiOperation(value = "修改昵称") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/nickname", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse updateNickname(HttpServletRequest request, + @ApiParam @Validated @RequestBody UserDto.UpdateNickname updateNickname) throws Exception { + Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); + userInfoService.updateNickname(currentUserId, updateNickname); + return JsonResponse.newInstance().ok(); + } + + @ApiOperation(value = "上传头像") + @ApiImplicitParams({ + }) + @RequestMapping(value = "/avatarUrl", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse uploadAvatarUrl(HttpServletRequest request, + @RequestParam(required = true) Part file) throws Exception { + + Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); + userInfoService.uploadAvatarUrl(currentUserId,file); + return JsonResponse.newInstance().ok(); + } + + @ApiOperation(value = "查找用户详细信息") + @ApiImplicitParams({ + }) + @RequestMapping(value = "", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) + public JsonResponse selectUserInfo(HttpServletRequest request) throws Exception { + + Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); + UserVo.SelectUserInfo selectUserInfo = userInfoService.selectUserInfo(currentUserId); + return JsonResponse.newInstance().ok(selectUserInfo); + } + + @ApiOperation(value = "修改用户详细信息") + @ApiImplicitParams({ + }) + @RequestMapping(value = "", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) + public JsonResponse updateUserInfo(HttpServletRequest request, + @ApiParam @Validated @RequestBody UserDto.UpdateUserInfo updateUserInfo) throws Exception { + + Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject()); + UserVo.SelectUserInfo selectUserInfo = userInfoService.updateUserInfo(currentUserId,updateUserInfo); + return JsonResponse.newInstance().ok(selectUserInfo); + } + + +} diff --git a/signin/src/main/java/com/ccsens/signin/bean/dto/UserDto.java b/signin/src/main/java/com/ccsens/signin/bean/dto/UserDto.java new file mode 100644 index 00000000..4a179c92 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/bean/dto/UserDto.java @@ -0,0 +1,214 @@ +package com.ccsens.signin.bean.dto; + +import com.ccsens.util.WebConstant; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Pattern; + +/** + * @author 逗 + */ +@Data +public class UserDto { + @Data + @ApiModel + public static class UserSginin{ + @lombok.Data + @ApiModel + public static class Data{ + @ApiModelProperty("用户标识|用户名") + @NotEmpty(message = "identifier is required.") + private String identifier; + @ApiModelProperty("用户凭据|密码") + private String credential; + } + @ApiModelProperty("登录客户端:0-wxmp,1-H5,2-Android,3-IOS,4-WxEnterprise") + @NotNull(message = "client is required.") + private Integer client; + @ApiModelProperty("登录类型:0-wxmp,1-phone,2-email,3-accounts,4-OAUTH2_Wx,5-Wx_H5,6-OAUTH2_WeiBo, 7-Wx_Enterprise") + @NotNull(message = "type is required.") + private Integer type; + @ApiModelProperty("登录信息") + private Data data; + @ApiModelProperty("通知消息") + private String redirect; + } + + @Data + @ApiModel + public static class UpdatePhone{ + @ApiModelProperty("旧手机号") + private String oldPhone; + @ApiModelProperty("密码") + private String password; + @ApiModelProperty("新手机号") + private String newPhone; + @ApiModelProperty("新手机号的验证码") + private String code; + } + + @Data + @ApiModel + public static class Account{ + @ApiModelProperty("用户id") + private Long id; + @ApiModelProperty("用户名") + private String username; + @ApiModelProperty("密码") + private String password; + } + @Data + @ApiModel + public static class UpdatePassword{ + @ApiModelProperty("手机号") + @NotEmpty(message = "手机号不能为空") + @Pattern(regexp="^[1]([3-9])[0-9]{9}$",message="请输入正确的手机号") + private String phone; + @ApiModelProperty("验证码") + @NotEmpty(message = "验证码不能为空.") + private String code; + @ApiModelProperty("密码") + @NotEmpty(message = "密码不能为空") + @Pattern(regexp="^[a-zA-Z0-9._-]{6,20}$",message="密码长度需在6~20之间,不能使用汉字,不能包含特殊字符") + private String password; + } + + @Data + @ApiModel("通过账号修改密码") + public static class UpdatePasswordByAccount{ + @ApiModelProperty("账号") + @NotEmpty(message = "账号不能为空") + private String account; + @ApiModelProperty("旧密码") + @NotEmpty(message = "旧密码不能为空.") + @Pattern(regexp="^[a-zA-Z0-9._-]{6,20}$",message="密码长度需在6~20之间,不能使用汉字,不能包含特殊字符") + private String passwordOld; + @ApiModelProperty("新密码") + @NotEmpty(message = "新密码不能为空") + @Pattern(regexp="^[a-zA-Z0-9._-]{6,20}$",message="密码长度需在6~20之间,不能使用汉字,不能包含特殊字符") + private String passwordNew; + } + + @Data + @ApiModel("手机号注册") + public static class UserSignup{ + @ApiModelProperty("手机号") + @NotEmpty(message = "手机号不能为空") + @Pattern(regexp="^[1]([3-9])[0-9]{9}$",message="请输入正确的手机号") + private String phone; + @ApiModelProperty("验证码") + @NotEmpty(message = "验证码不能为空.") + private String smsCode; + @ApiModelProperty("账号") + @NotEmpty(message = "账号不能为空.") + @Pattern(regexp="^[a-zA-Z0-9._-]{2,20}$",message="账号长度需在2~20之间,不能使用汉字,不能包含特殊字符") + private String account; + @ApiModelProperty("密码") + @NotEmpty(message = "密码不能为空") + @Pattern(regexp="^[a-zA-Z0-9._-]{6,20}$",message="密码长度需在6~20之间,不能使用汉字,不能包含特殊字符") + private String password; + @ApiModelProperty("来源 0:默认注册,1:跳绳") + private byte source = WebConstant.Regist.SOURCE; + } + + @Data + @ApiModel("注册") + public static class UserSignupSystem{ + @ApiModelProperty("账号") + private String account; + @ApiModelProperty("密码") + private String password; + } + @Data + @ApiModel + public static class WxMergePhone{ + @ApiModelProperty("手机号") + private String phone; + @ApiModelProperty("合并方式 0直接合并 1不合并以前的信息") + private int isMerge; + } + + @Data + @ApiModel + public static class WxBindingPhone{ + @ApiModelProperty("手机号") + private String phone; + @ApiModelProperty("手机验证码") + private String smsCode; + } + + @Data + @ApiModel + public static class WxInfo{ +// @ApiModelProperty("用户id") +// private String userId; + @ApiModelProperty("微信名") + private String nickname; + @ApiModelProperty("微信头像") + private String headImgUrl; + @ApiModelProperty("性别") + private Byte sex; + @ApiModelProperty("省") + private String province; + @ApiModelProperty("市") + private String city; + @ApiModelProperty("国家") + private String country; + @ApiModelProperty("语言") + private String language; + } + + @Data + @ApiModel("修改登录账号") + public static class UpdateAccount{ + @ApiModelProperty("手机号") + @NotEmpty(message = "手机号不能为空") + @Pattern(regexp="^[1]([3-9])[0-9]{9}$",message="请输入正确的手机号") + private String phone; + @ApiModelProperty("验证码") + @NotEmpty(message = "验证码不能为空.") + private String smsCode; + @ApiModelProperty("账号") + @NotEmpty(message = "新账号不能为空.") + private String account; + @ApiModelProperty("密码,有账号登录信息则验证密码,没有则设为新密码") + @NotEmpty(message = "密码不能为空") + private String password; + } + + @Data + @ApiModel("修改昵称") + public static class UpdateNickname{ + @ApiModelProperty("昵称") + @NotEmpty(message = "新昵称不能为空.") + private String nickname; + } + + @Data + @ApiModel("修改个人详细信息") + public static class UpdateUserInfo{ + @NotNull + @ApiModelProperty("userId") + private Long id; + @ApiModelProperty("昵称") + private String nickname; + @ApiModelProperty("个人签名") + private String signature; + @ApiModelProperty("个人简介") + private String introduction; + @ApiModelProperty("生日") + private String birthday; + @ApiModelProperty("所在地") + private String address; + @ApiModelProperty("网页") + private String webPath; + @ApiModelProperty("公司") + private String company; + @ApiModelProperty("职位") + private String position; + } +} diff --git a/signin/src/main/java/com/ccsens/signin/bean/po/SysAuth.java b/signin/src/main/java/com/ccsens/signin/bean/po/SysAuth.java new file mode 100644 index 00000000..cf818110 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/bean/po/SysAuth.java @@ -0,0 +1,128 @@ +package com.ccsens.signin.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class SysAuth implements Serializable { + private Long id; + + private Long userId; + + private Byte identifyType; + + private String identifier; + + private String credential; + + private String salt; + + private Date createdAt; + + private Date updatedAt; + + private Byte recStatus; + + private Byte registerType; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Byte getIdentifyType() { + return identifyType; + } + + public void setIdentifyType(Byte identifyType) { + this.identifyType = identifyType; + } + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier == null ? null : identifier.trim(); + } + + public String getCredential() { + return credential; + } + + public void setCredential(String credential) { + this.credential = credential == null ? null : credential.trim(); + } + + public String getSalt() { + return salt; + } + + public void setSalt(String salt) { + this.salt = salt == null ? null : salt.trim(); + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public Byte getRecStatus() { + return recStatus; + } + + public void setRecStatus(Byte recStatus) { + this.recStatus = recStatus; + } + + public Byte getRegisterType() { + return registerType; + } + + public void setRegisterType(Byte registerType) { + this.registerType = registerType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", userId=").append(userId); + sb.append(", identifyType=").append(identifyType); + sb.append(", identifier=").append(identifier); + sb.append(", credential=").append(credential); + sb.append(", salt=").append(salt); + sb.append(", createdAt=").append(createdAt); + sb.append(", updatedAt=").append(updatedAt); + sb.append(", recStatus=").append(recStatus); + sb.append(", registerType=").append(registerType); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/signin/src/main/java/com/ccsens/signin/bean/po/SysAuthExample.java b/signin/src/main/java/com/ccsens/signin/bean/po/SysAuthExample.java new file mode 100644 index 00000000..5d8e4bfa --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/bean/po/SysAuthExample.java @@ -0,0 +1,831 @@ +package com.ccsens.signin.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SysAuthExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysAuthExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeIsNull() { + addCriterion("identify_type is null"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeIsNotNull() { + addCriterion("identify_type is not null"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeEqualTo(Byte value) { + addCriterion("identify_type =", value, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeNotEqualTo(Byte value) { + addCriterion("identify_type <>", value, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeGreaterThan(Byte value) { + addCriterion("identify_type >", value, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeGreaterThanOrEqualTo(Byte value) { + addCriterion("identify_type >=", value, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeLessThan(Byte value) { + addCriterion("identify_type <", value, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeLessThanOrEqualTo(Byte value) { + addCriterion("identify_type <=", value, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeIn(List values) { + addCriterion("identify_type in", values, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeNotIn(List values) { + addCriterion("identify_type not in", values, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeBetween(Byte value1, Byte value2) { + addCriterion("identify_type between", value1, value2, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifyTypeNotBetween(Byte value1, Byte value2) { + addCriterion("identify_type not between", value1, value2, "identifyType"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNull() { + addCriterion("identifier is null"); + return (Criteria) this; + } + + public Criteria andIdentifierIsNotNull() { + addCriterion("identifier is not null"); + return (Criteria) this; + } + + public Criteria andIdentifierEqualTo(String value) { + addCriterion("identifier =", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotEqualTo(String value) { + addCriterion("identifier <>", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThan(String value) { + addCriterion("identifier >", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierGreaterThanOrEqualTo(String value) { + addCriterion("identifier >=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThan(String value) { + addCriterion("identifier <", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLessThanOrEqualTo(String value) { + addCriterion("identifier <=", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierLike(String value) { + addCriterion("identifier like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotLike(String value) { + addCriterion("identifier not like", value, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierIn(List values) { + addCriterion("identifier in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotIn(List values) { + addCriterion("identifier not in", values, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierBetween(String value1, String value2) { + addCriterion("identifier between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andIdentifierNotBetween(String value1, String value2) { + addCriterion("identifier not between", value1, value2, "identifier"); + return (Criteria) this; + } + + public Criteria andCredentialIsNull() { + addCriterion("credential is null"); + return (Criteria) this; + } + + public Criteria andCredentialIsNotNull() { + addCriterion("credential is not null"); + return (Criteria) this; + } + + public Criteria andCredentialEqualTo(String value) { + addCriterion("credential =", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialNotEqualTo(String value) { + addCriterion("credential <>", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialGreaterThan(String value) { + addCriterion("credential >", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialGreaterThanOrEqualTo(String value) { + addCriterion("credential >=", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialLessThan(String value) { + addCriterion("credential <", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialLessThanOrEqualTo(String value) { + addCriterion("credential <=", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialLike(String value) { + addCriterion("credential like", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialNotLike(String value) { + addCriterion("credential not like", value, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialIn(List values) { + addCriterion("credential in", values, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialNotIn(List values) { + addCriterion("credential not in", values, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialBetween(String value1, String value2) { + addCriterion("credential between", value1, value2, "credential"); + return (Criteria) this; + } + + public Criteria andCredentialNotBetween(String value1, String value2) { + addCriterion("credential not between", value1, value2, "credential"); + return (Criteria) this; + } + + public Criteria andSaltIsNull() { + addCriterion("salt is null"); + return (Criteria) this; + } + + public Criteria andSaltIsNotNull() { + addCriterion("salt is not null"); + return (Criteria) this; + } + + public Criteria andSaltEqualTo(String value) { + addCriterion("salt =", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltNotEqualTo(String value) { + addCriterion("salt <>", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltGreaterThan(String value) { + addCriterion("salt >", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltGreaterThanOrEqualTo(String value) { + addCriterion("salt >=", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltLessThan(String value) { + addCriterion("salt <", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltLessThanOrEqualTo(String value) { + addCriterion("salt <=", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltLike(String value) { + addCriterion("salt like", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltNotLike(String value) { + addCriterion("salt not like", value, "salt"); + return (Criteria) this; + } + + public Criteria andSaltIn(List values) { + addCriterion("salt in", values, "salt"); + return (Criteria) this; + } + + public Criteria andSaltNotIn(List values) { + addCriterion("salt not in", values, "salt"); + return (Criteria) this; + } + + public Criteria andSaltBetween(String value1, String value2) { + addCriterion("salt between", value1, value2, "salt"); + return (Criteria) this; + } + + public Criteria andSaltNotBetween(String value1, String value2) { + addCriterion("salt not between", value1, value2, "salt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Date value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Date value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Date value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Date value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Date value1, Date value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNull() { + addCriterion("rec_status is null"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNotNull() { + addCriterion("rec_status is not null"); + return (Criteria) this; + } + + public Criteria andRecStatusEqualTo(Byte value) { + addCriterion("rec_status =", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotEqualTo(Byte value) { + addCriterion("rec_status <>", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThan(Byte value) { + addCriterion("rec_status >", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("rec_status >=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThan(Byte value) { + addCriterion("rec_status <", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThanOrEqualTo(Byte value) { + addCriterion("rec_status <=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusIn(List values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List values) { + addCriterion("rec_status not in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusBetween(Byte value1, Byte value2) { + addCriterion("rec_status between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { + addCriterion("rec_status not between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRegisterTypeIsNull() { + addCriterion("register_type is null"); + return (Criteria) this; + } + + public Criteria andRegisterTypeIsNotNull() { + addCriterion("register_type is not null"); + return (Criteria) this; + } + + public Criteria andRegisterTypeEqualTo(Byte value) { + addCriterion("register_type =", value, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeNotEqualTo(Byte value) { + addCriterion("register_type <>", value, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeGreaterThan(Byte value) { + addCriterion("register_type >", value, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeGreaterThanOrEqualTo(Byte value) { + addCriterion("register_type >=", value, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeLessThan(Byte value) { + addCriterion("register_type <", value, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeLessThanOrEqualTo(Byte value) { + addCriterion("register_type <=", value, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeIn(List values) { + addCriterion("register_type in", values, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeNotIn(List values) { + addCriterion("register_type not in", values, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeBetween(Byte value1, Byte value2) { + addCriterion("register_type between", value1, value2, "registerType"); + return (Criteria) this; + } + + public Criteria andRegisterTypeNotBetween(Byte value1, Byte value2) { + addCriterion("register_type not between", value1, value2, "registerType"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/signin/src/main/java/com/ccsens/signin/bean/po/SysUser.java b/signin/src/main/java/com/ccsens/signin/bean/po/SysUser.java new file mode 100644 index 00000000..5c2b1e4f --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/bean/po/SysUser.java @@ -0,0 +1,205 @@ +package com.ccsens.signin.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class SysUser implements Serializable { + private Long id; + + private Long gradeId; + + private String avatarUrl; + + private String nickname; + + private Byte gender; + + private String country; + + private String province; + + private String city; + + private String language; + + private String phone; + + private String wechat; + + private String email; + + private Long balance; + + private Date createdAt; + + private Date updatedAt; + + private Byte recStatus; + + private Byte source; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getGradeId() { + return gradeId; + } + + public void setGradeId(Long gradeId) { + this.gradeId = gradeId; + } + + public String getAvatarUrl() { + return avatarUrl; + } + + public void setAvatarUrl(String avatarUrl) { + this.avatarUrl = avatarUrl == null ? null : avatarUrl.trim(); + } + + public String getNickname() { + return nickname; + } + + public void setNickname(String nickname) { + this.nickname = nickname == null ? null : nickname.trim(); + } + + public Byte getGender() { + return gender; + } + + public void setGender(Byte gender) { + this.gender = gender; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country == null ? null : country.trim(); + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province == null ? null : province.trim(); + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city == null ? null : city.trim(); + } + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language == null ? null : language.trim(); + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone == null ? null : phone.trim(); + } + + public String getWechat() { + return wechat; + } + + public void setWechat(String wechat) { + this.wechat = wechat == null ? null : wechat.trim(); + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email == null ? null : email.trim(); + } + + public Long getBalance() { + return balance; + } + + public void setBalance(Long balance) { + this.balance = balance; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public Byte getRecStatus() { + return recStatus; + } + + public void setRecStatus(Byte recStatus) { + this.recStatus = recStatus; + } + + public Byte getSource() { + return source; + } + + public void setSource(Byte source) { + this.source = source; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", gradeId=").append(gradeId); + sb.append(", avatarUrl=").append(avatarUrl); + sb.append(", nickname=").append(nickname); + sb.append(", gender=").append(gender); + sb.append(", country=").append(country); + sb.append(", province=").append(province); + sb.append(", city=").append(city); + sb.append(", language=").append(language); + sb.append(", phone=").append(phone); + sb.append(", wechat=").append(wechat); + sb.append(", email=").append(email); + sb.append(", balance=").append(balance); + sb.append(", createdAt=").append(createdAt); + sb.append(", updatedAt=").append(updatedAt); + sb.append(", recStatus=").append(recStatus); + sb.append(", source=").append(source); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/signin/src/main/java/com/ccsens/signin/bean/po/SysUserExample.java b/signin/src/main/java/com/ccsens/signin/bean/po/SysUserExample.java new file mode 100644 index 00000000..7c040d20 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/bean/po/SysUserExample.java @@ -0,0 +1,1311 @@ +package com.ccsens.signin.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SysUserExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysUserExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andGradeIdIsNull() { + addCriterion("grade_id is null"); + return (Criteria) this; + } + + public Criteria andGradeIdIsNotNull() { + addCriterion("grade_id is not null"); + return (Criteria) this; + } + + public Criteria andGradeIdEqualTo(Long value) { + addCriterion("grade_id =", value, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdNotEqualTo(Long value) { + addCriterion("grade_id <>", value, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdGreaterThan(Long value) { + addCriterion("grade_id >", value, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdGreaterThanOrEqualTo(Long value) { + addCriterion("grade_id >=", value, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdLessThan(Long value) { + addCriterion("grade_id <", value, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdLessThanOrEqualTo(Long value) { + addCriterion("grade_id <=", value, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdIn(List values) { + addCriterion("grade_id in", values, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdNotIn(List values) { + addCriterion("grade_id not in", values, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdBetween(Long value1, Long value2) { + addCriterion("grade_id between", value1, value2, "gradeId"); + return (Criteria) this; + } + + public Criteria andGradeIdNotBetween(Long value1, Long value2) { + addCriterion("grade_id not between", value1, value2, "gradeId"); + return (Criteria) this; + } + + public Criteria andAvatarUrlIsNull() { + addCriterion("avatar_url is null"); + return (Criteria) this; + } + + public Criteria andAvatarUrlIsNotNull() { + addCriterion("avatar_url is not null"); + return (Criteria) this; + } + + public Criteria andAvatarUrlEqualTo(String value) { + addCriterion("avatar_url =", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlNotEqualTo(String value) { + addCriterion("avatar_url <>", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlGreaterThan(String value) { + addCriterion("avatar_url >", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlGreaterThanOrEqualTo(String value) { + addCriterion("avatar_url >=", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlLessThan(String value) { + addCriterion("avatar_url <", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlLessThanOrEqualTo(String value) { + addCriterion("avatar_url <=", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlLike(String value) { + addCriterion("avatar_url like", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlNotLike(String value) { + addCriterion("avatar_url not like", value, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlIn(List values) { + addCriterion("avatar_url in", values, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlNotIn(List values) { + addCriterion("avatar_url not in", values, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlBetween(String value1, String value2) { + addCriterion("avatar_url between", value1, value2, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andAvatarUrlNotBetween(String value1, String value2) { + addCriterion("avatar_url not between", value1, value2, "avatarUrl"); + return (Criteria) this; + } + + public Criteria andNicknameIsNull() { + addCriterion("nickname is null"); + return (Criteria) this; + } + + public Criteria andNicknameIsNotNull() { + addCriterion("nickname is not null"); + return (Criteria) this; + } + + public Criteria andNicknameEqualTo(String value) { + addCriterion("nickname =", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameNotEqualTo(String value) { + addCriterion("nickname <>", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameGreaterThan(String value) { + addCriterion("nickname >", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameGreaterThanOrEqualTo(String value) { + addCriterion("nickname >=", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameLessThan(String value) { + addCriterion("nickname <", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameLessThanOrEqualTo(String value) { + addCriterion("nickname <=", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameLike(String value) { + addCriterion("nickname like", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameNotLike(String value) { + addCriterion("nickname not like", value, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameIn(List values) { + addCriterion("nickname in", values, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameNotIn(List values) { + addCriterion("nickname not in", values, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameBetween(String value1, String value2) { + addCriterion("nickname between", value1, value2, "nickname"); + return (Criteria) this; + } + + public Criteria andNicknameNotBetween(String value1, String value2) { + addCriterion("nickname not between", value1, value2, "nickname"); + return (Criteria) this; + } + + public Criteria andGenderIsNull() { + addCriterion("gender is null"); + return (Criteria) this; + } + + public Criteria andGenderIsNotNull() { + addCriterion("gender is not null"); + return (Criteria) this; + } + + public Criteria andGenderEqualTo(Byte value) { + addCriterion("gender =", value, "gender"); + return (Criteria) this; + } + + public Criteria andGenderNotEqualTo(Byte value) { + addCriterion("gender <>", value, "gender"); + return (Criteria) this; + } + + public Criteria andGenderGreaterThan(Byte value) { + addCriterion("gender >", value, "gender"); + return (Criteria) this; + } + + public Criteria andGenderGreaterThanOrEqualTo(Byte value) { + addCriterion("gender >=", value, "gender"); + return (Criteria) this; + } + + public Criteria andGenderLessThan(Byte value) { + addCriterion("gender <", value, "gender"); + return (Criteria) this; + } + + public Criteria andGenderLessThanOrEqualTo(Byte value) { + addCriterion("gender <=", value, "gender"); + return (Criteria) this; + } + + public Criteria andGenderIn(List values) { + addCriterion("gender in", values, "gender"); + return (Criteria) this; + } + + public Criteria andGenderNotIn(List values) { + addCriterion("gender not in", values, "gender"); + return (Criteria) this; + } + + public Criteria andGenderBetween(Byte value1, Byte value2) { + addCriterion("gender between", value1, value2, "gender"); + return (Criteria) this; + } + + public Criteria andGenderNotBetween(Byte value1, Byte value2) { + addCriterion("gender not between", value1, value2, "gender"); + return (Criteria) this; + } + + public Criteria andCountryIsNull() { + addCriterion("country is null"); + return (Criteria) this; + } + + public Criteria andCountryIsNotNull() { + addCriterion("country is not null"); + return (Criteria) this; + } + + public Criteria andCountryEqualTo(String value) { + addCriterion("country =", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryNotEqualTo(String value) { + addCriterion("country <>", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryGreaterThan(String value) { + addCriterion("country >", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryGreaterThanOrEqualTo(String value) { + addCriterion("country >=", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryLessThan(String value) { + addCriterion("country <", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryLessThanOrEqualTo(String value) { + addCriterion("country <=", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryLike(String value) { + addCriterion("country like", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryNotLike(String value) { + addCriterion("country not like", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryIn(List values) { + addCriterion("country in", values, "country"); + return (Criteria) this; + } + + public Criteria andCountryNotIn(List values) { + addCriterion("country not in", values, "country"); + return (Criteria) this; + } + + public Criteria andCountryBetween(String value1, String value2) { + addCriterion("country between", value1, value2, "country"); + return (Criteria) this; + } + + public Criteria andCountryNotBetween(String value1, String value2) { + addCriterion("country not between", value1, value2, "country"); + return (Criteria) this; + } + + public Criteria andProvinceIsNull() { + addCriterion("province is null"); + return (Criteria) this; + } + + public Criteria andProvinceIsNotNull() { + addCriterion("province is not null"); + return (Criteria) this; + } + + public Criteria andProvinceEqualTo(String value) { + addCriterion("province =", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceNotEqualTo(String value) { + addCriterion("province <>", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceGreaterThan(String value) { + addCriterion("province >", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceGreaterThanOrEqualTo(String value) { + addCriterion("province >=", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceLessThan(String value) { + addCriterion("province <", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceLessThanOrEqualTo(String value) { + addCriterion("province <=", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceLike(String value) { + addCriterion("province like", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceNotLike(String value) { + addCriterion("province not like", value, "province"); + return (Criteria) this; + } + + public Criteria andProvinceIn(List values) { + addCriterion("province in", values, "province"); + return (Criteria) this; + } + + public Criteria andProvinceNotIn(List values) { + addCriterion("province not in", values, "province"); + return (Criteria) this; + } + + public Criteria andProvinceBetween(String value1, String value2) { + addCriterion("province between", value1, value2, "province"); + return (Criteria) this; + } + + public Criteria andProvinceNotBetween(String value1, String value2) { + addCriterion("province not between", value1, value2, "province"); + return (Criteria) this; + } + + public Criteria andCityIsNull() { + addCriterion("city is null"); + return (Criteria) this; + } + + public Criteria andCityIsNotNull() { + addCriterion("city is not null"); + return (Criteria) this; + } + + public Criteria andCityEqualTo(String value) { + addCriterion("city =", value, "city"); + return (Criteria) this; + } + + public Criteria andCityNotEqualTo(String value) { + addCriterion("city <>", value, "city"); + return (Criteria) this; + } + + public Criteria andCityGreaterThan(String value) { + addCriterion("city >", value, "city"); + return (Criteria) this; + } + + public Criteria andCityGreaterThanOrEqualTo(String value) { + addCriterion("city >=", value, "city"); + return (Criteria) this; + } + + public Criteria andCityLessThan(String value) { + addCriterion("city <", value, "city"); + return (Criteria) this; + } + + public Criteria andCityLessThanOrEqualTo(String value) { + addCriterion("city <=", value, "city"); + return (Criteria) this; + } + + public Criteria andCityLike(String value) { + addCriterion("city like", value, "city"); + return (Criteria) this; + } + + public Criteria andCityNotLike(String value) { + addCriterion("city not like", value, "city"); + return (Criteria) this; + } + + public Criteria andCityIn(List values) { + addCriterion("city in", values, "city"); + return (Criteria) this; + } + + public Criteria andCityNotIn(List values) { + addCriterion("city not in", values, "city"); + return (Criteria) this; + } + + public Criteria andCityBetween(String value1, String value2) { + addCriterion("city between", value1, value2, "city"); + return (Criteria) this; + } + + public Criteria andCityNotBetween(String value1, String value2) { + addCriterion("city not between", value1, value2, "city"); + return (Criteria) this; + } + + public Criteria andLanguageIsNull() { + addCriterion("language is null"); + return (Criteria) this; + } + + public Criteria andLanguageIsNotNull() { + addCriterion("language is not null"); + return (Criteria) this; + } + + public Criteria andLanguageEqualTo(String value) { + addCriterion("language =", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageNotEqualTo(String value) { + addCriterion("language <>", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageGreaterThan(String value) { + addCriterion("language >", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageGreaterThanOrEqualTo(String value) { + addCriterion("language >=", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageLessThan(String value) { + addCriterion("language <", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageLessThanOrEqualTo(String value) { + addCriterion("language <=", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageLike(String value) { + addCriterion("language like", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageNotLike(String value) { + addCriterion("language not like", value, "language"); + return (Criteria) this; + } + + public Criteria andLanguageIn(List values) { + addCriterion("language in", values, "language"); + return (Criteria) this; + } + + public Criteria andLanguageNotIn(List values) { + addCriterion("language not in", values, "language"); + return (Criteria) this; + } + + public Criteria andLanguageBetween(String value1, String value2) { + addCriterion("language between", value1, value2, "language"); + return (Criteria) this; + } + + public Criteria andLanguageNotBetween(String value1, String value2) { + addCriterion("language not between", value1, value2, "language"); + return (Criteria) this; + } + + public Criteria andPhoneIsNull() { + addCriterion("phone is null"); + return (Criteria) this; + } + + public Criteria andPhoneIsNotNull() { + addCriterion("phone is not null"); + return (Criteria) this; + } + + public Criteria andPhoneEqualTo(String value) { + addCriterion("phone =", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotEqualTo(String value) { + addCriterion("phone <>", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneGreaterThan(String value) { + addCriterion("phone >", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneGreaterThanOrEqualTo(String value) { + addCriterion("phone >=", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneLessThan(String value) { + addCriterion("phone <", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneLessThanOrEqualTo(String value) { + addCriterion("phone <=", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneLike(String value) { + addCriterion("phone like", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotLike(String value) { + addCriterion("phone not like", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneIn(List values) { + addCriterion("phone in", values, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotIn(List values) { + addCriterion("phone not in", values, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneBetween(String value1, String value2) { + addCriterion("phone between", value1, value2, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotBetween(String value1, String value2) { + addCriterion("phone not between", value1, value2, "phone"); + return (Criteria) this; + } + + public Criteria andWechatIsNull() { + addCriterion("wechat is null"); + return (Criteria) this; + } + + public Criteria andWechatIsNotNull() { + addCriterion("wechat is not null"); + return (Criteria) this; + } + + public Criteria andWechatEqualTo(String value) { + addCriterion("wechat =", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatNotEqualTo(String value) { + addCriterion("wechat <>", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatGreaterThan(String value) { + addCriterion("wechat >", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatGreaterThanOrEqualTo(String value) { + addCriterion("wechat >=", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatLessThan(String value) { + addCriterion("wechat <", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatLessThanOrEqualTo(String value) { + addCriterion("wechat <=", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatLike(String value) { + addCriterion("wechat like", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatNotLike(String value) { + addCriterion("wechat not like", value, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatIn(List values) { + addCriterion("wechat in", values, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatNotIn(List values) { + addCriterion("wechat not in", values, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatBetween(String value1, String value2) { + addCriterion("wechat between", value1, value2, "wechat"); + return (Criteria) this; + } + + public Criteria andWechatNotBetween(String value1, String value2) { + addCriterion("wechat not between", value1, value2, "wechat"); + return (Criteria) this; + } + + public Criteria andEmailIsNull() { + addCriterion("email is null"); + return (Criteria) this; + } + + public Criteria andEmailIsNotNull() { + addCriterion("email is not null"); + return (Criteria) this; + } + + public Criteria andEmailEqualTo(String value) { + addCriterion("email =", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotEqualTo(String value) { + addCriterion("email <>", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThan(String value) { + addCriterion("email >", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailGreaterThanOrEqualTo(String value) { + addCriterion("email >=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThan(String value) { + addCriterion("email <", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLessThanOrEqualTo(String value) { + addCriterion("email <=", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailLike(String value) { + addCriterion("email like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotLike(String value) { + addCriterion("email not like", value, "email"); + return (Criteria) this; + } + + public Criteria andEmailIn(List values) { + addCriterion("email in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotIn(List values) { + addCriterion("email not in", values, "email"); + return (Criteria) this; + } + + public Criteria andEmailBetween(String value1, String value2) { + addCriterion("email between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andEmailNotBetween(String value1, String value2) { + addCriterion("email not between", value1, value2, "email"); + return (Criteria) this; + } + + public Criteria andBalanceIsNull() { + addCriterion("balance is null"); + return (Criteria) this; + } + + public Criteria andBalanceIsNotNull() { + addCriterion("balance is not null"); + return (Criteria) this; + } + + public Criteria andBalanceEqualTo(Long value) { + addCriterion("balance =", value, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceNotEqualTo(Long value) { + addCriterion("balance <>", value, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceGreaterThan(Long value) { + addCriterion("balance >", value, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceGreaterThanOrEqualTo(Long value) { + addCriterion("balance >=", value, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceLessThan(Long value) { + addCriterion("balance <", value, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceLessThanOrEqualTo(Long value) { + addCriterion("balance <=", value, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceIn(List values) { + addCriterion("balance in", values, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceNotIn(List values) { + addCriterion("balance not in", values, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceBetween(Long value1, Long value2) { + addCriterion("balance between", value1, value2, "balance"); + return (Criteria) this; + } + + public Criteria andBalanceNotBetween(Long value1, Long value2) { + addCriterion("balance not between", value1, value2, "balance"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Date value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Date value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Date value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Date value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Date value1, Date value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNull() { + addCriterion("rec_status is null"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNotNull() { + addCriterion("rec_status is not null"); + return (Criteria) this; + } + + public Criteria andRecStatusEqualTo(Byte value) { + addCriterion("rec_status =", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotEqualTo(Byte value) { + addCriterion("rec_status <>", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThan(Byte value) { + addCriterion("rec_status >", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("rec_status >=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThan(Byte value) { + addCriterion("rec_status <", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThanOrEqualTo(Byte value) { + addCriterion("rec_status <=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusIn(List values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List values) { + addCriterion("rec_status not in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusBetween(Byte value1, Byte value2) { + addCriterion("rec_status between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { + addCriterion("rec_status not between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andSourceIsNull() { + addCriterion("source is null"); + return (Criteria) this; + } + + public Criteria andSourceIsNotNull() { + addCriterion("source is not null"); + return (Criteria) this; + } + + public Criteria andSourceEqualTo(Byte value) { + addCriterion("source =", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotEqualTo(Byte value) { + addCriterion("source <>", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThan(Byte value) { + addCriterion("source >", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceGreaterThanOrEqualTo(Byte value) { + addCriterion("source >=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThan(Byte value) { + addCriterion("source <", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceLessThanOrEqualTo(Byte value) { + addCriterion("source <=", value, "source"); + return (Criteria) this; + } + + public Criteria andSourceIn(List values) { + addCriterion("source in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotIn(List values) { + addCriterion("source not in", values, "source"); + return (Criteria) this; + } + + public Criteria andSourceBetween(Byte value1, Byte value2) { + addCriterion("source between", value1, value2, "source"); + return (Criteria) this; + } + + public Criteria andSourceNotBetween(Byte value1, Byte value2) { + addCriterion("source not between", value1, value2, "source"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/signin/src/main/java/com/ccsens/signin/bean/po/SysUserInfo.java b/signin/src/main/java/com/ccsens/signin/bean/po/SysUserInfo.java new file mode 100644 index 00000000..2830d45b --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/bean/po/SysUserInfo.java @@ -0,0 +1,150 @@ +package com.ccsens.signin.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class SysUserInfo implements Serializable { + private Long id; + + private Long userId; + + private String signature; + + private String introduction; + + private String birthday; + + private String address; + + private String webPath; + + private String company; + + private String position; + + private Date createdAt; + + private Date updatedAt; + + private Byte recStatus; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature == null ? null : signature.trim(); + } + + public String getIntroduction() { + return introduction; + } + + public void setIntroduction(String introduction) { + this.introduction = introduction == null ? null : introduction.trim(); + } + + public String getBirthday() { + return birthday; + } + + public void setBirthday(String birthday) { + this.birthday = birthday == null ? null : birthday.trim(); + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address == null ? null : address.trim(); + } + + public String getWebPath() { + return webPath; + } + + public void setWebPath(String webPath) { + this.webPath = webPath == null ? null : webPath.trim(); + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company == null ? null : company.trim(); + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position == null ? null : position.trim(); + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public Byte getRecStatus() { + return recStatus; + } + + public void setRecStatus(Byte recStatus) { + this.recStatus = recStatus; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", userId=").append(userId); + sb.append(", signature=").append(signature); + sb.append(", introduction=").append(introduction); + sb.append(", birthday=").append(birthday); + sb.append(", address=").append(address); + sb.append(", webPath=").append(webPath); + sb.append(", company=").append(company); + sb.append(", position=").append(position); + sb.append(", createdAt=").append(createdAt); + sb.append(", updatedAt=").append(updatedAt); + sb.append(", recStatus=").append(recStatus); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/signin/src/main/java/com/ccsens/signin/bean/po/SysUserInfoExample.java b/signin/src/main/java/com/ccsens/signin/bean/po/SysUserInfoExample.java new file mode 100644 index 00000000..80005119 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/bean/po/SysUserInfoExample.java @@ -0,0 +1,991 @@ +package com.ccsens.signin.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SysUserInfoExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public SysUserInfoExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andSignatureIsNull() { + addCriterion("signature is null"); + return (Criteria) this; + } + + public Criteria andSignatureIsNotNull() { + addCriterion("signature is not null"); + return (Criteria) this; + } + + public Criteria andSignatureEqualTo(String value) { + addCriterion("signature =", value, "signature"); + return (Criteria) this; + } + + public Criteria andSignatureNotEqualTo(String value) { + addCriterion("signature <>", value, "signature"); + return (Criteria) this; + } + + public Criteria andSignatureGreaterThan(String value) { + addCriterion("signature >", value, "signature"); + return (Criteria) this; + } + + public Criteria andSignatureGreaterThanOrEqualTo(String value) { + addCriterion("signature >=", value, "signature"); + return (Criteria) this; + } + + public Criteria andSignatureLessThan(String value) { + addCriterion("signature <", value, "signature"); + return (Criteria) this; + } + + public Criteria andSignatureLessThanOrEqualTo(String value) { + addCriterion("signature <=", value, "signature"); + return (Criteria) this; + } + + public Criteria andSignatureLike(String value) { + addCriterion("signature like", value, "signature"); + return (Criteria) this; + } + + public Criteria andSignatureNotLike(String value) { + addCriterion("signature not like", value, "signature"); + return (Criteria) this; + } + + public Criteria andSignatureIn(List values) { + addCriterion("signature in", values, "signature"); + return (Criteria) this; + } + + public Criteria andSignatureNotIn(List values) { + addCriterion("signature not in", values, "signature"); + return (Criteria) this; + } + + public Criteria andSignatureBetween(String value1, String value2) { + addCriterion("signature between", value1, value2, "signature"); + return (Criteria) this; + } + + public Criteria andSignatureNotBetween(String value1, String value2) { + addCriterion("signature not between", value1, value2, "signature"); + return (Criteria) this; + } + + public Criteria andIntroductionIsNull() { + addCriterion("introduction is null"); + return (Criteria) this; + } + + public Criteria andIntroductionIsNotNull() { + addCriterion("introduction is not null"); + return (Criteria) this; + } + + public Criteria andIntroductionEqualTo(String value) { + addCriterion("introduction =", value, "introduction"); + return (Criteria) this; + } + + public Criteria andIntroductionNotEqualTo(String value) { + addCriterion("introduction <>", value, "introduction"); + return (Criteria) this; + } + + public Criteria andIntroductionGreaterThan(String value) { + addCriterion("introduction >", value, "introduction"); + return (Criteria) this; + } + + public Criteria andIntroductionGreaterThanOrEqualTo(String value) { + addCriterion("introduction >=", value, "introduction"); + return (Criteria) this; + } + + public Criteria andIntroductionLessThan(String value) { + addCriterion("introduction <", value, "introduction"); + return (Criteria) this; + } + + public Criteria andIntroductionLessThanOrEqualTo(String value) { + addCriterion("introduction <=", value, "introduction"); + return (Criteria) this; + } + + public Criteria andIntroductionLike(String value) { + addCriterion("introduction like", value, "introduction"); + return (Criteria) this; + } + + public Criteria andIntroductionNotLike(String value) { + addCriterion("introduction not like", value, "introduction"); + return (Criteria) this; + } + + public Criteria andIntroductionIn(List values) { + addCriterion("introduction in", values, "introduction"); + return (Criteria) this; + } + + public Criteria andIntroductionNotIn(List values) { + addCriterion("introduction not in", values, "introduction"); + return (Criteria) this; + } + + public Criteria andIntroductionBetween(String value1, String value2) { + addCriterion("introduction between", value1, value2, "introduction"); + return (Criteria) this; + } + + public Criteria andIntroductionNotBetween(String value1, String value2) { + addCriterion("introduction not between", value1, value2, "introduction"); + return (Criteria) this; + } + + public Criteria andBirthdayIsNull() { + addCriterion("birthday is null"); + return (Criteria) this; + } + + public Criteria andBirthdayIsNotNull() { + addCriterion("birthday is not null"); + return (Criteria) this; + } + + public Criteria andBirthdayEqualTo(String value) { + addCriterion("birthday =", value, "birthday"); + return (Criteria) this; + } + + public Criteria andBirthdayNotEqualTo(String value) { + addCriterion("birthday <>", value, "birthday"); + return (Criteria) this; + } + + public Criteria andBirthdayGreaterThan(String value) { + addCriterion("birthday >", value, "birthday"); + return (Criteria) this; + } + + public Criteria andBirthdayGreaterThanOrEqualTo(String value) { + addCriterion("birthday >=", value, "birthday"); + return (Criteria) this; + } + + public Criteria andBirthdayLessThan(String value) { + addCriterion("birthday <", value, "birthday"); + return (Criteria) this; + } + + public Criteria andBirthdayLessThanOrEqualTo(String value) { + addCriterion("birthday <=", value, "birthday"); + return (Criteria) this; + } + + public Criteria andBirthdayLike(String value) { + addCriterion("birthday like", value, "birthday"); + return (Criteria) this; + } + + public Criteria andBirthdayNotLike(String value) { + addCriterion("birthday not like", value, "birthday"); + return (Criteria) this; + } + + public Criteria andBirthdayIn(List values) { + addCriterion("birthday in", values, "birthday"); + return (Criteria) this; + } + + public Criteria andBirthdayNotIn(List values) { + addCriterion("birthday not in", values, "birthday"); + return (Criteria) this; + } + + public Criteria andBirthdayBetween(String value1, String value2) { + addCriterion("birthday between", value1, value2, "birthday"); + return (Criteria) this; + } + + public Criteria andBirthdayNotBetween(String value1, String value2) { + addCriterion("birthday not between", value1, value2, "birthday"); + return (Criteria) this; + } + + public Criteria andAddressIsNull() { + addCriterion("address is null"); + return (Criteria) this; + } + + public Criteria andAddressIsNotNull() { + addCriterion("address is not null"); + return (Criteria) this; + } + + public Criteria andAddressEqualTo(String value) { + addCriterion("address =", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotEqualTo(String value) { + addCriterion("address <>", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThan(String value) { + addCriterion("address >", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThanOrEqualTo(String value) { + addCriterion("address >=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThan(String value) { + addCriterion("address <", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThanOrEqualTo(String value) { + addCriterion("address <=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLike(String value) { + addCriterion("address like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotLike(String value) { + addCriterion("address not like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressIn(List values) { + addCriterion("address in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotIn(List values) { + addCriterion("address not in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressBetween(String value1, String value2) { + addCriterion("address between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotBetween(String value1, String value2) { + addCriterion("address not between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andWebPathIsNull() { + addCriterion("web_path is null"); + return (Criteria) this; + } + + public Criteria andWebPathIsNotNull() { + addCriterion("web_path is not null"); + return (Criteria) this; + } + + public Criteria andWebPathEqualTo(String value) { + addCriterion("web_path =", value, "webPath"); + return (Criteria) this; + } + + public Criteria andWebPathNotEqualTo(String value) { + addCriterion("web_path <>", value, "webPath"); + return (Criteria) this; + } + + public Criteria andWebPathGreaterThan(String value) { + addCriterion("web_path >", value, "webPath"); + return (Criteria) this; + } + + public Criteria andWebPathGreaterThanOrEqualTo(String value) { + addCriterion("web_path >=", value, "webPath"); + return (Criteria) this; + } + + public Criteria andWebPathLessThan(String value) { + addCriterion("web_path <", value, "webPath"); + return (Criteria) this; + } + + public Criteria andWebPathLessThanOrEqualTo(String value) { + addCriterion("web_path <=", value, "webPath"); + return (Criteria) this; + } + + public Criteria andWebPathLike(String value) { + addCriterion("web_path like", value, "webPath"); + return (Criteria) this; + } + + public Criteria andWebPathNotLike(String value) { + addCriterion("web_path not like", value, "webPath"); + return (Criteria) this; + } + + public Criteria andWebPathIn(List values) { + addCriterion("web_path in", values, "webPath"); + return (Criteria) this; + } + + public Criteria andWebPathNotIn(List values) { + addCriterion("web_path not in", values, "webPath"); + return (Criteria) this; + } + + public Criteria andWebPathBetween(String value1, String value2) { + addCriterion("web_path between", value1, value2, "webPath"); + return (Criteria) this; + } + + public Criteria andWebPathNotBetween(String value1, String value2) { + addCriterion("web_path not between", value1, value2, "webPath"); + return (Criteria) this; + } + + public Criteria andCompanyIsNull() { + addCriterion("company is null"); + return (Criteria) this; + } + + public Criteria andCompanyIsNotNull() { + addCriterion("company is not null"); + return (Criteria) this; + } + + public Criteria andCompanyEqualTo(String value) { + addCriterion("company =", value, "company"); + return (Criteria) this; + } + + public Criteria andCompanyNotEqualTo(String value) { + addCriterion("company <>", value, "company"); + return (Criteria) this; + } + + public Criteria andCompanyGreaterThan(String value) { + addCriterion("company >", value, "company"); + return (Criteria) this; + } + + public Criteria andCompanyGreaterThanOrEqualTo(String value) { + addCriterion("company >=", value, "company"); + return (Criteria) this; + } + + public Criteria andCompanyLessThan(String value) { + addCriterion("company <", value, "company"); + return (Criteria) this; + } + + public Criteria andCompanyLessThanOrEqualTo(String value) { + addCriterion("company <=", value, "company"); + return (Criteria) this; + } + + public Criteria andCompanyLike(String value) { + addCriterion("company like", value, "company"); + return (Criteria) this; + } + + public Criteria andCompanyNotLike(String value) { + addCriterion("company not like", value, "company"); + return (Criteria) this; + } + + public Criteria andCompanyIn(List values) { + addCriterion("company in", values, "company"); + return (Criteria) this; + } + + public Criteria andCompanyNotIn(List values) { + addCriterion("company not in", values, "company"); + return (Criteria) this; + } + + public Criteria andCompanyBetween(String value1, String value2) { + addCriterion("company between", value1, value2, "company"); + return (Criteria) this; + } + + public Criteria andCompanyNotBetween(String value1, String value2) { + addCriterion("company not between", value1, value2, "company"); + return (Criteria) this; + } + + public Criteria andPositionIsNull() { + addCriterion("position is null"); + return (Criteria) this; + } + + public Criteria andPositionIsNotNull() { + addCriterion("position is not null"); + return (Criteria) this; + } + + public Criteria andPositionEqualTo(String value) { + addCriterion("position =", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotEqualTo(String value) { + addCriterion("position <>", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionGreaterThan(String value) { + addCriterion("position >", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionGreaterThanOrEqualTo(String value) { + addCriterion("position >=", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionLessThan(String value) { + addCriterion("position <", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionLessThanOrEqualTo(String value) { + addCriterion("position <=", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionLike(String value) { + addCriterion("position like", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotLike(String value) { + addCriterion("position not like", value, "position"); + return (Criteria) this; + } + + public Criteria andPositionIn(List values) { + addCriterion("position in", values, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotIn(List values) { + addCriterion("position not in", values, "position"); + return (Criteria) this; + } + + public Criteria andPositionBetween(String value1, String value2) { + addCriterion("position between", value1, value2, "position"); + return (Criteria) this; + } + + public Criteria andPositionNotBetween(String value1, String value2) { + addCriterion("position not between", value1, value2, "position"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Date value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Date value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Date value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Date value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Date value1, Date value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNull() { + addCriterion("rec_status is null"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNotNull() { + addCriterion("rec_status is not null"); + return (Criteria) this; + } + + public Criteria andRecStatusEqualTo(Byte value) { + addCriterion("rec_status =", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotEqualTo(Byte value) { + addCriterion("rec_status <>", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThan(Byte value) { + addCriterion("rec_status >", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("rec_status >=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThan(Byte value) { + addCriterion("rec_status <", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThanOrEqualTo(Byte value) { + addCriterion("rec_status <=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusIn(List values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List values) { + addCriterion("rec_status not in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusBetween(Byte value1, Byte value2) { + addCriterion("rec_status between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { + addCriterion("rec_status not between", value1, value2, "recStatus"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/signin/src/main/java/com/ccsens/signin/bean/vo/UserVo.java b/signin/src/main/java/com/ccsens/signin/bean/vo/UserVo.java new file mode 100644 index 00000000..396b4253 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/bean/vo/UserVo.java @@ -0,0 +1,165 @@ +package com.ccsens.signin.bean.vo; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +public class UserVo { + @Data + @ApiModel + public static class UserSign{ + @ApiModelProperty("用户Id") + private Long userId; + @ApiModelProperty("认证类型Id") + private Long authId; + } + + @Data + @ApiModel + public static class TokenBean { + @ApiModelProperty("用户id") + private Long id; + @ApiModelProperty("账号") + private String account; + @ApiModelProperty("手机号") + private String phone; + @ApiModelProperty("token") + private String token; + @ApiModelProperty("刷新token") + private String refresh_token; + @ApiModelProperty("微信信息") + private WxInfo wxInfo; + } + + @Data + @ApiModel + public static class SmsCode{ + @ApiModelProperty("手机号") + private String phone; + @ApiModelProperty("有效时间(秒)") + private Integer expiredInSeconds; + @JsonIgnore + private String smsCode; + } + + @Data + @ApiModel + public static class Account{ + @ApiModelProperty("用户id") + private Long id; + @ApiModelProperty("用户名") + private String username; + @ApiModelProperty("密码") + private String password; + } + + @Data + @ApiModel + public static class TokenToUserId{ + @ApiModelProperty("用户id") + private Long id; + } + + @Data + @ApiModel + public static class WxInfo{ + @ApiModelProperty("微信名") + private String nickname; + @ApiModelProperty("微信头像") + private String headImgUrl; + @ApiModelProperty("性别") + private Byte sex; + @ApiModelProperty("省") + private String province; + @ApiModelProperty("市") + private String city; + @ApiModelProperty("国家") + private String country; + @ApiModelProperty("语言") + private String language; + } + + @Data + @ApiModel("公众号用户") + public static class Oauth2WX{ + @ApiModelProperty("openid") + private String openid; + @ApiModelProperty("用户id") + private Long userId; + } + + @Data + @ApiModel("用户信息") + public static class UserInfo { + @ApiModelProperty("用户id") + private Long id; + @ApiModelProperty("昵称") + private String nickname; + @ApiModelProperty("头像") + private String avatarUrl; + } + + @Data + @ApiModel("查询个人信息") + public static class SelectUserInfo{ + @ApiModelProperty("userId") + private Long id; + @ApiModelProperty("账号") + private String account; + @ApiModelProperty("手机号") + private String phone; + @ApiModelProperty("昵称") + private String nickname; + @ApiModelProperty("头像") + private String avatarUrl; + @ApiModelProperty("个人签名") + private String signature; + @ApiModelProperty("个人简介") + private String introduction; + @ApiModelProperty("生日") + private String birthday; + @ApiModelProperty("所在地") + private String address; + @ApiModelProperty("网页") + private String webPath; + @ApiModelProperty("公司") + private String company; + @ApiModelProperty("职位") + private String position; + @ApiModelProperty("已使用tall多少天") + private Integer dayOfUseTall; + @JsonIgnore // 已使用tall多少天 + private Date createdAt; + @ApiModelProperty("空间使用情况") + private Interspace interspace; +// @ApiModelProperty("标签信息") +// private List labelList; + } + + @Data + @ApiModel("空间使用信息") + public static class Interspace{ + @ApiModelProperty("空间已有项目") + private Integer projectNum; + @ApiModelProperty("空间总项目(目前写无限制)") + private Integer projectTotal; + @ApiModelProperty("空间剩余(目前写无限制)") + private Integer interspaceResidue; + @ApiModelProperty("总空间(目前写无限制)") + private Integer interspaceTotal; + } + + @Data + @ApiModel("返回图片验证码") + public static class VerificationCode{ + @ApiModelProperty("图片验证码Id") + private String verificationCodeId; + @ApiModelProperty("图片的Base64字符串") + private String imageBase64; + } +} diff --git a/signin/src/main/java/com/ccsens/signin/config/BeanConfig.java b/signin/src/main/java/com/ccsens/signin/config/BeanConfig.java new file mode 100644 index 00000000..a7660236 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/config/BeanConfig.java @@ -0,0 +1,31 @@ +package com.ccsens.wisdomcar.config; + +import com.ccsens.wisdomcar.intercept.MybatisInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @description: + * @author: wuHuiJuan + * @create: 2019/12/03 18:01 + */ +@Configuration +public class BeanConfig { +// @Bean +// public static PropertySourcesPlaceholderConfigurer properties(){ +// PropertySourcesPlaceholderConfigurer conf = new PropertySourcesPlaceholderConfigurer(); +// YamlPropertiesFactoryBean yml = new YamlPropertiesFactoryBean(); +// yml.setResources(new ClassPathResource("business.yml")); +// conf.setProperties(yml.getObject()); +// return conf; +// } + + /** + * 注册拦截器 + */ + @Bean + public MybatisInterceptor mybatisInterceptor() { + MybatisInterceptor interceptor = new MybatisInterceptor(); + return interceptor; + } +} diff --git a/signin/src/main/java/com/ccsens/signin/config/SpringConfig.java b/signin/src/main/java/com/ccsens/signin/config/SpringConfig.java new file mode 100644 index 00000000..ba4c397f --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/config/SpringConfig.java @@ -0,0 +1,169 @@ +package com.ccsens.wisdomcar.config; + + +import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.IdUtil; +import com.ccsens.util.config.DruidProps; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.StringHttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.web.servlet.config.annotation.*; + +import javax.annotation.Resource; +import javax.sql.DataSource; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.List; + +@Configuration +//public class SpringConfig extends WebMvcConfigurationSupport { +public class SpringConfig implements WebMvcConfigurer { + @Resource + private DruidProps druidPropsUtil; + @Value("${spring.snowflake.workerId}") + private String workerId; + @Value("${spring.snowflake.datacenterId}") + private String datacenterId; + + /** + * 配置Converter + * @return + */ + @Bean + public HttpMessageConverter responseStringConverter() { + StringHttpMessageConverter converter = new StringHttpMessageConverter( + Charset.forName("UTF-8")); + return converter; + } + + @Bean + public HttpMessageConverter responseJsonConverter(){ + MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); + List mediaTypeList = new ArrayList<>(); + mediaTypeList.add(MediaType.TEXT_HTML); + mediaTypeList.add(MediaType.APPLICATION_JSON_UTF8); + converter.setSupportedMediaTypes(mediaTypeList); + + //converter.setObjectMapper(); + ObjectMapper objectMapper = new ObjectMapper(); + SimpleModule simpleModule = new SimpleModule(); + simpleModule.addSerializer(Long.class, ToStringSerializer.instance); + simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); + objectMapper.registerModule(simpleModule); + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + converter.setObjectMapper(objectMapper); + + return converter; + } + + @Override + public void configureMessageConverters(List> converters) { + //super.configureMessageConverters(converters); + converters.add(responseStringConverter()); + converters.add(responseJsonConverter()); + } + + @Override + public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { + configurer.favorPathExtension(false); + } + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") +// .allowedMethods("*") // 允许提交请求的方法,*表示全部允许 + .allowedOrigins("*") // #允许向该服务器提交请求的URI,*表示全部允许 + .allowCredentials(true) // 允许cookies跨域 + .allowedHeaders("*") // #允许访问的头信息,*表示全部 + .maxAge(18000L); // 预检请求的缓存时间(秒),即在这个时间段里,对于相同的跨域请求不会再预检了 + + } + + /** + * 配置视图解析器 SpringBoot建议使用Thymeleaf代替jsp,动态页面默认路径:resources/template,静态页面默认路径: resources/static + * @return + */ +// @Bean +// public ViewResolver getViewResolver() { +// InternalResourceViewResolver resolver = new InternalResourceViewResolver(); +// resolver.setPrefix("/WEB-INF/views/"); +// resolver.setSuffix(".jsp"); +// return resolver; +// } +// @Override +// public void configureDefaultServletHandling( +// DefaultServletHandlerConfigurer configurer) { +// configurer.enable(); +// } + + + /** + * 配置静态资源 + */ + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("swagger-ui.html") + .addResourceLocations("classpath:/META-INF/resources/"); + registry.addResourceHandler("/webjars/**") + .addResourceLocations("classpath:/META-INF/resources/webjars/"); + + registry.addResourceHandler("/uploads/**") + .addResourceLocations("file:///home/cloud/game/uploads/"); + //super.addResourceHandlers(registry); + } + + /** + * 配置拦截器 + * @param registry + */ + @Override + public void addInterceptors(InterceptorRegistry registry) { + //addPathPatterns 用于添加拦截规则 + //excludePathPatterns 用于排除拦截 +// registry.addInterceptor(tokenInterceptor()) +// .addPathPatterns("/projects/**") +// .addPathPatterns("/messages/**") +// .addPathPatterns("/users/**") +// .excludePathPatterns("/users/signin") +// .excludePathPatterns("/users/smscode") +// .excludePathPatterns("/users/signup") +// .excludePathPatterns("/users/password") +// .excludePathPatterns("/users/account") +// .excludePathPatterns("/users/token") +// .excludePathPatterns("/users/claims") +// .addPathPatterns("/plugins/**") +// .addPathPatterns("/delivers/**") +// .addPathPatterns("/tasks/**") +// .addPathPatterns("/members/**") +// .addPathPatterns("/templates/**") +// .addPathPatterns("/hardware/**"); + //super.addInterceptors(registry); + } +// +// @Bean +// public TokenInterceptor tokenInterceptor(){ +// return new TokenInterceptor(); +// } + + /** + * 配置数据源(单数据源) + */ + @Bean + public DataSource dataSource(){ + return druidPropsUtil.createDruidDataSource(); + } + + @Bean + public Snowflake snowflake(){ +// return new Snowflake(Long.valueOf(workerId),Long.valueOf(datacenterId)); + return IdUtil.createSnowflake(Long.valueOf(workerId),Long.valueOf(datacenterId)); + } +} \ No newline at end of file diff --git a/signin/src/main/java/com/ccsens/signin/config/SwaggerConfigure.java b/signin/src/main/java/com/ccsens/signin/config/SwaggerConfigure.java new file mode 100644 index 00000000..39e8e504 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/config/SwaggerConfigure.java @@ -0,0 +1,56 @@ +package com.ccsens.wisdomcar.config; + +import com.ccsens.util.WebConstant; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ParameterBuilder; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.schema.ModelRef; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Parameter; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.ArrayList; +import java.util.List; + +@Configuration +@EnableSwagger2 +@ConditionalOnExpression("${swagger.enable}") +//public class SwaggerConfigure extends WebMvcConfigurationSupport { +public class SwaggerConfigure /*implements WebMvcConfigurer*/ { + @Bean + public Docket customDocket() { + // + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + .select() + .apis(RequestHandlerSelectors + .basePackage("com.ccsens.signin.api")) + .build() + .globalOperationParameters(setHeaderToken()); + } + + private ApiInfo apiInfo() { + return new ApiInfo("Swagger Tall-game",//大标题 title + "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",//小标题 + "1.0.0",//版本 + "http://swagger.io/terms/",//termsOfServiceUrl + "zhangsan",//作者 + "Apache 2.0",//链接显示文字 + "http://www.apache.org/licenses/LICENSE-2.0.html"//网站链接 + ); + } + + private List setHeaderToken() { + ParameterBuilder tokenPar = new ParameterBuilder(); + List pars = new ArrayList<>(); + tokenPar.name(WebConstant.HEADER_KEY_TOKEN).description("token") + .defaultValue(WebConstant.HEADER_KEY_TOKEN_PREFIX) + .modelRef(new ModelRef("string")).parameterType("header").required(false).build(); + pars.add(tokenPar.build()); + return pars; + } +} diff --git a/signin/src/main/java/com/ccsens/signin/exception/GetCurrentPartiException.java b/signin/src/main/java/com/ccsens/signin/exception/GetCurrentPartiException.java new file mode 100644 index 00000000..2cf48ae1 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/exception/GetCurrentPartiException.java @@ -0,0 +1,10 @@ +package com.ccsens.signin.exception; + + +import com.ccsens.util.exception.BaseException; + +public class GetCurrentPartiException extends BaseException { + public GetCurrentPartiException(Integer code, String message) { + super(code, message); + } +} diff --git a/signin/src/main/java/com/ccsens/signin/exception/GetCurrentUserException.java b/signin/src/main/java/com/ccsens/signin/exception/GetCurrentUserException.java new file mode 100644 index 00000000..48830c96 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/exception/GetCurrentUserException.java @@ -0,0 +1,11 @@ +package com.ccsens.signin.exception; + +import com.ccsens.util.exception.BaseException; +import lombok.Getter; + +@Getter +public class GetCurrentUserException extends BaseException { + public GetCurrentUserException(int code, String msg){ + super(code,msg); + } +} diff --git a/signin/src/main/java/com/ccsens/signin/exception/GetTaskException.java b/signin/src/main/java/com/ccsens/signin/exception/GetTaskException.java new file mode 100644 index 00000000..34af29c1 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/exception/GetTaskException.java @@ -0,0 +1,10 @@ +package com.ccsens.signin.exception; + + +import com.ccsens.util.exception.BaseException; + +public class GetTaskException extends BaseException { + public GetTaskException(Integer code, String message) { + super(code, message); + } +} diff --git a/signin/src/main/java/com/ccsens/signin/exception/PartiLoginException.java b/signin/src/main/java/com/ccsens/signin/exception/PartiLoginException.java new file mode 100644 index 00000000..5ed06b29 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/exception/PartiLoginException.java @@ -0,0 +1,10 @@ +package com.ccsens.signin.exception; + + +import com.ccsens.util.exception.BaseException; + +public class PartiLoginException extends BaseException { + public PartiLoginException(Integer code, String message) { + super(code, message); + } +} diff --git a/signin/src/main/java/com/ccsens/signin/exception/SmsException.java b/signin/src/main/java/com/ccsens/signin/exception/SmsException.java new file mode 100644 index 00000000..e187ecbd --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/exception/SmsException.java @@ -0,0 +1,17 @@ +package com.ccsens.signin.exception; + + +import com.ccsens.util.WebConstant; +import com.ccsens.util.exception.BaseException; + +public class SmsException extends BaseException { + public static final String Error_SendTooFast = WebConstant.Exist_Verify_Code_In_Seconds + "内只能发送一次,请稍后再试"; + + public SmsException(String message) { + super(message); + } + + public SmsException(Integer code,String message) { + super(code,message); + } +} diff --git a/signin/src/main/java/com/ccsens/signin/exception/TaskValidateException.java b/signin/src/main/java/com/ccsens/signin/exception/TaskValidateException.java new file mode 100644 index 00000000..d68f4068 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/exception/TaskValidateException.java @@ -0,0 +1,10 @@ +package com.ccsens.signin.exception; + + +import com.ccsens.util.exception.BaseException; + +public class TaskValidateException extends BaseException { + public TaskValidateException(int i, String s) { + super(i,s); + } +} diff --git a/signin/src/main/java/com/ccsens/signin/exception/UnAuthenticationException.java b/signin/src/main/java/com/ccsens/signin/exception/UnAuthenticationException.java new file mode 100644 index 00000000..f0d3452e --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/exception/UnAuthenticationException.java @@ -0,0 +1,10 @@ +package com.ccsens.signin.exception; + + +import com.ccsens.util.exception.BaseException; + +public class UnAuthenticationException extends BaseException { + public UnAuthenticationException() { + super(400,"未认证的用户"); + } +} diff --git a/signin/src/main/java/com/ccsens/signin/exception/UnAuthorizationException.java b/signin/src/main/java/com/ccsens/signin/exception/UnAuthorizationException.java new file mode 100644 index 00000000..151ce9b5 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/exception/UnAuthorizationException.java @@ -0,0 +1,10 @@ +package com.ccsens.signin.exception; + + +import com.ccsens.util.exception.BaseException; + +public class UnAuthorizationException extends BaseException { + public UnAuthorizationException() { + super(401,"未授权的用户"); + } +} diff --git a/signin/src/main/java/com/ccsens/signin/exception/UserLoginException.java b/signin/src/main/java/com/ccsens/signin/exception/UserLoginException.java new file mode 100644 index 00000000..1a4ad1fc --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/exception/UserLoginException.java @@ -0,0 +1,10 @@ +package com.ccsens.signin.exception; + + +import com.ccsens.util.exception.BaseException; + +public class UserLoginException extends BaseException { + public UserLoginException(int code,String message){ + super(code,message); + } +} diff --git a/signin/src/main/java/com/ccsens/signin/intercept/MybatisInterceptor.java b/signin/src/main/java/com/ccsens/signin/intercept/MybatisInterceptor.java new file mode 100644 index 00000000..d63f9443 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/intercept/MybatisInterceptor.java @@ -0,0 +1,159 @@ +package com.ccsens.wisdomcar.intercept; + +import cn.hutool.core.collection.CollectionUtil; +import com.ccsens.util.WebConstant; +import org.apache.ibatis.executor.Executor; +import org.apache.ibatis.mapping.BoundSql; +import org.apache.ibatis.mapping.MappedStatement; +import org.apache.ibatis.mapping.ResultMap; +import org.apache.ibatis.mapping.SqlSource; +import org.apache.ibatis.plugin.*; +import org.apache.ibatis.reflection.DefaultReflectorFactory; +import org.apache.ibatis.reflection.MetaObject; +import org.apache.ibatis.reflection.factory.DefaultObjectFactory; +import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory; +import org.apache.ibatis.session.ResultHandler; +import org.apache.ibatis.session.RowBounds; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +/** + * @description: + * @author: wuHuiJuan + * @create: 2019/12/11 10:58 + */ +@Intercepts({ + @Signature( + type = Executor.class, + method = "query", + args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class} + ) +}) +public class MybatisInterceptor implements Interceptor { + @Override + public Object intercept(Invocation invocation) throws Throwable { + + + String selectByExample = "selectByExample"; + String countByExample = "countByExample"; + String countByExample2 = "selectByExample_COUNT"; + String selectByPrimaryKey = "selectByPrimaryKey"; + + Object[] args = invocation.getArgs(); + MappedStatement statement = (MappedStatement) args[0]; + if (statement.getId().endsWith(selectByExample) + || statement.getId().endsWith(countByExample) + || statement.getId().endsWith(countByExample2)) { + //XXXExample + Object example = args[1]; + + addCondition(statement, example); + + + + + } else if (statement.getId().endsWith(selectByPrimaryKey)) { + BoundSql boundSql = statement.getBoundSql(args[1]); + String sql = boundSql.getSql() + " and rec_status = 0"; + MappedStatement newStatement = newMappedStatement(statement, new BoundSqlSqlSource(boundSql)); + MetaObject msObject = MetaObject.forObject(newStatement, new DefaultObjectFactory(), new DefaultObjectWrapperFactory(),new DefaultReflectorFactory()); + msObject.setValue("sqlSource.boundSql.sql", sql); + args[0] = newStatement; + } + + return invocation.proceed(); + } + + private void addCondition(MappedStatement statement, Object example) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException { + if (example instanceof Map) { + example = ((Map) example).get("_ORIGINAL_PARAMETER_OBJECT"); + } + + + Method method = example.getClass().getMethod("getOredCriteria", null); + //获取到条件数组,第一个是Criteria + List list = (List) method.invoke(example); + if (CollectionUtil.isEmpty(list)) { + Class clazz = ((ResultMap) statement.getResultMaps().get(0)).getType(); + String exampleName = clazz.getName() + "Example"; + Object paramExample = Class.forName(exampleName).newInstance(); + Method createCriteria = paramExample.getClass().getMethod("createCriteria"); + Object criteria = createCriteria.invoke(paramExample); + Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); + andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); + list.add(criteria); + } else { + Object criteria = list.get(0); + Method getCriteria = criteria.getClass().getMethod("getCriteria"); + List params = (List) getCriteria.invoke(criteria); + boolean hasDel = false; + for (Object param : params) { + Method getCondition = param.getClass().getMethod("getCondition"); + Object condition = getCondition.invoke(param); + if ("rec_status =".equals(condition)) { + hasDel = true; + } + } + if (!hasDel) { + Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); + andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); + } + + } + + } + + @Override + public Object plugin(Object target) { + return Plugin.wrap(target, this); + } + + @Override + public void setProperties(Properties properties) { + + } + + private MappedStatement newMappedStatement(MappedStatement ms, SqlSource newSqlSource) { + MappedStatement.Builder builder = + new MappedStatement.Builder(ms.getConfiguration(), ms.getId(), newSqlSource, ms.getSqlCommandType()); + builder.resource(ms.getResource()); + builder.fetchSize(ms.getFetchSize()); + builder.statementType(ms.getStatementType()); + builder.keyGenerator(ms.getKeyGenerator()); + if (ms.getKeyProperties() != null && ms.getKeyProperties().length != 0) { + StringBuilder keyProperties = new StringBuilder(); + for (String keyProperty : ms.getKeyProperties()) { + keyProperties.append(keyProperty).append(","); + } + keyProperties.delete(keyProperties.length() - 1, keyProperties.length()); + builder.keyProperty(keyProperties.toString()); + } + builder.timeout(ms.getTimeout()); + builder.parameterMap(ms.getParameterMap()); + builder.resultMaps(ms.getResultMaps()); + builder.resultSetType(ms.getResultSetType()); + builder.cache(ms.getCache()); + builder.flushCacheRequired(ms.isFlushCacheRequired()); + builder.useCache(ms.isUseCache()); + + return builder.build(); + } + + + // 定义一个内部辅助类,作用是包装sq + class BoundSqlSqlSource implements SqlSource { + private BoundSql boundSql; + public BoundSqlSqlSource(BoundSql boundSql) { + this.boundSql = boundSql; + } + @Override + public BoundSql getBoundSql(Object parameterObject) { + return boundSql; + } + } + +} diff --git a/signin/src/main/java/com/ccsens/signin/persist/dao/SysAuthDao.java b/signin/src/main/java/com/ccsens/signin/persist/dao/SysAuthDao.java new file mode 100644 index 00000000..19bea275 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/persist/dao/SysAuthDao.java @@ -0,0 +1,18 @@ +package com.ccsens.signin.persist.dao; + + +import com.ccsens.signin.bean.vo.UserVo; +import com.ccsens.signin.persist.mapper.SysAuthMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface SysAuthDao extends SysAuthMapper { + /** + * 查询关注了公众号的用户的openid + * @param userIds + * @return + */ + List queryOauth2WX(List userIds); +} diff --git a/signin/src/main/java/com/ccsens/signin/persist/dao/SysUserDao.java b/signin/src/main/java/com/ccsens/signin/persist/dao/SysUserDao.java new file mode 100644 index 00000000..74624655 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/persist/dao/SysUserDao.java @@ -0,0 +1,65 @@ +package com.ccsens.signin.persist.dao; + + +import com.ccsens.signin.bean.vo.UserVo; +import com.ccsens.signin.persist.mapper.SysUserMapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface SysUserDao extends SysUserMapper { + + void replaceAuth(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId); + + void replaceAttention(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId); + + void replaceBalance(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId); + + void replaceProject(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId); + + void replaceMember(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId); + + void replaceDeliverPostLog(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId); + + void replaceProLog(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId); + + String getUserNameByUserId(@Param("userId") Long userId); + + void replaceComment(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId); + + /** + * 查询用户信息 + * @param userId 用户id + * @return 用户信息 + */ + UserVo.UserInfo getUserInfoByUserId(Long userId); + + /** + * 根据id查询用户信息 + * @param ids 用户id数组 + * @return 用户信息列表 + */ + List queryUserInfos(Long[] ids); + /** + * 查找个人详细信息 + * @param currentUserId userId + * @return 个人信息 + */ + UserVo.SelectUserInfo selectUserInfo(@Param("userId") Long currentUserId); + + /** + * 获取空间使用信息 + * @param currentUserId userId + * @return 目前只查询用户创建了几个项目 + */ + UserVo.Interspace selectInterspace(@Param("userId") Long currentUserId); + + /** + * 查询登录返回的信息 + * @param userId + * @return + */ + UserVo.TokenBean getTokenBeanByUserId(Long userId); +} diff --git a/signin/src/main/java/com/ccsens/signin/persist/dao/SysUserInfoDao.java b/signin/src/main/java/com/ccsens/signin/persist/dao/SysUserInfoDao.java new file mode 100644 index 00000000..b50ae868 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/persist/dao/SysUserInfoDao.java @@ -0,0 +1,8 @@ +package com.ccsens.signin.persist.dao; + +import com.ccsens.signin.persist.mapper.SysUserInfoMapper; +import org.springframework.stereotype.Repository; + +@Repository +public interface SysUserInfoDao extends SysUserInfoMapper { +} diff --git a/signin/src/main/java/com/ccsens/signin/persist/mapper/SysAuthMapper.java b/signin/src/main/java/com/ccsens/signin/persist/mapper/SysAuthMapper.java new file mode 100644 index 00000000..e3d0235e --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/persist/mapper/SysAuthMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.signin.persist.mapper; + +import com.ccsens.signin.bean.po.SysAuth; +import com.ccsens.signin.bean.po.SysAuthExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SysAuthMapper { + long countByExample(SysAuthExample example); + + int deleteByExample(SysAuthExample example); + + int deleteByPrimaryKey(Long id); + + int insert(SysAuth record); + + int insertSelective(SysAuth record); + + List selectByExample(SysAuthExample example); + + SysAuth selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") SysAuth record, @Param("example") SysAuthExample example); + + int updateByExample(@Param("record") SysAuth record, @Param("example") SysAuthExample example); + + int updateByPrimaryKeySelective(SysAuth record); + + int updateByPrimaryKey(SysAuth record); +} \ No newline at end of file diff --git a/signin/src/main/java/com/ccsens/signin/persist/mapper/SysUserInfoMapper.java b/signin/src/main/java/com/ccsens/signin/persist/mapper/SysUserInfoMapper.java new file mode 100644 index 00000000..85c6305e --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/persist/mapper/SysUserInfoMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.signin.persist.mapper; + +import com.ccsens.signin.bean.po.SysUserInfo; +import com.ccsens.signin.bean.po.SysUserInfoExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SysUserInfoMapper { + long countByExample(SysUserInfoExample example); + + int deleteByExample(SysUserInfoExample example); + + int deleteByPrimaryKey(Long id); + + int insert(SysUserInfo record); + + int insertSelective(SysUserInfo record); + + List selectByExample(SysUserInfoExample example); + + SysUserInfo selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") SysUserInfo record, @Param("example") SysUserInfoExample example); + + int updateByExample(@Param("record") SysUserInfo record, @Param("example") SysUserInfoExample example); + + int updateByPrimaryKeySelective(SysUserInfo record); + + int updateByPrimaryKey(SysUserInfo record); +} \ No newline at end of file diff --git a/signin/src/main/java/com/ccsens/signin/persist/mapper/SysUserMapper.java b/signin/src/main/java/com/ccsens/signin/persist/mapper/SysUserMapper.java new file mode 100644 index 00000000..681d7a20 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/persist/mapper/SysUserMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.signin.persist.mapper; + +import com.ccsens.signin.bean.po.SysUser; +import com.ccsens.signin.bean.po.SysUserExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SysUserMapper { + long countByExample(SysUserExample example); + + int deleteByExample(SysUserExample example); + + int deleteByPrimaryKey(Long id); + + int insert(SysUser record); + + int insertSelective(SysUser record); + + List selectByExample(SysUserExample example); + + SysUser selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") SysUser record, @Param("example") SysUserExample example); + + int updateByExample(@Param("record") SysUser record, @Param("example") SysUserExample example); + + int updateByPrimaryKeySelective(SysUser record); + + int updateByPrimaryKey(SysUser record); +} \ No newline at end of file diff --git a/signin/src/main/java/com/ccsens/signin/service/IUserInfoService.java b/signin/src/main/java/com/ccsens/signin/service/IUserInfoService.java new file mode 100644 index 00000000..083d425a --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/service/IUserInfoService.java @@ -0,0 +1,48 @@ +package com.ccsens.signin.service; + +import com.ccsens.signin.bean.dto.UserDto; +import com.ccsens.signin.bean.vo.UserVo; + +import javax.servlet.http.Part; + +/** + * @author 逗 + */ +public interface IUserInfoService { + /** + * 修改登录的账号 + * @param userId 用户id + * @param changeAccount 验证码和新账号 + */ + void updateAccount(Long userId, UserDto.UpdateAccount changeAccount); + + /** + * 修改昵称 + * @param userId 用户id + * @param updateNickname 新昵称 + */ + void updateNickname(Long userId, UserDto.UpdateNickname updateNickname); + + /** + * 上传头像 + * @param currentUserId userId + * @param file 上传的文件 + * @throws Exception 文件异常 + */ + void uploadAvatarUrl(Long currentUserId, Part file) throws Exception; + + /** + * 查找全部个人信息 + * @param currentUserId userId + * @return 个人信息 + */ + UserVo.SelectUserInfo selectUserInfo(Long currentUserId); + + /** + * 修改个人详细信息 + * @param currentUserId userId + * @param updateUserInfo 需要修改的信息,为空则不需要修改 + * @return 返回当前用户的详细信息 + */ + UserVo.SelectUserInfo updateUserInfo(Long currentUserId, UserDto.UpdateUserInfo updateUserInfo); +} \ No newline at end of file diff --git a/signin/src/main/java/com/ccsens/signin/service/IUserService.java b/signin/src/main/java/com/ccsens/signin/service/IUserService.java new file mode 100644 index 00000000..eb2681d2 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/service/IUserService.java @@ -0,0 +1,110 @@ +package com.ccsens.signin.service; + +import com.ccsens.signin.bean.dto.UserDto; +import com.ccsens.signin.bean.po.SysUser; +import com.ccsens.signin.bean.vo.UserVo; +import com.ccsens.util.WebConstant; + +import java.util.List; +import java.util.Map; + +/** + * @author 逗 + */ +public interface IUserService { + UserVo.UserSign signin(WebConstant.CLIENT_TYPE clientType, WebConstant.IDENTIFY_TYPE identifyType, + String identifier, String credential, String clientIp, String redirect) throws Exception; + + UserVo.TokenBean generateToken(WebConstant.CLIENT_TYPE client_type, Object subject, Map payLoads) throws Exception; + + UserVo.TokenBean getUserInfoAndToken(WebConstant.CLIENT_TYPE client_type, WebConstant.IDENTIFY_TYPE identify_type, UserVo.UserSign userSignVo, Map theMap) throws Exception; + + boolean tokenNotExistInCache(Long authId) throws Exception; + + UserVo.SmsCode getSignInSmsCode(String phone, String verificationCodeId, String verificationCodeValue) throws Exception; + + SysUser getUserById(Long aLong) throws Exception; + + UserVo.UserSign registerUser(UserDto.UserSignup userSignup)throws Exception; + + UserVo.UserSign bindingNewPhone(Long currentUserId, UserDto.WxBindingPhone wxPhone)throws Exception; + + String getPhone(Long userId); + + void updatePhone(Long currentUserId, UserDto.UpdatePhone updatePhone) throws Exception; + + Boolean findAccount(String account); + + Boolean findPhone(String phone); + + UserVo.UserSign saveAuth(UserDto.UserSignup userSignup); + + void updateAccount(UserDto.Account account); + + /** + * 通过手机号修改密码 + * @param passwordDto 手机号验证码 + */ + void updatePassword(UserDto.UpdatePassword passwordDto) throws Exception; + + /** + * 通过账号密码修改密码 + * @param passwordDto 账号旧密码和新密码 + */ + void updatePasswordByAccount(UserDto.UpdatePasswordByAccount passwordDto) throws Exception; + + /** + * 通过手机号查找userId + * @param phoneCell 手机号 + * @return userId + */ + Long selectUserIdByPhone(String phoneCell)throws Exception; + + String selectAccountByPhone(String phone)throws Exception; + +// List selectUserIdByRoleId(Long roleId)throws Exception; +// +// Boolean getIsAttention(Long currentUserId, Long projectId); + +// void userAttentionProject(Long currentUserId, ProjectDto.ProjectIdDto projectIdDto); + + //默认注册 + /** + *@Description: 注冊用戶,若用戶手机号存在,则默认用户已注册,不做任何操作;若账号重复,则再名字后面添加_1(递增,直到不重复) + * @param signup + *@return: long + *@Author: wuhuijuan + *@date: 2019/10/29 14:43 + */ + long defaultRegisterUser(com.ccsens.cloudutil.bean.tall.dto.UserDto.DefaultUserSingup signup); + + + UserVo.UserSign mergeByPhone(Long currentUserId, UserDto.WxMergePhone wxPhone); + + UserVo.WxInfo updateUserInfo(Long currentUserId, UserDto.WxInfo userInfo); + + void relievePhone(Long userId, UserDto.WxBindingPhone phoneInfo); + + UserVo.UserSign changePhoneNotPassword(Long userId, UserDto.WxBindingPhone phoneInfo) throws Exception; + + UserVo.TokenBean getTokenByUserId(Long userId); + + void mergeUserId(Long userId, Long uselessId); + + UserVo.Account systemRegister(UserDto.UserSignupSystem userSignup); + + String getUserNameByUserId(Long userId); + + /** + * 根据id查询用户信息 + * @param ids + * @return + */ + List queryUserInfos(Long[] ids); + + /** + * 获取图片验证码信息 + * @return 返回图片转成的base64字符串,和图片的id + */ + UserVo.VerificationCode getVertifyCode(); +} diff --git a/signin/src/main/java/com/ccsens/signin/service/UserInfoService.java b/signin/src/main/java/com/ccsens/signin/service/UserInfoService.java new file mode 100644 index 00000000..5dc6de93 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/service/UserInfoService.java @@ -0,0 +1,258 @@ +package com.ccsens.signin.service; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ImageUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.ccsens.signin.bean.dto.UserDto; +import com.ccsens.signin.bean.po.*; +import com.ccsens.signin.bean.vo.UserVo; +import com.ccsens.signin.persist.dao.SysAuthDao; +import com.ccsens.signin.persist.dao.SysUserDao; +import com.ccsens.signin.persist.dao.SysUserInfoDao; +import com.ccsens.signin.util.TallConstant; +import com.ccsens.util.*; +import com.ccsens.util.exception.BaseException; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.FileUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import javax.servlet.http.Part; +import java.io.File; +import java.security.NoSuchAlgorithmException; +import java.security.spec.InvalidKeySpecException; +import java.util.Date; +import java.util.List; + +/** + * @author 逗 + */ +@Slf4j +@Service +@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) +public class UserInfoService implements IUserInfoService{ + @Resource + private RedisUtil redisUtil; + @Resource + private SysAuthDao sysAuthDao; + @Resource + private SysUserDao sysUserDao; +// @Resource +// private SysLabelDao sysLabelDao; + @Resource + private SysUserInfoDao sysUserInfoDao; + @Resource + private Snowflake snowflake; + + @Override + public void updateAccount(Long userId, UserDto.UpdateAccount changeAccount) { + //判断验证码是否正确 + if (redisUtil.hasKey(RedisKeyManager.getSigninSmsKey(changeAccount.getPhone()))) { + if (changeAccount.getSmsCode().equals(redisUtil.get(RedisKeyManager.getSigninSmsKey(changeAccount.getPhone())).toString())) { + //查找redis该账号是否正在使用 + String accountKey = TallConstant.getUpdateAccount(changeAccount.getAccount()); + if(redisUtil.hasKey(accountKey)){ + throw new BaseException(CodeEnum.ALREADY_EXIST_ACCOUNT); + } + //未查到则存进redis时效一分钟 + redisUtil.set(accountKey,changeAccount.getAccount(),60); + //检查数据库内账号是否存在 + SysAuthExample sysAuthExample = new SysAuthExample(); + sysAuthExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value) + .andIdentifierEqualTo(changeAccount.getAccount()); + List sysAuthList = sysAuthDao.selectByExample(sysAuthExample); + if(CollectionUtil.isNotEmpty(sysAuthList)){ + throw new BaseException(CodeEnum.ALREADY_EXIST_ACCOUNT); + } + //修改账号 + SysAuthExample authAccountExample = new SysAuthExample(); + authAccountExample.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value); + List authList = sysAuthDao.selectByExample(authAccountExample); + if(CollectionUtil.isNotEmpty(authList)){ + authList.forEach(sysAuth -> { + //验证密码 + try { + if (!ShiroKit.authenticate(changeAccount.getPassword(), sysAuth.getCredential(), sysAuth.getSalt())) { + throw new BaseException(CodeEnum.PASSWORD_ERROR); + } + sysAuth.setIdentifier(changeAccount.getAccount()); + sysAuthDao.updateByPrimaryKeySelective(sysAuth); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } catch (InvalidKeySpecException e) { + e.printStackTrace(); + } + }); + }else { + //不存在则添加账号 + SysAuth sysAuth = new SysAuth(); + sysAuth.setId(snowflake.nextId()); + sysAuth.setUserId(userId); + sysAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Account.value); + sysAuth.setIdentifier(changeAccount.getAccount()); + sysAuth.setSalt(ShiroKit.getRandomSalt(6)); + sysAuth.setCredential(ShiroKit.md5(changeAccount.getPassword(), sysAuth.getSalt())); + sysAuthDao.insertSelective(sysAuth); + } + //修改完删除redis + redisUtil.del(accountKey); + }else { + throw new BaseException(CodeEnum.SMS_CODE_CORRECT); + } + }else { + throw new BaseException(CodeEnum.SMS_CODE_CORRECT); + } + } + + @Override + public void updateNickname(Long userId, UserDto.UpdateNickname updateNickname) { + //查找redis该昵称是否正在使用 + String nicknameKey = TallConstant.getUpdateNickname(updateNickname.getNickname()); + if(redisUtil.hasKey(nicknameKey)){ + throw new BaseException(CodeEnum.NICKNAME_REPEAT); + } + //未查到则存进redis时效一分钟 + redisUtil.set(nicknameKey,updateNickname.getNickname(),60); + //查找数据库此昵称是否存在 + SysUserExample sysUserExample = new SysUserExample(); + sysUserExample.createCriteria().andNicknameEqualTo(updateNickname.getNickname()); + List userList = sysUserDao.selectByExample(sysUserExample); + if(CollectionUtil.isNotEmpty(userList)){ + throw new BaseException(CodeEnum.NICKNAME_REPEAT); + } + SysUser user = sysUserDao.selectByPrimaryKey(userId); + if(ObjectUtil.isNotNull(user)){ + user.setNickname(updateNickname.getNickname()); + sysUserDao.updateByPrimaryKeySelective(user); + } + redisUtil.del(nicknameKey); + } + + @Override + public void uploadAvatarUrl(Long currentUserId, Part file) throws Exception { + //获取文件大小 + float fileSize = (float) file.getSize(); + System.out.println(fileSize); + //计算出倍数 + float a = (float)(80 * 1024) / fileSize; + System.out.println(a); + //限制文件格式 + String allowedExts = "png,jpg,jpeg"; + String original = UploadFileUtil_Servlet3.getFileNameByPart(file); + String ext = FileUtil.extName(original); + if (StrUtil.isEmpty(ext) || !allowedExts.contains(ext)){ + throw new NotSupportedFileTypeException("不支持的格式类型: " + ext); + } + //创建文件目录及名字 + String extraPath = DateUtil.format(new Date(), "yyyyMMdd"); + //上传的文件 + String temporaryFilePath = File.separator + IdUtil.simpleUUID() + "." + ext; + File temporaryFile = new File(WebConstant.UPLOAD_AVATAR_URL + extraPath + temporaryFilePath); + FileUtils.copyInputStreamToFile(file.getInputStream(), temporaryFile); + //压缩后的文件 + String compressFilePath = File.separator + IdUtil.simpleUUID() + "." + ext; + File compressFile = new File(WebConstant.UPLOAD_AVATAR_URL+ extraPath + compressFilePath); + //文件大于80k则进行压缩,否则不压缩 + if(a < 1) { + ImageUtil.scale(temporaryFile, compressFile, a); + } + //获取文件的压缩前的文件名 + String fullPath = WebConstant.UPLOAD_PATH_AVATAR_URL + File.separator + extraPath + temporaryFilePath; + //压缩前和压缩后的文件都存在则删除压缩前的文件 + if(temporaryFile.exists() && compressFile.exists()){ + FileUtil.del(temporaryFile); + //压缩成功后获取压缩后的文件名 + fullPath = WebConstant.UPLOAD_PATH_AVATAR_URL + File.separator + extraPath + compressFilePath; + } + + //查找到当前的用户,修改头像路径信息 + SysUser sysUser = sysUserDao.selectByPrimaryKey(currentUserId); + + sysUser.setAvatarUrl(PropUtil.gatewayUrl + WebConstant.TALL_UPLOADS + fullPath); + sysUserDao.updateByPrimaryKeySelective(sysUser); + } + + @Override + public UserVo.SelectUserInfo selectUserInfo(Long currentUserId){ + UserVo.SelectUserInfo selectUserInfo = sysUserDao.selectUserInfo(currentUserId); + if(ObjectUtil.isNotNull(selectUserInfo)){ + //计算注册时长 + if(ObjectUtil.isNotNull(selectUserInfo.getCreatedAt())){ + long now = System.currentTimeMillis(); + selectUserInfo.setDayOfUseTall((int) ((now - selectUserInfo.getCreatedAt().getTime()) / 1000 / 3600 / 24)); + } +// //获取标签信息 +// selectUserInfo.setLabelList(sysLabelDao.selectLabelByUserId(currentUserId,null,null)); + //获取空间使用信息 + UserVo.Interspace interspace = sysUserDao.selectInterspace(currentUserId); + selectUserInfo.setInterspace(interspace); + } + + return selectUserInfo; + } + + @Override + public UserVo.SelectUserInfo updateUserInfo(Long currentUserId, UserDto.UpdateUserInfo updateUserInfo) { + //查找用户 + SysUser user = sysUserDao.selectByPrimaryKey(updateUserInfo.getId()); + if(ObjectUtil.isNull(user)){ + throw new BaseException(CodeEnum.NOT_USER); + } + //查找用户详细信息的记录 + SysUserInfo sysUserInfo; + SysUserInfoExample sysUserInfoExample = new SysUserInfoExample(); + sysUserInfoExample.createCriteria().andUserIdEqualTo(updateUserInfo.getId()); + List sysUserInfoList = sysUserInfoDao.selectByExample(sysUserInfoExample); + if(CollectionUtil.isNotEmpty(sysUserInfoList)){ + sysUserInfo = sysUserInfoList.get(0); + }else { + sysUserInfo = new SysUserInfo(); + sysUserInfo.setId(snowflake.nextId()); + sysUserInfo.setUserId(updateUserInfo.getId()); + sysUserInfoDao.insertSelective(sysUserInfo); + } + //修改昵称 + if(StrUtil.isNotEmpty(updateUserInfo.getNickname())){ + UserDto.UpdateNickname updateNickname = new UserDto.UpdateNickname(); + updateNickname.setNickname(updateUserInfo.getNickname()); + updateNickname(updateUserInfo.getId(),updateNickname); + } + //个人签名 + if(StrUtil.isNotEmpty(updateUserInfo.getSignature())){ + sysUserInfo.setSignature(updateUserInfo.getSignature()); + } + //个人简介 + if(StrUtil.isNotEmpty(updateUserInfo.getIntroduction())){ + sysUserInfo.setIntroduction(updateUserInfo.getIntroduction()); + } + //生日 + if(StrUtil.isNotEmpty(updateUserInfo.getBirthday())){ + sysUserInfo.setBirthday(updateUserInfo.getBirthday()); + } + //所在地 + if(StrUtil.isNotEmpty(updateUserInfo.getAddress())){ + sysUserInfo.setAddress(updateUserInfo.getAddress()); + } + //网页 + if(StrUtil.isNotEmpty(updateUserInfo.getWebPath())){ + sysUserInfo.setWebPath(updateUserInfo.getWebPath()); + } + //公司 + if(StrUtil.isNotEmpty(updateUserInfo.getCompany())){ + sysUserInfo.setCompany(updateUserInfo.getCompany()); + } + //职位 + if(StrUtil.isNotEmpty(updateUserInfo.getPosition())){ + sysUserInfo.setPosition(updateUserInfo.getPosition()); + } + sysUserInfoDao.updateByPrimaryKeySelective(sysUserInfo); + return selectUserInfo(updateUserInfo.getId()); + } +} diff --git a/signin/src/main/java/com/ccsens/signin/service/UserService.java b/signin/src/main/java/com/ccsens/signin/service/UserService.java new file mode 100644 index 00000000..298a6b82 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/service/UserService.java @@ -0,0 +1,1621 @@ +package com.ccsens.signin.service; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.ccsens.cloudutil.feign.HealthFeignClient; +import com.ccsens.signin.bean.dto.UserDto; +import com.ccsens.signin.bean.po.SysAuth; +import com.ccsens.signin.bean.po.SysAuthExample; +import com.ccsens.signin.bean.po.SysUser; +import com.ccsens.signin.bean.vo.UserVo; +import com.ccsens.signin.exception.SmsException; +import com.ccsens.signin.persist.dao.SysAuthDao; +import com.ccsens.signin.persist.dao.SysUserDao; +import com.ccsens.signin.util.TallConstant; +import com.ccsens.util.*; +import com.ccsens.util.bean.wx.po.WxOauth2UserInfo; +import com.ccsens.util.enterprisewx.WeiXinConstant; +import com.ccsens.util.enterprisewx.vo.WeiXinVo; +import com.ccsens.util.exception.BaseException; +import com.ccsens.util.wx.WxGzhUtil; +import com.ccsens.util.wx.WxXcxUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.RandomStringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @author 逗 + */ +@Slf4j +@Service +@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) +public class UserService implements IUserService { + @Resource + private SysUserDao userDao; + @Resource + private SysAuthDao authDao; +// @Resource +// private ProMemberDao memberDao; +// @Resource +// private ProRoleDao proRoleDao; +// @Resource +// private ProMemberRoleDao memberRoleDao; +// @Resource +// private SysBalanceLogDao sysBalanceLogDao; + @Resource + private Snowflake snowflake; + @Resource + private RedisUtil redisUtil; +// @Resource +// private SysProjectDao sysProjectDao; +// @Resource +// private UserAttentionDao userAttentionDao; + @Resource + private HealthFeignClient healthFeignClient; + + + /** + * 登录 + */ + @Override + public UserVo.UserSign signin(WebConstant.CLIENT_TYPE clientType, WebConstant.IDENTIFY_TYPE identifyType, + String identifier, String credential, String clientIp, String redirect) throws Exception { + UserVo.UserSign userSignVo; + //1.登陆 + userSignVo = __signin(identifyType, identifier, credential, redirect); +// if (ObjectUtil.isNotNull(userSignVo) && ObjectUtil.isNotNull(userSignVo.getAuthId())) { +// //2.添加登陆记录 +// __addSigninRecord(clientType, clientIp, userSignVo.getAuthId()); +// } + return userSignVo; + } + + private UserVo.UserSign __signin(WebConstant.IDENTIFY_TYPE identifyType, + String identifier, String credential, String redirect) throws Exception { + switch (identifyType) { + case WxEnterprise: + return wxEnterpriseLogin(identifier, credential, redirect); + case Wxmp: + credential = credential == null ? "old" : credential; + return wxmplogin(identifier, credential); + case OAUTH2_Wx: + return wxLogin(identifyType, identifier); + case Wx_H5: + return wxH5Login(identifyType, identifier); + case OAUTH2_WeiBo: + //Fix Me. + break; + case Phone: + return phoneLogin(identifier, credential); + case Email: +// return emailLogin(identifier, credential); + case Account: + return accountLogin(identifier, credential); + default: + break; + } + return null; + } + + /** + * 企业登录 + * @return 返回用户信息 + */ + private UserVo.UserSign wxEnterpriseLogin(String identifier, String credential, String redirect) { + log.info("企业微信登录:{},{}, {}", identifier, credential, redirect); + String suiteId = WeiXinConstant.SuiteId.getValue(credential); + if (StrUtil.isBlank(suiteId) || StrUtil.isBlank(identifier)) { + throw new BaseException(CodeEnum.PARAM_ERROR); + } + String suiteAccessToken = healthFeignClient.getSuiteAccessToken(suiteId); + + WeiXinVo.Code2Session userInfo = WeiXinConstant.code2Session(identifier, suiteAccessToken); + log.info("用户信息:{}", userInfo); + if (userInfo == null) { + throw new BaseException(CodeEnum.PARAM_ERROR); + } + return getUserSign(userInfo.getUserId(), userInfo.getCorpId(), (byte) WebConstant.IDENTIFY_TYPE.WxEnterprise.value, redirect); + } + + /** + * 微信网页登陆 + * + * @param code 微信code + * @return 返回用户信息 + */ + private UserVo.UserSign wxH5Login(WebConstant.IDENTIFY_TYPE identifyType, String code) { + UserVo.UserSign userSignVo; + //获取微信信息 + +// WxGzhUtil wxGzhUtil = new WxGzhUtil(); +// WxOauth2UserInfo wxOauth2UserInfo = wxGzhUtil.getOauth2UserInfo(identifyType, code); + WxOauth2UserInfo wxOauth2UserInfo = WxGzhUtil.getOauth2UserInfo(identifyType, code); + + SysAuth theAuth; + if (ObjectUtil.isNotNull(wxOauth2UserInfo)) { +// //查找有无保存的信息 +// SysWxExample sysWxExample = new SysWxExample(); +// sysWxExample.createCriteria().andUnionIdEqualTo(wxOauth2UserInfo.getUnionId()); +// List sysWxList = sysWxDao.selectByExample(sysWxExample); +// SysWx sysWx = null; +// if (CollUtil.isNotEmpty(sysWxList)) { +// //如果有信息,则更新 +// sysWx = sysWxList.get(0); +// BeanUtil.copyProperties(wxOauth2UserInfo, sysWx); +// sysWxDao.updateByPrimaryKeySelective(sysWx); +// } else { +// //没有则保存微信信息 +// sysWx = new SysWx(); +// BeanUtil.copyProperties(wxOauth2UserInfo, sysWx); +// sysWx.setId(snowflake.nextId()); +// sysWxDao.insertSelective(sysWx); +// } + //查找认证信息 + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Wx_H5.value) + .andIdentifierEqualTo(wxOauth2UserInfo.getOpenId()); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + theAuth = authList.get(0); + } else { + SysAuthExample sysAuthExample = new SysAuthExample(); + sysAuthExample.createCriteria().andCredentialEqualTo(wxOauth2UserInfo.getUnionId()); + List sysAuthList = authDao.selectByExample(sysAuthExample); + if (CollectionUtil.isNotEmpty(sysAuthList)) { + //添加认证方式 + theAuth = new SysAuth(); + theAuth.setId(snowflake.nextId()); + theAuth.setUserId(sysAuthList.get(0).getUserId()); + theAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Wx_H5.value); + theAuth.setIdentifier(wxOauth2UserInfo.getOpenId()); + theAuth.setCredential(wxOauth2UserInfo.getUnionId()); + authDao.insertSelective(theAuth); + } else { + //新建用户并保存微信信息 + SysUser user = new SysUser(); + user.setId(snowflake.nextId()); + user.setAvatarUrl(wxOauth2UserInfo.getHeadImgUrl()); + user.setNickname(wxOauth2UserInfo.getNickname()); + user.setGender((byte) wxOauth2UserInfo.getSex()); + user.setCountry(wxOauth2UserInfo.getCountry()); + user.setProvince(wxOauth2UserInfo.getProvince()); + user.setCity(wxOauth2UserInfo.getCity()); + user.setLanguage(wxOauth2UserInfo.getLanguage()); + userDao.insertSelective(user); + //添加认证方式 + theAuth = new SysAuth(); + theAuth.setId(snowflake.nextId()); + theAuth.setUserId(user.getId()); + theAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Wx_H5.value); + theAuth.setIdentifier(wxOauth2UserInfo.getOpenId()); + theAuth.setCredential(wxOauth2UserInfo.getUnionId()); + authDao.insertSelective(theAuth); +// //自动添加账号密码 +// String accountName = RandomStringUtils.random(8, WebConstant.RANDOM_STR); +// SysAuth accountAuth = new SysAuth(); +// accountAuth.setId(snowflake.nextId()); +// accountAuth.setUserId(user.getId()); +// accountAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Account.value); +// accountAuth.setIdentifier("USER_" + accountName); +// accountAuth.setCredential("123456"); +// authDao.insertSelective(accountAuth); + } + } + } else { + throw new BaseException(CodeEnum.NOT_SELECT_WX); + } + + //2.返回 + userSignVo = new UserVo.UserSign(); + userSignVo.setUserId(theAuth.getUserId()); + userSignVo.setAuthId(theAuth.getId()); + return userSignVo; + } + + /** + * 微信公众号登陆 + * + * @param code 微信code + * @return 返回用户信息 + */ + private UserVo.UserSign wxLogin(WebConstant.IDENTIFY_TYPE identifyType, String code) { + UserVo.UserSign userSignVo; + //获取微信信息并保存 + log.info("公众号登陆,{}", code); +// WxGzhUtil wxGzhUtil = new WxGzhUtil(); +// WxOauth2UserInfo wxOauth2UserInfo = wxGzhUtil.getOauth2UserInfo(identifyType, code); + WxOauth2UserInfo wxOauth2UserInfo = WxGzhUtil.getOauth2UserInfo(identifyType, code); + log.info("获取用户的微信信息,{}", wxOauth2UserInfo); + + SysAuth theAuth; + if (ObjectUtil.isNotNull(wxOauth2UserInfo)) { + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.OAUTH2_Wx.value) + .andIdentifierEqualTo(wxOauth2UserInfo.getOpenId()).andCredentialEqualTo(wxOauth2UserInfo.getUnionId()); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + theAuth = authList.get(0); + log.info("该用户已有公众号登录的auth信息,{}", theAuth); + } else { + SysAuthExample sysAuthExample = new SysAuthExample(); + sysAuthExample.createCriteria().andCredentialEqualTo(wxOauth2UserInfo.getUnionId()); + List sysAuthList = authDao.selectByExample(sysAuthExample); + if (CollectionUtil.isNotEmpty(sysAuthList)) { +// SysAuth sysAuth = sysAuthList.get(0); + //添加认证方式 + theAuth = new SysAuth(); + theAuth.setId(snowflake.nextId()); + theAuth.setUserId(sysAuthList.get(0).getUserId()); + theAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.OAUTH2_Wx.value); + theAuth.setIdentifier(wxOauth2UserInfo.getOpenId()); + theAuth.setCredential(wxOauth2UserInfo.getUnionId()); + authDao.insertSelective(theAuth); + } else { + //新建用户并保存微信信息 + SysUser user = new SysUser(); + user.setId(snowflake.nextId()); + user.setAvatarUrl(wxOauth2UserInfo.getHeadImgUrl()); + user.setNickname(wxOauth2UserInfo.getNickname()); + user.setGender((byte) wxOauth2UserInfo.getSex()); + user.setCountry(wxOauth2UserInfo.getCountry()); + user.setProvince(wxOauth2UserInfo.getProvince()); + user.setCity(wxOauth2UserInfo.getCity()); + user.setLanguage(wxOauth2UserInfo.getLanguage()); + userDao.insertSelective(user); + //添加认证方式 + theAuth = new SysAuth(); + theAuth.setId(snowflake.nextId()); + theAuth.setUserId(user.getId()); + theAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.OAUTH2_Wx.value); + theAuth.setIdentifier(wxOauth2UserInfo.getOpenId()); + theAuth.setCredential(wxOauth2UserInfo.getUnionId()); + authDao.insertSelective(theAuth); +// //自动添加账号密码 +// String accountName = RandomStringUtils.random(8, WebConstant.RANDOM_STR); +// SysAuth accountAuth = new SysAuth(); +// accountAuth.setId(snowflake.nextId()); +// accountAuth.setUserId(user.getId()); +// accountAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Account.value); +// accountAuth.setIdentifier("USER_" + accountName); +// accountAuth.setSalt(ShiroKit.getRandomSalt(6)); +// accountAuth.setCredential(ShiroKit.md5("123456", accountAuth.getSalt())); +// authDao.insertSelective(accountAuth); +// log.info("新建用户:{},新建auth:{}", user,theAuth); + } + } + } else { + throw new BaseException(CodeEnum.NOT_SELECT_WX); + } + + //2.返回 + userSignVo = new UserVo.UserSign(); + userSignVo.setUserId(theAuth.getUserId()); + userSignVo.setAuthId(theAuth.getId()); + log.info("认证成功返回:{}", userSignVo); + return userSignVo; + } + + + /** + * 手机号登陆 + * + * @param phone 手机号 + * @param smsVerifyCode 验证码 + * @return 返回用户信息 + */ + private UserVo.UserSign phoneLogin(String phone, String smsVerifyCode) { + UserVo.UserSign userSignVo; + if (isSmsCodeCorrect(phone, smsVerifyCode)) { + //1.查找对应账户,不存在则注册 + List authList; + SysAuth theAuth; + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value) + .andIdentifierEqualTo(phone); + authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + theAuth = authList.get(0); + } else { + theAuth = wxRegist(phone, null, WebConstant.IDENTIFY_TYPE.Phone); + } + userSignVo = new UserVo.UserSign(); + userSignVo.setUserId(theAuth.getUserId()); + userSignVo.setAuthId(theAuth.getId()); + +// //给所有手机号一样的角色添加userId +// memberHandler(theAuth.getUserId(), phone); + } else { + throw new BaseException(CodeEnum.SMS_CODE_CORRECT); + } + return userSignVo; + } + + + + /** + * 账号登录 + */ + private UserVo.UserSign accountLogin(String username, String password) throws Exception { + long start = System.currentTimeMillis(); + UserVo.UserSign userSignVo; + List authList; + SysAuth theAuth; + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria() + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value).andIdentifierEqualTo(username); + authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + theAuth = authList.get(0); + if (ShiroKit.authenticate(password, theAuth.getCredential(), theAuth.getSalt())) { + userSignVo = new UserVo.UserSign(); + userSignVo.setUserId(theAuth.getUserId()); + userSignVo.setAuthId(theAuth.getId()); + } else { + throw new BaseException(CodeEnum.PASSWORD_ERROR); + } + } else { + throw new BaseException(CodeEnum.NOT_ACCOUNT); + } + long end = System.currentTimeMillis(); + log.info("查询并验证账号用时:{}",end - start); + return userSignVo; + } + + /** + * 微信小程序 + */ + private UserVo.UserSign wxmplogin(String code, String gameType) throws Exception { + //0.获取openid + Long start = System.currentTimeMillis(); + WxXcxUtil.WechatUser wechatUser = WxXcxUtil.getUserInfo(code, gameType); + Long end = System.currentTimeMillis(); + log.info("调用微信查询openId耗时:{}",end - start); + String openId = wechatUser.openid; + String unionId = wechatUser.unionid; + log.info("小程序登录,openid:{} ,unionId:{}", openId, unionId); + return getUserSign(openId, unionId, (byte) WebConstant.IDENTIFY_TYPE.Wxmp.value, null); + } + + +// @Data +// private static class WxEnterpriseParam { +// private String suiteAccessToken; +// private String userTicket; +// private String redirect; +// } + + + /** + * @param openId openId + * @param unionId unionId + * @return 返回认证信息 + */ + private UserVo.UserSign getUserSign(String openId, String unionId, + byte identifyType, String redirect) { + long start = System.currentTimeMillis(); + UserVo.UserSign userSignVo; + List authList; + SysAuth theAuth; + if (ObjectUtil.isNull(openId)) { + return null; + } + String key = openId + TallConstant.LOGIN + identifyType; + Object o = redisUtil.get(key); + if(ObjectUtil.isNotNull(o)){ + return (UserVo.UserSign)o; + } + + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andIdentifyTypeEqualTo(identifyType).andIdentifierEqualTo(openId); + authList = authDao.selectByExample(authExample); + long end1 = System.currentTimeMillis(); + log.info("查auth表耗时:{}",end1 - start); + if (CollectionUtil.isEmpty(authList)) { + List sysAuthList = null; + long end2 = 0; + if (ObjectUtil.isNotNull(unionId) && identifyType == WebConstant.IDENTIFY_TYPE.Wxmp.value) { + SysAuthExample sysAuthExample = new SysAuthExample(); + sysAuthExample.createCriteria().andCredentialEqualTo(unionId); + sysAuthList = authDao.selectByExample(sysAuthExample); + end2 = System.currentTimeMillis(); + log.info("查找同平台其他登录方式耗时:{}",end2 - end1); + } + if (CollectionUtil.isNotEmpty(sysAuthList)) { + //添加认证方式 + theAuth = new SysAuth(); + theAuth.setId(snowflake.nextId()); + theAuth.setUserId(sysAuthList.get(0).getUserId()); + theAuth.setIdentifyType(identifyType); + theAuth.setIdentifier(openId); + theAuth.setCredential(unionId); + authDao.insertSelective(theAuth); + long end3 = System.currentTimeMillis(); + log.info("同平台有其他登录方式,添加小程序auth耗时:{}",end3 - (end2 == 0 ? end1 : end2)); + } else { + //新建用户并保存微信信息 + SysUser user = new SysUser(); + user.setId(snowflake.nextId()); + //企业微信获取详细用户信息,并绑定用户信息 + getUserDetail(identifyType, openId, unionId, redirect, user); + userDao.insertSelective(user); + //添加认证方式 + theAuth = new SysAuth(); + theAuth.setId(snowflake.nextId()); + theAuth.setUserId(user.getId()); + theAuth.setIdentifyType(identifyType); + theAuth.setIdentifier(openId); + theAuth.setCredential(unionId); + authDao.insertSelective(theAuth); + long end4 = System.currentTimeMillis(); + log.info("同平台没有其他登录方式,添加user和小程序auth耗时:{}",end4 - (end2 == 0 ? end1 : end2)); +// //自动添加账号密码 +// String accountName = RandomStringUtils.random(8, WebConstant.RANDOM_STR); +// SysAuth accountAuth = new SysAuth(); +// accountAuth.setId(snowflake.nextId()); +// accountAuth.setUserId(user.getId()); +// accountAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Account.value); +// accountAuth.setIdentifier("USER_" + accountName); +// accountAuth.setSalt(ShiroKit.getRandomSalt(6)); +// accountAuth.setCredential(ShiroKit.md5("123456", accountAuth.getSalt())); +// authDao.insertSelective(accountAuth); + } +// theAuth = wxRegist(openid, unionId,WebConstant.IDENTIFY_TYPE.Wxmp); + } else { + theAuth = authList.get(0); + } + + //2.返回 + userSignVo = new UserVo.UserSign(); + userSignVo.setUserId(theAuth.getUserId()); + userSignVo.setAuthId(theAuth.getId()); + + //存入redis + redisUtil.set(key,userSignVo, TallConstant.LOGIN_TIME); + long end2 = System.currentTimeMillis(); + log.info("方法结束总耗时:{}",end2 - end1); + return userSignVo; + } + + /** + * 获取企业微信信息,并绑定用户 + * @param identifyType 登录类型 + * @param userid userId + * @param corpId corpId + * @param redirect redirect + * @param user 用户信息 + */ + private void getUserDetail(byte identifyType, String userid, String corpId, String redirect, SysUser user) { + if (identifyType == WebConstant.IDENTIFY_TYPE.WxEnterprise.value && StrUtil.isNotBlank(redirect)) { + Map map = new HashMap<>(); + map.put("tallUserId", user.getId()); + map.put("userid", userid); + map.put("corpid", corpId); + String result = RestTemplateUtil.postBody(redirect, map); + log.info("{}绑定关系结果:{}", map, result); + + JSONObject json = JSONObject.parseObject(result); + if (json.getIntValue("code") == 0) { + JSONObject data = json.getJSONObject("data"); + user.setNickname(data.getString("name")); + user.setGender(data.getByteValue("gender")); + user.setAvatarUrl(data.getString("avatar")); + } + user.setRecStatus((byte)0); + } + } + + /** + * 微信登陆后天添加用户和认证方式 + * + * @return 认证信息 + */ + private SysAuth wxRegist(String identifier, String credential, WebConstant.IDENTIFY_TYPE identifyType) { + //1.添加user + SysUser user = new SysUser(); + user.setId(snowflake.nextId()); + userDao.insertSelective(user); + + //2.添加auth + SysAuth auth = new SysAuth(); + auth.setId(snowflake.nextId()); + auth.setUserId(user.getId()); + auth.setIdentifyType((byte) identifyType.value); + auth.setIdentifier(identifier); + auth.setCredential(credential); + authDao.insertSelective(auth); +// //自动添加账号密码 +// String accountName = RandomStringUtils.random(8, WebConstant.RANDOM_STR); +// SysAuth accountAuth = new SysAuth(); +// accountAuth.setId(snowflake.nextId()); +// accountAuth.setUserId(user.getId()); +// accountAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Account.value); +// accountAuth.setIdentifier("USER_" + accountName); +// accountAuth.setSalt(ShiroKit.getRandomSalt(6)); +// accountAuth.setCredential(ShiroKit.md5("123456", accountAuth.getSalt())); +// authDao.insertSelective(accountAuth); + + return auth; + } + + /** + * 获取token + */ + @Override + public UserVo.TokenBean generateToken(WebConstant.CLIENT_TYPE clientType, Object subject, Map payLoads){ + UserVo.TokenBean tokenBean = new UserVo.TokenBean(); + + Long tokenExpired = null; + Long refreshTokenExpired = null; + + switch (clientType) { + case Wxmp: + case WxEnterprise: + case H5: + //tokenExpired = 3600 * 1000L * 2; + tokenExpired = 3600 * 1000L * 24; + break; + case Android: + case IOS: + tokenExpired = 3600 * 1000L * 2; + refreshTokenExpired = 3600 * 1000L * 24 * 30; + break; + default: + + } + + //1.生成token并缓存 + long start = System.currentTimeMillis(); + if (ObjectUtil.isNotNull(tokenExpired)) { + String token = + JwtUtil.createJWT(subject + "", + payLoads, tokenExpired, + WebConstant.JWT_ACCESS_TOKEN_SECERT); + redisUtil.set(RedisKeyManager.getTokenCachedKey(subject), + token, tokenExpired / 1000); + tokenBean.setToken(token); + } + + long end = System.currentTimeMillis(); + log.info("生成token并缓存到redis用时:{}",end - start); + + if (ObjectUtil.isNotNull(refreshTokenExpired)) { + String refreshToken = + JwtUtil.createJWT(subject + "", + payLoads, refreshTokenExpired, + WebConstant.JWT_ACCESS_TOKEN_SECERT); + redisUtil.set(RedisKeyManager.getRefreshTokenCachedKey(subject), + refreshToken, refreshTokenExpired / 1000); + tokenBean.setRefresh_token(refreshToken); + } + + //2.返回 + return tokenBean; + } + + /** + * 发送验证码 + */ + @Override + public UserVo.SmsCode getSignInSmsCode(String phone,String verificationCodeId, String verificationCodeValue) { + //获取登陆客户端类型 +// WebConstant.CLIENT_TYPE client_type = null; +// if (ObjectUtil.isNotNull(client)) { +// client_type = WebConstant.CLIENT_TYPE.valueOf(client); +// } else { +// client_type = WebConstant.CLIENT_TYPE.valueOf(1); +// } + //检查图形验证码是否正确 + String codeKey = WebConstant.IMAGE_CODE + verificationCodeId; + if (!redisUtil.hasKey(codeKey)) { + throw new BaseException(CodeEnum.VERIFICATION_CODE_PAST); + } + if (!verificationCodeValue.equals(String.valueOf(redisUtil.get(codeKey)))) { + throw new BaseException(CodeEnum.VERIFICATION_CODE_ERROR); + } + //验证一次,无论是否正确,都将缓存删除 + redisUtil.del(codeKey); + //验证手机号的正确性 + String regex = "[1]([3-9])[0-9]{9}$"; + Pattern p = Pattern.compile(regex); + Matcher m = p.matcher(phone); + boolean isMatch = m.matches(); + if (!isMatch) { + throw new BaseException(CodeEnum.PHONE_ERR); + } + + UserVo.SmsCode smsCodeVo; + //1.验证发送间隔是否大于指定间隔 + if (redisUtil.hasKey(RedisKeyManager.getSigninSmsExistKey(phone))) { + throw new SmsException(SmsException.Error_SendTooFast); + } + + + String verifyCode = "1111"; + if("1".equalsIgnoreCase(PropUtil.smsCode)){ + verifyCode = RandomUtil.randomNumbers(4); + } + + //3.保存到redis中 + Integer codeValidInSeconds = WebConstant.Expired_Verify_Code_In_Seconds; + Integer codeExistInSeconds = WebConstant.Exist_Verify_Code_In_Seconds; + redisUtil.set(RedisKeyManager.getSigninSmsKey(phone), verifyCode, codeValidInSeconds); + redisUtil.set(RedisKeyManager.getSigninSmsExistKey(phone), verifyCode, codeExistInSeconds); + + //5.发送验证码 + if("1".equalsIgnoreCase(PropUtil.smsCode)) { + SmsUtil.sendSms(phone, verifyCode,"", codeValidInSeconds); + } + //6.返回 + smsCodeVo = new UserVo.SmsCode(); + smsCodeVo.setPhone(phone); + smsCodeVo.setSmsCode(verifyCode); + smsCodeVo.setExpiredInSeconds(WebConstant.Expired_Verify_Code_In_Seconds); + return smsCodeVo; + } + + /** + * 通过id找用户 + */ + @Override + public SysUser getUserById(Long userId) { + SysUser theUser; + theUser = userDao.selectByPrimaryKey(userId); + if (ObjectUtil.isNull(theUser)) { + throw new BaseException(406, "找不到对应Id用户: " + userId); + } + return theUser; + } + + /** + * 注册 + */ + @Override + public UserVo.UserSign registerUser(UserDto.UserSignup userSignup){ + UserVo.UserSign userSignVo; + //验证码是否合格 + if (isSmsCodeCorrect(userSignup.getPhone(), userSignup.getSmsCode())) { + //检查手机号是否已被注册 + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria() + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value).andIdentifierEqualTo(userSignup.getPhone()); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isEmpty(authList)) { + //验证账号是否被注册 + Boolean flag = findAccount(userSignup.getAccount()); + if (!flag) { + userSignVo = saveAuth(userSignup); + } else { + throw new BaseException(CodeEnum.ALREADY_EXIST_ACCOUNT); + } + } else { + throw new BaseException(CodeEnum.ALREADY_EXIST_PHONE); + } + } else { + throw new BaseException(CodeEnum.SMS_CODE_CORRECT); + } + return userSignVo; + } + + /** + * 添加认证 + */ + @Override + public UserVo.UserSign saveAuth(UserDto.UserSignup userSignup) { + UserVo.UserSign userSignVo;//生成一个用户并添加认证方式 + SysUser user = new SysUser(); + user.setId(snowflake.nextId()); + user.setPhone(userSignup.getPhone()); + user.setAvatarUrl(PropUtil.notGatewayUrl + "staticrec/logo.png"); + user.setSource(userSignup.getSource()); + userDao.insertSelective(user); + + SysAuth accountAuth = new SysAuth(); + accountAuth.setId(snowflake.nextId()); + accountAuth.setUserId(user.getId()); + accountAuth.setIdentifier(userSignup.getAccount()); + accountAuth.setSalt(ShiroKit.getRandomSalt(6)); + accountAuth.setCredential(ShiroKit.md5(userSignup.getPassword(), accountAuth.getSalt())); + accountAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Account.value); + authDao.insertSelective(accountAuth); + + SysAuth phoneAuth = new SysAuth(); + phoneAuth.setId(snowflake.nextId()); + phoneAuth.setUserId(user.getId()); + phoneAuth.setIdentifier(userSignup.getPhone()); + phoneAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Phone.value); + authDao.insertSelective(phoneAuth); + + userSignVo = new UserVo.UserSign(); + userSignVo.setUserId(user.getId()); + userSignVo.setAuthId(phoneAuth.getId()); + +// //给所有手机号一样的角色添加userId +// memberHandler(user.getId(), userSignup.getPhone()); + return userSignVo; + } + +// /** +// * 给所有手机号相同的角色添加userId +// */ +// private void memberHandler(Long userId, String phone) { +// ProMemberExample memberExample = new ProMemberExample(); +// memberExample.createCriteria().andPhoneEqualTo(phone); +// List proMemberList = memberDao.selectByExample(memberExample); +// if (CollectionUtil.isNotEmpty(proMemberList)) { +// SysUser user = userDao.selectByPrimaryKey(userId); +// if (ObjectUtil.isNotNull(user)) { +// for (ProMember member : proMemberList) { +// if (ObjectUtil.isNull(member.getUserId()) || member.getUserId() == 0) { +// member.setUserId(userId); +// //将用户的昵称和头像复制到成员信息内 +// member.setAvatarUrl(user.getAvatarUrl()); +// member.setNickname(user.getNickname()); +// +// memberDao.updateByPrimaryKeySelective(member); +// } +// } +// } +// } +// } + + /** + * 查找账号 + */ + @Override + public Boolean findAccount(String account) { + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value) + .andIdentifierEqualTo(account); + List authList = authDao.selectByExample(authExample); + + return CollectionUtil.isNotEmpty(authList); + } + + /** + * 查找手机号 + */ + @Override + public Boolean findPhone(String phone) { + //验证手机号的正确性 + String regex = "[1]([3-9])[0-9]{9}$"; + Pattern p = Pattern.compile(regex); + Matcher m = p.matcher(phone); + boolean isMatch = m.matches(); + if (!isMatch) { + throw new BaseException(CodeEnum.PHONE_ERR); + } + + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value) + .andIdentifierEqualTo(phone); + List authList = authDao.selectByExample(authExample); + + return CollectionUtil.isNotEmpty(authList); + } + + /** + * 修改账号信息 + */ + @Override + public void updateAccount(UserDto.Account account) { + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andUserIdEqualTo(account.getId()).andIdentifyTypeEqualTo((byte) 3); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + SysAuth auth = authList.get(0); + if (StrUtil.isNotEmpty(account.getUsername())) { + auth.setIdentifier(account.getUsername()); + } + if (StrUtil.isNotEmpty(account.getPassword())) { + auth.setCredential(account.getPassword()); + } + authDao.updateByPrimaryKeySelective(auth); + } + } + + @Override + public boolean tokenNotExistInCache(Long authId) { + return !redisUtil.hasKey(RedisKeyManager.getTokenCachedKey(authId)); + } + + /** + * 微信绑定新手机号(没有账号,注册) + * + * @param currentUserId userId + * @param wxPhone 手机号和验证码 + * @return 用户id和认证类型 + */ + @Override + public UserVo.UserSign bindingNewPhone(Long currentUserId, UserDto.WxBindingPhone wxPhone) { + if (isSmsCodeCorrect(wxPhone.getPhone(), wxPhone.getSmsCode())) { + //查找该用户以前绑定的手机 + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value) + .andUserIdEqualTo(currentUserId); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + throw new BaseException(CodeEnum.ALREADY_BINDING_PHONE); + } else { + //改手机对应账户,如果有,提示 + List phoneList; + SysAuthExample phoneExample = new SysAuthExample(); + phoneExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value) + .andIdentifierEqualTo(wxPhone.getPhone()); + phoneList = authDao.selectByExample(phoneExample); + if (CollectionUtil.isNotEmpty(phoneList)) { + throw new BaseException(CodeEnum.MERGE_WX_PHONE); + } else { + //绑定 添加auth + SysAuth auth = new SysAuth(); + auth.setId(snowflake.nextId()); + auth.setUserId(currentUserId); + auth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Phone.value); + auth.setIdentifier(wxPhone.getPhone()); + authDao.insertSelective(auth); + +// //给手机号一样的所有项目内的成员添加userId +// memberHandler(currentUserId, wxPhone.getPhone()); + } + } + } else { + throw new BaseException(CodeEnum.SMS_CODE_CORRECT); + } + //返回用户信息 + UserVo.UserSign userSignVo = null; + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value) + .andIdentifierEqualTo(wxPhone.getPhone()); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + userSignVo = new UserVo.UserSign(); + userSignVo.setAuthId(authList.get(0).getId()); + userSignVo.setUserId(authList.get(0).getUserId()); + } + return userSignVo; + } + + /** + * 更改绑定手机号 + */ + @Override + public void updatePhone(Long currentUserId, UserDto.UpdatePhone updatePhone) throws Exception { + if (isSmsCodeCorrect(updatePhone.getNewPhone(), updatePhone.getCode())) { + //查找新手机号的的绑定信息 + Long newPhoneUserId = selectUserIdByPhone(updatePhone.getNewPhone()); + if (ObjectUtil.isNull(newPhoneUserId)) { + //查找此用户的账号密码 + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andUserIdEqualTo(currentUserId) + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + SysAuth accountAuth = authList.get(0); + //验证密码 + if (ShiroKit.authenticate(updatePhone.getPassword(), accountAuth.getCredential(), accountAuth.getSalt())) { + //查找此用户的的手机号 + SysAuthExample phoneExample = new SysAuthExample(); + phoneExample.createCriteria().andUserIdEqualTo(currentUserId) + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value); + List phoneAuthList = authDao.selectByExample(phoneExample); + if (CollectionUtil.isNotEmpty(phoneAuthList)) { + //修改 + SysAuth phoneAuth = phoneAuthList.get(0); + phoneAuth.setIdentifier(updatePhone.getNewPhone()); + authDao.updateByPrimaryKeySelective(phoneAuth); + //修改用户信息 + SysUser user = userDao.selectByPrimaryKey(currentUserId); + user.setPhone(updatePhone.getNewPhone()); + userDao.updateByPrimaryKeySelective(user); + } + } else { + throw new BaseException("密码错误"); + } + } + } else { + throw new BaseException(-1, "新手机号已经注册过账号"); + } + } else { + throw new BaseException(-1, "验证信息不正确"); + } + } + + /** + * 判断验证码是否有效 + */ + private Boolean isSmsCodeCorrect(String phone, String smsCode) { + boolean correct = false; + if (redisUtil.hasKey(RedisKeyManager.getSigninSmsKey(phone))) { + if (smsCode.equals(redisUtil.get(RedisKeyManager.getSigninSmsKey(phone)).toString())) { + correct = true; + } + } + return correct; + } + + /** + * 修改密码 + */ + @Override + public void updatePassword(UserDto.UpdatePassword passwordDto) throws Exception { + if (StrUtil.isNotEmpty(passwordDto.getPhone()) && StrUtil.isNotEmpty(passwordDto.getCode())) { + if (isSmsCodeCorrect(passwordDto.getPhone(), passwordDto.getCode())) { + Long userId = selectUserIdByPhone(passwordDto.getPhone()); + if (ObjectUtil.isNotNull(userId)) { + SysAuthExample sysAuthExample = new SysAuthExample(); + sysAuthExample.createCriteria() + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value) + .andUserIdEqualTo(userId); + List authList = authDao.selectByExample(sysAuthExample); + if (CollectionUtil.isNotEmpty(authList)) { + SysAuth auth = authList.get(0); + if (!ShiroKit.authenticate(passwordDto.getPassword(), auth.getCredential(), auth.getSalt())) { + auth.setCredential(ShiroKit.md5(passwordDto.getPassword(), auth.getSalt())); + authDao.updateByPrimaryKeySelective(auth); + } else { + throw new BaseException(CodeEnum.NEW_PASSWORD_REPEAT_OLD); + } + } else { + throw new BaseException(CodeEnum.PHONE_ERR); + } + } else { + throw new BaseException(CodeEnum.PHONE_ERR); + } + } else { + throw new BaseException(CodeEnum.SMS_CODE_CORRECT); + } + } + } + + @Override + public void updatePasswordByAccount(UserDto.UpdatePasswordByAccount passwordDto) throws Exception{ + if (passwordDto.getPasswordOld().equalsIgnoreCase(passwordDto.getPasswordNew())){ + throw new BaseException(CodeEnum.NEW_PASSWORD_REPEAT_OLD); + } + //检查账号和密码是否正确 + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria() + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value) + .andIdentifierEqualTo(passwordDto.getAccount()); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isEmpty(authList)) { + throw new BaseException(CodeEnum.NOT_ACCOUNT); + } + SysAuth sysAuth = authList.get(0); + if (ShiroKit.authenticate(passwordDto.getPasswordOld(), sysAuth.getCredential(), sysAuth.getSalt())) { + //修改密码 + sysAuth.setCredential(ShiroKit.md5(passwordDto.getPasswordNew(), sysAuth.getSalt())); + authDao.updateByPrimaryKeySelective(sysAuth); + } else { + throw new BaseException(CodeEnum.PASSWORD_ERROR); + } + } + + /** + * 通过用户查找手机号 + * @param userId userId + * @return 手机号 + */ + @Override + public String getPhone(Long userId) { + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value); + List sysAuthList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(sysAuthList)) { + return sysAuthList.get(0).getIdentifier(); + } else { + return null; + } + } + + /** + * 通过手机号查找用户Id + */ + @Override + public Long selectUserIdByPhone(String phoneCell) { + Long userId = null; + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria() + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value).andIdentifierEqualTo(phoneCell); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + userId = authList.get(0).getUserId(); + } + return userId; + } + + /** + * 通过手机号查找用户名(账号) + */ + @Override + public String selectAccountByPhone(String phone) { + String account = null; + if (StrUtil.isNotEmpty(phone)) { + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria() + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value).andIdentifierEqualTo(phone); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + SysAuthExample authExample1 = new SysAuthExample(); + authExample1.createCriteria().andUserIdEqualTo(authList.get(0).getUserId()) + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value); + List authList1 = authDao.selectByExample(authExample1); + if (CollectionUtil.isNotEmpty(authList1)) { + account = authList1.get(0).getIdentifier(); + } + } + } + return account; + } + +// /** +// * 查找角色下的所有人的userId +// */ +// @Override +// public List selectUserIdByRoleId(Long roleId) { +// ProRole role = proRoleDao.selectByPrimaryKey(roleId); +// if(ObjectUtil.isNull(role)){ +// return null; +// } +// List userIdList; +// if(role.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.AllMember.phase)){ +// userIdList = memberRoleDao.selectUserIdByProjectId(role.getProjectId()); +// }else { +// userIdList = memberRoleDao.selectUserIdByRoleId(roleId); +// } +// return userIdList; +// } + +// /** +// * 查询用户是否关注此项目 +// * +// * @param currentUserId userId +// * @param projectId 项目id +// * @return 是否关注此项目 +// */ +// @Override +// public Boolean getIsAttention(Long currentUserId, Long projectId) { +// boolean isAttention = false; +// if (ObjectUtil.isNotNull(sysProjectDao.selectByPrimaryKey(projectId))) { +// UserAttentionExample attentionExample = new UserAttentionExample(); +// attentionExample.createCriteria().andProjectIdEqualTo(projectId).andUserIdEqualTo(currentUserId); +// List attentionList = userAttentionDao.selectByExample(attentionExample); +// if (CollectionUtil.isNotEmpty(attentionList)) { +// isAttention = true; +// } +// } else { +// throw new BaseException(CodeEnum.NOT_PROJECT); +// } +// return isAttention; +// } + +// /** +// * 用户关注某个项目 +// * +// * @param currentUserId userId +// * @param projectIdDto 项目id +// */ +// @Override +// public void userAttentionProject(Long currentUserId, ProjectDto.ProjectIdDto projectIdDto) { +// //查找项目 +// SysProject project = sysProjectDao.selectByPrimaryKey(projectIdDto.getProjectId()); +// if (ObjectUtil.isNotNull(project)) { +// UserAttentionExample attentionExample = new UserAttentionExample(); +// attentionExample.createCriteria().andProjectIdEqualTo(projectIdDto.getProjectId()).andUserIdEqualTo(currentUserId); +// List attentionList = userAttentionDao.selectByExample(attentionExample); +// if (CollectionUtil.isNotEmpty(attentionList)) { +// throw new BaseException(CodeEnum.ALREADY_ATTENTION); +// } +// UserAttention attention = new UserAttention(); +// attention.setId(snowflake.nextId()); +// attention.setUserId(currentUserId); +// attention.setProjectId(projectIdDto.getProjectId()); +// userAttentionDao.insertSelective(attention); +// } else { +// throw new BaseException(CodeEnum.NOT_PROJECT); +// } +// } + + // @Override +// public UserVo.TokenBean userManageSignin(UserDto.UserSginin dto){ +// UserVo.TokenBean tokenBean = null; +// JsonResponse tokenBeanJsonResponse = userManageFeign.userSignin(dto); +// tokenBean = tokenBeanJsonResponse.getData(); +// return tokenBean; +// } + + @Override + public long defaultRegisterUser(com.ccsens.cloudutil.bean.tall.dto.UserDto.DefaultUserSingup signup) { + log.info("默认注册信息:{}", signup); + //检查手机号是否已被注册 + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria() + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value).andIdentifierEqualTo(signup.getPhone()); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + log.info("用户已存在,直接返回user"); + return userDao.selectByPrimaryKey(authList.get(0).getUserId()).getId(); + } + UserDto.UserSignup up = new UserDto.UserSignup(); + up.setAccount(signup.getAccount()); + up.setPassword(WebConstant.Regist.PASSWORD); + up.setPhone(signup.getPhone()); + up.setSource(signup.getSource()); + + UserVo.UserSign userSign = saveAuth(up); + return userSign.getUserId(); + } + + @Override + public UserVo.TokenBean getUserInfoAndToken(WebConstant.CLIENT_TYPE clientType, WebConstant.IDENTIFY_TYPE identifyType,UserVo.UserSign userSignVo, Map theMap) { + long start = System.currentTimeMillis(); + UserVo.TokenBean tokenBean = userDao.getTokenBeanByUserId(userSignVo.getUserId()); + //如果只有手机号没有账号信息,则将手机号脱敏当成账号 + if (StrUtil.isEmpty(tokenBean.getAccount()) && StrUtil.isNotEmpty(tokenBean.getPhone())){ + String phoneNumber = tokenBean.getPhone().substring(0, 3) + "****" + tokenBean.getPhone().substring(7, tokenBean.getPhone().length()); + tokenBean.setAccount(phoneNumber); + } + long end1 = System.currentTimeMillis(); + log.info("查询用户信息用了:{}",end1 - start); + UserVo.TokenBean tokenBean1 = generateToken(clientType, userSignVo.getUserId(), theMap); + tokenBean.setToken(tokenBean1.getToken()); + tokenBean.setRefresh_token(tokenBean1.getRefresh_token()); + + return tokenBean; + } + +// /** +// * 通过userId查找账号 +// * @param userId userId +// * @return 账号 +// */ +// private String selectAccountByUserId(Long userId) { +// String account = null; +// SysAuthExample sysAuthExample = new SysAuthExample(); +// sysAuthExample.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value); +// List authList = authDao.selectByExample(sysAuthExample); +// if(CollectionUtil.isNotEmpty(authList)){ +// account = authList.get(0).getIdentifier(); +// } +// return account; +// } +// +// private String getPhoneByRegisterType(Long userId, WebConstant.IDENTIFY_TYPE identifyType) { +// SysAuthExample authExample = new SysAuthExample(); +// authExample.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value); +// List sysAuthList = authDao.selectByExample(authExample); +// if (CollectionUtil.isNotEmpty(sysAuthList)) { +// return sysAuthList.get(0).getIdentifier(); +// } else { +// SysAuthExample authExampleType = new SysAuthExample(); +// authExampleType.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) identifyType.value); +// List sysAuthList1 = authDao.selectByExample(authExampleType); +// if (CollectionUtil.isNotEmpty(sysAuthList1)){ +// if(sysAuthList1.get(0).getRegisterType() == 1){ +// return "1"; +// } +// } +// return null; +// } +// } + + /** + * 合并账号 + * @param currentUserId userId + * @param wxPhone 手机号和合并方式 + * @return 用户id + */ + @Override + public UserVo.UserSign mergeByPhone(Long currentUserId, UserDto.WxMergePhone wxPhone) { + if (wxPhone.getIsMerge() == 0) { + //直接合并 + //1.查找手机号原来的userId + Long userId = selectUserIdByPhone(wxPhone.getPhone()); + if (ObjectUtil.isNotNull(userId)) { + //处理账号认证信息,保留手机号的账号,删除现在的账号 + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value) + .andUserIdEqualTo(currentUserId); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + for (SysAuth auth : authList) { + auth.setRecStatus((byte) 2); + authDao.updateByPrimaryKeySelective(auth); + } + } + userDao.replaceAuth(userId, currentUserId); + //查询所有关联userId的数据库表 auth表 attention表 balance表 project表 member表 DeliverPostLog表 proLog表 + //依次将查出的数据的旧userId 替换成新的userId + userDao.replaceProject(userId, currentUserId); + userDao.replaceAttention(userId, currentUserId); + userDao.replaceBalance(userId, currentUserId); + userDao.replaceMember(userId, currentUserId); + userDao.replaceDeliverPostLog(userId, currentUserId); + userDao.replaceProLog(userId, currentUserId); + userDao.replaceComment(userId, currentUserId); + //将以前的余额添加至此账号 + SysUser newUser = userDao.selectByPrimaryKey(currentUserId); + SysUser oldUser = userDao.selectByPrimaryKey(userId); +// if(ObjectUtil.isNotNull(oldUser) && ObjectUtil.isNotNull(newUser)) { +// updateBalance(oldUser, newUser); +// } + //将以前的user删除 + oldUser.setRecStatus((byte) 2); + userDao.updateByPrimaryKeySelective(oldUser); + + + } else { + throw new BaseException(CodeEnum.PARAM_ERROR); + } + } else { + //不要以前的信息 + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value) + .andIdentifierEqualTo(wxPhone.getPhone()); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + SysAuth auth = authList.get(0); + //查找这个手机号以前的用户,并删除 + SysUser user = userDao.selectByPrimaryKey(auth.getUserId()); + user.setRecStatus((byte) 2); + userDao.updateByPrimaryKeySelective(user); + //删除这个手机号的认证方式 + auth.setRecStatus((byte) 2); + authDao.updateByPrimaryKeySelective(auth); + //将当前的用户手机号改为新的手机号 + SysAuthExample sysAuthExample = new SysAuthExample(); + sysAuthExample.createCriteria().andUserIdEqualTo(currentUserId) + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value); + List sysAuthList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(sysAuthList)) { + SysAuth sysAuth = sysAuthList.get(0); + sysAuth.setIdentifier(wxPhone.getPhone()); + authDao.updateByPrimaryKeySelective(sysAuth); + } +// auth.setUserId(currentUserId); +// authDao.updateByPrimaryKeySelective(auth); + } + } + + UserVo.UserSign userSignVo = null; + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value) + .andIdentifierEqualTo(wxPhone.getPhone()); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + userSignVo = new UserVo.UserSign(); + userSignVo.setAuthId(authList.get(0).getId()); + userSignVo.setUserId(authList.get(0).getUserId()); + } + + return userSignVo; + } + +// private void updateBalance(SysUser oldUser, SysUser newUser) { +// newUser.setBalance(newUser.getBalance() + oldUser.getBalance()); +// userDao.updateByPrimaryKeySelective(newUser); +// //添加一条余额变更记录 +// SysBalanceLog balanceLog = new SysBalanceLog(); +// balanceLog.setId(snowflake.nextId()); +// balanceLog.setUserId(newUser.getId()); +// balanceLog.setBalance(newUser.getBalance()); +// balanceLog.setOffset(oldUser.getBalance()); +// balanceLog.setDescription("合并账号"); +// sysBalanceLogDao.insertSelective(balanceLog); +// } + + /** + * 输入两个userid合并账号 + */ + @Override + public void mergeUserId(Long userId, Long uselessId) { + SysUser user = userDao.selectByPrimaryKey(userId); + SysUser uselessUser = userDao.selectByPrimaryKey(userId); + if(ObjectUtil.isNull(user) || ObjectUtil.isNull(uselessUser)){ + throw new BaseException(CodeEnum.NOT_MEMBER); + } + userDao.replaceAuth(uselessId,userId); + //查询所有关联userId的数据库表 auth表 attention表 balance表 project表 member表 DeliverPostLog表 proLog表 + //依次将查出的数据的旧userId 替换成新的userId + userDao.replaceAttention(uselessId,userId); + userDao.replaceBalance(uselessId,userId); + userDao.replaceProject(uselessId,userId); + userDao.replaceMember(uselessId,userId); + userDao.replaceDeliverPostLog(uselessId,userId); + userDao.replaceProLog(uselessId,userId); + //将以前的余额添加至此账号 + SysUser oldUser = userDao.selectByPrimaryKey(uselessId); + SysUser newUser = userDao.selectByPrimaryKey(userId); +// if(ObjectUtil.isNotNull(oldUser) && ObjectUtil.isNotNull(newUser)) { +// updateBalance(oldUser, newUser); +// } + //将以前的user删除 + oldUser.setRecStatus((byte) 2); + userDao.updateByPrimaryKeySelective(oldUser); + + } + + /** + * 修改用户信息(添加微信信息) + * @return 返回信息 + */ + @Override + public UserVo.WxInfo updateUserInfo(Long currentUserId, UserDto.WxInfo userInfo) { + //通过userId查找到用户 + SysUser user = userDao.selectByPrimaryKey(currentUserId); + log.info("查找到原来的user信息,{}",user); + if (ObjectUtil.isNull(user)) { + throw new BaseException(CodeEnum.NOT_LOGIN); + } + + if (StrUtil.isNotEmpty(userInfo.getNickname())) { + user.setNickname(userInfo.getNickname()); + } + if (StrUtil.isNotEmpty(userInfo.getHeadImgUrl())) { + user.setAvatarUrl(userInfo.getHeadImgUrl()); + } + if (ObjectUtil.isNotNull(userInfo.getSex())) { + user.setGender(userInfo.getSex()); + } + if (StrUtil.isNotEmpty(userInfo.getCountry())) { + user.setCountry(userInfo.getCountry()); + } + if (StrUtil.isNotEmpty(userInfo.getProvince())) { + user.setProvince(userInfo.getProvince()); + } + if (StrUtil.isNotEmpty(userInfo.getCity())) { + user.setCity(userInfo.getCity()); + } + if (StrUtil.isNotEmpty(userInfo.getLanguage())) { + user.setLanguage(userInfo.getLanguage()); + } + userDao.updateByPrimaryKeySelective(user); + log.info("修改后的user信息,{}",user); + UserVo.WxInfo wxInfo = new UserVo.WxInfo(); + BeanUtil.copyProperties(user, wxInfo); + wxInfo.setHeadImgUrl(user.getAvatarUrl()); + wxInfo.setSex(user.getGender()); + return wxInfo; + } + + /** + * 解除已绑定的手机号 + */ + @Override + public void relievePhone(Long userId, UserDto.WxBindingPhone phoneInfo) { + if(isSmsCodeCorrect(phoneInfo.getPhone(),phoneInfo.getSmsCode())){ + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andUserIdEqualTo(userId) + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value) + .andIdentifierEqualTo(phoneInfo.getPhone()); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + SysAuth auth = authList.get(0); + auth.setRecStatus((byte) 2); + authDao.updateByPrimaryKeySelective(auth); + }else { + throw new BaseException(CodeEnum.PHONE_ERR); + } + } + + } + + /** + * 更改绑定手机号(不要密码) + * + * @param userId userId + * @param phoneInfo 手机号和验证码 + */ + @Override + public UserVo.UserSign changePhoneNotPassword(Long userId, UserDto.WxBindingPhone phoneInfo) { + UserVo.UserSign userSign; + if (isSmsCodeCorrect(phoneInfo.getPhone(), phoneInfo.getSmsCode())) { + //查找新手机号的的绑定信息 + Long newPhoneUserId = selectUserIdByPhone(phoneInfo.getPhone()); + if (ObjectUtil.isNull(newPhoneUserId)) { + + //查找此用户的的手机号 + SysAuthExample phoneExample = new SysAuthExample(); + phoneExample.createCriteria().andUserIdEqualTo(userId) + .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value); + List phoneAuthList = authDao.selectByExample(phoneExample); + if (CollectionUtil.isNotEmpty(phoneAuthList)) { + //修改 + SysAuth phoneAuth = phoneAuthList.get(0); + phoneAuth.setIdentifier(phoneInfo.getPhone()); + authDao.updateByPrimaryKeySelective(phoneAuth); + + userSign = new UserVo.UserSign(); + userSign.setUserId(phoneAuth.getUserId()); + userSign.setAuthId(phoneAuth.getId()); + + } else { + //添加一条手机号认证信息 + SysAuth sysAuth = new SysAuth(); + sysAuth.setId(snowflake.nextId()); + sysAuth.setUserId(userId); + sysAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Phone.value); + sysAuth.setIdentifier(phoneInfo.getPhone()); + authDao.insertSelective(sysAuth); + + userSign = new UserVo.UserSign(); + userSign.setUserId(sysAuth.getUserId()); + userSign.setAuthId(sysAuth.getId()); + + } + } else { + throw new BaseException(CodeEnum.MERGE_WX_PHONE); + } + } else { + throw new BaseException(CodeEnum.SMS_CODE_CORRECT); + } + return userSign; + } + + + /** + * 通过userId获取token + * + * @param userId userId + * @return token + */ + @Override + public UserVo.TokenBean getTokenByUserId(Long userId) { + UserVo.TokenBean tokenBean = new UserVo.TokenBean(); + //在redis中获取token + if (ObjectUtil.isNull(userId)) { + throw new BaseException(CodeEnum.PARAM_ERROR); + } + Object tokenRe = redisUtil.get(RedisKeyManager.getTokenCachedKey(userId)); + //获取认证信息 + UserVo.UserSign userSignVo = null; + SysAuthExample authExample = new SysAuthExample(); + authExample.createCriteria().andUserIdEqualTo(userId); + List authList = authDao.selectByExample(authExample); + if (CollectionUtil.isNotEmpty(authList)) { + userSignVo = new UserVo.UserSign(); + userSignVo.setUserId(authList.get(0).getUserId()); + userSignVo.setAuthId(authList.get(0).getId()); + } + if(ObjectUtil.isNotNull(userSignVo)){ + //获取手机号 + String phone = getPhone(userSignVo.getUserId()); + //获取账号 + String account = selectAccountByPhone(phone); + //获取用户的基本信息、 + UserVo.WxInfo wxInfo = null; + SysUser user = userDao.selectByPrimaryKey(userSignVo.getUserId()); + if (ObjectUtil.isNotNull(user)) { + wxInfo = new UserVo.WxInfo(); + BeanUtil.copyProperties(user, wxInfo); + wxInfo.setSex(user.getGender()); + wxInfo.setHeadImgUrl(user.getAvatarUrl()); + } + tokenBean.setId(userSignVo.getUserId()); + tokenBean.setPhone(phone); + tokenBean.setAccount(account); + tokenBean.setWxInfo(wxInfo); + }else { + throw new BaseException(CodeEnum.PARAM_ERROR); + } + //如果token为空重新生成一份 + if (ObjectUtil.isNull(tokenRe)) { + //3.生成token(access_token,refresh_token) + if (ObjectUtil.isNotNull(userSignVo)) { + Map theMap = CollectionUtil.newHashMap(); + theMap.put("authId", String.valueOf(userSignVo.getAuthId())); + long tokenExpired = 3600 * 1000L * 24 * 100; + + String token = + JwtUtil.createJWT(userId + "", + theMap, tokenExpired, + WebConstant.JWT_ACCESS_TOKEN_SECERT); + redisUtil.set(RedisKeyManager.getTokenCachedKey(userId), + token, tokenExpired / 1000); + tokenRe = token; + } + } + tokenBean.setToken(tokenRe.toString()); + return tokenBean; + } + + @Override + public UserVo.Account systemRegister(UserDto.UserSignupSystem userSignup) { + UserVo.Account account = new UserVo.Account(); + //1.添加user + SysUser user = new SysUser(); + user.setId(snowflake.nextId()); + userDao.insertSelective(user); + //自动添加账号密码 + String accountName; + String password; + if(StrUtil.isNotEmpty(userSignup.getAccount())){ + accountName = userSignup.getAccount(); + SysAuthExample sysAuthExample = new SysAuthExample(); + sysAuthExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value).andIdentifierEqualTo(accountName); + List authList = authDao.selectByExample(sysAuthExample); + if(CollectionUtil.isNotEmpty(authList)){ + throw new BaseException(CodeEnum.ALREADY_EXIST_ACCOUNT); + } + }else { + accountName = "USER_" + RandomStringUtils.random(8, WebConstant.RANDOM_STR); + } + //检查账号是否存在 + boolean flag = true; + int i = 0; + while (flag){ + SysAuthExample sysAuthExample = new SysAuthExample(); + sysAuthExample.createCriteria().andIdentifierEqualTo(accountName + (i==0 ? "" : "_"+i)).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value); + List authList1 = authDao.selectByExample(sysAuthExample); + if(CollectionUtil.isEmpty(authList1)){ + flag = false; + }else { + i++; + } + } + accountName = accountName + (i==0 ? "" : "_"+i); + + if(StrUtil.isNotEmpty(userSignup.getPassword())){ + password = userSignup.getPassword(); + }else { + password = "123456"; + } + SysAuth accountAuth = new SysAuth(); + accountAuth.setId(snowflake.nextId()); + accountAuth.setUserId(user.getId()); + accountAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Account.value); + accountAuth.setIdentifier(accountName); + accountAuth.setSalt(ShiroKit.getRandomSalt(6)); + accountAuth.setCredential(ShiroKit.md5(password, accountAuth.getSalt())); + accountAuth.setRegisterType((byte) 1); + authDao.insertSelective(accountAuth); + + account.setId(user.getId()); + account.setUsername(accountAuth.getIdentifier()); + return account; + } + + /** + * 通过userId获取用户名 + */ + @Override + public String getUserNameByUserId(Long userId) { + return userDao.getUserNameByUserId(userId); + } + + @Override + public List queryUserInfos(Long[] ids) { + return userDao.queryUserInfos(ids); + } + + @Override + public UserVo.VerificationCode getVertifyCode() { + Map codeMap = ImageCodeGeneratorUtil.generateCountCode(); + //生成一个id + long id = snowflake.nextId(); + //将两个数的和,存在redis内,key为新生成的id + String imageCodeKey = WebConstant.IMAGE_CODE + id; + redisUtil.set(imageCodeKey,codeMap.get("sum"),90); + log.info("将图形验证码存入redis:{}",imageCodeKey); + String imageBase64 = "data:image/png;base64," + ImageCodeGeneratorUtil.generateCodeImage(null, (String) codeMap.get("imageCode"), 200, 70); + + UserVo.VerificationCode vertifyCode = new UserVo.VerificationCode(); + vertifyCode.setImageBase64(imageBase64); + vertifyCode.setVerificationCodeId(String.valueOf(id)); + + return vertifyCode; + } +} diff --git a/signin/src/main/java/com/ccsens/signin/util/TallConstant.java b/signin/src/main/java/com/ccsens/signin/util/TallConstant.java new file mode 100644 index 00000000..1f45eb74 --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/util/TallConstant.java @@ -0,0 +1,55 @@ +package com.ccsens.signin.util; + +/** + * @author 逗 + */ +public class TallConstant { + + /*** redis key: 修改账号*/ + public static final String UPDATE_ACCOUNT = "update_account_"; + /*** redis key: 修改账号*/ + public static final String UPDATE_NICKNAME = "update_nickname_"; + /*** redis key: 查找登陆用户 格式 identifier_login_identifyType 有效期一天*/ + public static final String LOGIN = "_login_"; + /*** (需要特殊处理的插件)个人任务汇报插件*/ + public static final String PERSONAL_TASK_REPORT = "personal_task_report"; + + /***一天 */ + public static final long LOGIN_TIME = 60 * 60 * 24; + + /** + * 接口发送的信息模板 + * @param operateType 接口code + * @return + */ + public static String getRobotTemplateKey(int operateType) { + return "operate_type_" + operateType; + } + + public static String getUpdateAccount(String account){ + return UPDATE_ACCOUNT + account; + } + + public static String getUpdateNickname(String nickname){ + return UPDATE_ACCOUNT + nickname; + } + + public static final class TaskRemindTiming { + /**不提醒*/ + public static final byte REMIND_NONE = 0; + /**开始前*/ + public static final byte REMIND_TASK_BEFORE_START = 1; + /**开始时*/ + public static final byte REMIND_TASK_START = 2; + /**开始后*/ + public static final byte REMIND_TASK_AFTER_START = 3; + /**结束前*/ + public static final byte REMIND_TASK_BEFORE_END = 4; + /**结束时*/ + public static final byte REMIND_TASK_END = 5; + /**结束后*/ + public static final byte REMIND_TASK_AFTER_END = 6; + /**自定义*/ + public static final byte REMIND_TASK_USER_DEFINED = 7; + } +} diff --git a/signin/src/main/java/com/ccsens/signin/util/WxTemplateUtil.java b/signin/src/main/java/com/ccsens/signin/util/WxTemplateUtil.java new file mode 100644 index 00000000..4f1df29b --- /dev/null +++ b/signin/src/main/java/com/ccsens/signin/util/WxTemplateUtil.java @@ -0,0 +1,168 @@ +package com.ccsens.signin.util; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.ccsens.util.WechatUtil; +import com.ccsens.util.wx.WxGzhUtil; +import com.ccsens.util.wx.WxTemplateMessage; + + +/** + * @description: 微信模板 + * @author: whj + * @time: 2020/6/9 11:07 + */ +public class WxTemplateUtil { + + /** + * 设置小程序跳转 + * @param projectId + * @return + */ + private static WxTemplateMessage getWxTemplateMessage(Long projectId) { + String url = String.format(WechatUtil.PROJECT_URL, projectId); + WxTemplateMessage.MiniProgram miniProgram = new WxTemplateMessage.MiniProgram(WechatUtil.appid,url); + + WxTemplateMessage message = new WxTemplateMessage(); + message.setMiniprogram(miniProgram); + return message; + } + + /** + * 完成任务提醒(备注是在切面处统一加的) + * @param projectId + * @param userName + * @param operation + * @param taskName + * @return + */ + public static WxTemplateMessage getFinishTask(Long projectId, String userName, String operation, String taskName){ + + WxTemplateMessage message = getWxTemplateMessage(projectId); + message.setTemplate_id(WxGzhUtil.Template.TASK_FINISH.templateId); + WxTemplateMessage.TemplateData data = new WxTemplateMessage.TemplateData(); + data.setFirst(new WxTemplateMessage.TemplateSettings(userName + operation + taskName)); + data.setKeyword1(new WxTemplateMessage.TemplateSettings(taskName)); + data.setKeyword2(new WxTemplateMessage.TemplateSettings(DateUtil.now())); + message.setData(data); + return message; + } + + + /** + * 添加任务(备注是在切面处统一加的) + * @param projectId + * @param userName + * @param taskName + * @return + */ + public static WxTemplateMessage getAddTask(Long projectId, String userName, String taskName) { + WxTemplateMessage message = getWxTemplateMessage(projectId); + message.setTemplate_id(WxGzhUtil.Template.TASK_ADD.templateId); + WxTemplateMessage.TemplateData data = new WxTemplateMessage.TemplateData(); + data.setFirst(new WxTemplateMessage.TemplateSettings(StrUtil.format("{}添加了{}任务", userName, taskName))); + data.setKeyword1(new WxTemplateMessage.TemplateSettings(taskName)); + data.setKeyword2(new WxTemplateMessage.TemplateSettings(DateUtil.now())); + message.setData(data); + return message; + } + + /** + * 删除任务 + * @param projectId + * @param userName + * @param taskName + * @return + */ + public static WxTemplateMessage getDeleteTask(Long projectId, String userName, String taskName) { + WxTemplateMessage message = getWxTemplateMessage(projectId); + message.setTemplate_id(WxGzhUtil.Template.TASK_DELETE.templateId); + WxTemplateMessage.TemplateData data = new WxTemplateMessage.TemplateData(); + data.setFirst(new WxTemplateMessage.TemplateSettings(StrUtil.format("{}删除了{}任务", userName, taskName))); + data.setKeyword1(new WxTemplateMessage.TemplateSettings(taskName)); + data.setKeyword2(new WxTemplateMessage.TemplateSettings(DateUtil.now())); + data.setKeyword3(new WxTemplateMessage.TemplateSettings("")); + message.setData(data); + return message; + } + + /** + * 修改任务 + * @param projectId + * @param userName + * @param taskName + * @return + */ + public static WxTemplateMessage getChangeTask(Long projectId, String userName, String taskName) { + WxTemplateMessage message = getAddTask(projectId, userName, taskName); + message.getData().setFirst(new WxTemplateMessage.TemplateSettings(StrUtil.format("{}修改了{}任务", userName, taskName))); + return message; + } + + /** + * 上传交付物 + * @param projectId + * @param userName + * @param deliverName + * @return + */ + public static WxTemplateMessage getAddDeliver(Long projectId, String userName, String deliverName) { + WxTemplateMessage message = getWxTemplateMessage(projectId); + message.setTemplate_id(WxGzhUtil.Template.TASK_PROGRESS.templateId); + WxTemplateMessage.TemplateData data = new WxTemplateMessage.TemplateData(); + data.setFirst(new WxTemplateMessage.TemplateSettings("")); + data.setKeyword1(new WxTemplateMessage.TemplateSettings(userName + "上传了" + deliverName)); + data.setKeyword2(new WxTemplateMessage.TemplateSettings("上传交付物")); + message.setData(data); + return message; + } + + /** + * 删除交付物 + * @param projectId + * @param userName + * @param deliverName + * @return + */ + public static WxTemplateMessage getDeleteDeliver(Long projectId, String userName, String deliverName) { + WxTemplateMessage message = getAddDeliver(projectId, userName, deliverName); + WxTemplateMessage.TemplateData data = message.getData(); + data.setKeyword1(new WxTemplateMessage.TemplateSettings(userName + "删除了" + deliverName)); + data.setKeyword2(new WxTemplateMessage.TemplateSettings("删除交付物")); + message.setData(data); + return message; + } + + /** + * 检查交付物 + * @param projectId + * @param userName + * @param deliverName + * @return + */ + public static WxTemplateMessage getCheckDeliver(Long projectId, String userName, String deliverName) { + WxTemplateMessage message = getAddDeliver(projectId, userName, deliverName); + WxTemplateMessage.TemplateData data = message.getData(); + data.setKeyword1(new WxTemplateMessage.TemplateSettings(userName + "检查了" + deliverName)); + data.setKeyword2(new WxTemplateMessage.TemplateSettings("检查交付物")); + message.setData(data); + return message; + } + + /** + * 发表评论 + * @param projectId + * @param userName + * @return + */ + public static WxTemplateMessage getAddComment(Long projectId, String userName) { + WxTemplateMessage message = getWxTemplateMessage(projectId); + message.setTemplate_id(WxGzhUtil.Template.TASK_PROGRESS.templateId); + WxTemplateMessage.TemplateData data = new WxTemplateMessage.TemplateData(); + data.setFirst(new WxTemplateMessage.TemplateSettings(userName + "进行了点评")); + data.setKeyword1(new WxTemplateMessage.TemplateSettings(userName)); + data.setKeyword2(new WxTemplateMessage.TemplateSettings(DateUtil.now())); + message.setData(data); + return message; + } +} diff --git a/signin/src/main/resources/application-common.yml b/signin/src/main/resources/application-common.yml new file mode 100644 index 00000000..c27ac934 --- /dev/null +++ b/signin/src/main/resources/application-common.yml @@ -0,0 +1,28 @@ +logging: + level: + com: + favorites: DEBUG + org: + hibernate: ERROR + springframework: + web: DEBUG +mybatis: + config-location: classpath:mybatis/mybatis-config.xml + mapper-locations: classpath*:mapper_*/*.xml + type-aliases-package: com.ccsens.ht.bean +server: + tomcat: + uri-encoding: UTF-8 +spring: + http: + encoding: + charset: UTF-8 + enabled: true + force: true + log-request-details: true + servlet: + multipart: + max-file-size: 10MB + max-request-size: 100MB + + diff --git a/signin/src/main/resources/application-dev.yml b/signin/src/main/resources/application-dev.yml new file mode 100644 index 00000000..a6096204 --- /dev/null +++ b/signin/src/main/resources/application-dev.yml @@ -0,0 +1,41 @@ +server: + port: 7130 + servlet: + context-path: +spring: + snowflake: + datacenterId: 1 + workerId: 1 + application: + name: signin + datasource: + type: com.alibaba.druid.pool.DruidDataSource + rabbitmq: + host: 192.168.0.99 + password: 111111 + port: 5672 + username: admin + redis: + database: 0 + host: 127.0.0.1 + jedis: + pool: + max-active: 200 + max-idle: 10 + max-wait: -1ms + min-idle: 0 + password: '' + port: 6379 + timeout: 1000ms +swagger: + enable: true + +gatewayUrl: https://test.tall.wiki/gateway/ +notGatewayUrl: /home/staticrec/logo.png +smsCode: 0 +wx: + prefixUrl: https://test.tall.wiki/wxconfigurer-api/ +file: + path: /home/cloud/tall/uploads/ + domain: http://localhost:7030/v1.0/ + imgDomain: http://localhost:7030/v1.0/uploads \ No newline at end of file diff --git a/signin/src/main/resources/application-prod.yml b/signin/src/main/resources/application-prod.yml new file mode 100644 index 00000000..bf0a7001 --- /dev/null +++ b/signin/src/main/resources/application-prod.yml @@ -0,0 +1,48 @@ +server: + port: 7130 + servlet: + context-path: /v1.0 +spring: + snowflake: + datacenterId: 1 + workerId: 1 + application: + name: signin + datasource: + type: com.alibaba.druid.pool.DruidDataSource + rabbitmq: + host: 127.0.0.1 + password: 111111 + port: 5672 + username: admin + redis: + database: 0 + host: 127.0.0.1 + jedis: + pool: + max-active: 200 + max-idle: 10 + max-wait: -1ms + min-idle: 0 +# password: '' + password: 'areowqr!@43ef' + port: 6379 + timeout: 1000ms +swagger: + enable: false +eureka: + instance: + # www.tall.wiki +# ip-address: 140.143.228.3 +# ip-address: 81.70.54.64 + ip-address: 192.144.182.42 + +gatewayUrl: https://www.tall.wiki/gateway/ +notGatewayUrl: https://www.tall.wiki/ +smsCode: 1 +wx: + prefixUrl: https://www.tall.wiki/wxconfigurer-api/ +file: + path: /home/cloud/tall/uploads/ + domain: https://www.tall.wiki/gateway/tall/v1.0/ + imgDomain: https://www.tall.wiki/gateway/tall/v1.0/uploads \ No newline at end of file diff --git a/signin/src/main/resources/application-test.yml b/signin/src/main/resources/application-test.yml new file mode 100644 index 00000000..207b3dad --- /dev/null +++ b/signin/src/main/resources/application-test.yml @@ -0,0 +1,51 @@ +server: + port: 7130 + servlet: + context-path: /v1.0 +spring: + snowflake: + datacenterId: 1 + workerId: 1 + application: + name: signin + datasource: + type: com.alibaba.druid.pool.DruidDataSource + rabbitmq: + host: 127.0.0.1 +# host: api.ccsens.com + password: 111111 + port: 5672 + username: admin + redis: + database: 0 + host: 127.0.0.1 + jedis: + pool: + max-active: 200 + max-idle: 10 + max-wait: -1ms + min-idle: 0 + password: '' + port: 6379 + timeout: 1000ms +swagger: + enable: true +eureka: + instance: + ip-address: 192.168.0.99 +# ip-address: 49.233.89.188 +#gatewayUrl: http://192.168.0.99/gateway/ +#notGatewayUrl: http://192.168.0.99/ +gatewayUrl: https://test.tall.wiki/gateway/ +notGatewayUrl: https://test.tall.wiki/ +smsCode: 0 +wx: + prefixUrl: https://www.tall.wiki/wxconfigurer-api/ +file: + path: /home/cloud/tall/uploads/ + domain: https://test.tall.wiki/gateway/tall/v1.0/ + imgDomain: https://test.tall.wiki/gateway/tall/v1.0/uploads + +#file: +# domain: http://192.168.0.99/gateway/tall/v1.0/ +# imgDomain: http://192.168.0.99/gateway/tall/v1.0/uploads \ No newline at end of file diff --git a/signin/src/main/resources/application.yml b/signin/src/main/resources/application.yml new file mode 100644 index 00000000..b5408a3a --- /dev/null +++ b/signin/src/main/resources/application.yml @@ -0,0 +1,5 @@ +spring: + profiles: + active: dev + include: util-dev,common + diff --git a/signin/src/main/resources/business.yml b/signin/src/main/resources/business.yml new file mode 100644 index 00000000..eb60c4ba --- /dev/null +++ b/signin/src/main/resources/business.yml @@ -0,0 +1,9 @@ +business: + packet: + ## 红包默认过期时间(ms) + expiretime: 7*24*3600*1000 + ## 发红包手续费率 + rate: 0.01 + ## 发红包手续费率 + toplimit: 500.0 +name: zs \ No newline at end of file diff --git a/signin/src/main/resources/druid-dev.yml b/signin/src/main/resources/druid-dev.yml new file mode 100644 index 00000000..109ec223 --- /dev/null +++ b/signin/src/main/resources/druid-dev.yml @@ -0,0 +1,34 @@ +spring: + datasource: + druid: + connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 + driverClassName: com.mysql.cj.jdbc.Driver + dynamicUrl: jdbc:mysql://localhost:3306/${schema} + filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' + filterName: druidFilter + filterProfileEnable: true + filterUrlPattern: /* + filters: stat,wall + initialSize: 5 + maxActive: 20 + maxPoolPreparedStatementPerConnectionSize: 20 + maxWait: 60000 + minEvictableIdleTimeMillis: 300000 + minIdle: 5 + password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473 + poolPreparedStatements: true + servletLogSlowSql: true + servletLoginPassword: 111111 + servletLoginUsername: druid + servletName: druidServlet + servletResetEnable: true + servletUrlMapping: /druid/* + testOnBorrow: false + testOnReturn: false + testWhileIdle: true + timeBetweenEvictionRunsMillis: 60000 + url: jdbc:mysql://49.233.89.188:3306/tall?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true +# url: jdbc:mysql://127.0.0.1/tall?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true + username: root + validationQuery: SELECT 1 FROM DUAL + env: CCSENS_TALL \ No newline at end of file diff --git a/signin/src/main/resources/druid-prod.yml b/signin/src/main/resources/druid-prod.yml new file mode 100644 index 00000000..20a6ff77 --- /dev/null +++ b/signin/src/main/resources/druid-prod.yml @@ -0,0 +1,34 @@ +spring: + datasource: + druid: + connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 + driverClassName: com.mysql.cj.jdbc.Driver + dynamicUrl: jdbc:mysql://127.0.0.1:3306/${schema} + filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' + filterName: druidFilter + filterProfileEnable: true + filterUrlPattern: /* + filters: stat,wall + initialSize: 5 + maxActive: 20 + maxPoolPreparedStatementPerConnectionSize: 20 + maxWait: 60000 + minEvictableIdleTimeMillis: 300000 + minIdle: 5 +# password: 7cdefb88e0b8c8a401b66a83ee0cf80387461268074d1c3dcb146ab485318633 + password: + poolPreparedStatements: true + servletLogSlowSql: true + servletLoginPassword: 111111 + servletLoginUsername: druid + servletName: druidServlet + servletResetEnable: true + servletUrlMapping: /druid/* + testOnBorrow: false + testOnReturn: false + testWhileIdle: true + timeBetweenEvictionRunsMillis: 60000 + url: jdbc:mysql://127.0.0.1/tall?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true + username: root + validationQuery: SELECT 1 FROM DUAL + env: CCSENS_HEALTH \ No newline at end of file diff --git a/signin/src/main/resources/druid-test.yml b/signin/src/main/resources/druid-test.yml new file mode 100644 index 00000000..656c54f2 --- /dev/null +++ b/signin/src/main/resources/druid-test.yml @@ -0,0 +1,35 @@ +spring: + datasource: + druid: + connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 + driverClassName: com.mysql.cj.jdbc.Driver + dynamicUrl: jdbc:mysql://localhost:3306/${schema} + filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' + filterName: druidFilter + filterProfileEnable: true + filterUrlPattern: /* + filters: stat,wall + initialSize: 5 + maxActive: 20 + maxPoolPreparedStatementPerConnectionSize: 20 + maxWait: 60000 + minEvictableIdleTimeMillis: 300000 + minIdle: 5 +# password: + password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473 + poolPreparedStatements: true + servletLogSlowSql: true + servletLoginPassword: 111111 + servletLoginUsername: druid + servletName: druidServlet + servletResetEnable: true + servletUrlMapping: /druid/* + testOnBorrow: false + testOnReturn: false + testWhileIdle: true + timeBetweenEvictionRunsMillis: 60000 +# url: jdbc:mysql://127.0.0.1/tall?useUnicode=true&characterEncoding=UTF-8 + url: jdbc:mysql://test.tall.wiki/tall?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true + username: root + validationQuery: SELECT 1 FROM DUAL + env: CCSENS_TALL \ No newline at end of file diff --git a/signin/src/main/resources/logback-spring.xml b/signin/src/main/resources/logback-spring.xml new file mode 100644 index 00000000..0e29be06 --- /dev/null +++ b/signin/src/main/resources/logback-spring.xml @@ -0,0 +1,196 @@ + + + + + + + + + + logback + + + + + + + + + + + + + + + + + info + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + + + ${log.path}/log_debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/log_info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/log_warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + + ${log.path}/log_error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/signin/src/main/resources/mapper_dao/SysAuthDao.xml b/signin/src/main/resources/mapper_dao/SysAuthDao.xml new file mode 100644 index 00000000..d519f3f0 --- /dev/null +++ b/signin/src/main/resources/mapper_dao/SysAuthDao.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/signin/src/main/resources/mapper_dao/SysUserDao.xml b/signin/src/main/resources/mapper_dao/SysUserDao.xml new file mode 100644 index 00000000..e4155133 --- /dev/null +++ b/signin/src/main/resources/mapper_dao/SysUserDao.xml @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + update + t_sys_auth + set + user_id = #{newUserId} + where + user_id = #{oldUserId} + + + + update + t_sys_user_attention + set + user_id = #{newUserId} + where + user_id = #{oldUserId} + + + + update + t_sys_balance_log + set + user_id = #{newUserId} + where + user_id = #{oldUserId} + + + + update + t_sys_project + set + creator_id = #{newUserId} + where + creator_id = #{oldUserId} + + + + update + t_pro_member + set + user_id = #{newUserId} + where + user_id = #{oldUserId} + + + + update + t_pro_task_deliver_post_log + set + user_id = #{newUserId} + where + user_id = #{oldUserId} + + + + update + t_pro_log + set + user_id = #{newUserId} + where + user_id = #{oldUserId} + + + + update + t_pro_task_comment + set + user_id = #{newUserId} + where + user_id = #{oldUserId} + + + + + + + + + + + + + \ No newline at end of file diff --git a/signin/src/main/resources/mapper_raw/SysAuthMapper.xml b/signin/src/main/resources/mapper_raw/SysAuthMapper.xml new file mode 100644 index 00000000..60d76fdb --- /dev/null +++ b/signin/src/main/resources/mapper_raw/SysAuthMapper.xml @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, user_id, identify_type, identifier, credential, salt, created_at, updated_at, + rec_status, register_type + + + + + delete from t_sys_auth + where id = #{id,jdbcType=BIGINT} + + + delete from t_sys_auth + + + + + + insert into t_sys_auth (id, user_id, identify_type, + identifier, credential, salt, + created_at, updated_at, rec_status, + register_type) + values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{identifyType,jdbcType=TINYINT}, + #{identifier,jdbcType=VARCHAR}, #{credential,jdbcType=VARCHAR}, #{salt,jdbcType=VARCHAR}, + #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, + #{registerType,jdbcType=TINYINT}) + + + insert into t_sys_auth + + + id, + + + user_id, + + + identify_type, + + + identifier, + + + credential, + + + salt, + + + created_at, + + + updated_at, + + + rec_status, + + + register_type, + + + + + #{id,jdbcType=BIGINT}, + + + #{userId,jdbcType=BIGINT}, + + + #{identifyType,jdbcType=TINYINT}, + + + #{identifier,jdbcType=VARCHAR}, + + + #{credential,jdbcType=VARCHAR}, + + + #{salt,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + #{registerType,jdbcType=TINYINT}, + + + + + + update t_sys_auth + + + id = #{record.id,jdbcType=BIGINT}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + identify_type = #{record.identifyType,jdbcType=TINYINT}, + + + identifier = #{record.identifier,jdbcType=VARCHAR}, + + + credential = #{record.credential,jdbcType=VARCHAR}, + + + salt = #{record.salt,jdbcType=VARCHAR}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + register_type = #{record.registerType,jdbcType=TINYINT}, + + + + + + + + update t_sys_auth + set id = #{record.id,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, + identify_type = #{record.identifyType,jdbcType=TINYINT}, + identifier = #{record.identifier,jdbcType=VARCHAR}, + credential = #{record.credential,jdbcType=VARCHAR}, + salt = #{record.salt,jdbcType=VARCHAR}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT}, + register_type = #{record.registerType,jdbcType=TINYINT} + + + + + + update t_sys_auth + + + user_id = #{userId,jdbcType=BIGINT}, + + + identify_type = #{identifyType,jdbcType=TINYINT}, + + + identifier = #{identifier,jdbcType=VARCHAR}, + + + credential = #{credential,jdbcType=VARCHAR}, + + + salt = #{salt,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + register_type = #{registerType,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_sys_auth + set user_id = #{userId,jdbcType=BIGINT}, + identify_type = #{identifyType,jdbcType=TINYINT}, + identifier = #{identifier,jdbcType=VARCHAR}, + credential = #{credential,jdbcType=VARCHAR}, + salt = #{salt,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT}, + register_type = #{registerType,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/signin/src/main/resources/mapper_raw/SysUserInfoMapper.xml b/signin/src/main/resources/mapper_raw/SysUserInfoMapper.xml new file mode 100644 index 00000000..9fb1d13f --- /dev/null +++ b/signin/src/main/resources/mapper_raw/SysUserInfoMapper.xml @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, user_id, signature, introduction, birthday, address, web_path, company, position, + created_at, updated_at, rec_status + + + + + delete from t_sys_user_info + where id = #{id,jdbcType=BIGINT} + + + delete from t_sys_user_info + + + + + + insert into t_sys_user_info (id, user_id, signature, + introduction, birthday, address, + web_path, company, position, + created_at, updated_at, rec_status + ) + values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{signature,jdbcType=VARCHAR}, + #{introduction,jdbcType=VARCHAR}, #{birthday,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, + #{webPath,jdbcType=VARCHAR}, #{company,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, + #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} + ) + + + insert into t_sys_user_info + + + id, + + + user_id, + + + signature, + + + introduction, + + + birthday, + + + address, + + + web_path, + + + company, + + + position, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{userId,jdbcType=BIGINT}, + + + #{signature,jdbcType=VARCHAR}, + + + #{introduction,jdbcType=VARCHAR}, + + + #{birthday,jdbcType=VARCHAR}, + + + #{address,jdbcType=VARCHAR}, + + + #{webPath,jdbcType=VARCHAR}, + + + #{company,jdbcType=VARCHAR}, + + + #{position,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_sys_user_info + + + id = #{record.id,jdbcType=BIGINT}, + + + user_id = #{record.userId,jdbcType=BIGINT}, + + + signature = #{record.signature,jdbcType=VARCHAR}, + + + introduction = #{record.introduction,jdbcType=VARCHAR}, + + + birthday = #{record.birthday,jdbcType=VARCHAR}, + + + address = #{record.address,jdbcType=VARCHAR}, + + + web_path = #{record.webPath,jdbcType=VARCHAR}, + + + company = #{record.company,jdbcType=VARCHAR}, + + + position = #{record.position,jdbcType=VARCHAR}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_sys_user_info + set id = #{record.id,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, + signature = #{record.signature,jdbcType=VARCHAR}, + introduction = #{record.introduction,jdbcType=VARCHAR}, + birthday = #{record.birthday,jdbcType=VARCHAR}, + address = #{record.address,jdbcType=VARCHAR}, + web_path = #{record.webPath,jdbcType=VARCHAR}, + company = #{record.company,jdbcType=VARCHAR}, + position = #{record.position,jdbcType=VARCHAR}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_sys_user_info + + + user_id = #{userId,jdbcType=BIGINT}, + + + signature = #{signature,jdbcType=VARCHAR}, + + + introduction = #{introduction,jdbcType=VARCHAR}, + + + birthday = #{birthday,jdbcType=VARCHAR}, + + + address = #{address,jdbcType=VARCHAR}, + + + web_path = #{webPath,jdbcType=VARCHAR}, + + + company = #{company,jdbcType=VARCHAR}, + + + position = #{position,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_sys_user_info + set user_id = #{userId,jdbcType=BIGINT}, + signature = #{signature,jdbcType=VARCHAR}, + introduction = #{introduction,jdbcType=VARCHAR}, + birthday = #{birthday,jdbcType=VARCHAR}, + address = #{address,jdbcType=VARCHAR}, + web_path = #{webPath,jdbcType=VARCHAR}, + company = #{company,jdbcType=VARCHAR}, + position = #{position,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/signin/src/main/resources/mapper_raw/SysUserMapper.xml b/signin/src/main/resources/mapper_raw/SysUserMapper.xml new file mode 100644 index 00000000..34c92048 --- /dev/null +++ b/signin/src/main/resources/mapper_raw/SysUserMapper.xml @@ -0,0 +1,400 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, grade_id, avatar_url, nickname, gender, country, province, city, language, phone, + wechat, email, balance, created_at, updated_at, rec_status, source + + + + + delete from t_sys_user + where id = #{id,jdbcType=BIGINT} + + + delete from t_sys_user + + + + + + insert into t_sys_user (id, grade_id, avatar_url, + nickname, gender, country, + province, city, language, + phone, wechat, email, + balance, created_at, updated_at, + rec_status, source) + values (#{id,jdbcType=BIGINT}, #{gradeId,jdbcType=BIGINT}, #{avatarUrl,jdbcType=VARCHAR}, + #{nickname,jdbcType=VARCHAR}, #{gender,jdbcType=TINYINT}, #{country,jdbcType=VARCHAR}, + #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{language,jdbcType=VARCHAR}, + #{phone,jdbcType=VARCHAR}, #{wechat,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, + #{balance,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, + #{recStatus,jdbcType=TINYINT}, #{source,jdbcType=TINYINT}) + + + insert into t_sys_user + + + id, + + + grade_id, + + + avatar_url, + + + nickname, + + + gender, + + + country, + + + province, + + + city, + + + language, + + + phone, + + + wechat, + + + email, + + + balance, + + + created_at, + + + updated_at, + + + rec_status, + + + source, + + + + + #{id,jdbcType=BIGINT}, + + + #{gradeId,jdbcType=BIGINT}, + + + #{avatarUrl,jdbcType=VARCHAR}, + + + #{nickname,jdbcType=VARCHAR}, + + + #{gender,jdbcType=TINYINT}, + + + #{country,jdbcType=VARCHAR}, + + + #{province,jdbcType=VARCHAR}, + + + #{city,jdbcType=VARCHAR}, + + + #{language,jdbcType=VARCHAR}, + + + #{phone,jdbcType=VARCHAR}, + + + #{wechat,jdbcType=VARCHAR}, + + + #{email,jdbcType=VARCHAR}, + + + #{balance,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + #{source,jdbcType=TINYINT}, + + + + + + update t_sys_user + + + id = #{record.id,jdbcType=BIGINT}, + + + grade_id = #{record.gradeId,jdbcType=BIGINT}, + + + avatar_url = #{record.avatarUrl,jdbcType=VARCHAR}, + + + nickname = #{record.nickname,jdbcType=VARCHAR}, + + + gender = #{record.gender,jdbcType=TINYINT}, + + + country = #{record.country,jdbcType=VARCHAR}, + + + province = #{record.province,jdbcType=VARCHAR}, + + + city = #{record.city,jdbcType=VARCHAR}, + + + language = #{record.language,jdbcType=VARCHAR}, + + + phone = #{record.phone,jdbcType=VARCHAR}, + + + wechat = #{record.wechat,jdbcType=VARCHAR}, + + + email = #{record.email,jdbcType=VARCHAR}, + + + balance = #{record.balance,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + source = #{record.source,jdbcType=TINYINT}, + + + + + + + + update t_sys_user + set id = #{record.id,jdbcType=BIGINT}, + grade_id = #{record.gradeId,jdbcType=BIGINT}, + avatar_url = #{record.avatarUrl,jdbcType=VARCHAR}, + nickname = #{record.nickname,jdbcType=VARCHAR}, + gender = #{record.gender,jdbcType=TINYINT}, + country = #{record.country,jdbcType=VARCHAR}, + province = #{record.province,jdbcType=VARCHAR}, + city = #{record.city,jdbcType=VARCHAR}, + language = #{record.language,jdbcType=VARCHAR}, + phone = #{record.phone,jdbcType=VARCHAR}, + wechat = #{record.wechat,jdbcType=VARCHAR}, + email = #{record.email,jdbcType=VARCHAR}, + balance = #{record.balance,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT}, + source = #{record.source,jdbcType=TINYINT} + + + + + + update t_sys_user + + + grade_id = #{gradeId,jdbcType=BIGINT}, + + + avatar_url = #{avatarUrl,jdbcType=VARCHAR}, + + + nickname = #{nickname,jdbcType=VARCHAR}, + + + gender = #{gender,jdbcType=TINYINT}, + + + country = #{country,jdbcType=VARCHAR}, + + + province = #{province,jdbcType=VARCHAR}, + + + city = #{city,jdbcType=VARCHAR}, + + + language = #{language,jdbcType=VARCHAR}, + + + phone = #{phone,jdbcType=VARCHAR}, + + + wechat = #{wechat,jdbcType=VARCHAR}, + + + email = #{email,jdbcType=VARCHAR}, + + + balance = #{balance,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + source = #{source,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_sys_user + set grade_id = #{gradeId,jdbcType=BIGINT}, + avatar_url = #{avatarUrl,jdbcType=VARCHAR}, + nickname = #{nickname,jdbcType=VARCHAR}, + gender = #{gender,jdbcType=TINYINT}, + country = #{country,jdbcType=VARCHAR}, + province = #{province,jdbcType=VARCHAR}, + city = #{city,jdbcType=VARCHAR}, + language = #{language,jdbcType=VARCHAR}, + phone = #{phone,jdbcType=VARCHAR}, + wechat = #{wechat,jdbcType=VARCHAR}, + email = #{email,jdbcType=VARCHAR}, + balance = #{balance,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT}, + source = #{source,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/signin/src/main/resources/mybatis/mybatis-config.xml b/signin/src/main/resources/mybatis/mybatis-config.xml new file mode 100644 index 00000000..e5a218dd --- /dev/null +++ b/signin/src/main/resources/mybatis/mybatis-config.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tall/src/main/java/com/ccsens/tall/TallApplication.java b/tall/src/main/java/com/ccsens/tall/TallApplication.java index 290d270e..4115321d 100644 --- a/tall/src/main/java/com/ccsens/tall/TallApplication.java +++ b/tall/src/main/java/com/ccsens/tall/TallApplication.java @@ -24,7 +24,6 @@ import java.io.File; @EnableCircuitBreaker @EnableFeignClients(basePackages = "com.ccsens.cloudutil.feign") @SpringBootApplication(scanBasePackages = "com.ccsens") - public class TallApplication implements CommandLineRunner { public static void main(String[] args) { File dir = new File(WebConstant.IMG_PATH_PREFIX_SHARE_QR); From 90951175bd9908549efec0d879b6bdd54e108954 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Mon, 14 Dec 2020 11:39:24 +0800 Subject: [PATCH 31/33] =?UTF-8?q?20201214=E6=80=A5=E6=95=91=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomcar/bean/po/FirstAidStandard.java | 20 +- .../bean/po/FirstAidStandardExample.java | 78 +-- .../com/ccsens/wisdomcar/bean/po/Rfid.java | 12 +- .../ccsens/wisdomcar/bean/po/RfidExample.java | 48 +- .../com/ccsens/wisdomcar/bean/po/Screen.java | 22 + .../wisdomcar/bean/po/ScreenExample.java | 120 ++++ .../com/ccsens/wisdomcar/bean/po/Step.java | 95 +++ .../ccsens/wisdomcar/bean/po/StepExample.java | 641 ++++++++++++++++++ .../bean/vo/Message/CarRecordMessageVo.java | 2 +- .../wisdomcar/persist/mapper/StepMapper.java | 30 + .../wisdomcar/service/RecordService.java | 18 +- .../com/ccsens/wisdomcar/util/Constant.java | 14 + .../mapper_raw/FirstAidStandardMapper.xml | 40 +- .../main/resources/mapper_raw/RfidMapper.xml | 28 +- .../resources/mapper_raw/ScreenMapper.xml | 40 +- .../main/resources/mapper_raw/StepMapper.xml | 243 +++++++ 16 files changed, 1325 insertions(+), 126 deletions(-) create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Step.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/StepExample.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/mapper/StepMapper.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/util/Constant.java create mode 100644 wisdomcar/src/main/resources/mapper_raw/StepMapper.xml diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidStandard.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidStandard.java index 5c4fba7f..f6930995 100644 --- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidStandard.java +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidStandard.java @@ -10,9 +10,9 @@ public class FirstAidStandard implements Serializable { private Long hospitalId; - private Byte step; + private Long stepId; - private String duration; + private Long duration; private Date createdAt; @@ -46,20 +46,20 @@ public class FirstAidStandard implements Serializable { this.hospitalId = hospitalId; } - public Byte getStep() { - return step; + public Long getStepId() { + return stepId; } - public void setStep(Byte step) { - this.step = step; + public void setStepId(Long stepId) { + this.stepId = stepId; } - public String getDuration() { + public Long getDuration() { return duration; } - public void setDuration(String duration) { - this.duration = duration == null ? null : duration.trim(); + public void setDuration(Long duration) { + this.duration = duration; } public Date getCreatedAt() { @@ -95,7 +95,7 @@ public class FirstAidStandard implements Serializable { sb.append(", id=").append(id); sb.append(", type=").append(type); sb.append(", hospitalId=").append(hospitalId); - sb.append(", step=").append(step); + sb.append(", stepId=").append(stepId); sb.append(", duration=").append(duration); sb.append(", createdAt=").append(createdAt); sb.append(", updatedAt=").append(updatedAt); diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidStandardExample.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidStandardExample.java index e79b6784..1dc4cc79 100644 --- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidStandardExample.java +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidStandardExample.java @@ -285,63 +285,63 @@ public class FirstAidStandardExample { return (Criteria) this; } - public Criteria andStepIsNull() { - addCriterion("step is null"); + public Criteria andStepIdIsNull() { + addCriterion("step_id is null"); return (Criteria) this; } - public Criteria andStepIsNotNull() { - addCriterion("step is not null"); + public Criteria andStepIdIsNotNull() { + addCriterion("step_id is not null"); return (Criteria) this; } - public Criteria andStepEqualTo(Byte value) { - addCriterion("step =", value, "step"); + public Criteria andStepIdEqualTo(Long value) { + addCriterion("step_id =", value, "stepId"); return (Criteria) this; } - public Criteria andStepNotEqualTo(Byte value) { - addCriterion("step <>", value, "step"); + public Criteria andStepIdNotEqualTo(Long value) { + addCriterion("step_id <>", value, "stepId"); return (Criteria) this; } - public Criteria andStepGreaterThan(Byte value) { - addCriterion("step >", value, "step"); + public Criteria andStepIdGreaterThan(Long value) { + addCriterion("step_id >", value, "stepId"); return (Criteria) this; } - public Criteria andStepGreaterThanOrEqualTo(Byte value) { - addCriterion("step >=", value, "step"); + public Criteria andStepIdGreaterThanOrEqualTo(Long value) { + addCriterion("step_id >=", value, "stepId"); return (Criteria) this; } - public Criteria andStepLessThan(Byte value) { - addCriterion("step <", value, "step"); + public Criteria andStepIdLessThan(Long value) { + addCriterion("step_id <", value, "stepId"); return (Criteria) this; } - public Criteria andStepLessThanOrEqualTo(Byte value) { - addCriterion("step <=", value, "step"); + public Criteria andStepIdLessThanOrEqualTo(Long value) { + addCriterion("step_id <=", value, "stepId"); return (Criteria) this; } - public Criteria andStepIn(List values) { - addCriterion("step in", values, "step"); + public Criteria andStepIdIn(List values) { + addCriterion("step_id in", values, "stepId"); return (Criteria) this; } - public Criteria andStepNotIn(List values) { - addCriterion("step not in", values, "step"); + public Criteria andStepIdNotIn(List values) { + addCriterion("step_id not in", values, "stepId"); return (Criteria) this; } - public Criteria andStepBetween(Byte value1, Byte value2) { - addCriterion("step between", value1, value2, "step"); + public Criteria andStepIdBetween(Long value1, Long value2) { + addCriterion("step_id between", value1, value2, "stepId"); return (Criteria) this; } - public Criteria andStepNotBetween(Byte value1, Byte value2) { - addCriterion("step not between", value1, value2, "step"); + public Criteria andStepIdNotBetween(Long value1, Long value2) { + addCriterion("step_id not between", value1, value2, "stepId"); return (Criteria) this; } @@ -355,62 +355,52 @@ public class FirstAidStandardExample { return (Criteria) this; } - public Criteria andDurationEqualTo(String value) { + public Criteria andDurationEqualTo(Long value) { addCriterion("duration =", value, "duration"); return (Criteria) this; } - public Criteria andDurationNotEqualTo(String value) { + public Criteria andDurationNotEqualTo(Long value) { addCriterion("duration <>", value, "duration"); return (Criteria) this; } - public Criteria andDurationGreaterThan(String value) { + public Criteria andDurationGreaterThan(Long value) { addCriterion("duration >", value, "duration"); return (Criteria) this; } - public Criteria andDurationGreaterThanOrEqualTo(String value) { + public Criteria andDurationGreaterThanOrEqualTo(Long value) { addCriterion("duration >=", value, "duration"); return (Criteria) this; } - public Criteria andDurationLessThan(String value) { + public Criteria andDurationLessThan(Long value) { addCriterion("duration <", value, "duration"); return (Criteria) this; } - public Criteria andDurationLessThanOrEqualTo(String value) { + public Criteria andDurationLessThanOrEqualTo(Long value) { addCriterion("duration <=", value, "duration"); return (Criteria) this; } - public Criteria andDurationLike(String value) { - addCriterion("duration like", value, "duration"); - return (Criteria) this; - } - - public Criteria andDurationNotLike(String value) { - addCriterion("duration not like", value, "duration"); - return (Criteria) this; - } - - public Criteria andDurationIn(List values) { + public Criteria andDurationIn(List values) { addCriterion("duration in", values, "duration"); return (Criteria) this; } - public Criteria andDurationNotIn(List values) { + public Criteria andDurationNotIn(List values) { addCriterion("duration not in", values, "duration"); return (Criteria) this; } - public Criteria andDurationBetween(String value1, String value2) { + public Criteria andDurationBetween(Long value1, Long value2) { addCriterion("duration between", value1, value2, "duration"); return (Criteria) this; } - public Criteria andDurationNotBetween(String value1, String value2) { + public Criteria andDurationNotBetween(Long value1, Long value2) { addCriterion("duration not between", value1, value2, "duration"); return (Criteria) this; } diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Rfid.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Rfid.java index 1f718e27..10eb35ef 100644 --- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Rfid.java +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Rfid.java @@ -12,7 +12,7 @@ public class Rfid implements Serializable { private String name; - private Byte step; + private Long stepId; private Long hospitalId; @@ -56,12 +56,12 @@ public class Rfid implements Serializable { this.name = name == null ? null : name.trim(); } - public Byte getStep() { - return step; + public Long getStepId() { + return stepId; } - public void setStep(Byte step) { - this.step = step; + public void setStepId(Long stepId) { + this.stepId = stepId; } public Long getHospitalId() { @@ -106,7 +106,7 @@ public class Rfid implements Serializable { sb.append(", rfid=").append(rfid); sb.append(", type=").append(type); sb.append(", name=").append(name); - sb.append(", step=").append(step); + sb.append(", stepId=").append(stepId); sb.append(", hospitalId=").append(hospitalId); sb.append(", createdAt=").append(createdAt); sb.append(", updatedAt=").append(updatedAt); diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/RfidExample.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/RfidExample.java index b0fa2efe..f965317f 100644 --- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/RfidExample.java +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/RfidExample.java @@ -365,63 +365,63 @@ public class RfidExample { return (Criteria) this; } - public Criteria andStepIsNull() { - addCriterion("step is null"); + public Criteria andStepIdIsNull() { + addCriterion("step_id is null"); return (Criteria) this; } - public Criteria andStepIsNotNull() { - addCriterion("step is not null"); + public Criteria andStepIdIsNotNull() { + addCriterion("step_id is not null"); return (Criteria) this; } - public Criteria andStepEqualTo(Byte value) { - addCriterion("step =", value, "step"); + public Criteria andStepIdEqualTo(Long value) { + addCriterion("step_id =", value, "stepId"); return (Criteria) this; } - public Criteria andStepNotEqualTo(Byte value) { - addCriterion("step <>", value, "step"); + public Criteria andStepIdNotEqualTo(Long value) { + addCriterion("step_id <>", value, "stepId"); return (Criteria) this; } - public Criteria andStepGreaterThan(Byte value) { - addCriterion("step >", value, "step"); + public Criteria andStepIdGreaterThan(Long value) { + addCriterion("step_id >", value, "stepId"); return (Criteria) this; } - public Criteria andStepGreaterThanOrEqualTo(Byte value) { - addCriterion("step >=", value, "step"); + public Criteria andStepIdGreaterThanOrEqualTo(Long value) { + addCriterion("step_id >=", value, "stepId"); return (Criteria) this; } - public Criteria andStepLessThan(Byte value) { - addCriterion("step <", value, "step"); + public Criteria andStepIdLessThan(Long value) { + addCriterion("step_id <", value, "stepId"); return (Criteria) this; } - public Criteria andStepLessThanOrEqualTo(Byte value) { - addCriterion("step <=", value, "step"); + public Criteria andStepIdLessThanOrEqualTo(Long value) { + addCriterion("step_id <=", value, "stepId"); return (Criteria) this; } - public Criteria andStepIn(List values) { - addCriterion("step in", values, "step"); + public Criteria andStepIdIn(List values) { + addCriterion("step_id in", values, "stepId"); return (Criteria) this; } - public Criteria andStepNotIn(List values) { - addCriterion("step not in", values, "step"); + public Criteria andStepIdNotIn(List values) { + addCriterion("step_id not in", values, "stepId"); return (Criteria) this; } - public Criteria andStepBetween(Byte value1, Byte value2) { - addCriterion("step between", value1, value2, "step"); + public Criteria andStepIdBetween(Long value1, Long value2) { + addCriterion("step_id between", value1, value2, "stepId"); return (Criteria) this; } - public Criteria andStepNotBetween(Byte value1, Byte value2) { - addCriterion("step not between", value1, value2, "step"); + public Criteria andStepIdNotBetween(Long value1, Long value2) { + addCriterion("step_id not between", value1, value2, "stepId"); return (Criteria) this; } diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Screen.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Screen.java index be8eb9f7..33d2551f 100644 --- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Screen.java +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Screen.java @@ -10,6 +10,10 @@ public class Screen implements Serializable { private Long hospitalId; + private Byte showType; + + private Long userId; + private Date createdAt; private Date updatedAt; @@ -42,6 +46,22 @@ public class Screen implements Serializable { this.hospitalId = hospitalId; } + public Byte getShowType() { + return showType; + } + + public void setShowType(Byte showType) { + this.showType = showType; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + public Date getCreatedAt() { return createdAt; } @@ -75,6 +95,8 @@ public class Screen implements Serializable { sb.append(", id=").append(id); sb.append(", name=").append(name); sb.append(", hospitalId=").append(hospitalId); + sb.append(", showType=").append(showType); + sb.append(", userId=").append(userId); sb.append(", createdAt=").append(createdAt); sb.append(", updatedAt=").append(updatedAt); sb.append(", recStatus=").append(recStatus); diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/ScreenExample.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/ScreenExample.java index cb7acb5f..85cff46d 100644 --- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/ScreenExample.java +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/ScreenExample.java @@ -295,6 +295,126 @@ public class ScreenExample { return (Criteria) this; } + public Criteria andShowTypeIsNull() { + addCriterion("show_type is null"); + return (Criteria) this; + } + + public Criteria andShowTypeIsNotNull() { + addCriterion("show_type is not null"); + return (Criteria) this; + } + + public Criteria andShowTypeEqualTo(Byte value) { + addCriterion("show_type =", value, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeNotEqualTo(Byte value) { + addCriterion("show_type <>", value, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeGreaterThan(Byte value) { + addCriterion("show_type >", value, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeGreaterThanOrEqualTo(Byte value) { + addCriterion("show_type >=", value, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeLessThan(Byte value) { + addCriterion("show_type <", value, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeLessThanOrEqualTo(Byte value) { + addCriterion("show_type <=", value, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeIn(List values) { + addCriterion("show_type in", values, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeNotIn(List values) { + addCriterion("show_type not in", values, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeBetween(Byte value1, Byte value2) { + addCriterion("show_type between", value1, value2, "showType"); + return (Criteria) this; + } + + public Criteria andShowTypeNotBetween(Byte value1, Byte value2) { + addCriterion("show_type not between", value1, value2, "showType"); + return (Criteria) this; + } + + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); + return (Criteria) this; + } + public Criteria andCreatedAtIsNull() { addCriterion("created_at is null"); return (Criteria) this; diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Step.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Step.java new file mode 100644 index 00000000..9ec033a2 --- /dev/null +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/Step.java @@ -0,0 +1,95 @@ +package com.ccsens.wisdomcar.bean.po; + +import java.io.Serializable; +import java.util.Date; + +public class Step implements Serializable { + private Long id; + + private String name; + + private String code; + + private Integer sequence; + + private Date createdAt; + + private Date updatedAt; + + private Byte recStatus; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code == null ? null : code.trim(); + } + + public Integer getSequence() { + return sequence; + } + + public void setSequence(Integer sequence) { + this.sequence = sequence; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public Byte getRecStatus() { + return recStatus; + } + + public void setRecStatus(Byte recStatus) { + this.recStatus = recStatus; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", name=").append(name); + sb.append(", code=").append(code); + sb.append(", sequence=").append(sequence); + sb.append(", createdAt=").append(createdAt); + sb.append(", updatedAt=").append(updatedAt); + sb.append(", recStatus=").append(recStatus); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/StepExample.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/StepExample.java new file mode 100644 index 00000000..57c9d59e --- /dev/null +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/StepExample.java @@ -0,0 +1,641 @@ +package com.ccsens.wisdomcar.bean.po; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class StepExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public StepExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andCodeIsNull() { + addCriterion("code is null"); + return (Criteria) this; + } + + public Criteria andCodeIsNotNull() { + addCriterion("code is not null"); + return (Criteria) this; + } + + public Criteria andCodeEqualTo(String value) { + addCriterion("code =", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotEqualTo(String value) { + addCriterion("code <>", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThan(String value) { + addCriterion("code >", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThanOrEqualTo(String value) { + addCriterion("code >=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThan(String value) { + addCriterion("code <", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThanOrEqualTo(String value) { + addCriterion("code <=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLike(String value) { + addCriterion("code like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotLike(String value) { + addCriterion("code not like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeIn(List values) { + addCriterion("code in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotIn(List values) { + addCriterion("code not in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeBetween(String value1, String value2) { + addCriterion("code between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotBetween(String value1, String value2) { + addCriterion("code not between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andSequenceIsNull() { + addCriterion("sequence is null"); + return (Criteria) this; + } + + public Criteria andSequenceIsNotNull() { + addCriterion("sequence is not null"); + return (Criteria) this; + } + + public Criteria andSequenceEqualTo(Integer value) { + addCriterion("sequence =", value, "sequence"); + return (Criteria) this; + } + + public Criteria andSequenceNotEqualTo(Integer value) { + addCriterion("sequence <>", value, "sequence"); + return (Criteria) this; + } + + public Criteria andSequenceGreaterThan(Integer value) { + addCriterion("sequence >", value, "sequence"); + return (Criteria) this; + } + + public Criteria andSequenceGreaterThanOrEqualTo(Integer value) { + addCriterion("sequence >=", value, "sequence"); + return (Criteria) this; + } + + public Criteria andSequenceLessThan(Integer value) { + addCriterion("sequence <", value, "sequence"); + return (Criteria) this; + } + + public Criteria andSequenceLessThanOrEqualTo(Integer value) { + addCriterion("sequence <=", value, "sequence"); + return (Criteria) this; + } + + public Criteria andSequenceIn(List values) { + addCriterion("sequence in", values, "sequence"); + return (Criteria) this; + } + + public Criteria andSequenceNotIn(List values) { + addCriterion("sequence not in", values, "sequence"); + return (Criteria) this; + } + + public Criteria andSequenceBetween(Integer value1, Integer value2) { + addCriterion("sequence between", value1, value2, "sequence"); + return (Criteria) this; + } + + public Criteria andSequenceNotBetween(Integer value1, Integer value2) { + addCriterion("sequence not between", value1, value2, "sequence"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNull() { + addCriterion("created_at is null"); + return (Criteria) this; + } + + public Criteria andCreatedAtIsNotNull() { + addCriterion("created_at is not null"); + return (Criteria) this; + } + + public Criteria andCreatedAtEqualTo(Date value) { + addCriterion("created_at =", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotEqualTo(Date value) { + addCriterion("created_at <>", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThan(Date value) { + addCriterion("created_at >", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("created_at >=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThan(Date value) { + addCriterion("created_at <", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtLessThanOrEqualTo(Date value) { + addCriterion("created_at <=", value, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtIn(List values) { + addCriterion("created_at in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotIn(List values) { + addCriterion("created_at not in", values, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtBetween(Date value1, Date value2) { + addCriterion("created_at between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andCreatedAtNotBetween(Date value1, Date value2) { + addCriterion("created_at not between", value1, value2, "createdAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNull() { + addCriterion("updated_at is null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIsNotNull() { + addCriterion("updated_at is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedAtEqualTo(Date value) { + addCriterion("updated_at =", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotEqualTo(Date value) { + addCriterion("updated_at <>", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThan(Date value) { + addCriterion("updated_at >", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { + addCriterion("updated_at >=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThan(Date value) { + addCriterion("updated_at <", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { + addCriterion("updated_at <=", value, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtIn(List values) { + addCriterion("updated_at in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotIn(List values) { + addCriterion("updated_at not in", values, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtBetween(Date value1, Date value2) { + addCriterion("updated_at between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { + addCriterion("updated_at not between", value1, value2, "updatedAt"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNull() { + addCriterion("rec_status is null"); + return (Criteria) this; + } + + public Criteria andRecStatusIsNotNull() { + addCriterion("rec_status is not null"); + return (Criteria) this; + } + + public Criteria andRecStatusEqualTo(Byte value) { + addCriterion("rec_status =", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotEqualTo(Byte value) { + addCriterion("rec_status <>", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThan(Byte value) { + addCriterion("rec_status >", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { + addCriterion("rec_status >=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThan(Byte value) { + addCriterion("rec_status <", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusLessThanOrEqualTo(Byte value) { + addCriterion("rec_status <=", value, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusIn(List values) { + addCriterion("rec_status in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotIn(List values) { + addCriterion("rec_status not in", values, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusBetween(Byte value1, Byte value2) { + addCriterion("rec_status between", value1, value2, "recStatus"); + return (Criteria) this; + } + + public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { + addCriterion("rec_status not between", value1, value2, "recStatus"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/Message/CarRecordMessageVo.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/Message/CarRecordMessageVo.java index 16d00989..36122865 100644 --- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/Message/CarRecordMessageVo.java +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/Message/CarRecordMessageVo.java @@ -17,7 +17,7 @@ public class CarRecordMessageVo extends BaseMessageDto { */ private String carNumber; /** - * 类型 0:开始 1:体重 2:剂量 3:rfid + * 类型 0开始 1体重 2rfid, 3称重一 4称重二 5称重三 6称重四 7震动 8剂量, */ private int type; /** diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/mapper/StepMapper.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/mapper/StepMapper.java new file mode 100644 index 00000000..efd47141 --- /dev/null +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/mapper/StepMapper.java @@ -0,0 +1,30 @@ +package com.ccsens.wisdomcar.persist.mapper; + +import com.ccsens.wisdomcar.bean.po.Step; +import com.ccsens.wisdomcar.bean.po.StepExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface StepMapper { + long countByExample(StepExample example); + + int deleteByExample(StepExample example); + + int deleteByPrimaryKey(Long id); + + int insert(Step record); + + int insertSelective(Step record); + + List selectByExample(StepExample example); + + Step selectByPrimaryKey(Long id); + + int updateByExampleSelective(@Param("record") Step record, @Param("example") StepExample example); + + int updateByExample(@Param("record") Step record, @Param("example") StepExample example); + + int updateByPrimaryKeySelective(Step record); + + int updateByPrimaryKey(Step record); +} \ No newline at end of file diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java index d60248e4..0953377e 100644 --- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java @@ -78,20 +78,34 @@ public class RecordService implements IRecordService{ InMessage inMessage = InMessage.newToUserMessage(null,userIdSet,null,messageRule,s); //发送消息 messageService.sendToCarRecord(inMessage); + //TODO 如果是称重信息,制造测试数据发送大屏 + //新建急救表存储信息 + saveAidRecord(carRecordMessageDto, wisdomCar.getId()); + } + private void saveAidRecord(CarRecordMessageDto carRecordMessageDto, Long wisdomCarId) { // 如果是开始信息,新建一条急救表数据( TODO redis) if(carRecordMessageDto.getType() == 0){ + //TODO 结束该平车的上一个急救信息 + FirstAidExample firstAidExample = new FirstAidExample(); + firstAidExample.createCriteria().andCarIdEqualTo(wisdomCarId).andBegintimeNotEqualTo(0L).andEndtimeEqualTo(0L); + List firstAidList = firstAidMapper.selectByExample(firstAidExample); +// if(CollectionUtil.isNotEmpty()) + //新建急救信息 FirstAid firstAid = new FirstAid(); firstAid.setId(snowflake.nextId()); - firstAid.setCarId(wisdomCar.getId()); + firstAid.setCarId(wisdomCarId); firstAid.setBegintime(carRecordMessageDto.getTime()); + //存入数据库 firstAidMapper.insertSelective(firstAid); + //存入redis + String key = ""; }else { // 否则去添加急救流程信息(TODO redis) //急救表id 通过平车id查找 FirstAidExample firstAidExample = new FirstAidExample(); - firstAidExample.createCriteria().andCarIdEqualTo(wisdomCar.getId()); + firstAidExample.createCriteria().andCarIdEqualTo(wisdomCarId); List firstAids = firstAidMapper.selectByExample(firstAidExample); if(CollectionUtil.isNotEmpty(firstAids)){ FirstAid firstAid = firstAids.get(0); diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/util/Constant.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/util/Constant.java new file mode 100644 index 00000000..1922824b --- /dev/null +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/util/Constant.java @@ -0,0 +1,14 @@ +package com.ccsens.wisdomcar.util; + +/** + * @description: + * @author: whj + * @time: 2020/8/13 17:14 + */ +public class Constant { + /** + * 急救信息 + */ + public static final long SINGLE_ROLL_30_S = 2011; + +} diff --git a/wisdomcar/src/main/resources/mapper_raw/FirstAidStandardMapper.xml b/wisdomcar/src/main/resources/mapper_raw/FirstAidStandardMapper.xml index 8686a2e3..0236ba73 100644 --- a/wisdomcar/src/main/resources/mapper_raw/FirstAidStandardMapper.xml +++ b/wisdomcar/src/main/resources/mapper_raw/FirstAidStandardMapper.xml @@ -5,8 +5,8 @@ - - + + @@ -70,7 +70,7 @@ - id, type, hospital_id, step, duration, created_at, updated_at, rec_status + id, type, hospital_id, step_id, duration, created_at, updated_at, rec_status select @@ -105,11 +105,11 @@ insert into t_rfid (id, rfid, type, - name, step, hospital_id, + name, step_id, hospital_id, created_at, updated_at, rec_status ) values (#{id,jdbcType=BIGINT}, #{rfid,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, - #{name,jdbcType=VARCHAR}, #{step,jdbcType=TINYINT}, #{hospitalId,jdbcType=BIGINT}, + #{name,jdbcType=VARCHAR}, #{stepId,jdbcType=BIGINT}, #{hospitalId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} ) @@ -128,8 +128,8 @@ name, - - step, + + step_id, hospital_id, @@ -157,8 +157,8 @@ #{name,jdbcType=VARCHAR}, - - #{step,jdbcType=TINYINT}, + + #{stepId,jdbcType=BIGINT}, #{hospitalId,jdbcType=BIGINT}, @@ -195,8 +195,8 @@ name = #{record.name,jdbcType=VARCHAR}, - - step = #{record.step,jdbcType=TINYINT}, + + step_id = #{record.stepId,jdbcType=BIGINT}, hospital_id = #{record.hospitalId,jdbcType=BIGINT}, @@ -221,7 +221,7 @@ rfid = #{record.rfid,jdbcType=VARCHAR}, type = #{record.type,jdbcType=TINYINT}, name = #{record.name,jdbcType=VARCHAR}, - step = #{record.step,jdbcType=TINYINT}, + step_id = #{record.stepId,jdbcType=BIGINT}, hospital_id = #{record.hospitalId,jdbcType=BIGINT}, created_at = #{record.createdAt,jdbcType=TIMESTAMP}, updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, @@ -242,8 +242,8 @@ name = #{name,jdbcType=VARCHAR}, - - step = #{step,jdbcType=TINYINT}, + + step_id = #{stepId,jdbcType=BIGINT}, hospital_id = #{hospitalId,jdbcType=BIGINT}, @@ -265,7 +265,7 @@ set rfid = #{rfid,jdbcType=VARCHAR}, type = #{type,jdbcType=TINYINT}, name = #{name,jdbcType=VARCHAR}, - step = #{step,jdbcType=TINYINT}, + step_id = #{stepId,jdbcType=BIGINT}, hospital_id = #{hospitalId,jdbcType=BIGINT}, created_at = #{createdAt,jdbcType=TIMESTAMP}, updated_at = #{updatedAt,jdbcType=TIMESTAMP}, diff --git a/wisdomcar/src/main/resources/mapper_raw/ScreenMapper.xml b/wisdomcar/src/main/resources/mapper_raw/ScreenMapper.xml index 5fbdd161..4f5189c4 100644 --- a/wisdomcar/src/main/resources/mapper_raw/ScreenMapper.xml +++ b/wisdomcar/src/main/resources/mapper_raw/ScreenMapper.xml @@ -5,6 +5,8 @@ + + @@ -68,7 +70,7 @@ - id, name, hospital_id, created_at, updated_at, rec_status + id, name, hospital_id, show_type, user_id, created_at, updated_at, rec_status + select + + distinct + + + from t_step + + + + + order by ${orderByClause} + + + + + delete from t_step + where id = #{id,jdbcType=BIGINT} + + + delete from t_step + + + + + + insert into t_step (id, name, code, + sequence, created_at, updated_at, + rec_status) + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, + #{sequence,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, + #{recStatus,jdbcType=TINYINT}) + + + insert into t_step + + + id, + + + name, + + + code, + + + sequence, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{code,jdbcType=VARCHAR}, + + + #{sequence,jdbcType=INTEGER}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_step + + + id = #{record.id,jdbcType=BIGINT}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + code = #{record.code,jdbcType=VARCHAR}, + + + sequence = #{record.sequence,jdbcType=INTEGER}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_step + set id = #{record.id,jdbcType=BIGINT}, + name = #{record.name,jdbcType=VARCHAR}, + code = #{record.code,jdbcType=VARCHAR}, + sequence = #{record.sequence,jdbcType=INTEGER}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_step + + + name = #{name,jdbcType=VARCHAR}, + + + code = #{code,jdbcType=VARCHAR}, + + + sequence = #{sequence,jdbcType=INTEGER}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_step + set name = #{name,jdbcType=VARCHAR}, + code = #{code,jdbcType=VARCHAR}, + sequence = #{sequence,jdbcType=INTEGER}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file From 0b4b48ace8da26070b2302d02dcee69e98b0410b Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Mon, 14 Dec 2020 11:56:12 +0800 Subject: [PATCH 32/33] =?UTF-8?q?20201214=E7=BB=9F=E8=AE=A1api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomcar/api/StatisticsController.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/api/StatisticsController.java diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/api/StatisticsController.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/api/StatisticsController.java new file mode 100644 index 00000000..109ef427 --- /dev/null +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/api/StatisticsController.java @@ -0,0 +1,17 @@ +package com.ccsens.wisdomcar.api; + +import io.swagger.annotations.Api; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author 逗 + */ +@Slf4j +@Api(tags = "统计api" , description = "大屏显示") +@RestController +@RequestMapping("/statistics") +public class StatisticsController { + +} From c2c912ca8ed3c5a8a97a1369d3343006b8b30504 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Mon, 14 Dec 2020 12:06:38 +0800 Subject: [PATCH 33/33] =?UTF-8?q?20201214=E5=88=A0=E9=99=A4=E6=80=A5?= =?UTF-8?q?=E6=95=91=E8=AE=B0=E5=BD=95=E8=A1=A8=E7=BB=93=E6=9D=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccsens/wisdomcar/bean/po/FirstAid.java | 35 ++-- .../wisdomcar/bean/po/FirstAidExample.java | 156 ++++++++++++------ .../wisdomcar/bean/po/FirstAidRecord.java | 23 +-- .../bean/po/FirstAidRecordExample.java | 108 +++--------- .../resources/mapper_raw/FirstAidMapper.xml | 73 ++++---- .../mapper_raw/FirstAidRecordMapper.xml | 49 ++---- 6 files changed, 221 insertions(+), 223 deletions(-) diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAid.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAid.java index 68f116dd..638e6afb 100644 --- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAid.java +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAid.java @@ -8,9 +8,11 @@ public class FirstAid implements Serializable { private Long carId; - private Long begintime; + private Long hospitalId; - private Long endtime; + private Long beginTime; + + private Long endTime; private Date createdAt; @@ -36,20 +38,28 @@ public class FirstAid implements Serializable { this.carId = carId; } - public Long getBegintime() { - return begintime; + public Long getHospitalId() { + return hospitalId; + } + + public void setHospitalId(Long hospitalId) { + this.hospitalId = hospitalId; + } + + public Long getBeginTime() { + return beginTime; } - public void setBegintime(Long begintime) { - this.begintime = begintime; + public void setBeginTime(Long beginTime) { + this.beginTime = beginTime; } - public Long getEndtime() { - return endtime; + public Long getEndTime() { + return endTime; } - public void setEndtime(Long endtime) { - this.endtime = endtime; + public void setEndTime(Long endTime) { + this.endTime = endTime; } public Date getCreatedAt() { @@ -84,8 +94,9 @@ public class FirstAid implements Serializable { sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", carId=").append(carId); - sb.append(", begintime=").append(begintime); - sb.append(", endtime=").append(endtime); + sb.append(", hospitalId=").append(hospitalId); + sb.append(", beginTime=").append(beginTime); + sb.append(", endTime=").append(endTime); sb.append(", createdAt=").append(createdAt); sb.append(", updatedAt=").append(updatedAt); sb.append(", recStatus=").append(recStatus); diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidExample.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidExample.java index f3b0fc76..b52e5114 100644 --- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidExample.java +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidExample.java @@ -225,123 +225,183 @@ public class FirstAidExample { return (Criteria) this; } - public Criteria andBegintimeIsNull() { - addCriterion("beginTime is null"); + public Criteria andHospitalIdIsNull() { + addCriterion("hospital_id is null"); return (Criteria) this; } - public Criteria andBegintimeIsNotNull() { - addCriterion("beginTime is not null"); + public Criteria andHospitalIdIsNotNull() { + addCriterion("hospital_id is not null"); return (Criteria) this; } - public Criteria andBegintimeEqualTo(Long value) { - addCriterion("beginTime =", value, "begintime"); + public Criteria andHospitalIdEqualTo(Long value) { + addCriterion("hospital_id =", value, "hospitalId"); return (Criteria) this; } - public Criteria andBegintimeNotEqualTo(Long value) { - addCriterion("beginTime <>", value, "begintime"); + public Criteria andHospitalIdNotEqualTo(Long value) { + addCriterion("hospital_id <>", value, "hospitalId"); return (Criteria) this; } - public Criteria andBegintimeGreaterThan(Long value) { - addCriterion("beginTime >", value, "begintime"); + public Criteria andHospitalIdGreaterThan(Long value) { + addCriterion("hospital_id >", value, "hospitalId"); return (Criteria) this; } - public Criteria andBegintimeGreaterThanOrEqualTo(Long value) { - addCriterion("beginTime >=", value, "begintime"); + public Criteria andHospitalIdGreaterThanOrEqualTo(Long value) { + addCriterion("hospital_id >=", value, "hospitalId"); return (Criteria) this; } - public Criteria andBegintimeLessThan(Long value) { - addCriterion("beginTime <", value, "begintime"); + public Criteria andHospitalIdLessThan(Long value) { + addCriterion("hospital_id <", value, "hospitalId"); return (Criteria) this; } - public Criteria andBegintimeLessThanOrEqualTo(Long value) { - addCriterion("beginTime <=", value, "begintime"); + public Criteria andHospitalIdLessThanOrEqualTo(Long value) { + addCriterion("hospital_id <=", value, "hospitalId"); return (Criteria) this; } - public Criteria andBegintimeIn(List values) { - addCriterion("beginTime in", values, "begintime"); + public Criteria andHospitalIdIn(List values) { + addCriterion("hospital_id in", values, "hospitalId"); return (Criteria) this; } - public Criteria andBegintimeNotIn(List values) { - addCriterion("beginTime not in", values, "begintime"); + public Criteria andHospitalIdNotIn(List values) { + addCriterion("hospital_id not in", values, "hospitalId"); return (Criteria) this; } - public Criteria andBegintimeBetween(Long value1, Long value2) { - addCriterion("beginTime between", value1, value2, "begintime"); + public Criteria andHospitalIdBetween(Long value1, Long value2) { + addCriterion("hospital_id between", value1, value2, "hospitalId"); return (Criteria) this; } - public Criteria andBegintimeNotBetween(Long value1, Long value2) { - addCriterion("beginTime not between", value1, value2, "begintime"); + public Criteria andHospitalIdNotBetween(Long value1, Long value2) { + addCriterion("hospital_id not between", value1, value2, "hospitalId"); return (Criteria) this; } - public Criteria andEndtimeIsNull() { - addCriterion("endTime is null"); + public Criteria andBeginTimeIsNull() { + addCriterion("begin_time is null"); return (Criteria) this; } - public Criteria andEndtimeIsNotNull() { - addCriterion("endTime is not null"); + public Criteria andBeginTimeIsNotNull() { + addCriterion("begin_time is not null"); return (Criteria) this; } - public Criteria andEndtimeEqualTo(Long value) { - addCriterion("endTime =", value, "endtime"); + public Criteria andBeginTimeEqualTo(Long value) { + addCriterion("begin_time =", value, "beginTime"); return (Criteria) this; } - public Criteria andEndtimeNotEqualTo(Long value) { - addCriterion("endTime <>", value, "endtime"); + public Criteria andBeginTimeNotEqualTo(Long value) { + addCriterion("begin_time <>", value, "beginTime"); return (Criteria) this; } - public Criteria andEndtimeGreaterThan(Long value) { - addCriterion("endTime >", value, "endtime"); + public Criteria andBeginTimeGreaterThan(Long value) { + addCriterion("begin_time >", value, "beginTime"); return (Criteria) this; } - public Criteria andEndtimeGreaterThanOrEqualTo(Long value) { - addCriterion("endTime >=", value, "endtime"); + public Criteria andBeginTimeGreaterThanOrEqualTo(Long value) { + addCriterion("begin_time >=", value, "beginTime"); return (Criteria) this; } - public Criteria andEndtimeLessThan(Long value) { - addCriterion("endTime <", value, "endtime"); + public Criteria andBeginTimeLessThan(Long value) { + addCriterion("begin_time <", value, "beginTime"); return (Criteria) this; } - public Criteria andEndtimeLessThanOrEqualTo(Long value) { - addCriterion("endTime <=", value, "endtime"); + public Criteria andBeginTimeLessThanOrEqualTo(Long value) { + addCriterion("begin_time <=", value, "beginTime"); return (Criteria) this; } - public Criteria andEndtimeIn(List values) { - addCriterion("endTime in", values, "endtime"); + public Criteria andBeginTimeIn(List values) { + addCriterion("begin_time in", values, "beginTime"); return (Criteria) this; } - public Criteria andEndtimeNotIn(List values) { - addCriterion("endTime not in", values, "endtime"); + public Criteria andBeginTimeNotIn(List values) { + addCriterion("begin_time not in", values, "beginTime"); return (Criteria) this; } - public Criteria andEndtimeBetween(Long value1, Long value2) { - addCriterion("endTime between", value1, value2, "endtime"); + public Criteria andBeginTimeBetween(Long value1, Long value2) { + addCriterion("begin_time between", value1, value2, "beginTime"); return (Criteria) this; } - public Criteria andEndtimeNotBetween(Long value1, Long value2) { - addCriterion("endTime not between", value1, value2, "endtime"); + public Criteria andBeginTimeNotBetween(Long value1, Long value2) { + addCriterion("begin_time not between", value1, value2, "beginTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNull() { + addCriterion("end_time is null"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNotNull() { + addCriterion("end_time is not null"); + return (Criteria) this; + } + + public Criteria andEndTimeEqualTo(Long value) { + addCriterion("end_time =", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotEqualTo(Long value) { + addCriterion("end_time <>", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThan(Long value) { + addCriterion("end_time >", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThanOrEqualTo(Long value) { + addCriterion("end_time >=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThan(Long value) { + addCriterion("end_time <", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThanOrEqualTo(Long value) { + addCriterion("end_time <=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIn(List values) { + addCriterion("end_time in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotIn(List values) { + addCriterion("end_time not in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeBetween(Long value1, Long value2) { + addCriterion("end_time between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotBetween(Long value1, Long value2) { + addCriterion("end_time not between", value1, value2, "endTime"); return (Criteria) this; } diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidRecord.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidRecord.java index fb4e4a13..ca75bb38 100644 --- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidRecord.java +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidRecord.java @@ -12,9 +12,7 @@ public class FirstAidRecord implements Serializable { private String value; - private Long begintime; - - private Long endtime; + private Long beginTime; private Date createdAt; @@ -56,20 +54,12 @@ public class FirstAidRecord implements Serializable { this.value = value == null ? null : value.trim(); } - public Long getBegintime() { - return begintime; - } - - public void setBegintime(Long begintime) { - this.begintime = begintime; - } - - public Long getEndtime() { - return endtime; + public Long getBeginTime() { + return beginTime; } - public void setEndtime(Long endtime) { - this.endtime = endtime; + public void setBeginTime(Long beginTime) { + this.beginTime = beginTime; } public Date getCreatedAt() { @@ -106,8 +96,7 @@ public class FirstAidRecord implements Serializable { sb.append(", firstAidId=").append(firstAidId); sb.append(", type=").append(type); sb.append(", value=").append(value); - sb.append(", begintime=").append(begintime); - sb.append(", endtime=").append(endtime); + sb.append(", beginTime=").append(beginTime); sb.append(", createdAt=").append(createdAt); sb.append(", updatedAt=").append(updatedAt); sb.append(", recStatus=").append(recStatus); diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidRecordExample.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidRecordExample.java index e5ca1b76..19b035fb 100644 --- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidRecordExample.java +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/FirstAidRecordExample.java @@ -355,123 +355,63 @@ public class FirstAidRecordExample { return (Criteria) this; } - public Criteria andBegintimeIsNull() { - addCriterion("beginTime is null"); + public Criteria andBeginTimeIsNull() { + addCriterion("begin_time is null"); return (Criteria) this; } - public Criteria andBegintimeIsNotNull() { - addCriterion("beginTime is not null"); + public Criteria andBeginTimeIsNotNull() { + addCriterion("begin_time is not null"); return (Criteria) this; } - public Criteria andBegintimeEqualTo(Long value) { - addCriterion("beginTime =", value, "begintime"); + public Criteria andBeginTimeEqualTo(Long value) { + addCriterion("begin_time =", value, "beginTime"); return (Criteria) this; } - public Criteria andBegintimeNotEqualTo(Long value) { - addCriterion("beginTime <>", value, "begintime"); + public Criteria andBeginTimeNotEqualTo(Long value) { + addCriterion("begin_time <>", value, "beginTime"); return (Criteria) this; } - public Criteria andBegintimeGreaterThan(Long value) { - addCriterion("beginTime >", value, "begintime"); + public Criteria andBeginTimeGreaterThan(Long value) { + addCriterion("begin_time >", value, "beginTime"); return (Criteria) this; } - public Criteria andBegintimeGreaterThanOrEqualTo(Long value) { - addCriterion("beginTime >=", value, "begintime"); + public Criteria andBeginTimeGreaterThanOrEqualTo(Long value) { + addCriterion("begin_time >=", value, "beginTime"); return (Criteria) this; } - public Criteria andBegintimeLessThan(Long value) { - addCriterion("beginTime <", value, "begintime"); + public Criteria andBeginTimeLessThan(Long value) { + addCriterion("begin_time <", value, "beginTime"); return (Criteria) this; } - public Criteria andBegintimeLessThanOrEqualTo(Long value) { - addCriterion("beginTime <=", value, "begintime"); + public Criteria andBeginTimeLessThanOrEqualTo(Long value) { + addCriterion("begin_time <=", value, "beginTime"); return (Criteria) this; } - public Criteria andBegintimeIn(List values) { - addCriterion("beginTime in", values, "begintime"); + public Criteria andBeginTimeIn(List values) { + addCriterion("begin_time in", values, "beginTime"); return (Criteria) this; } - public Criteria andBegintimeNotIn(List values) { - addCriterion("beginTime not in", values, "begintime"); + public Criteria andBeginTimeNotIn(List values) { + addCriterion("begin_time not in", values, "beginTime"); return (Criteria) this; } - public Criteria andBegintimeBetween(Long value1, Long value2) { - addCriterion("beginTime between", value1, value2, "begintime"); + public Criteria andBeginTimeBetween(Long value1, Long value2) { + addCriterion("begin_time between", value1, value2, "beginTime"); return (Criteria) this; } - public Criteria andBegintimeNotBetween(Long value1, Long value2) { - addCriterion("beginTime not between", value1, value2, "begintime"); - return (Criteria) this; - } - - public Criteria andEndtimeIsNull() { - addCriterion("endTime is null"); - return (Criteria) this; - } - - public Criteria andEndtimeIsNotNull() { - addCriterion("endTime is not null"); - return (Criteria) this; - } - - public Criteria andEndtimeEqualTo(Long value) { - addCriterion("endTime =", value, "endtime"); - return (Criteria) this; - } - - public Criteria andEndtimeNotEqualTo(Long value) { - addCriterion("endTime <>", value, "endtime"); - return (Criteria) this; - } - - public Criteria andEndtimeGreaterThan(Long value) { - addCriterion("endTime >", value, "endtime"); - return (Criteria) this; - } - - public Criteria andEndtimeGreaterThanOrEqualTo(Long value) { - addCriterion("endTime >=", value, "endtime"); - return (Criteria) this; - } - - public Criteria andEndtimeLessThan(Long value) { - addCriterion("endTime <", value, "endtime"); - return (Criteria) this; - } - - public Criteria andEndtimeLessThanOrEqualTo(Long value) { - addCriterion("endTime <=", value, "endtime"); - return (Criteria) this; - } - - public Criteria andEndtimeIn(List values) { - addCriterion("endTime in", values, "endtime"); - return (Criteria) this; - } - - public Criteria andEndtimeNotIn(List values) { - addCriterion("endTime not in", values, "endtime"); - return (Criteria) this; - } - - public Criteria andEndtimeBetween(Long value1, Long value2) { - addCriterion("endTime between", value1, value2, "endtime"); - return (Criteria) this; - } - - public Criteria andEndtimeNotBetween(Long value1, Long value2) { - addCriterion("endTime not between", value1, value2, "endtime"); + public Criteria andBeginTimeNotBetween(Long value1, Long value2) { + addCriterion("begin_time not between", value1, value2, "beginTime"); return (Criteria) this; } diff --git a/wisdomcar/src/main/resources/mapper_raw/FirstAidMapper.xml b/wisdomcar/src/main/resources/mapper_raw/FirstAidMapper.xml index 985b1dee..a8a0b65b 100644 --- a/wisdomcar/src/main/resources/mapper_raw/FirstAidMapper.xml +++ b/wisdomcar/src/main/resources/mapper_raw/FirstAidMapper.xml @@ -4,8 +4,9 @@ - - + + + @@ -69,7 +70,7 @@ - id, car_id, beginTime, endTime, created_at, updated_at, rec_status + id, car_id, hospital_id, begin_time, end_time, created_at, updated_at, rec_status select @@ -105,13 +104,11 @@ insert into t_first_aid_record (id, first_aid_id, type, - value, beginTime, endTime, - created_at, updated_at, rec_status - ) + value, begin_time, created_at, + updated_at, rec_status) values (#{id,jdbcType=BIGINT}, #{firstAidId,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, - #{value,jdbcType=VARCHAR}, #{begintime,jdbcType=BIGINT}, #{endtime,jdbcType=BIGINT}, - #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} - ) + #{value,jdbcType=VARCHAR}, #{beginTime,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, + #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) insert into t_first_aid_record @@ -128,11 +125,8 @@ value, - - beginTime, - - - endTime, + + begin_time, created_at, @@ -157,11 +151,8 @@ #{value,jdbcType=VARCHAR}, - - #{begintime,jdbcType=BIGINT}, - - - #{endtime,jdbcType=BIGINT}, + + #{beginTime,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, @@ -195,11 +186,8 @@ value = #{record.value,jdbcType=VARCHAR}, - - beginTime = #{record.begintime,jdbcType=BIGINT}, - - - endTime = #{record.endtime,jdbcType=BIGINT}, + + begin_time = #{record.beginTime,jdbcType=BIGINT}, created_at = #{record.createdAt,jdbcType=TIMESTAMP}, @@ -221,8 +209,7 @@ first_aid_id = #{record.firstAidId,jdbcType=BIGINT}, type = #{record.type,jdbcType=TINYINT}, value = #{record.value,jdbcType=VARCHAR}, - beginTime = #{record.begintime,jdbcType=BIGINT}, - endTime = #{record.endtime,jdbcType=BIGINT}, + begin_time = #{record.beginTime,jdbcType=BIGINT}, created_at = #{record.createdAt,jdbcType=TIMESTAMP}, updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, rec_status = #{record.recStatus,jdbcType=TINYINT} @@ -242,11 +229,8 @@ value = #{value,jdbcType=VARCHAR}, - - beginTime = #{begintime,jdbcType=BIGINT}, - - - endTime = #{endtime,jdbcType=BIGINT}, + + begin_time = #{beginTime,jdbcType=BIGINT}, created_at = #{createdAt,jdbcType=TIMESTAMP}, @@ -265,8 +249,7 @@ set first_aid_id = #{firstAidId,jdbcType=BIGINT}, type = #{type,jdbcType=TINYINT}, value = #{value,jdbcType=VARCHAR}, - beginTime = #{begintime,jdbcType=BIGINT}, - endTime = #{endtime,jdbcType=BIGINT}, + begin_time = #{beginTime,jdbcType=BIGINT}, created_at = #{createdAt,jdbcType=TIMESTAMP}, updated_at = #{updatedAt,jdbcType=TIMESTAMP}, rec_status = #{recStatus,jdbcType=TINYINT}