Commit 2358b46b authored by tianyiming's avatar tianyiming

两员配备-三项制度统计统计表数据

parent ed09931b
...@@ -17,6 +17,7 @@ public class DateUtils { ...@@ -17,6 +17,7 @@ public class DateUtils {
public static final String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; public static final String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
public static final String MINUTE_PATTERN = "yyyy-MM-dd HH:mm"; public static final String MINUTE_PATTERN = "yyyy-MM-dd HH:mm";
public static final String DATE_HOUR_PATTERN = "yyyy-MM-dd HH";
public static final String HOUR_PATTERN = "yyyy-MM-dd HH:mm:ss"; public static final String HOUR_PATTERN = "yyyy-MM-dd HH:mm:ss";
public static final String DATE_PATTERN = "yyyy-MM-dd"; public static final String DATE_PATTERN = "yyyy-MM-dd";
public static final String MONTH_PATTERN = "yyyy-MM"; public static final String MONTH_PATTERN = "yyyy-MM";
......
...@@ -26,12 +26,22 @@ public class ThreeSystemsDto extends BaseDto { ...@@ -26,12 +26,22 @@ public class ThreeSystemsDto extends BaseDto {
@ApiModelProperty(value = "监管单位名称") @ApiModelProperty(value = "监管单位名称")
private String supervisoryUnitName; private String supervisoryUnitName;
@ApiModelProperty(value = "监管单位orgcode") @ApiModelProperty(value = "监管单位orgCode")
private String supervisoryUnitOrgcode; private String supervisoryUnitOrgCode;
@ApiModelProperty(value = "监管单位等级") @ApiModelProperty(value = "监管单位等级")
private String supervisoryUnitLevel; private String supervisoryUnitLevel;
@ApiModelProperty(value = "使用单位类型")
private String unitType;
@ApiModelProperty(value = "使用单位统一信用代码")
private String useCode;
@ApiModelProperty(value = "检查状态")
private String checkStatus;
@ApiModelProperty(value = "占比") @ApiModelProperty(value = "占比")
private String proportion; private String proportion;
...@@ -48,7 +58,7 @@ public class ThreeSystemsDto extends BaseDto { ...@@ -48,7 +58,7 @@ public class ThreeSystemsDto extends BaseDto {
private String planType; private String planType;
@ApiModelProperty(value = "统计日期") @ApiModelProperty(value = "统计日期")
private Date checkDate; private String checkDate;
@ApiModelProperty(value = "统计开始日期") @ApiModelProperty(value = "统计开始日期")
private Date startDate; private Date startDate;
......
...@@ -39,8 +39,8 @@ public class ThreeSystems extends BaseEntity { ...@@ -39,8 +39,8 @@ public class ThreeSystems extends BaseEntity {
/** /**
* 监管单位orgcode * 监管单位orgcode
*/ */
@TableField("supervisory_unit_orgcode") @TableField("supervisory_unit_org_code")
private String supervisoryUnitOrgcode; private String supervisoryUnitOrgCode;
/** /**
* 监管单位等级 * 监管单位等级
...@@ -82,6 +82,6 @@ public class ThreeSystems extends BaseEntity { ...@@ -82,6 +82,6 @@ public class ThreeSystems extends BaseEntity {
* 统计日期 * 统计日期
*/ */
@TableField("check_date") @TableField("check_date")
private Date checkDate; private String checkDate;
} }
package com.yeejoin.amos.boot.module.tcm.api.mapper; package com.yeejoin.amos.boot.module.tcm.api.mapper;
import com.yeejoin.amos.boot.module.tcm.api.dto.ThreeSystemsDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.ThreeSystems; import com.yeejoin.amos.boot.module.tcm.api.entity.ThreeSystems;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* Mapper 接口 * Mapper 接口
* *
* @author system_generator * @author system_generator
* @date 2023-11-01 * @date 2023-11-01
*/ */
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);
void saveOrUpdateBatch(@Param("resultList") List<ThreeSystems> resultList);
List<ThreeSystemsDto> getOldCompanyThreeSystemsStatisticsList(@Param("type") Integer type, @Param("lastStart") String lastStart);
} }
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tcm.api.mapper; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tcm.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tcm.api.dto.ThreeSystemsDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyCheckDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyCheckDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing; import com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing;
......
...@@ -15,4 +15,7 @@ import java.util.List; ...@@ -15,4 +15,7 @@ import java.util.List;
public interface IThreeSystemsService { public interface IThreeSystemsService {
List<ThreeSystems> getStatisticsMessage(List<LinkedHashMap> list, String planType, String startDate, String endDate); List<ThreeSystems> getStatisticsMessage(List<LinkedHashMap> list, String planType, String startDate, String endDate);
void getThreeSystemsStatistics(String type);
} }
...@@ -25,6 +25,5 @@ public interface ITzsTwoStaffingService { ...@@ -25,6 +25,5 @@ public interface ITzsTwoStaffingService {
Page<TzsTwoStaffingCompanyCheckDto> getCompanyCheckList(String orgCode, TzsTwoStaffingCompanyCheckDto companyDto, Page<TzsTwoStaffingCompanyCheckDto> page); Page<TzsTwoStaffingCompanyCheckDto> getCompanyCheckList(String orgCode, TzsTwoStaffingCompanyCheckDto companyDto, Page<TzsTwoStaffingCompanyCheckDto> page);
void getThreeSystemsStatistics();
} }
...@@ -2,4 +2,101 @@ ...@@ -2,4 +2,101 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.tcm.api.mapper.ThreeSystemsMapper"> <mapper namespace="com.yeejoin.amos.boot.module.tcm.api.mapper.ThreeSystemsMapper">
<select id="getCompanyThreeSystemsStatisticsList"
resultType="com.yeejoin.amos.boot.module.tcm.api.dto.ThreeSystemsDto">
SELECT
ei.use_code useCode,
ei.supervise_org_code supervisoryUnitOrgCode,
ei.unit_type unitType,
CASE
WHEN (
SELECT COUNT
( 1 )
FROM
amos_tzs_biz.p_plan_task pt
WHERE
pt.finish_status = '2'
AND ppt.use_code = pt.use_code
AND pt.check_date BETWEEN #{startDay}
AND #{endDay}
AND pt.plan_type = #{type}
) > 0 THEN
1 ELSE 0
END AS checkStatus
FROM
amos_tzs_biz.tz_base_enterprise_info ei
LEFT JOIN amos_tzs_biz.p_plan_task ppt ON ei.use_code = ppt.use_code
GROUP BY
ei.use_code
</select>
<select id="saveOrUpdateBatch">
INSERT INTO "amos_tzs_biz"."tzs_three_systems" (
"sequence_nbr",
"rec_date",
"rec_user_id",
"rec_user_name",
"is_delete",
"supervisory_unit_id",
"supervisory_unit_name",
"supervisory_unit_org_code",
"supervisory_unit_level",
"proportion",
"registered_num",
"check_num",
"finish_check_num",
"plan_type",
"check_date"
)
VALUES <foreach collection="resultList" item="item" index="index" separator=",">
(
#{item.sequenceNbr},
#{item.recDate},
#{item.recUserId},
#{item.recUserName},
false,
#{item.supervisoryUnitId},
#{item.supervisoryUnitName},
#{item.supervisoryUnitOrgCode},
#{item.supervisoryUnitLevel},
#{item.proportion},
#{item.registeredNum},
#{item.checkNum},
#{item.finishCheckNum},
#{item.planType},
#{item.checkDate}
)
</foreach>
on conflict (supervisory_unit_org_code,plan_type,check_date) do update set
"sequence_nbr" = EXCLUDED."sequence_nbr",
"rec_date" = EXCLUDED."rec_date",
"rec_user_id" = EXCLUDED."rec_user_id",
"rec_user_name" = EXCLUDED."rec_user_name",
"is_delete" = EXCLUDED."is_delete",
"supervisory_unit_id" = EXCLUDED."supervisory_unit_id",
"supervisory_unit_name" = EXCLUDED."supervisory_unit_name",
"supervisory_unit_org_code" = EXCLUDED."supervisory_unit_org_code",
"supervisory_unit_level" = EXCLUDED."supervisory_unit_level",
"proportion" = EXCLUDED."proportion",
"registered_num" = EXCLUDED."registered_num",
"check_num" = EXCLUDED."check_num",
"finish_check_num" = EXCLUDED."finish_check_num",
"plan_type" = EXCLUDED."plan_type",
"check_date" = EXCLUDED."check_date"
</select>
<select id="getOldCompanyThreeSystemsStatisticsList"
resultType="com.yeejoin.amos.boot.module.tcm.api.dto.ThreeSystemsDto">
SELECT
*
FROM
tzs_three_systems
WHERE
plan_type = #{type}
AND check_date = #{lastStart}
</select>
</mapper> </mapper>
...@@ -49,4 +49,13 @@ public class ThreeSystemsController<string> extends BaseController { ...@@ -49,4 +49,13 @@ public class ThreeSystemsController<string> extends BaseController {
return ResponseHelper.buildResponse(threeSystemsPage); return ResponseHelper.buildResponse(threeSystemsPage);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getThreeSystemsStatistics")
@ApiOperation(httpMethod = "GET", value = "生成三项制度统计", notes = "生成三项制度统计")
public ResponseModel<Object> getThreeSystemsStatistics(@RequestParam(value = "type") String type) {
iThreeSystemsService.getThreeSystemsStatistics(type);
return ResponseHelper.buildResponse("ok");
}
} }
...@@ -130,12 +130,4 @@ public class TzsTwoStaffingController extends BaseController { ...@@ -130,12 +130,4 @@ public class TzsTwoStaffingController extends BaseController {
return ResponseHelper.buildResponse(tzsTwoStaffingService.getCompanyCheckList(orgCode, companyDto,page)); return ResponseHelper.buildResponse(tzsTwoStaffingService.getCompanyCheckList(orgCode, companyDto,page));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getThreeSystemsStatistics")
@ApiOperation(httpMethod = "GET", value = "生成三项制度统计", notes = "生成三项制度统计")
public ResponseModel<Object> getThreeSystemsStatistics() {
tzsTwoStaffingService.getThreeSystemsStatistics();
return ResponseHelper.buildResponse("ok");
}
} }
...@@ -5,6 +5,7 @@ import com.google.common.collect.Lists; ...@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tcm.api.common.BizCommonConstant; import com.yeejoin.amos.boot.module.tcm.api.common.BizCommonConstant;
import com.yeejoin.amos.boot.module.tcm.api.dto.ThreeSystemsDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyCheckDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyCheckDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingDto;
...@@ -27,10 +28,7 @@ import java.math.BigDecimal; ...@@ -27,10 +28,7 @@ import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -160,12 +158,8 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto, Tz ...@@ -160,12 +158,8 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto, Tz
return tzsTwoStaffingMapper.getCompanyCheckList(page, orgCode, companyDto); return tzsTwoStaffingMapper.getCompanyCheckList(page, orgCode, companyDto);
} }
@Override
public void getThreeSystemsStatistics() {
}
private List<LinkedHashMap<String, Object>> getSupervisionList() { public List<LinkedHashMap<String, Object>> getSupervisionList() {
List<LinkedHashMap<String, Object>> supervisionList = List<LinkedHashMap<String, Object>> supervisionList =
(List<LinkedHashMap<String, Object>>) redisUtils.get(BizCommonConstant.REGULATOR_UNIT_LIST); (List<LinkedHashMap<String, Object>>) redisUtils.get(BizCommonConstant.REGULATOR_UNIT_LIST);
if (ValidationUtil.isEmpty(supervisionList)) { if (ValidationUtil.isEmpty(supervisionList)) {
......
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