diff --git a/zlpt-modules/zlpt-company/pom.xml b/zlpt-modules/zlpt-company/pom.xml index 5ea5bd2..f56cc67 100644 --- a/zlpt-modules/zlpt-company/pom.xml +++ b/zlpt-modules/zlpt-company/pom.xml @@ -51,6 +51,12 @@ zlpt-modules-system 3.6.3 + + com.bonus.zlpt + zlpt-modules-system + 3.6.3 + compile + \ No newline at end of file diff --git a/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/controller/MaUpOffController.java b/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/controller/MaUpOffController.java index e52b03d..475c445 100644 --- a/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/controller/MaUpOffController.java +++ b/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/controller/MaUpOffController.java @@ -7,6 +7,7 @@ import com.bonus.zlpt.company.domain.MaUpOff; import com.bonus.zlpt.company.mapper.MaUpOffMapper; import com.bonus.zlpt.company.service.impl.MaUpOffServiceImpl; import com.bonus.zlpt.home.service.MaTypeInfoSevice; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -35,7 +36,7 @@ public class MaUpOffController extends BaseController { @Resource private MaUpOffMapper maUpOffMapper; - @Resource + @Autowired(required = false) private MaTypeInfoSevice maTypeInfoSevice; /** diff --git a/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/controller/SunAccountController.java b/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/controller/SunAccountController.java new file mode 100644 index 0000000..716554d --- /dev/null +++ b/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/controller/SunAccountController.java @@ -0,0 +1,75 @@ +package com.bonus.zlpt.company.controller; + +import com.bonus.zlpt.common.core.web.controller.BaseController; +import com.bonus.zlpt.common.core.web.domain.AjaxResult; +import com.bonus.zlpt.common.security.utils.SecurityUtils; +import com.bonus.zlpt.system.api.domain.SysUser; +import com.bonus.zlpt.system.service.ISysUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +@RestController +@RequestMapping("/sun") +public class SunAccountController extends BaseController { + + @Autowired(required = false) + private ISysUserService iSysUserService; + + /** + * 获取此账号下的子账号信息 + * @param + * @return + */ + @GetMapping("/selectUserList") + public List selectUserList() { + SysUser sysUser = new SysUser(); + int parentId = Math.toIntExact(SecurityUtils.getUserId()); + sysUser.setParentId(parentId); + List sysUsersList = iSysUserService.selectUserList(sysUser); + return sysUsersList; + } + + /** + * 添加子账号 + * @param sysUser + * @return + */ + @PostMapping("/sunAdd") + public AjaxResult sunAdd(@RequestBody SysUser sysUser) { + + int parentId = Math.toIntExact(SecurityUtils.getUserId()); + sysUser.setParentId(parentId); + iSysUserService.insertUser(sysUser); + + return success("添加成功!"); + } + + /** + * 修改子账号状态 + * @param sysUser + * @return + */ + @PostMapping("/updateUserStatus") + public AjaxResult updateUserStatus(@RequestBody SysUser sysUser) { + + iSysUserService.updateUserStatus(sysUser); + return success("修改成功!"); + } + + /** + * 删除子账号 + * @param + * @return + */ + @PostMapping("/deleteUserById/{id}") + public AjaxResult deleteUserById(@PathVariable Long id) { + + iSysUserService.deleteUserById(id); + return success("删除成功!"); + } + + +} diff --git a/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/mapper/SunAccountMapper.java b/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/mapper/SunAccountMapper.java new file mode 100644 index 0000000..5adcf0b --- /dev/null +++ b/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/mapper/SunAccountMapper.java @@ -0,0 +1,4 @@ +package com.bonus.zlpt.company.mapper; + +public interface SunAccountMapper { +} diff --git a/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/service/SunAccountService.java b/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/service/SunAccountService.java new file mode 100644 index 0000000..9ff1926 --- /dev/null +++ b/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/service/SunAccountService.java @@ -0,0 +1,4 @@ +package com.bonus.zlpt.company.service; + +public interface SunAccountService { +} diff --git a/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/service/impl/SunAccountServiceImpl.java b/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/service/impl/SunAccountServiceImpl.java new file mode 100644 index 0000000..2fa0987 --- /dev/null +++ b/zlpt-modules/zlpt-company/src/main/java/com/bonus/zlpt/company/service/impl/SunAccountServiceImpl.java @@ -0,0 +1,8 @@ +package com.bonus.zlpt.company.service.impl; + +import com.bonus.zlpt.company.service.SunAccountService; +import org.springframework.stereotype.Service; + +@Service +public class SunAccountServiceImpl implements SunAccountService { +} diff --git a/zlpt-modules/zlpt-company/src/main/resources/bootstrap.yml b/zlpt-modules/zlpt-company/src/main/resources/bootstrap.yml index 114cd9a..918ca90 100644 --- a/zlpt-modules/zlpt-company/src/main/resources/bootstrap.yml +++ b/zlpt-modules/zlpt-company/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 9201 + port: 9207 # Spring spring: diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/DevInfoController.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/DevInfoController.java index 9586809..7cf6768 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/DevInfoController.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/DevInfoController.java @@ -34,7 +34,7 @@ public class DevInfoController extends BaseController */ @RequiresPermissions("equip:info:list") @PostMapping("/list") - public TableDataInfo list(DevInfoVo devInfo) + public TableDataInfo list(@RequestBody DevInfoVo devInfo) { startPage(devInfo.getPageNum(), devInfo.getPageSize()); List list = devInfoService.selectDevInfoList(devInfo); diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/TypeInfoController.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/TypeInfoController.java index 47d38b9..062a379 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/TypeInfoController.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/TypeInfoController.java @@ -1,6 +1,7 @@ package com.bonus.zlpt.equip.controller; import java.util.List; +import java.util.Map; import javax.servlet.http.HttpServletResponse; import com.bonus.zlpt.common.core.utils.poi.ExcelUtil; import com.bonus.zlpt.common.core.web.controller.BaseController; @@ -22,6 +23,9 @@ import org.springframework.web.bind.annotation.RestController; import com.bonus.zlpt.common.core.domain.equip.TypeInfo; import com.bonus.zlpt.equip.service.ITypeInfoService; + + + /** * 设备类型Controller * diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/UpOffController.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/UpOffController.java index bc10571..43d1e72 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/UpOffController.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/controller/UpOffController.java @@ -122,9 +122,13 @@ public class UpOffController extends BaseController @RequiresPermissions("equip:off:edit") @Log(title = "设备上下架管理", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody UpOff upOff) + public AjaxResult edit(@RequestBody List upOffList) { - return toAjax(upOffService.updateUpOff(upOff)); + if (upOffList.size()==0){ + return warn("传入参数为空!"); + } + + return toAjax(upOffService.updateUpOff(upOffList)); } /** @@ -138,4 +142,11 @@ public class UpOffController extends BaseController { return toAjax(upOffService.deleteUpOffByIds(ids)); } + + + /** + * 批量上下架 + */ + + } diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/IDevInfoService.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/IDevInfoService.java index 6cf8282..5ab3008 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/IDevInfoService.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/IDevInfoService.java @@ -1,6 +1,8 @@ package com.bonus.zlpt.equip.service; import java.util.List; +import java.util.Map; + import com.bonus.zlpt.common.core.domain.equip.DevInfo; import com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo; @@ -59,4 +61,6 @@ public interface IDevInfoService * @return 结果 */ public int deleteDevInfoByMaId(Long maId); + + public Map sumType(); } diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/ITypeInfoService.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/ITypeInfoService.java index 1335128..a535952 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/ITypeInfoService.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/ITypeInfoService.java @@ -1,11 +1,8 @@ package com.bonus.zlpt.equip.service; import java.util.List; -import java.util.stream.Collectors; import cn.hutool.core.lang.tree.Tree; -import cn.hutool.core.lang.tree.TreeNode; -import cn.hutool.core.lang.tree.TreeUtil; import com.bonus.zlpt.common.core.domain.equip.TypeInfo; /** @@ -65,5 +62,4 @@ public interface ITypeInfoService public int deleteTypeInfoByTypeId(Long typeId); List> treeSelect(); - } diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/IUpOffService.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/IUpOffService.java index b0cfb94..8d37fc0 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/IUpOffService.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/IUpOffService.java @@ -52,11 +52,11 @@ public interface IUpOffService * 修改设备上下架管理 * - * @param upOff 设备上下架管理 + * @param upOffList 设备上下架管理 * @return 结果 */ - public int updateUpOff(UpOff upOff); + public int updateUpOff(List upOffList); /** * 批量删除设备上下架管理 diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/DevInfoServiceImpl.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/DevInfoServiceImpl.java index fe7a4c2..5eb66af 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/DevInfoServiceImpl.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/DevInfoServiceImpl.java @@ -1,10 +1,15 @@ package com.bonus.zlpt.equip.service.impl; +import java.util.IdentityHashMap; import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; import com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo; +import com.bonus.zlpt.common.core.domain.equip.TypeInfo; import com.bonus.zlpt.common.core.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -99,4 +104,23 @@ public class DevInfoServiceImpl implements IDevInfoService { return devInfoMapper.deleteDevInfoByMaId(maId); } + + @Override + public Map sumType() { + DevInfo devInfo = new DevInfo(); + Map sumTypeMap = new IdentityHashMap<>(); + //获取所有的装备信息 + List devInfoList = devInfoMapper.selectDevInfoList(devInfo); + //获取每种状态列表 + Map> groupedByMaStatus = devInfoList.stream() + .collect(Collectors.groupingBy(DevInfo::getMaStatus)); + //获取所有的key + Set keys = groupedByMaStatus.keySet(); + //根据key计算每种状态的数量 + for (String key : keys) { + List DevInfoList = groupedByMaStatus.get(key); + sumTypeMap.put(key,DevInfoList.size()); + } + return sumTypeMap; + } } diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/TypeInfoServiceImpl.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/TypeInfoServiceImpl.java index 045da8a..4338d94 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/TypeInfoServiceImpl.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/TypeInfoServiceImpl.java @@ -1,8 +1,6 @@ package com.bonus.zlpt.equip.service.impl; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; @@ -133,5 +131,4 @@ public class TypeInfoServiceImpl implements ITypeInfoService return node; }; } - } diff --git a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/UpOffServiceImpl.java b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/UpOffServiceImpl.java index 30ad18b..7087296 100644 --- a/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/UpOffServiceImpl.java +++ b/zlpt-modules/zlpt-equip/src/main/java/com/bonus/zlpt/equip/service/impl/UpOffServiceImpl.java @@ -83,14 +83,17 @@ public class UpOffServiceImpl implements IUpOffService * 修改设备上下架管理 * - * @param upOff 设备上下架管理 + * @param upOffList 设备上下架管理 * @return 结果 */ @Override - public int updateUpOff(UpOff upOff) + public int updateUpOff(List upOffList) { - return upOffMapper.updateUpOff(upOff); + for (int i = 0; i < upOffList.size(); i++) { + upOffMapper.updateUpOff(upOffList.get(i)); + } + return 1; } /** diff --git a/zlpt-modules/zlpt-file/src/main/java/com/bonus/zlpt/file/service/FileUploadTencentServiceImpl.java b/zlpt-modules/zlpt-file/src/main/java/com/bonus/zlpt/file/service/FileUploadTencentServiceImpl.java index 23662bd..3d8721c 100644 --- a/zlpt-modules/zlpt-file/src/main/java/com/bonus/zlpt/file/service/FileUploadTencentServiceImpl.java +++ b/zlpt-modules/zlpt-file/src/main/java/com/bonus/zlpt/file/service/FileUploadTencentServiceImpl.java @@ -12,6 +12,7 @@ import com.qcloud.cos.model.PutObjectRequest; import com.qcloud.cos.model.PutObjectResult; import com.qcloud.cos.region.Region; import org.joda.time.DateTime; +import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import java.io.InputStream; @@ -23,6 +24,7 @@ import java.io.InputStream; * @Create 2023/12/3 16:29 * @Version 1.0 */ +@Service public class FileUploadTencentServiceImpl implements FileUploadTencentService { /** diff --git a/zlpt-modules/zlpt-file/src/main/resources/bootstrap.yml b/zlpt-modules/zlpt-file/src/main/resources/bootstrap.yml index 1eb9c3a..95e6721 100644 --- a/zlpt-modules/zlpt-file/src/main/resources/bootstrap.yml +++ b/zlpt-modules/zlpt-file/src/main/resources/bootstrap.yml @@ -17,6 +17,13 @@ tencent: secretid: AKIDjJfoiPs9C2e1A5sSoSu77tTq212rTs56 # API密钥 secretkey: rVzLXWM0QceU9bqunTyHNFuMdiaFk4B6 +file: + path: 1 + prefix: 2 + domain: 3 + +fdfs: + domain: 3 # Spring diff --git a/zlpt-modules/zlpt-home/pom.xml b/zlpt-modules/zlpt-home/pom.xml index 12187af..fac8250 100644 --- a/zlpt-modules/zlpt-home/pom.xml +++ b/zlpt-modules/zlpt-home/pom.xml @@ -19,12 +19,7 @@ com.bonus.zlpt zlpt-common-swagger - - com.bonus.zlpt - zlpt-modules-file - 3.6.3 - compile - + diff --git a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/BmCarouselSetController.java b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/BmCarouselSetController.java index 5304dc0..680cc61 100644 --- a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/BmCarouselSetController.java +++ b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/BmCarouselSetController.java @@ -3,8 +3,7 @@ package com.bonus.zlpt.home.controller; import com.bonus.zlpt.common.core.web.controller.BaseController; import com.bonus.zlpt.common.core.web.domain.AjaxResult; import com.bonus.zlpt.common.core.web.page.TableDataInfo; -import com.bonus.zlpt.common.security.utils.SecurityUtils; -import com.bonus.zlpt.file.service.FileUploadTencentService; + import com.bonus.zlpt.home.pojo.BmCarouselSet; import com.bonus.zlpt.home.service.BmCarouselSetService; import org.springframework.web.bind.annotation.*; @@ -27,8 +26,7 @@ public class BmCarouselSetController extends BaseController { @Resource private BmCarouselSetService bmCarouselSetService; - @Resource - private FileUploadTencentService fileUploadTencentService; + /** * 获取轮播图列表 diff --git a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/MaDevInfoController.java b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/MaDevInfoController.java index eb53d58..3b769a3 100644 --- a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/MaDevInfoController.java +++ b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/MaDevInfoController.java @@ -1,17 +1,18 @@ package com.bonus.zlpt.home.controller; + import com.bonus.zlpt.common.core.domain.equip.DevInfo; import com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo; import com.bonus.zlpt.common.core.web.controller.BaseController; import com.bonus.zlpt.common.core.web.page.TableDataInfo; import com.bonus.zlpt.home.service.MaDevInfoService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import javax.annotation.Resource; import java.util.List; @RestController @@ -19,7 +20,7 @@ import java.util.List; public class MaDevInfoController extends BaseController { - @Resource + @Autowired private MaDevInfoService maDevInfoService; diff --git a/zlpt-modules/zlpt-home/src/main/resources/bootstrap.yml b/zlpt-modules/zlpt-home/src/main/resources/bootstrap.yml index 269d9af..434f11f 100644 --- a/zlpt-modules/zlpt-home/src/main/resources/bootstrap.yml +++ b/zlpt-modules/zlpt-home/src/main/resources/bootstrap.yml @@ -1,12 +1,12 @@ # Tomcat server: - port: 9201 + port: 9301 # Spring spring: application: # 应用名称 - name: zlpt-system + name: zlpt-home profiles: # 环境配置 active: zlpt_cloud_dev diff --git a/zlpt-modules/zlpt-home/src/main/resources/mapper/MaDevInfoMapper.xml b/zlpt-modules/zlpt-home/src/main/resources/mapper/MaDevInfoMapper.xml index 4eabadc..57aaa8f 100644 --- a/zlpt-modules/zlpt-home/src/main/resources/mapper/MaDevInfoMapper.xml +++ b/zlpt-modules/zlpt-home/src/main/resources/mapper/MaDevInfoMapper.xml @@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - +