Browse Source

生产模拟

wangzhuo 2 years ago
parent
commit
0f8d257466
16 changed files with 1005 additions and 0 deletions
  1. 34 0
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/dto/RecordsDTO.java
  2. 34 0
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/dto/StationDTO.java
  3. 90 0
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/entity/Records.java
  4. 67 0
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/entity/Station.java
  5. 36 0
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/vo/RecordsVO.java
  6. 36 0
      blade-service-api/blade-school-api/src/main/java/org/springblade/school/vo/StationVO.java
  7. 133 0
      blade-service/blade-school/src/main/java/org/springblade/school/controller/RecordsController.java
  8. 139 0
      blade-service/blade-school/src/main/java/org/springblade/school/controller/StationController.java
  9. 42 0
      blade-service/blade-school/src/main/java/org/springblade/school/mapper/RecordsMapper.java
  10. 24 0
      blade-service/blade-school/src/main/java/org/springblade/school/mapper/RecordsMapper.xml
  11. 42 0
      blade-service/blade-school/src/main/java/org/springblade/school/mapper/StationMapper.java
  12. 20 0
      blade-service/blade-school/src/main/java/org/springblade/school/mapper/StationMapper.xml
  13. 68 0
      blade-service/blade-school/src/main/java/org/springblade/school/service/IRecordsService.java
  14. 49 0
      blade-service/blade-school/src/main/java/org/springblade/school/service/IStationService.java
  15. 140 0
      blade-service/blade-school/src/main/java/org/springblade/school/service/impl/RecordsServiceImpl.java
  16. 51 0
      blade-service/blade-school/src/main/java/org/springblade/school/service/impl/StationServiceImpl.java

+ 34 - 0
blade-service-api/blade-school-api/src/main/java/org/springblade/school/dto/RecordsDTO.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.school.dto;
+
+import org.springblade.school.entity.Records;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 生产记录数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-07-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class RecordsDTO extends Records {
+	private static final long serialVersionUID = 1L;
+
+}

+ 34 - 0
blade-service-api/blade-school-api/src/main/java/org/springblade/school/dto/StationDTO.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.school.dto;
+
+import org.springblade.school.entity.Station;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 生产模拟工位表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-07-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class StationDTO extends Station {
+	private static final long serialVersionUID = 1L;
+
+}

+ 90 - 0
blade-service-api/blade-school-api/src/main/java/org/springblade/school/entity/Records.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.school.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.time.LocalDateTime;
+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_records")
+@ApiModel(value = "Records对象", description = "生产记录")
+public class Records implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 系统编号
+	 */
+	@ApiModelProperty(value = "系统编号")
+	private String sysNo;
+	/**
+	 * 团队名字
+	 */
+	@ApiModelProperty(value = "团队名字")
+	private String teamName;
+	/**
+	 * 租户id
+	 */
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private Long createUser;
+	/**
+	 * 创建部门
+	 */
+	@ApiModelProperty(value = "创建部门")
+	private Long createDept;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private LocalDateTime createTime;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private Long updateUser;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private LocalDateTime updateTime;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+
+
+}

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

@@ -0,0 +1,67 @@
+/*
+ *      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;
+
+
+}

+ 36 - 0
blade-service-api/blade-school-api/src/main/java/org/springblade/school/vo/RecordsVO.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.school.vo;
+
+import org.springblade.school.entity.Records;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 生产记录视图实体类
+ *
+ * @author BladeX
+ * @since 2023-07-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "RecordsVO对象", description = "生产记录")
+public class RecordsVO extends Records {
+	private static final long serialVersionUID = 1L;
+
+}

+ 36 - 0
blade-service-api/blade-school-api/src/main/java/org/springblade/school/vo/StationVO.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.school.vo;
+
+import org.springblade.school.entity.Station;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 生产模拟工位表视图实体类
+ *
+ * @author BladeX
+ * @since 2023-07-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "StationVO对象", description = "生产模拟工位表")
+public class StationVO extends Station {
+	private static final long serialVersionUID = 1L;
+
+}

+ 133 - 0
blade-service/blade-school/src/main/java/org/springblade/school/controller/RecordsController.java

@@ -0,0 +1,133 @@
+/*
+ *      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 cn.hutool.json.JSONObject;
+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.springblade.school.entity.Station;
+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.core.boot.ctrl.BladeController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 生产记录 控制器
+ *
+ * @author BladeX
+ * @since 2023-07-13
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/records")
+@Api(value = "生产记录", tags = "生产记录接口")
+public class RecordsController extends BladeController {
+
+	private final IRecordsService recordsService;
+
+	/**
+	 * 详情
+	 */
+	@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);
+	}
+
+	/**
+	 * 分页 生产记录
+	 */
+	@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));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 生产记录
+	 */
+	@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);
+		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));
+	}
+
+
+	/**
+	 * 删除 生产记录
+	 */
+	@PostMapping("/remove")
+	@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)));
+	}
+
+
+}

+ 139 - 0
blade-service/blade-school/src/main/java/org/springblade/school/controller/StationController.java

