Просмотр исходного кода

[审批][修改][添加审批流]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
97a77c6bd2
17 измененных файлов: 250 добавлений и 59 удалений
  1. +10
    -6
      mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java
  2. +5
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java
  3. +35
    -24
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java
  4. +27
    -7
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  5. +7
    -0
      mallinkService/src/main/java/com/iformall/domain/dto/WxCouponChannelDto.java
  6. +12
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java
  7. +2
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumChart.java
  8. +37
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumCouponAppType.java
  9. +6
    -1
      mallinkService/src/main/java/com/iformall/service/WxCouponService.java
  10. +5
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java
  11. +6
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java
  12. +17
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java
  13. +4
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  14. +63
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  15. +5
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java
  16. +5
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java
  17. +4
    -0
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 10
- 6
mallinkAdmin/src/main/java/com/iformall/controller/app/WxAppinfoController.java Просмотреть файл

@@ -57,9 +57,11 @@ public class WxAppinfoController extends BaseController {
String param = merchant.getWeappScene(); String param = merchant.getWeappScene();
ResultData resultData = qrCodeService.exportQrcode(null, null, merchant.getTenantId(), 1, pageUrl, param, 0, "", "", "店铺详情", true); ResultData resultData = qrCodeService.exportQrcode(null, null, merchant.getTenantId(), 1, pageUrl, param, 0, "", "", "店铺详情", true);
Map<String, String> map = (Map) resultData.data; Map<String, String> 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(); String param = couponChannel.getWeappScene();
ResultData resultData = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); ResultData resultData = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true);
Map<String,String> map = (Map)resultData.data; Map<String,String> 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);
}
} }
}); });
} }


+ 5
- 3
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; String param = "t:md:"+resultData.data;
ResultData resultQrCode = qrCodeService.exportQrcode(null,null,wxMerchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情",true); ResultData resultQrCode = qrCodeService.exportQrcode(null,null,wxMerchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情",true);
Map<String,String> map = (Map)resultQrCode.data; Map<String,String> 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; return resultData;


+ 35
- 24
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.controller.base.BaseController;
import com.iformall.domain.dto.WxCouponChannelDto; import com.iformall.domain.dto.WxCouponChannelDto;
import com.iformall.domain.po.MallUserInfo; import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxCoupon;
import com.iformall.domain.po.WxCouponChannel; import com.iformall.domain.po.WxCouponChannel;
import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.vo.WxCouponChannelAddVo; import com.iformall.domain.vo.WxCouponChannelAddVo;
import com.iformall.domain.vo.WxCouponChannelVo; 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.mapper.WxCouponChannelMapper;
import com.iformall.service.QrCodeService; import com.iformall.service.QrCodeService;
import com.iformall.service.WxCouponChannelService; import com.iformall.service.WxCouponChannelService;
import com.iformall.service.WxCouponService; import com.iformall.service.WxCouponService;
import com.iformall.service.WxFlowService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
@@ -45,6 +52,10 @@ public class WxCouponChannelController extends BaseController {
private WxCouponChannelMapper wxCouponChannelMapper; private WxCouponChannelMapper wxCouponChannelMapper;
@Autowired @Autowired
private QrCodeService qrCodeService; private QrCodeService qrCodeService;
@Autowired
private WxFlowService wxFlowService;
@Autowired
private WxCouponService wxCouponService;


@ApiOperation("分页列表接口") @ApiOperation("分页列表接口")
@GetMapping("list") @GetMapping("list")
@@ -80,9 +91,11 @@ public class WxCouponChannelController extends BaseController {
String param = couponChannel.getWeappScene(); String param = couponChannel.getWeappScene();
ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true);
Map<String,String> map = (Map)resultDataQ.data; Map<String,String> 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; return resultData;
} }
@@ -113,30 +126,28 @@ public class WxCouponChannelController extends BaseController {
logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch"); logger.debug("[" + getIpAddr() + "] WxCouponChannelController::addbatch");
String[] ids = wxCouponChannelDto.getCouponIds().split(","); String[] ids = wxCouponChannelDto.getCouponIds().split(",");
String[] channelId = wxCouponChannelDto.getChannelId().split(","); String[] channelId = wxCouponChannelDto.getChannelId().split(",");
ResultData resultData = wxCouponChannelService.addBatch(ids, channelId, getTenantId(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime());
List<WxCouponChannelAddVo> list = (List<WxCouponChannelAddVo>)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<String,String> 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查询接口") @ApiOperation("根据id查询接口")


+ 27
- 7
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.WxCoupon;
import com.iformall.domain.po.WxCouponChannel; import com.iformall.domain.po.WxCouponChannel;
import com.iformall.domain.vo.WxCouponStatisVo; 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.mapper.WxCouponChannelMapper;
import com.iformall.service.WxCouponService; import com.iformall.service.WxCouponService;
import com.iformall.service.WxFlowService;
import com.iformall.utils.DateUtils; import com.iformall.utils.DateUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@@ -38,6 +36,8 @@ public class WxCouponController extends BaseController {
private WxCouponService wxCouponService; private WxCouponService wxCouponService;
@Autowired @Autowired
private WxCouponChannelMapper wxCouponChannelMapper; private WxCouponChannelMapper wxCouponChannelMapper;
@Autowired
private WxFlowService wxFlowService;


@ApiOperation("分页列表接口") @ApiOperation("分页列表接口")
@GetMapping("list") @GetMapping("list")
@@ -74,7 +74,6 @@ public class WxCouponController extends BaseController {
return wxCouponService.list(wxCoupon, pageNum, pageSize); //全列表 return wxCouponService.list(wxCoupon, pageNum, pageSize); //全列表
} }



@ApiOperation("新增接口") @ApiOperation("新增接口")
@PostMapping("add") @PostMapping("add")
@SystemControllerLog(description = "券投放-新增") @SystemControllerLog(description = "券投放-新增")
@@ -100,8 +99,15 @@ public class WxCouponController extends BaseController {
return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。"); return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。");
} }
} }

