| | |
| | | import com.zt.core.oss.service.ISysOssConfigService; |
| | | import com.zt.core.oss.service.ISysOssService; |
| | | import com.zt.life.core.constant.Cache; |
| | | import com.zt.life.export.service.DownloadService; |
| | | import com.zt.life.oss.OssEncryptService; |
| | | import com.zt.life.sys.dao.SysOssConfigDao; |
| | | import com.zt.life.sys.dto.OssDto; |
| | | import com.zt.life.sys.mapstruct.OssExMapper; |
| | | import com.zt.life.sys.model.SysOssConfig; |
| | | import com.zt.life.util.ZipCipherUtil; |
| | | import com.zt.modules.oss.model.SysOss; |
| | | import com.zt.modules.oss.service.SysOssService; |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private SysOssService sysOssServices; |
| | | |
| | | @Value("${zt.oss.local-path}") |
| | | private String localPath; |
| | | |
| | | @Value("${data.key}") |
| | | private String key; |
| | | |
| | | @Autowired |
| | | private OssEncryptService ossEncryptService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | |
| | | return baseDao.selectList(new QueryWrapper<SysOssConfig>().eq(Constant.TableColumn.IS_DELETE, Constant.Bool.NO).lambda() |
| | | .eq(SysOssConfig::getBusiType, busiType)); |
| | | } |
| | | |
| | | public void downloadFilesByosList(HttpServletRequest request, HttpServletResponse response, List<SysOss> list, String projectName) { |
| | | try { |
| | | String uuid = UUIDUtil.getUUID(); |
| | | String remoteFileFullPath = Paths.get(localPath, "temp", uuid).toString(); |
| | | Files.createDirectories(Paths.get(remoteFileFullPath)); |
| | | |
| | | for (SysOss so : list) { |
| | | try { |
| | | String localFileFullPath = Paths.get(localPath, so.getPath()).toString(); |
| | | File localFile = new File(localFileFullPath); |
| | | if (localFile.exists()) { |
| | | try (InputStream in = ossEncryptService.decrypt(localFile); |
| | | BufferedInputStream bis = new BufferedInputStream(in); |
| | | BufferedOutputStream bos = new BufferedOutputStream( |
| | | new FileOutputStream(remoteFileFullPath + File.separator + so.getName()))) { |
| | | |
| | | byte[] buffer = new byte[1024]; |
| | | int len; |
| | | while ((len = bis.read(buffer)) != -1) { |
| | | bos.write(buffer, 0, len); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); // 或者记录日志 |
| | | } |
| | | } |
| | | |
| | | String fileNameZip = Paths.get(localPath, "temp", uuid + ".zip").toString(); |
| | | new ZipCipherUtil().encryptZip(remoteFileFullPath, fileNameZip, key); |
| | | |
| | | File zipFile = new File(fileNameZip); |
| | | response.reset(); |
| | | response.setContentLength((int) zipFile.length()); |
| | | response.setContentType("application/octet-stream;charset=UTF-8"); |
| | | String encodedFilename = DownloadService.getNameEncoder(request, projectName + ".zip"); |
| | | response.addHeader("Content-Disposition", "attachment;filename=" + encodedFilename); |
| | | |
| | | try (FileInputStream fileInputStream = new FileInputStream(zipFile); |
| | | ServletOutputStream outputStream = response.getOutputStream()) { |
| | | |
| | | byte[] buffers = new byte[1024]; |
| | | int length; |
| | | while ((length = fileInputStream.read(buffers)) > 0) { |
| | | outputStream.write(buffers, 0, length); |
| | | } |
| | | |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); // 或者记录日志 |
| | | } finally { |
| | | FileUtils.deleteQuietly(new File(remoteFileFullPath)); |
| | | FileUtils.deleteQuietly(new File(fileNameZip));// 删除临时文件夹及其内容 |
| | | } |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); // 或者记录日志 |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.zt.life.util; |
| | | |
| | | public class ZipCipherUtil { |
| | | /** |
| | | * 对目录srcFile下的所有文件目录进行先压缩后加密,然后保存为destfile |
| | | * |
| | | * @param srcFile |
| | | * 要操作的文件或文件夹 |
| | | * @param destfile |
| | | * 压缩加密后存放的文件 |
| | | * @param keyStr |
| | | * 密钥 |
| | | */ |
| | | public void encryptZip(String srcFile, String destfile, String keyStr) { |
| | | try { |
| | | /* File temp = new File(UUID.randomUUID().toString() + ".zip"); |
| | | temp.deleteOnExit(); |
| | | // 先压缩文件 |
| | | // new ZipUtil().zip(srcFile, temp.getAbsolutePath()); |
| | | cn.hutool.core.util.ZipUtil.zip(srcFile, temp.getAbsolutePath(), false); |
| | | // 对文件加密 |
| | | // FileAESUtil.EncFile(temp.getAbsolutePath(), destfile); |
| | | new CipherUtil().encrypt(temp.getAbsolutePath(), destfile, keyStr); |
| | | temp.delete();*/ |
| | | cn.hutool.core.util.ZipUtil.zip(srcFile, destfile, false); |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 对文件srcfile进行先解密后解压缩,然后解压缩到目录destfile下 |
| | | * |
| | | * @param srcfile |
| | | * 要解密和解压缩的文件名 |
| | | * @param destfile |
| | | * 解压缩后的目录 |
| | | * @param keyStr |
| | | * 密钥 |
| | | */ |
| | | public void decryptUnzip(String srcfile, String destfile, String keyStr) { |
| | | try { |
| | | /* File temp = new File(UUID.randomUUID().toString() + ".zip"); |
| | | temp.deleteOnExit(); |
| | | // 先对文件解密 |
| | | new CipherUtil().decrypt(srcfile, temp.getAbsolutePath(), keyStr); |
| | | // FileAESUtil.DecFile(srcfile, temp.getAbsolutePath()); |
| | | // 解压缩 |
| | | // new ZipUtil().unZip(temp.getAbsolutePath(), destfile); |
| | | cn.hutool.core.util.ZipUtil.unzip(temp.getAbsolutePath(), destfile); |
| | | temp.delete();*/ |
| | | cn.hutool.core.util.ZipUtil.unzip(srcfile, destfile); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | @GetMapping("getItemList") |
| | | @ApiOperation("获取入库配置项列表") |
| | | public PageResult<WarehouseConfigItem> getItemList(Long projectId,String ids) { |
| | | String type ="change"; |
| | | List<WarehouseConfigItem> resultList = configItemService.warehouseConfigList(projectId,ids,type); |
| | | List<WarehouseConfigItem> resultList = configItemService.warehouseConfigList(projectId,ids); |
| | | return PageResult.ok(resultList); |
| | | } |
| | | @GetMapping("exportConfigChange") |
| | |
| | | import com.zt.common.validator.group.UpdateGroup; |
| | | import com.zt.life.modules.configItemOutbound.dto.ConfigItemOutboundDto; |
| | | import com.zt.life.modules.configItemOutbound.model.ConfigItemOutbound; |
| | | import com.zt.life.modules.configItemOutbound.model.OutboundConfigItem; |
| | | import com.zt.life.modules.configItemOutbound.service.ConfigItemOutboundService; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem; |
| | | import com.zt.life.modules.configItemWarehouse.service.WarehouseConfigItemService; |
| | |
| | | |
| | | @Autowired |
| | | private WarehouseConfigItemService configItemService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | |
| | | |
| | | @GetMapping("getDto") |
| | | @ApiOperation("信息") |
| | | public Result<ConfigItemOutboundDto> getDto(Long projectId, Long changeId) { |
| | | ConfigItemOutboundDto data = configItemOutboundService.getDto(projectId, changeId); |
| | | if (changeId!=null) { |
| | | for (WarehouseConfigItem configItem : data.getConfigOutboundList()) { |
| | | Long configItemId = configItem.getId(); |
| | | OssDto ossDto = sysOssConfigService.getOssByBusiType(configItemId, "config_item_warehouse"); |
| | | if (ossDto != null) { |
| | | configItem.setFiles(ossDto); |
| | | } |
| | | } |
| | | } |
| | | public Result<ConfigItemOutboundDto> getDto(Long projectId, Long outboundId) { |
| | | ConfigItemOutboundDto data = configItemOutboundService.getDto(projectId, outboundId); |
| | | return Result.ok(data); |
| | | } |
| | | |
| | |
| | | @GetMapping("getItemList") |
| | | @ApiOperation("获取入库配置项列表") |
| | | public PageResult<WarehouseConfigItem> getItemList(Long projectId,String ids) { |
| | | String type ="outbound"; |
| | | List<WarehouseConfigItem> resultList = configItemService.warehouseConfigList(projectId,ids,type); |
| | | List<WarehouseConfigItem> resultList = configItemService.warehouseConfigList(projectId, ids); |
| | | return PageResult.ok(resultList); |
| | | } |
| | | |
| | | @GetMapping("exportConfigOutbound") |
| | | @ApiOperation("打印变更申请单") |
| | | @LogOperation("打印变更申请单") |
| | | @ApiOperation("打印出库申请单") |
| | | @LogOperation("打印出库申请单") |
| | | public void exportConfigOutbound(Long id, HttpServletRequest request, HttpServletResponse response) { |
| | | configItemOutboundService.exportConfigOutbound(id,request, response); |
| | | } |
| | | |
| | | @GetMapping("outbound") |
| | | @ApiOperation("出库") |
| | | @LogOperation("出库") |
| | | public void downloadFiles(HttpServletResponse response, HttpServletRequest request, Long id) { |
| | | configItemOutboundService.downloadFiles(response, request, id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.configItemOutbound.controller; |
| | | |
| | | |
| | | import com.zt.common.annotation.LogOperation; |
| | | import com.zt.common.annotation.QueryParam; |
| | | import com.zt.common.constant.Constant; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import com.zt.common.servlet.PageResult; |
| | | import com.zt.common.servlet.Result; |
| | | import com.zt.common.validator.AssertUtils; |
| | | import com.zt.common.validator.ValidatorUtils; |
| | | import com.zt.common.validator.group.AddGroup; |
| | | import com.zt.common.validator.group.DefaultGroup; |
| | | import com.zt.common.validator.group.UpdateGroup; |
| | | import com.zt.life.modules.configItemOutbound.model.OutboundConfigItem; |
| | | import com.zt.life.modules.configItemOutbound.service.OutboundConfigItemService; |
| | | import io.swagger.annotations.Api; |
| | | 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.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | |
| | | /** |
| | | * warehouse_config_item |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2023-11-27 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/configItemOutbound/OutboundConfigItem/") |
| | | @Api(tags="outbound_config_item") |
| | | public class OutboundConfigItemController { |
| | | @Autowired |
| | | private OutboundConfigItemService outboundConfigItemService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | }) |
| | | public PageResult<OutboundConfigItem> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | |
| | | return PageResult.ok(outboundConfigItemService.page(queryFilter)); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @ApiOperation("信息") |
| | | public Result<OutboundConfigItem> get(@PathVariable("id") Long id){ |
| | | OutboundConfigItem data = outboundConfigItemService.get(id); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody OutboundConfigItem outboundConfigItem){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(outboundConfigItem, AddGroup.class, DefaultGroup.class); |
| | | outboundConfigItemService.insert(outboundConfigItem); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody OutboundConfigItem outboundConfigItem){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(outboundConfigItem, UpdateGroup.class, DefaultGroup.class); |
| | | outboundConfigItemService.update(outboundConfigItem); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | | public Result delete(@RequestBody Long[] ids){ |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | outboundConfigItemService.delete(ids); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zt.life.modules.configItemOutbound.dao; |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.configItemOutbound.dto.ConfigItemOutboundDto; |
| | | import com.zt.life.modules.configItemOutbound.model.ConfigItemOutbound; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseCmAudit; |
| | | import com.zt.modules.oss.model.SysOss; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | List<ConfigItemOutbound> getList(Map<String, Object> params); |
| | | |
| | | List<SysOss> getFilesByBusiId(Long id); |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.configItemOutbound.dao; |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.configItemOutbound.model.OutboundConfigItem; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * warehouse_config_item |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2023-11-27 |
| | | */ |
| | | @Mapper |
| | | public interface OutboundConfigItemDao extends BaseDao<OutboundConfigItem> { |
| | | |
| | | List<OutboundConfigItem> getList(Map<String, Object> params); |
| | | } |
| | |
| | | package com.zt.life.modules.configItemOutbound.dto; |
| | | |
| | | import com.zt.life.modules.configItemOutbound.model.ConfigItemOutbound; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseCmAudit; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseQaAudit; |
| | | import com.zt.life.modules.configItemOutbound.model.OutboundConfigItem; |
| | | import com.zt.life.modules.project.model.Project; |
| | | import com.zt.modules.workflow.dto.FlowInfoDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | private FlowInfoDto flowInfoDto; |
| | | |
| | | @ApiModelProperty(value = "变更配置项") |
| | | private List<WarehouseConfigItem> configOutboundList = new ArrayList<>(); |
| | | private List<OutboundConfigItem> configOutboundList = new ArrayList<>(); |
| | | } |
| | | |
New file |
| | |
| | | package com.zt.life.modules.configItemOutbound.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.zt.common.entity.BusiEntity; |
| | | import com.zt.life.sys.dto.OssDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * warehouse_config_item |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2023-11-27 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | @TableName("config_item_outbound_detail") |
| | | public class OutboundConfigItem extends BusiEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "入库项ID") |
| | | private Long warehouseId; |
| | | |
| | | @ApiModelProperty(value = "出库单ID") |
| | | private Long outboundId; |
| | | |
| | | @ApiModelProperty(value = "项目工程ID") |
| | | private Long projectId; |
| | | |
| | | @ApiModelProperty(value = "检查单ID") |
| | | private Long checkId; |
| | | |
| | | @ApiModelProperty(value = "入库明细类型") |
| | | private String pageCode; |
| | | |
| | | @ApiModelProperty(value = "序号") |
| | | private Integer no; |
| | | |
| | | @ApiModelProperty(value = "入库状态") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "配置项名称") |
| | | private String itemName; |
| | | |
| | | @ApiModelProperty(value = "配置项标识") |
| | | private String itemIdentify; |
| | | |
| | | @ApiModelProperty(value = "版本") |
| | | private String version; |
| | | |
| | | |
| | | @ApiModelProperty(value = "密级") |
| | | private String secretClass; |
| | | |
| | | |
| | | @ApiModelProperty(value = "出库选择") |
| | | private Long selectId; |
| | | } |
| | |
| | | package com.zt.life.modules.configItemOutbound.service; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.common.utils.UUIDUtil; |
| | | import com.zt.life.export.dto.WordFile; |
| | | import com.zt.life.export.service.WordFileService; |
| | | import com.zt.life.modules.configItemOutbound.dao.ConfigItemOutboundDao; |
| | | import com.zt.life.modules.configItemOutbound.dto.ConfigItemOutboundDto; |
| | | import com.zt.life.modules.configItemOutbound.model.ConfigItemOutbound; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseCmAudit; |
| | | import com.zt.life.modules.configItemOutbound.model.OutboundConfigItem; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseQaAudit; |
| | | import com.zt.life.modules.configItemWarehouse.service.WarehouseCmAuditService; |
| | | import com.zt.life.modules.configItemWarehouse.service.WarehouseConfigItemService; |
| | | import com.zt.life.modules.configItemWarehouse.service.WarehouseQaAuditService; |
| | | import com.zt.life.modules.mainPart.utils.GetFilesPath; |
| | | import com.zt.life.modules.mainPart.utils.GetShowDictList; |
| | | import com.zt.life.util.ZipCipherUtil; |
| | | import com.zt.life.modules.project.service.ProjectService; |
| | | import com.zt.life.modules.testCheckOrder.model.TestCheckOrder; |
| | | import com.zt.life.modules.testCheckOrder.service.TestCheckOrderService; |
| | | import com.zt.life.sys.service.SysOssConfigService; |
| | | import com.zt.modules.coderule.service.SysCodeRuleService; |
| | | import com.zt.modules.oss.model.SysOss; |
| | | import com.zt.modules.oss.service.SysOssService; |
| | | import com.zt.modules.workflow.dto.FlowInfoDto; |
| | | import com.zt.modules.workflow.service.WorkflowService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @Autowired |
| | | private ProjectService projectService; |
| | | |
| | | @Autowired |
| | | private WarehouseCmAuditService cmAuditService; |
| | | |
| | | @Autowired |
| | | private WarehouseQaAuditService qaAuditService; |
| | | @Value("${zt.oss.local-server}") |
| | | private String localServer; |
| | | |
| | | @Autowired |
| | | private WarehouseConfigItemService configItemService; |
| | | |
| | | @Autowired |
| | | private OutboundConfigItemService outboundItemService; |
| | | |
| | | @Autowired |
| | | private TestCheckOrderService testCheckOrderService; |
| | |
| | | @Autowired |
| | | private GetFilesPath getFilesPath; |
| | | |
| | | @Value("${data.sync-path}") |
| | | private String syncPath; |
| | | |
| | | @Value("${data.key}") |
| | | private String key; |
| | | |
| | | /** |
| | | * 分页查询 |
| | |
| | | OutboundId = configItemDto.getConfigItemOutbound().getId(); |
| | | } |
| | | |
| | | for (WarehouseConfigItem configItem : configItemDto.getConfigOutboundList()) { |
| | | configItem.setWarehouseId(OutboundId); |
| | | for (OutboundConfigItem configItem : configItemDto.getConfigOutboundList()) { |
| | | configItem.setOutboundId(OutboundId); |
| | | if (configItem.getId() != null) { |
| | | configItemService.update(configItem); |
| | | outboundItemService.update(configItem); |
| | | } else { |
| | | configItem.setWarehouseId(OutboundId); |
| | | configItem.setOutboundId(OutboundId); |
| | | configItem.setProjectId(configItemDto.getConfigItemOutbound().getProjectId()); |
| | | configItemService.insert(configItem); |
| | | outboundItemService.insert(configItem); |
| | | } |
| | | Long checkId = configItem.getCheckId(); |
| | | if (checkId != null) { |
| | |
| | | testCheckOrderService.update(testCheckOrder); |
| | | } |
| | | } |
| | | sysOssConfigService.updateOss(configItem.getId(), configItem.getFiles());// 保存附件 |
| | | } |
| | | |
| | | Long bizId = configItemDto.getConfigItemOutbound().getId(); |
| | |
| | | if (projectId == null) { |
| | | projectId = configItemOutbound.getProjectId(); |
| | | } |
| | | List<WarehouseConfigItem> configOutboundList = configItemService.getList(OutboundId); |
| | | List<OutboundConfigItem> configOutboundList = outboundItemService.getList(OutboundId); |
| | | data.setConfigOutboundList(configOutboundList); |
| | | |
| | | } else { |
| | |
| | | dataObj.getConfigItemOutbound().setLibraryType(libraryTypeStr); |
| | | String ApprovalOpinionStr = getShowDictList.getShowDictList(dataObj.getConfigItemOutbound().getApprovalOpinions(), "is_agree", false); |
| | | dataObj.getConfigItemOutbound().setApprovalOpinions(ApprovalOpinionStr); |
| | | for (WarehouseConfigItem configItemList : dataObj.getConfigOutboundList()) { |
| | | for (OutboundConfigItem configItemList : dataObj.getConfigOutboundList()) { |
| | | String value = configItemList.getSecretClass(); |
| | | String secretClassStr = getShowDictList.getShowDictList(value, "secret_class", false); |
| | | configItemList.setSecretClass(secretClassStr); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | public void downloadFiles(HttpServletResponse response, HttpServletRequest request, Long id) { |
| | | String projectName="出库文件"; |
| | | List<SysOss> list = baseDao.getFilesByBusiId(id); |
| | | sysOssConfigService.downloadFilesByosList(request,response,list,projectName); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.configItemOutbound.service; |
| | | |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.life.modules.configItemOutbound.dao.OutboundConfigItemDao; |
| | | import com.zt.life.modules.configItemOutbound.model.OutboundConfigItem; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * warehouse_config_item |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2023-11-27 |
| | | */ |
| | | @Service |
| | | public class OutboundConfigItemService extends BaseService<OutboundConfigItemDao, OutboundConfigItem> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param queryFilter |
| | | * @return |
| | | */ |
| | | public List<OutboundConfigItem> page(QueryFilter queryFilter) { |
| | | return baseDao.getList(queryFilter.getQueryParams()); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param ids |
| | | */ |
| | | public void delete(Long[] ids) { |
| | | super.deleteLogic(ids); |
| | | } |
| | | |
| | | public List<OutboundConfigItem> getList(Long outboundId) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("outboundId",outboundId); |
| | | return baseDao.getList(params); |
| | | } |
| | | } |
| | |
| | | |
| | | List<WarehouseConfigItem> itemList(Long projectId); |
| | | |
| | | List<WarehouseConfigItem> changeSelectList(Long projectId,String ids); |
| | | List<WarehouseConfigItem> outboundSelectList(Long projectId,String ids); |
| | | List<WarehouseConfigItem> selectList(Long projectId,String ids); |
| | | } |
| | |
| | | private String secretClass; |
| | | |
| | | @ApiModelProperty(value = "变更选择") |
| | | private Long changeSelectId; |
| | | |
| | | @ApiModelProperty(value = "出库选择") |
| | | private Long outboundSelectId; |
| | | private Long selectId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "附件") |
| | |
| | | return baseDao.itemList(projectId); |
| | | } |
| | | |
| | | public List<WarehouseConfigItem> warehouseConfigList(Long projectId,String ids,String type) { |
| | | if (type.contains("outbound")){ |
| | | return baseDao.outboundSelectList(projectId,ids); |
| | | } |
| | | return baseDao.changeSelectList(projectId,ids); |
| | | public List<WarehouseConfigItem> warehouseConfigList(Long projectId,String ids) { |
| | | return baseDao.selectList(projectId,ids); |
| | | } |
| | | } |
| | |
| | | ORDER BY ${orderBySql} |
| | | </if> |
| | | </select> |
| | | <select id="getFilesByBusiId" resultType="com.zt.modules.oss.model.SysOss"> |
| | | select b.* from config_item_outbound_detail a , sys_oss b where a.outbound_id= #{id} and a.IS_DELETE=0 and b.IS_DELETE=0 and |
| | | a.select_id=b.BUSI_ID and BUSI_TYPE='config_item_warehouse' |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.zt.life.modules.configItemOutbound.dao.OutboundConfigItemDao"> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.configItemOutbound.model.OutboundConfigItem"> |
| | | select a.* |
| | | from config_item_outbound_detail a |
| | | <where> |
| | | a.is_delete = 0 |
| | | <if test="warehouseId!=null"> |
| | | and outbound_id = ${outboundId} |
| | | </if> |
| | | </where> |
| | | <if test="orderBySql!=null"> |
| | | ORDER BY ${orderBySql} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | WHERE i.is_delete = 0 |
| | | AND i.project_id = ${projectId} |
| | | </select> |
| | | <select id="changeSelectList" resultType="com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem"> |
| | | <select id="selectList" resultType="com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem"> |
| | | SET @row_number = 0; |
| | | SELECT (@row_number := @row_number + 1) AS no, |
| | | a.item_name,a.item_identify,a.version as retrospect_version,a.secret_class,a.project_id,a.id as change_select_id |
| | | a.item_name,a.item_identify,a.version as retrospect_version,a.secret_class,a.project_id,a.id as select_id |
| | | from config_item_warehouse_detail a |
| | | WHERE a.is_delete = 0 |
| | | and a.project_id = ${projectId} |
| | | and a.outbound_select_id IS NOT NULL |
| | | <if test="ids!=null and ids!=''"> |
| | | AND id not in (${ids}) |
| | | </if> |
| | | and a.id NOT IN (SELECT change_select_id FROM config_item_warehouse_detail |
| | | WHERE |
| | | ( SELECT count(*) FROM config_item_warehouse_detail WHERE id IN (SELECT |
| | | change_select_id |
| | | FROM |
| | | config_item_warehouse_detail) ) > 0) |
| | | and a.id NOT IN (select select_id from config_item_warehouse_detail where select_id is not null) |
| | | </select> |
| | | <select id="outboundSelectList" resultType="com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem"> |
| | | SET @row_number = 0; |
| | | SELECT (@row_number := @row_number + 1) AS no, |
| | | a.item_name,a.item_identify,a.version,a.secret_class,a.project_id,a.id as outbound_select_id |
| | | from config_item_warehouse_detail a |
| | | WHERE a.is_delete = 0 |
| | | and a.project_id = ${projectId} |
| | | and a.change_select_id IS NOT NULL |
| | | <if test="ids!=null and ids!=''"> |
| | | AND id not in (${ids}) |
| | | </if> |
| | | and a.id NOT IN (SELECT outbound_select_id FROM config_item_warehouse_detail |
| | | WHERE |
| | | ( SELECT count(*) FROM config_item_warehouse_detail WHERE id IN (SELECT |
| | | outbound_select_id |
| | | FROM |
| | | config_item_warehouse_detail) ) > 0) |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <subMmenu :navMenus="navMenu.children"></subMmenu> |
| | | </el-submenu> |
| | | <!-- 最后一级菜单 --> |
| | | <el-menu-item v-else-if="navMenu.showMenu==1" :key="navMenu.id" :index="navMenu.id" |
| | | <el-menu-item v-else-if="navMenu.showMenu==1" :key="key" :index="navMenu.id" |
| | | @click="gotoRouteHandle(navMenu.id)"> |
| | | <svg class="icon-svg aui-sidebar__menu-icon" aria-hidden="true"> |
| | | <use :xlink:href="`#${navMenu.icon}`"></use> |
| | |
| | | </zt-table-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" prop="files" label="上传附件" width="240" align="center"> |
| | | <template v-slot="{ row }"> |
| | | <!-- <zt-table-button @click="files(row.id)">上传附件</zt-table-button>--> |
| | | <table-uploader busi-type="config_item_warehouse" model-name="row" :dataForm="row" |
| | | v-model="row.files"/> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div v-if="showAddAndEdit && !dataForm.disabled" class="icon-container" @click="handleCommand"> |
| | | <!-- 放置固定的图标 --> |
| | |
| | | </div> |
| | | <div style="width: calc(100% - 120px)" class="el-border-left"> |
| | | <el-form-item class="el-CMTextarea" style="width: 100%;padding: 5px"> |
| | | <el-input v-if="stepMarker=='pzxck_cmcz'" type="textarea" :rows="2" placeholder="请输入内容" |
| | | v-model="dataForm.configItemOutbound.CmOperations"></el-input> |
| | | <span v-else>{{dataForm.configItemOutbound.CmOperations}}</span> |
| | | <el-button v-if="stepMarker=='pzxck_cmcz'" type="primary" @click="download()">出库</el-button> |
| | | </el-form-item> |
| | | <el-form-item label-width="80%" label="操作人:" style="width: 65%"> |
| | | <span>{{dataForm.configItemOutbound.operator}}</span> |
| | |
| | | handleCommand() { |
| | | this.$nextTick(()=>{ |
| | | console.log(this.dataForm.projectId,'this.dataForm.projectId') |
| | | this.ids = this.dataForm.configOutboundList.map(item=>item.outboundSelectId).join(',') |
| | | this.ids = this.dataForm.configOutboundList.map(item=>item.selectId).join(',') |
| | | this.$refs.configItemList.$refs.dialog.init(this.dataForm.projectId,this.ids) |
| | | }) |
| | | // this.dataForm.configItemList.push({}) |
| | |
| | | let apiURL = `/configItemOutbound/ConfigItemOutbound/exportConfigOutbound` |
| | | window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${params}` |
| | | }, |
| | | download(){ |
| | | let params = qs.stringify({ |
| | | token: Cookies.get('token'), |
| | | id:this.dataForm.id |
| | | }) |
| | | let apiURL = `/configItemOutbound/ConfigItemOutbound/outbound` |
| | | window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${params}` |
| | | }, |
| | | // 获取信息 |
| | | async getInfo() { |
| | | let params = { |
| | | changeId: this.dataForm.id, |
| | | outboundId: this.dataForm.id, |
| | | projectId: this.dataForm.projectId |
| | | } |
| | | let res = await this.$http.get(`/configItemOutbound/ConfigItemOutbound/getDto`, {params: params}) |
| | |
| | | <!-- 已办任务弹窗 --> |
| | | <ItemCirculatOrder ref="itemCirculatOrder" @refreshDataList="getQuery()"></ItemCirculatOrder> |
| | | <ConfigItemWarehouse ref="configItemWarehouse" @refreshDataList="getQuery()"></ConfigItemWarehouse> |
| | | <TestCheckOrder ref="testCheckOrder" @refreshDataList="getQuery()"></TestCheckOrder> |
| | | <ConfigItemChange ref="configItemChange" @refreshDataList="getQuery()"></ConfigItemChange> |
| | | <ConfigItemOutbound ref="configItemOutbound" @refreshDataList="getQuery()"></ConfigItemOutbound> |
| | | <TestCheckOrder ref="testCheckOrder" @refreshDataList="getQuery()"></TestCheckOrder><TestCheckOrder ref="testCheckOrder" @refreshDataList="getQuery()"></TestCheckOrder> |
| | | <!-- </zt-table-wraper>--> |
| | | </div> |
| | | </template> |
| | |
| | | import Cookies from "js-cookie"; |
| | | import ConfigItemWarehouse from '@/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate' |
| | | import TestCheckOrder from "@/views/modules/testCheckOrder/TestCheckOrder-AddOrUpdate.vue"; |
| | | import ConfigItemChange from "@/views/modules/configItemChange/ConfigItemChange-AddOrUpdate.vue"; |
| | | import ConfigItemOutbound from "@/views/modules/configItemOutbound/ConfigItemOutbound-AddOrUpdate.vue"; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | TestCheckOrder, |
| | | InfiniteLoading, |
| | | ItemCirculatOrder, |
| | | ConfigItemWarehouse |
| | | ConfigItemWarehouse, |
| | | ConfigItemChange, |
| | | ConfigItemOutbound |
| | | }, |
| | | watch:{ |
| | | }, |
| | |
| | | this.$nextTick(()=>{ |
| | | this.$refs.testCheckOrder.$refs.dialog.init(row.bizId,row, true) |
| | | }) |
| | | }else if (row.flowCode === 'pzxck') { |
| | | this.$nextTick(()=>{ |
| | | this.$refs.configItemOutbound.$refs.dialog.init(row.bizId,row, true) |
| | | }) |
| | | }else if (row.flowCode === 'pzxbg') { |
| | | this.$nextTick(()=>{ |
| | | this.$refs.configItemChange.$refs.dialog.init(row.bizId,row, true) |
| | | }) |
| | | } |
| | | else { |
| | | if (row.stepReadRouterId === null){ |
| | |
| | | union all |
| | | select menu_id |
| | | from sys_role_menu s1,sys_role s2 |
| | | where s1.role_id = s2.id and s2.code='base' |
| | | where s1.role_id = s2.id and s2.code='base' and s1.is_delete=0 and s2.is_delete=0 |
| | | ) |
| | | </if> |
| | | <if test="tenantId != null and tenantId != 0"> |