wujunjie 7 年 前
コミット
82990e0ae5

+ 14 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/SignFamily.java

@ -87,6 +87,20 @@ public class SignFamily extends IdEntity {
    // 居委会字段名称
    private String sickVillageName;
    private Integer signPaySource;//签约支付渠道: 1线下 2线上
    //1.4.3新增医生拒签原因
    private String refuseSpeak;//医生拒签原因
    public static long getSerialVersionUID() {
        return serialVersionUID;
    }
    public String getRefuseSpeak() {
        return refuseSpeak;
    }
    public void setRefuseSpeak(String refuseSpeak) {
        this.refuseSpeak = refuseSpeak;
    }
    public Integer getSignPaySource() {
        return signPaySource;

+ 19 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/Prescription.java

@ -30,6 +30,8 @@ public class Prescription extends IdEntity {
    private Date failTime;                  //基位 开方失败时间
    private String failReason;                  //基位 开方失败原因
    private Date dosageTime;                //配药完成时间
    private Date extendTime;                //延长收药的系统
    private Integer extendCount;                //延长收药次数(限1次)
    private Date dispatchingTime;          //配送员领药时间
    private Date expressageTime;            //配送员到服务站的时间
    private Date finishTime;                //配送员确认送达或居民确认取药的时间
@ -109,6 +111,23 @@ public class Prescription extends IdEntity {
    private String drugDeliveryOperatorName; //操作人员名字
    private Date drugDeliveryTime; //异常出药时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getExtendTime() {
        return extendTime;
    }
    public void setExtendTime(Date extendTime) {
        this.extendTime = extendTime;
    }
    @Column(name = "extend_count", unique = true, nullable = false)
    public Integer getExtendCount() {
        return extendCount;
    }
    public void setExtendCount(Integer extendCount) {
        this.extendCount = extendCount;
    }
    @Column(name = "code", unique = true, nullable = false)
    public String getCode() {

+ 26 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -26,6 +26,7 @@ import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.MessageType;
import io.swagger.models.auth.In;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -96,6 +97,31 @@ public class PrescriptionService extends BaseService {
        return prescriptionDao.findByCode(prescriptionCode);
    }
    /**
     * 续方确认收药接口
     *
     * @param prescriptionCode 续方code
     * @param type 1:确认收药 2:延长收药
     * @return
     */
    public void confirmReceipt(String prescriptionCode, Integer type) throws Exception{
        try {
            Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
            if (type == 1){
                //直接更改状态为已完成
                prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
            }else if (type == 2){
                //不更改状态只添加延长收药时间
                prescription.setExtendTime(new Date());
                prescription.setExtendCount(prescription.getExtendCount()+1);
            }
            prescriptionDao.save(prescription);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    /**

+ 5 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -1358,7 +1358,8 @@ public class FamilyContractService extends BaseService {
                                 String patientCard, int type,
                                 String healthLabel, String customLabel, String disease,
                                 String expenses, long adminTeamCode,
                                 String sevId) throws Exception {
                                 String sevId,
                                 String refuseReason) throws Exception {
        JSONObject result = new JSONObject();
        String caller = "";
        if (type != 1 && type != 2) {
@ -1549,6 +1550,9 @@ public class FamilyContractService extends BaseService {
            // 医生拒绝
            sf.setStatus(-2);
            sf.setCzrq(new Date());
            if (StringUtils.isNotEmpty(refuseReason)){
                sf.setRefuseSpeak(refuseReason);
            }
            // 拒绝签约
            JSONObject json = new JSONObject();
            json.put("first", "签约失败通知");

+ 4 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -525,6 +525,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     * @param patientIDcard    患者身份证
     * @param type             处理类型:1同意,2拒绝
     * @param adminTeamCode    行政团队code
     * @param refuseReason    居民签约时的医生拒签原因(可选 限制200字)
     * @return
     */
    @RequestMapping(value = "sign")
@ -544,7 +545,8 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            int type,
            long adminTeamCode,
            @RequestParam(required = false, defaultValue = "0") String expenses,
            @RequestParam(required = false) String sevId) {
            @RequestParam(required = false) String sevId,
            @RequestParam(required = false) String refuseReason) {
        try {
            if (type != 2) {
                try {
@ -579,7 +581,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                return error(-1, "健康情况标签不能为空!");
            }
            JSONObject res = familyContractService.handleSign(signType, getAccessToken(), doctor, doctorName, healthDoctor, healthDoctorName, msgid, patientIDcard, type, healthLabel, customLabel, disease, expenses, adminTeamCode, sevId);
            JSONObject res = familyContractService.handleSign(signType, getAccessToken(), doctor, doctorName, healthDoctor, healthDoctorName, msgid, patientIDcard, type, healthLabel, customLabel, disease, expenses, adminTeamCode, sevId,refuseReason);
            if (res.getInt("status") == -1) {
                return error(-1, "未知的处理类型!");
            } else if (res.getInt("status") == 0) {

+ 14 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/team/AdminTeamController.java

@ -261,12 +261,25 @@ public class AdminTeamController extends BaseController {
        }
    }
    /**
     * 当前医生为团队长信息排在最前,成员在后
     * @param doctorCode
     * @return
     */
    @RequestMapping(value = "/team/{doctor_code}/teams", method = RequestMethod.GET)
    @ApiOperation(value = "获取医生团队列表")
    public String getDoctorTeams(@PathVariable("doctor_code") String doctorCode) {
        try {
            ArrayList teams = new ArrayList();
            List<AdminTeam> teamList = teamService.getDoctorTeams(doctorCode);
            return write(200, "OK", "data", new JSONArray(teamList));
            AdminTeam team = teamService.findByLeaderCode(doctorCode);
            teams.add(team);
            for (AdminTeam list : teamList){
                if (!doctorCode.equals(list.getLeaderCode())){
                    teams.add(list);
                }
            }
            return write(200, "OK", "data", new JSONArray(teams));
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());

+ 20 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionController.java

@ -254,6 +254,26 @@ public class PatientPrescriptionController extends WeixinBaseController {
        }
    }
    /**
     * 续方确认收药接口
     *
     * @param prescriptionCode 续方code原状态为60
     * @param type 1:确认收药 2:延长收药
     * @return
     */
    @RequestMapping(value = "/confirmReceipt", method = RequestMethod.POST)
    @ApiOperation(value = "续方确认收药接口")
    public String confirmReceipt(
            @RequestParam(required = true) @ApiParam(value = "处方code", name = "prescriptionCode") String prescriptionCode,
            @RequestParam(required = true) @ApiParam(value = "收药方式", name = "type") Integer type) {
        try {
            prescriptionService.confirmReceipt(prescriptionCode,type);
            return write(200, "确认成功");
        } catch (Exception e) {
            return error(-1, "确认失败");
        }
    }
    @RequestMapping(value = "/fadeRecipe", method = RequestMethod.POST)
    @ApiOperation(value = "挂号作废处方接口")