Browse Source

补充查询条件

master
HAHA 3 years ago
parent
commit
4f78a9d596
  1. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyTypepercentFormDTO.java
  2. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
  3. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java
  4. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  5. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml
  6. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyPieFormDTO.java
  7. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java
  8. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyTypepercentFormDTO.java

@ -19,4 +19,6 @@ public class PartyTypepercentFormDTO {
*/ */
@NotBlank(message = "组织id不能为空") @NotBlank(message = "组织id不能为空")
private String agencyId; private String agencyId;
private String customerId;
} }

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java

@ -260,7 +260,8 @@ public class IcPartyUnitController {
* @date 2022/5/18 16:42 * @date 2022/5/18 16:42
*/ */
@PostMapping("/statistics/typepercent") @PostMapping("/statistics/typepercent")
public Result<List<PartyTypepercentResultDTO>> getTypepercent(@RequestBody PartyTypepercentFormDTO form) { public Result<List<PartyTypepercentResultDTO>> getTypepercent(@RequestBody PartyTypepercentFormDTO form,@LoginUser TokenDto tokenDto) {
form.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(form); ValidatorUtils.validateEntity(form);
List<PartyTypepercentResultDTO> dto = icPartyUnitService.getTypepercent(form); List<PartyTypepercentResultDTO> dto = icPartyUnitService.getTypepercent(form);
return new Result<List<PartyTypepercentResultDTO>>().ok(dto); return new Result<List<PartyTypepercentResultDTO>>().ok(dto);

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java

@ -88,5 +88,6 @@ public interface IcPartyUnitDao extends BaseDao<IcPartyUnitEntity> {
* *
* @param agencyId * @param agencyId
*/ */
List<PartyTypepercentResultDTO> getTypepercent(@Param("agencyId") String agencyId); List<PartyTypepercentResultDTO> getTypepercent(@Param("agencyId") String agencyId,
@Param("customerId") String customerId);
} }

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -631,7 +631,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
throw new EpmetException(dictResult.getCode()); throw new EpmetException(dictResult.getCode());
} }
List<PartyTypepercentResultDTO> result = baseDao.getTypepercent(form.getAgencyId()); List<PartyTypepercentResultDTO> result = baseDao.getTypepercent(form.getAgencyId(),form.getCustomerId());
Map<String, Integer> map = result.stream().collect(Collectors.toMap(PartyTypepercentResultDTO::getCode, PartyTypepercentResultDTO::getValue)); Map<String, Integer> map = result.stream().collect(Collectors.toMap(PartyTypepercentResultDTO::getCode, PartyTypepercentResultDTO::getValue));
int sum = result.stream().mapToInt(PartyTypepercentResultDTO::getValue).sum(); int sum = result.stream().mapToInt(PartyTypepercentResultDTO::getValue).sum();

1
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml

@ -121,6 +121,7 @@
WHERE WHERE
a.DEL_FLAG = '0' a.DEL_FLAG = '0'
AND a.AGENCY_ID = #{agencyId} AND a.AGENCY_ID = #{agencyId}
AND a.CUSTOMER_ID = #{customerId}
GROUP BY GROUP BY
a.type a.type
</select> </select>

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyPieFormDTO.java

@ -2,6 +2,7 @@ package com.epmet.dto.form;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
@Data @Data
@ -9,6 +10,7 @@ public class VolunteerPolyPieFormDTO implements Serializable {
private static final long serialVersionUID = 6284245738483042805L; private static final long serialVersionUID = 6284245738483042805L;
@NotBlank(message = "agencyId必填")
private String agencyId; private String agencyId;
private String customerId; private String customerId;

4
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java

@ -144,7 +144,9 @@ public class IcVolunteerPolyController {
* @date 2022/5/19 17:21 * @date 2022/5/19 17:21
*/ */
@PostMapping("statistics") @PostMapping("statistics")
public Result<List<VolunteerPolyPieResultDTO>> getStatistics(@RequestBody VolunteerPolyPieFormDTO form) { public Result<List<VolunteerPolyPieResultDTO>> getStatistics(@RequestBody VolunteerPolyPieFormDTO form,@LoginUser TokenDto tokenDto) {
form.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(form);
List<VolunteerPolyPieResultDTO> dto = icVolunteerPolyService.getStatistics(form); List<VolunteerPolyPieResultDTO> dto = icVolunteerPolyService.getStatistics(form);
return new Result<List<VolunteerPolyPieResultDTO>>().ok(dto); return new Result<List<VolunteerPolyPieResultDTO>>().ok(dto);
} }

2
epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml

@ -64,6 +64,8 @@
FROM FROM
ic_volunteer_poly p ic_volunteer_poly p
LEFT JOIN ic_volunteer_poly_category c ON p.ID_CARD = c.ID_CARD LEFT JOIN ic_volunteer_poly_category c ON p.ID_CARD = c.ID_CARD
where
p.CUSTOMER_ID = #{customerId}
GROUP BY GROUP BY
c.VOLUNTEER_CATEGORY c.VOLUNTEER_CATEGORY
</select> </select>

Loading…
Cancel
Save