| @@ -81,6 +81,10 @@ public class WxCouponController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::add"); | logger.debug("[" + getIpAddr() + "] WxCouponController::add"); | ||||
| ResultData resultData = wxCouponService.saveOrUpdate(wxCoupon); | ResultData resultData = wxCouponService.saveOrUpdate(wxCoupon); | ||||
| if(resultData.code != 200){ | |||||
| return resultData; | |||||
| } | |||||
| //启动投放审批 | //启动投放审批 | ||||
| if(wxCoupon.getFlowParams() !=null && wxCoupon.getFlowParams().size()>0) { | if(wxCoupon.getFlowParams() !=null && wxCoupon.getFlowParams().size()>0) { | ||||
| wxCoupon.getFlowParams().put("businessId",wxCoupon.getId()); | wxCoupon.getFlowParams().put("businessId",wxCoupon.getId()); | ||||
| @@ -113,6 +117,7 @@ public class WxCouponController extends BaseController { | |||||
| //启动审批流 | //启动审批流 | ||||
| if (wxCoupon.getFlowParams() != null && wxCoupon.getFlowParams().size() > 0) { | if (wxCoupon.getFlowParams() != null && wxCoupon.getFlowParams().size() > 0) { | ||||
| logger.info("------coupon.update().businessType:"+wxCoupon.getFlowParams().get("businessType")); | logger.info("------coupon.update().businessType:"+wxCoupon.getFlowParams().get("businessType")); | ||||
| wxCoupon.getFlowParams().put("businessId",wxCoupon.getId()); | |||||
| wxFlowService.start(wxCoupon.getFlowParams(), getUserId(), getUser().getName(), getTenantId()); | wxFlowService.start(wxCoupon.getFlowParams(), getUserId(), getUser().getName(), getTenantId()); | ||||
| //作废审批 | //作废审批 | ||||
| if (EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(wxCoupon.getStatus())) { | if (EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(wxCoupon.getStatus())) { | ||||
| @@ -229,7 +229,8 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| if (flag) { | if (flag) { | ||||
| String message = sb.toString(); | String message = sb.toString(); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "商户:" + message + "还未配置分账账户"); | |||||
| //todo:测试 | |||||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "商户:" + message + "还未配置分账账户"); | |||||
| } | } | ||||
| } | } | ||||
| @@ -117,7 +117,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| Boolean supplement = (Boolean)mapInfo.get("supplement"); | Boolean supplement = (Boolean)mapInfo.get("supplement"); | ||||
| Integer contractType = 0; | Integer contractType = 0; | ||||
| String str = (String)getVariableByKey(variables,"contractType"); | String str = (String)getVariableByKey(variables,"contractType"); | ||||
| Integer operateType = (Integer)getVariableByKey(variables,"operateType"); | |||||
| Integer operateType = (Integer)getVariableByKey(variables,"approvalType"); | |||||
| if(StringUtils.isNotBlank(str)){ | if(StringUtils.isNotBlank(str)){ | ||||
| contractType = Integer.parseInt(str); | contractType = Integer.parseInt(str); | ||||
| } | } | ||||
| @@ -204,14 +204,6 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| if(EnumCouponAppType.PUT.getCode().equals(operateType)){ | if(EnumCouponAppType.PUT.getCode().equals(operateType)){ | ||||
| wxCoupon.setPutApplyStatus(applyStatus); | wxCoupon.setPutApplyStatus(applyStatus); | ||||
| String idsV = (String)getVariableByKey(variables,"ids"); | |||||
| String channelIdV = (String)getVariableByKey(variables,"channelId"); | |||||
| String[] ids = idsV.split(","); | |||||
| String[] channelId = channelIdV.split(","); | |||||
| Date beginTime = (Date)getVariableByKey(variables,"beginTime"); | |||||
| Date endTime = (Date)getVariableByKey(variables,"endTime"); | |||||
| String tenantId = (String)getVariableByKey(variables,"tenantId"); | |||||
| wxCouponChannelService.addBatch(ids, channelId, tenantId, beginTime,endTime); | |||||
| }else if(EnumCouponAppType.STOCK.getCode().equals(operateType)){ | }else if(EnumCouponAppType.STOCK.getCode().equals(operateType)){ | ||||
| wxCoupon.setStockApplyStatus(applyStatus); | wxCoupon.setStockApplyStatus(applyStatus); | ||||
| if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue() | if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue() | ||||