Commit 9465e5a4 authored by Quxl's avatar Quxl

x

parent 651918c6
...@@ -12,7 +12,7 @@ import org.springframework.transaction.PlatformTransactionManager; ...@@ -12,7 +12,7 @@ import org.springframework.transaction.PlatformTransactionManager;
import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.pool.DruidDataSource;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.dialect.MySqlDialect; import com.egolm.common.jdbc.dialect.SqlServerDialect;
@Configuration @Configuration
public class DataSourceConfig { public class DataSourceConfig {
...@@ -35,7 +35,7 @@ public class DataSourceConfig { ...@@ -35,7 +35,7 @@ public class DataSourceConfig {
public JdbcTemplate getJdbcTemplate(DataSource dataSource) { public JdbcTemplate getJdbcTemplate(DataSource dataSource) {
JdbcTemplate jdbcTemplate = new JdbcTemplate(); JdbcTemplate jdbcTemplate = new JdbcTemplate();
jdbcTemplate.setDataSource(dataSource); jdbcTemplate.setDataSource(dataSource);
jdbcTemplate.setDialect(new MySqlDialect()); jdbcTemplate.setDialect(new SqlServerDialect());
jdbcTemplate.setSql_level(3); jdbcTemplate.setSql_level(3);
return jdbcTemplate; return jdbcTemplate;
} }
......
...@@ -174,6 +174,7 @@ public class UserController { ...@@ -174,6 +174,7 @@ public class UserController {
@ApiOperation("小程序登陆") @ApiOperation("小程序登陆")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "openId", dataType = "String", required = false, value = "OPENID", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "openId", dataType = "String", required = false, value = "OPENID", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "unionId", dataType = "String", required = false, value = "unionId", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "mobile", dataType = "String", required = false, value = "手机号", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "mobile", dataType = "String", required = false, value = "手机号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = false, value = "orgNo", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = false, value = "orgNo", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = false, value = "语言", defaultValue = "936"), @ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = false, value = "语言", defaultValue = "936"),
...@@ -182,16 +183,17 @@ public class UserController { ...@@ -182,16 +183,17 @@ public class UserController {
@ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = "") @ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = "")
}) })
@RequestMapping(value = "/loginByOpenId",method=RequestMethod.POST) @RequestMapping(value = "/loginByOpenId",method=RequestMethod.POST)
public String loginByOpenId(String openId, String mobile, String orgNo, String langID, HttpServletRequest request, HttpServletResponse response) { public String loginByOpenId(String openId, String mobile, String orgNo, String unionId, String langID, HttpServletRequest request, HttpServletResponse response) {
Map<String, Object> customerMap = userService.queryCustomerByOpenId(openId); Map<String, Object> customerMap = userService.queryCustomerByOpenId(openId);
if(customerMap == null) { if(customerMap == null) {
customerMap = userService.queryCustomerByMobile(mobile); customerMap = userService.queryCustomerByMobile(mobile);
} }
if(customerMap == null) { if(customerMap == null) {
if(StringUtil.isNotBlank(openId, mobile)) { if(StringUtil.isNotBlank(openId, mobile)) {
customerMap = userService.createCustomer(openId, mobile);
} else {
throw new XException("手机号码和OPENID不能为空"); throw new XException("手机号码和OPENID不能为空");
} }
customerMap = userService.createCustomer(openId, mobile);
} }
String custNo = (String)customerMap.get("sCustNO"); String custNo = (String)customerMap.get("sCustNO");
List<Map<String, Object>> shopList = userService.queryShopList(custNo); List<Map<String, Object>> shopList = userService.queryShopList(custNo);
......
...@@ -474,8 +474,8 @@ public class UserServiceImpl implements UserService { ...@@ -474,8 +474,8 @@ public class UserServiceImpl implements UserService {
map.put("sMobile", mobile); map.put("sMobile", mobile);
map.put("sCustNO", mobile); map.put("sCustNO", mobile);
map.put("sCustName", mobile); map.put("sCustName", mobile);
map.put("sCustLevelType", "普通客户"); map.put("sCustLeveType", "普通客户");
map.put("sCustLevelTypeID", "1"); map.put("sCustLeveTypeID", "1");
map.put("nTag", 0); map.put("nTag", 0);
map.put("sCreateUser", ""); map.put("sCreateUser", "");
map.put("dCreateDate", new Date()); map.put("dCreateDate", new Date());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment