|
@@ -1,15 +1,21 @@
|
|
|
package com.uas.platform.b2b.service.impl;
|
|
package com.uas.platform.b2b.service.impl;
|
|
|
|
|
|
|
|
|
|
+import com.uas.platform.b2b.core.util.DateFormatUtils;
|
|
|
|
|
+import com.uas.platform.b2b.core.util.DateUtils;
|
|
|
import com.uas.platform.b2b.dao.CommonDao;
|
|
import com.uas.platform.b2b.dao.CommonDao;
|
|
|
import com.uas.platform.b2b.model.ApcheckKeyWord;
|
|
import com.uas.platform.b2b.model.ApcheckKeyWord;
|
|
|
import com.uas.platform.b2b.model.ErpProdIODetail;
|
|
import com.uas.platform.b2b.model.ErpProdIODetail;
|
|
|
import com.uas.platform.b2b.service.ErpProdIODetailService;
|
|
import com.uas.platform.b2b.service.ErpProdIODetailService;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
|
|
+import com.uas.platform.core.exception.IllegalOperatorException;
|
|
|
import org.apache.axis.utils.StringUtils;
|
|
import org.apache.axis.utils.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -25,9 +31,34 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
private CommonDao commonDao;
|
|
private CommonDao commonDao;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public List<ErpProdIODetail> findXlsApChecks(List<Long> filter, ApcheckKeyWord keyword, Long fromDate, Long endDate) {
|
|
|
|
|
|
|
+ public List<ErpProdIODetail> findXlsApChecks(List<Long> filter, ApcheckKeyWord keyword, Long fromDate, Long endDate, String checkDate) {
|
|
|
Long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
Long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
StringBuffer distributes = new StringBuffer();
|
|
StringBuffer distributes = new StringBuffer();
|
|
|
|
|
+ String sqlFromDate;
|
|
|
|
|
+ String sqlEndDate;
|
|
|
|
|
+ /*
|
|
|
|
|
+ * 1、 如果前端指定开始截止时间,直接使用
|
|
|
|
|
+ * 2、 如果前端未指定,采用选择月份,使用月份处理
|
|
|
|
|
+ * 3、 截止时间筛选采用传入截止时间加1天(86400000毫秒)小于的做法,这样能取到当天所有数据
|
|
|
|
|
+ */
|
|
|
|
|
+ final Integer oneDayMilliseconds = 86400000;
|
|
|
|
|
+ boolean onlyCheckDate = (null == fromDate || null == endDate) && null != checkDate;
|
|
|
|
|
+ if (null != fromDate && null != endDate ) {
|
|
|
|
|
+ sqlFromDate = DateFormatUtils.DATE_FORMAT.format(new Date(fromDate));
|
|
|
|
|
+ sqlEndDate = DateFormatUtils.DATE_FORMAT.format(new Date(endDate + oneDayMilliseconds));
|
|
|
|
|
+ } else if (onlyCheckDate) {
|
|
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
|
|
|
|
|
+ Date date;
|
|
|
|
|
+ try {
|
|
|
|
|
+ date = DateUtils.dateAddMonth(format.parse(checkDate), 1);
|
|
|
|
|
+ } catch (ParseException e) {
|
|
|
|
|
+ throw new IllegalOperatorException("时间格式异常");
|
|
|
|
|
+ }
|
|
|
|
|
+ sqlFromDate = DateFormatUtils.DATE_FORMAT.format(date);
|
|
|
|
|
+ sqlEndDate = DateFormatUtils.DATE_FORMAT.format(new Date(date.getTime() + oneDayMilliseconds));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new IllegalOperatorException("请选择对账时间");
|
|
|
|
|
+ }
|
|
|
List<ErpProdIODetail> details = new ArrayList<>();
|
|
List<ErpProdIODetail> details = new ArrayList<>();
|
|
|
if (null != filter) {
|
|
if (null != filter) {
|
|
|
filter.forEach(uu -> {
|
|
filter.forEach(uu -> {
|
|
@@ -38,19 +69,19 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
// 货款调账
|
|
// 货款调账
|
|
|
- List<ErpProdIODetail> adjustments = getAdjustments(distributes, keyword, fromDate, endDate, enUU);
|
|
|
|
|
|
|
+ List<ErpProdIODetail> adjustments = getAdjustments(distributes, keyword, sqlFromDate, sqlEndDate, enUU);
|
|
|
// 采购验收单
|
|
// 采购验收单
|
|
|
- List<ErpProdIODetail> saleAccepts = getSaleAccepts(distributes, keyword, fromDate, endDate, enUU);
|
|
|
|
|
|
|
+ List<ErpProdIODetail> saleAccepts = getSaleAccepts(distributes, keyword, sqlFromDate, sqlEndDate, enUU);
|
|
|
// 采购验退单
|
|
// 采购验退单
|
|
|
- List<ErpProdIODetail> saleReturns = getSaleReturns(distributes, keyword, fromDate, endDate, enUU);
|
|
|
|
|
|
|
+ List<ErpProdIODetail> saleReturns = getSaleReturns(distributes, keyword, sqlFromDate, sqlEndDate, enUU);
|
|
|
// 客户不良品入库单
|
|
// 客户不良品入库单
|
|
|
- List<ErpProdIODetail> badIns = getBadIns(distributes, keyword, fromDate, endDate, enUU);
|
|
|
|
|
|
|
+ List<ErpProdIODetail> badIns = getBadIns(distributes, keyword, sqlFromDate, sqlEndDate, enUU);
|
|
|
// 客户不良品出库单
|
|
// 客户不良品出库单
|
|
|
- List<ErpProdIODetail> badOuts = getBadOuts(distributes, keyword, fromDate, endDate, enUU);
|
|
|
|
|
|
|
+ List<ErpProdIODetail> badOuts = getBadOuts(distributes, keyword, sqlFromDate, sqlEndDate, enUU);
|
|
|
// 委外验收单
|
|
// 委外验收单
|
|
|
- List<ErpProdIODetail> makeAccepts = getMakeAccepts(distributes, keyword, fromDate, endDate, enUU);
|
|
|
|
|
|
|
+ List<ErpProdIODetail> makeAccepts = getMakeAccepts(distributes, keyword, sqlFromDate, sqlEndDate, enUU);
|
|
|
// 委外验退单
|
|
// 委外验退单
|
|
|
- List<ErpProdIODetail> makeReturns = getMakeReturns(distributes, keyword, fromDate, endDate, enUU);
|
|
|
|
|
|
|
+ List<ErpProdIODetail> makeReturns = getMakeReturns(distributes, keyword, sqlFromDate, sqlEndDate, enUU);
|
|
|
details.addAll(adjustments);
|
|
details.addAll(adjustments);
|
|
|
details.addAll(saleAccepts);
|
|
details.addAll(saleAccepts);
|
|
|
details.addAll(saleReturns);
|
|
details.addAll(saleReturns);
|
|
@@ -71,7 +102,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
* @param enUU 当前企业UU
|
|
* @param enUU 当前企业UU
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- private List<ErpProdIODetail> getMakeReturns(StringBuffer distributes, ApcheckKeyWord keyword, Long fromDate, Long endDate, Long enUU) {
|
|
|
|
|
|
|
+ private List<ErpProdIODetail> getMakeReturns(StringBuffer distributes, ApcheckKeyWord keyword, String fromDate, String endDate, Long enUU) {
|
|
|
StringBuffer sql = new StringBuffer("select mr_code as inoutno, mr_date as pidate, mr_rate as rate, mr_receivecode as receivecode, " +
|
|
StringBuffer sql = new StringBuffer("select mr_code as inoutno, mr_date as pidate, mr_rate as rate, mr_receivecode as receivecode, " +
|
|
|
"mr_receivename as receivename, '客户委外验退单' as piclass, 'make$returnitem' as sourcetable, ma_code as ordercode, 0 as orderdetno, " +
|
|
"mr_receivename as receivename, '客户委外验退单' as piclass, 'make$returnitem' as sourcetable, ma_code as ordercode, 0 as orderdetno, " +
|
|
|
"mri_number as detno, (-(1) * mri_qty ) as qty, mri_orderpice as orderprice, mr_currency as currency, mri_taxrate as taxrate, " +
|
|
"mri_number as detno, (-(1) * mri_qty ) as qty, mri_orderpice as orderprice, mr_currency as currency, mri_taxrate as taxrate, " +
|
|
@@ -105,13 +136,12 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
sql.append("and mr_enuu in (").append(distributes).append(") ");
|
|
sql.append("and mr_enuu in (").append(distributes).append(") ");
|
|
|
}
|
|
}
|
|
|
if (fromDate != null) {
|
|
if (fromDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(mr_date) >= '").append(new java.sql.Date(fromDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(mr_date) >= '").append(fromDate).append("' ");
|
|
|
}
|
|
}
|
|
|
if (endDate != null) {
|
|
if (endDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(mr_date) <= '").append(new java.sql.Date(endDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(mr_date) < '").append(endDate).append("' ");
|
|
|
}
|
|
}
|
|
|
- List<ErpProdIODetail> makeReturns = commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
|
|
- return makeReturns;
|
|
|
|
|
|
|
+ return commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -124,7 +154,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
* @param enUU 当前企业UU
|
|
* @param enUU 当前企业UU
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- private List<ErpProdIODetail> getMakeAccepts(StringBuffer distributes, ApcheckKeyWord keyword, Long fromDate, Long endDate, Long enUU) {
|
|
|
|
|
|
|
+ private List<ErpProdIODetail> getMakeAccepts(StringBuffer distributes, ApcheckKeyWord keyword, String fromDate, String endDate, Long enUU) {
|
|
|
StringBuffer sql = new StringBuffer("select make$accept.ma_code as inoutno, make$accept.ma_date as pidate, make$accept.ma_rate as rate, " +
|
|
StringBuffer sql = new StringBuffer("select make$accept.ma_code as inoutno, make$accept.ma_date as pidate, make$accept.ma_rate as rate, " +
|
|
|
"ma_receivecode as receivecode, ma_receivename as receivename, '客户委外验收单' as piclass, 'make$acceptitem' as sourcetable, " +
|
|
"ma_receivecode as receivecode, ma_receivename as receivename, '客户委外验收单' as piclass, 'make$acceptitem' as sourcetable, " +
|
|
|
"make$orders.ma_code as ordercode, 0 as orderdetno, mai_number as detno, mai_qty as qty, mai_orderpice as orderprice, " +
|
|
"make$orders.ma_code as ordercode, 0 as orderdetno, mai_number as detno, mai_qty as qty, mai_orderpice as orderprice, " +
|
|
@@ -158,13 +188,12 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
sql.append("and make$accept.ma_enuu in (").append(distributes).append(") ");
|
|
sql.append("and make$accept.ma_enuu in (").append(distributes).append(") ");
|
|
|
}
|
|
}
|
|
|
if (fromDate != null) {
|
|
if (fromDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(make$accept.ma_date) >= '").append(new java.sql.Date(fromDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(make$accept.ma_date) >= '").append(fromDate).append("' ");
|
|
|
}
|
|
}
|
|
|
if (endDate != null) {
|
|
if (endDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(make$accept.ma_date) <= '").append(new java.sql.Date(endDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(make$accept.ma_date) < '").append(endDate).append("' ");
|
|
|
}
|
|
}
|
|
|
- List<ErpProdIODetail> makeAccepts = commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
|
|
- return makeAccepts;
|
|
|
|
|
|
|
+ return commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -177,7 +206,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
* @param enUU 当前企业UU
|
|
* @param enUU 当前企业UU
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- private List<ErpProdIODetail> getBadOuts(StringBuffer distributes, ApcheckKeyWord keyword, Long fromDate, Long endDate, Long enUU) {
|
|
|
|
|
|
|
+ private List<ErpProdIODetail> getBadOuts(StringBuffer distributes, ApcheckKeyWord keyword, String fromDate, String endDate, Long enUU) {
|
|
|
StringBuffer sql = new StringBuffer("select po_code as inoutno, po_date as pidate, po_rate as rate, po_receivecode as receivecode, " +
|
|
StringBuffer sql = new StringBuffer("select po_code as inoutno, po_date as pidate, po_rate as rate, po_receivecode as receivecode, " +
|
|
|
"po_receivename as receivename, '客户不良品出库单' as piclass, 'purc$badoutitem' as sourcetable, pu_code as pd_ordercode, " +
|
|
"po_receivename as receivename, '客户不良品出库单' as piclass, 'purc$badoutitem' as sourcetable, pu_code as pd_ordercode, " +
|
|
|
"purc$orderitems.pd_number as orderdetno, poi_number as detno, (-(1) * poi_qty ) as qty, 0 as pd_orderprice, po_currency as currency, " +
|
|
"purc$orderitems.pd_number as orderdetno, poi_number as detno, (-(1) * poi_qty ) as qty, 0 as pd_orderprice, po_currency as currency, " +
|
|
@@ -211,13 +240,12 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
sql.append("and po_enuu in (").append(distributes).append(") ");
|
|
sql.append("and po_enuu in (").append(distributes).append(") ");
|
|
|
}
|
|
}
|
|
|
if (fromDate != null) {
|
|
if (fromDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(po_date) >= '").append(new java.sql.Date(fromDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(po_date) >= '").append(fromDate).append("' ");
|
|
|
}
|
|
}
|
|
|
if (endDate != null) {
|
|
if (endDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(po_date) <= '").append(new java.sql.Date(endDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(po_date) < '").append(endDate).append("' ");
|
|
|
}
|
|
}
|
|
|
- List<ErpProdIODetail> badOuts = commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
|
|
- return badOuts;
|
|
|
|
|
|
|
+ return commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -230,7 +258,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
* @param enUU 当前企业UU
|
|
* @param enUU 当前企业UU
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- private List<ErpProdIODetail> getBadIns(StringBuffer distributes, ApcheckKeyWord keyword, Long fromDate, Long endDate, Long enUU) {
|
|
|
|
|
|
|
+ private List<ErpProdIODetail> getBadIns(StringBuffer distributes, ApcheckKeyWord keyword, String fromDate, String endDate, Long enUU) {
|
|
|
StringBuffer sql = new StringBuffer("select pb_code as inoutno, pb_date as pidate, pb_rate as rate, pb_receivecode as receivecode, " +
|
|
StringBuffer sql = new StringBuffer("select pb_code as inoutno, pb_date as pidate, pb_rate as rate, pb_receivecode as receivecode, " +
|
|
|
"pb_receivename as receivename, '客户不良品入库单' as piclass, 'purc$badinitem' as sourcetable, pu_code as ordercode, " +
|
|
"pb_receivename as receivename, '客户不良品入库单' as piclass, 'purc$badinitem' as sourcetable, pu_code as ordercode, " +
|
|
|
"pd_number as orderdetno, pbi_number as detno, pbi_qty as qty, 0 as pd_orderprice, pb_currency as currency, pbi_taxrate as taxrate, " +
|
|
"pd_number as orderdetno, pbi_number as detno, pbi_qty as qty, 0 as pd_orderprice, pb_currency as currency, pbi_taxrate as taxrate, " +
|
|
@@ -264,13 +292,12 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
sql.append("and pb_enuu in (").append(distributes).append(") ");
|
|
sql.append("and pb_enuu in (").append(distributes).append(") ");
|
|
|
}
|
|
}
|
|
|
if (fromDate != null) {
|
|
if (fromDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(pb_date) >= '").append(new java.sql.Date(fromDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(pb_date) >= '").append(fromDate).append("' ");
|
|
|
}
|
|
}
|
|
|
if (endDate != null) {
|
|
if (endDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(pb_date) <= '").append(new java.sql.Date(endDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(pb_date) < '").append(endDate).append("' ");
|
|
|
}
|
|
}
|
|
|
- List<ErpProdIODetail> badIns = commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
|
|
- return badIns;
|
|
|
|
|
|
|
+ return commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -283,7 +310,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
* @param enUU 当前企业UU
|
|
* @param enUU 当前企业UU
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- private List<ErpProdIODetail> getSaleReturns(StringBuffer distributes, ApcheckKeyWord keyword, Long fromDate, Long endDate, Long enUU) {
|
|
|
|
|
|
|
+ private List<ErpProdIODetail> getSaleReturns(StringBuffer distributes, ApcheckKeyWord keyword, String fromDate, String endDate, Long enUU) {
|
|
|
StringBuffer sql = new StringBuffer("select purc$return.pr_code as inoutno, pr_date as pidate, pr_rate as rate, pr_receivecode as receivecode, " +
|
|
StringBuffer sql = new StringBuffer("select purc$return.pr_code as inoutno, pr_date as pidate, pr_rate as rate, pr_receivecode as receivecode, " +
|
|
|
"pr_receivename as receivename, '客户采购验退单' as piclass, 'purc$returnitem' as sourcetable, pu_code as ordercode, pd_number as orderdetno, " +
|
|
"pr_receivename as receivename, '客户采购验退单' as piclass, 'purc$returnitem' as sourcetable, pu_code as ordercode, pd_number as orderdetno, " +
|
|
|
"pri_number as detno, (-(1) * pri_qty ) as qty, pri_orderprice as orderprice, pr_currency as currency, pri_taxrate as taxrate, " +
|
|
"pri_number as detno, (-(1) * pri_qty ) as qty, pri_orderprice as orderprice, pr_currency as currency, pri_taxrate as taxrate, " +
|
|
@@ -317,13 +344,12 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
sql.append("and pr_enuu in (").append(distributes).append(") ");
|
|
sql.append("and pr_enuu in (").append(distributes).append(") ");
|
|
|
}
|
|
}
|
|
|
if (fromDate != null) {
|
|
if (fromDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(pr_date) >= '").append(new java.sql.Date(fromDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(pr_date) >= '").append(fromDate).append("' ");
|
|
|
}
|
|
}
|
|
|
if (endDate != null) {
|
|
if (endDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(pr_date) <= '").append(new java.sql.Date(endDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(pr_date) < '").append(endDate).append("' ");
|
|
|
}
|
|
}
|
|
|
- List<ErpProdIODetail> saleReturns = commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
|
|
- return saleReturns;
|
|
|
|
|
|
|
+ return commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -336,7 +362,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
* @param enUU 当前企业UU
|
|
* @param enUU 当前企业UU
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- private List<ErpProdIODetail> getSaleAccepts(StringBuffer distributes, ApcheckKeyWord keyword, Long fromDate, Long endDate, Long enUU) {
|
|
|
|
|
|
|
+ private List<ErpProdIODetail> getSaleAccepts(StringBuffer distributes, ApcheckKeyWord keyword, String fromDate, String endDate, Long enUU) {
|
|
|
StringBuffer sql = new StringBuffer("select pa_code as inoutno, pa_date as pidate, pa_rate as rate, pa_receivecode as receivcode, " +
|
|
StringBuffer sql = new StringBuffer("select pa_code as inoutno, pa_date as pidate, pa_rate as rate, pa_receivecode as receivcode, " +
|
|
|
"pa_receivename as receivename, '客户采购验收单' as piclass, 'purc$acceptitem' as sourcetable, pu_code as ordercode, " +
|
|
"pa_receivename as receivename, '客户采购验收单' as piclass, 'purc$acceptitem' as sourcetable, pu_code as ordercode, " +
|
|
|
"pd_number as orderdetno, pai_number as detno, pai_qty as qty, pai_orderprice as orderprice, pa_currency as currency, " +
|
|
"pd_number as orderdetno, pai_number as detno, pai_qty as qty, pai_orderprice as orderprice, pa_currency as currency, " +
|
|
@@ -370,13 +396,12 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
sql.append("and pa_enuu in (").append(distributes).append(") ");
|
|
sql.append("and pa_enuu in (").append(distributes).append(") ");
|
|
|
}
|
|
}
|
|
|
if (fromDate != null) {
|
|
if (fromDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(pa_date) >= '").append(new java.sql.Date(fromDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(pa_date) >= '").append(fromDate).append("' ");
|
|
|
}
|
|
}
|
|
|
if (endDate != null) {
|
|
if (endDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(pa_date) <= '").append(new java.sql.Date(endDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(pa_date) < '").append(endDate).append("' ");
|
|
|
}
|
|
}
|
|
|
- List<ErpProdIODetail> saleAccepts = commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
|
|
- return saleAccepts;
|
|
|
|
|
|
|
+ return commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -389,7 +414,7 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
* @param enUU 当前企业UU
|
|
* @param enUU 当前企业UU
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- private List<ErpProdIODetail> getAdjustments(StringBuffer distributes, ApcheckKeyWord keyword, Long fromDate, Long endDate, Long enUU) {
|
|
|
|
|
|
|
+ private List<ErpProdIODetail> getAdjustments(StringBuffer distributes, ApcheckKeyWord keyword, String fromDate, String endDate, Long enUU) {
|
|
|
StringBuffer sql = new StringBuffer("select aa_inoutno inoutno, aa_orderdate pidate, aa_rate rate, aa_receivecode receivecode, " +
|
|
StringBuffer sql = new StringBuffer("select aa_inoutno inoutno, aa_orderdate pidate, aa_rate rate, aa_receivecode receivecode, " +
|
|
|
"aa_receivename receivename, '货款调账' as piclass, 'purc$apbilladjustment' as sourcetable, aa_ordercode ordercode, " +
|
|
"aa_receivename receivename, '货款调账' as piclass, 'purc$apbilladjustment' as sourcetable, aa_ordercode ordercode, " +
|
|
|
"aa_orderdetno orderdetno, aa_detno detno, aa_prid prid, aa_prodcode prodcode, aa_prodspec prodspec, aa_prodtitle prodtitle, aa_produnit as produnit, " +
|
|
"aa_orderdetno orderdetno, aa_detno detno, aa_prid prid, aa_prodcode prodcode, aa_prodspec prodspec, aa_prodtitle prodtitle, aa_produnit as produnit, " +
|
|
@@ -418,12 +443,11 @@ public class ErpProdIODetailServiceImpl implements ErpProdIODetailService {
|
|
|
sql.append("and aa_custuu in (").append(distributes).append(") ");
|
|
sql.append("and aa_custuu in (").append(distributes).append(") ");
|
|
|
}
|
|
}
|
|
|
if (fromDate != null) {
|
|
if (fromDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(aa_date) >= '").append(new java.sql.Date(fromDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(aa_date) >= '").append(fromDate).append("' ");
|
|
|
}
|
|
}
|
|
|
if (endDate != null) {
|
|
if (endDate != null) {
|
|
|
- sql.append("and DAYFORMDATE(aa_date) <= '").append(new java.sql.Date(endDate)).append("' ");
|
|
|
|
|
|
|
+ sql.append("and DAYFORMDATE(aa_date) < '").append(endDate).append("' ");
|
|
|
}
|
|
}
|
|
|
- List<ErpProdIODetail> adjustments = commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
|
|
- return adjustments;
|
|
|
|
|
|
|
+ return commonDao.query(sql.toString(), ErpProdIODetail.class);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|