| @@ -174,15 +174,36 @@ public class WxCouponController extends BaseController { | |||||
| } | } | ||||
| wxCoupon.setTenantId(getTenantId()); | wxCoupon.setTenantId(getTenantId()); | ||||
| //启动审批流 | |||||
| if(wxCoupon.getFlowParams() != null && wxCoupon.getFlowParams().size() >0){ | if(wxCoupon.getFlowParams() != null && wxCoupon.getFlowParams().size() >0){ | ||||
| List<Map<String,Object>> variables = (List)wxCoupon.getFlowParams().get("variables"); | |||||
| Map<String,Object> map = new HashedMap(); | |||||
| map.put("key","inventory"); | |||||
| map.put("value",wxCoupon.getInventory()); | |||||
| variables.add(map); | |||||
| map = new HashedMap(); | |||||
| map.put("key","remainInventory"); | |||||
| map.put("value",wxCoupon.getRemainInventory()); | |||||
| variables.add(map); | |||||
| map = new HashedMap(); | |||||
| map.put("key","type"); | |||||
| map.put("value",wxCoupon.getType()); | |||||
| variables.add(map); | |||||
| map = new HashedMap(); | |||||
| map.put("key","validEndDate"); | |||||
| map.put("value",wxCoupon.getValidEndDate()); | |||||
| map = new HashedMap(); | |||||
| map.put("key","validStartDate"); | |||||
| map.put("value",wxCoupon.getValidStartDate()); | |||||
| map = new HashedMap(); | |||||
| map.put("key","validType"); | |||||
| map.put("value",wxCoupon.getValidType()); | |||||
| variables.add(map); | |||||
| map = new HashedMap(); | |||||
| map.put("key","validDays"); | |||||
| map.put("value",wxCoupon.getValidDays()); | |||||
| variables.add(map); | |||||
| wxCoupon.getFlowParams().put("businessId",wxCoupon.getId()); | wxCoupon.getFlowParams().put("businessId",wxCoupon.getId()); | ||||
| wxCoupon.getFlowParams().put("inventory",wxCoupon.getInventory()); | |||||
| wxCoupon.getFlowParams().put("remainInventory",wxCoupon.getRemainInventory()); | |||||
| wxCoupon.getFlowParams().put("type",wxCoupon.getType()); | |||||
| wxCoupon.getFlowParams().put("validEndDate",wxCoupon.getValidEndDate()); | |||||
| wxCoupon.getFlowParams().put("validStartDate",wxCoupon.getValidStartDate()); | |||||
| wxCoupon.getFlowParams().put("validType",wxCoupon.getValidType()); | |||||
| wxFlowService.start(wxCoupon.getFlowParams(), getUserId(), getUser().getName(), getTenantId()); | wxFlowService.start(wxCoupon.getFlowParams(), getUserId(), getUser().getName(), getTenantId()); | ||||
| wxCoupon.setStockApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); | wxCoupon.setStockApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); | ||||
| wxCoupon.setUpdateDate(new Date()); | wxCoupon.setUpdateDate(new Date()); | ||||
| @@ -110,10 +110,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| @Override | @Override | ||||
| public ResultData addBatch(String[] ids, String[] channelId, String tanantId, Date beginTime, Date endTime) { | public ResultData addBatch(String[] ids, String[] channelId, String tanantId, Date beginTime, Date endTime) { | ||||
| List<WxCouponChannelAddVo> errorList = new ArrayList<>(); | List<WxCouponChannelAddVo> errorList = new ArrayList<>(); | ||||
| List<WxCouponChannelAddVo> sucList = new ArrayList<>(); | |||||
| for (String targetIdstr:channelId) { | for (String targetIdstr:channelId) { | ||||
| Integer targetId = Integer.parseInt(targetIdstr); | Integer targetId = Integer.parseInt(targetIdstr); | ||||
| for (String couponidstr:ids) { | for (String couponidstr:ids) { | ||||
| @@ -121,15 +118,13 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| WxCouponChannelAddVo vo = addCouponChannel(couponid,targetId,tanantId,beginTime,endTime); | WxCouponChannelAddVo vo = addCouponChannel(couponid,targetId,tanantId,beginTime,endTime); | ||||
| if(!vo.isSuc()){ | if(!vo.isSuc()){ | ||||
| errorList.add(vo); | errorList.add(vo); | ||||
| }else{ | |||||
| sucList.add(vo); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if(errorList.size()>0) { | if(errorList.size()>0) { | ||||
| return new ResultData(errorList); | return new ResultData(errorList); | ||||
| }else { | }else { | ||||
| return new ResultData(sucList); | |||||
| return new ResultData(); | |||||
| } | } | ||||
| } | } | ||||
| @@ -213,13 +213,13 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| Integer inventory = (Integer) getVariableByKey(variables, "inventory"); | Integer inventory = (Integer) getVariableByKey(variables, "inventory"); | ||||
| Integer remainInventory = (Integer) getVariableByKey(variables, "remainInventory"); | Integer remainInventory = (Integer) getVariableByKey(variables, "remainInventory"); | ||||
| Integer type = (Integer) getVariableByKey(variables, "type"); | Integer type = (Integer) getVariableByKey(variables, "type"); | ||||
| String validDays = (String) getVariableByKey(variables, "validDays"); | |||||
| Integer validDays = (Integer) getVariableByKey(variables, "validDays"); | |||||
| Integer validType = (Integer) getVariableByKey(variables, "validType"); | Integer validType = (Integer) getVariableByKey(variables, "validType"); | ||||
| wxCoupon.setInventory(inventory); | wxCoupon.setInventory(inventory); | ||||
| wxCoupon.setRemainInventory(remainInventory); | wxCoupon.setRemainInventory(remainInventory); | ||||
| wxCoupon.setType(type); | wxCoupon.setType(type); | ||||
| wxCoupon.setValidDays(Integer.parseInt(validDays)); | |||||
| wxCoupon.setValidDays(validDays); | |||||
| wxCoupon.setValidType(validType); | wxCoupon.setValidType(validType); | ||||
| wxCouponService.updateCouponStockAndEndTime(wxCoupon); | wxCouponService.updateCouponStockAndEndTime(wxCoupon); | ||||
| }else if(EnumFlowKey.NEW_GROUP_UPLINE.getCode().equals(flowType)){ | }else if(EnumFlowKey.NEW_GROUP_UPLINE.getCode().equals(flowType)){ | ||||