trick9191 7 anos atrás
pai
commit
5befdc4f36

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDao.java

@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
/**
@ -20,6 +21,10 @@ public interface PrescriptionDao extends PagingAndSortingRepository<Prescription
    @Query("update Prescription p set p.status=?2 where p.code=?1")
    void updateStatus(String prescriptionCode,Integer status);
    @Modifying
    @Query("update Prescription p set p.status=?2 ,p.finishTime =?3 where p.code=?1")
    void updateStatus(String prescriptionCode, Integer status, Date date);
    @Query("select p from Prescription p where p.jwCode=?1 and p.status=?2 and p.patient=?3 ")
    List<Prescription> fingdByJwCodeAndStatus(String jwcode,Integer status,String patient);
    //根据处方code得到患者信息

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/express/SFExpressService.java

@ -333,7 +333,7 @@ public class SFExpressService extends BaseService {
            //如果路由信息节点包含了"已收件"节点,这修改处方派送状态为完成,增加物流派送日志为完成
            if(isContainEndRoutInfo){
                //修改处方状态为完成
                prescriptionDao.updateStatus(sfexpress_obj.getPrescriptionCode(), PrescriptionLog.PrescriptionLogStatus.finish.getValue());
                prescriptionDao.updateStatus(sfexpress_obj.getPrescriptionCode(), PrescriptionLog.PrescriptionLogStatus.finish.getValue(),new Date());
                //保存配送成功的日志
                PrescriptionLog prescriptionLog = new PrescriptionLog();
@ -459,7 +459,7 @@ public class SFExpressService extends BaseService {
            //如果路由信息节点包含了"已收件"节点,则修改处方状态为完成,增加物流派送日志为完成
            if(isContainEndRoutInfo){
                //修改处方状态为完成
                prescriptionDao.updateStatus(sfexpress.getPrescriptionCode(), PrescriptionLog.PrescriptionLogStatus.finish.getValue());
                prescriptionDao.updateStatus(sfexpress.getPrescriptionCode(), PrescriptionLog.PrescriptionLogStatus.finish.getValue(),new Date());
                //保存配送成功的日志
                PrescriptionLog prescriptionLog = new PrescriptionLog();

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

@ -121,7 +121,7 @@ public class PrescriptionService extends BaseService {
            if (type == 1){
                //直接更改状态为已完成
                prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
                prescription.setFinishTime(new Date());
            }else if (type == 2){
                //不更改状态只添加延长收药时间
                int extendCount = prescription.getExtendCount();

+ 6 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/pc/prescription/PrescriptionExpressagePCService.java

@ -286,7 +286,7 @@ public class PrescriptionExpressagePCService extends BaseService {
        switch (prescriptionDispensaryCode.getType()) {
            case 1: {
                //判断是1 居民取药码
                dispensaryCode_1(userCode, prescriptionDispensaryCode);
                dispensaryCode_1(prescription,userCode, prescriptionDispensaryCode);
                break;
            }
            case 2: {
@ -317,10 +317,13 @@ public class PrescriptionExpressagePCService extends BaseService {
     * @param prescriptionDispensaryCode
     * @return
     */
    public void dispensaryCode_1(String userCode, PrescriptionDispensaryCode prescriptionDispensaryCode) {
    public void dispensaryCode_1(Prescription prescription ,String userCode, PrescriptionDispensaryCode prescriptionDispensaryCode) {
        //修改处方状态为完成
        prescriptionDao.updateStatus(prescriptionDispensaryCode.getPrescriptionCode(), PrescriptionLog.PrescriptionLogStatus.finish.getValue());
        //prescriptionDao.updateStatus(prescriptionDispensaryCode.getPrescriptionCode(), PrescriptionLog.PrescriptionLogStatus.finish.getValue());
        prescription.setFinishTime(new Date());
        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
        prescriptionDao.save(prescription);
        //保存配送成功的日志
        PrescriptionLog prescriptionLog = new PrescriptionLog();