LAPTOP-KB9HII50\70708 3 سال پیش
والد
کامیت
bb0adcee2f

+ 13 - 0
common/common-entity/sql记录

@ -1553,3 +1553,16 @@ CREATE TABLE `base_yunxing_channel` (
-- 2021-10-14 ysj
ALTER table wlyy_devices add column collect_num int(20) default null COMMENT '采集数据次数';
ALTER table wlyy_devices add column abnormal_num int(20) default null COMMENT '异常指标数据次数';
-- 2021-10-16 ysj
CREATE TABLE `base_child_activity_registration` (
  `id` varchar(50) NOT NULL,
  `patient` varchar(50) DEFAULT NULL,
  `patient_name` varchar(50) DEFAULT NULL,
  `activity_type` varchar(2) DEFAULT NULL COMMENT '活动类型',
  `org_code` varchar(50) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='幼儿活动报名表';

+ 57 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/activity/ChildActivityRegistrationDO.java

@ -0,0 +1,57 @@
package com.yihu.jw.entity.care.activity;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 幼儿活动报名表
 * Created by yeshijie on 2021/10/16.
 */
@Entity
@Table(name="base_child_activity_registration")
public class ChildActivityRegistrationDO extends UuidIdentityEntityWithCreateTime {
    private String patient;
    private String patientName;
    private String activityType;
    private String orgCode;
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    @Column(name = "patient_name")
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    @Column(name = "activity_type")
    public String getActivityType() {
        return activityType;
    }
    public void setActivityType(String activityType) {
        this.activityType = activityType;
    }
    @Column(name = "org_code")
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
}

+ 17 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/activity/ChildActivityRegistrationDao.java

@ -0,0 +1,17 @@
package com.yihu.jw.care.dao.activity;
import com.yihu.jw.entity.care.activity.ChildActivityRegistrationDO;
import com.yihu.jw.entity.care.consult.BaseYunxingChannelDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2021/10/16.
 */
public interface ChildActivityRegistrationDao extends PagingAndSortingRepository<ChildActivityRegistrationDO,String>,
        JpaSpecificationExecutor<ChildActivityRegistrationDO> {
    @Query("select a from ChildActivityRegistrationDO a where a.patient = ?1 and a.activityType = ?2 ")
    ChildActivityRegistrationDO findByPatientAndActivityType(String patient,String activityType);
}

+ 62 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/activity/ChildActivityEndpoint.java

@ -0,0 +1,62 @@
package com.yihu.jw.care.endpoint.activity;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.service.activity.ChildActivityRegistrationService;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
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;
/**
 * Created by yeshijie on 2021/10/16.
 */
@RestController
@RequestMapping("childActivity" )
@Api(tags = "幼儿活动", description = "幼儿活动")
public class ChildActivityEndpoint  extends EnvelopRestEndpoint {
    @Autowired
    private ChildActivityRegistrationService activityRegistrationService;
    @GetMapping(value = "childActivityRegistrationList")
    @ApiOperation(value = "活动报名列表查询")
    public PageEnvelop childActivityRegistrationList(
            @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = false) String patient,
            @ApiParam(name = "activityType", value = "活动类型 1小鬼来当家 2秋游去 3我喜欢我自己 4乡村音乐") @RequestParam(value = "activityType", required = false) String status,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1") @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15") @RequestParam(value = "size") int size) {
        try{
            return activityRegistrationService.childActivityRegistrationList(patient, status, page, size);
        }catch (Exception e){
            return failedPageEnvelopException2(e);
        }
    }
    @GetMapping("applyActivity")
    @ApiOperation(value = "在线报名-根据教师展示")
    public ObjEnvelop applyActivity(
            @ApiParam(name = "patient", value = "居民id")
            @RequestParam(value = "patient", required = true) String patient,
            @ApiParam(name = "activityType", value = "活动类型 1小鬼来当家 2秋游去 3我喜欢我自己 4乡村音乐")
            @RequestParam(value = "activityType", required = true) String activityType
    ) {
        try {
            JSONObject result = activityRegistrationService.applyActivity(patient,activityType);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return ObjEnvelop.getError(result.getString(ResponseContant.resultMsg),-1);
            }
            return success(result.get("resultMsg"));
        } catch (Exception e) {
            return failedObjEnvelopException2(e);
        }
    }
}

+ 20 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/course/PatientCourseEndpoint.java

@ -131,8 +131,26 @@ public class PatientCourseEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取教师")
    public ListEnvelop findDoctorByOrg (
            @ApiParam(name = "orgCode", value = "机构code")
            @RequestParam(value = "orgCode", required = false) String orgCode) throws Exception {
        return success(courseService.findDoctorByOrg(orgCode));
            @RequestParam(value = "orgCode", required = false) String orgCode){
        try {
            return success(courseService.findDoctorByOrg(orgCode));
        }catch (Exception e){
            e.printStackTrace();
            return failedListEnvelopException2(e);
        }
    }
    @GetMapping(value = "findDoctorByOrgLimit")
    @ApiOperation(value = "查找机构的老师 奶牛城堡时限制教师")
    public ListEnvelop findDoctorByOrgLimit (
            @ApiParam(name = "orgCode", value = "机构code")
            @RequestParam(value = "orgCode", required = false) String orgCode) {
        try {
            return success(courseService.findDoctorByOrgLimit(orgCode));
        }catch (Exception e){
            e.printStackTrace();
            return failedListEnvelopException2(e);
        }
    }
    @GetMapping("getCourseByteacher")

+ 95 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/activity/ChildActivityRegistrationService.java

