forked from rongchao/epmet-cloud-rizhao
				
			
				 29 changed files with 639 additions and 16 deletions
			
			
		| @ -0,0 +1,36 @@ | |||
| package com.epmet.dto.form.screen; | |||
| 
 | |||
| import com.epmet.commons.tools.constant.NumConstant; | |||
| import lombok.Data; | |||
| 
 | |||
| import javax.validation.constraints.NotBlank; | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  * @Author zxc | |||
|  * @DateTime 2021/6/1 3:11 下午 | |||
|  * @DESC | |||
|  */ | |||
| @Data | |||
| public class ColorProjectTotalFormDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = -6991770717583778665L; | |||
| 
 | |||
|     public interface ColorProjectTotalForm{} | |||
| 
 | |||
|     /** | |||
|      * 组织id | |||
|      */ | |||
|     @NotBlank(message = "组织ID不能为空",groups = ColorProjectTotalForm.class) | |||
|     private String agencyId; | |||
| 
 | |||
|     /** | |||
|      * 行政区域码【平阴必填】 | |||
|      */ | |||
|     private String areaCode; | |||
| 
 | |||
|     /** | |||
|      * 绿灯事件查询几个月的数据 | |||
|      */ | |||
|     private Integer monthCount = NumConstant.ONE; | |||
| } | |||
| @ -0,0 +1,27 @@ | |||
| package com.epmet.dto.form.screen; | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import javax.validation.constraints.NotBlank; | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  * @Author zxc | |||
|  * @DateTime 2021/6/2 9:42 上午 | |||
|  * @DESC | |||
|  */ | |||
| @Data | |||
| public class StreetDetailPYFormDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = -4821168326488796711L; | |||
| 
 | |||
|     public interface StreetDetailPYForm{} | |||
| 
 | |||
|     @NotBlank(message = "组织ID不能为空",groups = StreetDetailPYForm.class) | |||
|     private String agencyId; | |||
| 
 | |||
|     /** | |||
|      * 行政区域编码 平阴必填 | |||
|      */ | |||
|     private String areaCode; | |||
| } | |||
| @ -0,0 +1,48 @@ | |||
| package com.epmet.dto.result.screen; | |||
| 
 | |||
| import com.epmet.commons.tools.constant.NumConstant; | |||
| import com.fasterxml.jackson.annotation.JsonIgnore; | |||
| import lombok.Data; | |||
| 
 | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  * @Author zxc | |||
|  * @DateTime 2021/6/1 3:15 下午 | |||
|  * @DESC | |||
|  */ | |||
| @Data | |||
| public class ColorProjectTotalResultDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = -8211214262766797296L; | |||
| 
 | |||
|     /** | |||
|      * 事件总数 | |||
|      */ | |||
|     private Integer projectTotal; | |||
| 
 | |||
|     /** | |||
|      * 红灯事件总数 | |||
|      */ | |||
|     private Integer redTotal; | |||
| 
 | |||
|     /** | |||
|      * 黄灯事件总数 | |||
|      */ | |||
|     private Integer yellowTotal; | |||
| 
 | |||
|     /** | |||
|      * 绿灯事件总数 | |||
|      */ | |||
|     private Integer greenTotal; | |||
| 
 | |||
|     @JsonIgnore | |||
|     private Integer projectLevel; | |||
| 
 | |||
|     public ColorProjectTotalResultDTO() { | |||
|         this.projectTotal = NumConstant.ZERO; | |||
|         this.redTotal = NumConstant.ZERO; | |||
|         this.yellowTotal = NumConstant.ZERO; | |||
|         this.greenTotal = NumConstant.ZERO; | |||
|     } | |||
| } | |||
| @ -0,0 +1,50 @@ | |||
| package com.epmet.dto.result.screen; | |||
| 
 | |||
| import com.epmet.commons.tools.constant.NumConstant; | |||
| import lombok.Data; | |||
| 
 | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  * @Author zxc | |||
|  * @DateTime 2021/6/2 9:43 上午 | |||
|  * @DESC | |||
|  */ | |||
| @Data | |||
| public class StreetDetailPYResultDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = 663001974527694466L; | |||
| 
 | |||
