| | |
| | | screenUserVo.setPermissionProject(param.getPermissionProject()); |
| | | screenUserVo.setCommentType(param.getCommentType()); |
| | | screenUserVo.setSafetyId(param.getSafetyId()); |
| | | String name = clientParamService.getTemplateName(param.getSafetyId()); |
| | | screenUserVo.setSafetyName(name); |
| | | |
| | | screenUserVo.setDeviceTemplateId(param.getDeviceTemplateId()); |
| | | screenUserVo.setDeviceTemplateName(clientParamService.getTemplateName(param.getDeviceTemplateId())); |
| | | |
| | | screenUserVo.setBigHiddenDanger(param.getBigHiddenDanger()); |
| | | screenUserVo.setGeneralHiddenDanger(param.getGeneralHiddenDanger()); |
| | | } |
| New file |
| | |
| | | package com.ruoyi.web.controller.tool; |
| | | |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | public class HolidayUtil { |
| | | |
| | | |
| | | public static boolean isHoliday() { |
| | | String result = HttpUtil.get("https://publicapi.xiaoai.me/holiday/day?date=" + LocalDate.now()); |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | Object data = jsonObject.get("data"); |
| | | JSONArray parse = JSONArray.parse(data.toString()); |
| | | for (int i = 0; i < parse.size(); i++) { |
| | | JSONObject jsonObject1 = parse.getJSONObject(i); |
| | | if (jsonObject1.get("daytype").toString().equals("1")) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | boolean holiday = isHoliday(); |
| | | System.out.println(holiday); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.ruoyi.system.model.ClientParam; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ClientParamMapper extends BaseMapper<ClientParam> { |
| | | |
| | | String getTemplateName(@Param("id") Integer id); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface ClientParamService extends IService<ClientParam> { |
| | | |
| | | String getTemplateName(Integer safetyId); |
| | | |
| | | |
| | | } |
| | |
| | | @Service |
| | | public class ClientParamServiceImpl extends ServiceImpl<ClientParamMapper, ClientParam> implements ClientParamService { |
| | | |
| | | @Override |
| | | public String getTemplateName(Integer safetyId) { |
| | | return this.baseMapper.getTemplateName(safetyId); |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value = "安全报告模板id") |
| | | private Integer safetyId; |
| | | |
| | | @ApiModelProperty(value = "安全报告模板名称") |
| | | private String safetyName; |
| | | |
| | | @ApiModelProperty(value = "设备模板id") |
| | | private Integer deviceTemplateId; |
| | | |
| | | @ApiModelProperty(value = "设备模板名称") |
| | | private String deviceTemplateName; |
| | | |
| | | @ApiModelProperty(value = "1开启 2关闭 重大隐患") |
| | | private Integer bigHiddenDanger; |
| | | |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, client_id, name, logo, big_hidden_danger, general_hidden_danger, comment_type, safety_id, device_template_id, project_num, under_construction_project, asset_project, permission_client, permission_project |
| | | </sql> |
| | | <select id="getTemplateName" resultType="java.lang.String" parameterType="java.lang.Integer"> |
| | | select name |
| | | from report_template |
| | | where id = #{id} |
| | | |
| | | </select> |
| | | |
| | | </mapper> |