Compare commits
17 Commits
67be1b36f5
...
8be25973c9
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8be25973c9 | ||
![]() |
db5e6c097d | ||
![]() |
a8fef3ed3b | ||
![]() |
fb84350512 | ||
![]() |
33ec5c134e | ||
![]() |
4801a0c93c | ||
![]() |
1997d31018 | ||
![]() |
d1fd8b0efc | ||
![]() |
ecfcde8156 | ||
![]() |
3118ea1501 | ||
![]() |
d98169b17b | ||
![]() |
08a2952879 | ||
![]() |
8a571e614a | ||
![]() |
afc3b08ce2 | ||
![]() |
c026971b54 | ||
![]() |
021d5560d6 | ||
a6691b4d9b |
@ -87,6 +87,7 @@ public class CompleteShipDetailReportPlugin extends AbstractReportListDataPlugin
|
|||||||
String forderno = filter.getString("yem_forderno");
|
String forderno = filter.getString("yem_forderno");
|
||||||
long fcustom = filter.getLong("yem_fcustom");
|
long fcustom = filter.getLong("yem_fcustom");
|
||||||
long fresourceno = filter.getLong("yem_fresourceno");
|
long fresourceno = filter.getLong("yem_fresourceno");
|
||||||
|
long producttype = filter.getLong("yem_bd_producttype");
|
||||||
QFilter qFilter = getBaseQFilter(new String[]{"B", "C"});
|
QFilter qFilter = getBaseQFilter(new String[]{"B", "C"});
|
||||||
qFilter.and("yem_signconfirmstatus", "=", "A");//回签确认状态
|
qFilter.and("yem_signconfirmstatus", "=", "A");//回签确认状态
|
||||||
if (YEM.isNotEmpty(forderno)) {
|
if (YEM.isNotEmpty(forderno)) {
|
||||||
@ -103,6 +104,9 @@ public class CompleteShipDetailReportPlugin extends AbstractReportListDataPlugin
|
|||||||
qFilter.and("yem_es_materialinfo.yem_resourcenog.id", "=", fresourceno);
|
qFilter.and("yem_es_materialinfo.yem_resourcenog.id", "=", fresourceno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (producttype > 0) {
|
||||||
|
qFilter.and("yem_bd_products.id", "=", producttype);
|
||||||
|
}
|
||||||
ArrayList<String> selectfields = Lists.newArrayList();
|
ArrayList<String> selectfields = Lists.newArrayList();
|
||||||
selectfields.add("yem_es_materialinfo.id main_detail_id");
|
selectfields.add("yem_es_materialinfo.id main_detail_id");
|
||||||
selectfields.add("id main_id");
|
selectfields.add("id main_id");
|
||||||
@ -110,6 +114,7 @@ public class CompleteShipDetailReportPlugin extends AbstractReportListDataPlugin
|
|||||||
selectfields.add("yem_customer yem_custom");
|
selectfields.add("yem_customer yem_custom");
|
||||||
selectfields.add("yem_currency yem_currency");
|
selectfields.add("yem_currency yem_currency");
|
||||||
selectfields.add("yem_es_materialinfo.yem_productmodel.yem_products.id yem_product");//产品机型
|
selectfields.add("yem_es_materialinfo.yem_productmodel.yem_products.id yem_product");//产品机型
|
||||||
|
selectfields.add("yem_bd_products yem_products");//产品分类
|
||||||
selectfields.add("yem_priceitem yem_priceitem");//价格条款-交货方式
|
selectfields.add("yem_priceitem yem_priceitem");//价格条款-交货方式
|
||||||
selectfields.add("yem_es_materialinfo.yem_sapricepriceclause yem_price");//销售单价(价格条款)-单价
|
selectfields.add("yem_es_materialinfo.yem_sapricepriceclause yem_price");//销售单价(价格条款)-单价
|
||||||
selectfields.add("yem_es_materialinfo.yem_qty yem_qty");//数量-台数
|
selectfields.add("yem_es_materialinfo.yem_qty yem_qty");//数量-台数
|
||||||
|
@ -21,6 +21,7 @@ import java.math.BigDecimal;
|
|||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static com.yem.rf.utils.RFUtils.formatDate;
|
||||||
import static com.yem.rf.utils.RFUtils.getBaseQFilter;
|
import static com.yem.rf.utils.RFUtils.getBaseQFilter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,18 +39,6 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
public DataSet query(ReportQueryParam param, Object o) throws Throwable {
|
public DataSet query(ReportQueryParam param, Object o) throws Throwable {
|
||||||
|
|
||||||
FilterInfo filter = param.getFilter();
|
FilterInfo filter = param.getFilter();
|
||||||
Date fshipdate_start = filter.getDate("yem_fshipdate_start");//发货日期
|
|
||||||
Date fshipdate_end = filter.getDate("yem_fshipdate_end");//发货日期
|
|
||||||
|
|
||||||
Date fexportdate_start = filter.getDate("yem_fexportdate_start");//出口日期
|
|
||||||
Date fexportdate_end = filter.getDate("yem_fexportdate_end");//出口日期
|
|
||||||
|
|
||||||
String fcontactno = filter.getString("yem_fcontactno");//合同号
|
|
||||||
|
|
||||||
Long fcustomer = filter.getLong("yem_fcustomer");//客户
|
|
||||||
|
|
||||||
String fladingno = filter.getString("yem_fladingno");//提单号
|
|
||||||
|
|
||||||
|
|
||||||
DataSet declaredocx = queryDeclareDocx(param);
|
DataSet declaredocx = queryDeclareDocx(param);
|
||||||
|
|
||||||
@ -63,6 +52,7 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
|
|
||||||
dataSet = declaredocx.leftJoin(declaredocx_relation)
|
dataSet = declaredocx.leftJoin(declaredocx_relation)
|
||||||
.on("merged_seq", "rl_merged_seq")
|
.on("merged_seq", "rl_merged_seq")
|
||||||
|
.on("declaredocx_id", "declare_id_gp_fk")
|
||||||
.select(RptUtil.getDataSetFiledAlias(declaredocx), RptUtil.getDataSetFiledAlias(declaredocx_relation))
|
.select(RptUtil.getDataSetFiledAlias(declaredocx), RptUtil.getDataSetFiledAlias(declaredocx_relation))
|
||||||
.finish();
|
.finish();
|
||||||
|
|
||||||
@ -97,8 +87,34 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
Date fexportdate_start = filter.getDate("yem_fexportdate_start");//出口日期
|
||||||
|
Date fexportdate_end = filter.getDate("yem_fexportdate_end");//出口日期
|
||||||
|
|
||||||
return dataSet;
|
String fcontactno = filter.getString("yem_fcontactno");//合同号
|
||||||
|
|
||||||
|
Long fcustomer = filter.getLong("yem_fcustomer");//客户
|
||||||
|
|
||||||
|
String fladingno = filter.getString("yem_fladingno");//提单号
|
||||||
|
|
||||||
|
|
||||||
|
sb.append("1=1");
|
||||||
|
if (YEM.isNotEmpty(fexportdate_start)) {
|
||||||
|
sb.append(" AND TO_DATE(yem_exportdate, 'yyyy-MM-dd') >= ").append(String.format("TO_DATE('%s','yyyy-MM-dd')", formatDate(fexportdate_start)));
|
||||||
|
}
|
||||||
|
if (YEM.isNotEmpty(fexportdate_end)) {
|
||||||
|
sb.append(" AND TO_DATE(yem_exportdate, 'yyyy-MM-dd') <= ").append(String.format("TO_DATE('%s','yyyy-MM-dd')", formatDate(fexportdate_end)));
|
||||||
|
}
|
||||||
|
if (YEM.isNotEmpty(fcontactno)) {
|
||||||
|
sb.append(" AND yem_contactno LIKE '%").append(fcontactno.trim()).append("%'");
|
||||||
|
}
|
||||||
|
if (YEM.isNotEmpty(fcustomer)) {
|
||||||
|
sb.append(" AND yem_customer = ").append(fcustomer);
|
||||||
|
}
|
||||||
|
if (YEM.isNotEmpty(fladingno)) {
|
||||||
|
sb.append(" AND yem_ladingno LIKE '%").append(fladingno.trim()).append("%'");
|
||||||
|
}
|
||||||
|
|
||||||
|
return dataSet.where(sb.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -140,6 +156,7 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
selectfields.add("yem_usbexrate yem_usdrate");//美元汇率
|
selectfields.add("yem_usbexrate yem_usdrate");//美元汇率
|
||||||
selectfields.add("yem_es_declare_ec.yem_taxrefundrates yem_degrate");//退税率
|
selectfields.add("yem_es_declare_ec.yem_taxrefundrates yem_degrate");//退税率
|
||||||
selectfields.add("yem_declarenumber yem_declarationno");//报关单号
|
selectfields.add("yem_declarenumber yem_declarationno");//报关单号
|
||||||
|
selectfields.add("yem_es_declare_ec.yem_declarationelee yem_declarationeletxt");//实际申报要素-规格型号
|
||||||
|
|
||||||
selectfields.add("yem_reightamtbase yem_reightamtbase");//海运费(本位币)
|
selectfields.add("yem_reightamtbase yem_reightamtbase");//海运费(本位币)
|
||||||
selectfields.add("yem_premiumamtbase yem_premiumamtbase");//保费(本位币)
|
selectfields.add("yem_premiumamtbase yem_premiumamtbase");//保费(本位币)
|
||||||
@ -311,11 +328,12 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
|
|
||||||
ArrayList<String> selectfields = Lists.newArrayList();
|
ArrayList<String> selectfields = Lists.newArrayList();
|
||||||
|
|
||||||
|
selectfields.add("id declare_id_gp_fk");
|
||||||
selectfields.add("yem_es_declare_ecd.yem_fgseq rl_detail_seq");//商品明细序号
|
selectfields.add("yem_es_declare_ecd.yem_fgseq rl_detail_seq");//商品明细序号
|
||||||
selectfields.add("yem_es_declare_ecd.yem_decsourceentryidtext rl_detail_id");//商品明细分录行id
|
selectfields.add("yem_es_declare_ecd.yem_decsourceentryidtext rl_detail_id");//商品明细分录行id
|
||||||
selectfields.add("yem_es_declare_ecd.yem_decgoodsseq rl_merged_seq");//报关商品序号
|
selectfields.add("yem_es_declare_ecd.yem_decgoodsseq rl_merged_seq");//报关商品序号
|
||||||
DataSet dataSet = ORM.create().queryDataSet(algoKey, "yem_es_declaredocx", String.join(",", selectfields), qFilter.toArray());
|
DataSet dataSet = ORM.create().queryDataSet(algoKey, "yem_es_declaredocx", String.join(",", selectfields), qFilter.toArray());
|
||||||
dataSet = dataSet.select("CAST(rl_detail_seq as Integer) rl_detail_seq, CAST(rl_detail_id as Long) rl_detail_id, CAST(rl_merged_seq as Integer) rl_merged_seq");
|
dataSet = dataSet.select("CAST(rl_detail_seq as Integer) rl_detail_seq, CAST(rl_detail_id as Long) rl_detail_id, CAST(rl_merged_seq as Integer) rl_merged_seq, declare_id_gp_fk");
|
||||||
|
|
||||||
DataSet declaredocx_detail = queryDeclareDocx_Detail(param);
|
DataSet declaredocx_detail = queryDeclareDocx_Detail(param);
|
||||||
|
|
||||||
@ -338,25 +356,27 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
.select(RptUtil.getDataSetFiledAlias(dataSet), RptUtil.getDataSetFiledAlias(salesorder))
|
.select(RptUtil.getDataSetFiledAlias(dataSet), RptUtil.getDataSetFiledAlias(salesorder))
|
||||||
.finish();
|
.finish();
|
||||||
|
|
||||||
DataSet infoDataSet1 = dataSet.copy().groupBy(new String[]{"rl_merged_seq"})
|
DataSet infoDataSet1 = dataSet.copy().groupBy(new String[]{"declare_id_gp_fk", "rl_merged_seq"})
|
||||||
.agg(new GroupConcatFunctionByComma(), "yem_bizdate", "yem_shipdate")
|
.agg(new GroupConcatFunctionByComma(), "yem_bizdate", "yem_shipdate")
|
||||||
.agg(new GroupConcatFunctionByComma(), "yem_contactno", "yem_contactno")
|
.agg(new GroupConcatFunctionByComma(), "yem_contactno", "yem_contactno")
|
||||||
.finish()
|
.finish()
|
||||||
.select("rl_merged_seq rl_merged_seq_1, yem_shipdate, yem_contactno");
|
.select("declare_id_gp_fk declare_id_gp_fk_1, rl_merged_seq rl_merged_seq_1, yem_shipdate, yem_contactno");
|
||||||
|
|
||||||
DataSet infoDataSet2 = dataSet.copy().groupBy(new String[]{"rl_merged_seq"})
|
DataSet infoDataSet2 = dataSet.copy().groupBy(new String[]{"declare_id_gp_fk", "rl_merged_seq"})
|
||||||
.agg(new GroupTopOneFunction(), "yem_declarationele", "yem_declarationele")
|
|
||||||
.agg(new GroupTopOneFunction(), "rl_detail_id", "rl_detail_id")
|
.agg(new GroupTopOneFunction(), "rl_detail_id", "rl_detail_id")
|
||||||
.agg(new GroupTopOneFunction(), "main_id", "main_id")
|
.agg(new GroupTopOneFunction(), "main_id", "main_id")
|
||||||
|
.agg(new GroupTopOneFunction(), "yem_orderno", "yem_orderno")
|
||||||
|
.agg(new GroupTopOneFunction(), "rl_merged_seq", "rl_merged_seq")
|
||||||
.finish()
|
.finish()
|
||||||
.select("rl_merged_seq rl_merged_seq_2, yem_declarationele, rl_detail_id, main_id");
|
.select("declare_id_gp_fk declare_id_gp_fk_2, rl_merged_seq rl_merged_seq_2, rl_detail_id, main_id, yem_orderno, rl_merged_seq");
|
||||||
|
|
||||||
dataSet = infoDataSet1.leftJoin(infoDataSet2)
|
dataSet = infoDataSet1.leftJoin(infoDataSet2)
|
||||||
|
.on("declare_id_gp_fk_1", "declare_id_gp_fk_2")
|
||||||
.on("rl_merged_seq_1", "rl_merged_seq_2")
|
.on("rl_merged_seq_1", "rl_merged_seq_2")
|
||||||
.select(RptUtil.getDataSetFiledAlias(infoDataSet1), RptUtil.getDataSetFiledAlias(infoDataSet2))
|
.select(RptUtil.getDataSetFiledAlias(infoDataSet1), RptUtil.getDataSetFiledAlias(infoDataSet2))
|
||||||
.finish();
|
.finish();
|
||||||
|
|
||||||
dataSet = dataSet.select(String.join(",", RptUtil.getDataSetFiledAlias(dataSet)) + ", rl_merged_seq_1 rl_merged_seq");
|
dataSet = dataSet.select(String.join(",", RptUtil.getDataSetFiledAlias(dataSet)) + ", declare_id_gp_fk_1 declare_id_gp_fk");
|
||||||
|
|
||||||
return dataSet;
|
return dataSet;
|
||||||
}
|
}
|
||||||
@ -373,8 +393,6 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
|
|
||||||
selectfields.add("yem_es_materialinfo.id detail_id");
|
selectfields.add("yem_es_materialinfo.id detail_id");
|
||||||
selectfields.add("yem_es_materialinfo.yem_coreentryid main_order_id_ddd_fk");
|
selectfields.add("yem_es_materialinfo.yem_coreentryid main_order_id_ddd_fk");
|
||||||
selectfields.add("yem_es_materialinfo.yem_declarationele yem_declarationele");
|
|
||||||
|
|
||||||
|
|
||||||
return ORM.create().queryDataSet(algoKey, "yem_es_declaredocx", String.join(",", selectfields), qFilter.toArray());
|
return ORM.create().queryDataSet(algoKey, "yem_es_declaredocx", String.join(",", selectfields), qFilter.toArray());
|
||||||
}
|
}
|
||||||
@ -394,7 +412,11 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
selectfields.add("yem_bizdate");//业务日期
|
selectfields.add("yem_bizdate");//业务日期
|
||||||
|
|
||||||
DataSet dataSet = ORM.create().queryDataSet(algoKey, "yem_es_delivernotice", String.join(",", selectfields), qFilter.toArray());
|
DataSet dataSet = ORM.create().queryDataSet(algoKey, "yem_es_delivernotice", String.join(",", selectfields), qFilter.toArray());
|
||||||
return dataSet.select("dn_main_id_fk, TO_CHAR(yem_bizdate, 'yyyy-MM-dd') yem_bizdate");
|
dataSet = dataSet.select("dn_main_id_fk, TO_CHAR(yem_bizdate, 'yyyy-MM-dd') yem_bizdate");
|
||||||
|
dataSet = dataSet.groupBy(new String[]{"dn_main_id_fk"})
|
||||||
|
.agg(new GroupConcatFunctionByComma(), "yem_bizdate", "yem_bizdate")
|
||||||
|
.finish();
|
||||||
|
return dataSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -426,18 +448,20 @@ public class ExportDeclarationDetailsReportPlugin extends AbstractReportListData
|
|||||||
"ELSE 0.0 " +
|
"ELSE 0.0 " +
|
||||||
"END contains_framework_sign ");
|
"END contains_framework_sign ");
|
||||||
|
|
||||||
DataSet framework = dataSet.copy().where("contains_framework_sign = 1.0");
|
dataSet = dataSet.select(String.join(",", RptUtil.getDataSetFiledAlias(dataSet)) + "," +
|
||||||
|
"CASE WHEN contains_framework_sign = 1 THEN contact_billno ELSE '' END yem_orderno");
|
||||||
framework = framework.groupBy(new String[]{"framework_billno"})
|
// DataSet framework = dataSet.copy().where("contains_framework_sign = 1.0");
|
||||||
.agg(new GroupConcatFunctionByComma(), "contact_billno", "yem_orderno")
|
//
|
||||||
.finish();
|
// framework = framework.groupBy(new String[]{"framework_billno"})
|
||||||
|
// .agg(new GroupConcatFunctionByComma(), "contact_billno", "yem_orderno")
|
||||||
framework = framework.select("framework_billno framework_billno_fk, yem_orderno");
|
// .finish();
|
||||||
|
//
|
||||||
dataSet = dataSet.leftJoin(framework)
|
// framework = framework.select("framework_billno framework_billno_fk, yem_orderno");
|
||||||
.on("framework_billno", "framework_billno_fk")
|
//
|
||||||
.select(RptUtil.getDataSetFiledAlias(dataSet), RptUtil.getDataSetFiledAlias(framework))
|
// dataSet = dataSet.leftJoin(framework)
|
||||||
.finish();
|
// .on("framework_billno", "framework_billno_fk")
|
||||||
|
// .select(RptUtil.getDataSetFiledAlias(dataSet), RptUtil.getDataSetFiledAlias(framework))
|
||||||
|
// .finish();
|
||||||
|
|
||||||
return dataSet;
|
return dataSet;
|
||||||
}
|
}
|
||||||
|
@ -80,6 +80,7 @@ public class ITCOrderDetailsReportPlugin extends AbstractReportListDataPlugin {
|
|||||||
long fcustomer = filter.getLong("yem_fcustomer");//客户
|
long fcustomer = filter.getLong("yem_fcustomer");//客户
|
||||||
Date forderdateStart = filter.getDate("yem_forderdate_start");
|
Date forderdateStart = filter.getDate("yem_forderdate_start");
|
||||||
Date forderdateEnd = filter.getDate("yem_forderdate_end");
|
Date forderdateEnd = filter.getDate("yem_forderdate_end");
|
||||||
|
long producttype = filter.getLong("yem_bd_producttype");//产品分类
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("yem_businesssort = 'Z' AND dn_status != 'C'");
|
sb.append("yem_businesssort = 'Z' AND dn_status != 'C'");
|
||||||
@ -101,6 +102,11 @@ public class ITCOrderDetailsReportPlugin extends AbstractReportListDataPlugin {
|
|||||||
if (YEM.isNotEmpty(forderdateEnd)) {
|
if (YEM.isNotEmpty(forderdateEnd)) {
|
||||||
sb.append(" AND forderdate <= ").append(String.format("TO_DATE('%s','yyyy-MM-dd')", formatDate(forderdateEnd)));
|
sb.append(" AND forderdate <= ").append(String.format("TO_DATE('%s','yyyy-MM-dd')", formatDate(forderdateEnd)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (producttype > 0) {
|
||||||
|
sb.append(" AND yem_products = ").append(producttype);
|
||||||
|
}
|
||||||
|
|
||||||
resDataSet = resDataSet.addField("0.0", "yem_inventoryqty");
|
resDataSet = resDataSet.addField("0.0", "yem_inventoryqty");
|
||||||
|
|
||||||
DataSet where = resDataSet.where(sb.toString());
|
DataSet where = resDataSet.where(sb.toString());
|
||||||
@ -140,6 +146,8 @@ public class ITCOrderDetailsReportPlugin extends AbstractReportListDataPlugin {
|
|||||||
selectfields.add("yem_es_materialinfo.yem_businesssort yem_businesssort");
|
selectfields.add("yem_es_materialinfo.yem_businesssort yem_businesssort");
|
||||||
selectfields.add("createtime");
|
selectfields.add("createtime");
|
||||||
selectfields.add("yem_bd_products");//产品分类
|
selectfields.add("yem_bd_products");//产品分类
|
||||||
|
selectfields.add("yem_bd_products yem_products");//产品分类
|
||||||
|
selectfields.add("yem_es_materialinfo.yem_es_salesorder_z.yem_currentstate yem_currentstate");//当前状态
|
||||||
|
|
||||||
return ORM.create().queryDataSet(algoKey, "yem_es_salesorder", String.join(",", selectfields), qFilter.toArray())
|
return ORM.create().queryDataSet(algoKey, "yem_es_salesorder", String.join(",", selectfields), qFilter.toArray())
|
||||||
.orderBy(new String[]{"createtime DESC"});
|
.orderBy(new String[]{"createtime DESC"});
|
||||||
@ -160,7 +168,26 @@ public class ITCOrderDetailsReportPlugin extends AbstractReportListDataPlugin {
|
|||||||
selectfields.add("yem_shippingplan_entry.yem_plandetail_entry.id order_plan_detail_id");//跟单任务明细子分录ID
|
selectfields.add("yem_shippingplan_entry.yem_plandetail_entry.id order_plan_detail_id");//跟单任务明细子分录ID
|
||||||
selectfields.add("yem_shippingplan_entry.yem_plandetail_entry.yem_srcentryid order_detail_id_plan_fk");
|
selectfields.add("yem_shippingplan_entry.yem_plandetail_entry.yem_srcentryid order_detail_id_plan_fk");
|
||||||
|
|
||||||
return ORM.create().queryDataSet(algoKey, "yem_es_salesorder", String.join(",", selectfields), qFilter.toArray());
|
DataSet dataSet = ORM.create().queryDataSet(algoKey, "yem_es_salesorder", String.join(",", selectfields), qFilter.toArray());
|
||||||
|
|
||||||
|
DataSet proReqBill = queryOrderProReqBill(param);
|
||||||
|
|
||||||
|
dataSet = dataSet.leftJoin(proReqBill)
|
||||||
|
.on("order_plan_id", "order_req_main_detail_fk")
|
||||||
|
.select(RptUtil.getDataSetFiledAlias(dataSet), RptUtil.getDataSetFiledAlias(proReqBill))
|
||||||
|
.finish();
|
||||||
|
|
||||||
|
return dataSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
private DataSet queryOrderProReqBill(ReportQueryParam param) {
|
||||||
|
QFilter qFilter = getBaseQFilter();
|
||||||
|
List<String> selectfields = new ArrayList<>();
|
||||||
|
selectfields.add("TO_CHAR(yem_es_materialinfo.yem_yieldetacdate, 'yyyy-MM-dd') yem_prodfeedbackdate");//预计完成时间
|
||||||
|
selectfields.add("yem_es_materialinfo.yem_sourceentryid order_req_main_detail_fk");
|
||||||
|
|
||||||
|
|
||||||
|
return ORM.create().queryDataSet(algoKey, "yem_orderproreqbill", String.join(",", selectfields), qFilter.toArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -212,7 +239,7 @@ public class ITCOrderDetailsReportPlugin extends AbstractReportListDataPlugin {
|
|||||||
List<String> selectfields = new ArrayList<>();
|
List<String> selectfields = new ArrayList<>();
|
||||||
selectfields.add("yem_es_salesorder_r.yem_entrtyid plan_proc_detail_fk");
|
selectfields.add("yem_es_salesorder_r.yem_entrtyid plan_proc_detail_fk");
|
||||||
selectfields.add("yem_es_salesorder_r.yem_stockway yem_ifreform");
|
selectfields.add("yem_es_salesorder_r.yem_stockway yem_ifreform");
|
||||||
selectfields.add("TO_CHAR(yem_es_salesorder_r.yem_yieldetacdate, 'yyyy-MM-dd') yem_prodfeedbackdate");//预计完成时间
|
// selectfields.add("TO_CHAR(yem_es_salesorder_r.yem_yieldetacdate, 'yyyy-MM-dd') yem_prodfeedbackdate");//预计完成时间
|
||||||
selectfields.add("TO_CHAR(yem_es_salesorder_r.yem_yieldfactacdate, 'yyyy-MM-dd') yem_plancompdate");//实际完成时间
|
selectfields.add("TO_CHAR(yem_es_salesorder_r.yem_yieldfactacdate, 'yyyy-MM-dd') yem_plancompdate");//实际完成时间
|
||||||
return ORM.create().queryDataSet(algoKey, "yem_tracktaskconsole", String.join(",", selectfields), null);
|
return ORM.create().queryDataSet(algoKey, "yem_tracktaskconsole", String.join(",", selectfields), null);
|
||||||
}
|
}
|
||||||
@ -344,8 +371,7 @@ public class ITCOrderDetailsReportPlugin extends AbstractReportListDataPlugin {
|
|||||||
for (DynamicObject dynamicObject : collection) {
|
for (DynamicObject dynamicObject : collection) {
|
||||||
String vehicleno = dynamicObject.getString("yem_vehicleno");
|
String vehicleno = dynamicObject.getString("yem_vehicleno");
|
||||||
if (YEM.isNotEmpty(vehicleno)) {
|
if (YEM.isNotEmpty(vehicleno)) {
|
||||||
BigDecimal inventoryqty = dynamicObject.getBigDecimal("yem_inventoryqty");
|
dynamicObject.set("yem_reqqty", new BigDecimal("1"));
|
||||||
dynamicObject.set("yem_reqqty", inventoryqty);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +75,12 @@ public class SalesCommissionReportPlugin extends AbstractReportListDataPlugin {
|
|||||||
long resourceno = filter.getLong("yem_resourceno");//资源号
|
long resourceno = filter.getLong("yem_resourceno");//资源号
|
||||||
Date start = filter.getDate("yem_ladingdate_start");//提单日期-开始
|
Date start = filter.getDate("yem_ladingdate_start");//提单日期-开始
|
||||||
Date end = filter.getDate("yem_ladingdate_end");//提单日期-结束
|
Date end = filter.getDate("yem_ladingdate_end");//提单日期-结束
|
||||||
|
|
||||||
|
Date fshipdate_start = filter.getDate("yem_fshipdate_start");
|
||||||
|
Date fshipdate_end = filter.getDate("yem_fshipdate_end");
|
||||||
|
|
||||||
|
long foperator = filter.getLong("yem_foperator");//
|
||||||
|
|
||||||
where.append("salesorder_billtype IN ('yem_es_salesorder_nmzj', 'yem_es_salesorder_ZJ') AND salesorder_commissiontype IN ('Z', 'ZP')");
|
where.append("salesorder_billtype IN ('yem_es_salesorder_nmzj', 'yem_es_salesorder_ZJ') AND salesorder_commissiontype IN ('Z', 'ZP')");
|
||||||
if (YEM.isNotEmpty(salesorderno)) {
|
if (YEM.isNotEmpty(salesorderno)) {
|
||||||
where.append(" AND yem_contractno LIKE '%").append(salesorderno).append("%'");
|
where.append(" AND yem_contractno LIKE '%").append(salesorderno).append("%'");
|
||||||
@ -97,6 +103,19 @@ public class SalesCommissionReportPlugin extends AbstractReportListDataPlugin {
|
|||||||
if (YEM.isNotEmpty(end)) {
|
if (YEM.isNotEmpty(end)) {
|
||||||
where.append(" AND TO_DATE(yem_ladingdatetext,'yyyy-MM-dd') <= ").append(String.format("TO_DATE('%s','yyyy-MM-dd')", formatDate(end)));
|
where.append(" AND TO_DATE(yem_ladingdatetext,'yyyy-MM-dd') <= ").append(String.format("TO_DATE('%s','yyyy-MM-dd')", formatDate(end)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (YEM.isNotEmpty(fshipdate_start)) {
|
||||||
|
where.append(" AND TO_DATE(yem_shipdate,'yyyy-MM-dd') >= ").append(String.format("TO_DATE('%s','yyyy-MM-dd')", formatDate(fshipdate_start)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (YEM.isNotEmpty(fshipdate_end)) {
|
||||||
|
where.append(" AND TO_DATE(yem_shipdate,'yyyy-MM-dd') <= ").append(String.format("TO_DATE('%s','yyyy-MM-dd')", formatDate(fshipdate_end)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (foperator > 0) {
|
||||||
|
where.append(" AND yem_salesman = ").append(foperator);
|
||||||
|
}
|
||||||
|
|
||||||
resDataSet = resDataSet.where(where.toString());
|
resDataSet = resDataSet.where(where.toString());
|
||||||
|
|
||||||
return resDataSet;
|
return resDataSet;
|
||||||
@ -131,13 +150,15 @@ public class SalesCommissionReportPlugin extends AbstractReportListDataPlugin {
|
|||||||
selectfields.add("yem_es_materialinfo.yem_es_salesorder_z.yem_vehicleno yem_vehicleno");//整机编号
|
selectfields.add("yem_es_materialinfo.yem_es_salesorder_z.yem_vehicleno yem_vehicleno");//整机编号
|
||||||
selectfields.add("yem_es_materialinfo.yem_es_salesorder_z.yem_resourcescode yem_resourcescode");//资源号
|
selectfields.add("yem_es_materialinfo.yem_es_salesorder_z.yem_resourcescode yem_resourcescode");//资源号
|
||||||
selectfields.add("yem_es_materialinfo.yem_es_salesorder_z.yem_milltype yem_productmodel");//资源号
|
selectfields.add("yem_es_materialinfo.yem_es_salesorder_z.yem_milltype yem_productmodel");//资源号
|
||||||
selectfields.add("yem_es_materialinfo.yem_qty yem_qty");//数量
|
// selectfields.add("yem_es_materialinfo.yem_qty yem_qty");//数量
|
||||||
selectfields.add("yem_currency yem_currency");//结算币别
|
selectfields.add("yem_currency yem_currency");//结算币别
|
||||||
selectfields.add("yem_exrate yem_exrate");//汇率
|
selectfields.add("yem_exrate yem_exrate");//汇率
|
||||||
selectfields.add("createtime");
|
selectfields.add("createtime");
|
||||||
|
selectfields.add("TO_CHAR(yem_bizdate, 'yyyy-MM-dd') yem_shipdate");//业务日期-发货日期
|
||||||
return ORM.create().queryDataSet(algoKey, "yem_es_delivernotice", String.join(",", selectfields), qFilter.toArray())
|
DataSet dataSet = ORM.create().queryDataSet(algoKey, "yem_es_delivernotice", String.join(",", selectfields), qFilter.toArray())
|
||||||
.orderBy(new String[]{"createtime DESC"});
|
.orderBy(new String[]{"createtime DESC"});
|
||||||
|
dataSet = dataSet.addField("1.0", "yem_qty");
|
||||||
|
return dataSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -168,13 +189,14 @@ public class SalesCommissionReportPlugin extends AbstractReportListDataPlugin {
|
|||||||
selectfields.add("id salesorderid");
|
selectfields.add("id salesorderid");
|
||||||
selectfields.add("yem_es_materialinfo.id salesorderenid");
|
selectfields.add("yem_es_materialinfo.id salesorderenid");
|
||||||
selectfields.add("yem_reccondition yem_reccondition");//收款条件
|
selectfields.add("yem_reccondition yem_reccondition");//收款条件
|
||||||
selectfields.add("yem_es_materialinfo.yem_saamtpriceclause yem_safobamount");//销售金额(价格条款) 整机合计价格
|
selectfields.add("yem_es_materialinfo.yem_safobprice yem_safobamount");//销售FOB单价 整机合计价格
|
||||||
selectfields.add("yem_es_materialinfo.yem_singlepartgiftmat yem_singlepartgiftmat");//单台配件赠送金额 赠送配件金额
|
selectfields.add("yem_es_materialinfo.yem_singlepartgiftmat yem_singlepartgiftmat");//单台配件赠送金额 赠送配件金额
|
||||||
selectfields.add("yem_es_materialinfo.yem_fobamount yem_companystandamt");//公司标准价
|
selectfields.add("yem_es_materialinfo.yem_fobamount yem_companystandamt");//公司标准价
|
||||||
selectfields.add("CASE WHEN yem_issinosurecon = '1' THEN 'A' ELSE 'B' END yem_iscredit");//是否信保合同
|
selectfields.add("CASE WHEN yem_issinosurecon = '1' THEN 'A' ELSE 'B' END yem_iscredit");//是否信保合同
|
||||||
selectfields.add("yem_billtype.number salesorder_billtype");//单据类型
|
selectfields.add("yem_billtype.number salesorder_billtype");//单据类型
|
||||||
selectfields.add("yem_es_materialinfo.yem_commissiontype salesorder_commissiontype");//业务分类
|
selectfields.add("yem_es_materialinfo.yem_commissiontype salesorder_commissiontype");//业务分类
|
||||||
selectfields.add("yem_offeramount");
|
selectfields.add("yem_offeramount");
|
||||||
|
selectfields.add("yem_operator yem_salesman");//销售员
|
||||||
|
|
||||||
return ORM.create().queryDataSet(algoKey, "yem_es_salesorder", String.join(",", selectfields), qFilter.toArray());
|
return ORM.create().queryDataSet(algoKey, "yem_es_salesorder", String.join(",", selectfields), qFilter.toArray());
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
package com.yem.rf.task;
|
||||||
|
|
||||||
|
import com.yem.wm.utils.ContactSignUtils;
|
||||||
|
import com.yem.wm.utils.DynamicObjectUtil;
|
||||||
|
import kd.bos.context.RequestContext;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||||
|
import kd.bos.exception.KDException;
|
||||||
|
import kd.bos.schedule.executor.AbstractTask;
|
||||||
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: TODO
|
||||||
|
* @Date: 2024/9/5 9:38
|
||||||
|
* @Created: by ZZSLL
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ExportDeclarationDataFIxTask extends AbstractTask {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(ExportDeclarationDataFIxTask.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(RequestContext requestContext, Map<String, Object> map) throws KDException {
|
||||||
|
String selectfields = DynamicObjectUtil.getSelectfields("yem_es_declaredocx");
|
||||||
|
selectfields = DynamicObjectUtil.getEntrySelectfields(selectfields, "yem_es_declaredocx", "yem_es_materialinfo");
|
||||||
|
selectfields = DynamicObjectUtil.getEntrySelectfields(selectfields, "yem_es_declaredocx", "yem_es_declare_ecd");
|
||||||
|
DynamicObject[] load = BusinessDataServiceHelper.load("yem_es_declaredocx", selectfields, null);
|
||||||
|
for (DynamicObject b : load) {
|
||||||
|
DynamicObjectCollection relation = b.getDynamicObjectCollection("yem_es_declare_ecd");
|
||||||
|
DynamicObjectCollection m = b.getDynamicObjectCollection("yem_es_materialinfo");
|
||||||
|
for (DynamicObject r : relation) {
|
||||||
|
int i = relation.indexOf(r);
|
||||||
|
String decsourceentryidtext = r.getString("yem_decsourceentryidtext");
|
||||||
|
if ("0".equals(decsourceentryidtext)) {
|
||||||
|
logger.info("修复-{}-{}行", b.getString("billno"), i);
|
||||||
|
int fgseq = r.getInt("yem_fgseq");
|
||||||
|
if (fgseq - 1 <= m.size()) {
|
||||||
|
DynamicObject detail = m.get(fgseq - 1);
|
||||||
|
long id = detail.getLong("id");
|
||||||
|
r.set("yem_decsourceentryidtext", String.valueOf(id));
|
||||||
|
logger.info("new Id: {}", id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SaveServiceHelper.save(load);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user