@@ -0,0 +1,139 @@
+/*
+ *      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.Station;
+import org.springblade.school.vo.StationVO;
+import org.springblade.school.service.IStationService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.List;
+
+/**
+ * 生产模拟工位表 控制器
+ *
+ * @author BladeX
+ * @since 2023-07-13
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/station")
+@Api(value = "生产模拟工位表", tags = "生产模拟工位表接口")
+public class StationController extends BladeController {
+
+	private final IStationService stationService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入station")
+	public R<Station> detail(Station station) {
+		Station detail = stationService.getOne(Condition.getQueryWrapper(station));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 生产模拟工位表
+	 */
+	@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));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 生产模拟工位表
+	 */
+	@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);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 生产模拟工位表
+	 */
+	@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));
+	}
+
+	/**
+	 * 修改 生产模拟工位表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "修改", notes = "传入station")
+	public R update(@Valid @RequestBody Station station) {
+		return R.status(stationService.updateById(station));
+	}
+
+	/**
+	 * 新增或修改 生产模拟工位表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "新增或修改", notes = "传入station")
+	public R submit(@Valid @RequestBody Station station) {
+		return R.status(stationService.saveOrUpdate(station));
+	}
+
+
+	/**
+	 * 删除 生产模拟工位表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 9)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(stationService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 42 - 0
blade-service/blade-school/src/main/java/org/springblade/school/mapper/RecordsMapper.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.Records;
+import org.springblade.school.vo.RecordsVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 生产记录 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-07-13
+ */
+public interface RecordsMapper extends BaseMapper<Records> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param records
+	 * @return
+	 */
+	List<RecordsVO> selectRecordsPage(IPage page, RecordsVO records);
+
+}

+ 24 - 0
blade-service/blade-school/src/main/java/org/springblade/school/mapper/RecordsMapper.xml

@@ -0,0 +1,24 @@
+<?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">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="recordsResultMap" type="org.springblade.school.entity.Records">
+        <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_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="selectRecordsPage" resultMap="recordsResultMap">
+        select * from product_mock_records where is_deleted = 0
+    </select>
+
+</mapper>

+ 42 - 0
blade-service/blade-school/src/main/java/org/springblade/school/mapper/StationMapper.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.Station;
+import org.springblade.school.vo.StationVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 生产模拟工位表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-07-13
+ */
+public interface StationMapper extends BaseMapper<Station> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param station
+	 * @return
+	 */
+	List<StationVO> selectStationPage(IPage page, StationVO station);
+
+}

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

@@ -0,0 +1,20 @@
+<?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>

+ 68 - 0
blade-service/blade-school/src/main/java/org/springblade/school/service/IRecordsService.java

@@ -0,0 +1,68 @@
+/*
+ *      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 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 com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 生产记录 服务类
+ *
+ * @author BladeX
+ * @since 2023-07-13
+ */
+public interface IRecordsService extends IService<Records> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param records
+	 * @return
+	 */
+	IPage<RecordsVO> selectRecordsPage(IPage<RecordsVO> page, RecordsVO records);
+
+	/**
+	 * 新增生产记录
+	 * @param records 生产记录
+	 * @return id
+	 */
+	Long insert(Records records);
+
+	/**
+	 * 获取详情
+	 * @param queryWrapper
+	 * @return
+	 */
+	JSONObject getRecordsAndStationByRecordsId(QueryWrapper<Records> queryWrapper);
+
+	/**
+	 * 修改
+	 * @param records 生产记录
+	 * @param station 岗位
+	 * @return
+	 */
+	boolean setById(Records records, List<Station> station);
+}

+ 49 - 0
blade-service/blade-school/src/main/java/org/springblade/school/service/IStationService.java

@@ -0,0 +1,49 @@
+/*
+ *      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.Station;
+import org.springblade.school.vo.StationVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 生产模拟工位表 服务类
+ *
+ * @author BladeX
+ * @since 2023-07-13
+ */
+public interface IStationService extends IService<Station> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param station
+	 * @return
+	 */
+	IPage<StationVO> selectStationPage(IPage<StationVO> page, StationVO station);
+
+	/**
+	 * 新增 生产模拟工位表List
+	 * @param stationList 工位list
+	 * @return
+	 */
+	boolean saveList(List<Station> stationList);
+}

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

@@ -0,0 +1,140 @@
+/*
+ *      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 javafx.scene.chart.PieChart;
+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.StationMapper;
+import org.springblade.school.vo.RecordsVO;
+import org.springblade.school.mapper.RecordsMapper;
+import org.springblade.school.service.IRecordsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+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 java.awt.print.Book;
+import java.time.LocalDateTime;
+import java.util.*;
+
+/**
+ * 生产记录 服务实现类
+ *
+ * @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;
+	}
+
+}

+ 51 - 0
blade-service/blade-school/src/main/java/org/springblade/school/service/impl/StationServiceImpl.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.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 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
+ */
+@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));
+	}
+
+	@Transactional
+	@Override
+	public boolean saveList(List<Station> stationList) {
+		stationList.forEach(baseMapper::insert);
+		return true;
+	}
+
+}