Ver código fonte

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

wangzhinan 5 anos atrás
pai
commit
583aeeef28

+ 5 - 5
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -452,7 +452,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
            count = (Long) rstotal.get(0).get("total");
            count = Long.parseLong(rstotal.get(0).get("total").toString());
        }
        String sql ="SELECT " +
@ -4606,7 +4606,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    
        Long totalsqlAll = 0l;
        if (alltotal != null && alltotal.size() > 0) {
            totalsqlAll = (Long) alltotal.get(0).get("total");
            totalsqlAll = Long.parseLong(alltotal.get(0).get("total").toString());
        }
    
        object.put("all",totalsqlAll);
@ -4625,7 +4625,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    
        Long twCount = 0l;
        if (imgtotal != null && imgtotal.size() > 0) {
            twCount = (Long) imgtotal.get(0).get("total");
            twCount = Long.parseLong(imgtotal.get(0).get("total").toString());
        }
    
        object.put("twCount",twCount);
@ -4644,7 +4644,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    
        Long spcount = 0l;
        if (sptotal != null && sptotal.size() > 0) {
            spcount = (Long) sptotal.get(0).get("total");
            spcount = Long.parseLong(sptotal.get(0).get("total").toString());
        }
    
        object.put("spCount",spcount);
@ -4664,7 +4664,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    
        Long xtcount = 0l;
        if (xttotal != null && xttotal.size() > 0) {
            xtcount = (Long) xttotal.get(0).get("total");
            xtcount = Long.parseLong(xttotal.get(0).get("total").toString());
        }
    
        object.put("xtCount",xtcount);

