Commit 305d1126 authored by 竹天卫's avatar 竹天卫

存货出库 安全台账

parent 121aaf13
......@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@Api(tags = "数据统计")
@RestController
@RequestMapping("/business/t-processes-truck")
@RequestMapping("/business/data-statistics")
@Validated
public class DataStatisticsController {
......
......@@ -46,7 +46,7 @@ public class LoginController {
public R testSave() {
//用户
TSysUser user = new TSysUser();
user.setName("竹天卫").setLoginID("zhutianwei").setPassword("123456").setDeptID("1").setRoleID(1);
user.setName("竹天卫").setLoginID("zhutianwei"+userService.count()+1).setPassword("123456").setDeptID("1").setRoleID(1);
Boolean ref = userService.save(user);
Rcode.NOT_SQL.assertIsFalse(!ref);
//设备台账
......
......@@ -10,6 +10,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
......@@ -23,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
@Api(tags = "设备管理")
@RestController
@RequestMapping("/business/t-equipment-account")
@Validated
public class TEquipmentAccountController {
@Autowired
......
......@@ -3,6 +3,8 @@ package cn.wise.sc.acquisition.business.mapper;
import cn.wise.sc.acquisition.business.entity.TSysPower;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
* <p>
* Mapper 接口
......@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface TSysPowerMapper extends BaseMapper<TSysPower> {
List<TSysPower> getPowerByRole(Integer roleId);
}
......@@ -2,4 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.wise.sc.acquisition.business.mapper.TSysPowerMapper">
<select id="getPowerByRole" resultType="cn.wise.sc.acquisition.business.entity.TSysPower">
select p.*
from T_Sys_Power p
left join T_Sys_RolePower rp on rp.PowerID = p.ID
where rp.RoleID = #{params.roleId}
</select>
</mapper>
package cn.wise.sc.acquisition.business.model;
import cn.wise.sc.acquisition.business.entity.TSysPower;
import cn.wise.sc.acquisition.business.entity.TSysUser;
import lombok.Data;
import java.util.List;
@Data
public class LoginUser extends TSysUser {
// private List<SysPermission> permissions;
private String token;
/**
* 登陆时间戳(毫秒)
......@@ -17,8 +20,17 @@ public class LoginUser extends TSysUser {
*/
private Long expireTime;
private String postName;
// SysRole roleList;
/**
* 角色
*/
private String roleName;
/**
* 部门
*/
private String deptName;
/**
* 功能
*/
private List<TSysPower> powerList;
}
package cn.wise.sc.acquisition.business.model.query;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description: 人员管理附件
* @author: wlb
* @create: 2020-10-19
**/
@Data
@ApiModel("人员管理附件")
public class SysUserEnclosureQuery {
@ApiModelProperty("用户id")
private Integer userId;
@ApiModelProperty("文件名")
private String alias;
@ApiModelProperty("扩展名")
private String extName;
@ApiModelProperty("路径")
private String enclosureUrl;
}
......@@ -14,7 +14,7 @@ import java.time.LocalDateTime;
* @since 2021-04-23
*/
@Data
@ApiModel("设备台账")
@ApiModel("设备台账Query")
public class TEquipmentAccountQuery {
......
package cn.wise.sc.acquisition.business.model.query;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author ztw
* @since 2021-04-27
*/
@Data
@ApiModel("存货出库Query")
public class TMaterialOutQuery {
/**
* ID号
*/
@ApiModelProperty("出库表id")
private String uid;
/**
* 设备编码
*/
@ApiModelProperty("设备编码")
private String equipmentID;
/**
* 设备名称
*/
@ApiModelProperty("设备名称")
private String equipmentName;
/**
* 工序名称
*/
@ApiModelProperty("工序名称")
private String processesName;
/**
* 材料消耗的类型,包括燃料及动力、润滑察试、配件、工具、火工材料、电力和其它等
*/
@ApiModelProperty("材料消耗的类型,包括燃料及动力、润滑察试、配件、工具、火工材料、电力和其它等")
private String consumeType;
/**
* 材料消耗日期
*/
@ApiModelProperty("材料消耗日期")
private LocalDateTime consumeDate;
/**
* 消耗材料的品名
*/
@ApiModelProperty("消耗材料的品名")
private String name;
/**
* 消耗材料的数量
*/
@ApiModelProperty("消耗材料的数量")
private Float amount;
/**
* 消耗材料的单价
*/
@ApiModelProperty("消耗材料的单价")
private Float price;
/**
* 花费的金额:Amount*Price
*/
@ApiModelProperty("花费的金额:Amount*Price")
private Float total;
/**
* 用途:生产,保养、维修
*/
@ApiModelProperty("用途:生产,保养、维修")
private String purpose;
/**
* 材料发放人
*/
@ApiModelProperty("材料发放人")
private String clffr;
/**
* 材料领用人
*/
@ApiModelProperty("材料领用人")
private String cllyr;
/**
* 备注
*/
@ApiModelProperty("备注")
private String bz;
/**
* 日期标记,如:2021年01月
*/
@ApiModelProperty("日期标记,如:2021年01月")
private String tag;
}
package cn.wise.sc.acquisition.business.model.query;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author ztw
* @since 2021-04-27
*/
@Data
@ApiModel("安全台账Query")
public class TSafeTroubleQuery {
/**
* ID号
*/
@ApiModelProperty("安全台账表id")
private String uid;
/**
* 检查人
*/
@ApiModelProperty("检查人")
private String jcr;
/**
* 发现日期
*/
@ApiModelProperty("发现日期")
private LocalDateTime fxrq;
/**
* 隐患位置
*/
@ApiModelProperty("隐患位置")
private String yhwz;
/**
* 隐患描述
*/
@ApiModelProperty("隐患描述")
private String yhms;
/**
* 隐患级别
*/
@ApiModelProperty("隐患级别")
private String yhjb;
/**
* 整改措施
*/
@ApiModelProperty("整改措施")
private String zgcs;
/**
* 整改要求
*/
@ApiModelProperty("整改要求")
private String zgyq;
/**
* 整改负责人
*/
@ApiModelProperty("整改负责人")
private String zgfzr;
/**
* 复查人
*/
@ApiModelProperty("复查人")
private String fcr;
/* @ApiModelProperty("隐患照片")
private List<MultipartFile> photoList;*/
}
package cn.wise.sc.acquisition.business.model.vo;
import cn.wise.sc.acquisition.business.entity.TSafeTroubleImg;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* @description:
* @author: ztw
* @create: 2021-04-25
**/
@Data
@ApiModel("安全台账Vo")
public class TSafeTroubleVo {
/**
* ID号
*/
@ApiModelProperty("Uid")
private String Uid;
/**
* 检查人
*/
@ApiModelProperty("检查人")
private String Jcr;
/**
* 发现日期
*/
@ApiModelProperty("发现日期")
private LocalDateTime Fxrq;
/**
* 隐患位置
*/
@ApiModelProperty("隐患位置")
private String Yhwz;
/**
* 隐患描述
*/
@ApiModelProperty("隐患描述")
private String Yhms;
/**
* 隐患级别
*/
@ApiModelProperty("隐患级别")
private String Yhjb;
/**
* 整改措施
*/
@ApiModelProperty("整改措施")
private String Zgcs;
/**
* 整改要求
*/
@ApiModelProperty("整改要求")
private String Zgyq;
/**
* 整改负责人
*/
@ApiModelProperty("整改负责人")
private String Zgfzr;
/**
* 复查人
*/
@ApiModelProperty("复查人")
private String Fcr;
@ApiModelProperty("隐患照片")
List<TSafeTroubleImg> oldImgs = new ArrayList<>();
@ApiModelProperty("整改后照片")
List<TSafeTroubleImg> newImgs = new ArrayList<>();
}
......@@ -2,12 +2,16 @@ package cn.wise.sc.acquisition.business.service.impl;
import cn.wise.im.common.http.R;
import cn.wise.sc.acquisition.business.constant.Rcode;
import cn.wise.sc.acquisition.business.entity.TSysUser;
import cn.wise.sc.acquisition.business.entity.*;
import cn.wise.sc.acquisition.business.mapper.TSysDeptMapper;
import cn.wise.sc.acquisition.business.mapper.TSysPowerMapper;
import cn.wise.sc.acquisition.business.mapper.TSysRoleMapper;
import cn.wise.sc.acquisition.business.mapper.TSysUserMapper;
import cn.wise.sc.acquisition.business.model.LoginUser;
import cn.wise.sc.acquisition.business.service.ITSysUserService;
import cn.wise.sc.acquisition.business.util.JwtUtil;
import cn.wise.sc.acquisition.business.util.RedisUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -15,6 +19,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
......@@ -30,6 +35,15 @@ public class TSysUserServiceImpl extends ServiceImpl<TSysUserMapper, TSysUser> i
@Resource
private TSysUserMapper userMapper;
@Resource
private TSysRoleMapper roleMapper;
@Resource
private TSysDeptMapper deptMapper;
@Resource
private TSysPowerMapper powerMapper;
@Resource
private HttpServletRequest request;
@Autowired
......@@ -56,8 +70,18 @@ public class TSysUserServiceImpl extends ServiceImpl<TSysUserMapper, TSysUser> i
TSysUser sysUser = userMapper.selectById(Integer.valueOf(map.get("id").toString()));
LoginUser loginUser = new LoginUser();
BeanUtils.copyProperties(sysUser, loginUser);
//角色
TSysRole role = roleMapper.selectById(sysUser.getRoleID());
Rcode.NOT_FOUND.assertNotNull(role);
loginUser.setRoleName(role.getName());
//部门
TSysDept dept = deptMapper.selectById(sysUser.getDeptID());
Rcode.NOT_FOUND.assertNotNull(dept);
loginUser.setDeptName(dept.getName());
//功能权限
List<TSysPower> powerList = powerMapper.getPowerByRole(role.getId());
loginUser.setPowerList(powerList);
return R.ok(loginUser);
}
......
......@@ -192,4 +192,46 @@ public class ImageUtil {
//String encode = Base64.encode(stream.toByteArray());
return stream.toByteArray();
}
/**
* 判断图片大小
*
* @param len
* 文件长度
* @param size
* 限制大小
* @param unit
* 限制单位(B,K,M,G)
* @return
*/
public static boolean checkFileSize(Long len, int size, String unit) {
// long len = file.length();
double fileSize = 0;
if ("B".equals(unit.toUpperCase())) {
fileSize = (double) len;
} else if ("K".equals(unit.toUpperCase())) {
fileSize = (double) len / 1024;
} else if ("M".equals(unit.toUpperCase())) {
fileSize = (double) len / 1048576;
} else if ("G".equals(unit.toUpperCase())) {
fileSize = (double) len / 1073741824;
}
if (fileSize > size) {
return false;
}
return true;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment