Merge branch 'test' of https://git.will-way.cn/zgty/zt-qms into test
This commit is contained in:
@@ -62,4 +62,11 @@ public interface SupplierService {
|
|||||||
*/
|
*/
|
||||||
PageResult<SupplierDO> getSupplierPage(SupplierPageReqVO pageReqVO);
|
PageResult<SupplierDO> getSupplierPage(SupplierPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得供应商列表
|
||||||
|
*
|
||||||
|
* @param supplierNames 供应商名称数组
|
||||||
|
* @return 供应商列表
|
||||||
|
*/
|
||||||
|
List<SupplierDO> getSuppliersByNames(List<String> supplierNames);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.zt.plat.module.qms.office.supplier.service;
|
package com.zt.plat.module.qms.office.supplier.service;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierExtendRespVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierExtendRespVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
|
||||||
@@ -90,4 +91,11 @@ public class SupplierServiceImpl implements SupplierService {
|
|||||||
return supplierMapper.selectPage(pageReqVO);
|
return supplierMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SupplierDO> getSuppliersByNames(List<String> supplierNames) {
|
||||||
|
|
||||||
|
return supplierMapper.selectList(Wrappers.lambdaQuery(SupplierDO.class)
|
||||||
|
.in(SupplierDO::getName, supplierNames));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -62,8 +62,12 @@ public class DeviceMaintainController extends AbstractFileUploadController imple
|
|||||||
|
|
||||||
@PostMapping("/saveMaintainVo")
|
@PostMapping("/saveMaintainVo")
|
||||||
@Operation(summary = "创建或获取维护数据")
|
@Operation(summary = "创建或获取维护数据")
|
||||||
public CommonResult<Boolean> saveMaintainVo(@RequestBody DeviceMaintainVO vo) {
|
public CommonResult<DeviceMaintainRespVO> saveMaintainVo(@RequestBody DeviceMaintainVO vo) {
|
||||||
return deviceMaintainService.saveMaintainVo(vo);
|
CommonResult<DeviceMaintainDO> ret = deviceMaintainService.saveMaintainVo(vo);
|
||||||
|
if(!ret.isSuccess())
|
||||||
|
return ret.error(ret.getCode(), ret.getMsg());
|
||||||
|
DeviceMaintainDO entity = ret.getData();
|
||||||
|
return success(BeanUtils.toBean(entity, DeviceMaintainRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/createOrGet")
|
@PostMapping("/createOrGet")
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ public class DeviceUseRecordDetailPageReqVO extends PageParam {
|
|||||||
@Schema(description = "样品编号")
|
@Schema(description = "样品编号")
|
||||||
private String sampleCode;
|
private String sampleCode;
|
||||||
|
|
||||||
|
@Schema(description = "明细数据类型")
|
||||||
|
private String detailType;
|
||||||
|
|
||||||
@Schema(description = "所属部门")
|
@Schema(description = "所属部门")
|
||||||
private String systemDepartmentCode;
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,10 @@ public class DeviceUseRecordDetailRespVO {
|
|||||||
@ExcelProperty("样品编号")
|
@ExcelProperty("样品编号")
|
||||||
private String sampleCode;
|
private String sampleCode;
|
||||||
|
|
||||||
|
@Schema(description = "明细数据类型")
|
||||||
|
@ExcelProperty("明细数据类型")
|
||||||
|
private String detailType;
|
||||||
|
|
||||||
@Schema(description = "所属部门")
|
@Schema(description = "所属部门")
|
||||||
@ExcelProperty("所属部门")
|
@ExcelProperty("所属部门")
|
||||||
private String systemDepartmentCode;
|
private String systemDepartmentCode;
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ public class DeviceUseRecordDetailSaveReqVO {
|
|||||||
@Schema(description = "样品编号")
|
@Schema(description = "样品编号")
|
||||||
private String sampleCode;
|
private String sampleCode;
|
||||||
|
|
||||||
|
@Schema(description = "明细数据类型")
|
||||||
|
private String detailType;
|
||||||
|
|
||||||
@Schema(description = "所属部门")
|
@Schema(description = "所属部门")
|
||||||
private String systemDepartmentCode;
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,11 @@ public class DeviceUseRecordDetailDO extends BusinessBaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableField("SMP_CD")
|
@TableField("SMP_CD")
|
||||||
private String sampleCode;
|
private String sampleCode;
|
||||||
|
/**
|
||||||
|
* 明细数据类型
|
||||||
|
*/
|
||||||
|
@TableField("DTL_TY")
|
||||||
|
private String detailType;
|
||||||
/**
|
/**
|
||||||
* 所属部门
|
* 所属部门
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
|||||||
*/
|
*/
|
||||||
public interface DeviceMaintainService {
|
public interface DeviceMaintainService {
|
||||||
|
|
||||||
CommonResult<Boolean> saveMaintainVo(DeviceMaintainVO vo);
|
CommonResult<DeviceMaintainDO> saveMaintainVo(DeviceMaintainVO vo);
|
||||||
|
|
||||||
CommonResult<DeviceMaintainVO> createOrGet(Long deviceId, String date, String dataType);
|
CommonResult<DeviceMaintainVO> createOrGet(Long deviceId, String date, String dataType);
|
||||||
|
|
||||||
|
|||||||
@@ -51,13 +51,13 @@ public class DeviceMaintainServiceImpl implements DeviceMaintainService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public CommonResult<Boolean> saveMaintainVo(DeviceMaintainVO vo) {
|
public CommonResult<DeviceMaintainDO> saveMaintainVo(DeviceMaintainVO vo) {
|
||||||
DeviceMaintainDO data = new DeviceMaintainDO();
|
DeviceMaintainDO data = new DeviceMaintainDO();
|
||||||
BeanUtil.copyProperties(vo, data);
|
BeanUtil.copyProperties(vo, data);
|
||||||
deviceMaintainMapper.updateById(data);
|
deviceMaintainMapper.updateById(data);
|
||||||
List<DeviceMaintainItemDO> maintainItemList = vo.getMaintainItemList();
|
List<DeviceMaintainItemDO> maintainItemList = vo.getMaintainItemList();
|
||||||
deviceMaintainItemService.updateBatch(maintainItemList);
|
deviceMaintainItemService.updateBatch(maintainItemList);
|
||||||
return CommonResult.success(true);
|
return CommonResult.success(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.admin;
|
package com.zt.plat.module.qms.resource.material.controller.admin;
|
||||||
|
|
||||||
|
import com.alibaba.excel.EasyExcel;
|
||||||
|
import com.alibaba.excel.ExcelWriter;
|
||||||
|
import com.alibaba.excel.converters.longconverter.LongStringConverter;
|
||||||
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||||
|
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
||||||
|
import com.zt.plat.framework.common.util.http.HttpUtils;
|
||||||
import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore;
|
import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore;
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchPageReqVO;
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchPageReqVO;
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchRespVO;
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchRespVO;
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchSaveReqVO;
|
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialBatchSaveReqVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.importer.MaterialBatchImportExcelVO;
|
||||||
|
import com.zt.plat.module.qms.resource.material.controller.vo.resp.MaterialBatchImportRespVO;
|
||||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchDO;
|
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialBatchDO;
|
||||||
import com.zt.plat.module.qms.resource.material.service.MaterialBatchService;
|
import com.zt.plat.module.qms.resource.material.service.MaterialBatchService;
|
||||||
import com.zt.plat.module.qms.resource.material.valid.AddGroup;
|
import com.zt.plat.module.qms.resource.material.valid.AddGroup;
|
||||||
@@ -20,6 +28,10 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||||||
|
|
||||||
import jakarta.validation.*;
|
import jakarta.validation.*;
|
||||||
import jakarta.servlet.http.*;
|
import jakarta.servlet.http.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@@ -33,6 +45,8 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
|||||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 物料批次")
|
@Tag(name = "管理后台 - 物料批次")
|
||||||
@@ -132,4 +146,46 @@ public class MaterialBatchController implements BusinessControllerMarker {
|
|||||||
return success(BeanUtils.toBean(list, MaterialBatchRespVO.class));
|
return success(BeanUtils.toBean(list, MaterialBatchRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get-import-template")
|
||||||
|
@Operation(summary = "获得物料批次导入模板")
|
||||||
|
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||||
|
List<MaterialBatchImportExcelVO> samples = Arrays.asList(
|
||||||
|
MaterialBatchImportExcelVO.builder()
|
||||||
|
.productName("无水硼砂")
|
||||||
|
.productCode("W11174909")
|
||||||
|
.productModelNo("95%")
|
||||||
|
.supplier("供应商 1")
|
||||||
|
.manufacturerDate(LocalDate.parse("2026-03-15"))
|
||||||
|
.dueDate(LocalDate.parse("2026-08-11"))
|
||||||
|
.inboundQuantity(BigDecimal.valueOf(100))
|
||||||
|
.location("1 号货架")
|
||||||
|
.remark("模板数据,导入时请删除!")
|
||||||
|
.build(),
|
||||||
|
MaterialBatchImportExcelVO.builder()
|
||||||
|
.productName("氧化钙")
|
||||||
|
.productCode("W10102372")
|
||||||
|
.productModelNo("AR500g/瓶")
|
||||||
|
.supplier("供应商 2")
|
||||||
|
.manufacturerDate(LocalDate.parse("2026-04-16"))
|
||||||
|
.dueDate(LocalDate.parse("2026-09-18"))
|
||||||
|
.inboundQuantity(BigDecimal.valueOf(200))
|
||||||
|
.location("2 号货架")
|
||||||
|
.remark("模板数据,导入时请删除!")
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
ExcelUtils.write(response, "物料批次导入模板.xls", "物料批次导入",
|
||||||
|
MaterialBatchImportExcelVO.class, samples);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/import")
|
||||||
|
@Operation(summary = "导入物料批次")
|
||||||
|
@Parameter(name = "file", description = "Excel 文件", required = true)
|
||||||
|
public CommonResult<MaterialBatchImportRespVO> importMaterialBatch(@RequestParam("file") MultipartFile file) throws IOException {
|
||||||
|
List<MaterialBatchImportExcelVO> importList = ExcelUtils.read(file, MaterialBatchImportExcelVO.class, 0);
|
||||||
|
MaterialBatchImportRespVO respVO = materialBatchService.importMaterialBatchList(importList);
|
||||||
|
return success(respVO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user