|
|
@@ -1,5 +1,6 @@
|
|
|
package com.usoftchina.saas.document.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
@@ -502,7 +503,23 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
|
|
|
//取分页信息
|
|
|
PageInfo<ProductReserveCostDTO> pageInfo = new PageInfo<ProductReserveCostDTO>(reserveCostList);
|
|
|
map.put("list", pageInfo);
|
|
|
- map.put("calculate", null);
|
|
|
+ //替换listReqDTO中的数据
|
|
|
+ String calculateFields = listReqDTO.getCalculateFields().replaceAll("rc_amount", "pw_amount").replaceAll("pw_onhand", "rc_number");
|
|
|
+ listReqDTO.setCalculateFields(calculateFields);
|
|
|
+ //取对应计算数据
|
|
|
+ String calculateFieldsSql = listReqDTO.getCalculateFieldsSql();
|
|
|
+ Long companyId = BaseContextHolder.getCompanyId();
|
|
|
+ String condition = listReqDTO.getFinalCondition();
|
|
|
+ JSONArray arr = new JSONArray();
|
|
|
+ if (!StringUtils.isEmpty(calculateFieldsSql)) {
|
|
|
+ String res = getMapper().selectCalculateFields(calculateFieldsSql, condition, companyId);
|
|
|
+ res = res.replaceAll("pw_amount", "rc_amount").replace("pw_onhand", "rc_number");
|
|
|
+ try {
|
|
|
+ arr = JSONArray.parseArray(res);
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("calculate", arr);
|
|
|
return map;
|
|
|
}
|
|
|
|