Explorar o código

1.设备管理模块表结构和基本接口创建
2.增加对外接收设备生产数据接口

纪新园 hai 9 meses
pai
achega
461309b801
Modificáronse 17 ficheiros con 1029 adicións e 0 borrados
  1. 34 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/device/dto/DeviceBaseinfoDTO.java
  2. 34 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/device/dto/DeviceProductdataDTO.java
  3. 101 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/device/entity/DeviceBaseinfo.java
  4. 124 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/device/entity/DeviceProductdata.java
  5. 36 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/device/vo/DeviceBaseinfoVO.java
  6. 36 0
      blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/device/vo/DeviceProductdataVO.java
  7. 126 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/controller/DeviceBaseinfoController.java
  8. 56 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/controller/DeviceProductdataApiController.java
  9. 126 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/controller/DeviceProductdataController.java
  10. 42 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/mapper/DeviceBaseinfoMapper.java
  11. 25 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/mapper/DeviceBaseinfoMapper.xml
  12. 42 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/mapper/DeviceProductdataMapper.java
  13. 30 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/mapper/DeviceProductdataMapper.xml
  14. 41 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/service/IDeviceBaseinfoService.java
  15. 45 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/service/IDeviceProductdataService.java
  16. 41 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/service/impl/DeviceBaseinfoServiceImpl.java
  17. 90 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/service/impl/DeviceProductdataServiceImpl.java

+ 34 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/device/dto/DeviceBaseinfoDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.dto;
+
+import org.springblade.salesPart.device.entity.DeviceBaseinfo;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 设备管理数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class DeviceBaseinfoDTO extends DeviceBaseinfo {
+	private static final long serialVersionUID = 1L;
+
+}

+ 34 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/device/dto/DeviceProductdataDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.dto;
+
+import org.springblade.salesPart.device.entity.DeviceProductdata;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 设备生产数据表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class DeviceProductdataDTO extends DeviceProductdata {
+	private static final long serialVersionUID = 1L;
+
+}

+ 101 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/device/entity/DeviceBaseinfo.java

@@ -0,0 +1,101 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.core.secure.utils.AuthUtil;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+/**
+ * 设备管理实体类
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+@Data
+@TableName("pjpf_device_baseinfo")
+@ApiModel(value = "DeviceBaseinfo对象", description = "设备管理")
+public class DeviceBaseinfo implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private Long createUser;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private String createUserName;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private Long updateUser;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private String updateUserName;
+	/**
+	 * 设备编号
+	 */
+	@ApiModelProperty(value = "设备编号")
+	private String deviceCode;
+	/**
+	 * 设备名称
+	 */
+	@ApiModelProperty(value = "设备名称")
+	private String deviceName;
+	/**
+	 * 设备状态(开/关)
+	 */
+	@ApiModelProperty(value = "设备状态(开/关)")
+	private String deviceStatus;
+
+	/**
+	 * 租户id
+	 */
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+
+
+}

+ 124 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/device/entity/DeviceProductdata.java

@@ -0,0 +1,124 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 设备生产数据表实体类
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+@Data
+@TableName("pjpf_device_productdata")
+@ApiModel(value = "DeviceProductdata对象", description = "设备生产数据表")
+public class DeviceProductdata implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private Long createUser;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private String createUserName;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private Long updateUser;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private String updateUserName;
+	/**
+	 * 任务编号
+	 */
+	@ApiModelProperty(value = "任务编号")
+	private String taskCode;
+	/**
+	 * 设备编号
+	 */
+	@ApiModelProperty(value = "设备编号")
+	private String deviceCode;
+	/**
+	 * 设备名称
+	 */
+	@ApiModelProperty(value = "设备名称")
+	private String deviceName;
+	/**
+	 * 开始时间
+	 */
+	@ApiModelProperty(value = "开始时间")
+	private Date startTime;
+	/**
+	 * 结束时间
+	 */
+	@ApiModelProperty(value = "结束时间")
+	private Date endTime;
+	/**
+	 * 模型层数
+	 */
+	@ApiModelProperty(value = "模型层数")
+	private Integer modelLayernum;
+	/**
+	 * 模型体积
+	 */
+	@ApiModelProperty(value = "模型体积")
+	private String modelVolume;
+	/**
+	 * 打印耗材
+	 */
+	@ApiModelProperty(value = "打印耗材")
+	private Integer printConsumable;
+
+	/**
+	 * 租户id
+	 */
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+
+
+}

+ 36 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/device/vo/DeviceBaseinfoVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.vo;
+
+import org.springblade.salesPart.device.entity.DeviceBaseinfo;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 设备管理视图实体类
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "DeviceBaseinfoVO对象", description = "设备管理")
+public class DeviceBaseinfoVO extends DeviceBaseinfo {
+	private static final long serialVersionUID = 1L;
+
+}

