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

[租金管理][修改]修改业务逻辑

release_toaliyun_real
gongbiao 7 лет назад
Родитель
Сommit
9bb32df838
4 измененных файлов: 31 добавлений и 20 удалений
  1. +17
    -14
      mallinkService/src/main/java/com/simple/domain/po/WxBillRent.java
  2. +1
    -1
      mallinkService/src/main/java/com/simple/service/WxBillRentService.java
  3. +7
    -2
      mallinkService/src/main/java/com/simple/service/impl/WxBillRentServiceImpl.java
  4. +6
    -3
      mallinkService/src/main/resources/mapper/WxBillRentMapper.xml

+ 17
- 14
mallinkService/src/main/java/com/simple/domain/po/WxBillRent.java Просмотреть файл

@@ -39,10 +39,8 @@ public class WxBillRent implements Serializable {
}

@Transient
protected WxMerchant wxMerchant;
protected String shopNumber;

@Transient
protected WxShop wxShop;


/*商铺ID**/
@@ -93,6 +91,18 @@ public class WxBillRent implements Serializable {
@io.swagger.annotations.ApiModelProperty(value="欠缴金额",name="owe")
private BigDecimal owe;

/***/
@io.swagger.annotations.ApiModelProperty(value="payStatus",name="payStatus")
private Integer payStatus;


public String getShopNumber() {
return shopNumber;
}

public void setShopNumber(String shopNumber) {
this.shopNumber = shopNumber;
}

public Integer getShopId() {
return shopId;
@@ -181,13 +191,6 @@ public class WxBillRent implements Serializable {
this.tenantId = tenantId;
}

public WxMerchant getWxMerchant() {
return wxMerchant;
}

public void setWxMerchant(WxMerchant wxMerchant) {
this.wxMerchant = wxMerchant;
}

public BigDecimal getOwe() {
return owe;
@@ -197,12 +200,12 @@ public class WxBillRent implements Serializable {
this.owe = owe;
}

public WxShop getWxShop() {
return wxShop;
public Integer getPayStatus() {
return payStatus;
}

public void setWxShop(WxShop wxShop) {
this.wxShop = wxShop;
public void setPayStatus(Integer payStatus) {
this.payStatus = payStatus;
}

public static enum Field


+ 1
- 1
mallinkService/src/main/java/com/simple/service/WxBillRentService.java Просмотреть файл

@@ -22,7 +22,7 @@ public interface WxBillRentService {
* @param id
* @return
*/
WxBillRent getById(String id);
Map<String, Object> getById(Long id);
/**
* 保存或更新实体


+ 7
- 2
mallinkService/src/main/java/com/simple/service/impl/WxBillRentServiceImpl.java Просмотреть файл

@@ -27,8 +27,10 @@ public class WxBillRentServiceImpl implements WxBillRentService {
}

@Override
public WxBillRent getById(String id) {
return wxBillRentMapper.selectByPrimaryKey(id);
public Map<String, Object> getById(Long id) {
WxBillRent record = new WxBillRent();
record.setId(id);
return wxBillRentMapper.findListMap(record).get(0);
}

@Override
@@ -36,8 +38,11 @@ public class WxBillRentServiceImpl implements WxBillRentService {
if (record.getId() == null) {
final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
record.setCreatetime(new Date());
record.setPayStatus(record.getOwe().doubleValue()>0?0:1);
wxBillRentMapper.insertSelective(record);
} else {
record.setPayStatus(record.getOwe().doubleValue()>0?0:1);
wxBillRentMapper.updateByPrimaryKeySelective(record);
}
}


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

@@ -18,12 +18,12 @@
<result column="receipt_num" jdbcType="VARCHAR" property="receiptNum" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="owe" jdbcType="DECIMAL" property="owe" />
<result column="pay_status" jdbcType="Integer" property="payStatus" />
</resultMap>
<sql id="allColumns">
`id`,`shop_id`,`user_area`,`price`,`need_pay`,`receive_pay`,`pay`,`receive_period`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`pay_way`,`receipt_num`,`tenant_id`,`owe`
`id`,`shop_id`,`user_area`,`price`,`need_pay`,`receive_pay`,`pay`,`receive_period`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`pay_way`,`receipt_num`,`tenant_id`,`owe`,`pay_status`
</sql>

<sql id="dynamicWhereConditions">
@@ -61,7 +61,7 @@
select br.id,br.shop_id shopId,br.user_area userArea,br.price,br.need_pay needPay,br.receive_pay receivePay,
br.pay,br.receive_period receivePeriod,br.receive_date receiveDate,br.pay_date payDate,br.createtime,
br.expired_day expiredDay,br.pay_way payWay,br.receipt_num receiptNum,m.`name` merchantName,
s.build_area buildArea,s.operation_area operationArea,s.shop_number shopNumber,br.owe
s.build_area buildArea,s.operation_area operationArea,s.shop_number shopNumber,br.owe,br.pay_status payStatus
from wx_bill_rent br left join wx_merchant_shop ms on br.shop_id=ms.shop_id and ms.is_del=0
inner join wx_merchant m on ms.merchant_id=m.id
inner join wx_shop s on ms.shop_id=s.id
@@ -81,6 +81,9 @@
<if test=" null != payWay "> and br.`pay_way` = #{payWay} </if>
<if test=" null != receiptNum "> and br.`receipt_num` = #{receiptNum} </if>
<if test=" null != tenantId "> and br.`tenant_id` = #{tenantId} </if>
<if test=" null != shopNumber "> and br.`shop_number` = #{shopNumber} </if>
<if test=" null != payStatus "> and br.`pay_status` = #{payStatus} </if>
<if test=" null != ids ">
and br.id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">


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