| @@ -553,7 +553,7 @@ public class WxRentContractController extends WxContractBaseController { | |||
| return new ResultData(Result.ERROR,e.getMessage()); | |||
| } | |||
| wxRentContractService.updateRentContractStatus(wxRentContract.getId()); | |||
| wxRentContractService.updateRentContractStatus(wxRentContract.getId(),false); | |||
| if(contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | |||
| wxPropertyContractService.updatePropertyContractStatus(wxRentContract.getPropertyId()); | |||
| } | |||
| @@ -9,6 +9,7 @@ import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxCouponChannel; | |||
| import com.iformall.domain.po.WxCouponPassword; | |||
| import com.iformall.domain.po.WxFlowModel; | |||
| import com.iformall.domain.po.WxFlowRecord; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| @@ -145,14 +146,14 @@ public class WxCouponController extends BaseController { | |||
| return hasFlow(EnumFlowKey.B_COUPON_MERCHANT_CREATE,getTenantInfo()); | |||
| } | |||
| @ApiOperation("查询是否有审批流程") | |||
| @PostMapping("hasFlow") | |||
| public ResultData hasFlow() { | |||
| if (hasMerchantCouponFlow()) { | |||
| return new ResultData(1); | |||
| }else { | |||
| return new ResultData(0); | |||
| } | |||
| @ApiOperation("审批历史") | |||
| @GetMapping("flowHistory") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "couponId", value = "编号", dataType = "Long", paramType = "query", required = true)}) | |||
| public ResultData flowHistory(Long couponId) { | |||
| WxFlowRecord record = new WxFlowRecord(); | |||
| record.setBusinessId(String.valueOf(couponId)); | |||
| return new ResultData(wxFlowService.listAsPage(record, 1, 100)); | |||
| } | |||
| @@ -173,7 +174,7 @@ public class WxCouponController extends BaseController { | |||
| return new ResultData(Result.ERROR,EnumFlowKey.B_COUPON_MERCHANT_CREATE.getMessage()+"未配置审批流程"); | |||
| } | |||
| WxMerchantBUser buser = getUser(); | |||
| wxFlowService.start(generateFlowParams(EnumFlowKey.B_COUPON_MERCHANT_CREATE,EnumCouponAppType.PUT,wxCoupon,wxCoupon.getRemark(), buser.getPhone()), getBuserId(), buser.getName(), wxCoupon); | |||
| wxFlowService.start(generateFlowParams(EnumFlowKey.B_COUPON_MERCHANT_CREATE,EnumCouponAppType.PUT,coupon,wxCoupon.getRemark(), buser.getPhone()), getBuserId(), buser.getName(), coupon); | |||
| return new ResultData(Result.SUCCESS,"提交审批成功"); | |||
| } | |||
| @@ -117,11 +117,15 @@ public class WxMerchantController extends BaseController { | |||
| WxCUser cuUser = new WxCUser(); | |||
| cuUser.updateTenantInfo(getTenantInfo()); | |||
| cuUser.setPhone(phone); | |||
| WxCUser mUser = cUserService.getByObject(cuUser); | |||
| if (mUser != null) { | |||
| return new ResultData(mUser.getOpenId()); | |||
| } else { | |||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | |||
| try { | |||
| WxCUser mUser = cUserService.getByObject(cuUser); | |||
| if (mUser != null) { | |||
| return new ResultData(mUser.getOpenId()); | |||
| } else { | |||
| return new ResultData(ErrorCode.USER_IS_EMPTY,phone+"请在C端完成授权手机号操作。"); | |||
| } | |||
| }catch(Exception e) { | |||
| return new ResultData(ErrorCode.USER_IS_EMPTY.getCode(),phone+"匹配C端用户失败,该情况可能是未在C端授权手机号或者用户C端数据存在多个微信对应统一手机号异常数据。"); | |||
| } | |||
| } | |||
| return new ResultData(ErrorCode.USER_NO_PERMISSION); | |||
| @@ -161,7 +161,7 @@ public class WxCarController extends BaseController { | |||
| try { | |||
| vendorPersonId = parkFactory.getParkService(park.getVendorType()).bindCar(paramMap, park, member); | |||
| if(StringUtils.isBlank(vendorPersonId)) { | |||
| return new ResultData(Result.ERROR,"厂商会员ID未返回"); | |||
| return new ResultData(Result.ERROR,"厂商绑定车牌会员ID未返回"); | |||
| } | |||
| return parkHelper.bindCar(paramMap, park, member.getId(),vendorPersonId); | |||
| } catch (Exception e) { | |||
| @@ -68,7 +68,7 @@ public interface WxRentContractService { | |||
| ResultData updateFile(WxRentContract wxRentContract, Long userId,String userName,Date oldRentStartDate,boolean writeComplate); | |||
| ResultData updateRentContractStatus(Long id); | |||
| ResultData updateRentContractStatus(Long id,boolean buildPropertyBill); | |||
| List<Long> getShopIds(WxRentContract record) ; | |||
| @@ -73,12 +73,7 @@ public class WxCUserServiceImpl implements WxCUserService { | |||
| @Override | |||
| public WxCUser getByObject(WxCUser record) { | |||
| try { | |||
| return wxCUserMapper.selectOne(new QueryWrapper(record)); | |||
| } catch (Exception e) { | |||
| logger.error("NOT found: " + e.getMessage()); | |||
| } | |||
| return null; | |||
| return wxCUserMapper.selectOne(new QueryWrapper(record)); | |||
| } | |||
| @Override | |||
| @@ -216,7 +216,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||
| } | |||
| //如果审批完成 | |||
| }else if (EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | |||
| wxRentContractService.updateRentContractStatus(bsId); | |||
| wxRentContractService.updateRentContractStatus(bsId,false); | |||
| if (isrentproperty) { | |||
| wxPropertyContractService.updatePropertyContractStatus(propetyId); | |||
| } | |||
| @@ -1635,7 +1635,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| @Override | |||
| public ResultData updateRentContractStatus(Long id) { | |||
| public ResultData updateRentContractStatus(Long id,boolean buildProperyBill) { | |||
| if (id == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| @@ -1678,7 +1678,10 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| //押金 | |||
| buildDeposit( null, id); | |||
| } | |||
| updatePropertyPreviewBill(record); | |||
| //一起建立物业账单 | |||
| if (buildProperyBill) { | |||
| updatePropertyPreviewBill(record); | |||
| } | |||
| //作废合同 | |||
| //updateInvalidContract(id); | |||
| } | |||
| @@ -2513,6 +2516,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| } | |||
| @Override | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void outDateContract(WxMall wxMall) { | |||
| //查询有计租合同的商户 | |||
| WxRentContract wr = new WxRentContract(); | |||
| @@ -2548,7 +2552,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| WxRentContract wrcq = new WxRentContract(); | |||
| wrcq.setMerchantId(mid); | |||
| wrcq.setStatuss(EnumRentContractStatus.getValidStatus()); | |||
| List<WxRentContract> contractList0 = wxRentContractMapper.findList(wrc); | |||
| List<WxRentContract> contractList0 = wxRentContractMapper.findList(wrcq); | |||
| for (WxRentContract w : contractList0) { | |||
| List<Long> shopids0 = w.shopIdsByRentInfo(); | |||
| if (null != shopids0) { | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.service.park.impl.cyf; | |||
| import java.text.ParseException; | |||
| import java.util.Date; | |||
| import java.util.Map; | |||
| import org.springframework.stereotype.Service; | |||
| @@ -67,14 +68,20 @@ public class CYFParkCallbackService extends BaseParkService implements ParkCallB | |||
| @Override | |||
| public ParkNotifyParam parseUnbindNoticyParam(Object param) { | |||
| // TODO Auto-generated method stub | |||
| return null; | |||
| } | |||
| @Override | |||
| public ParkNotifyParam parsePaidNoticyParam(Object param) { | |||
| // TODO Auto-generated method stub | |||
| return null; | |||
| Map vo = (Map) param; | |||
| ParkNotifyParam p = new ParkNotifyParam(); | |||
| p.setCarNumber((String) vo.get("plate")); | |||
| p.setParkId(String.valueOf(vo.get("parkId"))); | |||
| p.setParkOrderId((String) vo.get("orderNo")); | |||
| p.setSynId((String) vo.get("orderNo")); | |||
| p.setFee(vo.get("fee").toString()); | |||
| p.setPayTime((Date) vo.get("payTime")); | |||
| return p; | |||
| } | |||
| @@ -19,6 +19,7 @@ import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxPark; | |||
| import com.iformall.domain.vo.WxCouponOrderCarCVo; | |||
| import com.iformall.enums.EnumCarVendor; | |||
| import com.iformall.enums.EnumCouponUnit; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.park.ParkAdapterService; | |||
| import com.iformall.service.park.impl.BaseParkService; | |||
| @@ -66,8 +67,7 @@ public class CYFParkService extends BaseParkService implements ParkAdapterServic | |||
| String ret = cyf.registerCar(token,park.getNumber(),feeGroupId,park.getParkingId(),carNumber,null,member.getNickName()); | |||
| JSONObject retObj = JSON.parseObject(ret); | |||
| if (retObj.getIntValue("result") == 1){ | |||
| //TODO 返回vendorPersonId | |||
| return null; | |||
| return retObj.get("localPersonId").toString(); | |||
| }else { | |||
| logger.error("cyfBindCar error. paramMap: {} . cyfResult: {}",JSON.toJSONString(paramMap),ret); | |||
| String msg = retObj.getString("strError"); | |||
| @@ -128,9 +128,45 @@ public class CYFParkService extends BaseParkService implements ParkAdapterServic | |||
| } | |||
| } | |||
| /** | |||
| * 优惠券支付流程:(1):调取openapi/getFee路径获取当前停车费,入参:plate,parkingId,token | |||
| (2):调用地址:http://wechat.cheyifu2016.com/fm-pay/#/transit?encodeURIComponent('orderNo=123&couponFee=2&actualFee=20') | |||
| 注: 详细参考接口文档参数 | |||
| * @param token | |||
| * @param orderNo | |||
| * @param couponFee | |||
| * @param actualFee | |||
| * @return | |||
| */ | |||
| @Override | |||
| public ResultData useCoupon(Map<String, String> paramMap, WxPark park, WxCouponOrderCarCVo userCar,WxCoupon coupon,String carNumber) throws Exception{ | |||
| return new ResultData(); | |||
| String params = park.getVendorParams(); | |||
| JSONObject objParams = JSON.parseObject(params); | |||
| String token = objParams.getString("token"); | |||
| //先获取停车费,然后再提交停车费 | |||
| String ret = cyf.getCarStopFee(token,park.getParkingId(),carNumber); | |||
| JSONObject retObj = JSON.parseObject(ret); | |||
| if (retObj.getIntValue("result") == 1){ | |||
| String orderId = retObj.getString("orderId"); | |||
| if (StringUtils.isBlank(orderId)) { | |||
| logger.error("cyfCarStopFee error. paramMap: {} . cyfResult: {}",JSON.toJSONString(paramMap),ret); | |||
| return new ResultData(ErrorCode.CYF_STOP_FEE_FAIL.getCode(), "车易付停车费查询未返回订单编号:"+orderId); | |||
| } | |||
| if (!coupon.getUnit().equals(EnumCouponUnit.MONEY.getCode())) { | |||
| return new ResultData(ErrorCode.CYF_STOP_FEE_FAIL.getCode(), "车易付只能支持金额券,不能使用小时券:"+orderId); | |||
| } | |||
| int fee = retObj.getInteger("fee"); | |||
| int amount = Integer.parseInt(coupon.getPriceStr()); | |||
| Map retmap = new HashMap(); | |||
| retmap.put("orderNo", orderId); | |||
| retmap.put("couponFee", amount); | |||
| retmap.put("actualFee", fee-amount); | |||
| return new ResultData(); | |||
| }else { | |||
| logger.error("cyfCarStopFee error. paramMap: {} . cyfResult: {}",JSON.toJSONString(paramMap),ret); | |||
| String msg = retObj.getString("strError"); | |||
| return new ResultData(ErrorCode.CYF_STOP_FEE_FAIL.getCode(), "停车费获取失败:"+msg); | |||
| } | |||
| } | |||
| @Override | |||
| @@ -54,8 +54,8 @@ public class CYFUtil { | |||
| //解绑车辆 | |||
| public static final String UNBIND_CAR = "http://oepn.cheyifu2016.com:8892/openapi/personCar/delete"; | |||
| //上报缴费接口 | |||
| //优惠券缴费接口 | |||
| public static final String COUPON_FEE = "http://oepn.cheyifu2016.com:8892/openapi/couponFee"; | |||
| @@ -140,8 +140,6 @@ public class CYFUtil { | |||
| return result; | |||
| } | |||
| private static String Proc(String url, Map<String, Object> paramMap) { | |||
| CloseableHttpClient httpClient = HttpClients.createDefault(); | |||