From 6be859f745beaa13a831f3291147612f66b9d776 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 26 十一月 2024 09:42:21 +0800
Subject: [PATCH] ll
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java | 76 +++++++++++++++++++++++++++++---------
1 files changed, 58 insertions(+), 18 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java
index bf37d57..4d2465c 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java
@@ -87,26 +87,65 @@
}
/**
* 閫�绉熸彁浜�
- * @param model
+ * @param param
* @return
*/
@Override
@Transactional(rollbackFor = {BusinessException.class,Exception.class})
- public Integer backRent(YwContract model){
- isParamValidCreated(model);
+ public Integer backRent(YwContract param){
+ isParamValidBackRent(param);
+ //澶勭悊
+ dealBackRentBillBiz(param);
+ YwContract update = new YwContract();
+ update.setEditDate(new Date());
+ update.setEditor(param.getLoginUserInfo().getId());
+ update.setBtActDate(update.getEditDate());
+ update.setBtActUserId(update.getEditor());
+ update.setStatus(Constants.THREE);
+ update.setBtInfo(param.getBtInfo());
+ update.setBtDate(param.getBtDate());
+ update.setBtType(param.getBtType());
+ update.setBtUserId(param.getBtUserId());
+ update.setBtFee(param.getBtFee());
+ ywContractMapper.updateById(update);
+ dealLogBiz(param,Constants.YwLogType.CONTRACT_BACK,null,null);
+ return param.getId();
+ }
- model.setCreator(model.getLoginUserInfo().getId());
- model.setIsdeleted(Constants.ZERO);
- model.setCreateDate(new Date());
- model.setStatus(Constants.ZERO);
- model.setEditDate(model.getCreateDate());
- model.setEditor(model.getCreator());
- model.setStatus(Constants.ZERO);//寰呮墽琛�
- ywContractMapper.insert(model);
- dealDetailListBiz(model);//澶勭悊鏉℃淇℃伅
- dealMultifileBiz(model);//澶勭悊闄勪欢淇℃伅
- dealLogBiz(model,Constants.YwLogType.CONTRACT_CREATE,null,null);//璁板綍鏂板缓鏃ュ織
- return model.getId();
+ private void dealBackRentBillBiz(YwContract param) {
+ }
+
+ private void isParamValidBackRent(YwContract param) {
+ if(param.getId()==null
+ || param.getBtType() == null
+ || param.getBtDate() == null
+ || param.getBtUserId() == null
+ || param.getBtSignDate() == null
+ ||StringUtils.isBlank( param.getBtInfo())){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ YwContract model = ywContractMapper.selectById(param.getId());
+ if(model==null || Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝鍚堝悓淇℃伅涓嶅瓨鍦紝璇疯繑鍥炲垪琛ㄥ埛鏂伴噸璇曪紒");
+ }
+
+ SystemUser user = systemUserMapper.selectById(param.getUserId());
+ if(user ==null || (user.getDeleted()!=null&& user.getDeleted() )){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝缁忓姙浜轰俊鎭笉瀛樺湪锛�");
+ }
+ if(param.getAddBillList()!=null && param.getAddBillList().size()>0){
+ for(YwContractBill bill: param.getAddBillList()){
+ if(bill.getCostType() == null
+ ||bill.getFeeType() == null
+ ||bill.getReceivableFee() == null
+ ||bill.getCompanyId() == null
+ ||bill.getPlanPayDate() == null
+ ||(Constants.equalsInteger(bill.getFeeType(),Constants.ZERO)
+ && (bill.getStartDate() ==null || bill.getEndDate() ==null) )){
+
+ }
+ }
+ }
}
private void dealDetailListBiz(YwContract model) {
@@ -211,10 +250,10 @@
bill.setStatus(Constants.ZERO);
bill.setStartDate(model.getStartDate());
bill.setEndDate(model.getEndDate());
- bill.setType(type);
+ bill.setType(Constants.ZERO);
+ bill.setCostType(type);
bill.setTotleFee(type==Constants.THREE?model.getZlDeposit():model.getWyDeposit());//鎶奸噾璐圭敤
bill.setSortnum(0);
- bill.setTitle(type==Constants.THREE?"绉熻祦鎶奸噾":"鐗╀笟鎶奸噾" );
return bill;
}
@@ -416,7 +455,8 @@
bill.setContractId(model.getId());
bill.setStatus(Constants.ZERO);
bill.setDetailId(d.getId());
- bill.setType(d.getType());
+ bill.setCostType(d.getType());
+ bill.setType(Constants.ZERO);
return bill;
}
--
Gitblit v1.9.3