e0ff6529b4364fdbf81d25f33e881118b147b3fa..869edb425d2e931d756c756c16ee5b3f42ee027a
2023-08-04 zf
bug修改
869edb 对比 | 目录
2023-08-04 zf
bug修改
145d00 对比 | 目录
已修改12个文件
176 ■■■■ 文件已修改
src/main/java/com/gk/hotwork/Controller/LoginController.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gk/hotwork/Controller/UserController.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gk/hotwork/Domain/SafetySelfInspection.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gk/hotwork/Domain/Utils/Constants.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gk/hotwork/Mapper/SafetyInspectionItemMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gk/hotwork/Mapper/mybatis/InspectionHiddenDangerMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyInspectionItemMapper.xml 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gk/hotwork/Mapper/mybatis/UserInfoMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetyInspectionItemImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-dev.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-prod.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/gk/hotwork/Controller/LoginController.java
@@ -9,11 +9,8 @@
import com.gk.hotwork.Config.Oauth2.IRedisService;
import com.gk.hotwork.Config.Oauth2.OauthRole;
import com.gk.hotwork.Config.Oauth2.RedisKeyEnum;
import com.gk.hotwork.Domain.AuthorizationInfo;
import com.gk.hotwork.Domain.ExamScoreInfo;
import com.gk.hotwork.Domain.*;
import com.gk.hotwork.Domain.Exception.BusinessException;
import com.gk.hotwork.Domain.UserFace;
import com.gk.hotwork.Domain.UserInfo;
import com.gk.hotwork.Domain.Utils.CommonUtil;
import com.gk.hotwork.Domain.Utils.Msg;
import com.gk.hotwork.Domain.Vo.ExamScoreVo;
@@ -48,6 +45,9 @@
    ExamScoreService examScoreService;
    @Autowired
    UserFaceService userFaceService;
    @Autowired
    CompanyService companyService;
    @Value("${host}")
    private String host;
    @Value("${workname}")
