From 12e137374853d081aa5898f8784f539812592657 Mon Sep 17 00:00:00 2001 From: wangh <123456> Date: Wed, 20 Jul 2022 10:30:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E9=97=A8=E4=BD=93?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/broad/MTKController.java | 37 +++++ .../src/main/resources/application.yml | 2 +- .../main/resources/templates/broad/fp.html | 24 +-- .../java/com/ruoyi/common/config/Global.java | 124 +++++++++++++++ .../system/controller/BaseTeamController.java | 150 ++++++++++++++++++ .../com/ruoyi/system/domain/BaseTeam.java | 80 ++++++++++ .../ruoyi/system/mapper/BaseTeamMapper.java | 61 +++++++ .../system/service/IBaseTeamService.java | 61 +++++++ .../service/impl/BaseTeamServiceImpl.java | 96 +++++++++++ .../mapper/system/BaseTeamMapper.xml | 72 +++++++++ .../templates/system/base_team/add.html | 69 ++++++++ .../templates/system/base_team/base_team.html | 101 ++++++++++++ .../templates/system/base_team/edit.html | 39 +++++ 13 files changed, 903 insertions(+), 13 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/MTKController.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/config/Global.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/controller/BaseTeamController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseTeam.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseTeamMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/IBaseTeamService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BaseTeamServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/BaseTeamMapper.xml create mode 100644 ruoyi-system/src/main/resources/templates/system/base_team/add.html create mode 100644 ruoyi-system/src/main/resources/templates/system/base_team/base_team.html create mode 100644 ruoyi-system/src/main/resources/templates/system/base_team/edit.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/MTKController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/MTKController.java new file mode 100644 index 0000000..7136af2 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/MTKController.java @@ -0,0 +1,37 @@ +package com.ruoyi.web.controller.broad; + +import com.alibaba.fastjson.JSONArray; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.json.JSONObject; +import com.ruoyi.system.domain.BaseTeam; +import com.ruoyi.system.service.IBaseTeamService; +import com.ruoyi.system.service.IBroadDataService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; + +/** + * @author wanghao + * @date 2022/7/20 10:24 + */ +@Controller("/broad/mtk") +@ApiOperation("门体库") +@ResponseBody +public class MTKController { + @Autowired + IBroadDataService service; + + @Autowired + private IBaseTeamService baseTeamService; + + @PostMapping("/team6s") + public String list(BaseTeam baseTeam) { + List list = baseTeamService.selectBaseTeamList(baseTeam); + return JSONArray.toJSONString(list); + } + +} diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index c097ca1..3070cec 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -9,7 +9,7 @@ ruoyi: # 实例演示开关 demoEnabled: false # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) - profile: D:/ruoyi/uploadPath + profile: D:/haiwei/uploadPath # 获取ip地址开关 addressEnabled: false diff --git a/ruoyi-admin/src/main/resources/templates/broad/fp.html b/ruoyi-admin/src/main/resources/templates/broad/fp.html index 9c61784..4a345bd 100644 --- a/ruoyi-admin/src/main/resources/templates/broad/fp.html +++ b/ruoyi-admin/src/main/resources/templates/broad/fp.html @@ -453,18 +453,18 @@ } // 当班计划/实际产量/当班差异 - // autoUpdate('/broad/fp/selectFpOrderInfo', INTERVAL, data => { - // // let p = [data[1], data[0][2], data[0][3]] - // let p = [data.planned_number, data.quantity_number, data.planned_number - data.quantity_number] - // - // for (let i in p) { - // updateSplitBlocks(p[i], selectors[i]) - // } - // }) - // let a = [ - // {name: '当班计划', qty: '123'}, - // {name: '实际产量', qty: '123'}, - // ] + autoUpdate('/broad/fp/selectFpOrderInfo', INTERVAL, data => { + // let p = [data[1], data[0][2], data[0][3]] + let p = [data.planned_number, data.quantity_number, data.planned_number - data.quantity_number] + + for (let i in p) { + updateSplitBlocks(p[i], selectors[i]) + } + }) + let a = [ + {name: '当班计划', qty: '123'}, + {name: '实际产量', qty: '123'}, + ] // 生产统计数据 autoUpdate('/broad/fp/selectStationHourInfo', INTERVAL, data => { $('#bottom-left').remove() diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/config/Global.java b/ruoyi-common/src/main/java/com/ruoyi/common/config/Global.java new file mode 100644 index 0000000..38fe7e8 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/config/Global.java @@ -0,0 +1,124 @@ +package com.ruoyi.common.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * 全局配置类 + * + * @author ruoyi + */ +@Component +@ConfigurationProperties(prefix = "ruoyi") +public class Global +{ + /** 项目名称 */ + private static String name; + + /** 版本 */ + private static String version; + + /** 版权年份 */ + private static String copyrightYear; + + /** 实例演示开关 */ + private static boolean demoEnabled; + + /** 上传路径 */ + private static String profile; + + /** 获取地址开关 */ + private static boolean addressEnabled; + + public static String getName() + { + return name; + } + + public void setName(String name) + { + Global.name = name; + } + + public static String getVersion() + { + return version; + } + + public void setVersion(String version) + { + Global.version = version; + } + + public static String getCopyrightYear() + { + return copyrightYear; + } + + public void setCopyrightYear(String copyrightYear) + { + Global.copyrightYear = copyrightYear; + } + + public static boolean isDemoEnabled() + { + return demoEnabled; + } + + public void setDemoEnabled(boolean demoEnabled) + { + Global.demoEnabled = demoEnabled; + } + + public static String getProfile() + { + return profile; + } + + public void setProfile(String profile) + { + Global.profile = profile; + } + + public static boolean isAddressEnabled() + { + return addressEnabled; + } + + public void setAddressEnabled(boolean addressEnabled) + { + Global.addressEnabled = addressEnabled; + } + + /** + * 获取头像上传路径 + */ + public static String getAvatarPath() + { + return getProfile() + "/avatar"; + } + + /** + * 获取下载路径 + */ + public static String getDownloadPath() + { + return getProfile() + "/download/"; + } + + /** + * 获取上传路径 + */ + public static String getUploadPath() + { + return getProfile() + "/upload"; + } + + /** + * 获取上传路径修复 + */ + public static String getUploadPathRecorrect() + { + return getProfile() + "/"; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/BaseTeamController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/BaseTeamController.java new file mode 100644 index 0000000..629e930 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/BaseTeamController.java @@ -0,0 +1,150 @@ +package com.ruoyi.system.controller; + +import java.io.IOException; +import java.util.List; + +import com.ruoyi.common.utils.file.FileUploadUtils; + + +import com.ruoyi.common.config.Global; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.BaseTeam; +import com.ruoyi.system.service.IBaseTeamService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 班组6S统计维护Controller + * + * @author ruoyi + * @date 2022-07-20 + */ +@Controller +@RequestMapping("/system/base_team") +public class BaseTeamController extends BaseController +{ + private String prefix = "system/base_team"; + + @Autowired + private IBaseTeamService baseTeamService; + + @RequiresPermissions("system:base_team:view") + @GetMapping() + public String base_team() + { + return prefix + "/base_team"; + } + + /** + * 查询班组6S统计维护列表 + */ + @RequiresPermissions("system:base_team:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(BaseTeam baseTeam) + { + startPage(); + List list = baseTeamService.selectBaseTeamList(baseTeam); + return getDataTable(list); + } + + /** + * 导出班组6S统计维护列表 + */ + @RequiresPermissions("system:base_team:export") + @Log(title = "班组6S统计维护", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(BaseTeam baseTeam) + { + List list = baseTeamService.selectBaseTeamList(baseTeam); + ExcelUtil util = new ExcelUtil(BaseTeam.class); + return util.exportExcel(list, "班组6S统计维护数据"); + } + + /** + * 新增班组6S统计维护 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存班组6S统计维护 + */ + @RequiresPermissions("system:base_team:add") + @Log(title = "班组6S统计维护", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(MultipartFile file,BaseTeam baseTeam) + { + + + String filePath = Global.getUploadPath(); + try { + String pathName = FileUploadUtils.upload(filePath, file); + List list = baseTeamService.selectBaseTeamList(null); + int id=0; + if (list!=null||!list.isEmpty()){ + id= Math.toIntExact(list.get(list.size() - 1).getId())+1; + } + baseTeam.setId(Long.valueOf(id)); + baseTeam.setPath(pathName); + return toAjax(baseTeamService.insertBaseTeam(baseTeam)); + } catch (IOException e) { + e.printStackTrace(); + } + return error(); + } + + /** + * 修改班组6S统计维护 + */ + @RequiresPermissions("system:base_team:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + BaseTeam baseTeam = baseTeamService.selectBaseTeamById(id); + mmap.put("baseTeam", baseTeam); + return prefix + "/edit"; + } + + /** + * 修改保存班组6S统计维护 + */ + @RequiresPermissions("system:base_team:edit") + @Log(title = "班组6S统计维护", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(BaseTeam baseTeam) + { + return toAjax(baseTeamService.updateBaseTeam(baseTeam)); + } + + /** + * 删除班组6S统计维护 + */ + @RequiresPermissions("system:base_team:remove") + @Log(title = "班组6S统计维护", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(baseTeamService.deleteBaseTeamByIds(ids)); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseTeam.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseTeam.java new file mode 100644 index 0000000..fee28e3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BaseTeam.java @@ -0,0 +1,80 @@ +package com.ruoyi.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 班组6S统计维护对象 base_team_s + * + * @author ruoyi + * @date 2022-07-20 + */ +public class BaseTeam extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 名称 */ + @Excel(name = "名称") + private String teamName; + + /** 分数 */ + @Excel(name = "分数") + private Long teamNumber; + + /** 图片 */ + @Excel(name = "图片") + private String path; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTeamName(String teamName) + { + this.teamName = teamName; + } + + public String getTeamName() + { + return teamName; + } + public void setTeamNumber(Long teamNumber) + { + this.teamNumber = teamNumber; + } + + public Long getTeamNumber() + { + return teamNumber; + } + public void setPath(String path) + { + this.path = path; + } + + public String getPath() + { + return path; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("createTime", getCreateTime()) + .append("id", getId()) + .append("teamName", getTeamName()) + .append("teamNumber", getTeamNumber()) + .append("path", getPath()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseTeamMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseTeamMapper.java new file mode 100644 index 0000000..6a7c9ed --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseTeamMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.BaseTeam; + +/** + * 班组6S统计维护Mapper接口 + * + * @author ruoyi + * @date 2022-07-20 + */ +public interface BaseTeamMapper +{ + /** + * 查询班组6S统计维护 + * + * @param id 班组6S统计维护主键 + * @return 班组6S统计维护 + */ + public BaseTeam selectBaseTeamById(Long id); + + /** + * 查询班组6S统计维护列表 + * + * @param baseTeam 班组6S统计维护 + * @return 班组6S统计维护集合 + */ + public List selectBaseTeamList(BaseTeam baseTeam); + + /** + * 新增班组6S统计维护 + * + * @param baseTeam 班组6S统计维护 + * @return 结果 + */ + public int insertBaseTeam(BaseTeam baseTeam); + + /** + * 修改班组6S统计维护 + * + * @param baseTeam 班组6S统计维护 + * @return 结果 + */ + public int updateBaseTeam(BaseTeam baseTeam); + + /** + * 删除班组6S统计维护 + * + * @param id 班组6S统计维护主键 + * @return 结果 + */ + public int deleteBaseTeamById(Long id); + + /** + * 批量删除班组6S统计维护 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBaseTeamByIds(String[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBaseTeamService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBaseTeamService.java new file mode 100644 index 0000000..d762ea5 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBaseTeamService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.BaseTeam; + +/** + * 班组6S统计维护Service接口 + * + * @author ruoyi + * @date 2022-07-20 + */ +public interface IBaseTeamService +{ + /** + * 查询班组6S统计维护 + * + * @param id 班组6S统计维护主键 + * @return 班组6S统计维护 + */ + public BaseTeam selectBaseTeamById(Long id); + + /** + * 查询班组6S统计维护列表 + * + * @param baseTeam 班组6S统计维护 + * @return 班组6S统计维护集合 + */ + public List selectBaseTeamList(BaseTeam baseTeam); + + /** + * 新增班组6S统计维护 + * + * @param baseTeam 班组6S统计维护 + * @return 结果 + */ + public int insertBaseTeam(BaseTeam baseTeam); + + /** + * 修改班组6S统计维护 + * + * @param baseTeam 班组6S统计维护 + * @return 结果 + */ + public int updateBaseTeam(BaseTeam baseTeam); + + /** + * 批量删除班组6S统计维护 + * + * @param ids 需要删除的班组6S统计维护主键集合 + * @return 结果 + */ + public int deleteBaseTeamByIds(String ids); + + /** + * 删除班组6S统计维护信息 + * + * @param id 班组6S统计维护主键 + * @return 结果 + */ + public int deleteBaseTeamById(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BaseTeamServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BaseTeamServiceImpl.java new file mode 100644 index 0000000..67c4051 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BaseTeamServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.BaseTeamMapper; +import com.ruoyi.system.domain.BaseTeam; +import com.ruoyi.system.service.IBaseTeamService; +import com.ruoyi.common.core.text.Convert; + +/** + * 班组6S统计维护Service业务层处理 + * + * @author ruoyi + * @date 2022-07-20 + */ +@Service +public class BaseTeamServiceImpl implements IBaseTeamService +{ + @Autowired + private BaseTeamMapper baseTeamMapper; + + /** + * 查询班组6S统计维护 + * + * @param id 班组6S统计维护主键 + * @return 班组6S统计维护 + */ + @Override + public BaseTeam selectBaseTeamById(Long id) + { + return baseTeamMapper.selectBaseTeamById(id); + } + + /** + * 查询班组6S统计维护列表 + * + * @param baseTeam 班组6S统计维护 + * @return 班组6S统计维护 + */ + @Override + public List selectBaseTeamList(BaseTeam baseTeam) + { + return baseTeamMapper.selectBaseTeamList(baseTeam); + } + + /** + * 新增班组6S统计维护 + * + * @param baseTeam 班组6S统计维护 + * @return 结果 + */ + @Override + public int insertBaseTeam(BaseTeam baseTeam) + { + baseTeam.setCreateTime(DateUtils.getNowDate()); + return baseTeamMapper.insertBaseTeam(baseTeam); + } + + /** + * 修改班组6S统计维护 + * + * @param baseTeam 班组6S统计维护 + * @return 结果 + */ + @Override + public int updateBaseTeam(BaseTeam baseTeam) + { + return baseTeamMapper.updateBaseTeam(baseTeam); + } + + /** + * 批量删除班组6S统计维护 + * + * @param ids 需要删除的班组6S统计维护主键 + * @return 结果 + */ + @Override + public int deleteBaseTeamByIds(String ids) + { + return baseTeamMapper.deleteBaseTeamByIds(Convert.toStrArray(ids)); + } + + /** + * 删除班组6S统计维护信息 + * + * @param id 班组6S统计维护主键 + * @return 结果 + */ + @Override + public int deleteBaseTeamById(Long id) + { + return baseTeamMapper.deleteBaseTeamById(id); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/BaseTeamMapper.xml b/ruoyi-system/src/main/resources/mapper/system/BaseTeamMapper.xml new file mode 100644 index 0000000..a5ed9db --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/BaseTeamMapper.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + select create_time, id, team_name, team_number, path from base_team_s + + + + + + + + + SELECT seq_base_team_s.NEXTVAL as id FROM DUAL + + insert into base_team_s + + create_time, + id, + team_name, + team_number, + path, + + + #{createTime}, + #{id}, + #{teamName}, + #{teamNumber}, + #{path}, + + + + + update base_team_s + + create_time = #{createTime}, + team_name = #{teamName}, + team_number = #{teamNumber}, + path = #{path}, + + where id = #{id} + + + + delete from base_team_s where id = #{id} + + + + delete from base_team_s where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/templates/system/base_team/add.html b/ruoyi-system/src/main/resources/templates/system/base_team/add.html new file mode 100644 index 0000000..0f794c4 --- /dev/null +++ b/ruoyi-system/src/main/resources/templates/system/base_team/add.html @@ -0,0 +1,69 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+
+
+
+ + 清除 +
+
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/templates/system/base_team/base_team.html b/ruoyi-system/src/main/resources/templates/system/base_team/base_team.html new file mode 100644 index 0000000..50b5a4e --- /dev/null +++ b/ruoyi-system/src/main/resources/templates/system/base_team/base_team.html @@ -0,0 +1,101 @@ + + + + + + +
+
+ + + + + + + + + + + + + + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/templates/system/base_team/edit.html b/ruoyi-system/src/main/resources/templates/system/base_team/edit.html new file mode 100644 index 0000000..f6bdc7d --- /dev/null +++ b/ruoyi-system/src/main/resources/templates/system/base_team/edit.html @@ -0,0 +1,39 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ + + + \ No newline at end of file