财报代码编写
This commit is contained in:
parent
7d52bf7417
commit
98999d34ce
|
@ -19,5 +19,7 @@ public interface IBusinessDao extends IBaseDao<BusinessEntity, String> {
|
||||||
int saveData(JSONObject saveData);
|
int saveData(JSONObject saveData);
|
||||||
|
|
||||||
int saveDetailData(JSONObject saveDetailData);
|
int saveDetailData(JSONObject saveDetailData);
|
||||||
|
|
||||||
|
List<JSONObject> querytets(JSONObject jsonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,16 @@ public class BusinessDaoImpl extends MybatisGenericDao<BusinessEntity, String> i
|
||||||
public int saveData(JSONObject saveData) {
|
public int saveData(JSONObject saveData) {
|
||||||
return super.insert(getSqlIdPrifx() + "saveData", saveData);
|
return super.insert(getSqlIdPrifx() + "saveData", saveData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int saveDetailData(JSONObject saveData) {
|
public int saveDetailData(JSONObject saveData) {
|
||||||
return super.insert(getSqlIdPrifx() + "saveDetailData", saveData);
|
return super.insert(getSqlIdPrifx() + "saveDetailData", saveData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<JSONObject> querytets(JSONObject jsonObject) {
|
||||||
|
List<JSONObject> o = (List<JSONObject>) super.selectList(getSqlIdPrifx() + "querytets", jsonObject);
|
||||||
|
return o;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,5 +130,25 @@
|
||||||
</trim>
|
</trim>
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="querytets" resultType="com.alibaba.fastjson.JSONObject" parameterType="com.alibaba.fastjson.JSONObject">
|
||||||
|
select
|
||||||
|
id,
|
||||||
|
IFNULL(zdmc, '') as zdmc,
|
||||||
|
IFNULL(zdbm, '') as zdbm,
|
||||||
|
IFNULL(sfbt, '') as sfbt,
|
||||||
|
IFNULL(bj, '') as bj,
|
||||||
|
IFNULL(lxsz, '') as lxsz,
|
||||||
|
IFNULL(zdlj, '') as zdlj,
|
||||||
|
IFNULL(lx, '') as lx,
|
||||||
|
IFNULL(blx, '') as blx,
|
||||||
|
IFNULL(zdz, '') as zdz
|
||||||
|
from test0003
|
||||||
|
<trim prefix="where" prefixOverrides="and">
|
||||||
|
<if test="blx != null and blx != ''"> and blx = #{blx} </if>
|
||||||
|
<if test="lx != null and lx != ''"> and lx = #{lx} </if>
|
||||||
|
</trim>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,61 @@ public class BusinessServiceImpl extends BaseService<BusinessEntity, String> imp
|
||||||
String startDate = times+" 00:00:00";
|
String startDate = times+" 00:00:00";
|
||||||
String endDate = times+" 23:59:59";
|
String endDate = times+" 23:59:59";
|
||||||
JSONArray datalist = new JSONArray();
|
JSONArray datalist = new JSONArray();
|
||||||
sendBusinessData(datalist, access_token, queryCursor, startDate, endDate);
|
List<String> a = new ArrayList<>();
|
||||||
|
a.add("2025-03-11");
|
||||||
|
a.add("2025-03-12");
|
||||||
|
a.add("2025-03-13");
|
||||||
|
a.add("2025-03-14");
|
||||||
|
a.add("2025-03-15");
|
||||||
|
a.add("2025-03-16");
|
||||||
|
a.add("2025-03-17");
|
||||||
|
a.add("2025-03-18");
|
||||||
|
a.add("2025-03-19");
|
||||||
|
a.add("2025-03-20");
|
||||||
|
a.add("2025-03-21");
|
||||||
|
a.add("2025-03-22");
|
||||||
|
a.add("2025-03-23");
|
||||||
|
a.add("2025-03-24");
|
||||||
|
a.add("2025-03-25");
|
||||||
|
a.add("2025-03-26");
|
||||||
|
a.add("2025-03-27");
|
||||||
|
a.add("2025-03-28");
|
||||||
|
a.add("2025-03-29");
|
||||||
|
a.add("2025-03-30");
|
||||||
|
a.add("2025-03-31");
|
||||||
|
a.add("2025-04-01");
|
||||||
|
a.add("2025-04-02");
|
||||||
|
a.add("2025-04-03");
|
||||||
|
a.add("2025-04-04");
|
||||||
|
a.add("2025-04-05");
|
||||||
|
a.add("2025-04-06");
|
||||||
|
a.add("2025-04-07");
|
||||||
|
a.add("2025-04-08");
|
||||||
|
a.add("2025-04-09");
|
||||||
|
a.add("2025-04-10");
|
||||||
|
a.add("2025-04-11");
|
||||||
|
a.add("2025-04-12");
|
||||||
|
a.add("2025-04-13");
|
||||||
|
a.add("2025-04-14");
|
||||||
|
a.add("2025-04-15");
|
||||||
|
a.add("2025-04-16");
|
||||||
|
a.add("2025-04-17");
|
||||||
|
a.add("2025-04-18");
|
||||||
|
a.add("2025-04-19");
|
||||||
|
a.add("2025-04-20");
|
||||||
|
a.add("2025-04-21");
|
||||||
|
a.add("2025-04-22");
|
||||||
|
a.add("2025-04-23");
|
||||||
|
a.add("2025-04-24");
|
||||||
|
a.add("2025-04-25");
|
||||||
|
a.add("2025-04-26");
|
||||||
|
a.add("2025-04-27");
|
||||||
|
a.add("2025-04-28");
|
||||||
|
a.add("2025-04-29");
|
||||||
|
a.add(times);
|
||||||
|
for (int i = 0; i < a.size(); i++) {
|
||||||
|
sendBusinessData(datalist, access_token, queryCursor, a.get(i)+" 00:00:00", a.get(i)+" 23:59:59");
|
||||||
|
}
|
||||||
|
|
||||||
if(datalist != null && datalist.size() > 0){
|
if(datalist != null && datalist.size() > 0){
|
||||||
for (int i = 0; i < datalist.size(); i++) {
|
for (int i = 0; i < datalist.size(); i++) {
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.hzya.frame;
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.plugin.businessData.dao.IBusinessDao;
|
||||||
import com.hzya.frame.util.AESUtil;
|
import com.hzya.frame.util.AESUtil;
|
||||||
import org.apache.http.HttpEntity;
|
import org.apache.http.HttpEntity;
|
||||||
import org.apache.http.client.config.RequestConfig;
|
import org.apache.http.client.config.RequestConfig;
|
||||||
|
@ -15,6 +16,7 @@ import org.apache.http.impl.client.HttpClients;
|
||||||
import org.apache.http.util.EntityUtils;
|
import org.apache.http.util.EntityUtils;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
@ -30,11 +32,11 @@ import java.util.Map;
|
||||||
* @Author llg
|
* @Author llg
|
||||||
* Date 2023/7/16 8:18 上午
|
* Date 2023/7/16 8:18 上午
|
||||||
*/
|
*/
|
||||||
//@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
//@SpringBootTest(classes = {WebappApplication.class})
|
@SpringBootTest(classes = {WebappApplication.class})
|
||||||
public class temButtom {
|
public class temButtom {
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void test01() {
|
public void test01() {
|
||||||
String a = AESUtil.encrypt("hzya@1314");
|
String a = AESUtil.encrypt("hzya@1314");
|
||||||
System.out.println(a);
|
System.out.println(a);
|
||||||
|
@ -43,7 +45,7 @@ public class temButtom {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void test02() {
|
public void test02() {
|
||||||
// 1056162015172640840 -7858803986346327947 3178176833471791293 合同评审-待办测试(bdmanager 2024-10-22 16:45) 7743552636545550897 bdmanager 18058147870 pending start success 新增成功!
|
// 1056162015172640840 -7858803986346327947 3178176833471791293 合同评审-待办测试(bdmanager 2024-10-22 16:45) 7743552636545550897 bdmanager 18058147870 pending start success 新增成功!
|
||||||
// success 更新待办为已办成功!
|
// success 更新待办为已办成功!
|
||||||
|
@ -141,6 +143,48 @@ public class temButtom {
|
||||||
}
|
}
|
||||||
return body.toString();
|
return body.toString();
|
||||||
}
|
}
|
||||||
|
@Autowired
|
||||||
|
private IBusinessDao businessDao;
|
||||||
|
@Test
|
||||||
|
public void test1212() {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("blx","F2");
|
||||||
|
jsonObject.put("lx","1");
|
||||||
|
List<JSONObject> jsonObjects = businessDao.querytets(jsonObject);
|
||||||
|
jsonObject.put("lx","2");
|
||||||
|
List<JSONObject> jsonObjectsmx = businessDao.querytets(jsonObject);
|
||||||
|
|
||||||
|
|
||||||
|
StringBuffer a = new StringBuffer();
|
||||||
|
a.append("<?xml version=\"1.0\" encoding='UTF-8'?>").append("\n");
|
||||||
|
a.append("<ufinterface account=\"001\" billtype=\"F2\" businessunitcode=\"\" filename=\"\" groupcode=\"001\" isexchange=\"Y\" orgcode=\"\" receiver=\"\" replace=\"Y\" roottag=\"\" sender=\"SHJDY\">").append("\n");
|
||||||
|
a.append("<bill id=\"主键ID\">").append("\n");
|
||||||
|
a.append("<billhead>").append("\n");
|
||||||
|
for (int i = 0; i < jsonObjects.size(); i++) {
|
||||||
|
if(jsonObjects.get(i).getString("zdbm") != null && !"".equals(jsonObjects.get(i).getString("zdbm"))){
|
||||||
|
a.append("<!--"+jsonObjects.get(i).getString("zdmc")+jsonObjects.get(i).get("sfbt")+"-->").append("\n");
|
||||||
|
a.append("<"+jsonObjects.get(i).getString("zdbm")+">"+jsonObjects.get(i).get("zdz")+"</"+jsonObjects.get(i).getString("zdbm")+">").append("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a.append("<bodys>").append("\n");
|
||||||
|
a.append("<item>").append("\n");
|
||||||
|
for (int i = 0; i < jsonObjectsmx.size(); i++) {
|
||||||
|
if(jsonObjectsmx.get(i).getString("zdbm") != null && !"".equals(jsonObjectsmx.get(i).getString("zdbm"))){
|
||||||
|
a.append("<!--"+jsonObjectsmx.get(i).getString("zdmc")+jsonObjectsmx.get(i).get("sfbt")+"-->").append("\n");
|
||||||
|
a.append("<"+jsonObjectsmx.get(i).getString("zdbm")+">"+jsonObjectsmx.get(i).get("zdz") +"</"+jsonObjectsmx.get(i).getString("zdbm")+">").append("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a.append("</item>").append("\n");
|
||||||
|
a.append("</bodys>").append("\n");
|
||||||
|
a.append("</billhead>").append("\n");
|
||||||
|
a.append("</bill>").append("\n");
|
||||||
|
a.append("</ufinterface>").append("\n");
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println(a.toString());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue