9c9e1a2a by ja

no message

1 parent bce2c347
...@@ -19,24 +19,26 @@ public class HapiController { ...@@ -19,24 +19,26 @@ public class HapiController {
19 19
20 @RequestMapping("/register") 20 @RequestMapping("/register")
21 public MessageEntity register(@RequestParam("barcode") String barcode, 21 public MessageEntity register(@RequestParam("barcode") String barcode,
22 @RequestParam("openid") String openid,
22 @RequestParam("name") String name,@RequestParam("gender") String gender,@RequestParam("birthdayStr") String birthdayStr, 23 @RequestParam("name") String name,@RequestParam("gender") String gender,@RequestParam("birthdayStr") String birthdayStr,
23 @RequestParam("mobileNumber") String mobileNumber,@RequestParam("samplingDate") String samplingDate, 24 @RequestParam("mobileNumber") String mobileNumber,@RequestParam("samplingDate") String samplingDate,
24 @RequestParam("recipients") String recipients,@RequestParam("address") String address,@RequestParam("familyDisease") String familyDisease, 25 @RequestParam("recipients") String recipients,@RequestParam("address") String address,@RequestParam("familyDisease") String familyDisease,
25 @RequestParam("existingDisease") String existingDisease,@RequestParam("weight") Float weight, 26 @RequestParam("existingDisease") String existingDisease,@RequestParam("weight") Float weight,
26 @RequestParam("height") Integer height,@RequestParam(value = "remarks",required = false)String remarks){ 27 @RequestParam("height") Integer height,@RequestParam(value = "remarks",required = false)String remarks){
27 return this.hapiService.register(barcode, name, gender, birthdayStr, mobileNumber, samplingDate, recipients, address, familyDisease, existingDisease, weight, height, remarks); 28 return this.hapiService.register(barcode,openid, name, gender, birthdayStr, mobileNumber, samplingDate, recipients, address, familyDisease, existingDisease, weight, height, remarks);
28 } 29 }
29 30
30 @RequestMapping("/genereport") 31 @RequestMapping("/genereport")
31 public MessageEntity genereport(@RequestParam("barcode") String barcode, 32 public MessageEntity genereport(@RequestParam("barcode") String barcode,
32 @RequestParam("mobileNumber") String mobileNumber){ 33 @RequestParam("mobileNumber") String mobileNumber,
33 return this.hapiService.genereport(barcode, mobileNumber); 34 @RequestParam("openid") String openid){
35 return this.hapiService.genereport(barcode, mobileNumber,openid);
34 } 36 }
35 37
36 @RequestMapping("/getbymobile") 38 @RequestMapping("/getbyopenid")
37 public MessageEntity getbymobile( 39 public MessageEntity getbymobile(
38 @RequestParam("mobileNumber") String mobileNumber){ 40 @RequestParam("openid") String openid){
39 return this.hapiService.getByMobileNumber(mobileNumber); 41 return this.hapiService.getByopenid(openid);
40 } 42 }
41 43
42 @RequestMapping("/memberlist") 44 @RequestMapping("/memberlist")
......
...@@ -13,7 +13,7 @@ import java.util.Map; ...@@ -13,7 +13,7 @@ import java.util.Map;
13 public interface MemberInfoMapper { 13 public interface MemberInfoMapper {
14 boolean create(MemberInfo memberInfo); 14 boolean create(MemberInfo memberInfo);
15 15
16 MemberInfo getByMobileNumber(@Param("mobileNumber") String mobileNumber); 16 MemberInfo getByopenid(@Param("openid") String openid);
17 17
18 boolean genereport(@Param("isGenereport") Integer isGenereport, 18 boolean genereport(@Param("isGenereport") Integer isGenereport,
19 @Param("genereportAt") Date genereportAt, 19 @Param("genereportAt") Date genereportAt,
...@@ -21,7 +21,7 @@ public interface MemberInfoMapper { ...@@ -21,7 +21,7 @@ public interface MemberInfoMapper {
21 @Param("pdfName") String pdfName, 21 @Param("pdfName") String pdfName,
22 @Param("url") String url, 22 @Param("url") String url,
23 @Param("genereportName") String genereportName, 23 @Param("genereportName") String genereportName,
24 @Param("mobileNumber") String mobileNumber); 24 @Param("openid") String openid);
25 25
26 List<MemberInfo> list(@Param("keyWord") String keyWord,@Param("status") Integer status,@Param("pageable") Pageable pageable); 26 List<MemberInfo> list(@Param("keyWord") String keyWord,@Param("status") Integer status,@Param("pageable") Pageable pageable);
27 27
......
...@@ -33,6 +33,7 @@ public class MemberInfo { ...@@ -33,6 +33,7 @@ public class MemberInfo {
33 String pdfName; 33 String pdfName;
34 String url; 34 String url;
35 String genereportName; 35 String genereportName;
36 String openid;
36 37
37 public Long getId() { 38 public Long getId() {
38 return id; 39 return id;
...@@ -249,4 +250,12 @@ public class MemberInfo { ...@@ -249,4 +250,12 @@ public class MemberInfo {
249 public void setGenereportName(String genereportName) { 250 public void setGenereportName(String genereportName) {
250 this.genereportName = genereportName; 251 this.genereportName = genereportName;
251 } 252 }
253
254 public String getOpenid() {
255 return openid;
256 }
257
258 public void setOpenid(String openid) {
259 this.openid = openid;
260 }
252 } 261 }
......
...@@ -11,12 +11,12 @@ import java.util.List; ...@@ -11,12 +11,12 @@ import java.util.List;
11 public interface HapiService { 11 public interface HapiService {
12 12
13 13
14 MessageEntity register(String barcode,String name,String gender,String birthdayStr,String mobileNumber,String samplingDate, 14 MessageEntity register(String barcode,String openid,String name,String gender,String birthdayStr,String mobileNumber,String samplingDate,
15 String recipients,String address,String familyDisease,String existingDisease,Float weight,Integer height,String remarks); 15 String recipients,String address,String familyDisease,String existingDisease,Float weight,Integer height,String remarks);
16 16
17 MessageEntity getByMobileNumber(String mobileNumber); 17 MessageEntity getByopenid(String mobileNumber);
18 18
19 MessageEntity genereport(String barcode,String mobileNumber); 19 MessageEntity genereport(String barcode,String mobileNumber,String openid);
20 20
21 MessageEntity reportByDay(String beginTime,String endTime); 21 MessageEntity reportByDay(String beginTime,String endTime);
22 22
......
...@@ -52,7 +52,7 @@ public class HapiServiceImpl implements HapiService { ...@@ -52,7 +52,7 @@ public class HapiServiceImpl implements HapiService {
52 52
53 53
54 @Override 54 @Override
55 public MessageEntity register(String barcode,String name,String gender,String birthdayStr,String mobileNumber,String samplingDate, 55 public MessageEntity register(String barcode,String openid,String name,String gender,String birthdayStr,String mobileNumber,String samplingDate,
56 String recipients,String address,String familyDisease,String existingDisease,Float weight,Integer height,String remarks) { 56 String recipients,String address,String familyDisease,String existingDisease,Float weight,Integer height,String remarks) {
57 long timestamp = new Date().getTime()/1000; 57 long timestamp = new Date().getTime()/1000;
58 MessageEntity.Builder builder = new MessageEntity.Builder(); 58 MessageEntity.Builder builder = new MessageEntity.Builder();
...@@ -83,6 +83,7 @@ public class HapiServiceImpl implements HapiService { ...@@ -83,6 +83,7 @@ public class HapiServiceImpl implements HapiService {
83 if(map.containsKey("ret") && map.get("ret").toString().equals("0") && map.containsKey("uuid")){ 83 if(map.containsKey("ret") && map.get("ret").toString().equals("0") && map.containsKey("uuid")){
84 String memberNumber = map.get("uuid") != null ? map.get("uuid").toString() : ""; 84 String memberNumber = map.get("uuid") != null ? map.get("uuid").toString() : "";
85 MemberInfo memberInfo = new MemberInfo(); 85 MemberInfo memberInfo = new MemberInfo();
86 memberInfo.setOpenid(openid);
86 memberInfo.setStatus(1); 87 memberInfo.setStatus(1);
87 memberInfo.setAddress(address); 88 memberInfo.setAddress(address);
88 memberInfo.setBarcode(barcode); 89 memberInfo.setBarcode(barcode);
...@@ -110,7 +111,7 @@ public class HapiServiceImpl implements HapiService { ...@@ -110,7 +111,7 @@ public class HapiServiceImpl implements HapiService {
110 111
111 112
112 @Override 113 @Override
113 public MessageEntity genereport(String barcode,String mobileNumber) { 114 public MessageEntity genereport(String barcode,String mobileNumber,String openid) {
114 long timestamp = new Date().getTime()/1000; 115 long timestamp = new Date().getTime()/1000;
115 MessageEntity.Builder builder = new MessageEntity.Builder(); 116 MessageEntity.Builder builder = new MessageEntity.Builder();
116 Map<String,Object> paremMap = new HashMap<>(); 117 Map<String,Object> paremMap = new HashMap<>();
...@@ -132,14 +133,14 @@ public class HapiServiceImpl implements HapiService { ...@@ -132,14 +133,14 @@ public class HapiServiceImpl implements HapiService {
132 String name = map.get("name") != null ? map.get("name").toString() : ""; 133 String name = map.get("name") != null ? map.get("name").toString() : "";
133 String packName = map.get("packName") != null ? map.get("packName").toString() : ""; 134 String packName = map.get("packName") != null ? map.get("packName").toString() : "";
134 String pdfName = map.get("pdfName") != null ? map.get("pdfName").toString() : ""; 135 String pdfName = map.get("pdfName") != null ? map.get("pdfName").toString() : "";
135 this.memberInfoMapper.genereport(1,new Date(),packName,pdfName,pdfurl,name,mobileNumber); 136 this.memberInfoMapper.genereport(1,new Date(),packName,pdfName,pdfurl,name,openid);
136 } 137 }
137 return builder.success(true).code("2000").content(map).create(); 138 return builder.success(true).code("2000").content(map).create();
138 } 139 }
139 140
140 public MessageEntity getByMobileNumber(String mobileNumber){ 141 public MessageEntity getByopenid(String openid){
141 MessageEntity.Builder builder = new MessageEntity.Builder(); 142 MessageEntity.Builder builder = new MessageEntity.Builder();
142 MemberInfo memberInfo = this.memberInfoMapper.getByMobileNumber(mobileNumber); 143 MemberInfo memberInfo = this.memberInfoMapper.getByopenid(openid);
143 if(memberInfo == null || memberInfo.getId() == 0){ 144 if(memberInfo == null || memberInfo.getId() == 0){
144 //账号不存在 145 //账号不存在
145 Map<String,Object> map = new HashMap<>(); 146 Map<String,Object> map = new HashMap<>();
......
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
25 remarks, 25 remarks,
26 member_number, 26 member_number,
27 create_at, 27 create_at,
28 status 28 status,
29 openid
29 ) 30 )
30 VALUES ( 31 VALUES (
31 #{source}, 32 #{source},
...@@ -47,12 +48,13 @@ ...@@ -47,12 +48,13 @@
47 #{remarks}, 48 #{remarks},
48 #{memberNumber}, 49 #{memberNumber},
49 #{createAt}, 50 #{createAt},
50 #{status} 51 #{status},
52 #{openid}
51 ); 53 );
52 </insert> 54 </insert>
53 55
54 <select id="getByMobileNumber" resultType="com.example.models.api.MemberInfo"> 56 <select id="getByopenid" resultType="com.example.models.api.MemberInfo">
55 select * from t_hpai_member_info where mobile_number = #{mobileNumber} limit 1; 57 select * from t_hpai_member_info where openid = #{openid} limit 1;
56 </select> 58 </select>
57 59
58 <update id="genereport"> 60 <update id="genereport">
...@@ -62,7 +64,7 @@ ...@@ -62,7 +64,7 @@
62 pack_name = #{packName}, 64 pack_name = #{packName},
63 pdf_name = #{pdfName}, 65 pdf_name = #{pdfName},
64 url = #{url}, 66 url = #{url},
65 genereport_name = #{genereportName} where mobile_number = #{mobileNumber}; 67 genereport_name = #{genereportName} where openid = #{openid};
66 </update> 68 </update>
67 69
68 70
......