wangzhuo 2 lat temu
rodzic
commit
33fa6e4662
27 zmienionych plików z 968 dodań i 413 usunięć
  1. 50 0
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/dto/ProductMockRecordsDTO.java
  2. 12 3
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/dto/ProductMockStationDTO.java
  3. 51 0
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/dto/ProductMockWeekDTO.java
  4. 12 8
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/entity/ProductMockRecords.java
  5. 109 0
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/entity/ProductMockStation.java
  6. 97 0
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/entity/ProductMockWeek.java
  7. 0 67
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/entity/Station.java
  8. 4 4
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/vo/ProductMockRecordsVO.java
  9. 4 4
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/vo/ProductMockStationVO.java
  10. 7 5
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/vo/ProductMockWeekVO.java
  11. 23 47
      blade-service/blade-school/src/main/java/org/springblade/school/controller/ProductMockRecordsController.java
  12. 29 42
      blade-service/blade-school/src/main/java/org/springblade/school/controller/ProductMockStationController.java
  13. 126 0
      blade-service/blade-school/src/main/java/org/springblade/school/controller/ProductMockWeekController.java
  14. 6 6
      blade-service/blade-school/src/main/java/org/springblade/school/mapper/ProductMockRecordsMapper.java
  15. 5 5
      blade-service/blade-school/src/main/java/org/springblade/school/mapper/ProductMockRecordsMapper.xml
  16. 6 6
      blade-service/blade-school/src/main/java/org/springblade/school/mapper/ProductMockStationMapper.java
  17. 27 0
      blade-service/blade-school/src/main/java/org/springblade/school/mapper/ProductMockStationMapper.xml
  18. 42 0
      blade-service/blade-school/src/main/java/org/springblade/school/mapper/ProductMockWeekMapper.java
  19. 25 0
      blade-service/blade-school/src/main/java/org/springblade/school/mapper/ProductMockWeekMapper.xml
  20. 0 20
      blade-service/blade-school/src/main/java/org/springblade/school/mapper/StationMapper.xml
  21. 16 27
      blade-service/blade-school/src/main/java/org/springblade/school/service/IProductMockRecordsService.java
  22. 6 14
      blade-service/blade-school/src/main/java/org/springblade/school/service/IProductMockStationService.java
  23. 41 0
      blade-service/blade-school/src/main/java/org/springblade/school/service/IProductMockWeekService.java
  24. 221 0
      blade-service/blade-school/src/main/java/org/springblade/school/service/impl/ProductMockRecordsServiceImpl.java
  25. 8 18
      blade-service/blade-school/src/main/java/org/springblade/school/service/impl/ProductMockStationServiceImpl.java
  26. 41 0
      blade-service/blade-school/src/main/java/org/springblade/school/service/impl/ProductMockWeekServiceImpl.java
  27. 0 137
      blade-service/blade-school/src/main/java/org/springblade/school/service/impl/RecordsServiceImpl.java

+ 50 - 0
blade-service-api/blade-school-api/src/main/java/org/springblade/school/dto/ProductMockRecordsDTO.java

@@ -0,0 +1,50 @@
+/*
+ *      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.school.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.springblade.school.entity.ProductMockRecords;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.school.entity.ProductMockStation;
+import org.springblade.school.entity.ProductMockWeek;
+
+import java.util.List;
+
+/**
+ * 生产记录数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-07-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProductMockRecordsDTO extends ProductMockRecords {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 星期List
+	 */
+	@ApiModelProperty(value = "生产模拟星期list")
+	private List<ProductMockWeekDTO> productMockWeekDTOList;
+
+	/**
+	 * 星期
+	 */
+	@ApiModelProperty(value = "生产模拟星期")
+	private ProductMockWeekDTO productMockWeekDTO;
+}

+ 12 - 3
blade-service-api/blade-school-api/src/main/java/org/springblade/school/dto/StationDTO.java → blade-service-api/blade-school-api/src/main/java/org/springblade/school/dto/ProductMockStationDTO.java

@@ -16,19 +16,28 @@
  */
 package org.springblade.school.dto;
 
-import org.springblade.school.entity.Station;
+import io.swagger.annotations.ApiModelProperty;
+import org.springblade.school.entity.ProductMockStation;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.math.BigDecimal;
+
 /**
  * 生产模拟工位表数据传输对象实体类
  *
  * @author BladeX
- * @since 2023-07-13
+ * @since 2023-07-14
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-public class StationDTO extends Station {
+public class ProductMockStationDTO extends ProductMockStation {
 	private static final long serialVersionUID = 1L;
 
+	/**
+	 * 该工位当天生产金额
+	 */
+	@ApiModelProperty(value = "该工位当天生产金额")
+	private Integer totalAmounts;
+
 }

+ 51 - 0
blade-service-api/blade-school-api/src/main/java/org/springblade/school/dto/ProductMockWeekDTO.java

@@ -0,0 +1,51 @@
+/*
+ *      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.school.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.springblade.school.entity.ProductMockStation;
+import org.springblade.school.entity.ProductMockWeek;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * 生产模拟星期数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-07-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProductMockWeekDTO extends ProductMockWeek {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 生产模拟工位
+	 */
+	@ApiModelProperty(value = "生产模拟工位")
+	private List<ProductMockStation> productMockStationList;
+
+
+	/**
+	 * 生产模拟工位List
+	 */
+	@ApiModelProperty(value = "生产模拟工位list")
+	private List<ProductMockStationDTO> productMockStationDTOList;
+
+}

+ 12 - 8
blade-service-api/blade-school-api/src/main/java/org/springblade/school/entity/Records.java → blade-service-api/blade-school-api/src/main/java/org/springblade/school/entity/ProductMockRecords.java

@@ -16,26 +16,26 @@
  */
 package org.springblade.school.entity;
 
-import com.baomidou.mybatisplus.annotation.TableName;
-
 import java.time.LocalDateTime;
 import java.io.Serializable;
+import java.util.Date;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * 生产记录实体类
  *
  * @author BladeX
- * @since 2023-07-13
+ * @since 2023-07-14
  */
 @Data
-@TableName("product_mock_records")
-@ApiModel(value = "Records对象", description = "生产记录")
-public class Records implements Serializable {
+@ApiModel(value = "ProductMockRecords对象", description = "生产记录")
+public class ProductMockRecords implements Serializable {
 
 	private static final long serialVersionUID = 1L;
 
@@ -69,7 +69,9 @@ public class Records implements Serializable {
 	 * 创建时间
 	 */
 	@ApiModelProperty(value = "创建时间")
-	private LocalDateTime createTime;
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date createTime;
 	/**
 	 * 修改人
 	 */
@@ -79,7 +81,9 @@ public class Records implements Serializable {
 	 * 修改时间
 	 */
 	@ApiModelProperty(value = "修改时间")
-	private LocalDateTime updateTime;
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date updateTime;
 	/**
 	 * 是否已删除(0 否 1是)
 	 */

+ 109 - 0
blade-service-api/blade-school-api/src/main/java/org/springblade/school/entity/ProductMockStation.java

@@ -0,0 +1,109 @@
+/*
+ *      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.school.entity;
+
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * 生产模拟工位表实体类
+ *
+ * @author BladeX
+ * @since 2023-07-14
+ */
+@Data
+@ApiModel(value = "ProductMockStation对象", description = "生产模拟工位表")
+public class ProductMockStation implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 星期id
+	 */
+	@ApiModelProperty(value = "星期id")
+	private Long weekId;
+	/**
+	 * 生产数量
+	 */
+	@ApiModelProperty(value = "生产数量")
+	private Integer productQuantity;
+	/**
+	 * 出售单价
+	 */
+	@ApiModelProperty(value = "出售单价")
+	private Integer saleUnitPrice;
+	/**
+	 * 坐标
+	 */
+	@ApiModelProperty(value = "坐标")
+	private String locationint;
+	/**
+	 * 生产星期
+	 */
+	@ApiModelProperty(value = "生产星期")
+	private Integer data;
+	/**
+	 * 租户id
+	 */
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private Long createUser;
+	/**
+	 * 创建部门
+	 */
+	@ApiModelProperty(value = "创建部门")
+	private Long createDept;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date createTime;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private Long updateUser;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date updateTime;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+
+
+}

+ 97 - 0
blade-service-api/blade-school-api/src/main/java/org/springblade/school/entity/ProductMockWeek.java

@@ -0,0 +1,97 @@
+/*
+ *      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.school.entity;
+
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 生产模拟星期实体类
+ *
+ * @author BladeX
+ * @since 2023-07-17
+ */
+@Data
+@ApiModel(value = "ProductMockWeek对象", description = "生产模拟星期")
+public class ProductMockWeek implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * id
+	 */
+	@ApiModelProperty(value = "id")
+	private Long id;
+	/**
+	 * 生产记录id
+	 */
+	@ApiModelProperty(value = "生产记录id")
+	private Long recordsId;
+	/**
+	 * 星期
+	 */
+	@ApiModelProperty(value = "星期")
+	private Integer week;
+	/**
+	 * 总价格
+	 */
+	@ApiModelProperty(value = "总价格")
+	private Integer totalPrice;
+	/**
+	 * 租户id
+	 */
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private Long createUser;
+	/**
+	 * 创建部门
+	 */
+	@ApiModelProperty(value = "创建部门")
+	private Long createDept;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private Long updateUser;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+
+
+}

+ 0 - 67
blade-service-api/blade-school-api/src/main/java/org/springblade/school/entity/Station.java

@@ -1,67 +0,0 @@
-/*
- *      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.school.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import java.io.Serializable;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 生产模拟工位表实体类
- *
- * @author BladeX
- * @since 2023-07-13
- */
-@Data
-@TableName("product_mock_station")
-@ApiModel(value = "Station对象", description = "生产模拟工位表")
-public class Station implements Serializable {
-
-	private static final long serialVersionUID = 1L;
-
-	private Long id;
-	/**
-	* 生产数量
-	*/
-		@ApiModelProperty(value = "生产数量")
-		private Integer productQuantity;
-	/**
-	* 出售单价
-	*/
-		@ApiModelProperty(value = "出售单价")
-		private Integer saleUnitPrice;
-	/**
-	* 坐标
-	*/
-		@ApiModelProperty(value = "坐标")
-		private String locationint;
-	/**
-	* 生产日期
-	*/
-		@ApiModelProperty(value = "生产日期")
-		private Integer data;
-	/**
-	 * 生产记录
-	 */
-	@ApiModelProperty(value = "生产记录表id")
-	private Long recodsId;
-
-
-}

+ 4 - 4
blade-service-api/blade-school-api/src/main/java/org/springblade/school/vo/RecordsVO.java → blade-service-api/blade-school-api/src/main/java/org/springblade/school/vo/ProductMockRecordsVO.java

@@ -16,7 +16,7 @@
  */
 package org.springblade.school.vo;
 
-import org.springblade.school.entity.Records;
+import org.springblade.school.entity.ProductMockRecords;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
@@ -25,12 +25,12 @@ import io.swagger.annotations.ApiModel;
  * 生产记录视图实体类
  *
  * @author BladeX
- * @since 2023-07-13
+ * @since 2023-07-14
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-@ApiModel(value = "RecordsVO对象", description = "生产记录")
-public class RecordsVO extends Records {
+@ApiModel(value = "ProductMockRecordsVO对象", description = "生产记录")
+public class ProductMockRecordsVO extends ProductMockRecords {
 	private static final long serialVersionUID = 1L;
 
 }

+ 4 - 4
blade-service-api/blade-school-api/src/main/java/org/springblade/school/vo/StationVO.java → blade-service-api/blade-school-api/src/main/java/org/springblade/school/vo/ProductMockStationVO.java

@@ -16,7 +16,7 @@
  */
 package org.springblade.school.vo;
 
-import org.springblade.school.entity.Station;
+import org.springblade.school.entity.ProductMockStation;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import io.swagger.annotations.ApiModel;
@@ -25,12 +25,12 @@ import io.swagger.annotations.ApiModel;
  * 生产模拟工位表视图实体类
  *
  * @author BladeX
- * @since 2023-07-13
+ * @since 2023-07-14
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-@ApiModel(value = "StationVO对象", description = "生产模拟工位表")
-public class StationVO extends Station {
+@ApiModel(value = "ProductMockStationVO对象", description = "生产模拟工位表")
+public class ProductMockStationVO extends ProductMockStation {
 	private static final long serialVersionUID = 1L;
 
 }

+ 7 - 5
blade-service-api/blade-school-api/src/main/java/org/springblade/school/dto/RecordsDTO.java → blade-service-api/blade-school-api/src/main/java/org/springblade/school/vo/ProductMockWeekVO.java

@@ -14,21 +14,23 @@
  *  this software without specific prior written permission.
  *  Author: Chill 庄骞 (smallchill@163.com)
  */
-package org.springblade.school.dto;
+package org.springblade.school.vo;
 
-import org.springblade.school.entity.Records;
+import org.springblade.school.entity.ProductMockWeek;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
 
 /**
- * 生产记录数据传输对象实体类
+ * 生产模拟星期视图实体类
  *
  * @author BladeX
- * @since 2023-07-13
+ * @since 2023-07-17
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
-public class RecordsDTO extends Records {
+@ApiModel(value = "ProductMockWeekVO对象", description = "生产模拟星期")
+public class ProductMockWeekVO extends ProductMockWeek {
 	private static final long serialVersionUID = 1L;
 
 }

+ 23 - 47
blade-service/blade-school/src/main/java/org/springblade/school/controller/RecordsController.java → blade-service/blade-school/src/main/java/org/springblade/school/controller/ProductMockRecordsController.java

@@ -16,7 +16,6 @@
  */
 package org.springblade.school.controller;
 
-import cn.hutool.json.JSONObject;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -29,40 +28,37 @@ 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.springblade.school.entity.Station;
+import org.springblade.school.dto.ProductMockRecordsDTO;
 import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.school.entity.Records;
-import org.springblade.school.vo.RecordsVO;
-import org.springblade.school.service.IRecordsService;
+import org.springblade.school.entity.ProductMockRecords;
+import org.springblade.school.vo.ProductMockRecordsVO;
+import org.springblade.school.service.IProductMockRecordsService;
 import org.springblade.core.boot.ctrl.BladeController;
 
-import java.util.List;
-import java.util.Map;
-
 /**
  * 生产记录 控制器
  *
  * @author BladeX
- * @since 2023-07-13
+ * @since 2023-07-14
  */
 @RestController
 @AllArgsConstructor
-@RequestMapping("/records")
+@RequestMapping("/productmockrecords")
 @Api(value = "生产记录", tags = "生产记录接口")
-public class RecordsController extends BladeController {
+public class ProductMockRecordsController extends BladeController {
 
-	private final IRecordsService recordsService;
+	private final IProductMockRecordsService productMockRecordsService;
 
 	/**
 	 * 详情
 	 */
 	@GetMapping("/detail")
 	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "详情", notes = "传入records")
-	public R<JSONObject> detail(Records records) {
-		JSONObject detail = recordsService.getRecordsAndStationByRecordsId(Condition.getQueryWrapper(records));
-		return R.data(detail);
+	@ApiOperation(value = "详情", notes = "传入productMockRecords")
+	public R<ProductMockRecordsDTO> detail(ProductMockRecords productMockRecords) {
+
+		return R.data(productMockRecordsService.getProductMockRecordsByid(Condition.getQueryWrapper(productMockRecords)));
 	}
 
 	/**
@@ -70,9 +66,9 @@ public class RecordsController extends BladeController {
 	 */
 	@GetMapping("/list")
 	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "分页", notes = "传入records")
-	public R<IPage<Records>> list(Records records, Query query) {
-		IPage<Records> pages = recordsService.page(Condition.getPage(query), Condition.getQueryWrapper(records));
+	@ApiOperation(value = "分页", notes = "传入productMockRecords")
+	public R<IPage<ProductMockRecords>> list(ProductMockRecords productMockRecords, Query query) {
+		IPage<ProductMockRecords> pages = productMockRecordsService.page(Condition.getPage(query), Condition.getQueryWrapper(productMockRecords));
 		return R.data(pages);
 	}
 
@@ -81,41 +77,21 @@ public class RecordsController extends BladeController {
 	 */
 	@GetMapping("/page")
 	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "分页", notes = "传入records")
-	public R<IPage<RecordsVO>> page(RecordsVO records, Query query) {
-		IPage<RecordsVO> pages = recordsService.selectRecordsPage(Condition.getPage(query), records);
+	@ApiOperation(value = "分页", notes = "传入productMockRecords")
+	public R<IPage<ProductMockRecordsVO>> page(ProductMockRecordsVO productMockRecords, Query query) {
+		IPage<ProductMockRecordsVO> pages = productMockRecordsService.selectProductMockRecordsPage(Condition.getPage(query), productMockRecords);
 		return R.data(pages);
 	}
 
 	/**
-	 * 新增 生产记录
-	 */
-	@PostMapping("/save")
-	@ApiOperationSupport(order = 4)
-	@ApiOperation(value = "新增", notes = "传入records")
-	public R save(@Valid @RequestBody Records records) {
-		return R.data(recordsService.insert(records));
-	}
-
-	/**
-	 * 修改 生产记录
-	 */
-	@PostMapping("/update")
-	@ApiOperationSupport(order = 5)
-	@ApiOperation(value = "修改", notes = "传入records")
-	public R update(@Valid @RequestParam(value = "records") Records records,
-					@RequestParam(value = "station",required = false) List<Station> station) {
-		return R.status(recordsService.setById(records, station));
-	}
-
-	/**
 	 * 新增或修改 生产记录
 	 */
 	@PostMapping("/submit")
 	@ApiOperationSupport(order = 6)
-	@ApiOperation(value = "新增或修改", notes = "传入records")
-	public R submit(@Valid @RequestBody Records records) {
-		return R.status(recordsService.saveOrUpdate(records));
+	@ApiOperation(value = "新增或修改", notes = "传入productMockRecords")
+	public R submit(@Valid @RequestBody ProductMockRecordsDTO productMockRecordsDTO) {
+
+		return productMockRecordsService.saveOrUpdateProductMockRecords(productMockRecordsDTO);
 	}
 
 
@@ -126,7 +102,7 @@ public class RecordsController extends BladeController {
 	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(recordsService.removeByIds(Func.toLongList(ids)));
+		return R.status(productMockRecordsService.removeByIds(Func.toLongList(ids)));
 	}
 
 

+ 29 - 42
blade-service/blade-school/src/main/java/org/springblade/school/controller/StationController.java → blade-service/blade-school/src/main/java/org/springblade/school/controller/ProductMockStationController.java

@@ -29,35 +29,33 @@ 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.school.entity.Station;
-import org.springblade.school.vo.StationVO;
-import org.springblade.school.service.IStationService;
+import org.springblade.school.entity.ProductMockStation;
+import org.springblade.school.vo.ProductMockStationVO;
+import org.springblade.school.service.IProductMockStationService;
 import org.springblade.core.boot.ctrl.BladeController;
 
-import java.util.List;
-
 /**
  * 生产模拟工位表 控制器
  *
  * @author BladeX
- * @since 2023-07-13
+ * @since 2023-07-14
  */
 @RestController
 @AllArgsConstructor
-@RequestMapping("/station")
+@RequestMapping("/productmockstation")
 @Api(value = "生产模拟工位表", tags = "生产模拟工位表接口")
-public class StationController extends BladeController {
+public class ProductMockStationController extends BladeController {
 
-	private final IStationService stationService;
+	private final IProductMockStationService productMockStationService;
 
 	/**
 	 * 详情
 	 */
 	@GetMapping("/detail")
 	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "详情", notes = "传入station")
-	public R<Station> detail(Station station) {
-		Station detail = stationService.getOne(Condition.getQueryWrapper(station));
+	@ApiOperation(value = "详情", notes = "传入productMockStation")
+	public R<ProductMockStation> detail(ProductMockStation productMockStation) {
+		ProductMockStation detail = productMockStationService.getOne(Condition.getQueryWrapper(productMockStation));
 		return R.data(detail);
 	}
 
@@ -66,9 +64,9 @@ public class StationController extends BladeController {
 	 */
 	@GetMapping("/list")
 	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "分页", notes = "传入station")
-	public R<IPage<Station>> list(Station station, Query query) {
-		IPage<Station> pages = stationService.page(Condition.getPage(query), Condition.getQueryWrapper(station));
+	@ApiOperation(value = "分页", notes = "传入productMockStation")
+	public R<IPage<ProductMockStation>> list(ProductMockStation productMockStation, Query query) {
+		IPage<ProductMockStation> pages = productMockStationService.page(Condition.getPage(query), Condition.getQueryWrapper(productMockStation));
 		return R.data(pages);
 	}
 
@@ -77,9 +75,9 @@ public class StationController extends BladeController {
 	 */
 	@GetMapping("/page")
 	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "分页", notes = "传入station")
-	public R<IPage<StationVO>> page(StationVO station, Query query) {
-		IPage<StationVO> pages = stationService.selectStationPage(Condition.getPage(query), station);
+	@ApiOperation(value = "分页", notes = "传入productMockStation")
+	public R<IPage<ProductMockStationVO>> page(ProductMockStationVO productMockStation, Query query) {
+		IPage<ProductMockStationVO> pages = productMockStationService.selectProductMockStationPage(Condition.getPage(query), productMockStation);
 		return R.data(pages);
 	}
 
@@ -88,40 +86,29 @@ public class StationController extends BladeController {
 	 */
 	@PostMapping("/save")
 	@ApiOperationSupport(order = 4)
-	@ApiOperation(value = "新增", notes = "传入station")
-	public R save(@Valid @RequestBody Station station) {
-		return R.status(stationService.save(station));
-	}
-
-	/**
-	 * 新增 生产模拟工位表
-	 */
-	@PostMapping("/save-list")
-	@ApiOperationSupport(order = 5)
-	@ApiOperation(value = "新增", notes = "传入station")
-	public R save(@Valid @RequestBody List<Station> stationList) {
-
-		return R.status(stationService.saveList(stationList));
+	@ApiOperation(value = "新增", notes = "传入productMockStation")
+	public R save(@Valid @RequestBody ProductMockStation productMockStation) {
+		return R.status(productMockStationService.save(productMockStation));
 	}
 
 	/**
 	 * 修改 生产模拟工位表
 	 */
 	@PostMapping("/update")
-	@ApiOperationSupport(order = 6)
-	@ApiOperation(value = "修改", notes = "传入station")
-	public R update(@Valid @RequestBody Station station) {
-		return R.status(stationService.updateById(station));
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入productMockStation")
+	public R update(@Valid @RequestBody ProductMockStation productMockStation) {
+		return R.status(productMockStationService.updateById(productMockStation));
 	}
 
 	/**
 	 * 新增或修改 生产模拟工位表
 	 */
 	@PostMapping("/submit")
-	@ApiOperationSupport(order = 7)
-	@ApiOperation(value = "新增或修改", notes = "传入station")
-	public R submit(@Valid @RequestBody Station station) {
-		return R.status(stationService.saveOrUpdate(station));
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入productMockStation")
+	public R submit(@Valid @RequestBody ProductMockStation productMockStation) {
+		return R.status(productMockStationService.saveOrUpdate(productMockStation));
 	}
 
 
@@ -129,10 +116,10 @@ public class StationController extends BladeController {
 	 * 删除 生产模拟工位表
 	 */
 	@PostMapping("/remove")
-	@ApiOperationSupport(order = 9)
+	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(stationService.removeByIds(Func.toLongList(ids)));
+		return R.status(productMockStationService.removeByIds(Func.toLongList(ids)));
 	}
 
 

+ 126 - 0
blade-service/blade-school/src/main/java/org/springblade/school/controller/ProductMockWeekController.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.school.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.school.entity.ProductMockWeek;
+import org.springblade.school.vo.ProductMockWeekVO;
+import org.springblade.school.service.IProductMockWeekService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 生产模拟星期 控制器
+ *
+ * @author BladeX
+ * @since 2023-07-17
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/productmockweek")
+@Api(value = "生产模拟星期", tags = "生产模拟星期接口")
+public class ProductMockWeekController extends BladeController {
+
+	private final IProductMockWeekService productMockWeekService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入productMockWeek")
+	public R<ProductMockWeek> detail(ProductMockWeek productMockWeek) {
+		ProductMockWeek detail = productMockWeekService.getOne(Condition.getQueryWrapper(productMockWeek));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 生产模拟星期
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入productMockWeek")
+	public R<IPage<ProductMockWeek>> list(ProductMockWeek productMockWeek, Query query) {
+		IPage<ProductMockWeek> pages = productMockWeekService.page(Condition.getPage(query), Condition.getQueryWrapper(productMockWeek));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 生产模拟星期
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入productMockWeek")
+	public R<IPage<ProductMockWeekVO>> page(ProductMockWeekVO productMockWeek, Query query) {
+		IPage<ProductMockWeekVO> pages = productMockWeekService.selectProductMockWeekPage(Condition.getPage(query), productMockWeek);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 生产模拟星期
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入productMockWeek")
+	public R save(@Valid @RequestBody ProductMockWeek productMockWeek) {
+		return R.status(productMockWeekService.save(productMockWeek));
+	}
+
+	/**
+	 * 修改 生产模拟星期
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入productMockWeek")
+	public R update(@Valid @RequestBody ProductMockWeek productMockWeek) {
+		return R.status(productMockWeekService.updateById(productMockWeek));
+	}
+
+	/**
+	 * 新增或修改 生产模拟星期
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入productMockWeek")
+	public R submit(@Valid @RequestBody ProductMockWeek productMockWeek) {
+		return R.status(productMockWeekService.saveOrUpdate(productMockWeek));
+	}
+
+
+	/**
+	 * 删除 生产模拟星期
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(productMockWeekService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 6 - 6
blade-service/blade-school/src/main/java/org/springblade/school/mapper/RecordsMapper.java → blade-service/blade-school/src/main/java/org/springblade/school/mapper/ProductMockRecordsMapper.java

@@ -16,8 +16,8 @@
  */
 package org.springblade.school.mapper;
 
-import org.springblade.school.entity.Records;
-import org.springblade.school.vo.RecordsVO;
+import org.springblade.school.entity.ProductMockRecords;
+import org.springblade.school.vo.ProductMockRecordsVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import java.util.List;
@@ -26,17 +26,17 @@ import java.util.List;
  * 生产记录 Mapper 接口
  *
  * @author BladeX
- * @since 2023-07-13
+ * @since 2023-07-14
  */
-public interface RecordsMapper extends BaseMapper<Records> {
+public interface ProductMockRecordsMapper extends BaseMapper<ProductMockRecords> {
 
 	/**
 	 * 自定义分页
 	 *
 	 * @param page
-	 * @param records
+	 * @param productMockRecords
 	 * @return
 	 */
-	List<RecordsVO> selectRecordsPage(IPage page, RecordsVO records);
+	List<ProductMockRecordsVO> selectProductMockRecordsPage(IPage page, ProductMockRecordsVO productMockRecords);
 
 }

+ 5 - 5
blade-service/blade-school/src/main/java/org/springblade/school/mapper/RecordsMapper.xml → blade-service/blade-school/src/main/java/org/springblade/school/mapper/ProductMockRecordsMapper.xml

@@ -1,23 +1,23 @@
 <?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.school.mapper.RecordsMapper">
+<mapper namespace="org.springblade.school.mapper.ProductMockRecordsMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="recordsResultMap" type="org.springblade.school.entity.Records">
+    <resultMap id="productMockRecordsResultMap" type="org.springblade.school.entity.ProductMockRecords">
         <id column="id" property="id"/>
         <result column="sys_no" property="sysNo"/>
         <result column="team_name" property="teamName"/>
-        <result column="team_name" property="teamName"/>
-        <result column="tenant_id" property="tenantId"/>
+        <result column="create_user" property="createUser"/>
         <result column="create_dept" property="createDept"/>
         <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="tenant_id" property="tenantId"/>
     </resultMap>
 
 
-    <select id="selectRecordsPage" resultMap="recordsResultMap">
+    <select id="selectProductMockRecordsPage" resultMap="productMockRecordsResultMap">
         select * from product_mock_records where is_deleted = 0
     </select>
 

+ 6 - 6
blade-service/blade-school/src/main/java/org/springblade/school/mapper/StationMapper.java → blade-service/blade-school/src/main/java/org/springblade/school/mapper/ProductMockStationMapper.java

@@ -16,8 +16,8 @@
  */
 package org.springblade.school.mapper;
 
-import org.springblade.school.entity.Station;
-import org.springblade.school.vo.StationVO;
+import org.springblade.school.entity.ProductMockStation;
+import org.springblade.school.vo.ProductMockStationVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import java.util.List;
@@ -26,17 +26,17 @@ import java.util.List;
  * 生产模拟工位表 Mapper 接口
  *
  * @author BladeX
- * @since 2023-07-13
+ * @since 2023-07-14
  */
-public interface StationMapper extends BaseMapper<Station> {
+public interface ProductMockStationMapper extends BaseMapper<ProductMockStation> {
 
 	/**
 	 * 自定义分页
 	 *
 	 * @param page
-	 * @param station
+	 * @param productMockStation
 	 * @return
 	 */
-	List<StationVO> selectStationPage(IPage page, StationVO station);
+	List<ProductMockStationVO> selectProductMockStationPage(IPage page, ProductMockStationVO productMockStation);
 
 }

+ 27 - 0
blade-service/blade-school/src/main/java/org/springblade/school/mapper/ProductMockStationMapper.xml

@@ -0,0 +1,27 @@
+<?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.school.mapper.ProductMockStationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="productMockStationResultMap" type="org.springblade.school.entity.ProductMockStation">
+        <id column="id" property="id"/>
+        <result column="week_id" property="weekId"/>
+        <result column="product_quantity" property="productQuantity"/>
+        <result column="sale_unit_price" property="saleUnitPrice"/>
+        <result column="locationint" property="locationint"/>
+        <result column="data" property="data"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <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="tenant_id" property="tenantId"/>
+    </resultMap>
+
+
+    <select id="selectProductMockStationPage" resultMap="productMockStationResultMap">
+        select * from product_mock_station where is_deleted = 0
+    </select>
+
+</mapper>

+ 42 - 0
blade-service/blade-school/src/main/java/org/springblade/school/mapper/ProductMockWeekMapper.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.school.mapper;
+
+import org.springblade.school.entity.ProductMockWeek;
+import org.springblade.school.vo.ProductMockWeekVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 生产模拟星期 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-07-17
+ */
+public interface ProductMockWeekMapper extends BaseMapper<ProductMockWeek> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param productMockWeek
+	 * @return
+	 */
+	List<ProductMockWeekVO> selectProductMockWeekPage(IPage page, ProductMockWeekVO productMockWeek);
+
+}

+ 25 - 0
blade-service/blade-school/src/main/java/org/springblade/school/mapper/ProductMockWeekMapper.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.school.mapper.ProductMockWeekMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="productMockWeekResultMap" type="org.springblade.school.entity.ProductMockWeek">
+        <id column="id" property="id"/>
+        <result column="records_id" property="recordsId"/>
+        <result column="week" property="week"/>
+        <result column="total_price" property="totalPrice"/>
+        <result column="tenant_id" property="tenantId"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+
+    <select id="selectProductMockWeekPage" resultMap="productMockWeekResultMap">
+        select * from product_mock_week where is_deleted = 0
+    </select>
+
+</mapper>

+ 0 - 20
blade-service/blade-school/src/main/java/org/springblade/school/mapper/StationMapper.xml

@@ -1,20 +0,0 @@
-<?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.school.mapper.StationMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="stationResultMap" type="org.springblade.school.entity.Station">
-        <id column="id" property="id"/>
-        <result column="product_quantity" property="productQuantity"/>
-        <result column="sale_unit_price" property="saleUnitPrice"/>
-        <result column="locationint" property="locationint"/>
-        <result column="data" property="data"/>
-        <result column="recods_id" property="recodsId"/>
-    </resultMap>
-
-
-    <select id="selectStationPage" resultMap="stationResultMap">
-        select * from product_mock_station where is_deleted = 0
-    </select>
-
-</mapper>

+ 16 - 27
blade-service/blade-school/src/main/java/org/springblade/school/service/IRecordsService.java → blade-service/blade-school/src/main/java/org/springblade/school/service/IProductMockRecordsService.java

@@ -16,53 +16,42 @@
  */
 package org.springblade.school.service;
 
-import cn.hutool.json.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import org.springblade.school.entity.Records;
-import org.springblade.school.entity.Station;
-import org.springblade.school.vo.RecordsVO;
+import org.springblade.school.dto.ProductMockRecordsDTO;
+import org.springblade.school.entity.ProductMockRecords;
+import org.springblade.school.vo.ProductMockRecordsVO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-
-import java.util.List;
-import java.util.Map;
+import org.springblade.core.tool.api.R;
 
 /**
  * 生产记录 服务类
  *
  * @author BladeX
- * @since 2023-07-13
+ * @since 2023-07-14
  */
-public interface IRecordsService extends IService<Records> {
+public interface IProductMockRecordsService extends IService<ProductMockRecords> {
 
 	/**
 	 * 自定义分页
 	 *
 	 * @param page
-	 * @param records
+	 * @param productMockRecords
 	 * @return
 	 */
-	IPage<RecordsVO> selectRecordsPage(IPage<RecordsVO> page, RecordsVO records);
-
-	/**
-	 * 新增生产记录
-	 * @param records 生产记录
-	 * @return id
-	 */
-	Long insert(Records records);
+	IPage<ProductMockRecordsVO> selectProductMockRecordsPage(IPage<ProductMockRecordsVO> page, ProductMockRecordsVO productMockRecords);
 
 	/**
-	 * 获取详情
-	 * @param queryWrapper
-	 * @return
+	 * 新增或修改生产模拟
+	 * @param productMockRecordsDTO 包含岗位的生产记录实体
+	 * @return 保存或更新后的数据
 	 */
-	JSONObject getRecordsAndStationByRecordsId(QueryWrapper<Records> queryWrapper);
+	R saveOrUpdateProductMockRecords(ProductMockRecordsDTO productMockRecordsDTO);
 
 	/**
-	 * 修改
-	 * @param records 生产记录
-	 * @param station 岗位
-	 * @return
+	 * 查询详情,包含岗位信息
+	 * @param queryWrapper id
+	 * @return 详情
 	 */
-	boolean setById(Records records, List<Station> station);
+	ProductMockRecordsDTO getProductMockRecordsByid(QueryWrapper<ProductMockRecords> queryWrapper);
 }

+ 6 - 14
blade-service/blade-school/src/main/java/org/springblade/school/service/IStationService.java → blade-service/blade-school/src/main/java/org/springblade/school/service/IProductMockStationService.java

@@ -16,34 +16,26 @@
  */
 package org.springblade.school.service;
 
-import org.springblade.school.entity.Station;
-import org.springblade.school.vo.StationVO;
+import org.springblade.school.entity.ProductMockStation;
+import org.springblade.school.vo.ProductMockStationVO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
-import java.util.List;
-
 /**
  * 生产模拟工位表 服务类
  *
  * @author BladeX
- * @since 2023-07-13
+ * @since 2023-07-14
  */
-public interface IStationService extends IService<Station> {
+public interface IProductMockStationService extends IService<ProductMockStation> {
 
 	/**
 	 * 自定义分页
 	 *
 	 * @param page
-	 * @param station
+	 * @param productMockStation
 	 * @return
 	 */
-	IPage<StationVO> selectStationPage(IPage<StationVO> page, StationVO station);
+	IPage<ProductMockStationVO> selectProductMockStationPage(IPage<ProductMockStationVO> page, ProductMockStationVO productMockStation);
 
-	/**
-	 * 新增 生产模拟工位表List
-	 * @param stationList 工位list
-	 * @return
-	 */
-	boolean saveList(List<Station> stationList);
 }

+ 41 - 0
blade-service/blade-school/src/main/java/org/springblade/school/service/IProductMockWeekService.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.school.service;
+
+import org.springblade.school.entity.ProductMockWeek;
+import org.springblade.school.vo.ProductMockWeekVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 生产模拟星期 服务类
+ *
+ * @author BladeX
+ * @since 2023-07-17
+ */
+public interface IProductMockWeekService extends IService<ProductMockWeek> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param productMockWeek
+	 * @return
+	 */
+	IPage<ProductMockWeekVO> selectProductMockWeekPage(IPage<ProductMockWeekVO> page, ProductMockWeekVO productMockWeek);
+
+}

+ 221 - 0
blade-service/blade-school/src/main/java/org/springblade/school/service/impl/ProductMockRecordsServiceImpl.java

@@ -0,0 +1,221 @@
+/*
+ *      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.school.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.secure.utils.SecureUtil;
+import org.springblade.school.dto.ProductMockRecordsDTO;
+import org.springblade.school.dto.ProductMockStationDTO;
+import org.springblade.school.dto.ProductMockWeekDTO;
+import org.springblade.school.entity.ProductMockRecords;
+import org.springblade.school.entity.ProductMockStation;
+import org.springblade.school.entity.ProductMockWeek;
+import org.springblade.school.mapper.ProductMockStationMapper;
+import org.springblade.school.mapper.ProductMockWeekMapper;
+import org.springblade.school.vo.ProductMockRecordsVO;
+import org.springblade.school.mapper.ProductMockRecordsMapper;
+import org.springblade.school.service.IProductMockRecordsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+import org.springblade.core.tool.api.R;
+
+import java.util.*;
+
+/**
+ * 生产记录 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-07-14
+ */
+@Service
+public class ProductMockRecordsServiceImpl extends ServiceImpl<ProductMockRecordsMapper, ProductMockRecords> implements IProductMockRecordsService {
+
+	/**
+	 * 生产模拟星期mapple
+	 */
+	@Autowired
+	private ProductMockWeekMapper productMockWeekMapper;
+
+	/**
+	 * 生产模拟岗位mapple
+	 */
+	@Autowired
+	private ProductMockStationMapper productMockStationMapper;
+
+	@Override
+	public IPage<ProductMockRecordsVO> selectProductMockRecordsPage(IPage<ProductMockRecordsVO> page, ProductMockRecordsVO productMockRecords) {
+		return page.setRecords(baseMapper.selectProductMockRecordsPage(page, productMockRecords));
+	}
+
+	/**
+	 * 新增或修改生产模拟
+	 *
+	 * @param productMockRecordsDTO 包含岗位的生产记录实体
+	 * @return 保存或更新后的数据
+	 */
+	@Transactional
+	@Override
+	public R saveOrUpdateProductMockRecords(ProductMockRecordsDTO productMockRecordsDTO) {
+
+		ProductMockRecords productMockRecords = new ProductMockRecords();
+		BeanUtils.copyProperties(productMockRecordsDTO, productMockRecords);
+
+		// 没有id新数据保存
+		if (productMockRecordsDTO.getId() == null) {
+
+			// 设置租户id
+			productMockRecords.setTenantId(SecureUtil.getTenantId());
+			// 设置创建人
+			productMockRecords.setCreateUser(SecureUtil.getUserId());
+			// 设置创建部门
+//			productMockRecords.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
+			// 设置创建时间
+			productMockRecords.setCreateTime(new Date());
+
+			// 新增数据
+			int i = baseMapper.insert(productMockRecords);
+
+			if (i != 1) {
+				// 新增失败手动归滚
+				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+				R<String> R = new R<>();
+				R.setCode(500);
+				R.setSuccess(false);
+				R.setMsg("保存操作记录失败");
+				return R;
+			}
+			productMockRecordsDTO.setId(productMockRecords.getId());
+		}
+
+		// 星期表
+		ProductMockWeekDTO productMockWeekDTO = productMockRecordsDTO.getProductMockWeekDTO();
+		ProductMockWeek productMockWeek = new ProductMockWeek();
+		BeanUtils.copyProperties(productMockWeekDTO, productMockWeek);
+		// 设置记录表id
+		productMockWeek.setRecordsId(productMockRecords.getId());
+		// 设置租户id
+		productMockWeek.setTenantId(SecureUtil.getTenantId());
+		// 设置创建人
+		productMockWeek.setCreateUser(SecureUtil.getUserId());
+		// 设置创建部门
+//			productMockWeek.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
+		// 设置创建时间
+		productMockWeek.setCreateTime(new Date());
+
+		int insert = productMockWeekMapper.insert(productMockWeek);
+
+		if (insert != 1) {
+			// 新增失败手动归滚
+			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+			R<String> R = new R<>();
+			R.setCode(500);
+			R.setSuccess(false);
+			R.setMsg("保存星期失败");
+			return R;
+		}
+
+		// 处理工位数据
+		List<ProductMockStation> productMockStationList = productMockWeekDTO.getProductMockStationList();
+
+		for (ProductMockStation productMockStation : productMockStationList) {
+
+			// 设置星期表id
+			productMockStation.setWeekId(productMockWeek.getId());
+			// 设置租户id
+			productMockStation.setTenantId(SecureUtil.getTenantId());
+			// 设置创建人
+			productMockStation.setCreateUser(SecureUtil.getUserId());
+			// 设置创建部门
+//			productMockStation.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
+			// 设置创建时间
+
+			productMockStation.setCreateTime(new Date());
+
+			int y = productMockStationMapper.insert(productMockStation);
+			if (y != 1) {
+				// 新增失败手动归滚
+				TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+				R<String> R = new R<>();
+				R.setCode(500);
+				R.setSuccess(false);
+				R.setMsg("保存工位数据失败");
+				return R;
+			}
+		}
+
+		// 保存成功
+		return R.data(productMockRecordsDTO);
+	}
+
+	/**
+	 * 查询详情,包含星期,岗位信息
+	 *
+	 * @param queryWrapper id
+	 * @return 详情
+	 */
+	@Override
+	public ProductMockRecordsDTO getProductMockRecordsByid(QueryWrapper<ProductMockRecords> queryWrapper) {
+		ProductMockRecordsDTO productMockRecordsDTO = new ProductMockRecordsDTO();
+		// 获取生产模拟记录
+		ProductMockRecords productMockRecords = baseMapper.selectOne(queryWrapper);
+		BeanUtils.copyProperties(productMockRecords, productMockRecordsDTO);
+
+		// 获取星期记录
+		QueryWrapper<ProductMockWeek> weekqw = new QueryWrapper<>();
+		weekqw.eq("records_id", productMockRecords.getId());
+		List<ProductMockWeek> productMockWeeks = productMockWeekMapper.selectList(weekqw);
+		List<ProductMockWeekDTO> weekDTOAList = new ArrayList<>();
+		BeanUtils.copyProperties(productMockWeeks, weekDTOAList);
+		productMockRecordsDTO.setProductMockWeekDTOList(weekDTOAList);
+
+		for (ProductMockWeekDTO productMockWeekDTO : weekDTOAList) {
+			// 获取工位记录
+			QueryWrapper<ProductMockStation> pmsqw = new QueryWrapper<>();
+			pmsqw.eq("week_id", productMockWeekDTO.getId());
+			List<ProductMockStation> productMockStations = productMockStationMapper.selectList(pmsqw);
+
+			// 根据日期正序排序
+			Comparator<ProductMockStation> comparing = Comparator.comparing(ProductMockStation::getData);
+			productMockStations.sort(comparing);
+
+			List<ProductMockStationDTO> productMockStationDTOList = new ArrayList<>();
+
+			// 计算合计
+			for (ProductMockStation productMockStation : productMockStations) {
+
+				ProductMockStationDTO productMockStationDTO = new ProductMockStationDTO();
+				BeanUtils.copyProperties(productMockStation, productMockStationDTO);
+				productMockStationDTO.setTotalAmounts(productMockStationDTO.getProductQuantity() * productMockStationDTO.getSaleUnitPrice());
+
+				productMockStationDTOList.add(productMockStationDTO);
+			}
+
+			// 放置岗位信息
+			productMockWeekDTO.setProductMockStationDTOList(productMockStationDTOList);
+		}
+
+		return productMockRecordsDTO;
+	}
+
+}

+ 8 - 18
blade-service/blade-school/src/main/java/org/springblade/school/service/impl/StationServiceImpl.java → blade-service/blade-school/src/main/java/org/springblade/school/service/impl/ProductMockStationServiceImpl.java

@@ -16,36 +16,26 @@
  */
 package org.springblade.school.service.impl;
 
-import org.springblade.school.entity.Station;
-import org.springblade.school.vo.StationVO;
-import org.springblade.school.mapper.StationMapper;
-import org.springblade.school.service.IStationService;
+import org.springblade.school.entity.ProductMockStation;
+import org.springblade.school.vo.ProductMockStationVO;
+import org.springblade.school.mapper.ProductMockStationMapper;
+import org.springblade.school.service.IProductMockStationService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.List;
 
 /**
  * 生产模拟工位表 服务实现类
  *
  * @author BladeX
- * @since 2023-07-13
+ * @since 2023-07-14
  */
 @Service
-public class StationServiceImpl extends ServiceImpl<StationMapper, Station> implements IStationService {
-
-	@Override
-	public IPage<StationVO> selectStationPage(IPage<StationVO> page, StationVO station) {
-		return page.setRecords(baseMapper.selectStationPage(page, station));
-	}
+public class ProductMockStationServiceImpl extends ServiceImpl<ProductMockStationMapper, ProductMockStation> implements IProductMockStationService {
 
-	@Transactional
 	@Override
-	public boolean saveList(List<Station> stationList) {
-		stationList.forEach(baseMapper::insert);
-		return true;
+	public IPage<ProductMockStationVO> selectProductMockStationPage(IPage<ProductMockStationVO> page, ProductMockStationVO productMockStation) {
+		return page.setRecords(baseMapper.selectProductMockStationPage(page, productMockStation));
 	}
 
 }

+ 41 - 0
blade-service/blade-school/src/main/java/org/springblade/school/service/impl/ProductMockWeekServiceImpl.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.school.service.impl;
+
+import org.springblade.school.entity.ProductMockWeek;
+import org.springblade.school.vo.ProductMockWeekVO;
+import org.springblade.school.mapper.ProductMockWeekMapper;
+import org.springblade.school.service.IProductMockWeekService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 生产模拟星期 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-07-17
+ */
+@Service
+public class ProductMockWeekServiceImpl extends ServiceImpl<ProductMockWeekMapper, ProductMockWeek> implements IProductMockWeekService {
+
+	@Override
+	public IPage<ProductMockWeekVO> selectProductMockWeekPage(IPage<ProductMockWeekVO> page, ProductMockWeekVO productMockWeek) {
+		return page.setRecords(baseMapper.selectProductMockWeekPage(page, productMockWeek));
+	}
+
+}

+ 0 - 137
blade-service/blade-school/src/main/java/org/springblade/school/service/impl/RecordsServiceImpl.java

@@ -1,137 +0,0 @@
-/*
- *      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.school.service.impl;
-
-import cn.hutool.json.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springblade.client.feign.ISerialClient;
-import org.springblade.core.secure.utils.AuthUtil;
-import org.springblade.core.tool.api.R;
-import org.springblade.school.entity.Records;
-import org.springblade.school.entity.Station;
-import org.springblade.school.mapper.RecordsMapper;
-import org.springblade.school.mapper.StationMapper;
-import org.springblade.school.service.IRecordsService;
-import org.springblade.school.vo.RecordsVO;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.transaction.interceptor.TransactionAspectSupport;
-
-import java.util.List;
-
-/**
- * 生产记录 服务实现类
- *
- * @author BladeX
- * @since 2023-07-13
- */
-@Service
-public class RecordsServiceImpl extends ServiceImpl<RecordsMapper, Records> implements IRecordsService {
-
-	/**
-	 * 工位mapper
-	 */
-	@Autowired
-	private StationMapper stationMapper;
-
-	/**
-	 * 生成系统编号
-	 */
-	@Autowired
-	private ISerialClient serialClient;
-
-
-	@Override
-	public IPage<RecordsVO> selectRecordsPage(IPage<RecordsVO> page, RecordsVO records) {
-		return page.setRecords(baseMapper.selectRecordsPage(page, records));
-	}
-
-	/**
-	 * 新增生产记录
-	 * @param records 生产记录
-	 * @return 成功true,失败false
-	 */
-	@Transactional
-	@Override
-	public Long insert(Records records) {
-
-		// 租户id
-		records.setTenantId(AuthUtil.getTenantId());
-		// 系统编号
-		R billNo = serialClient.getBillNo("XYGL", "XY", "XYGL");
-		if (!billNo.isSuccess()) {
-			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-			throw new Error("生成系统编号失败");
-		}
-		records.setSysNo(billNo.getData().toString());
-
-		// 当前登录人
-		records.setCreateUser(AuthUtil.getUserId());
-
-		// 创建部门
-		records.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
-
-		// 新增生产记录
-		baseMapper.insert(records);
-		return records.getId();
-	}
-
-	/**
-	 * 查询详情
-	 * @param queryWrapper 条件
-	 * @return 生产记录与工位list
-	 */
-	@Override
-	public JSONObject getRecordsAndStationByRecordsId(QueryWrapper<Records> queryWrapper) {
-
-		// 查询生产记录
-		Records records = baseMapper.selectOne(queryWrapper);
-
-		// 查询岗位list
-		QueryWrapper<Station> sqw = new QueryWrapper<>();
-		sqw.eq("recods_id", records.getId());
-		List<Station> stationList = stationMapper.selectList(sqw);
-
-		// 查询工位
-		JSONObject json = new JSONObject();
-		json.set("records", records);
-		json.set("stationList", stationList);
-
-		return json;
-	}
-
-	/**
-	 * 修改
-	 * @param records 生产记录
-	 * @param station 岗位
-	 * @return
-	 */
-	@Transactional
-	@Override
-	public boolean setById(Records records, List<Station> station) {
-
-		baseMapper.updateById(records);
-		if (station != null) {
-			station.forEach(stationMapper::updateById);
-		}
-		return true;
-	}
-
-}