+ 19 - 37
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -177,20 +177,12 @@ public class ImService {
	public List<Map<String,Object>>  findConsultRecordByPatient(String patient, String id,String type, int page,int pagesize, String title,Integer status,Integer payStatus) {
		
		
		if(page >=1){
			page --;
		}
		
		if (pagesize <= 0) {
			pagesize = 10;
		}
		
		String  sql = "SELECT " +
				"a.id AS \"id\"," +
				"a.type AS \"type\"," +
				"a.title AS \"title\"," +
				"a.symptoms AS \"symptoms\"," +
				"a.czrq AS \"czrq\"," +
				"to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\"," +
				"b.status AS \"status\"," +
				"b.evaluate AS \"evaluate\"," +
				"d.name AS \"doctorName\"," +
@ -229,8 +221,8 @@ public class ImService {
		if (!StringUtils.isEmpty(payStatus)) {
			sql += " and a.pay_status = " + payStatus + "";
		}
		sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
		List<Map<String,Object>> result = hibenateUtils.createSQLQuery(sql);
		sql += " ORDER BY a.czrq desc ";
		List<Map<String,Object>> result = hibenateUtils.createSQLQuery(sql,page,pagesize);
		/*result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));*/
		return result;
	}
@ -265,7 +257,7 @@ public class ImService {
		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
		Long count = 0L;
		if (rstotal != null && rstotal.size() > 0) {
			count = (Long) rstotal.get(0).get("total");
			count = Long.parseLong(rstotal.get(0).get("total").toString());
		}
		
		return count;
@ -1438,7 +1430,11 @@ public class ImService {
		
		ConsultTeamDo consultTeamDo = consultTeamDao.findByConsult(consult);
		
		ConsultDo consultDo = consultDao.findOne(consult);
		
		object.put("doctorCode",consultTeamDo.getDoctor());
		//支付状态
		object.put("payStatus",consultDo.getPayStatus());
		
		return object;
	}
@ -1596,7 +1592,7 @@ public class ImService {
				"a.score as \"score\"," +
				"a.score_type as \"score_type\"," +
				"a.content as \"content\"," +
				"b.create_time as \"create_time\"," +
				"to_char(b.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"create_time\"," +
				"c.type as \"type\"," +
				"c.name as \"patientname\"," +
				"b.id as \"id\"," +
@ -1698,13 +1694,7 @@ public class ImService {
	                                                  String type, Integer status,
	                                                  int page,int pagesize,
	                                                  String title,String start_time,String end_time) {
		if(page >=1){
			page --;
		}
		
		if (pagesize <= 0) {
			pagesize = 10;
		}
		String  sql = "";
		//专家咨询
		if("1".equals(type) || "15".equals(type) || type.contains(",")){
@ -1713,7 +1703,7 @@ public class ImService {
					"a.type AS \"type\"," +
					"a.title AS \"title\"," +
					"a.symptoms AS \"symptoms\"," +
					"a.czrq AS \"czrq\"," +
					"to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\"," +
					"b.status AS \"status\"," +
					"b.evaluate AS \"evaluate\"," +
					"d.name AS \"patientName\"," +
@ -1733,7 +1723,7 @@ public class ImService {
					"a.type AS \"type\"," +
					"a.title AS \"title\"," +
					"a.symptoms AS \"symptoms\"," +
					"a.czrq AS \"czrq\"," +
					"to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\"," +
					"b.status AS \"status\"," +
					"b.evaluate AS \"evaluate\"," +
					"d.name AS \"patientName\"," +
@ -1787,9 +1777,9 @@ public class ImService {
		if (!StringUtils.isEmpty(id)) {
			sql += " and a.id = '" + id + "'";
		}
		sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
		sql += " ORDER BY a.czrq desc ";
		
		return hibenateUtils.createSQLQuery(sql);
		return hibenateUtils.createSQLQuery(sql,page,pagesize);
	}
	
	/**
@ -2086,20 +2076,12 @@ public class ImService {
	                                                  int page,int pagesize,
	                                                  String title,String start_time,String end_time,String patinet) {
		
		if(page >=1){
			page --;
		}
		
		if (pagesize <= 0) {
			pagesize = 10;
		}
		
		String  sql = "SELECT " +
				"a.id AS \"id\"," +
				"a.type AS \"type\"," +
				"a.title AS \"title\"," +
				"a.symptoms AS \"symptoms\"," +
				"a.czrq AS \"czrq\"," +
				"to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\"," +
				"b.status AS \"status\"," +
				"b.evaluate AS \"evaluate\"," +
				"d.name AS \"patientName\"," +
@ -2151,11 +2133,11 @@ public class ImService {
		if (!StringUtils.isEmpty(id)) {
			sql += " and a.id = '" + id + "'";
		}
		sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
		sql += " ORDER BY a.czrq desc ";
		
//		result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));
		
		return hibenateUtils.createSQLQuery(sql);
		return hibenateUtils.createSQLQuery(sql,page,pagesize);
	}
	
	
@ -2402,7 +2384,7 @@ public class ImService {
					"a.type AS \"type\"," +
					"a.title AS \"title\"," +
					"a.symptoms AS \"symptoms\"," +
					"a.czrq AS \"czrq\"," +
					"to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\"," +
					"b.status AS \"status\"," +
					"b.evaluate AS \"evaluate\"," +
					"b.doctor AS \"doctorCode\"," +
@ -2434,7 +2416,7 @@ public class ImService {
					"patient.sex AS \"patientsex\"," +
					"patient.photo AS \"patientphoto\"," +
					"op.id AS \"outpatientid\"," +
					"op.register_date AS \"registerDate\"," +
					"to_char(op.register_date,'YYYY-MM-DD hh24:mi:ss')  AS \"registerDate\"," +
					"op.status AS outpatientstatus " +
					"FROM wlyy_outpatient op," +
					"base_patient patient " +

+ 23 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/iot/dict/IotDeviceDictDO.java

@ -20,10 +20,10 @@ public class IotDeviceDictDO extends UuidIdentityEntityWithOperator implements S
    private String saasId;
    @Column(name = "device_type")
    private String deviceType;//设备种类
    private String deviceType;//设备种类,iot_system_dict表的id
    @Column(name = "name")
    private String name;//设备种类名称
    private String name;//设备种类名称,iot_system_dict表的value
    @Column(name = "data_type")
    private String dataType;//测量数据种类
@ -31,6 +31,11 @@ public class IotDeviceDictDO extends UuidIdentityEntityWithOperator implements S
    @Column(name = "data_type_name")
    private String dataTypeName;//测量数据种类名称
    @Column(name = "unit")
    private String unit;//单位
    @Column(name = "field")
    private String field;//对应字段
    @Column(name = "del")
    private Integer del;//删除标志
@ -84,4 +89,20 @@ public class IotDeviceDictDO extends UuidIdentityEntityWithOperator implements S
    public void setDel(Integer del) {
        this.del = del;
    }
    public String getUnit() {
        return unit;
    }
    public void setUnit(String unit) {
        this.unit = unit;
    }
    public String getField() {
        return field;
    }
    public void setField(String field) {
        this.field = field;
    }
}

+ 3 - 3
common/common-request-mapping/src/main/java/com/yihu/jw/rm/iot/IotRequestMapping.java

@ -139,10 +139,10 @@ public class IotRequestMapping {
     * 设备字典模块常量
     */
    public static class DeviceDict{
        public static final String api_create = "deviceDict";
        public static final String api_delete = "deviceDict";
        public static final String api_create = "createDeviceDict";
        public static final String api_delete = "deleteDeviceDict";
        public static final String api_getById = "getDeviceDictById";
        public static final String api_update = "deviceDict";
        public static final String api_update = "updateDeviceDict";
        public static final String api_queryPage = "queryDeviceDictPage";
        public static final String api_getList = "getDeviceDictList";

+ 33 - 0
common/common-util/src/main/java/com/yihu/jw/util/common/BeanUtils.java

@ -0,0 +1,33 @@
package com.yihu.jw.util.common;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import java.beans.PropertyDescriptor;
import java.util.HashSet;
import java.util.Set;
/**
 * create by hmf on 2020/04/27
 */
public class BeanUtils {
    /**
     * @Title: getNullPropertyNames
     * @Description: 获取值为空的属性名称
     * @createdBy:byrc
     */
    public static String[] getNullPropertyNames(Object source) {
        BeanWrapper src = new BeanWrapperImpl(source);
        PropertyDescriptor[] pds = src.getPropertyDescriptors();
        Set<String> emptyNames = new HashSet<String>();
        for (PropertyDescriptor pd : pds) {
            Object srcValue = src.getPropertyValue(pd.getName());
            if (srcValue == null)
                emptyNames.add(pd.getName());
        }
        String[] result = new String[emptyNames.size()];
        return emptyNames.toArray(result);
    }
}

+ 22 - 19
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -129,7 +129,6 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
								@ApiParam(name = "pagesize", value = "分页大小")
								@RequestParam(value = "pagesize",required = false) int pagesize
								)throws Exception{
		JSONArray array = new JSONArray();
		List<Map<String,Object>>  data = imService.findConsultRecordByPatient(patient, id,type, page,pagesize, title,status,payStatus);
		
		/*if (data != null) {
@ -168,7 +167,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		
		JSONObject result = new JSONObject();
		result.put("total",total);
		result.put("list",array);
		result.put("list",data);
		return success(result);
	}
	
@ -424,28 +423,32 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			hospitalSystemMessageService.saveMessage(systemMessageDO);
			BaseDoctorDO d = baseDoctorDao.findById(re.getString("doctor"));
			BasePatientDO p = basePatientDao.findById(re.getString("patient"));
			//眼科支付订单
			if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
				if (type==1||type==2){
					BusinessOrderDO businessOrderDO = new BusinessOrderDO();
					businessOrderDO.setDoctor(doctor);
					businessOrderDO.setPatient(patient);
					businessOrderDO.setPatientName(re.getString("patientName"));
					businessOrderDO.setDescription("专家咨询费");
					businessOrderDO.setOrderCategory("1");
					if (type==1){
						businessOrderDO.setOrderType(1);
					}else if (type==17){
						businessOrderDO.setOrderType(3);
						businessOrderDO.setRelationCode(re.getString("consult"));
						businessOrderDO.setRelationName("新增专家咨询");
			
			try {
				//眼科支付订单
				if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
					if (type==1||type==2){
						BusinessOrderDO businessOrderDO = new BusinessOrderDO();
						businessOrderDO.setDoctor(doctor);
						businessOrderDO.setPatient(patient);
						businessOrderDO.setPatientName(re.getString("patientName"));
						businessOrderDO.setDescription("专家咨询费");
						businessOrderDO.setOrderCategory("1");
						if (type==1){
							businessOrderDO.setOrderType(1);
						}else if (type==17){
							businessOrderDO.setOrderType(3);
							businessOrderDO.setRelationCode(re.getString("consult"));
							businessOrderDO.setRelationName("新增专家咨询");
						}
						businessOrderService.saveOrder(businessOrderDO);
					}
					businessOrderService.saveOrder(businessOrderDO);
				}
			}catch (Exception e){
			    logger.info("支付订单失败:"+e.getMessage());
			}
			//发送企业号推送
			try{
				

+ 15 - 4
svr/svr-iot/src/main/java/com/yihu/iot/controller/dict/IotDeviceDictController.java

@ -9,10 +9,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
@ -43,4 +40,18 @@ public class IotDeviceDictController extends EnvelopRestEndpoint {
        List<IotDeviceDictDO> iotDeviceDicts = convertToModels(list, new ArrayList<>(list.size()), IotDeviceDictDO.class, fields);
        return MixEnvelop.getSuccessList(IotRequestMapping.DeviceDict.message_success_find_functions,iotDeviceDicts);
    }
    @PostMapping(value = IotRequestMapping.DeviceDict.api_create)
    @ApiOperation(value = "创建编辑设备字典")
    public MixEnvelop create(
            @ApiParam(name = "jsonData", value = "设备体征字典json数据")
            @RequestParam(value = "jsonData", required = false) String jsonData){
        try {
            IotDeviceDictDO dictDO = toEntity(jsonData, IotDeviceDictDO.class);
            return MixEnvelop.getSuccess(IotRequestMapping.Company.message_success_create, iotDeviceDictService.create(dictDO));
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/dao/dict/IotDeviceDictDao.java

@ -11,6 +11,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
public interface IotDeviceDictDao extends PagingAndSortingRepository<IotDeviceDictDO,String>,
        JpaSpecificationExecutor<IotDeviceDictDO> {
    @Query("from IotDeviceDictDO w where w.id =?1")
    @Query("from IotDeviceDictDO w where w.id =?1 and w.del = 1")
    IotDeviceDictDO findById(String id);
}

+ 28 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotDeviceDictService.java

@ -3,9 +3,15 @@ package com.yihu.iot.service.dict;
import com.yihu.iot.dao.dict.IotDeviceDictDao;
import com.yihu.jw.entity.iot.dict.IotDeviceDictDO;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import static com.yihu.jw.util.common.BeanUtils.getNullPropertyNames;
/**
 * @author yeshijie on 2017/12/8.
 */
@ -19,4 +25,26 @@ public class IotDeviceDictService extends BaseJpaService<IotDeviceDictDO,IotDevi
        return iotDeviceDictDao.findById(id);
    }
    /**
     * 新增或编辑体征字典
     * @param dictDO
     * @return
     */
    public IotDeviceDictDO create(IotDeviceDictDO dictDO) {
        //判断新增或者编辑
        if(StringUtils.isNotBlank(dictDO.getId())){
            IotDeviceDictDO oldDictDO = iotDeviceDictDao.findById(dictDO.getId());
            BeanUtils.copyProperties(dictDO, oldDictDO, getNullPropertyNames(dictDO));
            oldDictDO.setUpdateTime(new Date());
            iotDeviceDictDao.save(oldDictDO);
            return oldDictDO;
        }else {
            dictDO.setSaasId(getCode());
            dictDO.setDel(1);
            dictDO.setCreateTime(new Date());
            iotDeviceDictDao.save(dictDO);
            return dictDO;
        }
    }
}