提交 f3e4ce02 编写于 作者: xinxu.wang's avatar xinxu.wang

Merge branch 'release' into 'master'

Release

See merge request !138
流水线 #53932 已失败 于阶段
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId> <groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-client</artifactId> <artifactId>pica-cloud-account-client</artifactId>
<version>1.1.7-SNAPSHOT</version> <version>1.1.9-SNAPSHOT</version>
<name>pica-cloud-account-client</name> <name>pica-cloud-account-client</name>
<packaging>jar</packaging> <packaging>jar</packaging>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<dependency> <dependency>
<groupId>com.pica.cloud.account</groupId> <groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId> <artifactId>pica-cloud-account-common</artifactId>
<version>1.1.7-SNAPSHOT</version> <version>1.1.9-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
...@@ -42,8 +42,9 @@ ...@@ -42,8 +42,9 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.pica.cloud.foundation</groupId> <groupId>com.pica.cloud.foundation</groupId>
<artifactId>pica-cloud-entity</artifactId> <artifactId>pica-cloud-utils</artifactId>
<version>1.2.0</version> <version>1.4.7</version>
<scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -2,7 +2,7 @@ package com.pica.cloud.account.account.client; ...@@ -2,7 +2,7 @@ package com.pica.cloud.account.account.client;
import com.pica.cloud.account.account.common.dto.CancelAccountDto; import com.pica.cloud.account.account.common.dto.CancelAccountDto;
import com.pica.cloud.account.account.common.dto.QueryDoctorRole; import com.pica.cloud.account.account.common.dto.QueryDoctorRole;
import com.pica.cloud.foundation.entity.PicaResponse; import com.pica.cloud.foundation.utils.PicaResponse;
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
......
...@@ -4,7 +4,7 @@ import com.pica.cloud.account.account.common.dto.AccountWeChatInfoDto; ...@@ -4,7 +4,7 @@ import com.pica.cloud.account.account.common.dto.AccountWeChatInfoDto;
import com.pica.cloud.account.account.common.req.AccountInfoReq; import com.pica.cloud.account.account.common.req.AccountInfoReq;
import com.pica.cloud.account.account.common.req.HospitalSaasUserListReq; import com.pica.cloud.account.account.common.req.HospitalSaasUserListReq;
import com.pica.cloud.account.account.common.resp.DoctorUnionResp; import com.pica.cloud.account.account.common.resp.DoctorUnionResp;
import com.pica.cloud.foundation.entity.PicaResponse; import com.pica.cloud.foundation.utils.PicaResponse;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
package com.pica.cloud.account.account.client; package com.pica.cloud.account.account.client;
import com.pica.cloud.foundation.entity.PicaResponse; import com.pica.cloud.foundation.utils.PicaResponse;
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
......
package com.pica.cloud.account.account.client; package com.pica.cloud.account.account.client;
import com.pica.cloud.account.account.common.req.LoginAppletReq; import com.pica.cloud.account.account.common.req.LoginAppletReq;
import com.pica.cloud.foundation.entity.PicaResponse; import com.pica.cloud.foundation.utils.PicaResponse;
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.*;
public interface LoginClient { public interface LoginClient {
@PostMapping("/account/login/QRCode") @PostMapping("/account/login/QRCode")
PicaResponse<String> loginQRCode(@RequestHeader(value = "token") String token,@RequestHeader(value = "user_token_tourist") String user_token_tourist); PicaResponse<String> loginQRCode(@RequestHeader(value = "token") String token, @RequestHeader(value = "user_token_tourist") String user_token_tourist);
@PostMapping("/account/login/applet") @PostMapping("/account/login/applet")
PicaResponse<String> loginApplet(@RequestBody LoginAppletReq req); PicaResponse<String> loginApplet(@RequestBody LoginAppletReq req);
......
package com.pica.cloud.account.account.client; package com.pica.cloud.account.account.client;
import com.pica.cloud.account.account.common.req.*; import com.pica.cloud.account.account.common.req.*;
import com.pica.cloud.account.account.common.resp.AcctPatIdResp; import com.pica.cloud.account.account.common.resp.*;
import com.pica.cloud.account.account.common.resp.AcctSelfPatId; import com.pica.cloud.foundation.utils.PicaResponse;
import com.pica.cloud.account.account.common.resp.PatBindResp;
import com.pica.cloud.account.account.common.resp.PatFamilyResp;
import com.pica.cloud.foundation.entity.PicaResponse;
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -18,12 +15,18 @@ public interface PatHealthPackClient { ...@@ -18,12 +15,18 @@ public interface PatHealthPackClient {
@GetMapping(value = "/account/pat-health/acctId/unionId/{unionId}") @GetMapping(value = "/account/pat-health/acctId/unionId/{unionId}")
PicaResponse<Integer> getAcctIdByUnionId(@PathVariable("unionId") String unionId); PicaResponse<Integer> getAcctIdByUnionId(@PathVariable("unionId") String unionId);
@GetMapping(value = "/account/pat-health/unionId/acctId/{acctId}")
PicaResponse<String> getUnionIdByAcctId(@PathVariable("acctId") Integer acctId);
@GetMapping(value = "/account/pat-health/acctId/patId/{patientId}") @GetMapping(value = "/account/pat-health/acctId/patId/{patientId}")
PicaResponse<Integer> getAcctIdByPatId(@PathVariable("patientId") Integer patientId); PicaResponse<Integer> getAcctIdByPatId(@PathVariable("patientId") Integer patientId);
@GetMapping(value = "/account/pat-health/directPatIds/{patientId}") @GetMapping(value = "/account/pat-health/directPatIds/{patientId}")
PicaResponse<List<Integer>> getDirectPatIdsByPatId(@PathVariable("patientId") Integer patientId); PicaResponse<List<Integer>> getDirectPatIdsByPatId(@PathVariable("patientId") Integer patientId);
@GetMapping(value = "/account/pat-health/directPatIds/unionId")
PicaResponse<List<Integer>> getDirectPatIdsByUnionId(@RequestParam("unionId") String unionId);
@GetMapping(value = "/account/pat-health/familyPats/{acctId}/containAcct/{containAcct}") @GetMapping(value = "/account/pat-health/familyPats/{acctId}/containAcct/{containAcct}")
PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId, @PathVariable("containAcct") Integer containAcct); PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId, @PathVariable("containAcct") Integer containAcct);
...@@ -39,6 +42,9 @@ public interface PatHealthPackClient { ...@@ -39,6 +42,9 @@ public interface PatHealthPackClient {
@GetMapping(value = "/account/pat-health/familyAcct/patId/{patId}") @GetMapping(value = "/account/pat-health/familyAcct/patId/{patId}")
PicaResponse<Integer> getFamilyAcctPatId(@PathVariable("patId") Integer patId); PicaResponse<Integer> getFamilyAcctPatId(@PathVariable("patId") Integer patId);
@GetMapping(value = "/account/pat-health/familyAcct/self/patId/{patId}")
PicaResponse<List<Integer>> getRelationSelfAcctPatId(@PathVariable("patId") Integer patId);
@PostMapping(value = "/account/pat-health/familyAcct/patIds") @PostMapping(value = "/account/pat-health/familyAcct/patIds")
PicaResponse<AcctPatIdResp> getFamilyAcctPatIds(@RequestBody AcctPatIdReq acctPatIdReq); PicaResponse<AcctPatIdResp> getFamilyAcctPatIds(@RequestBody AcctPatIdReq acctPatIdReq);
...@@ -57,4 +63,9 @@ public interface PatHealthPackClient { ...@@ -57,4 +63,9 @@ public interface PatHealthPackClient {
@PostMapping(value = "/account/pat-health/acct/updatePatByAcctId") @PostMapping(value = "/account/pat-health/acct/updatePatByAcctId")
PicaResponse<Boolean> updatePatByAcctId(@RequestBody UpdateAcctPatInfoReq req); PicaResponse<Boolean> updatePatByAcctId(@RequestBody UpdateAcctPatInfoReq req);
@GetMapping(value = "/account/pat-health/acctInfo/patId/{patientId}")
PicaResponse<List<AcctSelfPatInfoResp>> getAcctInfoByPatId(@PathVariable("patientId") Integer patientId);
@GetMapping(value = "/account/pat-health/acctInfo/patInfo/{unionId}")
PicaResponse<AcctSelfPatInfoResp> getAcctInfoByUnionId(@PathVariable("unionId") String unionId);
} }
package com.pica.cloud.account.account.client; package com.pica.cloud.account.account.client;
import com.pica.cloud.account.account.common.req.AcctPatInfoReq; import com.pica.cloud.account.account.common.req.AcctPatInfoReq;
import com.pica.cloud.foundation.entity.PicaResponse; import com.pica.cloud.foundation.utils.PicaResponse;
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
......
...@@ -7,7 +7,7 @@ import com.pica.cloud.account.account.common.req.LoginResult; ...@@ -7,7 +7,7 @@ import com.pica.cloud.account.account.common.req.LoginResult;
import com.pica.cloud.account.account.common.req.OCINRequest; import com.pica.cloud.account.account.common.req.OCINRequest;
import com.pica.cloud.account.account.common.req.circle.CircleAcctInitReq; import com.pica.cloud.account.account.common.req.circle.CircleAcctInitReq;
import com.pica.cloud.account.account.common.req.shop.ShopAcctInitReq; import com.pica.cloud.account.account.common.req.shop.ShopAcctInitReq;
import com.pica.cloud.foundation.entity.PicaResponse; import com.pica.cloud.foundation.utils.PicaResponse;
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId> <groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId> <artifactId>pica-cloud-account-common</artifactId>
<version>1.1.7-SNAPSHOT</version> <version>1.1.9-SNAPSHOT</version>
<name>pica-cloud-account-common</name> <name>pica-cloud-account-common</name>
<packaging>jar</packaging> <packaging>jar</packaging>
......
package com.pica.cloud.account.account.common.resp;
public class AcctSelfPatInfoResp {
private Integer accId;
private Integer patientId;
private String name;
private String mobilePhone;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMobilePhone() {
return mobilePhone;
}
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone;
}
public Integer getAccId() {
return accId;
}
public void setAccId(Integer accId) {
this.accId = accId;
}
public Integer getPatientId() {
return patientId;
}
public void setPatientId(Integer patientId) {
this.patientId = patientId;
}
}
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
<dependency> <dependency>
<groupId>com.pica.cloud.account</groupId> <groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId> <artifactId>pica-cloud-account-common</artifactId>
<version>1.1.7-SNAPSHOT</version> <version>1.1.9-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -126,7 +126,7 @@ public class AccountController extends AccountBaseController { ...@@ -126,7 +126,7 @@ public class AccountController extends AccountBaseController {
//判断账号是否已经存在 //判断账号是否已经存在
Account account = accountService.getByMobilePhone(mobilePhone); Account account = accountService.getByMobilePhone(mobilePhone);
if (StringUtil.isNull(account)) { if (StringUtil.isNull(account)) {
throw new PicaException(PicaResultCode.RESULE_DATA_NONE.code(),"请先至云鹊医App注册认证后使用"); throw new PicaException(PicaResultCode.RESULE_DATA_NONE.code(),"本APP采用实名注册制\n如需注册请联系客服" + redisClient.get( "mobile_400_1"));
} }
senderId = account == null ? 0L : account.getId(); senderId = account == null ? 0L : account.getId();
} }
......
...@@ -543,7 +543,7 @@ public class LoginController extends AccountBaseController { ...@@ -543,7 +543,7 @@ public class LoginController extends AccountBaseController {
Account account = accountService.getByMobilePhone(req.getMobilePhone()); //获取账号信息 Account account = accountService.getByMobilePhone(req.getMobilePhone()); //获取账号信息
if (account == null) { if (account == null) {
intactUtil.sendIntact(batchNo, "login/applet", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3, "未注册,请验证码登录"); intactUtil.sendIntact(batchNo, "login/applet", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3, "未注册,请验证码登录");
return PicaResponse.toResponse(null, PicaResultCode.RESULE_DATA_NONE.code(), "未注册,请验证码登录"); return PicaResponse.toResponse(null, PicaResultCode.RESULE_DATA_NONE.code(), "本APP采用实名注册制\n如需注册请联系客服" + redisClient.get( "mobile_400_1"));
} }
//更新最后登录时间 //更新最后登录时间
......
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
package com.pica.cloud.account.account.server.controller; package com.pica.cloud.account.account.server.controller;
import com.pica.cloud.account.account.common.req.*; import com.pica.cloud.account.account.common.req.*;
import com.pica.cloud.account.account.common.resp.AcctPatIdResp; import com.pica.cloud.account.account.common.resp.*;
import com.pica.cloud.account.account.common.resp.AcctSelfPatId;
import com.pica.cloud.account.account.common.resp.PatBindResp;
import com.pica.cloud.account.account.common.resp.PatFamilyResp;
import com.pica.cloud.account.account.server.service.AccountPatFamilyRecordService; import com.pica.cloud.account.account.server.service.AccountPatFamilyRecordService;
import com.pica.cloud.account.account.server.service.PatHealthPackService; import com.pica.cloud.account.account.server.service.PatHealthPackService;
import com.pica.cloud.foundation.entity.PicaResponse; import com.pica.cloud.foundation.entity.PicaResponse;
...@@ -41,6 +38,12 @@ public class PatHealthPackController { ...@@ -41,6 +38,12 @@ public class PatHealthPackController {
return PicaResponse.toResponse(packService.getAcctIdByUnionId(unionId)); return PicaResponse.toResponse(packService.getAcctIdByUnionId(unionId));
} }
@ApiOperation("获取unionId-根据主账户ID")
@GetMapping(value = "/unionId/acctId/{acctId}")
public PicaResponse<String> getUnionIdByAcctId(@PathVariable("acctId") Integer acctId) throws Exception {
return PicaResponse.toResponse(packService.getUnionIdByAcctId(acctId));
}
@ApiOperation("获取主账户ID-作为监护人自身patientId") @ApiOperation("获取主账户ID-作为监护人自身patientId")
@GetMapping(value = "/acctId/patId/{patientId}") @GetMapping(value = "/acctId/patId/{patientId}")
public PicaResponse<Integer> getAcctIdByPatId(@PathVariable("patientId") Integer patientId) throws Exception { public PicaResponse<Integer> getAcctIdByPatId(@PathVariable("patientId") Integer patientId) throws Exception {
...@@ -53,6 +56,12 @@ public class PatHealthPackController { ...@@ -53,6 +56,12 @@ public class PatHealthPackController {
return PicaResponse.toResponse(packService.getDirectPatIdsByPatId(patientId)); return PicaResponse.toResponse(packService.getDirectPatIdsByPatId(patientId));
} }
@ApiOperation("所在家庭组的监护人 + 同级家庭成员 + 下级所有成员 patientId list,去除自身、去重;")
@GetMapping(value = "/directPatIds/unionId")
public PicaResponse<List<Integer>> getDirectPatIdsByUnionId(@RequestParam("unionId") String unionId) throws Exception {
return PicaResponse.toResponse(packService.getDirectPatIdsByUnionId(unionId));
}
@ApiOperation("根据accid获取自身家庭成员List;containAcct:0 包含自身 1 不包含自身") @ApiOperation("根据accid获取自身家庭成员List;containAcct:0 包含自身 1 不包含自身")
@GetMapping(value = "/familyPats/{acctId}/containAcct/{containAcct}") @GetMapping(value = "/familyPats/{acctId}/containAcct/{containAcct}")
public PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId, @PathVariable("containAcct") Integer containAcct) throws Exception { public PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId, @PathVariable("containAcct") Integer containAcct) throws Exception {
...@@ -84,6 +93,13 @@ public class PatHealthPackController { ...@@ -84,6 +93,13 @@ public class PatHealthPackController {
return PicaResponse.toResponse(packService.getFamilyAcctPatId(patId)); return PicaResponse.toResponse(packService.getFamilyAcctPatId(patId));
} }
@ApiOperation("根据patientId获取监护人acctId),本人成员(监护人patId)")
@GetMapping(value = "/familyAcct/self/patId/{patId}")
public PicaResponse<List<Integer>> getRelationSelfAcctPatId(@PathVariable("patId") Integer patId) throws Exception {
return PicaResponse.toResponse(packService.getFamilyAcctIdsPatId(patId));
}
@ApiOperation("根据patientIds 获取监护人-本人监护人(自身patId),本人成员(监护人patId)") @ApiOperation("根据patientIds 获取监护人-本人监护人(自身patId),本人成员(监护人patId)")
@PostMapping(value = "/familyAcct/patIds") @PostMapping(value = "/familyAcct/patIds")
public PicaResponse<AcctPatIdResp> getFamilyAcctPatIds(@RequestBody AcctPatIdReq acctPatIdReq) throws Exception { public PicaResponse<AcctPatIdResp> getFamilyAcctPatIds(@RequestBody AcctPatIdReq acctPatIdReq) throws Exception {
...@@ -121,4 +137,23 @@ public class PatHealthPackController { ...@@ -121,4 +137,23 @@ public class PatHealthPackController {
return PicaResponse.toResponse(packService.updatePatByAcctId(req)); return PicaResponse.toResponse(packService.updatePatByAcctId(req));
} }
@ApiOperation("获取主账户-作为监护人自身patientId")
@GetMapping(value = "/acctInfo/patId/{patientId}")
public PicaResponse<List<AcctSelfPatInfoResp>> getAcctInfoByPatId(@PathVariable("patientId") Integer patientId) throws Exception {
return PicaResponse.toResponse(packService.getAcctInfoByPatId(patientId));
}
@ApiOperation("获取主账户-作为监护人自身patientId")
@GetMapping(value = "/acctInfo/patInfo/{unionId}")
public PicaResponse<AcctSelfPatInfoResp> getAcctInfoByUnionId(@PathVariable("unionId") String unionId) throws Exception {
return PicaResponse.toResponse(packService.getAcctInfoByUnionId(unionId));
}
@ApiOperation("更新accId 对应的患者信息")
@PostMapping(value = "/acct/updateAcct")
public PicaResponse updatePat(@RequestBody UpdateAcctPatInfoReq req) {
packService.updatePat(req);
return PicaResponse.toResponse();
}
} }
package com.pica.cloud.account.account.server.mapper; package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.common.req.AcctPatPageReq; import com.pica.cloud.account.account.common.resp.AcctSelfPatInfoResp;
import com.pica.cloud.account.account.server.entity.AcctPatFamily; import com.pica.cloud.account.account.server.entity.AcctPatFamily;
import java.util.List; import java.util.List;
...@@ -26,7 +26,7 @@ public interface AcctPatFamilyMapper { ...@@ -26,7 +26,7 @@ public interface AcctPatFamilyMapper {
List<AcctPatFamily> getListByPatIdSelfs(List<Integer> list); List<AcctPatFamily> getListByPatIdSelfs(List<Integer> list);
/** 查询居民id所在家庭组监护人- 作为家庭成员、非主账户本人居民id,单条ok 多条异常数据 */ /** 查询居民id所在家庭组监护人- 作为家庭成员、非主账户本人居民id,单条ok 多条异常数据 */
AcctPatFamily getByPatIdNotSelf(Integer patId); List<AcctPatFamily> getByPatIdNotSelf(Integer patId);
List<AcctPatFamily> getListByPatIdNotSelfs(List<Integer> list); List<AcctPatFamily> getListByPatIdNotSelfs(List<Integer> list);
...@@ -47,4 +47,9 @@ public interface AcctPatFamilyMapper { ...@@ -47,4 +47,9 @@ public interface AcctPatFamilyMapper {
List<AcctPatFamily> getMemberListByPatIds(List<Integer> patIds); List<AcctPatFamily> getMemberListByPatIds(List<Integer> patIds);
List<Integer> queryPatIdByPage(Map map); List<Integer> queryPatIdByPage(Map map);
List<AcctSelfPatInfoResp> getAcctInfoByPatIdSelf(Integer patId);
AcctSelfPatInfoResp getAcctInfoByUnionId(String unionId);
List<Integer> getPatIdsByUnionId(String unionId);
} }
\ No newline at end of file
...@@ -128,4 +128,6 @@ public interface DoctorMapper { ...@@ -128,4 +128,6 @@ public interface DoctorMapper {
@Param("loginTime") Date loginTime); @Param("loginTime") Date loginTime);
String selectIdByOpenId(String openId); String selectIdByOpenId(String openId);
int updateDoctorLastLoginTime(@Param("userId") Integer userId);
} }
\ No newline at end of file
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
package com.pica.cloud.account.account.server.service; package com.pica.cloud.account.account.server.service;
import com.pica.cloud.account.account.common.req.*; import com.pica.cloud.account.account.common.req.*;
import com.pica.cloud.account.account.common.resp.AcctPatIdResp; import com.pica.cloud.account.account.common.resp.*;
import com.pica.cloud.account.account.common.resp.AcctSelfPatId;
import com.pica.cloud.account.account.common.resp.PatBindResp;
import com.pica.cloud.account.account.common.resp.PatFamilyResp;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
import java.util.List; import java.util.List;
...@@ -22,10 +19,14 @@ public interface PatHealthPackService { ...@@ -22,10 +19,14 @@ public interface PatHealthPackService {
Integer getAcctIdByUnionId(String unionId); Integer getAcctIdByUnionId(String unionId);
String getUnionIdByAcctId(Integer acctId);
Integer getAcctIdByPatId(Integer patientId); Integer getAcctIdByPatId(Integer patientId);
List<Integer> getDirectPatIdsByPatId(Integer patientId); List<Integer> getDirectPatIdsByPatId(Integer patientId);
List<Integer> getDirectPatIdsByUnionId(String unionId);
PatFamilyResp getFamilyPatsByAcctId(Integer acctId,Integer containAcct); PatFamilyResp getFamilyPatsByAcctId(Integer acctId,Integer containAcct);
Integer saveAcct(AcctPatInfoReq patInfoReq); Integer saveAcct(AcctPatInfoReq patInfoReq);
...@@ -36,6 +37,8 @@ public interface PatHealthPackService { ...@@ -36,6 +37,8 @@ public interface PatHealthPackService {
Integer getFamilyAcctPatId(Integer patId); Integer getFamilyAcctPatId(Integer patId);
List<Integer> getFamilyAcctIdsPatId(Integer patId);
AcctPatIdResp getFamilyAcctPatIds(AcctPatIdReq acctPatIdReq); AcctPatIdResp getFamilyAcctPatIds(AcctPatIdReq acctPatIdReq);
Integer initAccts(List<InitAcctReq> list); Integer initAccts(List<InitAcctReq> list);
...@@ -45,4 +48,10 @@ public interface PatHealthPackService { ...@@ -45,4 +48,10 @@ public interface PatHealthPackService {
AcctSelfPatId getAcctIdByMobile(String mobile); AcctSelfPatId getAcctIdByMobile(String mobile);
boolean updatePatByAcctId(UpdateAcctPatInfoReq req); boolean updatePatByAcctId(UpdateAcctPatInfoReq req);
void updatePat(UpdateAcctPatInfoReq req);
List<AcctSelfPatInfoResp> getAcctInfoByPatId(Integer patientId);
AcctSelfPatInfoResp getAcctInfoByUnionId(String unionId);
} }
...@@ -16,6 +16,7 @@ import com.pica.cloud.foundation.encryption.util.EncryptUtils; ...@@ -16,6 +16,7 @@ import com.pica.cloud.foundation.encryption.util.EncryptUtils;
import com.pica.cloud.foundation.redis.ICacheClient; import com.pica.cloud.foundation.redis.ICacheClient;
import com.pica.cloud.foundation.utils.entity.PicaUser; import com.pica.cloud.foundation.utils.entity.PicaUser;
import com.pica.cloud.foundation.utils.utils.ValidateUtils; import com.pica.cloud.foundation.utils.utils.ValidateUtils;
import lombok.var;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -27,6 +28,7 @@ import org.springframework.stereotype.Service; ...@@ -27,6 +28,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
import java.util.regex.Pattern;
/** /**
* @author andong * @author andong
...@@ -90,6 +92,9 @@ public class AccountServiceImpl implements AccountService { ...@@ -90,6 +92,9 @@ public class AccountServiceImpl implements AccountService {
@Override @Override
@Transactional @Transactional
public void createAccount(Account account, Integer bizType) { public void createAccount(Account account, Integer bizType) {
if (!ValidateUtils.isMobile(EncryptUtils.decryptContent(account.getMobilePhone(), EncryptConstants.ENCRYPT_TYPE_MOBILE, EncryptConstants.ENCRYPT_DECRYPT_KEY))) {
throw new AccountException(AccountExceptionEnum.PICA_MOBILE_ERROR);
}
//账户表 //账户表
AccountInfoEntity accountInfo = new AccountInfoEntity(); AccountInfoEntity accountInfo = new AccountInfoEntity();
Date currentTime = new Date(); Date currentTime = new Date();
......
...@@ -96,6 +96,9 @@ public class WechatServiceImpl implements WechatService { ...@@ -96,6 +96,9 @@ public class WechatServiceImpl implements WechatService {
if (StringUtil.isNotNull(accountUnionEntity)) { if (StringUtil.isNotNull(accountUnionEntity)) {
doctorUnionfoModel = doctorMapper.getDoctorByAcctId(accountUnionEntity.getAcctId()); doctorUnionfoModel = doctorMapper.getDoctorByAcctId(accountUnionEntity.getAcctId());
} }
if (StringUtil.isNull(doctorUnionfoModel)) {
doctorUnionfoModel = new DoctorUnionResp();
}
return doctorUnionfoModel; return doctorUnionfoModel;
} }
......
...@@ -177,6 +177,7 @@ public class TokenUtils { ...@@ -177,6 +177,7 @@ public class TokenUtils {
//存储token:(token-doctor-1:用户数据) //存储token:(token-doctor-1:用户数据)
cacheClient.hset(value, key, valueInfo); cacheClient.hset(value, key, valueInfo);
} }
doctorMapper.updateDoctorLastLoginTime(account.getId().intValue());
// } else { // } else {
// cacheClient.hset(value, "token", newToken); // cacheClient.hset(value, "token", newToken);
// } // }
......
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
from account_pat_family from account_pat_family
where patient_id = #{patientId,jdbcType=INTEGER} where patient_id = #{patientId,jdbcType=INTEGER}
and relation = 1 and relation = 1
and delete_flag = 1; and delete_flag = 1 order by created_time desc limit 1
</select> </select>
<select id="getListByPatIdSelfs" parameterType="java.util.List" resultMap="BaseResultMap" > <select id="getListByPatIdSelfs" parameterType="java.util.List" resultMap="BaseResultMap" >
...@@ -195,7 +195,8 @@ ...@@ -195,7 +195,8 @@
from account_pat_family from account_pat_family
where patient_id = #{patientId,jdbcType=INTEGER} where patient_id = #{patientId,jdbcType=INTEGER}
AND relation != 1 AND relation != 1
and delete_flag = 1; and delete_flag = 1
order by modified_time desc
</select> </select>
<select id="getListByPatIdNotSelfs" parameterType="java.util.List" resultMap="BaseResultMap" > <select id="getListByPatIdNotSelfs" parameterType="java.util.List" resultMap="BaseResultMap" >
...@@ -270,4 +271,37 @@ ...@@ -270,4 +271,37 @@
limit #{begin},#{end} limit #{begin},#{end}
</select> </select>
<select id="getAcctInfoByPatIdSelf" parameterType="java.lang.Integer" resultType="com.pica.cloud.account.account.common.resp.AcctSelfPatInfoResp" >
select
api.id as accId, pf.patient_id as patientId, api.name , api.mobile_phone as mobilePhone
from account_pat_family pf, account_pat_info api
where pf.patient_id = #{patientId,jdbcType=INTEGER}
AND pf.relation = 1
and pf.delete_flag = 1
and pf.acct_id = api.id
and api.delete_flag = 1
</select>
<select id="getAcctInfoByUnionId" parameterType="java.lang.String" resultType="com.pica.cloud.account.account.common.resp.AcctSelfPatInfoResp" >
select
api.id as accId, pf.patient_id as patientId, api.name , api.mobile_phone as mobilePhone
from account_pat_family pf, account_pat_info api, account_pat_union pu
where pu.union_id = #{unionId} and pu.union_type = 1
and pu.acct_id = api.id
and pu.delete_flag = 1
AND pf.relation = 1
and pf.delete_flag = 1
and pf.acct_id = api.id
and api.delete_flag = 1
</select>
<select id="getPatIdsByUnionId" parameterType="java.lang.String" resultType="java.lang.Integer" >
select
distinct pf.patient_id as patientId
from account_pat_family pf, account_pat_union pu
where pu.union_id = #{unionId} and pu.union_type = 1
and pu.delete_flag = 1
and pf.delete_flag = 1
and pu.acct_id = pf.acct_id
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -145,7 +145,8 @@ ...@@ -145,7 +145,8 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from account_pat_union from account_pat_union
where union_id = #{unionId,jdbcType=VARCHAR} where union_id = #{unionId,jdbcType=VARCHAR}
and delete_flag = 1; and delete_flag = 1
order by modified_time desc limit 1
</select> </select>
<select id="selectByAcctId" parameterType="java.lang.Integer" resultMap="BaseResultMap" > <select id="selectByAcctId" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
...@@ -153,7 +154,8 @@ ...@@ -153,7 +154,8 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from account_pat_union from account_pat_union
where acct_id = #{acctId,jdbcType=INTEGER} where acct_id = #{acctId,jdbcType=INTEGER}
and delete_flag = 1; and delete_flag = 1
order by modified_time desc limit 1
</select> </select>
<insert id="initBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id"> <insert id="initBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
......
...@@ -1105,4 +1105,10 @@ ...@@ -1105,4 +1105,10 @@
where openid = #{openId} and delete_flag = 1 where openid = #{openId} and delete_flag = 1
limit 1 limit 1
</select> </select>
<update id="updateDoctorLastLoginTime" parameterType="Object">
update p_doctor
SET last_login_time = now()
where id = #{userId}
</update>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册