Commit 5caa2e6d authored by chenzhao's avatar chenzhao

增加维保人员关联账户接口

parent e15e6a5e
......@@ -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
......
......@@ -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")) {
......
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