| @@ -262,8 +262,8 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| @GetMapping("/queryTemplateCount") | @GetMapping("/queryTemplateCount") | ||||
| public ResultData queryTemplateCount() { | public ResultData queryTemplateCount() { | ||||
| String userId = getUser().getId().toString(); | |||||
| Map entries = stringRedisTemplate.opsForHash().entries(userId); | |||||
| String importKey = "import-" + getUser().getId(); | |||||
| 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) { | ||||
| entries.clear(); | entries.clear(); | ||||
| @@ -274,22 +274,22 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| String successCount = entries.get("successCount").toString(); | String successCount = entries.get("successCount").toString(); | ||||
| String failCount = entries.get("failCount").toString(); | String failCount = entries.get("failCount").toString(); | ||||
| if (allCount.equals(failCount)) {//stringRedisTemplate.expire(userId,1,TimeUnit.SECONDS); | |||||
| if (StringUtils.isNotBlank(failCount) && allCount.equals(failCount)) {//stringRedisTemplate.expire(userId,1,TimeUnit.SECONDS); | |||||
| logger.info(JSONArray.toJSONString(entries) + ">>>>>>>>>>>>>>>>>>>>>2"); | logger.info(JSONArray.toJSONString(entries) + ">>>>>>>>>>>>>>>>>>>>>2"); | ||||
| //完全失败 | //完全失败 | ||||
| stringRedisTemplate.opsForHash().delete(userId, "allCount"); | |||||
| stringRedisTemplate.opsForHash().delete(userId, "allSuccessCount"); | |||||
| stringRedisTemplate.opsForHash().delete(userId, "successCount"); | |||||
| stringRedisTemplate.opsForHash().delete(userId, "failCount"); | |||||
| stringRedisTemplate.opsForHash().delete(importKey, "allCount"); | |||||
| stringRedisTemplate.opsForHash().delete(importKey, "allSuccessCount"); | |||||
| stringRedisTemplate.opsForHash().delete(importKey, "successCount"); | |||||
| stringRedisTemplate.opsForHash().delete(importKey, "failCount"); | |||||
| return new ResultData(ErrorCode.MEM_IMPORT_ERR); | return new ResultData(ErrorCode.MEM_IMPORT_ERR); | ||||
| } | } | ||||
| //导入完成 | //导入完成 | ||||
| if (allSuccessCount.equals(successCount)) { | |||||
| if (StringUtils.isNotBlank(allSuccessCount) && allSuccessCount.equals(successCount)) { | |||||
| ResultData ok = new ResultData(Result.SUCCESS, "ok", entries); | ResultData ok = new ResultData(Result.SUCCESS, "ok", entries); | ||||
| stringRedisTemplate.opsForHash().delete(userId, "allCount"); | |||||
| stringRedisTemplate.opsForHash().delete(userId, "allSuccessCount"); | |||||
| stringRedisTemplate.opsForHash().delete(userId, "successCount"); | |||||
| stringRedisTemplate.opsForHash().delete(userId, "failCount"); | |||||
| stringRedisTemplate.opsForHash().delete(importKey, "allCount"); | |||||
| stringRedisTemplate.opsForHash().delete(importKey, "allSuccessCount"); | |||||
| stringRedisTemplate.opsForHash().delete(importKey, "successCount"); | |||||
| stringRedisTemplate.opsForHash().delete(importKey, "failCount"); | |||||
| return ok; | return ok; | ||||
| } | } | ||||
| return new ResultData(Result.SUCCESS, "查询成功", entries); | return new ResultData(Result.SUCCESS, "查询成功", entries); | ||||
| @@ -228,10 +228,17 @@ public class WxCarCallBackController extends BaseController { | |||||
| logger.info("["+getIpAddr()+"etcpPaidCallback: " + paramMap.toString()); | logger.info("["+getIpAddr()+"etcpPaidCallback: " + paramMap.toString()); | ||||
| String carNumber = paramMap.get("plateNumber"); | String carNumber = paramMap.get("plateNumber"); | ||||
| // TODO how to get the parkId | |||||
| // 根据orderId获取入场信息,确定租户ID | |||||
| String orderId = paramMap.get("orderId"); | |||||
| HashMap<String, String> map = new HashMap<String, String>(); | |||||
| map.put("synId", orderId); | |||||
| String tenant_id = wxCarCmdLogService.getTenantIdBySynId(map); | |||||
| Date currentDate = new Date(); | Date currentDate = new Date(); | ||||
| WxCarCmdLog wxCarCmdLog = new WxCarCmdLog(); | WxCarCmdLog wxCarCmdLog = new WxCarCmdLog(); | ||||
| if(StringUtils.isNotBlank(tenant_id)) { | |||||
| wxCarCmdLog.setTenantId(tenant_id); | |||||
| } | |||||
| wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | ||||
| wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PAY_MANUAL.getCode()); | wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PAY_MANUAL.getCode()); | ||||
| wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap)); | wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap)); | ||||
| @@ -107,7 +107,7 @@ public class WxMsgController extends BaseController { | |||||
| if (phones.equals("")) {//没有手工输入手机号时解析标签,有,继续流转 | if (phones.equals("")) {//没有手工输入手机号时解析标签,有,继续流转 | ||||
| phones = parselabel(wxMsg.getTenantId(), wxMsg); | phones = parselabel(wxMsg.getTenantId(), wxMsg); | ||||
| if (phones.equals("")) {//解析之后手机号依然不存在时返回 | if (phones.equals("")) {//解析之后手机号依然不存在时返回 | ||||
| return new ResultData(ErrorCode.MSG_PHONE_NOT_FOUND); | |||||
| return new ResultData(ErrorCode.MSG_NO_VALID_PHONE); | |||||
| } | } | ||||
| } | } | ||||
| @@ -10,6 +10,7 @@ import com.iformall.enums.EnumMerchantBUserStatus; | |||||
| import com.iformall.enums.EnumMerchantStatus; | import com.iformall.enums.EnumMerchantStatus; | ||||
| import com.iformall.interceptor.AuthorizationInterceptor; | import com.iformall.interceptor.AuthorizationInterceptor; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.HashUtil; | |||||
| import com.iformall.utils.IPUtil; | import com.iformall.utils.IPUtil; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| @@ -81,6 +82,15 @@ public class WxMerchantBUserController extends BaseController { | |||||
| resultMap.put("service_phone", mall.getServicePhone()); | resultMap.put("service_phone", mall.getServicePhone()); | ||||
| resultMap.put("tenant_id",merchant.getTenantId()); | resultMap.put("tenant_id",merchant.getTenantId()); | ||||
| resultMap.put("merchant_id",merchant.getId()); | resultMap.put("merchant_id",merchant.getId()); | ||||
| String mid = null; | |||||
| try { | |||||
| mid = String.valueOf(merchant.getId()); | |||||
| if(mid != null) { | |||||
| resultMap.put("merchant_id_scan", HashUtil.EncoderByMd5(mid)); | |||||
| } | |||||
| }catch (Exception e) { | |||||
| logger.error(e.getMessage()); | |||||
| } | |||||
| return new ResultData(resultMap); | return new ResultData(resultMap); | ||||
| } | } | ||||
| @@ -45,22 +45,22 @@ public class WxCardPayController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| WxCardSpendService wxCardSpendService; | WxCardSpendService wxCardSpendService; | ||||
| @ApiOperation(value = "C端扫B端储值卡支付订单", notes = "params:{\"cardId\":\"String\",\"merchantCode\":\"String\",\"totalFee\":\"String(元)\"}") | |||||
| @ApiOperation(value = "C端扫B端储值卡支付订单", notes = "params:{\"cardId\":\"String\",\"merchantId\":\"String\",\"totalFee\":\"String(元)\"}") | |||||
| @PostMapping("order_create") | @PostMapping("order_create") | ||||
| public ResultData saveCardPayOrder(@RequestBody Map<String, String> paramMap, HttpServletRequest request) { | public ResultData saveCardPayOrder(@RequestBody Map<String, String> paramMap, HttpServletRequest request) { | ||||
| String ipStr = getIpAddr(); | String ipStr = getIpAddr(); | ||||
| logger.info("saveCardPayOrder: " + ipStr + " :" + paramMap.toString()); | logger.info("saveCardPayOrder: " + ipStr + " :" + paramMap.toString()); | ||||
| String cardIdStr = paramMap.get("cardId"); | String cardIdStr = paramMap.get("cardId"); | ||||
| String merchantCode = paramMap.get("merchantCode"); | |||||
| String merchantStr = paramMap.get("merchantId"); | |||||
| String totalFeeStr = paramMap.get("totalFee"); | String totalFeeStr = paramMap.get("totalFee"); | ||||
| if (StringUtils.isBlank(cardIdStr)) { | if (StringUtils.isBlank(cardIdStr)) { | ||||
| logger.error("cardId不能为空"); | logger.error("cardId不能为空"); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "cardId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "cardId不能为空"); | ||||
| } | } | ||||
| if (StringUtils.isBlank(merchantCode)) { | |||||
| logger.error("merchantCode不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantCode不能为空"); | |||||
| if (StringUtils.isBlank(merchantStr)) { | |||||
| logger.error("merchantId不能为空"); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantId不能为空"); | |||||
| } | } | ||||
| if (StringUtils.isBlank(totalFeeStr)) { | if (StringUtils.isBlank(totalFeeStr)) { | ||||
| logger.error("totalFee不能为空"); | logger.error("totalFee不能为空"); | ||||
| @@ -76,10 +76,10 @@ public class WxCardPayController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "cardIdStr转换失败"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "cardIdStr转换失败"); | ||||
| } | } | ||||
| try { | try { | ||||
| merchantId = Long.valueOf(merchantCode); | |||||
| merchantId = Long.valueOf(merchantStr); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("merchantCode convert failed:" + merchantCode); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantCode转换失败"); | |||||
| logger.error("merchantCode convert failed:" + merchantStr); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantId转换失败"); | |||||
| } | } | ||||
| BigDecimal totalFee = new BigDecimal(totalFeeStr); | BigDecimal totalFee = new BigDecimal(totalFeeStr); | ||||
| @@ -37,7 +37,7 @@ public class WxCouponChannelController extends BaseController { | |||||
| wxCouponChannel.setTenantId(getTenantId()); | wxCouponChannel.setTenantId(getTenantId()); | ||||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | ||||
| wxCouponChannel.setSortColumns(WxCouponChannel.Field.CreateDate_DESC); | wxCouponChannel.setSortColumns(WxCouponChannel.Field.CreateDate_DESC); | ||||
| wxCouponChannel.setIsCRequest(0);//标记为C端调用 | |||||
| return new ResultData(wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize)); | return new ResultData(wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize)); | ||||
| } | } | ||||
| @@ -5,7 +5,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.WxMerchantDiscountVo; | |||||
| import com.iformall.domain.vo.WxMerchantVo; | |||||
| import com.iformall.enums.EnumMerchantStatus; | import com.iformall.enums.EnumMerchantStatus; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| @@ -123,7 +123,7 @@ public class WxMallController extends BaseController { | |||||
| WxMerchant merchantQ = new WxMerchant(); | WxMerchant merchantQ = new WxMerchant(); | ||||
| merchantQ.setTenantId(user.getTenantId()); | merchantQ.setTenantId(user.getTenantId()); | ||||
| merchantQ.setStatus(EnumMerchantStatus.VALID.getCode()); | merchantQ.setStatus(EnumMerchantStatus.VALID.getCode()); | ||||
| List<WxMerchantDiscountVo> list = wxMerchantService.getDisCountList(merchantQ); | |||||
| List<WxMerchantVo> list = wxMerchantService.getDisCountList(merchantQ); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", list); | return new ResultData(Result.SUCCESS, "查询成功", list); | ||||
| } | } | ||||
| @@ -0,0 +1,44 @@ | |||||
| package com.iformall.controller; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.vo.WxMerchantVo; | |||||
| import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.utils.HashUtil; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.HashMap; | |||||
| /** | |||||
| * @author Stormeye | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("/api/merchant") | |||||
| public class WxMerchantController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxMerchantService wxMerchantService; | |||||
| @ApiOperation("根据code查询接口") | |||||
| @GetMapping("/findByCode") | |||||
| @ApiImplicitParam(name = "merchantCode", value = "merchantCode", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData findByCode(String merchantCode) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::findByCode"); | |||||
| if(merchantCode == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| HashMap<String, String> params = new HashMap<String, String>(); | |||||
| params.put("tenantId", getTenantId()); | |||||
| params.put("merchantCode", HashUtil.DecodeByMD5(merchantCode)); | |||||
| WxMerchantVo wxMerchant = wxMerchantService.getMerchantInfo(params); | |||||
| return new ResultData(wxMerchant); | |||||
| } | |||||
| } | |||||
| @@ -253,7 +253,7 @@ public enum ErrorCode{ | |||||
| /** | /** | ||||
| * 会员 | * 会员 | ||||
| */ | */ | ||||
| MEM_IMPORT_ERR(13000, "模板导入失败"), | |||||
| MEM_IMPORT_ERR(13000, "模板导入失败,请尝试重新导入"), | |||||
| MEM_SCORE_NOT_ENOUGH(13001, "成长值不够扣减值"), | MEM_SCORE_NOT_ENOUGH(13001, "成长值不够扣减值"), | ||||
| /** | /** | ||||
| @@ -40,6 +40,15 @@ public class WxCouponChannel implements Serializable { | |||||
| this.ids = ids; | this.ids = ids; | ||||
| } | } | ||||
| @Transient | |||||
| private Integer isCRequest; | |||||
| @Transient | |||||
| private Date startdate; | |||||
| @Transient | |||||
| private Date enddate; | |||||
| @Transient | @Transient | ||||
| protected List<Long> couponIds; | protected List<Long> couponIds; | ||||
| @@ -89,6 +98,13 @@ public class WxCouponChannel implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="子频道ID",name="subTargetId") | @io.swagger.annotations.ApiModelProperty(value="子频道ID",name="subTargetId") | ||||
| private Long subTargetId; | private Long subTargetId; | ||||
| public Integer getIsCRequest() { | |||||
| return isCRequest; | |||||
| } | |||||
| public void setIsCRequest(Integer isCRequest) { | |||||
| this.isCRequest = isCRequest; | |||||
| } | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| @@ -165,6 +181,22 @@ public class WxCouponChannel implements Serializable { | |||||
| this.subTargetId = subTargetId; | this.subTargetId = subTargetId; | ||||
| } | } | ||||
| public Date getStartdate() { | |||||
| return startdate; | |||||
| } | |||||
| public void setStartdate(Date startdate) { | |||||
| this.startdate = startdate; | |||||
| } | |||||
| public Date getEnddate() { | |||||
| return enddate; | |||||
| } | |||||
| public void setEnddate(Date enddate) { | |||||
| this.enddate = enddate; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| @@ -59,6 +59,9 @@ public class WxWiWideInfo implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="expiredTime",name="expiredTime") | @io.swagger.annotations.ApiModelProperty(value="expiredTime",name="expiredTime") | ||||
| private Date expiredTime; | private Date expiredTime; | ||||
| /*卖外迪信息类型列表,1,支持客流 2,支持wifi*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="capability",name="capability") | |||||
| private String capability; | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| @@ -105,6 +108,14 @@ public class WxWiWideInfo implements Serializable { | |||||
| this.expiredTime = expiredTime; | this.expiredTime = expiredTime; | ||||
| } | } | ||||
| public String getCapability() { | |||||
| return capability; | |||||
| } | |||||
| public void setCapability(String capability) { | |||||
| this.capability = capability; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| @@ -0,0 +1,18 @@ | |||||
| package com.iformall.domain.vo; | |||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| public class WxCUserBasicInfoVo extends WxCUserBasicInfo { | |||||
| /**用户tags*/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="用户tags",name="tags") | |||||
| private String tags; | |||||
| public String getTags() { | |||||
| return tags; | |||||
| } | |||||
| public void setTags(String tags) { | |||||
| this.tags = tags; | |||||
| } | |||||
| } | |||||
| @@ -1,38 +0,0 @@ | |||||
| package com.iformall.domain.vo; | |||||
| public class WxMerchantDiscountVo extends WxMerchantVo { | |||||
| private static final long serialVersionUID = 6687964942922444531L; | |||||
| @io.swagger.annotations.ApiModelProperty(value="VIP折扣率1",name="vipDiscountRate1") | |||||
| private Integer vipDiscountRate1; | |||||
| @io.swagger.annotations.ApiModelProperty(value="VIP折扣率2",name="vipDiscountRate2") | |||||
| private Integer vipDiscountRate2; | |||||
| @io.swagger.annotations.ApiModelProperty(value="VIP折扣率3",name="vipDiscountRate3") | |||||
| private Integer vipDiscountRate3; | |||||
| public Integer getVipDiscountRate1() { | |||||
| return vipDiscountRate1; | |||||
| } | |||||
| public void setVipDiscountRate1(Integer vipDiscountRate1) { | |||||
| this.vipDiscountRate1 = vipDiscountRate1; | |||||
| } | |||||
| public Integer getVipDiscountRate2() { | |||||
| return vipDiscountRate2; | |||||
| } | |||||
| public void setVipDiscountRate2(Integer vipDiscountRate2) { | |||||
| this.vipDiscountRate2 = vipDiscountRate2; | |||||
| } | |||||
| public Integer getVipDiscountRate3() { | |||||
| return vipDiscountRate3; | |||||
| } | |||||
| public void setVipDiscountRate3(Integer vipDiscountRate3) { | |||||
| this.vipDiscountRate3 = vipDiscountRate3; | |||||
| } | |||||
| } | |||||
| @@ -8,7 +8,8 @@ package com.iformall.enums; | |||||
| public enum EnumRentContractType { | public enum EnumRentContractType { | ||||
| RENT_BY_AREA(1, "面积"), | RENT_BY_AREA(1, "面积"), | ||||
| RENT_BY_JOINT(2, "联营扣点") | |||||
| RENT_BY_JOINT(2, "联营扣点"), | |||||
| RENT_BY_AREA_AND_JOINT(3, "面积与联营扣点取高") | |||||
| ; | ; | ||||
| public static EnumRentContractType getEnum(Integer code) { | public static EnumRentContractType getEnum(Integer code) { | ||||
| @@ -0,0 +1,36 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * Created by Stormeye on 2018/08/09. | |||||
| */ | |||||
| public enum EnumWiWideInfoStatus { | |||||
| INVALID(0, "未开通"), | |||||
| VALID(1, "已开通") | |||||
| ; | |||||
| public static EnumWiWideInfoStatus getEnum(Integer code) { | |||||
| for (EnumWiWideInfoStatus value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumWiWideInfoStatus(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -4,6 +4,7 @@ import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | import com.iformall.domain.dto.WxCUserBasicInfoDto; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | import com.iformall.domain.po.WxCUserBasicInfo; | ||||
| import com.iformall.domain.vo.CUserBaseVo; | import com.iformall.domain.vo.CUserBaseVo; | ||||
| import com.iformall.domain.vo.WxCUserBasicInfoVo; | |||||
| import java.util.List; | import java.util.List; | ||||
| @@ -22,4 +23,6 @@ public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, S | |||||
| long findCountByScore(WxCUserBasicInfoDto dto); | long findCountByScore(WxCUserBasicInfoDto dto); | ||||
| long findCount(WxCUserBasicInfoDto dto); | long findCount(WxCUserBasicInfoDto dto); | ||||
| List<WxCUserBasicInfoVo> findVoList(WxCUserBasicInfo wxCUserBasicInfo); | |||||
| } | } | ||||
| @@ -23,4 +23,6 @@ public interface WxCarCmdLogMapper extends CommonMapper<WxCarCmdLog, Long> { | |||||
| List<Map<String,Object>> queryPlateNumberList(Map<String,Object> carParams); | List<Map<String,Object>> queryPlateNumberList(Map<String,Object> carParams); | ||||
| String queryTenantIdBySynId(HashMap<String,String> params); | |||||
| } | } | ||||
| @@ -3,13 +3,15 @@ package com.iformall.mapper; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.vo.WxMerchantDiscountVo; | |||||
| import com.iformall.domain.vo.WxMerchantVo; | |||||
| public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | ||||
| List<WxMerchant> findList(WxMerchant wxMerchant); | List<WxMerchant> findList(WxMerchant wxMerchant); | ||||
| List<WxMerchantDiscountVo> findDiscountList(WxMerchant wxMerchant); | |||||
| List<WxMerchantVo> findDiscountList(WxMerchant wxMerchant); | |||||
| WxMerchantVo getMerchantByCode(HashMap<String, String> params); | |||||
| @@ -3,14 +3,16 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.WxCarCmdLog; | import com.iformall.domain.po.WxCarCmdLog; | ||||
| import java.util.HashMap; | |||||
| public interface WxCarCmdLogService { | public interface WxCarCmdLogService { | ||||
| /** | /** | ||||
| * 根据实体查询分页列表 | * 根据实体查询分页列表 | ||||
| * | * | ||||
| * @param record | * @param record | ||||
| * @param offset | |||||
| * @param limit | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxCarCmdLog> listAsPage(WxCarCmdLog record, Integer pageIndex, Integer pageSize); | PageInfo<WxCarCmdLog> listAsPage(WxCarCmdLog record, Integer pageIndex, Integer pageSize); | ||||
| @@ -36,12 +38,20 @@ public interface WxCarCmdLogService { | |||||
| * @param id | * @param id | ||||
| */ | */ | ||||
| void deleteById(Long id); | void deleteById(Long id); | ||||
| /** | |||||
| * 根据synId获取tenantId | |||||
| * @param params | |||||
| * @return | |||||
| */ | |||||
| String getTenantIdBySynId(HashMap<String, String> params); | |||||
| } | } | ||||
| @@ -3,8 +3,9 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.vo.WxMerchantDiscountVo; | |||||
| import com.iformall.domain.vo.WxMerchantVo; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | import java.util.List; | ||||
| /** | /** | ||||
| @@ -28,7 +29,15 @@ public interface WxMerchantService { | |||||
| * @param record | * @param record | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| List<WxMerchantDiscountVo> getDisCountList(WxMerchant record); | |||||
| List<WxMerchantVo> getDisCountList(WxMerchant record); | |||||
| /** | |||||
| * 根据code查询 | |||||
| * | |||||
| * @param params | |||||
| * @return | |||||
| */ | |||||
| WxMerchantVo getMerchantInfo(HashMap<String, String> params); | |||||
| /** | /** | ||||
| * 根据实体查询分页列表 | * 根据实体查询分页列表 | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.service.impl; | package com.iformall.service.impl; | ||||
| import com.alibaba.fastjson.JSONArray; | |||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| @@ -673,6 +674,18 @@ public class DataTowerServiceImpl implements DataTowerService { | |||||
| return new ResultData(ErrorCode.WIWIDE_INFO_NOT_FOUND); | return new ResultData(ErrorCode.WIWIDE_INFO_NOT_FOUND); | ||||
| } | } | ||||
| wiWideInfo = list.get(0); | wiWideInfo = list.get(0); | ||||
| List<Integer> cap = JSONArray.parseArray(wiWideInfo.getCapability(), Integer.class); | |||||
| Integer dataType; | |||||
| try { | |||||
| dataType = Integer.valueOf(params.get("dataType")); | |||||
| params.remove("dataType"); | |||||
| }catch (Exception e){ | |||||
| return new ResultData(ErrorCode.WIWIDE_INFO_NOT_FOUND); | |||||
| } | |||||
| if (cap == null || !cap.stream().anyMatch(c->c.equals(dataType))) { | |||||
| return new ResultData(ErrorCode.WIWIDE_INFO_NOT_FOUND); | |||||
| } | |||||
| String res = WiwideUtil.queryData(wiWideInfo, getWiwideToken(wiWideInfo), params); | String res = WiwideUtil.queryData(wiWideInfo, getWiwideToken(wiWideInfo), params); | ||||
| JSONObject result = JSONObject.parseObject(res); | JSONObject result = JSONObject.parseObject(res); | ||||
| if (result.getInteger("result") == 200){ | if (result.getInteger("result") == 200){ | ||||
| @@ -568,7 +568,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params1.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params1.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| params1.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); | |||||
| params1.put("endTime", markingCouponDataReportDto.getEndTime()); | |||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| List<TouchUsersReportVo> wxUserVisitList = wxUserVisitMapper.touchUsersReportList(params1); | List<TouchUsersReportVo> wxUserVisitList = wxUserVisitMapper.touchUsersReportList(params1); | ||||
| @@ -582,7 +582,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params2.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | params2.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | ||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| params2.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); | |||||
| params2.put("endTime", markingCouponDataReportDto.getEndTime()); | |||||
| List<TouchUsersReportVo> couponDatalist = wxCouponOrderMapper.touchUsersReportList(params2); | List<TouchUsersReportVo> couponDatalist = wxCouponOrderMapper.touchUsersReportList(params2); | ||||
| Map<String,TouchUsersReportVo> visitMap = couponDatalist.stream().collect(Collectors.toMap(TouchUsersReportVo::getxTime, p -> p)); | Map<String,TouchUsersReportVo> visitMap = couponDatalist.stream().collect(Collectors.toMap(TouchUsersReportVo::getxTime, p -> p)); | ||||
| @@ -18,6 +18,7 @@ import com.iformall.domain.po.WxTags; | |||||
| import com.iformall.domain.vo.CUserBaseInfoT; | import com.iformall.domain.vo.CUserBaseInfoT; | ||||
| import com.iformall.domain.vo.CUserBaseVo; | import com.iformall.domain.vo.CUserBaseVo; | ||||
| import com.iformall.domain.vo.CUserTagVo; | import com.iformall.domain.vo.CUserTagVo; | ||||
| import com.iformall.domain.vo.WxCUserBasicInfoVo; | |||||
| import com.iformall.enums.EnumAssignTagsTrigger; | import com.iformall.enums.EnumAssignTagsTrigger; | ||||
| import com.iformall.enums.EnumScoreType; | import com.iformall.enums.EnumScoreType; | ||||
| import com.iformall.mapper.WxCUserBasicInfoMapper; | import com.iformall.mapper.WxCUserBasicInfoMapper; | ||||
| @@ -155,7 +156,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| public void exportData(HttpServletRequest request, HttpServletResponse response, String tenantId) { | public void exportData(HttpServletRequest request, HttpServletResponse response, String tenantId) { | ||||
| WxCUserBasicInfo basicInfoQ = new WxCUserBasicInfo(); | WxCUserBasicInfo basicInfoQ = new WxCUserBasicInfo(); | ||||
| basicInfoQ.setTenantId(tenantId); | basicInfoQ.setTenantId(tenantId); | ||||
| List<WxCUserBasicInfo> memberlist = wxCUserBasicInfoMapper.findList(basicInfoQ); | |||||
| List<WxCUserBasicInfoVo> memberlist = wxCUserBasicInfoMapper.findVoList(basicInfoQ); | |||||
| XSSFWorkbook workbook; | XSSFWorkbook workbook; | ||||
| String filepath = Constant.fileDirectory; | String filepath = Constant.fileDirectory; | ||||
| @@ -168,6 +169,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||||
| WxTags wxTagsQ = new WxTags(); | |||||
| List<WxTags> tagList = wxTagsMapper.findList(wxTagsQ); | |||||
| try { | try { | ||||
| File file = new File(filepath); | File file = new File(filepath); | ||||
| workbook = new XSSFWorkbook(); | workbook = new XSSFWorkbook(); | ||||
| @@ -211,7 +215,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| tagCellTwo = rowtwo.createCell(9); | tagCellTwo = rowtwo.createCell(9); | ||||
| scoreCellTwo = rowtwo.createCell(10); | scoreCellTwo = rowtwo.createCell(10); | ||||
| WxCUserBasicInfo entity = memberlist.get(i); | |||||
| WxCUserBasicInfoVo entity = memberlist.get(i); | |||||
| String sexStr = "保密"; | String sexStr = "保密"; | ||||
| if (entity.getSex() == 1) | if (entity.getSex() == 1) | ||||
| @@ -229,21 +233,22 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| updateDateCellTwo.setCellValue(sdf.format(entity.getUpdateDate())); | updateDateCellTwo.setCellValue(sdf.format(entity.getUpdateDate())); | ||||
| createDateCellTwo.setCellValue(sdf.format(entity.getCreateDate())); | createDateCellTwo.setCellValue(sdf.format(entity.getCreateDate())); | ||||
| if (entity != null) { | if (entity != null) { | ||||
| if (entity.getTagId() != null) { | |||||
| WxCUserTags uTag = wxCUserTagsMapper.selectByPrimaryKey(entity.getTagId()); | |||||
| if (uTag != null && StringUtils.isNotBlank(uTag.getTags())) { | |||||
| List<Long> ids = JSONObject.parseArray(uTag.getTags(), Long.class); | |||||
| if (entity.getTagId() != null && entity.getTags() != null) { | |||||
| if (StringUtils.isNotBlank(entity.getTags())) { | |||||
| List<Long> ids = JSONObject.parseArray(entity.getTags(), Long.class); | |||||
| if (!ids.isEmpty()) { | if (!ids.isEmpty()) { | ||||
| WxTags wxTagsQ = new WxTags(); | |||||
| wxTagsQ.setIds(ids); | |||||
| List<WxTags> tagList = wxTagsMapper.findList(wxTagsQ); | |||||
| String tagNames = ""; | String tagNames = ""; | ||||
| String tagIds = ""; | String tagIds = ""; | ||||
| List<Long> tagIdList = new ArrayList<>(); | List<Long> tagIdList = new ArrayList<>(); | ||||
| for (WxTags wt : tagList) { | |||||
| tagNames += wt.getName() + "/"; | |||||
| tagIds += wt.getId() + ","; | |||||
| tagIdList.add(wt.getId()); | |||||
| for(Long id: ids) { | |||||
| for(WxTags tag: tagList) { | |||||
| if(id.equals(tag.getId())) { | |||||
| tagNames += tag.getName() + "/"; | |||||
| tagIds += tag.getId() + ","; | |||||
| tagIdList.add(tag.getId()); | |||||
| break; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| if (StringUtils.isNotBlank(tagNames)) { | if (StringUtils.isNotBlank(tagNames)) { | ||||
| entity.setTagNames(tagNames.substring(0, tagNames.length() - 1)); | entity.setTagNames(tagNames.substring(0, tagNames.length() - 1)); | ||||
| @@ -513,27 +518,25 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| String importKey = "import-" + userId; | |||||
| //默认添加到redis里 | |||||
| stringRedisTemplate.opsForHash().put(importKey, "allCount", ""); | |||||
| stringRedisTemplate.opsForHash().put(importKey, "allSuccessCount", "0"); | |||||
| stringRedisTemplate.opsForHash().put(importKey, "successCount", "0"); | |||||
| stringRedisTemplate.opsForHash().put(importKey, "failCount", "0"); | |||||
| ImportParams params = new ImportParams(); | ImportParams params = new ImportParams(); | ||||
| //IExcelDataHandler<CUserBaseInfoT> handler = new UserExcelHandler(); | |||||
| //handler.setNeedHandlerFields(new String[]{"姓名", "性别", "手机号", "微信昵称", "学历", "生日", "地址", "上次活跃时间", "注册时间", "标签", "成长值"});// 注意这里对应的是excel的列名。也就是对象上指定的列名。 | |||||
| //params.setDataHandler(handler); | |||||
| //params.setVerifyHandler(); | |||||
| // 需要验证 | // 需要验证 | ||||
| params.setImportFields(new String[]{"姓名", "性别", "手机号", "微信昵称", "学历", "生日", "地址", "上次活跃时间", "注册时间", "标签", "成长值"}); | params.setImportFields(new String[]{"姓名", "性别", "手机号", "微信昵称", "学历", "生日", "地址", "上次活跃时间", "注册时间", "标签", "成长值"}); | ||||
| params.setNeedVerify(true); | params.setNeedVerify(true); | ||||
| try { | try { | ||||
| ExcelImportResult<CUserBaseInfoT> datalist = ExcelImportUtil.importExcelMore(file.getInputStream(), CUserBaseInfoT.class, params); | ExcelImportResult<CUserBaseInfoT> datalist = ExcelImportUtil.importExcelMore(file.getInputStream(), CUserBaseInfoT.class, params); | ||||
| List<CUserBaseInfoT> successList = datalist.getList(); | List<CUserBaseInfoT> successList = datalist.getList(); | ||||
| List<CUserBaseInfoT> failList = datalist.getFailList(); | List<CUserBaseInfoT> failList = datalist.getFailList(); | ||||
| logger.info("验证通过的数量:" + successList.size()); | |||||
| logger.info("验证未通过的数量:" + failList.size()); | |||||
| //如果不存在就添加 | |||||
| stringRedisTemplate.opsForHash().put(userId, "allCount", successList.size() + failList.size() + ""); | |||||
| stringRedisTemplate.opsForHash().put(userId, "allSuccessCount", successList.size() + ""); | |||||
| stringRedisTemplate.opsForHash().put(userId, "successCount", "0"); | |||||
| stringRedisTemplate.opsForHash().put(userId, "failCount", failList.size() + ""); | |||||
| logger.info("验证通过的数量: " + successList.size()); | |||||
| logger.info("验证未通过的数量: " + failList.size()); | |||||
| successList.parallelStream().forEach(uBase->{ | successList.parallelStream().forEach(uBase->{ | ||||
| @@ -645,12 +648,12 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| stringRedisTemplate.opsForHash().increment(userId,"successCount",1); | stringRedisTemplate.opsForHash().increment(userId,"successCount",1); | ||||
| }); | }); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| stringRedisTemplate.opsForHash().put(importKey, "allCount", "1"); | |||||
| stringRedisTemplate.opsForHash().put(importKey, "allSuccessCount", "0"); | |||||
| stringRedisTemplate.opsForHash().put(importKey, "successCount", "0"); | |||||
| stringRedisTemplate.opsForHash().put(importKey, "failCount", "1"); | |||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| logger.error("导入模板失败:"+e.getMessage()); | logger.error("导入模板失败:"+e.getMessage()); | ||||
| stringRedisTemplate.opsForHash().put(userId, "allCount", "1"); | |||||
| stringRedisTemplate.opsForHash().put(userId, "allSuccessCount", "0"); | |||||
| stringRedisTemplate.opsForHash().put(userId, "successCount", "0"); | |||||
| stringRedisTemplate.opsForHash().put(userId, "failCount", "1"); | |||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||
| @@ -126,11 +126,14 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||||
| String str = JSON.toJSONString(tagId); | String str = JSON.toJSONString(tagId); | ||||
| hs.addAll(wxCUserTagsMapper.findByTags(str, tenantId)); | hs.addAll(wxCUserTagsMapper.findByTags(str, tenantId)); | ||||
| } | } | ||||
| List<Long> userIds = new ArrayList<>(); | |||||
| userIds.addAll(hs); | |||||
| WxCUserBasicInfo wxCUserBasicInfo = new WxCUserBasicInfo(); | |||||
| wxCUserBasicInfo.setIds(userIds); | |||||
| return wxCUserBasicInfoMapper.findList(wxCUserBasicInfo); | |||||
| if (!hs.isEmpty()) { | |||||
| List<Long> userIds = new ArrayList<>(); | |||||
| userIds.addAll(hs); | |||||
| WxCUserBasicInfo wxCUserBasicInfo = new WxCUserBasicInfo(); | |||||
| wxCUserBasicInfo.setIds(userIds); | |||||
| return wxCUserBasicInfoMapper.findList(wxCUserBasicInfo); | |||||
| } | |||||
| return new ArrayList<>(); | |||||
| } | } | ||||
| @@ -11,6 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import java.util.HashMap; | |||||
| @Service | @Service | ||||
| public class WxCarCmdLogServiceImpl implements WxCarCmdLogService { | public class WxCarCmdLogServiceImpl implements WxCarCmdLogService { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @@ -47,7 +49,11 @@ public class WxCarCmdLogServiceImpl implements WxCarCmdLogService { | |||||
| } | } | ||||
| @Override | |||||
| public String getTenantIdBySynId(HashMap<String,String> params) { | |||||
| return wxCarCmdLogMapper.queryTenantIdBySynId(params); | |||||
| } | |||||
| @@ -7,7 +7,6 @@ import com.iformall.common.IdWorker; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.WxMerchantDiscountVo; | |||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| @@ -102,10 +101,15 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<WxMerchantDiscountVo> getDisCountList(WxMerchant record) { | |||||
| public List<WxMerchantVo> getDisCountList(WxMerchant record) { | |||||
| return wxMerchantMapper.findDiscountList(record); | return wxMerchantMapper.findDiscountList(record); | ||||
| } | } | ||||
| @Override | |||||
| public WxMerchantVo getMerchantInfo(HashMap<String, String> params) { | |||||
| return wxMerchantMapper.getMerchantByCode(params); | |||||
| } | |||||
| @Override | @Override | ||||
| public List<WxMerchant> etcpList(WxMerchant record) { | public List<WxMerchant> etcpList(WxMerchant record) { | ||||
| record.setCarVendorType(EnumCarVendor.CAR_ETCP.getCode()); | record.setCarVendorType(EnumCarVendor.CAR_ETCP.getCode()); | ||||
| @@ -131,7 +131,7 @@ public class WxMerchantSubsidyServiceImpl implements WxMerchantSubsidyService { | |||||
| WxMerchantSubsidyVo entity = subsidyVoList.get(i); | WxMerchantSubsidyVo entity = subsidyVoList.get(i); | ||||
| idCellTwo.setCellValue(String.valueOf(entity.getId())); | |||||
| idCellTwo.setCellValue(String.valueOf(entity.getOrderId())); | |||||
| merchantNameCellTwo.setCellValue(entity.getMerchantName()); | merchantNameCellTwo.setCellValue(entity.getMerchantName()); | ||||
| if (entity.getCreateDate() != null) | if (entity.getCreateDate() != null) | ||||
| createDateCellTwo.setCellValue(sdf.format(entity.getCreateDate())); | createDateCellTwo.setCellValue(sdf.format(entity.getCreateDate())); | ||||
| @@ -613,6 +613,9 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| throw new MallinkException(ErrorCode.COUPON_IS_NOT_FREE); | throw new MallinkException(ErrorCode.COUPON_IS_NOT_FREE); | ||||
| } | } | ||||
| // 减库存操作 | |||||
| stockReduce(user, coupon, couponIdStr); | |||||
| int payment = coupon.getSalePrice(); | int payment = coupon.getSalePrice(); | ||||
| Date curr = new Date(); | Date curr = new Date(); | ||||
| @@ -692,6 +695,9 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| throw new MallinkException(ErrorCode.COUPON_IS_NOT_FREE); | throw new MallinkException(ErrorCode.COUPON_IS_NOT_FREE); | ||||
| } | } | ||||
| // 减库存操作 | |||||
| stockReduce(user, coupon, couponIdStr); | |||||
| int payment = coupon.getSalePrice(); | int payment = coupon.getSalePrice(); | ||||
| Date curr = new Date(); | Date curr = new Date(); | ||||
| @@ -165,6 +165,22 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND); | return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND); | ||||
| } | } | ||||
| wxRentContractMapper.insertSelective(record); | wxRentContractMapper.insertSelective(record); | ||||
| //建立账单 | |||||
| if (record.getMerchantId() != null && record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) | |||||
| && record.getReceivePeriod() != null && record.getDeposit() > 0 && record.getPrice() > 0) { | |||||
| WxBillRent wxBillRent = new WxBillRent(); | |||||
| wxBillRent.setMerchantId(record.getMerchantId()); | |||||
| List<Map<String, Object>> billRentList = wxBillRentMapper.queryBillRentList(wxBillRent); | |||||
| if (billRentList.size() == 0) { | |||||
| WxMerchant wxMerchant = new WxMerchant(); | |||||
| wxMerchant.setId(record.getMerchantId()); | |||||
| wxMerchant.setTenantId(record.getTenantId()); | |||||
| //租金 | |||||
| buildRent(wxMerchant); | |||||
| //押金 | |||||
| buildDeposit(wxMerchant); | |||||
| } | |||||
| } | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("保存租赁合同信息失败,e:" + e.getMessage()); | logger.error("保存租赁合同信息失败,e:" + e.getMessage()); | ||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | ||||
| @@ -1,6 +1,8 @@ | |||||
| package com.iformall.utils; | package com.iformall.utils; | ||||
| import java.io.UnsupportedEncodingException; | |||||
| import java.security.MessageDigest; | import java.security.MessageDigest; | ||||
| import java.util.Base64; | |||||
| /** | /** | ||||
| * @author Stormeye | * @author Stormeye | ||||
| @@ -82,4 +84,25 @@ public class HashUtil { | |||||
| } | } | ||||
| return diff == 0; | return diff == 0; | ||||
| } | } | ||||
| public static String EncoderByMd5(String str) { | |||||
| if (str == null) { | |||||
| return null; | |||||
| } | |||||
| try { | |||||
| String enc = hash("md5", str); | |||||
| enc = new String(Base64.getUrlEncoder().encode(enc.getBytes("utf-8"))); | |||||
| return enc; | |||||
| } catch (UnsupportedEncodingException e) { | |||||
| return null; | |||||
| } | |||||
| } | |||||
| public static String DecodeByMD5(String str) { | |||||
| if (str == null) { | |||||
| return null; | |||||
| } | |||||
| String dec = new String(Base64.getUrlDecoder().decode(str)); | |||||
| return dec; | |||||
| } | |||||
| } | } | ||||
| @@ -194,4 +194,104 @@ | |||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| <resultMap id="VoBaseResultMap" type="com.iformall.domain.vo.WxCUserBasicInfoVo"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="phone" jdbcType="VARCHAR" property="phone"/> | |||||
| <result column="birthdate" jdbcType="TIMESTAMP" property="birthdate"/> | |||||
| <result column="education" jdbcType="VARCHAR" property="education"/> | |||||
| <result column="sex" jdbcType="INTEGER" property="sex"/> | |||||
| <result column="email" jdbcType="VARCHAR" property="email"/> | |||||
| <result column="address" jdbcType="VARCHAR" property="address"/> | |||||
| <result column="poins" jdbcType="INTEGER" property="poins"/> | |||||
| <result column="tag_id" jdbcType="BIGINT" property="tagId"/> | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="name" jdbcType="VARCHAR" property="name"/> | |||||
| <result column="level" jdbcType="VARCHAR" property="level"/> | |||||
| <result column="nick_name" jdbcType="VARCHAR" property="nickName"/> | |||||
| <result column="tags" jdbcType="VARCHAR" property="tags"/> | |||||
| </resultMap> | |||||
| <sql id="allVoColumns"> | |||||
| cu.`id`,cu.`phone`,cu.`birthdate`,cu.`education`,cu.`sex`,cu.`email`,cu.`address`,cu.`poins`,cu.`tag_id`, | |||||
| cu.`create_date`,cu.`update_date`,cu.`tenant_id`,cu.`name`,cu.`level`,cu.`nick_name`, | |||||
| cut.`tags` | |||||
| </sql> | |||||
| <sql id="dynamicVoWhereConditions"> | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | |||||
| and cu.`id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and cu.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != phone "> | |||||
| and cu.`phone` like concat('%', #{phone},'%') | |||||
| </if> | |||||
| <if test=" null != birthdate "> | |||||
| and cu.`birthdate` = #{birthdate} | |||||
| </if> | |||||
| <if test=" null != education "> | |||||
| and cu.`education` like concat('%', #{education},'%') | |||||
| </if> | |||||
| <if test=" null != sex "> | |||||
| and cu.`sex` = #{sex} | |||||
| </if> | |||||
| <if test=" null != email "> | |||||
| and cu.`email` like concat('%', #{email},'%') | |||||
| </if> | |||||
| <if test=" null != address "> | |||||
| and cu.`address` like concat('%', #{address},'%') | |||||
| </if> | |||||
| <if test=" null != poins "> | |||||
| and cu.`poins` = #{poins} | |||||
| </if> | |||||
| <if test=" null != tagId "> | |||||
| and cu.`tag_id` = #{tagId} | |||||
| </if> | |||||
| <if test=" null != createDate "> | |||||
| and cu.`create_date` = #{createDate} | |||||
| </if> | |||||
| <if test=" null != updateDate "> | |||||
| and cu.`update_date` = #{updateDate} | |||||
| </if> | |||||
| <if test=" null != name "> | |||||
| and `name` like concat('%', #{name},'%') | |||||
| </if> | |||||
| <if test=" null != startTime and null!=endTime"> | |||||
| and cu.`create_date` between #{startTime} and #{endTime} | |||||
| </if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findVoList" parameterType="com.iformall.domain.vo.WxCUserBasicInfoVo" resultMap="VoBaseResultMap"> | |||||
| select | |||||
| <include refid="allVoColumns"/> | |||||
| from wx_c_user_basic_info cu | |||||
| left join wx_c_user_tags cut on cut.`id` = cu.`tag_id` | |||||
| <include refid="dynamicVoWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -103,8 +103,11 @@ | |||||
| and json_unquote(JSON_EXTRACT(cmd_json,'$.plateNumber')) is not null | and json_unquote(JSON_EXTRACT(cmd_json,'$.plateNumber')) is not null | ||||
| group by plateNumber | group by plateNumber | ||||
| </select> | </select> | ||||
| <select id="queryTenantIdBySynId" parameterType="hashmap" resultType="String"> | |||||
| select `tenant_id` from wx_car_cmd_log | |||||
| where cmd_type = 601 and json_extract(cmd_json, "$.synId") = #{synId} | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -52,7 +52,11 @@ | |||||
| and cc.`business` = #{business} | and cc.`business` = #{business} | ||||
| </if> | </if> | ||||
| <if test=" null != beginTime and null != endTime and null != targetAd and 2 == targetAd"> | |||||
| <if test=" null != startdate and null!=enddate"> | |||||
| and cc.`create_date` between #{startdate} and #{enddate} | |||||
| </if> | |||||
| <if test="null !=isCRequest and null != targetAd and 2 == targetAd"> | |||||
| and cc.`begin_time` < now() | and cc.`begin_time` < now() | ||||
| and cc.`end_time` > now() | and cc.`end_time` > now() | ||||
| </if> | </if> | ||||
| @@ -68,6 +72,7 @@ | |||||
| <if test=" null != updateDate "> | <if test=" null != updateDate "> | ||||
| and cc.`update_date` = #{updateDate} | and cc.`update_date` = #{updateDate} | ||||
| </if> | </if> | ||||
| <if test=" null != subTargetId "> | <if test=" null != subTargetId "> | ||||
| and cc.`sub_target_id` = #{subTargetId} | and cc.`sub_target_id` = #{subTargetId} | ||||
| </if> | </if> | ||||
| @@ -55,9 +55,9 @@ | |||||
| <if test=" null != couponId "> | <if test=" null != couponId "> | ||||
| and `coupon_id` = #{couponId} | and `coupon_id` = #{couponId} | ||||
| </if> | |||||
| <if test=" null != couponName "> | |||||
| </if> | |||||
| <if test=" null != couponName and couponName!=''"> | |||||
| and `coupon_name` like concat('%', #{couponName},'%') | and `coupon_name` like concat('%', #{couponName},'%') | ||||
| </if> | </if> | ||||
| @@ -145,33 +145,38 @@ | |||||
| </select> | </select> | ||||
| <select id="couponDataList" resultType="com.iformall.domain.vo.MarkingCouponDataReportVo" parameterType="hashmap"> | <select id="couponDataList" resultType="com.iformall.domain.vo.MarkingCouponDataReportVo" parameterType="hashmap"> | ||||
| SELECT DATE_FORMAT(wx_coupon_order.create_date,'%Y-%m-%d') as createTime,wx_coupon_order.coupon_id as couponId | |||||
| ,COUNT(DISTINCT c_user_id) as couponUserCount,count(*) as couponCount | |||||
| ,(select Count(coupon_id) from wx_coupon_order c | |||||
| SELECT DATE_FORMAT(wx_coupon_order.create_date,'%Y-%m-%d') as createTime, | |||||
| wx_coupon_order.coupon_id as couponId | |||||
| ,COUNT(DISTINCT c_user_id) as couponUserCount,count(*) as couponCount | |||||
| ,(case when coupon_type < 7 then | |||||
| (select Count(coupon_id) from wx_coupon_order c | |||||
| where coupon_order_status=1 | where coupon_order_status=1 | ||||
| and DATE_FORMAT(create_date,'%Y-%m-%d')=createTime | |||||
| and DATE_FORMAT(update_date,'%Y-%m-%d')=createTime | |||||
| and tenant_id=#{tenantId} | and tenant_id=#{tenantId} | ||||
| and c.coupon_id=couponId | and c.coupon_id=couponId | ||||
| <if test="startTime != null"> | |||||
| and c.update_date >= #{startTime} | |||||
| </if> | |||||
| <if test="endTime != null"> | |||||
| and c.update_date <= #{endTime} | |||||
| </if> | |||||
| ) as verifyCount | |||||
| ,(select Count(DISTINCT c_user_id) from wx_coupon_order d | |||||
| ) else | |||||
| (select Count(card_id) from wx_coupon_order c, wx_card_spend cs | |||||
| where DATE_FORMAT(cs.create_date,'%Y-%m-%d')=createTime | |||||
| and c.tenant_id=#{tenantId} | |||||
| and c.coupon_id=couponId | |||||
| and c.id=cs.card_id | |||||
| ) end) | |||||
| as verifyCount | |||||
| ,(case when coupon_type < 7 then | |||||
| (select Count(DISTINCT c_user_id) from wx_coupon_order d | |||||
| where coupon_order_status=1 | where coupon_order_status=1 | ||||
| and d.coupon_id=couponId | and d.coupon_id=couponId | ||||
| and DATE_FORMAT(create_date,'%Y-%m-%d')=createTime | |||||
| and DATE_FORMAT(update_date,'%Y-%m-%d')=createTime | |||||
| and tenant_id=#{tenantId} | and tenant_id=#{tenantId} | ||||
| and d.coupon_id=couponId | and d.coupon_id=couponId | ||||
| <if test="startTime != null"> | |||||
| and d.update_date >= #{startTime} | |||||
| </if> | |||||
| <if test="endTime != null"> | |||||
| and d.update_date <= #{endTime} | |||||
| </if> | |||||
| ) as verifyUserCount | |||||
| ) else | |||||
| (select Count(DISTINCT cs.owner_id) from wx_coupon_order c, wx_card_spend cs | |||||
| where DATE_FORMAT(cs.create_date,'%Y-%m-%d')=createTime | |||||
| and c.tenant_id=#{tenantId} | |||||
| and c.coupon_id=couponId | |||||
| and c.id=cs.card_id | |||||
| ) end) | |||||
| as verifyUserCount | |||||
| from wx_coupon_order | from wx_coupon_order | ||||
| join wx_coupon on wx_coupon_order.coupon_id=wx_coupon.id | join wx_coupon on wx_coupon_order.coupon_id=wx_coupon.id | ||||
| where wx_coupon_order.tenant_id=#{tenantId} | where wx_coupon_order.tenant_id=#{tenantId} | ||||
| @@ -187,7 +192,7 @@ | |||||
| <if test="couponTitle != null"> | <if test="couponTitle != null"> | ||||
| and wx_coupon.title like concat('%', #{couponTitle},'%') | and wx_coupon.title like concat('%', #{couponTitle},'%') | ||||
| </if> | </if> | ||||
| GROUP BY createTime,couponId | |||||
| GROUP BY createTime,couponId,coupon_type | |||||
| order by createTime desc | order by createTime desc | ||||
| </select> | </select> | ||||
| @@ -373,8 +378,8 @@ | |||||
| <if test=" null != couponOrderStatus "> | <if test=" null != couponOrderStatus "> | ||||
| and co.coupon_order_status = #{couponOrderStatus} | and co.coupon_order_status = #{couponOrderStatus} | ||||
| </if> | </if> | ||||
| <if test=" null != merchantName "> | |||||
| <if test=" null != merchantName and merchantName!=''"> | |||||
| and (case when com.mc=1 then | and (case when com.mc=1 then | ||||
| (select m.name from wx_merchant m, wx_coupon_merchant cm | (select m.name from wx_merchant m, wx_coupon_merchant cm | ||||
| where m.id = cm.merchant_id and cm.product_id=co.coupon_id) else '[多商户通用]' end) | where m.id = cm.merchant_id and cm.product_id=co.coupon_id) else '[多商户通用]' end) | ||||
| @@ -388,9 +393,13 @@ | |||||
| <if test="endDate != null"> | <if test="endDate != null"> | ||||
| AND co.create_date < #{endDate,jdbcType=TIMESTAMP} | AND co.create_date < #{endDate,jdbcType=TIMESTAMP} | ||||
| </if> | </if> | ||||
| <if test=" null != id "> | |||||
| and co.id = #{id} | |||||
| </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <if test=" null != sortColumns"> order by ${sortColumns} </if> | ||||
| </select> | </select> | ||||
| @@ -98,7 +98,7 @@ | |||||
| m.vip_discount_rate1, m.vip_discount_rate2, m.vip_discount_rate3 | m.vip_discount_rate1, m.vip_discount_rate2, m.vip_discount_rate3 | ||||
| </sql> | </sql> | ||||
| <resultMap id="MerchantDiscountVoResultMap" type="com.iformall.domain.vo.WxMerchantDiscountVo"> | |||||
| <resultMap id="MerchantDiscountVoResultMap" type="com.iformall.domain.vo.WxMerchantVo"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | <id column="id" jdbcType="BIGINT" property="id"/> | ||||
| <result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl"/> | <result column="img_url" jdbcType="VARCHAR" property="merchantImgUrl"/> | ||||
| <result column="name" jdbcType="VARCHAR" property="merchantName"/> | <result column="name" jdbcType="VARCHAR" property="merchantName"/> | ||||
| @@ -135,5 +135,26 @@ | |||||
| </where> | </where> | ||||
| </select> | </select> | ||||
| <select id="getMerchantByCode" parameterType="java.util.Map" resultMap="MerchantDiscountVoResultMap"> | |||||
| select | |||||
| <include refid="allMerchantDiscountVoColumns"/> | |||||
| FROM wx_merchant m | |||||
| left join wx_merchant_shop ms on ms.merchant_id = m.id and ms.is_del = 0 | |||||
| left join wx_shop s on ms.shop_id = s.id | |||||
| left join wx_mall_building mb on s.building = mb.id | |||||
| left join wx_mall_floor mf on s.floor = mf.id | |||||
| <where> | |||||
| <if test=" null != tenantId "> | |||||
| and m.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != status "> | |||||
| and m.`status` = #{status} | |||||
| </if> | |||||
| <if test=" null != merchantCode "> | |||||
| and md5(m.`id`) = #{merchantCode} | |||||
| </if> | |||||
| </where> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -427,7 +427,7 @@ | |||||
| o.order_status,o.create_date,o.update_date,o.detail,'[多商户交易]' merchant_name,cubi.`name` c_user_name,cubi.phone | o.order_status,o.create_date,o.update_date,o.detail,'[多商户交易]' merchant_name,cubi.`name` c_user_name,cubi.phone | ||||
| from | from | ||||
| ( | ( | ||||
| select o.* from wx_order o where o.type in (0,3) and o.id in( | |||||
| select o.* from wx_order o where o.type=0 and o.id in( | |||||
| select o.id from wx_order o left join wx_coupon_merchant cm | select o.id from wx_order o left join wx_coupon_merchant cm | ||||
| on o.product_id=cm.product_id group by o.id having count(o.id)>1)) o | on o.product_id=cm.product_id group by o.id having count(o.id)>1)) o | ||||
| left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id | left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id | ||||
| @@ -436,7 +436,7 @@ | |||||
| o.order_status,o.create_date,o.update_date,o.detail,m.`name` merchant_name,cubi.`name` c_user_name,cubi.phone | o.order_status,o.create_date,o.update_date,o.detail,m.`name` merchant_name,cubi.`name` c_user_name,cubi.phone | ||||
| from( | from( | ||||
| select o.*,cm.merchant_id from ( | select o.*,cm.merchant_id from ( | ||||
| select o.* from wx_order o where o.type in (0,3) and o.id not in( | |||||
| select o.* from wx_order o where o.type=0 and o.id not in( | |||||
| select o.id from wx_order o left join wx_coupon_merchant cm | select o.id from wx_order o left join wx_coupon_merchant cm | ||||
| on o.product_id=cm.product_id group by o.id having count(o.id)>1) | on o.product_id=cm.product_id group by o.id having count(o.id)>1) | ||||
| ) o | ) o | ||||
| @@ -447,6 +447,12 @@ | |||||
| where type in (1,2))o | where type in (1,2))o | ||||
| left join wx_merchant m on o.merchant_id=m.id | left join wx_merchant m on o.merchant_id=m.id | ||||
| left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id | left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id | ||||
| union all | |||||
| select o.id,o.order_number,o.tenant_id,o.c_user_id,o.product_id,o.type,o.payment_type,o.payment,o.payment_time, | |||||
| o.order_status,o.create_date,o.update_date,o.detail,m.`name` merchant_name,cubi.`name` c_user_name,cubi.phone | |||||
| from wx_order o left join wx_merchant m on o.product_id=m.id | |||||
| left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id | |||||
| where o.type=3 | |||||
| ) o | ) o | ||||
| <where> | <where> | ||||
| <if test="tenantId!=null"> | <if test="tenantId!=null"> | ||||
| @@ -9,11 +9,11 @@ | |||||
| <result column="wiwide_url" jdbcType="VARCHAR" property="wiwideUrl"/> | <result column="wiwide_url" jdbcType="VARCHAR" property="wiwideUrl"/> | ||||
| <result column="token" jdbcType="VARCHAR" property="token"/> | <result column="token" jdbcType="VARCHAR" property="token"/> | ||||
| <result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime"/> | <result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime"/> | ||||
| <result column="capability" jdbcType="VARCHAR" property="capability"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`wiwide_id`,`wiwide_key`,`wiwide_url`, `token`,`expired_time` | |||||
| `id`,`tenant_id`,`wiwide_id`,`wiwide_key`,`wiwide_url`, `token`,`expired_time`,`capability` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||