财报数据推送
This commit is contained in:
parent
b5251fba58
commit
182994104d
|
@ -36,6 +36,7 @@ import com.hzya.frame.basedao.service.impl.BaseService;
|
||||||
import javax.net.ssl.SSLContext;
|
import javax.net.ssl.SSLContext;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -686,85 +687,106 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public JsonResultEntity sendFinancialReportPlugin(JSONObject requestJson) {
|
public JsonResultEntity sendFinancialReportPlugin(JSONObject requestJson) {
|
||||||
JSONObject jsonObject = requestJson.getJSONObject("jsonStr");
|
|
||||||
String cdDate = null;
|
logger.error("财报数据推送入参"+requestJson.toJSONString());
|
||||||
String jnDate = null;
|
JSONObject jsonStr = requestJson.getJSONObject("jsonStr");
|
||||||
String qnDate = null;
|
JSONObject businessDataStr = jsonStr.getJSONObject("businessDataStr");
|
||||||
String orgCode = "X0644";
|
String eventType = jsonStr.getString("eventType");
|
||||||
IncomeInvoiceEntity dyAloneId = null;
|
switch (eventType) {
|
||||||
JSONObject dydata = null;
|
case "onProcessFinished"://流程结束事件,同步物料到U8C
|
||||||
JSONObject qndata = null;
|
JSONObject businessData = businessDataStr.getJSONObject("formson_0275");
|
||||||
IncomeInvoiceEntity qnAloneId = null;
|
|
||||||
if(requestJson.getString("orgCode") != null){
|
|
||||||
orgCode = requestJson.getString("orgCode");
|
|
||||||
}
|
return BaseResult.getSuccessMessageEntity("推送数据成功");
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
default:
|
||||||
if(requestJson.getString("year") != null && requestJson.getString("month") != null){
|
return BaseResult.getFailureMessageEntity("未匹配到流程监听事件!当前传入的eventType:" + eventType);
|
||||||
cdDate = requestJson.getString("year") + "-" + requestJson.getString("month");
|
|
||||||
if("13".equals(requestJson.getString("month"))){
|
|
||||||
cdDate = requestJson.getString("year") + "-12";
|
|
||||||
qnDate = (requestJson.getInteger("year")-1) + "-12";
|
|
||||||
}else {
|
|
||||||
cdDate = requestJson.getString("year") + "-" + requestJson.getString("month");
|
|
||||||
qnDate = (requestJson.getInteger("year")-1) + "-" + requestJson.getString("month");
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
cdDate = sdf.format(new Date());
|
|
||||||
jnDate = sdf.format(new Date());
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTime(new Date());
|
|
||||||
calendar.add(Calendar.YEAR, -1);
|
|
||||||
Date qn = calendar.getTime();
|
|
||||||
qnDate = sdf.format(qn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询帐套组织
|
|
||||||
IncomeInvoiceEntity jnentity = new IncomeInvoiceEntity();
|
|
||||||
jnentity.setDataSourceCode("");
|
|
||||||
jnentity.setSysData(jnDate);
|
|
||||||
jnentity.setOrgCode(orgCode);
|
|
||||||
List<IncomeInvoiceEntity> jnlist = incomeInvoiceDao.queryZtzz(jnentity);
|
|
||||||
if(jnlist != null && jnlist.size() == 1){
|
|
||||||
dyAloneId = jnlist.get(0);
|
|
||||||
}else {
|
|
||||||
return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送");
|
|
||||||
}
|
|
||||||
//查询帐套组织
|
|
||||||
IncomeInvoiceEntity qnentity = new IncomeInvoiceEntity();
|
|
||||||
qnentity.setDataSourceCode("");
|
|
||||||
qnentity.setSysData(jnDate);
|
|
||||||
qnentity.setOrgCode(orgCode);
|
|
||||||
List<IncomeInvoiceEntity> qnlist = incomeInvoiceDao.queryZtzz(qnentity);
|
|
||||||
if(qnlist != null && qnlist.size() == 1){
|
|
||||||
qnAloneId = qnlist.get(0);
|
|
||||||
}else {
|
|
||||||
logger.info("未查询到当月的财报数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
//查找今年数据
|
|
||||||
IncomeInvoiceEntity jnquerydata = new IncomeInvoiceEntity();
|
|
||||||
jnquerydata.setDataSourceCode("");
|
|
||||||
jnquerydata.setAloneId(dyAloneId.getAloneId());
|
|
||||||
List<JSONObject> dydataList = incomeInvoiceDao.queryByAloneId(jnquerydata);
|
|
||||||
if(dydataList != null && dydataList.size() == 1){
|
|
||||||
dydata = dydataList.get(0);
|
|
||||||
}else {
|
|
||||||
return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送");
|
|
||||||
}
|
|
||||||
|
|
||||||
//查找去年数据
|
|
||||||
IncomeInvoiceEntity qnquerydata = new IncomeInvoiceEntity();
|
|
||||||
qnquerydata.setDataSourceCode("");
|
|
||||||
qnquerydata.setAloneId(qnAloneId.getAloneId());
|
|
||||||
List<JSONObject> qndataList = incomeInvoiceDao.queryByAloneId(qnquerydata);
|
|
||||||
if(qndataList != null && qndataList.size() == 1){
|
|
||||||
qndata = qndataList.get(0);
|
|
||||||
}
|
|
||||||
//拼接数据
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return BaseResult.getSuccessMessageEntity("执行成功");
|
|
||||||
|
//JSONObject jsonObject = requestJson.getJSONObject("jsonStr");
|
||||||
|
//String cdDate = null;
|
||||||
|
//String jnDate = null;
|
||||||
|
//String qnDate = null;
|
||||||
|
//String orgCode = "X0644";
|
||||||
|
//IncomeInvoiceEntity dyAloneId = null;
|
||||||
|
//JSONObject dydata = null;
|
||||||
|
//JSONObject qndata = null;
|
||||||
|
//IncomeInvoiceEntity qnAloneId = null;
|
||||||
|
//if(requestJson.getString("orgCode") != null){
|
||||||
|
// orgCode = requestJson.getString("orgCode");
|
||||||
|
//}
|
||||||
|
//SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
||||||
|
//if(requestJson.getString("year") != null && requestJson.getString("month") != null){
|
||||||
|
// cdDate = requestJson.getString("year") + "-" + requestJson.getString("month");
|
||||||
|
// if("13".equals(requestJson.getString("month"))){
|
||||||
|
// cdDate = requestJson.getString("year") + "-12";
|
||||||
|
// qnDate = (requestJson.getInteger("year")-1) + "-12";
|
||||||
|
// }else {
|
||||||
|
// cdDate = requestJson.getString("year") + "-" + requestJson.getString("month");
|
||||||
|
// qnDate = (requestJson.getInteger("year")-1) + "-" + requestJson.getString("month");
|
||||||
|
// }
|
||||||
|
//}else {
|
||||||
|
// cdDate = sdf.format(new Date());
|
||||||
|
// jnDate = sdf.format(new Date());
|
||||||
|
// Calendar calendar = Calendar.getInstance();
|
||||||
|
// calendar.setTime(new Date());
|
||||||
|
// calendar.add(Calendar.YEAR, -1);
|
||||||
|
// Date qn = calendar.getTime();
|
||||||
|
// qnDate = sdf.format(qn);
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
////查询帐套组织
|
||||||
|
//IncomeInvoiceEntity jnentity = new IncomeInvoiceEntity();
|
||||||
|
//jnentity.setDataSourceCode("");
|
||||||
|
//jnentity.setSysData(jnDate);
|
||||||
|
//jnentity.setOrgCode(orgCode);
|
||||||
|
//List<IncomeInvoiceEntity> jnlist = incomeInvoiceDao.queryZtzz(jnentity);
|
||||||
|
//if(jnlist != null && jnlist.size() == 1){
|
||||||
|
// dyAloneId = jnlist.get(0);
|
||||||
|
//}else {
|
||||||
|
// return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送");
|
||||||
|
//}
|
||||||
|
////查询帐套组织
|
||||||
|
//IncomeInvoiceEntity qnentity = new IncomeInvoiceEntity();
|
||||||
|
//qnentity.setDataSourceCode("");
|
||||||
|
//qnentity.setSysData(jnDate);
|
||||||
|
//qnentity.setOrgCode(orgCode);
|
||||||
|
//List<IncomeInvoiceEntity> qnlist = incomeInvoiceDao.queryZtzz(qnentity);
|
||||||
|
//if(qnlist != null && qnlist.size() == 1){
|
||||||
|
// qnAloneId = qnlist.get(0);
|
||||||
|
//}else {
|
||||||
|
// logger.info("未查询到当月的财报数据");
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
////查找今年数据
|
||||||
|
//IncomeInvoiceEntity jnquerydata = new IncomeInvoiceEntity();
|
||||||
|
//jnquerydata.setDataSourceCode("");
|
||||||
|
//jnquerydata.setAloneId(dyAloneId.getAloneId());
|
||||||
|
//List<JSONObject> dydataList = incomeInvoiceDao.queryByAloneId(jnquerydata);
|
||||||
|
//if(dydataList != null && dydataList.size() == 1){
|
||||||
|
// dydata = dydataList.get(0);
|
||||||
|
//}else {
|
||||||
|
// return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送");
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
// //查找去年数据
|
||||||
|
//IncomeInvoiceEntity qnquerydata = new IncomeInvoiceEntity();
|
||||||
|
//qnquerydata.setDataSourceCode("");
|
||||||
|
//qnquerydata.setAloneId(qnAloneId.getAloneId());
|
||||||
|
//List<JSONObject> qndataList = incomeInvoiceDao.queryByAloneId(qnquerydata);
|
||||||
|
//if(qndataList != null && qndataList.size() == 1){
|
||||||
|
// qndata = qndataList.get(0);
|
||||||
|
//}
|
||||||
|
////拼接数据
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue