diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java b/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java index e5fd0528f..91d6100dd 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java @@ -57,9 +57,11 @@ public class WxAppinfoController extends BaseController { String param = merchant.getWeappScene(); ResultData resultData = qrCodeService.exportQrcode(null, null, merchant.getTenantId(), 1, pageUrl, param, 0, "", "", "店铺详情", true); Map map = (Map) resultData.data; - String url = map.get("url"); - merchant.setQrCode(url); - wxMerchantMapper.updateByPrimaryKeySelective(merchant); + if(map!=null && map.get("url") !=null) { + String url = map.get("url"); + merchant.setQrCode(url); + wxMerchantMapper.updateByPrimaryKeySelective(merchant); + } } }); } @@ -81,9 +83,11 @@ public class WxAppinfoController extends BaseController { String param = couponChannel.getWeappScene(); ResultData resultData = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); Map map = (Map)resultData.data; - String url = map.get("url"); - couponChannel.setQrCode(url); - wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); + if(map!=null && map.get("url") !=null) { + String url = map.get("url"); + couponChannel.setQrCode(url); + wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); + } } }); } diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java index 2a8ca6014..9cfd63f38 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java @@ -108,9 +108,11 @@ public class WxMerchantController extends BaseController { String param = "t:md:"+resultData.data; ResultData resultQrCode = qrCodeService.exportQrcode(null,null,wxMerchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情",true); Map map = (Map)resultQrCode.data; - String url = map.get("url"); - wxMerchant.setQrCode(url); - wxMerchantService.updateMerchant(wxMerchant); + if(map!=null && map.get("url") !=null) { + String url = map.get("url"); + wxMerchant.setQrCode(url); + wxMerchantService.updateMerchant(wxMerchant); + } } return resultData; 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 15fb0e231..f5ac302bc 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java @@ -9,13 +9,20 @@ import com.iformall.controller.app.WxAppinfoController; import com.iformall.controller.base.BaseController; import com.iformall.domain.dto.WxCouponChannelDto; import com.iformall.domain.po.MallUserInfo; +import com.iformall.domain.po.WxCoupon; import com.iformall.domain.po.WxCouponChannel; +import com.iformall.domain.po.WxRentContract; import com.iformall.domain.vo.WxCouponChannelAddVo; import com.iformall.domain.vo.WxCouponChannelVo; +import com.iformall.enums.EnumCouponChannelStatus; +import com.iformall.enums.EnumFlowRecordStatus; +import com.iformall.enums.EnumRentContractAppStatus; +import com.iformall.enums.EnumRentContractStatus; import com.iformall.mapper.WxCouponChannelMapper; import com.iformall.service.QrCodeService; import com.iformall.service.WxCouponChannelService; import com.iformall.service.WxCouponService; +import com.iformall.service.WxFlowService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -45,6 +52,10 @@ public class WxCouponChannelController extends BaseController { private WxCouponChannelMapper wxCouponChannelMapper; @Autowired private QrCodeService qrCodeService; + @Autowired + private WxFlowService wxFlowService; + @Autowired + private WxCouponService wxCouponService; @ApiOperation("分页列表接口") @GetMapping("list") @@ -80,9 +91,11 @@ public class WxCouponChannelController extends BaseController { String param = couponChannel.getWeappScene(); ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); Map map = (Map)resultDataQ.data; - String url = map.get("url"); - couponChannel.setQrCode(url); - wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); + if(map!=null && map.get("url") !=null) { + String url = map.get("url"); + couponChannel.setQrCode(url); + wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); + } } return resultData; } @@ -113,30 +126,28 @@ public class WxCouponChannelController extends BaseController { logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); String[] ids = wxCouponChannelDto.getCouponIds().split(","); String[] channelId = wxCouponChannelDto.getChannelId().split(","); - ResultData resultData = wxCouponChannelService.addBatch(ids, channelId, getTenantId(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); - List list = (List)resultData.data; - - //生成二维码 - if(CollectionUtils.isNotEmpty(list)){ - String pageUrl = "pages/index/index"; - - for (WxCouponChannelAddVo vo:list) { - WxCouponChannel couponChannel = new WxCouponChannel(); - couponChannel.setId(vo.getId()); - couponChannel.setType(vo.getType()); - String param = couponChannel.getWeappScene(); - ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); - Map map = (Map)resultDataQ.data; - String url = map.get("url"); - couponChannel.setQrCode(url); - wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); + 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); } - - resultData.data = null; } - - return resultData; + return new 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 258aca5e9..353a24fed 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -9,12 +9,10 @@ import com.iformall.controller.base.BaseController; import com.iformall.domain.po.WxCoupon; import com.iformall.domain.po.WxCouponChannel; import com.iformall.domain.vo.WxCouponStatisVo; -import com.iformall.enums.EnumCouponChannelStatus; -import com.iformall.enums.EnumCouponType; -import com.iformall.enums.EnumCouponValidType; -import com.iformall.enums.EnumDelFlag; +import com.iformall.enums.*; import com.iformall.mapper.WxCouponChannelMapper; import com.iformall.service.WxCouponService; +import com.iformall.service.WxFlowService; import com.iformall.utils.DateUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -38,6 +36,8 @@ public class WxCouponController extends BaseController { private WxCouponService wxCouponService; @Autowired private WxCouponChannelMapper wxCouponChannelMapper; + @Autowired + private WxFlowService wxFlowService; @ApiOperation("分页列表接口") @GetMapping("list") @@ -74,7 +74,6 @@ public class WxCouponController extends BaseController { return wxCouponService.list(wxCoupon, pageNum, pageSize); //全列表 } - @ApiOperation("新增接口") @PostMapping("add") @SystemControllerLog(description = "券投放-新增") @@ -100,8 +99,15 @@ public class WxCouponController extends BaseController { return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。"); } } - 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(); + } + } return wxCouponService.saveOrUpdate(wxCoupon); } @@ -147,7 +153,21 @@ public class WxCouponController extends BaseController { return new ResultData(ErrorCode.COUPON_STOCK_DATE_NO_CAR); } wxCoupon.setTenantId(getTenantId()); - return wxCouponService.updateCouponStockAndEndTime(wxCoupon); + + if(wxCoupon.getFlowParams() != null && wxCoupon.getFlowParams().size() >0){ +// 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()); + }else{ + return wxCouponService.updateCouponStockAndEndTime(wxCoupon); + } + + return new ResultData(); } @ApiOperation("根据id删除接口") diff --git a/mallinkService/src/main/java/com/iformall/domain/dto/WxCouponChannelDto.java b/mallinkService/src/main/java/com/iformall/domain/dto/WxCouponChannelDto.java index e99a5a518..0a5829898 100644 --- a/mallinkService/src/main/java/com/iformall/domain/dto/WxCouponChannelDto.java +++ b/mallinkService/src/main/java/com/iformall/domain/dto/WxCouponChannelDto.java @@ -2,8 +2,10 @@ package com.iformall.domain.dto; import lombok.Data; +import javax.persistence.Transient; import java.io.Serializable; import java.util.Date; +import java.util.Map; @Data @@ -14,4 +16,9 @@ public class WxCouponChannelDto implements Serializable { private String channelId; private Date beginTime; private Date endTime; + + @Transient + @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") + private Map flowParams; + } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java index 893f73a99..166a7274f 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java @@ -13,6 +13,7 @@ import javax.persistence.Transient; import java.math.BigDecimal; import java.util.Date; import java.util.List; +import java.util.Map; @Table(name = "wx_coupon") @Data @@ -171,6 +172,13 @@ public class WxCoupon extends BaseEntity { //营销分析 private WxCouponStatisVo wxCouponStatisVo; + @io.swagger.annotations.ApiModelProperty(value="投放审批状态",name="putApplyStatus") + private Integer putApplyStatus; + @io.swagger.annotations.ApiModelProperty(value="库存审批状态",name="stockApplyStatus") + private Integer stockApplyStatus; + @io.swagger.annotations.ApiModelProperty(value="作废审批状态",name="cancleApplyStatus") + private Integer cancleApplyStatus; + @Transient @SortColumn(column = "press_count") private Integer pressSendCount; @@ -198,6 +206,10 @@ public class WxCoupon extends BaseEntity { @Transient private Integer pressSuccCount; + @Transient + @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") + private Map flowParams; + @io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel") private Integer isDel; diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumChart.java b/mallinkService/src/main/java/com/iformall/enums/EnumChart.java index 490e1b008..e21e201f7 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumChart.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumChart.java @@ -61,6 +61,8 @@ public enum EnumChart { INDEX_SALE_DATA(52, "营销数据"), RENT_RATE_HISTORY(53, "商铺出租率走势"), + + BUSINESS(54,"业态分析"), ; public static EnumChart getEnum(Integer code) { diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumCouponAppType.java b/mallinkService/src/main/java/com/iformall/enums/EnumCouponAppType.java new file mode 100644 index 000000000..0851c3d19 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/enums/EnumCouponAppType.java @@ -0,0 +1,37 @@ +package com.iformall.enums; + +/** + * Created by luozukai + */ +public enum EnumCouponAppType { + PUT(1, "投放"), + STOCK(2, "库存"), + CANCLE(3, "作废"), + + ; + + public static EnumCouponAppType getEnum(Integer code) { + for (EnumCouponAppType value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + private Integer code; + private String message; + + EnumCouponAppType(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } +} diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java index 39029ec61..cb260e70c 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java @@ -61,7 +61,12 @@ public interface WxCouponService { * @param record */ ResultData saveOrUpdate(WxCoupon record); - + /** + * 更新实体 + * + * @param record + */ + void update(WxCoupon record); /** * 根据Id删除实体 * diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java index dc7fd1472..8a3cb9819 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java @@ -276,9 +276,11 @@ public class WxCampaignServiceImpl implements WxCampaignService { String param = couponChannel.getWeappScene(); ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); Map map = (Map)resultDataQ.data; - String url = map.get("url"); - couponChannel.setQrCode(url); - wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); + if(map!=null && map.get("url") !=null) { + String url = map.get("url"); + couponChannel.setQrCode(url); + wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); + } } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java index 8e15f7b18..912bc4e4a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java @@ -312,6 +312,11 @@ public class WxChartServiceImpl implements WxChartDataService { return getRentRateHistory(tenantId,paramsMap); } + //业务分析 + if (chart.equals(EnumChart.BUSINESS.getCode())) { + return getRentRateHistory(tenantId,paramsMap); + } + return new ResultData(ErrorCode.REPORT_TYPE_UNKNOWN); } @@ -339,7 +344,7 @@ public class WxChartServiceImpl implements WxChartDataService { List days = DateUtils.getTjTimeList(startTime, endTime, 1==dateType.intValue()?"0":"1"); Map map = getMap(days); for (Map m : mapList) { - map.put((String)m.get("xTime"),(Long)m.get("xCount")); + map.put((String)m.get( "xTime"),(Long)m.get("xCount")); } double all = allList.size(); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java index 24f812a72..7bcfe1a8f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java @@ -16,10 +16,8 @@ import com.iformall.enums.*; import com.iformall.mapper.WxCouponChannelMapper; import com.iformall.mapper.WxCouponMerchantMapper; import com.iformall.mapper.WxMerchantMapper; -import com.iformall.service.WxCouponChannelService; -import com.iformall.service.WxCouponService; -import com.iformall.service.WxOrderService; -import com.iformall.service.WxScreenAdService; +import com.iformall.service.*; +import org.checkerframework.checker.units.qual.A; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -43,6 +41,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { WxScreenAdService wxScreenAdService; @Autowired WxOrderService wxOrderService; + @Autowired + QrCodeService qrCodeService; /** * B端业务端 @@ -235,6 +235,19 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { vo.setId(channel.getId()); vo.setType(channel.getType()); vo.setSuc(true); + + String pageUrl = "pages/index/index"; + WxCouponChannel couponChannel = new WxCouponChannel(); + couponChannel.setId(vo.getId()); + couponChannel.setType(vo.getType()); + String param = couponChannel.getWeappScene(); + ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); + Map map = (Map)resultDataQ.data; + if(map!=null && map.get("url") !=null) { + String url = map.get("url"); + couponChannel.setQrCode(url); + wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); + } return vo; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index 8a8a3f499..b290b300f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -576,4 +576,8 @@ public class WxCouponServiceImpl implements WxCouponService { return new ResultData(); } + @Override + public void update(WxCoupon record) { + wxCouponMapper.updateByPrimaryKeySelective(record); + } } 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 9c938a750..b3432f9d1 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -14,10 +14,7 @@ import com.iformall.domain.vo.FlowUserVo; import com.iformall.domain.vo.UserTaskVo; import com.iformall.domain.vo.WxBillAll; import com.iformall.enums.*; -import com.iformall.mapper.WxFlowConfigMapper; -import com.iformall.mapper.WxFlowModelMapper; -import com.iformall.mapper.WxFlowRecordMapper; -import com.iformall.mapper.WxPropertyContractMapper; +import com.iformall.mapper.*; import com.iformall.mq.MqBaseProducer; import com.iformall.service.*; import com.iformall.utils.Constant; @@ -84,6 +81,12 @@ public class WxFlowServiceImpl implements WxFlowService { private WxFlowConfigMapper wxFlowConfigMapper; @Autowired private WxBillAllService wxBillAllService; + @Autowired + private WxCouponMapper wxCouponMapper; + @Autowired + private WxCouponService wxCouponService; + @Autowired + private WxCouponChannelService wxCouponChannelService; /** * 获取流程key @@ -114,6 +117,7 @@ public class WxFlowServiceImpl implements WxFlowService { Boolean supplement = (Boolean)mapInfo.get("supplement"); Integer contractType = 0; String str = (String)getVariableByKey(variables,"contractType"); + Integer operateType = (Integer)getVariableByKey(variables,"operateType"); if(StringUtils.isNotBlank(str)){ contractType = Integer.parseInt(str); } @@ -190,6 +194,60 @@ public class WxFlowServiceImpl implements WxFlowService { wxBillAll.setNewPrice(newPrice); wxBillAllService.updateReceivePay(wxBillAll, user); } + } else if (EnumFlowKey.NEW_COUPON_UPLINE.getCode().equals(flowType) + || EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType) + || EnumFlowKey.NEW_GROUP_UPLINE.getCode().equals(flowType) + || EnumFlowKey.NEW_PRESS_UPLINE.getCode().equals(flowType)) { + WxCoupon wxCoupon = new WxCoupon(); + wxCoupon.setId(businessId); + wxCoupon.setUpdateDate(new Date()); + + if(EnumCouponAppType.PUT.getCode().equals(operateType)){ + 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)){ + wxCoupon.setStockApplyStatus(applyStatus); + if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue() + ||EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType)) { + //减库存 + if(EnumFlowKey.NEW_COUPON_UPLINE.getCode().equals(flowType)) { + Integer inventory = (Integer) getVariableByKey(variables, "inventory"); + Integer remainInventory = (Integer) getVariableByKey(variables, "remainInventory"); + Integer type = (Integer) getVariableByKey(variables, "type"); + String validDays = (String) getVariableByKey(variables, "validDays"); + Integer validType = (Integer) getVariableByKey(variables, "validType"); + + wxCoupon.setInventory(inventory); + wxCoupon.setRemainInventory(remainInventory); + wxCoupon.setType(type); + wxCoupon.setValidDays(Integer.parseInt(validDays)); + wxCoupon.setValidType(validType); + wxCouponService.updateCouponStockAndEndTime(wxCoupon); + }else if(EnumFlowKey.NEW_GROUP_UPLINE.getCode().equals(flowType)){ + Integer remainInventory = (Integer) getVariableByKey(variables, "remainInventory"); + wxCoupon.setRemainInventory(remainInventory); + wxCouponMapper.updateByPrimaryKeySelective(wxCoupon); + }else if(EnumFlowKey.NEW_PRESS_UPLINE.getCode().equals(flowType)){ + Integer inventory = (Integer) getVariableByKey(variables, "inventory"); + wxCoupon.setInventory(inventory); + wxCouponMapper.updateByPrimaryKeySelective(wxCoupon); + } + } + }else if(EnumCouponAppType.CANCLE.getCode().equals(operateType)){ + wxCoupon.setCancleApplyStatus(applyStatus); + if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { + //作废 + wxCoupon.setStatus(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode()); + } + } + wxCouponMapper.updateByPrimaryKeySelective(wxCoupon); } } @@ -255,6 +313,7 @@ public class WxFlowServiceImpl implements WxFlowService { map.put("supplement",supplement); map.put("taskAssignee",flowModel.getFlow()); setSignAssignee(map,flowModel.getFlow()); + map.put("tenantId",tenantId); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(flowModel.getFlowId(), map); logger.debug("流程启动,流程id:{}",processInstance.getId()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java index eef060507..d21c7111b 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java @@ -313,9 +313,11 @@ public class WxGameServiceImpl implements WxGameService { String param = couponChannel.getWeappScene(); ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); Map map = (Map)resultDataQ.data; - String url = map.get("url"); - couponChannel.setQrCode(url); - wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); + if(map!=null && map.get("url") !=null) { + String url = map.get("url"); + couponChannel.setQrCode(url); + wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); + } } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java index 153c8c5b9..f37aab56e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java @@ -141,9 +141,11 @@ public class WxTopicServiceImpl implements WxTopicService { String param = couponChannel.getWeappScene(); ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); Map map = (Map)resultDataQ.data; - String url = map.get("url"); - couponChannel.setQrCode(url); - wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); + if(map!=null && map.get("url") !=null) { + String url = map.get("url"); + couponChannel.setQrCode(url); + wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); + } } } diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 6d2a33c3f..c7e7967d0 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -38,6 +38,9 @@ + + + @@ -92,6 +95,7 @@ `id`,`tenant_id`,`type`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`send_type`, `valid_type`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`price`,`unit`,`remain_inventory`,`inventory`, `remark`,`status`,`create_date`,`update_date`,`business`,`sub_business`,`support_transfer`,`subsidy_num`,`subsidy_type`, + `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`,put_apply_status,stock_apply_status,cancle_apply_status `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`,`conditions`