feat(sip): 添加订单配置信息和文件日志功能
- 新增订单配置信息相关接口和服务实现 - 添加订单文件日志相关接口和服务实现 - 在订单信息中增加配置文件和合同文件列表 - 优化文件上传逻辑,支持配置器导入master
parent
a11879d098
commit
e384ef51dc
|
@ -1,5 +1,6 @@
|
|||
ruoyi:
|
||||
demoEnabled: false
|
||||
profile: /home/application/uploadPath
|
||||
excelTemplate: /home/application/excelTemplate
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为80
|
||||
|
|
|
@ -9,7 +9,7 @@ ruoyi:
|
|||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: D:\ruoyi\uploadPath
|
||||
profile: D:\ruoyi\uploadPath\oms
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 开发环境配置
|
||||
|
|
|
@ -144,7 +144,10 @@ public class FileUploadUtils
|
|||
{
|
||||
int dirLastIndex = RuoYiConfig.getProfile().length() + 1;
|
||||
String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
|
||||
return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
|
||||
return StringUtils.isNotEmpty(currentDir) ?
|
||||
Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName
|
||||
: Constants.RESOURCE_PREFIX + "/" + fileName
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -185,7 +185,6 @@ public class OrderInfoController extends BaseController
|
|||
public void listExport(HttpServletRequest request, HttpServletResponse response) {
|
||||
try
|
||||
{
|
||||
|
||||
// 本地资源路径
|
||||
String localPath = RuoYiConfig.getExcelTemplate();
|
||||
// 下载名称
|
||||
|
|
|
@ -1,8 +1,24 @@
|
|||
package com.ruoyi.sip.controller;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.sip.domain.DeliveryList;
|
||||
import com.ruoyi.sip.domain.ProjectOrderConfigInfo;
|
||||
import com.ruoyi.sip.domain.ProjectOrderFileLog;
|
||||
import com.ruoyi.sip.service.IProjectOrderConfigInfoService;
|
||||
import com.ruoyi.sip.service.IProjectOrderFileLogService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -18,6 +34,10 @@ import com.ruoyi.common.core.controller.BaseController;
|
|||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 订单管理Controller
|
||||
|
@ -27,6 +47,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||
*/
|
||||
@Controller
|
||||
@RequestMapping("/project/order")
|
||||
@Slf4j
|
||||
public class ProjectOrderInfoController extends BaseController
|
||||
{
|
||||
private String prefix = "project/order";
|
||||
|
@ -34,6 +55,10 @@ public class ProjectOrderInfoController extends BaseController
|
|||
@Autowired
|
||||
private IProjectOrderInfoService projectOrderInfoService;
|
||||
|
||||
@Autowired
|
||||
private IProjectOrderConfigInfoService projectOrderConfigInfoService;
|
||||
@Autowired
|
||||
private IProjectOrderFileLogService fileLogService;
|
||||
@RequiresPermissions("project:order:view")
|
||||
@GetMapping()
|
||||
public String order()
|
||||
|
@ -125,4 +150,68 @@ public class ProjectOrderInfoController extends BaseController
|
|||
{
|
||||
return toAjax(projectOrderInfoService.deleteProjectOrderInfoByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*/
|
||||
|
||||
@PostMapping("/importConfigData")
|
||||
@ResponseBody
|
||||
public AjaxResult importConfigData(MultipartFile file, Long orderId) {
|
||||
return projectOrderConfigInfoService.importConfigData(file, orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*/
|
||||
|
||||
@PostMapping("/importContractData")
|
||||
@ResponseBody
|
||||
public AjaxResult importContractData(MultipartFile file, Long orderId) {
|
||||
ProjectOrderFileLog projectOrderFileLog = new ProjectOrderFileLog();
|
||||
projectOrderFileLog.setFileType(ProjectOrderFileLog.FileTypeEnum.CONTRACT.getCode());
|
||||
projectOrderFileLog.setOrderId(orderId);
|
||||
projectOrderFileLog.setUploadTime(DateUtils.getNowDate());
|
||||
projectOrderFileLog.setUploadUser(ShiroUtils.getUserId().toString());
|
||||
projectOrderFileLog.setFileName(file.getOriginalFilename());
|
||||
try {
|
||||
String upload = FileUploadUtils.upload(file);
|
||||
projectOrderFileLog.setFilePath(upload);
|
||||
} catch (IOException e) {
|
||||
return AjaxResult.error("上传失败");
|
||||
}
|
||||
fileLogService.insertProjectOrderFileLog(projectOrderFileLog);
|
||||
return AjaxResult.success("导入成功");
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/contract/export")
|
||||
public void contractExport(String fileName, HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
// 本地资源路径
|
||||
String localPath = RuoYiConfig.getExcelTemplate();
|
||||
// 下载名称
|
||||
String downloadPath = localPath + File.separator + fileName;
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, fileName);
|
||||
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
@GetMapping("/file/download")
|
||||
public void download(String filePath, HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
// 本地资源路径
|
||||
String localPath = RuoYiConfig.getProfile();
|
||||
// 下载名称
|
||||
String downloadPath = filePath.replace(Constants.RESOURCE_PREFIX,localPath);
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, filePath);
|
||||
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
package com.ruoyi.sip.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 订单配置信息对象 project_order_config_info
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@Data
|
||||
public class ProjectOrderConfigInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 订单id */
|
||||
// @Excel(name = "订单id")
|
||||
private Long orderId;
|
||||
|
||||
/** 产品编码 */
|
||||
@Excel(name = "产品编码")
|
||||
private String productBomCode;
|
||||
|
||||
/** 产品型号 */
|
||||
@Excel(name = "产品型号")
|
||||
private String model;
|
||||
|
||||
/** 产品代码 */
|
||||
@Excel(name = "产品代码")
|
||||
private String productCode;
|
||||
|
||||
/** 产品描述 */
|
||||
@Excel(name = "描述")
|
||||
private String productDesc;
|
||||
|
||||
/** 产品数量 */
|
||||
@Excel(name = "数量")
|
||||
private Long quantity;
|
||||
|
||||
/** 目录单价 */
|
||||
@Excel(name = "目录单价(RMB)")
|
||||
private BigDecimal cataloguePrice;
|
||||
/** 指导折扣 */
|
||||
@Excel(name = "指导折扣")
|
||||
private BigDecimal guidanceDiscount;
|
||||
|
||||
/** 折扣 */
|
||||
@Excel(name = "折扣")
|
||||
private BigDecimal discount;
|
||||
|
||||
/** 单价 */
|
||||
@Excel(name = "单价(RMB)")
|
||||
private BigDecimal price;
|
||||
/** 总价 */
|
||||
@Excel(name = "总价(RMB)")
|
||||
private BigDecimal allPrice;
|
||||
/** 目录总价 */
|
||||
@Excel(name = "目录总价(RMB)")
|
||||
private BigDecimal catalogueAllPrice;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** 性能参数 */
|
||||
@Excel(name = "性能参数")
|
||||
private String performanceParameters;
|
||||
|
||||
/** CID信息 */
|
||||
@Excel(name = "CID信息")
|
||||
private String cidInfo;
|
||||
/** CID信息 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.ruoyi.sip.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 订单文件对象 project_order_file_log
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@Data
|
||||
public class ProjectOrderFileLog extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 订单id */
|
||||
@Excel(name = "订单id")
|
||||
private Long orderId;
|
||||
|
||||
/** 文件名称 */
|
||||
@Excel(name = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
/** 上传人 */
|
||||
@Excel(name = "上传人")
|
||||
private String uploadUser;
|
||||
|
||||
/** 上传时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date uploadTime;
|
||||
|
||||
/** 文件路径 */
|
||||
@Excel(name = "文件路径")
|
||||
private String filePath;
|
||||
|
||||
/** 文件类型 1:配置器 2:合同 */
|
||||
@Excel(name = "文件类型 1:配置器 2:合同")
|
||||
private String fileType;
|
||||
|
||||
@Getter
|
||||
public enum FileTypeEnum{
|
||||
CONFIG("1","配置器"),
|
||||
CONTRACT("2","合同");
|
||||
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
FileTypeEnum(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.ruoyi.sip.domain;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
@ -166,5 +167,7 @@ public class ProjectOrderInfo extends BaseEntity {
|
|||
*/
|
||||
@Excel(name = "订单状态")
|
||||
private String orderStatus;
|
||||
private List<ProjectOrderFileLog> contractFileList;
|
||||
private List<ProjectOrderFileLog> configFileList;
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
package com.ruoyi.sip.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.sip.domain.ProjectOrderConfigInfo;
|
||||
|
||||
/**
|
||||
* 订单配置信息Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
public interface ProjectOrderConfigInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询订单配置信息
|
||||
*
|
||||
* @param id 订单配置信息主键
|
||||
* @return 订单配置信息
|
||||
*/
|
||||
public ProjectOrderConfigInfo selectProjectOrderConfigInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单配置信息列表
|
||||
*
|
||||
* @param projectOrderConfigInfo 订单配置信息
|
||||
* @return 订单配置信息集合
|
||||
*/
|
||||
public List<ProjectOrderConfigInfo> selectProjectOrderConfigInfoList(ProjectOrderConfigInfo projectOrderConfigInfo);
|
||||
|
||||
/**
|
||||
* 新增订单配置信息
|
||||
*
|
||||
* @param projectOrderConfigInfo 订单配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProjectOrderConfigInfo(ProjectOrderConfigInfo projectOrderConfigInfo);
|
||||
|
||||
/**
|
||||
* 修改订单配置信息
|
||||
*
|
||||
* @param projectOrderConfigInfo 订单配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProjectOrderConfigInfo(ProjectOrderConfigInfo projectOrderConfigInfo);
|
||||
|
||||
/**
|
||||
* 删除订单配置信息
|
||||
*
|
||||
* @param id 订单配置信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProjectOrderConfigInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除订单配置信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProjectOrderConfigInfoByIds(String[] ids);
|
||||
|
||||
void insertBatch(List<ProjectOrderConfigInfo> orderConfigInfoList);
|
||||
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.ruoyi.sip.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.sip.domain.ProjectOrderFileLog;
|
||||
|
||||
/**
|
||||
* 订单文件Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
public interface ProjectOrderFileLogMapper
|
||||
{
|
||||
/**
|
||||
* 查询订单文件
|
||||
*
|
||||
* @param id 订单文件主键
|
||||
* @return 订单文件
|
||||
*/
|
||||
public ProjectOrderFileLog selectProjectOrderFileLogById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单文件列表
|
||||
*
|
||||
* @param projectOrderFileLog 订单文件
|
||||
* @return 订单文件集合
|
||||
*/
|
||||
public List<ProjectOrderFileLog> selectProjectOrderFileLogList(ProjectOrderFileLog projectOrderFileLog);
|
||||
|
||||
/**
|
||||
* 新增订单文件
|
||||
*
|
||||
* @param projectOrderFileLog 订单文件
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProjectOrderFileLog(ProjectOrderFileLog projectOrderFileLog);
|
||||
|
||||
/**
|
||||
* 修改订单文件
|
||||
*
|
||||
* @param projectOrderFileLog 订单文件
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProjectOrderFileLog(ProjectOrderFileLog projectOrderFileLog);
|
||||
|
||||
/**
|
||||
* 删除订单文件
|
||||
*
|
||||
* @param id 订单文件主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProjectOrderFileLogById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除订单文件
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProjectOrderFileLogByIds(String[] ids);
|
||||
|
||||
void deleteProjectOrderFileLogByOrderIdList(List<Long> longs);
|
||||
|
||||
List<ProjectOrderFileLog> listByOrderId(List<Long> orderIdList);
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.ruoyi.sip.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.sip.domain.ProjectOrderConfigInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 订单配置信息Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
public interface IProjectOrderConfigInfoService
|
||||
{
|
||||
/**
|
||||
* 查询订单配置信息
|
||||
*
|
||||
* @param id 订单配置信息主键
|
||||
* @return 订单配置信息
|
||||
*/
|
||||
public ProjectOrderConfigInfo selectProjectOrderConfigInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单配置信息列表
|
||||
*
|
||||
* @param projectOrderConfigInfo 订单配置信息
|
||||
* @return 订单配置信息集合
|
||||
*/
|
||||
public List<ProjectOrderConfigInfo> selectProjectOrderConfigInfoList(ProjectOrderConfigInfo projectOrderConfigInfo);
|
||||
|
||||
/**
|
||||
* 新增订单配置信息
|
||||
*
|
||||
* @param projectOrderConfigInfo 订单配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProjectOrderConfigInfo(ProjectOrderConfigInfo projectOrderConfigInfo);
|
||||
|
||||
/**
|
||||
* 修改订单配置信息
|
||||
*
|
||||
* @param projectOrderConfigInfo 订单配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProjectOrderConfigInfo(ProjectOrderConfigInfo projectOrderConfigInfo);
|
||||
|
||||
/**
|
||||
* 批量删除订单配置信息
|
||||
*
|
||||
* @param ids 需要删除的订单配置信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProjectOrderConfigInfoByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除订单配置信息信息
|
||||
*
|
||||
* @param id 订单配置信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProjectOrderConfigInfoById(Long id);
|
||||
|
||||
AjaxResult importConfigData(MultipartFile orderConfigInfoList, Long orderId);
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.ruoyi.sip.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.sip.domain.ProjectOrderFileLog;
|
||||
|
||||
/**
|
||||
* 订单文件Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
public interface IProjectOrderFileLogService
|
||||
{
|
||||
/**
|
||||
* 查询订单文件
|
||||
*
|
||||
* @param id 订单文件主键
|
||||
* @return 订单文件
|
||||
*/
|
||||
public ProjectOrderFileLog selectProjectOrderFileLogById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单文件列表
|
||||
*
|
||||
* @param projectOrderFileLog 订单文件
|
||||
* @return 订单文件集合
|
||||
*/
|
||||
public List<ProjectOrderFileLog> selectProjectOrderFileLogList(ProjectOrderFileLog projectOrderFileLog);
|
||||
|
||||
/**
|
||||
* 新增订单文件
|
||||
*
|
||||
* @param projectOrderFileLog 订单文件
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProjectOrderFileLog(ProjectOrderFileLog projectOrderFileLog);
|
||||
|
||||
/**
|
||||
* 修改订单文件
|
||||
*
|
||||
* @param projectOrderFileLog 订单文件
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProjectOrderFileLog(ProjectOrderFileLog projectOrderFileLog);
|
||||
|
||||
/**
|
||||
* 批量删除订单文件
|
||||
*
|
||||
* @param ids 需要删除的订单文件主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProjectOrderFileLogByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除订单文件信息
|
||||
*
|
||||
* @param id 订单文件主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProjectOrderFileLogById(Long id);
|
||||
|
||||
void deleteProjectOrderFileLogByOrderIdList(List<Long> longs);
|
||||
|
||||
List<ProjectOrderFileLog> listByOrderId(List<Long> longs);
|
||||
}
|
|
@ -0,0 +1,163 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.sip.domain.ProjectOrderFileLog;
|
||||
import com.ruoyi.sip.service.IProjectOrderFileLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.sip.mapper.ProjectOrderConfigInfoMapper;
|
||||
import com.ruoyi.sip.domain.ProjectOrderConfigInfo;
|
||||
import com.ruoyi.sip.service.IProjectOrderConfigInfoService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 订单配置信息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ProjectOrderConfigInfoServiceImpl implements IProjectOrderConfigInfoService {
|
||||
@Autowired
|
||||
private ProjectOrderConfigInfoMapper projectOrderConfigInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private IProjectOrderFileLogService fileLogService;
|
||||
|
||||
/**
|
||||
* 查询订单配置信息
|
||||
*
|
||||
* @param id 订单配置信息主键
|
||||
* @return 订单配置信息
|
||||
*/
|
||||
@Override
|
||||
public ProjectOrderConfigInfo selectProjectOrderConfigInfoById(Long id) {
|
||||
return projectOrderConfigInfoMapper.selectProjectOrderConfigInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单配置信息列表
|
||||
*
|
||||
* @param projectOrderConfigInfo 订单配置信息
|
||||
* @return 订单配置信息
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectOrderConfigInfo> selectProjectOrderConfigInfoList(ProjectOrderConfigInfo projectOrderConfigInfo) {
|
||||
return projectOrderConfigInfoMapper.selectProjectOrderConfigInfoList(projectOrderConfigInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单配置信息
|
||||
*
|
||||
* @param projectOrderConfigInfo 订单配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProjectOrderConfigInfo(ProjectOrderConfigInfo projectOrderConfigInfo) {
|
||||
return projectOrderConfigInfoMapper.insertProjectOrderConfigInfo(projectOrderConfigInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单配置信息
|
||||
*
|
||||
* @param projectOrderConfigInfo 订单配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProjectOrderConfigInfo(ProjectOrderConfigInfo projectOrderConfigInfo) {
|
||||
return projectOrderConfigInfoMapper.updateProjectOrderConfigInfo(projectOrderConfigInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单配置信息
|
||||
*
|
||||
* @param ids 需要删除的订单配置信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProjectOrderConfigInfoByIds(String ids) {
|
||||
return projectOrderConfigInfoMapper.deleteProjectOrderConfigInfoByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单配置信息信息
|
||||
*
|
||||
* @param id 订单配置信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProjectOrderConfigInfoById(Long id) {
|
||||
return projectOrderConfigInfoMapper.deleteProjectOrderConfigInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult importConfigData(MultipartFile file, Long orderId) {
|
||||
|
||||
List<ProjectOrderConfigInfo> orderConfigInfoList = null;
|
||||
try {
|
||||
ExcelUtil<ProjectOrderConfigInfo> util = new ExcelUtil<ProjectOrderConfigInfo>(ProjectOrderConfigInfo.class);
|
||||
orderConfigInfoList = util.importExcel(file.getInputStream());
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException("导入失败,读取文件错误");
|
||||
}
|
||||
|
||||
//保存文件
|
||||
fileLogService.deleteProjectOrderFileLogByOrderIdList(Collections.singletonList( orderId));
|
||||
ProjectOrderFileLog projectOrderFileLog = new ProjectOrderFileLog();
|
||||
try {
|
||||
String upload = FileUploadUtils.upload(file);
|
||||
projectOrderFileLog.setFilePath(upload);
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException("导入失败,上传文件错误");
|
||||
}
|
||||
projectOrderFileLog.setFileName(file.getOriginalFilename());
|
||||
projectOrderFileLog.setFileType(ProjectOrderFileLog.FileTypeEnum.CONFIG.getCode());
|
||||
projectOrderFileLog.setOrderId(orderId);
|
||||
projectOrderFileLog.setUploadTime(DateUtils.getNowDate());
|
||||
projectOrderFileLog.setUploadUser(ShiroUtils.getUserId().toString());
|
||||
fileLogService.insertProjectOrderFileLog(projectOrderFileLog);
|
||||
|
||||
|
||||
|
||||
if (CollUtil.isEmpty(orderConfigInfoList)) {
|
||||
return AjaxResult.error("文件为空");
|
||||
}
|
||||
List<String> productCodeList = orderConfigInfoList.stream().map(ProjectOrderConfigInfo::getProductCode).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
if (productCodeList.isEmpty()) {
|
||||
return AjaxResult.error("文件为空或产品编码为空");
|
||||
}
|
||||
// List<OrderList> orderLists = infoMapper.listOrderListByDeliveryId(deliveryId);
|
||||
// if (orderLists.isEmpty()) {
|
||||
// return AjaxResult.error("发货单中没有产品");
|
||||
// }
|
||||
// List<String> existsProductCodeList = orderLists.stream().map(OrderList::getProductCode).collect(Collectors.toList());
|
||||
// List<String> notExistsProductCodeList = productCodeList.stream().filter(productCode -> !existsProductCodeList.contains(productCode)).distinct().collect(Collectors.toList());
|
||||
// if (!notExistsProductCodeList.isEmpty()) {
|
||||
// return AjaxResult.error(StringUtils.format("编码为[{}]的产品在合同请单中未找到,请确认后重试;", String.join(",", notExistsProductCodeList)));
|
||||
// }
|
||||
|
||||
for (ProjectOrderConfigInfo configInfo : orderConfigInfoList) {
|
||||
configInfo.setOrderId(orderId);
|
||||
}
|
||||
|
||||
projectOrderConfigInfoMapper.insertBatch(orderConfigInfoList);
|
||||
return AjaxResult.success("导入成功");
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.sip.mapper.ProjectOrderFileLogMapper;
|
||||
import com.ruoyi.sip.domain.ProjectOrderFileLog;
|
||||
import com.ruoyi.sip.service.IProjectOrderFileLogService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 订单文件Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-06-03
|
||||
*/
|
||||
@Service
|
||||
public class ProjectOrderFileLogServiceImpl implements IProjectOrderFileLogService
|
||||
{
|
||||
@Autowired
|
||||
private ProjectOrderFileLogMapper projectOrderFileLogMapper;
|
||||
|
||||
/**
|
||||
* 查询订单文件
|
||||
*
|
||||
* @param id 订单文件主键
|
||||
* @return 订单文件
|
||||
*/
|
||||
@Override
|
||||
public ProjectOrderFileLog selectProjectOrderFileLogById(Long id)
|
||||
{
|
||||
return projectOrderFileLogMapper.selectProjectOrderFileLogById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单文件列表
|
||||
*
|
||||
* @param projectOrderFileLog 订单文件
|
||||
* @return 订单文件
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectOrderFileLog> selectProjectOrderFileLogList(ProjectOrderFileLog projectOrderFileLog)
|
||||
{
|
||||
return projectOrderFileLogMapper.selectProjectOrderFileLogList(projectOrderFileLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单文件
|
||||
*
|
||||
* @param projectOrderFileLog 订单文件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProjectOrderFileLog(ProjectOrderFileLog projectOrderFileLog)
|
||||
{
|
||||
return projectOrderFileLogMapper.insertProjectOrderFileLog(projectOrderFileLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单文件
|
||||
*
|
||||
* @param projectOrderFileLog 订单文件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProjectOrderFileLog(ProjectOrderFileLog projectOrderFileLog)
|
||||
{
|
||||
return projectOrderFileLogMapper.updateProjectOrderFileLog(projectOrderFileLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单文件
|
||||
*
|
||||
* @param ids 需要删除的订单文件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProjectOrderFileLogByIds(String ids)
|
||||
{
|
||||
return projectOrderFileLogMapper.deleteProjectOrderFileLogByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单文件信息
|
||||
*
|
||||
* @param id 订单文件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProjectOrderFileLogById(Long id)
|
||||
{
|
||||
return projectOrderFileLogMapper.deleteProjectOrderFileLogById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProjectOrderFileLogByOrderIdList(List<Long> longs) {
|
||||
projectOrderFileLogMapper.deleteProjectOrderFileLogByOrderIdList(longs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectOrderFileLog> listByOrderId(List<Long> orderIdList) {
|
||||
return projectOrderFileLogMapper.listByOrderId(orderIdList);
|
||||
}
|
||||
}
|
|
@ -2,9 +2,13 @@ package com.ruoyi.sip.service.impl;
|
|||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.sip.domain.ProjectOrderFileLog;
|
||||
import com.ruoyi.sip.service.IProjectOrderFileLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.sip.mapper.ProjectOrderInfoMapper;
|
||||
|
@ -23,6 +27,8 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService {
|
|||
@Autowired
|
||||
private ProjectOrderInfoMapper projectOrderInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private IProjectOrderFileLogService fileLogService;
|
||||
/**
|
||||
* 查询订单管理
|
||||
*
|
||||
|
@ -31,7 +37,13 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService {
|
|||
*/
|
||||
@Override
|
||||
public ProjectOrderInfo selectProjectOrderInfoById(Long id) {
|
||||
return projectOrderInfoMapper.selectProjectOrderInfoById(id);
|
||||
ProjectOrderInfo projectOrderInfo = projectOrderInfoMapper.selectProjectOrderInfoById(id);
|
||||
List<ProjectOrderFileLog> projectOrderFileLogs = fileLogService.listByOrderId(Collections.singletonList(id));
|
||||
Map<String, List<ProjectOrderFileLog>> fileLogMap =
|
||||
projectOrderFileLogs.stream().collect(Collectors.groupingBy(ProjectOrderFileLog::getFileType));
|
||||
projectOrderInfo.setContractFileList(fileLogMap.get(ProjectOrderFileLog.FileTypeEnum.CONTRACT.getCode()));
|
||||
projectOrderInfo.setConfigFileList(fileLogMap.get(ProjectOrderFileLog.FileTypeEnum.CONFIG.getCode()));
|
||||
return projectOrderInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,138 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.sip.mapper.ProjectOrderConfigInfoMapper">
|
||||
|
||||
<resultMap type="ProjectOrderConfigInfo" id="ProjectOrderConfigInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="productBomCode" column="product_bom_code" />
|
||||
<result property="model" column="model" />
|
||||
<result property="productCode" column="product_code" />
|
||||
<result property="productDesc" column="product_desc" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="cataloguePrice" column="catalogue_price" />
|
||||
<result property="catalogueAllPrice" column="catalogue_all_price" />
|
||||
<result property="price" column="price" />
|
||||
<result property="allPrice" column="all_price" />
|
||||
<result property="guidanceDiscount" column="guidance_discount" />
|
||||
<result property="discount" column="discount" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="performanceParameters" column="performance_parameters" />
|
||||
<result property="cidInfo" column="cid_info" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProjectOrderConfigInfoVo">
|
||||
select id, order_id, product_bom_code, model, product_code, product_desc, quantity,
|
||||
catalogue_price, catalogue_all_price, price, all_price, guidance_discount, discount, remark,
|
||||
performance_parameters, cid_info from project_order_config_info
|
||||
</sql>
|
||||
|
||||
<select id="selectProjectOrderConfigInfoList" parameterType="ProjectOrderConfigInfo" resultMap="ProjectOrderConfigInfoResult">
|
||||
<include refid="selectProjectOrderConfigInfoVo"/>
|
||||
<where>
|
||||
<if test="orderId != null "> and order_id = #{orderId}</if>
|
||||
<if test="productBomCode != null and productBomCode != ''"> and product_bom_code = #{productBomCode}</if>
|
||||
<if test="model != null and model != ''"> and model = #{model}</if>
|
||||
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
|
||||
<if test="productDesc != null and productDesc != ''"> and product_desc = #{productDesc}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="cataloguePrice != null "> and catalogue_price = #{cataloguePrice}</if>
|
||||
<if test="catalogueAllPrice != null "> and catalogue_all_price = #{catalogueAllPrice}</if>
|
||||
<if test="price != null "> and price = #{price}</if>
|
||||
<if test="allPrice != null "> and all_price = #{allPrice}</if>
|
||||
<if test="guidanceDiscount != null "> and guidance_discount = #{guidanceDiscount}</if>
|
||||
<if test="discount != null "> and discount = #{discount}</if>
|
||||
<if test="performanceParameters != null and performanceParameters != ''"> and performance_parameters = #{performanceParameters}</if>
|
||||
<if test="cidInfo != null and cidInfo != ''"> and cid_info = #{cidInfo}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProjectOrderConfigInfoById" parameterType="Long" resultMap="ProjectOrderConfigInfoResult">
|
||||
<include refid="selectProjectOrderConfigInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertProjectOrderConfigInfo" parameterType="ProjectOrderConfigInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into project_order_config_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="productBomCode != null">product_bom_code,</if>
|
||||
<if test="model != null">model,</if>
|
||||
<if test="productCode != null">product_code,</if>
|
||||
<if test="productDesc != null">product_desc,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="cataloguePrice != null">catalogue_price,</if>
|
||||
<if test="catalogueAllPrice != null">catalogue_all_price,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="allPrice != null">all_price,</if>
|
||||
<if test="guidanceDiscount != null">guidance_discount,</if>
|
||||
<if test="discount != null">discount,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="performanceParameters != null">performance_parameters,</if>
|
||||
<if test="cidInfo != null">cid_info,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
<if test="productBomCode != null">#{productBomCode},</if>
|
||||
<if test="model != null">#{model},</if>
|
||||
<if test="productCode != null">#{productCode},</if>
|
||||
<if test="productDesc != null">#{productDesc},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="cataloguePrice != null">#{cataloguePrice},</if>
|
||||
<if test="catalogueAllPrice != null">#{catalogueAllPrice},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="allPrice != null">#{allPrice},</if>
|
||||
<if test="guidanceDiscount != null">#{guidanceDiscount},</if>
|
||||
<if test="discount != null">#{discount},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="performanceParameters != null">#{performanceParameters},</if>
|
||||
<if test="cidInfo != null">#{cidInfo},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertBatch">
|
||||
insert into project_order_config_info (order_id, product_bom_code, model, product_code, product_desc,
|
||||
quantity, catalogue_price, catalogue_all_price, price, all_price,
|
||||
guidance_discount, discount, remark, performance_parameters, cid_info) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.orderId}, #{item.productBomCode}, #{item.model}, #{item.productCode}, #{item.productDesc}, #{item.quantity},
|
||||
#{item.cataloguePrice}, #{item.catalogueAllPrice}, #{item.price}, #{item.allPrice}, #{item.guidanceDiscount},
|
||||
#{item.discount}, #{item.remark}, #{item.performanceParameters}, #{item.cidInfo})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateProjectOrderConfigInfo" parameterType="ProjectOrderConfigInfo">
|
||||
update project_order_config_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="orderId != null">order_id = #{orderId},</if>
|
||||
<if test="productBomCode != null">product_bom_code = #{productBomCode},</if>
|
||||
<if test="model != null">model = #{model},</if>
|
||||
<if test="productCode != null">product_code = #{productCode},</if>
|
||||
<if test="productDesc != null">product_desc = #{productDesc},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="cataloguePrice != null">catalogue_price = #{cataloguePrice},</if>
|
||||
<if test="catalogueAllPrice != null">catalogue_all_price = #{catalogueAllPrice},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="allPrice != null">all_price = #{allPrice},</if>
|
||||
<if test="guidanceDiscount != null">guidance_discount = #{guidanceDiscount},</if>
|
||||
<if test="discount != null">discount = #{discount},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="performanceParameters != null">performance_parameters = #{performanceParameters},</if>
|
||||
<if test="cidInfo != null">cid_info = #{cidInfo},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProjectOrderConfigInfoById" parameterType="Long">
|
||||
delete from project_order_config_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProjectOrderConfigInfoByIds" parameterType="String">
|
||||
delete from project_order_config_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,96 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.sip.mapper.ProjectOrderFileLogMapper">
|
||||
|
||||
<resultMap type="ProjectOrderFileLog" id="ProjectOrderFileLogResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="fileName" column="file_name" />
|
||||
<result property="uploadUser" column="upload_user" />
|
||||
<result property="uploadTime" column="upload_time" />
|
||||
<result property="filePath" column="file_path" />
|
||||
<result property="fileType" column="file_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProjectOrderFileLogVo">
|
||||
select id, order_id, file_name, upload_user, upload_time, file_path, file_type from project_order_file_log
|
||||
</sql>
|
||||
|
||||
<select id="selectProjectOrderFileLogList" parameterType="ProjectOrderFileLog" resultMap="ProjectOrderFileLogResult">
|
||||
<include refid="selectProjectOrderFileLogVo"/>
|
||||
<where>
|
||||
<if test="orderId != null "> and order_id = #{orderId}</if>
|
||||
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
||||
<if test="uploadUser != null and uploadUser != ''"> and upload_user = #{uploadUser}</if>
|
||||
<if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
|
||||
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
|
||||
<if test="fileType != null and fileType != ''"> and file_type = #{fileType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProjectOrderFileLogById" parameterType="Long" resultMap="ProjectOrderFileLogResult">
|
||||
<include refid="selectProjectOrderFileLogVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="listByOrderId" resultType="com.ruoyi.sip.domain.ProjectOrderFileLog">
|
||||
<include refid="selectProjectOrderFileLogVo"/>
|
||||
where order_id in (
|
||||
<foreach item="id" collection="list" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
<insert id="insertProjectOrderFileLog" parameterType="ProjectOrderFileLog" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into project_order_file_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="fileName != null">file_name,</if>
|
||||
<if test="uploadUser != null">upload_user,</if>
|
||||
<if test="uploadTime != null">upload_time,</if>
|
||||
<if test="filePath != null">file_path,</if>
|
||||
<if test="fileType != null">file_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
<if test="fileName != null">#{fileName},</if>
|
||||
<if test="uploadUser != null">#{uploadUser},</if>
|
||||
<if test="uploadTime != null">#{uploadTime},</if>
|
||||
<if test="filePath != null">#{filePath},</if>
|
||||
<if test="fileType != null">#{fileType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProjectOrderFileLog" parameterType="ProjectOrderFileLog">
|
||||
update project_order_file_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="orderId != null">order_id = #{orderId},</if>
|
||||
<if test="fileName != null">file_name = #{fileName},</if>
|
||||
<if test="uploadUser != null">upload_user = #{uploadUser},</if>
|
||||
<if test="uploadTime != null">upload_time = #{uploadTime},</if>
|
||||
<if test="filePath != null">file_path = #{filePath},</if>
|
||||
<if test="fileType != null">file_type = #{fileType},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProjectOrderFileLogById" parameterType="Long">
|
||||
delete from project_order_file_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProjectOrderFileLogByIds" parameterType="String">
|
||||
delete from project_order_file_log where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteProjectOrderFileLogByOrderIdList">
|
||||
delete from project_order_file_log where order_id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue