diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/UploadPicturesMapper.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/UploadPicturesMapper.java index d4fe2ba7..223e4314 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/UploadPicturesMapper.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/mapper/UploadPicturesMapper.java @@ -9,8 +9,8 @@ import org.springframework.stereotype.Repository; * Mapper 接口 *

* - * @author Leon.L - * @since 2021-07-11 + * @author zjw + * @since 2021-09-09 */ @Repository public interface UploadPicturesMapper extends BaseMapper { diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/model/UploadPictures.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/model/UploadPictures.java index a445753f..ab50bd71 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/model/UploadPictures.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/model/UploadPictures.java @@ -14,8 +14,8 @@ import java.time.LocalDateTime; * *

* - * @author Leon.L - * @since 2021-07-11 + * @author zjw + * @since 2021-09-09 */ @TableName("Z_UPLOAD_PICTURES") @@ -79,6 +79,8 @@ public class UploadPictures extends Model { */ @TableField("MODIFIED_DATE_TIME") private LocalDateTime modifiedDateTime; + @TableField("STATUS") + private String status; public String getHandle() { @@ -169,6 +171,14 @@ public class UploadPictures extends Model { this.modifiedDateTime = modifiedDateTime; } + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + public static final String HANDLE = "HANDLE"; public static final String SITE = "SITE"; @@ -191,6 +201,8 @@ public static final String MODIFIED_USER = "MODIFIED_USER"; public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; +public static final String STATUS = "STATUS"; + @Override protected Serializable pkVal() { @@ -211,6 +223,7 @@ public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME"; ", createdDateTime = " + createdDateTime + ", modifiedUser = " + modifiedUser + ", modifiedDateTime = " + modifiedDateTime + + ", status = " + status + "}"; } } \ No newline at end of file diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/FileUploadedService.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/FileUploadedService.java index 62d0cd53..2b697167 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/FileUploadedService.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/FileUploadedService.java @@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletResponse; */ public interface FileUploadedService { - public void uploadAttachment(MultipartFile fileItem, String site, String taskNo, String fileType); + public void uploadAttachment(MultipartFile fileItem, String site, String taskNo, String fileType,String status); public String showFile(HttpServletRequest request, HttpServletResponse response) throws Exception ; diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/UploadPicturesService.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/UploadPicturesService.java index 49b343ec..8580c1c1 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/UploadPicturesService.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/UploadPicturesService.java @@ -12,8 +12,8 @@ import java.util.List; * 服务类 *

* - * @author Leon.L - * @since 2021-07-11 + * @author zjw + * @since 2021-09-09 */ public interface UploadPicturesService extends IService { diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java index a12bcecf..e1fe7fd2 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java @@ -178,6 +178,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl selectPage(FrontPage frontPage, AbnormalBill abnormalBill) { @@ -296,8 +299,16 @@ public class AbnormalBillServiceImpl extends ServiceImpl ncCodesAndNcGroups = ncCodeService.findNcCodeDescriptionByNcCode(abnormalBill.getNcCode()); List abnormalNcCodes = new LinkedList<>(); for(int i = 0; i < ncCodesAndNcGroups.size(); i ++){ @@ -764,8 +775,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl name = null; - if(StringUtil.notBlank(abnormalBill.getFileName())){ - name = Arrays.asList(abnormalBill.getFileName().split(",")); - } - if(name != null && name.size() != 0){ - //String uuid = UUID.randomUUID().toString(); + List name = Arrays.asList(abnormalBill.getFileName().split(",")); + if(name.size() != 0){ UploadPictures uploadPictures = new UploadPictures(); - uploadPictures.setHandle("UploadPicturesBO:"+abnormalBill.getSite()+","+abnormalBill.getAbnormalNo()); + uploadPictures.setHandle("UploadPicturesBO:"+abnormalBill.getSite()+","+abnormalBill.getAbnormalNo()+","+abnormalBill.getStatus()); uploadPictures.setSite(abnormalBill.getSite()); uploadPictures.setPicturePath(abnormalBill.getFilePath()); StringBuilder pictureAddress = new StringBuilder(); @@ -851,6 +859,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl uploadPictures1 = uploadPicturesService.selectList(uploadPictures); if(uploadPictures1 != null && uploadPictures1.size() == 1){ return uploadPictures1.get(0); diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/FileUploadedServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/FileUploadedServiceImpl.java index 82b838d2..d571d37d 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/FileUploadedServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/FileUploadedServiceImpl.java @@ -20,10 +20,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; +import java.io.*; /** * @Description TODO @@ -53,24 +50,39 @@ public class FileUploadedServiceImpl implements FileUploadedService { * @return */ @Override - public void uploadAttachment(MultipartFile fileItem,String site,String taskNo,String fileType) { + public void uploadAttachment(MultipartFile fileItem,String site,String taskNo,String fileType,String status) { if (StringUtil.isBlank(site)) { site = CommonMethods.getSite(); } + String ftpPath = taskNo + "/" + status; //上传附件名称 String fileName = fileItem.getOriginalFilename(); try { Ftp ftp = new Ftp(host, port,username,password); - - ftp.upload(taskNo, fileName, fileItem.getInputStream()); + ftp.upload(ftpPath, fileName, fileItem.getInputStream()); ftp.close(); } catch (IOException e) { logger.info(e.getMessage()); - throw BusinessException.build("" + e.getMessage()); + throw BusinessException.build("上传图片失败:" + e.getMessage()); } - + +// try{ +// FTPClient ftpClient = new FTPClient(); +// ftpClient.connect(host,port); +// ftpClient.login(username,password); +// InputStream inputStream = fileItem.getInputStream(); +// FileInputStream fileInputStream= (FileInputStream) inputStream; +// ftpClient.changeWorkingDirectory(ftpPath); +// ftpClient.setFileType(FTP.BINARY_FILE_TYPE); +// ftpClient.storeFile("ces",fileInputStream); +// ftpClient.logout(); +// }catch (Exception e){ +// throw BusinessException.build("上传图片失败:" + e.getMessage()); +// } + } + @Override public String showFile(HttpServletRequest request, HttpServletResponse response) throws Exception { String path = request.getParameter("PATH"); // InputStream in = null; @@ -79,8 +91,7 @@ public class FileUploadedServiceImpl implements FileUploadedService { String coderPath = new String(path.getBytes("ISO8859_1")); String newPath = new String(coderPath.getBytes("GBK"), FTPClient.DEFAULT_CONTROL_ENCODING); // - // in = ftpClient.getFtp(path); -// in = ftpClient.getFtp(newPath); + FTPClient ftpClient = new FTPClient(); ftpClient.connect(host,port); ftpClient.login(username,password); @@ -101,7 +112,7 @@ public class FileUploadedServiceImpl implements FileUploadedService { // 检验文件是否存在 InputStream in = ftpClient.retrieveFileStream(new String(file.getBytes("GBK"),FTP.DEFAULT_CONTROL_ENCODING)); if(in == null || ftpClient.getReplyCode() == FTPReply.FILE_UNAVAILABLE){ - return "该文件不存在"; + throw BusinessException.build("预览图片失败,该文件不存在"); } ByteArrayOutputStream outStream = new ByteArrayOutputStream(); @@ -115,13 +126,13 @@ public class FileUploadedServiceImpl implements FileUploadedService { out.write(data); out.flush(); }catch (Exception e){ - return "图片获取失败"+e.getMessage(); + throw BusinessException.build("预览图片失败"+e.getMessage()); }finally { out.close(); // in.close(); } - return "渲染图片成功"; + return null; } @Override @@ -173,6 +184,8 @@ public class FileUploadedServiceImpl implements FileUploadedService { String site = request.getParameter("site"); String taskNo = request.getParameter("taskNo"); String fileType = request.getParameter("fileType"); + String status = request.getParameter("status"); + String ftpPath = taskNo + "/" + status; if (StringUtil.isBlank(site)) { site = CommonMethods.getSite(); @@ -181,11 +194,11 @@ public class FileUploadedServiceImpl implements FileUploadedService { String fileName = fileItem.getName(); try { Ftp ftp = new Ftp(host, port,username,password); - ftp.upload(taskNo, fileName, fileItem.getInputStream()); + ftp.upload(ftpPath, fileName, fileItem.getInputStream()); ftp.close(); } catch (IOException e) { logger.info(e.getMessage()); - throw BusinessException.build("" + e.getMessage()); + throw BusinessException.build("上传图片失败" + e.getMessage()); } } } diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/UploadPicturesServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/UploadPicturesServiceImpl.java index 470ad05e..6e684d3e 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/UploadPicturesServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/UploadPicturesServiceImpl.java @@ -1,14 +1,14 @@ package com.foreverwin.mesnac.anomaly.service.impl; -import com.foreverwin.modular.core.util.FrontPage; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.foreverwin.mesnac.anomaly.model.UploadPictures; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.foreverwin.mesnac.anomaly.mapper.UploadPicturesMapper; +import com.foreverwin.mesnac.anomaly.model.UploadPictures; import com.foreverwin.mesnac.anomaly.service.UploadPicturesService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; +import com.foreverwin.modular.core.util.FrontPage; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -17,8 +17,8 @@ import java.util.List; * 服务实现类 *

* - * @author Leon.L - * @since 2021-07-11 + * @author zjw + * @since 2021-09-09 */ @Service @Transactional(rollbackFor = Exception.class) diff --git a/anomaly/src/main/resources/mapper/UploadPicturesMapper.xml b/anomaly/src/main/resources/mapper/UploadPicturesMapper.xml index 2aee9399..a12757bf 100644 --- a/anomaly/src/main/resources/mapper/UploadPicturesMapper.xml +++ b/anomaly/src/main/resources/mapper/UploadPicturesMapper.xml @@ -15,11 +15,12 @@ + - HANDLE, SITE, PICTURE_PATH, PICTURE_ADDRESS, OBJECT_BO, NUM, TYPE, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME + HANDLE, SITE, PICTURE_PATH, PICTURE_ADDRESS, OBJECT_BO, NUM, TYPE, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME, STATUS @@ -64,6 +65,7 @@ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFIED_USER=#{ew.entity.modifiedUser} AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND STATUS=#{ew.entity.status} @@ -85,6 +87,7 @@ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFIED_USER=#{ew.entity.modifiedUser} AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND STATUS=#{ew.entity.status} ${ew.sqlSegment} @@ -114,6 +117,7 @@ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFIED_USER=#{ew.entity.modifiedUser} AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND STATUS=#{ew.entity.status} ${ew.sqlSegment} @@ -143,6 +147,7 @@ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFIED_USER=#{ew.entity.modifiedUser} AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND STATUS=#{ew.entity.status} ${ew.sqlSegment} @@ -172,6 +177,7 @@ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFIED_USER=#{ew.entity.modifiedUser} AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND STATUS=#{ew.entity.status} ${ew.sqlSegment} @@ -201,6 +207,7 @@ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFIED_USER=#{ew.entity.modifiedUser} AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND STATUS=#{ew.entity.status} ${ew.sqlSegment} @@ -230,6 +237,7 @@ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFIED_USER=#{ew.entity.modifiedUser} AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND STATUS=#{ew.entity.status} ${ew.sqlSegment} @@ -255,6 +263,7 @@ CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME, + STATUS, VALUES #{handle}, @@ -268,6 +277,7 @@ #{createdDateTime}, #{modifiedUser}, #{modifiedDateTime}, + #{status}, @@ -288,6 +298,7 @@ #{createdDateTime}, #{modifiedUser}, #{modifiedDateTime}, + #{status}, @@ -304,6 +315,7 @@ CREATED_DATE_TIME=#{et.createdDateTime}, MODIFIED_USER=#{et.modifiedUser}, MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + STATUS=#{et.status}, WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL} @@ -320,6 +332,7 @@ CREATED_DATE_TIME=#{et.createdDateTime}, MODIFIED_USER=#{et.modifiedUser}, MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + STATUS=#{et.status}, WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL} @@ -336,6 +349,7 @@ CREATED_DATE_TIME=#{et.createdDateTime}, MODIFIED_USER=#{et.modifiedUser}, MODIFIED_DATE_TIME=#{et.modifiedDateTime}, + STATUS=#{et.status}, @@ -351,6 +365,7 @@ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFIED_USER=#{ew.entity.modifiedUser} AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND STATUS=#{ew.entity.status} ${ew.sqlSegment} @@ -397,6 +412,7 @@ AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} AND MODIFIED_USER=#{ew.entity.modifiedUser} AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime} + AND STATUS=#{ew.entity.status} ${ew.sqlSegment} diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/ResrceMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/ResrceMapper.java index bd7cbf1f..89abf8af 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/ResrceMapper.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/ResrceMapper.java @@ -30,11 +30,11 @@ public interface ResrceMapper extends BaseMapper { */ List> selectResourceTypeResourceList(@Param("site") String site); - Resrce findByResrce(@Param("site")String site,@Param("resrce")String resrce); + Resrce findByResrce(@Param("site") String site, @Param("resrce") String resrce); - List findAllResrce(@Param("site")String site); + List findAllResrce(@Param("site") String site); - List findResourceListByResourceType(@Param("site")String site,@Param("resourceTypeBo")String resourceTypeBo); + List findResourceListByResourceType(@Param("site") String site, @Param("resourceTypeBo") String resourceTypeBo); List> selectResourceOperation(@Param("resourceBo") String resourceBo); @@ -44,4 +44,7 @@ public interface ResrceMapper extends BaseMapper { String isInspectByResrce(@Param("site") String site, @Param("resrce") String resrce); + + + } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/WorkCenterMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/WorkCenterMapper.java index 087c9907..4a9b5204 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/WorkCenterMapper.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/WorkCenterMapper.java @@ -2,6 +2,7 @@ package com.foreverwin.mesnac.meapi.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.meapi.model.Resrce; import com.foreverwin.mesnac.meapi.model.WorkCenter; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @@ -22,10 +23,10 @@ public interface WorkCenterMapper extends BaseMapper { List getWorkShopList(@Param("site")String site, @Param("locale")String locale); - WorkCenter findWorkCenterDescriptionByResrce(@Param("resrceBo")String resourceBo, - @Param("locale")String locale); + WorkCenter findWorkCenterByResrce(@Param("resrce") Resrce resrce); WorkCenter findWorkCenterDescriptionByWorkCenter(@Param("site")String site, @Param("workCenter")String workCenter, @Param("locale")String locale); + } \ No newline at end of file diff --git a/meapi/src/main/resources/mapper/WorkCenterMapper.xml b/meapi/src/main/resources/mapper/WorkCenterMapper.xml index 77fe573d..69edf836 100644 --- a/meapi/src/main/resources/mapper/WorkCenterMapper.xml +++ b/meapi/src/main/resources/mapper/WorkCenterMapper.xml @@ -487,11 +487,17 @@ WHERE WC.WC_CATEGORY = 'LEVEL4' AND WC.SITE = #{site} - + SELECT wc.WORK_CENTER WORK_CENTER,wct.DESCRIPTION DESCRIPTION + FROM RESRCE r + LEFT JOIN WORK_CENTER_MEMBER wcm ON wcm.WORK_CENTER_OR_RESOURCE_GBO = r.HANDLE + LEFT JOIN WORK_CENTER_MEMBER wcm2 ON wcm2.WORK_CENTER_OR_RESOURCE_GBO = wcm.WORK_CENTER_BO + LEFT JOIN WORK_CENTER wc ON wc.HANDLE = wcm2.WORK_CENTER_BO + LEFT JOIN WORK_CENTER_T wct ON wct.WORK_CENTER_BO = wc.HANDLE AND wct.LOCALE = 'zh' + + r.SITE = #{resrce.site} AND + r.RESRCE = #{resrce.resrce} +