Commit f9dbfc69 authored by zhangyingbin's avatar zhangyingbin

焊工统计接口开发

parent 382b0468
package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
public interface WelderMapper extends BaseMapper {
List<Map> welderStatistics(String bizOrgCode);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.WelderMapper">
<select id="welderStatistics" resultType="java.util.Map">
SELECT
fi.field_value AS `name`,COUNT(1) AS value
FROM
cb_org_usr AS ou
LEFT JOIN cb_dynamic_form_instance AS fi ON ou.sequence_nbr = fi.instance_id and fi.field_code = "licensedProject"
WHERE ou.org_expand_attr1 = "WELDER" AND ou.biz_org_type="PERSON" AND ou.biz_org_code LIKE CONCAT("%",#{bizOrgCode},"%")
GROUP BY fi.field_value
</select>
</mapper>
...@@ -239,4 +239,14 @@ public class WelderController extends BaseController { ...@@ -239,4 +239,14 @@ public class WelderController extends BaseController {
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
/**
* 焊工持证项目统计
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "焊工持证项目统计", notes = "焊工持证项目统计")
@GetMapping(value = "/welderStatistics")
public ResponseModel<List<Map>> welderStatistics() {
return ResponseHelper.buildResponse(welderServiceImpl.welderStatistics());
}
} }
...@@ -6,10 +6,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -6,10 +6,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto; import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project; import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource; import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource;
import com.yeejoin.amos.boot.module.ugp.api.mapper.WelderMapper;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify; import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -38,6 +41,11 @@ public class WelderServiceImpl { ...@@ -38,6 +41,11 @@ public class WelderServiceImpl {
@Value("${amos.secret.key}") @Value("${amos.secret.key}")
String secretKey; String secretKey;
@Autowired
OrgUsrServiceImpl orgUsrService;
@Autowired
WelderMapper welderMapper;
/** /**
* 获取当前登录所在单位下的项目中的所有焊工列表 * 获取当前登录所在单位下的项目中的所有焊工列表
...@@ -156,4 +164,10 @@ public class WelderServiceImpl { ...@@ -156,4 +164,10 @@ public class WelderServiceImpl {
return orgService.dataHandling(jsonObject,bizOrgType,sequenceNbr); return orgService.dataHandling(jsonObject,bizOrgType,sequenceNbr);
} }
@BusinessIdentify
public List<Map> welderStatistics() {
String bizOrgCode = orgUsrService.getById(orgService.getReginParams().getBusinessInfo().getCompanySequenceNbr()).getBizOrgCode();
return welderMapper.welderStatistics(bizOrgCode);
}
} }
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