|     /** | |||
|      * 组织id | |||
|      */ | |||
|     private String agencyId; | |||
| 
 | |||
|     /** | |||
|      * 组织名称 | |||
|      */ | |||
|     private String agencyName; | |||
| 
 | |||
|     /** | |||
|      * 注册党员数 | |||
|      */ | |||
|     private Integer partyMemberTotal; | |||
| 
 | |||
|     /** | |||
|      * 网格总数 | |||
|      */ | |||
|     private Integer gridTotal; | |||
| 
 | |||
|     /** | |||
|      * 网格员数 | |||
|      */ | |||
|     private Integer gridMemberTotal; | |||
| 
 | |||
|     public StreetDetailPYResultDTO() { | |||
|         this.partyMemberTotal = NumConstant.ZERO; | |||
|         this.gridTotal = NumConstant.ZERO; | |||
|         this.gridMemberTotal = NumConstant.ZERO; | |||
|         this.agencyId = ""; | |||
|         this.agencyName = ""; | |||
|     } | |||
| } | |||
| @ -0,0 +1,38 @@ | |||
| package com.epmet.datareport.controller.screen; | |||
| 
 | |||
| import com.epmet.commons.tools.utils.Result; | |||
| import com.epmet.commons.tools.validator.ValidatorUtils; | |||
| import com.epmet.datareport.service.evaluationindex.screen.PyService; | |||
| import com.epmet.dto.form.screen.StreetDetailPYFormDTO; | |||
| import com.epmet.dto.result.screen.StreetDetailPYResultDTO; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.PostMapping; | |||
| import org.springframework.web.bind.annotation.RequestBody; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| 
 | |||
| /** | |||
|  * @Author zxc | |||
|  * @DateTime 2021/6/2 9:40 上午 | |||
|  * @DESC | |||
|  */ | |||
| @RestController | |||
| @RequestMapping("pyscreen") | |||
| public class PyController { | |||
| 
 | |||
|     @Autowired | |||
|     private PyService pyService; | |||
| 
 | |||
|     /** | |||
|      * @Description  街道:注册党员数、网格数、网格员数 | |||
|      * @Param formDTO | |||
|      * @author zxc | |||
|      * @date 2021/6/2 10:07 上午 | |||
|      */ | |||
|     @PostMapping("streetdetail-py") | |||
|     public Result<StreetDetailPYResultDTO> streetDetail(@RequestBody StreetDetailPYFormDTO formDTO){ | |||
|         ValidatorUtils.validateEntity(formDTO, StreetDetailPYFormDTO.StreetDetailPYForm.class); | |||
|         return new Result<StreetDetailPYResultDTO>().ok(pyService.streetDetail(formDTO)); | |||
|     } | |||
| 
 | |||
| } | |||
| @ -0,0 +1,21 @@ | |||
| package com.epmet.datareport.service.evaluationindex.screen; | |||
| 
 | |||
| import com.epmet.dto.form.screen.StreetDetailPYFormDTO; | |||
| import com.epmet.dto.result.screen.StreetDetailPYResultDTO; | |||
| 
 | |||
| /** | |||
|  * @Author zxc | |||
|  * @DateTime 2021/6/2 10:05 上午 | |||
|  * @DESC | |||
|  */ | |||
| public interface PyService { | |||
| 
 | |||
|     /** | |||
|      * @Description  街道:注册党员数、网格数、网格员数 | |||
|      * @Param formDTO | |||
|      * @author zxc | |||
|      * @date 2021/6/2 10:07 上午 | |||
|      */ | |||
|     StreetDetailPYResultDTO streetDetail(StreetDetailPYFormDTO formDTO); | |||
| 
 | |||
| } | |||
| @ -0,0 +1,51 @@ | |||
| package com.epmet.datareport.service.evaluationindex.screen.impl; | |||
| 
 | |||
