|
@ -25,6 +25,9 @@ import org.springframework.web.client.RestTemplate; |
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
import java.io.File; |
|
|
import java.io.File; |
|
|
import java.io.FileOutputStream; |
|
|
import java.io.FileOutputStream; |
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
import java.nio.file.Files; |
|
|
|
|
|
import java.nio.file.StandardCopyOption; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
|
|
|
|
import java.util.*; |
|
|
import java.util.*; |
|
@ -91,6 +94,8 @@ public class ProcessScheduled { |
|
|
private KpssProcessNode6IdInfo kpssProcessNode6IdInfo; |
|
|
private KpssProcessNode6IdInfo kpssProcessNode6IdInfo; |
|
|
@Value("${ypt.htqxid}") |
|
|
@Value("${ypt.htqxid}") |
|
|
private String htqxid; |
|
|
private String htqxid; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private MailService mailService; |
|
|
private String[] industry = {"政党机关","公检法司","交通运输","医疗卫生","文体教育","农林牧渔", |
|
|
private String[] industry = {"政党机关","公检法司","交通运输","医疗卫生","文体教育","农林牧渔", |
|
|
"通信电信","水利水电","航空航天","石油化工","环保绿化","海洋气象","金融保险","科研技术","商业服务","军队"}; |
|
|
"通信电信","水利水电","航空航天","石油化工","环保绿化","海洋气象","金融保险","科研技术","商业服务","军队"}; |
|
|
/** |
|
|
/** |
|
@ -145,7 +150,6 @@ public class ProcessScheduled { |
|
|
if ("ZJ".equals(qy)){ |
|
|
if ("ZJ".equals(qy)){ |
|
|
sendKpqrsrToYunPingtai(item,headers); |
|
|
sendKpqrsrToYunPingtai(item,headers); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//开票确认到账
|
|
|
//开票确认到账
|
|
|
}else if (interfaceType==3&& "ZJ".equals(item.getQy())){ |
|
|
}else if (interfaceType==3&& "ZJ".equals(item.getQy())){ |
|
|
sendKpqrdzToYunPingtai(item,headers); |
|
|
sendKpqrdzToYunPingtai(item,headers); |
|
@ -176,6 +180,12 @@ public class ProcessScheduled { |
|
|
//把查到的数据按次序更新或新增到北京
|
|
|
//把查到的数据按次序更新或新增到北京
|
|
|
sendXmList.forEach(iteam -> { |
|
|
sendXmList.forEach(iteam -> { |
|
|
iteam.setProjectDescription(null);//项目描述非必填项
|
|
|
iteam.setProjectDescription(null);//项目描述非必填项
|
|
|
|
|
|
String projectManagerCode = iteam.getProjectManagerCode();//特殊工号处理
|
|
|
|
|
|
if("0519039".equals(projectManagerCode)){ |
|
|
|
|
|
iteam.setProjectManagerCode("A300019"); |
|
|
|
|
|
} else if ("0520021".equals(projectManagerCode)) { |
|
|
|
|
|
iteam.setProjectManagerCode("052002"); |
|
|
|
|
|
} |
|
|
List<String> list = Arrays.asList(industry); |
|
|
List<String> list = Arrays.asList(industry); |
|
|
String projectIndustry = iteam.getProjectIndustry(); |
|
|
String projectIndustry = iteam.getProjectIndustry(); |
|
|
if(!list.contains(projectIndustry)){ |
|
|
if(!list.contains(projectIndustry)){ |
|
@ -211,6 +221,9 @@ public class ProcessScheduled { |
|
|
sendXmLambdaUpdateWrapper.eq(SendXm::getId,iteam.getId()); |
|
|
sendXmLambdaUpdateWrapper.eq(SendXm::getId,iteam.getId()); |
|
|
sendXmLambdaUpdateWrapper.set(SendXm::getErrormessage,responseData.getMessage().toString()); |
|
|
sendXmLambdaUpdateWrapper.set(SendXm::getErrormessage,responseData.getMessage().toString()); |
|
|
sendXmMapper.update(null, sendXmLambdaUpdateWrapper); |
|
|
sendXmMapper.update(null, sendXmLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn" |
|
|
|
|
|
,"云平台新增项目失败,projectId是" + iteam.getProjectId() + " id是" + iteam.getId() |
|
|
|
|
|
,"返回的信息是" + responseData.toString()); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -227,6 +240,9 @@ public class ProcessScheduled { |
|
|
sendXmLambdaUpdateWrapper.eq(SendXm::getId,iteam.getId()); |
|
|
sendXmLambdaUpdateWrapper.eq(SendXm::getId,iteam.getId()); |
|
|
sendXmLambdaUpdateWrapper.set(SendXm::getErrormessage,"云平台编号为空"); |
|
|
sendXmLambdaUpdateWrapper.set(SendXm::getErrormessage,"云平台编号为空"); |
|
|
sendXmMapper.update(null, sendXmLambdaUpdateWrapper); |
|
|
sendXmMapper.update(null, sendXmLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn" |
|
|
|
|
|
,"云平台更新项目失败,projectId是" + iteam.getProjectId() + " id是" + iteam.getId() |
|
|
|
|
|
,"云平台编号为空"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
String name = iteam.getProjectNo()+"*"+iteam.getProjectName(); |
|
|
String name = iteam.getProjectNo()+"*"+iteam.getProjectName(); |
|
@ -251,6 +267,9 @@ public class ProcessScheduled { |
|
|
sendXmLambdaUpdateWrapper.eq(SendXm::getId,iteam.getId()); |
|
|
sendXmLambdaUpdateWrapper.eq(SendXm::getId,iteam.getId()); |
|
|
sendXmLambdaUpdateWrapper.set(SendXm::getErrormessage,responseData.getMessage().toString()); |
|
|
sendXmLambdaUpdateWrapper.set(SendXm::getErrormessage,responseData.getMessage().toString()); |
|
|
sendXmMapper.update(null, sendXmLambdaUpdateWrapper); |
|
|
sendXmMapper.update(null, sendXmLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn" |
|
|
|
|
|
,"云平台更新项目失败,projectId是" + iteam.getProjectId() + " id是" + iteam.getId() |
|
|
|
|
|
,"返回的信息是" + responseData.toString()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
@ -262,6 +281,9 @@ public class ProcessScheduled { |
|
|
if("邀请招标".equals(winningBidWay)){ |
|
|
if("邀请招标".equals(winningBidWay)){ |
|
|
item.setWinningBidWay("内部邀请"); |
|
|
item.setWinningBidWay("内部邀请"); |
|
|
} |
|
|
} |
|
|
|
|
|
if("询比采购".equals(winningBidWay)){ |
|
|
|
|
|
item.setWinningBidWay("公开招标"); |
|
|
|
|
|
} |
|
|
//用项目id 查询项目金额
|
|
|
//用项目id 查询项目金额
|
|
|
HashMap<String,String> hashMap = new HashMap<>(); |
|
|
HashMap<String,String> hashMap = new HashMap<>(); |
|
|
String requestid = item.getRequestid(); |
|
|
String requestid = item.getRequestid(); |
|
@ -287,17 +309,28 @@ public class ProcessScheduled { |
|
|
if (contractAmount.compareTo(amt)!=0){ |
|
|
if (contractAmount.compareTo(amt)!=0){ |
|
|
//更新数据需要所有字段都有值,所以去查最新的一笔更新记录,改一下合同金额
|
|
|
//更新数据需要所有字段都有值,所以去查最新的一笔更新记录,改一下合同金额
|
|
|
List<SendXm> sendXms = sendXmMapper.querySendXmByProjectId(item.getProjectId()); |
|
|
List<SendXm> sendXms = sendXmMapper.querySendXmByProjectId(item.getProjectId()); |
|
|
SendXm sendXm = sendXms.get(0);//得到最新的一条已修改记录
|
|
|
|
|
|
sendXm.setContractAmount(contractAmount);//修改金额
|
|
|
try { |
|
|
sendXm.setProjectNo(item.getProjectNo());//修改项目编号
|
|
|
if (sendXms.size() >= 0) { |
|
|
HttpEntity<SendXm> request = new HttpEntity<>(sendXm, headers); |
|
|
SendXm sendXm = sendXms.get(0);//得到最新的一条已修改记录
|
|
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(projectUrl, request, ResponseBeanForBeiJing.class); |
|
|
sendXm.setContractAmount(contractAmount);//修改金额
|
|
|
if ("200".equals(responseData.getCode())) { |
|
|
sendXm.setProjectNo(item.getProjectNo());//修改项目编号
|
|
|
log.info("更新项目金额到云平台成功"); |
|
|
HttpEntity<SendXm> request = new HttpEntity<>(sendXm, headers); |
|
|
log.info(responseData.toString()); |
|
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(projectUrl, request, ResponseBeanForBeiJing.class); |
|
|
} else { |
|
|
if ("200".equals(responseData.getCode())) { |
|
|
log.info("更新项目金额失败,projectId是" + sendXm.getProjectId() + " id是" + sendXm.getId()); |
|
|
log.info("更新项目金额到云平台成功"); |
|
|
log.info("返回的信息是" + responseData.toString()); |
|
|
log.info(responseData.toString()); |
|
|
|
|
|
} else { |
|
|
|
|
|
log.info("更新项目金额失败,projectId是" + sendXm.getProjectId() + " id是" + sendXm.getId()); |
|
|
|
|
|
log.info("返回的信息是" + responseData.toString()); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"云平台合同更新项目金额失败,projectId是" + sendXm.getProjectId() + " id是" + sendXm.getId() |
|
|
|
|
|
, "返回的信息是" + responseData.toString()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception e){ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//0表示新增,要传到北京
|
|
|
//0表示新增,要传到北京
|
|
@ -329,6 +362,9 @@ public class ProcessScheduled { |
|
|
sendHtLambdaUpdateWrapper.eq(SendHt::getId, item.getId());//更新条件
|
|
|
sendHtLambdaUpdateWrapper.eq(SendHt::getId, item.getId());//更新条件
|
|
|
sendHtLambdaUpdateWrapper.set(SendHt::getErrormessage,responseData.getMessage().toString());//更新的值
|
|
|
sendHtLambdaUpdateWrapper.set(SendHt::getErrormessage,responseData.getMessage().toString());//更新的值
|
|
|
sendHtMapper.update(null, sendHtLambdaUpdateWrapper); |
|
|
sendHtMapper.update(null, sendHtLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"云平台新增合同失败,projectId是" + item.getContractId() + " id是" + item.getId() |
|
|
|
|
|
,"返回的信息是" + responseData.toString()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//修改
|
|
|
//修改
|
|
@ -365,6 +401,9 @@ public class ProcessScheduled { |
|
|
sendHtLambdaUpdateWrapper.eq(SendHt::getId, item.getId());//更新条件
|
|
|
sendHtLambdaUpdateWrapper.eq(SendHt::getId, item.getId());//更新条件
|
|
|
sendHtLambdaUpdateWrapper.set(SendHt::getErrormessage,responseData.getMessage().toString());//更新的值
|
|
|
sendHtLambdaUpdateWrapper.set(SendHt::getErrormessage,responseData.getMessage().toString());//更新的值
|
|
|
sendHtMapper.update(null, sendHtLambdaUpdateWrapper); |
|
|
sendHtMapper.update(null, sendHtLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"云平台更新合同失败,projectId是" + item.getContractId() + " id是" + item.getId() |
|
|
|
|
|
,"返回的信息是" + responseData.toString()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
@ -390,18 +429,25 @@ public class ProcessScheduled { |
|
|
} |
|
|
} |
|
|
if("信息技术咨询监理服务费".equals(sendKpxx.getInvoiceContent())){ |
|
|
if("信息技术咨询监理服务费".equals(sendKpxx.getInvoiceContent())){ |
|
|
sendKpxx.setInvoiceContent("监理咨询服务费"); |
|
|
sendKpxx.setInvoiceContent("监理咨询服务费"); |
|
|
|
|
|
} else if ("信息监理运维服务费".equals(sendKpxx.getInvoiceContent())) { |
|
|
|
|
|
sendKpxx.setInvoiceContent("运维监理服务费"); |
|
|
} |
|
|
} |
|
|
if(StringUtils.isBlank(sendKpxx.getPayerNumber())){ |
|
|
if(StringUtils.isBlank(sendKpxx.getPayerNumber())){ |
|
|
sendKpxx.setPayerNumber("/"); |
|
|
sendKpxx.setPayerNumber("/"); |
|
|
} |
|
|
} |
|
|
|
|
|
// sendKpxx.setApplyUserCode("0519999");
|
|
|
sendKpxx.setReceiptScheduleName(null); |
|
|
sendKpxx.setReceiptScheduleName(null); |
|
|
//新增
|
|
|
//新增
|
|
|
String[] evidenceIds = sendKpxx.getEvidenceId().split(",");//获取文件id组
|
|
|
if(sendKpxx.getEvidenceId()!=null){ |
|
|
String evidenceid= sendfpfielUpdown(headers,evidenceIds);//上传文件信息
|
|
|
String[] evidenceIds = sendKpxx.getEvidenceId().split(",");//获取文件id组
|
|
|
|
|
|
String evidenceid= sendfpfielUpdown(headers,evidenceIds);//上传文件信息
|
|
|
// if()
|
|
|
// if()
|
|
|
if(evidenceid.length()>0){ |
|
|
if(evidenceid.length()>0){ |
|
|
evidenceid=evidenceid.substring(0,evidenceid.length()-1); |
|
|
evidenceid=evidenceid.substring(0,evidenceid.length()-1); |
|
|
|
|
|
} |
|
|
|
|
|
sendKpxx.setEvidenceId(evidenceid); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//因为会驳回,驳回后在提交就是修改状态,查询是否有退回记录,如果有要重新提交
|
|
|
//因为会驳回,驳回后在提交就是修改状态,查询是否有退回记录,如果有要重新提交
|
|
|
if(sendKpxx.getOperatetype()==1){ |
|
|
if(sendKpxx.getOperatetype()==1){ |
|
|
LambdaQueryWrapper<SendKpxx> sendKpxxLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<SendKpxx> sendKpxxLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
@ -437,19 +483,34 @@ public class ProcessScheduled { |
|
|
String fplx = hashMapScKpsqsp.get("fplx"); |
|
|
String fplx = hashMapScKpsqsp.get("fplx"); |
|
|
String fpzl = hashMapScKpsqsp.get("fpzl"); |
|
|
String fpzl = hashMapScKpsqsp.get("fpzl"); |
|
|
//发票种类如果是电子发票
|
|
|
//发票种类如果是电子发票
|
|
|
if("2c9a59b680e0190f0181224a7a76045a".equals(fpzl)){ |
|
|
if("2c9a59b680e0190f0181224a7a76045a".equals(fpzl)&&"增值税普通发票".equals(sendKpxx.getInvoiceType())){ |
|
|
sendKpxx.setInvoiceType("增值税电子普通发票"); |
|
|
sendKpxx.setInvoiceType("增值税电子普通发票"); |
|
|
|
|
|
}else if("2c9a59b680e0190f0181224a5c740459".equals(fpzl)&&"数电专用发票".equals(sendKpxx.getInvoiceType())){ |
|
|
|
|
|
sendKpxx.setInvoiceType("增值税专用发票"); |
|
|
|
|
|
} |
|
|
|
|
|
String specialInfo = sendKpxx.getSpecialInfo(); |
|
|
|
|
|
if(specialInfo==null){ |
|
|
|
|
|
specialInfo=""; |
|
|
|
|
|
} |
|
|
|
|
|
String dz = ""; |
|
|
|
|
|
String dh = ""; |
|
|
|
|
|
String zh = ""; |
|
|
|
|
|
String khx =""; |
|
|
|
|
|
if(hashMapScKpsqsp.get("dz")!=null){ |
|
|
|
|
|
dz = hashMapScKpsqsp.get("dz"); |
|
|
|
|
|
} |
|
|
|
|
|
if(hashMapScKpsqsp.get("dh")!=null){ |
|
|
|
|
|
dh = hashMapScKpsqsp.get("dh"); |
|
|
} |
|
|
} |
|
|
if("2c9adae478fdbe15017906eca5710259".equals(fplx)){ |
|
|
if(hashMapScKpsqsp.get("zh")!=null){ |
|
|
String dz = hashMapScKpsqsp.get("dz"); |
|
|
zh = hashMapScKpsqsp.get("zh"); |
|
|
String dh = hashMapScKpsqsp.get("dh"); |
|
|
|
|
|
String zh = hashMapScKpsqsp.get("zh"); |
|
|
|
|
|
String khx = hashMapScKpsqsp.get("khx"); |
|
|
|
|
|
String specialInfo= "开户行:"+khx+" ,账号:"+zh+" ,地址及电话:"+dz+dh; |
|
|
|
|
|
sendKpxx.setSpecialInfo(specialInfo); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
if(hashMapScKpsqsp.get("khx")!=null){ |
|
|
|
|
|
khx = hashMapScKpsqsp.get("khx"); |
|
|
|
|
|
} |
|
|
|
|
|
specialInfo+= "。开户行:"+khx+" ,账号:"+zh+" ,地址及电话:"+dz+dh; |
|
|
|
|
|
sendKpxx.setSpecialInfo(specialInfo); |
|
|
headers.setContentType(MediaType.APPLICATION_JSON); |
|
|
headers.setContentType(MediaType.APPLICATION_JSON); |
|
|
sendKpxx.setEvidenceId(evidenceid); |
|
|
|
|
|
String xsfzr =""; |
|
|
String xsfzr =""; |
|
|
//退票要先删掉原来的到账信息
|
|
|
//退票要先删掉原来的到账信息
|
|
|
String projectid = sendKpxx.getProjectNo();//项目编号,其他的是云平台编号
|
|
|
String projectid = sendKpxx.getProjectNo();//项目编号,其他的是云平台编号
|
|
@ -467,7 +528,14 @@ public class ProcessScheduled { |
|
|
sendKpxx.setProjectNo(yptbh); |
|
|
sendKpxx.setProjectNo(yptbh); |
|
|
if(yptbh ==null){ |
|
|
if(yptbh ==null){ |
|
|
log.info("开票申请更新项目西悉尼更新失败,projectId是" + iteam.getProjectId()); |
|
|
log.info("开票申请更新项目西悉尼更新失败,projectId是" + iteam.getProjectId()); |
|
|
log.info("云平台编号为空" ); |
|
|
log.info("项目开票云平台编号为空" ); |
|
|
|
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, "项目开票云平台编号为空");//更新的值
|
|
|
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"新增退票开票信息失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"项目开票云平台编号为空" ); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
String name = iteam.getProjectNo()+"*"+iteam.getProjectName(); |
|
|
String name = iteam.getProjectNo()+"*"+iteam.getProjectName(); |
|
@ -485,6 +553,22 @@ public class ProcessScheduled { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
if(sendKpxx.getIsReturn()==1){ |
|
|
if(sendKpxx.getIsReturn()==1){ |
|
|
|
|
|
String requestid = sendKpxx.getRequestid(); |
|
|
|
|
|
HashMap<String, String> hashMap = otherMapper.selectScKpsqsp_tuipiao_yptbh(requestid).get(0); |
|
|
|
|
|
if(hashMap==null||hashMap.get("yptbh")==null) { |
|
|
|
|
|
log.info("退票发票信息为空"); |
|
|
|
|
|
log.info("新增退票开票信息失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId()); |
|
|
|
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, "退票发票云平台编号为空");//更新的值
|
|
|
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"新增退票开票信息失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"退票发票云平台编号为空" ); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
String yptbh = hashMap.get("yptbh"); |
|
|
|
|
|
sendKpxx.setInvoiceNo(yptbh); |
|
|
deleteFpdzrq(headers,sendKpxx); |
|
|
deleteFpdzrq(headers,sendKpxx); |
|
|
if(sendKpxx.getInvoiceNo()==null){ |
|
|
if(sendKpxx.getInvoiceNo()==null){ |
|
|
log.info("退票发票发票编号不能为空"); |
|
|
log.info("退票发票发票编号不能为空"); |
|
@ -493,9 +577,11 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, "退票发票发票编号不能为空");//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, "退票发票发票编号不能为空");//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"新增退票开票信息失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"退票发票发票编号不能为空" ); |
|
|
} |
|
|
} |
|
|
headers.setContentType(MediaType.APPLICATION_JSON); |
|
|
headers.setContentType(MediaType.APPLICATION_JSON); |
|
|
sendKpxx.setEvidenceId(evidenceid); |
|
|
|
|
|
sendKpxx.setReturnInvoiceNo(sendKpxx.getInvoiceNo()); |
|
|
sendKpxx.setReturnInvoiceNo(sendKpxx.getInvoiceNo()); |
|
|
HttpEntity<SendKpxx> request = new HttpEntity<>(sendKpxx, headers); |
|
|
HttpEntity<SendKpxx> request = new HttpEntity<>(sendKpxx, headers); |
|
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(invoiceUrl,request, ResponseBeanForBeiJing.class); |
|
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(invoiceUrl,request, ResponseBeanForBeiJing.class); |
|
@ -503,7 +589,16 @@ public class ProcessScheduled { |
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, 1);//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, 1);//更新的值
|
|
|
|
|
|
if(sendKpxx.getOperatetype()==1){ |
|
|
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getOperatetype, 0);//更新的值符合查询条件
|
|
|
|
|
|
} |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
Map dataMap = (Map) responseData.getData(); |
|
|
|
|
|
String invoiceNo = dataMap.get("invoiceNo").toString(); |
|
|
|
|
|
HashMap<String, String> paramMap = new HashMap<>(); |
|
|
|
|
|
paramMap.put("yptbh", invoiceNo); |
|
|
|
|
|
paramMap.put("id", sendKpxx.getRequestid()); |
|
|
|
|
|
otherMapper.updateScKpsqsp_yptbh_Byid(paramMap);//把返回的项目编号存入Sc_kssqsp
|
|
|
log.info("新增退票开票信息到云平台成功"); |
|
|
log.info("新增退票开票信息到云平台成功"); |
|
|
log.info(responseData.toString()); |
|
|
log.info(responseData.toString()); |
|
|
} else { |
|
|
} else { |
|
@ -513,6 +608,9 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"新增退票开票信息失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"返回的信息是" + responseData.toString()); |
|
|
} |
|
|
} |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
@ -541,12 +639,15 @@ public class ProcessScheduled { |
|
|
} else { |
|
|
} else { |
|
|
log.info("新增开票信息失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId()); |
|
|
log.info("新增开票信息失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId()); |
|
|
log.error("返回的信息是" + responseData.toString()); |
|
|
log.error("返回的信息是" + responseData.toString()); |
|
|
|
|
|
log.info("项目编号是"+sendKpxx.toString()); |
|
|
//记录错误信息
|
|
|
//记录错误信息
|
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getRequestid, sendKpxx.getRequestid());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getRequestid, sendKpxx.getRequestid());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"新增开票信息失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"返回的信息是" + responseData.toString()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// //修改
|
|
|
// //修改
|
|
@ -601,6 +702,9 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, "发票发票编号不能为空");//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, "发票发票编号不能为空");//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"开票收入报错,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"发票发票编号不能为空"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -614,6 +718,9 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, beanForBeiJing.getMessage().toString());//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, beanForBeiJing.getMessage().toString());//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"申请审批状态报错,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"报错信息" + beanForBeiJing.getMessage().toString()); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
Map dataMap = (Map) beanForBeiJing.getData(); |
|
|
Map dataMap = (Map) beanForBeiJing.getData(); |
|
@ -651,6 +758,9 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"新增开票确认失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"发票发票编号不能为空" + responseData.getMessage().toString()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//修改
|
|
|
//修改
|
|
@ -666,6 +776,9 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, "invoiceNo发票发票编号不能为空");//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, "invoiceNo发票发票编号不能为空");//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"新增开票确认收入失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"invoiceNo发票发票编号不能为空" ); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
String invoiceNo = stringStringHashMap.get("yptbh"); |
|
|
String invoiceNo = stringStringHashMap.get("yptbh"); |
|
@ -686,6 +799,9 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, beanForBeiJing.getMessage().toString());//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, beanForBeiJing.getMessage().toString());//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"申请审批状态报错,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"报错信息" + beanForBeiJing.getMessage().toString()); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
Map dataMap = (Map) beanForBeiJing.getData(); |
|
|
Map dataMap = (Map) beanForBeiJing.getData(); |
|
@ -722,6 +838,9 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"新增开票确认收入失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"报错信息" + responseData.getMessage().toString()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//修改
|
|
|
//修改
|
|
@ -749,7 +868,12 @@ public class ProcessScheduled { |
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, 1);//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, 1);//更新的值
|
|
|
|
|
|
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
sendKpxxLambdaUpdateWrapper.clear(); |
|
|
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getWfrequest, sendKpxx.getWfrequest());//更新条件
|
|
|
|
|
|
sendKpxxLambdaUpdateWrapper.isNull(SendKpxx::getStatus);//更新条件
|
|
|
|
|
|
sendKpxxMapper.delete(sendKpxxLambdaUpdateWrapper); |
|
|
log.info("删除后新增开票确认到云平台成功"); |
|
|
log.info("删除后新增开票确认到云平台成功"); |
|
|
log.info(responseData.toString()); |
|
|
log.info(responseData.toString()); |
|
|
return; |
|
|
return; |
|
@ -759,12 +883,25 @@ public class ProcessScheduled { |
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, responseData.getMessage().toString());//更新的值
|
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"修改开票确认收入失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"报错信息" + responseData.getMessage().toString()); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
}else if (sendKpxx.getOperatetype()==2){ |
|
|
}else if (sendKpxx.getOperatetype()==2){ |
|
|
invoiceNo = otherMapper.selectScKpsqsp_yptbh_Byreqid(sendKpxx.getWfrequest()).get("yptbh"); |
|
|
invoiceNo = otherMapper.selectScKpsqsp_yptbh_Byreqid(sendKpxx.getWfrequest()).get("yptbh"); |
|
|
sendKpxx.setInvoiceNo(invoiceNo); |
|
|
sendKpxx.setInvoiceNo(invoiceNo); |
|
|
sendKpxx.setOpFlag(1); |
|
|
sendKpxx.setOpFlag(1); |
|
|
String incomeId = otherMapper.selectScKpcwqrsr_incomeId_Bylcid(sendKpxx.getWfrequest()).get("incomeId"); |
|
|
String incomeId =""; |
|
|
|
|
|
try { |
|
|
|
|
|
incomeId = otherMapper.selectScKpcwqrsr_incomeId_Bylcid(sendKpxx.getWfrequest()).get("incomeId"); |
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, "不存在incomeId");//更新的值
|
|
|
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
sendKpxx.setIncomeId(incomeId); |
|
|
sendKpxx.setIncomeId(incomeId); |
|
|
HttpEntity<SendKpxx> request1 = new HttpEntity<>(sendKpxx, headers); |
|
|
HttpEntity<SendKpxx> request1 = new HttpEntity<>(sendKpxx, headers); |
|
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(incomeUrl,request1, ResponseBeanForBeiJing.class); |
|
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(incomeUrl,request1, ResponseBeanForBeiJing.class); |
|
@ -784,6 +921,9 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"删除开票确认收入失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"报错信息" + responseData.getMessage().toString()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -798,6 +938,9 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, "invoiceNo发票发票编号不能为空");//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, "invoiceNo发票发票编号不能为空");//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"确认收入到账失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"invoiceNo发票发票编号不能为空"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
String invoiceNo = stringStringHashMap.get("yptbh"); |
|
|
String invoiceNo = stringStringHashMap.get("yptbh"); |
|
@ -818,6 +961,9 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, beanForBeiJing.getMessage().toString());//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, beanForBeiJing.getMessage().toString());//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"查询审批状态,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"报错信息" + beanForBeiJing.getMessage().toString()); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
Map dataMap = (Map) beanForBeiJing.getData(); |
|
|
Map dataMap = (Map) beanForBeiJing.getData(); |
|
@ -854,6 +1000,9 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"删除开票确认到账失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"报错信息" + responseData.getMessage().toString()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//修改
|
|
|
//修改
|
|
@ -891,6 +1040,9 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"修改开票确认收入失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"报错信息" + responseData.getMessage().toString()); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -899,6 +1051,12 @@ public class ProcessScheduled { |
|
|
List<SendKpxx> sendKpxxToYPTList = sendKpxxMapper.querySendToYPT(); |
|
|
List<SendKpxx> sendKpxxToYPTList = sendKpxxMapper.querySendToYPT(); |
|
|
sendKpxxToYPTList.forEach(item->{ |
|
|
sendKpxxToYPTList.forEach(item->{ |
|
|
String invoiceNo = item.getInvoiceNo(); |
|
|
String invoiceNo = item.getInvoiceNo(); |
|
|
|
|
|
if(invoiceNo==null){ |
|
|
|
|
|
String requestid = item.getRequestid(); |
|
|
|
|
|
HashMap<String, String> hashMap = otherMapper.selectScKpsqsp_tuipiao_yptbh(requestid).get(0); |
|
|
|
|
|
String yptbh = hashMap.get("yptbh"); |
|
|
|
|
|
invoiceNo=yptbh; |
|
|
|
|
|
} |
|
|
HttpEntity<Object> request = new HttpEntity<>(null, headers); |
|
|
HttpEntity<Object> request = new HttpEntity<>(null, headers); |
|
|
ResponseEntity<ResponseBeanForBeiJing> exchange = restTemplate.exchange(InvoicingApprovalStatusUrl+"/"+invoiceNo, HttpMethod.GET, request, ResponseBeanForBeiJing.class); |
|
|
ResponseEntity<ResponseBeanForBeiJing> exchange = restTemplate.exchange(InvoicingApprovalStatusUrl+"/"+invoiceNo, HttpMethod.GET, request, ResponseBeanForBeiJing.class); |
|
|
ResponseBeanForBeiJing beanForBeiJing = exchange.getBody(); |
|
|
ResponseBeanForBeiJing beanForBeiJing = exchange.getBody(); |
|
@ -913,7 +1071,6 @@ public class ProcessScheduled { |
|
|
Map dataMap = (Map) beanForBeiJing.getData(); |
|
|
Map dataMap = (Map) beanForBeiJing.getData(); |
|
|
Integer status = (Integer) dataMap.get("status"); |
|
|
Integer status = (Integer) dataMap.get("status"); |
|
|
Date nowData = new Date(); |
|
|
Date nowData = new Date(); |
|
|
|
|
|
|
|
|
if (status==2 || status==4){//已确认
|
|
|
if (status==2 || status==4){//已确认
|
|
|
//更新这边的流程
|
|
|
//更新这边的流程
|
|
|
String processId = sendKpxxMapper.selectProcessId(item.getRequestid()); |
|
|
String processId = sendKpxxMapper.selectProcessId(item.getRequestid()); |
|
@ -1100,33 +1257,82 @@ public class ProcessScheduled { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
//发送发票文件
|
|
|
//发送发票文件
|
|
|
public String sendfpfielUpdown(HttpHeaders headers,String[] evidenceIds){ |
|
|
// public String sendfpfielUpdown(HttpHeaders headers,String[] evidenceIds){
|
|
|
String evidenceid=""; |
|
|
// String evidenceid="";
|
|
|
for (String id:evidenceIds) { |
|
|
// for (String id:evidenceIds) {
|
|
|
//查询
|
|
|
// //查询
|
|
|
HashMap<String, String> fileMap = otherMapper.selectFileById(id); |
|
|
// HashMap<String, String> fileMap = otherMapper.selectFileById(id);
|
|
|
String filePath = fileMap.get("filepath"); |
|
|
// String filePath = fileMap.get("filepath");
|
|
|
String originalName = fileMap.get("originalName"); |
|
|
// String originalName = fileMap.get("originalName");
|
|
|
filePath =fileDownPre+filePath; |
|
|
// filePath =fileDownPre+filePath;
|
|
|
File file1 = new File(filePath); |
|
|
// File file1 = new File(filePath);
|
|
|
//文件不存在 创建文件夹
|
|
|
// //文件不存在 创建文件夹
|
|
|
if(!file1.exists()){ |
|
|
// if(!file1.exists()){
|
|
|
file1.mkdirs(); |
|
|
// file1.mkdirs();
|
|
|
} |
|
|
// }
|
|
|
String newfilepath = filePath+File.separator+originalName; |
|
|
// String newfilepath = filePath+File.separator+originalName;
|
|
|
downloadFileFromSshServer(filePath,newfilepath); |
|
|
// downloadFileFromSshServer(filePath,newfilepath);
|
|
|
File file = new File(newfilepath); |
|
|
// File file = new File(newfilepath);
|
|
|
if(file.exists()){ |
|
|
// if(file.exists()){
|
|
|
headers.setContentType(MediaType.MULTIPART_FORM_DATA); |
|
|
// headers.setContentType(MediaType.MULTIPART_FORM_DATA);
|
|
|
MultiValueMap<String, Object> body = new LinkedMultiValueMap<>(); |
|
|
// MultiValueMap<String, Object> body = new LinkedMultiValueMap<>();
|
|
|
body.add("file", new FileSystemResource(new File(newfilepath))); |
|
|
// body.add("file", new FileSystemResource(new File(newfilepath)));
|
|
|
HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<>(body, headers); |
|
|
// HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<>(body, headers);
|
|
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(uploadFileUrl ,request, ResponseBeanForBeiJing.class); |
|
|
// ResponseBeanForBeiJing responseData = restTemplate.postForObject(uploadFileUrl ,request, ResponseBeanForBeiJing.class);
|
|
|
//文件处理
|
|
|
// //文件处理
|
|
|
String dataString = responseData.getData().toString(); |
|
|
// String dataString = responseData.getData().toString();
|
|
|
evidenceid = evidenceid+dataString+","; |
|
|
// evidenceid = evidenceid+dataString+",";
|
|
|
}else { |
|
|
// }else {
|
|
|
log.info("文件不存在,文件位置"+filePath); |
|
|
// log.info("文件不存在,文件位置"+filePath);
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// return evidenceid;
|
|
|
|
|
|
// }
|
|
|
|
|
|
public String sendfpfielUpdown(HttpHeaders headers, String[] evidenceIds) { |
|
|
|
|
|
String evidenceid = ""; |
|
|
|
|
|
for (String id : evidenceIds) { |
|
|
|
|
|
File tempFile = null; |
|
|
|
|
|
try { |
|
|
|
|
|
// 查询文件信息
|
|
|
|
|
|
HashMap<String, String> fileMap = otherMapper.selectFileById(id); |
|
|
|
|
|
String filePath = fileDownPre + fileMap.get("filepath"); |
|
|
|
|
|
String originalName = fileMap.get("originalName"); |
|
|
|
|
|
|
|
|
|
|
|
// 构建原文件
|
|
|
|
|
|
File originalFile = new File(filePath); |
|
|
|
|
|
if (originalFile.exists()) { |
|
|
|
|
|
// 在同目录下创建使用原始文件名的临时文件
|
|
|
|
|
|
tempFile = new File(originalFile.getParent(), originalName); |
|
|
|
|
|
|
|
|
|
|
|
// 复制文件
|
|
|
|
|
|
Files.copy(originalFile.toPath(), tempFile.toPath(), StandardCopyOption.REPLACE_EXISTING); |
|
|
|
|
|
|
|
|
|
|
|
// 设置请求头和请求体
|
|
|
|
|
|
headers.setContentType(MediaType.MULTIPART_FORM_DATA); |
|
|
|
|
|
MultiValueMap<String, Object> body = new LinkedMultiValueMap<>(); |
|
|
|
|
|
body.add("file", new FileSystemResource(tempFile)); |
|
|
|
|
|
|
|
|
|
|
|
// 发送请求
|
|
|
|
|
|
HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<>(body, headers); |
|
|
|
|
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(uploadFileUrl, request, ResponseBeanForBeiJing.class); |
|
|
|
|
|
|
|
|
|
|
|
// 处理响应
|
|
|
|
|
|
String dataString = responseData.getData().toString(); |
|
|
|
|
|
evidenceid = evidenceid + dataString + ","; |
|
|
|
|
|
} else { |
|
|
|
|
|
log.info("文件不存在,文件位置:" + filePath); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.error("文件处理过程发生错误", e); |
|
|
|
|
|
} finally { |
|
|
|
|
|
// 删除临时文件
|
|
|
|
|
|
if (tempFile != null && tempFile.exists()) { |
|
|
|
|
|
try { |
|
|
|
|
|
Files.delete(tempFile.toPath()); |
|
|
|
|
|
} catch (IOException e) { |
|
|
|
|
|
log.error("临时文件删除失败:" + tempFile.getAbsolutePath(), e); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return evidenceid; |
|
|
return evidenceid; |
|
@ -1181,6 +1387,9 @@ public class ProcessScheduled { |
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getErrormessage, responseData.getMessage().toString());//更新的值
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
log.info("删除到账信息失败"+responseData.toString()); |
|
|
log.info("删除到账信息失败"+responseData.toString()); |
|
|
|
|
|
mailService.sendTextMailMessage("yuanyuan.jin@srit.com.cn", |
|
|
|
|
|
"删除到账信息失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId() |
|
|
|
|
|
,"删除到账信息失败"+responseData.toString()); |
|
|
} |
|
|
} |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|