Commit 7ff006e3 authored by tianyiming's avatar tianyiming

两员配备-企业两员配备情况查询

parent 6b672855
package com.yeejoin.amos.boot.module.tcm.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
*
* @author system_generator
* @date 2023-10-27
*/
@Data
@ApiModel(value="TzsTwoStaffingCompanyDto", description="")
public class TzsTwoStaffingCompanyDto {
@ApiModelProperty(value = "监管单位ID")
private String sequenceNbr;
@ApiModelProperty(value = "监管单位名称")
private String superviseOrgName;
@ApiModelProperty(value = "监管单位orgCode")
private String superviseOrgCode;
@ApiModelProperty(value = "单位类型")
private String unitType;
@ApiModelProperty(value = "企业名称")
private String useUnit;
@ApiModelProperty(value = "企业编码")
private String useCode;
@ApiModelProperty(value = "企业类型")
private String mainCharger;
@ApiModelProperty(value = "完成配备")
private String completeNormal;
@ApiModelProperty(value = "使用单位完成配备")
private String useDone;
@ApiModelProperty(value = "生产单位完成配备")
private String productDone;
@ApiModelProperty(value = "完成配备")
private String allDone;
//下述字段待定
@ApiModelProperty(value = "主要负责人数")
private String mainNum;
@ApiModelProperty(value = "安全总监数")
private String majordomoNum;
@ApiModelProperty(value = "安全员数")
private String safetyNum;
@ApiModelProperty(value = "质量安全总监数")
private String QualityMajNumber;
@ApiModelProperty(value = "质量安全员数")
private String QualitySafetyNum;
}
package com.yeejoin.amos.boot.module.tcm.api.mapper; package com.yeejoin.amos.boot.module.tcm.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -14,5 +16,8 @@ import java.util.List; ...@@ -14,5 +16,8 @@ import java.util.List;
*/ */
public interface TzsTwoStaffingMapper extends BaseMapper<TzsTwoStaffing> { public interface TzsTwoStaffingMapper extends BaseMapper<TzsTwoStaffing> {
Page<TzsTwoStaffingCompanyDto> getCompanyList(@Param("page")Page<TzsTwoStaffingCompanyDto> page,
@Param("companyDto") TzsTwoStaffingCompanyDto companyDto,
@Param("orgCode") String orgCode);
List<TzsTwoStaffing> getListByOrgCode(@Param("orgCode")String orgCode, @Param("type")String type); List<TzsTwoStaffing> getListByOrgCode(@Param("orgCode")String orgCode, @Param("type")String type);
} }
package com.yeejoin.amos.boot.module.tcm.api.service; package com.yeejoin.amos.boot.module.tcm.api.service;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing; import com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
...@@ -15,4 +20,5 @@ import java.util.List; ...@@ -15,4 +20,5 @@ import java.util.List;
public interface ITzsTwoStaffingService { public interface ITzsTwoStaffingService {
List<TzsTwoStaffing> getStatisticsMessage(List<LinkedHashMap> list); List<TzsTwoStaffing> getStatisticsMessage(List<LinkedHashMap> list);
Page<TzsTwoStaffingCompanyDto> getCompanyList(String orgCode, TzsTwoStaffingCompanyDto companyDto,Page<TzsTwoStaffingCompanyDto> page);
} }
...@@ -2,6 +2,24 @@ ...@@ -2,6 +2,24 @@
<!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.TzsTwoStaffingMapper"> <mapper namespace="com.yeejoin.amos.boot.module.tcm.api.mapper.TzsTwoStaffingMapper">
<select id="getCompanyList" resultType="com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto">
SELECT
*
FROM
view_two_staffing
where
supervise_org_code like concat('%',#{orgCode},'%')
<if test="companyDto.unitType != '' and companyDto.unitType != null">
and unit_type like concat('%',#{companyDto.unitType},'%')
</if>
<if test="companyDto.useUnit != '' and companyDto.useUnit != null">
and unit_unit like concat('%',#{companyDto.useUnit},'%')
</if>
<if test="companyDto.useCode != '' and companyDto.useCode != null">
and use_code like concat('%',#{companyDto.useCode},'%')
</if>
</select>
<select id="getListByOrgCode" resultType="com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing"> <select id="getListByOrgCode" resultType="com.yeejoin.amos.boot.module.tcm.api.entity.TzsTwoStaffing">
</select> </select>
......
package com.yeejoin.amos.boot.module.tcm.biz.controller; package com.yeejoin.amos.boot.module.tcm.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingCompanyDto;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
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.service.ITzsTwoStaffingService; import com.yeejoin.amos.boot.module.tcm.api.service.ITzsTwoStaffingService;
import com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzsUserInfoServiceImpl; import com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzsUserInfoServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -29,11 +43,10 @@ import java.util.List; ...@@ -29,11 +43,10 @@ import java.util.List;
@Api(tags = "统计") @Api(tags = "统计")
@RequestMapping(value = "/twoStaff") @RequestMapping(value = "/twoStaff")
public class TzsTwoStaffingController extends BaseController { public class TzsTwoStaffingController extends BaseController {
private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE";
@Autowired @Autowired
private ITzsTwoStaffingService tzsTwoStaffingService; private ITzsTwoStaffingService tzsTwoStaffingService;
private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE";
@Autowired @Autowired
private TzsUserInfoServiceImpl tzsUserInfoServiceImpl; private TzsUserInfoServiceImpl tzsUserInfoServiceImpl;
...@@ -41,6 +54,21 @@ public class TzsTwoStaffingController extends BaseController { ...@@ -41,6 +54,21 @@ public class TzsTwoStaffingController extends BaseController {
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getCompanyList")
@ApiOperation(httpMethod = "GET", value = "企业两员配备情况查询", notes = "企业两员配备情况查询")
public ResponseModel<IPage<TzsTwoStaffingCompanyDto>> getCompanyList(@RequestParam(value = "orgCode") String orgCode,
@RequestParam(value = "current") String current,
@RequestParam(value = "size") String size,
TzsTwoStaffingCompanyDto companyDto) {
Page<TzsTwoStaffingCompanyDto> page = new Page<>();
page.setCurrent(Long.parseLong(current));
page.setSize(Long.parseLong(size));
return ResponseHelper.buildResponse(tzsTwoStaffingService.getCompanyList(orgCode, companyDto,page));
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getTree") @GetMapping(value = "/getTree")
......
package com.yeejoin.amos.boot.module.tcm.biz.service.impl; package com.yeejoin.amos.boot.module.tcm.biz.service.impl;
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;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsTwoStaffingMapper; import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsTwoStaffingMapper;
import com.yeejoin.amos.boot.module.tcm.api.service.ITzsTwoStaffingService; import com.yeejoin.amos.boot.module.tcm.api.service.ITzsTwoStaffingService;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsTwoStaffingDto;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
...@@ -21,19 +24,25 @@ import java.util.List; ...@@ -21,19 +24,25 @@ import java.util.List;
* @date 2023-10-27 * @date 2023-10-27
*/ */
@Service @Service
public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto,TzsTwoStaffing,TzsTwoStaffingMapper> implements ITzsTwoStaffingService { public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto, TzsTwoStaffing, TzsTwoStaffingMapper> implements ITzsTwoStaffingService {
@Autowired
TzsTwoStaffingMapper tzsTwoStaffingMapper;
/** /**
* 分页查询 * 分页查询
*/ */
public Page<TzsTwoStaffingDto> queryForTzsTwoStaffingPage(Page<TzsTwoStaffingDto> page) { public Page<TzsTwoStaffingDto> queryForTzsTwoStaffingPage(Page<TzsTwoStaffingDto> page) {
return this.queryForPage(page, null, false); return this.queryForPage(page, null, false);
} }
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<TzsTwoStaffingDto> queryForTzsTwoStaffingList() { public List<TzsTwoStaffingDto> queryForTzsTwoStaffingList() {
return this.queryForList("" , false); return this.queryForList("", false);
} }
@Override @Override
...@@ -59,4 +68,36 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto,Tzs ...@@ -59,4 +68,36 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto,Tzs
} }
return result; return result;
} }
@Override
public Page<TzsTwoStaffingCompanyDto> getCompanyList(String orgCode, TzsTwoStaffingCompanyDto companyDto, Page<TzsTwoStaffingCompanyDto> page) {
Page<TzsTwoStaffingCompanyDto> companyList = tzsTwoStaffingMapper.getCompanyList(page, companyDto, orgCode);
companyList.getRecords().stream().map(item -> {
if (item.getUnitType().contains("使用单位")) {
item.setCompleteNormal(Integer.valueOf(item.getUseDone()) > 1 ? "是" : "否");
}
if (item.getUnitType().contains("充装单位")
|| item.getUnitType().contains("安装改造维修单位")
|| item.getUnitType().contains("制造单位")
|| item.getUnitType().contains("设计单位")) {
item.setCompleteNormal(Integer.valueOf(item.getProductDone()) > 1 ? "是" : "否");
}
if (item.getUnitType().contains("使用单位") && (item.getUnitType().contains("充装单位")
|| item.getUnitType().contains("安装改造维修单位")
|| item.getUnitType().contains("制造单位")
|| item.getUnitType().contains("设计单位"))) {
item.setCompleteNormal(Integer.valueOf(item.getAllDone()) > 1 ? "是" : "否");
}
return item;
});
return companyList;
}
} }
\ No newline at end of file
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