提交 01411f02 authored 作者: 杨凯's avatar 杨凯

feat:家庭医生初始化

上级 b7313e29
...@@ -48,7 +48,7 @@ public interface PatientSignService { ...@@ -48,7 +48,7 @@ public interface PatientSignService {
List<PatientSignEntity> selectList(PatientSignEntity patientSignEntity); List<PatientSignEntity> selectList(PatientSignEntity patientSignEntity);
PatientSignEntity getOneByPhone(String phone); List<PatientSignEntity> getListByPhone(String phone);
int updateById(PatientSignEntity patientSignEntity); int updateById(PatientSignEntity patientSignEntity);
......
...@@ -318,14 +318,14 @@ public class PatientSignServiceImpl implements PatientSignService { ...@@ -318,14 +318,14 @@ public class PatientSignServiceImpl implements PatientSignService {
} }
@Override @Override
public PatientSignEntity getOneByPhone(String phone) { public List<PatientSignEntity> getListByPhone(String phone) {
QueryWrapper<PatientSignEntity> psWrapper = new QueryWrapper<>(); QueryWrapper<PatientSignEntity> psWrapper = new QueryWrapper<>();
PatientSignEntity patientSign = new PatientSignEntity(); PatientSignEntity patientSign = new PatientSignEntity();
patientSign.setPatientPhone(phone); patientSign.setPatientPhone(phone);
psWrapper.setEntity(patientSign); psWrapper.setEntity(patientSign);
psWrapper.orderByDesc("createTime"); psWrapper.orderByDesc("createTime");
psWrapper.last("limit 1"); // psWrapper.last("limit 1");
PatientSignEntity pse = patientSignMapper.selectOne(psWrapper); List<PatientSignEntity> pse = patientSignMapper.selectList(psWrapper);
return pse; return pse;
} }
......
...@@ -8,6 +8,7 @@ import com.ebaiyihui.family.doctor.common.dto.SendImMsgDTO; ...@@ -8,6 +8,7 @@ import com.ebaiyihui.family.doctor.common.dto.SendImMsgDTO;
import com.ebaiyihui.family.doctor.server.common.constants.CommonConstants; import com.ebaiyihui.family.doctor.server.common.constants.CommonConstants;
import com.ebaiyihui.family.doctor.server.common.constants.ImConstants; import com.ebaiyihui.family.doctor.server.common.constants.ImConstants;
import com.ebaiyihui.family.doctor.server.common.enums.MsgTempTypeEnum; import com.ebaiyihui.family.doctor.server.common.enums.MsgTempTypeEnum;
import com.ebaiyihui.family.doctor.server.common.enums.SignStatus;
import com.ebaiyihui.family.doctor.server.common.enums.StatusEnum; import com.ebaiyihui.family.doctor.server.common.enums.StatusEnum;
import com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity; import com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity;
import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity; import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity;
...@@ -186,7 +187,7 @@ public class SignedTask { ...@@ -186,7 +187,7 @@ public class SignedTask {
} }
} }
@Scheduled(cron = "0 0 1 * * ?") @Scheduled(cron = "0 56 1 * * ?")
public void orderInvalidation() { public void orderInvalidation() {
log.info("开始进行权益信息处理..."); log.info("开始进行权益信息处理...");
List<MobileBenefitPackageEntity> mobileBenefitPackageEntities = mobileBenefitPackageMapper.queryMaxOneList(); List<MobileBenefitPackageEntity> mobileBenefitPackageEntities = mobileBenefitPackageMapper.queryMaxOneList();
...@@ -196,12 +197,15 @@ public class SignedTask { ...@@ -196,12 +197,15 @@ public class SignedTask {
for (MobileBenefitPackageEntity mbp : mobileBenefitPackageEntities) { for (MobileBenefitPackageEntity mbp : mobileBenefitPackageEntities) {
Date curTime = new Date(); Date curTime = new Date();
Date endTime = DateUtils.parseDate(mbp.getBenefitsEndTime(), DateUtils.FULL_FORMAT); Date endTime = DateUtils.parseDate(mbp.getBenefitsEndTime(), DateUtils.FULL_FORMAT);
PatientSignEntity patientSignEntity = patientSignSevice.getOneByPhone(mbp.getPhone()); List<PatientSignEntity> patientSignEntities = patientSignSevice.getListByPhone(mbp.getPhone());
mbp.setVersion(1); mbp.setVersion(1);
for (PatientSignEntity patientSignEntity : patientSignEntities) {
if (endTime.after(curTime)) { if (endTime.after(curTime)) {
patientSignEntity.setPackageOrderId(mbp.getActivateOrderId()); patientSignEntity.setPackageOrderId(mbp.getActivateOrderId());
patientSignEntity.setSignEndTime(endTime); patientSignEntity.setSignEndTime(endTime);
} else { } else {
if (SignStatus.SIGNED.getValue().equals(patientSignEntity.getSignStatus())
&& StatusEnum.IN_CONSULTATION.getValue().equals(patientSignEntity.getStatus())) {
patientSignEntity.setStatus(StatusEnum.FINISH_APPLY.getValue()); patientSignEntity.setStatus(StatusEnum.FINISH_APPLY.getValue());
MobileBenefitPackageEntity entity = mobileBenefitPackageMapper.queryByPhone(patientSignEntity.getPatientPhone(), MobileBenefitPackageEntity entity = mobileBenefitPackageMapper.queryByPhone(patientSignEntity.getPatientPhone(),
patientSignEntity.getPackageOrderId(), "1"); patientSignEntity.getPackageOrderId(), "1");
...@@ -219,7 +223,10 @@ public class SignedTask { ...@@ -219,7 +223,10 @@ public class SignedTask {
thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO, null); thirdOrderPushUtil.syncBenefitUsedOrder(notifyConsultDataDTO, null);
} }
} }
}
patientSignSevice.updateById(patientSignEntity); patientSignSevice.updateById(patientSignEntity);
}
mobileBenefitPackageMapper.updateVersion(mbp); mobileBenefitPackageMapper.updateVersion(mbp);
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论