|
@@ -24,6 +24,7 @@ import com.malk.zhixingtongde.entity.Profit;
|
|
import com.malk.zhixingtongde.service.ZxtdReportService;
|
|
import com.malk.zhixingtongde.service.ZxtdReportService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import java.io.*;
|
|
import java.io.*;
|
|
@@ -54,13 +55,16 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
@Autowired
|
|
@Autowired
|
|
private DDClient ddClient;
|
|
private DDClient ddClient;
|
|
|
|
|
|
|
|
+ @Value("${report.path}")
|
|
|
|
+ private String reportPath;
|
|
|
|
+
|
|
private static String[] PROFIT_CLASSIFYS={"收入","销售费用","管理费用","研发费用","财务费用"};// 分类
|
|
private static String[] PROFIT_CLASSIFYS={"收入","销售费用","管理费用","研发费用","财务费用"};// 分类
|
|
private static int[] PROFIT_NUMBERS={15,25,25,25,10};// 报表默认长度
|
|
private static int[] PROFIT_NUMBERS={15,25,25,25,10};// 报表默认长度
|
|
|
|
|
|
private static String[] RECEIVABLE_CLASSIFYS ={"平台服务费","技术服务费","其他"};// 应收账款表子科目
|
|
private static String[] RECEIVABLE_CLASSIFYS ={"平台服务费","技术服务费","其他"};// 应收账款表子科目
|
|
private static int[] RECEIABLE_NUMBERS ={30,30,30};// 应收账款表默认长度
|
|
private static int[] RECEIABLE_NUMBERS ={30,30,30};// 应收账款表默认长度
|
|
|
|
|
|
- private static String[] OTHER_RECEIVABLE_CLASSIFYS ={"房屋押金","员工借款(备用金)","往来"};// 其他应收款表子科目
|
|
|
|
|
|
+ private static String[] OTHER_RECEIVABLE_CLASSIFYS ={"办公房屋费用","往来","员工借款(备用金)"};// 其他应收款表子科目
|
|
private static int[] OTHER_RECEIABLE_NUMBERS ={15,15,15};// 其他应收款表默认长度
|
|
private static int[] OTHER_RECEIABLE_NUMBERS ={15,15,15};// 其他应收款表默认长度
|
|
|
|
|
|
private static String[] PAYABLE_CLASSIFYS ={"往来"};// 应付款表子科目
|
|
private static String[] PAYABLE_CLASSIFYS ={"往来"};// 应付款表子科目
|
|
@@ -78,7 +82,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
|
|
|
|
String _matchFormUuid(String code) {
|
|
String _matchFormUuid(String code) {
|
|
Map<String, String> formUuid = UtilMap.empty();
|
|
Map<String, String> formUuid = UtilMap.empty();
|
|
- if (UtilEnv.getActiveProfile().equals(UtilEnv.ENV_PROD)) {
|
|
|
|
|
|
+ if (UtilEnv.getActiveProfile().equals(UtilEnv.ENV_PROD) || UtilEnv.getActiveProfile().equals(UtilEnv.ENV_DEV)) {
|
|
formUuid.put("PROFIT", "FORM-32937639BC314882AF45201131EAE4C0YD2L"); // 利润表
|
|
formUuid.put("PROFIT", "FORM-32937639BC314882AF45201131EAE4C0YD2L"); // 利润表
|
|
formUuid.put("DOMAIN", "https://nxcyz4.aliwork.com/"); // 宜搭域名
|
|
formUuid.put("DOMAIN", "https://nxcyz4.aliwork.com/"); // 宜搭域名
|
|
formUuid.put("BUDGET","FORM-A0B077B5775341869605B2EB7E79356A7ZX7");// 成本费用预算编制中间表
|
|
formUuid.put("BUDGET","FORM-A0B077B5775341869605B2EB7E79356A7ZX7");// 成本费用预算编制中间表
|
|
@@ -90,6 +94,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
formUuid.put("INCOME","FORM-DA4BC7EA522E4D59A9233C507206D291N1XX");// 收入申请表
|
|
formUuid.put("INCOME","FORM-DA4BC7EA522E4D59A9233C507206D291N1XX");// 收入申请表
|
|
formUuid.put("PAY","FORM-DE36121157B74774B5C8462E38519269OAVS");// 支出申请表
|
|
formUuid.put("PAY","FORM-DE36121157B74774B5C8462E38519269OAVS");// 支出申请表
|
|
formUuid.put("ARTIFICIAL","FORM-52CEBFBA6D56413993E1F5075A493FDCVXVT");// 资产负债手动维护表
|
|
formUuid.put("ARTIFICIAL","FORM-52CEBFBA6D56413993E1F5075A493FDCVXVT");// 资产负债手动维护表
|
|
|
|
+ formUuid.put("PREVIOUS","FORM-2E13B1E519A3410D9DA27EA1DAA71ABF2UUO");// 往期数据手动维护表
|
|
} else {
|
|
} else {
|
|
formUuid.put("DOMAIN", "https://nxcyz4.aliwork.com/");
|
|
formUuid.put("DOMAIN", "https://nxcyz4.aliwork.com/");
|
|
}
|
|
}
|
|
@@ -382,86 +387,164 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
public void uploadToDingTalk(HttpServletResponse response,String userId) {
|
|
public void uploadToDingTalk(HttpServletResponse response,String userId) {
|
|
//获取当前时间戳
|
|
//获取当前时间戳
|
|
long beginTimestamp = System.currentTimeMillis();
|
|
long beginTimestamp = System.currentTimeMillis();
|
|
- System.out.println("开始上传文件:" + beginTimestamp);
|
|
|
|
|
|
+ System.out.println("开始上传相关账户明细表:" + beginTimestamp);
|
|
|
|
|
|
//父节点dentryUuid
|
|
//父节点dentryUuid
|
|
-// String parentDentryUuid = "9bN7RYPWdMm4Mv4eTDnleGRaVZd1wyK0";//poc api上传测试文件夹
|
|
|
|
String parentDentryUuid = "ZX6GRezwJlRgBQmQCGE54DMQWdqbropQ";//知行同德
|
|
String parentDentryUuid = "ZX6GRezwJlRgBQmQCGE54DMQWdqbropQ";//知行同德
|
|
String year = DateUtil.year(new Date()) + "";
|
|
String year = DateUtil.year(new Date()) + "";
|
|
- String month = DateUtil.month(new Date()) + 1 + "";
|
|
|
|
|
|
|
|
exportAll(response, year);
|
|
exportAll(response, year);
|
|
- exportCash(response, year + "0" + month);
|
|
|
|
|
|
|
|
//文件
|
|
//文件
|
|
- File file1 = new File("d:\\现金流量表-" + year + "0" + month + ".xlsx");
|
|
|
|
- File file2 = new File("d:\\相关账户明细表-" + year + ".xlsx");
|
|
|
|
- List<File> files = new ArrayList<>();
|
|
|
|
- Collections.addAll(files,file1,file2);
|
|
|
|
|
|
+ File file = new File("d:\\相关账户明细表-" + year + ".xlsx");
|
|
|
|
|
|
//获取文件上传信息
|
|
//获取文件上传信息
|
|
Map param = new HashMap();
|
|
Map param = new HashMap();
|
|
-// param.put("unionId","5PK3cMYhiStn7HDoNabweEgiEiE");//poc wzy
|
|
|
|
param.put("unionId","b80wtLNgk1gXHvKn9eozugiEiE");//知行同德 lfx
|
|
param.put("unionId","b80wtLNgk1gXHvKn9eozugiEiE");//知行同德 lfx
|
|
Map body = new HashMap();
|
|
Map body = new HashMap();
|
|
body.put("protocol","HEADER_SIGNATURE");
|
|
body.put("protocol","HEADER_SIGNATURE");
|
|
|
|
|
|
- for (File file : files) {
|
|
|
|
- DDR_New ddr = (DDR_New) UtilHttp.doPost("https://api.dingtalk.com/v2.0/storage/spaces/files/" + parentDentryUuid + "/uploadInfos/query", ddConf.initTokenHeader(ddClient.getAccessToken()), param, body, DDR_New.class);
|
|
|
|
- String uploadKey = ddr.getUploadKey();
|
|
|
|
- Map headerSignatureInfo = ddr.getHeaderSignatureInfo();
|
|
|
|
- Map<String,String> headers = (Map<String,String>) headerSignatureInfo.get("headers");
|
|
|
|
- List<String> resourceUrls = (List<String>) headerSignatureInfo.get("resourceUrls");
|
|
|
|
- String resourceUrl = resourceUrls.get(0);
|
|
|
|
-
|
|
|
|
- //使用OSS的header加签方式上传文件
|
|
|
|
- try {
|
|
|
|
- URL url = new URL(resourceUrl);
|
|
|
|
- HttpURLConnection connection = (HttpURLConnection)url.openConnection();
|
|
|
|
- if (headers != null) {
|
|
|
|
- for (Map.Entry<String, String> entry : headers.entrySet()) {
|
|
|
|
- connection.setRequestProperty(entry.getKey(), entry.getValue());
|
|
|
|
- }
|
|
|
|
|
|
+ DDR_New ddr = (DDR_New) UtilHttp.doPost("https://api.dingtalk.com/v2.0/storage/spaces/files/" + parentDentryUuid + "/uploadInfos/query", ddConf.initTokenHeader(ddClient.getAccessToken()), param, body, DDR_New.class);
|
|
|
|
+ String uploadKey = ddr.getUploadKey();
|
|
|
|
+ Map headerSignatureInfo = ddr.getHeaderSignatureInfo();
|
|
|
|
+ Map<String,String> headers = (Map<String,String>) headerSignatureInfo.get("headers");
|
|
|
|
+ List<String> resourceUrls = (List<String>) headerSignatureInfo.get("resourceUrls");
|
|
|
|
+ String resourceUrl = resourceUrls.get(0);
|
|
|
|
+ //使用OSS的header加签方式上传文件
|
|
|
|
+ try {
|
|
|
|
+ URL url = new URL(resourceUrl);
|
|
|
|
+ HttpURLConnection connection = (HttpURLConnection)url.openConnection();
|
|
|
|
+ if (headers != null) {
|
|
|
|
+ for (Map.Entry<String, String> entry : headers.entrySet()) {
|
|
|
|
+ connection.setRequestProperty(entry.getKey(), entry.getValue());
|
|
}
|
|
}
|
|
- connection.setDoOutput(true);
|
|
|
|
- connection.setRequestMethod("PUT");
|
|
|
|
- connection.setUseCaches(false);
|
|
|
|
- connection.setReadTimeout(10000);
|
|
|
|
- connection.setConnectTimeout(10000);
|
|
|
|
- connection.connect();
|
|
|
|
- OutputStream out = connection.getOutputStream();
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- InputStream is = new FileInputStream(file);
|
|
|
|
- byte[] b =new byte[1024];
|
|
|
|
- int temp;
|
|
|
|
- while ((temp=is.read(b))!=-1){
|
|
|
|
- out.write(b,0,temp);
|
|
|
|
- }
|
|
|
|
- out.flush();
|
|
|
|
- out.close();
|
|
|
|
- int responseCode = connection.getResponseCode();
|
|
|
|
- connection.disconnect();
|
|
|
|
- if (responseCode == 200) {
|
|
|
|
- System.out.println("上传成功");
|
|
|
|
- } else {
|
|
|
|
- System.out.println("上传失败");
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ connection.setDoOutput(true);
|
|
|
|
+ connection.setRequestMethod("PUT");
|
|
|
|
+ connection.setUseCaches(false);
|
|
|
|
+ connection.setReadTimeout(10000);
|
|
|
|
+ connection.setConnectTimeout(10000);
|
|
|
|
+ connection.connect();
|
|
|
|
+ OutputStream out = connection.getOutputStream();
|
|
|
|
+ InputStream is = new FileInputStream(file);
|
|
|
|
+ byte[] b =new byte[1024];
|
|
|
|
+ int temp;
|
|
|
|
+ while ((temp=is.read(b))!=-1){
|
|
|
|
+ out.write(b,0,temp);
|
|
|
|
+ }
|
|
|
|
+ out.flush();
|
|
|
|
+ out.close();
|
|
|
|
+ int responseCode = connection.getResponseCode();
|
|
|
|
+ connection.disconnect();
|
|
|
|
+ if (responseCode == 200) {
|
|
|
|
+ System.out.println("上传成功");
|
|
|
|
+ } else {
|
|
|
|
+ System.out.println("上传失败");
|
|
|
|
+ }
|
|
|
|
+ //提交文件
|
|
|
|
+ Map body2 = new HashMap();
|
|
|
|
+ Map option = new HashMap();
|
|
|
|
+ option.put("conflictStrategy","OVERWRITE");
|
|
|
|
+ body2.put("uploadKey",uploadKey);
|
|
|
|
+ body2.put("name",file.getName());
|
|
|
|
+ body2.put("option",option);
|
|
|
|
+ UtilHttp.doPost("https://api.dingtalk.com/v2.0/storage/spaces/files/" + parentDentryUuid + "/commit",ddClient.initTokenHeader(),param,body2);
|
|
|
|
+ }catch (IOException e){
|
|
|
|
+ System.out.println("上传文件异常");
|
|
|
|
+ }
|
|
|
|
|
|
- //提交文件
|
|
|
|
- Map body2 = new HashMap();
|
|
|
|
- Map option = new HashMap();
|
|
|
|
- option.put("conflictStrategy","OVERWRITE");
|
|
|
|
- body2.put("uploadKey",uploadKey);
|
|
|
|
- body2.put("name",file.getName());
|
|
|
|
- body2.put("option",option);
|
|
|
|
|
|
+ long endTimestamp = System.currentTimeMillis();
|
|
|
|
+ System.out.println("上传文件结束:" + endTimestamp);
|
|
|
|
+ System.out.println("上传文件耗时:" + (endTimestamp - beginTimestamp)/1000 + "s");
|
|
|
|
|
|
- UtilHttp.doPost("https://api.dingtalk.com/v2.0/storage/spaces/files/" + parentDentryUuid + "/commit",ddClient.initTokenHeader(),param,body2);
|
|
|
|
|
|
+ //发送工作通知给当前登陆人
|
|
|
|
+ if (Objects.nonNull(userId)){
|
|
|
|
+ Map param2 = new HashMap();
|
|
|
|
+ param2.put("access_token",ddClient.getAccessToken());
|
|
|
|
+ Map body3 = new HashMap();
|
|
|
|
+ body3.put("agent_id",ddConf.getAgentId());
|
|
|
|
+ body3.put("userid_list",userId);
|
|
|
|
+ Map msg = new HashMap();
|
|
|
|
+ msg.put("msgtype","text");
|
|
|
|
+ //获取当前时间 精确到秒
|
|
|
|
+ String time = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ msg.put("text",UtilMap.map("content","报表已同步完成!请到钉钉云盘查看 时间:" + time));
|
|
|
|
+ body3.put("msg",msg);
|
|
|
|
+ UtilHttp.doPost("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2",null,param2,body3);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- }catch (IOException e){
|
|
|
|
- System.out.println("上传文件异常");
|
|
|
|
|
|
+ @Override
|
|
|
|
+ @Async
|
|
|
|
+ public void uploadToDingTalk2(HttpServletResponse response,String userId,String month) {
|
|
|
|
+ //获取当前时间戳
|
|
|
|
+ long beginTimestamp = System.currentTimeMillis();
|
|
|
|
+ System.out.println("开始上传现金流量表:" + beginTimestamp);
|
|
|
|
+
|
|
|
|
+ //父节点dentryUuid
|
|
|
|
+ String parentDentryUuid = "ZX6GRezwJlRgBQmQCGE54DMQWdqbropQ";//知行同德
|
|
|
|
+ String year = DateUtil.year(new Date()) + "";
|
|
|
|
+
|
|
|
|
+ exportCash(response, year + "0" + month);
|
|
|
|
+
|
|
|
|
+ //文件
|
|
|
|
+ File file = new File(reportPath + "现金流量表-" + year + "0" + month + ".xlsx");
|
|
|
|
+
|
|
|
|
+ //获取文件上传信息
|
|
|
|
+ Map param = new HashMap();
|
|
|
|
+ param.put("unionId","b80wtLNgk1gXHvKn9eozugiEiE");//知行同德 lfx
|
|
|
|
+ Map body = new HashMap();
|
|
|
|
+ body.put("protocol","HEADER_SIGNATURE");
|
|
|
|
+
|
|
|
|
+ DDR_New ddr = (DDR_New) UtilHttp.doPost("https://api.dingtalk.com/v2.0/storage/spaces/files/" + parentDentryUuid + "/uploadInfos/query", ddConf.initTokenHeader(ddClient.getAccessToken()), param, body, DDR_New.class);
|
|
|
|
+ String uploadKey = ddr.getUploadKey();
|
|
|
|
+ Map headerSignatureInfo = ddr.getHeaderSignatureInfo();
|
|
|
|
+ Map<String,String> headers = (Map<String,String>) headerSignatureInfo.get("headers");
|
|
|
|
+ List<String> resourceUrls = (List<String>) headerSignatureInfo.get("resourceUrls");
|
|
|
|
+ String resourceUrl = resourceUrls.get(0);
|
|
|
|
+ //使用OSS的header加签方式上传文件
|
|
|
|
+ try {
|
|
|
|
+ URL url = new URL(resourceUrl);
|
|
|
|
+ HttpURLConnection connection = (HttpURLConnection)url.openConnection();
|
|
|
|
+ if (headers != null) {
|
|
|
|
+ for (Map.Entry<String, String> entry : headers.entrySet()) {
|
|
|
|
+ connection.setRequestProperty(entry.getKey(), entry.getValue());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ connection.setDoOutput(true);
|
|
|
|
+ connection.setRequestMethod("PUT");
|
|
|
|
+ connection.setUseCaches(false);
|
|
|
|
+ connection.setReadTimeout(10000);
|
|
|
|
+ connection.setConnectTimeout(10000);
|
|
|
|
+ connection.connect();
|
|
|
|
+ OutputStream out = connection.getOutputStream();
|
|
|
|
+ InputStream is = new FileInputStream(file);
|
|
|
|
+ byte[] b =new byte[1024];
|
|
|
|
+ int temp;
|
|
|
|
+ while ((temp=is.read(b))!=-1){
|
|
|
|
+ out.write(b,0,temp);
|
|
|
|
+ }
|
|
|
|
+ out.flush();
|
|
|
|
+ out.close();
|
|
|
|
+ int responseCode = connection.getResponseCode();
|
|
|
|
+ connection.disconnect();
|
|
|
|
+ if (responseCode == 200) {
|
|
|
|
+ System.out.println("上传成功");
|
|
|
|
+ } else {
|
|
|
|
+ System.out.println("上传失败");
|
|
}
|
|
}
|
|
|
|
+ //提交文件
|
|
|
|
+ Map body2 = new HashMap();
|
|
|
|
+ Map option = new HashMap();
|
|
|
|
+ option.put("conflictStrategy","OVERWRITE");
|
|
|
|
+ body2.put("uploadKey",uploadKey);
|
|
|
|
+ body2.put("name",file.getName());
|
|
|
|
+ body2.put("option",option);
|
|
|
|
+ UtilHttp.doPost("https://api.dingtalk.com/v2.0/storage/spaces/files/" + parentDentryUuid + "/commit",ddClient.initTokenHeader(),param,body2);
|
|
|
|
+ }catch (IOException e){
|
|
|
|
+ System.out.println("上传文件异常");
|
|
}
|
|
}
|
|
|
|
+
|
|
long endTimestamp = System.currentTimeMillis();
|
|
long endTimestamp = System.currentTimeMillis();
|
|
System.out.println("上传文件结束:" + endTimestamp);
|
|
System.out.println("上传文件结束:" + endTimestamp);
|
|
System.out.println("上传文件耗时:" + (endTimestamp - beginTimestamp)/1000 + "s");
|
|
System.out.println("上传文件耗时:" + (endTimestamp - beginTimestamp)/1000 + "s");
|
|
@@ -477,7 +560,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
msg.put("msgtype","text");
|
|
msg.put("msgtype","text");
|
|
//获取当前时间 精确到秒
|
|
//获取当前时间 精确到秒
|
|
String time = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
|
|
String time = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
|
|
- msg.put("text",UtilMap.map("content","报表已同步完成!请到钉钉云盘查看 时间:" + time));
|
|
|
|
|
|
+ msg.put("text",UtilMap.map("content","现金流量表已同步完成!请到钉钉云盘查看 时间:" + time));
|
|
body3.put("msg",msg);
|
|
body3.put("msg",msg);
|
|
UtilHttp.doPost("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2",null,param2,body3);
|
|
UtilHttp.doPost("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2",null,param2,body3);
|
|
}
|
|
}
|
|
@@ -598,6 +681,8 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
//查询资产负债手动维护表
|
|
//查询资产负债手动维护表
|
|
List<Map> artificialList = getYdFormDataList(_matchFormUuid("ARTIFICIAL"),JSONObject.toJSONString(UtilMap.map("textField_lxtzn9up",year)),YDConf.FORM_QUERY.retrieve_list_all);
|
|
List<Map> artificialList = getYdFormDataList(_matchFormUuid("ARTIFICIAL"),JSONObject.toJSONString(UtilMap.map("textField_lxtzn9up",year)),YDConf.FORM_QUERY.retrieve_list_all);
|
|
|
|
|
|
|
|
+ //查询往期数据手动维护表
|
|
|
|
+// List<Map> previousList = getYdFormDataList(_matchFormUuid("PREVIOUS"), JSONObject.toJSONString(UtilMap.map("textField_lxtzn9up", "202401")), YDConf.FORM_QUERY.retrieve_list);
|
|
|
|
|
|
//货币资金
|
|
//货币资金
|
|
Accounts accounts1 = new Accounts();
|
|
Accounts accounts1 = new Accounts();
|
|
@@ -622,11 +707,11 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
String amt = getBigDecimalStringAmt(formData.get("numberField_lp82nads"));
|
|
String amt = getBigDecimalStringAmt(formData.get("numberField_lp82nads"));
|
|
|
|
|
|
ReflectUtil.invoke(accounts1, "setAmt"+month, NumberUtil.sub(ReflectUtil.invoke(accounts1,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
ReflectUtil.invoke(accounts1, "setAmt"+month, NumberUtil.sub(ReflectUtil.invoke(accounts1,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
- List<String> accounts = (List<String>) formData.get("multiSelectField_lv0bm8qs");
|
|
|
|
|
|
+ /*List<String> accounts = (List<String>) formData.get("multiSelectField_lv0bm8qs");
|
|
String account = "";
|
|
String account = "";
|
|
if (Objects.nonNull(accounts) && !accounts.isEmpty()){
|
|
if (Objects.nonNull(accounts) && !accounts.isEmpty()){
|
|
account = accounts.get(0);
|
|
account = accounts.get(0);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -672,7 +757,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //获取收入中实际已收的金额-应收账款表
|
|
|
|
|
|
+ /*//获取收入中实际已收的金额-应收账款表
|
|
List<Map> collect = incomeList.stream().filter(p ->
|
|
List<Map> collect = incomeList.stream().filter(p ->
|
|
String.valueOf(((Map) p.get("formData")).get("selectField_ly2pd5cm")).equals("关联应收帐款表"))
|
|
String.valueOf(((Map) p.get("formData")).get("selectField_ly2pd5cm")).equals("关联应收帐款表"))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -684,12 +769,30 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
String month = String.valueOf(formData1.get("textField_lxl8moor")).substring(6);
|
|
String month = String.valueOf(formData1.get("textField_lxl8moor")).substring(6);
|
|
ReflectUtil.invoke(accounts3,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts3,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
ReflectUtil.invoke(accounts3,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts3,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
}
|
|
}
|
|
- }
|
|
|
|
- String addAmt = accounts3.getInitialAmt();
|
|
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ /*//应收-往期
|
|
|
|
+ List<Map> collect2 = previousList.stream().filter(p ->
|
|
|
|
+ String.valueOf(((Map) p.get("formData")).get("selectField_lyo7yox6")).equals("应收账款表"))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ if (!collect2.isEmpty()){
|
|
|
|
+ for (Map oneCollect : collect2) {
|
|
|
|
+ Map formData1 = (Map) oneCollect.get("formData");
|
|
|
|
+ String amt = String.valueOf(formData1.get("numberField_lyo7yox9"));
|
|
|
|
+ String month = String.valueOf(formData1.get("textField_lyo7yoxa")).substring(6);
|
|
|
|
+ ReflectUtil.invoke(accounts3,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts3,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
|
|
+ }
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ //累加
|
|
|
|
+ /*String addAmt = accounts3.getInitialAmt();
|
|
for (int i = 1; i < month1+2; i++) {
|
|
for (int i = 1; i < month1+2; i++) {
|
|
ReflectUtil.invoke(accounts3,"setAmt"+i,NumberUtil.add(ReflectUtil.invoke(accounts3,"getAmt"+i),addAmt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
ReflectUtil.invoke(accounts3,"setAmt"+i,NumberUtil.add(ReflectUtil.invoke(accounts3,"getAmt"+i),addAmt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
addAmt = ReflectUtil.invoke(accounts3,"getAmt"+i);
|
|
addAmt = ReflectUtil.invoke(accounts3,"getAmt"+i);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
//其他应收款
|
|
//其他应收款
|
|
@@ -720,11 +823,11 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //获取收入中实际已收的金额-应收账款表
|
|
|
|
|
|
+ /*//获取收入中实际已收的金额-应收账款表
|
|
List<Map> collect = incomeList.stream().filter(p ->
|
|
List<Map> collect = incomeList.stream().filter(p ->
|
|
String.valueOf(((Map) p.get("formData")).get("selectField_ly2pd5cm")).equals("关联其他应收款表"))
|
|
String.valueOf(((Map) p.get("formData")).get("selectField_ly2pd5cm")).equals("关联其他应收款表"))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
- //应收-已收
|
|
|
|
|
|
+ //其他应收-已收
|
|
if (!collect.isEmpty()){
|
|
if (!collect.isEmpty()){
|
|
for (Map oneCollect : collect) {
|
|
for (Map oneCollect : collect) {
|
|
Map formData1 = (Map) oneCollect.get("formData");
|
|
Map formData1 = (Map) oneCollect.get("formData");
|
|
@@ -732,13 +835,27 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
String month = String.valueOf(formData1.get("textField_lxl8moor")).substring(6);
|
|
String month = String.valueOf(formData1.get("textField_lxl8moor")).substring(6);
|
|
ReflectUtil.invoke(accounts2,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts2,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
ReflectUtil.invoke(accounts2,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts2,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ /*//其他应收-往期
|
|
|
|
+ List<Map> collect2 = previousList.stream().filter(p ->
|
|
|
|
+ String.valueOf(((Map) p.get("formData")).get("selectField_lyo7yox6")).equals("其他应收款表"))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ if (!collect2.isEmpty()){
|
|
|
|
+ for (Map oneCollect : collect2) {
|
|
|
|
+ Map formData1 = (Map) oneCollect.get("formData");
|
|
|
|
+ String amt = String.valueOf(formData1.get("numberField_lyo7yox9"));
|
|
|
|
+ String month = String.valueOf(formData1.get("textField_lyo7yoxa")).substring(6);
|
|
|
|
+ ReflectUtil.invoke(accounts3,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts3,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
|
|
+ }
|
|
|
|
+ }*/
|
|
|
|
|
|
- String addAmt = accounts2.getInitialAmt();
|
|
|
|
|
|
+ //累加
|
|
|
|
+ /*String addAmt = accounts2.getInitialAmt();
|
|
for (int i = 1; i < month1+2; i++) {
|
|
for (int i = 1; i < month1+2; i++) {
|
|
ReflectUtil.invoke(accounts2,"setAmt"+i,NumberUtil.add(ReflectUtil.invoke(accounts2,"getAmt"+i),addAmt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
ReflectUtil.invoke(accounts2,"setAmt"+i,NumberUtil.add(ReflectUtil.invoke(accounts2,"getAmt"+i),addAmt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
addAmt = ReflectUtil.invoke(accounts2,"getAmt"+i);
|
|
addAmt = ReflectUtil.invoke(accounts2,"getAmt"+i);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
|
|
|
|
//手填数据
|
|
//手填数据
|
|
@@ -811,7 +928,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //获取支出中实际已付的金额-应付账款表
|
|
|
|
|
|
+ /*//获取支出中实际已付的金额-应付账款表
|
|
List<Map> collect = payList.stream().filter(p ->
|
|
List<Map> collect = payList.stream().filter(p ->
|
|
String.valueOf(((Map) p.get("formData")).get("selectField_ly2lhkpe")).equals("关联应付账款表"))
|
|
String.valueOf(((Map) p.get("formData")).get("selectField_ly2lhkpe")).equals("关联应付账款表"))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
@@ -823,12 +940,26 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
String month = String.valueOf(formData1.get("textField_lqvpypje")).substring(6);
|
|
String month = String.valueOf(formData1.get("textField_lqvpypje")).substring(6);
|
|
ReflectUtil.invoke(accounts12,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts12,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
ReflectUtil.invoke(accounts12,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts12,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
}
|
|
}
|
|
- }
|
|
|
|
- String addAmt = accounts12.getInitialAmt();
|
|
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ /*//应付-往期
|
|
|
|
+ List<Map> collect2 = previousList.stream().filter(p ->
|
|
|
|
+ String.valueOf(((Map) p.get("formData")).get("selectField_lyo7yox6")).equals("应付账款表"))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ if (!collect2.isEmpty()){
|
|
|
|
+ for (Map oneCollect : collect2) {
|
|
|
|
+ Map formData1 = (Map) oneCollect.get("formData");
|
|
|
|
+ String amt = String.valueOf(formData1.get("numberField_lyo7yox9"));
|
|
|
|
+ String month = String.valueOf(formData1.get("textField_lyo7yoxa")).substring(6);
|
|
|
|
+ ReflectUtil.invoke(accounts3,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts3,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
|
|
+ }
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ /*String addAmt = accounts12.getInitialAmt();
|
|
for (int i = 1; i < month1+2; i++) {
|
|
for (int i = 1; i < month1+2; i++) {
|
|
ReflectUtil.invoke(accounts12,"setAmt"+i,NumberUtil.add(ReflectUtil.invoke(accounts12,"getAmt"+i),addAmt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
ReflectUtil.invoke(accounts12,"setAmt"+i,NumberUtil.add(ReflectUtil.invoke(accounts12,"getAmt"+i),addAmt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
addAmt = ReflectUtil.invoke(accounts12,"getAmt"+i);
|
|
addAmt = ReflectUtil.invoke(accounts12,"getAmt"+i);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -862,11 +993,11 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //获取支出中实际已付的金额-其他应付款表
|
|
|
|
|
|
+ /*//获取支出中实际已付的金额-其他应付款表
|
|
List<Map> collect = payList.stream().filter(p ->
|
|
List<Map> collect = payList.stream().filter(p ->
|
|
String.valueOf(((Map) p.get("formData")).get("selectField_ly2lhkpe")).equals("关联其他应付款表"))
|
|
String.valueOf(((Map) p.get("formData")).get("selectField_ly2lhkpe")).equals("关联其他应付款表"))
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
- //应付-已付
|
|
|
|
|
|
+ //其他应付-已付
|
|
if (!collect.isEmpty()){
|
|
if (!collect.isEmpty()){
|
|
for (Map oneCollect : collect) {
|
|
for (Map oneCollect : collect) {
|
|
Map formData1 = (Map) oneCollect.get("formData");
|
|
Map formData1 = (Map) oneCollect.get("formData");
|
|
@@ -874,13 +1005,27 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
String month = String.valueOf(formData1.get("textField_lqvpypje")).substring(6);
|
|
String month = String.valueOf(formData1.get("textField_lqvpypje")).substring(6);
|
|
ReflectUtil.invoke(accounts10,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts10,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
ReflectUtil.invoke(accounts10,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts10,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
- String addAmt = accounts10.getInitialAmt();
|
|
|
|
|
|
+ /*//其他应付-往期
|
|
|
|
+ List<Map> collect2 = previousList.stream().filter(p ->
|
|
|
|
+ String.valueOf(((Map) p.get("formData")).get("selectField_lyo7yox6")).equals("其他应付款表"))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ if (!collect2.isEmpty()){
|
|
|
|
+ for (Map oneCollect : collect2) {
|
|
|
|
+ Map formData1 = (Map) oneCollect.get("formData");
|
|
|
|
+ String amt = String.valueOf(formData1.get("numberField_lyo7yox9"));
|
|
|
|
+ String month = String.valueOf(formData1.get("textField_lyo7yoxa")).substring(6);
|
|
|
|
+ ReflectUtil.invoke(accounts3,"setAmt"+month,NumberUtil.sub(ReflectUtil.invoke(accounts3,"getAmt"+month),amt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
|
|
+ }
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ //累加
|
|
|
|
+ /*String addAmt = accounts10.getInitialAmt();
|
|
for (int i = 1; i < month1+2; i++) {
|
|
for (int i = 1; i < month1+2; i++) {
|
|
ReflectUtil.invoke(accounts10,"setAmt"+i,NumberUtil.add(ReflectUtil.invoke(accounts10,"getAmt"+i),addAmt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
ReflectUtil.invoke(accounts10,"setAmt"+i,NumberUtil.add(ReflectUtil.invoke(accounts10,"getAmt"+i),addAmt).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
addAmt = ReflectUtil.invoke(accounts10,"getAmt"+i);
|
|
addAmt = ReflectUtil.invoke(accounts10,"getAmt"+i);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
|
|
|
|
//未分配利润
|
|
//未分配利润
|
|
@@ -1048,6 +1193,7 @@ public class ZxtdReportServiceImpl implements ZxtdReportService {
|
|
incomeJsonString.add(COMPLETED_STATUS);
|
|
incomeJsonString.add(COMPLETED_STATUS);
|
|
incomeJsonString.add(AGREE_RESULT);
|
|
incomeJsonString.add(AGREE_RESULT);
|
|
String incomeSearchCondition = JSONObject.toJSONString(incomeJsonString);
|
|
String incomeSearchCondition = JSONObject.toJSONString(incomeJsonString);
|
|
|
|
+ String s = _matchFormUuid("INCOME");
|
|
List<Map> incomeDataList = getYdFormDataList(_matchFormUuid("INCOME"),incomeSearchCondition,YDConf.FORM_QUERY.retrieve_list);
|
|
List<Map> incomeDataList = getYdFormDataList(_matchFormUuid("INCOME"),incomeSearchCondition,YDConf.FORM_QUERY.retrieve_list);
|
|
|
|
|
|
// List<Map> incomeDataList = getYdFormDataList(_matchFormUuid("INCOME"),JSONObject.toJSONString(UtilMap.map("textField_lqvp25z0", year)),YDConf.FORM_QUERY.retrieve_list);
|
|
// List<Map> incomeDataList = getYdFormDataList(_matchFormUuid("INCOME"),JSONObject.toJSONString(UtilMap.map("textField_lqvp25z0", year)),YDConf.FORM_QUERY.retrieve_list);
|