Commit 31485013 authored by tangwei's avatar tangwei

增加公司过滤

parent aa0d0e53
......@@ -5,6 +5,8 @@ import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.equipmanage.fegin.JcsFeign;
import com.yeejoin.equipmanage.mapper.EquipmentManageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
......@@ -28,6 +30,7 @@ import com.yeejoin.equipmanage.service.EquipmentManageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
/**
* @author zjw
......@@ -43,6 +46,8 @@ public class EquipmentManageController extends AbstractBaseController{
@Autowired
private RemoteSecurityService remoteSecurityService;
@Autowired
private JcsFeign jcsFeign;
@GetMapping(value = "/listAndCount")
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -56,9 +61,23 @@ public class EquipmentManageController extends AbstractBaseController{
@RequestParam(value = "maintenance",required = false) String formGroupId,
@RequestParam(value = "controBoxBuildId",required = false) String controBoxBuildId,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int pageSize
@RequestParam(value = "size") int pageSize,
@RequestParam(value = "companyId") String companyId
) {
return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,formGroupId,current,pageSize,controBoxBuildId);
if(companyId!=null) {
String token = getToken();
String appKey = getAppKey();
String product = getProduct();
ResponseModel<JSONObject> obj = jcsFeign.getUnitById(appKey,product,token,companyId);
JSONObject result = obj.getResult();
if (result.containsKey("sequenceNbr")) {
companyId = result.get("sequenceNbr").toString();
}
}
return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,formGroupId,current,pageSize,controBoxBuildId,companyId);
}
@GetMapping(value = "/getUtils")
......
......@@ -27,7 +27,7 @@ public interface EquipmentManageService extends IService<EquipmentManageEntity>
* @param pageSize
* @return
*/
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize, String controBoxBuildId);
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize, String controBoxBuildId,String companyId);
/**
* 获取下拉菜单数据
......
......@@ -56,7 +56,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
@Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance,
String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId) {
String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId,String companyCode) {
HttpServletRequest request = null;
Map map = new HashMap<String, Object>();
map.put("equimentName", equimentName);
......@@ -66,6 +66,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
map.put("spage", current);
map.put("pageSize", pageSize);
map.put("bizOrgCode", bizOrgCode);
map.put("companyCode", companyCode);
map.put("formGroupId", formGroupId);
map.put("controBoxBuildId",controBoxBuildId);
List<EquipmentManageVo> dataList = equipmentManageMapper.queryEquipmenInfo(map);
......
......@@ -46,6 +46,9 @@
<if test="bizOrgCode != null and bizOrgCode != ''">
AND biz_org_code like CONCAT(#{bizOrgCode},'%')
</if>
<if test="companyCode != null and companyCode != ''">
AND biz_org_code ={companyCode}
</if>
<if test="formGroupId != null and formGroupId != '' and formGroupId != '-1'">
AND form_group_id = #{formGroupId}
</if>
......
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