Browse Source

[品牌][修改][品牌删除功能]

release_toaliyun_real
luozukai 7 years ago
parent
commit
7ae6bc84d3
6 changed files with 69 additions and 4 deletions
  1. +16
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  2. +2
    -0
      mallinkAdmin/src/main/resources/db/migration/V201906051753__L_ALTER_COUPON.sql
  3. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java
  4. +42
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/UserTaskVo.java
  5. +4
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  6. +2
    -1
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 16
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java View File

@@ -7,15 +7,19 @@ import com.iformall.common.Result;
import com.iformall.common.ResultData;
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.mapper.WxCouponChannelMapper;
import com.iformall.service.WxCouponService;
import com.iformall.utils.DateUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -31,6 +35,8 @@ public class WxCouponController extends BaseController {

@Autowired
private WxCouponService wxCouponService;
@Autowired
private WxCouponChannelMapper wxCouponChannelMapper;

@ApiOperation("分页列表接口")
@GetMapping("list")
@@ -61,6 +67,16 @@ public class WxCouponController extends BaseController {
if (wxCoupon.getId() == null) {
return new ResultData(ResultData.ERROR, "缺少id");
}
if(wxCoupon.getIsDel().equals(1)){
WxCouponChannel query = new WxCouponChannel();
query.setTenantId(wxCoupon.getTenantId());
query.setCouponId(wxCoupon.getId());
query.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode());
if(CollectionUtils.isNotEmpty(wxCouponChannelMapper.findList(query))){
return new ResultData(ResultData.ERROR, "有活动正在上架,请先下架。");
}
}

wxCoupon.setTenantId(getTenantId());
return wxCouponService.saveOrUpdate(wxCoupon);
}


+ 2
- 0
mallinkAdmin/src/main/resources/db/migration/V201906051753__L_ALTER_COUPON.sql View File

@@ -0,0 +1,2 @@
alter table wx_coupon
add column `is_del` SMALLINT(1) DEFAULT 0 COMMENT '是否删除1是0否';

+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java View File

@@ -194,6 +194,9 @@ public class WxCoupon extends BaseEntity {
@Transient
private Integer pressSuccCount;

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

public String getSalePriceStr() {
if(salePrice!=null) {
salePriceStr = new BigDecimal(salePrice).divide(new BigDecimal(100)).toString();


+ 42
- 0
mallinkService/src/main/java/com/iformall/domain/vo/UserTaskVo.java View File

@@ -0,0 +1,42 @@
package com.iformall.domain.vo;

import lombok.Data;
import java.io.Serializable;
import java.util.List;

@Data
public class UserTaskVo implements Serializable{
private static final long serialVersionUID = 1L;

private String name;

private List<Long> userList;

//1普通 2会签 3或签
private Integer type;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public List<Long> getUserList() {
return userList;
}

public void setUserList(List<Long> userList) {
this.userList = userList;
}

public Integer getType() {
return type;
}

public void setType(Integer type) {
this.type = type;
}
}

+ 4
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java View File

@@ -20,6 +20,7 @@ import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.UserTask;
import org.flowable.common.engine.api.FlowableIllegalArgumentException;
import org.flowable.engine.*;
import org.flowable.engine.runtime.Execution;
@@ -117,7 +118,7 @@ public class WxFlowServiceImpl implements WxFlowService {
contractType = Integer.parseInt(str);
}

if(1 == flowType){
if(EnumFlowKey.CONTRACT.getCode().equals(flowType)){
// 1租赁合同 2点位合同 3物业 4点位物业合同
if(contractType.intValue() == 1 || contractType.intValue() == 2){
WxRentContract rent = new WxRentContract();
@@ -142,7 +143,7 @@ public class WxFlowServiceImpl implements WxFlowService {
wxPropertyContractService.updatePropertyContractStatus(businessId);
}
}
}else if(3 == flowType){
}else if(EnumFlowKey.END_CONTRACT.getCode().equals(flowType)){
if(contractType.intValue() == 1 || contractType.intValue() == 2){
WxRentContract rent = new WxRentContract();
rent.setId(businessId);
@@ -189,7 +190,7 @@ public class WxFlowServiceImpl implements WxFlowService {
}
wxPropertyContractMapper.updateApplyStatus(wxPropertyContract);
}
} else if (2 == flowType) {
} else if (EnumFlowKey.BILL.getCode().equals(flowType)) {
if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) {
//账单审批
Integer billType = (Integer) getVariableByKey(variables, "billType");


+ 2
- 1
mallinkService/src/main/resources/mapper/WxCouponMapper.xml View File

@@ -37,6 +37,7 @@
<result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/>
<result column="credit_price" jdbcType="INTEGER" property="creditPrice"/>
<result column="credit_refund" jdbcType="INTEGER" property="creditRefund"/>
<result column="is_del" property="isDel"/>

</resultMap>
<resultMap id="statisMap" type="com.iformall.domain.vo.WxCouponStatisVo">
@@ -263,7 +264,7 @@


<sql id="dynamicWhereConditionsForCoupon">
where 1 = 1
where is_del = 0
<if test=" null != targetAd ">
and 0 = (select count(*) from wx_coupon_channel cc
where c.`id` = cc.coupon_id


Loading…
Cancel
Save