java110 лет назад: 5
Родитель
Сommit
b18ecd8063

+ 30 - 0
java110-bean/src/main/java/com/java110/dto/payFeeDetailDiscount/PayFeeDetailDiscountDto.java

@@ -1,9 +1,11 @@
 package com.java110.dto.payFeeDetailDiscount;
 package com.java110.dto.payFeeDetailDiscount;
 
 
 import com.java110.dto.PageDto;
 import com.java110.dto.PageDto;
+import com.java110.dto.feeDiscountSpec.FeeDiscountSpecDto;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
+import java.util.List;
 
 
 /**
 /**
  * @ClassName FloorDto
  * @ClassName FloorDto
@@ -21,8 +23,12 @@ public class PayFeeDetailDiscountDto extends PageDto implements Serializable {
     private String remark;
     private String remark;
     private String communityId;
     private String communityId;
     private String discountId;
     private String discountId;
+    private String discountName;
+    private String discountType;
     private String feeId;
     private String feeId;
 
 
+    private List<FeeDiscountSpecDto> feeDiscountSpecs;
+
 
 
     private Date createTime;
     private Date createTime;
 
 
@@ -101,4 +107,28 @@ public class PayFeeDetailDiscountDto extends PageDto implements Serializable {
     public void setStatusCd(String statusCd) {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
         this.statusCd = statusCd;
     }
     }
+
+    public List<FeeDiscountSpecDto> getFeeDiscountSpecs() {
+        return feeDiscountSpecs;
+    }
+
+    public void setFeeDiscountSpecs(List<FeeDiscountSpecDto> feeDiscountSpecs) {
+        this.feeDiscountSpecs = feeDiscountSpecs;
+    }
+
+    public String getDiscountName() {
+        return discountName;
+    }
+
+    public void setDiscountName(String discountName) {
+        this.discountName = discountName;
+    }
+
+    public String getDiscountType() {
+        return discountType;
+    }
+
+    public void setDiscountType(String discountType) {
+        this.discountType = discountType;
+    }
 }
 }

+ 3 - 1
java110-db/src/main/resources/mapper/fee/PayFeeDetailDiscountServiceDaoImplMapper.xml

@@ -100,8 +100,10 @@
         select t.create_time,t.create_time createTime,t.detail_discount_id,t.detail_discount_id
         select t.create_time,t.create_time createTime,t.detail_discount_id,t.detail_discount_id
         detailDiscountId,t.discount_price,t.discount_price discountPrice,t.detail_id,t.detail_id
         detailDiscountId,t.discount_price,t.discount_price discountPrice,t.detail_id,t.detail_id
         detailId,t.status_cd,t.status_cd statusCd,t.remark,t.b_id,t.b_id bId,t.community_id,t.community_id
         detailId,t.status_cd,t.status_cd statusCd,t.remark,t.b_id,t.b_id bId,t.community_id,t.community_id
-        communityId,t.discount_id,t.discount_id discountId,t.fee_id,t.fee_id feeId
+        communityId,t.discount_id,t.discount_id discountId,t.fee_id,t.fee_id feeId,fd.discount_name discountName,
+        fd.discount_type discountType
         from pay_fee_detail_discount t
         from pay_fee_detail_discount t
+        left join fee_discount fd on t.discount_id = fd.discount_id and t.community_id = fd.community_id and fd.status_cd = '0'
         where 1 =1
         where 1 =1
         <if test="createTime !=null and createTime != ''">
         <if test="createTime !=null and createTime != ''">
             and t.create_time= #{createTime}
             and t.create_time= #{createTime}

+ 28 - 1
service-fee/src/main/java/com/java110/fee/api/FeeDiscountApi.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.java110.dto.feeDiscount.FeeDiscountDto;
 import com.java110.dto.feeDiscount.FeeDiscountDto;
 import com.java110.dto.feeDiscountRule.FeeDiscountRuleDto;
 import com.java110.dto.feeDiscountRule.FeeDiscountRuleDto;
 import com.java110.dto.feeDiscountRuleSpec.FeeDiscountRuleSpecDto;
 import com.java110.dto.feeDiscountRuleSpec.FeeDiscountRuleSpecDto;
+import com.java110.dto.payFeeDetailDiscount.PayFeeDetailDiscountDto;
 import com.java110.fee.bmo.feeDiscount.IDeleteFeeDiscountBMO;
 import com.java110.fee.bmo.feeDiscount.IDeleteFeeDiscountBMO;
 import com.java110.fee.bmo.feeDiscount.IGetFeeDiscountBMO;
 import com.java110.fee.bmo.feeDiscount.IGetFeeDiscountBMO;
 import com.java110.fee.bmo.feeDiscount.ISaveFeeDiscountBMO;
 import com.java110.fee.bmo.feeDiscount.ISaveFeeDiscountBMO;
@@ -17,7 +18,11 @@ import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 
 
 
 @RestController
 @RestController
@@ -178,4 +183,26 @@ public class FeeDiscountApi {
                                                      @RequestParam(value = "row") int row) {
                                                      @RequestParam(value = "row") int row) {
         return computeFeeDiscountBMOImpl.compute(feeId, communityId, cycles, page, row);
         return computeFeeDiscountBMOImpl.compute(feeId, communityId, cycles, page, row);
     }
     }
+
+
+    /**
+     * 查询 缴费优惠
+     *
+     * @return
+     * @serviceCode /feeDiscount/queryFeeDetailDiscount
+     * @path /app/feeDiscount/queryFeeDetailDiscount
+     */
+    @RequestMapping(value = "/queryFeeDetailDiscount", method = RequestMethod.GET)
+    public ResponseEntity<String> queryFeeDetailDiscount(
+            @RequestParam(value = "detailId") String detailId,
+            @RequestParam(value = "communityId") String communityId,
+            @RequestParam(value = "page") int page,
+            @RequestParam(value = "row") int row) {
+        PayFeeDetailDiscountDto payFeeDetailDiscountDto = new PayFeeDetailDiscountDto();
+        payFeeDetailDiscountDto.setPage(page);
+        payFeeDetailDiscountDto.setRow(row);
+        payFeeDetailDiscountDto.setDetailId(detailId);
+        payFeeDetailDiscountDto.setCommunityId(communityId);
+        return getFeeDiscountBMOImpl.getFeeDetailDiscount(payFeeDetailDiscountDto);
+    }
 }
 }