| import com.epmet.commons.dynamic.datasource.annotation.DataSource; | |||
| import com.epmet.commons.tools.exception.RenException; | |||
| import com.epmet.constant.DataSourceConstant; | |||
| import com.epmet.datareport.dao.evaluationindex.screen.ScreenUserTotalDataDao; | |||
| import com.epmet.datareport.service.evaluationindex.screen.PyService; | |||
| import com.epmet.dto.form.screen.StreetDetailPYFormDTO; | |||
| import com.epmet.dto.result.screen.StreetDetailPYResultDTO; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| 
 | |||
| /** | |||
|  * @Author zxc | |||
|  * @DateTime 2021/6/2 10:05 上午 | |||
|  * @DESC | |||
|  */ | |||
| @Slf4j | |||
| @Service | |||
| @DataSource(DataSourceConstant.EVALUATION_INDEX) | |||
| public class PyServiceImpl implements PyService { | |||
| 
 | |||
|     @Autowired | |||
|     private ScreenUserTotalDataDao screenUserTotalDataDao; | |||
| 
 | |||
|     /** | |||
|      * @Description  街道:注册党员数、网格数、网格员数 | |||
|      * @Param formDTO | |||
|      * @author zxc | |||
|      * @date 2021/6/2 10:07 上午 | |||
|      */ | |||
|     @Override | |||
|     public StreetDetailPYResultDTO streetDetail(StreetDetailPYFormDTO formDTO) { | |||
|         StreetDetailPYResultDTO result = new StreetDetailPYResultDTO(); | |||
|         if (StringUtils.isEmpty(formDTO.getAreaCode())){ | |||
|             result = screenUserTotalDataDao.selectStreetDetailByAgencyId(formDTO.getAgencyId()); | |||
|         }else { | |||
|             StreetDetailPYResultDTO eightStreet = screenUserTotalDataDao.selectStreetDetailByAreaCode(formDTO.getAreaCode()); | |||
|             result = screenUserTotalDataDao.selectStreetDetailByAgencyId(formDTO.getAgencyId()); | |||
|             if (null == result){ | |||
|                 throw new RenException("组织ID【"+formDTO.getAgencyId()+"】不存在于screen_customer_agency"); | |||
|             } | |||
|             result.setGridMemberTotal(result.getGridMemberTotal() + eightStreet.getGridMemberTotal()); | |||
|             result.setPartyMemberTotal(result.getPartyMemberTotal() + eightStreet.getPartyMemberTotal()); | |||
|             result.setGridTotal(result.getGridTotal() + eightStreet.getGridTotal()); | |||
|         } | |||
|         return result; | |||
|     } | |||
| } | |||
| @ -0,0 +1,29 @@ | |||
| package com.epmet.dto.org.result; | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import java.io.Serializable; | |||
| import java.util.List; | |||
| 
 | |||
| /** | |||
|  * 返回每个网格、每个组织下,工作人员的userId | |||
|  * | |||
|  * @author yinzuomei@elink-cn.com | |||
|  * @date 2021/6/3 9:49 | |||
|  */ | |||
| @Data | |||
| public class OrgStaffDTO implements Serializable { | |||
| 
 | |||
|     /** | |||
|      * 组织id或者网格id | |||
|      */ | |||
|     private String orgId; | |||
|     /** | |||
|      * agency or grid | |||
|      */ | |||
|     private String orgType; | |||
|     /** | |||
|      * 当前组织或者当前网格下的: | |||
|      */ | |||
|     private List<String> staffIds; | |||
| } | |||
| @ -0,0 +1,4 @@ | |||
| -- 为了平阴大屏,显示网格员数,screen_user_total_data 新增GRID_MEMBER_TOTAL | |||
| 
 | |||
| -- epmet_evaluation_index 、 epmet_data_statistical_display  库执行以下: | |||
| ALTER TABLE screen_user_total_data ADD COLUMN `GRID_MEMBER_TOTAL` INT ( 11 ) NOT NULL DEFAULT '0' COMMENT '06.01新增:orgType=agency或者grid的时候,此列赋值:当前组织或者当前网格内的网格员人数' AFTER PROJECT_TOTAL; | |||
					Loading…
					
					
				
		Reference in new issue