From 8f7a54fdac35b5126a159716b55ff6d8a19c237b Mon Sep 17 00:00:00 2001 From: luozukai Date: Wed, 26 Jun 2019 17:13:12 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=A1=E6=89=B9=E6=B5=81][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E5=AE=8C=E5=96=84]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../market/WxCouponChannelController.java | 24 ++------------- .../controller/market/WxCouponController.java | 29 +++++++++++++++---- .../src/main/resources/application-dev.yml | 4 +-- 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java index 85f9a793c..f425a3c27 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java @@ -116,28 +116,8 @@ public class WxCouponChannelController extends BaseController { logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); String[] ids = wxCouponChannelDto.getCouponIds().split(","); String[] channelId = wxCouponChannelDto.getChannelId().split(","); - - if (org.springframework.util.CollectionUtils.isEmpty(wxCouponChannelDto.getFlowParams())) { - ResultData resultData = wxCouponChannelService.addBatch(ids, channelId, getTenantId(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); - return resultData; - }else{ - //走审批 - wxCouponChannelDto.getFlowParams().put("ids",wxCouponChannelDto.getCouponIds()); - wxCouponChannelDto.getFlowParams().put("channelId",wxCouponChannelDto.getChannelId()); - wxCouponChannelDto.getFlowParams().put("tenantId",getTenantId()); - wxCouponChannelDto.getFlowParams().put("beginTime",wxCouponChannelDto.getBeginTime()); - wxCouponChannelDto.getFlowParams().put("endTime",wxCouponChannelDto.getEndTime()); - - wxFlowService.start(wxCouponChannelDto.getFlowParams(), getUserId(), getUser().getName(), getTenantId()); - //修改coupon applyStatus状态为审核中 - for (String id:ids) { - WxCoupon wxCoupon = new WxCoupon(); - wxCoupon.setId(Long.parseLong(id)); - wxCoupon.setPutApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); - wxCouponService.update(wxCoupon); - } - } - return new ResultData(); + ResultData resultData = wxCouponChannelService.addBatch(ids, channelId, getTenantId(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); + return resultData; } @ApiOperation("根据id查询接口") diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java index ec01ce31b..f02e6fcfc 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -79,7 +79,16 @@ public class WxCouponController extends BaseController { @SystemControllerLog(description = "券投放-新增") public ResultData add(@RequestBody WxCoupon wxCoupon) { logger.debug("[" + getIpAddr() + "] WxCouponController::add"); - return wxCouponService.saveOrUpdate(wxCoupon); + + ResultData resultData = wxCouponService.saveOrUpdate(wxCoupon); + //启动投放审批 + if(wxCoupon.getFlowParams() !=null && wxCoupon.getFlowParams().size()>0) { + wxCoupon.getFlowParams().put("businessId",wxCoupon.getId()); + wxFlowService.start(wxCoupon.getFlowParams(), getUserId(), getUser().getName(), getTenantId()); + //修改coupon applyStatus状态为审核中 + wxCoupon.setPutApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); + } + return resultData; } @ApiOperation("根据id更新接口") @@ -101,11 +110,16 @@ public class WxCouponController extends BaseController { } wxCoupon.setTenantId(getTenantId()); - //作废走审批 - if (EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(wxCoupon.getStatus())) { - if (wxCoupon.getFlowParams() != null && wxCoupon.getFlowParams().size() > 0) { - wxFlowService.start(wxCoupon.getFlowParams(), getUserId(), getUser().getName(), getTenantId()); - return new ResultData(); + //启动审批流 + if (wxCoupon.getFlowParams() != null && wxCoupon.getFlowParams().size() > 0) { + logger.info("------coupon.update().businessType:"+wxCoupon.getFlowParams().get("businessType")); + wxFlowService.start(wxCoupon.getFlowParams(), getUserId(), getUser().getName(), getTenantId()); + //作废审批 + if (EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode().equals(wxCoupon.getStatus())) { + wxCoupon.setCancleApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); + }else{ + //投放审批 + wxCoupon.setPutApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); } } return wxCouponService.saveOrUpdate(wxCoupon); @@ -163,6 +177,9 @@ public class WxCouponController extends BaseController { // wxCoupon.getFlowParams().put("validType",wxCoupon.getValidType()); wxFlowService.start(wxCoupon.getFlowParams(), getUserId(), getUser().getName(), getTenantId()); + wxCoupon.setStockApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); + wxCoupon.setUpdateDate(new Date()); + wxCouponService.update(wxCoupon); }else{ return wxCouponService.updateCouponStockAndEndTime(wxCoupon); } diff --git a/mallinkAdmin/src/main/resources/application-dev.yml b/mallinkAdmin/src/main/resources/application-dev.yml index b42940e74..e5afcafe0 100644 --- a/mallinkAdmin/src/main/resources/application-dev.yml +++ b/mallinkAdmin/src/main/resources/application-dev.yml @@ -113,8 +113,8 @@ fm: exception: false exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com deploy: 1 - open: true - upload_dir: /home/test/server/uploads/ + open: false + upload_dir: /tmp/ ueditor: config: config.json