| @@ -7,15 +7,19 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | 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.vo.WxCouponStatisVo; | import com.iformall.domain.vo.WxCouponStatisVo; | ||||
| import com.iformall.enums.EnumCouponChannelStatus; | |||||
| import com.iformall.enums.EnumCouponType; | import com.iformall.enums.EnumCouponType; | ||||
| import com.iformall.enums.EnumCouponValidType; | import com.iformall.enums.EnumCouponValidType; | ||||
| import com.iformall.mapper.WxCouponChannelMapper; | |||||
| import com.iformall.service.WxCouponService; | import com.iformall.service.WxCouponService; | ||||
| 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; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.collections.CollectionUtils; | |||||
| import org.apache.commons.collections.map.HashedMap; | import org.apache.commons.collections.map.HashedMap; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -31,6 +35,8 @@ public class WxCouponController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxCouponService wxCouponService; | private WxCouponService wxCouponService; | ||||
| @Autowired | |||||
| private WxCouponChannelMapper wxCouponChannelMapper; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -61,6 +67,16 @@ public class WxCouponController extends BaseController { | |||||
| if (wxCoupon.getId() == null) { | if (wxCoupon.getId() == null) { | ||||
| return new ResultData(ResultData.ERROR, "缺少id"); | 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()); | wxCoupon.setTenantId(getTenantId()); | ||||
| return wxCouponService.saveOrUpdate(wxCoupon); | return wxCouponService.saveOrUpdate(wxCoupon); | ||||
| } | } | ||||
| @@ -0,0 +1,2 @@ | |||||
| alter table wx_coupon | |||||
| add column `is_del` SMALLINT(1) DEFAULT 0 COMMENT '是否删除1是0否'; | |||||
| @@ -194,6 +194,9 @@ public class WxCoupon extends BaseEntity { | |||||
| @Transient | @Transient | ||||
| private Integer pressSuccCount; | private Integer pressSuccCount; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel") | |||||
| private Integer isDel; | |||||
| public String getSalePriceStr() { | public String getSalePriceStr() { | ||||
| if(salePrice!=null) { | if(salePrice!=null) { | ||||
| salePriceStr = new BigDecimal(salePrice).divide(new BigDecimal(100)).toString(); | salePriceStr = new BigDecimal(salePrice).divide(new BigDecimal(100)).toString(); | ||||
| @@ -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; | |||||
| } | |||||
| } | |||||
| @@ -20,6 +20,7 @@ import org.apache.commons.collections.map.HashedMap; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.apache.shiro.SecurityUtils; | import org.apache.shiro.SecurityUtils; | ||||
| import org.flowable.bpmn.model.BpmnModel; | import org.flowable.bpmn.model.BpmnModel; | ||||
| import org.flowable.bpmn.model.UserTask; | |||||
| import org.flowable.common.engine.api.FlowableIllegalArgumentException; | import org.flowable.common.engine.api.FlowableIllegalArgumentException; | ||||
| import org.flowable.engine.*; | import org.flowable.engine.*; | ||||
| import org.flowable.engine.runtime.Execution; | import org.flowable.engine.runtime.Execution; | ||||
| @@ -117,7 +118,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| contractType = Integer.parseInt(str); | contractType = Integer.parseInt(str); | ||||
| } | } | ||||
| if(1 == flowType){ | |||||
| if(EnumFlowKey.CONTRACT.getCode().equals(flowType)){ | |||||
| // 1租赁合同 2点位合同 3物业 4点位物业合同 | // 1租赁合同 2点位合同 3物业 4点位物业合同 | ||||
| if(contractType.intValue() == 1 || contractType.intValue() == 2){ | if(contractType.intValue() == 1 || contractType.intValue() == 2){ | ||||
| WxRentContract rent = new WxRentContract(); | WxRentContract rent = new WxRentContract(); | ||||
| @@ -142,7 +143,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| wxPropertyContractService.updatePropertyContractStatus(businessId); | wxPropertyContractService.updatePropertyContractStatus(businessId); | ||||
| } | } | ||||
| } | } | ||||
| }else if(3 == flowType){ | |||||
| }else if(EnumFlowKey.END_CONTRACT.getCode().equals(flowType)){ | |||||
| if(contractType.intValue() == 1 || contractType.intValue() == 2){ | if(contractType.intValue() == 1 || contractType.intValue() == 2){ | ||||
| WxRentContract rent = new WxRentContract(); | WxRentContract rent = new WxRentContract(); | ||||
| rent.setId(businessId); | rent.setId(businessId); | ||||
| @@ -189,7 +190,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| } | } | ||||
| wxPropertyContractMapper.updateApplyStatus(wxPropertyContract); | wxPropertyContractMapper.updateApplyStatus(wxPropertyContract); | ||||
| } | } | ||||
| } else if (2 == flowType) { | |||||
| } else if (EnumFlowKey.BILL.getCode().equals(flowType)) { | |||||
| if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | ||||
| //账单审批 | //账单审批 | ||||
| Integer billType = (Integer) getVariableByKey(variables, "billType"); | Integer billType = (Integer) getVariableByKey(variables, "billType"); | ||||
| @@ -37,6 +37,7 @@ | |||||
| <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/> | <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/> | ||||
| <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"/> | |||||
| </resultMap> | </resultMap> | ||||
| <resultMap id="statisMap" type="com.iformall.domain.vo.WxCouponStatisVo"> | <resultMap id="statisMap" type="com.iformall.domain.vo.WxCouponStatisVo"> | ||||
| @@ -263,7 +264,7 @@ | |||||
| <sql id="dynamicWhereConditionsForCoupon"> | <sql id="dynamicWhereConditionsForCoupon"> | ||||
| where 1 = 1 | |||||
| where is_del = 0 | |||||
| <if test=" null != targetAd "> | <if test=" null != targetAd "> | ||||
| and 0 = (select count(*) from wx_coupon_channel cc | and 0 = (select count(*) from wx_coupon_channel cc | ||||
| where c.`id` = cc.coupon_id | where c.`id` = cc.coupon_id | ||||