@@ -118,6 +118,14 @@
            UserFace userFace = userFaceService.selectByUserId(user.getId());
            if (userFace != null)
                user.setCode(userFace.getCode());
            if(user.getCompanyid() != null){
                CompanyInfo companyInfo = companyService.getById(user.getId());
                if(companyInfo != null){
                    user.setProvince(companyInfo.getProvince());
                    user.setCity(companyInfo.getCity());
                    user.setCounty(companyInfo.getArea());
                }
            }
            msg.setResult(user);
        } catch (Exception e) {
            e.printStackTrace();
src/main/java/com/gk/hotwork/Controller/UserController.java
@@ -201,9 +201,12 @@
            @ApiImplicitParam(name = "company",value = "单位名称"),
            @ApiImplicitParam(name = "realname",value = "姓名"),
            @ApiImplicitParam(name = "idcard",value = "身份证号"),
            @ApiImplicitParam(name = "province",value = "省"),
            @ApiImplicitParam(name = "city",value = "市"),
            @ApiImplicitParam(name = "county",value = "县"),
    })
    public Msg getSuperviseUserInfo(@RequestParam(defaultValue = "0") Integer pageIndex, @RequestParam(defaultValue = "10") Integer pageSize, String sort,String order,
                                  String username,String company,String realname, String idcard){
                                  String username,String company,String realname, String idcard, String province,String city,String county){
        Msg msg = new Msg();
        msg.setCode("200");
        msg.setMessage("success");
@@ -226,16 +229,29 @@
        if (StringUtils.isNotBlank(idcard)){
            condition.put("idcard",idcard.trim());
        }
        if (StringUtils.isNotBlank(province)){
            condition.put("province",province.trim());
        if(StringUtils.isNotBlank(userInfoCurrent.getProvince())){
            condition.put("province", userInfoCurrent.getProvince());
            if(StringUtils.isNotBlank(city)){
                condition.put("city", city);
            }
            if(StringUtils.isNotBlank(county)){
                condition.put("county", county);
            }
        }else {
            if(StringUtils.isNotBlank(userInfoCurrent.getProvince())){
                condition.put("province", userInfoCurrent.getProvince());
            }
            if(StringUtils.isNotBlank(userInfoCurrent.getCity())){
                condition.put("city", userInfoCurrent.getCity());
            }
            if(StringUtils.isNotBlank(userInfoCurrent.getCounty())){
                condition.put("county", userInfoCurrent.getCounty());
            }
        }
        if(StringUtils.isNotBlank(userInfoCurrent.getCity())){
            condition.put("city", userInfoCurrent.getCity());
        }
        if(StringUtils.isNotBlank(userInfoCurrent.getCounty())){
            condition.put("county", userInfoCurrent.getCounty());
        }
        pageInfo.setCondition(condition);
        userService.selectSuperviseUserDataGrid(pageInfo);
@@ -2685,9 +2701,6 @@
    /**
     * 获取监管辖区内的企业
     */
    /**
     * 获取专家用户列表
     */
    @GetMapping("/company/list")
    @ApiOperation(value = "获取监管辖区企业数据",response = Msg.class)
src/main/java/com/gk/hotwork/Domain/SafetySelfInspection.java
@@ -60,8 +60,7 @@
    private Date inspectionStartTime;
    /** 检查结束时间   **/
    @TableField(exist = false)
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date inspectionEndTime;
    /** 检查项集合   **/
@@ -102,6 +101,7 @@
    //检查标识 2自查,1监管检查
    private Byte flag;
    /**
     * 隐患总数
     */
src/main/java/com/gk/hotwork/Domain/Utils/Constants.java
@@ -30,7 +30,7 @@
    /**
     * 非过滤URL **,
     */
    public static final String FILTER_EXCLUDE_PATH = "/,/v2/api-docs,/swagger-resources/**,/swagger-ui.html,/webjars/**,/auth/**,/api/**,/error,/upload/**,/dbback/**,/push/**,/register/add,/companyList,/departmentList,/districtByName,/district,/pwd-change";
    public static final String FILTER_EXCLUDE_PATH = "/,/v2/api-docs,/swagger-resources/**,/swagger-ui.html,/webjars/**,/auth/**,/api/**,/error,/upload/**,/dbback/**,/push/**,/register/add,/companyList,/departmentList,/districtByName,/district,/pwd-change,/uploadfile/**";
    /**
     * 登录授权类型
src/main/java/com/gk/hotwork/Mapper/SafetyInspectionItemMapper.java
@@ -19,7 +19,7 @@
    SafetyInspectionItem getById(@Param("id")Long id);
    void updateSafetyInspectionItem(@Param("param") SafetyInspectionItem param);
    void updateSafetyInspectionItem(@Param("item") SafetyInspectionItem item);
    IPage<SafetyInspectionItem> selectCPages(Page<SafetyInspectionItem> page,@Param("params") Map<String, Object> params);
}
src/main/java/com/gk/hotwork/Mapper/mybatis/InspectionHiddenDangerMapper.xml
@@ -3,6 +3,7 @@
<mapper namespace="com.gk.hotwork.Mapper.InspectionHiddenDangerMapper" >
     <update id="delByInspectionItemId">
       update inspection_hidden_danger set valid_flag = 0 , update_time = #{inspectionHiddenDanger.updateTime},update_by = #{inspectionHiddenDanger.updateBy}
        where self_inspection_item_id = #{inspectionHiddenDanger.selfInspectionItemId}
     </update>
    <update id="delByIds">
@@ -77,7 +78,7 @@
        <if test="params.area != null and params.area != ''" >
            and co.area = #{params.area}
        </if>
        ORDER BY l.create_time
        ORDER BY l.create_time desc
    </select>
    <select id="inspectionHdangerlist" resultType="com.gk.hotwork.Domain.InspectionHiddenDanger">
        SELECT
src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyInspectionItemMapper.xml
@@ -12,6 +12,7 @@
    <result column="element_a" property="elementA" jdbcType="BIGINT" />
    <result column="element_b" property="elementB" jdbcType="BIGINT" />
    <result column="element_c" property="elementC" jdbcType="BIGINT" />
    <result column="standardization_requirements" property="standardizationRequirements" jdbcType="VARCHAR" />
    <result column="enterprise_standard" property="enterpriseStandard" jdbcType="VARCHAR" />
    <result column="review_method" property="reviewMethod" jdbcType="VARCHAR" />
@@ -67,4 +68,94 @@
    where a.valid_flag = 1 and a.id= #{id}
  </select>
    <update id="updateBatch">
        <foreach collection="itemList" item="item" index="index" open="" close="" separator=";">
            update safety_inspection_item
            set
            <trim prefix="" suffix="" suffixOverrides=",">
                <if test="item.validFlag != null">
                    valid_flag = #{item.validFlag},
                </if>
                <if test="item.createTime != null and item.createTime != '' ">
                    create_time = #{item.createTime},
                </if>
                <if test="item.createBy != null and item.createBy != '' ">
                    create_by = #{item.createBy},
                </if>
                <if test="item.updateTime != null and item.updateTime != '' ">
                    update_time = #{item.updateTime},
                </if>
                <if test="item.updateBy != null and item.updateBy != '' ">
                    update_by = #{item.updateBy},
                </if>
                <if test="item.elementA != null">
                    element_a = #{item.elementA},
                </if>
                <if test="item.elementB != null">
                    element_b = #{item.elementB},
                </if>
                <if test="item.elementC != null">
                    element_c = #{item.elementC},
                </if>
                <if test="item.standardizationRequirements != null and item.standardizationRequirements != '' ">
                    standardization_requirements = #{item.standardizationRequirements},
                </if>
                <if test="item.enterpriseStandard != null and item.enterpriseStandard != '' ">
                    enterprise_standard = #{item.enterpriseStandard},
                </if>
                <if test="item.reviewMethod != null and item.reviewMethod != '' ">
                    review_method = #{item.reviewMethod},
                </if>
                <if test="item.veto != null and item.veto != '' ">
                    veto = #{item.veto},
                </if>
            </trim>
            where id=#{item.id}
        </foreach>
    </update>
    <update id="updateSafetyInspectionItem">
        update safety_inspection_item
        <trim prefix="set" suffix="" suffixOverrides=",">
            <if test="item.validFlag != null">
                valid_flag = #{item.validFlag},
            </if>
            <if test="item.createTime != null">
                create_time = #{item.createTime},
            </if>
            <if test="item.createBy != null and item.createBy != '' ">
                create_by = #{item.createBy},
            </if>
            <if test="item.updateTime != null">
                update_time = #{item.updateTime},
            </if>
            <if test="item.updateBy != null and item.updateBy != '' ">
                update_by = #{item.updateBy},
            </if>
            <if test="item.elementA != null">
                element_a = #{item.elementA},
            </if>
            <if test="item.elementB != null">
                element_b = #{item.elementB},
            </if>
            <if test="item.elementC != null">
                element_c = #{item.elementC},
            </if>
            <if test="item.standardizationRequirements != null and item.standardizationRequirements != '' ">
                standardization_requirements = #{item.standardizationRequirements},
            </if>
            <if test="item.enterpriseStandard != null and item.enterpriseStandard != '' ">
                enterprise_standard = #{item.enterpriseStandard},
            </if>
            <if test="item.reviewMethod != null and item.reviewMethod != '' ">
                review_method = #{item.reviewMethod},
            </if>
            <if test="item.veto != null and item.veto != '' ">
                veto = #{item.veto},
            </if>
        </trim>
        where id=#{item.id}
    </update>
</mapper>
src/main/java/com/gk/hotwork/Mapper/mybatis/UserInfoMapper.xml
@@ -263,7 +263,7 @@
        and user.realname like concat ('%',#{record.realname,jdbcType=VARCHAR},'%')
      </if>
      <if test="record.company != null and record.company !=''">
        and user.company like concat ('%',#{record.company,jdbcType=VARCHAR},'%')
        and user.company like concat ('%',#{record.company},'%')
      </if>
      <if test="record.job != null and record.job !=''">
        and user.job like concat ('%',#{record.job,jdbcType=VARCHAR},'%')
src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetyInspectionItemImpl.java
@@ -289,7 +289,7 @@
        if (param.getElementB() == null) throw new BusinessException("请选择B级要素");
        //如果有三级要素则不创建标准
        List<ElementManagement> elementList = elementManagementService.getElementByParentId(param.getElementB());
        if(elementList.size() > 0){
        if(param.getElementC() == null && elementList.size() > 0){
            throw new BusinessException("请先删除三级要素");
        }
        if(StringUtils.isBlank(param.getStandardizationRequirements())) throw new BusinessException("请填写标准化要求");
src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java
@@ -421,7 +421,11 @@
        if (CollectionUtils.isNotEmpty(elementTreeList)) {
            for (ElementTree elementA : elementTreeList) {
                List<SafetySelfInspectionItem> selectElementList = itemList.stream().filter(item -> item.getElementA().equals(elementA.getValue())).collect(Collectors.toList());
                List<SafetySelfInspectionItem> selectElementList = itemList
                        .stream()
                        .filter(item -> item.getElementA() != null &&
                        item.getElementA().equals(elementA.getValue()))
                        .collect(Collectors.toList());
                if (CollectionUtils.isNotEmpty(selectElementList)) {
                    SafetySelfInspectionElementRespDTO elementARespDTO = new SafetySelfInspectionElementRespDTO();
                    elementARespDTO.setElementId(elementA.getValue());
@@ -449,7 +453,9 @@
                                //无三级要素过滤出二级要素检查内容
                                List<SafetySelfInspectionItem> sItemList = itemList
                                        .stream()
                                        .filter(item -> item.getElementC() == null && item.getElementB().equals(stree.getValue()))
                                        .filter(item -> item.getElementC() == null
                                                && item.getElementB() != null
                                                && item.getElementB().equals(stree.getValue()))
                                        .collect(Collectors.toList());
                                //填充检查项
                                elementBRespDTO.setItemList(assemblyDeduction(sItemList));
@@ -624,7 +630,7 @@
            //否决 合格--删除扣分记录
            safetySelfInspectionItemDeductionMapper.delBySafetySelfInspectionItemId(param.getId(),username,date);
            //删除隐患
            dangerService.delByInspectionItemId(param.getSafetyInspectionItemId(),user);
            dangerService.delByInspectionItemId(param.getId(),user);
            //删除附件
            attachmentInfoService.deleteByBusinessId(param.getId());
        }else{
@@ -724,6 +730,7 @@
        safetySelfInspection.setStatus(2);
        safetySelfInspection.setUpdateTime(date);
        safetySelfInspection.setUpdateBy(username);
        safetySelfInspection.setInspectionEndTime(new Date());
        safetySelfInspectionMapper.updateById(safetySelfInspection);
    }
src/main/resources/application-dev.yml
@@ -129,4 +129,4 @@
# swagger生产环境中禁止显示
swagger:
  show: false
  show: true
src/main/resources/application-prod.yml
@@ -2,7 +2,7 @@
server:
  tomcat:
    uri-encoding: UTF-8
    basedir: /
    basedir: /home/ecs-shanghai/temp
  port: 8006
  servlet:
    context-path: /