| @@ -536,6 +536,12 @@ public class WxPropertyContractController extends WxContractBaseController { | |||||
| } | } | ||||
| try { | try { | ||||
| contract.setCustomersId(proertyContract.getCustomersId()); | |||||
| contract.setCustomerType(proertyContract.getCustomerType()); | |||||
| contract.setCustomerName(proertyContract.getCustomerName()); | |||||
| contract.setCustomerLinkPerson(proertyContract.getCustomerLinkPerson()); | |||||
| contract.setCustomerPhone(proertyContract.getCustomerPhone()); | |||||
| contract.setCustomerLegalPerson(proertyContract.getCustomerLegalPerson()); | |||||
| wxPropertyContractService.transfer(contract,user); | wxPropertyContractService.transfer(contract,user); | ||||
| }catch(Exception e) { | }catch(Exception e) { | ||||
| logger.error("transfer error.",e); | logger.error("transfer error.",e); | ||||
| @@ -615,6 +615,13 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| try { | try { | ||||
| rentContract.setCustomersId(wxRentContract.getCustomersId()); | |||||
| rentContract.setCustomerType(wxRentContract.getCustomerType()); | |||||
| rentContract.setCustomerName(wxRentContract.getCustomerName()); | |||||
| rentContract.setCustomerLinkPerson(wxRentContract.getCustomerLinkPerson()); | |||||
| rentContract.setCustomerPhone(wxRentContract.getCustomerPhone()); | |||||
| rentContract.setCustomerLegalPerson(wxRentContract.getCustomerLegalPerson()); | |||||
| wxRentContractService.transfer(rentContract,user); | wxRentContractService.transfer(rentContract,user); | ||||
| }catch(Exception e) { | }catch(Exception e) { | ||||
| logger.error("transfer error.",e); | logger.error("transfer error.",e); | ||||
| @@ -56,6 +56,6 @@ public interface WxAllBillMapper extends CommonMapper<WxAllBill, Long> { | |||||
| void updateContractCusName(WxAllBill wxBillRent); | void updateContractCusName(WxAllBill wxBillRent); | ||||
| void updateAllContractCusName(WxAllBill wxBillRent); | |||||
| void transferCusName(WxAllBill wxBillRent); | |||||
| } | } | ||||
| @@ -1509,7 +1509,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| bill.updateTenantInfo(record); | bill.updateTenantInfo(record); | ||||
| bill.setPropertyContractId(record.getId()); | bill.setPropertyContractId(record.getId()); | ||||
| bill.setCusName(record.getCustomerName()); | bill.setCusName(record.getCustomerName()); | ||||
| wxAllBillMapper.updateAllContractCusName(bill); | |||||
| wxAllBillMapper.transferCusName(bill); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -2099,7 +2099,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| bill.updateTenantInfo(rentContract); | bill.updateTenantInfo(rentContract); | ||||
| bill.setRentContractId(rentContract.getId()); | bill.setRentContractId(rentContract.getId()); | ||||
| bill.setCusName(rentContract.getCustomerName()); | bill.setCusName(rentContract.getCustomerName()); | ||||
| wxAllBillMapper.updateAllContractCusName(bill); | |||||
| wxAllBillMapper.transferCusName(bill); | |||||
| if (rentContract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | if (rentContract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { | ||||
| WxPropertyContract pq = new WxPropertyContract(); | WxPropertyContract pq = new WxPropertyContract(); | ||||
| @@ -455,7 +455,7 @@ | |||||
| </if> | </if> | ||||
| </update> | </update> | ||||
| <update id="updateAllContractCusName" parameterType="com.iformall.domain.po.WxAllBill"> | |||||
| <update id="transferCusName" parameterType="com.iformall.domain.po.WxAllBill"> | |||||
| update wx_all_bill set cus_name = #{cusName} where tenant_id = #{tenantId} | update wx_all_bill set cus_name = #{cusName} where tenant_id = #{tenantId} | ||||
| <if test=" null != rentContractId"> | <if test=" null != rentContractId"> | ||||
| and rent_contract_id = #{rentContractId} | and rent_contract_id = #{rentContractId} | ||||
| @@ -463,6 +463,22 @@ | |||||
| <if test=" null != propertyContractId"> | <if test=" null != propertyContractId"> | ||||
| and property_contract_id = #{propertyContractId} | and property_contract_id = #{propertyContractId} | ||||
| </if> | </if> | ||||
| and( | |||||
| <!-- 应收 --> | |||||
| ( | |||||
| ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5,6,7)) | |||||
| or | |||||
| ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and bill_type in (13,21,5,6,7)) | |||||
| ) | |||||
| <!-- 应fu --> | |||||
| or ( | |||||
| ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') < 0 and bill_type not in (13,21,5,6,7)) | |||||
| or | |||||
| ( `pay` - IFNULL(`return_pay`,'0') - IFNULL(`use_money`,'0') > 0 and bill_type in (13,21,5,7)) | |||||
| ) | |||||
| ) | |||||
| </update> | </update> | ||||
| </mapper> | </mapper> | ||||