Browse Source
# Conflicts: # esua-epdc/epdc-gateway/pom.xml # esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/enterprisereport/service/impl/EnterpriseReportServiceImpl.javafeature/screenDataPush
98 changed files with 4571 additions and 210 deletions
@ -0,0 +1,141 @@ |
|||
package com.elink.esua.epdc.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 组织治理指数(天) |
|||
* |
|||
* @author zhy |
|||
* @date 2021/6/28 9:28 |
|||
*/ |
|||
@Data |
|||
public class ScreenAgencyGovernDailyResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -4035893591086943602L; |
|||
|
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* agency_id所属的机关级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) |
|||
*/ |
|||
private String level; |
|||
|
|||
/** |
|||
* 上级组织Id |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 网格所有上级id |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 日期ID |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 界面展示:问题解决总数=1+2+3+4+5+6+7+8 |
|||
*/ |
|||
private Integer problemResolvedCount; |
|||
|
|||
/** |
|||
* 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数 |
|||
*/ |
|||
private String groupSelfGovernRatio; |
|||
|
|||
/** |
|||
* 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数 |
|||
*/ |
|||
private String gridSelfGovernRatio; |
|||
|
|||
/** |
|||
* 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 |
|||
*/ |
|||
private String communityClosedRatio; |
|||
|
|||
/** |
|||
* 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 |
|||
*/ |
|||
private String streetClosedRatio; |
|||
|
|||
/** |
|||
* 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 |
|||
*/ |
|||
private String districtDeptClosedRatio; |
|||
|
|||
/** |
|||
* 1、当前组织内,话题关闭已解决数 |
|||
*/ |
|||
private Integer topicResolvedCount; |
|||
|
|||
/** |
|||
* 2、当前组织内,话题关闭无需解决数 |
|||
*/ |
|||
private Integer topicUnResolvedCount; |
|||
|
|||
/** |
|||
* 3、当前组织内,议题关闭已解决数 |
|||
*/ |
|||
private Integer issueResolvedCount; |
|||
|
|||
/** |
|||
* 4、当前组织内,议题关闭无需解决数 |
|||
*/ |
|||
private Integer issueUnResolvedCount; |
|||
|
|||
/** |
|||
* 5、当前组织内:来源于议题的项目:结案已解决数 |
|||
*/ |
|||
private Integer issueProjectResolvedCount; |
|||
|
|||
/** |
|||
* 6、当前组织内:来源于议题的项目:结案无需解决数 |
|||
*/ |
|||
private Integer issueProjectUnResolvedCount; |
|||
|
|||
/** |
|||
* 7、当前组织内:项目立项,结案已解决数;默认为0, |
|||
*/ |
|||
private Integer approvalProjectResolvedCount; |
|||
|
|||
/** |
|||
* 8、当前组织内:项目立项,结案无需解决数;默认为0, |
|||
*/ |
|||
private Integer approvalProjectUnResolvedCount; |
|||
|
|||
/** |
|||
* 9、当前组织内,未出小组即未转议题的:话题关闭已解决数 |
|||
*/ |
|||
private Integer inGroupTopicResolvedCount; |
|||
|
|||
/** |
|||
* 10、当前组织内,未出小组即未转议题的:话题关闭无需解决数 |
|||
*/ |
|||
private Integer inGroupTopicUnResolvedCount; |
|||
|
|||
/** |
|||
* 11、未出当前组织的,结案项目数 |
|||
*/ |
|||
private Integer gridSelfGovernProjectTotal; |
|||
|
|||
/** |
|||
* 当前组织内出来的项目:由社区结案(已解决+未解决)的项目总数 |
|||
*/ |
|||
private Integer communityClosedCount; |
|||
|
|||
/** |
|||
* 当前组织内出来的项目:由街道结案(已解决+未解决)的项目总数 |
|||
*/ |
|||
private Integer streetClosedCount; |
|||
|
|||
/** |
|||
* 当前组织内出来的项目:由区直部门(已解决+未解决)结案的项目总数 |
|||
*/ |
|||
private Integer districtDeptClosedCount; |
|||
} |
|||
@ -0,0 +1,106 @@ |
|||
package com.elink.esua.epdc.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 治理能力排行数据(按日统计)数据 |
|||
* |
|||
* @author zhy |
|||
* @date 2021/6/28 9:28 |
|||
*/ |
|||
@Data |
|||
public class ScreenGovernRankDataDailyResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -4035893591086943602L; |
|||
|
|||
/** |
|||
* 组织Id 可以为网格,机关id |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* 组织类别 agency:组织;部门:department;网格:grid |
|||
*/ |
|||
private String orgType; |
|||
|
|||
/** |
|||
* 上级组织Id |
|||
*/ |
|||
private String parentId; |
|||
|
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
private String orgName; |
|||
|
|||
/** |
|||
* 日期ID |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 月ID |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 年ID |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 响应率,最大值100,保留小数点后4位 |
|||
*/ |
|||
private String responseRatio; |
|||
|
|||
/** |
|||
* 响应数 |
|||
*/ |
|||
private Integer responseCount; |
|||
|
|||
/** |
|||
* 项目转入次数 |
|||
*/ |
|||
private Integer transferCount; |
|||
|
|||
/** |
|||
* 解决率 最大值100,保留小数点后4位 |
|||
*/ |
|||
private String resolvedRatio; |
|||
|
|||
/** |
|||
* 解决项目数 |
|||
*/ |
|||
private Integer resolvedCount; |
|||
|
|||
/** |
|||
* 已关闭项目数 |
|||
*/ |
|||
private Integer closedCount; |
|||
|
|||
/** |
|||
* 自治率 最大值100,保留小数点后4位 |
|||
*/ |
|||
private String governRatio; |
|||
|
|||
/** |
|||
* 自治项目数 |
|||
*/ |
|||
private Integer governCount; |
|||
|
|||
/** |
|||
* 满意率,最大值100,保留小数点后四位 |
|||
*/ |
|||
private String satisfactionRatio; |
|||
|
|||
/** |
|||
* 满意项目数 |
|||
*/ |
|||
private Integer satisfactionCount; |
|||
|
|||
/** |
|||
* 已关闭项目(由议题转的项目)数 |
|||
*/ |
|||
private Integer closedProjectCount; |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
package com.elink.esua.epdc.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhy |
|||
* @date 2021/6/28 14:12 |
|||
*/ |
|||
@Data |
|||
public class ScreenGovernanceResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -4696640703716250973L; |
|||
} |
|||
@ -0,0 +1,156 @@ |
|||
package com.elink.esua.epdc.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 网格治理指数(天) |
|||
* |
|||
* @author zhy |
|||
* @date 2021/6/28 9:28 |
|||
*/ |
|||
@Data |
|||
public class ScreenGridGovernDailyResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -4035893591086943602L; |
|||
|
|||
/** |
|||
* 组织Id 可以为网格,机关id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 上级组织Id |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 网格所有上级id |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 日期ID |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 界面展示:问题解决总数=1+2+3+4+5+6+7+8 |
|||
*/ |
|||
private Integer problemResolvedCount; |
|||
|
|||
/** |
|||
* 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数 |
|||
*/ |
|||
private String groupSelfGovernRatio; |
|||
|
|||
/** |
|||
* 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数 |
|||
*/ |
|||
private String gridSelfGovernRatio; |
|||
|
|||
/** |
|||
* 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 |
|||
*/ |
|||
private String communityClosedRatio; |
|||
|
|||
/** |
|||
* 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 |
|||
*/ |
|||
private String streetClosedRatio; |
|||
|
|||
/** |
|||
* 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 |
|||
*/ |
|||
private String districtDeptClosedRatio; |
|||
|
|||
/** |
|||
* 1、当前网格内,话题关闭已解决数 |
|||
*/ |
|||
private Integer topicResolvedCount; |
|||
|
|||
/** |
|||
* 2、当前网格内,话题关闭无需解决数 |
|||
*/ |
|||
private Integer topicUnResolvedCount; |
|||
|
|||
/** |
|||
* 3、当前网格内,议题关闭已解决数 |
|||
*/ |
|||
private Integer issueResolvedCount; |
|||
|
|||
/** |
|||
* 4、当前网格内,议题关闭无需解决数 |
|||
*/ |
|||
private Integer issueUnResolvedCount; |
|||
|
|||
/** |
|||
* 5、当前网格内:来源于议题的项目:结案已解决数 |
|||
*/ |
|||
private Integer issueProjectResolvedCount; |
|||
|
|||
/** |
|||
* 6、当前网格内:来源于议题的项目:结案无需解决数 |
|||
*/ |
|||
private Integer issueProjectUnResolvedCount; |
|||
|
|||
/** |
|||
* 7、当前网格内:项目立项,结案已解决数;默认为0, |
|||
*/ |
|||
private Integer approvalProjectResolvedCount; |
|||
|
|||
/** |
|||
* 8、当前网格内:项目立项,结案无需解决数;默认为0, |
|||
*/ |
|||
private Integer approvalProjectUnResolvedCount; |
|||
|
|||
/** |
|||
* 9、当前网格内,未出小组即未转议题的:话题关闭已解决数 |
|||
*/ |
|||
private Integer inGroupTopicResolvedCount; |
|||
|
|||
/** |
|||
* 10、当前网格内,未出小组即未转议题的:话题关闭无需解决数 |
|||
*/ |
|||
private Integer inGroupTopicUnResolvedCount; |
|||
|
|||
/** |
|||
* 11、来源于议题的项目,未出网格结案并且已解决的项目数 |
|||
*/ |
|||
private Integer fromIssueResolvedInGridCount; |
|||
|
|||
/** |
|||
* 12、来源于议题的项目,未出网格结案并且无需解决的项目数 |
|||
*/ |
|||
private Integer fromIssueUnResolvedInGridCount; |
|||
|
|||
/** |
|||
* 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0 |
|||
*/ |
|||
private Integer fromAgencyResolvedInGridCount; |
|||
|
|||
/** |
|||
* 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0 |
|||
*/ |
|||
private Integer fromAgencyUnResolvedInGridCount; |
|||
|
|||
/** |
|||
* 15、未出当前网格的,结案项目数=11+12+13+14 |
|||
*/ |
|||
private Integer gridSelfGovernProjectTotal; |
|||
|
|||
/** |
|||
* 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 |
|||
*/ |
|||
private Integer communityClosedCount; |
|||
|
|||
/** |
|||
* 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 |
|||
*/ |
|||
private Integer streetClosedCount; |
|||
|
|||
/** |
|||
* 当前网格内出来的项目:由区直部门(已解决+未解决)结案的项目总数 |
|||
*/ |
|||
private Integer districtDeptClosedCount; |
|||
} |
|||
@ -0,0 +1,70 @@ |
|||
package com.elink.esua.epdc.modules.screen.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.screen.form.ScreenJobFormDTO; |
|||
import com.elink.esua.epdc.modules.screen.service.ScreenGovernanceService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
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 zhy |
|||
* @date 2021/6/28 11:07 |
|||
*/ |
|||
@Slf4j |
|||
@RestController |
|||
@RequestMapping("data/stats/governance") |
|||
public class ScreenGovernanceController { |
|||
|
|||
@Autowired |
|||
private ScreenGovernanceService screenGovernanceService; |
|||
|
|||
/** |
|||
* 01、治理能力排行数据(按日统计)数据 |
|||
* |
|||
* @param |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* @author zhy |
|||
* @date 2021/6/28 11:05 |
|||
*/ |
|||
@PostMapping("governrankdatadaily") |
|||
public Result governrankdatadaily(@RequestBody ScreenJobFormDTO formDto) { |
|||
log.info("<governrankdatadaily|治理能力排行数据(按日统计)数据>定时任务执行"); |
|||
return screenGovernanceService.governrankdatadaily(formDto); |
|||
} |
|||
|
|||
/** |
|||
* 02、网格治理指数(天) |
|||
* |
|||
* @param |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* @author zhy |
|||
* @date 2021/6/28 11:05 |
|||
*/ |
|||
@PostMapping("gridgoverndaily") |
|||
public Result gridgoverndaily(@RequestBody ScreenJobFormDTO formDto) { |
|||
log.info("<gridgoverndaily|网格治理指数(天)>定时任务执行"); |
|||
return screenGovernanceService.gridgoverndaily(formDto); |
|||
} |
|||
|
|||
/** |
|||
* 03、组织治理指数(天) |
|||
* |
|||
* @param |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* @author zhy |
|||
* @date 2021/6/28 11:05 |
|||
*/ |
|||
@PostMapping("agencygoverndaily") |
|||
public Result agencygoverndaily(@RequestBody ScreenJobFormDTO formDto) { |
|||
log.info("<agencygoverndaily|组织治理指数(天)>定时任务执行"); |
|||
return screenGovernanceService.agencygoverndaily(formDto); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
package com.elink.esua.epdc.modules.screen.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.dto.SysDeptDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.ScreenAgencyGovernDailyResultDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.ScreenGovernRankDataDailyResultDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.ScreenGovernanceResultDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.ScreenGridGovernDailyResultDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author zhy |
|||
* @date 2021/6/28 14:04 |
|||
*/ |
|||
@Mapper |
|||
public interface ScreenGovernanceDao extends BaseDao<ScreenGovernanceResultDTO> { |
|||
|
|||
/** |
|||
* 获取街道列表 |
|||
* |
|||
* @param |
|||
* @return java.util.List<com.elink.esua.epdc.dto.SysDeptDTO> |
|||
* @author zhy |
|||
* @date 2021/8/16 17:11 |
|||
*/ |
|||
List<SysDeptDTO> getStreetList(); |
|||
|
|||
/** |
|||
* 治理能力排行数据(按日统计)数据 |
|||
* 网格统计 |
|||
* |
|||
* @param |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.ScreenGovernRankDataDailyResultDTO> |
|||
* @author zhy |
|||
* @date 2021/6/28 14:06 |
|||
*/ |
|||
List<ScreenGovernRankDataDailyResultDTO> governrankdatadaily(); |
|||
|
|||
/** |
|||
* 治理能力排行数据(按日统计)数据 |
|||
* 组织统计 |
|||
* |
|||
* @param |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.ScreenGovernRankDataDailyResultDTO> |
|||
* @author zhy |
|||
* @date 2021/6/28 14:06 |
|||
*/ |
|||
List<ScreenGovernRankDataDailyResultDTO> governrankdatadailyAgency(); |
|||
|
|||
/** |
|||
* 治理能力排行数据(按日统计)数据 |
|||
* 未响应数 |
|||
* |
|||
* @param |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.ScreenGovernRankDataDailyResultDTO> |
|||
* @author zhy |
|||
* @date 2021/6/28 14:06 |
|||
*/ |
|||
List<ScreenGovernRankDataDailyResultDTO> governrankdatadailyNoResp(); |
|||
|
|||
/** |
|||
* 网格治理指数(天) |
|||
* |
|||
* @param |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.ScreenGridGovernDailyResultDTO> |
|||
* @author zhy |
|||
* @date 2021/8/13 17:55 |
|||
*/ |
|||
List<ScreenGridGovernDailyResultDTO> gridgoverndaily(); |
|||
|
|||
|
|||
/** |
|||
* 组织治理指数(天) |
|||
* |
|||
* @param |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.ScreenGridGovernDailyResultDTO> |
|||
* @author zhy |
|||
* @date 2021/8/13 17:55 |
|||
*/ |
|||
List<ScreenAgencyGovernDailyResultDTO> agencygoverndaily(); |
|||
|
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
package com.elink.esua.epdc.modules.screen.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.screen.form.ScreenJobFormDTO; |
|||
|
|||
/** |
|||
* 治理能力数据推送 |
|||
* |
|||
* @author zhy |
|||
* @date 2021/6/28 13:51 |
|||
*/ |
|||
public interface ScreenGovernanceService { |
|||
|
|||
/** |
|||
* 01、治理能力排行数据(按日统计)数据 |
|||
* |
|||
* @param |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* @author zhy |
|||
* @date 2021/6/28 13:47 |
|||
*/ |
|||
Result governrankdatadaily(ScreenJobFormDTO formDto); |
|||
|
|||
/** |
|||
* 02、网格治理指数(天) |
|||
* |
|||
* @param |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* @author zhy |
|||
* @date 2021/6/28 13:47 |
|||
*/ |
|||
Result gridgoverndaily(ScreenJobFormDTO formDto); |
|||
|
|||
/** |
|||
* 03、组织治理指数(天) |
|||
* |
|||
* @param |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* @author zhy |
|||
* @date 2021/6/28 13:47 |
|||
*/ |
|||
Result agencygoverndaily(ScreenJobFormDTO formDto); |
|||
|
|||
} |
|||
@ -0,0 +1,145 @@ |
|||
package com.elink.esua.epdc.modules.screen.service.impl; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.constant.EpmetConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.DateUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.SysDeptDTO; |
|||
import com.elink.esua.epdc.dto.screen.form.ScreenJobFormDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.ScreenAgencyGovernDailyResultDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.ScreenGovernRankDataDailyResultDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.ScreenGovernanceResultDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.ScreenGridGovernDailyResultDTO; |
|||
import com.elink.esua.epdc.modules.screen.dao.ScreenGovernanceDao; |
|||
import com.elink.esua.epdc.modules.screen.service.ScreenGovernanceService; |
|||
import com.elink.esua.epdc.utils.EpmetUtils; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.text.DecimalFormat; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
|
|||
|
|||
/** |
|||
* 治理能力数据推送 |
|||
* |
|||
* @author zhy |
|||
* @date 2021/6/28 13:51 |
|||
*/ |
|||
@Service |
|||
public class ScreenGovernanceServiceImpl extends BaseServiceImpl<ScreenGovernanceDao, ScreenGovernanceResultDTO> implements ScreenGovernanceService { |
|||
|
|||
@Autowired |
|||
private EpmetUtils epmetUtils; |
|||
|
|||
@Value("${epmet.config.customerId}") |
|||
private String EPMET_CONFIG_CUSTOMER_ID; |
|||
|
|||
@Override |
|||
public Result governrankdatadaily(ScreenJobFormDTO formDto) { |
|||
String yearMonthDay = DateUtils.formatNoSplit(DateUtils.addDateDays(new Date(), -1)); |
|||
|
|||
List<ScreenGovernRankDataDailyResultDTO> data = baseDao.governrankdatadaily(); |
|||
List<ScreenGovernRankDataDailyResultDTO> agencyData = baseDao.governrankdatadailyAgency(); |
|||
List<ScreenGovernRankDataDailyResultDTO> noRespData = baseDao.governrankdatadailyNoResp(); |
|||
List<SysDeptDTO> streetList = baseDao.getStreetList(); |
|||
|
|||
// 处理未响应和项目转入次数
|
|||
noRespHandle(data, noRespData); |
|||
noRespHandle(agencyData, noRespData); |
|||
|
|||
// 社区数据需要在本身基础上再加上网格的合计
|
|||
data.forEach(item -> { |
|||
Optional<ScreenGovernRankDataDailyResultDTO> agencyOptional = agencyData.stream().filter(agency -> agency.getOrgId().equals(item.getParentId())).findFirst(); |
|||
if (agencyOptional.isPresent()) { |
|||
ScreenGovernRankDataDailyResultDTO agencyResult = agencyOptional.get(); |
|||
agencyResult.setResponseCount(agencyResult.getResponseCount() + item.getResponseCount()); |
|||
agencyResult.setTransferCount(agencyResult.getTransferCount() + item.getTransferCount()); |
|||
} |
|||
}); |
|||
|
|||
streetList.forEach(street -> { |
|||
String streetId = street.getId().toString(); |
|||
// 街道数据需要在本身基础上再加上社区的合计
|
|||
Optional<ScreenGovernRankDataDailyResultDTO> agencyOptional = agencyData.stream().filter(agency -> agency.getOrgId().equals(streetId)).findFirst(); |
|||
if (agencyOptional.isPresent()) { |
|||
ScreenGovernRankDataDailyResultDTO agencyResult = agencyOptional.get(); |
|||
Integer responseCount = agencyResult.getResponseCount() + agencyData.stream().filter(agency -> agency.getParentId().equals(streetId)).mapToInt(ScreenGovernRankDataDailyResultDTO::getResponseCount).sum(); |
|||
Integer transferCount = agencyResult.getTransferCount() + agencyData.stream().filter(agency -> agency.getParentId().equals(streetId)).mapToInt(ScreenGovernRankDataDailyResultDTO::getTransferCount).sum(); |
|||
agencyResult.setResponseCount(responseCount); |
|||
agencyResult.setTransferCount(transferCount); |
|||
} |
|||
}); |
|||
// 合并网格社区街道数据
|
|||
data.addAll(agencyData); |
|||
// 计算响应率
|
|||
data.forEach(item -> { |
|||
if (0 == item.getTransferCount() || 0 == item.getResponseCount()) { |
|||
item.setResponseRatio("0.0000"); |
|||
} else { |
|||
DecimalFormat df = new DecimalFormat("0.0000"); |
|||
item.setResponseRatio(df.format((float) item.getResponseCount() / item.getTransferCount())); |
|||
} |
|||
}); |
|||
|
|||
JSONObject jsonObject = new JSONObject(); |
|||
jsonObject.put("isFirst", true); |
|||
jsonObject.put("dateId", yearMonthDay); |
|||
jsonObject.put("dataList", data); |
|||
epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_GOV_RANK_DATA, JSONObject.toJSONString(jsonObject)); |
|||
return new Result(); |
|||
} |
|||
|
|||
@Override |
|||
public Result gridgoverndaily(ScreenJobFormDTO formDto) { |
|||
String yearMonthDay = DateUtils.formatNoSplit(DateUtils.addDateDays(new Date(), -1)); |
|||
|
|||
List<ScreenGridGovernDailyResultDTO> data = baseDao.gridgoverndaily(); |
|||
JSONObject jsonObject = new JSONObject(); |
|||
jsonObject.put("isFirst", true); |
|||
jsonObject.put("dataList", data); |
|||
jsonObject.put("dateId", yearMonthDay); |
|||
epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_GOV_GRID_GOV_DATA, JSONObject.toJSONString(jsonObject)); |
|||
return new Result(); |
|||
} |
|||
|
|||
@Override |
|||
public Result agencygoverndaily(ScreenJobFormDTO formDto) { |
|||
String yearMonthDay = DateUtils.formatNoSplit(DateUtils.addDateDays(new Date(), -1)); |
|||
|
|||
List<ScreenAgencyGovernDailyResultDTO> data = baseDao.agencygoverndaily(); |
|||
JSONObject jsonObject = new JSONObject(); |
|||
jsonObject.put("isFirst", true); |
|||
jsonObject.put("dateId", yearMonthDay); |
|||
jsonObject.put("dataList", data); |
|||
epmetUtils.httpPost(EpmetConstant.EPMET_SCREEN_GOV_AGENCY_GOV_DATA, JSONObject.toJSONString(jsonObject)); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* 追加未响应数据 |
|||
* |
|||
* @param data |
|||
* @param noRespData |
|||
* @return void |
|||
* @author zhy |
|||
* @date 2021/8/13 14:48 |
|||
*/ |
|||
private void noRespHandle(List<ScreenGovernRankDataDailyResultDTO> data, List<ScreenGovernRankDataDailyResultDTO> noRespData) { |
|||
data.forEach(item -> { |
|||
Optional<ScreenGovernRankDataDailyResultDTO> noDataOptional = noRespData.stream().filter(agency -> agency.getOrgId().equals(item.getOrgId())).findFirst(); |
|||
// 如果有未响应的,项目转入次数 = 响应数 + 未响应数,否则,项目转入次数 = 响应数
|
|||
if (noDataOptional.isPresent()) { |
|||
ScreenGovernRankDataDailyResultDTO agencyResult = noDataOptional.get(); |
|||
item.setTransferCount(agencyResult.getResponseCount() + item.getResponseCount()); |
|||
} else { |
|||
item.setTransferCount(item.getResponseCount()); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,895 @@ |
|||
<?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.elink.esua.epdc.modules.screen.dao.ScreenGovernanceDao"> |
|||
|
|||
<select id="getStreetList" resultType="com.elink.esua.epdc.dto.SysDeptDTO"> |
|||
SELECT |
|||
id, |
|||
pid, |
|||
pids, |
|||
NAME |
|||
FROM |
|||
esua_epdc_admin.sys_dept sd |
|||
WHERE |
|||
sd.del_flag = '0' |
|||
AND sd.type_key = 'street_party' |
|||
AND sd.id NOT IN ( |
|||
SELECT |
|||
t.dept_id |
|||
FROM |
|||
esua_epdc_admin.sys_dept_config t |
|||
WHERE |
|||
t.del_flag = '0' |
|||
) |
|||
</select> |
|||
|
|||
<select id="governrankdatadaily" resultType="com.elink.esua.epdc.dto.screen.result.ScreenGovernRankDataDailyResultDTO"> |
|||
SELECT |
|||
DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y%m%d' |
|||
) AS dateId, |
|||
DATE_FORMAT( |
|||
STR_TO_DATE( |
|||
DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
), |
|||
'%Y' |
|||
), |
|||
'%Y' |
|||
) AS yearId, |
|||
DATE_FORMAT( |
|||
STR_TO_DATE( |
|||
DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
), |
|||
'%Y-%m' |
|||
), |
|||
'%Y%m' |
|||
) AS monthId, |
|||
'grid' AS orgType, |
|||
sd.id AS orgId, |
|||
sd.pid AS parentId, |
|||
sd. NAME AS orgName, |
|||
IFNULL(count(hp.id), 0) AS responseCount, |
|||
IFNULL(st.ITEM_SETTLE_TOTAL, 0) AS resolvedCount, |
|||
IFNULL(st.ITEM_CLOSED_TOTAL, 0) AS closedCount, |
|||
IFNULL(st.ITEM_CLOSED_TOTAL, 0) AS closedProjectCount, |
|||
IFNULL( |
|||
ROUND( |
|||
( |
|||
st.ITEM_SETTLE_TOTAL + st.ITEM_CLOSED_TOTAL |
|||
) / st.ITEM_TOTAL, |
|||
4 |
|||
), |
|||
0 |
|||
) AS resolvedRatio, |
|||
IFNULL(hs.BYSELF_TOTAL, 0) AS governCount, |
|||
IFNULL( |
|||
ROUND( |
|||
hs.BYSELF_TOTAL / hs.ITEM_TOTAL, |
|||
4 |
|||
), |
|||
0 |
|||
) AS governRatio, |
|||
IFNULL( |
|||
hs.EVA_GOOD_TOTAL + hs.EVA_VERYGOOD_TOTAL, |
|||
0 |
|||
) AS satisfactionCount, |
|||
IFNULL( |
|||
ROUND( |
|||
( |
|||
hs.EVA_GOOD_TOTAL + hs.EVA_VERYGOOD_TOTAL |
|||
) / hs.ITEM_TOTAL, |
|||
4 |
|||
), |
|||
0 |
|||
) AS satisfactionRatio |
|||
FROM |
|||
esua_epdc_admin.sys_dept sd |
|||
LEFT JOIN esua_epdc_events.epdc_item_handle_process hp ON hp.HANDLER_DEPT_ID = sd.id |
|||
AND hp.DEL_FLAG = '0' |
|||
AND DATE_FORMAT(hp.CREATED_TIME, '%Y-%m-%d') <= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
LEFT JOIN esua_epdc_analysis.epdc_issue_item_statistics st ON st.GRID_ID = sd.id |
|||
LEFT JOIN esua_epdc_analysis.epdc_grid_handle_statistics hs ON hs.DEPT_ID = sd.id |
|||
WHERE |
|||
sd.del_flag = '0' |
|||
AND sd.type_key = 'grid_party' |
|||
AND sd.id NOT IN ( |
|||
SELECT |
|||
t.dept_id |
|||
FROM |
|||
esua_epdc_admin.sys_dept_config t |
|||
WHERE |
|||
t.del_flag = '0' |
|||
) |
|||
GROUP BY |
|||
sd.id |
|||
</select> |
|||
|
|||
<select id="governrankdatadailyAgency" resultType="com.elink.esua.epdc.dto.screen.result.ScreenGovernRankDataDailyResultDTO"> |
|||
SELECT |
|||
DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y%m%d' |
|||
) AS dateId, |
|||
DATE_FORMAT( |
|||
STR_TO_DATE( |
|||
DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
), |
|||
'%Y' |
|||
), |
|||
'%Y' |
|||
) AS yearId, |
|||
DATE_FORMAT( |
|||
STR_TO_DATE( |
|||
DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
), |
|||
'%Y-%m' |
|||
), |
|||
'%Y%m' |
|||
) AS monthId, |
|||
'agency' AS orgType, |
|||
sd.id AS orgId, |
|||
sd.pid AS parentId, |
|||
sd. NAME AS orgName, |
|||
IFNULL(count(hp.id), 0) AS responseCount, |
|||
IFNULL(st.ITEM_SETTLE_TOTAL, 0) AS resolvedCount, |
|||
IFNULL(st.ITEM_CLOSED_TOTAL, 0) AS closedCount, |
|||
IFNULL(st.ITEM_CLOSED_TOTAL, 0) AS closedProjectCount, |
|||
IFNULL( |
|||
ROUND( |
|||
( |
|||
st.ITEM_SETTLE_TOTAL + st.ITEM_CLOSED_TOTAL |
|||
) / st.ITEM_TOTAL, |
|||
4 |
|||
), |
|||
0 |
|||
) AS resolvedRatio, |
|||
IFNULL(hs.BYSELF_TOTAL, 0) AS governCount, |
|||
IFNULL( |
|||
ROUND( |
|||
hs.BYSELF_TOTAL / hs.ITEM_TOTAL, |
|||
4 |
|||
), |
|||
0 |
|||
) AS governRatio, |
|||
IFNULL( |
|||
hs.EVA_GOOD_TOTAL + hs.EVA_VERYGOOD_TOTAL, |
|||
0 |
|||
) AS satisfactionCount, |
|||
IFNULL( |
|||
ROUND( |
|||
( |
|||
hs.EVA_GOOD_TOTAL + hs.EVA_VERYGOOD_TOTAL |
|||
) / hs.ITEM_TOTAL, |
|||
4 |
|||
), |
|||
0 |
|||
) AS satisfactionRatio |
|||
FROM |
|||
esua_epdc_admin.sys_dept sd |
|||
LEFT JOIN esua_epdc_events.epdc_item_handle_process hp ON hp.HANDLER_DEPT_ID = sd.id |
|||
AND hp.DEL_FLAG = '0' |
|||
AND DATE_FORMAT(hp.CREATED_TIME, '%Y-%m-%d') <= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
LEFT JOIN esua_epdc_analysis.epdc_issue_item_statistics st ON st.GRID_ID = sd.id |
|||
LEFT JOIN esua_epdc_analysis.epdc_grid_handle_statistics hs ON hs.DEPT_ID = sd.id |
|||
WHERE |
|||
sd.del_flag = '0' |
|||
AND sd.id NOT IN ( |
|||
SELECT |
|||
t.dept_id |
|||
FROM |
|||
esua_epdc_admin.sys_dept_config t |
|||
WHERE |
|||
t.del_flag = '0' |
|||
) |
|||
AND sd.type_key IN ( |
|||
'community_party', |
|||
'street_party' |
|||
) |
|||
GROUP BY |
|||
sd.id |
|||
</select> |
|||
|
|||
<select id="governrankdatadailyNoResp" resultType="com.elink.esua.epdc.dto.screen.result.ScreenGovernRankDataDailyResultDTO"> |
|||
SELECT |
|||
d.DEPT_ID AS orgId, |
|||
COUNT(0) AS responseCount |
|||
FROM |
|||
esua_epdc_events.epdc_item_dept d |
|||
LEFT JOIN esua_epdc_events.epdc_item i ON i.ID = d.ITEM_ID |
|||
WHERE |
|||
d.ITEM_HANDLE_ID IS NOT NULL |
|||
AND d.DEL_FLAG = '0' |
|||
AND i.DEL_FLAG = '0' |
|||
AND i.ITEM_STATE = '0' |
|||
AND DATE_FORMAT(d.CREATED_TIME, '%Y-%m-%d') <= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
GROUP BY |
|||
d.DEPT_ID |
|||
</select> |
|||
|
|||
<select id="gridgoverndaily" resultType="com.elink.esua.epdc.dto.screen.result.ScreenGridGovernDailyResultDTO"> |
|||
SELECT |
|||
info.*, IFNULL( |
|||
( |
|||
info.inGroupTopicResolvedCount + info.inGroupTopicUnResolvedCount |
|||
) / info.problemResolvedCount, |
|||
0 |
|||
) AS groupSelfGovernRatio, |
|||
IFNULL( |
|||
info.gridSelfGovernProjectTotal / info.problemResolvedCount, |
|||
0 |
|||
) AS gridSelfGovernRatio, |
|||
IFNULL( |
|||
info.communityClosedCount / info.problemResolvedCount, |
|||
0 |
|||
) AS communityClosedRatio, |
|||
IFNULL( |
|||
info.streetClosedCount / info.problemResolvedCount, |
|||
0 |
|||
) AS streetClosedRatio, |
|||
0 AS districtDeptClosedRatio |
|||
FROM |
|||
( |
|||
SELECT |
|||
DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y%m%d' |
|||
) AS dateId, |
|||
sd.id AS gridId, |
|||
sd.pid, |
|||
sd.pids, |
|||
IFNULL( |
|||
( |
|||
IFNULL(topic.topicResolvedCount, 0) + IFNULL(topic.topicUnResolvedCount, 0) + IFNULL(issue.issueResolvedCount, 0) + IFNULL(issue.issueUnResolvedCount, 0) + IFNULL(item.issueProjectResolvedCount, 0) + IFNULL(item.issueProjectUnResolvedCount, 0) |
|||
), |
|||
0 |
|||
) AS problemResolvedCount, |
|||
IFNULL(topic.topicResolvedCount, 0) AS topicResolvedCount, |
|||
IFNULL( |
|||
topic.topicUnResolvedCount, |
|||
0 |
|||
) AS topicUnResolvedCount, |
|||
IFNULL(issue.issueResolvedCount, 0) AS issueResolvedCount, |
|||
IFNULL( |
|||
issue.issueUnResolvedCount, |
|||
0 |
|||
) AS issueUnResolvedCount, |
|||
IFNULL( |
|||
item.issueProjectResolvedCount, |
|||
0 |
|||
) AS issueProjectResolvedCount, |
|||
IFNULL( |
|||
item.issueProjectUnResolvedCount, |
|||
0 |
|||
) AS issueProjectUnResolvedCount, |
|||
IFNULL( |
|||
item.approvalProjectResolvedCount, |
|||
0 |
|||
) AS approvalProjectResolvedCount, |
|||
IFNULL( |
|||
item.approvalProjectUnResolvedCount, |
|||
0 |
|||
) AS approvalProjectUnResolvedCount, |
|||
IFNULL( |
|||
topic.inGroupTopicResolvedCount, |
|||
0 |
|||
) AS inGroupTopicResolvedCount, |
|||
IFNULL( |
|||
topic.inGroupTopicUnResolvedCount, |
|||
0 |
|||
) AS inGroupTopicUnResolvedCount, |
|||
IFNULL( |
|||
selfsolved.fromIssueResolvedInGridCount, |
|||
0 |
|||
) AS fromIssueResolvedInGridCount, |
|||
IFNULL( |
|||
selfsolved.fromIssueUnResolvedInGridCount, |
|||
0 |
|||
) AS fromIssueUnResolvedInGridCount, |
|||
IFNULL( |
|||
selfsolved.fromAgencyResolvedInGridCount, |
|||
0 |
|||
) AS fromAgencyResolvedInGridCount, |
|||
IFNULL( |
|||
selfsolved.fromAgencyUnResolvedInGridCount, |
|||
0 |
|||
) AS fromAgencyUnResolvedInGridCount, |
|||
IFNULL( |
|||
( |
|||
selfsolved.fromIssueResolvedInGridCount + selfsolved.fromIssueUnResolvedInGridCount + selfsolved.fromIssueUnResolvedInGridCount + selfsolved.fromAgencyResolvedInGridCount |
|||
), |
|||
0 |
|||
) AS gridSelfGovernProjectTotal, |
|||
IFNULL( |
|||
commsolved.communityClosedCount, |
|||
0 |
|||
) AS communityClosedCount, |
|||
IFNULL( |
|||
streetsolved.streetClosedCount, |
|||
0 |
|||
) AS streetClosedCount, |
|||
0 AS districtDeptClosedCount |
|||
FROM |
|||
esua_epdc_admin.sys_dept sd |
|||
LEFT JOIN ( |
|||
SELECT |
|||
GRID_ID, |
|||
IFNULL(COUNT(0), 0) AS topicResolvedCount, |
|||
IFNULL(COUNT(0), 0) AS inGroupTopicResolvedCount, |
|||
0 AS topicUnResolvedCount, |
|||
0 AS inGroupTopicUnResolvedCount |
|||
FROM |
|||
esua_epdc_group.epdc_topic et |
|||
WHERE |
|||
et.DEL_FLAG = '0' |
|||
AND DATE_FORMAT(et.UPDATED_TIME, '%Y-%m-%d') <= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
AND et.STATE = '20' |
|||
GROUP BY |
|||
et.GRID_ID |
|||
) topic ON topic.GRID_ID = sd.id |
|||
LEFT JOIN ( |
|||
SELECT |
|||
GRID_ID, |
|||
IFNULL(COUNT(0), 0) AS issueResolvedCount, |
|||
0 AS issueUnResolvedCount |
|||
FROM |
|||
esua_epdc_events.epdc_issue eis |
|||
WHERE |
|||
eis.DEL_FLAG = '0' |
|||
AND DATE_FORMAT( |
|||
eis.UPDATED_TIME, |
|||
'%Y-%m-%d' |
|||
) <= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
AND eis.ISSUE_STATE = '2' |
|||
GROUP BY |
|||
eis.GRID_ID |
|||
) issue ON issue.GRID_ID = sd.id |
|||
LEFT JOIN ( |
|||
SELECT |
|||
GRID_ID, |
|||
IFNULL(COUNT(0), 0) AS issueProjectResolvedCount, |
|||
0 AS issueProjectUnResolvedCount, |
|||
0 AS approvalProjectResolvedCount, |
|||
0 AS approvalProjectUnResolvedCount |
|||
FROM |
|||
esua_epdc_events.epdc_item eit |
|||
WHERE |
|||
eit.DEL_FLAG = '0' |
|||
AND DATE_FORMAT( |
|||
eit.UPDATED_TIME, |
|||
'%Y-%m-%d' |
|||
) <= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
AND eit.ITEM_STATE IN ('5', '10') |
|||
GROUP BY |
|||
GRID_ID |
|||
) item ON item.GRID_ID = sd.id |
|||
LEFT JOIN ( |
|||
SELECT |
|||
GRID_ID, |
|||
IFNULL(COUNT(0), 0) AS fromIssueResolvedInGridCount, |
|||
0 AS fromIssueUnResolvedInGridCount, |
|||
0 AS fromAgencyResolvedInGridCount, |
|||
0 AS fromAgencyUnResolvedInGridCount |
|||
FROM |
|||
( |
|||
SELECT |
|||
GRID_ID, |
|||
eit.id, |
|||
hp.HANDLER_DEPT_ID, |
|||
eit.UPDATED_TIME |
|||
FROM |
|||
esua_epdc_events.epdc_item eit |
|||
LEFT JOIN esua_epdc_events.epdc_item_handle_process hp ON hp.item_id = eit.id |
|||
WHERE |
|||
eit.DEL_FLAG = '0' |
|||
AND hp.DEL_FLAG = '0' |
|||
AND eit.ITEM_STATE IN ('5', '10') |
|||
GROUP BY |
|||
eit.GRID_ID, |
|||
eit.ID |
|||
HAVING |
|||
COUNT(DISTINCT hp.HANDLER_DEPT_ID) = 1 |
|||
) t |
|||
WHERE |
|||
t.GRID_ID = t.HANDLER_DEPT_ID |
|||
AND DATE_FORMAT(t.UPDATED_TIME, '%Y-%m-%d') <= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
GROUP BY |
|||
t.GRID_ID |
|||
) selfsolved ON selfsolved.GRID_ID = sd.id |
|||
LEFT JOIN ( |
|||
SELECT |
|||
GRID_ID, |
|||
IFNULL(COUNT(0), 0) AS communityClosedCount |
|||
FROM |
|||
( |
|||
SELECT |
|||
GRID_ID, |
|||
eit.id, |
|||
hp.HANDLER_DEPT_ID, |
|||
eit.UPDATED_TIME |
|||
FROM |
|||
esua_epdc_events.epdc_item eit |
|||
LEFT JOIN esua_epdc_events.epdc_item_handle_process hp ON hp.item_id = eit.id |
|||
LEFT JOIN esua_epdc_admin.sys_dept sd ON sd.id = hp.HANDLER_DEPT_ID |
|||
WHERE |
|||
eit.DEL_FLAG = '0' |
|||
AND hp.DEL_FLAG = '0' |
|||
AND eit.ITEM_STATE IN ('5', '10') |
|||
AND hp.STATE IN ('5', '10') |
|||
AND sd.type_key = 'community_party' |
|||
GROUP BY |
|||
eit.GRID_ID, |
|||
eit.ID |
|||
) t |
|||
WHERE |
|||
DATE_FORMAT(t.UPDATED_TIME, '%Y-%m-%d') <= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
GROUP BY |
|||
t.GRID_ID |
|||
) commsolved ON commsolved.GRID_ID = sd.id |
|||
LEFT JOIN ( |
|||
SELECT |
|||
GRID_ID, |
|||
IFNULL(COUNT(0), 0) AS streetClosedCount |
|||
FROM |
|||
( |
|||
SELECT |
|||
GRID_ID, |
|||
eit.id, |
|||
hp.HANDLER_DEPT_ID, |
|||
eit.UPDATED_TIME |
|||
FROM |
|||
esua_epdc_events.epdc_item eit |
|||
LEFT JOIN esua_epdc_events.epdc_item_handle_process hp ON hp.item_id = eit.id |
|||
LEFT JOIN esua_epdc_admin.sys_dept sd ON sd.id = hp.HANDLER_DEPT_ID |
|||
WHERE |
|||
eit.DEL_FLAG = '0' |
|||
AND hp.DEL_FLAG = '0' |
|||
AND eit.ITEM_STATE IN ('5', '10') |
|||
AND hp.STATE IN ('5', '10') |
|||
AND sd.type_key = 'street_party' |
|||
GROUP BY |
|||
eit.GRID_ID, |
|||
eit.ID |
|||
) t |
|||
WHERE |
|||
DATE_FORMAT(t.UPDATED_TIME, '%Y-%m-%d') <= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
GROUP BY |
|||
t.GRID_ID |
|||
) streetsolved ON streetsolved.GRID_ID = sd.id |
|||
WHERE |
|||
sd.del_flag = '0' |
|||
AND sd.type_key = 'grid_party' |
|||
AND sd.id NOT IN ( |
|||
SELECT |
|||
t.dept_id |
|||
FROM |
|||
esua_epdc_admin.sys_dept_config t |
|||
WHERE |
|||
t.del_flag = '0' |
|||
) |
|||
GROUP BY |
|||
sd.id |
|||
) info |
|||
</select> |
|||
|
|||
<select id="agencygoverndaily" resultType="com.elink.esua.epdc.dto.screen.result.ScreenAgencyGovernDailyResultDTO"> |
|||
SELECT |
|||
DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y%m%d' |
|||
) AS dateId, |
|||
sd.id AS agencyId, |
|||
CASE |
|||
WHEN sd.type_key = 'community_party' THEN |
|||
'community' |
|||
WHEN sd.type_key = 'street_party' THEN |
|||
'street' |
|||
END AS LEVEL, |
|||
sd.pid, |
|||
sd.pids, |
|||
IFNULL( |
|||
sum(info.problemResolvedCount), |
|||
0 |
|||
) AS problemResolvedCount, |
|||
IFNULL( |
|||
sum(info.topicResolvedCount), |
|||
0 |
|||
) AS topicResolvedCount, |
|||
IFNULL( |
|||
sum(info.topicUnResolvedCount), |
|||
0 |
|||
) AS topicUnResolvedCount, |
|||
IFNULL( |
|||
sum(info.issueResolvedCount), |
|||
0 |
|||
) AS issueResolvedCount, |
|||
IFNULL( |
|||
sum(info.issueUnResolvedCount), |
|||
0 |
|||
) AS issueUnResolvedCount, |
|||
IFNULL( |
|||
sum( |
|||
info.issueProjectResolvedCount |
|||
), |
|||
0 |
|||
) AS issueProjectResolvedCount, |
|||
IFNULL( |
|||
sum( |
|||
info.issueProjectUnResolvedCount |
|||
), |
|||
0 |
|||
) AS issueProjectUnResolvedCount, |
|||
IFNULL( |
|||
sum( |
|||
info.approvalProjectResolvedCount |
|||
), |
|||
0 |
|||
) AS approvalProjectResolvedCount, |
|||
IFNULL( |
|||
sum( |
|||
info.approvalProjectUnResolvedCount |
|||
), |
|||
0 |
|||
) AS approvalProjectUnResolvedCount, |
|||
IFNULL( |
|||
sum( |
|||
info.inGroupTopicResolvedCount |
|||
), |
|||
0 |
|||
) AS inGroupTopicResolvedCount, |
|||
IFNULL( |
|||
sum( |
|||
info.inGroupTopicUnResolvedCount |
|||
), |
|||
0 |
|||
) AS inGroupTopicUnResolvedCount, |
|||
IFNULL( |
|||
sum( |
|||
info.gridSelfGovernProjectTotal |
|||
), |
|||
0 |
|||
) AS gridSelfGovernProjectTotal, |
|||
IFNULL( |
|||
sum(info.communityClosedCount), |
|||
0 |
|||
) AS communityClosedCount, |
|||
IFNULL( |
|||
sum(info.streetClosedCount), |
|||
0 |
|||
) AS streetClosedCount, |
|||
0 AS districtDeptClosedCount, |
|||
IFNULL( |
|||
( |
|||
sum( |
|||
info.inGroupTopicResolvedCount |
|||
) + sum( |
|||
info.inGroupTopicUnResolvedCount |
|||
) |
|||
) / sum(info.problemResolvedCount), |
|||
0 |
|||
) AS groupSelfGovernRatio, |
|||
IFNULL( |
|||
sum( |
|||
info.gridSelfGovernProjectTotal |
|||
) / sum(info.problemResolvedCount), |
|||
0 |
|||
) AS gridSelfGovernRatio, |
|||
IFNULL( |
|||
sum(info.communityClosedCount) / sum(info.problemResolvedCount), |
|||
0 |
|||
) AS communityClosedRatio, |
|||
IFNULL( |
|||
sum(info.streetClosedCount) / sum(info.problemResolvedCount), |
|||
0 |
|||
) AS streetClosedRatio, |
|||
0 AS districtDeptClosedRatio |
|||
FROM |
|||
( |
|||
SELECT |
|||
sd.pids, |
|||
IFNULL( |
|||
( |
|||
IFNULL(topic.topicResolvedCount, 0) + IFNULL(topic.topicUnResolvedCount, 0) + IFNULL(issue.issueResolvedCount, 0) + IFNULL(issue.issueUnResolvedCount, 0) + IFNULL(item.issueProjectResolvedCount, 0) + IFNULL(item.issueProjectUnResolvedCount, 0) |
|||
), |
|||
0 |
|||
) AS problemResolvedCount, |
|||
IFNULL(topic.topicResolvedCount, 0) AS topicResolvedCount, |
|||
IFNULL( |
|||
topic.topicUnResolvedCount, |
|||
0 |
|||
) AS topicUnResolvedCount, |
|||
IFNULL(issue.issueResolvedCount, 0) AS issueResolvedCount, |
|||
IFNULL( |
|||
issue.issueUnResolvedCount, |
|||
0 |
|||
) AS issueUnResolvedCount, |
|||
IFNULL( |
|||
item.issueProjectResolvedCount, |
|||
0 |
|||
) AS issueProjectResolvedCount, |
|||
IFNULL( |
|||
item.issueProjectUnResolvedCount, |
|||
0 |
|||
) AS issueProjectUnResolvedCount, |
|||
IFNULL( |
|||
item.approvalProjectResolvedCount, |
|||
0 |
|||
) AS approvalProjectResolvedCount, |
|||
IFNULL( |
|||
item.approvalProjectUnResolvedCount, |
|||
0 |
|||
) AS approvalProjectUnResolvedCount, |
|||
IFNULL( |
|||
topic.inGroupTopicResolvedCount, |
|||
0 |
|||
) AS inGroupTopicResolvedCount, |
|||
IFNULL( |
|||
topic.inGroupTopicUnResolvedCount, |
|||
0 |
|||
) AS inGroupTopicUnResolvedCount, |
|||
IFNULL( |
|||
selfsolved.fromIssueResolvedInGridCount, |
|||
0 |
|||
) AS fromIssueResolvedInGridCount, |
|||
IFNULL( |
|||
selfsolved.fromIssueUnResolvedInGridCount, |
|||
0 |
|||
) AS fromIssueUnResolvedInGridCount, |
|||
IFNULL( |
|||
selfsolved.fromAgencyResolvedInGridCount, |
|||
0 |
|||
) AS fromAgencyResolvedInGridCount, |
|||
IFNULL( |
|||
selfsolved.fromAgencyUnResolvedInGridCount, |
|||
0 |
|||
) AS fromAgencyUnResolvedInGridCount, |
|||
IFNULL( |
|||
( |
|||
selfsolved.fromIssueResolvedInGridCount + selfsolved.fromIssueUnResolvedInGridCount + selfsolved.fromIssueUnResolvedInGridCount + selfsolved.fromAgencyResolvedInGridCount |
|||
), |
|||
0 |
|||
) AS gridSelfGovernProjectTotal, |
|||
IFNULL( |
|||
commsolved.communityClosedCount, |
|||
0 |
|||
) AS communityClosedCount, |
|||
IFNULL( |
|||
streetsolved.streetClosedCount, |
|||
0 |
|||
) AS streetClosedCount, |
|||
0 AS districtDeptClosedCount |
|||
FROM |
|||
esua_epdc_admin.sys_dept sd |
|||
LEFT JOIN ( |
|||
SELECT |
|||
GRID_ID, |
|||
IFNULL(COUNT(0), 0) AS topicResolvedCount, |
|||
IFNULL(COUNT(0), 0) AS inGroupTopicResolvedCount, |
|||
0 AS topicUnResolvedCount, |
|||
0 AS inGroupTopicUnResolvedCount |
|||
FROM |
|||
esua_epdc_group.epdc_topic et |
|||
WHERE |
|||
et.DEL_FLAG = '0' |
|||
AND DATE_FORMAT(et.UPDATED_TIME, '%Y-%m-%d')<= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
AND et.STATE = '20' |
|||
GROUP BY |
|||
et.GRID_ID |
|||
) topic ON topic.GRID_ID = sd.id |
|||
LEFT JOIN ( |
|||
SELECT |
|||
GRID_ID, |
|||
IFNULL(COUNT(0), 0) AS issueResolvedCount, |
|||
0 AS issueUnResolvedCount |
|||
FROM |
|||
esua_epdc_events.epdc_issue eis |
|||
WHERE |
|||
eis.DEL_FLAG = '0' |
|||
AND DATE_FORMAT( |
|||
eis.UPDATED_TIME, |
|||
'%Y-%m-%d' |
|||
)<= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
AND eis.ISSUE_STATE = '2' |
|||
GROUP BY |
|||
eis.GRID_ID |
|||
) issue ON issue.GRID_ID = sd.id |
|||
LEFT JOIN ( |
|||
SELECT |
|||
GRID_ID, |
|||
IFNULL(COUNT(0), 0) AS issueProjectResolvedCount, |
|||
0 AS issueProjectUnResolvedCount, |
|||
0 AS approvalProjectResolvedCount, |
|||
0 AS approvalProjectUnResolvedCount |
|||
FROM |
|||
esua_epdc_events.epdc_item eit |
|||
WHERE |
|||
eit.DEL_FLAG = '0' |
|||
AND DATE_FORMAT( |
|||
eit.UPDATED_TIME, |
|||
'%Y-%m-%d' |
|||
)<= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
AND eit.ITEM_STATE IN ('5', '10') |
|||
GROUP BY |
|||
GRID_ID |
|||
) item ON item.GRID_ID = sd.id |
|||
LEFT JOIN ( |
|||
SELECT |
|||
GRID_ID, |
|||
IFNULL(COUNT(0), 0) AS fromIssueResolvedInGridCount, |
|||
0 AS fromIssueUnResolvedInGridCount, |
|||
0 AS fromAgencyResolvedInGridCount, |
|||
0 AS fromAgencyUnResolvedInGridCount |
|||
FROM |
|||
( |
|||
SELECT |
|||
GRID_ID, |
|||
eit.id, |
|||
hp.HANDLER_DEPT_ID, |
|||
eit.UPDATED_TIME |
|||
FROM |
|||
esua_epdc_events.epdc_item eit |
|||
LEFT JOIN esua_epdc_events.epdc_item_handle_process hp ON hp.item_id = eit.id |
|||
WHERE |
|||
eit.DEL_FLAG = '0' |
|||
AND hp.DEL_FLAG = '0' |
|||
AND eit.ITEM_STATE IN ('5', '10') |
|||
GROUP BY |
|||
eit.GRID_ID, |
|||
eit.ID |
|||
HAVING |
|||
COUNT(DISTINCT hp.HANDLER_DEPT_ID) = 1 |
|||
) t |
|||
WHERE |
|||
t.GRID_ID = t.HANDLER_DEPT_ID |
|||
AND DATE_FORMAT(t.UPDATED_TIME, '%Y-%m-%d')<= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
GROUP BY |
|||
t.GRID_ID |
|||
) selfsolved ON selfsolved.GRID_ID = sd.id |
|||
LEFT JOIN ( |
|||
SELECT |
|||
GRID_ID, |
|||
IFNULL(COUNT(0), 0) AS communityClosedCount |
|||
FROM |
|||
( |
|||
SELECT |
|||
GRID_ID, |
|||
eit.id, |
|||
hp.HANDLER_DEPT_ID, |
|||
eit.UPDATED_TIME |
|||
FROM |
|||
esua_epdc_events.epdc_item eit |
|||
LEFT JOIN esua_epdc_events.epdc_item_handle_process hp ON hp.item_id = eit.id |
|||
LEFT JOIN esua_epdc_admin.sys_dept sd ON sd.id = hp.HANDLER_DEPT_ID |
|||
WHERE |
|||
eit.DEL_FLAG = '0' |
|||
AND hp.DEL_FLAG = '0' |
|||
AND eit.ITEM_STATE IN ('5', '10') |
|||
AND hp.STATE IN ('5', '10') |
|||
AND sd.type_key = 'community_party' |
|||
GROUP BY |
|||
eit.GRID_ID, |
|||
eit.ID |
|||
) t |
|||
WHERE |
|||
DATE_FORMAT(t.UPDATED_TIME, '%Y-%m-%d')<= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
GROUP BY |
|||
t.GRID_ID |
|||
) commsolved ON commsolved.GRID_ID = sd.id |
|||
LEFT JOIN ( |
|||
SELECT |
|||
GRID_ID, |
|||
IFNULL(COUNT(0), 0) AS streetClosedCount |
|||
FROM |
|||
( |
|||
SELECT |
|||
GRID_ID, |
|||
eit.id, |
|||
hp.HANDLER_DEPT_ID, |
|||
eit.UPDATED_TIME |
|||
FROM |
|||
esua_epdc_events.epdc_item eit |
|||
LEFT JOIN esua_epdc_events.epdc_item_handle_process hp ON hp.item_id = eit.id |
|||
LEFT JOIN esua_epdc_admin.sys_dept sd ON sd.id = hp.HANDLER_DEPT_ID |
|||
WHERE |
|||
eit.DEL_FLAG = '0' |
|||
AND hp.DEL_FLAG = '0' |
|||
AND eit.ITEM_STATE IN ('5', '10') |
|||
AND hp.STATE IN ('5', '10') |
|||
AND sd.type_key = 'street_party' |
|||
GROUP BY |
|||
eit.GRID_ID, |
|||
eit.ID |
|||
) t |
|||
WHERE |
|||
DATE_FORMAT(t.UPDATED_TIME, '%Y-%m-%d')<= DATE_FORMAT( |
|||
date_add(now(), INTERVAL - 1 DAY), |
|||
'%Y-%m-%d' |
|||
) |
|||
GROUP BY |
|||
t.GRID_ID |
|||
) streetsolved ON streetsolved.GRID_ID = sd.id |
|||
WHERE |
|||
sd.del_flag = '0' |
|||
AND sd.type_key = 'grid_party' |
|||
AND sd.id NOT IN ( |
|||
SELECT |
|||
t.dept_id |
|||
FROM |
|||
esua_epdc_admin.sys_dept_config t |
|||
WHERE |
|||
t.del_flag = '0' |
|||
) |
|||
GROUP BY |
|||
sd.id |
|||
) info |
|||
LEFT JOIN esua_epdc_admin.sys_dept sd ON find_in_set(sd.`id`, info.pids) |
|||
WHERE |
|||
sd.del_flag = '0' |
|||
AND sd.id NOT IN ( |
|||
SELECT |
|||
t.dept_id |
|||
FROM |
|||
esua_epdc_admin.sys_dept_config t |
|||
WHERE |
|||
t.del_flag = '0' |
|||
) |
|||
AND sd.type_key IN ( |
|||
'community_party', |
|||
'street_party' |
|||
) |
|||
GROUP BY |
|||
sd.id |
|||
</select> |
|||
|
|||
</mapper> |
|||
@ -0,0 +1,129 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
import com.elink.esua.epdc.dto.result.ScreenCompanyImagesResultDTO; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 大屏企业信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-03 |
|||
*/ |
|||
@Data |
|||
public class ScreenCompanyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 企业名称 |
|||
*/ |
|||
private String companyName; |
|||
|
|||
/** |
|||
* 企业简介 |
|||
*/ |
|||
private String companyIntroduction; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
private String contactPerson; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 企业地址 |
|||
*/ |
|||
private String companyAddress; |
|||
|
|||
/** |
|||
* 统一社会信用代码 |
|||
*/ |
|||
private String uniformSocialCreditCode; |
|||
|
|||
/** |
|||
* 注册资金(万元) |
|||
*/ |
|||
private Integer registeredCapital; |
|||
|
|||
/** |
|||
* 企业人数 |
|||
*/ |
|||
private Integer employedPopulation; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 删除标识 0:否,1:是 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 企业照片 |
|||
*/ |
|||
private List<ScreenCompanyImagesResultDTO> images; |
|||
|
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
package com.elink.esua.epdc.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.Min; |
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class EpdcScreenCompanyListFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 页码 |
|||
*/ |
|||
@Min(value = 1, message = "页码必须大于0") |
|||
private Integer pageIndex; |
|||
|
|||
/** |
|||
* 页容量 |
|||
*/ |
|||
@Min(value = 1, message = "页容量必须大于0") |
|||
private Integer pageSize; |
|||
|
|||
/** |
|||
* 企业名称 |
|||
*/ |
|||
private String companyName; |
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
package com.elink.esua.epdc.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class EpdcScreenCompanyListResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 企业名称 |
|||
*/ |
|||
private String companyName; |
|||
|
|||
/** |
|||
* 企业简介 |
|||
*/ |
|||
private String companyIntroduction; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
private String contactPerson; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 企业地址 |
|||
*/ |
|||
private String companyAddress; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 企业照片 |
|||
*/ |
|||
private List<String> images; |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
package com.elink.esua.epdc.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class ScreenCompanyImagesResultDTO implements Serializable { |
|||
|
|||
private String name; |
|||
|
|||
private String url; |
|||
} |
|||
@ -0,0 +1,111 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.epidemic.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.ScreenCompanyDTO; |
|||
import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO; |
|||
import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO; |
|||
import com.elink.esua.epdc.modules.epidemic.excel.ScreenCompanyExcel; |
|||
import com.elink.esua.epdc.modules.epidemic.service.ScreenCompanyService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 大屏企业信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-03 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("screencompany") |
|||
public class ScreenCompanyController { |
|||
|
|||
@Autowired |
|||
private ScreenCompanyService screenCompanyService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<ScreenCompanyDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<ScreenCompanyDTO> page = screenCompanyService.page(params); |
|||
return new Result<PageData<ScreenCompanyDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<ScreenCompanyDTO> get(@PathVariable("id") String id){ |
|||
ScreenCompanyDTO data = screenCompanyService.get(id); |
|||
return new Result<ScreenCompanyDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody ScreenCompanyDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
screenCompanyService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody ScreenCompanyDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
screenCompanyService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
screenCompanyService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<ScreenCompanyDTO> list = screenCompanyService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, ScreenCompanyExcel.class); |
|||
} |
|||
|
|||
/** |
|||
* 大屏-企业列表 |
|||
* |
|||
* @param formDto |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO>> |
|||
* @author lc |
|||
* @since 2021/9/3 18:55 |
|||
*/ |
|||
@PostMapping("screenCompanyList") |
|||
public Result<List<EpdcScreenCompanyListResultDTO>> screenCompanyList(@RequestBody EpdcScreenCompanyListFormDTO formDto) { |
|||
ValidatorUtils.validateEntity(formDto); |
|||
List<EpdcScreenCompanyListResultDTO> data = screenCompanyService.listOfCompanyListForScreen(formDto); |
|||
return new Result<List<EpdcScreenCompanyListResultDTO>>().ok(data); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.epidemic.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.dto.ScreenCompanyDTO; |
|||
import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO; |
|||
import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO; |
|||
import com.elink.esua.epdc.modules.epidemic.entity.ScreenCompanyEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 大屏企业信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-03 |
|||
*/ |
|||
@Mapper |
|||
public interface ScreenCompanyDao extends BaseDao<ScreenCompanyEntity> { |
|||
|
|||
/** |
|||
* 查询大屏企业信息 |
|||
* |
|||
* @param id |
|||
* @return com.elink.esua.epdc.dto.ScreenCompanyDTO |
|||
* @author lc |
|||
* @since 2021/9/3 18:34 |
|||
*/ |
|||
ScreenCompanyDTO selectCompanyInfoById(String id); |
|||
|
|||
/** |
|||
* 大屏-企业列表 |
|||
* |
|||
* @param formDto |
|||
* @return java.util.List<com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO> |
|||
* @author lc |
|||
* @since 2021/9/3 18:50 |
|||
*/ |
|||
List<EpdcScreenCompanyListResultDTO> selectListOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto); |
|||
|
|||
} |
|||
@ -0,0 +1,91 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.epidemic.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 大屏企业信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-03 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_screen_company") |
|||
public class ScreenCompanyEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 企业名称 |
|||
*/ |
|||
private String companyName; |
|||
|
|||
/** |
|||
* 企业简介 |
|||
*/ |
|||
private String companyIntroduction; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
private String contactPerson; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 企业地址 |
|||
*/ |
|||
private String companyAddress; |
|||
|
|||
/** |
|||
* 统一社会信用代码 |
|||
*/ |
|||
private String uniformSocialCreditCode; |
|||
|
|||
/** |
|||
* 注册资金(万元) |
|||
*/ |
|||
private Integer registeredCapital; |
|||
|
|||
/** |
|||
* 企业人数 |
|||
*/ |
|||
private Integer employedPopulation; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
} |
|||
@ -0,0 +1,86 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.epidemic.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 大屏企业信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-03 |
|||
*/ |
|||
@Data |
|||
public class ScreenCompanyExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "企业名称") |
|||
private String companyName; |
|||
|
|||
@Excel(name = "企业简介") |
|||
private String companyIntroduction; |
|||
|
|||
@Excel(name = "联系人") |
|||
private String contactPerson; |
|||
|
|||
@Excel(name = "联系电话") |
|||
private String mobile; |
|||
|
|||
@Excel(name = "企业地址") |
|||
private String companyAddress; |
|||
|
|||
@Excel(name = "统一社会信用代码") |
|||
private String uniformSocialCreditCode; |
|||
|
|||
@Excel(name = "注册资金(万元)") |
|||
private Integer registeredCapital; |
|||
|
|||
@Excel(name = "企业人数") |
|||
private Integer employedPopulation; |
|||
|
|||
@Excel(name = "经度") |
|||
private String longitude; |
|||
|
|||
@Excel(name = "纬度") |
|||
private String latitude; |
|||
|
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
|
|||
@Excel(name = "删除标识 0:否,1:是") |
|||
private String delFlag; |
|||
|
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
|
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
|
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,107 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.epidemic.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.ScreenCompanyDTO; |
|||
import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO; |
|||
import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO; |
|||
import com.elink.esua.epdc.modules.epidemic.entity.ScreenCompanyEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 大屏企业信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-03 |
|||
*/ |
|||
public interface ScreenCompanyService extends BaseService<ScreenCompanyEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<ScreenCompanyDTO> |
|||
* @author generator |
|||
* @date 2021-09-03 |
|||
*/ |
|||
PageData<ScreenCompanyDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<ScreenCompanyDTO> |
|||
* @author generator |
|||
* @date 2021-09-03 |
|||
*/ |
|||
List<ScreenCompanyDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return ScreenCompanyDTO |
|||
* @author generator |
|||
* @date 2021-09-03 |
|||
*/ |
|||
ScreenCompanyDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-03 |
|||
*/ |
|||
void save(ScreenCompanyDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-03 |
|||
*/ |
|||
void update(ScreenCompanyDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-03 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* 大屏-企业列表 |
|||
* |
|||
* @param formDto |
|||
* @return java.util.List<com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO> |
|||
* @author lc |
|||
* @since 2021/9/3 18:52 |
|||
*/ |
|||
List<EpdcScreenCompanyListResultDTO> listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto); |
|||
} |
|||
@ -0,0 +1,140 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.epidemic.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.constant.CustomImageConstant; |
|||
import com.elink.esua.epdc.dto.ScreenCompanyDTO; |
|||
import com.elink.esua.epdc.dto.form.EpdcScreenCompanyListFormDTO; |
|||
import com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO; |
|||
import com.elink.esua.epdc.dto.result.ScreenCompanyImagesResultDTO; |
|||
import com.elink.esua.epdc.modules.epidemic.dao.ScreenCompanyDao; |
|||
import com.elink.esua.epdc.modules.epidemic.entity.ScreenCompanyEntity; |
|||
import com.elink.esua.epdc.modules.epidemic.service.ScreenCompanyService; |
|||
import com.elink.esua.epdc.modules.reportissue.service.CustomImgService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 大屏企业信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-03 |
|||
*/ |
|||
@Service |
|||
public class ScreenCompanyServiceImpl extends BaseServiceImpl<ScreenCompanyDao, ScreenCompanyEntity> implements ScreenCompanyService { |
|||
|
|||
@Autowired |
|||
private CustomImgService customImgService; |
|||
|
|||
@Override |
|||
public PageData<ScreenCompanyDTO> page(Map<String, Object> params) { |
|||
IPage<ScreenCompanyEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, ScreenCompanyDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<ScreenCompanyDTO> list(Map<String, Object> params) { |
|||
List<ScreenCompanyEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, ScreenCompanyDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<ScreenCompanyEntity> getWrapper(Map<String, Object> params){ |
|||
String companyName = (String)params.get("companyName"); |
|||
|
|||
QueryWrapper<ScreenCompanyEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.like(StringUtils.isNotBlank(companyName), "COMPANY_NAME", companyName.trim()); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public ScreenCompanyDTO get(String id) { |
|||
return baseDao.selectCompanyInfoById(id); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(ScreenCompanyDTO dto) { |
|||
ScreenCompanyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCompanyEntity.class); |
|||
insert(entity); |
|||
// 保存图片
|
|||
this.saveImages(dto.getImages(), entity.getId()); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(ScreenCompanyDTO dto) { |
|||
ScreenCompanyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCompanyEntity.class); |
|||
updateById(entity); |
|||
// 删除已有图片
|
|||
customImgService.modifyImagesByReferenceIdAndImgType(entity.getId(), CustomImageConstant.SCREEN_COMPANY_IMAGE); |
|||
// 保存新图片
|
|||
this.saveImages(dto.getImages(), entity.getId()); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
public List<EpdcScreenCompanyListResultDTO> listOfCompanyListForScreen(EpdcScreenCompanyListFormDTO formDto) { |
|||
int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); |
|||
formDto.setPageIndex(pageIndex); |
|||
return baseDao.selectListOfCompanyListForScreen(formDto); |
|||
} |
|||
|
|||
/** |
|||
* 保存图片 |
|||
* |
|||
* @param dto |
|||
* @param id |
|||
* @return void |
|||
* @author lc |
|||
* @since 2021/9/6 11:06 |
|||
*/ |
|||
private void saveImages(List<ScreenCompanyImagesResultDTO> dto, String id) { |
|||
List<String> images = new ArrayList<>(); |
|||
for (ScreenCompanyImagesResultDTO image: |
|||
dto) { |
|||
images.add(image.getUrl()); |
|||
} |
|||
customImgService.saveImages(images, id, CustomImageConstant.SCREEN_COMPANY_IMAGE); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,82 @@ |
|||
<?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.elink.esua.epdc.modules.epidemic.dao.ScreenCompanyDao"> |
|||
|
|||
<resultMap id="screenCompanyInfo" type="com.elink.esua.epdc.dto.ScreenCompanyDTO"> |
|||
<result property="id" column="ID"/> |
|||
<result property="companyName" column="COMPANY_NAME"/> |
|||
<result property="companyIntroduction" column="COMPANY_INTRODUCTION"/> |
|||
<result property="contactPerson" column="CONTACT_PERSON"/> |
|||
<result property="mobile" column="MOBILE"/> |
|||
<result property="companyAddress" column="COMPANY_ADDRESS"/> |
|||
<result property="uniformSocialCreditCode" column="UNIFORM_SOCIAL_CREDIT_CODE"/> |
|||
<result property="registeredCapital" column="REGISTERED_CAPITAL"/> |
|||
<result property="employedPopulation" column="EMPLOYED_POPULATION"/> |
|||
<result property="longitude" column="LONGITUDE"/> |
|||
<result property="latitude" column="LATITUDE"/> |
|||
<collection property="images" ofType="com.elink.esua.epdc.dto.result.ScreenCompanyImagesResultDTO"> |
|||
<result property="name" column="imageId"/> |
|||
<result property="url" column="IMG_URL"/> |
|||
</collection> |
|||
</resultMap> |
|||
<select id="selectCompanyInfoById" resultMap="screenCompanyInfo"> |
|||
SELECT |
|||
c.ID, |
|||
c.COMPANY_NAME, |
|||
c.COMPANY_INTRODUCTION, |
|||
c.CONTACT_PERSON, |
|||
c.MOBILE, |
|||
c.COMPANY_ADDRESS, |
|||
c.UNIFORM_SOCIAL_CREDIT_CODE, |
|||
c.REGISTERED_CAPITAL, |
|||
c.EMPLOYED_POPULATION, |
|||
c.LONGITUDE, |
|||
c.LATITUDE, |
|||
i.IMG_URL, |
|||
i.ID as imageId |
|||
FROM |
|||
epdc_screen_company c |
|||
LEFT JOIN epdc_custom_img i ON i.REFERENCE_ID = c.ID AND i.DEL_FLAG = '0' |
|||
WHERE |
|||
c.DEL_FLAG = '0' |
|||
AND c.ID = #{id} |
|||
</select> |
|||
|
|||
<resultMap id="screenCompanyInfoList" type="com.elink.esua.epdc.dto.result.EpdcScreenCompanyListResultDTO"> |
|||
<result property="id" column="ID"/> |
|||
<result property="companyName" column="COMPANY_NAME"/> |
|||
<result property="companyIntroduction" column="COMPANY_INTRODUCTION"/> |
|||
<result property="contactPerson" column="CONTACT_PERSON"/> |
|||
<result property="mobile" column="MOBILE"/> |
|||
<result property="companyAddress" column="COMPANY_ADDRESS"/> |
|||
<result property="longitude" column="LONGITUDE"/> |
|||
<result property="latitude" column="LATITUDE"/> |
|||
<collection property="images" ofType="java.lang.String"> |
|||
<result property="imgUrl" column="IMG_URL"/> |
|||
</collection> |
|||
</resultMap> |
|||
<select id="selectListOfCompanyListForScreen" resultMap="screenCompanyInfoList"> |
|||
SELECT |
|||
c.ID, |
|||
c.COMPANY_NAME, |
|||
c.COMPANY_INTRODUCTION, |
|||
c.CONTACT_PERSON, |
|||
c.MOBILE, |
|||
c.COMPANY_ADDRESS, |
|||
c.LONGITUDE, |
|||
c.LATITUDE, |
|||
i.IMG_URL |
|||
FROM |
|||
epdc_screen_company c |
|||
LEFT JOIN epdc_custom_img i ON i.REFERENCE_ID = c.ID AND i.DEL_FLAG = '0' |
|||
WHERE |
|||
c.DEL_FLAG = '0' |
|||
<if test="companyName != null and companyName != ''"> |
|||
and c.COMPANY_NAME like concat('%', #{companyName}, '%') |
|||
</if> |
|||
ORDER BY c.CREATED_TIME DESC |
|||
LIMIT #{pageIndex},#{pageSize} |
|||
</select> |
|||
|
|||
</mapper> |
|||
@ -0,0 +1,86 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.activity; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 活动详细时间段表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-02 |
|||
*/ |
|||
@Data |
|||
public class ActPeriodDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 活动ID |
|||
*/ |
|||
private String actId; |
|||
|
|||
/** |
|||
* 活动开始时间 |
|||
*/ |
|||
private Date actPeriodStartTime; |
|||
|
|||
/** |
|||
* 活动结束时间 |
|||
*/ |
|||
private Date actPeriodEndTime; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 删除标识 0:未删除 1:删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,81 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.activity; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 活动详细时间段用户关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-02 |
|||
*/ |
|||
@Data |
|||
public class ActPeriodUserDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 活动详细时间段表ID |
|||
*/ |
|||
private String actPeriodId; |
|||
|
|||
/** |
|||
* 活动用户关系表ID |
|||
*/ |
|||
private String actUserRelationId; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 删除标识 0:未删除 1:删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
package com.elink.esua.epdc.activity.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 活动报名 |
|||
*/ |
|||
@Data |
|||
public class EpdcActSignupFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 活动ID |
|||
*/ |
|||
@NotBlank(message = "活动ID不能为空") |
|||
private String actId; |
|||
|
|||
/** |
|||
* 参与活动时间段 |
|||
*/ |
|||
@NotNull(message = "参与活动时间段不能为空") |
|||
private List<String> actPeriodId; |
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.controller; |
|||
|
|||
import com.elink.esua.epdc.activity.ActPeriodDTO; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.modules.activity.service.ActPeriodService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 活动详细时间段表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-02 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("actperiod") |
|||
public class ActPeriodController { |
|||
|
|||
@Autowired |
|||
private ActPeriodService actPeriodService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<ActPeriodDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<ActPeriodDTO> page = actPeriodService.page(params); |
|||
return new Result<PageData<ActPeriodDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<ActPeriodDTO> get(@PathVariable("id") String id){ |
|||
ActPeriodDTO data = actPeriodService.get(id); |
|||
return new Result<ActPeriodDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody ActPeriodDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
actPeriodService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody ActPeriodDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
actPeriodService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
actPeriodService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,87 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.controller; |
|||
|
|||
import com.elink.esua.epdc.activity.ActPeriodUserDTO; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.modules.activity.service.ActPeriodUserService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 活动详细时间段用户关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-02 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("actperioduser") |
|||
public class ActPeriodUserController { |
|||
|
|||
@Autowired |
|||
private ActPeriodUserService actPeriodUserService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<ActPeriodUserDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<ActPeriodUserDTO> page = actPeriodUserService.page(params); |
|||
return new Result<PageData<ActPeriodUserDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<ActPeriodUserDTO> get(@PathVariable("id") String id){ |
|||
ActPeriodUserDTO data = actPeriodUserService.get(id); |
|||
return new Result<ActPeriodUserDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody ActPeriodUserDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
actPeriodUserService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody ActPeriodUserDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
actPeriodUserService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
actPeriodUserService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,67 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.dao; |
|||
|
|||
import com.elink.esua.epdc.activity.ActPeriodDTO; |
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.modules.activity.entity.ActPeriodEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 活动详细时间段表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-02 |
|||
*/ |
|||
@Mapper |
|||
public interface ActPeriodDao extends BaseDao<ActPeriodEntity> { |
|||
|
|||
/** |
|||
* 查询活动已报名的时间段 |
|||
* |
|||
* @param actId |
|||
* @return java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO> |
|||
* @author lc |
|||
* @since 2021/9/2 16:02 |
|||
*/ |
|||
List<ActPeriodDTO> selectPeriodsAlreadySignIn(String actId); |
|||
|
|||
/** |
|||
* 删除活动时间段 |
|||
* |
|||
* @param actId |
|||
* @return void |
|||
* @author lc |
|||
* @since 2021/9/2 15:30 |
|||
*/ |
|||
void modifyDelFlagByActId(String actId); |
|||
|
|||
/** |
|||
* 获取活动时间段 |
|||
* |
|||
* @param actId |
|||
* @return java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO> |
|||
* @author lc |
|||
* @since 2021/9/2 16:29 |
|||
*/ |
|||
List<ActPeriodDTO> selectListOfActPeriodsByActId(String actId); |
|||
List<ActPeriodDTO> selectActTimeByActId(String actId); |
|||
|
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.dao; |
|||
|
|||
import com.elink.esua.epdc.activity.ActPeriodDTO; |
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.modules.activity.entity.ActPeriodUserEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 活动详细时间段用户关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-02 |
|||
*/ |
|||
@Mapper |
|||
public interface ActPeriodUserDao extends BaseDao<ActPeriodUserEntity> { |
|||
|
|||
/** |
|||
* 获取用户报名时间段 |
|||
* |
|||
* @param actUserRelationId |
|||
* @return java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO> |
|||
* @author lc |
|||
* @since 2021/9/2 20:06 |
|||
*/ |
|||
List<ActPeriodDTO> selectListOfSignInActPeriodsByActUserRelationId(String actUserRelationId); |
|||
|
|||
/** |
|||
* 删除参与活动时间段记录 |
|||
* |
|||
* @param actUserRelationId |
|||
* @return void |
|||
* @author lc |
|||
* @since 2021/9/3 15:47 |
|||
*/ |
|||
void modifyActPeriodUserDelFlagByActUserRelationId(String actUserRelationId); |
|||
|
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 活动详细时间段表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-02 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_act_period") |
|||
public class ActPeriodEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 活动ID |
|||
*/ |
|||
private String actId; |
|||
|
|||
/** |
|||
* 活动开始时间 |
|||
*/ |
|||
private Date actPeriodStartTime; |
|||
|
|||
/** |
|||
* 活动结束时间 |
|||
*/ |
|||
private Date actPeriodEndTime; |
|||
|
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 活动详细时间段用户关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-02 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_act_period_user") |
|||
public class ActPeriodUserEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 活动详细时间段表ID |
|||
*/ |
|||
private String actPeriodId; |
|||
|
|||
/** |
|||
* 活动用户关系表ID |
|||
*/ |
|||
private String actUserRelationId; |
|||
|
|||
} |
|||
@ -0,0 +1,115 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.service; |
|||
|
|||
import com.elink.esua.epdc.activity.ActPeriodDTO; |
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.modules.activity.entity.ActPeriodEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 活动详细时间段表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-02 |
|||
*/ |
|||
public interface ActPeriodService extends BaseService<ActPeriodEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<ActPeriodDTO> |
|||
* @author generator |
|||
* @date 2021-09-02 |
|||
*/ |
|||
PageData<ActPeriodDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<ActPeriodDTO> |
|||
* @author generator |
|||
* @date 2021-09-02 |
|||
*/ |
|||
List<ActPeriodDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return ActPeriodDTO |
|||
* @author generator |
|||
* @date 2021-09-02 |
|||
*/ |
|||
ActPeriodDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-02 |
|||
*/ |
|||
void save(ActPeriodDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-02 |
|||
*/ |
|||
void update(ActPeriodDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-02 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* 删除活动时间段 |
|||
* |
|||
* @param actId |
|||
* @return void |
|||
* @author lc |
|||
* @since 2021/9/2 15:28 |
|||
*/ |
|||
void removeActPeriodsByActId(String actId); |
|||
|
|||
/** |
|||
* 获取活动时间段 |
|||
* |
|||
* @param actId |
|||
* @return java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO> |
|||
* @author lc |
|||
* @since 2021/9/2 16:13 |
|||
*/ |
|||
List<ActPeriodDTO> listOfActPeriodsByActId(String actId); |
|||
} |
|||
@ -0,0 +1,116 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.service; |
|||
|
|||
import com.elink.esua.epdc.activity.ActPeriodDTO; |
|||
import com.elink.esua.epdc.activity.ActPeriodUserDTO; |
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.modules.activity.entity.ActPeriodUserEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 活动详细时间段用户关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-02 |
|||
*/ |
|||
public interface ActPeriodUserService extends BaseService<ActPeriodUserEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<ActPeriodUserDTO> |
|||
* @author generator |
|||
* @date 2021-09-02 |
|||
*/ |
|||
PageData<ActPeriodUserDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<ActPeriodUserDTO> |
|||
* @author generator |
|||
* @date 2021-09-02 |
|||
*/ |
|||
List<ActPeriodUserDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return ActPeriodUserDTO |
|||
* @author generator |
|||
* @date 2021-09-02 |
|||
*/ |
|||
ActPeriodUserDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-02 |
|||
*/ |
|||
void save(ActPeriodUserDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-02 |
|||
*/ |
|||
void update(ActPeriodUserDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-02 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* 获取用户报名时间段 |
|||
* |
|||
* @param actUserRelationId |
|||
* @return java.util.List<com.elink.esua.epdc.activity.ActPeriodDTO> |
|||
* @author lc |
|||
* @since 2021/9/2 20:05 |
|||
*/ |
|||
List<ActPeriodDTO> listOfSignInActPeriodsByActUserRelationId(String actUserRelationId); |
|||
|
|||
/** |
|||
* 删除参与活动时间段记录 |
|||
* |
|||
* @param actUserRelationId |
|||
* @return void |
|||
* @author lc |
|||
* @since 2021/9/3 15:45 |
|||
*/ |
|||
void removeActPeriodUserByActUserRelationId(String actUserRelationId); |
|||
} |
|||
@ -0,0 +1,121 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.service.impl; |
|||
|
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.activity.ActPeriodDTO; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.modules.activity.dao.ActPeriodDao; |
|||
import com.elink.esua.epdc.modules.activity.entity.ActPeriodEntity; |
|||
import com.elink.esua.epdc.modules.activity.service.ActPeriodService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 活动详细时间段表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-02 |
|||
*/ |
|||
@Service |
|||
public class ActPeriodServiceImpl extends BaseServiceImpl<ActPeriodDao, ActPeriodEntity> implements ActPeriodService { |
|||
|
|||
@Override |
|||
public PageData<ActPeriodDTO> page(Map<String, Object> params) { |
|||
IPage<ActPeriodEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, ActPeriodDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<ActPeriodDTO> list(Map<String, Object> params) { |
|||
List<ActPeriodEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, ActPeriodDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<ActPeriodEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<ActPeriodEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public ActPeriodDTO get(String id) { |
|||
ActPeriodEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, ActPeriodDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(ActPeriodDTO dto) { |
|||
ActPeriodEntity entity = ConvertUtils.sourceToTarget(dto, ActPeriodEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(ActPeriodDTO dto) { |
|||
ActPeriodEntity entity = ConvertUtils.sourceToTarget(dto, ActPeriodEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void removeActPeriodsByActId(String actId) { |
|||
// 校验活动是否已有人报名,有人报名后不能修改活动时间段
|
|||
List<ActPeriodDTO> periods = baseDao.selectPeriodsAlreadySignIn(actId); |
|||
if (CollectionUtil.isNotEmpty(periods)) { |
|||
throw new RenException("活动时间段已有人报名,不能修改"); |
|||
} |
|||
baseDao.modifyDelFlagByActId(actId); |
|||
} |
|||
|
|||
@Override |
|||
public List<ActPeriodDTO> listOfActPeriodsByActId(String actId) { |
|||
List<ActPeriodDTO> data = baseDao.selectListOfActPeriodsByActId(actId); |
|||
if (CollectionUtil.isEmpty(data)) { |
|||
data = baseDao.selectActTimeByActId(actId); |
|||
} |
|||
return data; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,111 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.activity.ActPeriodDTO; |
|||
import com.elink.esua.epdc.activity.ActPeriodUserDTO; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.modules.activity.dao.ActPeriodUserDao; |
|||
import com.elink.esua.epdc.modules.activity.entity.ActPeriodUserEntity; |
|||
import com.elink.esua.epdc.modules.activity.service.ActPeriodUserService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 活动详细时间段用户关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-09-02 |
|||
*/ |
|||
@Service |
|||
public class ActPeriodUserServiceImpl extends BaseServiceImpl<ActPeriodUserDao, ActPeriodUserEntity> implements ActPeriodUserService { |
|||
|
|||
@Override |
|||
public PageData<ActPeriodUserDTO> page(Map<String, Object> params) { |
|||
IPage<ActPeriodUserEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, ActPeriodUserDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<ActPeriodUserDTO> list(Map<String, Object> params) { |
|||
List<ActPeriodUserEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, ActPeriodUserDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<ActPeriodUserEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<ActPeriodUserEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public ActPeriodUserDTO get(String id) { |
|||
ActPeriodUserEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, ActPeriodUserDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(ActPeriodUserDTO dto) { |
|||
ActPeriodUserEntity entity = ConvertUtils.sourceToTarget(dto, ActPeriodUserEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(ActPeriodUserDTO dto) { |
|||
ActPeriodUserEntity entity = ConvertUtils.sourceToTarget(dto, ActPeriodUserEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
public List<ActPeriodDTO> listOfSignInActPeriodsByActUserRelationId(String actUserRelationId) { |
|||
return baseDao.selectListOfSignInActPeriodsByActUserRelationId(actUserRelationId); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void removeActPeriodUserByActUserRelationId(String actUserRelationId) { |
|||
baseDao.modifyActPeriodUserDelFlagByActUserRelationId(actUserRelationId); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
<?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.elink.esua.epdc.modules.activity.dao.ActPeriodDao"> |
|||
|
|||
<select id="selectPeriodsAlreadySignIn" resultType="com.elink.esua.epdc.activity.ActPeriodDTO"> |
|||
SELECT |
|||
p.ID |
|||
FROM |
|||
epdc_act_period p |
|||
LEFT JOIN epdc_act_period_user pu ON pu.ACT_PERIOD_ID = p.ID |
|||
WHERE |
|||
p.DEL_FLAG = '0' |
|||
AND pu.DEL_FLAG = '0' |
|||
AND ACT_ID = #{actId} |
|||
</select> |
|||
|
|||
<update id="modifyDelFlagByActId"> |
|||
update epdc_act_period set del_flag = '1' where act_id = #{actId} |
|||
</update> |
|||
|
|||
<select id="selectListOfActPeriodsByActId" resultType="com.elink.esua.epdc.activity.ActPeriodDTO"> |
|||
SELECT |
|||
ID, |
|||
ACT_ID, |
|||
ACT_PERIOD_START_TIME, |
|||
ACT_PERIOD_END_TIME |
|||
FROM |
|||
epdc_act_period |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND ACT_ID = #{actId} |
|||
ORDER BY |
|||
ACT_PERIOD_START_TIME |
|||
</select> |
|||
|
|||
<select id="selectActTimeByActId" resultType="com.elink.esua.epdc.activity.ActPeriodDTO"> |
|||
SELECT ACT_START_TIME AS actPeriodStartTime, ACT_END_TIME AS actPeriodEndTime FROM epdc_act_info WHERE ID = #{actId} |
|||
</select> |
|||
|
|||
</mapper> |
|||
@ -0,0 +1,40 @@ |
|||
<?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.elink.esua.epdc.modules.activity.dao.ActPeriodUserDao"> |
|||
|
|||
<select id="selectListOfSignInActPeriodsByActUserRelationId" resultType="com.elink.esua.epdc.activity.ActPeriodDTO"> |
|||
SELECT |
|||
CASE |
|||
WHEN |
|||
p.ACT_PERIOD_START_TIME IS NULL THEN |
|||
t.ACT_START_TIME ELSE p.ACT_PERIOD_START_TIME |
|||
END AS actPeriodStartTime, |
|||
CASE |
|||
WHEN p.ACT_PERIOD_END_TIME IS NULL THEN |
|||
t.ACT_END_TIME ELSE p.ACT_PERIOD_END_TIME |
|||
END AS actPeriodEndTime |
|||
FROM |
|||
( |
|||
SELECT |
|||
ur.ID, |
|||
ai.ACT_START_TIME, |
|||
ai.ACT_END_TIME |
|||
FROM |
|||
epdc_act_user_relation ur |
|||
LEFT JOIN epdc_act_info ai ON ai.ID = ur.ACT_ID |
|||
WHERE |
|||
ur.ID = #{actUserRelationId} |
|||
) t |
|||
LEFT JOIN epdc_act_period_user pu ON pu.ACT_USER_RELATION_ID = t.ID |
|||
AND pu.DEL_FLAG = '0' |
|||
LEFT JOIN epdc_act_period p ON p.ID = pu.ACT_PERIOD_ID |
|||
AND p.DEL_FLAG = '0' |
|||
ORDER BY actPeriodStartTime |
|||
</select> |
|||
|
|||
<update id="modifyActPeriodUserDelFlagByActUserRelationId"> |
|||
update epdc_act_period_user set del_flag = '1' where ACT_USER_RELATION_ID = #{actUserRelationId} |
|||
</update> |
|||
|
|||
</mapper> |
|||
@ -0,0 +1,33 @@ |
|||
package com.elink.esua.epdc.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 大屏数据采集接口共 (17) 个 |
|||
* |
|||
* @author zhy |
|||
* @date 2021/6/29 14:41 |
|||
*/ |
|||
@Data |
|||
public class ScreenGovernanceParamDTO implements Serializable { |
|||
private static final long serialVersionUID = -6661828243095315569L; |
|||
|
|||
|
|||
/** |
|||
* 01、治理能力排行数据(按日统计)数据 |
|||
*/ |
|||
private String governrankdatadaily; |
|||
|
|||
/** |
|||
* 02、网格治理指数(天) |
|||
*/ |
|||
private String gridgoverndaily; |
|||
|
|||
/** |
|||
* 03、组织治理指数(天) |
|||
*/ |
|||
private String agencygoverndaily; |
|||
|
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.elink.esua.epdc.task.screen; |
|||
|
|||
/** |
|||
* 治理能力数据推送 |
|||
* |
|||
* @author zhy |
|||
* @date 2021/6/28 10:42 |
|||
*/ |
|||
public interface ScreenGovernancePushTask { |
|||
|
|||
/** |
|||
* 大屏数据推送 |
|||
* |
|||
* @param param 入参 |
|||
* 参数格式:{'gridPartyMemberData':'2020-08','gridPartyAbility':'2020-08','orgPartyAbility':'2020-08','gridServiceAbility':'2020-08','orgServiceAbility':'2020-08','gridGovernAbility':'2020-08','orgGovernAbility':'2020-08','deptGovernAbility':'2020-08','all':'2020-08'} |
|||
* @return void |
|||
* @author Liuchuang |
|||
* @since 2020/9/9 15:21 |
|||
*/ |
|||
void run(String param); |
|||
} |
|||
@ -0,0 +1,97 @@ |
|||
package com.elink.esua.epdc.task.screen; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.elink.esua.epdc.dto.ScreenGovernanceParamDTO; |
|||
import com.elink.esua.epdc.dto.screen.form.ScreenJobFormDTO; |
|||
import com.elink.esua.epdc.feign.AnalysisFeignClient; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 治理能力数据推送 |
|||
* |
|||
* @author zhy |
|||
* @date 2021/6/28 10:42 |
|||
*/ |
|||
@Component("screenGovernancePushTask") |
|||
public class ScreenGovernancePushTaskImpl implements ScreenGovernancePushTask { |
|||
|
|||
private final Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
@Autowired |
|||
private AnalysisFeignClient analysisFeignClient; |
|||
|
|||
@Override |
|||
public void run(String param) { |
|||
// 参数处理
|
|||
ScreenGovernanceParamDTO paramDto = new ScreenGovernanceParamDTO(); |
|||
if (StringUtils.isNotEmpty(param)) { |
|||
paramDto = JSONObject.parseObject(param, ScreenGovernanceParamDTO.class); |
|||
} |
|||
// 01、治理能力排行数据(按日统计)数据
|
|||
governrankdatadaily(paramDto.getGovernrankdatadaily()); |
|||
// 02、网格治理指数(天)
|
|||
gridgoverndaily(paramDto.getGridgoverndaily()); |
|||
// 03、组织治理指数(天)
|
|||
agencygoverndaily(paramDto.getAgencygoverndaily()); |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 01、治理能力排行数据(按日统计)数据 |
|||
* |
|||
* @param yearMonth 统计月份,格式yyyyMMdd |
|||
* @return void |
|||
* @author zhy |
|||
* @date 2021/6/28 10:47 |
|||
*/ |
|||
public void governrankdatadaily(String yearMonth) { |
|||
ScreenJobFormDTO formDto = new ScreenJobFormDTO(); |
|||
formDto.setYearMonth(yearMonth); |
|||
// 方法名
|
|||
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
|||
logger.info("<" + methodName + "|治理能力排行数据(按日统计)数据>定时任务开始执行" + yearMonth); |
|||
analysisFeignClient.governrankdatadaily(formDto); |
|||
logger.info("<" + methodName + "|治理能力排行数据(按日统计)数据>定时任务执行结束"); |
|||
} |
|||
|
|||
/** |
|||
* 02、网格治理指数(天) |
|||
* |
|||
* @param yearMonth |
|||
* @return void |
|||
* @author zhy |
|||
* @date 2021/6/28 10:47 |
|||
*/ |
|||
public void gridgoverndaily(String yearMonth) { |
|||
ScreenJobFormDTO formDto = new ScreenJobFormDTO(); |
|||
formDto.setYearMonth(yearMonth); |
|||
// 方法名
|
|||
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
|||
logger.info("<" + methodName + "|网格治理指数>定时任务开始执行"); |
|||
analysisFeignClient.gridgoverndaily(formDto); |
|||
logger.info("<" + methodName + "|网格治理指数>定时任务执行结束"); |
|||
} |
|||
|
|||
/** |
|||
* 03、组织治理指数(天) |
|||
* |
|||
* @param yearMonth |
|||
* @return void |
|||
* @author zhy |
|||
* @date 2021/6/28 10:47 |
|||
*/ |
|||
public void agencygoverndaily(String yearMonth) { |
|||
ScreenJobFormDTO formDto = new ScreenJobFormDTO(); |
|||
formDto.setYearMonth(yearMonth); |
|||
// 方法名
|
|||
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); |
|||
logger.info("<" + methodName + "|组织治理指数>定时任务开始执行"); |
|||
analysisFeignClient.agencygoverndaily(formDto); |
|||
logger.info("<" + methodName + "|组织治理指数>定时任务执行结束"); |
|||
} |
|||
|
|||
} |
|||
Loading…
Reference in new issue