From de5567b38e2506af2230d04b065b2dd931353fde Mon Sep 17 00:00:00 2001 From: chen <1251790704@qq.com> Date: Tue, 6 Apr 2021 17:40:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E6=95=88=E7=8E=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DgEfficiencyController.java | 102 ++++++++++-------- .../PersonalEfficiencyListRequest.java | 6 +- 2 files changed, 60 insertions(+), 48 deletions(-) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java index c35a7c14..9250c312 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java @@ -148,6 +148,61 @@ public class DgEfficiencyController { } } } + + // 时间筛选(固定时间),先根据固定时间筛选,再根据自选时间筛选 + if (personalEfficiencyListRequest.getCreateFixedTime() != null ) { + switch (personalEfficiencyListRequest.getCreateFixedTime()) { + case 0: + personalEfficiencyListRequest.setStartTime(DateUtils.getDayBegin()); + personalEfficiencyListRequest.setEndTime(DateUtils.getDayEnd());// 今天 + break; + case 1: + personalEfficiencyListRequest.setStartTime(DateUtils.getBeginDayOfYesterday()); + personalEfficiencyListRequest.setEndTime(DateUtils.getEndDayOfYesterDay());// 昨天 + break; + case 2: + personalEfficiencyListRequest.setStartTime(DateUtils.getBeginDayOfWeek()); + personalEfficiencyListRequest.setEndTime(DateUtils.getEndDayOfWeek());// 本周 + break; + case 3: + personalEfficiencyListRequest.setStartTime(DateUtils.getBeginDayOfMonth()); + personalEfficiencyListRequest.setEndTime(DateUtils.getEndDayOfMonth());// 本月 + break; + case 4: + personalEfficiencyListRequest.setStartTime(DateUtils.getBeginDayOfYear()); + personalEfficiencyListRequest.setEndTime(DateUtils.getEndDayOfYear());// 本年 + break; + } + //自选时间筛选 + }else if (personalEfficiencyListRequest.getStartTime() != null && personalEfficiencyListRequest.getEndTime() != null){ + personalEfficiencyListRequest.setStartTime(personalEfficiencyListRequest.getStartTime()); + personalEfficiencyListRequest.setEndTime(personalEfficiencyListRequest.getEndTime()); + }else { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date = null; + try { + date = sdf.parse("2020-04-16 00:00:00"); + } catch (ParseException e) { + e.printStackTrace(); + } + personalEfficiencyListRequest.setStartTime(date); + personalEfficiencyListRequest.setEndTime(new Date()); + } + //获取毫秒数 + long longStart = personalEfficiencyListRequest.getStartTime().getTime(); + long longEnd = personalEfficiencyListRequest.getEndTime().getTime(); + //迭代器进行筛选(过滤不在指定范围的时间数据) + Iterator iterator = responseList.iterator(); + while (iterator.hasNext()) { + PersonalEfficiencyListResponse next = iterator.next(); + String applicationDate = next.getApplicationDate(); + long longDate = getLongDate(applicationDate); + //当前日期小于开始日期或当前日期大于结束日期,删除该元素 + if (longDate < longStart || longDate > longEnd) { + iterator.remove(); + } + } + String userId = DgApplyAmountInfoController.getUserId(); CopyForMeRequest copyForMeRequest = new CopyForMeRequest(); copyForMeRequest.setUserId(Integer.parseInt(userId)); @@ -186,60 +241,15 @@ public class DgEfficiencyController { // 已发起 if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)) { responseList.removeIf(next -> !next.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)); - // responseList = responseList.stream().filter(p -> !p.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)).collect(Collectors.toList()); // 待处理 } else if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)) { responseList.removeIf(next -> !next.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)); - // responseList = responseList.stream().filter(p -> !p.getOperatingStatus().equals(StatusCode.CZ_ON_HAND)).collect(Collectors.toList()); // 已处理 } else if (personalEfficiencyListRequest.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)) { responseList.removeIf(next -> !next.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)); - // responseList = responseList.stream().filter(p -> !p.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)).collect(Collectors.toList()); - } - } - // 时间筛选(固定时间) - if (personalEfficiencyListRequest.getCreateFixedTime() != null && personalEfficiencyListRequest.getStartTime() == null && personalEfficiencyListRequest.getEndTime() == null) { - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - switch (personalEfficiencyListRequest.getCreateFixedTime()) { - case 0: - personalEfficiencyListRequest.setStartTime(dateFormat.format(DateUtils.getDayBegin())); - personalEfficiencyListRequest.setEndTime(dateFormat.format(DateUtils.getDayEnd()));// 今天 - break; - case 1: - personalEfficiencyListRequest.setStartTime(dateFormat.format(DateUtils.getBeginDayOfYesterday())); - personalEfficiencyListRequest.setEndTime(dateFormat.format(DateUtils.getEndDayOfYesterDay()));// 昨天 - break; - case 2: - personalEfficiencyListRequest.setStartTime(dateFormat.format(DateUtils.getBeginDayOfWeek())); - personalEfficiencyListRequest.setEndTime(dateFormat.format(DateUtils.getEndDayOfWeek()));// 本周 - break; - case 3: - personalEfficiencyListRequest.setStartTime(dateFormat.format(DateUtils.getBeginDayOfMonth())); - personalEfficiencyListRequest.setEndTime(dateFormat.format(DateUtils.getEndDayOfMonth()));// 本月 - break; - case 4: - personalEfficiencyListRequest.setStartTime(dateFormat.format(DateUtils.getBeginDayOfYear())); - personalEfficiencyListRequest.setEndTime(dateFormat.format(DateUtils.getEndDayOfYear()));// 本年 - break; - default: - personalEfficiencyListRequest.setStartTime(null); - personalEfficiencyListRequest.setEndTime(null); - } - //获取毫秒数 - long longStart = getLongDate(personalEfficiencyListRequest.getStartTime()); - long longEnd = getLongDate(personalEfficiencyListRequest.getEndTime()); - //迭代器进行筛选 - Iterator iterator = responseList.iterator(); - while (iterator.hasNext()) { - PersonalEfficiencyListResponse next = iterator.next(); - String applicationDate = next.getApplicationDate(); - long longDate = getLongDate(applicationDate); - //当前日期小于开始日期或当前日期大于结束日期,删除该元素 - if (longDate < longStart || longDate > longEnd) { - iterator.remove(); - } } } + //按时间降序排列 List collect = responseList.stream().sorted((o1, o2) -> { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PersonalEfficiencyListRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PersonalEfficiencyListRequest.java index 91571f33..304eeb7a 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PersonalEfficiencyListRequest.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/PersonalEfficiencyListRequest.java @@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.ToString; +import java.util.Date; + /** * @Author chen * @DATE 2020/12/31 15:35 @@ -19,11 +21,11 @@ public class PersonalEfficiencyListRequest { @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @ApiModelProperty("起始时间") - private String startTime; + private Date startTime; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @ApiModelProperty("结束时间") - private String endTime; + private Date endTime; @ApiModelProperty("操作状态") private Integer operatingStatus; From 4ca1fd21468bca91c1139da38528d4ead65b2263 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Wed, 7 Apr 2021 10:38:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrauth/service/impl/UserLoginServiceImpl.java | 11 ++++++++--- .../daqing/financial/hrauth/util/WXBizDataCrypt.java | 6 ++++++ .../com/daqing/framework/domain/hrms/UserEntity.java | 5 +++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java index 0a03a32c..66ec398b 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java @@ -353,7 +353,9 @@ public class UserLoginServiceImpl extends ServiceImpl // 用户的唯一标识(openid) String openid = (String) json.get("openid"); - System.out.println("session_key======"+session_key+"openid===="+openid); + String unionid = json.get("unionid").toString(); + + System.out.println("session_key======"+session_key+"openid===="+openid+"unionid===="+unionid); Map map = new HashMap(); @@ -376,9 +378,11 @@ public class UserLoginServiceImpl extends ServiceImpl userInfo.put("province", userInfoJSON.get("province")); userInfo.put("country", userInfoJSON.get("country")); userInfo.put("avatarUrl", userInfoJSON.get("avatarUrl")); - userInfo.put("unionId", userInfoJSON.get("unionId")); + //userInfo.put("unionId", userInfoJSON.get("unionId")); + userInfo.put("unionId", unionid); - System.out.println("unionId============"+userInfoJSON.get("unionId")); + System.out.println("unionId1============"+userInfoJSON.get("unionId")); + System.out.println("unionId2============"+userInfoJSON.get("unionId")); map.put("userInfo", userInfo); } else { map.put("status", 0); @@ -422,6 +426,7 @@ public class UserLoginServiceImpl extends ServiceImpl userEntity.setWechatId(md5UnionId);//加密后unionId userEntity.setHeadPortaritUrl(userMap.get("avatarUrl").toString());//头像路径 userEntity.setCreateTime(new Date());//创建时间 + userEntity.setType(loginRequest.getType());//登录类型(1:手机号 2:微信扫码登录 3:客户小程序登录 4:企业小程序登录) userLoginDao.insert(userEntity); loginRequest.setPhone(userMap.get("nickName").toString());//账号默认为微信名称 } diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/util/WXBizDataCrypt.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/util/WXBizDataCrypt.java index 8b19781a..8a9a7c09 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/util/WXBizDataCrypt.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/util/WXBizDataCrypt.java @@ -123,9 +123,15 @@ public class WXBizDataCrypt { public static void main(String[] args) throws Exception { + String iv="o/0EyFuVSUnsBjYHSExRnQ=="; + String sessionKey="7DU6CyigMSSVgR9JHXuMFA=="; + String encryptedData="Wwt3s0dUvUgtyZ9qwA0Rv4shePwN/6krOTb8WhJre/4lF+rO9tp+clUsjUqilngXZuTUYGcQt0WM6zNyCSNjK2q8/B9LLOc4Pu2KuIHLgfR+3NcF+q/sEs/vjrPMbjGQam5xQ6sl5iQVXa431S3i9hSj/2Hrp2lWdZ3NyytaGzakSsL8Wun1M05bvZ9bRqxnfyA726ILNb2O+OBehKKql2LwGW2g0J6R4Jwmfp5D5MzVDQZtB4UWhTJjHkq9FQZnI7I5oh4LpE74GClIUMoVCAEAB6g2M450n32sxSusM8lNemEG1ZCMvgRde9oYecMvBUNtXvtXzB/QZbQznt/Oh+EzmVArqhH/e7n+Ij23PNmiPbeD+zPNdmzn5Qhd5DPQaUrLxo6CqekmhdPtf1+AiU4AmQtHJNsD+aO4VP0va4s="; + +/* String iv="dvIIKwlnHIneQrj1ZGhhWQ=="; String sessionKey="xUkcqKQdaK0vpVUXj8ityA=="; String encryptedData="nK44nXrhAtBbmwBNgZ+du5mJbGoEr9pyPJG3upfQq6GXK3IKDHGkec6HDxGyBGe1qCs2kwLIOzm24da4o7cb6eEeNbewj18SMsWErGE3KWfy1b2BEg1ttu8oKp9Eatsmofavn/TnZeZSXVe5hDsmJSUPPRidjVp6AWCmOiQLCjY2RiNjpVx2fdgVvrzARK6IOlYyoL0soMUQXt0jnTdza5XVUbY/iTLbVc5Hrbw52+/n2tphoBc1iFXlkkKsJiHL6482LAZ43U5ev/AWoEV/lGfs4APktlppWjdIQkXFlpnb4z5TV0S5QT4D4fxigvjIi6MgTO9CYViCVS7K3/WK0JeuMS61dKJLAriajZN1LiBJhz29jG1PctEnGS56C+o59PrUKfULvRD6U0cGLpgsVuyFM6EFVgz7NIEmBC4gOVGnOSAenkc++xVvVUf164SBMIQItVXaYSv+13Dat43CyHmN+bZowJz0ghJ730gPv3f01RqCMmjrWwQuBzZi8RuXNPIBzpBhymfvnM8QF+FjXA=="; +*/ /* Map userInfo = getUserInfo(encryptedData, sessionKey, iv); System.out.println(userInfo); diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/UserEntity.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/UserEntity.java index 3137e3f2..1108a086 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/UserEntity.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/UserEntity.java @@ -100,4 +100,9 @@ public class UserEntity implements Serializable { */ private String headPortaritUrl; + /** + * 登录类型(1:手机号 2:微信扫码登录 3:客户小程序登录 4:企业小程序登录) + */ + private Integer type; + }