@ -0,0 +1,95 @@
package com.yihu.jw.care.service.activity;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.dao.activity.ChildActivityRegistrationDao;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.activity.ChildActivityRegistrationDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.util.common.IdCardUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * Created by yeshijie on 2021/10/16.
 */
@Service
public class ChildActivityRegistrationService {
    @Autowired
    private ChildActivityRegistrationDao childActivityRegistrationDao;
    @Autowired
    private BasePatientDao patientDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 幼儿申请活动
     * @param patient
     * @param activityType
     * @return
     */
    public JSONObject applyActivity(String patient, String activityType){
        JSONObject result = new JSONObject();
        ChildActivityRegistrationDO activityRegistrationDO = childActivityRegistrationDao.findByPatientAndActivityType(patient, activityType);
        if(activityRegistrationDO != null){
            String failMsg = "您已报名过改类型的活动,请勿重复报名!";
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg, failMsg);
            return result;
        }
        BasePatientDO patientDO = patientDao.findById(patient);
        activityRegistrationDO = new ChildActivityRegistrationDO();
        activityRegistrationDO.setActivityType(activityType);
        activityRegistrationDO.setPatient(patient);
        activityRegistrationDO.setPatientName(patientDO.getName());
        childActivityRegistrationDao.save(activityRegistrationDO);
        result.put(ResponseContant.resultFlag, ResponseContant.success);
        result.put(ResponseContant.resultMsg, activityRegistrationDO);
        return result;
    }
    /**
     * 活动报名列表查询
     * @param patient
     * @param activityType
     * @param page
     * @param size
     */
    public PageEnvelop childActivityRegistrationList(String patient,String activityType, int page, int size){
        String sql = "SELECT a.activity_type activityType,a.patient,p.name,p.sex,p.idcard,p.photo from base_child_activity_registration a,base_patient p " +
                "WHERE a.patient = p.id";
        String sqlCount = "select count(a.id) from base_child_activity_registration a,base_patient p WHERE a.patient = p.id  ";
        page = page>0?page-1:0;
        String limit = " order by a.create_time desc limit "+page*size+","+size;
        String filter = "";
        if(StringUtils.isNotBlank(patient)){
            filter += " and a.pateint = '"+patient+"' ";
        }
        if(StringUtils.isNotBlank(activityType)){
            filter += " and a.activity_type = '"+activityType+"' ";
        }
        Long count = jdbcTemplate.queryForObject(sqlCount+filter,Long.class);
        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql+filter);
        for (Map<String,Object> map:result){
            String idcard = map.get("idcard")+"";
            map.put("age", IdCardUtil.getAgeForIdcard(idcard));
        }
        return PageEnvelop.getSuccessListWithPage("查询成功",result,page,size,count);
    }
    public ChildActivityRegistrationDO activityDetail(String id){
        return childActivityRegistrationDao.findOne(id);
    }
}

+ 15 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/course/CourseService.java

@ -452,6 +452,21 @@ public class CourseService {
        return amapList;
    }
    /**
     * 查找机构的老师 奶牛城堡时限制教师
     * @param orgCode
     * @return
     */
    public List<Map<String,Object>> findDoctorByOrgLimit(String orgCode){
        String sql1 = "SELECT d.* FROM base_doctor d,base_doctor_hospital sh WHERE  d.del = 1 and  d.id = sh.doctor_code AND sh.del = 1 AND sh.org_code = '"+orgCode+"' " ;
        if("zhjdnncbtyy".equals(orgCode)){
            sql1 += " and d.consult_status = '1' ";
        }
        List<Map<String , Object >> amapList = jdbcTemplate.queryForList(sql1);
        return amapList;
    }
    public JSONObject getCourseByOrg(String lon2,String lat2){ //, int pageSize,int currentPage
        JSONObject object = new JSONObject();
        String sql = "SELECT id, code, `name`, mobile, photo, address, longitude, latitude, funDistance ( latitude, longitude, "+lat2+", "+lon2+" ) funDistance FROM base.base_org WHERE del = 1 and type = 4 ORDER BY funDistance DESC\n";

+ 5 - 5
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/lifeCare/LifeCareOrderService.java

@ -822,13 +822,13 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
                ",ord.doctor,ord.doctor_name doctorName,ord.expected_doctor_name expectedDoctorName,group_concat(Distinct fee.name SEPARATOR '、') serveItems" +
                " from base_life_care_order ord LEFT JOIN base_life_care_fee_detail fee on ord.id = fee.order_id " +
                "and fee.`status`<>3 where ord.patient = '"+patient+"' and ord.status<>0 ";
        String fliter = "";
        String filter = "";
       if (status != null){
           fliter += " and ord.status = "+status;
           filter += " and ord.status = "+status;
       }
       Long count = jdbcTemplate.queryForObject(sqlCount+fliter,Long.class);
       fliter += " group by ord.id order by ord.create_time desc limit "+page*size+","+size;
       List<Map<String,Object>> result = jdbcTemplate.queryForList(sql+fliter);
       Long count = jdbcTemplate.queryForObject(sqlCount+filter,Long.class);
        filter += " group by ord.id order by ord.create_time desc limit "+page*size+","+size;
       List<Map<String,Object>> result = jdbcTemplate.queryForList(sql+filter);
       return PageEnvelop.getSuccessListWithPage("查询成功",result,page,size,count);
    }

+ 3 - 0
svr/svr-cloud-transfor/readme.MD

@ -0,0 +1,3 @@
医养转发项目
爱牵挂推送医养杭州服务器有问题,公司的iot项目请求有时会失败
新增处理转发