ソースを参照

Merge branch 'dev' of wangzhinan/patient-co-management into dev

huangwenjie 7 年 前
コミット
8be18b67ab

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/CreditLogService.java

@ -165,7 +165,7 @@ public class CreditLogService {
     */
    public JSONObject selectByCondition(JSONObject object,Integer page,Integer size){
        String response = null;
        String url =getBaseUrl() + "findCreditsLogInfo";
        String url=getBaseUrl() + "findCreditsLogInfo";
        Map<String,String> params = new HashMap<>();
        params.put("creditsDetail",object.toJSONString());
        params.put("page",page.toString());
@ -348,7 +348,7 @@ public class CreditLogService {
        object.put("unionId",patient.getUnionid());
        object.put("patientIdcard",patient.getIdcard());
        String response = null;
        String url =getBaseUrl() + "selectByPatient";
        String url =getBaseUrl()+ "selectByPatient";
        Map<String,String> params = new HashMap<>();
        params.put("activity",object.toJSONString());
        params.put("page",page.toString());
@ -474,7 +474,7 @@ public class CreditLogService {
                    ids.add(patientDevices.get(0).getUser());
                }
            }else if (bindStatus == 1){
                String sql1 = "select * from wlyy_patient_device where user = '"+patientIds.get(i)+"' AND category_code = "+deviceType+" AND del = " + bindStatus;
                String sql1 = "select * from wlyy_patient_device where user = '"+patientIds.get(i)+"' AND category_code = "+deviceType+" AND del = " + 0;
                List<PatientDevice> patientDevices = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(PatientDevice.class));
                if (patientDevices == null || patientDevices.size() ==0){
                    ids.add(patientIds.get(i));

+ 28 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/TaskService.java

@ -6,9 +6,12 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientFamilyMember;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.patient.PatientDao;
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -19,7 +22,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -49,6 +51,10 @@ public class TaskService {
    private PatientDao patientDao;
    @Autowired
    private PatientFamilyMemberDao patientFamilyMemberDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private WlyySignFamilyCodeDao signFamilyCodeDao;
    /**
@ -124,7 +130,14 @@ public class TaskService {
     */
    public JSONObject attendTask(JSONObject object) throws Exception {
        String response = null;
        Patient patient = patientDao.findByCode(object.getString("patientId"));
        String patientId = object.getString("patientId");
        SignFamily signFamily = signFamilyDao.findByPatient(patientId);
        if (signFamily == null){
            throw new Exception("该居民尚未签约,不能报名!");
        }else if (signFamily!=null&&!signFamily.getExpensesStatus().equalsIgnoreCase("0")){
            throw new Exception("该居民尚未缴费,不能报名!");
        }
        Patient patient = patientDao.findByCode(patientId);
        String unionId = object.getString("unionId");
        Patient patient1 = patientDao.findByUnionid(unionId);
        if (patient1 != null){
@ -162,16 +175,25 @@ public class TaskService {
        if (patients != null && patients.size()!=0){
            patient = patients.get(0);
        }
        List<Patient> patientList = new ArrayList<>();
        JSONArray array = new JSONArray();
      /*  List<Patient> patientList = new ArrayList<>();*/
        JSONObject object = new JSONObject();
        if (patient != null){
            patientList.add(patient);
            SignFamily signFamily1 = signFamilyDao.findByPatient(patient.getCode());
            JSONObject object2 = (JSONObject) JSONObject.toJSON(patient);
            object2.put("hospital",signFamily1.getHospitalName());
            array.add(object2);
            /*patientList.add(patient);*/
            List<PatientFamilyMember> patientFamilyMemberList = patientFamilyMemberDao.findByPatient(patient.getCode());
            for (PatientFamilyMember patientFamilyMember:patientFamilyMemberList){
                Patient patient1 = patientDao.findByCode(patientFamilyMember.getFamilyMember());
                patientList.add(patient1);
                SignFamily signFamily = signFamilyDao.findByPatient(patient.getCode());
                JSONObject object1 = (JSONObject) JSONObject.toJSON(patient);
                object1.put("hospital",signFamily.getHospitalName());
                array.add(object1);
                /*patientList.add(patient1);*/
            }
            object.put("patientList",patientList);
            object.put("patientList",array);
            object.put("total",patientFamilyMemberList.size());
            object.put("page",1);
            object.put("size",100);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/bank/CreditsLogController.java

@ -268,7 +268,7 @@ public class CreditsLogController extends BaseController {
                                    @RequestParam(value = "size", required = false)Integer size){
        try {
            JSONObject object = new JSONObject();
            object.put("openId",getOpenid());
            object.put("patientId",getUID());
            return write(200,"查询成功","data",service.selectByPatient(object,page,size));
        }catch (Exception e){
            error(e);