|
@@ -170,7 +170,6 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 新增
|
|
|
*
|
|
@@ -178,9 +177,9 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public int add(PayLog model,String userId) {
|
|
|
+ public int add(PayLog model, String userId) {
|
|
|
|
|
|
- if(StringUtils.isEmpty(userId)){
|
|
|
+ if (StringUtils.isEmpty(userId)) {
|
|
|
userId = ShiroUtils.getUserId();
|
|
|
}
|
|
|
String serialNumber = getSerialNumber(model);
|
|
@@ -195,7 +194,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
// 更新合同 预收款 收款状态
|
|
|
ContractManage contractManage = contractManageMapper.selectByPrimaryKey(model.getContractId());
|
|
|
if (model.getPayType() == 1) {
|
|
|
- String receivedMoneyStr = extendMapper.getMoneyByContractId(model.getContractId(), model.getPayType(),null);
|
|
|
+ String receivedMoneyStr = extendMapper.getMoneyByContractId(model.getContractId(), model.getPayType(), null);
|
|
|
BigDecimal buyerMoney = contractManage.getBuyerMoney();
|
|
|
BigDecimal receivedMoney = new BigDecimal(receivedMoneyStr);
|
|
|
if (receivedMoney.doubleValue() < buyerMoney.doubleValue()) {
|
|
@@ -212,7 +211,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
.andSendStatusEqualTo("1");
|
|
|
List<InvoiceManage> invoiceManages = invoiceManageService.selectByExample(invoiceManageExample);
|
|
|
// 不存在推送成功的 则新增 正式发票
|
|
|
- if(CollectionUtils.isEmpty(invoiceManages)){
|
|
|
+ if (CollectionUtils.isEmpty(invoiceManages)) {
|
|
|
// 查询该合同是否已生成 正式发票
|
|
|
invoiceManageExample = new InvoiceManageExample();
|
|
|
invoiceManageExample.createCriteria().andTypeEqualTo("2")
|
|
@@ -276,7 +275,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
receiptManage.setReceiptType(receiptType);
|
|
|
receiptManage.setReceiptMoney(model.getPayMoney());
|
|
|
receiptManage.setReceiptNumber(serialNumber);
|
|
|
- receiptManageService.add(receiptManage,userId);
|
|
|
+ receiptManageService.add(receiptManage, userId);
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -362,7 +361,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
payLogDto.setPaymentMethod(contractManage.getPaymentMethod());
|
|
|
// payLogDto.setDeadLine(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, contractManage.getDeadline()));
|
|
|
// 查询已收房款
|
|
|
- String receivedMoneyStr = extendMapper.getMoneyByContractId(contractId, 1,null);
|
|
|
+ String receivedMoneyStr = extendMapper.getMoneyByContractId(contractId, 1, null);
|
|
|
BigDecimal receivedMoney = new BigDecimal(receivedMoneyStr);
|
|
|
// 欠款
|
|
|
BigDecimal arrears = BigDecimal.ZERO;
|
|
@@ -441,13 +440,21 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
filePath = "/home/project/settleDown/tem/receipt.docx";
|
|
|
fileName = "银行按揭收据.docx";
|
|
|
break;
|
|
|
+ case 5: // 楼款
|
|
|
+ filePath = "/home/project/settleDown/tem/receipt.docx";
|
|
|
+ fileName = "楼款收据.docx";
|
|
|
+ break;
|
|
|
+ case 6: // 补差款
|
|
|
+ filePath = "/home/project/settleDown/tem/receipt.docx";
|
|
|
+ fileName = "补差款收据.docx";
|
|
|
+ break;
|
|
|
case 8: // 首款-定金转
|
|
|
filePath = "/home/project/settleDown/tem/receipt.docx";
|
|
|
- fileName = "首款-定金转.docx";
|
|
|
+ fileName = "首款-定金转收据.docx";
|
|
|
break;
|
|
|
case 9: // 房款-定金转
|
|
|
filePath = "/home/project/settleDown/tem/receipt.docx";
|
|
|
- fileName = "房款-定金转.docx";
|
|
|
+ fileName = "房款-定金转收据.docx";
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -472,8 +479,8 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
String collectionTime = "";
|
|
|
try {
|
|
|
collectionTime = DateUtils.parseDateToStr(DateUtils.DATE_CH, payLog.getPayTime());
|
|
|
- }catch (Exception e){
|
|
|
- log.error("日期转换异常:{}",e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("日期转换异常:{}", e.getMessage());
|
|
|
}
|
|
|
String content = "";
|
|
|
String paymentMethod = "";
|
|
@@ -507,7 +514,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
settingInfoData = new HashMap<>();
|
|
|
settingInfoData.put("leftOffset", "50");
|
|
|
settingInfoData.put("topOffset", "0");
|
|
|
- settingData.put("${seal}",settingInfoData);
|
|
|
+ settingData.put("${seal}", settingInfoData);
|
|
|
|
|
|
|
|
|
try {
|
|
@@ -521,7 +528,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
out.close();
|
|
|
tempWord.deleteOnExit();
|
|
|
tempPDF.deleteOnExit();
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
log.error("文档生成报错:", e);
|
|
|
}
|
|
|
|
|
@@ -617,23 +624,24 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
|
|
|
/**
|
|
|
* 转首款 转房款
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @param type
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public int convertType(String id,Integer type){
|
|
|
+ public int convertType(String id, Integer type) {
|
|
|
PayLog payLog = selectByPrimaryKey(id);
|
|
|
// 1-意向金转定金,2-定金转首款,3-定金转房款
|
|
|
Integer convertType = null;
|
|
|
// 转首款
|
|
|
- if(type == 1){
|
|
|
+ if (type == 1) {
|
|
|
payLog.setContentType(8);
|
|
|
payLog.setPaymentStatus(3);
|
|
|
convertType = 2;
|
|
|
}
|
|
|
// 转房款
|
|
|
- if(type == 2){
|
|
|
+ if (type == 2) {
|
|
|
payLog.setContentType(9);
|
|
|
payLog.setPaymentStatus(4);
|
|
|
convertType = 3;
|
|
@@ -659,7 +667,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public int delete(String id){
|
|
|
+ public int delete(String id) {
|
|
|
|
|
|
PayLog payLog = modelMapper.selectByPrimaryKey(id);
|
|
|
payLog.setStatus(1);
|
|
@@ -668,7 +676,7 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
ReceiptManageExample receiptManageExample = new ReceiptManageExample();
|
|
|
receiptManageExample.createCriteria().andBusinessIdEqualTo(id);
|
|
|
List<ReceiptManage> receiptManages = receiptManageService.selectByExample(receiptManageExample);
|
|
|
- if(CollectionUtils.isNotEmpty(receiptManages)){
|
|
|
+ if (CollectionUtils.isNotEmpty(receiptManages)) {
|
|
|
receiptManageService.deleteByPrimaryKey(receiptManages.get(0).getId());
|
|
|
}
|
|
|
return result;
|
|
@@ -676,6 +684,4 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
}
|