新增我的未认领企业
This commit is contained in:
parent
5e022f534f
commit
ce21ccdd0f
@ -139,7 +139,7 @@ public class EnterpriseOfGridOperatorAppController extends AbstractController {
|
||||
return enterpriseOfGridOperatorService.listPageEnterpriseOfGridOperatorOfMine(token, page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计我的企业", notes = "统计我的企业解耦")
|
||||
@ApiOperation(value = "统计我的企业", notes = "统计我的企业接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
})
|
||||
@ -167,4 +167,32 @@ public class EnterpriseOfGridOperatorAppController extends AbstractController {
|
||||
return enterpriseOfGridOperatorService.listPageEnterpriseOfGridOperatorByUserId(userId, page);
|
||||
}
|
||||
|
||||
// Unclaimed
|
||||
@ApiOperation(value = "我的未认领企业分页列表", notes = "我的未认领企业分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "form", dataType = "Integer", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "form", dataType = "Integer", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "form", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "form", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "form", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpageunclaimedenterpriseofmine")
|
||||
public SuccessResultList<List<EnterpriseOfGridOperatorDTO>> listPageUnclaimedEnterpriseOfMine(@RequestHeader("token") String token, ListPage page) throws SearchException {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return enterpriseOfGridOperatorService.listPageUnclaimedEnterpriseOfMine(token, page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计我的未认领企业", notes = "统计我的未认领企业接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("countunclaimedenterpriseofmine")
|
||||
public SuccessResultData<Integer> countUnclaimedEnterpriseOfMine(@RequestHeader("token") String token) {
|
||||
return enterpriseOfGridOperatorService.countUnclaimedEnterpriseOfMine(token);
|
||||
}
|
||||
|
||||
}
|
@ -107,4 +107,22 @@ public interface IEnterpriseOfGridOperatorDao {
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<GridPersonnelDTO> listGridPersonnel(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 未认领企业列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<EnterpriseOfGridOperatorDTO> listUnclaimedEnterprise(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 统计未认领企业
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
Integer countUnclaimedEnterprise(Map<String, Object> params) throws SearchException;
|
||||
}
|
||||
|
@ -190,4 +190,22 @@ public interface IEnterpriseOfGridOperatorService {
|
||||
*/
|
||||
List<GridPersonnelDTO> listGridPersonnel(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 我的未认领企业分页列表
|
||||
*
|
||||
* @param token
|
||||
* @param page
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
SuccessResultList<List<EnterpriseOfGridOperatorDTO>> listPageUnclaimedEnterpriseOfMine(String token, ListPage page) throws SearchException;
|
||||
|
||||
/**
|
||||
* 统计我的未认领企业
|
||||
*
|
||||
* @param token
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
SuccessResultData<Integer> countUnclaimedEnterpriseOfMine(String token) throws SearchException;
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import com.cm.common.result.SuccessResultData;
|
||||
import com.cm.common.result.SuccessResultList;
|
||||
import com.cm.common.token.app.AppTokenManager;
|
||||
import com.cm.common.token.app.entity.AppToken;
|
||||
import com.cm.common.token.app.entity.AppTokenUser;
|
||||
import com.cm.common.utils.HashMapUtil;
|
||||
import com.cm.common.utils.UUIDUtil;
|
||||
import com.cm.inspection.dao.enterpriseofgridoperator.IEnterpriseOfGridOperatorDao;
|
||||
@ -19,6 +20,7 @@ import com.cm.inspection.pojo.dtos.gridpersonnel.GridPersonnelDTO;
|
||||
import com.cm.inspection.pojo.vos.enterpriseofgridoperator.EnterpriseOfGridOperatorVO;
|
||||
import com.cm.inspection.service.BaseService;
|
||||
import com.cm.inspection.service.enterpriseofgridoperator.IEnterpriseOfGridOperatorService;
|
||||
import com.cm.inspection.service.gridpersonnel.IGridPersonnelService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -41,6 +43,8 @@ public class EnterpriseOfGridOperatorServiceImpl extends BaseService implements
|
||||
private IEnterpriseOfGridOperatorDao enterpriseOfGridOperatorDao;
|
||||
@Autowired
|
||||
private SecurityComponent securityComponent;
|
||||
@Autowired
|
||||
private IGridPersonnelService gridPersonnelService;
|
||||
|
||||
@Override
|
||||
public SuccessResult saveEnterpriseOfGridOperator(EnterpriseOfGridOperatorVO enterpriseOfGridOperatorVO) throws Exception {
|
||||
@ -219,6 +223,35 @@ public class EnterpriseOfGridOperatorServiceImpl extends BaseService implements
|
||||
return enterpriseOfGridOperatorDao.listGridPersonnel(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<EnterpriseOfGridOperatorDTO>> listPageUnclaimedEnterpriseOfMine(String token, ListPage page) throws SearchException {
|
||||
String userId = AppTokenManager.getInstance().getToken(token).getAppTokenUser().getId();
|
||||
GridPersonnelDTO gridPersonnelDTO = gridPersonnelService.getGridPersonnelByUserId(userId);
|
||||
page.getParams().put("area1", gridPersonnelDTO.getArea1());
|
||||
page.getParams().put("area2", gridPersonnelDTO.getArea2());
|
||||
page.getParams().put("area3", gridPersonnelDTO.getArea3());
|
||||
page.getParams().put("area4", gridPersonnelDTO.getArea4());
|
||||
page.getParams().put("area5", gridPersonnelDTO.getArea5());
|
||||
PageHelper.startPage(page.getPage(), page.getRows());
|
||||
List<EnterpriseOfGridOperatorDTO> enterpriseOfGridOperatorDTOs = enterpriseOfGridOperatorDao.listUnclaimedEnterprise(page.getParams());
|
||||
PageInfo<EnterpriseOfGridOperatorDTO> pageInfo = new PageInfo<>(enterpriseOfGridOperatorDTOs);
|
||||
return new SuccessResultList<>(enterpriseOfGridOperatorDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultData<Integer> countUnclaimedEnterpriseOfMine(String token) throws SearchException {
|
||||
String userId = AppTokenManager.getInstance().getToken(token).getAppTokenUser().getId();
|
||||
GridPersonnelDTO gridPersonnelDTO = gridPersonnelService.getGridPersonnelByUserId(userId);
|
||||
Map<String, Object> params = getHashMap(5);
|
||||
params.put("area1", gridPersonnelDTO.getArea1());
|
||||
params.put("area2", gridPersonnelDTO.getArea2());
|
||||
params.put("area3", gridPersonnelDTO.getArea3());
|
||||
params.put("area4", gridPersonnelDTO.getArea4());
|
||||
params.put("area5", gridPersonnelDTO.getArea5());
|
||||
Integer countResult = enterpriseOfGridOperatorDao.countUnclaimedEnterprise(params);
|
||||
return new SuccessResultData<>(countResult == null ? 0 : countResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 网格员的企业分页列表(通过用户)
|
||||
*
|
||||
|
@ -147,4 +147,12 @@ public interface IGridPersonnelService {
|
||||
*/
|
||||
SuccessResultData<Integer> countGridPersonnel(Map<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 网格员详情(通过用户ID)
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
GridPersonnelDTO getGridPersonnelByUserId(String userId) throws SearchException;
|
||||
}
|
||||
|
@ -178,4 +178,11 @@ public class GridPersonnelServiceImpl extends BaseService implements IGridPerson
|
||||
return new SuccessResultData<>(countResult == null ? 0 : countResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GridPersonnelDTO getGridPersonnelByUserId(String userId) throws SearchException {
|
||||
Map<String, Object> params = getHashMap(1);
|
||||
params.put("userId", userId);
|
||||
return gridPersonnelDao.getGridPersonnel(params);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -477,4 +477,119 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 未认领企业列表 -->
|
||||
<select id="listUnclaimedEnterprise" parameterType="map" resultMap="enterpriseOfGridOperatorDTO">
|
||||
SELECT
|
||||
t1.enterprise_id,
|
||||
t1.name name_join_by_enterprise_id,
|
||||
t1.type type_join_by_enterprise_id,
|
||||
t1.type_dictionary_name,
|
||||
t1.area1 area1_join_by_enterprise_id,
|
||||
t1.area1_dictionary_name,
|
||||
t1.area2 area2_join_by_enterprise_id,
|
||||
t1.area2_dictionary_name,
|
||||
t1.area3 area3_join_by_enterprise_id,
|
||||
t1.area3_dictionary_name,
|
||||
t1.area4 area4_join_by_enterprise_id,
|
||||
t1.area4_dictionary_name,
|
||||
t1.area5 area5_join_by_enterprise_id,
|
||||
t1.area5_dictionary_name,
|
||||
t1.address address_join_by_enterprise_id,
|
||||
t1.industry_type indzustry_type_join_by_enterprise_id,
|
||||
t1.industry_type_dictionary_name,
|
||||
t1.industry industry_join_by_enterprise_id,
|
||||
t1.industry_dictionary_name,
|
||||
t1.engaged_count engaged_count_join_by_enterprise_id,
|
||||
t1.risk_operation risk_operation_join_by_enterprise_id,
|
||||
t1.risk_operation_dictionary_name,
|
||||
t1.legal_person,
|
||||
t1.master master_join_by_enterprise_id,
|
||||
t1.phone phone_join_by_enterprise_id,
|
||||
t1.classify classify_by_enterprise_id,
|
||||
t1.classify_dictionary_name,
|
||||
t1.nature nature_by_enterprise_id,
|
||||
t1.nature_dictionary_name,
|
||||
t1.is_log_off is_log_off_by_enterprise_id
|
||||
FROM
|
||||
gen_enterprise t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
AND
|
||||
t1.enterprise_id NOT IN (
|
||||
SELECT
|
||||
wt1.enterprise_id
|
||||
FROM
|
||||
gen_enterprise_of_grid_operator wt1
|
||||
GROUP BY
|
||||
wt1.enterprise_id
|
||||
)
|
||||
<if test="area1 != null and area1 != ''">
|
||||
AND
|
||||
t1.area1 = #{area1}
|
||||
</if>
|
||||
<if test="area2 != null and area2 != ''">
|
||||
AND
|
||||
t1.area2 = #{area2}
|
||||
</if>
|
||||
<if test="area3 != null and area3 != ''">
|
||||
AND
|
||||
t1.area3 = #{area3}
|
||||
</if>
|
||||
<if test="area4 != null and area4 != ''">
|
||||
AND
|
||||
t1.area4 = #{area4}
|
||||
</if>
|
||||
<if test="area5 != null and area5 != ''">
|
||||
AND
|
||||
t1.area5 = #{area5}
|
||||
</if>
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND
|
||||
t1.name LIKE CONCAT('%', #{keywords}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 统计未认领企业 -->
|
||||
<select id="countUnclaimedEnterprise" parameterType="map" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
gen_enterprise t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
AND
|
||||
t1.enterprise_id NOT IN (
|
||||
SELECT
|
||||
wt1.enterprise_id
|
||||
FROM
|
||||
gen_enterprise_of_grid_operator wt1
|
||||
GROUP BY
|
||||
wt1.enterprise_id
|
||||
)
|
||||
<if test="area1 != null and area1 != ''">
|
||||
AND
|
||||
t1.area1 = #{area1}
|
||||
</if>
|
||||
<if test="area2 != null and area2 != ''">
|
||||
AND
|
||||
t1.area2 = #{area2}
|
||||
</if>
|
||||
<if test="area3 != null and area3 != ''">
|
||||
AND
|
||||
t1.area3 = #{area3}
|
||||
</if>
|
||||
<if test="area4 != null and area4 != ''">
|
||||
AND
|
||||
t1.area4 = #{area4}
|
||||
</if>
|
||||
<if test="area5 != null and area5 != ''">
|
||||
AND
|
||||
t1.area5 = #{area5}
|
||||
</if>
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND
|
||||
t1.name LIKE CONCAT('%', #{keywords}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -141,6 +141,10 @@
|
||||
AND
|
||||
t1.grid_personnel_id = #{gridPersonnelId}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
AND
|
||||
t1.user_id LIKE CONCAT(#{userId}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 网格人员列表 -->
|
||||
|
Loading…
Reference in New Issue
Block a user