diff --git a/mallinkAdmin/src/main/resources/application-dev.yml b/mallinkAdmin/src/main/resources/application-dev.yml index 3383e8451..244121daf 100644 --- a/mallinkAdmin/src/main/resources/application-dev.yml +++ b/mallinkAdmin/src/main/resources/application-dev.yml @@ -113,7 +113,7 @@ fm: exception: false exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 1 - open: true + open: false ueditor: config: config.json diff --git a/mallinkAdmin/src/main/resources/application-prod.yml b/mallinkAdmin/src/main/resources/application-prod.yml index ad957ad0b..1cd581a63 100644 --- a/mallinkAdmin/src/main/resources/application-prod.yml +++ b/mallinkAdmin/src/main/resources/application-prod.yml @@ -97,7 +97,7 @@ fm: exception: true exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 3 - open: true + open: false ueditor: config: config.json diff --git a/mallinkAdmin/src/main/resources/application-test.yml b/mallinkAdmin/src/main/resources/application-test.yml index 574e7844f..d0e3e9215 100644 --- a/mallinkAdmin/src/main/resources/application-test.yml +++ b/mallinkAdmin/src/main/resources/application-test.yml @@ -97,7 +97,7 @@ fm: exception: true exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 2 - open: true + open: false ueditor: config: config.json diff --git a/mallinkBApi/src/main/resources/application-dev.yml b/mallinkBApi/src/main/resources/application-dev.yml index 7ad8efcdd..fb04fad82 100644 --- a/mallinkBApi/src/main/resources/application-dev.yml +++ b/mallinkBApi/src/main/resources/application-dev.yml @@ -87,7 +87,7 @@ fm: exception: false exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 1 - open: true + open: false logging: level: diff --git a/mallinkBApi/src/main/resources/application-prod.yml b/mallinkBApi/src/main/resources/application-prod.yml index 4c22a5659..7861a3f38 100644 --- a/mallinkBApi/src/main/resources/application-prod.yml +++ b/mallinkBApi/src/main/resources/application-prod.yml @@ -90,7 +90,7 @@ fm: exception: true exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 3 - open: true + open: false logging: level: diff --git a/mallinkBApi/src/main/resources/application-test.yml b/mallinkBApi/src/main/resources/application-test.yml index 467825304..7c8fa5abc 100644 --- a/mallinkBApi/src/main/resources/application-test.yml +++ b/mallinkBApi/src/main/resources/application-test.yml @@ -90,7 +90,7 @@ fm: exception: true exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 2 - open: true + open: false logging: level: diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java index d02748a65..c421dcf1f 100755 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java @@ -353,9 +353,15 @@ public class WxUserGrantController extends BaseController { WxCUser user = getUser(); if (user != null) { + logger.debug(user.toString()); + + boolean bFirstNickName = false; + if(StringUtils.isBlank(user.getNickName())) { + bFirstNickName = true; + } + WxMaService wxMaService = getWeappService(user.getAppId()); - logger.debug(user.toString()); String session_key = user.getSessionKey(); try { // 解密用户信息 @@ -371,10 +377,13 @@ public class WxUserGrantController extends BaseController { user.setLanguage(userInfo.getLanguage()); wxCUserService.saveOrUpdate(user); - // 成长值 - wxScoreRulesService.addScore(EnumScoreType.WECHAT_PERSION, user); - //增加积分 - addCredit(user, EnumScoreType.WECHAT_PERSION); + if(bFirstNickName) { + // 首次获取昵称 + // 成长值 + wxScoreRulesService.addScore(EnumScoreType.WECHAT_PERSION, user); + //增加积分 + addCredit(user, EnumScoreType.WECHAT_PERSION); + } resultMap.put("openId", user.getOpenId()); resultMap.put("unionId", user.getUnionId()); @@ -388,7 +397,7 @@ public class WxUserGrantController extends BaseController { return new ResultData(ErrorCode.DB_FAIL.getCode(), "解密并保存出错", resultMap); } } else { - return new ResultData(ErrorCode.USER_IS_EMPTY); + return new ResultData(ErrorCode.USER_LOGIN_FAILED); } } @@ -416,6 +425,15 @@ public class WxUserGrantController extends BaseController { WxCUser user = getUser(); + if (user == null) { + return new ResultData(ErrorCode.USER_IS_EMPTY); + } + + boolean isFirstPhone = false; + if(StringUtils.isBlank(user.getPhone())) { + isFirstPhone = true; + } + WxMaService wxMaService = getWeappService(user.getAppId()); String session_key = user.getSessionKey(); @@ -429,10 +447,13 @@ public class WxUserGrantController extends BaseController { user.setCountryCode(phoneNoInfo.getCountryCode()); wxCUserService.saveOrUpdate(user); - // 成长值 - user.setScore(user.getScore() + wxScoreRulesService.addScore(EnumScoreType.WECHAT_PHONE, user)); - //增加积分 - addCredit(user, EnumScoreType.WECHAT_PHONE); + if(isFirstPhone) { + // 首次授权, 增加成长值及积分 + // 成长值 + user.setScore(wxScoreRulesService.addScore(EnumScoreType.WECHAT_PHONE, user)); + //增加积分 + addCredit(user, EnumScoreType.WECHAT_PHONE); + } resultMap.put("msg", "授权手机成功!"); resultMap.put("phone", phoneNoInfo.getPhoneNumber()); diff --git a/mallinkCApi/src/main/resources/application-dev.yml b/mallinkCApi/src/main/resources/application-dev.yml index cd3beab85..b92f0d210 100644 --- a/mallinkCApi/src/main/resources/application-dev.yml +++ b/mallinkCApi/src/main/resources/application-dev.yml @@ -87,7 +87,7 @@ fm: exception: false exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 1 - open: true + open: false logging: level: diff --git a/mallinkCApi/src/main/resources/application-prod.yml b/mallinkCApi/src/main/resources/application-prod.yml index 40cd75f73..1744c7b57 100644 --- a/mallinkCApi/src/main/resources/application-prod.yml +++ b/mallinkCApi/src/main/resources/application-prod.yml @@ -90,7 +90,7 @@ fm: exception: true exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 3 - open: true + open: false logging: level: diff --git a/mallinkCApi/src/main/resources/application-test.yml b/mallinkCApi/src/main/resources/application-test.yml index f7e30b35c..ceb572db0 100644 --- a/mallinkCApi/src/main/resources/application-test.yml +++ b/mallinkCApi/src/main/resources/application-test.yml @@ -90,7 +90,7 @@ fm: exception: true exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 2 - open: true + open: false logging: level: diff --git a/mallinkMQConsumer/src/main/resources/application-dev.yml b/mallinkMQConsumer/src/main/resources/application-dev.yml index 47e0c39bd..8bad32f22 100644 --- a/mallinkMQConsumer/src/main/resources/application-dev.yml +++ b/mallinkMQConsumer/src/main/resources/application-dev.yml @@ -106,7 +106,7 @@ fm: exception: false exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 1 - open: true + open: false logging: level: diff --git a/mallinkMQConsumer/src/main/resources/application-prod.yml b/mallinkMQConsumer/src/main/resources/application-prod.yml index e2907d5f0..4987a8e34 100644 --- a/mallinkMQConsumer/src/main/resources/application-prod.yml +++ b/mallinkMQConsumer/src/main/resources/application-prod.yml @@ -81,7 +81,7 @@ fm: exception: true exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 3 - open: true + open: false logging: level: diff --git a/mallinkMQConsumer/src/main/resources/application-test.yml b/mallinkMQConsumer/src/main/resources/application-test.yml index 8a849a88b..754ff05a1 100644 --- a/mallinkMQConsumer/src/main/resources/application-test.yml +++ b/mallinkMQConsumer/src/main/resources/application-test.yml @@ -91,7 +91,7 @@ fm: exception: true exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 2 - open: true + open: false logging: level: diff --git a/mallinkSchedule/src/main/resources/application-dev.yml b/mallinkSchedule/src/main/resources/application-dev.yml index 702acbf79..9456f7690 100644 --- a/mallinkSchedule/src/main/resources/application-dev.yml +++ b/mallinkSchedule/src/main/resources/application-dev.yml @@ -89,7 +89,7 @@ fm: exception: false exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 1 - open: true + open: false logging: level: diff --git a/mallinkSchedule/src/main/resources/application-prod.yml b/mallinkSchedule/src/main/resources/application-prod.yml index 1dac831d9..732985359 100644 --- a/mallinkSchedule/src/main/resources/application-prod.yml +++ b/mallinkSchedule/src/main/resources/application-prod.yml @@ -91,7 +91,7 @@ fm: exception: true exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 3 - open: true + open: false logging: level: diff --git a/mallinkSchedule/src/main/resources/application-test.yml b/mallinkSchedule/src/main/resources/application-test.yml index 82387aa13..55517d72c 100644 --- a/mallinkSchedule/src/main/resources/application-test.yml +++ b/mallinkSchedule/src/main/resources/application-test.yml @@ -91,7 +91,7 @@ fm: exception: true exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 2 - open: true + open: false logging: level: diff --git a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java index 0fb751d3e..4b48b62c7 100644 --- a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java +++ b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java @@ -190,6 +190,7 @@ public enum ErrorCode{ WE_RUN_DATA_DECODE_ERR(11008, "运动信息解密失败"), MP_TEMPLATE_SEND_FAILED(11009, "公众号模板消息发送失败"), UNIFORM_SEND_FAILED(11010, "小程序统一消息发送失败"), + USER_LOGIN_FAILED(11011, "微信用户未登录或登录有问题"), /** diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCreditHistory.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCreditHistory.java index d1d54bf39..e75ccef51 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCreditHistory.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCreditHistory.java @@ -22,6 +22,8 @@ public class WxCreditHistory implements Serializable { protected List ids; @Transient protected String sortColumns; + @Transient + protected List merchantIds; @Transient @io.swagger.annotations.ApiModelProperty(value="开始时间",name="startTime") diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java index 5b03c2c0b..09d97174d 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java @@ -189,6 +189,8 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { final IdWorker idWorker = IdWorker.get(); record.setId(idWorker.nextId()); record.setCreateDate(new Date()); + //根据merchantIds判断券对应的商户是否为多商户 来赋值merchantId + setMerchantId(record); wxCreditHistoryMapper.insertSelective(record); //将计算出来新的总积分 更新到两张用户表里 if (wxCUser != null) { @@ -210,6 +212,16 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { return record; } + private void setMerchantId(WxCreditHistory record) { + if (record.getMerchantIds() != null && record.getMerchantIds().size() > 0) { + if (record.getMerchantIds().size() == 1) { + record.setMerchantId(record.getMerchantIds().get(0)); + } else { + record.setMerchantId(Long.valueOf(EnumMerchantType.MERCHANT_MORE.getCode())); + } + } + } + @Override public void deleteById(Long id) { wxCreditHistoryMapper.deleteByPrimaryKey(id); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index a293f7f16..53f483357 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -605,7 +605,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService Date receiveDate = DateUtils.getFirstDayOfNextMonth(startdate,receivePeriod * i); wxBillProperty.setReceiveDate(receiveDate); wxBillProperty.setStarttime(receiveDate); - wxBillProperty.setEndtime(DateUtils.getLastDayForMonth(receiveDate,receivePeriod * i)); + wxBillProperty.setEndtime(DateUtils.getLastDayForMonth(wxBillProperty.getStarttime(),receivePeriod * i)); instance.clear(); instance.setTime(receiveDate); @@ -613,38 +613,37 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService instance.add(Calendar.DAY_OF_MONTH, -1); wxBillProperty.setEndtime(instance.getTime()); }else if(i == paycount - 1) {//最后周期 + //receivePeriod * i 得到开始日期 Date receiveDate = DateUtils.getFirstDayOfNextMonth(startdate,receivePeriod * i); wxBillProperty.setReceiveDate(receiveDate); wxBillProperty.setStarttime(receiveDate); + //得到开始日期第一天 Date firstDay = DateUtils.getFirstDayForCurrMonth(wxBillProperty.getStarttime()); instance.clear(); instance.setTime(firstDay); - //最后一期有余,加上残月,(不整除时,最后一个月有余,否则为0) - if(isFirstDay(wxPropertyContract.getRentalStartDate())){ - if(receivePeriod > 1) { - if(isLastYesr && extralease > 0) { + //若最后一期有余,带上残月,(不整除时,最后一个月有余,否则extralease=0) + if(isFirstDay(wxPropertyContract.getRentalStartDate())){ //月第一天起租 + if(receivePeriod > 1){ + if(isLastYesr && extralease > 0){ instance.add(dayType, extralease); }else{ instance.add(dayType, receivePeriod); } - }else { + }else{ instance.add(dayType, receivePeriod); } }else{ - if(receivePeriod > 1) { - if(isLastYesr) { - instance.add(dayType, extralease); - }else{ - instance.add(dayType, receivePeriod); - } - } if(isLastYesr) { + instance.add(dayType, extralease); instance.add(Calendar.DAY_OF_MONTH, rentStartDateInt - 1); + }else{ + instance.add(dayType, receivePeriod); } } + //先减一个月 后加上残月 instance.add(Calendar.DAY_OF_MONTH, -1); wxBillProperty.setEndtime(instance.getTime()); @@ -662,15 +661,11 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService needPayDouble += price * receivePeriod; } }else{ - if(receivePeriod > 1) { - if(isLastYesr) { - needPayDouble += price * extralease; - }else{ - needPayDouble += price * receivePeriod; - } - } if(isLastYesr) { + needPayDouble += price * extralease; needPayDouble += oneDayProce * endDateInt; + }else{ + needPayDouble += price * receivePeriod; } } DecimalFormat format = new DecimalFormat("0"); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 4532b9a51..9b0f5acd5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -970,51 +970,43 @@ public class WxRentContractServiceImpl implements WxRentContractService { wxBillRent.setStarttime(receiveDate); wxBillRent.setEndtime(DateUtils.getLastDayForMonth(wxBillRent.getStarttime(),receivePeriod * i)); -// instance.clear(); -// instance.setTime(receiveDate); -// instance.add(dayType, receivePeriod); -// instance.add(Calendar.DAY_OF_MONTH, -1); -// wxBillRent.setEndtime(instance.getTime()); + instance.clear(); + instance.setTime(receiveDate); + instance.add(dayType, receivePeriod); + instance.add(Calendar.DAY_OF_MONTH, -1); + wxBillRent.setEndtime(instance.getTime()); }else if(i == paycount - 1) {//最后周期 + //receivePeriod * i 得到开始日期 Date receiveDate = DateUtils.getFirstDayOfNextMonth(startdate,receivePeriod * i); wxBillRent.setReceiveDate(receiveDate); wxBillRent.setStarttime(receiveDate); + //得到开始日期第一天 Date firstDay = DateUtils.getFirstDayForCurrMonth(wxBillRent.getStarttime()); instance.clear(); instance.setTime(firstDay); - if(new SimpleDateFormat("yyyy-MM-dd").format(wxBillRent.getEndtime()).equals("2020-02-29")){ - System.out.println( "-----------"+receivePeriod * i); - System.out.println("-----------"+new SimpleDateFormat("yyyy-MM-dd").format(wxBillRent.getReceiveDate())); - System.out.println("-----------"+new SimpleDateFormat("yyyy-MM-dd").format(wxBillRent.getEndtime())); - System.out.println(); - } - - //最后一期有余,加上残月,(不整除时,最后一个月有余,否则为0) - if(isFirstDay(wxRentContract.getRentalStartDate())){ - if(receivePeriod > 1) { - if(isLastYesr && extralease > 0) { + //若最后一期有余,带上残月,(不整除时,最后一个月有余,否则extralease=0) + if(isFirstDay(wxRentContract.getRentalStartDate())){ //月第一天起租 + if(receivePeriod > 1){ + if(isLastYesr && extralease > 0){ instance.add(dayType, extralease); }else{ instance.add(dayType, receivePeriod); } - }else { + }else{ instance.add(dayType, receivePeriod); } }else{ - if(receivePeriod > 1) { - if(isLastYesr) { - instance.add(dayType, extralease); - }else{ - instance.add(dayType, receivePeriod); - } - } if(isLastYesr) { + instance.add(dayType, extralease); instance.add(Calendar.DAY_OF_MONTH, rentStartDateInt - 1); + }else{ + instance.add(dayType, receivePeriod); } } + //先减一个月 后加上残月 instance.add(Calendar.DAY_OF_MONTH, -1); wxBillRent.setEndtime(instance.getTime()); @@ -1032,15 +1024,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { needPayDouble += price * receivePeriod; } }else{ - if(receivePeriod > 1) { - if(isLastYesr) { - needPayDouble += price * extralease; - }else{ - needPayDouble += price * receivePeriod; - } - } if(isLastYesr) { + needPayDouble += price * extralease; needPayDouble += oneDayProce * endDateInt; + }else{ + needPayDouble += price * receivePeriod; } } DecimalFormat format = new DecimalFormat("0"); @@ -2038,3 +2026,4 @@ public class WxRentContractServiceImpl implements WxRentContractService { } + diff --git a/mallinkWebSocketServer/src/main/resources/application-dev.yml b/mallinkWebSocketServer/src/main/resources/application-dev.yml index 041b69d95..c67199bd1 100644 --- a/mallinkWebSocketServer/src/main/resources/application-dev.yml +++ b/mallinkWebSocketServer/src/main/resources/application-dev.yml @@ -106,7 +106,7 @@ fm: exception: false exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 1 - open: true + open: false logging: level: diff --git a/mallinkWebSocketServer/src/main/resources/application-prod.yml b/mallinkWebSocketServer/src/main/resources/application-prod.yml index c777bb3cf..ac7188014 100644 --- a/mallinkWebSocketServer/src/main/resources/application-prod.yml +++ b/mallinkWebSocketServer/src/main/resources/application-prod.yml @@ -91,7 +91,7 @@ fm: exception: true exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 3 - open: true + open: false logging: level: diff --git a/mallinkWebSocketServer/src/main/resources/application-test.yml b/mallinkWebSocketServer/src/main/resources/application-test.yml index 4a2dbfa4d..965292d1c 100644 --- a/mallinkWebSocketServer/src/main/resources/application-test.yml +++ b/mallinkWebSocketServer/src/main/resources/application-test.yml @@ -91,7 +91,7 @@ fm: exception: true exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com,hanxueda@iformall.com deploy: 2 - open: true + open: false logging: level: