|
@@ -10,10 +10,7 @@ import com.hssx.cloudmodel.entity.vo.UserVO;
|
|
import com.hssx.cloudmodel.mapper.*;
|
|
import com.hssx.cloudmodel.mapper.*;
|
|
import com.hssx.cloudmodel.service.MouldFileService;
|
|
import com.hssx.cloudmodel.service.MouldFileService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import com.hssx.cloudmodel.util.FileUtil;
|
|
|
|
-import com.hssx.cloudmodel.util.HttpRespMsg;
|
|
|
|
-import com.hssx.cloudmodel.util.ListUtil;
|
|
|
|
-import com.hssx.cloudmodel.util.PageUtil;
|
|
|
|
|
|
+import com.hssx.cloudmodel.util.*;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
@@ -25,6 +22,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.*;
|
|
import java.io.*;
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.zip.ZipEntry;
|
|
import java.util.zip.ZipEntry;
|
|
import java.util.zip.ZipOutputStream;
|
|
import java.util.zip.ZipOutputStream;
|
|
@@ -221,8 +219,6 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
mould.setState(4+"");//4已报废状态
|
|
mould.setState(4+"");//4已报废状态
|
|
mouldMapper.updateById(mould);
|
|
mouldMapper.updateById(mould);
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
mf.setState(1);
|
|
mf.setState(1);
|
|
}
|
|
}
|
|
@@ -233,6 +229,17 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
//添加审批记录
|
|
//添加审批记录
|
|
MouldOperationDynamics dynamics = new MouldOperationDynamics();
|
|
MouldOperationDynamics dynamics = new MouldOperationDynamics();
|
|
dynamics.setMouldId(oldData.getId());
|
|
dynamics.setMouldId(oldData.getId());
|
|
|
|
+ dynamics.setBelongType(oldData.getBlongType());
|
|
|
|
+ dynamics.setFileId(oldData.getId());
|
|
|
|
+ if(null != oldData.getFileName2()){
|
|
|
|
+ dynamics.setFileName(oldData.getFileName()+","+oldData.getFileName2());
|
|
|
|
+ }else{
|
|
|
|
+ dynamics.setFileName(oldData.getFileName());
|
|
|
|
+ }
|
|
|
|
+ dynamics.setOperatorId(user.getId());
|
|
|
|
+ dynamics.setOperatorName(user.getUsername());
|
|
|
|
+ dynamics.setContent(Constant.APPROVAL);
|
|
|
|
+ mouldOperationDynamicsMapper.insert(dynamics);
|
|
} else if (user.getSubordinateType() == 1) {
|
|
} else if (user.getSubordinateType() == 1) {
|
|
//生产方
|
|
//生产方
|
|
if (isPass == 1) {
|
|
if (isPass == 1) {
|
|
@@ -252,6 +259,20 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
mf.setState(-2);
|
|
mf.setState(-2);
|
|
}
|
|
}
|
|
mouldFileMapper.updateById(mf);
|
|
mouldFileMapper.updateById(mf);
|
|
|
|
+ //添加审批记录
|
|
|
|
+ MouldOperationDynamics dynamics = new MouldOperationDynamics();
|
|
|
|
+ dynamics.setMouldId(oldData.getId());
|
|
|
|
+ dynamics.setBelongType(oldData.getBlongType());
|
|
|
|
+ dynamics.setFileId(oldData.getId());
|
|
|
|
+ if(null != oldData.getFileName2()){
|
|
|
|
+ dynamics.setFileName(oldData.getFileName()+","+oldData.getFileName2());
|
|
|
|
+ }else{
|
|
|
|
+ dynamics.setFileName(oldData.getFileName());
|
|
|
|
+ }
|
|
|
|
+ dynamics.setOperatorId(user.getId());
|
|
|
|
+ dynamics.setOperatorName(user.getUsername());
|
|
|
|
+ dynamics.setContent(Constant.APPROVAL);
|
|
|
|
+ mouldOperationDynamicsMapper.insert(dynamics);
|
|
} else {
|
|
} else {
|
|
msg.setError("只有生产方和资产方才能审核, subordinteType = " + user.getSubordinateType() + ", 无效!");
|
|
msg.setError("只有生产方和资产方才能审核, subordinteType = " + user.getSubordinateType() + ", 无效!");
|
|
}
|
|
}
|
|
@@ -462,6 +483,54 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg downloadFileListExcel(UserVO userVO, HttpServletResponse response) {
|
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
|
+ List<List<String>> list = new ArrayList<List<String>>();
|
|
|
|
+ //标题
|
|
|
|
+ List<String> titleList = new ArrayList<String>();
|
|
|
|
+ titleList.add("文件名");
|
|
|
|
+ titleList.add("下载者姓名");
|
|
|
|
+ titleList.add("文件类型");
|
|
|
|
+ titleList.add("下载时间");
|
|
|
|
+ list.add(titleList);
|
|
|
|
+ QueryWrapper<MouldOperationDynamics> qw = new QueryWrapper<MouldOperationDynamics>();
|
|
|
|
+ qw.eq("content",Constant.DOWNLOAD);
|
|
|
|
+ SimpleDateFormat dateSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ if(userVO.getStartTime() != null && userVO.getEndTime() != null){
|
|
|
|
+ qw.le("indate",userVO.getStartTime());
|
|
|
|
+ qw.ge("indate",userVO.getEndTime());
|
|
|
|
+ }
|
|
|
|
+ List<MouldOperationDynamics> mouldOperationDynamics = mouldOperationDynamicsMapper.selectList(qw);
|
|
|
|
+ for (MouldOperationDynamics dynamic : mouldOperationDynamics) {
|
|
|
|
+ List<String> rowList = new ArrayList<String>();
|
|
|
|
+ //文件名
|
|
|
|
+ rowList.add(dynamic.getFileName());
|
|
|
|
+ //操作者名字
|
|
|
|
+ rowList.add(dynamic.getOperatorName());
|
|
|
|
+ //文件类型
|
|
|
|
+ if(dynamic.getBelongType()==0){
|
|
|
|
+ rowList.add("模具文档");
|
|
|
|
+ }else if(dynamic.getBelongType()==1){
|
|
|
|
+ rowList.add("零件文档");
|
|
|
|
+ }else if(dynamic.getBelongType()==2){
|
|
|
|
+ rowList.add("试模验收");
|
|
|
|
+ }else if(dynamic.getBelongType()==3){
|
|
|
|
+ rowList.add("保养方案");
|
|
|
|
+ }else if(dynamic.getBelongType()==4){
|
|
|
|
+ rowList.add("模具更新");
|
|
|
|
+ }else if(dynamic.getBelongType()==5){
|
|
|
|
+ rowList.add("模具报废");
|
|
|
|
+ }
|
|
|
|
+ //下载时间
|
|
|
|
+ rowList.add(dateSdf.format(dynamic.getIndate()));
|
|
|
|
+ }
|
|
|
|
+ Mould mould = mouldMapper.selectById(userVO.getMouldId());
|
|
|
|
+ ExcelUtil.exportGeneralExcelByTitleAndList(response, mould.getModelNo()+mould.getModelName()+"-"+ dateSdf.format(new Date()), list);
|
|
|
|
+ msg.data = mould;
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
public Map<String, Object> feedBackDirectMultiDownload(HttpServletRequest request, HttpServletResponse response, String downloadPath, Mould vo, List<MouldFile> mouldFiles,String oldFilePath) throws IOException {
|
|
public Map<String, Object> feedBackDirectMultiDownload(HttpServletRequest request, HttpServletResponse response, String downloadPath, Mould vo, List<MouldFile> mouldFiles,String oldFilePath) throws IOException {
|
|
//压缩文件初始设置
|
|
//压缩文件初始设置
|