Compare commits
6 Commits
b3f3fdb7af
...
f2762e767c
Author | SHA1 | Date |
---|---|---|
|
f2762e767c | |
|
98999d34ce | |
|
7d52bf7417 | |
|
a85ace9a5f | |
|
c0cfccd595 | |
|
6e340195b5 |
|
@ -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++) {
|
||||||
|
@ -285,7 +339,7 @@ public class BusinessServiceImpl extends BaseService<BusinessEntity, String> imp
|
||||||
JSONObject saveDetailData = new JSONObject();
|
JSONObject saveDetailData = new JSONObject();
|
||||||
saveDetailData.put("field0004",detaildata.getJSONObject(i1).getString("StartDateTime"));//明细表-出发时间
|
saveDetailData.put("field0004",detaildata.getJSONObject(i1).getString("StartDateTime"));//明细表-出发时间
|
||||||
saveDetailData.put("field0005",detaildata.getJSONObject(i1).getString("StopDateTime"));//明细表-结束时间
|
saveDetailData.put("field0005",detaildata.getJSONObject(i1).getString("StopDateTime"));//明细表-结束时间
|
||||||
saveDetailData.put("field0022",detaildata.getJSONObject(i1).getString("BusinessDuration"));//明细表-出差时长
|
saveDetailData.put("field0022",detaildata.getJSONObject(i1).getString("DayValOfDuration"));//明细表-出差时长
|
||||||
|
|
||||||
if(detaildata.getJSONObject(i1).getString("BusinessVehicle") != null){// 明细表-交通工具
|
if(detaildata.getJSONObject(i1).getString("BusinessVehicle") != null){// 明细表-交通工具
|
||||||
if("0".equals(detaildata.getJSONObject(i1).getString("BusinessVehicle"))){
|
if("0".equals(detaildata.getJSONObject(i1).getString("BusinessVehicle"))){
|
||||||
|
@ -337,7 +391,7 @@ public class BusinessServiceImpl extends BaseService<BusinessEntity, String> imp
|
||||||
controlsLogEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443");
|
controlsLogEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||||
controlsLogEntity.setOrg_id("0");
|
controlsLogEntity.setOrg_id("0");
|
||||||
controlsLogEntity.setRemark("插件新增");
|
controlsLogEntity.setRemark("插件新增");
|
||||||
controlsLogDaoimpl.saveControlsLog(saveData.getString("id"), "数智中台", "800004", jsonObject.toJSONString(), "接口新增", "数智中台", "mdm_ccd_option_log", "1","插件新增");
|
controlsLogDaoimpl.saveControlsLog(saveData.getString("id"), "数智中台", "800004", "", "接口新增", "数智中台", "mdm_ccd_option_log", "1","插件新增");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return BaseResult.getSuccessMessageEntity("处理成功");
|
return BaseResult.getSuccessMessageEntity("处理成功");
|
||||||
|
@ -376,6 +430,7 @@ public class BusinessServiceImpl extends BaseService<BusinessEntity, String> imp
|
||||||
//}
|
//}
|
||||||
private void sendBusinessData(JSONArray datalist, String access_token, Integer queryCursor, String startDate, String endDate) {
|
private void sendBusinessData(JSONArray datalist, String access_token, Integer queryCursor, String startDate, String endDate) {
|
||||||
String url = "https://openapi.italent.cn/AttendanceOpen/api/v1/Business/GetApprovalCompletedBusinessList";
|
String url = "https://openapi.italent.cn/AttendanceOpen/api/v1/Business/GetApprovalCompletedBusinessList";
|
||||||
|
//String url = "https://openapi.italent.cn/AttendanceOpen/api/v1/Business/GetStartDateTimeBusinessList";
|
||||||
Map<String, String> headers = new HashMap<>();
|
Map<String, String> headers = new HashMap<>();
|
||||||
headers.put("Authorization", "Bearer " + access_token);
|
headers.put("Authorization", "Bearer " + access_token);
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|
|
@ -32,7 +32,7 @@ spring:
|
||||||
# type: com.alibaba.druid.pool.DruidDataSource
|
# type: com.alibaba.druid.pool.DruidDataSource
|
||||||
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||||
username: root
|
username: root
|
||||||
password: 62e4295b615a30dbf3b8ee96f41c820b
|
password: bd993088e8a7c3dc5f44441617f9b4bf
|
||||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||||
# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
|
# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
|
||||||
# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
|
# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
|
||||||
|
|
|
@ -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