|
|
@@ -22,6 +22,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
@@ -63,6 +64,9 @@ public class WxPortalController extends ApiBaseController {
|
|
|
@Autowired
|
|
|
private ISysUserExtService sysUserExtService;
|
|
|
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ JdbcTemplate jdbcTemplate;
|
|
|
@ApiOperation(value = "微信门户首页",notes = "参数:{userId:1}")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "params" , paramType = "body")
|
|
|
@@ -70,9 +74,15 @@ public class WxPortalController extends ApiBaseController {
|
|
|
@PostMapping("/portalData")
|
|
|
public Object getMagent(){
|
|
|
ParameterObject obj = getParameterObject();
|
|
|
- obj.checkParameterNotNull("userId");
|
|
|
+ obj.checkParameterNotNull("userId,agent");
|
|
|
+ String loginType="";
|
|
|
+ List<Map<String, Object>> loginTypeList = jdbcTemplate.queryForList("select dict_label shopType,dict_value shopTypeValue from sys_dict_data where dict_type='system_login_type' and dict_label=? ",obj.getString("agent"));
|
|
|
+ if(loginTypeList.size()!=0){
|
|
|
+ loginType= loginTypeList.get(0).get("shopTypeValue").toString();
|
|
|
+ }
|
|
|
+
|
|
|
WxBanner wxBanner = new WxBanner();
|
|
|
- List<WxMagnet> wxMagnetList = wxMagnetService.selectMagnetByUserId(obj.getString("userId"), obj.getString("cw"), obj.getString("salesLevel"));
|
|
|
+ List<WxMagnet> wxMagnetList = wxMagnetService.selectMagnetByUserId(obj.getString("userId"), obj.getString("cw"), obj.getString("salesLevel"),loginType);
|
|
|
List<WxBanner> wxBannerList = wxBannerService.selectWxBannerList(wxBanner);
|
|
|
return AjaxResult.success().putKV("magnets",wxMagnetList).putKV("banners",wxBannerList);
|
|
|
}
|