Browse Source

JOB工程,相关问题修改

huangwenjie 7 years ago
parent
commit
78ba6fea97

+ 3 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDao.java

@ -1,7 +1,6 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
@ -22,4 +21,7 @@ public interface PrescriptionDao extends PagingAndSortingRepository<Prescription
    @Query("select p from Prescription p where p.jwCode=?1 and p.status=?2 ")
    List<Prescription> fingdByJwCodeAndStatus(String jwcode,Integer status);
    @Query(value = "select p.prescription_code from wlyy_prescription_pay p LEFT JOIN  wlyy_prescription a on a.code = p.prescription_code where p.trade_status = 1 and a.jw_pay_status = 0",nativeQuery = true)
    List<String> findCodesByPayStautsAndExecuteSickStatus();
}

+ 0 - 6
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionPayDao.java

@ -1,20 +1,14 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionPay;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by chenweida on 2017/7/27.
 */
public interface PrescriptionPayDao extends PagingAndSortingRepository<PrescriptionPay, Long>, JpaSpecificationExecutor<PrescriptionPay> {
    @Query("from PrescriptionPay p where p.prescriptionCode=?1 ")
    PrescriptionPay findByPrescriptionPay(String prescriptionCode);
    @Query(value = "select p.prescription_code from wlyy_prescription_pay p LEFT JOIN  wlyy_prescription a on a.code = p.prescription_code where p.trade_status = 1 and a.jw_pay_status = 0")
    List<String> findCodesByPayStautsAndExecuteSickStatus();
}

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

@ -17,9 +17,6 @@ public class PrescriptionService extends BaseService {
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Autowired
    private PrescriptionPayDao prescriptionPayDao;
    /**
     *  获取处方信息
     * @param prescriptionCode 处方code
@ -35,7 +32,7 @@ public class PrescriptionService extends BaseService {
     *@date 2017/8/17 19:27
     */
    public List<String> findCodesByPayStautsAndExecuteSickStatus() {
        return prescriptionPayDao.findCodesByPayStautsAndExecuteSickStatus();
        return prescriptionDao.findCodesByPayStautsAndExecuteSickStatus();
    }
}

+ 18 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/quota/JobController.java

@ -358,7 +358,7 @@ public class JobController extends BaseController {
     * @date 2017/8/12 15:35
     */
    @RequestMapping(value = "/reOrderExpress", method = RequestMethod.POST)
    @ApiOperation("添加超时咨询自动关闭任务")
    @ApiOperation("遍历顺丰快递下单失败的记录,重新下单")
    public String reOrderExpressJob() {
        try {
            quartzHelper.startNow(SFExpressJob.class, "SFEXPRESS-REORDER", null);
@ -390,5 +390,22 @@ public class JobController extends BaseController {
            return error(-1, e.getMessage());
        }
    }
    /**
     *遍历长处方支付成功但是院内结算失败的记录,重新执行院内结算
     *@author huangwenjie
     *@date 2017/8/18 14:16
     */
    @RequestMapping(value = "/executeSickSettleJob", method = RequestMethod.POST)
    @ApiOperation("遍历长处方支付成功但是院内结算失败的记录,重新执行院内结算")
    public String executeSickSettleJob() {
        try {
            quartzHelper.startNow(SFExpressJob.class, "ZY-SICK-SETTLE", null);
            return write(200, "");
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
    //******************************长处方 end********************************
}