+ 36 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/device/vo/DeviceProductdataVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.vo;
+
+import org.springblade.salesPart.device.entity.DeviceProductdata;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 设备生产数据表视图实体类
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "DeviceProductdataVO对象", description = "设备生产数据表")
+public class DeviceProductdataVO extends DeviceProductdata {
+	private static final long serialVersionUID = 1L;
+
+}

+ 126 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/controller/DeviceBaseinfoController.java

@@ -0,0 +1,126 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.salesPart.device.entity.DeviceBaseinfo;
+import org.springblade.salesPart.device.vo.DeviceBaseinfoVO;
+import org.springblade.salesPart.device.service.IDeviceBaseinfoService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 设备管理 控制器
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/devicebaseinfo")
+@Api(value = "设备管理", tags = "设备管理接口")
+public class DeviceBaseinfoController extends BladeController {
+
+	private final IDeviceBaseinfoService deviceBaseinfoService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入deviceBaseinfo")
+	public R<DeviceBaseinfo> detail(DeviceBaseinfo deviceBaseinfo) {
+		DeviceBaseinfo detail = deviceBaseinfoService.getOne(Condition.getQueryWrapper(deviceBaseinfo));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 设备管理
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入deviceBaseinfo")
+	public R<IPage<DeviceBaseinfo>> list(DeviceBaseinfo deviceBaseinfo, Query query) {
+		IPage<DeviceBaseinfo> pages = deviceBaseinfoService.page(Condition.getPage(query), Condition.getQueryWrapper(deviceBaseinfo));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 设备管理
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入deviceBaseinfo")
+	public R<IPage<DeviceBaseinfoVO>> page(DeviceBaseinfoVO deviceBaseinfo, Query query) {
+		IPage<DeviceBaseinfoVO> pages = deviceBaseinfoService.selectDeviceBaseinfoPage(Condition.getPage(query), deviceBaseinfo);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 设备管理
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入deviceBaseinfo")
+	public R save(@Valid @RequestBody DeviceBaseinfo deviceBaseinfo) {
+		return R.status(deviceBaseinfoService.save(deviceBaseinfo));
+	}
+
+	/**
+	 * 修改 设备管理
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入deviceBaseinfo")
+	public R update(@Valid @RequestBody DeviceBaseinfo deviceBaseinfo) {
+		return R.status(deviceBaseinfoService.updateById(deviceBaseinfo));
+	}
+
+	/**
+	 * 新增或修改 设备管理
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入deviceBaseinfo")
+	public R submit(@Valid @RequestBody DeviceBaseinfo deviceBaseinfo) {
+		return R.status(deviceBaseinfoService.saveOrUpdate(deviceBaseinfo));
+	}
+
+	
+	/**
+	 * 删除 设备管理
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(deviceBaseinfoService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 56 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/controller/DeviceProductdataApiController.java

@@ -0,0 +1,56 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.controller;
+
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.tool.api.R;
+import org.springblade.salesPart.device.entity.DeviceProductdata;
+import org.springblade.salesPart.device.service.IDeviceProductdataService;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * 设备生产数据表 控制器
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/api/deviceproductdata")
+@Api(value = "设备生产数据表", tags = "设备生产数据表接口")
+public class DeviceProductdataApiController extends BladeController {
+
+	private final IDeviceProductdataService deviceProductdataService;
+
+	/**
+	 * 新增或修改 设备生产数据表
+	 */
+	@PostMapping("/updateDeviceproduct")
+	public R updateDeviceproduct(@RequestBody List<DeviceProductdata> dataList) {
+		return deviceProductdataService.updateDeviceproduct(dataList);
+	}
+
+
+}

+ 126 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/controller/DeviceProductdataController.java

@@ -0,0 +1,126 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.salesPart.device.entity.DeviceProductdata;
+import org.springblade.salesPart.device.vo.DeviceProductdataVO;
+import org.springblade.salesPart.device.service.IDeviceProductdataService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 设备生产数据表 控制器
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/deviceproductdata")
+@Api(value = "设备生产数据表", tags = "设备生产数据表接口")
+public class DeviceProductdataController extends BladeController {
+
+	private final IDeviceProductdataService deviceProductdataService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入deviceProductdata")
+	public R<DeviceProductdata> detail(DeviceProductdata deviceProductdata) {
+		DeviceProductdata detail = deviceProductdataService.getOne(Condition.getQueryWrapper(deviceProductdata));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 设备生产数据表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入deviceProductdata")
+	public R<IPage<DeviceProductdata>> list(DeviceProductdata deviceProductdata, Query query) {
+		IPage<DeviceProductdata> pages = deviceProductdataService.page(Condition.getPage(query), Condition.getQueryWrapper(deviceProductdata));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 设备生产数据表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入deviceProductdata")
+	public R<IPage<DeviceProductdataVO>> page(DeviceProductdataVO deviceProductdata, Query query) {
+		IPage<DeviceProductdataVO> pages = deviceProductdataService.selectDeviceProductdataPage(Condition.getPage(query), deviceProductdata);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 设备生产数据表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入deviceProductdata")
+	public R save(@Valid @RequestBody DeviceProductdata deviceProductdata) {
+		return R.status(deviceProductdataService.save(deviceProductdata));
+	}
+
+	/**
+	 * 修改 设备生产数据表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入deviceProductdata")
+	public R update(@Valid @RequestBody DeviceProductdata deviceProductdata) {
+		return R.status(deviceProductdataService.updateById(deviceProductdata));
+	}
+
+	/**
+	 * 新增或修改 设备生产数据表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入deviceProductdata")
+	public R submit(@Valid @RequestBody DeviceProductdata deviceProductdata) {
+		return R.status(deviceProductdataService.saveOrUpdate(deviceProductdata));
+	}
+
+	
+	/**
+	 * 删除 设备生产数据表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(deviceProductdataService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 42 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/mapper/DeviceBaseinfoMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.mapper;
+
+import org.springblade.salesPart.device.entity.DeviceBaseinfo;
+import org.springblade.salesPart.device.vo.DeviceBaseinfoVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 设备管理 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+public interface DeviceBaseinfoMapper extends BaseMapper<DeviceBaseinfo> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param deviceBaseinfo
+	 * @return
+	 */
+	List<DeviceBaseinfoVO> selectDeviceBaseinfoPage(IPage page, DeviceBaseinfoVO deviceBaseinfo);
+
+}

+ 25 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/mapper/DeviceBaseinfoMapper.xml

@@ -0,0 +1,25 @@
+<?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="org.springblade.salesPart.device.mapper.DeviceBaseinfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="deviceBaseinfoResultMap" type="org.springblade.salesPart.device.entity.DeviceBaseinfo">
+        <id column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_user_name" property="createUserName"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="update_user_name" property="updateUserName"/>
+        <result column="device_code" property="deviceCode"/>
+        <result column="device_name" property="deviceName"/>
+        <result column="device_status" property="deviceStatus"/>
+    </resultMap>
+
+
+    <select id="selectDeviceBaseinfoPage" resultMap="deviceBaseinfoResultMap">
+        select * from pjpf_device_baseinfo where is_deleted = 0
+    </select>
+
+</mapper>

+ 42 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/mapper/DeviceProductdataMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.mapper;
+
+import org.springblade.salesPart.device.entity.DeviceProductdata;
+import org.springblade.salesPart.device.vo.DeviceProductdataVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 设备生产数据表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+public interface DeviceProductdataMapper extends BaseMapper<DeviceProductdata> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param deviceProductdata
+	 * @return
+	 */
+	List<DeviceProductdataVO> selectDeviceProductdataPage(IPage page, DeviceProductdataVO deviceProductdata);
+
+}

+ 30 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/mapper/DeviceProductdataMapper.xml

@@ -0,0 +1,30 @@
+<?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="org.springblade.salesPart.device.mapper.DeviceProductdataMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="deviceProductdataResultMap" type="org.springblade.salesPart.device.entity.DeviceProductdata">
+        <id column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_user_name" property="createUserName"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="update_user_name" property="updateUserName"/>
+        <result column="task_code" property="taskCode"/>
+        <result column="device_code" property="deviceCode"/>
+        <result column="device_name" property="deviceName"/>
+        <result column="start_time" property="startTime"/>
+        <result column="end_time" property="endTime"/>
+        <result column="model_layernum" property="modelLayernum"/>
+        <result column="model_volume" property="modelVolume"/>
+        <result column="print_consumable" property="printConsumable"/>
+    </resultMap>
+
+
+    <select id="selectDeviceProductdataPage" resultMap="deviceProductdataResultMap">
+        select * from pjpf_device_productdata where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/service/IDeviceBaseinfoService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.service;
+
+import org.springblade.salesPart.device.entity.DeviceBaseinfo;
+import org.springblade.salesPart.device.vo.DeviceBaseinfoVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 设备管理 服务类
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+public interface IDeviceBaseinfoService extends IService<DeviceBaseinfo> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param deviceBaseinfo
+	 * @return
+	 */
+	IPage<DeviceBaseinfoVO> selectDeviceBaseinfoPage(IPage<DeviceBaseinfoVO> page, DeviceBaseinfoVO deviceBaseinfo);
+
+}

+ 45 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/service/IDeviceProductdataService.java

@@ -0,0 +1,45 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.service;
+
+import org.springblade.core.tool.api.R;
+import org.springblade.salesPart.device.entity.DeviceProductdata;
+import org.springblade.salesPart.device.vo.DeviceProductdataVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 设备生产数据表 服务类
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+public interface IDeviceProductdataService extends IService<DeviceProductdata> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param deviceProductdata
+	 * @return
+	 */
+	IPage<DeviceProductdataVO> selectDeviceProductdataPage(IPage<DeviceProductdataVO> page, DeviceProductdataVO deviceProductdata);
+
+    R updateDeviceproduct(List<DeviceProductdata> dataList);
+}

+ 41 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/service/impl/DeviceBaseinfoServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.service.impl;
+
+import org.springblade.salesPart.device.entity.DeviceBaseinfo;
+import org.springblade.salesPart.device.vo.DeviceBaseinfoVO;
+import org.springblade.salesPart.device.mapper.DeviceBaseinfoMapper;
+import org.springblade.salesPart.device.service.IDeviceBaseinfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 设备管理 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+@Service
+public class DeviceBaseinfoServiceImpl extends ServiceImpl<DeviceBaseinfoMapper, DeviceBaseinfo> implements IDeviceBaseinfoService {
+
+	@Override
+	public IPage<DeviceBaseinfoVO> selectDeviceBaseinfoPage(IPage<DeviceBaseinfoVO> page, DeviceBaseinfoVO deviceBaseinfo) {
+		return page.setRecords(baseMapper.selectDeviceBaseinfoPage(page, deviceBaseinfo));
+	}
+
+}

+ 90 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/device/service/impl/DeviceProductdataServiceImpl.java

@@ -0,0 +1,90 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.salesPart.device.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.AllArgsConstructor;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.salesPart.device.entity.DeviceBaseinfo;
+import org.springblade.salesPart.device.entity.DeviceProductdata;
+import org.springblade.salesPart.device.mapper.DeviceProductdataMapper;
+import org.springblade.salesPart.device.service.IDeviceBaseinfoService;
+import org.springblade.salesPart.device.service.IDeviceProductdataService;
+import org.springblade.salesPart.device.vo.DeviceProductdataVO;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 设备生产数据表 服务实现类
+ *
+ * @author BladeX
+ * @since 2025-03-20
+ */
+@Service
+@AllArgsConstructor
+public class DeviceProductdataServiceImpl extends ServiceImpl<DeviceProductdataMapper, DeviceProductdata> implements IDeviceProductdataService {
+
+	private final IDeviceBaseinfoService deviceBaseinfoService;
+
+	@Override
+	public IPage<DeviceProductdataVO> selectDeviceProductdataPage(IPage<DeviceProductdataVO> page, DeviceProductdataVO deviceProductdata) {
+		return page.setRecords(baseMapper.selectDeviceProductdataPage(page, deviceProductdata));
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public R updateDeviceproduct(List<DeviceProductdata> dataList) {
+		if (ObjectUtils.isNull(dataList) || dataList.isEmpty()) {
+			return R.fail("设备数据为空");
+		}
+		String code = dataList.stream().map(DeviceProductdata::getDeviceCode).collect(Collectors.joining(","));
+		List<DeviceBaseinfo> deviceBaseinfoList = deviceBaseinfoService.list(new LambdaQueryWrapper<DeviceBaseinfo>()
+			.eq(DeviceBaseinfo::getIsDeleted, 0)
+			.apply("find_in_set(device_code,'" + code + "')"));
+		List<DeviceBaseinfo> deviceBaseinfos = new ArrayList<>();
+		for (DeviceProductdata item : dataList) {
+			DeviceBaseinfo deviceBaseinfo = deviceBaseinfoList.stream().filter(e -> e.getDeviceCode().equals(item.getDeviceCode()))
+				.findFirst().orElse(null);
+			if (deviceBaseinfo != null) {
+				deviceBaseinfo.setDeviceStatus("开");
+				deviceBaseinfo.setUpdateTime(new Date());
+				deviceBaseinfo.setUpdateUser(AuthUtil.getUserId());
+				deviceBaseinfo.setUpdateUserName(AuthUtil.getUserName());
+				deviceBaseinfos.add(deviceBaseinfo);
+			}
+			item.setCreateTime(new Date());
+			item.setCreateUser(AuthUtil.getUserId());
+			item.setCreateUserName(AuthUtil.getUserName());
+			item.setTenantId(AuthUtil.getTenantId());
+		}
+		if (!deviceBaseinfos.isEmpty()) {
+			deviceBaseinfoService.updateBatchById(deviceBaseinfos);
+		}
+		this.saveBatch(dataList);
+		return R.success("更新成功");
+	}
+
+}