diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java index 88e769a91..9c6c18c05 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -207,11 +207,11 @@ public class WxFlowServiceImpl implements WxFlowService { if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { //减库存 if(EnumFlowKey.NEW_COUPON_UPLINE.getCode().equals(flowType) || EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType)) { - Integer inventory = (Integer) getVariableByKey(variables, "inventory"); - Integer remainInventory = (Integer) getVariableByKey(variables, "remainInventory"); - Integer type = (Integer) getVariableByKey(variables, "type"); - Integer validDays = (Integer) getVariableByKey(variables, "validDays"); - Integer validType = (Integer) getVariableByKey(variables, "validType"); + Integer inventory = getIngeter(getVariableByKey(variables, "inventory")); + Integer remainInventory = getIngeter(getVariableByKey(variables, "remainInventory")); + Integer type = getIngeter(getVariableByKey(variables, "type")); + Integer validDays = getIngeter(getVariableByKey(variables, "validDays")); + Integer validType = getIngeter(getVariableByKey(variables, "validType")); wxCoupon.setInventory(inventory); wxCoupon.setRemainInventory(remainInventory); @@ -220,11 +220,11 @@ public class WxFlowServiceImpl implements WxFlowService { wxCoupon.setValidType(validType); wxCouponService.updateCouponStockAndEndTime(wxCoupon); }else if(EnumFlowKey.NEW_GROUP_UPLINE.getCode().equals(flowType)){ - Integer remainInventory = (Integer) getVariableByKey(variables, "remainInventory"); + Integer remainInventory = getIngeter(getVariableByKey(variables, "remainInventory")); wxCoupon.setRemainInventory(remainInventory); wxCouponMapper.updateByPrimaryKeySelective(wxCoupon); }else if(EnumFlowKey.NEW_PRESS_UPLINE.getCode().equals(flowType)){ - Integer inventory = (Integer) getVariableByKey(variables, "inventory"); + Integer inventory = getIngeter(getVariableByKey(variables, "inventory")); wxCoupon.setInventory(inventory); wxCouponMapper.updateByPrimaryKeySelective(wxCoupon); } @@ -275,12 +275,12 @@ public class WxFlowServiceImpl implements WxFlowService { } } - public Integer getBusinessType(Object businessType){ - if(businessType == null) return null; - if(businessType instanceof String){ - return Integer.parseInt((String)businessType); - }else if(businessType instanceof Integer){ - return (Integer)businessType; + public Integer getIngeter(Object obj){ + if(obj == null) return null; + if(obj instanceof String){ + return Integer.parseInt((String)obj); + }else if(obj instanceof Integer){ + return (Integer)obj; } return null; } @@ -290,7 +290,7 @@ public class WxFlowServiceImpl implements WxFlowService { public ResultData start(Map params,Long userId,String userName,String tenantId) { String remark = (String)params.get("remark"); Long businessId = Long.parseLong(params.get("businessId").toString()); - Integer flowType = getBusinessType(params.get("businessType")); + Integer flowType = getIngeter(params.get("businessType")); List> variables = (List)params.get("variables"); Boolean supplement = (Boolean)params.get("supplement");