| @@ -257,15 +257,11 @@ public class MallUserInfoController extends BaseController { | |||||
| } | } | ||||
| private int checkUniqueName(String userName) { | private int checkUniqueName(String userName) { | ||||
| MallUserInfo userQ = new MallUserInfo(); | |||||
| userQ.setUsername(userName); | |||||
| return userInfoService.cntUserList(userQ); | |||||
| return userInfoService.cntByUserName(userName); | |||||
| } | } | ||||
| private int checkUniquePhone(String phone) { | private int checkUniquePhone(String phone) { | ||||
| MallUserInfo userQ = new MallUserInfo(); | |||||
| userQ.setPhone(phone); | |||||
| return userInfoService.cntUserList(userQ); | |||||
| return userInfoService.cntByUserPhone(phone); | |||||
| } | } | ||||
| @@ -5,7 +5,9 @@ import com.iformall.annotation.SystemControllerLog; | |||||
| 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.WxBusiness; | import com.iformall.domain.po.WxBusiness; | ||||
| import com.iformall.domain.po.WxSubBusiness; | |||||
| import com.iformall.service.WxBusinessService; | import com.iformall.service.WxBusinessService; | ||||
| import com.iformall.service.WxSubBusinessService; | |||||
| 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; | ||||
| @@ -27,6 +29,9 @@ public class WxBusinessController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxBusinessService wxBusinessService; | private WxBusinessService wxBusinessService; | ||||
| @Autowired | |||||
| private WxSubBusinessService wxSubBusinessService; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -49,41 +54,13 @@ public class WxBusinessController extends BaseController { | |||||
| return new ResultData(busList); | return new ResultData(busList); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| @SystemControllerLog(description = "业态-新增") | |||||
| public ResultData add(@RequestBody WxBusiness wxBusiness) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::add"); | |||||
| //Assert.notNull(wxBusiness.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| @SystemControllerLog(description = "业态-更新") | |||||
| public ResultData update(@RequestBody WxBusiness wxBusiness) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::update"); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "业态-删除") | |||||
| public ResultData delete(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::delete"); | |||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||||
| } | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "业态-查询") | |||||
| public ResultData findById(Integer id) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::findById"); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxBusinessService.getById(id)); | |||||
| @ApiOperation("子业态表接口") | |||||
| @GetMapping("listSub") | |||||
| @SystemControllerLog(description = "子业态") | |||||
| public ResultData listSub(@ModelAttribute WxSubBusiness wxSubBusiness) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::getList"); | |||||
| final List<WxSubBusiness> busList = wxSubBusinessService.findList(wxSubBusiness); | |||||
| return new ResultData(busList); | |||||
| } | } | ||||
| } | } | ||||
| @@ -36,6 +36,9 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| if ("wx_business".equals(tableName)) { | if ("wx_business".equals(tableName)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| if ("wx_sub_business".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| if ("wx_coupon_type".equals(tableName)) { | if ("wx_coupon_type".equals(tableName)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -76,6 +79,8 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| public boolean doMappedStatementFIlter(MappedStatement ms) { | public boolean doMappedStatementFIlter(MappedStatement ms) { | ||||
| if ("com.iformall.mapper.MallUserInfoMapper.selectByUserName".equals(ms.getId())) | if ("com.iformall.mapper.MallUserInfoMapper.selectByUserName".equals(ms.getId())) | ||||
| return true; | return true; | ||||
| if ("com.iformall.mapper.MallUserInfoMapper.cntByUserName".equals(ms.getId())) | |||||
| return true; | |||||
| if ("com.iformall.mapper.WxCouponActionLogMapper.getCountByUserAndCoupon".equals(ms.getId())) | if ("com.iformall.mapper.WxCouponActionLogMapper.getCountByUserAndCoupon".equals(ms.getId())) | ||||
| return true; | return true; | ||||
| return false; | return false; | ||||
| @@ -22,7 +22,7 @@ spring: | |||||
| poolPreparedStatements: true | poolPreparedStatements: true | ||||
| maxOpenPreparedStatements: 20 | maxOpenPreparedStatements: 20 | ||||
| connectionProperties: "druid.stat.mergeSql=true;druid.stat.slowSqlMillis=6000" | connectionProperties: "druid.stat.mergeSql=true;druid.stat.slowSqlMillis=6000" | ||||
| #jackson: | |||||
| #jackson: | |||||
| #date-format: yyyy-MM-dd HH:mm:ss | #date-format: yyyy-MM-dd HH:mm:ss | ||||
| # REDIS | # REDIS | ||||
| redis: | redis: | ||||
| @@ -112,7 +112,7 @@ jasypt: | |||||
| fm: | fm: | ||||
| exception: false | exception: false | ||||
| deploy: 1 | deploy: 1 | ||||
| open: false | |||||
| open: true | |||||
| ueditor: | ueditor: | ||||
| config: config.json | config: config.json | ||||
| @@ -0,0 +1,4 @@ | |||||
| ALTER TABLE `wx_c_user` | |||||
| CHANGE COLUMN `mp_subscribe_scene` `mp_subscribe_scene` VARCHAR(30) NULL, | |||||
| CHANGE COLUMN `subs_subscribe_scene` `subs_subscribe_scene` VARCHAR(30) NULL, | |||||
| CHANGE COLUMN `open_id` `open_id` VARCHAR(28) NULL COMMENT '微信openId'; | |||||
| @@ -86,7 +86,7 @@ wechat: | |||||
| fm: | fm: | ||||
| exception: false | exception: false | ||||
| deploy: 1 | deploy: 1 | ||||
| open: false | |||||
| open: true | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -40,13 +40,6 @@ public class WxBusinessController extends BaseController { | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| //临时兼容的代码,过度更改接口名 | |||||
| @ApiOperation("业态全列表接口") | |||||
| @GetMapping("allist") | |||||
| public ResultData allist(@ModelAttribute WxBusiness wxBusiness) { | |||||
| final List<WxBusiness> busList = wxBusinessService.findListAll(); | |||||
| return new ResultData(busList); | |||||
| } | |||||
| @ApiOperation("业态全列表接口") | @ApiOperation("业态全列表接口") | ||||
| @GetMapping("listAll") | @GetMapping("listAll") | ||||
| @@ -391,7 +391,7 @@ public class WxUserGrantController extends BaseController { | |||||
| * 检查用户状态 | * 检查用户状态 | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| @GetMapping("/checkUserStatus") | |||||
| @RequestMapping("/checkUserStatus") | |||||
| @ApiOperation(value = "判断是否是老用户", notes="") | @ApiOperation(value = "判断是否是老用户", notes="") | ||||
| public ResultData checkUserStatus() { | public ResultData checkUserStatus() { | ||||
| Map resultMap = new HashMap(); | Map resultMap = new HashMap(); | ||||
| @@ -409,7 +409,7 @@ public class WxUserGrantController extends BaseController { | |||||
| * 检查用户状态 | * 检查用户状态 | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| @GetMapping("/checkPhoneStatus") | |||||
| @RequestMapping("/checkPhoneStatus") | |||||
| @ApiOperation(value = "判断是否是老用户", notes="") | @ApiOperation(value = "判断是否是老用户", notes="") | ||||
| public ResultData checkPhoneStatus() { | public ResultData checkPhoneStatus() { | ||||
| Map resultMap = new HashMap(); | Map resultMap = new HashMap(); | ||||
| @@ -591,7 +591,7 @@ public class WxUserGrantController extends BaseController { | |||||
| * 获取用户折扣率 | * 获取用户折扣率 | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| @GetMapping("/getDiscountInfo") | |||||
| @RequestMapping("/getDiscountInfo") | |||||
| @ApiOperation(value = "获取用户折扣率", notes="") | @ApiOperation(value = "获取用户折扣率", notes="") | ||||
| public ResultData getDiscountInfo() { | public ResultData getDiscountInfo() { | ||||
| @@ -105,7 +105,7 @@ jasypt: | |||||
| fm: | fm: | ||||
| exception: false | exception: false | ||||
| deploy: 1 | deploy: 1 | ||||
| open: false | |||||
| open: true | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -88,7 +88,7 @@ jasypt: | |||||
| fm: | fm: | ||||
| exception: false | exception: false | ||||
| deploy: 1 | deploy: 1 | ||||
| open: false | |||||
| open: true | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -9,6 +9,7 @@ public class WxCouponMerchantDto implements Serializable { | |||||
| Long merchantId; | Long merchantId; | ||||
| String parameter; | String parameter; | ||||
| Integer business; | Integer business; | ||||
| Integer subBusiness; | |||||
| public Long getMerchantId() { | public Long getMerchantId() { | ||||
| return merchantId; | return merchantId; | ||||
| @@ -33,4 +34,12 @@ public class WxCouponMerchantDto implements Serializable { | |||||
| public void setBusiness(Integer business) { | public void setBusiness(Integer business) { | ||||
| this.business = business; | this.business = business; | ||||
| } | } | ||||
| public Integer getSubBusiness() { | |||||
| return subBusiness; | |||||
| } | |||||
| public void setSubBusiness(Integer subBusiness) { | |||||
| this.subBusiness = subBusiness; | |||||
| } | |||||
| } | } | ||||
| @@ -21,6 +21,9 @@ public class WxCoupon implements Serializable { | |||||
| @Transient | @Transient | ||||
| protected List<Long> ids; | protected List<Long> ids; | ||||
| @Transient | |||||
| protected List<Integer> types; | |||||
| @Transient | @Transient | ||||
| protected List<Long> notinTypes; | protected List<Long> notinTypes; | ||||
| @Transient | @Transient | ||||
| @@ -49,6 +52,14 @@ public class WxCoupon implements Serializable { | |||||
| this.ids = ids; | this.ids = ids; | ||||
| } | } | ||||
| public List<Integer> getTypes() { | |||||
| return types; | |||||
| } | |||||
| public void setTypes(List<Integer> types) { | |||||
| this.types = types; | |||||
| } | |||||
| @Transient | @Transient | ||||
| private String salePriceStr; | private String salePriceStr; | ||||
| @@ -70,8 +81,8 @@ public class WxCoupon implements Serializable { | |||||
| /**租户ID**/ | /**租户ID**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | ||||
| private String tenantId; | private String tenantId; | ||||
| /**券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡)**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,50.积分券,51积分停车券,100.消费卡)",name="type") | |||||
| /**券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,50.积分券,51.积分停车券,100.消费卡)**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,50.积分券,51.积分停车券,100.消费卡)",name="type") | |||||
| private Integer type; | private Integer type; | ||||
| /**封面图**/ | /**封面图**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | ||||
| @@ -27,10 +27,9 @@ public class WxScoreRules implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Transient | @Transient | ||||
| private static final String defaultRules = | |||||
| private static final String scoreDefaultRules = | |||||
| "[" + | "[" + | ||||
| "{\"id\":1,\"limit\":0,\"step\":1,\"score\":10 ,\"desc\":\"每日登陆\"}," + | "{\"id\":1,\"limit\":0,\"step\":1,\"score\":10 ,\"desc\":\"每日登陆\"}," + | ||||
| // "{\"id\":2,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||||
| "{\"id\":2,\"childs\":[" + | "{\"id\":2,\"childs\":[" + | ||||
| " {\"businessId\":1,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | " {\"businessId\":1,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | ||||
| " {\"businessId\":2,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | " {\"businessId\":2,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | ||||
| @@ -50,6 +49,29 @@ public class WxScoreRules implements Serializable { | |||||
| "{\"id\":7,\"limit\":1,\"step\":1,\"score\":100,\"desc\":\"编辑个人信息\"}" + | "{\"id\":7,\"limit\":1,\"step\":1,\"score\":100,\"desc\":\"编辑个人信息\"}" + | ||||
| "]"; | "]"; | ||||
| @Transient | |||||
| private static final String creditDefaultRules = | |||||
| "[" + | |||||
| "{\"id\":1,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"每日登陆\"}," + | |||||
| "{\"id\":2,\"childs\":[" + | |||||
| " {\"businessId\":1,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":2,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":3,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":4,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":5,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":7,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":8,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":9,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":10,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":6,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}" + | |||||
| "]}," + | |||||
| "{\"id\":3,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"绑定车牌1个\"}," + | |||||
| "{\"id\":4,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"连接WIFI1次\"}," + | |||||
| "{\"id\":5,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"授权个人信息\"}," + | |||||
| "{\"id\":6,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"授权手机号\"}," + | |||||
| "{\"id\":7,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"编辑个人信息\"}" + | |||||
| "]"; | |||||
| @Transient | @Transient | ||||
| public static final String ID = "id"; | public static final String ID = "id"; | ||||
| @Transient | @Transient | ||||
| @@ -114,9 +136,12 @@ public class WxScoreRules implements Serializable { | |||||
| tenantId = _tenantId; | tenantId = _tenantId; | ||||
| } | } | ||||
| public static String getScoreDefaultRules() { | |||||
| return scoreDefaultRules; | |||||
| } | |||||
| public static String getDefaultRules() { | |||||
| return defaultRules; | |||||
| public static String getCreditDefaultRules() { | |||||
| return creditDefaultRules; | |||||
| } | } | ||||
| public void setRules(String rules) { | public void setRules(String rules) { | ||||
| @@ -28,7 +28,7 @@ public interface MallUserInfoMapper extends CommonMapper<MallUserInfo, String> { | |||||
| Integer hasButtonPermission(@Param("userId") Long userId, @Param("permission") String permission); | Integer hasButtonPermission(@Param("userId") Long userId, @Param("permission") String permission); | ||||
| long cntByUserName(Map<String,Object> params); | |||||
| int cntByUserName(Map<String,Object> params); | |||||
| List<MallUserInfoVo> selectUsersByPhone(@Param("phone") String phone); | List<MallUserInfoVo> selectUsersByPhone(@Param("phone") String phone); | ||||
| @@ -34,7 +34,9 @@ public interface WxPropertyContractMapper extends CommonMapper<WxPropertyContrac | |||||
| void updateRentInvalidStatus(WxPropertyContract wxRentContract); | void updateRentInvalidStatus(WxPropertyContract wxRentContract); | ||||
| List<WxRentContract> getRentContractList(Map<String, Object> params); | |||||
| List<WxRentContract> getRentContractListByShop(Map<String, Object> params); | |||||
| List<WxRentContract> getRentContractListByPoint(Map<String, Object> params); | |||||
| void updateApplyStatus(WxPropertyContract wxPropertyContract); | void updateApplyStatus(WxPropertyContract wxPropertyContract); | ||||
| @@ -25,7 +25,7 @@ public interface MallUserInfoService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| int cntUserList(MallUserInfo record); | int cntUserList(MallUserInfo record); | ||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| * | * | ||||
| @@ -52,7 +52,13 @@ public interface MallUserInfoService { | |||||
| * 查询用户名总数,用于校验用户名是否重复 | * 查询用户名总数,用于校验用户名是否重复 | ||||
| * @param username | * @param username | ||||
| */ | */ | ||||
| long cntByUserName(String username); | |||||
| int cntByUserName(String username); | |||||
| /** | |||||
| * 查询手机号,用于校验手机号是否重复 | |||||
| * @param phone | |||||
| */ | |||||
| int cntByUserPhone(String phone); | |||||
| /** | /** | ||||
| * 根据用户名查询用户对象 | * 根据用户名查询用户对象 | ||||
| @@ -139,10 +139,17 @@ public class MallUserInfoServiceImpl implements MallUserInfoService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public long cntByUserName(String username) { | |||||
| MallUserInfo userInfo = new MallUserInfo(); | |||||
| userInfo.setUsername(username); | |||||
| return PageHelper.count(() -> mallUserInfoMapper.select(userInfo)); | |||||
| public int cntByUserName(String username) { | |||||
| Map<String, Object> params = new HashMap<>(); | |||||
| params.put("username", username); | |||||
| return mallUserInfoMapper.cntByUserName(params); | |||||
| } | |||||
| @Override | |||||
| public int cntByUserPhone(String phone) { | |||||
| Map<String, Object> params = new HashMap<>(); | |||||
| params.put("phone", phone); | |||||
| return mallUserInfoMapper.cntByUserName(params); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -210,6 +210,7 @@ public class WxCampaignServiceImpl implements WxCampaignService { | |||||
| wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); | wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); | ||||
| wxCouponChannel.setTenantId(wxCoupon.getTenantId()); | wxCouponChannel.setTenantId(wxCoupon.getTenantId()); | ||||
| wxCouponChannel.setBusiness(wxCoupon.getBusiness()); | wxCouponChannel.setBusiness(wxCoupon.getBusiness()); | ||||
| wxCouponChannel.setSubBusiness(wxCoupon.getSubBusiness()); | |||||
| wxCouponChannel.setTitle(wxCoupon.getTitle()); | wxCouponChannel.setTitle(wxCoupon.getTitle()); | ||||
| wxCouponChannel.setSubTargetId(record.getId()); | wxCouponChannel.setSubTargetId(record.getId()); | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| @@ -214,6 +214,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| wxCouponChannel.setTargetAd(channelId); | wxCouponChannel.setTargetAd(channelId); | ||||
| wxCouponChannel.setTenantId(tanantId); | wxCouponChannel.setTenantId(tanantId); | ||||
| wxCouponChannel.setBusiness(wxCoupon.getBusiness()); | wxCouponChannel.setBusiness(wxCoupon.getBusiness()); | ||||
| wxCouponChannel.setSubBusiness(wxCoupon.getSubBusiness()); | |||||
| wxCouponChannel.setTitle(wxCoupon.getTitle()); | wxCouponChannel.setTitle(wxCoupon.getTitle()); | ||||
| saveOrUpdate(wxCouponChannel); | saveOrUpdate(wxCouponChannel); | ||||
| return null; | return null; | ||||
| @@ -156,7 +156,15 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| return merchantParam.getString("parameter"); | return merchantParam.getString("parameter"); | ||||
| } | } | ||||
| private Integer parseBusiness(JSONObject merchantParam){ | private Integer parseBusiness(JSONObject merchantParam){ | ||||
| return Integer.valueOf(merchantParam.getString("businessId")); | |||||
| String businessIdStr = merchantParam.getString("businessId"); | |||||
| return Integer.valueOf(businessIdStr); | |||||
| } | |||||
| private Integer parseSubBusiness(JSONObject merchantParam){ | |||||
| String subBusinessIdStr = merchantParam.getString("subBusinessId"); | |||||
| if (subBusinessIdStr != null) | |||||
| return Integer.valueOf(subBusinessIdStr); | |||||
| return null; | |||||
| } | } | ||||
| private WxCouponMerchantDto parseMerchantParam(JSONObject merchantParam){ | private WxCouponMerchantDto parseMerchantParam(JSONObject merchantParam){ | ||||
| @@ -165,6 +173,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| wxCouponMerchantDto.setMerchantId(parseMerchantId(merchantParam)); | wxCouponMerchantDto.setMerchantId(parseMerchantId(merchantParam)); | ||||
| wxCouponMerchantDto.setParameter(parseParameter(merchantParam)); | wxCouponMerchantDto.setParameter(parseParameter(merchantParam)); | ||||
| wxCouponMerchantDto.setBusiness(parseBusiness(merchantParam)); | wxCouponMerchantDto.setBusiness(parseBusiness(merchantParam)); | ||||
| wxCouponMerchantDto.setSubBusiness(parseSubBusiness(merchantParam)); | |||||
| }catch (Exception e) { | }catch (Exception e) { | ||||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR); | throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| } | } | ||||
| @@ -204,7 +213,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| List<JSONObject> merchantParamList = JSONObject.parseArray(record.getMerchantParams(), JSONObject.class); | |||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| // check 卡券补贴设置 | // check 卡券补贴设置 | ||||
| @@ -232,9 +241,9 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| List<JSONObject> merchantParamList = JSONObject.parseArray(record.getMerchantParams(), JSONObject.class); | |||||
| if (merchantParamList != null) { | |||||
| List<Integer> businessList= new ArrayList<>(); | |||||
| if (merchantParamList != null && merchantParamList.size() > 0) { | |||||
| List<WxCouponMerchantDto> wxCouponMerchantDtoList = new ArrayList<>(); | |||||
| merchantParamList.forEach(merchantParam -> { | merchantParamList.forEach(merchantParam -> { | ||||
| WxCouponMerchant cm = new WxCouponMerchant(); | WxCouponMerchant cm = new WxCouponMerchant(); | ||||
| WxCouponMerchantDto wxCouponMerchantDto = parseMerchantParam(merchantParam); | WxCouponMerchantDto wxCouponMerchantDto = parseMerchantParam(merchantParam); | ||||
| @@ -245,13 +254,17 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| cm.setCreateDate(new Date()); | cm.setCreateDate(new Date()); | ||||
| cm.setUpdateDate(new Date()); | cm.setUpdateDate(new Date()); | ||||
| cm.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); | cm.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); | ||||
| businessList.add(wxCouponMerchantDto.getBusiness()); | |||||
| wxCouponMerchantDtoList.add(wxCouponMerchantDto); | |||||
| wxCouponMerchantMapper.insertSelective(cm); | wxCouponMerchantMapper.insertSelective(cm); | ||||
| }); | }); | ||||
| if (businessList.stream().distinct().count() > 1) { | |||||
| if (wxCouponMerchantDtoList.stream() | |||||
| .mapToInt(WxCouponMerchantDto::getBusiness).distinct().count() > 1) { | |||||
| record.setBusiness(EnumBusiness.BUSINESS_ID6.getCode()); | record.setBusiness(EnumBusiness.BUSINESS_ID6.getCode()); | ||||
| } else if (wxCouponMerchantDtoList.size() > 1){ | |||||
| record.setBusiness(wxCouponMerchantDtoList.get(0).getBusiness()); | |||||
| } else { | } else { | ||||
| record.setBusiness(businessList.get(0)); | |||||
| record.setBusiness(wxCouponMerchantDtoList.get(0).getBusiness()); | |||||
| record.setSubBusiness(wxCouponMerchantDtoList.get(0).getSubBusiness()); | |||||
| } | } | ||||
| } else{ | } else{ | ||||
| @@ -263,13 +276,11 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| wxCouponMapper.insertSelective(record); | wxCouponMapper.insertSelective(record); | ||||
| } else { | } else { | ||||
| if (record.getMerchantParams() != null) { | |||||
| List<JSONObject> merchantParamList = JSONObject.parseArray(record.getMerchantParams(), JSONObject.class); | |||||
| if (merchantParamList != null && merchantParamList.size() > 0) { | |||||
| WxCouponMerchant cmParam = new WxCouponMerchant(); | WxCouponMerchant cmParam = new WxCouponMerchant(); | ||||
| cmParam.setProductId(record.getId()); | cmParam.setProductId(record.getId()); | ||||
| List<WxCouponMerchant> oldList = wxCouponMerchantMapper.findList(cmParam); | List<WxCouponMerchant> oldList = wxCouponMerchantMapper.findList(cmParam); | ||||
| List<Integer> businessList= new ArrayList<>(); | |||||
| List<WxCouponMerchantDto> wxCouponMerchantDtoList = new ArrayList<>(); | |||||
| merchantParamList.stream().forEach(merchantParam -> { | merchantParamList.stream().forEach(merchantParam -> { | ||||
| WxCouponMerchant cm = new WxCouponMerchant(); | WxCouponMerchant cm = new WxCouponMerchant(); | ||||
| WxCouponMerchantDto wxCouponMerchantDto = parseMerchantParam(merchantParam); | WxCouponMerchantDto wxCouponMerchantDto = parseMerchantParam(merchantParam); | ||||
| @@ -289,7 +300,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| cm.setUpdateDate(new Date()); | cm.setUpdateDate(new Date()); | ||||
| wxCouponMerchantMapper.insertSelective(cm); | wxCouponMerchantMapper.insertSelective(cm); | ||||
| } | } | ||||
| businessList.add(Integer.valueOf(wxCouponMerchantDto.getBusiness())); | |||||
| wxCouponMerchantDtoList.add(wxCouponMerchantDto); | |||||
| oldList.removeIf( | oldList.removeIf( | ||||
| old->old.getProductId().equals(record.getId()) && | old->old.getProductId().equals(record.getId()) && | ||||
| old.getMerchantId().equals(wxCouponMerchantDto.getMerchantId())); | old.getMerchantId().equals(wxCouponMerchantDto.getMerchantId())); | ||||
| @@ -301,10 +312,14 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| wxCouponMerchantMapper.updateByPrimaryKeySelective(old); | wxCouponMerchantMapper.updateByPrimaryKeySelective(old); | ||||
| }); | }); | ||||
| if (businessList.stream().distinct().count() > 1) { | |||||
| if (wxCouponMerchantDtoList.stream() | |||||
| .mapToInt(WxCouponMerchantDto::getBusiness).distinct().count() > 1) { | |||||
| record.setBusiness(EnumBusiness.BUSINESS_ID6.getCode()); | record.setBusiness(EnumBusiness.BUSINESS_ID6.getCode()); | ||||
| } else if (wxCouponMerchantDtoList.size() > 1){ | |||||
| record.setBusiness(wxCouponMerchantDtoList.get(0).getBusiness()); | |||||
| } else { | } else { | ||||
| record.setBusiness(businessList.get(0)); | |||||
| record.setBusiness(wxCouponMerchantDtoList.get(0).getBusiness()); | |||||
| record.setSubBusiness(wxCouponMerchantDtoList.get(0).getSubBusiness()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -285,6 +285,7 @@ public class WxGameServiceImpl implements WxGameService { | |||||
| wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_GAME.getCode()); | wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_GAME.getCode()); | ||||
| wxCouponChannel.setTenantId(wxCoupon.getTenantId()); | wxCouponChannel.setTenantId(wxCoupon.getTenantId()); | ||||
| wxCouponChannel.setBusiness(wxCoupon.getBusiness()); | wxCouponChannel.setBusiness(wxCoupon.getBusiness()); | ||||
| wxCouponChannel.setSubBusiness(wxCoupon.getSubBusiness()); | |||||
| wxCouponChannel.setTitle(wxCoupon.getTitle()); | wxCouponChannel.setTitle(wxCoupon.getTitle()); | ||||
| wxCouponChannel.setSubTargetId(record.getId()); | wxCouponChannel.setSubTargetId(record.getId()); | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| @@ -745,7 +745,12 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("rentShopType", record.getRentShopType()); | params.put("rentShopType", record.getRentShopType()); | ||||
| List<WxRentContract> contractList = wxPropertyContractMapper.getRentContractList(params); | |||||
| List<WxRentContract> contractList; | |||||
| if (record.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { | |||||
| contractList = wxPropertyContractMapper.getRentContractListByShop(params); | |||||
| } else { | |||||
| contractList = wxPropertyContractMapper.getRentContractListByPoint(params); | |||||
| } | |||||
| return contractList; | return contractList; | ||||
| } | } | ||||
| @@ -27,9 +27,9 @@ import java.util.List; | |||||
| public class WxScoreRulesServiceImpl implements WxScoreRulesService { | public class WxScoreRulesServiceImpl implements WxScoreRulesService { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| private String keyPrev = "setting:scorerules:"; | |||||
| private String keyPrev = "setting:scorerules1:"; | |||||
| private String creditKeyPrev = "setting:creditrules:"; | |||||
| private String creditKeyPrev = "setting:creditrules1:"; | |||||
| @Autowired | @Autowired | ||||
| WxScoreRulesMapper wxScoreRulesMapper; | WxScoreRulesMapper wxScoreRulesMapper; | ||||
| @@ -54,7 +54,6 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| // 缓存存在 | // 缓存存在 | ||||
| if (scoreRulesRedisTemplate.hasKey(key)) { | if (scoreRulesRedisTemplate.hasKey(key)) { | ||||
| WxScoreRules wScoreRules = scoreRulesRedisTemplate.opsForValue().get(key); | WxScoreRules wScoreRules = scoreRulesRedisTemplate.opsForValue().get(key); | ||||
| wScoreRules.setRules(getScoreRulesNew(wScoreRules.getRules())); | |||||
| logger.info("WxScoreRulesServiceImpl.getScoreRules() : 从缓存中获取了成长值设置 >> " + wScoreRules.toString()); | logger.info("WxScoreRulesServiceImpl.getScoreRules() : 从缓存中获取了成长值设置 >> " + wScoreRules.toString()); | ||||
| return wScoreRules; | return wScoreRules; | ||||
| } | } | ||||
| @@ -65,13 +64,13 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| List<WxScoreRules> list = wxScoreRulesMapper.findList(scoreRules); | List<WxScoreRules> list = wxScoreRulesMapper.findList(scoreRules); | ||||
| if (list.size() > 0) { | if (list.size() > 0) { | ||||
| scoreRules = list.get(0); | scoreRules = list.get(0); | ||||
| scoreRules.setRules(getScoreRulesNew(scoreRules.getRules())); | |||||
| scoreRules.setRules(getScoreRulesNew(scoreRules.getRules(),EnumScoreRules.SCORE)); | |||||
| } else { | } else { | ||||
| // 如果成长值规则不存在,启用默认值 | // 如果成长值规则不存在,启用默认值 | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| scoreRules.setId(idWorker.nextId()); | scoreRules.setId(idWorker.nextId()); | ||||
| scoreRules.setRules(WxScoreRules.getDefaultRules()); | |||||
| scoreRules.setRules(WxScoreRules.getScoreDefaultRules()); | |||||
| wxScoreRulesMapper.insertSelective(scoreRules); | wxScoreRulesMapper.insertSelective(scoreRules); | ||||
| } | } | ||||
| @@ -83,10 +82,11 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| } | } | ||||
| //当成长值或积分规则新增时,将新增的数据一并返回给接口调用端 | //当成长值或积分规则新增时,将新增的数据一并返回给接口调用端 | ||||
| private String getScoreRulesNew(String scoreRules){ | |||||
| private String getScoreRulesNew(String scoreRules,EnumScoreRules enumScoreRules){ | |||||
| //getJSONObject(1) 为EnumScoreType.CONSUMPTION(2, "消费")的下标值 | //getJSONObject(1) 为EnumScoreType.CONSUMPTION(2, "消费")的下标值 | ||||
| JSONArray jsonArrayOld = JSONArray.parseArray(scoreRules).getJSONObject(1).getJSONArray("childs"); | JSONArray jsonArrayOld = JSONArray.parseArray(scoreRules).getJSONObject(1).getJSONArray("childs"); | ||||
| JSONArray jsonArrayDefault = JSONArray.parseArray(WxScoreRules.getDefaultRules()).getJSONObject(1).getJSONArray("childs"); | |||||
| String defaultRules = enumScoreRules.equals(EnumScoreRules.SCORE) ? WxScoreRules.getScoreDefaultRules() : WxScoreRules.getCreditDefaultRules(); | |||||
| JSONArray jsonArrayDefault = JSONArray.parseArray(defaultRules).getJSONObject(1).getJSONArray("childs"); | |||||
| if (jsonArrayOld.size() < jsonArrayDefault.size()) { | if (jsonArrayOld.size() < jsonArrayDefault.size()) { | ||||
| JSONArray childsJsonArray = new JSONArray(); | JSONArray childsJsonArray = new JSONArray(); | ||||
| JSONObject otherJSONObject = new JSONObject(); | JSONObject otherJSONObject = new JSONObject(); | ||||
| @@ -129,7 +129,6 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| // 缓存存在 | // 缓存存在 | ||||
| if (scoreRulesRedisTemplate.hasKey(key)) { | if (scoreRulesRedisTemplate.hasKey(key)) { | ||||
| WxScoreRules wScoreRules = scoreRulesRedisTemplate.opsForValue().get(key); | WxScoreRules wScoreRules = scoreRulesRedisTemplate.opsForValue().get(key); | ||||
| wScoreRules.setRules(getScoreRulesNew(wScoreRules.getRules())); | |||||
| logger.info("WxScoreRulesServiceImpl.getScoreRules() : 从缓存中获取了积分值设置 >> " + wScoreRules.toString()); | logger.info("WxScoreRulesServiceImpl.getScoreRules() : 从缓存中获取了积分值设置 >> " + wScoreRules.toString()); | ||||
| return wScoreRules; | return wScoreRules; | ||||
| } | } | ||||
| @@ -140,12 +139,12 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| List<WxScoreRules> list = wxScoreRulesMapper.findList(scoreRules); | List<WxScoreRules> list = wxScoreRulesMapper.findList(scoreRules); | ||||
| if (list.size() > 0) { | if (list.size() > 0) { | ||||
| scoreRules = list.get(0); | scoreRules = list.get(0); | ||||
| scoreRules.setRules(getScoreRulesNew(scoreRules.getRules())); | |||||
| scoreRules.setRules(getScoreRulesNew(scoreRules.getRules(),EnumScoreRules.CREDIT)); | |||||
| } else { | } else { | ||||
| // 如果积分规则不存在,启用默认值 | // 如果积分规则不存在,启用默认值 | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| scoreRules.setId(idWorker.nextId()); | scoreRules.setId(idWorker.nextId()); | ||||
| scoreRules.setRules(WxScoreRules.getDefaultRules()); | |||||
| scoreRules.setRules(WxScoreRules.getCreditDefaultRules()); | |||||
| wxScoreRulesMapper.insertSelective(scoreRules); | wxScoreRulesMapper.insertSelective(scoreRules); | ||||
| } | } | ||||
| @@ -196,8 +196,8 @@ | |||||
| AND p.permission = #{permission} | AND p.permission = #{permission} | ||||
| </select> | </select> | ||||
| <select id="cntByUserName" resultType="java.lang.Long"> | |||||
| select count(*) from mall_user_info where 1=1 | |||||
| <select id="cntByUserName" resultType="java.lang.Integer"> | |||||
| select count(*) from mall_user_info where status = 1 | |||||
| <if test=" null != username "> | <if test=" null != username "> | ||||
| and username=#{username} | and username=#{username} | ||||
| </if> | </if> | ||||
| @@ -266,7 +266,7 @@ | |||||
| and c.`tenant_id` = #{tenantId} | and c.`tenant_id` = #{tenantId} | ||||
| </if> | </if> | ||||
| <if test=" null == type "> | |||||
| <if test=" null == type and null == types"> | |||||
| and c.`type` < 7 | and c.`type` < 7 | ||||
| </if> | </if> | ||||
| @@ -393,6 +393,13 @@ | |||||
| #{idItem} | #{idItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != types "> | |||||
| and c.type in | |||||
| <foreach collection="types" index="index" item="typesItem" open="(" separator="," close=")"> | |||||
| #{typesItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | <if test=" null != sortColumns">order by ${sortColumns}</if> | ||||
| </sql> | </sql> | ||||
| @@ -175,15 +175,26 @@ | |||||
| )s) and merchant_id is null and tenant_id=#{tenantId} | )s) and merchant_id is null and tenant_id=#{tenantId} | ||||
| </update> | </update> | ||||
| <select id="getRentContractList" parameterType="hashmap" resultType="com.iformall.domain.po.WxRentContract"> | |||||
| select rc.*,s.shop_number from wx_rent_contract rc inner join wx_shop s on rc.shop_id=s.id | |||||
| <select id="getRentContractListByShop" parameterType="hashmap" resultType="com.iformall.domain.po.WxRentContract"> | |||||
| select rc.* from wx_rent_contract rc | |||||
| where rc.status not in(0,1,5,6,7) and rc.tenant_id=#{tenantId} | where rc.status not in(0,1,5,6,7) and rc.tenant_id=#{tenantId} | ||||
| and rc.id not in (select pc.rent_contract_id from ( | and rc.id not in (select pc.rent_contract_id from ( | ||||
| select rent_contract_id from wx_property_contract where status not in(5,6,7) and tenant_id=#{tenantId} | select rent_contract_id from wx_property_contract where status not in(5,6,7) and tenant_id=#{tenantId} | ||||
| ) pc) | ) pc) | ||||
| <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if> | <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if> | ||||
| </select> | </select> | ||||
| <select id="getRentContractListByPoint" parameterType="hashmap" resultType="com.iformall.domain.po.WxRentContract"> | |||||
| select rc.*,s.shop_number from wx_rent_contract rc | |||||
| inner join wx_shop s on rc.shop_id=s.id | |||||
| where rc.status not in(0,1,5,6,7) and rc.tenant_id=#{tenantId} | |||||
| and rc.id not in (select pc.rent_contract_id from ( | |||||
| select rent_contract_id from wx_property_contract where status not in(5,6,7) and tenant_id=#{tenantId} | |||||
| ) pc) | |||||
| <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if> | |||||
| </select> | |||||
| <update id="updateApplyStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | <update id="updateApplyStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | ||||
| update wx_property_contract set apply_status=#{applyStatus} | update wx_property_contract set apply_status=#{applyStatus} | ||||
| <if test=" null != businessType ">,business_type=#{businessType}</if> | <if test=" null != businessType ">,business_type=#{businessType}</if> | ||||
| @@ -102,7 +102,7 @@ jasypt: | |||||
| fm: | fm: | ||||
| exception: false | exception: false | ||||
| deploy: 1 | deploy: 1 | ||||
| open: false | |||||
| open: true | |||||
| logging: | logging: | ||||
| level: | level: | ||||