Merge remote-tracking branch 'origin/master'
| | |
| | | @Excel(name = "电话") |
| | | private String phone; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | // 集群模式 |
| | | // config.useClusterServers().addNodeAddress("192.168.110.188:7004", "192.168.110.188:7001"); |
| | | // 2.根据 Config 创建出 RedissonClient 示例。 |
| | | config.useSingleServer().setAddress("redis://192.168.110.235:6379").setPassword("123456"); |
| | | config.useSingleServer().setAddress("redis://127.0.0.1:6379").setPassword("123456"); |
| | | return Redisson.create(config); |
| | | } |
| | | |
| | |
| | | loginUser.setUsername(userName); |
| | | loginUser.setIpaddr(IpUtils.getIpAddr()); |
| | | refreshToken(loginUser); |
| | | |
| | | // Jwt存储信息 |
| | | Map<String, Object> claimsMap = new HashMap<String, Object>(); |
| | | claimsMap.put(SecurityConstants.USER_KEY, token); |
| | | claimsMap.put(SecurityConstants.DETAILS_USER_ID, userId); |
| | | claimsMap.put(SecurityConstants.DETAILS_USERNAME, userName); |
| | | |
| | | // 接口返回信息 |
| | | Map<String, Object> rspMap = new HashMap<String, Object>(); |
| | | rspMap.put("access_token", JwtUtils.createToken(claimsMap)); |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <module version="4"> |
| | | <component name="AdditionalModuleElements"> |
| | | <content url="file://$MODULE_DIR$" dumb="true"> |
| | | <sourceFolder url="file://$MODULE_DIR$/lib" type="java-resource" /> |
| | | </content> |
| | | </component> |
| | | </module> |
| | |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <!-- 分布式事务 --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-seata</artifactId> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- mybatis-plus --> |
| | | <dependency> |
| | |
| | | private HomeStatisticsService homeStatisticsService; |
| | | @PostMapping("/getHomeStatistics") |
| | | @ApiOperation(value = "首页统计接口") |
| | | public R<HomeStatisticsVO> getHomeStatistics(@RequestBody HomeStatisticsQuery homeStatisticsQuery) { |
| | | return R.ok(homeStatisticsService.getHomeStatistics(homeStatisticsQuery)); |
| | | public R<HomeStatisticsVO> getHomeStatistics(HomeStatisticsQuery homeStatisticsQuery) { |
| | | return R.ok(homeStatisticsService.getHomeStatistics(homeStatisticsQuery)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.management.controller; |
| | | |
| | | |
| | | import com.ruoyi.management.util.ObsUploadUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | @RestController |
| | | @RequestMapping("/base/oss") |
| | | @Api(value = "文件上传", tags = "文件上传", description = "文件上传") |
| | | public class OssController { |
| | | private static final String endpoint = "obs.cn-north-4.myhuaweicloud.com"; |
| | | private static final String accessKeyId = "DRJFJRVQ9KVLQUSJUROI"; |
| | | private static final String accessKeySecret = "3zpPkULh0a8CTTYjKL4f7szQZECkvVol4SwNab0f"; |
| | | private static final String bucketName = "jkjianshen"; |
| | | @PostMapping("/upload") |
| | | @ApiOperation(value = "文件上传") |
| | | public String upload(@RequestParam("file") MultipartFile file) throws IOException { |
| | | String s = ObsUploadUtil.obsUpload(file); |
| | | return s; |
| | | } |
| | | // @PostMapping("/uploadVideo") |
| | | // @ApiOperation(value = "视频上传",tags = "文件上传") |
| | | // public String uploadVideo(@RequestParam("file") MultipartFile file) throws Exception { |
| | | // // 获取文件名 |
| | | // String fileName = file.getOriginalFilename(); |
| | | // // 构建目标文件路径 |
| | | // String filePath = "/usr/local/temp" + fileName; |
| | | //// String filePath = "C:/temp/" + fileName; |
| | | // // 创建目标文件对象 |
| | | // File targetFile = new File(filePath); |
| | | // // 将 MultipartFile 内容写入目标文件 |
| | | // try (FileOutputStream fos = new FileOutputStream(targetFile)) { |
| | | // fos.write(file.getBytes()); |
| | | // } |
| | | // String s = UploadVideoUtil.endUpload(targetFile.toString(), UUIDUtil.getRandomCode(5)+fileName); |
| | | // // 创建要删除的文件对象 |
| | | // File fileToDelete = new File(targetFile.toString()); |
| | | // // 检查文件是否存在,并删除文件 |
| | | // if (fileToDelete.exists()) { |
| | | // fileToDelete.delete(); |
| | | // } |
| | | // return s; |
| | | // } |
| | | |
| | | // @PostMapping("/upload") |
| | | // @ApiOperation(value = "文件上传",tags = "文件上传") |
| | | // public ResponseEntity<String> upload(@RequestParam("file") MultipartFile file) throws IOException { |
| | | // // 创建 OSSClient 实例 |
| | | // OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret); |
| | | // |
| | | // |
| | | // // 创建 PutObjectRequest 对象 |
| | | // PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, file.getOriginalFilename(), file.getInputStream()); |
| | | // |
| | | // ObjectMetadata metadata = new ObjectMetadata(); |
| | | // // 取消文件缓存,文件每次都会从OSS服务器获取 |
| | | // metadata.setHeader("Cache-Control", "no-cache"); |
| | | // metadata.setHeader("Expires", "0"); |
| | | // |
| | | // |
| | | // // 上传文件 |
| | | // PutObjectResult putObjectResult = ossClient.putObject(putObjectRequest); |
| | | // |
| | | // // 关闭 OSSClient 实例 |
| | | // ossClient.shutdown(); |
| | | // |
| | | // String fileUrl = "https://" + bucketName + "." + endpoint + "/" + file.getOriginalFilename(); |
| | | // return ResponseEntity.ok(fileUrl); |
| | | // } |
| | | |
| | | |
| | | } |
| | |
| | | return R.ok(slGoodsShelfService.getGoodsShelfList(slGoodsShelfQuery)); |
| | | } |
| | | |
| | | @PostMapping("/getBGoodsShelfList") |
| | | @ApiOperation(value = "分页不获货架表管理") |
| | | public R<List<SlGoodsShelf>> getBGoodsShelfList(@RequestBody SlGoodsShelfQuery slGoodsShelfQuery) { |
| | | return R.ok(slGoodsShelfService.getBGoodsShelfList(slGoodsShelfQuery)); |
| | | } |
| | | |
| | | @PostMapping("/addSlGoodsShelf") |
| | | @ApiOperation(value = "添加/修改货架管理") |
| | | public R addSlGoodsShelf(@RequestBody SlGoodsShelfDTO slGoodsShelfDTO) { |
| | |
| | | } |
| | | |
| | | @PostMapping("/getStoreManagementimgOne") |
| | | @ApiOperation(value = "獲取仓库管理平面圖") |
| | | @ApiOperation(value = "获取仓库管理平面圖") |
| | | public R<SlStoreManagementImg> getStoreManagementimgOne(@RequestBody StoreManagementimgQuery storeManagementimgQuery) { |
| | | return R.ok(slStoreManagementImgService.getStoreManagementimgOne(storeManagementimgQuery)); |
| | | } |
| | |
| | | |
| | | @PostMapping("/uplSlVolumeProductionRk") |
| | | @ApiOperation(value = "修改入库批次管理") |
| | | public R uplSlVolumeProductionRk(@RequestBody List<SlVolumeProductionRkDTO> SlVolumeProductionRkDTO) { |
| | | slVolumeProductionRkService.uplSlVolumeProductionRk(SlVolumeProductionRkDTO); |
| | | public R uplSlVolumeProductionRk(@RequestBody UpdateRKDTO slVolumeProductionRkDTOS) { |
| | | slVolumeProductionRkService.uplSlVolumeProductionRk(slVolumeProductionRkDTOS.getSlVolumeProductionRkDTOS()); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | |
| | | * @author hjl |
| | | * @since 2024-06-25 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @Data |
| | | @TableName("sl_audit") |
| | | @ApiModel(value = "SlAudit对象", description = "审核记录") |
| | | public class SlAudit { |
New file |
| | |
| | | package com.ruoyi.management.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("添加入库批次DTO") |
| | | public class ADDRKDTO { |
| | | private List<SlVolumeProductionRkListDTO> slVolumeProductionRkListDTO; |
| | | } |
| | |
| | | @ApiModelProperty("货架id") |
| | | private Long shelfId; |
| | | |
| | | |
| | | /** 城市code */ |
| | | @ApiModelProperty("城市code") |
| | | private String cityCode; |
| | | |
| | | |
| | | /** 所属区县code */ |
| | | @ApiModelProperty("所属区县code") |
| | | private String countyCode; |
| | | |
| | | |
| | | /** 所属街道code */ |
| | | @ApiModelProperty("所属街道code") |
New file |
| | |
| | | package com.ruoyi.management.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("添加入库批次DTO") |
| | | public class UpdateRKDTO { |
| | | private List<SlVolumeProductionRkDTO> slVolumeProductionRkDTOS; |
| | | } |
| | |
| | | package com.ruoyi.management.domain.vo; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | @ApiModelProperty("发起人电话") |
| | | private String sysPhone; |
| | | |
| | | @ApiModelProperty("发起时间") |
| | | private DateTime createTime; |
| | | |
| | | @ApiModelProperty("入库管理id") |
| | | private Long rkId; |
| | |
| | | |
| | | @ApiModelProperty("1 待管理员审核,2 待主管审核,3 待主任审核, 4已完成, 5,已拒绝") |
| | | private Integer auditStatus; |
| | | @ApiModelProperty("1 待管理员审核,2 待主管审核,3 待主任审核, 4已完成, 5,已拒绝") |
| | | private Integer state; |
| | | |
| | | |
| | | @ApiModelProperty("申请人id") |
| | |
| | | public interface SlGoodsShelfService extends IService<SlGoodsShelf> { |
| | | PageDTO<SlGoodsShelfVO> getGoodsShelfList(@RequestBody SlGoodsShelfQuery slGoodsShelfQuery); |
| | | |
| | | List<SlGoodsShelf> getBGoodsShelfList(@RequestBody SlGoodsShelfQuery slGoodsShelfQuery); |
| | | |
| | | void addSlGoodsShelf(@RequestBody SlGoodsShelfDTO slGoodsShelfDTO); |
| | | |
| | | SlGoodsShelfVO getSlGoodsShelfOne( Long id); |
| | |
| | | repertoryZhai=repertoryZhai+li1.getCkNum(); |
| | | } |
| | | } |
| | | if (li.getRkPice() == null){ |
| | | li.setRkPice(BigDecimal.ZERO); |
| | | } |
| | | d=d+li.getRkPice().multiply(new BigDecimal(li.getRkPice().intValue())).doubleValue(); |
| | | li.setRepertoryZhai(repertoryZhai); |
| | | } |
| | |
| | | // 处理键和值 |
| | | Long a=0L; |
| | | for (homeVO vo : value) { |
| | | if (vo.getGoodsMaterialsNum()== null){ |
| | | vo.setGoodsMaterialsNum(0L); |
| | | } |
| | | a=a+vo.getGoodsMaterialsNum(); |
| | | } |
| | | goodsMaterialsNmVO.setGoodsMaterialsNum(a); |
| | |
| | | // 处理键和值 |
| | | Long a=0L; |
| | | for (homeVO vo : value) { |
| | | if (vo.getGoodsMaterialsNum()== null){ |
| | | vo.setGoodsMaterialsNum(0L); |
| | | } |
| | | a=a+vo.getGoodsMaterialsNum(); |
| | | } |
| | | goodsMaterialsNmVO1.setGoodsMaterialsNum(a); |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | goodsSkuIdList1.add(0L); |
| | | wrapper.in(SlAudit::getSysId,goodsSkuIdList1); |
| | | } |
| | | if (!data.getUserType().equals(00)){ |
| | | if (!data.getUserType().equals("00")){ |
| | | wrapper.in(SlAudit::getShenhId,userid); |
| | | } |
| | | List state=new ArrayList<>(); |
| | | state.add(1); |
| | | state.add(2); |
| | | state.add(3); |
| | | state.add(4); |
| | | state.add(5); |
| | | wrapper.eq(SlAudit::getState,state); |
| | | wrapper.eq(SlAudit::getType,auditRecordListQuery.getType()); |
| | | wrapper.eq( SlAudit::getDelFlag,0); |
| | | wrapper.eq(SlAudit::getDelFlag,0); |
| | | wrapper.orderByDesc(SlAudit::getCreateTime); |
| | | Page<SlAudit> page1 = this.page(page, wrapper); |
| | | PageDTO<SlAuditVO> slEquipmentVOPageDTO = PageDTO.of(page1, SlAuditVO.class); |
| | | List<SlAuditVO> list = slEquipmentVOPageDTO.getList(); |
| | | for (SlAuditVO sl:list){ |
| | | SlAuditVO slAuditVO=new SlAuditVO(); |
| | | SysUser data2 = sysUserClient.getSysUser(sl.getSysId()).getData(); |
| | | slAuditVO.setSysPhone(data2.getPhonenumber()); |
| | | slAuditVO.setSysName(data2.getNickName()); |
| | | sl.setSysPhone(data2.getPhonenumber()); |
| | | sl.setSysName(data2.getNickName()); |
| | | SlStoreManagement byId = slStoreManagementService.getById(sl.getManagementId()); |
| | | slAuditVO.setStoreManagementName(byId.getStoreManagementName()); |
| | | slAuditVO.setStoreManagementNo(byId.getStoreManagementNo()); |
| | | sl.setStoreManagementName(byId.getStoreManagementName()); |
| | | sl.setStoreManagementNo(byId.getStoreManagementNo()); |
| | | if (sl.getZymanagementId()!=null){ |
| | | SlStoreManagement byId1 = slStoreManagementService.getById(sl.getZymanagementId()); |
| | | slAuditVO.setBstoreManagementName(byId1.getStoreManagementName()); |
| | | slAuditVO.setBstoreManagementNo(byId1.getStoreManagementNo()); |
| | | sl.setBstoreManagementName(byId1.getStoreManagementName()); |
| | | sl.setBstoreManagementNo(byId1.getStoreManagementNo()); |
| | | } |
| | | } |
| | | return slEquipmentVOPageDTO; |
| | |
| | | } |
| | | this.removeById(page1); |
| | | } |
| | | |
| | | |
| | | SlAudit slAudit=new SlAudit(); |
| | | slAudit.setType(slAuditDTO.getType()); |
| | | slAudit.setState(1); |
| | | slAudit.setCreateTime(new Date()); |
| | | slAudit.setRkId(slAuditDTO.getRkId()); |
| | | if (slAudit.getType()==1){ |
| | | SlVolumeProductionRkgl slVolumeProductionRkgl = slVolumeProductionRkglMapper.selectById(slAuditDTO.getRkId()); |
| | |
| | | slAuditRecord1.setShenhId(byId.getCompetentId()); |
| | | slAuditRecord1.setType(2); |
| | | slAuditRecord1.setState(1); |
| | | slAuditRecordMapper.insert(slAuditRecord); |
| | | slAuditRecordMapper.insert(slAuditRecord1); |
| | | |
| | | SlAuditRecord slAuditRecord2=new SlAuditRecord(); |
| | | slAuditRecord2.setAuditId(slAudit.getId()); |
| | | slAuditRecord2.setShenhId(byId.getDirectorId()); |
| | | slAuditRecord2.setType(3); |
| | | slAuditRecord2.setState(1); |
| | | slAuditRecordMapper.insert(slAuditRecord); |
| | | slAuditRecordMapper.insert(slAuditRecord2); |
| | | } |
| | | if (slAudit.getType()==2){ |
| | | |
| | |
| | | slAuditRecord1.setShenhId(byId.getCompetentId()); |
| | | slAuditRecord1.setType(2); |
| | | slAuditRecord1.setState(1); |
| | | slAuditRecordMapper.insert(slAuditRecord); |
| | | slAuditRecordMapper.insert(slAuditRecord1); |
| | | |
| | | SlAuditRecord slAuditRecord2=new SlAuditRecord(); |
| | | slAuditRecord2.setAuditId(slAudit.getId()); |
| | | slAuditRecord2.setShenhId(byId.getDirectorId()); |
| | | slAuditRecord2.setType(3); |
| | | slAuditRecord2.setState(1); |
| | | slAuditRecordMapper.insert(slAuditRecord); |
| | | slAuditRecordMapper.insert(slAuditRecord2); |
| | | } |
| | | if (slAudit.getType()==3){ |
| | | SlVolumeProductionZygl slVolumeProductionZygl = slVolumeProductionZyglMapper.selectById(slAuditDTO.getRkId()); |
| | |
| | | slAuditRecord1.setShenhId(byId.getCompetentId()); |
| | | slAuditRecord1.setType(2); |
| | | slAuditRecord1.setState(1); |
| | | slAuditRecordMapper.insert(slAuditRecord); |
| | | slAuditRecordMapper.insert(slAuditRecord1); |
| | | |
| | | SlAuditRecord slAuditRecord2=new SlAuditRecord(); |
| | | slAuditRecord2.setAuditId(slAudit.getId()); |
| | | slAuditRecord2.setShenhId(byId.getDirectorId()); |
| | | slAuditRecord2.setType(3); |
| | | slAuditRecord2.setState(1); |
| | | slAuditRecordMapper.insert(slAuditRecord); |
| | | slAuditRecordMapper.insert(slAuditRecord2); |
| | | } |
| | | |
| | | } |
| | |
| | | public PageDTO<SlGoodsMaterialsVO> getGoodSmaterialsList(SlGoodsMaterialsQuery slGoodsMaterialsQuery) { |
| | | Page<SlGoodsMaterials> page = new Page<>(slGoodsMaterialsQuery.getPageCurr(), slGoodsMaterialsQuery.getPageSize()); |
| | | LambdaQueryWrapper< SlGoodsMaterials> wrapper= Wrappers.lambdaQuery(); |
| | | if (slGoodsMaterialsQuery.getGoodsMaterialsName()!=null&&slGoodsMaterialsQuery.getGoodsMaterialsName()!=""){ |
| | | wrapper.eq(SlGoodsMaterials::getGoodsMaterialsName,slGoodsMaterialsQuery.getGoodsMaterialsName()); |
| | | if (slGoodsMaterialsQuery.getGoodsMaterialsName()!=null&& !slGoodsMaterialsQuery.getGoodsMaterialsName().isEmpty()){ |
| | | wrapper.like(SlGoodsMaterials::getGoodsMaterialsName,slGoodsMaterialsQuery.getGoodsMaterialsName()); |
| | | } |
| | | if (slGoodsMaterialsQuery.getIsConsume()!=0){ |
| | | wrapper.eq(SlGoodsMaterials::getIsConsume,slGoodsMaterialsQuery.getIsConsume()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<SlGoodsShelf> getBGoodsShelfList(SlGoodsShelfQuery slGoodsShelfQuery) { |
| | | Long userid = SecurityUtils.getUserId(); |
| | | SysUser data = sysUserClient.getSysUser(userid).getData(); |
| | | |
| | | LambdaQueryWrapper<SlStoreManagement> wrapper= Wrappers.lambdaQuery(); |
| | | if(slGoodsShelfQuery.getStoreManagementName()!=null&&slGoodsShelfQuery.getStoreManagementName()!=""){ |
| | | wrapper.eq(SlStoreManagement::getStoreManagementName,slGoodsShelfQuery.getStoreManagementName()); |
| | | } |
| | | if (slGoodsShelfQuery.getStoreManagementNumber()!=0 && slGoodsShelfQuery.getStoreManagementNumber()!=null){ |
| | | wrapper.eq(SlStoreManagement::getStoreManagementGrade,slGoodsShelfQuery.getStoreManagementNumber()); |
| | | } |
| | | wrapper.eq(SlStoreManagement::getStoreManagementGrade,data.getRoleType()); |
| | | wrapper.eq(SlStoreManagement::getDelFlag,0); |
| | | List<SlStoreManagement> page1 = SlStoreManagementService.list(wrapper); |
| | | Set<Long> slStoreManagementIdList = null; |
| | | slStoreManagementIdList = page1.stream().map(SlStoreManagement::getId) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | |
| | | LambdaQueryWrapper< SlGoodsShelf> wrapper1= Wrappers.lambdaQuery(); |
| | | wrapper1.like(SlGoodsShelf::getGoodsShelfName,slGoodsShelfQuery.getGoodsShelfName()); |
| | | if(slGoodsShelfQuery.getStoreManagementName()!=null&&slGoodsShelfQuery.getStoreManagementName()!="") { |
| | | if (slStoreManagementIdList.size() > 0) { |
| | | wrapper1.in(SlGoodsShelf::getStoreManagementId, slStoreManagementIdList); |
| | | } else { |
| | | slStoreManagementIdList=new HashSet<>(); |
| | | slStoreManagementIdList.add(0L); |
| | | wrapper1.in(SlGoodsShelf::getStoreManagementId, slStoreManagementIdList); |
| | | } |
| | | } |
| | | wrapper1.eq( SlGoodsShelf::getDelFlag,0); |
| | | wrapper1.orderByDesc(SlGoodsShelf::getCreateTime); |
| | | List<SlGoodsShelf> page2 = this.list(wrapper1); |
| | | |
| | | return page2; |
| | | } |
| | | |
| | | @Override |
| | | public void addSlGoodsShelf(SlGoodsShelfDTO slGoodsShelfDTO) { |
| | | if (slGoodsShelfDTO.getId()==null){ |
| | | SlGoodsShelf slGoodsShelf=new SlGoodsShelf(); |
| | |
| | | if (slGoodsShelf!=null){ |
| | | list.setGoodsShelfName(slGoodsShelf.getGoodsShelfName()); |
| | | } |
| | | |
| | | |
| | | LambdaQueryWrapper<SlGoodsShelf> wrapper5= Wrappers.lambdaQuery(); |
| | | wrapper5.eq(SlGoodsShelf::getStoreManagementId,byId.getManagementId()); |
| | | wrapper5.eq(SlGoodsShelf::getStoreManagementNumber,list.getStoreManagementNumber()); |
| | |
| | | .collect(Collectors.toSet()); |
| | | |
| | | LambdaQueryWrapper< SlVolumeProductionRkgl> wrapper1= Wrappers.lambdaQuery(); |
| | | if (getVolumeProductionRkQuery.getPresentState()!=0&&getVolumeProductionRkQuery.getPresentState()!=null){ |
| | | if (getVolumeProductionRkQuery.getPresentState()!=null && getVolumeProductionRkQuery.getPresentState()!=0){ |
| | | wrapper1.eq(SlVolumeProductionRkgl::getPresentState,getVolumeProductionRkQuery.getPresentState()); |
| | | } |
| | | if (getVolumeProductionRkQuery.getAuditStatus()!=0&&getVolumeProductionRkQuery.getAuditStatus()!=null) { |
| | | if (getVolumeProductionRkQuery.getAuditStatus()!=null && getVolumeProductionRkQuery.getAuditStatus()!=0) { |
| | | wrapper1.eq(SlVolumeProductionRkgl::getAuditStatus, getVolumeProductionRkQuery.getAuditStatus()); |
| | | } |
| | | if (goodsSkuIdList.size()>0){ |
| | |
| | | this.save(slVolumeProductionRkgl); |
| | | }else{ |
| | | slVolumeProductionRkgl = this.getById(volumeProductionRkglDTO.getId()); |
| | | slVolumeProductionRkgl.setPresentState(1); |
| | | slVolumeProductionRkgl.setAuditStatus(1); |
| | | if (volumeProductionRkglDTO.getSource()!=null){ |
| | | slVolumeProductionRkgl.setSource(volumeProductionRkglDTO.getSource()); |
| | | } |
New file |
| | |
| | | package com.ruoyi.management.util; |
| | | |
| | | import com.obs.services.ObsClient; |
| | | import com.obs.services.model.ObjectMetadata; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.UUID; |
| | | |
| | | public class ObsUploadUtil { |
| | | |
| | | public static String endPoint = "obs.cn-southwest-2.myhuaweicloud.com"; |
| | | public static String accessKeyId = "LP9N1TLAYN8ERS1PVIYK"; |
| | | public static String accessKeySecret = "bV55lFHi1cG0SYBvnab8yIgDX6etKRSLh5j1gkPR"; |
| | | public static String bucketName = "haitunyingyu"; |
| | | public static String oss_domain = "https://haitunyingyu.obs.cn-southwest-2.myhuaweicloud.com/"; |
| | | // 创建ObsClient实例 |
| | | public static ObsClient obsClient = new ObsClient(accessKeyId, accessKeySecret, endPoint); |
| | | |
| | | public static String obsUpload(MultipartFile file) throws IOException{ |
| | | //CommonsMultipartFile file = (CommonsMultipartFile)multipartFile; |
| | | String fileName = ""; |
| | | if(file!=null && !"".equals(file.getOriginalFilename()) && file.getOriginalFilename()!=null){ |
| | | InputStream content = file.getInputStream();//获得指定文件的输入流 |
| | | ObjectMetadata meta = new ObjectMetadata();// 创建上传Object的Metadata |
| | | meta.setContentLength(file.getSize()); // 必须设置ContentLength |
| | | String originalFilename = file.getOriginalFilename(); |
| | | if (originalFilename.contains("apk")){ |
| | | fileName = "bf2fe5c5499341e5bc0d56c0c7d5fb2e.apk"; |
| | | System.err.println("apk"); |
| | | }else{ |
| | | fileName = UUID.randomUUID().toString().replaceAll("-","") + originalFilename.subSequence(originalFilename.lastIndexOf("."), originalFilename.length()); |
| | | } |
| | | obsClient.putObject(bucketName,"admin/"+fileName,content,meta);// 上传Object. |
| | | if(fileName != null && !"".equals(fileName)){ |
| | | System.out.println(fileName); |
| | | fileName = oss_domain+"admin/"+fileName; |
| | | } |
| | | } |
| | | return fileName; |
| | | } |
| | | |
| | | /** |
| | | * 删除某个Object |
| | | * |
| | | * @param bucketUrl |
| | | * @return |
| | | */ |
| | | public static boolean deleteObject(String bucketUrl) { |
| | | try { |
| | | bucketUrl=bucketUrl.replace(oss_domain+"web",""); |
| | | // 删除Object. |
| | | obsClient.deleteObject(bucketName, bucketUrl); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } finally { |
| | | //ossClient.shutdown(); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | // public static void createBucket(String bucketName) |
| | | // { |
| | | // //初始化 OSSClient |
| | | //// ossClient = new OssClient(endPoint, accessKeyId, accessKeySecret); |
| | | // |
| | | // // 新建一个Bucket |
| | | // Bucket bucket = ossClient.createBucket(bucketName); |
| | | // System.out.println(bucket.getName()); |
| | | // System.out.println(bucket.getCreationDate()); |
| | | // } |
| | | // |
| | | // public static void main(String[] args) { |
| | | // OssUploadUtil.createBucket("ssfdfsd"); |
| | | // } |
| | | } |
| | |
| | | <version>1.2.47</version> |
| | | </dependency> |
| | | |
| | | <!-- 分布式事务 --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-seata</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.domain.dto.deptQuery; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import io.seata.common.util.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | |
| | | |
| | | PageInfo<SysDept> page = deptService.page(pageInfo, |
| | | new LambdaQueryWrapper<SysDept>().orderByDesc(SysDept::getCreateTime) |
| | | .like(StringUtils.isNotBlank(dept.getDeptName()), SysDept::getDeptName, |
| | | .like(StringUtils.hasLength(dept.getDeptName()), SysDept::getDeptName, |
| | | dept.getDeptName()).eq(SysDept::getDelFlag, "0")); |
| | | return AjaxResult.success(page); |
| | | } |
| | |
| | | /** |
| | | * 查询部门列表(排除节点) |
| | | */ |
| | | |
| | | /** |
| | | * 根据部门编号获取详细信息 |
| | | */ |
| | |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import io.seata.common.util.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | |
| | | PageInfo<SysRole> page = roleService.page(pageInfo, |
| | | new LambdaQueryWrapper<SysRole>().ne(SysRole::getRoleId, 20) |
| | | .like(StringUtils.isNotBlank(query.getRoleName()), SysRole::getRoleName, |
| | | .like(StringUtils.hasLength(query.getRoleName()), SysRole::getRoleName, |
| | | query.getRoleName()).eq(SysRole::getDelFlag, "0")); |
| | | return AjaxResult.success(page); |
| | | } |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="contacts" column="contacts" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="roleType" column="roleType" /> |
| | | <result property="objectId" column="objectId" /> |
| | | <result property="provinceName" column="province_name" /> |
| | | <result property="provinceCode" column="province_code" /> |
| | | <result property="cityName" column="city_name" /> |
| | | <result property="cityCode" column="city_code" /> |
| | | <result property="countyName" column="county_name" /> |
| | | <result property="countyCode" column="county_code" /> |
| | | <result property="townName" column="town_name" /> |
| | | <result property="townCode" column="town_code" /> |
| | | <result property="userType" column="user_type"/> |
| | | <result property="roleType" column="roleType"/> |
| | | <association property="dept" column="dept_id" javaType="com.ruoyi.system.api.domain.SysDept" resultMap="deptResult" /> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> |
| | | </resultMap> |
| | |
| | | |
| | | <sql id="selectUserVo"> |
| | | select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | d.dept_id, d.dept_name,u.contacts,u.province_name,u.province_code,u.city_name,u.city_code,u.county_name,u.county_code,u.town_name,u.town_code, |
| | | d.dept_id, d.dept_name,u.contacts, |
| | | u.province_name , |
| | | u.province_code , |
| | | u.city_name , |
| | | u.city_code , |
| | | u.county_name , |
| | | u.county_code , |
| | | u.town_name , |
| | | u.town_code , |
| | | r.role_id, |
| | | r.role_name, |
| | | r.role_key, |
| | | r.role_sort, |
| | | r.data_scope, |
| | | r.status as role_status, |
| | | u.roleType as roleType, |
| | | u.roleType, |
| | | u.objectId AS objectId, |
| | | u.user_type |
| | | from sys_user u |