|
|
@ -83,6 +83,8 @@ public class ProcessScheduled { |
|
|
|
private String cancelPrjetcUrl; |
|
|
|
@Autowired |
|
|
|
private KpssProcessNode6IdInfo kpssProcessNode6IdInfo; |
|
|
|
@Value("${ypt.htqxid}") |
|
|
|
private String htqxid; |
|
|
|
/** |
|
|
|
* 定时任务跑合同和项目信息的变化发给北京,五分钟一次 |
|
|
|
*/ |
|
|
@ -185,6 +187,12 @@ public class ProcessScheduled { |
|
|
|
} else { |
|
|
|
log.info("新增失败,projectId是" + iteam.getProjectId() + " id是" + iteam.getId()); |
|
|
|
log.info("返回的信息是" + responseData.toString()); |
|
|
|
//记录失败原因
|
|
|
|
LambdaUpdateWrapper<SendXm> sendXmLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
sendXmLambdaUpdateWrapper.eq(SendXm::getId,iteam.getId()); |
|
|
|
sendXmLambdaUpdateWrapper.set(SendXm::getErrormessage,responseData.getMessage().toString()); |
|
|
|
sendXmMapper.update(null, sendXmLambdaUpdateWrapper); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
//修改
|
|
|
@ -207,6 +215,11 @@ public class ProcessScheduled { |
|
|
|
} else { |
|
|
|
log.info("更新失败,projectId是" + iteam.getProjectId() + " id是" + iteam.getId()); |
|
|
|
log.info("返回的信息是" + responseData.toString()); |
|
|
|
//记录失败原因
|
|
|
|
LambdaUpdateWrapper<SendXm> sendXmLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
sendXmLambdaUpdateWrapper.eq(SendXm::getId,iteam.getId()); |
|
|
|
sendXmLambdaUpdateWrapper.set(SendXm::getErrormessage,responseData.getMessage().toString()); |
|
|
|
sendXmMapper.update(null, sendXmLambdaUpdateWrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
@ -260,6 +273,11 @@ public class ProcessScheduled { |
|
|
|
} else { |
|
|
|
log.info("新增失败,projectId是" + item.getContractId() + " id是" + item.getId()); |
|
|
|
log.info("返回的信息是" + responseData.toString()); |
|
|
|
//记录失败原因
|
|
|
|
LambdaUpdateWrapper<SendHt> sendHtLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
sendHtLambdaUpdateWrapper.eq(SendHt::getId, item.getId());//更新条件
|
|
|
|
sendHtLambdaUpdateWrapper.set(SendHt::getErrormessage,responseData.getMessage().toString());//更新的值
|
|
|
|
sendHtMapper.update(null, sendHtLambdaUpdateWrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
//修改
|
|
|
@ -282,6 +300,11 @@ public class ProcessScheduled { |
|
|
|
} else { |
|
|
|
log.info("更新失败,projectId是" + item.getContractId() + " id是" + item.getId()); |
|
|
|
log.info("返回的信息是" + responseData.toString()); |
|
|
|
//记录失败原因
|
|
|
|
LambdaUpdateWrapper<SendHt> sendHtLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
sendHtLambdaUpdateWrapper.eq(SendHt::getId, item.getId());//更新条件
|
|
|
|
sendHtLambdaUpdateWrapper.set(SendHt::getErrormessage,responseData.getMessage().toString());//更新的值
|
|
|
|
sendHtMapper.update(null, sendHtLambdaUpdateWrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
@ -326,6 +349,10 @@ public class ProcessScheduled { |
|
|
|
sendKpxx.setInvoiceNo(null); |
|
|
|
headers.setContentType(MediaType.APPLICATION_JSON); |
|
|
|
sendKpxx.setEvidenceId(evidenceid); |
|
|
|
//退票要先删掉原来的到账信息
|
|
|
|
if(sendKpxx.getIsReturn()==1){ |
|
|
|
deleteFpdzrq(headers,sendKpxx); |
|
|
|
} |
|
|
|
HttpEntity<SendKpxx> request = new HttpEntity<>(sendKpxx, headers); |
|
|
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(invoiceUrl,request, ResponseBeanForBeiJing.class); |
|
|
|
if ("200".equals(responseData.getCode())) { |
|
|
@ -351,6 +378,12 @@ public class ProcessScheduled { |
|
|
|
} else { |
|
|
|
log.info("新增开票信息失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId()); |
|
|
|
log.error("返回的信息是" + responseData.toString()); |
|
|
|
//记录错误信息
|
|
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, responseData.getMessage().toString());//更新的值
|
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
//修改
|
|
|
@ -378,6 +411,11 @@ public class ProcessScheduled { |
|
|
|
} else { |
|
|
|
log.info("新增开票信息失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId()); |
|
|
|
log.error("返回的信息是" + responseData.toString()); |
|
|
|
//记录错误信息
|
|
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, responseData.getMessage().toString());//更新的值
|
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -421,6 +459,11 @@ public class ProcessScheduled { |
|
|
|
} else { |
|
|
|
log.info("新增开票确认失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId()); |
|
|
|
log.info("返回的信息是" + responseData.toString()); |
|
|
|
//记录失败信息
|
|
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, responseData.getMessage().toString());//更新的值
|
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
//修改
|
|
|
@ -478,6 +521,11 @@ public class ProcessScheduled { |
|
|
|
} else { |
|
|
|
log.info("新增开票确认收入失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId()); |
|
|
|
log.info("返回的信息是" + responseData.toString()); |
|
|
|
//记录失败信息
|
|
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, responseData.getMessage().toString());//更新的值
|
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
//修改
|
|
|
@ -508,14 +556,20 @@ public class ProcessScheduled { |
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
log.info("删除后新增开票确认到云平台成功"); |
|
|
|
log.info(responseData.toString()); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//记录错误信息
|
|
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, responseData.getMessage().toString());//更新的值
|
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
@Transactional() |
|
|
|
public void sendKpqrdzToYunPingtai(SendKpxx sendKpxx, HttpHeaders headers){ |
|
|
|
HashMap<String, String> stringStringHashMap = otherMapper.selectScKpsqsp_yptbh_ByPjid(sendKpxx.getRequestid()); |
|
|
|
sendKpxx.setOpUserCode(sendKpxx.getApplyUserCode()); |
|
|
|
if(stringStringHashMap==null){ |
|
|
|
return; |
|
|
|
} |
|
|
@ -563,6 +617,10 @@ public class ProcessScheduled { |
|
|
|
} else { |
|
|
|
log.info("新增开票确认失败,projectId是" + sendKpxx.getProjectNo() + " id是" + sendKpxx.getId()); |
|
|
|
log.info("返回的信息是" + responseData.toString()); |
|
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, responseData.getMessage().toString());//更新的值
|
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
//修改
|
|
|
@ -593,8 +651,13 @@ public class ProcessScheduled { |
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
log.info("删除后新增开票确认到账到云平台成功"); |
|
|
|
log.info(responseData.toString()); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
LambdaUpdateWrapper<SendKpxx> sendKpxxLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
|
|
|
sendKpxxLambdaUpdateWrapper.eq(SendKpxx::getId, sendKpxx.getId());//更新条件
|
|
|
|
sendKpxxLambdaUpdateWrapper.set(SendKpxx::getStatus, responseData.getMessage().toString());//更新的值
|
|
|
|
sendKpxxMapper.update(null, sendKpxxLambdaUpdateWrapper); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -830,7 +893,7 @@ public class ProcessScheduled { |
|
|
|
return evidenceid; |
|
|
|
} |
|
|
|
public void sendKpCancelToYPT(HttpHeaders headers){ |
|
|
|
List<HashMap<String, String>> hashMapList = otherMapper.selectSchtqxByflag(); |
|
|
|
List<HashMap<String, String>> hashMapList = otherMapper.selectSchtqxByflag(htqxid); |
|
|
|
if (hashMapList.size()>0){ |
|
|
|
hashMapList.forEach(item->{ |
|
|
|
String yptbh = item.get("yptbh"); |
|
|
@ -852,4 +915,35 @@ public class ProcessScheduled { |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除开票到账确认 |
|
|
|
*/ |
|
|
|
private Boolean deleteFpdzrq(HttpHeaders headers,SendKpxx sendKpxx) { |
|
|
|
String requestid = sendKpxx.getRequestid(); |
|
|
|
sendKpxx.setOpUserCode(sendKpxx.getApplyUserCode()); |
|
|
|
Double invoiceAmount = sendKpxx.getInvoiceAmount(); |
|
|
|
LambdaQueryWrapper<ScKpsqsp> scKpsqspLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
scKpsqspLambdaQueryWrapper.eq(ScKpsqsp::getId, requestid); |
|
|
|
List<ScKpsqsp> queryxxmclist = scKpsqspMapper.selectList(scKpsqspLambdaQueryWrapper); |
|
|
|
String xmmc = queryxxmclist.get(0).getXmmc(); |
|
|
|
scKpsqspLambdaQueryWrapper.clear(); |
|
|
|
scKpsqspLambdaQueryWrapper.eq(ScKpsqsp::getXmmc,xmmc); |
|
|
|
scKpsqspLambdaQueryWrapper.eq(ScKpsqsp::getKpje, invoiceAmount); |
|
|
|
List<ScKpsqsp> scKpsqspList = scKpsqspMapper.selectList(scKpsqspLambdaQueryWrapper); |
|
|
|
if (scKpsqspList.size() > 0) { |
|
|
|
ScKpsqsp scKpsqsp = scKpsqspList.get(0); |
|
|
|
String accountId = scKpsqsp.getAccountid(); |
|
|
|
sendKpxx.setAccountId(accountId); |
|
|
|
sendKpxx.setOpFlag(1); |
|
|
|
HttpEntity<SendKpxx> request2 = new HttpEntity<>(sendKpxx, headers); |
|
|
|
ResponseBeanForBeiJing responseData = restTemplate.postForObject(accountUrl, request2, ResponseBeanForBeiJing.class); |
|
|
|
if ("200".equals(responseData.getCode())) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
log.info("删除到账信息失败"+responseData.toString()); |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|