|
|
@@ -1,9 +1,7 @@
|
|
|
package com.uas.eis.service.Impl;
|
|
|
|
|
|
import com.uas.eis.dao.*;
|
|
|
-import com.uas.eis.sdk.dto.ListResp;
|
|
|
-import com.uas.eis.sdk.dto.QueryStockListReq;
|
|
|
-import com.uas.eis.sdk.dto.StockListDTO;
|
|
|
+import com.uas.eis.sdk.dto.*;
|
|
|
import com.uas.eis.beans.result.Result;
|
|
|
import com.uas.eis.service.ERPService;
|
|
|
import com.uas.eis.utils.StringUtil;
|
|
|
@@ -82,4 +80,57 @@ public class ERPServiceImpl implements ERPService {
|
|
|
listResp.setList(stockListDTOS);
|
|
|
return Result.success(listResp);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Result getIOList(QueryIOListReq queryIOListReq) {
|
|
|
+ ListResp<IOListDTO> listResp = new ListResp<>();
|
|
|
+ listResp.setPageNum(queryIOListReq.getPageNum());
|
|
|
+ listResp.setPageSize(queryIOListReq.getPageSize());
|
|
|
+ int page = queryIOListReq.getPageNum();
|
|
|
+ int pageSize = queryIOListReq.getPageSize();
|
|
|
+ int start = ((page - 1) * pageSize + 1);
|
|
|
+ int end = page * pageSize;
|
|
|
+ StringBuffer cond_sql = new StringBuffer("1=1");
|
|
|
+ if(StringUtil.hasText(queryIOListReq.getMaterialNo())){
|
|
|
+ cond_sql.append(" and pd_prodcode ='").append(queryIOListReq.getMaterialNo()).append("' ");
|
|
|
+ }else {
|
|
|
+ return Result.success(listResp);
|
|
|
+ }
|
|
|
+ if(StringUtil.hasText(queryIOListReq.getStartDate())){
|
|
|
+ cond_sql.append(" and pi_date >= to_date('").append(queryIOListReq.getStartDate()).append(" 00:00:00','YYYY-MM-DD HH24:mi:ss') ");
|
|
|
+ }
|
|
|
+ if(StringUtil.hasText(queryIOListReq.getEndDate())){
|
|
|
+ cond_sql.append(" and pi_date <= to_date('").append(queryIOListReq.getEndDate()).append(" 23:59:59','YYYY-MM-DD HH24:mi:ss') ");
|
|
|
+ }
|
|
|
+ if(StringUtil.hasText(queryIOListReq.getWarehouse())){
|
|
|
+ cond_sql.append(" and pd_whcode ='").append(queryIOListReq.getWarehouse()).append("' ");
|
|
|
+ }
|
|
|
+ //获取总数
|
|
|
+ StringBuffer searchSql = new StringBuffer();
|
|
|
+ searchSql.append("SELECT pi_inoutno,pi_class,to_char(pi_date,'yyyy-mm-dd hh24:mi:ss') pi_date,pd_pdno,pd_prodcode,pr_detail,pr_spec,pr_unit,pd_outqty,pd_inqty,pd_whcode,pd_whname,pd_batchcode,pd_ordercode,pi_status,pi_purpose,pi_type,pi_departmentname,pi_cardcode,pi_title" +
|
|
|
+ ",to_char(pi_date1,'yyyy-mm-dd hh24:mi:ss') pi_date1,pi_recordman" +
|
|
|
+ ",pi_vouchercode,nvl(pd_seller,pi_sellername) sellername,nvl(pd_sellercode,pi_sellercode) sellercode ")
|
|
|
+ .append(" from ProdIODetail left join ProdInOut on pd_piid=pi_id left join Product on pr_code=pd_prodcode " )
|
|
|
+ .append("WHERE ").append(cond_sql).append(" ORDER BY PI_DATE DESC,pi_id desc,pd_pdno");
|
|
|
+ StringBuffer countSql = new StringBuffer("select count(1) from ( ");
|
|
|
+ countSql.append(searchSql);
|
|
|
+ countSql.append(" )");
|
|
|
+// logger.info("countSql:{}",countSql.toString());
|
|
|
+ Integer total = baseDao.getJdbcTemplate().queryForObject(countSql.toString(), Integer.class);
|
|
|
+ listResp.setTotal(total);
|
|
|
+ List<IOListDTO> ioListDTOS = new ArrayList<>();
|
|
|
+ if(total > 0){
|
|
|
+ StringBuffer querySql = new StringBuffer("select * from (select TT.*, ROWNUM rn from ( ");
|
|
|
+ querySql.append(searchSql);
|
|
|
+ querySql.append(" )TT where ROWNUM <= ");
|
|
|
+ querySql.append(end);
|
|
|
+ querySql.append(") where rn >= ");
|
|
|
+ querySql.append(start);
|
|
|
+// logger.info("querySql:{}",querySql.toString());
|
|
|
+ ioListDTOS = baseDao.getJdbcTemplate().query(querySql.toString(),
|
|
|
+ new BeanPropertyRowMapper<>(IOListDTO.class));
|
|
|
+ }
|
|
|
+ listResp.setList(ioListDTOS);
|
|
|
+ return Result.success(listResp);
|
|
|
+ }
|
|
|
}
|