| @@ -66,7 +66,7 @@ public class AsyncTask { | |||
| public void importExcelData(File file, MallUserInfo user, String importKey, String tenantId) { | |||
| ImportParams params = new ImportParams(); | |||
| // 需要验证 | |||
| params.setImportFields(new String[]{"姓名", "性别", "手机号", "微信昵称", "学历", "生日", "地址", "上次活跃时间", "注册时间", "标签", "成长值"}); | |||
| params.setImportFields(new String[]{"姓名", "性别", "手机号", "微信昵称", "学历", "生日","积分", "地址", "上次活跃时间", "注册时间", "标签", "成长值"}); | |||
| IExcelDataHandler<CUserBaseInfoT> handler = new AsyncTask.UserExcelHandler(); | |||
| handler.setNeedHandlerFields(new String[] { "手机号" }); | |||
| params.setNeedVerify(true); | |||
| @@ -37,11 +37,11 @@ public class WxScoreRules implements Serializable { | |||
| " {\"businessId\":3,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||
| " {\"businessId\":4,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||
| " {\"businessId\":5,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||
| " {\"businessId\":6,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||
| " {\"businessId\":7,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||
| " {\"businessId\":8,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||
| " {\"businessId\":9,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||
| " {\"businessId\":10,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}" + | |||
| " {\"businessId\":10,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||
| " {\"businessId\":6,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}" + | |||
| "]}," + | |||
| "{\"id\":3,\"limit\":1,\"step\":1,\"score\":100,\"desc\":\"绑定车牌1个\"}," + | |||
| "{\"id\":4,\"limit\":0,\"step\":1,\"score\":10 ,\"desc\":\"连接WIFI1次\"}," + | |||
| @@ -34,27 +34,31 @@ public class CUserBaseInfoT implements Serializable { | |||
| @Excel(name="生日",width = 20,orderNum = "6") | |||
| @io.swagger.annotations.ApiModelProperty(value="出生日期",name="birthdate") | |||
| private String birthdate; | |||
| /**积分**/ | |||
| @Excel(name="积分",width = 20,orderNum = "7") | |||
| @io.swagger.annotations.ApiModelProperty(value="积分",name="credit") | |||
| private String credit; | |||
| /**地址**/ | |||
| @Excel(name="地址",width = 20,orderNum = "7") | |||
| @Excel(name="地址",width = 20,orderNum = "8") | |||
| @io.swagger.annotations.ApiModelProperty(value="地址",name="address") | |||
| private String address; | |||
| /**更新时间**/ | |||
| @Excel(name="上次活跃时间",width = 20, orderNum = "8") | |||
| @Excel(name="上次活跃时间",width = 20, orderNum = "9") | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private String updateDate; | |||
| /**创建时间**/ | |||
| @Excel(name="注册时间",width = 20, orderNum = "9") | |||
| @Excel(name="注册时间",width = 20, orderNum = "10") | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private String createDate; | |||
| @Transient | |||
| @Excel(name="标签",width = 20,orderNum = "10") | |||
| @Excel(name="标签",width = 20,orderNum = "11") | |||
| private String tagNames; | |||
| @Transient | |||
| @Excel(name="成长值",width = 20,orderNum = "11") | |||
| @Excel(name="成长值",width = 20,orderNum = "12") | |||
| private String poins; | |||
| public String getName() { | |||
| @@ -144,4 +148,12 @@ public class CUserBaseInfoT implements Serializable { | |||
| public void setPoins(String poins) { | |||
| this.poins = poins; | |||
| } | |||
| public String getCredit() { | |||
| return credit; | |||
| } | |||
| public void setCredit(String credit) { | |||
| this.credit = credit; | |||
| } | |||
| } | |||
| @@ -300,6 +300,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||
| u1.setPhone("13900010001"); | |||
| u1.setNickName("昵称"); | |||
| u1.setEducation("本科"); | |||
| u1.setCredit(10); | |||
| u1.setAddress("地址"); | |||
| try { | |||
| u1.setBirthdate(sdf.parse("2018-09-10")); | |||
| @@ -310,7 +311,6 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||
| u1.setCreateDate(new Date()); | |||
| u1.setUpdateDate(new Date()); | |||
| } | |||
| u1.setTagNames("附近住户"); | |||
| u1.setPoins(100); | |||
| @@ -319,6 +319,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||
| u2.setPhone("13900010002"); | |||
| u2.setNickName("昵称"); | |||
| u2.setEducation("本科"); | |||
| u2.setCredit(20); | |||
| u2.setAddress("地址"); | |||
| try { | |||
| @@ -339,6 +340,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||
| u3.setPhone("13900010003"); | |||
| u3.setNickName("昵称"); | |||
| u3.setEducation("本科"); | |||
| u3.setCredit(30); | |||
| u3.setAddress("地址"); | |||
| try { | |||
| @@ -566,6 +568,17 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||
| } | |||
| } | |||
| //积分 | |||
| Integer credit = null; | |||
| if (StringUtils.isNotBlank(uBase.getCredit())) { | |||
| try { | |||
| credit = Integer.valueOf(uBase.getCredit()); | |||
| userBase.setCredit(credit); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| } | |||
| WxCUserBasicInfo oldUserBase = null; | |||
| WxCUserBasicInfo userBaseQ = new WxCUserBasicInfo(); | |||
| userBaseQ.setTenantId(tenantId); | |||
| @@ -590,10 +603,18 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||
| if(points != null) { | |||
| oldUserBase.setPoins(points); | |||
| } | |||
| // 覆盖原积分 | |||
| if(credit != null) { | |||
| oldUserBase.setCredit(credit); | |||
| } | |||
| } else { | |||
| userBase.setId(idWorker.nextId()); | |||
| userBase.setUpdateDate(userBase.getUpdateDate() == null ? new Date() : userBase.getUpdateDate()); | |||
| userBase.setCreateDate(userBase.getCreateDate() == null ? new Date() : userBase.getCreateDate()); | |||
| //新增积分 | |||
| if(credit != null) { | |||
| userBase.setCredit(credit); | |||
| } | |||
| } | |||
| // update 昵称 | |||
| @@ -606,6 +627,11 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||
| if (userList.size() > 0) { | |||
| WxCUser user = userList.get(0); | |||
| if (user != null) { | |||
| //覆盖积分 | |||
| if(credit != null) { | |||
| user.setCredit(credit); | |||
| wxCUserMapper.updateByPrimaryKey(user); | |||
| } | |||
| bHaveCUser = true; | |||
| if (oldUserBase != null) { | |||
| if(oldUserBase != null) { | |||