附件上传,异常bug修改

赵嘉伟 4 years ago
parent 77e06fa969
commit 203b0054e4

@ -71,5 +71,10 @@
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.1</version>
</dependency>
</dependencies>
</project>

@ -6,6 +6,7 @@ import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDto;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillService;
import com.foreverwin.mesnac.anomaly.service.FileUploadedService;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
import com.foreverwin.modular.core.util.FrontPage;
@ -13,6 +14,8 @@ import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@ -30,6 +33,10 @@ public class AbnormalBillController {
@Autowired
private SfcDispatchCommonService sfcDispatchCommonService;
@Autowired
private FileUploadedService fileUploadedService;
/**
* id
@ -291,4 +298,19 @@ public class AbnormalBillController {
public R findResrceBySfc(SfcDispatchDto sfcDispatch){
return R.ok(sfcDispatchCommonService.findResrceBySfc(sfcDispatch));
}
@GetMapping("/show")
public R showFile(HttpServletRequest request, HttpServletResponse response) throws Exception {
return R.ok(fileUploadedService.showFile(request,response));
}
@PostMapping("/delete")
public R delete(String ftpPath,String fileName){
return R.ok(fileUploadedService.deleteFile(ftpPath,fileName));
}
@GetMapping("/findUploadPictureByAbnormalBo")
public R findUploadPictureByAbnormalBo(AbnormalBill abnormalBill){
return R.ok(abnormalBillService.findUploadPictureByAbnormalBo(abnormalBill));
}
}

@ -0,0 +1,124 @@
package com.foreverwin.mesnac.anomaly.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.anomaly.model.UploadPictures;
import com.foreverwin.mesnac.anomaly.service.UploadPicturesService;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
* @author Leon.L
* @since 2021-07-11
*/
@RestController
@RequestMapping("/Z-UPLOAD-PICTURES")
public class UploadPicturesController {
@Autowired
public UploadPicturesService uploadPicturesService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getUploadPicturesById(@PathVariable String id) {
return R.ok( uploadPicturesService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getUploadPicturesList(UploadPictures uploadPictures){
List<UploadPictures> result;
QueryWrapper<UploadPictures> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(uploadPictures);
result = uploadPicturesService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<UploadPictures> frontPage, UploadPictures uploadPictures){
IPage result;
QueryWrapper<UploadPictures> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(uploadPictures);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(UploadPictures::getHandle, frontPage.getGlobalQuery())
.or().like(UploadPictures::getSite, frontPage.getGlobalQuery())
.or().like(UploadPictures::getPicturePath, frontPage.getGlobalQuery())
.or().like(UploadPictures::getPictureAddress, frontPage.getGlobalQuery())
.or().like(UploadPictures::getObjectBo, frontPage.getGlobalQuery())
.or().like(UploadPictures::getNum, frontPage.getGlobalQuery())
.or().like(UploadPictures::getType, frontPage.getGlobalQuery())
.or().like(UploadPictures::getCreatedUser, frontPage.getGlobalQuery())
.or().like(UploadPictures::getModifiedUser, frontPage.getGlobalQuery())
);
}
result = uploadPicturesService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param uploadPictures
* @return null
*/
@PostMapping
public R save(@RequestBody UploadPictures uploadPictures) {
return R.ok(uploadPicturesService.save(uploadPictures));
}
/**
*
* @param uploadPictures
* @return null
*/
@PutMapping
public R updateById(@RequestBody UploadPictures uploadPictures) {
return R.ok(uploadPicturesService.updateById(uploadPictures));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(uploadPicturesService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(uploadPicturesService.removeByIds(ids));
}
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.anomaly.mapper;
import com.foreverwin.mesnac.anomaly.model.UploadPictures;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author Leon.L
* @since 2021-07-11
*/
@Repository
public interface UploadPicturesMapper extends BaseMapper<UploadPictures> {
}

@ -200,6 +200,14 @@ public class AbnormalBill extends Model<AbnormalBill> {
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
@TableField(exist = false)
private String filePath;
@TableField(exist = false)
private String fileName;
@TableField(exist = false)
private String fileNum;
public String getHandle() {
return handle;
@ -481,7 +489,31 @@ public class AbnormalBill extends Model<AbnormalBill> {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFileNum() {
return fileNum;
}
public void setFileNum(String fileNum) {
this.fileNum = fileNum;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";

@ -0,0 +1,216 @@
package com.foreverwin.mesnac.anomaly.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-07-11
*/
@TableName("Z_UPLOAD_PICTURES")
public class UploadPictures extends Model<UploadPictures> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@TableField("SITE")
private String site;
/**
*
*/
@TableField("PICTURE_PATH")
private String picturePath;
/**
*
*/
@TableField("PICTURE_ADDRESS")
private String pictureAddress;
/**
*
*/
@TableField("OBJECT_BO")
private String objectBo;
/**
*
*/
@TableField("NUM")
private String num;
/**
*
*/
@TableField("TYPE")
private String type;
/**
*
*/
@TableField("CREATED_USER")
private String createdUser;
/**
*
*/
@TableField("CREATED_DATE_TIME")
private LocalDateTime createdDateTime;
/**
*
*/
@TableField("MODIFIED_USER")
private String modifiedUser;
/**
*
*/
@TableField("MODIFIED_DATE_TIME")
private LocalDateTime modifiedDateTime;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getPicturePath() {
return picturePath;
}
public void setPicturePath(String picturePath) {
this.picturePath = picturePath;
}
public String getPictureAddress() {
return pictureAddress;
}
public void setPictureAddress(String pictureAddress) {
this.pictureAddress = pictureAddress;
}
public String getObjectBo() {
return objectBo;
}
public void setObjectBo(String objectBo) {
this.objectBo = objectBo;
}
public String getNum() {
return num;
}
public void setNum(String num) {
this.num = num;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getCreatedUser() {
return createdUser;
}
public void setCreatedUser(String createdUser) {
this.createdUser = createdUser;
}
public LocalDateTime getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(LocalDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
}
public String getModifiedUser() {
return modifiedUser;
}
public void setModifiedUser(String modifiedUser) {
this.modifiedUser = modifiedUser;
}
public LocalDateTime getModifiedDateTime() {
return modifiedDateTime;
}
public void setModifiedDateTime(LocalDateTime modifiedDateTime) {
this.modifiedDateTime = modifiedDateTime;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String PICTURE_PATH = "PICTURE_PATH";
public static final String PICTURE_ADDRESS = "PICTURE_ADDRESS";
public static final String OBJECT_BO = "OBJECT_BO";
public static final String NUM = "NUM";
public static final String TYPE = "TYPE";
public static final String CREATED_USER = "CREATED_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFIED_USER = "MODIFIED_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "UploadPictures{" +
"handle = " + handle +
", site = " + site +
", picturePath = " + picturePath +
", pictureAddress = " + pictureAddress +
", objectBo = " + objectBo +
", num = " + num +
", type = " + type +
", createdUser = " + createdUser +
", createdDateTime = " + createdDateTime +
", modifiedUser = " + modifiedUser +
", modifiedDateTime = " + modifiedDateTime +
"}";
}
}

@ -6,6 +6,7 @@ import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDisposeDto;
import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDto;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import com.foreverwin.mesnac.anomaly.model.UploadPictures;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.HashMap;
@ -46,7 +47,7 @@ public interface AbnormalBillService extends IService<AbnormalBill> {
* @param abnormalBill
* @param abnormalBillDispose
*/
void generateAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose,List<String> dutyCauseType,List<String> dutyType);
String generateAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose,List<String> dutyCauseType,List<String> dutyType);
void cancelBrowse(String handle,String cancelBrowse,String code);
@ -98,4 +99,17 @@ public interface AbnormalBillService extends IService<AbnormalBill> {
*/
void anomalyShutDown(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose);
/**
*
* @param abnormalBill
*/
public void fileUpload(AbnormalBill abnormalBill);
/**
*
* @param abnormalBill
* @return
*/
public UploadPictures findUploadPictureByAbnormalBo(AbnormalBill abnormalBill);
}

@ -0,0 +1,22 @@
package com.foreverwin.mesnac.anomaly.service;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-07-11
*/
public interface FileUploadedService {
public void uploadAttachment(MultipartFile fileItem, String site, String taskNo, String fileType);
public String showFile(HttpServletRequest request, HttpServletResponse response) throws Exception ;
public boolean deleteFile(String pathname, String filename);
}

@ -0,0 +1,28 @@
package com.foreverwin.mesnac.anomaly.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.anomaly.model.UploadPictures;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-07-11
*/
public interface UploadPicturesService extends IService<UploadPictures> {
/**
*
* @param frontPage
* @return
*/
IPage<UploadPictures> selectPage(FrontPage<UploadPictures> frontPage, UploadPictures uploadPictures);
List<UploadPictures> selectList(UploadPictures uploadPictures);
}

@ -89,6 +89,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
@Autowired
private DataFieldListService dataFieldListService;
@Autowired
private UploadPicturesService uploadPicturesService;
@Override
@ -110,10 +113,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
AbnormalBillDispose abnormalBillDispose,
List<String> dutyCauseType,
List<String> dutyType) {
this.generateAbnormalBill(abnormalBill,abnormalBillDispose,dutyCauseType,dutyType);
String message = this.generateAbnormalBill(abnormalBill, abnormalBillDispose, dutyCauseType, dutyType);
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
return abnormalBill.getAbnormalNo();
return message;
}
@Override
@ -122,7 +125,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
List<String> ncGroupAndNcCodes,
List<String> dutyCauseType,
List<String> dutyType) {
this.generateAbnormalBill(abnormalBill,abnormalBillDispose,dutyCauseType,dutyType);
String message = this.generateAbnormalBill(abnormalBill, abnormalBillDispose, dutyCauseType, dutyType);
//获取当前时间
LocalDateTime now = LocalDateTime.now();
//生成不良代码和不良代码组,并把它放到hashMap里面ncCode是存放在异常单里面的ncCode
@ -167,13 +170,13 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
return abnormalBill.getAbnormalNo();
return message;
}
@Override
public String anomalyReportDevice(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose) {
this.generateAbnormalBill(abnormalBill,abnormalBillDispose,null,null);
String message = this.generateAbnormalBill(abnormalBill, abnormalBillDispose, null, null);
List<NcCode> ncByNG = ncCodeService.findNcByNG(abnormalBill.getMessageType(), abnormalBill.getNcCode());
if(ncByNG == null || ncByNG.size() <= 0){
@ -181,7 +184,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
return abnormalBill.getAbnormalNo();
return message;
}
@Override
@ -377,17 +380,14 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
@Override
public void generateAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose,List<String> dutyCauseType,List<String> dutyType) {
public String generateAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose,List<String> dutyCauseType,List<String> dutyType) {
String site = CommonMethods.getSite();
String message = null;
LocalDateTime currentTime = LocalDateTime.now();
String user = CommonMethods.getUser();
if(StringUtil.isBlank(abnormalBill.getAbnormalNo())){
if(StringUtil.isBlank(abnormalBill.getAbnormalNo())) {
throw BusinessException.build("异常单号不存在");
}
abnormalBill.setHandle(HandleEnum.Z_ABNORMAL_BILL.getHandle(site,abnormalBill.getAbnormalNo()));
//更新的时候,判断该异常当的状态是否为新建
AbnormalBill abnormalBill1 = abnormalBillMapper.selectById(abnormalBill.getHandle());
@ -395,6 +395,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
if(!"N".equals(abnormalBill1.getStatus())){
throw BusinessException.build("该异常单已经被人处理,不能进行更新");
}
message = "更新成功";
}else{
message = "保存成功";
}
abnormalBillDispose.setAbnormalBillBo(abnormalBill.getHandle());
abnormalBillDispose.setHandle(HandleEnum.Z_ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
@ -502,6 +505,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
if(causeTypes.size() > 0){
abnormalCauseService.saveOrUpdateBatch(causeTypes);
}
//放置图片
this.fileUpload(abnormalBill);
return message;
}
@ -518,4 +525,57 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
abnormalBill.setCancelDateTime(now);
this.saveOrUpdate(abnormalBill);
}
}
@Override
public void fileUpload(AbnormalBill abnormalBill){
String user = CommonMethods.getUser();
LocalDateTime now = LocalDateTime.now();
List<String> name = null;
if(StringUtil.notBlank(abnormalBill.getFileName())){
name = Arrays.asList(abnormalBill.getFileName().split(","));
}
if(name != null && name.size() != 0){
//String uuid = UUID.randomUUID().toString();
UploadPictures uploadPictures = new UploadPictures();
uploadPictures.setHandle("UploadPicturesBO:"+abnormalBill.getSite()+","+abnormalBill.getAbnormalNo());
uploadPictures.setSite(abnormalBill.getSite());
uploadPictures.setPicturePath(abnormalBill.getFilePath());
StringBuilder pictureAddress = new StringBuilder();
for (int i = 0; i <= name.size() -1; i++) {
if(i != name.size() -1){
pictureAddress.append(abnormalBill.getFilePath()).append("/").append(name.get(i)).append(",");
}else{
pictureAddress.append(abnormalBill.getFilePath()).append("/").append(name.get(i));
}
}
uploadPictures.setPictureAddress(pictureAddress.toString());
uploadPictures.setObjectBo(abnormalBill.getHandle());
uploadPictures.setNum(abnormalBill.getFileNum());
uploadPictures.setType("ABNORMAL");
uploadPictures.setCreatedUser(user);
uploadPictures.setCreatedDateTime(now);
uploadPictures.setModifiedUser(user);
uploadPictures.setModifiedDateTime(now);
uploadPicturesService.saveOrUpdate(uploadPictures);
}
}
@Override
public UploadPictures findUploadPictureByAbnormalBo(AbnormalBill abnormalBill) {
String site = CommonMethods.getSite();
UploadPictures uploadPictures = new UploadPictures();
uploadPictures.setSite(site);
uploadPictures.setObjectBo(abnormalBill.getHandle());
List<UploadPictures> uploadPictures1 = uploadPicturesService.selectList(uploadPictures);
if(uploadPictures1 != null && uploadPictures1.size() == 1){
return uploadPictures1.get(0);
}
return null;
}
}

@ -0,0 +1,167 @@
package com.foreverwin.mesnac.anomaly.service.impl;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.ftp.Ftp;
import com.foreverwin.mesnac.anomaly.service.FileUploadedService;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
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.time.LocalDate;
import java.time.format.DateTimeFormatter;
/**
* @Description TODO
* @Author zhaojiawei
* @Since 2021-07-10
*/
@Service("FileUploaded")
@Transactional(rollbackFor = Exception.class)
@ConditionalOnProperty( prefix = "ftp",name = {"host","port","username","password"})
public class FileUploadedServiceImpl implements FileUploadedService {
@Value("${ftp.host}")
private String host;
@Value("${ftp.port}")
private Integer port;
@Value("${ftp.username}")
private String username;
@Value("${ftp.password}")
private String password;
private final static Logger logger = LoggerFactory.getLogger("FileUploadedServiceImpl");
/**
*
*
* @param fileItem
* @return
*/
@Override
public void uploadAttachment(MultipartFile fileItem,String site,String taskNo,String fileType) {
if (StrUtil.isBlank(site)) {
site = CommonMethods.getSite();
}
//上传附件目录:年/月/日
String path = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd"))+"/"+taskNo;
//上传附件名称
String fileName = fileItem.getOriginalFilename();
try {
Ftp ftp = new Ftp(host, port,username,password);
ftp.upload(path, fileName, fileItem.getInputStream());
ftp.close();
} catch (IOException e) {
logger.info(e.getMessage());
throw BusinessException.build("" + e.getMessage());
}
}
public String showFile(HttpServletRequest request, HttpServletResponse response) throws Exception {
String path = request.getParameter("PATH");
// InputStream in = null;
OutputStream out = null;
try {
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);
if(!FTPReply.isPositiveCompletion(ftpClient.getReplyCode())){
ftpClient.disconnect();
}
ftpClient.enterLocalActiveMode();
// 设置文件类型为二进制与ASCII有区别
ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
// 设置编码格式
ftpClient.setControlEncoding("GBK");
// 提取绝对地址的目录以及文件名
path = path.replace("ftp://"+path+":"+port+"/", "");
String dir = path.substring(0, path.lastIndexOf("/"));
String file = path.substring(path.lastIndexOf("/")+1);
// 进入文件所在目录,注意编码格式,以能够正确识别中文目录
boolean cdStatus = ftpClient.changeWorkingDirectory(new String(dir.getBytes("GBK"), FTP.DEFAULT_CONTROL_ENCODING));
// 检验文件是否存在
InputStream in = ftpClient.retrieveFileStream(new String(file.getBytes("GBK"),FTP.DEFAULT_CONTROL_ENCODING));
if(in == null || ftpClient.getReplyCode() == FTPReply.FILE_UNAVAILABLE){
return "该文件不存在";
}
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int len = 0;
while( (len=in.read(buffer)) != -1 ){
outStream.write(buffer, 0, len);
}
byte[] data = outStream.toByteArray();
out = response.getOutputStream();
out.write(data);
out.flush();
}catch (Exception e){
return "图片获取失败"+e.getMessage();
}finally {
out.close();
// in.close();
}
return "渲染图片成功";
}
@Override
public boolean deleteFile(String pathname, String filename){
boolean flag = false;
FTPClient ftpClient = null;
try {
//System.out.println("开始删除文件");
ftpClient = new FTPClient();
ftpClient.connect(host,port);
ftpClient.login(username,password);
if(!FTPReply.isPositiveCompletion(ftpClient.getReplyCode())){
ftpClient.disconnect();
}
ftpClient.enterLocalActiveMode();
// 设置文件类型为二进制与ASCII有区别
ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
// 设置编码格式
ftpClient.setControlEncoding("GBK");
//切换FTP目录
ftpClient.changeWorkingDirectory(pathname);
ftpClient.dele(filename);
ftpClient.logout();
flag = true;
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
if(ftpClient.isConnected()){
try{
ftpClient.disconnect();
}catch(IOException e){
e.printStackTrace();
}
}
}
}
}

@ -0,0 +1,46 @@
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.foreverwin.mesnac.anomaly.mapper.UploadPicturesMapper;
import com.foreverwin.mesnac.anomaly.service.UploadPicturesService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author Leon.L
* @since 2021-07-11
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class UploadPicturesServiceImpl extends ServiceImpl<UploadPicturesMapper, UploadPictures> implements UploadPicturesService {
@Autowired
private UploadPicturesMapper uploadPicturesMapper;
@Override
public IPage<UploadPictures> selectPage(FrontPage<UploadPictures> frontPage, UploadPictures uploadPictures) {
QueryWrapper<UploadPictures> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(uploadPictures);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<UploadPictures> selectList(UploadPictures uploadPictures) {
QueryWrapper<UploadPictures> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(uploadPictures);
return super.list(queryWrapper);
}
}

@ -0,0 +1,418 @@
<?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.foreverwin.mesnac.anomaly.mapper.UploadPicturesMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.anomaly.model.UploadPictures">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="PICTURE_PATH" property="picturePath" />
<result column="PICTURE_ADDRESS" property="pictureAddress" />
<result column="OBJECT_BO" property="objectBo" />
<result column="NUM" property="num" />
<result column="TYPE" property="type" />
<result column="CREATED_USER" property="createdUser" />
<result column="CREATED_DATE_TIME" property="createdDateTime" />
<result column="MODIFIED_USER" property="modifiedUser" />
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, PICTURE_PATH, PICTURE_ADDRESS, OBJECT_BO, NUM, TYPE, CREATED_USER, CREATED_DATE_TIME, MODIFIED_USER, MODIFIED_DATE_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_UPLOAD_PICTURES WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_UPLOAD_PICTURES
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_UPLOAD_PICTURES WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_UPLOAD_PICTURES
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_UPLOAD_PICTURES
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_UPLOAD_PICTURES
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_UPLOAD_PICTURES
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_UPLOAD_PICTURES
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_UPLOAD_PICTURES
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_UPLOAD_PICTURES
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.anomaly.model.UploadPictures">
INSERT INTO Z_UPLOAD_PICTURES
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="picturePath!=null">PICTURE_PATH,</if>
<if test="pictureAddress!=null">PICTURE_ADDRESS,</if>
<if test="objectBo!=null">OBJECT_BO,</if>
<if test="num!=null">NUM,</if>
<if test="type!=null">TYPE,</if>
<if test="createdUser!=null">CREATED_USER,</if>
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
<if test="modifiedUser!=null">MODIFIED_USER,</if>
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="picturePath!=null">#{picturePath},</if>
<if test="pictureAddress!=null">#{pictureAddress},</if>
<if test="objectBo!=null">#{objectBo},</if>
<if test="num!=null">#{num},</if>
<if test="type!=null">#{type},</if>
<if test="createdUser!=null">#{createdUser},</if>
<if test="createdDateTime!=null">#{createdDateTime},</if>
<if test="modifiedUser!=null">#{modifiedUser},</if>
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.anomaly.model.UploadPictures">
INSERT INTO Z_UPLOAD_PICTURES
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{picturePath},
#{pictureAddress},
#{objectBo},
#{num},
#{type},
#{createdUser},
#{createdDateTime},
#{modifiedUser},
#{modifiedDateTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_UPLOAD_PICTURES <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.picturePath!=null">PICTURE_PATH=#{et.picturePath},</if>
<if test="et.pictureAddress!=null">PICTURE_ADDRESS=#{et.pictureAddress},</if>
<if test="et.objectBo!=null">OBJECT_BO=#{et.objectBo},</if>
<if test="et.num!=null">NUM=#{et.num},</if>
<if test="et.type!=null">TYPE=#{et.type},</if>
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifiedUser!=null">MODIFIED_USER=#{et.modifiedUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_UPLOAD_PICTURES <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
PICTURE_PATH=#{et.picturePath},
PICTURE_ADDRESS=#{et.pictureAddress},
OBJECT_BO=#{et.objectBo},
NUM=#{et.num},
TYPE=#{et.type},
CREATED_USER=#{et.createdUser},
CREATED_DATE_TIME=#{et.createdDateTime},
MODIFIED_USER=#{et.modifiedUser},
MODIFIED_DATE_TIME=#{et.modifiedDateTime},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_UPLOAD_PICTURES <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.picturePath!=null">PICTURE_PATH=#{et.picturePath},</if>
<if test="et.pictureAddress!=null">PICTURE_ADDRESS=#{et.pictureAddress},</if>
<if test="et.objectBo!=null">OBJECT_BO=#{et.objectBo},</if>
<if test="et.num!=null">NUM=#{et.num},</if>
<if test="et.type!=null">TYPE=#{et.type},</if>
<if test="et.createdUser!=null">CREATED_USER=#{et.createdUser},</if>
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
<if test="et.modifiedUser!=null">MODIFIED_USER=#{et.modifiedUser},</if>
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_UPLOAD_PICTURES WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_UPLOAD_PICTURES
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_UPLOAD_PICTURES
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.picturePath!=null"> AND PICTURE_PATH=#{ew.entity.picturePath}</if>
<if test="ew.entity.pictureAddress!=null"> AND PICTURE_ADDRESS=#{ew.entity.pictureAddress}</if>
<if test="ew.entity.objectBo!=null"> AND OBJECT_BO=#{ew.entity.objectBo}</if>
<if test="ew.entity.num!=null"> AND NUM=#{ew.entity.num}</if>
<if test="ew.entity.type!=null"> AND TYPE=#{ew.entity.type}</if>
<if test="ew.entity.createdUser!=null"> AND CREATED_USER=#{ew.entity.createdUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifiedUser!=null"> AND MODIFIED_USER=#{ew.entity.modifiedUser}</if>
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_UPLOAD_PICTURES WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>

@ -47,8 +47,15 @@ wechat:
postUrl: https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=ACCESS_TOKEN
#ftp文档服务器
#ftp:
# host: 10.4.1.53
# port: 21
# username:
# password:
ftp:
host: 10.4.1.53
port: 21
username:
password:
host: 106.52.244.124
port: 21
username: zjw
password: zhaojiawei

@ -52,6 +52,12 @@
</exclusions>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>

Loading…
Cancel
Save