From 877a520c8cb31f29f1c3d6cd4a4f869b3c7e56aa Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Thu, 25 Jul 2024 11:41:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basis/controller/TeamController.java | 14 +- .../bonus/aqgqj/basis/entity/vo/BaseTeam.java | 1 + .../exper/contoller/DeviceController.java | 139 ++++++++++++ .../com/bonus/aqgqj/exper/dao/DeviceDao.java | 62 ++++++ .../aqgqj/exper/entity/vo/ExperDevice.java | 78 +++++++ .../aqgqj/exper/service/DeviceService.java | 60 ++++++ .../exper/service/impl/DeviceServiceImpl.java | 83 ++++++++ .../controller/PrimaryDataController.java | 58 +++++ .../aqgqj/primaryData/dao/PrimaryDataDao.java | 62 ++++++ .../service/PrimaryDataService.java | 61 ++++++ .../service/impl/PrimaryDataServiceImpl.java | 84 ++++++++ .../resources/mappers/exper/DeviceMapper.xml | 75 +++++++ .../mappers/primaryData/PrimaryDataMapper.xml | 54 +++++ .../js/basis/child/teamConfigDataFormTable.js | 199 ------------------ .../static/js/basis/customAddDeptForm.js | 177 ---------------- .../static/js/basis/customAddForm.js | 47 ++++- src/main/resources/static/js/basis/team.js | 114 +--------- .../pages/basis/child/teamConfigDataForm.html | 52 +++++ .../static/pages/basis/customAddDeptForm.html | 88 ++++++++ .../static/pages/basis/customAddForm.html | 33 ++- .../static/pages/exper/deviceAddForm.html | 71 +++++++ .../deviceList.html} | 37 +--- .../child/primaryDataList.html} | 18 +- .../static/pages/primaryData/primary.html | 70 ++++++ 24 files changed, 1196 insertions(+), 541 deletions(-) create mode 100644 src/main/java/com/bonus/aqgqj/exper/contoller/DeviceController.java create mode 100644 src/main/java/com/bonus/aqgqj/exper/dao/DeviceDao.java create mode 100644 src/main/java/com/bonus/aqgqj/exper/entity/vo/ExperDevice.java create mode 100644 src/main/java/com/bonus/aqgqj/exper/service/DeviceService.java create mode 100644 src/main/java/com/bonus/aqgqj/exper/service/impl/DeviceServiceImpl.java create mode 100644 src/main/java/com/bonus/aqgqj/primaryData/controller/PrimaryDataController.java create mode 100644 src/main/java/com/bonus/aqgqj/primaryData/dao/PrimaryDataDao.java create mode 100644 src/main/java/com/bonus/aqgqj/primaryData/service/PrimaryDataService.java create mode 100644 src/main/java/com/bonus/aqgqj/primaryData/service/impl/PrimaryDataServiceImpl.java create mode 100644 src/main/resources/mappers/exper/DeviceMapper.xml create mode 100644 src/main/resources/mappers/primaryData/PrimaryDataMapper.xml delete mode 100644 src/main/resources/static/js/basis/child/teamConfigDataFormTable.js delete mode 100644 src/main/resources/static/js/basis/customAddDeptForm.js create mode 100644 src/main/resources/static/pages/basis/child/teamConfigDataForm.html create mode 100644 src/main/resources/static/pages/basis/customAddDeptForm.html create mode 100644 src/main/resources/static/pages/exper/deviceAddForm.html rename src/main/resources/static/pages/{testReport/testReportMge.html => exper/deviceList.html} (58%) rename src/main/resources/static/pages/{testReport/child/testReportForm.html => primaryData/child/primaryDataList.html} (67%) create mode 100644 src/main/resources/static/pages/primaryData/primary.html diff --git a/src/main/java/com/bonus/aqgqj/basis/controller/TeamController.java b/src/main/java/com/bonus/aqgqj/basis/controller/TeamController.java index 62e3141..6fabfff 100644 --- a/src/main/java/com/bonus/aqgqj/basis/controller/TeamController.java +++ b/src/main/java/com/bonus/aqgqj/basis/controller/TeamController.java @@ -28,7 +28,7 @@ import java.util.List; /** * 用户相关接口 */ -@Api(tags = "用户") +@Api(tags = "班组") @RestController @RequestMapping("/teams/") public class TeamController { @@ -122,10 +122,14 @@ public class TeamController { @PreAuthorize("@pms.hasPermission('base:team:del')") public ServerResponse delTeam(EncryptedReq data) { try { - if (teamService.delTeam(data.getData().getTeamId())== 1){ - return ServerResponse.createBySuccessMsg("注销成功"); - }else { - return ServerResponse.createErroe("注销失败"); + if(data.getData().getCountuser()!=0){ + return ServerResponse.createBySuccessMsg("该班组人数不为0,无法删除"); + }else{ + if (teamService.delTeam(data.getData().getTeamId())== 1){ + return ServerResponse.createBySuccessMsg("删除成功"); + }else { + return ServerResponse.createErroe("删除失败"); + } } }catch (Exception e){ log.error(e.toString(),e); diff --git a/src/main/java/com/bonus/aqgqj/basis/entity/vo/BaseTeam.java b/src/main/java/com/bonus/aqgqj/basis/entity/vo/BaseTeam.java index 58108e0..adb7c06 100644 --- a/src/main/java/com/bonus/aqgqj/basis/entity/vo/BaseTeam.java +++ b/src/main/java/com/bonus/aqgqj/basis/entity/vo/BaseTeam.java @@ -26,6 +26,7 @@ public class BaseTeam extends PageEntity { private int delFlag; + private int countuser; public interface Status { int DISABLED = 0; diff --git a/src/main/java/com/bonus/aqgqj/exper/contoller/DeviceController.java b/src/main/java/com/bonus/aqgqj/exper/contoller/DeviceController.java new file mode 100644 index 0000000..a1090b9 --- /dev/null +++ b/src/main/java/com/bonus/aqgqj/exper/contoller/DeviceController.java @@ -0,0 +1,139 @@ +package com.bonus.aqgqj.exper.contoller; + +import com.bonus.aqgqj.annotation.DecryptAndVerify; +import com.bonus.aqgqj.annotation.LogAnnotation; +import com.bonus.aqgqj.exper.dao.DeviceDao; +import com.bonus.aqgqj.exper.entity.vo.ExperDevice; +import com.bonus.aqgqj.exper.service.DeviceService; +import com.bonus.aqgqj.system.vo.EncryptedReq; +import com.bonus.aqgqj.utils.ServerResponse; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import io.swagger.annotations.Api; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + + + +@Api(tags = "实验") +@RestController +@RequestMapping("/expers/") +public class DeviceController { + + private static final Logger log = LoggerFactory.getLogger("adminLogger"); + + @Autowired + private DeviceService deviceService; + @Resource + private DeviceDao deviceDao; + + /** + * 根据关键词获取实验设备列表 + * @param data + * @return + */ + @PostMapping(value = "getList") + @DecryptAndVerify(decryptedClass = ExperDevice.class)//加解密统一管理 + @LogAnnotation(operModul = "实验管理-实验设备管理", operation = "查询实验设备列表", operDesc = "系统级事件",operType="查询") + @PreAuthorize("@pms.hasPermission('exper:device:query')" ) + public ServerResponse listDevices(EncryptedReq data) { + PageHelper.startPage(data.getData().getPage(), data.getData().getLimit()); + try { + List list = deviceService.list(data.getData()); + PageInfo pageInfo = new PageInfo<>(list); + return ServerResponse.createSuccessPage(pageInfo,data.getData().getPage(),data.getData().getLimit()); + } catch (Exception e) { + log.error(e.toString(),e); + } + return ServerResponse.createErrorPage(data.getData().getPage(),data.getData().getLimit()); + } + + /** + * 根据实验设备id获取信息 + * @param data + * @return + */ + @PostMapping(value = "getDeviceId") + @DecryptAndVerify(decryptedClass = ExperDevice.class)//加解密统一管理 + @PreAuthorize("@pms.hasPermission('exper:device:query')" ) + public ServerResponse getDeviceId(EncryptedReq data) { + return deviceService.getDeviceId(data.getData()); + } + + /** + * 修改实验设备 + * @param data + * @return + */ + @PostMapping(value = "updateDevice") + @DecryptAndVerify(decryptedClass = ExperDevice.class)//加解密统一管理 + @LogAnnotation(operModul = "实验管理-实验设备管理", operation = "修改实验设备", operDesc = "系统级事件",operType="修改") + @PreAuthorize("@pms.hasPermission('exper:device:update')") + public ServerResponse updateDevice(EncryptedReq data) { + try { + ExperDevice u = deviceService.getDevice(data.getData().getDevName(),data.getData().getDevId()); + if (u != null) { + return ServerResponse.createErroe("设备名称 “"+data.getData().getDevName() + "” 已存在"); + } + deviceService.updateDevice(data.getData()); + return ServerResponse.createBySuccessMsg("操作成功"); + }catch (Exception e){ + log.error(e.toString(),e); + } + return ServerResponse.createErroe("操作失败"); + } + + /** + * 新增实验设备 + * @param data + * @return + */ + @PostMapping(value = "addDevice") + @DecryptAndVerify(decryptedClass = ExperDevice.class)//加解密统一管理 + @LogAnnotation(operModul = "实验管理-实验设备管理", operation = "新增实验设备", operDesc = "系统级事件",operType="新增") + @PreAuthorize("@pms.hasPermission('exper:device:add')") + public ServerResponse addDevice(EncryptedReq data) { + try { + ExperDevice u = deviceService.getAdd(data.getData().getDevName()); + if (u != null) { + return ServerResponse.createErroe("设备名称 “"+data.getData().getDevName() + "” 已存在"); + } + deviceService.add(data.getData()); + return ServerResponse.createBySuccessMsg("操作成功"); + }catch (Exception e){ + log.error(e.toString(),e); + } + return ServerResponse.createErroe("操作失败"); + } + + /** + * 删除实验设备 + * @param data + * @return + */ + @PostMapping(value = "delById") + @DecryptAndVerify(decryptedClass = ExperDevice.class)//加解密统一管理 + @LogAnnotation(operModul = "实验管理-实验设备管理", operation = "删除实验设备", operDesc = "系统级事件",operType="删除") + @PreAuthorize("@pms.hasPermission('exper:device:del')") + public ServerResponse delDevice(EncryptedReq data) { + try { + if (deviceService.delDevice(data.getData().getDevId())== 1){ + return ServerResponse.createBySuccessMsg("删除成功"); + }else { + return ServerResponse.createErroe("删除失败"); + } + }catch (Exception e){ + log.error(e.toString(),e); + } + return ServerResponse.createErroe("操作失败"); + } + +} diff --git a/src/main/java/com/bonus/aqgqj/exper/dao/DeviceDao.java b/src/main/java/com/bonus/aqgqj/exper/dao/DeviceDao.java new file mode 100644 index 0000000..a7f6201 --- /dev/null +++ b/src/main/java/com/bonus/aqgqj/exper/dao/DeviceDao.java @@ -0,0 +1,62 @@ +package com.bonus.aqgqj.exper.dao; + +import com.bonus.aqgqj.basis.entity.vo.BaseCustom; + +import com.bonus.aqgqj.exper.entity.vo.ExperDevice; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface DeviceDao { + + /** + * 获取实验设备列表 + * @param device + * @return + */ + List list(ExperDevice device); + + /** + * 根据实验设备id获取信息 + * @param device + * @return + */ + ExperDevice getDeviceId(ExperDevice device); + + /** + * 根据设备id查询是否重名 + * @param devName + * @param devId + * @return + */ + ExperDevice getDevice(String devName,Long devId); + + /** + * 修改该条设备数据 + * @param device + * @return + */ + int update(ExperDevice device); + + /** + * 根据设备名称查是否重名 + * @param devName + * @return + */ + ExperDevice getAdd(String devName); + + /** + * 新增该条数据 + * @param device + * @return + */ + int add(ExperDevice device); + /** + * 删除该条数据 + * @param devId + * @return + */ + int delDevice(Long devId); + +} diff --git a/src/main/java/com/bonus/aqgqj/exper/entity/vo/ExperDevice.java b/src/main/java/com/bonus/aqgqj/exper/entity/vo/ExperDevice.java new file mode 100644 index 0000000..facf9bf --- /dev/null +++ b/src/main/java/com/bonus/aqgqj/exper/entity/vo/ExperDevice.java @@ -0,0 +1,78 @@ +package com.bonus.aqgqj.exper.entity.vo; + +import com.bonus.aqgqj.base.entity.PageEntity; +import com.bonus.aqgqj.utils.UserUtil; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.sql.Date; + +/** + * @className:ExperDeviceVo + * @author:cwchen + * @date:2024-07-19-13:29 + * @version:1.0 + * @description:试验设备-vo + */ +@Data +public class ExperDevice extends PageEntity { + + /** + * 关键词 + */ + private String keyWord; + /** + * 设备id + */ + private Long devId; + /** + * 设备名称 + */ + private String devName; + /** + * 设备型号 + */ + private String devModule; + /** + * 设备编号 + */ + private String devCode; + /** + * 合同生效日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private java.util.Date contractDate; + /** + * 创建时间 + */ + + private java.sql.Date createTime; + /** + * 修改时间 + */ + + private java.sql.Date updateTime; + /** + * 创建人 + */ + + private Long createUser = UserUtil.getLoginUser().getId(); + /** + * 修改人 + */ + @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) + private Long updateUser = UserUtil.getLoginUser().getId(); + /** + * 数据来源 0 新增 1 实验配置 + */ + + private Integer dataSource ; + /** + * 删除状态 0正常 1删除 + */ + + private Integer delFlag ; + + +} diff --git a/src/main/java/com/bonus/aqgqj/exper/service/DeviceService.java b/src/main/java/com/bonus/aqgqj/exper/service/DeviceService.java new file mode 100644 index 0000000..334ec5a --- /dev/null +++ b/src/main/java/com/bonus/aqgqj/exper/service/DeviceService.java @@ -0,0 +1,60 @@ +package com.bonus.aqgqj.exper.service; + +import com.bonus.aqgqj.exper.entity.vo.ExperDevice; +import com.bonus.aqgqj.utils.ServerResponse; + +import java.util.List; + +public interface DeviceService { + + /** + * 获取实验设备列表 + * @param device + * @return + */ + List list(ExperDevice device); + + /** + * 根据实验设备id获取信息 + * @param device + * @return + */ + ServerResponse getDeviceId(ExperDevice device); + + /** + * 根据设备id查询是否重名 + * @param devName + * @param devId + * @return + */ + ExperDevice getDevice(String devName,Long devId); + + /** + * 修改该条设备数据 + * @param device + * @return + */ + ExperDevice updateDevice(ExperDevice device); + + /** + * 根据设备名称查是否重名 + * @param devName + * @return + */ + ExperDevice getAdd(String devName); + + /** + * 新增该条数据 + * @param device + * @return + */ + ExperDevice add(ExperDevice device); + + /** + * 删除该条数据 + * @param devId + * @return + */ + int delDevice(Long devId); + +} diff --git a/src/main/java/com/bonus/aqgqj/exper/service/impl/DeviceServiceImpl.java b/src/main/java/com/bonus/aqgqj/exper/service/impl/DeviceServiceImpl.java new file mode 100644 index 0000000..f184ed1 --- /dev/null +++ b/src/main/java/com/bonus/aqgqj/exper/service/impl/DeviceServiceImpl.java @@ -0,0 +1,83 @@ +package com.bonus.aqgqj.exper.service.impl; + +import com.bonus.aqgqj.basis.dao.CustomDao; +import com.bonus.aqgqj.basis.entity.vo.BaseCustom; +import com.bonus.aqgqj.basis.service.CustomService; +import com.bonus.aqgqj.exper.dao.DeviceDao; +import com.bonus.aqgqj.exper.entity.vo.ExperDevice; +import com.bonus.aqgqj.exper.service.DeviceService; +import com.bonus.aqgqj.utils.ServerResponse; +import com.bonus.aqgqj.utils.StringHelper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +@Slf4j +@Service +public class DeviceServiceImpl implements DeviceService { + + + @Resource + private DeviceDao deviceDao; + + + @Override + public List list(ExperDevice device) { + return deviceDao.list(device); + } + + @Override + public ServerResponse getDeviceId(ExperDevice device) { + try{ + ExperDevice vo= deviceDao.getDeviceId(device); + return ServerResponse.createSuccess(vo); + }catch (Exception e){ + return ServerResponse.createSuccess("修改成功"); + } + } + + @Override + public ExperDevice getDevice(String devName,Long devId) { + try{ + return deviceDao.getDevice(devName,devId); + }catch (Exception e){ + log.error(e.toString(),e); + } + return null; + } + + + @Override + @Transactional + public ExperDevice updateDevice(ExperDevice device) { + deviceDao.update(device); + return device; + } + + @Override + public ExperDevice getAdd(String devName) { + try{ + return deviceDao.getAdd(devName); + }catch (Exception e){ + log.error(e.toString(),e); + } + return null; + } + + @Override + @Transactional + public ExperDevice add(ExperDevice device) { + deviceDao.add(device); + return device; + } + + @Override + public int delDevice(Long devId) { + return deviceDao.delDevice(devId); + } + + +} diff --git a/src/main/java/com/bonus/aqgqj/primaryData/controller/PrimaryDataController.java b/src/main/java/com/bonus/aqgqj/primaryData/controller/PrimaryDataController.java new file mode 100644 index 0000000..22b3621 --- /dev/null +++ b/src/main/java/com/bonus/aqgqj/primaryData/controller/PrimaryDataController.java @@ -0,0 +1,58 @@ +package com.bonus.aqgqj.primaryData.controller; + +import com.bonus.aqgqj.annotation.DecryptAndVerify; +import com.bonus.aqgqj.annotation.LogAnnotation; +import com.bonus.aqgqj.basis.entity.dto.ParamsDto; +import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo; +import com.bonus.aqgqj.exper.dao.DeviceDao; +import com.bonus.aqgqj.exper.entity.vo.ExperDevice; +import com.bonus.aqgqj.exper.service.DeviceService; +import com.bonus.aqgqj.primaryData.dao.PrimaryDataDao; +import com.bonus.aqgqj.primaryData.service.PrimaryDataService; +import com.bonus.aqgqj.system.vo.EncryptedReq; +import com.bonus.aqgqj.utils.ServerResponse; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import io.swagger.annotations.Api; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + + +@Api(tags = "实验") +@RestController +@RequestMapping("/primaryDatas/") +public class PrimaryDataController { + + private static final Logger log = LoggerFactory.getLogger("adminLogger"); + + @Autowired + private PrimaryDataService primarydataService; + @Resource + private PrimaryDataDao primarydataDao; + + /** + * 根据关键词获取实验设备列表 + * @param data + * @return + */ + @PostMapping(value = "getList") + @DecryptAndVerify(decryptedClass = ParamsDto.class)//加解密统一管理 + @LogAnnotation(operModul = "原始数据管理-原始数据管理", operation = "查询原始数据列表", operDesc = "系统级事件",operType="查询") + @PreAuthorize("@pms.hasPermission('primaryData:primary:query')" ) + public ServerResponse listPrimaryDatas(EncryptedReq data) { + PageHelper.startPage(data.getData().getPage(), data.getData().getLimit()); + List list = primarydataService.getList(data.getData()); + PageInfo pageInfo = new PageInfo<>(list); + return ServerResponse.createSuccessPage(pageInfo, data.getData().getPage(), data.getData().getLimit()); + } + + +} diff --git a/src/main/java/com/bonus/aqgqj/primaryData/dao/PrimaryDataDao.java b/src/main/java/com/bonus/aqgqj/primaryData/dao/PrimaryDataDao.java new file mode 100644 index 0000000..a03b567 --- /dev/null +++ b/src/main/java/com/bonus/aqgqj/primaryData/dao/PrimaryDataDao.java @@ -0,0 +1,62 @@ +package com.bonus.aqgqj.primaryData.dao; + +import com.bonus.aqgqj.basis.entity.dto.ParamsDto; +import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo; +import com.bonus.aqgqj.exper.entity.vo.ExperDevice; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface PrimaryDataDao { + + /** + * 原始数据列表 + * @param data + * @return + */ + List getList(ParamsDto data); + +// /** +// * 根据实验设备id获取信息 +// * @param device +// * @return +// */ +// ExperDevice getDeviceId(ExperDevice device); +// +// /** +// * 根据设备id查询是否重名 +// * @param devName +// * @param devId +// * @return +// */ +// ExperDevice getDevice(String devName,Long devId); +// +// /** +// * 修改该条设备数据 +// * @param device +// * @return +// */ +// int update(ExperDevice device); +// +// /** +// * 根据设备名称查是否重名 +// * @param devName +// * @return +// */ +// ExperDevice getAdd(String devName); +// +// /** +// * 新增该条数据 +// * @param device +// * @return +// */ +// int add(ExperDevice device); +// /** +// * 删除该条数据 +// * @param devId +// * @return +// */ +// int delDevice(Long devId); + +} diff --git a/src/main/java/com/bonus/aqgqj/primaryData/service/PrimaryDataService.java b/src/main/java/com/bonus/aqgqj/primaryData/service/PrimaryDataService.java new file mode 100644 index 0000000..aa5ccb9 --- /dev/null +++ b/src/main/java/com/bonus/aqgqj/primaryData/service/PrimaryDataService.java @@ -0,0 +1,61 @@ +package com.bonus.aqgqj.primaryData.service; + +import com.bonus.aqgqj.basis.entity.dto.ParamsDto; +import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo; + + +import java.util.List; + +public interface PrimaryDataService { + + /** + * 原始数据列表 + * @param data + * @return + */ + List getList(ParamsDto data); + +// /** +// * 根据实验设备id获取信息 +// * @param device +// * @return +// */ +// ServerResponse getDeviceId(ExperDevice device); +// +// /** +// * 根据设备id查询是否重名 +// * @param devName +// * @param devId +// * @return +// */ +// ExperDevice getDevice(String devName,Long devId); +// +// /** +// * 修改该条设备数据 +// * @param device +// * @return +// */ +// ExperDevice updateDevice(ExperDevice device); +// +// /** +// * 根据设备名称查是否重名 +// * @param devName +// * @return +// */ +// ExperDevice getAdd(String devName); +// +// /** +// * 新增该条数据 +// * @param device +// * @return +// */ +// ExperDevice add(ExperDevice device); +// +// /** +// * 删除该条数据 +// * @param devId +// * @return +// */ +// int delDevice(Long devId); + +} diff --git a/src/main/java/com/bonus/aqgqj/primaryData/service/impl/PrimaryDataServiceImpl.java b/src/main/java/com/bonus/aqgqj/primaryData/service/impl/PrimaryDataServiceImpl.java new file mode 100644 index 0000000..5ac3a29 --- /dev/null +++ b/src/main/java/com/bonus/aqgqj/primaryData/service/impl/PrimaryDataServiceImpl.java @@ -0,0 +1,84 @@ +package com.bonus.aqgqj.primaryData.service.impl; + +import com.bonus.aqgqj.basis.entity.dto.ParamsDto; +import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo; +import com.bonus.aqgqj.primaryData.dao.PrimaryDataDao; +import com.bonus.aqgqj.primaryData.service.PrimaryDataService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +@Slf4j +@Service +public class PrimaryDataServiceImpl implements PrimaryDataService { + + + @Resource + private PrimaryDataDao primarydataDao; + + + @Override + public List getList(ParamsDto dto) { + List list = new ArrayList<>(); + try { + list = primarydataDao.getList(dto); + } catch (Exception e) { + log.error(e.toString(), e); + } + return list; + } + +// @Override +// public ServerResponse getDeviceId(ExperDevice device) { +// try{ +// ExperDevice vo= deviceDao.getDeviceId(device); +// return ServerResponse.createSuccess(vo); +// }catch (Exception e){ +// return ServerResponse.createSuccess("修改成功"); +// } +// } +// +// @Override +// public ExperDevice getDevice(String devName,Long devId) { +// try{ +// return deviceDao.getDevice(devName,devId); +// }catch (Exception e){ +// log.error(e.toString(),e); +// } +// return null; +// } +// +// +// @Override +// @Transactional +// public ExperDevice updateDevice(ExperDevice device) { +// deviceDao.update(device); +// return device; +// } +// +// @Override +// public ExperDevice getAdd(String devName) { +// try{ +// return deviceDao.getAdd(devName); +// }catch (Exception e){ +// log.error(e.toString(),e); +// } +// return null; +// } +// +// @Override +// @Transactional +// public ExperDevice add(ExperDevice device) { +// deviceDao.add(device); +// return device; +// } +// +// @Override +// public int delDevice(Long devId) { +// return deviceDao.delDevice(devId); +// } +// + +} diff --git a/src/main/resources/mappers/exper/DeviceMapper.xml b/src/main/resources/mappers/exper/DeviceMapper.xml new file mode 100644 index 0000000..828f4cd --- /dev/null +++ b/src/main/resources/mappers/exper/DeviceMapper.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + update tb_exper_device + set dev_name = #{devName}, + dev_module = #{devModule}, + dev_code = #{devCode}, + contract_date = #{contractDate}, + update_time = now(), + data_source = #{dataSource} + where dev_id = #{devId} + + + + insert into tb_exper_device(dev_name,dev_module,dev_code,contract_date,create_time,data_source,del_flag + )values ( + #{devName},#{devModule},#{devCode},#{contractDate},now(),#{dataSource},0 + ) + + + + update tb_exper_device + set del_flag = 1 + where dev_id = #{devId} + + + \ No newline at end of file diff --git a/src/main/resources/mappers/primaryData/PrimaryDataMapper.xml b/src/main/resources/mappers/primaryData/PrimaryDataMapper.xml new file mode 100644 index 0000000..2f496c0 --- /dev/null +++ b/src/main/resources/mappers/primaryData/PrimaryDataMapper.xml @@ -0,0 +1,54 @@ + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/js/basis/child/teamConfigDataFormTable.js b/src/main/resources/static/js/basis/child/teamConfigDataFormTable.js deleted file mode 100644 index 8d12cfd..0000000 --- a/src/main/resources/static/js/basis/child/teamConfigDataFormTable.js +++ /dev/null @@ -1,199 +0,0 @@ -let form, layer, table, tableIns; -let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10 -layui.use(['form', 'layer', 'table', 'laydate'], function () { - form = layui.form; - layer = layui.layer; - table = layui.table; - layui.form.render(); - pages(1, 10, 1); -}) - - -function pages(pageNum, pageSize, typeNum) { - let params = getReqParams(pageNum, pageSize, typeNum); - let url = dataUrl + "/teamconfigs/getListTemp" - ajaxRequest(url, "POST", params, true, function () { - }, function (result) { - console.log(result); - if (result.code === 200) { - if (result.data) { - initTable(result.data, result.limit, result.curr) - laypages(result.count, result.curr, result.limit) - } - } else if (result.code === 500) { - layer.alert(result.msg, {icon: 2}) - } - }, function (xhr) { - error(xhr) - }); -} - -function laypages(total, page, limit) { - layui.use(['laypage'], function () { - let laypage = layui.laypage; - laypage.render({ - elem: 'voi-page', - count: total, - curr: page, - limit: limit, - limits: [10, 20, 50, 100, 200, 500], - layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'], - groups: 5, - jump: function (obj, first) { - if (!first) { - pageNum = obj.curr, limitSize = obj.limit; - pages(obj.curr, obj.limit, null); - } - } - }); - }) -} - -/*初始化表格*/ -function initTable(dataList, limit, page) { - let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,}); - tableIns = table.render({ - elem: "#table_data", - height: "full-130", - data: dataList, - limit: limit, - cols: [ - [ - {type: 'checkbox', width: '5%', fixed: 'left'}, - //表头 - {title: "序号", width: 80, unresize: true, align: "center", - templet: function (d) { - return (page - 1) * limit + d.LAY_INDEX; - } - }, - {field: "teamConfigId", title: "ID", unresize: true, align: "center",hide:true}, - {field: "teamConfigName", title: "姓名", unresize: true, align: "center"}, - {field: "teamConfigJobNumber", title: "工号", unresize: true, align: "center"}, - {field: "teamConfigSex", title: "性别", unresize: true, align: "center", - templet: function (d) { - if (d.teamConfigSex == 0) { - return "女"; - } else if (d.teamConfigSex == 1) { - return "男"; - } - } - }, - // {field: "teamConfigTeamId", title: "班组id", unresize: true, align: "center"}, - {field: "teamConfigPhone", title: "联系电话", unresize: true, align: "center"}, - {title: "操作", unresize: true, width: 300, align: "center", - templet: function (d) { - - let html = ''; - let add="" - html=add; - return html; - } - }, - ], - ], - done: function (res, curr, count) { - layer.close(loadingMsg); - table.resize("table_data"); - count || this.elem.next(".layui-table-view").find(".layui-table-header").css("display", "inline-block"); - count || this.elem.next(".layui-table-view").find(".layui-table-box").css("overflow", "auto"); - }, - }); -} - - -// 获取参数 -function getReqParams(page, limit, type) { - let obj = {}; - if (!type) { - obj = { - page: page + "", - limit: limit + "", - keyWord: $('#keyWord').val(), - }; - } else { - obj = { - page: '1', - limit: '10', - keyWord: '', - }; - } - console.log(obj) - obj={ - encryptedData:encryptCBC(JSON.stringify(obj)) - } - return obj; -} - -// 查询/重置 -function query() { - let pattern = new RegExp("[%_<>]"); - pageNum = 1; - pages(1, limitSize); -} - -function reloadData() { - pages(pageNum, limitSize); -} - -// 获取选中的数据 -function getCheckedValues() { - let data = table.checkStatus("table_data").data; - let ids = [] - if (data.length === 0) { - return ids; - } - for (let i = 0; i < data.length; i++) { - ids.push(data[i].teamConfigId); - } - return ids; -} - -// 批量添加 -function batchAddData() { - let ids = getCheckedValues(); - console.log(ids); - let id = areaIdParam; - if (ids.length === 0) { - return layer.msg('至少添加一行数据', {icon: 7}) - } else { - addTeamConfigData(ids.toString(),id); - } -} - -/*修改用户*/ -function addData(id,teamConfigId) { - layer.confirm("确定添加到该班组吗?", { - move: false - }, function () { - let loadingMsg = layer.msg('数据添加中,请稍候...', {icon: 16, scrollbar: false, time: 0}); - let url = dataUrl + "/teamconfigs/addById"; - let params = { - 'id':id, - 'teamConfigId': teamConfigId - } - console.log(params); - params={ - encryptedData:encryptCBC(JSON.stringify(params)) - } - ajaxRequest(url, "POST", params, true, function () { - }, function (result) { - layer.close(loadingMsg); // 关闭提示层 - if (result.code === 200) { - parent.layer.msg(result.msg, {icon: 1}) - query() - } else if (result.code === 500) { - layer.alert(result.msg, {icon: 2}) - } - }, function (xhr) { - layer.close(loadingMsg); // 关闭提示层 - error(xhr) - }); - }) -} - - -function setParams(params){ - let obj = JSON.parse(params) - console.log(obj) - areaIdParam = obj.id -} \ No newline at end of file diff --git a/src/main/resources/static/js/basis/customAddDeptForm.js b/src/main/resources/static/js/basis/customAddDeptForm.js deleted file mode 100644 index 8b69064..0000000 --- a/src/main/resources/static/js/basis/customAddDeptForm.js +++ /dev/null @@ -1,177 +0,0 @@ -let form, layer, dtree, util, idParam, phoneParam,statusParam; -let arr = ['background', 'web', 'mobile', 'wx']; -let background, web, mobile, wx; -let data = [], appResList = []; -// 角色下拉选 -let roleList; -getTeamSelected(); -function setParams(params) { - idParam = JSON.parse(params).customId; - // statusParam = 0; - console.log(idParam) - layui.config({ - base: "../../../js/layui-v2.6.8/dtree/", //此处路径请自行处理, 可以使用绝对路径 - }).extend({ - dtree: 'dtree' - }).use(['form', 'layer', 'util'], function () { - layer = layui.layer; - form = layui.form; - util = layui.util; - form.on('submit(formData)', function (data) { - data.field.id = $('#id').val(); - // data.field.customStatus = $('#customStatus').val(); - // data.field.type = !$('#id').val() ? '1' : '2'; - saveData(data); - }); - // form.on('switch',function(data){ - // if(data.elem.checked==true){ - // statusParam = 1; - // } - // - // }); - form.verify( - { - required: function (value, item) { - let customPhone = $('#customPhone').val(); - if(customPhone){ - if (!(/^1[3456789]\d{9}$/.test(customPhone))) { - return '请输入正确的手机号'; - } - } - } - }, - ); - // if (idParam) { - // getFormbyId(); - // } - }); -} - -// 根据id获取用户信息 -function getFormbyId() { - let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,}); - let url = dataUrl + "/customs/getCustomId?token=" + tokens; - let params = { - customId: idParam - } - params={ - encryptedData:encryptCBC(JSON.stringify(params)) - } - - ajaxRequest(url, "POST", params, true, function () { - }, function (result) { - layer.close(loadingMsg); // 关闭提示层 - if (result.code === 200) { - setFormData(result.data); - } else { - layer.alert(result.msg, {icon: 2}) - } - }, function (xhr) { - layer.close(loadingMsg); // 关闭提示层 - error(xhr) - }); -} - -// 设置表单内容 -function setFormData(data) { - if (data) { - form.val('formInfo',data) - // if(data.customStatus == 1){ - // $("#customStatus").prop("checked", 1); - // }else{ - // $("#customStatus").prop("checked", 0); - // - // } - deptId = data.deptId; - pid = data.pid - console.log(data) - form.render(); - - - } -} - -function saveData2() { - $('#formSubmit').trigger('click') -} - -// 保存数据 -function saveData(data) { - let loadingMsg = layer.msg('数据上传中,请稍候...', {icon: 16, scrollbar: false, time: 0}); - - let params = data.field; - params.customId = idParam; - // params.customStatus = statusParam; - let path_url = ''; - path_url = 'addDeptCustom'; - - let url = dataUrl + "/customs/" + path_url + "?token=" + tokens; - - params = { - encryptedData: encryptCBC(JSON.stringify(params)) - } - - ajaxRequest(url, "POST", params, true, function () { - $('.save').addClass("layui-btn-disabled").attr("disabled", true); - $('.cancel').addClass("layui-btn-disabled").attr("disabled", true); - }, function (result) { - console.log(result) - layer.close(loadingMsg); // 关闭提示层 - if (result.code === 200) { - parent.layer.msg(result.msg, {icon: 1,time:1000},function (){ - closePage(1); - }) - // closePage(1); - // parent.layer.msg(result.data, {icon: 1}); - } else if (result.code === 500) { - layer.alert(result.msg, {icon: 2}) - $('.save').removeClass("layui-btn-disabled").attr("disabled", false); - $('.cancel').removeClass("layui-btn-disabled").attr("disabled", false); - } else if (result.code === 204) { - layer.alert(result.msg, {icon: 2}) - $('.save').removeClass("layui-btn-disabled").attr("disabled", false); - $('.cancel').removeClass("layui-btn-disabled").attr("disabled", false); - } - }, function (xhr) { - layer.close(loadingMsg); // 关闭提示层 - $('.save').removeClass("layui-btn-disabled").attr("disabled", false); - $('.cancel').removeClass("layui-btn-disabled").attr("disabled", false); - error(xhr) - }); - } - - - -// 关闭页面 -function closePage(type) { - let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引 - parent.layer.close(index); //再执行关闭 - if (type === 1) { - parent.reloadData() - } -} -function getTeamSelected() { - debugger - let url = dataUrl + '/customs/all'; - ajaxRequest(url, "POST", null, true, function () { - }, function (result) { - if (result.code === 200) { - setSelectValue(result.data, 'pid'); - // return result.data - } else { - layer.alert(result.msg, {icon: 2}) - } - }, function (xhr) { - error(xhr) - }); -} - -/*下拉选表单赋值*/ - // function setSelectValue(list, selectName) { - // let html = ''; - // $.each(list, function (index, item) { - // html += ''; - // }) - // $('#' + selectName).empty().append(html); - // layui.form.render(); - // } diff --git a/src/main/resources/static/js/basis/customAddForm.js b/src/main/resources/static/js/basis/customAddForm.js index 9eecb0c..6a75755 100644 --- a/src/main/resources/static/js/basis/customAddForm.js +++ b/src/main/resources/static/js/basis/customAddForm.js @@ -4,10 +4,10 @@ let background, web, mobile, wx; let data = [], appResList = []; // 角色下拉选 let roleList; - +getTeamSelected(); function setParams(params) { idParam = JSON.parse(params).customId; - statusParam = 0; + // statusParam = 0; console.log(idParam) layui.config({ base: "../../../js/layui-v2.6.8/dtree/", //此处路径请自行处理, 可以使用绝对路径 @@ -76,12 +76,15 @@ function getFormbyId() { function setFormData(data) { if (data) { form.val('formInfo',data) - if(data.customStatus == 1){ - $("#customStatus").prop("checked", 1); - }else{ - $("#customStatus").prop("checked", 0); - - } + // if(data.customStatus == 1){ + // $("#customStatus").prop("checked", 1); + // }else{ + // $("#customStatus").prop("checked", 0); + // + // } + deptId = data.deptId; + pid = data.pid + console.log(data) form.render(); @@ -98,7 +101,7 @@ function saveData(data) { let params = data.field; params.customId = idParam; - params.customStatus = statusParam; + // params.customStatus = statusParam; let path_url=''; if(params.customId==null || params.customId ==''){ path_url='addCustom'; @@ -145,4 +148,28 @@ function closePage(type) { if (type === 1) { parent.reloadData() } -} \ No newline at end of file +} +function getTeamSelected() { + let url = dataUrl + '/customs/all'; + ajaxRequest(url, "POST", null, true, function () { + }, function (result) { + if (result.code === 200) { + setSelectValue(result.data, 'pid'); + // return result.data + } else { + layer.alert(result.msg, {icon: 2}) + } + }, function (xhr) { + error(xhr) + }); +} + +/*下拉选表单赋值*/ +function setSelectValue(list, selectName) { + let html = ''; + $.each(list, function (index, item) { + html += ''; + }) + $('#' + selectName).empty().append(html); + layui.form.render(); +} diff --git a/src/main/resources/static/js/basis/team.js b/src/main/resources/static/js/basis/team.js index d126442..7cd66bd 100644 --- a/src/main/resources/static/js/basis/team.js +++ b/src/main/resources/static/js/basis/team.js @@ -5,31 +5,7 @@ layui.use(['form', 'layer', 'table', 'laydate'], function () { layer = layui.layer; table = layui.table; layui.form.render(); - getRoleSelected(); pages(1, 10, 1); - form.on('switch(is-state)', function (obj) { - console.log(obj); - // let url = dataUrl + "/sys/task/updaetTaskState"; - // let params = { - // 'id': this.value, - // 'taskStatus': obj.elem.checked ? 1 : 0, - // 'taskCode':this.taskCode - // } - // params={ - // encryptedData:encryptCBC(JSON.stringify(params)) - // } - // ajaxRequest(url, "POST", params, true, function () {}, function (result) { - // console.log(result) - // reloadData(); - // if (result.status === 200) { - // parent.layer.msg(result.data, {icon: 1}) - // } else if (result.status === 204) { - // parent.layer.alert(result.msg, {icon: 2}) - // } - // }, function (xhr) { - // error(xhr) - // }); - }); }) function pages(pageNum, pageSize, typeNum) { @@ -49,28 +25,6 @@ function pages(pageNum, pageSize, typeNum) { }, function (xhr) { error(xhr) }); - // $.ajax({ - // url: dataUrl + "/sys/user/getUserList", - // headers: { - // "token": tokens - // }, - // data: params, - // type: 'POST', - // async: false, - // success: function (result) { - // console.log(result); - // if (result.code === 200) { - // if (result.data) { - // initTable(result.data, result.limit, result.curr) - // laypages(result.count, result.curr, result.limit) - // } - // } else if (result.code === 500) { - // layer.alert(result.msg, {icon: 2}) - // } - // }, error: function (xhr) { - // error(xhr); - // } - // }); } function laypages(total, page, limit) { @@ -115,13 +69,13 @@ function initTable(dataList, limit, page) { {field: "teamTypeName", title: "班组类型", unresize: true, align: "center"}, {field: "teamLeader", title: "班组负责人", unresize: true, align: "center"}, {field: "teamLeaderPhone", title: "联系方式", unresize: true, align: "center"}, + {field: "countuser", title: "班组人数", unresize: true, align: "center"}, {field: "createTime", title: "创建时间", unresize: true, align: "center"}, {field: "updateTime", title: "更新时间", unresize: true, align: "center"}, {title: "操作", unresize: true, width: 300, align: "center", templet: function (d) { - let html = ''; - let del="" + let del="" let edit=""; html=edit+del; return html; @@ -201,14 +155,15 @@ function addData(teamId) { } /*删除用户*/ -function delData(teamId) { +function delData(teamId,countuser) { layer.confirm("确定删除吗?", { move: false }, function () { let loadingMsg = layer.msg('数据删除中,请稍候...', {icon: 16, scrollbar: false, time: 0}); let url = dataUrl + "/teams/delById"; let params = { - 'teamId': teamId + 'teamId': teamId, + 'countuser':countuser } params={ encryptedData:encryptCBC(JSON.stringify(params)) @@ -217,7 +172,11 @@ function delData(teamId) { }, function (result) { layer.close(loadingMsg); // 关闭提示层 if (result.code === 200) { - parent.layer.msg(result.msg, {icon: 1}) + if(result.msg=="删除成功"){ + parent.layer.msg(result.msg, {icon: 1}) + }else{ + parent.layer.msg(result.msg, {icon: 2}) + } query() } else if (result.code === 500) { layer.alert(result.msg, {icon: 2}) @@ -229,59 +188,6 @@ function delData(teamId) { }) } -// 启用/停用/解除锁定 -function editUserAccountStatus(id, status, type) { - let url = dataUrl + "/sys/user/editUserAccountStatus?token=" + token; - let params = { - 'id': id, - 'accountStatus': status, - 'type': type - } - ajaxRequest(url, "POST", params, true, function () { - }, function (result) { - if (result.code === 200) { - if(type){ - reloadData(); - } - parent.layer.msg(result.msg, {icon: 1}) - } else if (result.code === 500) { - layer.alert(result.msg, {icon: 2}) - } - }, function (xhr) { - error(xhr) - }); -} -// 管理员修改密码 -function resetPwd(id) { - let param = { - 'id': id, - 'type': '1' - } - openIframe2("addOrEditUnifyUser", '修改密码', "password.html", '770px', '400px', param); -} -function getRoleSelected() { - let url = dataUrl + '/roles/all'; - ajaxRequest(url, "POST", null, true, function () { - }, function (result) { - if (result.code === 200) { - setSelectValue(result.data, 'roleId'); - // return result.data - } else { - layer.alert(result.msg, {icon: 2}) - } - }, function (xhr) { - error(xhr) - }); -} -/*下拉选表单赋值*/ -function setSelectValue(list, selectName) { - let html = ''; - $.each(list, function (index, item) { - html += ''; - }) - $('#' + selectName).empty().append(html); - layui.form.render(); -} diff --git a/src/main/resources/static/pages/basis/child/teamConfigDataForm.html b/src/main/resources/static/pages/basis/child/teamConfigDataForm.html new file mode 100644 index 0000000..c1f9d6b --- /dev/null +++ b/src/main/resources/static/pages/basis/child/teamConfigDataForm.html @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + 成员-新增 + + + +
+
+
+
+
+ +
+
+ +
+ + +
+
+
+ +
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/static/pages/basis/customAddDeptForm.html b/src/main/resources/static/pages/basis/customAddDeptForm.html new file mode 100644 index 0000000..70cba3f --- /dev/null +++ b/src/main/resources/static/pages/basis/customAddDeptForm.html @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + 用户-新增/修改 + + +
+
+ + + + + + + + + + +
+ +
+ +
+
+ + + + + + + + + + + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + + + + + + + +
+ +
+
+ + +
+ + + \ No newline at end of file diff --git a/src/main/resources/static/pages/basis/customAddForm.html b/src/main/resources/static/pages/basis/customAddForm.html index c229754..87e9dc7 100644 --- a/src/main/resources/static/pages/basis/customAddForm.html +++ b/src/main/resources/static/pages/basis/customAddForm.html @@ -18,6 +18,15 @@
+ + + + + + + + +
@@ -25,6 +34,18 @@ lay-verify="required" maxlength="50">
+ + + + + + + + + + + +
@@ -46,12 +67,12 @@ lay-verify="required" maxlength="11">
-
- -
- -
-
+ + + + + + diff --git a/src/main/resources/static/pages/exper/deviceAddForm.html b/src/main/resources/static/pages/exper/deviceAddForm.html new file mode 100644 index 0000000..fb8effd --- /dev/null +++ b/src/main/resources/static/pages/exper/deviceAddForm.html @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + 实验设备-新增/修改 + + +
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ + + + +
+
+ + +
+ + + \ No newline at end of file diff --git a/src/main/resources/static/pages/testReport/testReportMge.html b/src/main/resources/static/pages/exper/deviceList.html similarity index 58% rename from src/main/resources/static/pages/testReport/testReportMge.html rename to src/main/resources/static/pages/exper/deviceList.html index 54eca93..15c8476 100644 --- a/src/main/resources/static/pages/testReport/testReportMge.html +++ b/src/main/resources/static/pages/exper/deviceList.html @@ -2,49 +2,37 @@ - - - + - - 检测报告管理 + 实验管理