Преглед изворни кода

优化加入 开始时间和结束时间功能

java110 пре 3 година
родитељ
комит
d98b3c7c69

+ 37 - 0
java110-bean/src/main/java/com/java110/dto/carInoutPayment/CarInoutPaymentDto.java

@@ -20,6 +20,7 @@ public class CarInoutPaymentDto extends PageDto implements Serializable {
     public static final String PAY_TYPE_ALIPAY = "1";
 
     private String realCharge;
+    private String realChargeTotal;
     private String inoutId;
     private String payType;
     private String paymentId;
@@ -27,6 +28,7 @@ public class CarInoutPaymentDto extends PageDto implements Serializable {
     private String[] paIds;
     private String communityId;
     private String payCharge;
+    private String payChargeTotal;
     private String payTime;
     private String carNum;
     private String payTypeName;
@@ -38,6 +40,9 @@ public class CarInoutPaymentDto extends PageDto implements Serializable {
 
     private String statusCd = "0";
 
+    private String startTime;
+    private String endTime;
+
 
     public String getRealCharge() {
         return realCharge;
@@ -159,4 +164,36 @@ public class CarInoutPaymentDto extends PageDto implements Serializable {
     public void setPaIds(String[] paIds) {
         this.paIds = paIds;
     }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getRealChargeTotal() {
+        return realChargeTotal;
+    }
+
+    public void setRealChargeTotal(String realChargeTotal) {
+        this.realChargeTotal = realChargeTotal;
+    }
+
+    public String getPayChargeTotal() {
+        return payChargeTotal;
+    }
+
+    public void setPayChargeTotal(String payChargeTotal) {
+        this.payChargeTotal = payChargeTotal;
+    }
 }

+ 19 - 0
java110-bean/src/main/java/com/java110/dto/machine/CarInoutDto.java

@@ -52,6 +52,9 @@ public class CarInoutDto extends CarInoutPaymentDto implements Serializable {
     private String feeConfigId;
     private String configId;
 
+    private String startTime;
+    private String endTime;
+
 
     public String getInoutId() {
         return inoutId;
@@ -206,4 +209,20 @@ public class CarInoutDto extends CarInoutPaymentDto implements Serializable {
     public void setConfigId(String configId) {
         this.configId = configId;
     }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
 }

+ 12 - 0
java110-db/src/main/resources/mapper/common/CarInoutDetailV1ServiceDaoImplMapper.xml

@@ -65,6 +65,12 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.create_time &gt; #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.create_time &lt; #{endTime}
+        </if>
         group by t.inout_id,t.machine_id,t.machine_code,t.car_inout,t.pa_id,t.detail_id,t.car_num,t.status_cd,t.community_id,
         ci.in_time ,ci.out_time ,ci.pa_id ,td.name,t.remark,pa.num ,tcfc.fee_name ,tcfc.config_id
         order by t.create_time desc
@@ -158,6 +164,12 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.create_time &gt; #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.create_time &lt; #{endTime}
+        </if>
 
 
     </select>

+ 53 - 0
java110-db/src/main/resources/mapper/common/CarInoutPaymentV1ServiceDaoImplMapper.xml

@@ -56,6 +56,12 @@
         <if test="payCharge !=null and payCharge != ''">
             and t.pay_charge= #{payCharge}
         </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.create_time &gt; #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.create_time &lt; #{endTime}
+        </if>
         order by t.create_time desc
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
@@ -133,8 +139,55 @@
         <if test="payCharge !=null and payCharge != ''">
             and t.pay_charge= #{payCharge}
         </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.create_time &gt; #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.create_time &lt; #{endTime}
+        </if>
 
 
     </select>
+    <select id="queryCarInoutPaymentMarjor" parameterType="Map" resultType="Map">
+        select sum(t.real_charge) realChargeTotal,sum(t.pay_charge) payChargeTotal
+        from car_inout_payment t
+        where 1 =1
+        <if test="realCharge !=null and realCharge != ''">
+            and t.real_charge= #{realCharge}
+        </if>
+        <if test="inoutId !=null and inoutId != ''">
+            and t.inout_id= #{inoutId}
+        </if>
+        <if test="payType !=null and payType != ''">
+            and t.pay_type= #{payType}
+        </if>
+        <if test="paymentId !=null and paymentId != ''">
+            and t.payment_id= #{paymentId}
+        </if>
+        <if test="paId !=null and paId != ''">
+            and t.pa_id= #{paId}
+        </if>
+        <if test="paIds !=null ">
+            and t.pa_id in
+            <foreach collection="paIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="payCharge !=null and payCharge != ''">
+            and t.pay_charge= #{payCharge}
+        </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.create_time &gt; #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.create_time &lt; #{endTime}
+        </if>
 
+    </select>
 </mapper>

+ 12 - 0
java110-db/src/main/resources/mapper/common/CarInoutV1ServiceDaoImplMapper.xml

@@ -65,6 +65,12 @@
         <if test="outTime !=null and outTime != ''">
             and t.out_time= #{outTime}
         </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.in_time &gt; #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.in_time &lt; #{endTime}
+        </if>
         group by t.in_time,t.inout_id,t.pa_id,t.car_num,t.status_cd,t.state,t.community_id,t.out_time,td.`name`,pa.num,tcfc.fee_name,tcfc.config_id
         order by t.create_time desc
         <if test="page != -1 and page != null ">
@@ -145,6 +151,12 @@
         <if test="outTime !=null and outTime != ''">
             and t.out_time= #{outTime}
         </if>
+        <if test="startTime !=null and startTime != ''">
+            and t.in_time &gt; #{startTime}
+        </if>
+        <if test="endTime !=null and endTime != ''">
+            and t.in_time &lt; #{endTime}
+        </if>
 
 
     </select>

+ 2 - 0
java110-interface/src/main/java/com/java110/intf/common/ICarInoutPaymentV1InnerServiceSMO.java

@@ -65,4 +65,6 @@ public interface ICarInoutPaymentV1InnerServiceSMO {
      */
     @RequestMapping(value = "/queryCarInoutPaymentsCount", method = RequestMethod.POST)
     int queryCarInoutPaymentsCount(@RequestBody CarInoutPaymentDto carInoutPaymentDto);
+    @RequestMapping(value = "/queryCarInoutPaymentMarjor", method = RequestMethod.POST)
+    List<CarInoutPaymentDto> queryCarInoutPaymentMarjor(@RequestBody CarInoutPaymentDto carInoutPaymentDto);
 }

+ 14 - 0
service-common/src/main/java/com/java110/common/cmd/carInoutPayment/ListCarInoutPaymentCmd.java

@@ -77,6 +77,20 @@ public class ListCarInoutPaymentCmd extends Cmd {
             carInoutPaymentDtos = new ArrayList<>();
         }
 
+        if(carInoutPaymentDtos != null && carInoutPaymentDtos.size()>0){
+            List<CarInoutPaymentDto> tempCarInoutPaymentDtos = carInoutPaymentV1InnerServiceSMOImpl.queryCarInoutPaymentMarjor(carInoutPaymentDto);
+            for(CarInoutPaymentDto carInoutPaymentDto1: carInoutPaymentDtos){
+                carInoutPaymentDto1.setPayChargeTotal(tempCarInoutPaymentDtos.get(0).getPayChargeTotal());
+                carInoutPaymentDto1.setRealChargeTotal(tempCarInoutPaymentDtos.get(0).getRealChargeTotal());
+            }
+        }else{
+            for(CarInoutPaymentDto carInoutPaymentDto1: carInoutPaymentDtos){
+                carInoutPaymentDto1.setPayChargeTotal("0");
+                carInoutPaymentDto1.setRealChargeTotal("0");
+            }
+        }
+
+
         ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, carInoutPaymentDtos);
 
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);

+ 2 - 0
service-common/src/main/java/com/java110/common/dao/ICarInoutPaymentV1ServiceDao.java

@@ -16,6 +16,7 @@
 package com.java110.common.dao;
 
 
+import com.java110.dto.carInoutPayment.CarInoutPaymentDto;
 import com.java110.utils.exception.DAOException;
 import com.java110.entity.merchant.BoMerchant;
 import com.java110.entity.merchant.BoMerchantAttr;
@@ -74,4 +75,5 @@ public interface ICarInoutPaymentV1ServiceDao {
      */
     int queryCarInoutPaymentsCount(Map info);
 
+    List<Map> queryCarInoutPaymentMarjor(Map info);
 }

+ 16 - 0
service-common/src/main/java/com/java110/common/dao/impl/CarInoutPaymentV1ServiceDaoImpl.java

@@ -108,5 +108,21 @@ public class CarInoutPaymentV1ServiceDaoImpl extends BaseServiceDao implements I
         return Integer.parseInt(businessCarInoutPaymentInfos.get(0).get("count").toString());
     }
 
+    /**
+     * 查询车辆支付信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> queryCarInoutPaymentMarjor(Map info) throws DAOException {
+        logger.debug("查询 queryCarInoutPaymentMarjor 入参 info : {}",info);
+
+        List<Map> businessCarInoutPaymentInfos = sqlSessionTemplate.selectList("carInoutPaymentV1ServiceDaoImpl.queryCarInoutPaymentMarjor",info);
+
+        return businessCarInoutPaymentInfos;
+    }
+
+
 
 }

+ 6 - 0
service-common/src/main/java/com/java110/common/smo/impl/CarInoutPaymentV1InnerServiceSMOImpl.java

@@ -26,6 +26,8 @@ import com.java110.dto.user.UserDto;
 import com.java110.dto.PageDto;
 import org.springframework.beans.factory.annotation.Autowired;
 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.RestController;
 
 import java.util.ArrayList;
@@ -85,5 +87,9 @@ public class CarInoutPaymentV1InnerServiceSMOImpl extends BaseServiceSMO impleme
     @Override
     public int queryCarInoutPaymentsCount(@RequestBody CarInoutPaymentDto carInoutPaymentDto) {
         return carInoutPaymentV1ServiceDaoImpl.queryCarInoutPaymentsCount(BeanConvertUtil.beanCovertMap(carInoutPaymentDto));    }
+    @Override
+    public List<CarInoutPaymentDto> queryCarInoutPaymentMarjor(@RequestBody CarInoutPaymentDto carInoutPaymentDto){
+        return BeanConvertUtil.covertBeanList(carInoutPaymentV1ServiceDaoImpl.queryCarInoutPaymentMarjor(BeanConvertUtil.beanCovertMap(carInoutPaymentDto)),CarInoutPaymentDto.class);
+    }
 
 }