From b3e4a07414be178705937f78e3deafd3536012bf Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Sat, 16 Jul 2022 08:47:53 +0800
Subject: [PATCH] 登录token储存到redis
---
src/main/java/org/springblade/modules/machining/mapper/MachiningMapper.java | 1
src/main/java/org/springblade/modules/process/dto/ProcessDTO.java | 34 +++
src/main/java/sql/process.menu.sql | 10 +
src/main/java/org/springblade/modules/process/entity/Process.java | 72 ++++++++
src/main/java/org/springblade/modules/process/controller/ProcessController.java | 136 +++++++++++++++
src/main/java/org/springblade/modules/process/vo/ProcessVO.java | 42 ++++
src/main/java/org/springblade/modules/machining/service/impl/MachiningServiceImpl.java | 7
src/main/java/org/springblade/modules/process/service/impl/ProcessServiceImpl.java | 41 ++++
src/main/java/org/springblade/modules/farmplant/mapper/FarmProductStockMapper.xml | 10
src/main/java/org/springblade/modules/process/service/IProcessService.java | 41 ++++
src/main/java/org/springblade/modules/sale/controller/SaleController.java | 2
src/main/java/org/springblade/common/config/BladeConfiguration.java | 1
src/main/java/org/springblade/modules/machining/mapper/MachiningMapper.xml | 10 +
src/main/java/org/springblade/modules/machining/controller/MachiningController.java | 14 +
src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java | 4
src/main/java/org/springblade/modules/sale/vo/SaleVO.java | 4
src/main/java/org/springblade/modules/machining/service/IMachiningService.java | 4
src/main/java/org/springblade/modules/process/mapper/ProcessMapper.java | 42 ++++
src/main/java/org/springblade/modules/process/mapper/ProcessMapper.xml | 33 +++
19 files changed, 496 insertions(+), 12 deletions(-)
diff --git a/src/main/java/org/springblade/common/config/BladeConfiguration.java b/src/main/java/org/springblade/common/config/BladeConfiguration.java
index 3809125..66a57e2 100644
--- a/src/main/java/org/springblade/common/config/BladeConfiguration.java
+++ b/src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -65,6 +65,7 @@
secureRegistry.excludePathPatterns("/soldrecord/soldrecord/**");
secureRegistry.excludePathPatterns("/stockfactory/stockfactory/**");
secureRegistry.excludePathPatterns("/soldr/soldr/**");
+ secureRegistry.excludePathPatterns("/machining/machining/**");
secureRegistry.excludePathPatterns("/stockrecord/stockrecord/**");
secureRegistry.excludePathPatterns("/blade-resource/oss/endpoint/**");
return secureRegistry;
diff --git a/src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java b/src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java
index 2d299dd..41c8065 100644
--- a/src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java
+++ b/src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java
@@ -106,8 +106,8 @@
}
Kv authInfo1 = TokenUtil.createAuthInfo(userInfo);
String access_token = authInfo1.get("access_token").toString();
- // 存入redis并设置过期时间为30分钟
- bladeRedis.setEx(access_token, access_token, Duration.ofMinutes(1));
+ // 存入redis并设置过期时间为60分钟
+ bladeRedis.setEx(access_token, access_token, Duration.ofMinutes(60));
return TokenUtil.createAuthInfo(userInfo);
}
diff --git a/src/main/java/org/springblade/modules/farmplant/mapper/FarmProductStockMapper.xml b/src/main/java/org/springblade/modules/farmplant/mapper/FarmProductStockMapper.xml
index b5c0e40..3a5d10c 100644
--- a/src/main/java/org/springblade/modules/farmplant/mapper/FarmProductStockMapper.xml
+++ b/src/main/java/org/springblade/modules/farmplant/mapper/FarmProductStockMapper.xml
@@ -4,7 +4,7 @@
<!--自定义查询农产品库存分页数据-->
<select id="selectFarmProductStockPage" resultType="org.springblade.modules.farmplant.vo.FarmProductStockVO">
- select sfps.strain_id strainId,sfps.land_id,sum(sfps.weight) weight,ss.url,ss.strain_name strainName from
+ select sfps.id,sfps.strain_id strainId,sfps.land_id,sum(sfps.weight) weight,ss.url,ss.strain_name strainName from
sys_farm_product_stock sfps
left join sys_strain ss on ss.id = sfps.strain_id
where 1=1
@@ -26,7 +26,7 @@
<if test="farmProductStock.tenantId!=null and farmProductStock.tenantId!=''">
and sfps.tenant_id = #{farmProductStock.tenantId}
</if>
- group by sfps.strain_id,ss.url,ss.strain_name,sfps.land_id
+ group by sfps.id,sfps.strain_id,ss.url,ss.strain_name,sfps.land_id
</select>
<select id="selectFarmProductStockPages" resultType="org.springblade.modules.farmplant.vo.FarmProductStockVO">
@@ -58,7 +58,7 @@
<!--查询农产品库存数据-->
<select id="statisticsProduct" resultType="org.springblade.modules.farmplant.vo.FarmProductStockVO">
- select sfps.strain_id strainId,sum(sfps.weight) weight,ss.url,ss.strain_name strainName from
+ select sfps.id,sfps.strain_id strainId,sum(sfps.weight) weight,ss.url,ss.strain_name strainName from
sys_farm_product_stock sfps
left join sys_strain ss on ss.id = sfps.strain_id
where 1=1
@@ -357,12 +357,12 @@
FROM
sys_farm_product_stock
WHERE
- strain_id = #{id}
+ id = #{id}
</select>
<!--减去对应库存-->
<update id="stockReduce">
UPDATE sys_farm_product_stock SET weight = weight - #{sale}
WHERE
- strain_id = #{id}
+ id = #{id}
</update>
</mapper>
diff --git a/src/main/java/org/springblade/modules/machining/controller/MachiningController.java b/src/main/java/org/springblade/modules/machining/controller/MachiningController.java
index 9f7a0c9..22cd449 100644
--- a/src/main/java/org/springblade/modules/machining/controller/MachiningController.java
+++ b/src/main/java/org/springblade/modules/machining/controller/MachiningController.java
@@ -112,7 +112,7 @@
return R.status(machiningService.saveOrUpdate(machining));
}
-
+
/**
* 删除 加工管理
*/
@@ -123,5 +123,15 @@
return R.status(machiningService.deleteLogic(Func.toLongList(ids)));
}
-
+
+ /**
+ * 加工产品
+ * @return
+ */
+ @GetMapping("/selectInfo")
+ public R selectInfo() {
+ return R.data(machiningService.selectInfo());
+ }
+
+
}
diff --git a/src/main/java/org/springblade/modules/machining/mapper/MachiningMapper.java b/src/main/java/org/springblade/modules/machining/mapper/MachiningMapper.java
index 4d3bea8..18d7e76 100644
--- a/src/main/java/org/springblade/modules/machining/mapper/MachiningMapper.java
+++ b/src/main/java/org/springblade/modules/machining/mapper/MachiningMapper.java
@@ -38,5 +38,6 @@
* @return
*/
List<MachiningVO> selectMachiningPage(IPage page, MachiningVO machining);
+ List selectInfo();
}
diff --git a/src/main/java/org/springblade/modules/machining/mapper/MachiningMapper.xml b/src/main/java/org/springblade/modules/machining/mapper/MachiningMapper.xml
index 169adf9..8a187ca 100644
--- a/src/main/java/org/springblade/modules/machining/mapper/MachiningMapper.xml
+++ b/src/main/java/org/springblade/modules/machining/mapper/MachiningMapper.xml
@@ -20,7 +20,15 @@
<select id="selectMachiningPage" resultMap="machiningResultMap">
- select * from sys_machining where is_deleted = 0
+ select *
+ from sys_machining
+ where is_deleted = 0
+ </select>
+
+ <select id="selectInfo" resultType="java.util.HashMap">
+ SELECT id as processId, machining_type as processName
+ FROM `sys_machining`
+ WHERE is_deleted = 0
</select>
</mapper>
diff --git a/src/main/java/org/springblade/modules/machining/service/IMachiningService.java b/src/main/java/org/springblade/modules/machining/service/IMachiningService.java
index ba8b973..39e6f1a 100644
--- a/src/main/java/org/springblade/modules/machining/service/IMachiningService.java
+++ b/src/main/java/org/springblade/modules/machining/service/IMachiningService.java
@@ -21,6 +21,8 @@
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
/**
* 加工管理 服务类
*
@@ -37,5 +39,5 @@
* @return
*/
IPage<MachiningVO> selectMachiningPage(IPage<MachiningVO> page, MachiningVO machining);
-
+ List selectInfo();
}
diff --git a/src/main/java/org/springblade/modules/machining/service/impl/MachiningServiceImpl.java b/src/main/java/org/springblade/modules/machining/service/impl/MachiningServiceImpl.java
index db62596..c7c25e5 100644
--- a/src/main/java/org/springblade/modules/machining/service/impl/MachiningServiceImpl.java
+++ b/src/main/java/org/springblade/modules/machining/service/impl/MachiningServiceImpl.java
@@ -24,6 +24,8 @@
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
/**
* 加工管理 服务实现类
*
@@ -38,4 +40,9 @@
return page.setRecords(baseMapper.selectMachiningPage(page, machining));
}
+ @Override
+ public List selectInfo() {
+ return baseMapper.selectInfo();
+ }
+
}
diff --git a/src/main/java/org/springblade/modules/process/controller/ProcessController.java b/src/main/java/org/springblade/modules/process/controller/ProcessController.java
new file mode 100644
index 0000000..7e3cb38
--- /dev/null
+++ b/src/main/java/org/springblade/modules/process/controller/ProcessController.java
@@ -0,0 +1,136 @@
+/*
+ * 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.modules.process.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.springblade.core.tool.utils.StringUtil;
+import org.springblade.modules.farmplant.service.FarmProductStockService;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.process.entity.Process;
+import org.springblade.modules.process.vo.ProcessVO;
+import org.springblade.modules.process.service.IProcessService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 加工记录表 控制器
+ *
+ * @author BladeX
+ * @since 2022-07-15
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/process/process")
+@Api(value = "加工记录表", tags = "加工记录表接口")
+public class ProcessController extends BladeController {
+
+ private final IProcessService processService;
+ private final FarmProductStockService farmProductStockService;
+ /**
+ * 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "详情", notes = "传入process")
+ public R<Process> detail(Process process) {
+ Process detail = processService.getOne(Condition.getQueryWrapper(process));
+ return R.data(detail);
+ }
+
+ /**
+ * 分页 加工记录表
+ */
+ @GetMapping("/list")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入process")
+ public R<IPage<Process>> list(Process process, Query query) {
+ IPage<Process> pages = processService.page(Condition.getPage(query), Condition.getQueryWrapper(process));
+ return R.data(pages);
+ }
+
+ /**
+ * 自定义分页 加工记录表
+ */
+ @GetMapping("/page")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "分页", notes = "传入process")
+ public R<IPage<ProcessVO>> page(ProcessVO process, Query query) {
+ IPage<ProcessVO> pages = processService.selectProcessPage(Condition.getPage(query), process);
+ return R.data(pages);
+ }
+
+ /**
+ * 新增 加工记录表
+ */
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 4)
+ @ApiOperation(value = "新增", notes = "传入process")
+ public R save(@Valid @RequestBody Process process) {
+ return R.status(processService.save(process));
+ }
+
+ /**
+ * 修改 加工记录表
+ */
+ @PostMapping("/update")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "修改", notes = "传入process")
+ public R update(@Valid @RequestBody Process process) {
+ return R.status(processService.updateById(process));
+ }
+
+ /**
+ * 新增或修改 加工记录表
+ */
+ @PostMapping("/submit")
+ @ApiOperationSupport(order = 6)
+ @ApiOperation(value = "新增或修改", notes = "传入process")
+ public R submit(@Valid @RequestBody ProcessVO process) {
+ boolean res = farmProductStockService.stockCompare(process.getSaleNum(),process.getProid());
+ if (!res){
+ throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("当前库存不足!"));
+ }else {
+ //库存充足,减去相应库存
+ farmProductStockService.stockReduce(process.getSaleNum(),process.getProid());
+ }
+ return R.status(processService.saveOrUpdate(process));
+ }
+
+
+ /**
+ * 删除 加工记录表
+ */
+ @PostMapping("/remove")
+ @ApiOperationSupport(order = 7)
+ @ApiOperation(value = "逻辑删除", notes = "传入ids")
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+ return R.status(processService.deleteLogic(Func.toLongList(ids)));
+ }
+
+
+}
diff --git a/src/main/java/org/springblade/modules/process/dto/ProcessDTO.java b/src/main/java/org/springblade/modules/process/dto/ProcessDTO.java
new file mode 100644
index 0000000..b7cfeff
--- /dev/null
+++ b/src/main/java/org/springblade/modules/process/dto/ProcessDTO.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.modules.process.dto;
+
+import org.springblade.modules.process.entity.Process;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 加工记录表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-07-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProcessDTO extends Process {
+ private static final long serialVersionUID = 1L;
+
+}
diff --git a/src/main/java/org/springblade/modules/process/entity/Process.java b/src/main/java/org/springblade/modules/process/entity/Process.java
new file mode 100644
index 0000000..75515e2
--- /dev/null
+++ b/src/main/java/org/springblade/modules/process/entity/Process.java
@@ -0,0 +1,72 @@
+/*
+ * 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.modules.process.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * 加工记录表实体类
+ *
+ * @author BladeX
+ * @since 2022-07-15
+ */
+@Data
+@TableName("sys_process")
+@EqualsAndHashCode(callSuper = true)
+public class Process extends BaseEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 品种id
+ */
+ private String strainId;
+ /**
+ * 加工时间
+ */
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ private Date saleTime;
+ /**
+ * 加工数量
+ */
+ private Double saleNum;
+ /**
+ * 加工产品id
+ */
+ private String processId;
+ /**
+ * 产品数量
+ */
+ private Double processNum;
+ /**
+ * 地块id
+ */
+ private String landId;
+
+
+}
diff --git a/src/main/java/org/springblade/modules/process/mapper/ProcessMapper.java b/src/main/java/org/springblade/modules/process/mapper/ProcessMapper.java
new file mode 100644
index 0000000..51fb844
--- /dev/null
+++ b/src/main/java/org/springblade/modules/process/mapper/ProcessMapper.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.modules.process.mapper;
+
+import org.springblade.modules.process.entity.Process;
+import org.springblade.modules.process.vo.ProcessVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 加工记录表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-07-15
+ */
+public interface ProcessMapper extends BaseMapper<Process> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param process
+ * @return
+ */
+ List<ProcessVO> selectProcessPage(IPage page, ProcessVO process);
+
+}
diff --git a/src/main/java/org/springblade/modules/process/mapper/ProcessMapper.xml b/src/main/java/org/springblade/modules/process/mapper/ProcessMapper.xml
new file mode 100644
index 0000000..a54cc03
--- /dev/null
+++ b/src/main/java/org/springblade/modules/process/mapper/ProcessMapper.xml
@@ -0,0 +1,33 @@
+<?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.modules.process.mapper.ProcessMapper">
+
+ <!-- 通用查询映射结果 -->
+ <resultMap id="processResultMap" type="org.springblade.modules.process.vo.ProcessVO">
+ <result column="id" property="id"/>
+ <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="status" property="status"/>
+ <result column="is_deleted" property="isDeleted"/>
+ <result column="strain_id" property="strainId"/>
+ <result column="sale_time" property="saleTime"/>
+ <result column="sale_num" property="saleNum"/>
+ <result column="process_id" property="processId"/>
+ <result column="process_num" property="processNum"/>
+ <result column="land_id" property="landId"/>
+ </resultMap>
+
+
+ <select id="selectProcessPage" resultMap="processResultMap">
+ SELECT p.*,
+ m.machining_type as processName,
+ m.machining_tp AS tpurl
+ FROM sys_process p
+ LEFT JOIN sys_machining m ON m.id = p.process_id
+ WHERE p.is_deleted = 0
+ </select>
+
+</mapper>
diff --git a/src/main/java/org/springblade/modules/process/service/IProcessService.java b/src/main/java/org/springblade/modules/process/service/IProcessService.java
new file mode 100644
index 0000000..51eed46
--- /dev/null
+++ b/src/main/java/org/springblade/modules/process/service/IProcessService.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.modules.process.service;
+
+import org.springblade.modules.process.entity.Process;
+import org.springblade.modules.process.vo.ProcessVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 加工记录表 服务类
+ *
+ * @author BladeX
+ * @since 2022-07-15
+ */
+public interface IProcessService extends BaseService<Process> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param process
+ * @return
+ */
+ IPage<ProcessVO> selectProcessPage(IPage<ProcessVO> page, ProcessVO process);
+
+}
diff --git a/src/main/java/org/springblade/modules/process/service/impl/ProcessServiceImpl.java b/src/main/java/org/springblade/modules/process/service/impl/ProcessServiceImpl.java
new file mode 100644
index 0000000..7b53dcc
--- /dev/null
+++ b/src/main/java/org/springblade/modules/process/service/impl/ProcessServiceImpl.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.modules.process.service.impl;
+
+import org.springblade.modules.process.entity.Process;
+import org.springblade.modules.process.vo.ProcessVO;
+import org.springblade.modules.process.mapper.ProcessMapper;
+import org.springblade.modules.process.service.IProcessService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 加工记录表 服务实现类
+ *
+ * @author BladeX
+ * @since 2022-07-15
+ */
+@Service
+public class ProcessServiceImpl extends BaseServiceImpl<ProcessMapper, Process> implements IProcessService {
+
+ @Override
+ public IPage<ProcessVO> selectProcessPage(IPage<ProcessVO> page, ProcessVO process) {
+ return page.setRecords(baseMapper.selectProcessPage(page, process));
+ }
+
+}
diff --git a/src/main/java/org/springblade/modules/process/vo/ProcessVO.java b/src/main/java/org/springblade/modules/process/vo/ProcessVO.java
new file mode 100644
index 0000000..8cf266c
--- /dev/null
+++ b/src/main/java/org/springblade/modules/process/vo/ProcessVO.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.modules.process.vo;
+
+import org.springblade.modules.process.entity.Process;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 加工记录表视图实体类
+ *
+ * @author BladeX
+ * @since 2022-07-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProcessVO extends Process {
+ private static final long serialVersionUID = 1L;
+ /**
+ * 库存量主键id
+ */
+ private String proid;
+ /**
+ * 加工品图片
+ */
+ private String tpurl;
+ private String processName;
+}
diff --git a/src/main/java/org/springblade/modules/sale/controller/SaleController.java b/src/main/java/org/springblade/modules/sale/controller/SaleController.java
index 5582a92..187b23e 100644
--- a/src/main/java/org/springblade/modules/sale/controller/SaleController.java
+++ b/src/main/java/org/springblade/modules/sale/controller/SaleController.java
@@ -112,7 +112,7 @@
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入sale")
- public R submit(@Valid @RequestBody Sale sale) {
+ public R submit(@Valid @RequestBody SaleVO sale) {
boolean res = farmProductStockService.stockCompare(sale.getSaleNum(),sale.getStrainId());
if (!res){
throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("当前库存不足!"));
diff --git a/src/main/java/org/springblade/modules/sale/vo/SaleVO.java b/src/main/java/org/springblade/modules/sale/vo/SaleVO.java
index 5065874..8e0687f 100644
--- a/src/main/java/org/springblade/modules/sale/vo/SaleVO.java
+++ b/src/main/java/org/springblade/modules/sale/vo/SaleVO.java
@@ -64,4 +64,8 @@
* 农场id
*/
private String farmId;
+ /**
+ * 库存量主键id
+ */
+ private String proid;
}
diff --git a/src/main/java/sql/process.menu.sql b/src/main/java/sql/process.menu.sql
new file mode 100644
index 0000000..9bf5da6
--- /dev/null
+++ b/src/main/java/sql/process.menu.sql
@@ -0,0 +1,10 @@
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1547829190508789761', 1123598815738675201, 'process', '加工产品', 'menu', '/process/process', NULL, 1, 1, 0, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1547829190508789762', '1547829190508789761', 'process_add', '新增', 'add', '/process/process/add', 'plus', 1, 2, 1, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1547829190508789763', '1547829190508789761', 'process_edit', '修改', 'edit', '/process/process/edit', 'form', 2, 2, 2, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1547829190508789764', '1547829190508789761', 'process_delete', '删除', 'delete', '/api/process/process/remove', 'delete', 3, 2, 3, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1547829190508789765', '1547829190508789761', 'process_view', '查看', 'view', '/process/process/view', 'file-text', 4, 2, 2, 1, NULL, 0);
--
Gitblit v1.9.3