| @@ -11,6 +11,7 @@ import com.iformall.domain.po.*; | |||||
| import com.iformall.enums.EnumAssignTagsTrigger; | import com.iformall.enums.EnumAssignTagsTrigger; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.Constant; | |||||
| 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; | ||||
| @@ -43,8 +44,6 @@ import static com.iformall.domain.po.WxCouponOrder.Field.CreateDate_DESC; | |||||
| public class WxCUserBasicInfoController extends BaseController { | public class WxCUserBasicInfoController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| private String importMemPrev = "importmem/"; | |||||
| @Autowired | @Autowired | ||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | private WxCUserBasicInfoService wxCUserBasicInfoService; | ||||
| @@ -280,7 +279,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| //得到当前用户ID | //得到当前用户ID | ||||
| final MallUserInfo user = getUser(); | final MallUserInfo user = getUser(); | ||||
| String userId = "" + user.getId(); | String userId = "" + user.getId(); | ||||
| String importKey = importMemPrev + userId; | |||||
| String importKey = Constant.importMemPrev + userId; | |||||
| final String tenantId = getTenantId(); | final String tenantId = getTenantId(); | ||||
| //查询当前用户得到的值是否为空,为空继续,不为空,返回模板正在导入 | //查询当前用户得到的值是否为空,为空继续,不为空,返回模板正在导入 | ||||
| @@ -295,7 +294,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| stringRedisTemplate.opsForHash().putIfAbsent(importKey, "processCount", ""); | stringRedisTemplate.opsForHash().putIfAbsent(importKey, "processCount", ""); | ||||
| stringRedisTemplate.opsForHash().putIfAbsent(importKey, "failCount", ""); | stringRedisTemplate.opsForHash().putIfAbsent(importKey, "failCount", ""); | ||||
| String fpath = "./upload/"; | |||||
| String fpath = Constant.fileDirectory; | |||||
| File targetFile = new File(fpath); | File targetFile = new File(fpath); | ||||
| if (!targetFile.exists()) { | if (!targetFile.exists()) { | ||||
| targetFile.mkdirs(); | targetFile.mkdirs(); | ||||
| @@ -357,7 +356,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| @GetMapping("/queryTemplateCount") | @GetMapping("/queryTemplateCount") | ||||
| public ResultData queryTemplateCount() { | public ResultData queryTemplateCount() { | ||||
| String importKey = importMemPrev + getUser().getId(); | |||||
| String importKey = Constant.importMemPrev + getUser().getId(); | |||||
| Map entries = stringRedisTemplate.opsForHash().entries(importKey); | Map entries = stringRedisTemplate.opsForHash().entries(importKey); | ||||
| logger.info(JSONArray.toJSONString(entries) + ">>>>>>>>>>>>>>>>>>>>>1"); | logger.info(JSONArray.toJSONString(entries) + ">>>>>>>>>>>>>>>>>>>>>1"); | ||||
| if (entries.size() < 4) { | if (entries.size() < 4) { | ||||
| @@ -13,7 +13,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| @Override | @Override | ||||
| public String getTenantId() { | public String getTenantId() { | ||||
| String tenantId = ""; | |||||
| String tenantId = null; | |||||
| try { | try { | ||||
| tenantId = (String) SecurityUtils.getSubject().getSession().getAttribute(UserSession.tenantId); | tenantId = (String) SecurityUtils.getSubject().getSession().getAttribute(UserSession.tenantId); | ||||
| } catch (InvalidSessionException e) { | } catch (InvalidSessionException e) { | ||||
| @@ -15,7 +15,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| @Override | @Override | ||||
| public String getTenantId() { | public String getTenantId() { | ||||
| String tenantId = ""; | |||||
| String tenantId = null; | |||||
| try { | try { | ||||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | ||||
| tenantId = (String) request.getAttribute(AuthorizationInterceptor.TENANT_ID); | tenantId = (String) request.getAttribute(AuthorizationInterceptor.TENANT_ID); | ||||
| @@ -68,6 +68,10 @@ public class WxCouponSend implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | ||||
| private Date updateDate; | private Date updateDate; | ||||
| /*发卷所属商户名**/ | |||||
| @Transient | |||||
| private String merchantName; | |||||
| /*场景发券计数**/ | /*场景发券计数**/ | ||||
| @Transient | @Transient | ||||
| protected int sendCount; | protected int sendCount; | ||||
| @@ -126,6 +130,15 @@ public class WxCouponSend implements Serializable { | |||||
| updateDate = _updateDate; | updateDate = _updateDate; | ||||
| } | } | ||||
| public String getMerchantName() { | |||||
| return merchantName; | |||||
| } | |||||
| public void setMerchantName(String merchantName) { | |||||
| this.merchantName = merchantName; | |||||
| } | |||||
| public int getSendCount() { | public int getSendCount() { | ||||
| return sendCount; | return sendCount; | ||||
| } | } | ||||
| @@ -2,5 +2,6 @@ package com.iformall.utils; | |||||
| public class Constant { | public class Constant { | ||||
| public static final String fileDirectory="./uploads/"; | |||||
| public static final String fileDirectory = "./uploads/"; | |||||
| public static final String importMemPrev = "importmem/"; | |||||
| } | } | ||||
| @@ -11,10 +11,18 @@ | |||||
| <result column="status" jdbcType="INTEGER" property="status" /> | <result column="status" jdbcType="INTEGER" property="status" /> | ||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | ||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | ||||
| <result column="merchant_name" jdbcType="VARCHAR" property="merchantName" /> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`coupon_id`,`title`,`send_type`,`conditions`,`status`,`create_date`,`update_date` | |||||
| `id`,`tenant_id`,`coupon_id`,`title`,`send_type`,`conditions`,`status`,`create_date`,`update_date`, | |||||
| (case when | |||||
| (select count(*) from wx_coupon_merchant xcm where xcm.product_id = coupon_id and status = 0)=1 | |||||
| then | |||||
| (select m.name from wx_merchant m, wx_coupon_merchant cm where m.id = cm.merchant_id and cm.product_id=coupon_id) | |||||
| else | |||||
| '[多商户通用]' | |||||
| end) as merchant_name | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||