|
@ -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.common.util.StringUtil;
|
|
import com.yihu.wlyy.sign.dao.*;
|
|
import com.yihu.wlyy.sign.dao.*;
|
|
import com.yihu.wlyy.sign.entity.*;
|
|
import com.yihu.wlyy.sign.entity.*;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.PrintWriter;
|
|
import java.io.PrintWriter;
|
|
import java.io.StringWriter;
|
|
import java.io.StringWriter;
|
|
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@ -121,16 +123,62 @@ public class ChargeZYService {
|
|
params.put("IDENTITY_CARD_NO", idcard); //身份证
|
|
params.put("IDENTITY_CARD_NO", idcard); //身份证
|
|
params.put("SIGN_MANAGE_YEAR", year); //签约年度
|
|
params.put("SIGN_MANAGE_YEAR", year); //签约年度
|
|
params.put("SICK_NAME", patient.getName()); //姓名
|
|
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()); //医保签约号
|
|
params.put("INSUR_PRO_ID", charge.getMiRegisterNo()); //医保签约号
|
|
|
|
|
|
|
|
|
|
if("1".equals(sign.getRenewFlag())||"2".equals(sign.getRenewFlag())){
|
|
if("1".equals(sign.getRenewFlag())||"2".equals(sign.getRenewFlag())){
|
|
proId = signFamilyRenewLogDao.getProId(signCode);
|
|
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 {
|
|
}else {
|
|
proId = signFamilyMappingDao.getProId(signCode);
|
|
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); //标志(智业签约主键)
|
|
params.put("PRO_ID", proId); //标志(智业签约主键)
|
|
|
|
|
|
operator = doctorMappingDao.findByDocotrCodeAndJwDoctorHospital(operator,hm[0]); //【医生映射】
|
|
operator = doctorMappingDao.findByDocotrCodeAndJwDoctorHospital(operator,hm[0]); //【医生映射】
|
|
@ -160,6 +208,7 @@ public class ChargeZYService {
|
|
if(isSuccess)
|
|
if(isSuccess)
|
|
{
|
|
{
|
|
charge.setNeedUpload("0");
|
|
charge.setNeedUpload("0");
|
|
|
|
signFamilyDao.save(sign);
|
|
}else {
|
|
}else {
|
|
charge.setNeedUpload("2");
|
|
charge.setNeedUpload("2");
|
|
content = objectMapper.writeValueAsString(charge);
|
|
content = objectMapper.writeValueAsString(charge);
|