【admin】新增#工厂管理
parent
0047457806
commit
a4e765e8d1
|
|
@ -89,9 +89,36 @@ public class PlantController {
|
||||||
*/
|
*/
|
||||||
@Log(title = "工厂管理删除")
|
@Log(title = "工厂管理删除")
|
||||||
@PostMapping("/del")
|
@PostMapping("/del")
|
||||||
public Object del(@Validated(value = PlantParam.delete.class) @RequestBody PlantParam plantParam) {
|
public Object del(@RequestBody PlantParam plantParam) {
|
||||||
iPlantService.del(Math.toIntExact(plantParam.getId()));
|
iPlantService.del(plantParam.getIds());
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂管理绑定用户
|
||||||
|
*
|
||||||
|
* @author hcy
|
||||||
|
* @param plantParam 参数
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
|
@Log(title = "工厂管理绑定用户")
|
||||||
|
@PostMapping("/boundUser")
|
||||||
|
public Object boundUser(@RequestBody PlantParam plantParam) {
|
||||||
|
iPlantService.boundUser(plantParam);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂管理解除绑定
|
||||||
|
*
|
||||||
|
* @author hcy
|
||||||
|
* @param plantParam 参数
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
|
@Log(title = "工厂管理解除绑定")
|
||||||
|
@PostMapping("/plantUnbound")
|
||||||
|
public Object plantUnbound(@RequestBody PlantParam plantParam) {
|
||||||
|
iPlantService.plantUnbound(plantParam);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.hcy.admin.vo.plant.PlantListVo;
|
||||||
import com.hcy.admin.vo.plant.PlantDetailVo;
|
import com.hcy.admin.vo.plant.PlantDetailVo;
|
||||||
import com.hcy.common.core.PageResult;
|
import com.hcy.common.core.PageResult;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -52,8 +53,19 @@ public interface IPlantService {
|
||||||
* 工厂管理删除
|
* 工厂管理删除
|
||||||
*
|
*
|
||||||
* @author hcy
|
* @author hcy
|
||||||
* @param id 主键ID
|
* @param ids 主键ID
|
||||||
*/
|
*/
|
||||||
void del(Integer id);
|
void del(List<Integer> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂管理绑定用户
|
||||||
|
* @param plantParam
|
||||||
|
*/
|
||||||
|
void boundUser(PlantParam plantParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂管理解除绑定
|
||||||
|
* @param plantParam
|
||||||
|
*/
|
||||||
|
void plantUnbound(PlantParam plantParam);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,22 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.yulichang.query.MPJQueryWrapper;
|
import com.github.yulichang.query.MPJQueryWrapper;
|
||||||
import com.hcy.admin.service.plant.IPlantService;
|
import com.hcy.admin.service.plant.IPlantService;
|
||||||
|
import com.hcy.admin.service.region.IDevRegionService;
|
||||||
import com.hcy.admin.validate.common.PageParam;
|
import com.hcy.admin.validate.common.PageParam;
|
||||||
import com.hcy.admin.validate.plant.PlantParam;
|
import com.hcy.admin.validate.plant.PlantParam;
|
||||||
import com.hcy.admin.vo.plant.PlantListVo;
|
import com.hcy.admin.vo.plant.PlantListVo;
|
||||||
import com.hcy.admin.vo.plant.PlantDetailVo;
|
import com.hcy.admin.vo.plant.PlantDetailVo;
|
||||||
|
import com.hcy.common.constant.GlobalConstant;
|
||||||
import com.hcy.common.core.PageResult;
|
import com.hcy.common.core.PageResult;
|
||||||
|
import com.hcy.common.entity.SparePartAudit.SparePartAudit;
|
||||||
import com.hcy.common.entity.plant.Plant;
|
import com.hcy.common.entity.plant.Plant;
|
||||||
|
import com.hcy.common.entity.sparePart.SparePart;
|
||||||
|
import com.hcy.common.entity.system.SystemAuthAdmin;
|
||||||
|
import com.hcy.common.entity.user.User;
|
||||||
|
import com.hcy.common.entity.warehouse.Warehouse;
|
||||||
import com.hcy.common.mapper.plant.PlantMapper;
|
import com.hcy.common.mapper.plant.PlantMapper;
|
||||||
|
import com.hcy.common.mapper.system.SystemAuthAdminMapper;
|
||||||
|
import com.hcy.common.mapper.user.UserMapper;
|
||||||
import com.hcy.common.utils.ArrayUtil;
|
import com.hcy.common.utils.ArrayUtil;
|
||||||
import com.hcy.common.utils.TimeUtil;
|
import com.hcy.common.utils.TimeUtil;
|
||||||
import com.hcy.common.utils.UrlUtil;
|
import com.hcy.common.utils.UrlUtil;
|
||||||
|
|
@ -32,6 +41,12 @@ public class PlantServiceImpl implements IPlantService {
|
||||||
@Resource
|
@Resource
|
||||||
PlantMapper plantMapper;
|
PlantMapper plantMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
SystemAuthAdminMapper systemAuthAdminMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IDevRegionService regionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工厂管理列表
|
* 工厂管理列表
|
||||||
*
|
*
|
||||||
|
|
@ -60,6 +75,23 @@ public class PlantServiceImpl implements IPlantService {
|
||||||
PlantListVo vo = new PlantListVo();
|
PlantListVo vo = new PlantListVo();
|
||||||
BeanUtils.copyProperties(item, vo);
|
BeanUtils.copyProperties(item, vo);
|
||||||
vo.setCreateTime(TimeUtil.timestampToDate(item.getCreateTime()));
|
vo.setCreateTime(TimeUtil.timestampToDate(item.getCreateTime()));
|
||||||
|
if(item.getAuthAdminId() != null){
|
||||||
|
//字符串拆分获取用户id
|
||||||
|
String[] userid = item.getAuthAdminId().split(",");
|
||||||
|
List<SystemAuthAdmin> authAdminList = new ArrayList<>();
|
||||||
|
for (String uid : userid) {
|
||||||
|
SystemAuthAdmin authAdmin = systemAuthAdminMapper.selectOne(
|
||||||
|
new QueryWrapper<SystemAuthAdmin>()
|
||||||
|
.eq("id", uid)
|
||||||
|
.eq("is_delete", 0)
|
||||||
|
.last("limit 1"));
|
||||||
|
if(authAdmin != null){
|
||||||
|
authAdmin.setAvatar(UrlUtil.toAbsoluteUrl(authAdmin.getAvatar()));
|
||||||
|
authAdminList.add(authAdmin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vo.setAuthAdminList(authAdminList);
|
||||||
|
}
|
||||||
list.add(vo);
|
list.add(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -85,6 +117,29 @@ public class PlantServiceImpl implements IPlantService {
|
||||||
|
|
||||||
PlantDetailVo vo = new PlantDetailVo();
|
PlantDetailVo vo = new PlantDetailVo();
|
||||||
BeanUtils.copyProperties(model, vo);
|
BeanUtils.copyProperties(model, vo);
|
||||||
|
vo.setCreateTime(TimeUtil.timestampToDate(model.getCreateTime()));
|
||||||
|
vo.setUpdateTime(TimeUtil.timestampToDate(model.getUpdateTime()));
|
||||||
|
|
||||||
|
Map<Long, String> regionMap = regionService.getRegionMap();
|
||||||
|
vo.setProvince(regionMap.get(model.getProvinceId()));
|
||||||
|
vo.setCity(regionMap.get(model.getCityId()));
|
||||||
|
vo.setDistrict(regionMap.get(model.getDistrictId()));
|
||||||
|
if(model.getAuthAdminId() != null){
|
||||||
|
//字符串拆分获取用户id
|
||||||
|
String[] userid = model.getAuthAdminId().split(",");
|
||||||
|
List<SystemAuthAdmin> authAdminList = new ArrayList<>();
|
||||||
|
for (String uid : userid) {
|
||||||
|
SystemAuthAdmin authAdmin = systemAuthAdminMapper.selectOne(
|
||||||
|
new QueryWrapper<SystemAuthAdmin>()
|
||||||
|
.eq("id", uid)
|
||||||
|
.eq("is_delete", 0)
|
||||||
|
.last("limit 1"));
|
||||||
|
authAdmin.setAvatar(UrlUtil.toAbsoluteUrl(authAdmin.getAvatar()));
|
||||||
|
authAdminList.add(authAdmin);
|
||||||
|
}
|
||||||
|
vo.setAuthAdminList(authAdminList);
|
||||||
|
}
|
||||||
|
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,16 +152,17 @@ public class PlantServiceImpl implements IPlantService {
|
||||||
@Override
|
@Override
|
||||||
public void add(PlantParam plantParam) {
|
public void add(PlantParam plantParam) {
|
||||||
Plant model = new Plant();
|
Plant model = new Plant();
|
||||||
model.setUserId(plantParam.getUserId());
|
|
||||||
model.setName(plantParam.getName());
|
model.setName(plantParam.getName());
|
||||||
model.setNumberUsers(plantParam.getNumberUsers());
|
|
||||||
model.setSort(plantParam.getSort());
|
model.setSort(plantParam.getSort());
|
||||||
model.setRemark(plantParam.getRemark());
|
model.setRemark(plantParam.getRemark());
|
||||||
model.setLongitude(plantParam.getLongitude());
|
model.setLongitude(plantParam.getLongitude());
|
||||||
model.setDimensionality(plantParam.getDimensionality());
|
model.setLatitude(plantParam.getLatitude());
|
||||||
model.setRegion(plantParam.getRegion());
|
model.setProvinceId(plantParam.getProvinceId());
|
||||||
|
model.setCityId(plantParam.getCityId());
|
||||||
|
model.setDistrictId(plantParam.getDistrictId());
|
||||||
model.setDetailedAddress(plantParam.getDetailedAddress());
|
model.setDetailedAddress(plantParam.getDetailedAddress());
|
||||||
model.setCreateTime(System.currentTimeMillis() / 1000);
|
model.setCreateTime(System.currentTimeMillis() / 1000);
|
||||||
|
|
||||||
plantMapper.insert(model);
|
plantMapper.insert(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,15 +183,16 @@ public class PlantServiceImpl implements IPlantService {
|
||||||
Assert.notNull(model, "数据不存在!");
|
Assert.notNull(model, "数据不存在!");
|
||||||
|
|
||||||
model.setId(plantParam.getId());
|
model.setId(plantParam.getId());
|
||||||
model.setUserId(plantParam.getUserId());
|
|
||||||
model.setName(plantParam.getName());
|
model.setName(plantParam.getName());
|
||||||
model.setNumberUsers(plantParam.getNumberUsers());
|
|
||||||
model.setSort(plantParam.getSort());
|
model.setSort(plantParam.getSort());
|
||||||
model.setRemark(plantParam.getRemark());
|
model.setRemark(plantParam.getRemark());
|
||||||
model.setLongitude(plantParam.getLongitude());
|
model.setLongitude(plantParam.getLongitude());
|
||||||
model.setDimensionality(plantParam.getDimensionality());
|
model.setLatitude(plantParam.getLatitude());
|
||||||
model.setRegion(plantParam.getRegion());
|
model.setProvinceId(plantParam.getProvinceId());
|
||||||
|
model.setCityId(plantParam.getCityId());
|
||||||
|
model.setDistrictId(plantParam.getDistrictId());
|
||||||
model.setDetailedAddress(plantParam.getDetailedAddress());
|
model.setDetailedAddress(plantParam.getDetailedAddress());
|
||||||
|
|
||||||
model.setUpdateTime(System.currentTimeMillis() / 1000);
|
model.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||||
plantMapper.updateById(model);
|
plantMapper.updateById(model);
|
||||||
}
|
}
|
||||||
|
|
@ -144,20 +201,94 @@ public class PlantServiceImpl implements IPlantService {
|
||||||
* 工厂管理删除
|
* 工厂管理删除
|
||||||
*
|
*
|
||||||
* @author hcy
|
* @author hcy
|
||||||
* @param id 主键ID
|
* @param ids 主键ID
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void del(Integer id) {
|
public void del(List<Integer> ids) {
|
||||||
|
List<Plant> modelList = plantMapper.selectList(
|
||||||
|
new QueryWrapper<Plant>()
|
||||||
|
.in("id", ids));
|
||||||
|
|
||||||
|
|
||||||
|
Assert.notNull(modelList, "数据不存在!");
|
||||||
|
// GlobalConstant.NOT_DELETE 调用未删除常量
|
||||||
|
// GlobalConstant.DELETE 删除标识
|
||||||
|
|
||||||
|
for (Plant plant : modelList) {
|
||||||
|
plant.setIsDelete(GlobalConstant.DELETE);
|
||||||
|
plant.setDeleteTime(System.currentTimeMillis() / 1000);
|
||||||
|
plantMapper.updateById(plant);// 进行伪删除 根据id把is_delete修改成1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂管理绑定用户
|
||||||
|
*
|
||||||
|
* @param plantParam
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void boundUser(PlantParam plantParam) {
|
||||||
Plant model = plantMapper.selectOne(
|
Plant model = plantMapper.selectOne(
|
||||||
new QueryWrapper<Plant>()
|
new QueryWrapper<Plant>()
|
||||||
.eq("id", id)
|
.eq("id", plantParam.getId())
|
||||||
.eq("is_delete", 0)
|
.eq("is_delete", 0)
|
||||||
.last("limit 1"));
|
.last("limit 1"));
|
||||||
|
|
||||||
Assert.notNull(model, "数据不存在!");
|
Assert.notNull(model, "数据不存在!");
|
||||||
|
|
||||||
model.setIsDelete(1);
|
List<SystemAuthAdmin> authAdminList = plantParam.getAuthAdminList();
|
||||||
model.setDeleteTime(System.currentTimeMillis() / 1000);
|
if(authAdminList != null){
|
||||||
|
int userNumber = 0;
|
||||||
|
// 使用StringBuilder来拼接id值
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (SystemAuthAdmin authAdmin : authAdminList) {
|
||||||
|
sb.append(authAdmin.getId()).append(",");
|
||||||
|
userNumber = userNumber + 1;
|
||||||
|
}
|
||||||
|
model.setNumberUsers((long) userNumber);
|
||||||
|
sb.deleteCharAt(sb.length() - 1); // 删除最后一个逗号
|
||||||
|
model.setAuthAdminId(String.valueOf(sb));// 备件审核id
|
||||||
|
}else{
|
||||||
|
model.setNumberUsers(null);
|
||||||
|
model.setAuthAdminId(null);// 备件审核id
|
||||||
|
}
|
||||||
|
|
||||||
|
model.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||||
|
plantMapper.updateById(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂管理解除绑定
|
||||||
|
*
|
||||||
|
* @param plantParam
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void plantUnbound(PlantParam plantParam) {
|
||||||
|
Plant model = plantMapper.selectOne(
|
||||||
|
new QueryWrapper<Plant>()
|
||||||
|
.eq("id", plantParam.getId())
|
||||||
|
.eq("is_delete", 0)
|
||||||
|
.last("limit 1"));
|
||||||
|
|
||||||
|
Assert.notNull(model, "数据不存在!");
|
||||||
|
|
||||||
|
List<SystemAuthAdmin> authAdminList = plantParam.getAuthAdminList();
|
||||||
|
if(authAdminList != null){
|
||||||
|
int userNumber = 0;
|
||||||
|
// 使用StringBuilder来拼接id值
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (SystemAuthAdmin authAdmin : authAdminList) {
|
||||||
|
sb.append(authAdmin.getId()).append(",");
|
||||||
|
userNumber = userNumber + 1;
|
||||||
|
}
|
||||||
|
model.setNumberUsers((long) userNumber);
|
||||||
|
sb.deleteCharAt(sb.length() - 1); // 删除最后一个逗号
|
||||||
|
model.setAuthAdminId(String.valueOf(sb));// 备件审核id
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
model.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||||
plantMapper.updateById(model);
|
plantMapper.updateById(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,14 +15,17 @@ import com.hcy.admin.service.system.ISystemAuthPermService;
|
||||||
import com.hcy.admin.service.system.ISystemAuthRoleService;
|
import com.hcy.admin.service.system.ISystemAuthRoleService;
|
||||||
import com.hcy.admin.validate.common.PageParam;
|
import com.hcy.admin.validate.common.PageParam;
|
||||||
import com.hcy.admin.validate.system.SystemAuthAdminParam;
|
import com.hcy.admin.validate.system.SystemAuthAdminParam;
|
||||||
|
import com.hcy.admin.vo.plant.PlantListVo;
|
||||||
import com.hcy.admin.vo.system.SystemAuthAdminVo;
|
import com.hcy.admin.vo.system.SystemAuthAdminVo;
|
||||||
import com.hcy.admin.vo.system.SystemAuthRoleVo;
|
import com.hcy.admin.vo.system.SystemAuthRoleVo;
|
||||||
import com.hcy.admin.vo.system.SystemAuthSelfVo;
|
import com.hcy.admin.vo.system.SystemAuthSelfVo;
|
||||||
import com.hcy.common.config.GlobalConfig;
|
import com.hcy.common.config.GlobalConfig;
|
||||||
import com.hcy.common.core.PageResult;
|
import com.hcy.common.core.PageResult;
|
||||||
|
import com.hcy.common.entity.plant.Plant;
|
||||||
import com.hcy.common.entity.system.SystemAuthAdmin;
|
import com.hcy.common.entity.system.SystemAuthAdmin;
|
||||||
import com.hcy.common.entity.system.SystemAuthMenu;
|
import com.hcy.common.entity.system.SystemAuthMenu;
|
||||||
import com.hcy.common.exception.OperateException;
|
import com.hcy.common.exception.OperateException;
|
||||||
|
import com.hcy.common.mapper.plant.PlantMapper;
|
||||||
import com.hcy.common.mapper.system.SystemAuthAdminMapper;
|
import com.hcy.common.mapper.system.SystemAuthAdminMapper;
|
||||||
import com.hcy.common.mapper.system.SystemAuthMenuMapper;
|
import com.hcy.common.mapper.system.SystemAuthMenuMapper;
|
||||||
import com.hcy.common.utils.*;
|
import com.hcy.common.utils.*;
|
||||||
|
|
@ -51,6 +54,9 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
||||||
@Resource
|
@Resource
|
||||||
ISystemAuthPermService iSystemAuthPermService;
|
ISystemAuthPermService iSystemAuthPermService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
PlantMapper plantMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据账号查找管理员
|
* 根据账号查找管理员
|
||||||
*
|
*
|
||||||
|
|
@ -96,23 +102,60 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
||||||
new Page<>(page, limit),
|
new Page<>(page, limit),
|
||||||
SystemAuthAdminVo.class,
|
SystemAuthAdminVo.class,
|
||||||
mpjQueryWrapper);
|
mpjQueryWrapper);
|
||||||
|
long total = 0;
|
||||||
|
List<SystemAuthAdminVo> list = new LinkedList<>();
|
||||||
|
for (SystemAuthAdminVo item : iPage.getRecords()) {
|
||||||
|
|
||||||
for (SystemAuthAdminVo vo : iPage.getRecords()) {
|
if (item.getId() == 1) {
|
||||||
if (vo.getId() == 1) {
|
item.setRole("系统管理员");
|
||||||
vo.setRole("系统管理员");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vo.getDept() == null) {
|
if (item.getDept() == null) {
|
||||||
vo.setDept("");
|
item.setDept("");
|
||||||
}
|
}
|
||||||
|
|
||||||
vo.setAvatar(UrlUtil.toAbsoluteUrl(vo.getAvatar()));
|
item.setAvatar(UrlUtil.toAbsoluteUrl(item.getAvatar()));
|
||||||
vo.setCreateTime(TimeUtil.timestampToDate(vo.getCreateTime()));
|
item.setCreateTime(TimeUtil.timestampToDate(item.getCreateTime()));
|
||||||
vo.setUpdateTime(TimeUtil.timestampToDate(vo.getUpdateTime()));
|
item.setUpdateTime(TimeUtil.timestampToDate(item.getUpdateTime()));
|
||||||
vo.setLastLoginTime(TimeUtil.timestampToDate(vo.getLastLoginTime()));
|
item.setLastLoginTime(TimeUtil.timestampToDate(item.getLastLoginTime()));
|
||||||
|
|
||||||
|
SystemAuthAdminVo vo = new SystemAuthAdminVo();
|
||||||
|
BeanUtils.copyProperties(item, vo);
|
||||||
|
//只查询没有被该工厂绑定的用户
|
||||||
|
if(params.get("plantId") != null && params.get("plantId") != ""){
|
||||||
|
Plant model = plantMapper.selectOne(
|
||||||
|
new QueryWrapper<Plant>()
|
||||||
|
.eq("id", params.get("plantId"))
|
||||||
|
.eq("is_delete", 0)
|
||||||
|
.last("limit 1"));
|
||||||
|
Assert.notNull(model, "数据不存在!");
|
||||||
|
if(model.getAuthAdminId() != null){
|
||||||
|
//字符串拆分获取用户id
|
||||||
|
String[] userid = model.getAuthAdminId().split(",");
|
||||||
|
// 查询没有被任何工厂绑定的用户
|
||||||
|
QueryWrapper<SystemAuthAdmin> userQueryWrapper = new QueryWrapper<>();
|
||||||
|
userQueryWrapper.notIn("id", userid);
|
||||||
|
List<SystemAuthAdmin> systemAuthAdmins = systemAuthAdminMapper.selectList(userQueryWrapper);
|
||||||
|
for (SystemAuthAdmin systemAuthAdmin : systemAuthAdmins) {
|
||||||
|
if(item.getId() == systemAuthAdmin.getId()){
|
||||||
|
list.add(vo);
|
||||||
|
total = total + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
list.add(vo);
|
||||||
|
total = total + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
list.add(vo);
|
||||||
|
total = total + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return PageResult.iPageHandle(iPage);
|
return PageResult.iPageHandle(total, iPage.getCurrent(), iPage.getSize(), list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.hcy.admin.validate.plant;
|
package com.hcy.admin.validate.plant;
|
||||||
|
|
||||||
import com.hcy.common.entity.SparePartAudit.SparePartAudit;
|
|
||||||
import com.hcy.common.entity.user.User;
|
import com.hcy.common.entity.system.SystemAuthAdmin;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.hibernate.validator.constraints.Length;
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
@ -27,43 +27,35 @@ public class PlantParam implements Serializable {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@NotNull(message = "userId参数缺失", groups = {create.class, update.class})
|
private String authAdminId;
|
||||||
@DecimalMin(value = "0", message = "userId参数值不能少于0", groups = {create.class, update.class})
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@NotNull(message = "name参数缺失", groups = {create.class, update.class})
|
@NotNull(message = "name参数缺失", groups = {create.class, update.class})
|
||||||
@Length(max = 255, message = "name参数不能超出255个字符", groups = {create.class, update.class})
|
@Length(max = 255, message = "name参数不能超出255个字符", groups = {create.class, update.class})
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@NotNull(message = "numberUsers参数缺失", groups = {create.class, update.class})
|
|
||||||
@DecimalMin(value = "0", message = "numberUsers参数值不能少于0", groups = {create.class, update.class})
|
|
||||||
private Long numberUsers;
|
private Long numberUsers;
|
||||||
|
|
||||||
@NotNull(message = "sort参数缺失", groups = {create.class, update.class})
|
@NotNull(message = "sort参数缺失", groups = {create.class, update.class})
|
||||||
@DecimalMin(value = "0", message = "sort参数值不能少于0", groups = {create.class, update.class})
|
@DecimalMin(value = "0", message = "sort参数值不能少于0", groups = {create.class, update.class})
|
||||||
private Long sort;
|
private Long sort;
|
||||||
|
|
||||||
@NotNull(message = "remark参数缺失", groups = {create.class, update.class})
|
|
||||||
@Length(max = 255, message = "remark参数不能超出255个字符", groups = {create.class, update.class})
|
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
@NotNull(message = "longitude参数缺失", groups = {create.class, update.class})
|
@NotNull(message = "longitude参数缺失", groups = {create.class, update.class})
|
||||||
@DecimalMin(value = "0", message = "longitude参数值不能少于0", groups = {create.class, update.class})
|
@DecimalMin(value = "0", message = "longitude参数值不能少于0", groups = {create.class, update.class})
|
||||||
private Long longitude;
|
private String longitude;
|
||||||
|
|
||||||
@NotNull(message = "dimensionality参数缺失", groups = {create.class, update.class})
|
private String latitude; // 纬度
|
||||||
@DecimalMin(value = "0", message = "dimensionality参数值不能少于0", groups = {create.class, update.class})
|
private Long provinceId; //省id
|
||||||
private Long dimensionality;
|
private Long cityId; //市id
|
||||||
|
private Long districtId; //区id
|
||||||
@NotNull(message = "region参数缺失", groups = {create.class, update.class})
|
|
||||||
@Length(max = 255, message = "region参数不能超出255个字符", groups = {create.class, update.class})
|
|
||||||
private String region;
|
|
||||||
|
|
||||||
@NotNull(message = "detailedAddress参数缺失", groups = {create.class, update.class})
|
@NotNull(message = "detailedAddress参数缺失", groups = {create.class, update.class})
|
||||||
@Length(max = 255, message = "detailedAddress参数不能超出255个字符", groups = {create.class, update.class})
|
@Length(max = 255, message = "detailedAddress参数不能超出255个字符", groups = {create.class, update.class})
|
||||||
private String detailedAddress;
|
private String detailedAddress;
|
||||||
|
|
||||||
private String createTime;
|
private String createTime;
|
||||||
private List<User> userList; //待绑定的用户
|
private List<SystemAuthAdmin> authAdminList; //待绑定的用户
|
||||||
|
private List<Integer> ids; //批量删除
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,5 +52,5 @@ public class SparePartParam implements Serializable {
|
||||||
|
|
||||||
private BigDecimal unitPrice;
|
private BigDecimal unitPrice;
|
||||||
|
|
||||||
private List<Integer> ids; //备件id集合
|
private List<Integer> ids; //批量删除
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.hcy.admin.vo.plant;
|
package com.hcy.admin.vo.plant;
|
||||||
|
|
||||||
|
import com.hcy.common.entity.system.SystemAuthAdmin;
|
||||||
import com.hcy.common.entity.user.User;
|
import com.hcy.common.entity.user.User;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
@ -15,17 +16,22 @@ public class PlantDetailVo implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private Long id; // 主键id
|
private Long id; // 主键id
|
||||||
private Long userId; // 用户id
|
private String authAdminId; // 用户id
|
||||||
private String name; // 工厂名称
|
private String name; // 工厂名称
|
||||||
private Long numberUsers; // 管理员人数
|
private Long numberUsers; // 管理员人数
|
||||||
private Long sort; // 排序
|
private Long sort; // 排序
|
||||||
private String remark; // 备注
|
private String remark; // 备注
|
||||||
private Long longitude; // 经度
|
private String longitude; // 经度
|
||||||
private Long dimensionality; // 维度
|
private String latitude; // 纬度
|
||||||
private String region; // 所属区域
|
private Long provinceId; //省id
|
||||||
|
private Long cityId; //市id
|
||||||
|
private Long districtId; //区id
|
||||||
|
private String province; //省
|
||||||
|
private String city; //市
|
||||||
|
private String district; //区
|
||||||
private String detailedAddress; // 详细地址
|
private String detailedAddress; // 详细地址
|
||||||
private Long createTime; // 创建时间
|
private String createTime; // 创建时间
|
||||||
private Long updateTime; // 更新时间
|
private String updateTime; // 更新时间
|
||||||
private List<User> userList; //待绑定的用户
|
private List<SystemAuthAdmin> authAdminList; //待绑定的用户
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.hcy.admin.vo.plant;
|
package com.hcy.admin.vo.plant;
|
||||||
|
|
||||||
|
import com.hcy.common.entity.system.SystemAuthAdmin;
|
||||||
import com.hcy.common.entity.user.User;
|
import com.hcy.common.entity.user.User;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
@ -15,12 +16,12 @@ public class PlantListVo implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private Long id; // 主键id
|
private Long id; // 主键id
|
||||||
private Long userId; // 用户id
|
private String authAdminId; // 用户id
|
||||||
private String name; // 工厂名称
|
private String name; // 工厂名称
|
||||||
private Long numberUsers; // 管理员人数
|
private Long numberUsers; // 管理员人数
|
||||||
private Long sort; // 排序
|
private Long sort; // 排序
|
||||||
private String remark; // 备注
|
private String remark; // 备注
|
||||||
private String createTime; // 创建时间
|
private String createTime; // 创建时间
|
||||||
private List<User> userList; //待绑定的用户
|
|
||||||
|
|
||||||
|
private List<SystemAuthAdmin> authAdminList; //待绑定的用户
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
package com.hcy.common.entity.plant;
|
package com.hcy.common.entity.plant;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -16,14 +19,18 @@ public class Plant implements Serializable {
|
||||||
|
|
||||||
@TableId(value="id", type= IdType.AUTO)
|
@TableId(value="id", type= IdType.AUTO)
|
||||||
private Long id; // 主键id
|
private Long id; // 主键id
|
||||||
private Long userId; // 用户id
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
|
private String authAdminId; // 管理员id
|
||||||
private String name; // 工厂名称
|
private String name; // 工厂名称
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
private Long numberUsers; // 管理员人数
|
private Long numberUsers; // 管理员人数
|
||||||
private Long sort; // 排序
|
private Long sort; // 排序
|
||||||
private String remark; // 备注
|
private String remark; // 备注
|
||||||
private Long longitude; // 经度
|
private String longitude; // 经度
|
||||||
private Long dimensionality; // 维度
|
private String latitude; // 纬度
|
||||||
private String region; // 所属区域
|
private Long provinceId; //省id
|
||||||
|
private Long cityId; //市id
|
||||||
|
private Long districtId; //区id
|
||||||
private String detailedAddress; // 详细地址
|
private String detailedAddress; // 详细地址
|
||||||
private Integer isDelete; // 是否删除: [0=否, 1=是]
|
private Integer isDelete; // 是否删除: [0=否, 1=是]
|
||||||
private Long createTime; // 创建时间
|
private Long createTime; // 创建时间
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue