|
@ -13,6 +13,7 @@ import com.yihu.wlyy.repository.patient.PatientFamilyMemberDao;
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
|
import com.yihu.wlyy.repository.statistics.WlyySignFamilyCodeDao;
|
|
|
import com.yihu.wlyy.util.HttpClientUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -39,6 +40,7 @@ public class TaskService {
|
|
|
private Logger logger = LoggerFactory.getLogger(TaskService.class);
|
|
|
|
|
|
private static String URL = "health:blank:url";
|
|
|
private static String STEP = "health:blank:step";
|
|
|
@Autowired
|
|
|
private SystemDictDao systemDictDao;
|
|
|
@Autowired
|
|
@ -73,6 +75,7 @@ public class TaskService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查看活动列表
|
|
|
*
|
|
@ -139,7 +142,7 @@ public class TaskService {
|
|
|
}
|
|
|
Patient patient = patientDao.findByCode(patientId);
|
|
|
String unionId = object.getString("unionId");
|
|
|
if(patient.getUnionid() != null){
|
|
|
if(!StringUtils.isNoneBlank(patient.getUnionid())){
|
|
|
throw new Exception("该居民已报名!");
|
|
|
}else {
|
|
|
Patient patient1 = patientDao.findByUnionid(unionId);
|
|
@ -149,6 +152,7 @@ public class TaskService {
|
|
|
patient.setUnionid(unionId);
|
|
|
patientDao.save(patient);
|
|
|
}
|
|
|
|
|
|
object.put("unionId",unionId);
|
|
|
object.put("patientIdcard",patient.getIdcard());
|
|
|
object.put("patientOpenid",patient.getOpenid());
|
|
@ -236,4 +240,22 @@ public class TaskService {
|
|
|
return JSONObject.parseObject(response);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取步数 50、100、500
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject getStepNumber(){
|
|
|
String step = redisTemplate.opsForValue().get(STEP);
|
|
|
String step1 = systemDictDao.findByDictNameAndCode("HEALTH_STEP","HEALTH_STEP");
|
|
|
JSONObject jsonObject = JSONObject.parseObject(step1);
|
|
|
if (step1 != null && step.equalsIgnoreCase(step1)){
|
|
|
return jsonObject;
|
|
|
}else {
|
|
|
redisTemplate.opsForValue().set(STEP,step1);
|
|
|
return jsonObject;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|