Browse Source

修改:

三个接口customerId参数的使用逻辑调整
dev_shibei_match
wangxianzhang 4 years ago
parent
commit
e3bfd50fde
  1. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  2. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java
  3. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java

@ -1,6 +1,8 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.IndexService;
@ -146,8 +148,9 @@ public class IndexController {
* @author sun
*/
@PostMapping("advancedbranchrank")
Result<List<IndexAdvanceBranchRankResultDTO>> advancedBranchRank(@RequestBody AdvancedBranchRankFormDTO formDTO){
Result<List<IndexAdvanceBranchRankResultDTO>> advancedBranchRank(@RequestBody AdvancedBranchRankFormDTO formDTO, @LoginUser TokenDto loginUser){
ValidatorUtils.validateEntity(formDTO, AdvancedBranchRankFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(loginUser.getCustomerId());
return new Result<List<IndexAdvanceBranchRankResultDTO>>().ok(indexService.advancedBranchRank(formDTO));
}

9
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java

@ -1,5 +1,7 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService;
@ -47,8 +49,10 @@ public class ScreenUserController {
* @author wxz
*/
@PostMapping("userpointrank/withoutpartymember")
public Result<List<UserPointRankListResultDTO>> userPointRankWithoutPartyMem(@RequestBody UserPointRankFormDTO formDTO) {
public Result<List<UserPointRankListResultDTO>> userPointRankWithoutPartyMem(@RequestBody UserPointRankFormDTO formDTO, @LoginUser TokenDto loginUser) {
ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(loginUser.getCustomerId());
return new Result<List<UserPointRankListResultDTO>>().ok(screenUserService.userPointRankWithoutPartyMem(formDTO));
}
@ -70,8 +74,9 @@ public class ScreenUserController {
* @author wxz
*/
@PostMapping("partypointrank")
public Result<List<PartyPointRankResultDTO>> partyPointRank(@RequestBody PartyPointRankFormDTO formDTO) {
public Result<List<PartyPointRankResultDTO>> partyPointRank(@RequestBody PartyPointRankFormDTO formDTO, @LoginUser TokenDto loginUser) {
ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(loginUser.getCustomerId());
return new Result<List<PartyPointRankResultDTO>>().ok(screenUserService.partyPointRank(formDTO));
}

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

@ -240,7 +240,7 @@
<select id="selectRankList" resultType="com.epmet.evaluationindex.screen.dto.result.IndexAdvanceBranchRankResultDTO">
SELECT
CONCAT(
(select agency_name from screen_customer_agency where agency_id = rd.parent_id),
(select agency_name from screen_customer_agency where agency_id = rd.parent_id <if test="customerId != null and customerId != ''">AND org.CUSTOMER_ID = #{customerId}</if>),
'-',
dm.org_name
)AS "name",
@ -252,7 +252,7 @@
rd.satisfaction_ratio AS "satisfactionRatio"
FROM
screen_index_data_monthly dm
INNER JOIN screen_org_rank_data rd ON dm.org_id = rd.org_id
INNER JOIN screen_org_rank_data rd ON dm.org_id = rd.org_id AND dm.CUSTOMER_ID = rd.CUSTOMER_ID
<!--查询的是网格的排行 下面条件是orgType = grid-->
INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = dm.CUSTOMER_ID AND org.GRID_ID = dm.ORG_ID AND org.DEL_FLAG = '0'

Loading…
Cancel
Save