Commit 7d04f8f1 by jinxin

企业列表查询字段处理

parent 23804876
package com.gic.haoban.manage.web.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.authcenter.commons.dto.AuthcenterUserDetails;
......@@ -502,6 +503,18 @@ public class EnterpriseController extends WebBaseController {
vo.setPhoneNumber(clerk.getPhoneNumber());
vo.setNationCode(clerk.getNationcode());
}
//enterpriseId 参数可以是企业id,也可以是企业名称
if(ObjectUtil.isNull(vo)){
//按名称去查
EnterpriseAndUserDTO dto = enterpriseService.getEnterpriseAndUserByName(enterpriseId);
vo = EntityUtil.changeEntityByJSON(EnterpriseSearchVO.class, dto);
if (vo != null) {
EnterpriseDTO enterprise1 = enterpriseService.getEnterpriseById(vo.getEnterpriseId());
if (enterprise1 != null) {
vo.setBrandName(enterprise1.getBrandName());
}
}
}
return resultResponse(HaoBanErrCode.ERR_1, vo);
}
......
package com.gic.haoban.manage.web.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
......@@ -234,6 +235,18 @@ public class WxEnterpriseController extends WebBaseController {
vo.setPhoneNumber(clerk.getPhoneNumber());
vo.setNationCode(clerk.getNationcode());
}
//enterpriseId 参数可以是企业id,也可以是企业名称
if(ObjectUtil.isNull(vo)){
//按名称去查
EnterpriseAndUserDTO dto = enterpriseService.getEnterpriseAndUserByName(enterpriseId);
vo = EntityUtil.changeEntityByJSON(EnterpriseSearchVO.class, dto);
if (vo != null) {
EnterpriseDTO enterprise1 = enterpriseService.getEnterpriseById(vo.getEnterpriseId());
if (enterprise1 != null) {
vo.setBrandName(enterprise1.getBrandName());
}
}
}
return resultResponse(HaoBanErrCode.ERR_1, vo);
}
......
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