Sfoglia il codice sorgente

处理统计卖家应收对账总金额的bug

yujia 7 anni fa
parent
commit
452a10caa6

+ 2 - 2
src/main/java/com/uas/platform/b2c/fa/payment/dao/BankTransferDao.java

@@ -32,8 +32,8 @@ public interface BankTransferDao extends JpaSpecificationExecutor<BankTransfer>,
 	 * @param collectenuu
 	 * @return
 	 */
-	@Query(value = "select sum(b.total) from BankTransfer b where b.operateType = :operateType and b.collectenuu = :collectenuu")
-	Double getLedgerByTypeAndEnuu(@Param("operateType") Integer operateType, @Param("collectenuu") Long collectenuu);
+	@Query(value = "select b.total from BankTransfer b where b.operateType = :operateType and b.collectenuu = :collectenuu")
+	List<Double> getLedgerByTypeAndEnuu(@Param("operateType") Integer operateType, @Param("collectenuu") Long collectenuu);
 
 	/**
 	 * 根据转账流水单id查找转账信息(客户)

+ 7 - 1
src/main/java/com/uas/platform/b2c/fa/payment/service/impl/BankTransferServiceImpl.java

@@ -584,7 +584,13 @@ public class BankTransferServiceImpl implements BankTransferService {
 	 */
 	@Override
 	public ResultMap getVendorBankTransferLedger() {
-		Double total = bankTransferDao.getLedgerByTypeAndEnuu(Type.SUP.value(), SystemSession.getUser().getEnterprise().getUu());
+		List<Double> totals = bankTransferDao.getLedgerByTypeAndEnuu(Type.SUP.value(), SystemSession.getUser().getEnterprise().getUu());
+		Double total = 0d;
+		if (org.apache.commons.collections.CollectionUtils.isNotEmpty(totals)) {
+			for (Double money : totals) {
+				total = NumberUtil.add(money, total);
+			}
+		}
 		return ResultMap.success(total);
 	}
 

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java

@@ -1841,7 +1841,7 @@ public class GoodsServiceImpl implements GoodsService {
         // 修改上下架状态并产生上下架历史
         GoodsHistory goodsHistory = null;
         if (!nowGoods.getStatus().equals(oldGoods.getStatus())) {
-            nowGoods.setStatus(oldGoods.getStatus());
+            //nowGoods.setStatus(oldGoods.getStatus());
             // 如果是下架
             if (oldGoods.getStatus().equals(Status.REMOVED.value())) {
                 goodsHistory = goodsHistoryService.converTGoodsHist(nowGoods, OperateType.Down.getPhrase(), false);