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

[合同管理][创建合同][店铺关联合同后把当前店铺待签约的作废]

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

+ 1
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java Просмотреть файл

@@ -125,7 +125,7 @@ public class WxRentContract implements Serializable {
@io.swagger.annotations.ApiModelProperty(value = "联系电话", name = "linkPhone")
private String linkPhone;

@io.swagger.annotations.ApiModelProperty(value = "联系电话", name = "payAccount")
@io.swagger.annotations.ApiModelProperty(value = "付款账号", name = "payAccount")
private String payAccount;

@io.swagger.annotations.ApiModelProperty(value = "上传文件名", name = "filename")


+ 2
- 1
mallinkService/src/main/java/com/iformall/enums/EnumRentContractStatus.java Просмотреть файл

@@ -10,7 +10,8 @@ public enum EnumRentContractStatus {
RENT_PAID(3, "计租中"),
CONTRACT_END_SOON(4, "即将到期"),
CONTRACT_END(5, "正常到期"),
CONTRACT_TERMINATE(6, "提前终止")
CONTRACT_TERMINATE(6, "提前终止"),
INVALID(7, "作废")
;

public static EnumRentContractStatus getEnum(Integer code) {


+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java Просмотреть файл

@@ -31,4 +31,6 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Strin

void updateRentWaitSignStatus(WxRentContract wxRentContract);

void updateRentInvalidStatus(WxRentContract wxRentContract);

}

+ 5
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Просмотреть файл

@@ -258,6 +258,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
shopparams.put("status",EnumShopStatus.NOT_RENT.getCode());
Map<String,Object> shopLeftInfo=wxShopMapper.queryShopLeftInfo(shopparams);
resultData.put("shopLeftInfo",shopLeftInfo);

//需要更新的状态
resultData.putAll(updateStatus(tenantId));
return resultData;
@@ -299,6 +300,10 @@ public class WxRentContractServiceImpl implements WxRentContractService {
WxRentContract wxRentContract = new WxRentContract();
wxRentContract.setTenantId(tenantId);

//作废合同
wxRentContract.setStatus(EnumRentContractStatus.INVALID.getCode());
wxRentContractMapper.updateRentInvalidStatus(wxRentContract);

//待签约
wxRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
wxRentContractMapper.updateRentWaitSignStatus(wxRentContract);


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

@@ -84,7 +84,7 @@
<select id="queryRentContractData" resultType="hashmap" parameterType="com.iformall.domain.po.WxRentContract">
select rc.id,rc.merchant_name merchantName,rc.rental_start_date rentalStartDate,rc.rental_end_date rentalEndDate,rc.`status`,
rc.price,rc.contract_number contractNumber,s.shop_number shopNumber,f.floor_name floorName,b.building_name buildingName,
rc.lease
rc.lease,rc.filepath,rc.filename
from wx_rent_contract rc
left join wx_shop s on rc.shop_id=s.id
left join wx_mall_floor f on s.floor=f.id
@@ -103,31 +103,37 @@
</select>
<select id="queryRentContractEndSoonStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract">
select count(id) from wx_rent_contract where tenant_id=#{tenantId} and status!=1 and status!=6 and DATEDIFF(rental_end_date,now()) &lt;= 30
select count(id) from wx_rent_contract where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) &lt;= 30
</select>
<select id="queryRentContractPaidStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract">
select count(id) from wx_rent_contract where tenant_id=#{tenantId} and status!=1 and status!=6 and rental_start_date &lt;= now() and rental_end_date >= now()
select count(id) from wx_rent_contract where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_start_date &lt;= now() and rental_end_date >= now()
</select>
<select id="queryRentContractEndStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract">
select count(id) from wx_rent_contract where tenant_id=#{tenantId} and status!=1 and status!=6 and rental_end_date &lt;now()
select count(id) from wx_rent_contract where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_end_date &lt;now()
</select>
<update id="updateRentContractEndSoonStatus" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and DATEDIFF(rental_end_date,now()) &lt;= 30
update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) &lt;= 30
</update>
<update id="updateRentContractPaidStatus" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and rental_start_date &lt;= now() and rental_end_date >= now()
update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_start_date &lt;= now() and rental_end_date >= now()
</update>
<update id="updateRentContractEndStatus" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and rental_end_date &lt;now()
update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_end_date &lt;now()
</update>
<update id="updateRentWaitSignStatus" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and merchant_id is null
update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=7 and merchant_id is null
</update>
<update id="updateRentInvalidStatus" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=#{status} where shop_id in (
select s.shop_id from (SELECT shop_id FROM wx_rent_contract WHERE tenant_id = #{tenantId} and merchant_id is not null and status!=6
)s) and merchant_id is null and tenant_id=#{tenantId}
</update>



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