+ 7 - 0
service-fee/src/main/java/com/java110/fee/bmo/feeDiscount/IGetFeeDiscountBMO.java

@@ -1,6 +1,7 @@
 package com.java110.fee.bmo.feeDiscount;
 package com.java110.fee.bmo.feeDiscount;
 
 
 import com.java110.dto.feeDiscount.FeeDiscountDto;
 import com.java110.dto.feeDiscount.FeeDiscountDto;
+import com.java110.dto.payFeeDetailDiscount.PayFeeDetailDiscountDto;
 import org.springframework.http.ResponseEntity;
 import org.springframework.http.ResponseEntity;
 
 
 public interface IGetFeeDiscountBMO {
 public interface IGetFeeDiscountBMO {
@@ -16,4 +17,10 @@ public interface IGetFeeDiscountBMO {
     ResponseEntity<String> get(FeeDiscountDto feeDiscountDto);
     ResponseEntity<String> get(FeeDiscountDto feeDiscountDto);
 
 
 
 
+    /**
+     * 查询 缴费优惠
+     * @param payFeeDetailDiscountDto
+     * @return
+     */
+    ResponseEntity<String> getFeeDetailDiscount(PayFeeDetailDiscountDto payFeeDetailDiscountDto);
 }
 }

+ 59 - 0
service-fee/src/main/java/com/java110/fee/bmo/feeDiscount/impl/GetFeeDiscountBMOImpl.java

@@ -2,9 +2,11 @@ package com.java110.fee.bmo.feeDiscount.impl;
 
 
 import com.java110.dto.feeDiscount.FeeDiscountDto;
 import com.java110.dto.feeDiscount.FeeDiscountDto;
 import com.java110.dto.feeDiscountSpec.FeeDiscountSpecDto;
 import com.java110.dto.feeDiscountSpec.FeeDiscountSpecDto;
+import com.java110.dto.payFeeDetailDiscount.PayFeeDetailDiscountDto;
 import com.java110.fee.bmo.feeDiscount.IGetFeeDiscountBMO;
 import com.java110.fee.bmo.feeDiscount.IGetFeeDiscountBMO;
 import com.java110.intf.fee.IFeeDiscountInnerServiceSMO;
 import com.java110.intf.fee.IFeeDiscountInnerServiceSMO;
 import com.java110.intf.fee.IFeeDiscountSpecInnerServiceSMO;
 import com.java110.intf.fee.IFeeDiscountSpecInnerServiceSMO;
+import com.java110.intf.fee.IPayFeeDetailDiscountInnerServiceSMO;
 import com.java110.vo.ResultVo;
 import com.java110.vo.ResultVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.HttpStatus;
@@ -23,6 +25,9 @@ public class GetFeeDiscountBMOImpl implements IGetFeeDiscountBMO {
     @Autowired
     @Autowired
     private IFeeDiscountSpecInnerServiceSMO feeDiscountSpecInnerServiceSMOImpl;
     private IFeeDiscountSpecInnerServiceSMO feeDiscountSpecInnerServiceSMOImpl;
 
 
+    @Autowired
+    private IPayFeeDetailDiscountInnerServiceSMO payFeeDetailDiscountInnerServiceSMOImpl;
+
     /**
     /**
      * @param feeDiscountDto
      * @param feeDiscountDto
      * @return 订单服务能够接受的报文
      * @return 订单服务能够接受的报文
@@ -47,6 +52,60 @@ public class GetFeeDiscountBMOImpl implements IGetFeeDiscountBMO {
         return responseEntity;
         return responseEntity;
     }
     }
 
 
+    @Override
+    public ResponseEntity<String> getFeeDetailDiscount(PayFeeDetailDiscountDto payFeeDetailDiscountDto) {
+
+        int count = payFeeDetailDiscountInnerServiceSMOImpl.queryPayFeeDetailDiscountsCount(payFeeDetailDiscountDto);
+
+        List<PayFeeDetailDiscountDto> feeDetailDiscountDtos = null;
+        if (count > 0) {
+            feeDetailDiscountDtos = payFeeDetailDiscountInnerServiceSMOImpl.queryPayFeeDetailDiscounts(payFeeDetailDiscountDto);
+            freshDiscountDetailSpec(feeDetailDiscountDtos);
+        } else {
+            feeDetailDiscountDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) payFeeDetailDiscountDto.getRow()), count, feeDetailDiscountDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        return responseEntity;
+    }
+
+    private void freshDiscountDetailSpec(List<PayFeeDetailDiscountDto> feeDetailDiscountDtos) {
+
+        if (feeDetailDiscountDtos == null || feeDetailDiscountDtos.size() < 1) {
+            return;
+        }
+
+        List<String> discountIds = new ArrayList<>();
+        for (PayFeeDetailDiscountDto feeDetailDiscountDto : feeDetailDiscountDtos) {
+            discountIds.add(feeDetailDiscountDto.getDiscountId());
+        }
+
+        FeeDiscountSpecDto tmpFeeDiscountSpecDto = new FeeDiscountSpecDto();
+
+        tmpFeeDiscountSpecDto.setDiscountIds(discountIds.toArray(new String[discountIds.size()]));
+        tmpFeeDiscountSpecDto.setCommunityId(feeDetailDiscountDtos.get(0).getCommunityId());
+
+        List<FeeDiscountSpecDto> feeDiscountSpecDtos = feeDiscountSpecInnerServiceSMOImpl.queryFeeDiscountSpecs(tmpFeeDiscountSpecDto);
+
+        if (feeDiscountSpecDtos == null || feeDiscountSpecDtos.size() < 1) {
+            return;
+        }
+        List<FeeDiscountSpecDto> tmpSpecs = null;
+        for (PayFeeDetailDiscountDto feeDetailDiscountDto : feeDetailDiscountDtos) {
+            tmpSpecs = new ArrayList<>();
+            for (FeeDiscountSpecDto feeDiscountSpecDto : feeDiscountSpecDtos) {
+                if (feeDetailDiscountDto.getDiscountId().equals(feeDiscountSpecDto.getDiscountId())) {
+                    tmpSpecs.add(feeDiscountSpecDto);
+
+                }
+            }
+            feeDetailDiscountDto.setFeeDiscountSpecs(tmpSpecs);
+        }
+    }
+
     private void freshDiscountSpec(List<FeeDiscountDto> feeDiscountDtos) {
     private void freshDiscountSpec(List<FeeDiscountDto> feeDiscountDtos) {
 
 
         if (feeDiscountDtos == null || feeDiscountDtos.size() < 1) {
         if (feeDiscountDtos == null || feeDiscountDtos.size() < 1) {