diff --git a/src/main/java/com/zcloud/controller/bus/CorpInfoController.java b/src/main/java/com/zcloud/controller/bus/CorpInfoController.java index 01babf0..261a20e 100644 --- a/src/main/java/com/zcloud/controller/bus/CorpInfoController.java +++ b/src/main/java/com/zcloud/controller/bus/CorpInfoController.java @@ -113,6 +113,7 @@ public class CorpInfoController extends BaseController { @ResponseBody @Transactional public Object add( + @RequestParam(value = "official_seal_file", required = false) MultipartFile[] official_seal_file, @RequestParam(value = "imgFiles", required = false) MultipartFile[] imgFiles, @RequestParam(value = "fourFiles", required = false) MultipartFile[] fourFiles) throws Exception { Map map = new HashMap(); @@ -128,7 +129,7 @@ public class CorpInfoController extends BaseController { List mainRoles = roleService.getRoleListByPid(pRold); if (mainRoles != null && mainRoles.size() > 0) { // 保存企业信息 - saveCorpInfo(pd); + saveCorpInfo(pd,official_seal_file); if ("2".equals(pd.get("STATUS"))) { saveCorpTrial(pd); } @@ -142,7 +143,6 @@ public class CorpInfoController extends BaseController { img.put("TYPE", "1"); editCorpImg(imgFiles, img); } - if (fourFiles != null && fourFiles.length > 0) { img.put("TYPE", "2"); editCorpImg(fourFiles, img); @@ -174,6 +174,7 @@ public class CorpInfoController extends BaseController { flow.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); flow.put("FLOW_STEP", "0"); // 待指定项目负责人 flow.put("FLOW_ACTION", Jurisdiction.getUsername() + "创建企业"); // 操作详情:创建企业 + flow.put("STATUS", 1); saveMaintenanceFlow(flow); map.put("pd", pd); @@ -1403,6 +1404,10 @@ public class CorpInfoController extends BaseController { pd2.put("FOREIGN_KEY", pd.getString("CORPINFO_ID")); pd2.put("TYPE", 1); List busImgs = imgfilesService.listAll(pd2);//营业执照图片 + PageData pd3 = new PageData(); + pd2.put("FOREIGN_KEY", pd.getString("CORPINFO_ID")); + pd2.put("TYPE", 0); + List official_seal_file = imgfilesService.listAll(pd2);//公章图片 pd2.put("TYPE", 2); List fourImgs = imgfilesService.listAll(pd2);//四色图照图片 @@ -1483,6 +1488,7 @@ public class CorpInfoController extends BaseController { map.put("pd", pd); map.put("cpd", cpd); map.put("busImgs", busImgs); + map.put("official_seal_file", official_seal_file); map.put("fourImgs", fourImgs); map.put("result", errInfo); return map; @@ -2255,7 +2261,7 @@ public class CorpInfoController extends BaseController { * * @param pd */ - private void saveCorpInfo(PageData pd) throws Exception { + private void saveCorpInfo(PageData pd, MultipartFile[] official_seal_file) throws Exception { pd.put("CORPINFO_ID", this.get32UUID()); //主键 pd.put("ISDELETE", "0"); //是否删除 pd.put("ISDELIVER", "0"); //是否交付 1-已交付 0- 未交付 @@ -2267,6 +2273,10 @@ public class CorpInfoController extends BaseController { pd.put("CREATOR", Jurisdiction.getUsername()); //创建人 pd.put("CREATUSERID", Jurisdiction.getUSER_ID()); //创建人 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间 + if (official_seal_file != null && official_seal_file.length > 0) { + pd.put("OFFICIAL_SEAL_PATH", smb.saveFile(official_seal_file[0],pd.getString("CORPINFO_ID"))); + } if (!Tools.isEmpty(pd.get("CORP_OF_TYPEAll"))) { PageData corptypePd = new PageData(); corptypePd.put("CORPTYPE_ID", pd.get("CORP_OF_TYPEAll")); diff --git a/src/main/java/com/zcloud/util/Const.java b/src/main/java/com/zcloud/util/Const.java index 49a4ae5..34d09e8 100644 --- a/src/main/java/com/zcloud/util/Const.java +++ b/src/main/java/com/zcloud/util/Const.java @@ -28,14 +28,13 @@ public class Const { public static final String SYSNAME = "sysName"; //系统名称 public static final String SHOWCOUNT = "showCount"; //每页条数 - public static final String FILEPATHFILE = "/uploadFiles/file/"; //文件上传路径 - public static final String BIFILEPATHFILE = "/uploadFiles/Bfile/"; //文件上传路径 - public static final String FILEPATHIMG = "/uploadFiles/imgs/"; //图片上传路径 - public static final String FILEPATHDZJM = "/uploadFiles/dzjm/"; //图片上传路径 - public static final String FILEPATHYHTP = "/uploadFiles/yhtp/"; //图片上传路径 - public static final String FILEPATHOEM = "/uploadFiles/oem/"; // oem - public static final String FILEPATHWORDTEMPLATE = "/uploadFiles/wordTemplate/"; //word导出模板文件夹 - public static final String FILEPATHCURRICULUM = "/uploadFiles/curriculum/"; //课程照片 + public static final String FILEPATHFILE = "/traffic/uploadFiles/file/"; //文件上传路径 + public static final String BIFILEPATHFILE = "/traffic/uploadFiles/Bfile/"; //文件上传路径 + public static final String FILEPATHIMG = "/traffic/uploadFiles/imgs/"; //图片上传路径 + public static final String FILEPATHDZJM = "/traffic/uploadFiles/dzjm/"; //图片上传路径 + public static final String FILEPATHYHTP = "/traffic/uploadFiles/yhtp/"; //图片上传路径 + public static final String FILEPATHWORDTEMPLATE = "/traffic/uploadFiles/wordTemplate/"; //word导出模板文件夹 + public static final String FILEPATHCURRICULUM = "/traffic/uploadFiles/curriculum/"; //课程照片 public static final String FILEACTIVITI = "/uploadFiles/activitiFile/"; //工作流生成XML和PNG目录 diff --git a/src/main/java/com/zcloud/util/Smb.java b/src/main/java/com/zcloud/util/Smb.java index 1d26dd3..8da9b43 100644 --- a/src/main/java/com/zcloud/util/Smb.java +++ b/src/main/java/com/zcloud/util/Smb.java @@ -200,20 +200,7 @@ public class Smb { } public String saveFile(MultipartFile file, String cost) throws Exception { - // 生成文件名 - String fileName = Warden.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); - // 根据项目类型生成项目文件 - String filePath; - if ("admin".equals(Jurisdiction.getUsername())) { - filePath = cost + "admin" + "/" + DateUtil.getDays(); - } else { - filePath = cost + "imgFactory" + "/" + DateUtil.getDays(); - } - - // 保存文件 - this.sshSftp(file, fileName, filePath); - // 返回文件保存目录 - return filePath + "/" + fileName; + return this.saveFile(file, cost, Const.FILEPATHFILE); } public String saveFile(MultipartFile file, String modular, String path) throws Exception { diff --git a/src/main/resources/mybatis/dsno2/corp/CorpInfoMapper.xml b/src/main/resources/mybatis/dsno2/corp/CorpInfoMapper.xml index a4298ee..e71752c 100644 --- a/src/main/resources/mybatis/dsno2/corp/CorpInfoMapper.xml +++ b/src/main/resources/mybatis/dsno2/corp/CorpInfoMapper.xml @@ -90,7 +90,10 @@ f.VIPLEVEL, f.USERS_NUM, f.STATUS, - f.REGULARTYPE + f.REGULARTYPE, + f.OFFICIAL_SEAL_PATH, + f.INDUSTRY_TYPE, + f.INDUSTRY_NAME @@ -172,7 +175,10 @@ VIPLEVEL, USERS_NUM, STATUS, - REGULARTYPE + REGULARTYPE, + OFFICIAL_SEAL_PATH, + INDUSTRY_TYPE, + INDUSTRY_NAME @@ -254,9 +260,10 @@ #{VIPLEVEL}, #{USERS_NUM}, #{STATUS}, - #{REGULARTYPE} - - + #{REGULARTYPE}, + #{OFFICIAL_SEAL_PATH}, + #{INDUSTRY_TYPE}, + #{INDUSTRY_NAME} @@ -476,31 +483,31 @@ CITY=#{CITY}, COUNTY=#{COUNTY}, VILLAGE = #{VILLAGE}, - LOGIN_USER_ID = #{LOGIN_USER_ID}, - ADDRESS_BUSINESS = #{ADDRESS_BUSINESS}, - ADDRESS_OFFICE = #{ADDRESS_OFFICE}, - CORP_STATE = #{CORP_STATE}, - FIXED_ASSETS = #{FIXED_ASSETS}, - YEAR_OUTPUT_VALUE = #{YEAR_OUTPUT_VALUE}, - REG_TYPE = #{REG_TYPE}, - SUBORDINATION = #{SUBORDINATION}, - CORP_OF_TYPE = #{CORP_OF_TYPE}, - CORP_OF_TYPE2 = #{CORP_OF_TYPE2}, - INDUSTRY_DEPARTMENT = #{INDUSTRY_DEPARTMENT}, - SCALE_TYPE = #{SCALE_TYPE}, - SAFETY_NAME = #{SAFETY_NAME}, - SAFETY_POST = #{SAFETY_POST}, - SAFETY_NUMBER = #{SAFETY_NUMBER}, - SAFETY_PHONE = #{SAFETY_PHONE}, - CORP_CONFIRM = #{CORP_CONFIRM}, - CORP_EXAMINE = #{CORP_EXAMINE}, + LOGIN_USER_ID = #{LOGIN_USER_ID}, + ADDRESS_BUSINESS = #{ADDRESS_BUSINESS}, + ADDRESS_OFFICE = #{ADDRESS_OFFICE}, + CORP_STATE = #{CORP_STATE}, + FIXED_ASSETS = #{FIXED_ASSETS}, + YEAR_OUTPUT_VALUE = #{YEAR_OUTPUT_VALUE}, + REG_TYPE = #{REG_TYPE}, + SUBORDINATION = #{SUBORDINATION}, + CORP_OF_TYPE = #{CORP_OF_TYPE}, + CORP_OF_TYPE2 = #{CORP_OF_TYPE2}, + INDUSTRY_DEPARTMENT = #{INDUSTRY_DEPARTMENT}, + SCALE_TYPE = #{SCALE_TYPE}, + SAFETY_NAME = #{SAFETY_NAME}, + SAFETY_POST = #{SAFETY_POST}, + SAFETY_NUMBER = #{SAFETY_NUMBER}, + SAFETY_PHONE = #{SAFETY_PHONE}, + CORP_CONFIRM = #{CORP_CONFIRM}, + CORP_EXAMINE = #{CORP_EXAMINE}, STREET = #{STREET}, - REPORT_CYCLE=#{REPORT_CYCLE}, + REPORT_CYCLE=#{REPORT_CYCLE}, REPORT_STATUS=#{REPORT_STATUS}, TRAINTYPE=#{TRAINTYPE}, VIPLEVEL = #{VIPLEVEL}, - USERS_NUM = #{USERS_NUM}, - REGULARTYPE = #{REGULARTYPE} + USERS_NUM = #{USERS_NUM}, + REGULARTYPE = #{REGULARTYPE} where CORPINFO_ID = #{CORPINFO_ID}