|
@@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.sql.*;
|
|
import java.sql.*;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
|
+import java.time.Year;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
@@ -253,6 +254,107 @@ public class NCServiceImpl implements NCService {
|
|
String month = String.format("%02d",lastMonth.getMonthValue()) ;
|
|
String month = String.format("%02d",lastMonth.getMonthValue()) ;
|
|
deleteMonthDate("FORM-5654B7C22E7546E9BBE7B4EF46DE08BAXZXU","textField_m0dkzhwo", String.valueOf(year),month);
|
|
deleteMonthDate("FORM-5654B7C22E7546E9BBE7B4EF46DE08BAXZXU","textField_m0dkzhwo", String.valueOf(year),month);
|
|
|
|
|
|
|
|
+ System.out.println(month);
|
|
|
|
+ Connection connection = null;
|
|
|
|
+ Statement statement = null;
|
|
|
|
+ ResultSet resultSet = null;
|
|
|
|
+ try {
|
|
|
|
+ // 加载 JDBC 驱动
|
|
|
|
+ Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
|
|
|
|
+ // 建立连接
|
|
|
|
+ connection = DriverManager.getConnection(sqlBean.getUrl(), sqlBean.getUsername(), sqlBean.getPassword());
|
|
|
|
+
|
|
|
|
+ // 创建 Statement 对象
|
|
|
|
+ statement = connection.createStatement();
|
|
|
|
+
|
|
|
|
+ // 测试sql 执行查询
|
|
|
|
+ String sql = "select \n" +
|
|
|
|
+ " org_accountingbook.code orgcode,\n" +
|
|
|
|
+ " org_accountingbook.name orgname,\n" +
|
|
|
|
+ " bd_account.code kmcode,\n" +
|
|
|
|
+ " substring(bd_account.code,0,5) kmbm,\n" +
|
|
|
|
+ " bd_accasoa.name kmname,\n" +
|
|
|
|
+ " bd_accasoa.dispname KMMC,\n" +
|
|
|
|
+ " org_dept.code bmcode,\n" +
|
|
|
|
+ " org_dept.name bmname,\n" +
|
|
|
|
+ " bd_project.project_code xmcode,\n" +
|
|
|
|
+ " bd_project.project_name xmname,\n" +
|
|
|
|
+ " SUM(gl_detail.localdebitamount) JFFS\n" +
|
|
|
|
+ " from gl_detail gl_detail\n" +
|
|
|
|
+ " left join gl_docfree1 on gl_detail.assid = gl_docfree1.assid\n" +
|
|
|
|
+ " left join org_dept on gl_docfree1.f1 = org_dept.pk_dept\n" +
|
|
|
|
+ " left join bd_project on gl_docfree1.f10=bd_project.pk_project\n" +
|
|
|
|
+ " left join org_accountingbook on gl_detail.pk_accountingbook=org_accountingbook.pk_accountingbook\n" +
|
|
|
|
+ " left join bd_accasoa on gl_detail.pk_accasoa=bd_accasoa.pk_accasoa\n" +
|
|
|
|
+ " left join bd_account on bd_accasoa.pk_account=bd_account.pk_account\n" +
|
|
|
|
+ " \n" +
|
|
|
|
+ " where substring(bd_account.code,0,5) in ('6602','6601')\n" +
|
|
|
|
+ " and gl_detail.yearv = '"+ year +"'\n" +
|
|
|
|
+ " and gl_detail.adjustperiod = '" + month + "'\n" +
|
|
|
|
+ " and org_accountingbook.code in('A01-0004','A02-0004','A11-0004','A03-0004','A06-0004','A04-0004','A05-0004','A10-0004')\n" +
|
|
|
|
+ " and gl_detail.discardflagv <> 'Y'\n" +
|
|
|
|
+ " and gl_detail.dr = 0\n" +
|
|
|
|
+ " and gl_detail.voucherkindv <> 255\n" +
|
|
|
|
+ " and gl_detail.tempsaveflag <> 'Y'\n" +
|
|
|
|
+ " and gl_detail.voucherkindv <> 5\n" +
|
|
|
|
+ " and (gl_docfree1.F1 <> 'NN/A' or gl_docfree1.F10 <> 'NN/A' )\n" +
|
|
|
|
+ " and 1 = 1\n" +
|
|
|
|
+ " group by gl_detail.pk_accasoa,\n" +
|
|
|
|
+ " gl_detail.pk_accountingbook,\n" +
|
|
|
|
+ " gl_detail.yearv,\n" +
|
|
|
|
+ " org_dept.code ,\n" +
|
|
|
|
+ " org_dept.name ,\n" +
|
|
|
|
+ " org_accountingbook.code,\n" +
|
|
|
|
+ " org_accountingbook.name,\n" +
|
|
|
|
+ " bd_accasoa.dispname,\n" +
|
|
|
|
+ " bd_account.code,\n" +
|
|
|
|
+ " bd_accasoa.name,\n" +
|
|
|
|
+ " bd_project.project_code,\n" +
|
|
|
|
+ " bd_project.project_name";
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ resultSet = statement.executeQuery(sql);
|
|
|
|
+
|
|
|
|
+ while (resultSet.next()) {
|
|
|
|
+ Map hashMap = new HashMap();
|
|
|
|
+
|
|
|
|
+ String yearAndNonth = year +"-"+month;
|
|
|
|
+ hashMap.put("dateField_m0dkzhwp", UtilDateTime.parse(yearAndNonth,"yyyy-MM"));
|
|
|
|
+ hashMap.put("textField_m0dkzhwo", yearAndNonth);
|
|
|
|
+ hashMap.put("textField_m0dkzhwu",resultSet.getString("kmcode"));
|
|
|
|
+ hashMap.put("textField_m0dkzhwv",resultSet.getString("kmname"));
|
|
|
|
+ hashMap.put("textField_m0eudqp0",resultSet.getString("bmname"));//部门
|
|
|
|
+ hashMap.put("numberField_m0dkzhx1",resultSet.getBigDecimal("JFFS"));
|
|
|
|
+
|
|
|
|
+ ydClient.operateData(YDParam.builder()
|
|
|
|
+ .appType("APP_ERBDTFS82HOVBPL3NFH0")
|
|
|
|
+ .systemToken("RRB66F91T97H1WN89QZYC47PKLZO2ZQOUMOQLP")
|
|
|
|
+ .formUuid("FORM-5654B7C22E7546E9BBE7B4EF46DE08BAXZXU")
|
|
|
|
+ .formDataJson(JSON.toJSONString(hashMap))
|
|
|
|
+ .build(), YDConf.FORM_OPERATION.create);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.info("数据库连接异常"+e.toString());
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ } finally {
|
|
|
|
+ // 关闭资源
|
|
|
|
+ try {
|
|
|
|
+ if (resultSet != null) resultSet.close();
|
|
|
|
+ if (statement != null) statement.close();
|
|
|
|
+ if (connection != null) connection.close();
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void getNcCollectionOld() {
|
|
|
|
+ // 获取当前年
|
|
|
|
+ int year = lastMonth.getYear();
|
|
|
|
+ String month = String.format("%02d",lastMonth.getMonthValue()) ;
|
|
|
|
+ deleteMonthDate("FORM-5654B7C22E7546E9BBE7B4EF46DE08BAXZXU","textField_m0dkzhwo", String.valueOf(year),month);
|
|
|
|
+
|
|
System.out.println(month);
|
|
System.out.println(month);
|
|
Connection connection = null;
|
|
Connection connection = null;
|
|
Statement statement = null;
|
|
Statement statement = null;
|
|
@@ -294,7 +396,7 @@ public class NCServiceImpl implements NCService {
|
|
ydClient.operateData(YDParam.builder()
|
|
ydClient.operateData(YDParam.builder()
|
|
.appType("APP_ERBDTFS82HOVBPL3NFH0")
|
|
.appType("APP_ERBDTFS82HOVBPL3NFH0")
|
|
.systemToken("RRB66F91T97H1WN89QZYC47PKLZO2ZQOUMOQLP")
|
|
.systemToken("RRB66F91T97H1WN89QZYC47PKLZO2ZQOUMOQLP")
|
|
- .formUuid("FORM-5654B7C22E7546E9BBE7B4EF46DE08BAXZXU")
|
|
|
|
|
|
+ .formUuid("FORM-0A7979E168AF494F9AA190F043DCBBC7CW9Z")
|
|
.formDataJson(JSON.toJSONString(hashMap))
|
|
.formDataJson(JSON.toJSONString(hashMap))
|
|
.build(), YDConf.FORM_OPERATION.create);
|
|
.build(), YDConf.FORM_OPERATION.create);
|
|
}
|
|
}
|
|
@@ -789,6 +891,7 @@ public class NCServiceImpl implements NCService {
|
|
});
|
|
});
|
|
Map<String, Long> collect = personList.stream().collect(Collectors.groupingBy(i -> i, Collectors.counting()));
|
|
Map<String, Long> collect = personList.stream().collect(Collectors.groupingBy(i -> i, Collectors.counting()));
|
|
|
|
|
|
|
|
+// log.info("collect:{}",collect);
|
|
final Double[] zsdglfy = {0.0};
|
|
final Double[] zsdglfy = {0.0};
|
|
final Double[] zsdsum = {0.0};
|
|
final Double[] zsdsum = {0.0};
|
|
//直属队
|
|
//直属队
|
|
@@ -799,19 +902,21 @@ public class NCServiceImpl implements NCService {
|
|
.searchCondition(JSON.toJSONString(UtilMap.map("textField_lrr3rg6i","直属队")))
|
|
.searchCondition(JSON.toJSONString(UtilMap.map("textField_lrr3rg6i","直属队")))
|
|
.build());
|
|
.build());
|
|
zsd.forEach(e->{
|
|
zsd.forEach(e->{
|
|
- if (ObjectUtil.isNotNull(manageList)){
|
|
|
|
|
|
+ if (ObjectUtil.isNotNull(manageList) && manageList.size() > 0){
|
|
manageList.forEach(s->{
|
|
manageList.forEach(s->{
|
|
- double manage_compute = s.get("manage_compute") == null ? 0.0 : Double.parseDouble(s.get("manage_compute").toString());
|
|
|
|
|
|
+// log.info("manage_compute数据:{}",s.get("manage_compute"));
|
|
|
|
+ double manage_compute = s.get("manage_compute") == null || s.get("manage_compute").toString().isEmpty() ? 0.0 : Double.parseDouble(s.get("manage_compute").toString());
|
|
zsdsum[0] = zsdsum[0] + manage_compute;
|
|
zsdsum[0] = zsdsum[0] + manage_compute;
|
|
});
|
|
});
|
|
- if (workingEmployeeIds.size() * zsdsum[0] == 0.0){
|
|
|
|
|
|
+ if (workingEmployeeIds.size() == 0 || workingEmployeeIds.size() * zsdsum[0] == 0.0){
|
|
zsdglfy[0] = 0.0;
|
|
zsdglfy[0] = 0.0;
|
|
}else {
|
|
}else {
|
|
- zsdglfy[0] = zsdglfy[0] + collect.get("直属队") / workingEmployeeIds.size() * zsdsum[0];
|
|
|
|
|
|
+ zsdglfy[0] = zsdglfy[0] + (collect.get("工程部(直属队)")==null||collect.get("工程部(直属队)").toString().isEmpty()?0.0:Double.parseDouble(collect.get("工程部(直属队)").toString()) )/ zsdsum[0];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ log.info("zsdglfy[0]:{}",zsdglfy[0]);
|
|
List<Map> projectList = new ArrayList<>();
|
|
List<Map> projectList = new ArrayList<>();
|
|
dataList = dataList.stream().filter(e -> !"PM99006".equals(e.get("textField_ltxrn8h1")) && !"PM99016".equals(e.get("textField_ltxrn8h1")) && !"PM99014".equals(e.get("textField_ltxrn8h1"))).collect(Collectors.toList());
|
|
dataList = dataList.stream().filter(e -> !"PM99006".equals(e.get("textField_ltxrn8h1")) && !"PM99016".equals(e.get("textField_ltxrn8h1")) && !"PM99014".equals(e.get("textField_ltxrn8h1"))).collect(Collectors.toList());
|
|
dataList.forEach(e-> {
|
|
dataList.forEach(e-> {
|
|
@@ -864,7 +969,7 @@ public class NCServiceImpl implements NCService {
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ";
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ";
|
|
ps[0] = mysqlCon.prepareStatement(insert);
|
|
ps[0] = mysqlCon.prepareStatement(insert);
|
|
|
|
|
|
- dataList.forEach(e->{
|
|
|
|
|
|
+ dataList.forEach(e-> {
|
|
List<Map> tableList = ydService.queryDetails(YDParam.builder().
|
|
List<Map> tableList = ydService.queryDetails(YDParam.builder().
|
|
appType("APP_ERBDTFS82HOVBPL3NFH0")
|
|
appType("APP_ERBDTFS82HOVBPL3NFH0")
|
|
.systemToken("RRB66F91T97H1WN89QZYC47PKLZO2ZQOUMOQLP")
|
|
.systemToken("RRB66F91T97H1WN89QZYC47PKLZO2ZQOUMOQLP")
|
|
@@ -877,13 +982,13 @@ public class NCServiceImpl implements NCService {
|
|
String name = e.get("textField_lrr3rg6i").toString();
|
|
String name = e.get("textField_lrr3rg6i").toString();
|
|
// int personCount = e.get("numberField_lrpvi1wf_value") == null || e.get("numberField_lrpvi1wf_value").toString().isEmpty() ? 0 : Integer.parseInt(e.get("numberField_lrpvi1wf_value").toString());
|
|
// int personCount = e.get("numberField_lrpvi1wf_value") == null || e.get("numberField_lrpvi1wf_value").toString().isEmpty() ? 0 : Integer.parseInt(e.get("numberField_lrpvi1wf_value").toString());
|
|
// log.info("项目点名称:{}",name);
|
|
// log.info("项目点名称:{}",name);
|
|
- final Double[] sum = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
|
|
|
|
|
|
+ final Double[] sum = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
|
|
final Integer[] person = {0};
|
|
final Integer[] person = {0};
|
|
// person[0] = person[0] + personCount;
|
|
// person[0] = person[0] + personCount;
|
|
- if (!tableList.isEmpty()){
|
|
|
|
- tableList.forEach(t->{
|
|
|
|
- double open = t.get("numberField_lrru2to2_value") == null || t.get("numberField_lrru2to2_value").toString().isEmpty() ? 0.0: Double.parseDouble(t.get("numberField_lrru2to2_value").toString());
|
|
|
|
- double income = open == 0.0 ? Double.parseDouble("".equals(t.get("numberField_lryopn7o_value")) ?"0.0":t.get("numberField_lryopn7o_value").toString()) : open;
|
|
|
|
|
|
+ if (!tableList.isEmpty()) {
|
|
|
|
+ tableList.forEach(t -> {
|
|
|
|
+ double open = t.get("numberField_lrru2to2_value") == null || t.get("numberField_lrru2to2_value").toString().isEmpty() ? 0.0 : Double.parseDouble(t.get("numberField_lrru2to2_value").toString());
|
|
|
|
+ double income = open == 0.0 ? Double.parseDouble("".equals(t.get("numberField_lryopn7o_value")) ? "0.0" : t.get("numberField_lryopn7o_value").toString()) : open;
|
|
//小业主预估
|
|
//小业主预估
|
|
double small = (t.get("numberField_m5uf580r_value") == null || t.get("numberField_m5uf580r_value").toString().isEmpty()) ? 0f : Double.parseDouble(t.get("numberField_m5uf580r_value").toString());
|
|
double small = (t.get("numberField_m5uf580r_value") == null || t.get("numberField_m5uf580r_value").toString().isEmpty()) ? 0f : Double.parseDouble(t.get("numberField_m5uf580r_value").toString());
|
|
//总计人数
|
|
//总计人数
|
|
@@ -893,6 +998,9 @@ public class NCServiceImpl implements NCService {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (sum[7] > 0.0) {
|
|
|
|
+
|
|
|
|
+// }
|
|
// //小业主合同月金额数据
|
|
// //小业主合同月金额数据
|
|
// if (ObjectUtil.isNotNull(smallList)){
|
|
// if (ObjectUtil.isNotNull(smallList)){
|
|
// smallList.forEach(s->{
|
|
// smallList.forEach(s->{
|
|
@@ -903,62 +1011,62 @@ public class NCServiceImpl implements NCService {
|
|
// });
|
|
// });
|
|
// }
|
|
// }
|
|
// //算薪人数
|
|
// //算薪人数
|
|
- if (ObjectUtil.isNotNull(collect)){
|
|
|
|
- person[0] = ObjectUtil.isNotNull(collect.get(name))?Math.toIntExact(collect.get(name)):0;
|
|
|
|
- }
|
|
|
|
- //生产成本-工资
|
|
|
|
- if (ObjectUtil.isNotNull(personCostList)){
|
|
|
|
- personCostList.forEach(s->{
|
|
|
|
- if (code.equals(s.get("xmcode"))){
|
|
|
|
- double person_cost_compute = s.get("person_cost_compute") == null ? 0.0 : Double.parseDouble(s.get("person_cost_compute").toString());
|
|
|
|
- sum[1] = sum[1] + person_cost_compute;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- //500114,500115生产成本-材料费
|
|
|
|
- if (ObjectUtil.isNotNull(materialList)){
|
|
|
|
- materialList.forEach(s->{
|
|
|
|
- if (code.equals(s.get("xmcode"))){
|
|
|
|
- double material_compute = s.get("material_compute") == null ? 0.0 : Double.parseDouble(s.get("material_compute").toString());
|
|
|
|
- sum[2] = sum[2] + material_compute;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- //500118,500119,500120,500121生产成本-折修
|
|
|
|
- if (ObjectUtil.isNotNull(repairList)){
|
|
|
|
- repairList.forEach(s->{
|
|
|
|
- if (code.equals(s.get("xmcode"))){
|
|
|
|
- double material_compute = s.get("material_compute") == null ? 0.0 : Double.parseDouble(s.get("material_compute").toString());
|
|
|
|
- sum[9] = sum[9] + material_compute;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- //5001生产成本-其他
|
|
|
|
- if (ObjectUtil.isNotNull(otherList)) {
|
|
|
|
- otherList.forEach(s -> {
|
|
|
|
- if (code.equals(s.get("xmcode"))) {
|
|
|
|
- double other_compute = s.get("other_compute") == null ? 0.0 : Double.parseDouble(s.get("other_compute").toString());
|
|
|
|
- sum[3] = sum[3] + other_compute;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- //6001+6002+6003 管理费用分子(去掉6003)
|
|
|
|
- if (ObjectUtil.isNotNull(manageList)){
|
|
|
|
- manageList.forEach(s->{
|
|
|
|
- double manage_compute = s.get("manage_compute") == null ? 0.0 : Double.parseDouble(s.get("manage_compute").toString());
|
|
|
|
- sum[4] = sum[4] + manage_compute;
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- //600101+600102+600103+600106+600109 管理费用分母
|
|
|
|
- if (ObjectUtil.isNotNull(manageProjectList)){
|
|
|
|
- manageProjectList.forEach(s->{
|
|
|
|
- if (code.equals(s.get("xmcode"))) {
|
|
|
|
- double manage_project_compute = s.get("manage_project_compute") == null ? 0.0 : Double.parseDouble(s.get("manage_project_compute").toString());
|
|
|
|
- sum[5] = sum[5] + manage_project_compute;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- //6801企业所得税
|
|
|
|
|
|
+ if (ObjectUtil.isNotNull(collect)) {
|
|
|
|
+ person[0] = ObjectUtil.isNotNull(collect.get(name)) ? Math.toIntExact(collect.get(name)) : 0;
|
|
|
|
+ }
|
|
|
|
+ //生产成本-工资
|
|
|
|
+ if (ObjectUtil.isNotNull(personCostList)) {
|
|
|
|
+ personCostList.forEach(s -> {
|
|
|
|
+ if (code.equals(s.get("xmcode"))) {
|
|
|
|
+ double person_cost_compute = s.get("person_cost_compute") == null ? 0.0 : Double.parseDouble(s.get("person_cost_compute").toString());
|
|
|
|
+ sum[1] = sum[1] + person_cost_compute;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ //500114,500115生产成本-材料费
|
|
|
|
+ if (ObjectUtil.isNotNull(materialList)) {
|
|
|
|
+ materialList.forEach(s -> {
|
|
|
|
+ if (code.equals(s.get("xmcode"))) {
|
|
|
|
+ double material_compute = s.get("material_compute") == null ? 0.0 : Double.parseDouble(s.get("material_compute").toString());
|
|
|
|
+ sum[2] = sum[2] + material_compute;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ //500118,500119,500120,500121生产成本-折修
|
|
|
|
+ if (ObjectUtil.isNotNull(repairList)) {
|
|
|
|
+ repairList.forEach(s -> {
|
|
|
|
+ if (code.equals(s.get("xmcode"))) {
|
|
|
|
+ double material_compute = s.get("material_compute") == null ? 0.0 : Double.parseDouble(s.get("material_compute").toString());
|
|
|
|
+ sum[9] = sum[9] + material_compute;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ //5001生产成本-其他
|
|
|
|
+ if (ObjectUtil.isNotNull(otherList)) {
|
|
|
|
+ otherList.forEach(s -> {
|
|
|
|
+ if (code.equals(s.get("xmcode"))) {
|
|
|
|
+ double other_compute = s.get("other_compute") == null ? 0.0 : Double.parseDouble(s.get("other_compute").toString());
|
|
|
|
+ sum[3] = sum[3] + other_compute;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ //6001+6002+6003 管理费用分子(去掉6003)
|
|
|
|
+ if (ObjectUtil.isNotNull(manageList)) {
|
|
|
|
+ manageList.forEach(s -> {
|
|
|
|
+ double manage_compute = s.get("manage_compute") == null ? 0.0 : Double.parseDouble(s.get("manage_compute").toString());
|
|
|
|
+ sum[4] = sum[4] + manage_compute;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ //600101+600102+600103+600106+600109 管理费用分母
|
|
|
|
+ if (ObjectUtil.isNotNull(manageProjectList)) {
|
|
|
|
+ manageProjectList.forEach(s -> {
|
|
|
|
+ if (code.equals(s.get("xmcode"))) {
|
|
|
|
+ double manage_project_compute = s.get("manage_project_compute") == null ? 0.0 : Double.parseDouble(s.get("manage_project_compute").toString());
|
|
|
|
+ sum[5] = sum[5] + manage_project_compute;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ //6801企业所得税
|
|
/* if(ObjectUtil.isNotNull(businessIncomeList)){
|
|
/* if(ObjectUtil.isNotNull(businessIncomeList)){
|
|
businessIncomeList.forEach(s->{
|
|
businessIncomeList.forEach(s->{
|
|
// if (code.equals(s.get("xmcode"))) {
|
|
// if (code.equals(s.get("xmcode"))) {
|
|
@@ -968,72 +1076,73 @@ public class NCServiceImpl implements NCService {
|
|
});
|
|
});
|
|
}*/
|
|
}*/
|
|
|
|
|
|
- try {
|
|
|
|
- ps[0].setObject(1,name);
|
|
|
|
- ps[0].setObject(2,null);
|
|
|
|
- ps[0].setObject(3,UtilDateTime.parse(yearAndMonth,"yyyy-MM").getTime());
|
|
|
|
- ps[0].setObject(4,e.get("selectField_lrn2oy4a")==null?null:e.get("selectField_lrn2oy4a").toString());
|
|
|
|
- ps[0].setObject(5,sum[7]/*/1.06*//10000); //预估
|
|
|
|
- ps[0].setObject(6,sum[8]/*/1.06*//10000); //开票
|
|
|
|
- ps[0].setObject(7,(sum[7]+sum[0])/*/1.06*//10000);//收入
|
|
|
|
- ps[0].setObject(8,person[0]);//人数
|
|
|
|
- ps[0].setObject(9,sum[1]/10000);
|
|
|
|
- ps[0].setObject(10,sum[2]/10000);
|
|
|
|
- ps[0].setObject(11,(sum[3]-sum[2]-sum[1]-sum[9])/10000);
|
|
|
|
- ps[0].setObject(12,sum[3]/10000);
|
|
|
|
- ps[0].setObject(13,(sum[7]+sum[0])*0.066/*/1.06*//10000);
|
|
|
|
- ps[0].setObject(14,((sum[7]+sum[0])/1.06-sum[3])/10000);
|
|
|
|
- ps[0].setObject(15,(sum[7]+sum[0]) == 0.0 ? 0.0:(sum[7]+sum[0]-sum[3])/(sum[7]+sum[0]));
|
|
|
|
- double glfy = 0.0 ;
|
|
|
|
- double corporate_income_tax = (sum[7]+sum[0])/10000 * 0.01;
|
|
|
|
- if ("直属队".equals(name)){
|
|
|
|
- glfy = zsdglfy[0];
|
|
|
|
- }else {
|
|
|
|
- //除直属队外项目的管理费用分摊,项目点收入 /(去除直属队、去除运作模式=整体外包的项目收入合计)*(管理费用合计-直属队管理费用);
|
|
|
|
- glfy = sum[7] / exceptZSDIncome * zsdsum[0];
|
|
|
|
- }
|
|
|
|
|
|
+ try {
|
|
|
|
+ ps[0].setObject(1, name);
|
|
|
|
+ ps[0].setObject(2, null);
|
|
|
|
+ ps[0].setObject(3, UtilDateTime.parse(yearAndMonth, "yyyy-MM").getTime());
|
|
|
|
+ ps[0].setObject(4, e.get("selectField_lrn2oy4a") == null ? null : e.get("selectField_lrn2oy4a").toString());
|
|
|
|
+ ps[0].setObject(5, sum[7]/*/1.06*/ / 10000); //预估
|
|
|
|
+ ps[0].setObject(6, sum[8]/*/1.06*/ / 10000); //开票
|
|
|
|
+ ps[0].setObject(7, (sum[7] + sum[0])/*/1.06*/ / 10000);//收入
|
|
|
|
+ ps[0].setObject(8, person[0]);//人数
|
|
|
|
+ ps[0].setObject(9, sum[1] / 10000);
|
|
|
|
+ ps[0].setObject(10, sum[2] / 10000);
|
|
|
|
+ ps[0].setObject(11, (sum[3] - sum[2] - sum[1] - sum[9]) / 10000);
|
|
|
|
+ ps[0].setObject(12, sum[3] / 10000);
|
|
|
|
+ ps[0].setObject(13, (sum[7] + sum[0]) * 0.066/*/1.06*/ / 10000);
|
|
|
|
+ ps[0].setObject(14, ((sum[7] + sum[0]) / 1.06 - sum[3]) / 10000);
|
|
|
|
+ ps[0].setObject(15, (sum[7] + sum[0]) == 0.0 ? 0.0 : (sum[7] + sum[0] - sum[3]) / (sum[7] + sum[0]));
|
|
|
|
+ double glfy = 0.0;
|
|
|
|
+ double corporate_income_tax = (sum[7] + sum[0]) / 10000 * 0.01;
|
|
|
|
+ if ("直属队".equals(name)) {
|
|
|
|
+ glfy = zsdglfy[0];
|
|
|
|
+ } else {
|
|
|
|
+ //除直属队外项目的管理费用分摊,项目点收入 /(去除直属队、去除运作模式=整体外包的项目收入合计)*(管理费用合计-直属队管理费用);
|
|
|
|
+ glfy = sum[7] / exceptZSDIncome * zsdsum[0];
|
|
|
|
+ }
|
|
// if ((sumProject+sumSamll) != 0.0){
|
|
// if ((sumProject+sumSamll) != 0.0){
|
|
// corporate_income_tax = (sum[7]+sum[0])/(sumProject+sumSamll)*sum[6];
|
|
// corporate_income_tax = (sum[7]+sum[0])/(sumProject+sumSamll)*sum[6];
|
|
// glfy = sum[4]/(sumProject+sumSamll)*(sum[7]+sum[0]);
|
|
// glfy = sum[4]/(sumProject+sumSamll)*(sum[7]+sum[0]);
|
|
// }
|
|
// }
|
|
- ps[0].setObject(16,glfy/10000);
|
|
|
|
- //企业所得税corporate_income_tax
|
|
|
|
- ps[0].setObject(17,corporate_income_tax/10000);
|
|
|
|
- ps[0].setObject(18,((sum[7] + sum[0])/* / 1.06*/ - sum[3] - glfy - corporate_income_tax)/10000);
|
|
|
|
- double net_margin = (sum[7] + sum[0]) == 0.0 ? 0.0:(sum[7] + sum[0] - sum[3] - glfy - corporate_income_tax) / (sum[7] + sum[0]);
|
|
|
|
- ps[0].setObject(19,net_margin);
|
|
|
|
- String profit_loss = "";
|
|
|
|
- if (net_margin < 0){
|
|
|
|
- profit_loss = "亏损";
|
|
|
|
- }else if (net_margin >=0 && net_margin <=0.05){
|
|
|
|
- profit_loss = "净利较低";
|
|
|
|
- }else if(net_margin > 0.05){
|
|
|
|
- profit_loss = "盈利";
|
|
|
|
|
|
+ ps[0].setObject(16, glfy / 10000);
|
|
|
|
+ //企业所得税corporate_income_tax
|
|
|
|
+ ps[0].setObject(17, corporate_income_tax / 10000);
|
|
|
|
+ ps[0].setObject(18, ((sum[7] + sum[0])/* / 1.06*/ - sum[3] - glfy - corporate_income_tax) / 10000);
|
|
|
|
+ double net_margin = (sum[7] + sum[0]) == 0.0 ? 0.0 : (sum[7] + sum[0] - sum[3] - glfy - corporate_income_tax) / (sum[7] + sum[0]);
|
|
|
|
+ ps[0].setObject(19, net_margin);
|
|
|
|
+ String profit_loss = "";
|
|
|
|
+ if (net_margin < 0) {
|
|
|
|
+ profit_loss = "亏损";
|
|
|
|
+ } else if (net_margin >= 0 && net_margin <= 0.05) {
|
|
|
|
+ profit_loss = "净利较低";
|
|
|
|
+ } else if (net_margin > 0.05) {
|
|
|
|
+ profit_loss = "盈利";
|
|
|
|
+ }
|
|
|
|
+ ps[0].setObject(20, e.get("selectField_lrhjdu45") == null ? null : e.get("selectField_lrhjdu45").toString());
|
|
|
|
+ ps[0].setObject(21, e.get("textField_lrn2oy4n") == null ? null : e.get("textField_lrn2oy4n").toString());
|
|
|
|
+ ps[0].setObject(22, profit_loss);
|
|
|
|
+ ps[0].setObject(23, e.get("dateField_lrn2oy54") == null ? null : e.get("dateField_lrn2oy54").toString());
|
|
|
|
+ ps[0].setObject(24, e.get("selectField_ltfgfke7") == null ? null : e.get("selectField_ltfgfke7").toString());
|
|
|
|
+ ps[0].setObject(25, "");
|
|
|
|
+ ps[0].setObject(26, yearAndMonth);
|
|
|
|
+ ps[0].setObject(27, sum[0]);
|
|
|
|
+ ps[0].setObject(28, sum[6]);
|
|
|
|
+ ps[0].setObject(29, sumProject + sumSamll);
|
|
|
|
+ ps[0].setObject(30, sum[9] / 10000);
|
|
|
|
+ ps[0].setObject(31, code);
|
|
|
|
+
|
|
|
|
+ ps[0].addBatch();
|
|
|
|
+ } catch (SQLException ex) {
|
|
|
|
+ ex.printStackTrace();
|
|
}
|
|
}
|
|
- ps[0].setObject(20,e.get("selectField_lrhjdu45")==null?null:e.get("selectField_lrhjdu45").toString());
|
|
|
|
- ps[0].setObject(21,e.get("textField_lrn2oy4n")==null?null:e.get("textField_lrn2oy4n").toString());
|
|
|
|
- ps[0].setObject(22,profit_loss);
|
|
|
|
- ps[0].setObject(23,e.get("dateField_lrn2oy54")==null?null:e.get("dateField_lrn2oy54").toString());
|
|
|
|
- ps[0].setObject(24,e.get("selectField_ltfgfke7")==null?null:e.get("selectField_ltfgfke7").toString());
|
|
|
|
- ps[0].setObject(25,"");
|
|
|
|
- ps[0].setObject(26,yearAndMonth);
|
|
|
|
- ps[0].setObject(27,sum[0]);
|
|
|
|
- ps[0].setObject(28,sum[6]);
|
|
|
|
- ps[0].setObject(29,sumProject+sumSamll);
|
|
|
|
- ps[0].setObject(30,sum[9]/10000);
|
|
|
|
- ps[0].setObject(31,code);
|
|
|
|
-
|
|
|
|
- ps[0].addBatch();
|
|
|
|
- } catch (SQLException ex) {
|
|
|
|
- ex.printStackTrace();
|
|
|
|
- }
|
|
|
|
// }
|
|
// }
|
|
|
|
+ }
|
|
});
|
|
});
|
|
ps[0].executeBatch();
|
|
ps[0].executeBatch();
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.info("数据库连接异常"+e.toString());
|
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
|
+ log.info("数据库连接异常"+e.toString());
|
|
} finally {
|
|
} finally {
|
|
// 关闭资源
|
|
// 关闭资源
|
|
try {
|
|
try {
|