Merge branch 'master' of https://gitea.zianxin.com/zax/biz-api-cloud
This commit is contained in:
commit
1fc0483fe8
9 files changed
+337
-9
No files matched your search
+103
@@ -0,0 +1,103 @@
|
||||
package com.bsd.pjcloud.integrated.vo.maintenance.app;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* App端维修工单详情VO
|
||||
*
|
||||
* @author zjf
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "App端维修工单详情VO")
|
||||
public class MaintenanceOrderAppDetailVo {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@Schema(description = "设备名称")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@Schema(description = "图片")
|
||||
private String picUrl;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 发现日期
|
||||
*/
|
||||
@Schema(description = "发现日期")
|
||||
private LocalDate dateFound;
|
||||
|
||||
/**
|
||||
* 发现地点
|
||||
*/
|
||||
@Schema(description = "设备位置")
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 工单紧急层度'high', 'medium', 'low'
|
||||
*/
|
||||
@Schema(description = "工单紧急层度'high', 'medium', 'low'")
|
||||
private String urgency;
|
||||
|
||||
/**
|
||||
* 维修类型
|
||||
*/
|
||||
@Schema(description = "维修类型")
|
||||
private Long maintainType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 处理说明/回复内容
|
||||
*/
|
||||
@Schema(description = "处理说明/回复内容")
|
||||
private String handleRemark;
|
||||
|
||||
/**
|
||||
* 处理图片(多个图片URL,逗号分隔)
|
||||
*/
|
||||
@Schema(description = "处理图片URL(多个用逗号分隔)")
|
||||
private String handlePicUrl;
|
||||
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
@Schema(description = "处理时间")
|
||||
private LocalDateTime handleTime;
|
||||
|
||||
/**
|
||||
* 处理人
|
||||
*/
|
||||
@Schema(description = "处理人")
|
||||
private String handleBy;
|
||||
}
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.bsd.pjcloud.integrated.vo.maintenance.app;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* App端维修工单列表VO
|
||||
*
|
||||
* @author zjf
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "App端维修工单列表VO")
|
||||
public class MaintenanceOrderAppListVo {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@Schema(description = "设备名称")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@Schema(description = "图片")
|
||||
private String picUrl;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 发现日期
|
||||
*/
|
||||
@Schema(description = "发现日期")
|
||||
private LocalDate dateFound;
|
||||
|
||||
/**
|
||||
* 发现地点
|
||||
*/
|
||||
@Schema(description = "设备位置")
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* 工单紧急层度'high', 'medium', 'low'
|
||||
*/
|
||||
@Schema(description = "工单紧急层度'high', 'medium', 'low'")
|
||||
private String urgency;
|
||||
|
||||
/**
|
||||
* 维修类型
|
||||
*/
|
||||
@Schema(description = "维修类型")
|
||||
private Long maintainType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
@Schema(description = "处理时间")
|
||||
private LocalDateTime handleTime;
|
||||
|
||||
/**
|
||||
* 处理人
|
||||
*/
|
||||
@Schema(description = "处理人")
|
||||
private String handleBy;
|
||||
}
|
||||
|
||||
+69
-6
@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteDictService;
|
||||
@@ -24,7 +25,10 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.bsd.pjcloud.integrated.dto.MaintenanceOrderAppCreateDTO;
|
||||
import com.bsd.pjcloud.integrated.dto.MaintenanceOrderHandleDTO;
|
||||
import com.bsd.pjcloud.integrated.vo.maintenance.MaintenanceOrderScreenVo;
|
||||
import com.bsd.pjcloud.integrated.vo.maintenance.app.MaintenanceOrderAppDetailVo;
|
||||
import com.bsd.pjcloud.integrated.vo.maintenance.app.MaintenanceOrderAppListVo;
|
||||
import com.bsd.pjcloud.integrated.vo.MaintenanceTypeVO;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysDictItem;
|
||||
|
||||
@@ -34,6 +38,7 @@ import java.util.HashMap;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 维修工单主表
|
||||
@@ -64,6 +69,7 @@ public class MaintenanceOrderController {
|
||||
public R getMaintenanceOrderPage(@ParameterObject Page page, @ParameterObject MaintenanceOrderEntity maintenanceOrder) {
|
||||
LambdaQueryWrapper<MaintenanceOrderEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(StrUtil.isNotBlank(maintenanceOrder.getTitle()),MaintenanceOrderEntity::getTitle,maintenanceOrder.getTitle());
|
||||
wrapper.orderByDesc(MaintenanceOrderEntity::getCreateTime);
|
||||
return R.ok(maintenanceOrderService.page(page, wrapper));
|
||||
}
|
||||
|
||||
@@ -158,13 +164,22 @@ public class MaintenanceOrderController {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/app/my")
|
||||
@Operation(summary = "App端-我的维修分页列表", description = "App端用户分页查询自己的维修单")
|
||||
@Operation(summary = "App端-我的维修分页列表", description = "App端用户分页查询自己的维修单,按创建时间倒序")
|
||||
// @PreAuthorize("@pms.hasPermission('integrated_maintenanceOrder_view')")
|
||||
public R myMaintenanceOrders(@ParameterObject Page page) {
|
||||
public R<IPage<MaintenanceOrderAppListVo>> myMaintenanceOrders(@ParameterObject Page page) {
|
||||
Long userId = SecurityUtils.getUser().getId();
|
||||
LambdaQueryWrapper<MaintenanceOrderEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(MaintenanceOrderEntity::getUserId, userId);
|
||||
return R.ok(maintenanceOrderService.page(page, wrapper));
|
||||
wrapper.orderByDesc(MaintenanceOrderEntity::getCreateTime); // 按创建时间倒序,最新的在第一条
|
||||
|
||||
IPage<MaintenanceOrderEntity> entityPage = maintenanceOrderService.page(page, wrapper);
|
||||
|
||||
// 转换为VO
|
||||
IPage<MaintenanceOrderAppListVo> voPage = entityPage.convert(entity ->
|
||||
BeanUtils.toBean(entity, MaintenanceOrderAppListVo.class)
|
||||
);
|
||||
|
||||
return R.ok(voPage);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,15 +188,18 @@ public class MaintenanceOrderController {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/app/my/{id}")
|
||||
@Operation(summary = "App端-我的维修单详情", description = "App端用户查看自己维修单详情")
|
||||
@Operation(summary = "App端-我的维修单详情", description = "App端用户查看自己维修单详情,包含处理说明和处理图片")
|
||||
// @PreAuthorize("@pms.hasPermission('integrated_maintenanceOrder_view')")
|
||||
public R myMaintenanceOrderDetail(@PathVariable("id") Long id) {
|
||||
public R<MaintenanceOrderAppDetailVo> myMaintenanceOrderDetail(@PathVariable("id") Long id) {
|
||||
Long userId = SecurityUtils.getUser().getId();
|
||||
MaintenanceOrderEntity entity = maintenanceOrderService.getById(id);
|
||||
if (entity == null || !Objects.equals(entity.getUserId(), userId)) {
|
||||
return R.failed("无权查看该维修单");
|
||||
}
|
||||
return R.ok(entity);
|
||||
|
||||
// 转换为VO
|
||||
MaintenanceOrderAppDetailVo vo = BeanUtils.toBean(entity, MaintenanceOrderAppDetailVo.class);
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,4 +251,49 @@ public class MaintenanceOrderController {
|
||||
|
||||
return R.ok(voList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台处理维修工单(支持填写处理情况和图片URL)
|
||||
* @param dto 处理工单DTO
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "后台处理维修工单", description = "后台管理员处理工单,可填写处理说明和图片URL")
|
||||
@SysLog("后台处理维修工单")
|
||||
@PostMapping("/handle")
|
||||
@PreAuthorize("@pms.hasPermission('integrated_maintenanceOrder_edit')")
|
||||
public R handleMaintenanceOrder(@RequestBody MaintenanceOrderHandleDTO dto) {
|
||||
// 查询工单
|
||||
MaintenanceOrderEntity entity = maintenanceOrderService.getById(dto.getId());
|
||||
if (entity == null) {
|
||||
return R.failed("工单不存在");
|
||||
}
|
||||
|
||||
// 更新工单信息
|
||||
if (StrUtil.isNotBlank(dto.getHandleRemark())) {
|
||||
entity.setHandleRemark(dto.getHandleRemark());
|
||||
}
|
||||
if (StrUtil.isNotBlank(dto.getHandlePicUrl())) {
|
||||
// 如果已有图片,追加新图片(用逗号分隔)
|
||||
String existingPics = entity.getHandlePicUrl();
|
||||
if (StrUtil.isNotBlank(existingPics)) {
|
||||
entity.setHandlePicUrl(existingPics + "," + dto.getHandlePicUrl());
|
||||
} else {
|
||||
entity.setHandlePicUrl(dto.getHandlePicUrl());
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotBlank(dto.getStatus())) {
|
||||
entity.setStatus(dto.getStatus());
|
||||
}
|
||||
|
||||
// 设置处理时间和处理人
|
||||
entity.setHandleTime(LocalDateTime.now());
|
||||
entity.setHandleBy(SecurityUtils.getUser().getUsername());
|
||||
|
||||
boolean success = maintenanceOrderService.updateById(entity);
|
||||
if (success) {
|
||||
return R.ok("工单处理成功");
|
||||
} else {
|
||||
return R.failed("工单处理失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.bsd.pjcloud.integrated.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 维修工单处理DTO
|
||||
*
|
||||
* @author zjf
|
||||
* @date 2025-01-27
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "维修工单处理DTO")
|
||||
public class MaintenanceOrderHandleDTO {
|
||||
|
||||
/**
|
||||
* 工单ID
|
||||
*/
|
||||
@Schema(description = "工单ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 处理说明/回复内容
|
||||
*/
|
||||
@Schema(description = "处理说明/回复内容")
|
||||
private String handleRemark;
|
||||
|
||||
/**
|
||||
* 处理图片(多个图片URL,逗号分隔)
|
||||
*/
|
||||
@Schema(description = "处理图片URL(多个用逗号分隔)")
|
||||
private String handlePicUrl;
|
||||
|
||||
/**
|
||||
* 状态(可选,如:已完成、处理中等)
|
||||
*/
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
}
|
||||
|
||||
+24
@@ -140,4 +140,28 @@ public class MaintenanceOrderEntity extends Model<MaintenanceOrderEntity> {
|
||||
*/
|
||||
@Schema(description="维修类型")
|
||||
private Long maintainType;
|
||||
|
||||
/**
|
||||
* 处理说明/回复内容
|
||||
*/
|
||||
@Schema(description="处理说明/回复内容")
|
||||
private String handleRemark;
|
||||
|
||||
/**
|
||||
* 处理图片(多个图片URL,逗号分隔)
|
||||
*/
|
||||
@Schema(description="处理图片(多个用逗号分隔)")
|
||||
private String handlePicUrl;
|
||||
|
||||
/**
|
||||
* 处理时间
|
||||
*/
|
||||
@Schema(description="处理时间")
|
||||
private LocalDateTime handleTime;
|
||||
|
||||
/**
|
||||
* 处理人
|
||||
*/
|
||||
@Schema(description="处理人")
|
||||
private String handleBy;
|
||||
}
|
||||
+4
@@ -22,5 +22,9 @@
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="maintainType" column="maintain_type"/>
|
||||
<result property="handleRemark" column="handle_remark"/>
|
||||
<result property="handlePicUrl" column="handle_pic_url"/>
|
||||
<result property="handleTime" column="handle_time"/>
|
||||
<result property="handleBy" column="handle_by"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+1
@@ -162,6 +162,7 @@ public class ReportController {
|
||||
public List<InventoryReportExcelDTO> exportInventoryReport(
|
||||
@Parameter(description = "查询条件") @ParameterObject InventoryReportQueryDTO queryDTO) {
|
||||
log.info("开始导出进销存报表,查询条件:{}", queryDTO);
|
||||
log.info("开始导出进销存报表,查询条件:{}", queryDTO);
|
||||
List<InventoryReportExcelDTO> list = inventoryReportService.exportExcel(queryDTO);
|
||||
log.info("导出进销存报表成功,导出记录数:{}", list.size());
|
||||
return list;
|
||||
|
||||
+3
-3
@@ -50,6 +50,8 @@
|
||||
spu.id AS product_id,
|
||||
spu.product_code,
|
||||
spu.product_name,
|
||||
spu.dept_id,
|
||||
spu.create_by,
|
||||
cat.name AS category_name,
|
||||
base.spec AS spec,
|
||||
base.unit AS unit,
|
||||
@@ -165,9 +167,7 @@
|
||||
<if test="param.supplierId != null">
|
||||
AND r.supplier_id = #{param.supplierId}
|
||||
</if>
|
||||
<if test="dataScope != null">
|
||||
${dataScope.sqlFilter}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
GROUP BY spu.id, spu.product_code, spu.product_name, cat.name,
|
||||
base.spec, base.unit, base.package_num, base.purchase_price, base.retail_price, stock.current_stock
|
||||
|
||||
+2
@@ -32,6 +32,8 @@
|
||||
spu.id AS product_id,
|
||||
spu.product_code,
|
||||
spu.product_name,
|
||||
spu.dept_id,
|
||||
spu.create_by,
|
||||
cat.name AS category_name,
|
||||
base.spec AS spec,
|
||||
base.unit AS unit,
|
||||
|
||||
Reference in new issue
Block a user