wxCoupon.setTenantId(getTenantId()); 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); return wxCouponService.saveOrUpdate(wxCoupon);
} }


@@ -147,7 +153,21 @@ public class WxCouponController extends BaseController {
return new ResultData(ErrorCode.COUPON_STOCK_DATE_NO_CAR); return new ResultData(ErrorCode.COUPON_STOCK_DATE_NO_CAR);
} }
wxCoupon.setTenantId(getTenantId()); 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删除接口") @ApiOperation("根据id删除接口")


+ 7
- 0
mallinkService/src/main/java/com/iformall/domain/dto/WxCouponChannelDto.java Просмотреть файл

@@ -2,8 +2,10 @@ package com.iformall.domain.dto;


import lombok.Data; import lombok.Data;


import javax.persistence.Transient;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.Map;




@Data @Data
@@ -14,4 +16,9 @@ public class WxCouponChannelDto implements Serializable {
private String channelId; private String channelId;
private Date beginTime; private Date beginTime;
private Date endTime; private Date endTime;

@Transient
@io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams")
private Map<String, Object> flowParams;

} }

+ 12
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java Просмотреть файл

@@ -13,6 +13,7 @@ import javax.persistence.Transient;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;


@Table(name = "wx_coupon") @Table(name = "wx_coupon")
@Data @Data
@@ -171,6 +172,13 @@ public class WxCoupon extends BaseEntity {
//营销分析 //营销分析
private WxCouponStatisVo wxCouponStatisVo; 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 @Transient
@SortColumn(column = "press_count") @SortColumn(column = "press_count")
private Integer pressSendCount; private Integer pressSendCount;
@@ -198,6 +206,10 @@ public class WxCoupon extends BaseEntity {
@Transient @Transient
private Integer pressSuccCount; private Integer pressSuccCount;


@Transient
@io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams")
private Map<String, Object> flowParams;

@io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel") @io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel")
private Integer isDel; private Integer isDel;




+ 2
- 0
mallinkService/src/main/java/com/iformall/enums/EnumChart.java Просмотреть файл

@@ -61,6 +61,8 @@ public enum EnumChart {
INDEX_SALE_DATA(52, "营销数据"), INDEX_SALE_DATA(52, "营销数据"),


RENT_RATE_HISTORY(53, "商铺出租率走势"), RENT_RATE_HISTORY(53, "商铺出租率走势"),

BUSINESS(54,"业态分析"),
; ;


public static EnumChart getEnum(Integer code) { public static EnumChart getEnum(Integer code) {


+ 37
- 0
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;
}
}

+ 6
- 1
mallinkService/src/main/java/com/iformall/service/WxCouponService.java Просмотреть файл

@@ -61,7 +61,12 @@ public interface WxCouponService {
* @param record * @param record
*/ */
ResultData saveOrUpdate(WxCoupon record); ResultData saveOrUpdate(WxCoupon record);

/**
* 更新实体
*
* @param record
*/
void update(WxCoupon record);
/** /**
* 根据Id删除实体 * 根据Id删除实体
* *


+ 5
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java Просмотреть файл

@@ -276,9 +276,11 @@ public class WxCampaignServiceImpl implements WxCampaignService {
String param = couponChannel.getWeappScene(); String param = couponChannel.getWeappScene();
ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true);
Map<String,String> map = (Map)resultDataQ.data; Map<String,String> 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);
}
} }
} }




+ 6
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java Просмотреть файл

@@ -312,6 +312,11 @@ public class WxChartServiceImpl implements WxChartDataService {
return getRentRateHistory(tenantId,paramsMap); return getRentRateHistory(tenantId,paramsMap);
} }


//业务分析
if (chart.equals(EnumChart.BUSINESS.getCode())) {
return getRentRateHistory(tenantId,paramsMap);
}

return new ResultData(ErrorCode.REPORT_TYPE_UNKNOWN); return new ResultData(ErrorCode.REPORT_TYPE_UNKNOWN);
} }


@@ -339,7 +344,7 @@ public class WxChartServiceImpl implements WxChartDataService {
List<String> days = DateUtils.getTjTimeList(startTime, endTime, 1==dateType.intValue()?"0":"1"); List<String> days = DateUtils.getTjTimeList(startTime, endTime, 1==dateType.intValue()?"0":"1");
Map<String,Long> map = getMap(days); Map<String,Long> map = getMap(days);
for (Map<String,Object> m : mapList) { for (Map<String,Object> 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(); double all = allList.size();


+ 17
- 4
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.WxCouponChannelMapper;
import com.iformall.mapper.WxCouponMerchantMapper; import com.iformall.mapper.WxCouponMerchantMapper;
import com.iformall.mapper.WxMerchantMapper; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -43,6 +41,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
WxScreenAdService wxScreenAdService; WxScreenAdService wxScreenAdService;
@Autowired @Autowired
WxOrderService wxOrderService; WxOrderService wxOrderService;
@Autowired
QrCodeService qrCodeService;


/** /**
* B端业务端 * B端业务端
@@ -235,6 +235,19 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
vo.setId(channel.getId()); vo.setId(channel.getId());
vo.setType(channel.getType()); vo.setType(channel.getType());
vo.setSuc(true); 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<String,String> map = (Map)resultDataQ.data;
if(map!=null && map.get("url") !=null) {
String url = map.get("url");
couponChannel.setQrCode(url);
wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel);
}
return vo; return vo;
} }




+ 4
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java Просмотреть файл

@@ -576,4 +576,8 @@ public class WxCouponServiceImpl implements WxCouponService {
return new ResultData(); return new ResultData();
} }


@Override
public void update(WxCoupon record) {
wxCouponMapper.updateByPrimaryKeySelective(record);
}
} }

+ 63
- 4
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.UserTaskVo;
import com.iformall.domain.vo.WxBillAll; import com.iformall.domain.vo.WxBillAll;
import com.iformall.enums.*; 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.mq.MqBaseProducer;
import com.iformall.service.*; import com.iformall.service.*;
import com.iformall.utils.Constant; import com.iformall.utils.Constant;
@@ -84,6 +81,12 @@ public class WxFlowServiceImpl implements WxFlowService {
private WxFlowConfigMapper wxFlowConfigMapper; private WxFlowConfigMapper wxFlowConfigMapper;
@Autowired @Autowired
private WxBillAllService wxBillAllService; private WxBillAllService wxBillAllService;
@Autowired
private WxCouponMapper wxCouponMapper;
@Autowired
private WxCouponService wxCouponService;
@Autowired
private WxCouponChannelService wxCouponChannelService;


/** /**
* 获取流程key * 获取流程key
@@ -114,6 +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");
if(StringUtils.isNotBlank(str)){ if(StringUtils.isNotBlank(str)){
contractType = Integer.parseInt(str); contractType = Integer.parseInt(str);
} }
@@ -190,6 +194,60 @@ public class WxFlowServiceImpl implements WxFlowService {
wxBillAll.setNewPrice(newPrice); wxBillAll.setNewPrice(newPrice);
wxBillAllService.updateReceivePay(wxBillAll, user); 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("supplement",supplement);
map.put("taskAssignee",flowModel.getFlow()); map.put("taskAssignee",flowModel.getFlow());
setSignAssignee(map,flowModel.getFlow()); setSignAssignee(map,flowModel.getFlow());
map.put("tenantId",tenantId);


ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(flowModel.getFlowId(), map); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(flowModel.getFlowId(), map);
logger.debug("流程启动,流程id:{}",processInstance.getId()); logger.debug("流程启动,流程id:{}",processInstance.getId());


+ 5
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java Просмотреть файл

@@ -313,9 +313,11 @@ public class WxGameServiceImpl implements WxGameService {
String param = couponChannel.getWeappScene(); String param = couponChannel.getWeappScene();
ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true);
Map<String,String> map = (Map)resultDataQ.data; Map<String,String> 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);
}
} }
} }




+ 5
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java Просмотреть файл

@@ -141,9 +141,11 @@ public class WxTopicServiceImpl implements WxTopicService {
String param = couponChannel.getWeappScene(); String param = couponChannel.getWeappScene();
ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true);
Map<String,String> map = (Map)resultDataQ.data; Map<String,String> 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);
}
} }
} }




+ 4
- 0
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Просмотреть файл

@@ -38,6 +38,9 @@
<result column="credit_price" jdbcType="INTEGER" property="creditPrice"/> <result column="credit_price" jdbcType="INTEGER" property="creditPrice"/>
<result column="credit_refund" jdbcType="INTEGER" property="creditRefund"/> <result column="credit_refund" jdbcType="INTEGER" property="creditRefund"/>
<result column="is_del" property="isDel"/> <result column="is_del" property="isDel"/>
<result column="put_apply_status" property="putApplyStatus"/>
<result column="stock_apply_status" property="stockApplyStatus"/>
<result column="cancle_apply_status" property="cancleApplyStatus"/>
<result column="conditions" jdbcType="VARCHAR" property="conditions"/> <result column="conditions" jdbcType="VARCHAR" property="conditions"/>


</resultMap> </resultMap>
@@ -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`, `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`, `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`, `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` `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`,`conditions`
</sql> </sql>




Загрузка…
Отмена
Сохранить