9c9e1a2a by ja

no message

1 parent bce2c347
......@@ -19,24 +19,26 @@ public class HapiController {
@RequestMapping("/register")
public MessageEntity register(@RequestParam("barcode") String barcode,
@RequestParam("openid") String openid,
@RequestParam("name") String name,@RequestParam("gender") String gender,@RequestParam("birthdayStr") String birthdayStr,
@RequestParam("mobileNumber") String mobileNumber,@RequestParam("samplingDate") String samplingDate,
@RequestParam("recipients") String recipients,@RequestParam("address") String address,@RequestParam("familyDisease") String familyDisease,
@RequestParam("existingDisease") String existingDisease,@RequestParam("weight") Float weight,
@RequestParam("height") Integer height,@RequestParam(value = "remarks",required = false)String remarks){
return this.hapiService.register(barcode, name, gender, birthdayStr, mobileNumber, samplingDate, recipients, address, familyDisease, existingDisease, weight, height, remarks);
return this.hapiService.register(barcode,openid, name, gender, birthdayStr, mobileNumber, samplingDate, recipients, address, familyDisease, existingDisease, weight, height, remarks);
}
@RequestMapping("/genereport")
public MessageEntity genereport(@RequestParam("barcode") String barcode,
@RequestParam("mobileNumber") String mobileNumber){
return this.hapiService.genereport(barcode, mobileNumber);
@RequestParam("mobileNumber") String mobileNumber,
@RequestParam("openid") String openid){
return this.hapiService.genereport(barcode, mobileNumber,openid);
}
@RequestMapping("/getbymobile")
@RequestMapping("/getbyopenid")
public MessageEntity getbymobile(
@RequestParam("mobileNumber") String mobileNumber){
return this.hapiService.getByMobileNumber(mobileNumber);
@RequestParam("openid") String openid){
return this.hapiService.getByopenid(openid);
}
@RequestMapping("/memberlist")
......
......@@ -13,7 +13,7 @@ import java.util.Map;
public interface MemberInfoMapper {
boolean create(MemberInfo memberInfo);
MemberInfo getByMobileNumber(@Param("mobileNumber") String mobileNumber);
MemberInfo getByopenid(@Param("openid") String openid);
boolean genereport(@Param("isGenereport") Integer isGenereport,
@Param("genereportAt") Date genereportAt,
......@@ -21,7 +21,7 @@ public interface MemberInfoMapper {
@Param("pdfName") String pdfName,
@Param("url") String url,
@Param("genereportName") String genereportName,
@Param("mobileNumber") String mobileNumber);
@Param("openid") String openid);
List<MemberInfo> list(@Param("keyWord") String keyWord,@Param("status") Integer status,@Param("pageable") Pageable pageable);
......
......@@ -33,6 +33,7 @@ public class MemberInfo {
String pdfName;
String url;
String genereportName;
String openid;
public Long getId() {
return id;
......@@ -249,4 +250,12 @@ public class MemberInfo {
public void setGenereportName(String genereportName) {
this.genereportName = genereportName;
}
public String getOpenid() {
return openid;
}
public void setOpenid(String openid) {
this.openid = openid;
}
}
......
......@@ -11,12 +11,12 @@ import java.util.List;
public interface HapiService {
MessageEntity register(String barcode,String name,String gender,String birthdayStr,String mobileNumber,String samplingDate,
MessageEntity register(String barcode,String openid,String name,String gender,String birthdayStr,String mobileNumber,String samplingDate,
String recipients,String address,String familyDisease,String existingDisease,Float weight,Integer height,String remarks);
MessageEntity getByMobileNumber(String mobileNumber);
MessageEntity getByopenid(String mobileNumber);
MessageEntity genereport(String barcode,String mobileNumber);
MessageEntity genereport(String barcode,String mobileNumber,String openid);
MessageEntity reportByDay(String beginTime,String endTime);
......
......@@ -52,7 +52,7 @@ public class HapiServiceImpl implements HapiService {
@Override
public MessageEntity register(String barcode,String name,String gender,String birthdayStr,String mobileNumber,String samplingDate,
public MessageEntity register(String barcode,String openid,String name,String gender,String birthdayStr,String mobileNumber,String samplingDate,
String recipients,String address,String familyDisease,String existingDisease,Float weight,Integer height,String remarks) {
long timestamp = new Date().getTime()/1000;
MessageEntity.Builder builder = new MessageEntity.Builder();
......@@ -83,6 +83,7 @@ public class HapiServiceImpl implements HapiService {
if(map.containsKey("ret") && map.get("ret").toString().equals("0") && map.containsKey("uuid")){
String memberNumber = map.get("uuid") != null ? map.get("uuid").toString() : "";
MemberInfo memberInfo = new MemberInfo();
memberInfo.setOpenid(openid);
memberInfo.setStatus(1);
memberInfo.setAddress(address);
memberInfo.setBarcode(barcode);
......@@ -110,7 +111,7 @@ public class HapiServiceImpl implements HapiService {
@Override
public MessageEntity genereport(String barcode,String mobileNumber) {
public MessageEntity genereport(String barcode,String mobileNumber,String openid) {
long timestamp = new Date().getTime()/1000;
MessageEntity.Builder builder = new MessageEntity.Builder();
Map<String,Object> paremMap = new HashMap<>();
......@@ -132,14 +133,14 @@ public class HapiServiceImpl implements HapiService {
String name = map.get("name") != null ? map.get("name").toString() : "";
String packName = map.get("packName") != null ? map.get("packName").toString() : "";
String pdfName = map.get("pdfName") != null ? map.get("pdfName").toString() : "";
this.memberInfoMapper.genereport(1,new Date(),packName,pdfName,pdfurl,name,mobileNumber);
this.memberInfoMapper.genereport(1,new Date(),packName,pdfName,pdfurl,name,openid);
}
return builder.success(true).code("2000").content(map).create();
}
public MessageEntity getByMobileNumber(String mobileNumber){
public MessageEntity getByopenid(String openid){
MessageEntity.Builder builder = new MessageEntity.Builder();
MemberInfo memberInfo = this.memberInfoMapper.getByMobileNumber(mobileNumber);
MemberInfo memberInfo = this.memberInfoMapper.getByopenid(openid);
if(memberInfo == null || memberInfo.getId() == 0){
//账号不存在
Map<String,Object> map = new HashMap<>();
......
......@@ -25,7 +25,8 @@
remarks,
member_number,
create_at,
status
status,
openid
)
VALUES (
#{source},
......@@ -47,12 +48,13 @@
#{remarks},
#{memberNumber},
#{createAt},
#{status}
#{status},
#{openid}
);
</insert>
<select id="getByMobileNumber" resultType="com.example.models.api.MemberInfo">
select * from t_hpai_member_info where mobile_number = #{mobileNumber} limit 1;
<select id="getByopenid" resultType="com.example.models.api.MemberInfo">
select * from t_hpai_member_info where openid = #{openid} limit 1;
</select>
<update id="genereport">
......@@ -62,7 +64,7 @@
pack_name = #{packName},
pdf_name = #{pdfName},
url = #{url},
genereport_name = #{genereportName} where mobile_number = #{mobileNumber};
genereport_name = #{genereportName} where openid = #{openid};
</update>
......