Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
nmy 2023-12-04 19:39:17 +08:00
commit ffce4497ea
24 changed files with 179 additions and 33 deletions

View File

@ -51,6 +51,12 @@
<artifactId>zlpt-modules-system</artifactId>
<version>3.6.3</version>
</dependency>
<dependency>
<groupId>com.bonus.zlpt</groupId>
<artifactId>zlpt-modules-system</artifactId>
<version>3.6.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -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;
/**

View File

@ -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<SysUser> selectUserList() {
SysUser sysUser = new SysUser();
int parentId = Math.toIntExact(SecurityUtils.getUserId());
sysUser.setParentId(parentId);
List<SysUser> 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("删除成功!");
}
}

View File

@ -0,0 +1,4 @@
package com.bonus.zlpt.company.mapper;
public interface SunAccountMapper {
}

View File

@ -0,0 +1,4 @@
package com.bonus.zlpt.company.service;
public interface SunAccountService {
}

View File

@ -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 {
}

View File

@ -1,6 +1,6 @@
# Tomcat
server:
port: 9201
port: 9207
# Spring
spring:

View File

@ -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<DevInfoVo> list = devInfoService.selectDevInfoList(devInfo);

View File

@ -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
*

View File

@ -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<UpOff> 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));
}
/**
* 批量上下架
*/
}

View File

@ -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<String, Integer> sumType();
}

View File

@ -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<Tree<Long>> treeSelect();
}

View File

@ -52,11 +52,11 @@ public interface IUpOffService
* 修改设备上下架管理
*
* @param upOff 设备上下架管理
* @param upOffList 设备上下架管理
* @return 结果
*/
public int updateUpOff(UpOff upOff);
public int updateUpOff(List<UpOff> upOffList);
/**
* 批量删除设备上下架管理

View File

@ -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<String, Integer> sumType() {
DevInfo devInfo = new DevInfo();
Map<String, Integer> sumTypeMap = new IdentityHashMap<>();
//获取所有的装备信息
List<DevInfoVo> devInfoList = devInfoMapper.selectDevInfoList(devInfo);
//获取每种状态列表
Map<String, List<DevInfo>> groupedByMaStatus = devInfoList.stream()
.collect(Collectors.groupingBy(DevInfo::getMaStatus));
//获取所有的key
Set<String> keys = groupedByMaStatus.keySet();
//根据key计算每种状态的数量
for (String key : keys) {
List<DevInfo> DevInfoList = groupedByMaStatus.get(key);
sumTypeMap.put(key,DevInfoList.size());
}
return sumTypeMap;
}
}

View File

@ -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;
};
}
}

View File

@ -83,14 +83,17 @@ public class UpOffServiceImpl implements IUpOffService
* 修改设备上下架管理
*
* @param upOff 设备上下架管理
* @param upOffList 设备上下架管理
* @return 结果
*/
@Override
public int updateUpOff(UpOff upOff)
public int updateUpOff(List<UpOff> upOffList)
{
return upOffMapper.updateUpOff(upOff);
for (int i = 0; i < upOffList.size(); i++) {
upOffMapper.updateUpOff(upOffList.get(i));
}
return 1;
}
/**

View File

@ -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 {
/**

View File

@ -17,6 +17,13 @@ tencent:
secretid: AKIDjJfoiPs9C2e1A5sSoSu77tTq212rTs56
# API密钥
secretkey: rVzLXWM0QceU9bqunTyHNFuMdiaFk4B6
file:
path: 1
prefix: 2
domain: 3
fdfs:
domain: 3
# Spring

View File

@ -19,12 +19,7 @@
<groupId>com.bonus.zlpt</groupId>
<artifactId>zlpt-common-swagger</artifactId>
</dependency>
<dependency>
<groupId>com.bonus.zlpt</groupId>
<artifactId>zlpt-modules-file</artifactId>
<version>3.6.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
<properties>

View File

@ -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;
/**
* 获取轮播图列表

View File

@ -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;

View File

@ -1,12 +1,12 @@
# Tomcat
server:
port: 9201
port: 9301
# Spring
spring:
application:
# 应用名称
name: zlpt-system
name: zlpt-home
profiles:
# 环境配置
active: zlpt_cloud_dev

View File

@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.zlpt.home.mapper.MaDevInfoMapper">
<resultMap type="com.bonus.zlpt.common.core.domain.equip.DevInfo" id="MaDevInfoResult">
<!-- <resultMap type="import com.bonus.zlpt.common.core.domain.equip.DevInfo" id="MaDevInfoResult">
<id property="maId" column="ma_id" />
<result property="code" column="code" />
<result property="typeId" column="type_id" />
@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="creator" column="creator" />
<result property="deposit" column="deposit" />
<result property="isActive" column="is_active" />
</resultMap>
</resultMap>-->
<select id="getEquipmentList" resultType="com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo">

View File

@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="parentId" column="parent_id" />
<association property="dept" javaType="com.bonus.zlpt.system.api.domain.SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap>
@ -69,6 +70,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">
AND u.status = #{status}
</if>
<if test="parentId != null and parentId != ''">
AND u.parent_id = #{parentId}
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
@ -156,6 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="parentId != null and parentId != ''">parent_id,</if>
create_time
)values(
<if test="userId != null and userId != ''">#{userId},</if>
@ -170,6 +175,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="parentId != null and parentId != ''">#{parentId},</if>
sysdate()
)
</insert>