|
@ -84,7 +84,7 @@ public class TaskService {
|
|
|
*/
|
|
|
public JSONObject selectActivity(JSONObject object,Integer page,Integer size){
|
|
|
String response = null;
|
|
|
String url =getBaseUrl() + "findActivity";
|
|
|
String url ="http://localhost:10051/svr-health-bank/" + "findActivity";
|
|
|
Map<String,String> params = new HashMap<>();
|
|
|
params.put("activity",object.toJSONString());
|
|
|
params.put("page",page.toString());
|
|
@ -135,6 +135,7 @@ public class TaskService {
|
|
|
String response = null;
|
|
|
String patientId = object.getString("patientId");
|
|
|
SignFamily signFamily = signFamilyDao.findByPatient(patientId);
|
|
|
String taskCode = object.getString("taskCode");
|
|
|
if (signFamily == null){
|
|
|
throw new Exception("已签约居民,才能报名!");
|
|
|
}else if (signFamily!=null&&!signFamily.getExpensesStatus().equalsIgnoreCase("1")){
|
|
@ -142,17 +143,18 @@ public class TaskService {
|
|
|
}
|
|
|
Patient patient = patientDao.findByCode(patientId);
|
|
|
String unionId = object.getString("unionId");
|
|
|
if(!StringUtils.isNoneBlank(patient.getUnionid())){
|
|
|
throw new Exception("该居民已报名!");
|
|
|
}else {
|
|
|
Patient patient1 = patientDao.findByUnionid(unionId);
|
|
|
if (patient1 != null){
|
|
|
if (StringUtils.isNoneBlank(taskCode)&&taskCode.equalsIgnoreCase("ACTIVITY_STEP")){
|
|
|
if(StringUtils.isNoneBlank(patient.getUnionid())){
|
|
|
throw new Exception("该居民已报名!");
|
|
|
}else {
|
|
|
Patient patient1 = patientDao.findByUnionid(unionId);
|
|
|
if (patient1 != null){
|
|
|
throw new Exception("该居民已报名!");
|
|
|
}
|
|
|
patient.setUnionid(unionId);
|
|
|
patientDao.save(patient);
|
|
|
}
|
|
|
patient.setUnionid(unionId);
|
|
|
patientDao.save(patient);
|
|
|
}
|
|
|
|
|
|
object.put("unionId",unionId);
|
|
|
object.put("patientIdcard",patient.getIdcard());
|
|
|
object.put("patientOpenid",patient.getOpenid());
|
|
@ -250,7 +252,7 @@ public class TaskService {
|
|
|
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)){
|
|
|
if (StringUtils.isNoneBlank(step) && step.equalsIgnoreCase(step1)){
|
|
|
return jsonObject;
|
|
|
}else {
|
|
|
redisTemplate.opsForValue().set(STEP,step1);
|