Commit b37f882d authored by maoying's avatar maoying

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 334f8fd1 fb022ee2
......@@ -33,4 +33,6 @@ public interface MaintenanceCompanyMapper extends BaseMapper<MaintenanceCompany>
List<MaintenanceCompany> findByCodeAndType(String code, String type);
List<MaintenanceCompany> findByInstanceIdAndType(Long instanceId, String type);
int amosIdExist(String amosId);
}
......@@ -170,4 +170,6 @@ public interface IMaintenanceCompanyService {
List<MaintenanceCompany> findPersonByAmosOrgId(String code, String userId);
MaintenanceCompany getOne(Long parentId);
Object amosIdExist(String amosId);
}
......@@ -55,6 +55,14 @@ WHERE
</if>
</where>
</select>
<select id="amosIdExist" resultType="int">
select count(amos_org_id) from cb_maintenance_company where is_delete = 0 and amos_org_id = #{amosId}
</select>
<select id="findByCodeAndType" resultType="com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany">
SELECT
m.sequence_nbr,
......
......@@ -7,15 +7,7 @@ import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
......@@ -90,6 +82,20 @@ public class MaintenanceCompanyController extends BaseController {
}
/**
* 判断关联账户是否已关联
*
* @param
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getAmosId/{amosId}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "判断关联账户是否已关联", notes = "判断关联账户是否已关联")
public ResponseModel<Object> getAmosId(@PathVariable String amosId) {
return ResponseHelper.buildResponse(maintenanceCompanyService.amosIdExist(amosId));
}
/**
* 检查员工编号是否已经存在,用于手动输入的员工编号校验
*
* @return
......@@ -342,4 +348,11 @@ public class MaintenanceCompanyController extends BaseController {
return ResponseHelper.buildResponse(maintenanceCompanyServiceImpl.getAmosOrgIdsByIds(list));
}
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getIdByAmosOrgId")
@ApiOperation(httpMethod = "GET", value = "根据orgId查主键Id", notes = "根据orgId查主键Id")
public ResponseModel<String> getIdByAmosOrgId(@RequestParam(value = "amosOrgId", required = true) String amosOrgId) {
return ResponseHelper.buildResponse(maintenanceCompanyServiceImpl.getIdByAmosOrgId(amosOrgId));
}
}
......@@ -391,6 +391,14 @@ public class MaintenanceCompanyServiceImpl
return pegaIPage;
}
public Object amosIdExist(String amosId) {
int num = maintenanceCompanyMapper.amosIdExist(amosId);
if (num > 0) {
return false;
}
return true;
}
@Override
public IPage<Map<String, Object>> getPageMaintenanceList(Map<String, Object> paramsMap) {
if (!paramsMap.containsKey("current") && !paramsMap.containsKey("size")) {
......@@ -848,4 +856,17 @@ public class MaintenanceCompanyServiceImpl
List<String> collect = maintenanceCompanyMapper.selectList(queryWrapper).stream().map(MaintenanceCompany::getAmosId).collect(Collectors.toList());
return collect;
}
public String getIdByAmosOrgId(String amosOrgId) {
QueryWrapper<MaintenanceCompany> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().select(MaintenanceCompany::getSequenceNbr)
.eq(MaintenanceCompany::getAmosId, amosOrgId)
.groupBy(MaintenanceCompany::getSequenceNbr)
.eq(MaintenanceCompany::getIsDelete, false);
MaintenanceCompany maintenanceCompany = maintenanceCompanyMapper.selectOne(queryWrapper);
if (ObjectUtils.isEmpty(maintenanceCompany)) {
return null;
}
return String.valueOf(maintenanceCompany.getSequenceNbr());
}
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.controller;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.dto.CheckDto;
import com.yeejoin.amos.maintenance.business.feign.JCSFeignClient;
import com.yeejoin.amos.maintenance.business.param.CheckInfoPageParam;
import com.yeejoin.amos.maintenance.business.param.CheckRecordParam;
import com.yeejoin.amos.maintenance.business.param.CheckStatisticalParam;
......@@ -71,6 +72,9 @@ public class CheckController extends AbstractBaseController {
@Value("${amosRefresh.patrol.topic}")
private String patrolTopic;
@Autowired
JCSFeignClient jcsFeignClient;
/**
* 巡检计划查询
*
......@@ -501,6 +505,12 @@ public class CheckController extends AbstractBaseController {
Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity());
params.putAll(authMap);
params.put("userId", userId);
if (StringUtil.isNotEmpty(userId)) {
ResponseModel<String> idByAmosOrgId = jcsFeignClient.getIdByAmosOrgId(userId);
if (StringUtil.isNotEmpty(idByAmosOrgId.getResult())) {
params.put("userId", idByAmosOrgId.getResult());
}
}
params.put("timeType", timeType);
params.put("result", result);
if (StringUtils.isNotBlank(orderRule)) {
......
......@@ -30,4 +30,11 @@ public interface JCSFeignClient {
*/
@RequestMapping(value = "jcs/common/maintenance-company/get/amosOrgIdsByIds", method = RequestMethod.GET, consumes = "application/json")
ResponseModel<List<String>> getAmosOrgIdsByIds(@RequestParam(value = "list") List<String> list);
/**
* 根据orgId查主键Id
* @return
*/
@RequestMapping(value = "jcs/common/maintenance-company/getIdByAmosOrgId", method = RequestMethod.GET, consumes = "application/json")
ResponseModel<String> getIdByAmosOrgId(@RequestParam(value = "amosOrgId") String amosOrgId);
}
......@@ -1907,11 +1907,12 @@
pp.id pointId,
pp.equipment_id equipmentId,
pp.equipment_name equipmentName,
pp.name equipmentDetailName,
pp.belong_system_id systemId,
pp.belong_system_name systemName,
pp.address address,
pp.original_id equipId,
CONCAT_WS('',pp.building_name,pp.address) buildingName,
CONCAT_WS('-',pp.building_name,pp.address) buildingName,
pc.org_code AS orgCode
FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id
......
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