wuxw 1 anno fa
parent
commit
a287637246

+ 2 - 2
service-fee/src/main/java/com/java110/fee/cmd/fee/PayFeeConfirmCmd.java

@@ -423,7 +423,7 @@ public class PayFeeConfirmCmd extends Cmd {
         feeDto.setFeeId(paramObj.getString("feeId"));
         feeDto.setFeeId(paramObj.getString("feeId"));
         feeDto.setCommunityId(paramObj.getString("communityId"));
         feeDto.setCommunityId(paramObj.getString("communityId"));
         List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);
         List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);
-        if (feeDtos == null || feeDtos.size() < 1) {
+        if (ListUtil.isNull(feeDtos)) {
             return;
             return;
         }
         }
         //为停车费单独处理
         //为停车费单独处理
@@ -439,7 +439,7 @@ public class PayFeeConfirmCmd extends Cmd {
 
 
         Calendar endTimeCalendar = null;
         Calendar endTimeCalendar = null;
         //车位费用续租
         //车位费用续租
-        if (ownerCarDtos == null || ownerCarDtos.size() < 1) {
+        if (ListUtil.isNull(ownerCarDtos)) {
             return;
             return;
         }
         }
         for (OwnerCarDto tmpOwnerCarDto : ownerCarDtos) {
         for (OwnerCarDto tmpOwnerCarDto : ownerCarDtos) {

+ 37 - 12
service-user/src/main/java/com/java110/user/cmd/owner/EditOwnerCarCmd.java

@@ -26,10 +26,7 @@ import com.java110.dto.owner.OwnerCarDto;
 import com.java110.intf.user.IOwnerCarV1InnerServiceSMO;
 import com.java110.intf.user.IOwnerCarV1InnerServiceSMO;
 import com.java110.po.car.OwnerCarPo;
 import com.java110.po.car.OwnerCarPo;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.exception.CmdException;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.utils.util.DateUtil;
-import com.java110.utils.util.StringUtil;
+import com.java110.utils.util.*;
 import com.java110.vo.ResultVo;
 import com.java110.vo.ResultVo;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -66,6 +63,13 @@ public class EditOwnerCarCmd extends Cmd {
         Assert.jsonObjectHaveKey(reqJson, "carType", "请求报文中未包含carType");
         Assert.jsonObjectHaveKey(reqJson, "carType", "请求报文中未包含carType");
         Assert.hasLength(reqJson.getString("communityId"), "小区ID不能为空");
         Assert.hasLength(reqJson.getString("communityId"), "小区ID不能为空");
 
 
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
         OwnerCarDto ownerCarDto = new OwnerCarDto();
         OwnerCarDto ownerCarDto = new OwnerCarDto();
         ownerCarDto.setMemberId(reqJson.getString("memberId"));
         ownerCarDto.setMemberId(reqJson.getString("memberId"));
         ownerCarDto.setCommunityId(reqJson.getString("communityId"));
         ownerCarDto.setCommunityId(reqJson.getString("communityId"));
@@ -79,13 +83,6 @@ public class EditOwnerCarCmd extends Cmd {
         if (StringUtil.isEmpty(psId) || "-1".equals(psId)) {
         if (StringUtil.isEmpty(psId) || "-1".equals(psId)) {
             throw new IllegalArgumentException("车位已经被释放,不允许修改车辆信息");
             throw new IllegalArgumentException("车位已经被释放,不允许修改车辆信息");
         }
         }
-
-    }
-
-    @Override
-    @Java110Transactional
-    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
-
         if (!reqJson.containsKey("leaseType")) {
         if (!reqJson.containsKey("leaseType")) {
             reqJson.put("leaseType", OwnerCarDto.LEASE_TYPE_MONTH);
             reqJson.put("leaseType", OwnerCarDto.LEASE_TYPE_MONTH);
         }
         }
@@ -101,7 +98,35 @@ public class EditOwnerCarCmd extends Cmd {
         if (flag < 1) {
         if (flag < 1) {
             throw new CmdException("修改数据失败");
             throw new CmdException("修改数据失败");
         }
         }
-
         cmdDataFlowContext.setResponseEntity(ResultVo.success());
         cmdDataFlowContext.setResponseEntity(ResultVo.success());
+
+        if (OwnerCarDto.CAR_TYPE_MEMBER.equals(ownerCarDtos.get(0).getCarTypeCd())) {
+            return;
+        }
+
+        ownerCarDto = new OwnerCarDto();
+        ownerCarDto.setMemberId(reqJson.getString("memberId"));
+        ownerCarDto.setCommunityId(reqJson.getString("communityId"));
+        ownerCarDto.setCarId(reqJson.getString("carId"));
+        ownerCarDtos = ownerCarV1InnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
+
+
+        // todo 修改成员车辆的开始时间和结束时间
+        OwnerCarDto tmpOwnerCarDto = new OwnerCarDto();
+        tmpOwnerCarDto.setCarId(ownerCarDtos.get(0).getCarId());
+        tmpOwnerCarDto.setCarTypeCd(OwnerCarDto.CAR_TYPE_MEMBER);
+        List<OwnerCarDto> memberOwnerCarDtos = ownerCarV1InnerServiceSMOImpl.queryOwnerCars(tmpOwnerCarDto);
+
+        if (ListUtil.isNull(memberOwnerCarDtos)) {
+            return;
+        }
+        OwnerCarPo memberOwnerCarPo = null;
+        for (OwnerCarDto mOwnerCarDto : memberOwnerCarDtos) {
+            memberOwnerCarPo = new OwnerCarPo();
+            memberOwnerCarPo.setMemberId(mOwnerCarDto.getMemberId());
+            memberOwnerCarPo.setStartTime(DateUtil.getFormatTimeStringA(ownerCarDtos.get(0).getStartTime()));
+            memberOwnerCarPo.setEndTime(DateUtil.getFormatTimeStringA(ownerCarDtos.get(0).getEndTime()));
+            ownerCarV1InnerServiceSMOImpl.updateOwnerCar(memberOwnerCarPo);
+        }
     }
     }
 }
 }