Prechádzať zdrojové kódy

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

liubing 3 rokov pred
rodič
commit
15a72d9467

+ 46 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/booking/BaseBookingServiceDo.java

@ -0,0 +1,46 @@
package com.yihu.jw.entity.care.booking;
import javax.persistence.*;
/***
 * @ClassName: BaseBookingServiceDo
 * @Description:
 * @Auther: shi kejing
 * @Date: 2021/8/12 10:19
 */
@Entity
@Table(name="base_booking_service")
public class BaseBookingServiceDo {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    private String patient;
    private Integer status;
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}

+ 21 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/booking/BaseBookingServiceDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.care.dao.booking;
import com.yihu.jw.entity.care.booking.BaseBookingServiceDo;
import com.yihu.jw.entity.care.contacts.PatientSosContactsDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/***
 * @ClassName: BaseBookingServiceDao
 * @Description:
 * @Auther: shi kejing
 * @Date: 2021/8/12 10:23
 */
public interface BaseBookingServiceDao extends PagingAndSortingRepository<BaseBookingServiceDo,String>,
        JpaSpecificationExecutor<BaseBookingServiceDo> {
    @Query("select a from BaseBookingServiceDo a where a.patient = ?1 and a.status = '1'")
    BaseBookingServiceDo findByPatient(String patient);
}

+ 49 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/booking/BaseBookingServiceEndpoint.java

@ -0,0 +1,49 @@
package com.yihu.jw.care.endpoint.booking;
import com.yihu.jw.care.service.booking.BaseBookingServiceService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
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;
/***
 * @ClassName: BaseBookingServiceEndpoint
 * @Description:
 * @Auther: shi kejing
 * @Date: 2021/8/12 10:31
 */
@RestController
@RequestMapping("bookingService" )
@Api(tags = "预订服务弹框", description = "预订服务弹框")
public class BaseBookingServiceEndpoint  extends EnvelopRestEndpoint {
    @Autowired
    private BaseBookingServiceService serviceService;
    @ApiOperation("是否需要弹框")
    @GetMapping(value= "findByPatient")
    public Envelop findByPatient(@ApiParam(name = "patient", value = "patient", required = true) @RequestParam(value = "patient", required = true)String patient){
        return success("获取成功!",serviceService.findByPatient(patient));
    }
    @ApiOperation("保存,不在弹框")
    @GetMapping(value= "saveByPatient")
    public Envelop saveByPatient(@ApiParam(name = "patient", value = "patient", required = true) @RequestParam(value = "patient", required = true)String patient){
        try {
            serviceService.saveByPatient(patient);
            return success("保存成功!");
        }catch (Exception e){
            e.printStackTrace();
            return success("保存失败!");
        }
    }
}

+ 37 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/booking/BaseBookingServiceService.java

@ -0,0 +1,37 @@
package com.yihu.jw.care.service.booking;
import com.yihu.jw.care.dao.booking.BaseBookingServiceDao;
import com.yihu.jw.entity.care.booking.BaseBookingServiceDo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/***
 * @ClassName: BaseBookingServiceService
 * @Description:
 * @Auther: shi kejing
 * @Date: 2021/8/12 10:24
 */
@Service
public class BaseBookingServiceService {
    @Autowired
    private BaseBookingServiceDao serviceDao;
    public void saveByPatient(String patient) throws Exception {
            BaseBookingServiceDo serviceDo = new BaseBookingServiceDo();
            serviceDo.setPatient(patient);
            serviceDo.setStatus(1);
            serviceDao.save(serviceDo);
    }
    public int findByPatient(String patient){
        BaseBookingServiceDo serviceDo = serviceDao.findByPatient(patient);
        if (serviceDo != null){
            return serviceDo.getStatus();
        }else {
            return 0;
        }
    }
}

+ 3 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/OnlineContactService.java

@ -36,10 +36,9 @@ public class OnlineContactService extends BaseJpaService<BasePatientDO, BasePati
        String jsSql = "SELECT p.*,pfm.family_relation familyRelation,p.archive_type\n" +
                "FROM base_patient_family_member pfm,base_patient p\n" +
                "WHERE pfm.del = 1 AND pfm.family_member = p.id AND p.patient_status = 1 AND pfm.patient = '"+patient+"'";
        String fwzSql = "SELECT o.* \n" +
                "FROM base_doctor_hospital dh,base_org o,base_service_package_sign_record spsr\n" +
                "WHERE dh.del = 1 AND o.del = 1 AND spsr.`status` = 1 AND spsr.sign_doctor = dh.doctor_code\n" +
                "AND dh.org_code = o.`code` AND spsr.patient = '"+patient+"' GROUP BY o.`code`";
        String fwzSql = "SELECT org.* from base_service_package_sign_record sr,base_service_package_record r,base_team_member m,base_org org \n" +
                "WHERE sr.status=1 and m.team_code = r.team_code and m.org_code = org.code and sr.id=r.sign_id \n" +
                "and sr.patient='"+patient+"' and m.del = '1' ";
        List<Map<String,Object>> zlyList = jdbcTemplate.queryForList(zlySql);
        List<Map<String,Object>> jsList = jdbcTemplate.queryForList(jsSql);
        List<Map<String,Object>> fwzList = jdbcTemplate.queryForList(fwzSql);