You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
3.0 KiB
78 lines
3.0 KiB
2 years ago
|
package com.ynxbd.common.action;
|
||
|
|
||
|
import com.ynxbd.common.action.base.BaseAction;
|
||
|
import com.ynxbd.common.bean.chronic.Chronic;
|
||
|
import com.ynxbd.common.dao.ChronicDao;
|
||
|
import com.ynxbd.common.dao.RecordDao;
|
||
|
import com.ynxbd.common.helper.common.ImageHelper;
|
||
|
import com.ynxbd.common.result.Result;
|
||
|
import com.ynxbd.common.result.ResultEnum;
|
||
|
import lombok.extern.slf4j.Slf4j;
|
||
|
import org.apache.struts2.convention.annotation.Action;
|
||
|
import org.apache.struts2.convention.annotation.Namespace;
|
||
|
|
||
|
import javax.sql.rowset.serial.SerialBlob;
|
||
|
import java.sql.SQLException;
|
||
|
|
||
|
/**
|
||
|
* @author 李进才
|
||
|
* @ClassName 慢病相关
|
||
|
* @Description TODO
|
||
|
* @date 2023/08/16 10:16:00
|
||
|
*/
|
||
|
|
||
|
|
||
|
@Slf4j
|
||
|
@Namespace("/chronic")
|
||
|
public class ChronicAction extends BaseAction {
|
||
|
|
||
|
@Action("upload")
|
||
|
public Result Upload(String applyName,String reserveTime,String patientId,String openId,String idcard,String treatId,Integer patientType,String diagProve,String idcardFont,String idcardBack,String inHospProve,String chronicName,String chronicCode,String phone,String address) throws SQLException {
|
||
|
log.info("[慢病预约] applyName-{}, reserveTime-{}, patientId-{}, openId-{}, idcard-{}, treatId-{}, patientType-{}, chronicName-{}, chronicCode-{}, phone-{}, address-{}",
|
||
|
applyName, reserveTime, patientId, openId, idcard, treatId, patientType, chronicName, chronicCode, phone, address);
|
||
|
if(applyName==null||patientId==null||openId==null||idcard==null||treatId==null||patientType==null){
|
||
|
return Result.error(ResultEnum.PARAM_IS_DEFECT);
|
||
|
}
|
||
|
if(new ChronicDao().selectIfApply(patientType,treatId)){
|
||
|
return Result.error(ResultEnum.APPLY_REPEAT);
|
||
|
}
|
||
|
Chronic chronic = new Chronic();
|
||
|
chronic.setApplyName(applyName);
|
||
|
chronic.setReserveTime(reserveTime);
|
||
|
chronic.setPatientId(patientId);
|
||
|
chronic.setOpenId(openId);
|
||
|
chronic.setIdcard(idcard);
|
||
|
chronic.setTreatId(treatId);
|
||
|
chronic.setPatientType(patientType);
|
||
|
chronic.setDiagProve(diagProve);
|
||
|
chronic.setIdcardFont(idcardFont);
|
||
|
chronic.setIdcardBack(idcardBack);
|
||
|
chronic.setInHospProve(inHospProve);
|
||
|
chronic.setChronicName(chronicName);
|
||
|
chronic.setChronicCode(chronicCode);
|
||
|
chronic.setPhone(phone);
|
||
|
chronic.setAddress(address);
|
||
|
if(new ChronicDao().insert(chronic)){
|
||
|
return Result.success();
|
||
|
}
|
||
|
return Result.error(ResultEnum.ERROR);
|
||
|
}
|
||
|
|
||
|
@Action("listByPatientId")
|
||
|
public Result ListByPatientId(String patientId){
|
||
|
log.info("[慢病预约]-获取列表 patientId-{}",patientId);
|
||
|
if(patientId==null){
|
||
|
return Result.error(ResultEnum.PARAM_IS_DEFECT);
|
||
|
}
|
||
|
return Result.success(new ChronicDao().selectByPatientId(patientId));
|
||
|
}
|
||
|
|
||
|
@Action("getChronicDict")
|
||
|
public Result getChronicDict(Integer chronicType){
|
||
|
if(chronicType==null){
|
||
|
return Result.error(ResultEnum.PARAM_IS_DEFECT);
|
||
|
}
|
||
|
return Result.success(new ChronicDao().selectDict(chronicType));
|
||
|
}
|
||
|
}
|