|
|
|
@@ -41,6 +41,8 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
@Autowired |
|
|
|
WxWeappExtSetMapper wxWeappExtSetMapper; |
|
|
|
@Autowired |
|
|
|
WxAuthorizerInfoMapper wxAuthorizerInfoMapper; |
|
|
|
@Autowired |
|
|
|
MallUserInfoMapper mallUserInfoMapper; |
|
|
|
@Autowired |
|
|
|
MallRoleMapper mallRoleMapper; |
|
|
|
@@ -74,6 +76,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
WxProjectConfig wxProjectConfig = wxProjectConfigMapper.selectById(id); |
|
|
|
if(wxProjectConfig!=null && wxProjectConfig.getDelType()<10000){ |
|
|
|
Date nowTime = new Date(); |
|
|
|
logger.info("wx_mall 商场---------------------init--start"); |
|
|
|
// 1. wx_mall 商场 |
|
|
|
WxMall wxMall = new WxMall(); |
|
|
|
wxMall.setTenantId("-1"); |
|
|
|
@@ -109,6 +112,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
logger.info("wx_mall 商场---------------------init--success"); |
|
|
|
|
|
|
|
// 2. wx_coupon_send_config |
|
|
|
logger.info("wx_coupon_send_config---------------------init--start"); |
|
|
|
WxCouponSendConfig wxCouponSendConfig = new WxCouponSendConfig(); |
|
|
|
wxCouponSendConfig.setTenantId(wxMall.getTenantId()); |
|
|
|
wxCouponSendConfig.setValue(0);//默认停用 |
|
|
|
@@ -126,6 +130,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
|
|
|
|
// 3. wx_mall_building 商场楼座 |
|
|
|
//{"A座":"B2层,B1层,1层,2层,3层,4层","B座":"1层,2层,3层"} |
|
|
|
logger.info("wx_mall_building---floor---------------------init--start"); |
|
|
|
JSONObject obj= JSON.parseObject(wxProjectConfig.getMallBuilding()); |
|
|
|
Iterator it =obj.entrySet().iterator(); |
|
|
|
while (it.hasNext()) { |
|
|
|
@@ -159,6 +164,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
|
|
|
|
//# --- 特殊商户号开通后,填写此数据 |
|
|
|
//# 5. wx_pay_account |
|
|
|
logger.info("wx_pay_account---------------------init--start"); |
|
|
|
WxPayAccount wxPayAccount = new WxPayAccount(); |
|
|
|
wxPayAccount.setTenantId(wxMall.getTenantId()); |
|
|
|
wxPayAccount.setMchId(wxProjectConfig.getMchId()); |
|
|
|
@@ -181,6 +187,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
|
|
|
|
//# --- 特殊商户号开通后,填写此数据 |
|
|
|
//# 6. wx_pay_account_bill |
|
|
|
logger.info("wx_pay_account_bill---------------------init--start"); |
|
|
|
WxPayAccountBill wxPayAccountBill = new WxPayAccountBill(); |
|
|
|
wxPayAccountBill.setTenantId(wxPayAccount.getTenantId()); |
|
|
|
wxPayAccountBill.setMchId(wxPayAccount.getMchId()); |
|
|
|
@@ -199,6 +206,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
|
|
|
|
//# --- 小程序开通后,填写此数据,并设置域名及业务域名等 |
|
|
|
//# 7. wx_appinfo |
|
|
|
logger.info("wx_appinfo---------------------init--start"); |
|
|
|
WxAppinfo wxAppinfo = new WxAppinfo(); |
|
|
|
wxAppinfo.setTenantId(wxMall.getTenantId()); |
|
|
|
wxAppinfo.setType(1); |
|
|
|
@@ -222,6 +230,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
|
|
|
|
logger.info("wx_appinfo ---------------------init--success"); |
|
|
|
|
|
|
|
logger.info("wx_weapp_ext_set---------------------init--start"); |
|
|
|
WxWeappExtSet wxWeappExtSet = new WxWeappExtSet(); |
|
|
|
wxWeappExtSet.setAppId(wxProjectConfig.getAppIdB()); |
|
|
|
wxWeappExtSet.setType(1); |
|
|
|
@@ -242,12 +251,39 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
|
|
|
|
logger.info("wx_weapp_ext_set ---------------------init--success"); |
|
|
|
|
|
|
|
logger.info("wx_authorizer_info---------------------init--start"); |
|
|
|
WxAuthorizerInfo wxAuthorizerInfo = new WxAuthorizerInfo(); |
|
|
|
wxAuthorizerInfo.setTenantId(wxMall.getTenantId()); |
|
|
|
wxAuthorizerInfo.setType(1); |
|
|
|
wxAuthorizerInfo.setAuthorizerAppid(wxProjectConfig.getAppIdB()); |
|
|
|
wxAuthorizerInfo.setHeadImg(wxProjectConfig.getHeadImgB()); |
|
|
|
wxAuthorizerInfo.setQrcodeUrl(wxProjectConfig.getQrcodeUrlB()); |
|
|
|
wxAuthorizerInfo.setCreateTime(nowTime); |
|
|
|
wxAuthorizerInfo.setUpdateTime(nowTime); |
|
|
|
wxAuthorizerInfo.setRefreshToken(""); |
|
|
|
wxAuthorizerInfo.setAccessToken(""); |
|
|
|
wxAuthorizerInfoMapper.insert(wxAuthorizerInfo); |
|
|
|
wxAuthorizerInfo = new WxAuthorizerInfo(); |
|
|
|
wxAuthorizerInfo.setTenantId(wxMall.getTenantId()); |
|
|
|
wxAuthorizerInfo.setType(2); |
|
|
|
wxAuthorizerInfo.setAuthorizerAppid(wxProjectConfig.getAppIdC()); |
|
|
|
wxAuthorizerInfo.setHeadImg(wxProjectConfig.getHeadImgC()); |
|
|
|
wxAuthorizerInfo.setQrcodeUrl(wxProjectConfig.getQrcodeUrlC()); |
|
|
|
wxAuthorizerInfo.setCreateTime(nowTime); |
|
|
|
wxAuthorizerInfo.setUpdateTime(nowTime); |
|
|
|
wxAuthorizerInfo.setRefreshToken(""); |
|
|
|
wxAuthorizerInfo.setAccessToken(""); |
|
|
|
wxAuthorizerInfoMapper.insert(wxAuthorizerInfo); |
|
|
|
|
|
|
|
logger.info("wx_authorizer_info ---------------------init--success"); |
|
|
|
|
|
|
|
//生成id |
|
|
|
//final IdWorker idWorker = IdWorker.get(); |
|
|
|
//密码加密 |
|
|
|
PasswordHelper passwordHelper = new PasswordHelper(); |
|
|
|
// 9. mall_user_info mfadmin/m2F@of0 |
|
|
|
// |
|
|
|
logger.info("mall_user_info---------------------init--start"); |
|
|
|
MallUserInfo mallUserInfo = new MallUserInfo(); |
|
|
|
//mallUserInfo.setId(idWorker.nextId()); |
|
|
|
mallUserInfo.setTenantId(wxMall.getTenantId()); |
|
|
|
@@ -265,6 +301,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
logger.info("mall_user_info ---------------------init--success"); |
|
|
|
|
|
|
|
//# 10. mall_role |
|
|
|
logger.info("mall_role---------------------init--start"); |
|
|
|
MallRole mallRole = new MallRole(); |
|
|
|
//mallRole.setId(idWorker.nextId()); |
|
|
|
mallRole.setTenantId(wxMall.getTenantId()); |
|
|
|
@@ -275,6 +312,8 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
logger.info("mall_role ---------------------init--success"); |
|
|
|
|
|
|
|
//# 11. mall_role_permission |
|
|
|
//默认给所有权限 |
|
|
|
logger.info("mall_role_permission---------------------init--start"); |
|
|
|
MallPermission mallPermission=new MallPermission(); |
|
|
|
List<MallPermission> list = mallPermissionMapper.findList(mallPermission); |
|
|
|
for(MallPermission m : list){ |
|
|
|
@@ -290,6 +329,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
logger.info("mall_role_permission ---------------------init--success"); |
|
|
|
|
|
|
|
//# 12. mall_user_role |
|
|
|
logger.info("mall_user_role---------------------init--start"); |
|
|
|
MallUserRole mallUserRole = new MallUserRole(); |
|
|
|
//mallUserRole.setId(idWorker.nextId()); |
|
|
|
mallUserRole.setUid(mallUserInfo.getId()); |
|
|
|
@@ -299,6 +339,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
logger.info("mall_user_role ---------------------init--success"); |
|
|
|
|
|
|
|
//# 13. wx_msg_config |
|
|
|
logger.info("wx_msg_config---------------------init--start"); |
|
|
|
WxMsgConfig wxMsgConfig = new WxMsgConfig(); |
|
|
|
wxMsgConfig.setTenantId(wxMall.getTenantId()); |
|
|
|
wxMsgConfig.setSecret("7305150347587283553aa8898e7dbf20"); |
|
|
|
@@ -320,6 +361,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
|
|
|
|
//# --- 14. ETCP 设置完后再填写此数据 |
|
|
|
//# 14. wx_park |
|
|
|
logger.info("wx_park---------------------init--start"); |
|
|
|
WxPark wxPark = new WxPark(); |
|
|
|
wxPark.setVendorParams("{}"); |
|
|
|
wxPark.setCreateDate(nowTime); |
|
|
|
@@ -337,6 +379,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
|
|
|
|
|
|
|
|
//# 积分成长值设置wx_score_rules |
|
|
|
logger.info("wx_score_rules---------------------init--start"); |
|
|
|
WxScoreRules wxScoreRules = new WxScoreRules(); |
|
|
|
//wxScoreRules.setId(idWorker.nextId()); |
|
|
|
wxScoreRules.setTenantId(wxMall.getTenantId()); |
|
|
|
@@ -362,6 +405,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
//# 17. wx_template_msg |
|
|
|
//# C端登录,设置域名 |
|
|
|
//# 设置核销成功通知,核销失败通知 |
|
|
|
logger.info("wx_template_msg---------------------init--start"); |
|
|
|
WxTemplateMsg wxTemplateMsg = new WxTemplateMsg(); |
|
|
|
wxTemplateMsg.setTenantId(wxMall.getTenantId()); |
|
|
|
wxTemplateMsg.setTemplateId(""); |
|
|
|
@@ -387,6 +431,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { |
|
|
|
|
|
|
|
|
|
|
|
// # 19. wx_question |
|
|
|
logger.info("wx_question---------------------init--start"); |
|
|
|
String questionJson = "[{\"flag\": \"single\", \"title\": \"请问您的职业是?\", \"answers\": [{\"id\": \"59\", \"name\": \"学生\"}, {\"id\": \"60\", \"name\": \"上班族\"}, {\"id\": \"61\", \"name\": \"企业高管\"}, {\"id\": \"62\", \"name\": \"个体户\"}, {\"id\": \"63\", \"name\": \"自由职业\"}, {\"id\": \"64\", \"name\": \"其他\"}]}," |
|
|
|
+ "{\"flag\": \"single\", \"title\": \"请问您目前的学历是?\", \"answers\": [{\"id\": \"34\", \"name\": \"高中\"}, {\"id\": \"35\", \"name\": \"大专\"}, {\"id\": \"36\", \"name\": \"本科\"}, {\"id\": \"37\", \"name\": \"硕士及以上\"}, {\"id\": \"38\", \"name\": \"博士及以上\"}]}," |
|
|
|
+ "{\"flag\": \"single\", \"title\": \"请问您是如何到达商场的?\", \"answers\": [{\"id\": \"127\", \"name\": \"走路\"}, {\"id\": \"128\", \"name\": \"乘车\"}]}," |
|
|
|
|