Parcourir la source

物料库存数量金额表合计修改

chenw il y a 7 ans
Parent
commit
039bd67441

+ 2 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java

@@ -556,7 +556,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         PageInfo<ProductReserveCostDTO> pageInfo = new PageInfo<ProductReserveCostDTO>(reserveCostList);
         map.put("list", pageInfo);
         //替换listReqDTO中的数据
-        String calculateFields = listReqDTO.getCalculateFields().replaceAll("rc_amount", "pw_amount").replaceAll("pw_onhand", "rc_number");
+        String calculateFields = listReqDTO.getCalculateFields().replaceAll("rc_amount", "po_amount").replaceAll("po_onhand", "rc_number");
         listReqDTO.setCalculateFields(calculateFields);
         //取对应计算数据
         String calculateFieldsSql = listReqDTO.getCalculateFieldsSql();
@@ -565,7 +565,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         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");
+            res = res.replaceAll("po_amount", "rc_amount").replace("po_onhand", "rc_number");
             try {
                 arr = JSONArray.parseArray(res);
             } catch (Exception e) {

+ 3 - 3
applications/document/document-server/src/main/resources/mapper/ProductMapper.xml

@@ -494,14 +494,14 @@
     </select>
     <select id="selectCalculateFields" resultType="string">
         select   ${fields}
-        from productWH tab left join Product on pw_prodid=pr_id left join warehouse on pw_whid=wh_id
+        from productonhand tab left join Product on pr_id = po_prodid and productonhand.companyId = product.companyId
         <where>
             <if test="con != null">
                 ${con}
             </if>
             <if test="companyId!=null">
-                and tab.companyId=#{companyId} and Product.companyId=#{companyId} and warehouse.companyId=#{companyId}
-                and pw_onhand!=0
+                and productonhand.companyId=#{companyId}
+                and po_onhand != 0
             </if>
         </where>
     </select>