Просмотр исходного кода

[合同管理][修改][增加文件名字段,修改终止合同]

release_toaliyun_real
gongbiao 7 лет назад
Родитель
Сommit
c9c6df7580
3 измененных файлов: 18 добавлений и 5 удалений
  1. +11
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java
  2. +4
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  3. +3
    -1
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml

+ 11
- 0
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;


+ 4
- 4
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);
//停用商户


+ 3
- 1
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml Просмотреть файл

@@ -26,11 +26,12 @@
<result column="link_person" jdbcType="VARCHAR" property="linkPerson"/>
<result column="link_phone" jdbcType="VARCHAR" property="linkPhone"/>
<result column="pay_account" jdbcType="VARCHAR" property="payAccount"/>
<result column="filename" jdbcType="VARCHAR" property="filename"/>
</resultMap>
<sql id="allColumns">
`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`
</sql>
<sql id="dynamicWhereConditions">
@@ -59,6 +60,7 @@
<if test=" null != linkPerson ">and `link_person` = #{linkPerson}</if>
<if test=" null != linkPhone ">and `link_phone` = #{linkPhone}</if>
<if test=" null != payAccount ">and `pay_account` = #{payAccount}</if>
<if test=" null != filename ">and `filename` = #{filename}</if>
<if test=" null != ids ">
and id in


Загрузка…
Отмена
Сохранить