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

[合同优化][修改][晚上合同优化需求]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
6856d168c8
4 измененных файлов: 26 добавлений и 46 удалений
  1. +0
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java
  2. +1
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  3. +1
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  4. +24
    -37
      mallinkService/src/main/resources/mapper/WxBillAllMapper.xml

+ 0
- 3
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java Просмотреть файл

@@ -53,12 +53,9 @@ public class WxRentContractController extends BaseController {
@ApiImplicitParam(name = "endtDate", value = "结束时间", dataType = "string", paramType = "query", required = true)})
@SystemControllerLog(description = "获取两个时间相差,返回n月零n天")
public ResultData getDateDiff(String startDate, String endDate) throws Exception{
logger.debug("[" + getIpAddr() + "] WxRentContractController::getTimeDiff");
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
Map<String,Integer> map = new HashMap<>();

int[] array = DateUtils.getDiff(sd.parse(startDate),sd.parse(endDate));

map.put("month",array[0]);
map.put("day",array[1]);
return new ResultData(map);


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

@@ -410,6 +410,7 @@ public class WxMerchantServiceImpl implements WxMerchantService {
}
return new ResultData(Result.SUCCESS, "商户创建成功", merchantId);
} catch (Exception e) {
e.printStackTrace();
logger.error("db failed: 商户创建失败, e:" + e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage());
}


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

@@ -743,11 +743,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {
if (wxRentContract != null) {
int receivePeriod = wxRentContract.getReceivePeriod().intValue();
Integer lease = wxRentContract.getLease();
// int[] array = DateUtils.getDiff(wxRentContract.getRentalStartDate(),wxRentContract.getRentalEndDate());
// Integer lease = array[0];
// if(array[1] >0){
// lease = array[0] +1;
// }

Date rentalStartDate = wxRentContract.getRentalStartDate();
Long price = wxRentContract.getPrice();
@@ -1097,7 +1092,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {

//最后一期截止到结束日期
if(i == paycount - 1){
if(wxRentContract.getRentalEndDate().after(wxBillRent.getEndtime())) {
if(wxBillRent.getEndtime().after(wxRentContract.getRentalEndDate())) {
wxBillRent.setEndtime(wxRentContract.getRentalEndDate());
}



+ 24
- 37
mallinkService/src/main/resources/mapper/WxBillAllMapper.xml Просмотреть файл

@@ -492,6 +492,22 @@
where m.status=1
</select>

<sql id="getOweBillAsPageConditions">
and status !=6
<if test="null != status ">
and status = #{status}
</if>
<if test=" null != month and ''!=month">
and date_format(receive_date,'%Y-%m')=#{month}
</if>
<if test=" null != starttime and ''!=starttime">
and receive_date >= #{starttime}
</if>
<if test=" null != endtime and ''!=endtime">
and receive_date &lt;= #{endtime}
</if>
</sql>

<select id="getOweBillAsPage" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap">
select bill.tenant_id tenantId,bill.merchant_id merchantId,m.name merchantName,bill.bill_type billType,
m.link_phone managerPhone,m.`link_person` manager,m.email,
@@ -544,44 +560,29 @@
select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent where is_preview = 0 and tenant_id = #{tenantId}
and status !=6
<if test="null != status ">
and status = #{status}
</if>
<include refid="getOweBillAsPageConditions"/>
union
select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,(need_pay-pay),DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property where is_preview = 0 and tenant_id = #{tenantId}
and status !=6
<if test="null != status ">
and status = #{status}
</if>
<include refid="getOweBillAsPageConditions"/>
union
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay,
res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from(
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,2 bill_type_value,'欠缴押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent_deposit where tenant_id = #{tenantId}
and status !=6
<if test="null != status ">
and status = #{status}
</if>
<include refid="getOweBillAsPageConditions"/>
union
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,4 bill_type_value,'欠缴押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property_deposit where tenant_id = #{tenantId}
and status !=6
<if test="null != status ">
and status = #{status}
</if>
<include refid="getOweBillAsPageConditions"/>
union
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,8 bill_type_value,'欠缴押金' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other_deposit where tenant_id = #{tenantId}
and status !=6
<if test="null != status ">
and status = #{status}
</if>
<include refid="getOweBillAsPageConditions"/>
) res
union
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay,
@@ -589,18 +590,12 @@
select id,merchant_id,shop_id,tenant_id,'其他费用' name,5 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type in(1,2) and tenant_id = #{tenantId}
and status !=6
<if test="null != status ">
and status = #{status}
</if>
<include refid="getOweBillAsPageConditions"/>
union
select id,merchant_id,shop_id,tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other where tenant_id = #{tenantId}
and status !=6
<if test="null != status ">
and status = #{status}
</if>
<include refid="getOweBillAsPageConditions"/>
) res

) bill
@@ -612,17 +607,9 @@
) bill
left join wx_merchant m on bill.merchant_id=m.id
where m.status=1 and m.tenant_id = #{tenantId}
<if test=" null != month and ''!=month">
and date_format(bill.receive_date,'%Y-%m')=#{month}
</if>
<if test=" null != starttime and ''!=starttime">
and bill.receive_date >= #{starttime}
</if>
<if test=" null != endtime and ''!=endtime">
and bill.receive_date &lt;= #{endtime}
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
<if test=" null == sortColumns"> order by totalOwe desc </if>
</select>


</mapper>

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