| @@ -31,6 +31,9 @@ public class UserApplication { | |||||
| @Value("${fm.open}") | @Value("${fm.open}") | ||||
| private boolean fmOpen; | private boolean fmOpen; | ||||
| @Value("${fm.upload_dir}") | |||||
| private String uploadDir; | |||||
| @Bean | @Bean | ||||
| public boolean isFmException() { | public boolean isFmException() { | ||||
| return fmException; | return fmException; | ||||
| @@ -46,6 +49,11 @@ public class UserApplication { | |||||
| return fmOpen; | return fmOpen; | ||||
| } | } | ||||
| @Bean | |||||
| public String fmUploadDir() { | |||||
| return uploadDir; | |||||
| } | |||||
| public static void main(String[] args) { | public static void main(String[] args) { | ||||
| SpringApplication.run(UserApplication.class, args); | SpringApplication.run(UserApplication.class, args); | ||||
| } | } | ||||
| @@ -48,6 +48,9 @@ public class WxAppinfoController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private boolean isFmOpen; | private boolean isFmOpen; | ||||
| @Autowired | |||||
| private String fmUploadDir; | |||||
| @Autowired | @Autowired | ||||
| private WxAppinfoService wxAppinfoService; | private WxAppinfoService wxAppinfoService; | ||||
| @@ -148,7 +151,7 @@ public class WxAppinfoController extends BaseController { | |||||
| } | } | ||||
| String filepath = Constant.fileDirectory; | |||||
| String filepath = fmUploadDir; | |||||
| String fileName = name + ".png"; | String fileName = name + ".png"; | ||||
| String destPath1 = filepath + "1_" + fileName; | String destPath1 = filepath + "1_" + fileName; | ||||
| String destPath = filepath + fileName; | String destPath = filepath + fileName; | ||||
| @@ -47,6 +47,9 @@ import static com.iformall.domain.po.WxCouponOrder.Field.CreateDate_DESC; | |||||
| public class WxCUserBasicInfoController extends BaseController { | public class WxCUserBasicInfoController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | |||||
| private String fmUploadDir; | |||||
| @Autowired | @Autowired | ||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | private WxCUserBasicInfoService wxCUserBasicInfoService; | ||||
| @@ -328,7 +331,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| stringRedisTemplate.opsForHash().putIfAbsent(importKey, "processCount", ""); | stringRedisTemplate.opsForHash().putIfAbsent(importKey, "processCount", ""); | ||||
| stringRedisTemplate.opsForHash().putIfAbsent(importKey, "failCount", ""); | stringRedisTemplate.opsForHash().putIfAbsent(importKey, "failCount", ""); | ||||
| String fpath = Constant.fileDirectory; | |||||
| String fpath = fmUploadDir; | |||||
| File targetFile = new File(fpath); | File targetFile = new File(fpath); | ||||
| if (!targetFile.exists()) { | if (!targetFile.exists()) { | ||||
| targetFile.mkdirs(); | targetFile.mkdirs(); | ||||
| @@ -30,6 +30,8 @@ import java.util.*; | |||||
| public class WxMsgController extends BaseController { | public class WxMsgController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | |||||
| private String fmUploadDir; | |||||
| @Autowired | @Autowired | ||||
| private WxMsgService wxMsgService; | private WxMsgService wxMsgService; | ||||
| @@ -89,11 +91,11 @@ public class WxMsgController extends BaseController { | |||||
| } | } | ||||
| String filename = UUID.randomUUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); | String filename = UUID.randomUUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); | ||||
| File path = new File(Constant.fileDirectory); | |||||
| File path = new File(fmUploadDir); | |||||
| if (!path.exists()) { | if (!path.exists()) { | ||||
| path.mkdirs(); | path.mkdirs(); | ||||
| } | } | ||||
| String filepath = Constant.fileDirectory + File.separator + filename; | |||||
| String filepath = fmUploadDir + filename; | |||||
| try { | try { | ||||
| FileOutputStream out = new FileOutputStream(new File(filepath)); | FileOutputStream out = new FileOutputStream(new File(filepath)); | ||||
| IOUtils.write(file.getBytes(), out); | IOUtils.write(file.getBytes(), out); | ||||
| @@ -38,6 +38,10 @@ import java.util.concurrent.TimeUnit; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxBillDaily") | @RequestMapping("wxBillDaily") | ||||
| public class WxBillDailyController extends BaseController { | public class WxBillDailyController extends BaseController { | ||||
| @Autowired | |||||
| private String fmUploadDir; | |||||
| @Autowired | @Autowired | ||||
| private WxBillDailyService wxBillDailyService; | private WxBillDailyService wxBillDailyService; | ||||
| @@ -141,7 +145,7 @@ public class WxBillDailyController extends BaseController { | |||||
| stringRedisTemplate.opsForHash().putIfAbsent(importKey, "processCount", ""); | stringRedisTemplate.opsForHash().putIfAbsent(importKey, "processCount", ""); | ||||
| stringRedisTemplate.opsForHash().putIfAbsent(importKey, "failCount", ""); | stringRedisTemplate.opsForHash().putIfAbsent(importKey, "failCount", ""); | ||||
| String fpath = Constant.fileDirectory; | |||||
| String fpath = fmUploadDir; | |||||
| File targetFile = new File(fpath); | File targetFile = new File(fpath); | ||||
| if (!targetFile.exists()) { | if (!targetFile.exists()) { | ||||
| targetFile.mkdirs(); | targetFile.mkdirs(); | ||||
| @@ -46,6 +46,9 @@ public class UploadController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private MallResourceService mallResourceService; | private MallResourceService mallResourceService; | ||||
| @Autowired | |||||
| private String fmUploadDir; | |||||
| private AmazonS3 s3 = null; | private AmazonS3 s3 = null; | ||||
| public ResultData awsUpload(InputStream inputStream, ObjectMetadata metadata, String fileName, String tenantId) { | public ResultData awsUpload(InputStream inputStream, ObjectMetadata metadata, String fileName, String tenantId) { | ||||
| @@ -176,8 +179,8 @@ public class UploadController extends BaseController { | |||||
| FileOutputStream fos = null; | FileOutputStream fos = null; | ||||
| String imgFormat = ImgUtil.getImgFormat(fileFormat); | String imgFormat = ImgUtil.getImgFormat(fileFormat); | ||||
| if(StringUtils.isNotBlank(imgFormat)) { | if(StringUtils.isNotBlank(imgFormat)) { | ||||
| String localImgFileName = Constant.fileDirectory + File.separator + tempFileName + "-1" + fileFormat; | |||||
| String localNewImgFileName = Constant.fileDirectory + File.separator + tempFileName + fileFormat; | |||||
| String localImgFileName = fmUploadDir + tempFileName + "-1" + fileFormat; | |||||
| String localNewImgFileName = fmUploadDir + tempFileName + fileFormat; | |||||
| BufferedInputStream fs = null; | BufferedInputStream fs = null; | ||||
| File localFile = new File(localImgFileName); | File localFile = new File(localImgFileName); | ||||
| fos = new FileOutputStream(localFile); | fos = new FileOutputStream(localFile); | ||||
| @@ -114,6 +114,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 1 | deploy: 1 | ||||
| open: false | open: false | ||||
| upload_dir: /home/test/server/uploads/ | |||||
| ueditor: | ueditor: | ||||
| config: config.json | config: config.json | ||||
| @@ -98,6 +98,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 3 | deploy: 3 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| ueditor: | ueditor: | ||||
| config: config.json | config: config.json | ||||
| @@ -98,6 +98,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 2 | deploy: 2 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| ueditor: | ueditor: | ||||
| config: config.json | config: config.json | ||||
| @@ -15,7 +15,6 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.config.AwsProperty; | import com.iformall.config.AwsProperty; | ||||
| import com.iformall.domain.po.MallResource; | import com.iformall.domain.po.MallResource; | ||||
| import com.iformall.service.MallResourceService; | import com.iformall.service.MallResourceService; | ||||
| import com.iformall.utils.Constant; | |||||
| import com.iformall.utils.ImgUtil; | import com.iformall.utils.ImgUtil; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| @@ -29,9 +28,6 @@ import org.springframework.web.bind.annotation.RequestParam; | |||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| import org.springframework.web.multipart.MultipartFile; | import org.springframework.web.multipart.MultipartFile; | ||||
| import javax.imageio.ImageIO; | |||||
| import java.awt.*; | |||||
| import java.awt.image.BufferedImage; | |||||
| import java.io.*; | import java.io.*; | ||||
| import java.net.URL; | import java.net.URL; | ||||
| import java.util.*; | import java.util.*; | ||||
| @@ -50,6 +46,9 @@ public class UploadController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private MallResourceService mallResourceService; | private MallResourceService mallResourceService; | ||||
| @Autowired | |||||
| private String fmUploadDir; | |||||
| private AmazonS3 s3 = null; | private AmazonS3 s3 = null; | ||||
| private ResultData awsUpload(InputStream inputStream, ObjectMetadata metadata, String fileName, String tenantId) { | private ResultData awsUpload(InputStream inputStream, ObjectMetadata metadata, String fileName, String tenantId) { | ||||
| @@ -180,8 +179,8 @@ public class UploadController extends BaseController { | |||||
| String imgFormat = ImgUtil.getImgFormat(fileFormat); | String imgFormat = ImgUtil.getImgFormat(fileFormat); | ||||
| if(StringUtils.isNotBlank(imgFormat)) { | if(StringUtils.isNotBlank(imgFormat)) { | ||||
| String localImgFileName = Constant.fileDirectory + File.separator + tempFileName + "-1" + fileFormat; | |||||
| String localNewImgFileName = Constant.fileDirectory + File.separator + tempFileName + fileFormat; | |||||
| String localImgFileName = fmUploadDir + tempFileName + "-1" + fileFormat; | |||||
| String localNewImgFileName = fmUploadDir + tempFileName + fileFormat; | |||||
| BufferedInputStream fs = null; | BufferedInputStream fs = null; | ||||
| File localFile = new File(localImgFileName); | File localFile = new File(localImgFileName); | ||||
| fos = new FileOutputStream(localFile); | fos = new FileOutputStream(localFile); | ||||
| @@ -107,6 +107,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 1 | deploy: 1 | ||||
| open: true | open: true | ||||
| upload_dir: /home/test/server/uploads | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -91,6 +91,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 3 | deploy: 3 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -91,6 +91,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 2 | deploy: 2 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -27,6 +27,9 @@ public class CApplication { | |||||
| @Value("${fm.open}") | @Value("${fm.open}") | ||||
| private boolean fmOpen; | private boolean fmOpen; | ||||
| @Value("${fm.upload_dir}") | |||||
| private String uploadDir; | |||||
| @Bean | @Bean | ||||
| public boolean isFmException() { | public boolean isFmException() { | ||||
| return fmException; | return fmException; | ||||
| @@ -42,6 +45,11 @@ public class CApplication { | |||||
| return fmOpen; | return fmOpen; | ||||
| } | } | ||||
| @Bean | |||||
| public String fmUploadDir() { | |||||
| return uploadDir; | |||||
| } | |||||
| public static void main(String[] args) { | public static void main(String[] args) { | ||||
| SpringApplication.run(CApplication.class, args); | SpringApplication.run(CApplication.class, args); | ||||
| @@ -106,7 +106,8 @@ fm: | |||||
| exception: false | exception: false | ||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 1 | deploy: 1 | ||||
| open: false | |||||
| open: true | |||||
| upload_dir: /home/test/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -91,6 +91,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 3 | deploy: 3 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -91,6 +91,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 2 | deploy: 2 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -31,6 +31,9 @@ public class CallbackApplication { | |||||
| @Value("${fm.open}") | @Value("${fm.open}") | ||||
| private boolean fmOpen; | private boolean fmOpen; | ||||
| @Value("${fm.upload_dir}") | |||||
| private String uploadDir; | |||||
| @Bean | @Bean | ||||
| public boolean isFmException() { | public boolean isFmException() { | ||||
| return fmException; | return fmException; | ||||
| @@ -46,6 +49,11 @@ public class CallbackApplication { | |||||
| return fmOpen; | return fmOpen; | ||||
| } | } | ||||
| @Bean | |||||
| public String fmUploadDir() { | |||||
| return uploadDir; | |||||
| } | |||||
| public static void main(String[] args) { | public static void main(String[] args) { | ||||
| SpringApplication.run(CallbackApplication.class, args); | SpringApplication.run(CallbackApplication.class, args); | ||||
| } | } | ||||
| @@ -112,6 +112,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 1 | deploy: 1 | ||||
| open: true | open: true | ||||
| upload_dir: /home/test/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -96,6 +96,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 3 | deploy: 3 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -96,6 +96,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 2 | deploy: 2 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -29,6 +29,9 @@ public class ConsumerApplication { | |||||
| @Value("${fm.open}") | @Value("${fm.open}") | ||||
| private boolean fmOpen; | private boolean fmOpen; | ||||
| @Value("${fm.upload_dir}") | |||||
| private String uploadDir; | |||||
| @Bean | @Bean | ||||
| public boolean isFmException() { | public boolean isFmException() { | ||||
| return fmException; | return fmException; | ||||
| @@ -44,6 +47,11 @@ public class ConsumerApplication { | |||||
| return fmOpen; | return fmOpen; | ||||
| } | } | ||||
| @Bean | |||||
| public String fmUploadDir() { | |||||
| return uploadDir; | |||||
| } | |||||
| public static void main(String[] args) { | public static void main(String[] args) { | ||||
| SpringApplication.run(ConsumerApplication.class, args); | SpringApplication.run(ConsumerApplication.class, args); | ||||
| @@ -107,6 +107,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 1 | deploy: 1 | ||||
| open: true | open: true | ||||
| upload_dir: /home/test/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -82,6 +82,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 3 | deploy: 3 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -92,6 +92,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 2 | deploy: 2 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -29,6 +29,9 @@ public class ScheduleApplication { | |||||
| @Value("${fm.open}") | @Value("${fm.open}") | ||||
| private boolean fmOpen; | private boolean fmOpen; | ||||
| @Value("${fm.upload_dir}") | |||||
| private String uploadDir; | |||||
| @Bean | @Bean | ||||
| public boolean isFmException() { | public boolean isFmException() { | ||||
| return fmException; | return fmException; | ||||
| @@ -44,6 +47,11 @@ public class ScheduleApplication { | |||||
| return fmOpen; | return fmOpen; | ||||
| } | } | ||||
| @Bean | |||||
| public String fmUploadDir() { | |||||
| return uploadDir; | |||||
| } | |||||
| public static void main(String[] args) { | public static void main(String[] args) { | ||||
| SpringApplication.run(ScheduleApplication.class, args); | SpringApplication.run(ScheduleApplication.class, args); | ||||
| @@ -107,6 +107,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 1 | deploy: 1 | ||||
| open: true | open: true | ||||
| upload_dir: /home/test/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -92,6 +92,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 3 | deploy: 3 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -92,6 +92,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 2 | deploy: 2 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -42,6 +42,9 @@ import java.util.*; | |||||
| public class WxPropertyContractServiceImpl implements WxPropertyContractService { | public class WxPropertyContractServiceImpl implements WxPropertyContractService { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | |||||
| private String fmUploadDir; | |||||
| @Autowired | @Autowired | ||||
| WxPropertyContractMapper wxPropertyContractMapper; | WxPropertyContractMapper wxPropertyContractMapper; | ||||
| @@ -797,7 +800,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| String filesuffix = wxPropertyContract.getFilepath().substring(wxPropertyContract.getFilepath().lastIndexOf(".")); | String filesuffix = wxPropertyContract.getFilepath().substring(wxPropertyContract.getFilepath().lastIndexOf(".")); | ||||
| String filename = UUID.randomUUID() + filesuffix; | String filename = UUID.randomUUID() + filesuffix; | ||||
| String filepath = Constant.fileDirectory; | |||||
| String filepath = fmUploadDir; | |||||
| String destPath = filepath + filename; | String destPath = filepath + filename; | ||||
| File dest = new File(destPath); | File dest = new File(destPath); | ||||
| File pDest = dest.getParentFile(); | File pDest = dest.getParentFile(); | ||||
| @@ -53,6 +53,9 @@ import java.util.*; | |||||
| public class WxRentContractServiceImpl implements WxRentContractService { | public class WxRentContractServiceImpl implements WxRentContractService { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | |||||
| private String fmUploadDir; | |||||
| @Autowired | @Autowired | ||||
| WxRentContractMapper wxRentContractMapper; | WxRentContractMapper wxRentContractMapper; | ||||
| @@ -1153,7 +1156,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(id); | WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(id); | ||||
| String filesuffix = wxRentContract.getFilepath().substring(wxRentContract.getFilepath().lastIndexOf(".")); | String filesuffix = wxRentContract.getFilepath().substring(wxRentContract.getFilepath().lastIndexOf(".")); | ||||
| String filename = UUID.randomUUID() + filesuffix; | String filename = UUID.randomUUID() + filesuffix; | ||||
| String filepath = Constant.fileDirectory; | |||||
| String filepath = fmUploadDir; | |||||
| String destPath = filepath + filename; | String destPath = filepath + filename; | ||||
| File dest = new File(destPath); | File dest = new File(destPath); | ||||
| File pDest = dest.getParentFile(); | File pDest = dest.getParentFile(); | ||||
| @@ -1404,7 +1407,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| logger.info("没有租赁及物业合同模板"); | logger.info("没有租赁及物业合同模板"); | ||||
| return; | return; | ||||
| } | } | ||||
| String filepath = Constant.fileDirectory; | |||||
| String filepath = fmUploadDir; | |||||
| String filename = UUID.randomUUID() + ".docx"; | String filename = UUID.randomUUID() + ".docx"; | ||||
| String exportFileName = result.get("merchantName").toString() + "合同.docx"; | String exportFileName = result.get("merchantName").toString() + "合同.docx"; | ||||
| exportWord(templatePath, filepath, filename, exportFileName, result, request, response); | exportWord(templatePath, filepath, filename, exportFileName, result, request, response); | ||||
| @@ -27,7 +27,6 @@ public class Constant { | |||||
| // 获取mall信息 | // 获取mall信息 | ||||
| public static final String MALL_KEY_PREV = "mall:"; | public static final String MALL_KEY_PREV = "mall:"; | ||||
| public static final String fileDirectory = "/tmp/uploads/"; | |||||
| public static final String importMemPrev = "importmem/"; | |||||
| public static final String importMemPrev = "importmem:"; | |||||
| public static final String adminPage = "https://admin.malls.iformall.com"; | public static final String adminPage = "https://admin.malls.iformall.com"; | ||||
| } | } | ||||
| @@ -31,6 +31,9 @@ public class SysApplication { | |||||
| @Value("${fm.open}") | @Value("${fm.open}") | ||||
| private boolean fmOpen; | private boolean fmOpen; | ||||
| @Value("${fm.upload_dir}") | |||||
| private String uploadDir; | |||||
| @Bean | @Bean | ||||
| public boolean isFmException() { | public boolean isFmException() { | ||||
| return fmException; | return fmException; | ||||
| @@ -46,6 +49,11 @@ public class SysApplication { | |||||
| return fmOpen; | return fmOpen; | ||||
| } | } | ||||
| @Bean | |||||
| public String fmUploadDir() { | |||||
| return uploadDir; | |||||
| } | |||||
| public static void main(String[] args) { | public static void main(String[] args) { | ||||
| SpringApplication.run(SysApplication.class, args); | SpringApplication.run(SysApplication.class, args); | ||||
| } | } | ||||
| @@ -40,6 +40,9 @@ public class WxAppinfoController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private boolean isFmOpen; | private boolean isFmOpen; | ||||
| @Autowired | |||||
| private String fmUploadDir; | |||||
| @Autowired | @Autowired | ||||
| private WxAppinfoService wxAppinfoService; | private WxAppinfoService wxAppinfoService; | ||||
| @@ -155,7 +158,7 @@ public class WxAppinfoController extends BaseController { | |||||
| } | } | ||||
| String filepath = Constant.fileDirectory; | |||||
| String filepath = fmUploadDir; | |||||
| String fileName = name + ".png"; | String fileName = name + ".png"; | ||||
| String destPath1 = filepath + "1_" + fileName; | String destPath1 = filepath + "1_" + fileName; | ||||
| String destPath = filepath + fileName; | String destPath = filepath + fileName; | ||||
| @@ -30,6 +30,8 @@ import java.util.*; | |||||
| public class WxMsgController extends BaseController { | public class WxMsgController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | |||||
| private String fmUploadDir; | |||||
| @Autowired | @Autowired | ||||
| private WxMsgService wxMsgService; | private WxMsgService wxMsgService; | ||||
| @@ -89,11 +91,11 @@ public class WxMsgController extends BaseController { | |||||
| } | } | ||||
| String filename = UUID.randomUUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); | String filename = UUID.randomUUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); | ||||
| File path = new File(Constant.fileDirectory); | |||||
| File path = new File(fmUploadDir); | |||||
| if (!path.exists()) { | if (!path.exists()) { | ||||
| path.mkdirs(); | path.mkdirs(); | ||||
| } | } | ||||
| String filepath = Constant.fileDirectory + File.separator + filename; | |||||
| String filepath = fmUploadDir + filename; | |||||
| try { | try { | ||||
| FileOutputStream out = new FileOutputStream(new File(filepath)); | FileOutputStream out = new FileOutputStream(new File(filepath)); | ||||
| IOUtils.write(file.getBytes(), out); | IOUtils.write(file.getBytes(), out); | ||||
| @@ -45,6 +45,9 @@ public class UploadController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private AwsProperty awsProperty; | private AwsProperty awsProperty; | ||||
| @Autowired | |||||
| private String fmUploadDir; | |||||
| @Autowired | @Autowired | ||||
| private MallResourceService mallResourceService; | private MallResourceService mallResourceService; | ||||
| @@ -175,8 +178,8 @@ public class UploadController extends BaseController { | |||||
| FileOutputStream fos = null; | FileOutputStream fos = null; | ||||
| String imgFormat = ImgUtil.getImgFormat(fileFormat); | String imgFormat = ImgUtil.getImgFormat(fileFormat); | ||||
| if(StringUtils.isNotBlank(imgFormat)) { | if(StringUtils.isNotBlank(imgFormat)) { | ||||
| String localImgFileName = Constant.fileDirectory + File.separator + tempFileName + "-1" + fileFormat; | |||||
| String localNewImgFileName = Constant.fileDirectory + File.separator + tempFileName + fileFormat; | |||||
| String localImgFileName = fmUploadDir + tempFileName + "-1" + fileFormat; | |||||
| String localNewImgFileName = fmUploadDir + tempFileName + fileFormat; | |||||
| BufferedInputStream fs = null; | BufferedInputStream fs = null; | ||||
| File localFile = new File(localImgFileName); | File localFile = new File(localImgFileName); | ||||
| fos = new FileOutputStream(localFile); | fos = new FileOutputStream(localFile); | ||||
| @@ -114,6 +114,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 1 | deploy: 1 | ||||
| open: true | open: true | ||||
| upload_dir: /home/test/server/uploads/ | |||||
| ueditor: | ueditor: | ||||
| config: config.json | config: config.json | ||||
| @@ -98,6 +98,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 3 | deploy: 3 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| ueditor: | ueditor: | ||||
| config: config.json | config: config.json | ||||
| @@ -98,6 +98,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 2 | deploy: 2 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| ueditor: | ueditor: | ||||
| config: config.json | config: config.json | ||||
| @@ -28,6 +28,9 @@ public class SocketServerApplication { | |||||
| @Value("${fm.open}") | @Value("${fm.open}") | ||||
| private boolean fmOpen; | private boolean fmOpen; | ||||
| @Value("${fm.upload_dir}") | |||||
| private String uploadDir; | |||||
| @Bean | @Bean | ||||
| public boolean isFmException() { | public boolean isFmException() { | ||||
| return fmException; | return fmException; | ||||
| @@ -43,6 +46,11 @@ public class SocketServerApplication { | |||||
| return fmOpen; | return fmOpen; | ||||
| } | } | ||||
| @Bean | |||||
| public String fmUploadDir() { | |||||
| return uploadDir; | |||||
| } | |||||
| public static void main(String[] args) { | public static void main(String[] args) { | ||||
| SpringApplication.run(SocketServerApplication.class, args); | SpringApplication.run(SocketServerApplication.class, args); | ||||
| @@ -107,6 +107,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 1 | deploy: 1 | ||||
| open: true | open: true | ||||
| upload_dir: /home/test/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -92,6 +92,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 3 | deploy: 3 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||
| @@ -92,6 +92,7 @@ fm: | |||||
| exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | exception_emails: hupeng@iformall.com,wuguoqiang@iformall.com,gongbiao@iformall.com,luozukai@iformall.com | ||||
| deploy: 2 | deploy: 2 | ||||
| open: true | open: true | ||||
| upload_dir: /home/ec2-user/server/uploads/ | |||||
| logging: | logging: | ||||
| level: | level: | ||||