修改bug
This commit is contained in:
@ -4,13 +4,12 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.dromara.bigscreen.domain.dto.WeatherQueryReq;
|
||||
import org.dromara.bigscreen.domain.vo.*;
|
||||
import org.dromara.bigscreen.mapper.ProjectBigScreenMapper;
|
||||
import org.dromara.bigscreen.service.EnterpriseBigScreenService;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.utils.BigDecimalUtil;
|
||||
import org.dromara.manager.weathermanager.vo.WeatherVo;
|
||||
import org.dromara.project.domain.BusAttendance;
|
||||
import org.dromara.project.domain.BusProject;
|
||||
@ -23,16 +22,11 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -218,7 +212,7 @@ public class EnterpriseBigScreenController {
|
||||
// return vo;
|
||||
// }).toList());
|
||||
ArrayList<ProjectAttendanceCountVo> projectAttendanceCountVos = new ArrayList<>();
|
||||
List<BusProject> busProjects = projectService.getBaseMapper().selectList(new LambdaQueryWrapper<BusProject>().eq(BusProject::getPId, 0L).eq(BusProject::getIsDelete,0));
|
||||
List<BusProject> busProjects = projectService.getBaseMapper().selectList(new LambdaQueryWrapper<BusProject>().eq(BusProject::getPId, 0L).eq(BusProject::getIsDelete, 0));
|
||||
List<Long> projectIds = new ArrayList<>();
|
||||
for (BusProject busProject : busProjects) {
|
||||
projectIds.add(busProject.getId());
|
||||
|
||||
@ -41,7 +41,7 @@ public interface EnterpriseBigScreenService {
|
||||
List<RiskEarlyWarningVo> getRiskEarlyWarning();
|
||||
|
||||
/**
|
||||
* 获取3天的天气列表
|
||||
* 获取当前登录用户3天的天气列表
|
||||
*
|
||||
* @param req 查询参数
|
||||
* @return 天气列表
|
||||
|
||||
@ -11,7 +11,10 @@ import org.dromara.common.utils.BigDecimalUtil;
|
||||
import org.dromara.manager.weathermanager.WeatherConstant;
|
||||
import org.dromara.manager.weathermanager.WeatherManager;
|
||||
import org.dromara.manager.weathermanager.vo.WeatherVo;
|
||||
import org.dromara.out.domain.*;
|
||||
import org.dromara.out.domain.BusProcurement;
|
||||
import org.dromara.out.domain.OutConstructionValueRange;
|
||||
import org.dromara.out.domain.OutMonthPlanAudit;
|
||||
import org.dromara.out.domain.OutValueAllocation;
|
||||
import org.dromara.out.service.*;
|
||||
import org.dromara.progress.domain.PgsProgressCategory;
|
||||
import org.dromara.progress.service.IPgsProgressCategoryService;
|
||||
@ -350,9 +353,8 @@ public class EnterpriseBigScreenServiceImpl implements EnterpriseBigScreenServic
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取3天的天气列表
|
||||
* 获取当前登录用户3天的天气列表
|
||||
*
|
||||
* @param req 查询参数
|
||||
* @return 天气列表
|
||||
*/
|
||||
@Override
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@ -25,7 +25,7 @@ public class BusPlanDocAssociationBo extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
@NotNull(message = "主键ID不能为空", groups = {EditGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
@ -46,5 +46,6 @@ public class BusPlanDocAssociationBo extends BaseEntity {
|
||||
/**
|
||||
* 需求数量
|
||||
*/
|
||||
@NotNull(message = "需求数量不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private BigDecimal demandQuantity;
|
||||
}
|
||||
|
||||
@ -59,7 +59,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.FileNameMap;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLEncoder;
|
||||
@ -205,7 +204,7 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
}
|
||||
|
||||
|
||||
public void validNum(List<BusPlanDocAssociationBo> associationList){
|
||||
public void validNum(List<BusPlanDocAssociationBo> associationList) {
|
||||
|
||||
for (BusPlanDocAssociationBo association : associationList) {
|
||||
|
||||
@ -218,7 +217,8 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
.filter(Objects::nonNull)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
if(total.add(association.getDemandQuantity()).compareTo(byId.getDemandQuantity()) > 0){
|
||||
|
||||
if (total.add(association.getDemandQuantity()).compareTo(byId.getDemandQuantity()) > 0) {
|
||||
throw new ServiceException("材料:" + byId.getName() + "已超出计划单的物料批次需求计划数量");
|
||||
}
|
||||
}
|
||||
@ -226,8 +226,6 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改物资-采购联系单
|
||||
*
|
||||
@ -235,7 +233,7 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional( rollbackFor = Exception.class)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateByBo(BusPurchaseDocBo bo) {
|
||||
BusPurchaseDoc update = MapstructUtils.convert(bo, BusPurchaseDoc.class);
|
||||
validEntityBeforeSave(update);
|
||||
@ -254,7 +252,7 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
.filter(Objects::nonNull)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
if(total.add(association.getDemandQuantity()).compareTo(byId.getDemandQuantity()) > 0){
|
||||
if (total.add(association.getDemandQuantity()).compareTo(byId.getDemandQuantity()) > 0) {
|
||||
throw new ServiceException("材料:" + byId.getName() + "已超出计划单的物料批次需求计划数量");
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,11 @@ public interface WeatherConstant {
|
||||
*/
|
||||
String THREE_DAYS_WEATHER_PATH = "/v7/weather/3d";
|
||||
|
||||
/**
|
||||
* 城市搜索
|
||||
*/
|
||||
String CITY_SEARCH = "/geo/v2/city/lookup";
|
||||
|
||||
/**
|
||||
* 天气信息
|
||||
*/
|
||||
|
||||
@ -11,6 +11,7 @@ import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.manager.weathermanager.vo.CitySearchVo;
|
||||
import org.dromara.manager.weathermanager.vo.WeatherVo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -138,6 +139,19 @@ public class WeatherManager {
|
||||
return String.format("https://%s%s?location=%s&lang=%s", weatherProperties.getApiHost(), weatherPath, location, lang);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取城市搜索 Url
|
||||
*
|
||||
* @param citySearchPath 城市搜索请求路径
|
||||
* @param location 位置
|
||||
* @param adm 地区
|
||||
* @param lang 语言
|
||||
*/
|
||||
private String getCitySearchUrl(String citySearchPath, String location, String adm, String lang) {
|
||||
return String.format("https://%s%s?location=%s&adm=%s&lang=%s",
|
||||
weatherProperties.getApiHost(), citySearchPath, location, adm, lang);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取小数点后两位的经纬度
|
||||
*
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
package org.dromara.manager.weathermanager.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-09-26 19:04
|
||||
*/
|
||||
@Data
|
||||
public class CitySearchVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 5453880592207725328L;
|
||||
|
||||
/**
|
||||
* 城市名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 城市id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 城市经度
|
||||
*/
|
||||
private String lat;
|
||||
|
||||
/**
|
||||
* 城市纬度
|
||||
*/
|
||||
private String lon;
|
||||
|
||||
/**
|
||||
* 城市的上级行政区划名称
|
||||
*/
|
||||
private String adm2;
|
||||
|
||||
/**
|
||||
* 城市所属一级行政区域
|
||||
*/
|
||||
private String adm1;
|
||||
|
||||
/**
|
||||
* 城市所属国家名称
|
||||
*/
|
||||
private String country;
|
||||
}
|
||||
@ -46,7 +46,6 @@ public class MatMaterialReceiveCreateReq implements Serializable {
|
||||
/**
|
||||
* 设备材料名称
|
||||
*/
|
||||
@NotBlank(message = "设备材料名称不能为空")
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
|
||||
@ -14,7 +14,6 @@ import org.dromara.common.core.utils.ObjectUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.materials.domain.MatMaterials;
|
||||
import org.dromara.materials.domain.MatMaterialsInventory;
|
||||
import org.dromara.materials.domain.MatMaterialsUseRecord;
|
||||
|
||||
@ -1,19 +1,17 @@
|
||||
package org.dromara.safety.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.safety.domain.WgzQuestionSavePdf;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@ -51,6 +49,7 @@ public class WgzQuestionSavePdfVo implements Serializable {
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "userId")
|
||||
@ExcelProperty(value = "用户名")
|
||||
private String userName;
|
||||
|
||||
|
||||
@ -2,7 +2,9 @@ package org.dromara.safety.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
@ -13,15 +15,12 @@ import org.dromara.safety.domain.bo.WgzQuestionSavePdfBo;
|
||||
import org.dromara.safety.domain.vo.WgzQuestionSavePdfVo;
|
||||
import org.dromara.safety.mapper.WgzQuestionSavePdfMapper;
|
||||
import org.dromara.safety.service.IWgzQuestionSavePdfService;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 用户试卷存储pdfService业务层处理
|
||||
@ -36,7 +35,7 @@ public class WgzQuestionSavePdfServiceImpl extends ServiceImpl<WgzQuestionSavePd
|
||||
private ISysUserService userService;
|
||||
|
||||
@Override
|
||||
public WgzQuestionSavePdf queryById(Long id){
|
||||
public WgzQuestionSavePdf queryById(Long id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@ -44,11 +43,6 @@ public class WgzQuestionSavePdfServiceImpl extends ServiceImpl<WgzQuestionSavePd
|
||||
public TableDataInfo<WgzQuestionSavePdfVo> queryPageList(WgzQuestionSavePdfBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<WgzQuestionSavePdf> lqw = buildQueryWrapper(bo);
|
||||
Page<WgzQuestionSavePdfVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
// 根据id获取到用户名
|
||||
result.getRecords().forEach(item -> {
|
||||
SysUserVo sysUserVo = userService.selectUserById(item.getUserId());
|
||||
item.setUserName(sysUserVo.getNickName());
|
||||
});
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@ -92,40 +86,40 @@ public class WgzQuestionSavePdfServiceImpl extends ServiceImpl<WgzQuestionSavePd
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(WgzQuestionSavePdf entity){
|
||||
private void validEntityBeforeSave(WgzQuestionSavePdf entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public WgzQuestionSavePdf queryByUserId(Long userId) {
|
||||
LambdaQueryWrapper<WgzQuestionSavePdf> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(WgzQuestionSavePdf::getUserId, userId);
|
||||
return baseMapper.selectOne(lqw);
|
||||
}
|
||||
@Override
|
||||
public WgzQuestionSavePdf queryByUserId(Long userId) {
|
||||
LambdaQueryWrapper<WgzQuestionSavePdf> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(WgzQuestionSavePdf::getUserId, userId);
|
||||
return baseMapper.selectOne(lqw);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteByUserId(Long userId) {
|
||||
//1、查询数据
|
||||
WgzQuestionSavePdf wgzQuestionSavePdf = queryByUserId(userId);
|
||||
//2、删除数据
|
||||
LambdaQueryWrapper<WgzQuestionSavePdf> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(WgzQuestionSavePdf::getUserId, userId);
|
||||
int delete = baseMapper.delete(lqw);
|
||||
//3、删除相对路径的pdf文件
|
||||
if(delete > 0){
|
||||
String path = wgzQuestionSavePdf.getPath();
|
||||
StrUtil.removePrefix(path, "upload/");
|
||||
StrUtil.removePrefix(path, "upload\\");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public Boolean deleteByUserId(Long userId) {
|
||||
//1、查询数据
|
||||
WgzQuestionSavePdf wgzQuestionSavePdf = queryByUserId(userId);
|
||||
//2、删除数据
|
||||
LambdaQueryWrapper<WgzQuestionSavePdf> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(WgzQuestionSavePdf::getUserId, userId);
|
||||
int delete = baseMapper.delete(lqw);
|
||||
//3、删除相对路径的pdf文件
|
||||
if (delete > 0) {
|
||||
String path = wgzQuestionSavePdf.getPath();
|
||||
StrUtil.removePrefix(path, "upload/");
|
||||
StrUtil.removePrefix(path, "upload\\");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user