Commit fdd89976 authored by Quxl's avatar Quxl

x

parent 3246c22c
......@@ -291,21 +291,9 @@ public class UserController {
@ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = "")
})
@RequestMapping(value = "/queryUserInfoByOpenId",method=RequestMethod.GET)
public String queryUserInfoByOpenId(String openId, HttpServletRequest request, HttpServletResponse response) {
TCustomer tCustomer = userService.getCustomerByOpenId(openId);
Map<String,Object> resultMap = new HashMap<String,Object>();
if(tCustomer != null) {
resultMap.put("custNO",tCustomer.getsCustNO());
resultMap.put("custName", tCustomer.getsCustName());
resultMap.put("custLevelTypeId", tCustomer.getsCustLeveTypeID());
resultMap.put("custLevelType", tCustomer.getsCustLeveType()+"");
resultMap.put("point", tCustomer.getnPoint()+"");
resultMap.put("mobile", tCustomer.getsMobile()+"");
resultMap.put("custTypeID", tCustomer.getsCustTypeID()+"");
resultMap.put("openID", tCustomer.getsOpenID());
resultMap.put("shopList", tCustomer.gettShops());
}
return Rjx.jsonOk().setData(resultMap).toJson();
public String queryUserInfoByOpenId(String openId, String langID, HttpServletRequest request, HttpServletResponse response) {
Map<String, Object> customerMap = userService.queryCustomerByOpenId(openId);
List<Map<String, Object>> shopList = userService.queryShopList((String)customerMap.get("sCustNO"));
return Rjx.jsonOk().set("customer", customerMap).set("shopList", shopList).setMessage(I18NUtils.getMessage(langID, "Msg_Login_success")).toJson();
}
}
......@@ -35,8 +35,6 @@ public interface UserService {
public Map<String, Object> createShop(String orgNo, Map<String, Object> customerMap);
public TCustomer getCustomerByOpenId(String openId);
public void deleteOpenId(String openId);
}
......@@ -547,20 +547,6 @@ public class UserServiceImpl implements UserService {
return map;
}
public TCustomer getCustomerByOpenId(String openId) {
try {
String sql = "SELECT * FROM tCustomer WHERE sOpenID = ? AND nTag&1=0";
jdbcTemplate.setDialect(new SqlServerDialect());
TCustomer tcustomer = jdbcTemplate.queryForBean(sql, TCustomer.class, openId);
String shopSql = "SELECT * FROM tShop WHERE nTag&1=0 and sCustNO =? ";
List<TShop> shops = jdbcTemplate.queryForBeans(shopSql, TShop.class, tcustomer.getsCustNO());
tcustomer.settShops(shops);
return tcustomer;
} catch (Exception e) {
return null;
}
}
@Override
public void deleteOpenId(String openId) {
jdbcTemplate.update("update tCustomer set sOpenID = ? where sOpenID = ?", null, openId);
......
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