瀏覽代碼

家庭签约支付上传接口修改

huangwenjie 7 年之前
父節點
當前提交
eff8e4d5f7

+ 2 - 2
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/common/thread/UploadChargeThread.java

@ -29,7 +29,7 @@ public class UploadChargeThread implements Runnable{
                {
                    Boolean running = systemDictService.getUploadChargeRunning();
                    if(running) {
                        System.out.print(DateUtil.dateToStrLong(now) + " 上传缴费...\r\n");
//                        System.out.print(DateUtil.dateToStrLong(now) + " 上传缴费...\r\n");
                        try {
                            service.uploadCharge();
                        }
@ -38,7 +38,7 @@ public class UploadChargeThread implements Runnable{
                            e.printStackTrace();
                        }
                        System.out.print(DateUtil.dateToStrLong(new Date()) + " 上传缴费记录结束。\r\n");
//                        System.out.print(DateUtil.dateToStrLong(new Date()) + " 上传缴费记录结束。\r\n");
                    }
                    Thread.sleep(sleepTime);

+ 5 - 5
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/common/thread/UploadThread.java

@ -30,8 +30,8 @@ public class UploadThread implements Runnable {
                Date now = new Date();
                //判断非空闲时候
                if(now.getHours()>=morningHours &&  now.getHours() < nightHours)
                {
//                if(now.getHours()>=morningHours &&  now.getHours() < nightHours)---2017.11.15修改为不判断空闲非空闲
//                {
                    //签约上传
                    SignZYService signZYService = (SignZYService) SpringContextHolder.getSpringBean("SignZYService");
                    SystemDictService systemDictService = (SystemDictService) SpringContextHolder.getSpringBean("SystemDictService");
@ -56,9 +56,9 @@ public class UploadThread implements Runnable {
                        Thread.sleep(retryTime);
                        continue;
                    }
                }
                Thread.sleep(1000*sleepTime);
//                }
//
//                Thread.sleep(1000*sleepTime);
            }
            catch (Exception ex)
            {

+ 2 - 0
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/dao/SignFamilyRenewLogDao.java

@ -23,6 +23,8 @@ public interface SignFamilyRenewLogDao extends PagingAndSortingRepository<SignFa
    SignFamilyRenewLog findByProId(String proId);
    SignFamilyRenewLog findByRenewProId(String renewProId);
    
    SignFamilyRenewLog findBySignCode(String signCode);
    SignFamilyRenewLog findByRenewSignCode(String renewSignCode);

+ 50 - 1
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/ChargeZYService.java

@ -6,11 +6,13 @@ import com.yihu.wlyy.sign.common.util.DateUtil;
import com.yihu.wlyy.sign.common.util.StringUtil;
import com.yihu.wlyy.sign.dao.*;
import com.yihu.wlyy.sign.entity.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -121,16 +123,62 @@ public class ChargeZYService {
                params.put("IDENTITY_CARD_NO", idcard);  //身份证
                params.put("SIGN_MANAGE_YEAR", year);  //签约年度
                params.put("SICK_NAME", patient.getName());  //姓名
                params.put("CHARGE_TIME", DateUtil.dateToStrLong(sign.getExpensesTime()));  //缴费时间
                
                if(sign.getExpensesTime() == null){
                    //如果签约表的支付时间为空,则从支付表获取支付时间
                    Date newdate = DateUtil.formatCharDateYMD(charge.getChargeTime(),"yyyyMMddHHmmss");
                    params.put("CHARGE_TIME", DateUtil.dateToStrLong(newdate));  //缴费时间
                    sign.setExpensesTime(newdate);
                    sign.setExpensesStatus("1");//已支付
                }else{
                    params.put("CHARGE_TIME", DateUtil.dateToStrLong(sign.getExpensesTime()));  //缴费时间
                }
                
               
                params.put("INSUR_PRO_ID", charge.getMiRegisterNo());  //医保签约号
                if("1".equals(sign.getRenewFlag())||"2".equals(sign.getRenewFlag())){
                    proId = signFamilyRenewLogDao.getProId(signCode);
                    if(StringUtils.isBlank(proId) || "0".equals(proId)){
                        
                        if("1".equals(sign.getSignSource())){
                            //如果是在基卫签约则需要更新同步
                            SignFamilyMapping signFamilyMapping = signFamilyMappingDao.findByCode(signCode);
                            signFamilyMapping.setNeedUpdate("1");
                            signFamilyMappingDao.save(signFamilyMapping);
                        }else{
                            //如果是网络签约则需要上传同步
                            SignFamilyRenewLog signFamilyRenewLog = signFamilyRenewLogDao.findBySignCode(signCode);
                            signFamilyRenewLog.setNeedUpload("1");
                            signFamilyRenewLogDao.save(signFamilyRenewLog);
                        }
    
                        //暂停30秒
                        Thread.sleep(30000);
                        return true;
                    }
                }else {
                    proId = signFamilyMappingDao.getProId(signCode);
                    if(StringUtils.isBlank(proId) || "0".equals(proId)){
    
                        SignFamilyMapping signFamilyMapping = signFamilyMappingDao.findByCode(signCode);
                        if("1".equals(sign.getSignSource())){
                            //如果是在基卫签约则需要更新同步
                            signFamilyMapping.setNeedUpdate("1");
                        }else{
                            //如果是网络签约则需要上传同步
                            signFamilyMapping.setNeedUpload("1");
                        }
                        signFamilyMappingDao.save(signFamilyMapping);
    
                        //暂停30秒
                        Thread.sleep(30000);
                        return true;
                    }
                }
                params.put("PRO_ID", proId);  //标志(智业签约主键)
                operator = doctorMappingDao.findByDocotrCodeAndJwDoctorHospital(operator,hm[0]);  //【医生映射】
@ -160,6 +208,7 @@ public class ChargeZYService {
                if(isSuccess)
                {
                    charge.setNeedUpload("0");
                    signFamilyDao.save(sign);
                }else {
                    charge.setNeedUpload("2");
                    content = objectMapper.writeValueAsString(charge);

+ 18 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/reply/DoctorQuickReplyService.java

@ -164,17 +164,29 @@ public class DoctorQuickReplyService extends BaseService {
     * 排序回复
     *
     * @param id
     * @param type
     * @return
     */
    public int sortReplyList(String id) {
    public int sortReplyList(String id,String type) {
        String[] ids = id.split(",");
        for (int i = 0; i < ids.length; i++) {
            DoctorQuickReply reply = quickReplyDao.findOne(Long.valueOf(ids[i]));
            if (reply == null) {
                return -1;
        if("1".equals(type)){
            for (int i = ids.length; i > ids.length; i--) {
                DoctorQuickReply reply = quickReplyDao.findOne(Long.valueOf(ids[i]));
                if (reply == null) {
                    return -1;
                }
                reply.setSort(i);
            }
        }else{
            for (int i = 0; i < ids.length; i++) {
                DoctorQuickReply reply = quickReplyDao.findOne(Long.valueOf(ids[i]));
                if (reply == null) {
                    return -1;
                }
                reply.setSort(ids.length - i);
            }
            reply.setSort(ids.length - i);
        }
        return 1;
    }
}

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

@ -131,13 +131,15 @@ public class DoctorQuickReplyController extends BaseController {
    @RequestMapping(value = "/sortList", method = RequestMethod.POST)
    @ApiOperation(value = "快捷回复排序")
    public String sortReplyList(@RequestParam @ApiParam(value = "快捷回复ID")String id) {
    public String sortReplyList(@RequestParam @ApiParam(value = "快捷回复ID")String id,
                                @ApiParam(name = "type", value = "快捷回复类型(1为续方咨询)", defaultValue = "0")
                                @RequestParam(value = "type", required = false, defaultValue = "0") String type) {
        try {
            if (StringUtils.isEmpty(id)) {
                return error(-1, "请输入排序后的回复ID");
            }
            int result = quickReplyService.sortReplyList(id);
            int result = quickReplyService.sortReplyList(id,type);
            if (result == 1) {
                return write(200, "排序成功");