diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java
index 415186e93..49f16026d 100644
--- a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java
+++ b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java
@@ -128,6 +128,9 @@ public class WxRentContract implements Serializable {
@io.swagger.annotations.ApiModelProperty(value = "联系电话", name = "payAccount")
private String payAccount;
+ @io.swagger.annotations.ApiModelProperty(value = "上传文件名", name = "filename")
+ private String filename;
+
public Long getMerchantId() {
return merchantId;
@@ -321,6 +324,14 @@ public class WxRentContract implements Serializable {
this.payAccount = payAccount;
}
+ public String getFilename() {
+ return filename;
+ }
+
+ public void setFilename(String filename) {
+ this.filename = filename;
+ }
+
public static enum Field {
Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), MerchantId_ASC("`merchant_id` ASC"), MerchantId_DESC("`merchant_id` DESC"), Price_ASC("`price` ASC"), Price_DESC("`price` DESC"), RentalStartDate_ASC("`rental_start_date` ASC"), RentalStartDate_DESC("`rental_start_date` DESC"), RentalEndDate_ASC("`rental_end_date` ASC"), RentalEndDate_DESC("`rental_end_date` DESC"), SignDate_ASC("`sign_date` ASC"), SignDate_DESC("`sign_date` DESC"), ReceivePeriod_ASC("`receive_period` ASC"), ReceivePeriod_DESC("`receive_period` DESC"), TenantId_ASC("`tenant_id` ASC"), TenantId_DESC("`tenant_id` DESC"), Filepath_ASC("`filepath` ASC"), Filepath_DESC("`filepath` DESC"), Status_ASC("`status` ASC"), Status_DESC("`status` DESC"), ContractNumber_ASC("`contract_number` ASC"), ContractNumber_DESC("`contract_number` DESC"), Deposit_ASC("`deposit` ASC"), Deposit_DESC("`deposit` DESC"), PayDate_ASC("`pay_date` ASC"), PayDate_DESC("`pay_date` DESC"), IsDel_ASC("`is_del` ASC"), IsDel_DESC("`is_del` DESC"), MerchantName_ASC("`merchant_name` ASC"), MerchantName_DESC("`merchant_name` DESC"), Brand_ASC("`brand` ASC"), Brand_DESC("`brand` DESC"), BusinessId_ASC("`business_id` ASC"), BusinessId_DESC("`business_id` DESC"), ShopType_ASC("`shop_type` ASC"), ShopType_DESC("`shop_type` DESC"), ShopId_ASC("`shop_id` ASC"), ShopId_DESC("`shop_id` DESC"), Updatetime_ASC("`updatetime` ASC"), Updatetime_DESC("`updatetime` DESC"), Createtime_ASC("`createtime` ASC"), Createtime_DESC("`createtime` DESC");
private String value;
diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
index 55cc4bd01..0c5466663 100644
--- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
+++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
@@ -128,7 +128,8 @@ public class WxRentContractServiceImpl implements WxRentContractService {
String id = request.getParameter("id");
WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(id);
- String filename = wxRentContract.getFilepath().substring(wxRentContract.getFilepath().lastIndexOf("/")+1);
+ String filesuffix = wxRentContract.getFilepath().substring(wxRentContract.getFilepath().lastIndexOf("."));
+ String filename=UUID.randomUUID()+filesuffix;
String filepath = Constant.fileDirectory;
String destPath = filepath + filename;
File dest = new File(destPath);
@@ -138,8 +139,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
try {
downLoadFromUrl(wxRentContract.getFilepath(),filename,filepath);
- //FileUtils.copyURLToFile(new URL(wxRentContract.getFilepath()),dest);
- downFile(destPath, filename, response, request);
+ downFile(destPath, wxRentContract.getFilename(), response, request);
org.apache.commons.io.FileUtils.forceDelete(dest);
} catch (IOException e) {
logger.info("创建本地文件失败"+e.getMessage());
@@ -173,7 +173,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
public ResultData endRentContract(Long id) {
WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(id);
- wxRentContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode());
+ wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_TERMINATE.getCode());
try {
wxRentContractMapper.updateByPrimaryKeySelective(wxRentContract);
//停用商户
diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml
index 829b4e0ae..bca5bfb77 100644
--- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml
@@ -26,11 +26,12 @@
+
- `id`,`merchant_id`,`price`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`,`tenant_id`,`filepath`,`status`,`contract_number`,`deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`,`shop_type`,`shop_id`,`updatetime`,`createtime`,`link_person`,`link_phone`,`pay_account`
+ `id`,`merchant_id`,`price`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`,`tenant_id`,`filepath`,`status`,`contract_number`,`deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`,`shop_type`,`shop_id`,`updatetime`,`createtime`,`link_person`,`link_phone`,`pay_account`,`filename`
@@ -59,6 +60,7 @@
and `link_person` = #{linkPerson}
and `link_phone` = #{linkPhone}
and `pay_account` = #{payAccount}
+ and `filename` = #{filename}
and id in