Compare commits
7 Commits
updateMenu
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c0abc26b8 | |||
| 914a474c43 | |||
| 13a121b9ac | |||
| 22bb8fd998 | |||
| 41541c3735 | |||
| 541d674072 | |||
| c2c6cd16cc |
@ -5,7 +5,7 @@ public enum DpEnum {
|
||||
ZLGLLX_ZXGL("专项检查", "1"),
|
||||
ZLGLLX_DQJC("定期检查", "2"),
|
||||
ZLGLLX_RCXJ("日常巡检", "3"),
|
||||
ZLGDZT_ZG("工单状态-整改", "2"),
|
||||
ZLGDZT_ZG("工单状态-整改", "1"),
|
||||
RYZT_ZG("人员状态-在岗", "1"),
|
||||
RYZT_LG("工单状态-离岗", "0"),
|
||||
JSLX_AQY("角色类型-安全员", "SAFETY_OFFICER");
|
||||
|
||||
@ -169,7 +169,7 @@ public class DpzaglServiceImpl implements DpzaglService {
|
||||
// 站班会
|
||||
HseTeamMeetingQueryReq hseTeamMeetingQueryReq = new HseTeamMeetingQueryReq();
|
||||
// List<HseTeamMeetingVo> hseTeamMeetingVos = teamMeetingService.queryList(hseTeamMeetingQueryReq);
|
||||
List<HseTeamMeeting> hseTeamMeetings = teamMeetingService.getBaseMapper().selectList(new LambdaQueryWrapper<HseTeamMeeting>().ge(HseTeamMeeting::getProjectId, bo.getProjectId()));
|
||||
List<HseTeamMeeting> hseTeamMeetings = teamMeetingService.getBaseMapper().selectList(new LambdaQueryWrapper<HseTeamMeeting>().eq(HseTeamMeeting::getProjectId, bo.getProjectId()));
|
||||
dpznglVo.setZbhList(MapstructUtils.convert(hseTeamMeetings, HseTeamMeetingVo.class));
|
||||
dpznglVo.getZbhList().forEach(hseTeamMeetingVo -> {if ( hseTeamMeetingVo.getCompereId() != null){hseTeamMeetingVo.setCompereName(userService.selectNicknameByIds(hseTeamMeetingVo.getCompereId().toString()));}});
|
||||
return dpznglVo;
|
||||
@ -197,8 +197,8 @@ public class DpzaglServiceImpl implements DpzaglService {
|
||||
dpznglVo.setZxjcAq(list.stream().filter(zl -> DpEnum.ZLGLLX_ZXGL.getTypeValue().equals(zl.getCheckType())).count());
|
||||
dpznglVo.setDqjcAq(list.stream().filter(zl -> DpEnum.ZLGLLX_DQJC.getTypeValue().equals(zl.getCheckType())).count());
|
||||
dpznglVo.setRcxjAq(list.stream().filter(zl -> DpEnum.ZLGLLX_RCXJ.getTypeValue().equals(zl.getCheckType())).count());
|
||||
dpznglVo.setAqZgsl(list.stream().filter(zl -> DpEnum.ZLGDZT_ZG.getTypeValue().equals(zl.getStatus())).count());
|
||||
List<HseSafetyInspectionVo> convert = MapstructUtils.convert(list.stream().filter(zl -> DpEnum.ZLGDZT_ZG.getTypeValue().equals(zl.getStatus())).collect(Collectors.toList()), HseSafetyInspectionVo.class);
|
||||
dpznglVo.setAqZgsl(list.stream().filter(zl -> DpEnum.ZLGDZT_ZG.getTypeValue().equals(zl.getReviewType())).count());
|
||||
List<HseSafetyInspectionVo> convert = MapstructUtils.convert(list.stream().filter(zl -> DpEnum.ZLGDZT_ZG.getTypeValue().equals(zl.getReviewType())).collect(Collectors.toList()), HseSafetyInspectionVo.class);
|
||||
convert.forEach(zl ->{if (zl.getCorrectorId() != null)zl.setCorrectorName(userService.selectNicknameByIds(zl.getCorrectorId().toString()));});
|
||||
dpznglVo.setAqZgList(convert);
|
||||
}
|
||||
@ -234,8 +234,8 @@ public class DpzaglServiceImpl implements DpzaglService {
|
||||
dpznglVo.setZxjcZl(zsZl.stream().filter(zl -> DpEnum.ZLGLLX_ZXGL.getTypeValue().equals(zl.getInspectionType())).count());
|
||||
dpznglVo.setDqjcZl(zsZl.stream().filter(zl -> DpEnum.ZLGLLX_DQJC.getTypeValue().equals(zl.getInspectionType())).count());
|
||||
dpznglVo.setRcxjZl(zsZl.stream().filter(zl -> DpEnum.ZLGLLX_RCXJ.getTypeValue().equals(zl.getInspectionType())).count());
|
||||
dpznglVo.setZlZgsl(zsZl.stream().filter(zl -> DpEnum.ZLGDZT_ZG.getTypeValue().equals(zl.getInspectionStatus())).count());
|
||||
List<QltQualityInspection> collect = zsZl.stream().filter(zl -> DpEnum.ZLGDZT_ZG.getTypeValue().equals(zl.getInspectionStatus())).collect(Collectors.toList());
|
||||
dpznglVo.setZlZgsl(zsZl.stream().filter(zl -> DpEnum.ZLGDZT_ZG.getTypeValue().equals(zl.getVerificationType())).count());
|
||||
List<QltQualityInspection> collect = zsZl.stream().filter(zl -> DpEnum.ZLGDZT_ZG.getTypeValue().equals(zl.getVerificationType())).collect(Collectors.toList());
|
||||
List<QltQualityInspectionVo> convert = MapstructUtils.convert(collect, QltQualityInspectionVo.class);
|
||||
convert.forEach(zl ->{if (zl.getCorrectorId() != null)zl.setCorrectorName(userService.selectNicknameByIds(zl.getCorrectorId().toString()));});
|
||||
dpznglVo.setZlZgList(convert);
|
||||
|
||||
@ -7,10 +7,12 @@ import com.alibaba.excel.write.metadata.WriteSheet;
|
||||
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
|
||||
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.*;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
@ -20,6 +22,7 @@ import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.design.domain.bo.*;
|
||||
import org.dromara.design.domain.vo.*;
|
||||
import org.dromara.design.exportUtil.bill.*;
|
||||
import org.dromara.design.service.IBusBillofquantitiesService;
|
||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -42,6 +45,7 @@ import java.util.*;
|
||||
public class BusBillofquantitiesVersionsController extends BaseController {
|
||||
|
||||
private final IBusBillofquantitiesVersionsService busBillofquantitiesVersionsService;
|
||||
private final IBusBillofquantitiesService busBillofquantitiesService;
|
||||
|
||||
/**
|
||||
* 导入excel
|
||||
@ -57,7 +61,7 @@ public class BusBillofquantitiesVersionsController extends BaseController {
|
||||
/**
|
||||
* 获取所有版本号
|
||||
*/
|
||||
@SaCheckPermission("design:billofquantitiesVersions:obtainAllVersionNumbers")
|
||||
@SaCheckPermission("design:billofquantitiesVersions:list")
|
||||
@GetMapping("/obtainAllVersionNumbers")
|
||||
public TableDataInfo<BusBillofquantitiesVersionsVo> obtainAllVersionNumbers(ObtainAllVersionNumbersReq bo, PageQuery pageQuery) {
|
||||
return busBillofquantitiesVersionsService.obtainAllVersionNumbers(bo, pageQuery);
|
||||
@ -76,7 +80,7 @@ public class BusBillofquantitiesVersionsController extends BaseController {
|
||||
/**
|
||||
* 获取指定版本的sheet
|
||||
*/
|
||||
@SaCheckPermission("design:billofquantitiesVersions:sheetList")
|
||||
@SaCheckPermission("design:billofquantitiesVersions:list")
|
||||
@GetMapping("/sheetList")
|
||||
public R<List<String>> sheetList(SheetListReq bo) {
|
||||
return R.ok(busBillofquantitiesVersionsService.sheetList(bo));
|
||||
@ -85,7 +89,7 @@ public class BusBillofquantitiesVersionsController extends BaseController {
|
||||
/**
|
||||
* 获取工程量清单列表
|
||||
*/
|
||||
@SaCheckPermission("design:billofquantitiesVersions:obtainTheList")
|
||||
@SaCheckPermission("design:billofquantitiesVersions:list")
|
||||
@GetMapping("/obtainTheList")
|
||||
public R<List<ObtainTheListRes>> obtainTheList(CoryObtainTheListReq bo, PageQuery pageQuery) {
|
||||
return R.ok(busBillofquantitiesVersionsService.obtainTheList(bo));
|
||||
@ -114,6 +118,7 @@ public class BusBillofquantitiesVersionsController extends BaseController {
|
||||
* 导出工程量清单版本列表
|
||||
*/
|
||||
@Log(title = "工程量清单版本", businessType = BusinessType.EXPORT)
|
||||
@SaCheckPermission("design:billofquantitiesVersions:export")
|
||||
@PostMapping("/export")
|
||||
public void export(String versions,Long projectId, HttpServletResponse response) throws IOException {
|
||||
Map<String, List<BillOfQuantitiesExport>> sheetDataMap = busBillofquantitiesVersionsService.export(versions,projectId);
|
||||
@ -223,38 +228,38 @@ public class BusBillofquantitiesVersionsController extends BaseController {
|
||||
// return R.ok(busBillofquantitiesVersionsService.queryById(id));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新增工程量清单版本
|
||||
// */
|
||||
// @SaCheckPermission("design:billofquantitiesVersions:add")
|
||||
// @Log(title = "工程量清单版本", businessType = BusinessType.INSERT)
|
||||
// @RepeatSubmit()
|
||||
// @PostMapping()
|
||||
// public R<Void> add(@Validated(AddGroup.class) @RequestBody BusBillofquantitiesVersionsBo bo) {
|
||||
// return toAjax(busBillofquantitiesVersionsService.insertByBo(bo));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改工程量清单版本
|
||||
// */
|
||||
// @SaCheckPermission("design:billofquantitiesVersions:edit")
|
||||
// @Log(title = "工程量清单版本", businessType = BusinessType.UPDATE)
|
||||
// @RepeatSubmit()
|
||||
// @PutMapping()
|
||||
// public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusBillofquantitiesVersionsBo bo) {
|
||||
// return toAjax(busBillofquantitiesVersionsService.updateByBo(bo));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除工程量清单版本
|
||||
// *
|
||||
// * @param ids 主键串
|
||||
// */
|
||||
// @SaCheckPermission("design:billofquantitiesVersions:remove")
|
||||
// @Log(title = "工程量清单版本", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
// @PathVariable Long[] ids) {
|
||||
// return toAjax(busBillofquantitiesVersionsService.deleteWithValidByIds(List.of(ids), true));
|
||||
// }
|
||||
/**
|
||||
* 新增工程量清单版本
|
||||
*/
|
||||
@SaCheckPermission("design:billofquantitiesVersions:add")
|
||||
@Log(title = "工程量清单版本", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusBillofquantitiesBo bo) {
|
||||
return toAjax(busBillofquantitiesService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工程量清单版本
|
||||
*/
|
||||
@SaCheckPermission("design:billofquantitiesVersions:edit")
|
||||
@Log(title = "工程量清单版本", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusBillofquantitiesBo bo) {
|
||||
return toAjax(busBillofquantitiesService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工程量清单版本
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("design:billofquantitiesVersions:remove")
|
||||
@Log(title = "工程量清单版本", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busBillofquantitiesService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ public class DesSchemeController extends BaseController {
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("design:scheme:query")
|
||||
// @SaCheckPermission("design:scheme:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<DesSchemeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
@ -109,18 +109,18 @@ public class DesSchemeController extends BaseController {
|
||||
/**
|
||||
* 新增设计方案文件
|
||||
*/
|
||||
@SaCheckPermission("design:scheme:upload")
|
||||
@SaCheckPermission("design:scheme:add")
|
||||
@Log(title = "设计方案", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/upload")
|
||||
public R<Long> addFile(MultipartFile file, Long projectId) {
|
||||
return R.ok(desSchemeService.addFile(file, projectId));
|
||||
public R<Long> addFile(MultipartFile file, Long projectId,String type) {
|
||||
return R.ok(desSchemeService.addFile(file, projectId, type));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设计方案文件
|
||||
*/
|
||||
@SaCheckPermission("design:scheme:update")
|
||||
@SaCheckPermission("design:scheme:edit")
|
||||
@Log(title = "设计方案", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/update/{id}")
|
||||
@ -129,6 +129,7 @@ public class DesSchemeController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@SaCheckPermission("design:scheme:export")
|
||||
@PostMapping("/exportZipWithStatus")
|
||||
public void exportZipWithStatus(ExportDto dto, HttpServletResponse response) throws Exception {
|
||||
desSchemeService.exportAsZipWithStatusPrefix(dto, response);
|
||||
|
||||
@ -261,13 +261,37 @@ public class DesVolumeCatalogController extends BaseController {
|
||||
Row row = sheet.getRow(rowIndex);
|
||||
if (hasValidData(row)) {
|
||||
String designSubitem = getCellValue(row.getCell(0));
|
||||
if (designSubitem == null || designSubitem.isEmpty()){
|
||||
throw new RuntimeException("第"+(rowIndex+1)+"行:子项名称不能为空");
|
||||
}
|
||||
String specialty = getCellValue(row.getCell(1));
|
||||
if (specialty == null || specialty.isEmpty()){
|
||||
throw new RuntimeException("第"+(rowIndex+1)+"行:专业不能为空");
|
||||
}
|
||||
String specialtyId = getCellValue(row.getCell(2));
|
||||
if (specialtyId == null || specialtyId.isEmpty()){
|
||||
throw new RuntimeException("第"+(rowIndex+1)+"行:专业"+specialty+"不存在,推荐使用系统下载模板进行数据填充");
|
||||
}
|
||||
String principal = getCellValue(row.getCell(3));
|
||||
if (principal == null || principal.isEmpty()){
|
||||
throw new RuntimeException("第"+(rowIndex+1)+"行:人员不能为空");
|
||||
}
|
||||
String principalId = getCellValue(row.getCell(4));
|
||||
if (principalId == null || principalId.isEmpty()){
|
||||
throw new RuntimeException("第"+(rowIndex+1)+"行:人员"+principal+"不存在,推荐使用系统下载模板进行数据填充");
|
||||
}
|
||||
String volumeNumber = getCellValue(row.getCell(5));
|
||||
if (volumeNumber == null || volumeNumber.isEmpty()){
|
||||
throw new RuntimeException("第"+(rowIndex+1)+"行:卷册编号不能为空");
|
||||
}
|
||||
String documentName = getCellValue(row.getCell(6));
|
||||
if (documentName == null || documentName.isEmpty()){
|
||||
throw new RuntimeException("第"+(rowIndex+1)+"行:资料名称不能为空");
|
||||
}
|
||||
LocalDate plannedCompletion = getLocalDateValue(row.getCell(7));
|
||||
if (plannedCompletion == null){
|
||||
throw new RuntimeException("第"+(rowIndex+1)+"行:计划出图时间不能为空");
|
||||
}
|
||||
|
||||
ExcelData excelData = new ExcelData(
|
||||
designSubitem, specialtyId, principalId, volumeNumber, documentName,
|
||||
|
||||
@ -51,6 +51,10 @@ public class DesScheme extends BaseEntity {
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 设计方案类型(1、可研,2、施工,3、初设)
|
||||
*/
|
||||
private String schemeType;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
|
||||
@ -9,6 +9,8 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 工程量清单业务对象 bus_billofquantities
|
||||
*
|
||||
@ -35,7 +37,7 @@ public class BusBillofquantitiesBo extends BaseEntity {
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
@NotBlank(message = "表名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "表名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String sheet;
|
||||
|
||||
|
||||
@ -72,12 +74,17 @@ public class BusBillofquantitiesBo extends BaseEntity {
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Long quantity;
|
||||
private BigDecimal quantity;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -52,5 +52,10 @@ public class DesSchemeBo extends BaseEntity {
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 设计方案类型(1、可研,2、施工,3、初设)
|
||||
*/
|
||||
private String schemeType;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@ -84,7 +85,7 @@ public class BusBillofquantitiesVo implements Serializable {
|
||||
* 数量
|
||||
*/
|
||||
@ExcelProperty(value = "数量")
|
||||
private Long quantity;
|
||||
private BigDecimal quantity;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
|
||||
@ -64,5 +64,10 @@ public class DesSchemeVo implements Serializable {
|
||||
@ExcelProperty(value = "审核状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 设计方案类型(1、可研,2、施工,3、初设)
|
||||
*/
|
||||
private String schemeType;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
package org.dromara.design.service;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.design.domain.dto.ExportDto;
|
||||
import org.dromara.design.domain.vo.DesSchemeVo;
|
||||
import org.dromara.design.domain.bo.DesSchemeBo;
|
||||
@ -11,7 +9,6 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Collection;
|
||||
@ -78,7 +75,7 @@ public interface IDesSchemeService extends IService<DesScheme>{
|
||||
/**
|
||||
* 添加文件
|
||||
*/
|
||||
Long addFile(MultipartFile file, Long projectId);
|
||||
Long addFile(MultipartFile file, Long projectId, String type);
|
||||
|
||||
/**
|
||||
* 修改文件
|
||||
|
||||
@ -1,6 +1,11 @@
|
||||
package org.dromara.design.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.NumberChineseFormatter;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@ -9,12 +14,17 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.utils.BatchNumberGenerator;
|
||||
import org.dromara.design.domain.BusBillofquantitiesVersions;
|
||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.design.domain.bo.BusBillofquantitiesBo;
|
||||
import org.dromara.design.domain.vo.BusBillofquantitiesVo;
|
||||
import org.dromara.design.domain.BusBillofquantities;
|
||||
import org.dromara.design.mapper.BusBillofquantitiesMapper;
|
||||
import org.dromara.design.service.IBusBillofquantitiesService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -31,6 +41,9 @@ import java.util.Collection;
|
||||
public class BusBillofquantitiesServiceImpl extends ServiceImpl<BusBillofquantitiesMapper, BusBillofquantities> implements IBusBillofquantitiesService {
|
||||
|
||||
private final BusBillofquantitiesMapper baseMapper;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IBusBillofquantitiesVersionsService busBillofquantitiesVersionsService;
|
||||
|
||||
/**
|
||||
* 查询工程量清单
|
||||
@ -94,6 +107,31 @@ public class BusBillofquantitiesServiceImpl extends ServiceImpl<BusBillofquantit
|
||||
public Boolean insertByBo(BusBillofquantitiesBo bo) {
|
||||
BusBillofquantities add = MapstructUtils.convert(bo, BusBillofquantities.class);
|
||||
validEntityBeforeSave(add);
|
||||
// 生成当前节点的sid
|
||||
String sid = BatchNumberGenerator.generateBatchNumber("GCLQD-");
|
||||
add.setSid(sid);
|
||||
//获取当前父节点下有多少子节点
|
||||
Long count = baseMapper.selectCount(new LambdaQueryWrapper<BusBillofquantities>().eq(BusBillofquantities::getPid, bo.getPid())) +1;
|
||||
if ("0".equals(bo.getPid())){
|
||||
//当父节点为0时,生成中文编号作为顶层
|
||||
String s = NumberChineseFormatter.numberCharToChinese((char) count.longValue(), false);
|
||||
add.setNum(s);
|
||||
}else {
|
||||
//当父节点不为0时,生成数字编号作为子节点编号
|
||||
BusBillofquantities busBillofquantities = baseMapper.selectOne(new LambdaQueryWrapper<BusBillofquantities>().eq(BusBillofquantities::getSid, bo.getPid()));
|
||||
if (busBillofquantities == null){
|
||||
throw new ServiceException("父节点不存在");
|
||||
}
|
||||
if ("0".equals(busBillofquantities.getPid())){
|
||||
add.setNum(count.toString());
|
||||
}else {
|
||||
if (busBillofquantities.getNum() != null){
|
||||
//当父节点有编号时,生成数字编号作为子节点编号 无编号时,不生成编号
|
||||
String s = busBillofquantities.getNum() + "." + count;
|
||||
add.setNum(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
@ -117,8 +155,24 @@ public class BusBillofquantitiesServiceImpl extends ServiceImpl<BusBillofquantit
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusBillofquantities entity){
|
||||
private void validEntityBeforeSave(BusBillofquantities entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
BusBillofquantitiesVersions versions = busBillofquantitiesVersionsService
|
||||
.getBaseMapper()
|
||||
.selectOne(new LambdaQueryWrapper<BusBillofquantitiesVersions>()
|
||||
.eq(BusBillofquantitiesVersions::getVersions, entity.getVersions()));
|
||||
if (versions == null) {
|
||||
throw new ServiceException("版本不存在");
|
||||
}
|
||||
if (!BusinessStatusEnum.DRAFT.getStatus().equals(versions.getStatus())
|
||||
&& !BusinessStatusEnum.BACK.getStatus().equals(versions.getStatus())
|
||||
&& !BusinessStatusEnum.CANCEL.getStatus().equals(versions.getStatus())){
|
||||
if (entity.getId() != null){
|
||||
throw new ServiceException("版本处于审核中,不能修改");
|
||||
}else {
|
||||
throw new ServiceException("版本处于审核中,不能新增");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -132,6 +186,25 @@ public class BusBillofquantitiesServiceImpl extends ServiceImpl<BusBillofquantit
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
for (Long id : ids) {
|
||||
BusBillofquantities busBillofquantities = baseMapper.selectById(id);
|
||||
if (busBillofquantities == null) {
|
||||
throw new ServiceException("数据不存在");
|
||||
}
|
||||
BusBillofquantitiesVersions versions = busBillofquantitiesVersionsService
|
||||
.getBaseMapper()
|
||||
.selectOne(new LambdaQueryWrapper<BusBillofquantitiesVersions>()
|
||||
.eq(BusBillofquantitiesVersions::getVersions, busBillofquantities.getVersions()));
|
||||
if (versions == null) {
|
||||
throw new ServiceException("版本不存在");
|
||||
}
|
||||
if (!BusinessStatusEnum.DRAFT.getStatus().equals(versions.getStatus())
|
||||
&& !BusinessStatusEnum.BACK.getStatus().equals(versions.getStatus())
|
||||
&& !BusinessStatusEnum.CANCEL.getStatus().equals(versions.getStatus())){
|
||||
throw new ServiceException("版本处于审核中,不能删除");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
@ -18,12 +18,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.oss.core.OssClient;
|
||||
import org.dromara.common.oss.factory.OssFactory;
|
||||
import org.dromara.design.domain.DesCollectFile;
|
||||
import org.dromara.design.domain.DesPrelimScheme;
|
||||
import org.dromara.design.domain.dto.ExportDto;
|
||||
import org.dromara.system.domain.vo.SysOssUploadVo;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.springframework.context.event.EventListener;
|
||||
@ -46,7 +41,6 @@ import java.net.http.HttpResponse;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Path;
|
||||
import java.time.Duration;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
@ -173,7 +167,7 @@ public class DesSchemeServiceImpl extends ServiceImpl<DesSchemeMapper, DesScheme
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long addFile(MultipartFile file, Long projectId) {
|
||||
public Long addFile(MultipartFile file, Long projectId, String type) {
|
||||
SysOssVo upload = ossService.upload(file, ossService.minioFileName(ContactNoticeTemplate, file));
|
||||
DesScheme scheme = new DesScheme();
|
||||
scheme.setProjectId(projectId);
|
||||
@ -181,7 +175,7 @@ public class DesSchemeServiceImpl extends ServiceImpl<DesSchemeMapper, DesScheme
|
||||
scheme.setOssId(upload.getOssId());
|
||||
scheme.setFileName(upload.getOriginalName());
|
||||
scheme.setFileUrl(upload.getUrl());
|
||||
|
||||
scheme.setSchemeType(type);
|
||||
baseMapper.insert(scheme);
|
||||
return scheme.getId();
|
||||
}
|
||||
|
||||
@ -529,8 +529,8 @@ public class DesVolumeCatalogServiceImpl extends ServiceImpl<DesVolumeCatalogMap
|
||||
|
||||
// 主 Sheet 设置表头
|
||||
Row sheetRow = mainSheet.createRow(0);
|
||||
String[] headers = {"子项名称", "专业", "专业编码",
|
||||
"人员", "人员编码", "卷册号", "资料名称", "计划出图时间"};
|
||||
String[] headers = {"*子项名称", "*专业", "*专业编码",
|
||||
"*人员", "*人员编码", "*卷册号", "*资料名称", "*计划出图时间"};
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
Cell cell = sheetRow.createCell(i);
|
||||
cell.setCellValue(headers[i]);
|
||||
|
||||
@ -342,7 +342,11 @@ public class MatMaterialsInventoryServiceImpl extends ServiceImpl<MatMaterialsIn
|
||||
.select(MatMaterials::getId)
|
||||
.like(MatMaterials::getMaterialsName, materialsName);
|
||||
List<Long> materialsIdList = materialsService.listObjs(materialsQueryWrapper, obj -> (Long) obj);
|
||||
if (CollUtil.isNotEmpty(materialsIdList)){
|
||||
lqw.in(MatMaterialsInventory::getMaterialsId, materialsIdList);
|
||||
}else {
|
||||
lqw.eq(MatMaterialsInventory::getMaterialsId, -1);
|
||||
}
|
||||
}
|
||||
// 模糊查询
|
||||
lqw.like(StringUtils.isNotBlank(operator), MatMaterialsInventory::getOperator, operator);
|
||||
|
||||
@ -2682,6 +2682,9 @@ public class PgsProgressCategoryServiceImpl extends ServiceImpl<PgsProgressCateg
|
||||
}
|
||||
}
|
||||
}
|
||||
if (listValues.isEmpty()){
|
||||
throw new ServiceException("没有数据");
|
||||
}
|
||||
try {
|
||||
ExcelUtil.exportMultiSheetExcelEnhanced(listValues, names, PgsProgressCategoryVo.class, null, response);
|
||||
} catch (IOException e) {
|
||||
|
||||
@ -2992,12 +2992,12 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
||||
if (info.getContractorId() != null) {
|
||||
boolean flag = false;
|
||||
for (SubContractor subContractor : SubContractors) {
|
||||
if (subContractor.getId().equals(info.getContractorId())) {
|
||||
if (Objects.equals(subContractor.getId(), info.getContractorId())) {
|
||||
flag = true;
|
||||
ryglWebSocketVo.setZzmc(subContractor.getName());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!flag){
|
||||
ryglWebSocketVo.setZzmc("暂无名称");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user