From 0c310bfb37d6bec0b685a04bff3307c2d630c0fb Mon Sep 17 00:00:00 2001 From: zhangye <654600784@qq.com> Date: Fri, 6 Mar 2020 19:48:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E5=91=98id=E6=94=B9userid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccsens/health/api/DebugController.java | 2 +- .../ccsens/health/bean/po/HealthAbnormal.java | 12 ++-- .../health/bean/po/HealthAbnormalExample.java | 48 ++++++------- .../ccsens/health/bean/po/HealthRecords.java | 12 ++-- .../health/bean/po/HealthRecordsExample.java | 48 ++++++------- .../com/ccsens/health/bean/po/Journey.java | 12 ++-- .../ccsens/health/bean/po/JourneyExample.java | 48 ++++++------- .../java/com/ccsens/health/bean/po/Site.java | 11 +++ .../ccsens/health/bean/po/SiteClockIn.java | 12 ++-- .../health/bean/po/SiteClockInExample.java | 48 ++++++------- .../ccsens/health/bean/po/SiteExample.java | 70 +++++++++++++++++++ .../ccsens/health/service/ClockService.java | 16 +++-- .../ccsens/health/service/HealthService.java | 20 ++++-- .../ccsens/health/service/IUserService.java | 2 +- .../ccsens/health/service/JourneyService.java | 16 +++-- .../ccsens/health/service/UserService.java | 36 +++++----- health/src/main/resources/application.yml | 4 +- .../mapper_raw/HealthAbnormalMapper.xml | 28 ++++---- .../mapper_raw/HealthRecordsMapper.xml | 30 ++++---- .../resources/mapper_raw/JourneyMapper.xml | 30 ++++---- .../mapper_raw/SiteClockInMapper.xml | 28 ++++---- .../main/resources/mapper_raw/SiteMapper.xml | 28 ++++++-- util/home | 2 +- .../test/java/com/ccsens/util/Base64Test.java | 1 - 24 files changed, 340 insertions(+), 224 deletions(-) diff --git a/health/src/main/java/com/ccsens/health/api/DebugController.java b/health/src/main/java/com/ccsens/health/api/DebugController.java index a889f434..cbcd4662 100644 --- a/health/src/main/java/com/ccsens/health/api/DebugController.java +++ b/health/src/main/java/com/ccsens/health/api/DebugController.java @@ -33,7 +33,7 @@ public class DebugController { @RequestMapping(value="qrcode",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) public JsonResponse qrcode(HttpServletRequest request) throws Exception { WxXcxUtil.getWxCode("pages/sign/sign?siteId=1235756988936359936&scene=1011&siteName=TSG&type=in" - ,"1011", WebConstant.UPLOAD_PATH_BASE+"112233.jpg"); + ,"1011", "/home/cloud/tall/uploads/112233.jpg"); return JsonResponse.newInstance().ok("完成"); } } diff --git a/health/src/main/java/com/ccsens/health/bean/po/HealthAbnormal.java b/health/src/main/java/com/ccsens/health/bean/po/HealthAbnormal.java index cc84c138..e4db5362 100644 --- a/health/src/main/java/com/ccsens/health/bean/po/HealthAbnormal.java +++ b/health/src/main/java/com/ccsens/health/bean/po/HealthAbnormal.java @@ -6,7 +6,7 @@ import java.util.Date; public class HealthAbnormal implements Serializable { private Long id; - private Long employeeId; + private Long userId; private Long time; @@ -28,12 +28,12 @@ public class HealthAbnormal implements Serializable { this.id = id; } - public Long getEmployeeId() { - return employeeId; + public Long getUserId() { + return userId; } - public void setEmployeeId(Long employeeId) { - this.employeeId = employeeId; + public void setUserId(Long userId) { + this.userId = userId; } public Long getTime() { @@ -83,7 +83,7 @@ public class HealthAbnormal implements Serializable { sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); - sb.append(", employeeId=").append(employeeId); + sb.append(", userId=").append(userId); sb.append(", time=").append(time); sb.append(", healthTypeId=").append(healthTypeId); sb.append(", createdAt=").append(createdAt); diff --git a/health/src/main/java/com/ccsens/health/bean/po/HealthAbnormalExample.java b/health/src/main/java/com/ccsens/health/bean/po/HealthAbnormalExample.java index 15b90a48..5691a782 100644 --- a/health/src/main/java/com/ccsens/health/bean/po/HealthAbnormalExample.java +++ b/health/src/main/java/com/ccsens/health/bean/po/HealthAbnormalExample.java @@ -165,63 +165,63 @@ public class HealthAbnormalExample { return (Criteria) this; } - public Criteria andEmployeeIdIsNull() { - addCriterion("employee_id is null"); + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); return (Criteria) this; } - public Criteria andEmployeeIdIsNotNull() { - addCriterion("employee_id is not null"); + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); return (Criteria) this; } - public Criteria andEmployeeIdEqualTo(Long value) { - addCriterion("employee_id =", value, "employeeId"); + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdNotEqualTo(Long value) { - addCriterion("employee_id <>", value, "employeeId"); + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdGreaterThan(Long value) { - addCriterion("employee_id >", value, "employeeId"); + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdGreaterThanOrEqualTo(Long value) { - addCriterion("employee_id >=", value, "employeeId"); + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdLessThan(Long value) { - addCriterion("employee_id <", value, "employeeId"); + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdLessThanOrEqualTo(Long value) { - addCriterion("employee_id <=", value, "employeeId"); + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdIn(List values) { - addCriterion("employee_id in", values, "employeeId"); + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdNotIn(List values) { - addCriterion("employee_id not in", values, "employeeId"); + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdBetween(Long value1, Long value2) { - addCriterion("employee_id between", value1, value2, "employeeId"); + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdNotBetween(Long value1, Long value2) { - addCriterion("employee_id not between", value1, value2, "employeeId"); + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); return (Criteria) this; } diff --git a/health/src/main/java/com/ccsens/health/bean/po/HealthRecords.java b/health/src/main/java/com/ccsens/health/bean/po/HealthRecords.java index 16be9ef2..963636be 100644 --- a/health/src/main/java/com/ccsens/health/bean/po/HealthRecords.java +++ b/health/src/main/java/com/ccsens/health/bean/po/HealthRecords.java @@ -7,7 +7,7 @@ import java.util.Date; public class HealthRecords implements Serializable { private Long id; - private Long employeeId; + private Long userId; private Long time; @@ -43,12 +43,12 @@ public class HealthRecords implements Serializable { this.id = id; } - public Long getEmployeeId() { - return employeeId; + public Long getUserId() { + return userId; } - public void setEmployeeId(Long employeeId) { - this.employeeId = employeeId; + public void setUserId(Long userId) { + this.userId = userId; } public Long getTime() { @@ -154,7 +154,7 @@ public class HealthRecords implements Serializable { sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); - sb.append(", employeeId=").append(employeeId); + sb.append(", userId=").append(userId); sb.append(", time=").append(time); sb.append(", district=").append(district); sb.append(", address=").append(address); diff --git a/health/src/main/java/com/ccsens/health/bean/po/HealthRecordsExample.java b/health/src/main/java/com/ccsens/health/bean/po/HealthRecordsExample.java index 3b8a36dc..669e50ef 100644 --- a/health/src/main/java/com/ccsens/health/bean/po/HealthRecordsExample.java +++ b/health/src/main/java/com/ccsens/health/bean/po/HealthRecordsExample.java @@ -166,63 +166,63 @@ public class HealthRecordsExample { return (Criteria) this; } - public Criteria andEmployeeIdIsNull() { - addCriterion("employee_id is null"); + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); return (Criteria) this; } - public Criteria andEmployeeIdIsNotNull() { - addCriterion("employee_id is not null"); + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); return (Criteria) this; } - public Criteria andEmployeeIdEqualTo(Long value) { - addCriterion("employee_id =", value, "employeeId"); + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdNotEqualTo(Long value) { - addCriterion("employee_id <>", value, "employeeId"); + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdGreaterThan(Long value) { - addCriterion("employee_id >", value, "employeeId"); + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdGreaterThanOrEqualTo(Long value) { - addCriterion("employee_id >=", value, "employeeId"); + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdLessThan(Long value) { - addCriterion("employee_id <", value, "employeeId"); + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdLessThanOrEqualTo(Long value) { - addCriterion("employee_id <=", value, "employeeId"); + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdIn(List values) { - addCriterion("employee_id in", values, "employeeId"); + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdNotIn(List values) { - addCriterion("employee_id not in", values, "employeeId"); + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdBetween(Long value1, Long value2) { - addCriterion("employee_id between", value1, value2, "employeeId"); + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdNotBetween(Long value1, Long value2) { - addCriterion("employee_id not between", value1, value2, "employeeId"); + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); return (Criteria) this; } diff --git a/health/src/main/java/com/ccsens/health/bean/po/Journey.java b/health/src/main/java/com/ccsens/health/bean/po/Journey.java index 21c4a541..9f724ae4 100644 --- a/health/src/main/java/com/ccsens/health/bean/po/Journey.java +++ b/health/src/main/java/com/ccsens/health/bean/po/Journey.java @@ -6,7 +6,7 @@ import java.util.Date; public class Journey implements Serializable { private Long id; - private Long employeeId; + private Long userId; private Byte tripMode; @@ -38,12 +38,12 @@ public class Journey implements Serializable { this.id = id; } - public Long getEmployeeId() { - return employeeId; + public Long getUserId() { + return userId; } - public void setEmployeeId(Long employeeId) { - this.employeeId = employeeId; + public void setUserId(Long userId) { + this.userId = userId; } public Byte getTripMode() { @@ -133,7 +133,7 @@ public class Journey implements Serializable { sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); - sb.append(", employeeId=").append(employeeId); + sb.append(", userId=").append(userId); sb.append(", tripMode=").append(tripMode); sb.append(", carNo=").append(carNo); sb.append(", startTime=").append(startTime); diff --git a/health/src/main/java/com/ccsens/health/bean/po/JourneyExample.java b/health/src/main/java/com/ccsens/health/bean/po/JourneyExample.java index ff8a1731..54dafd88 100644 --- a/health/src/main/java/com/ccsens/health/bean/po/JourneyExample.java +++ b/health/src/main/java/com/ccsens/health/bean/po/JourneyExample.java @@ -165,63 +165,63 @@ public class JourneyExample { return (Criteria) this; } - public Criteria andEmployeeIdIsNull() { - addCriterion("employee_id is null"); + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); return (Criteria) this; } - public Criteria andEmployeeIdIsNotNull() { - addCriterion("employee_id is not null"); + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); return (Criteria) this; } - public Criteria andEmployeeIdEqualTo(Long value) { - addCriterion("employee_id =", value, "employeeId"); + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdNotEqualTo(Long value) { - addCriterion("employee_id <>", value, "employeeId"); + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdGreaterThan(Long value) { - addCriterion("employee_id >", value, "employeeId"); + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdGreaterThanOrEqualTo(Long value) { - addCriterion("employee_id >=", value, "employeeId"); + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdLessThan(Long value) { - addCriterion("employee_id <", value, "employeeId"); + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdLessThanOrEqualTo(Long value) { - addCriterion("employee_id <=", value, "employeeId"); + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdIn(List values) { - addCriterion("employee_id in", values, "employeeId"); + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdNotIn(List values) { - addCriterion("employee_id not in", values, "employeeId"); + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdBetween(Long value1, Long value2) { - addCriterion("employee_id between", value1, value2, "employeeId"); + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdNotBetween(Long value1, Long value2) { - addCriterion("employee_id not between", value1, value2, "employeeId"); + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); return (Criteria) this; } diff --git a/health/src/main/java/com/ccsens/health/bean/po/Site.java b/health/src/main/java/com/ccsens/health/bean/po/Site.java index 9a867e65..d807ad74 100644 --- a/health/src/main/java/com/ccsens/health/bean/po/Site.java +++ b/health/src/main/java/com/ccsens/health/bean/po/Site.java @@ -15,6 +15,8 @@ public class Site implements Serializable { private BigDecimal latitude; + private String parentCode; + private Date createdAt; private Date updatedAt; @@ -63,6 +65,14 @@ public class Site implements Serializable { this.latitude = latitude; } + public String getParentCode() { + return parentCode; + } + + public void setParentCode(String parentCode) { + this.parentCode = parentCode == null ? null : parentCode.trim(); + } + public Date getCreatedAt() { return createdAt; } @@ -98,6 +108,7 @@ public class Site implements Serializable { sb.append(", siteCode=").append(siteCode); sb.append(", longitude=").append(longitude); sb.append(", latitude=").append(latitude); + sb.append(", parentCode=").append(parentCode); sb.append(", createdAt=").append(createdAt); sb.append(", updatedAt=").append(updatedAt); sb.append(", recStatus=").append(recStatus); diff --git a/health/src/main/java/com/ccsens/health/bean/po/SiteClockIn.java b/health/src/main/java/com/ccsens/health/bean/po/SiteClockIn.java index 3f5c5be7..6729950a 100644 --- a/health/src/main/java/com/ccsens/health/bean/po/SiteClockIn.java +++ b/health/src/main/java/com/ccsens/health/bean/po/SiteClockIn.java @@ -12,7 +12,7 @@ public class SiteClockIn implements Serializable { private String location; - private Long employeeId; + private Long userId; private Date createdAt; @@ -54,12 +54,12 @@ public class SiteClockIn implements Serializable { this.location = location == null ? null : location.trim(); } - public Long getEmployeeId() { - return employeeId; + public Long getUserId() { + return userId; } - public void setEmployeeId(Long employeeId) { - this.employeeId = employeeId; + public void setUserId(Long userId) { + this.userId = userId; } public Date getCreatedAt() { @@ -96,7 +96,7 @@ public class SiteClockIn implements Serializable { sb.append(", qrcodeId=").append(qrcodeId); sb.append(", time=").append(time); sb.append(", location=").append(location); - sb.append(", employeeId=").append(employeeId); + sb.append(", userId=").append(userId); sb.append(", createdAt=").append(createdAt); sb.append(", updatedAt=").append(updatedAt); sb.append(", recStatus=").append(recStatus); diff --git a/health/src/main/java/com/ccsens/health/bean/po/SiteClockInExample.java b/health/src/main/java/com/ccsens/health/bean/po/SiteClockInExample.java index 726ae933..2900acc6 100644 --- a/health/src/main/java/com/ccsens/health/bean/po/SiteClockInExample.java +++ b/health/src/main/java/com/ccsens/health/bean/po/SiteClockInExample.java @@ -355,63 +355,63 @@ public class SiteClockInExample { return (Criteria) this; } - public Criteria andEmployeeIdIsNull() { - addCriterion("employee_id is null"); + public Criteria andUserIdIsNull() { + addCriterion("user_id is null"); return (Criteria) this; } - public Criteria andEmployeeIdIsNotNull() { - addCriterion("employee_id is not null"); + public Criteria andUserIdIsNotNull() { + addCriterion("user_id is not null"); return (Criteria) this; } - public Criteria andEmployeeIdEqualTo(Long value) { - addCriterion("employee_id =", value, "employeeId"); + public Criteria andUserIdEqualTo(Long value) { + addCriterion("user_id =", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdNotEqualTo(Long value) { - addCriterion("employee_id <>", value, "employeeId"); + public Criteria andUserIdNotEqualTo(Long value) { + addCriterion("user_id <>", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdGreaterThan(Long value) { - addCriterion("employee_id >", value, "employeeId"); + public Criteria andUserIdGreaterThan(Long value) { + addCriterion("user_id >", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdGreaterThanOrEqualTo(Long value) { - addCriterion("employee_id >=", value, "employeeId"); + public Criteria andUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("user_id >=", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdLessThan(Long value) { - addCriterion("employee_id <", value, "employeeId"); + public Criteria andUserIdLessThan(Long value) { + addCriterion("user_id <", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdLessThanOrEqualTo(Long value) { - addCriterion("employee_id <=", value, "employeeId"); + public Criteria andUserIdLessThanOrEqualTo(Long value) { + addCriterion("user_id <=", value, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdIn(List values) { - addCriterion("employee_id in", values, "employeeId"); + public Criteria andUserIdIn(List values) { + addCriterion("user_id in", values, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdNotIn(List values) { - addCriterion("employee_id not in", values, "employeeId"); + public Criteria andUserIdNotIn(List values) { + addCriterion("user_id not in", values, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdBetween(Long value1, Long value2) { - addCriterion("employee_id between", value1, value2, "employeeId"); + public Criteria andUserIdBetween(Long value1, Long value2) { + addCriterion("user_id between", value1, value2, "userId"); return (Criteria) this; } - public Criteria andEmployeeIdNotBetween(Long value1, Long value2) { - addCriterion("employee_id not between", value1, value2, "employeeId"); + public Criteria andUserIdNotBetween(Long value1, Long value2) { + addCriterion("user_id not between", value1, value2, "userId"); return (Criteria) this; } diff --git a/health/src/main/java/com/ccsens/health/bean/po/SiteExample.java b/health/src/main/java/com/ccsens/health/bean/po/SiteExample.java index 1f051863..82077311 100644 --- a/health/src/main/java/com/ccsens/health/bean/po/SiteExample.java +++ b/health/src/main/java/com/ccsens/health/bean/po/SiteExample.java @@ -426,6 +426,76 @@ public class SiteExample { return (Criteria) this; } + public Criteria andParentCodeIsNull() { + addCriterion("parent_code is null"); + return (Criteria) this; + } + + public Criteria andParentCodeIsNotNull() { + addCriterion("parent_code is not null"); + return (Criteria) this; + } + + public Criteria andParentCodeEqualTo(String value) { + addCriterion("parent_code =", value, "parentCode"); + return (Criteria) this; + } + + public Criteria andParentCodeNotEqualTo(String value) { + addCriterion("parent_code <>", value, "parentCode"); + return (Criteria) this; + } + + public Criteria andParentCodeGreaterThan(String value) { + addCriterion("parent_code >", value, "parentCode"); + return (Criteria) this; + } + + public Criteria andParentCodeGreaterThanOrEqualTo(String value) { + addCriterion("parent_code >=", value, "parentCode"); + return (Criteria) this; + } + + public Criteria andParentCodeLessThan(String value) { + addCriterion("parent_code <", value, "parentCode"); + return (Criteria) this; + } + + public Criteria andParentCodeLessThanOrEqualTo(String value) { + addCriterion("parent_code <=", value, "parentCode"); + return (Criteria) this; + } + + public Criteria andParentCodeLike(String value) { + addCriterion("parent_code like", value, "parentCode"); + return (Criteria) this; + } + + public Criteria andParentCodeNotLike(String value) { + addCriterion("parent_code not like", value, "parentCode"); + return (Criteria) this; + } + + public Criteria andParentCodeIn(List values) { + addCriterion("parent_code in", values, "parentCode"); + return (Criteria) this; + } + + public Criteria andParentCodeNotIn(List values) { + addCriterion("parent_code not in", values, "parentCode"); + return (Criteria) this; + } + + public Criteria andParentCodeBetween(String value1, String value2) { + addCriterion("parent_code between", value1, value2, "parentCode"); + return (Criteria) this; + } + + public Criteria andParentCodeNotBetween(String value1, String value2) { + addCriterion("parent_code not between", value1, value2, "parentCode"); + return (Criteria) this; + } + public Criteria andCreatedAtIsNull() { addCriterion("created_at is null"); return (Criteria) this; diff --git a/health/src/main/java/com/ccsens/health/service/ClockService.java b/health/src/main/java/com/ccsens/health/service/ClockService.java index 2c77b14c..eeb94c9c 100644 --- a/health/src/main/java/com/ccsens/health/service/ClockService.java +++ b/health/src/main/java/com/ccsens/health/service/ClockService.java @@ -3,6 +3,7 @@ package com.ccsens.health.service; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.lang.Snowflake; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import com.ccsens.cloudutil.feign.TallFeignClient; import com.ccsens.health.bean.dto.ClockDto; import com.ccsens.health.bean.dto.HealthDto; @@ -51,12 +52,12 @@ public class ClockService implements IClockService { //1、获取打卡信息和userId ClockDto.SiteDto clickIn = params.getParam(); Long userId = params.getUserId(); - //2、通过userId获取成员id - Employee employee = userService.getEmployeeByUserId(userId); +// //2、通过userId获取成员id +// Employee employee = userService.getEmployeeByUserId(userId); //添加打卡记录 SiteClockIn siteClockIn = new SiteClockIn(); siteClockIn.setId(snowflake.nextId()); - siteClockIn.setEmployeeId(employee.getId()); + siteClockIn.setUserId(userId); siteClockIn.setQrcodeId(clickIn.getSiteId()); siteClockIn.setTime(System.currentTimeMillis()); siteClockInDao.insertSelective(siteClockIn); @@ -75,10 +76,13 @@ public class ClockService implements IClockService { Long startTime = selectDate.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : selectDate.getStartTime(); Long endTime = selectDate.getEndTime() == null ? System.currentTimeMillis() : selectDate.getEndTime(); String userId = tallFeignClient.getUserId(selectDate.getToken()); - //2、通过userid查询出成员id - Employee employee = userService.getEmployeeByUserId(Long.valueOf(userId)); + if(StrUtil.isEmpty(userId)){ + throw new BaseException(CodeEnum.NOT_LOGIN); + } +// //2、通过userid查询出成员id +// Employee employee = userService.getEmployeeByUserId(Long.valueOf(userId)); //3、查询该成员符合时间的记录 - List siteClockInfoList = siteClockInDao.selectHealthInfoByDate(employee.getId(),startTime,endTime); + List siteClockInfoList = siteClockInDao.selectHealthInfoByDate(Long.valueOf(userId),startTime,endTime); //4、返回 return siteClockInfoList; } diff --git a/health/src/main/java/com/ccsens/health/service/HealthService.java b/health/src/main/java/com/ccsens/health/service/HealthService.java index 09398d7a..2f0af4e4 100644 --- a/health/src/main/java/com/ccsens/health/service/HealthService.java +++ b/health/src/main/java/com/ccsens/health/service/HealthService.java @@ -4,6 +4,7 @@ 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.StrUtil; import com.ccsens.cloudutil.feign.TallFeignClient; import com.ccsens.health.bean.dto.HealthDto; import com.ccsens.health.bean.dto.JourneyDto; @@ -12,10 +13,12 @@ import com.ccsens.health.bean.vo.HealthVo; import com.ccsens.health.persist.dao.HealthQRCodeDao; import com.ccsens.health.persist.dao.HealthRecordsDao; import com.ccsens.health.persist.dao.HealthTypeDao; +import com.ccsens.util.CodeEnum; import com.ccsens.util.DateUtil; import com.ccsens.util.QrCodeUtil; import com.ccsens.util.WebConstant; import com.ccsens.util.bean.dto.QueryDto; +import com.ccsens.util.exception.BaseException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -49,13 +52,13 @@ public class HealthService implements IHealthService{ //1、获取健康信息和userId HealthDto.healthInfo healthInfo = params.getParam(); Long userId = params.getUserId(); - //2、通过userId获取成员id - Employee employee = userService.getEmployeeByUserId(userId); +// //2、通过userId获取成员id +// Employee employee = userService.getEmployeeByUserId(userId); //3、保存健康信息 HealthRecords healthRecords = new HealthRecords(); healthRecords.setId(snowflake.nextId()); healthRecords.setTime(System.currentTimeMillis()); - healthRecords.setEmployeeId(employee.getId()); + healthRecords.setUserId(userId); BeanUtil.copyProperties(healthInfo,healthRecords); healthRecordsDao.insertSelective(healthRecords); //4、生成健康码,返回地址 @@ -73,7 +76,7 @@ public class HealthService implements IHealthService{ //6、查询健康信息和健康码地址返回前端 HealthVo.HealthInfo healthInfoVo = new HealthVo.HealthInfo(); BeanUtil.copyProperties(healthRecords,healthInfoVo); - healthInfoVo.setUserId(employee.getId()); + healthInfoVo.setUserId(userId); healthInfoVo.setHealthCode(qrcodePath); return healthInfoVo; } @@ -90,10 +93,13 @@ public class HealthService implements IHealthService{ Long startTime = selectDate.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : selectDate.getStartTime(); Long endTime = selectDate.getEndTime() == null ? System.currentTimeMillis() : selectDate.getEndTime(); String userId = tallFeignClient.getUserId(selectDate.getToken()); - //2、通过userid查询出成员id - Employee employee = userService.getEmployeeByUserId(Long.valueOf(userId)); + if(StrUtil.isEmpty(userId)){ + throw new BaseException(CodeEnum.NOT_LOGIN); + } +// //2、通过userid查询出成员id +// Employee employee = userService.getEmployeeByUserId(Long.valueOf(userId)); //3、查询该成员符合时间的记录 - List healthInfoList = healthRecordsDao.selectHealthInfoByDate(employee.getId(),startTime,endTime); + List healthInfoList = healthRecordsDao.selectHealthInfoByDate(Long.valueOf(userId),startTime,endTime); //4、返回 return healthInfoList; } diff --git a/health/src/main/java/com/ccsens/health/service/IUserService.java b/health/src/main/java/com/ccsens/health/service/IUserService.java index 8c66fc06..51c91b1e 100644 --- a/health/src/main/java/com/ccsens/health/service/IUserService.java +++ b/health/src/main/java/com/ccsens/health/service/IUserService.java @@ -11,5 +11,5 @@ public interface IUserService { UserVo.UserInfo addUserInfo(QueryDto params); - Employee getEmployeeByUserId(Long userId); +// Employee getEmployeeByUserId(Long userId); } diff --git a/health/src/main/java/com/ccsens/health/service/JourneyService.java b/health/src/main/java/com/ccsens/health/service/JourneyService.java index a660e9f1..1ba1139e 100644 --- a/health/src/main/java/com/ccsens/health/service/JourneyService.java +++ b/health/src/main/java/com/ccsens/health/service/JourneyService.java @@ -3,6 +3,7 @@ package com.ccsens.health.service; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.StrUtil; import com.ccsens.cloudutil.feign.TallFeignClient; import com.ccsens.health.bean.dto.JourneyDto; import com.ccsens.health.bean.po.Employee; @@ -46,13 +47,13 @@ public class JourneyService implements IJourneyService{ //1、获取用户id和传入信息 JourneyDto.JourneyInfo journeyInfo = params.getParam(); Long userId = params.getUserId(); - //2、通过tallId找到health里的成员id - Employee employee = userService.getEmployeeByUserId(userId); +// //2、通过tallId找到health里的成员id +// Employee employee = userService.getEmployeeByUserId(userId); //3、保存行程 Journey journey = new Journey(); BeanUtil.copyProperties(journeyInfo,journey); journey.setId(snowflake.nextId()); - journey.setEmployeeId(employee.getId()); + journey.setUserId(userId); journeyDao.insertSelective(journey); //4、查询行程信息,并返回 JourneyVo.JourneyInfo journeyInfoVo = new JourneyVo.JourneyInfo(); @@ -73,10 +74,13 @@ public class JourneyService implements IJourneyService{ Long startTime = selectDate.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : selectDate.getStartTime(); Long endTime = selectDate.getEndTime() == null ? System.currentTimeMillis() : selectDate.getEndTime(); String userId = tallFeignClient.getUserId(selectDate.getToken()); - //2、通过userid查询出成员id - Employee employee = userService.getEmployeeByUserId(Long.valueOf(userId)); + if(StrUtil.isEmpty(userId)){ + throw new BaseException(CodeEnum.NOT_LOGIN); + } +// //2、通过userid查询出成员id +// Employee employee = userService.getEmployeeByUserId(Long.valueOf(userId)); //3、查询该成员符合时间的行程记录 - List journeyList = journeyDao.selectJourneyByDate(employee.getId(),startTime,endTime); + List journeyList = journeyDao.selectJourneyByDate(Long.valueOf(userId),startTime,endTime); //4、返回 return journeyList; } diff --git a/health/src/main/java/com/ccsens/health/service/UserService.java b/health/src/main/java/com/ccsens/health/service/UserService.java index 363a2400..88de4f20 100644 --- a/health/src/main/java/com/ccsens/health/service/UserService.java +++ b/health/src/main/java/com/ccsens/health/service/UserService.java @@ -3,6 +3,7 @@ package com.ccsens.health.service; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.StrUtil; import com.ccsens.cloudutil.feign.TallFeignClient; import com.ccsens.health.bean.dto.JourneyDto; import com.ccsens.health.bean.dto.UserDto; @@ -51,13 +52,16 @@ public class UserService implements IUserService{ Long startTime = selectDate.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : selectDate.getStartTime(); Long endTime = selectDate.getEndTime() == null ? System.currentTimeMillis() : selectDate.getEndTime(); String userId = tallFeignClient.getUserId(selectDate.getToken()); + if(StrUtil.isEmpty(userId)){ + throw new BaseException(CodeEnum.NOT_LOGIN); + } //查询信息 RealNameAuth realNameAuth = realNameAuthDao.selectByPrimaryKey(Long.valueOf(userId)); UserVo.UserInfo userInfoVo = new UserVo.UserInfo(); BeanUtil.copyProperties(realNameAuth,userInfoVo); - //查询健康码 - Employee employee = getEmployeeByUserId(Long.valueOf(userId)); - List healthCodeList = healthRecordsDao.getHealthQrCodeByEmployeeId(employee.getId(),startTime,endTime); +// //查询健康码 +// Employee employee = getEmployeeByUserId(Long.valueOf(userId)); + List healthCodeList = healthRecordsDao.getHealthQrCodeByEmployeeId(Long.valueOf(userId),startTime,endTime); userInfoVo.setHealthCodeList(healthCodeList); @@ -91,18 +95,18 @@ public class UserService implements IUserService{ } - /** - * 通过userid获取employeeId - */ - @Override - public Employee getEmployeeByUserId(Long userId){ - EmployeeExample employeeExample = new EmployeeExample(); - employeeExample.createCriteria().andTallUserIdEqualTo(userId); - List employeeList = employeeDao.selectByExample(employeeExample); - if(CollectionUtil.isEmpty(employeeList)){ - throw new BaseException(CodeEnum.NOT_EMPLOYEE); - } - return employeeList.get(0); - } +// /** +// * 通过userid获取employeeId +// */ +// @Override +// public Employee getEmployeeByUserId(Long userId){ +// EmployeeExample employeeExample = new EmployeeExample(); +// employeeExample.createCriteria().andTallUserIdEqualTo(userId); +// List employeeList = employeeDao.selectByExample(employeeExample); +// if(CollectionUtil.isEmpty(employeeList)){ +// throw new BaseException(CodeEnum.NOT_EMPLOYEE); +// } +// return employeeList.get(0); +// } } diff --git a/health/src/main/resources/application.yml b/health/src/main/resources/application.yml index 5889ff7f..5c2cd5c4 100644 --- a/health/src/main/resources/application.yml +++ b/health/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: test - include: common, util-test \ No newline at end of file + active: dev + include: common, util-dev \ No newline at end of file diff --git a/health/src/main/resources/mapper_raw/HealthAbnormalMapper.xml b/health/src/main/resources/mapper_raw/HealthAbnormalMapper.xml index 1b774738..e5ffa0c3 100644 --- a/health/src/main/resources/mapper_raw/HealthAbnormalMapper.xml +++ b/health/src/main/resources/mapper_raw/HealthAbnormalMapper.xml @@ -3,7 +3,7 @@ - + @@ -69,7 +69,7 @@ - id, employee_id, time, health_type_id, created_at, updated_at, rec_status + id, user_id, time, health_type_id, created_at, updated_at, rec_status select @@ -110,12 +110,12 @@ - insert into t_health_records (id, employee_id, time, + insert into t_health_records (id, user_id, time, district, address, health_type_id, hospital, touch_hubei, touch_sick, animal_heat, self_fill, created_at, updated_at, rec_status) - values (#{id,jdbcType=BIGINT}, #{employeeId,jdbcType=BIGINT}, #{time,jdbcType=BIGINT}, + values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{time,jdbcType=BIGINT}, #{district,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{healthTypeId,jdbcType=BIGINT}, #{hospital,jdbcType=VARCHAR}, #{touchHubei,jdbcType=TINYINT}, #{touchSick,jdbcType=TINYINT}, #{animalHeat,jdbcType=DECIMAL}, #{selfFill,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, @@ -127,8 +127,8 @@ id, - - employee_id, + + user_id, time, @@ -171,8 +171,8 @@ #{id,jdbcType=BIGINT}, - - #{employeeId,jdbcType=BIGINT}, + + #{userId,jdbcType=BIGINT}, #{time,jdbcType=BIGINT}, @@ -224,8 +224,8 @@ id = #{record.id,jdbcType=BIGINT}, - - employee_id = #{record.employeeId,jdbcType=BIGINT}, + + user_id = #{record.userId,jdbcType=BIGINT}, time = #{record.time,jdbcType=BIGINT}, @@ -271,7 +271,7 @@ update t_health_records set id = #{record.id,jdbcType=BIGINT}, - employee_id = #{record.employeeId,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, time = #{record.time,jdbcType=BIGINT}, district = #{record.district,jdbcType=VARCHAR}, address = #{record.address,jdbcType=VARCHAR}, @@ -291,8 +291,8 @@ update t_health_records - - employee_id = #{employeeId,jdbcType=BIGINT}, + + user_id = #{userId,jdbcType=BIGINT}, time = #{time,jdbcType=BIGINT}, @@ -335,7 +335,7 @@ update t_health_records - set employee_id = #{employeeId,jdbcType=BIGINT}, + set user_id = #{userId,jdbcType=BIGINT}, time = #{time,jdbcType=BIGINT}, district = #{district,jdbcType=VARCHAR}, address = #{address,jdbcType=VARCHAR}, diff --git a/health/src/main/resources/mapper_raw/JourneyMapper.xml b/health/src/main/resources/mapper_raw/JourneyMapper.xml index b68819ba..2e187ae5 100644 --- a/health/src/main/resources/mapper_raw/JourneyMapper.xml +++ b/health/src/main/resources/mapper_raw/JourneyMapper.xml @@ -3,7 +3,7 @@ - + @@ -74,8 +74,8 @@ - id, employee_id, trip_mode, car_no, start_time, end_time, journey_type, together, - self_fill, created_at, updated_at, rec_status + id, user_id, trip_mode, car_no, start_time, end_time, journey_type, together, self_fill, + created_at, updated_at, rec_status select @@ -104,10 +104,10 @@ insert into t_site_clock_in (id, qrcode_id, time, - location, employee_id, created_at, + location, user_id, created_at, updated_at, rec_status) values (#{id,jdbcType=BIGINT}, #{qrcodeId,jdbcType=BIGINT}, #{time,jdbcType=BIGINT}, - #{location,jdbcType=VARCHAR}, #{employeeId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, + #{location,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) @@ -125,8 +125,8 @@ location, - - employee_id, + + user_id, created_at, @@ -151,8 +151,8 @@ #{location,jdbcType=VARCHAR}, - - #{employeeId,jdbcType=BIGINT}, + + #{userId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, @@ -186,8 +186,8 @@ location = #{record.location,jdbcType=VARCHAR}, - - employee_id = #{record.employeeId,jdbcType=BIGINT}, + + user_id = #{record.userId,jdbcType=BIGINT}, created_at = #{record.createdAt,jdbcType=TIMESTAMP}, @@ -209,7 +209,7 @@ qrcode_id = #{record.qrcodeId,jdbcType=BIGINT}, time = #{record.time,jdbcType=BIGINT}, location = #{record.location,jdbcType=VARCHAR}, - employee_id = #{record.employeeId,jdbcType=BIGINT}, + user_id = #{record.userId,jdbcType=BIGINT}, created_at = #{record.createdAt,jdbcType=TIMESTAMP}, updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, rec_status = #{record.recStatus,jdbcType=TINYINT} @@ -229,8 +229,8 @@ location = #{location,jdbcType=VARCHAR}, - - employee_id = #{employeeId,jdbcType=BIGINT}, + + user_id = #{userId,jdbcType=BIGINT}, created_at = #{createdAt,jdbcType=TIMESTAMP}, @@ -249,7 +249,7 @@ set qrcode_id = #{qrcodeId,jdbcType=BIGINT}, time = #{time,jdbcType=BIGINT}, location = #{location,jdbcType=VARCHAR}, - employee_id = #{employeeId,jdbcType=BIGINT}, + user_id = #{userId,jdbcType=BIGINT}, created_at = #{createdAt,jdbcType=TIMESTAMP}, updated_at = #{updatedAt,jdbcType=TIMESTAMP}, rec_status = #{recStatus,jdbcType=TINYINT} diff --git a/health/src/main/resources/mapper_raw/SiteMapper.xml b/health/src/main/resources/mapper_raw/SiteMapper.xml index 5e796bee..6ef426ca 100644 --- a/health/src/main/resources/mapper_raw/SiteMapper.xml +++ b/health/src/main/resources/mapper_raw/SiteMapper.xml @@ -7,6 +7,7 @@ + @@ -70,7 +71,8 @@ - id, site_name, site_code, longitude, latitude, created_at, updated_at, rec_status + id, site_name, site_code, longitude, latitude, parent_code, created_at, updated_at, + rec_status