Commit 9e326fe7 authored by tianyiming's avatar tianyiming

两个规定-三项制度统计优化

parent 8fc4bbc7
...@@ -15,7 +15,9 @@ import java.util.List; ...@@ -15,7 +15,9 @@ import java.util.List;
*/ */
public interface ThreeSystemsMapper extends BaseMapper<ThreeSystems> { public interface ThreeSystemsMapper extends BaseMapper<ThreeSystems> {
List<ThreeSystemsDto> getCompanyThreeSystemsStatisticsList(@Param("type") Integer type, @Param("startDay") String startDay, @Param("endDay") String endDay); List<ThreeSystemsDto> getCompanyThreeSystemsStatisticsList(@Param("staticTableName") String staticTableName,
@Param("startDay") String startDay,
@Param("endDay") String endDay);
void saveOrUpdateBatch(@Param("resultList") List<ThreeSystems> resultList); void saveOrUpdateBatch(@Param("resultList") List<ThreeSystems> resultList);
......
...@@ -10,27 +10,26 @@ ...@@ -10,27 +10,26 @@
ei.supervise_org_code supervisoryUnitOrgCode, ei.supervise_org_code supervisoryUnitOrgCode,
ei.unit_type unitType, ei.unit_type unitType,
CASE CASE
WHEN ( WHEN (
SELECT COUNT SELECT COUNT
( 1 ) ( 1 )
FROM FROM
amos_tzs_biz.p_plan_task pt ${staticTableName} pt
WHERE WHERE
pt.finish_status = '2' pt.not_start = 0
AND ppt.use_code = pt.use_code AND pt.time_out = 0
AND pt.check_date BETWEEN #{startDay} AND (pt.risk_end > 0 or pt.no_risk_end > 0)
AND psd.unit_code = pt.unit_code
AND pt.check_time BETWEEN #{startDay}
AND #{endDay} AND #{endDay}
AND pt.plan_type = #{type}
) > 0 THEN ) > 0 THEN
1 ELSE 0 1 ELSE 0
END AS checkStatus END AS checkStatus
FROM FROM
amos_tzs_biz.tz_base_enterprise_info ei tz_base_enterprise_info ei
LEFT JOIN amos_tzs_biz.p_plan_task ppt ON ei.use_code = ppt.use_code LEFT JOIN ${staticTableName} psd ON ei.use_code = psd.unit_code
GROUP BY GROUP BY
ei.use_code ei.use_code
</select> </select>
<select id="saveOrUpdateBatch"> <select id="saveOrUpdateBatch">
......
...@@ -24,7 +24,7 @@ import java.util.LinkedHashMap; ...@@ -24,7 +24,7 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
@RestController @RestController
@Api(tags = "三个规定统计") @Api(tags = "三个制度统计")
@RequestMapping(value = "/threeProvisions") @RequestMapping(value = "/threeProvisions")
public class ThreeSystemsController<string> extends BaseController { public class ThreeSystemsController<string> extends BaseController {
private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE"; private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE";
......
...@@ -228,8 +228,11 @@ public class ThreeSystemsServiceImpl extends BaseService<ThreeSystemsDto, ThreeS ...@@ -228,8 +228,11 @@ public class ThreeSystemsServiceImpl extends BaseService<ThreeSystemsDto, ThreeS
lastEnd = DateUtils.convertDateToString(c.getTime(), DateUtils.DATE_PATTERN) + end; lastEnd = DateUtils.convertDateToString(c.getTime(), DateUtils.DATE_PATTERN) + end;
} }
} }
// todo 此处统计表名通过接口查询得到 接口暂未实现
String planType = type.toString();
String staticTableName = "p_static_day";
//获取当天、本周、本月新的数据 //获取当天、本周、本月新的数据
newStaffingCompanyList = threeSystemsMapper.getCompanyThreeSystemsStatisticsList(type, startDay, endDay); newStaffingCompanyList = threeSystemsMapper.getCompanyThreeSystemsStatisticsList(staticTableName, startDay, endDay);
//调用三项制度统计方法处理数据 //调用三项制度统计方法处理数据
resultList = getThreeSystems(supervisionList, newStaffingCompanyList, type, startDay, true); resultList = getThreeSystems(supervisionList, newStaffingCompanyList, type, startDay, true);
//将新数据存入统计表中 //将新数据存入统计表中
...@@ -241,7 +244,9 @@ public class ThreeSystemsServiceImpl extends BaseService<ThreeSystemsDto, ThreeS ...@@ -241,7 +244,9 @@ public class ThreeSystemsServiceImpl extends BaseService<ThreeSystemsDto, ThreeS
//获取日/周/月的历史数据 //获取日/周/月的历史数据
oldStaffingCompanyList = threeSystemsMapper.getOldCompanyThreeSystemsStatisticsList(type, DateUtils.dateToString(lastStart)); oldStaffingCompanyList = threeSystemsMapper.getOldCompanyThreeSystemsStatisticsList(type, DateUtils.dateToString(lastStart));
//获取日/周/月历史数据的最新状态数据 //获取日/周/月历史数据的最新状态数据
List<ThreeSystemsDto> oldNewStaffingCompanyList = threeSystemsMapper.getCompanyThreeSystemsStatisticsList(type, lastStart, lastEnd); // todo 此处统计表名通过接口查询得到 接口暂未实现
List<ThreeSystemsDto> oldNewStaffingCompanyList = threeSystemsMapper.getCompanyThreeSystemsStatisticsList(staticTableName, lastStart, lastEnd);
if (!ValidationUtil.isEmpty(oldNewStaffingCompanyList)) { if (!ValidationUtil.isEmpty(oldNewStaffingCompanyList)) {
// 调用三项制度统计方法处理数据 // 调用三项制度统计方法处理数据
oldList = ValidationUtil.isEmpty(oldStaffingCompanyList) ? oldList = ValidationUtil.isEmpty(oldStaffingCompanyList) ?
...@@ -266,6 +271,7 @@ public class ThreeSystemsServiceImpl extends BaseService<ThreeSystemsDto, ThreeS ...@@ -266,6 +271,7 @@ public class ThreeSystemsServiceImpl extends BaseService<ThreeSystemsDto, ThreeS
/** /**
* 三项制度统计数据方法 * 三项制度统计数据方法
*
* @param supervisionList 行政区划列表 * @param supervisionList 行政区划列表
* @param StaffingCompanyList 需要统计处理的数据列表 * @param StaffingCompanyList 需要统计处理的数据列表
* @param type 统计类型 * @param type 统计类型
......
...@@ -156,6 +156,7 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto, Tz ...@@ -156,6 +156,7 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto, Tz
companyDto.setCheckStartTime(ObjectUtils.isEmpty(companyDto.getCheckStartTime()) ? startDay : companyDto.getCheckStartTime()); companyDto.setCheckStartTime(ObjectUtils.isEmpty(companyDto.getCheckStartTime()) ? startDay : companyDto.getCheckStartTime());
companyDto.setCheckEndTime(ObjectUtils.isEmpty(companyDto.getCheckEndTime()) ? endDay : companyDto.getCheckEndTime()); companyDto.setCheckEndTime(ObjectUtils.isEmpty(companyDto.getCheckEndTime()) ? endDay : companyDto.getCheckEndTime());
// todo 此处统计表名通过接口查询得到 接口暂未实现 // todo 此处统计表名通过接口查询得到 接口暂未实现
String planType = companyDto.getPlanType();
String staticTableName = "p_static_day"; String staticTableName = "p_static_day";
return tzsTwoStaffingMapper.getCompanyCheckList(page, orgCode, staticTableName, companyDto); return tzsTwoStaffingMapper.getCompanyCheckList(page, orgCode, staticTableName, companyDto);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment