Browse Source

上传体征数据积分增加bug

zd_123 7 years ago
parent
commit
083f98ee84

+ 0 - 2
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/DeviceService.java

@ -509,7 +509,6 @@ public class DeviceService extends BaseService{
                if (signFamily!=null){
                    hospital = signFamily.getHospital();
                }
                String flagStr = "";
                if (deviceType==1){
                    flagStr="BP_MEASURE";
@ -529,7 +528,6 @@ public class DeviceService extends BaseService{
                            params.add(new BasicNameValuePair("creditsDetail", "{\"tradeType\":\"ACTIVITY_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+result.getUser()+"\",\"hospital\":\"350205\"}"));
                            String response = HttpClientUtil.post(url, params, "UTF-8");
                            System.out.println(response);
                            com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(response);
                            String status = jsonObject.getString("status");
                            if (!"200".equals(status)){

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceLogService.java

@ -74,7 +74,7 @@ public class PatientDeviceLogService extends BaseService {
                "  SELECT sf.name, pd.* FROM wlyy_patient_device_log pd" +
                "  LEFT JOIN wlyy_sign_family sf ON pd.patient = sf.patient" +
                "  WHERE" +
                "   pd.is_del = 1 and (sf.doctor= '" +doctor+"' or sf.doctor_health = '"+doctor+"')"+
                "  pd.is_del = 1 and (sf.doctor= '" +doctor+"' or sf.doctor_health = '"+doctor+"') and sf.`status`>0"+
                "  ORDER BY" +
                "  create_time DESC) a" +
                " GROUP BY a.device_sn) b" +

+ 36 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/health/bank/AccountController.java

@ -4,9 +4,16 @@
package com.yihu.wlyy.web.third.health.bank;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.wechat.WechatTemplateConfig;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
import com.yihu.wlyy.service.app.health.bank.CreditLogService;
import com.yihu.wlyy.service.app.health.bank.TaskService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -19,6 +26,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
 * @author wangzhinan
 * @create 2018-05-07 8:50
@ -34,6 +44,14 @@ public class AccountController extends BaseController {
    private CreditLogService service;
    @Autowired
    private TaskService taskService;
    @Autowired
    private WechatTemplateConfigDao templateConfigDao;
    @Autowired
    private PushMsgTask pushMsgTask;
    @Autowired
    private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
    @Autowired
    private PatientDao patientDao;
@ -141,4 +159,22 @@ public class AccountController extends BaseController {
            return error(-1,e.getMessage());
        }
    }
    @RequestMapping(value = "/insertCredits",method = RequestMethod.POST)
    @ApiOperation("添加积分")
    public String insert(@ApiParam(name = "creditsDetail",value = "居民id集合")
                         @RequestParam(name = "creditsDetail") String creditsDetail){
        try {
            JSONObject object = JSONObject.parseObject(creditsDetail);
            JSONObject result = service.insert(object);
            String status = result.getString("status");
            logger.info("健康银行居民新增积分:"+result.toString());
            return write(200,"添加成功","data",result);
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
}