|
@@ -27,12 +27,17 @@ import com.idea.customerManagement.dto.CustomerManagementDto;
|
|
|
import com.idea.customerManagement.excel.CustomerManagementExcel;
|
|
|
import com.idea.customerManagement.excel.TempContractExcel;
|
|
|
import com.idea.customerManagement.excel.TempCusExcel;
|
|
|
+import com.idea.customerManagement.excel.TempDepositExcel;
|
|
|
import com.idea.customerManagement.mapper.ContractManageMapper;
|
|
|
import com.idea.customerManagement.mapper.CustomerManagementExtendMapper;
|
|
|
import com.idea.customerManagement.mapper.CustomerManagementMapper;
|
|
|
import com.idea.customerManagement.mapper.RoomSelectionInfoMapper;
|
|
|
import com.idea.customerManagement.model.*;
|
|
|
+import com.idea.invoice.model.ReceiptManage;
|
|
|
+import com.idea.invoice.service.ReceiptManageService;
|
|
|
import com.idea.invoice.util.InvoiceUtil;
|
|
|
+import com.idea.paymentManagement.mapper.PayLogMapper;
|
|
|
+import com.idea.paymentManagement.model.PayLog;
|
|
|
import com.idea.util.DateUtils;
|
|
|
import com.idea.util.ExcelUtils;
|
|
|
import com.idea.util.ReplaceWord;
|
|
@@ -96,6 +101,8 @@ public class CustomerManagementService implements BaseService<CustomerManagement
|
|
|
private ParkRoomService parkRoomService;
|
|
|
@Autowired
|
|
|
private ContractManageService contractManageService;
|
|
|
+ @Autowired
|
|
|
+ private PayLogMapper payLogMapper;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -1196,7 +1203,11 @@ public class CustomerManagementService implements BaseService<CustomerManagement
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 更新合同信息
|
|
|
+ * @param file
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
public void tempContractUpdate(MultipartFile file) throws IOException {
|
|
|
|
|
|
// 读取excel
|
|
@@ -1292,4 +1303,90 @@ public class CustomerManagementService implements BaseService<CustomerManagement
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新定金信息
|
|
|
+ * @param file
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
+ public void tempDepositUpdate(MultipartFile file) throws IOException {
|
|
|
+
|
|
|
+ // 读取excel
|
|
|
+ ExcelUtils excelUtils = new ExcelUtils();
|
|
|
+ List<TempDepositExcel> list = excelUtils.excelImport(file.getInputStream(), TempDepositExcel.class,"惠景二期",1);
|
|
|
+ BigDecimal decimal = new BigDecimal("10000");
|
|
|
+ for(TempDepositExcel excel : list){
|
|
|
+ System.out.println("excel信息" + excel.toString());
|
|
|
+
|
|
|
+ String buildName = excel.getBuildName();
|
|
|
+ String roomNo = excel.getRoomNo();
|
|
|
+ String collectionTime = excel.getCollectionTime();
|
|
|
+ ParkRoom room = extendMapper.getByBuildHouseName(buildName, roomNo);
|
|
|
+
|
|
|
+ // 更新定金状态
|
|
|
+ RoomSelectionInfoExample example = new RoomSelectionInfoExample();
|
|
|
+ example.createCriteria().andHouseIdEqualTo(room.getId());
|
|
|
+ List<RoomSelectionInfo> deposits = roomSelectionInfoMapper.selectByExample(example);
|
|
|
+ if(CollectionUtils.isNotEmpty(deposits)){
|
|
|
+ RoomSelectionInfo model = deposits.get(0);
|
|
|
+ model.setUpdatedAt(new Date());
|
|
|
+ model.setUpdatedId("1");
|
|
|
+ model.setStatus(2);
|
|
|
+ model.setCollectionId("1");
|
|
|
+ model.setCollectionTime(DateUtils.parseDate(collectionTime));
|
|
|
+ model.setPaymentMethod(1);
|
|
|
+ model.setReceivedAmount(decimal);
|
|
|
+ roomSelectionInfoMapper.updateByPrimaryKeySelective(model);
|
|
|
+
|
|
|
+ ContractManageExample contractManageExample = new ContractManageExample();
|
|
|
+ contractManageExample.createCriteria().andCustomerManagementIdEqualTo(model.getCustomerManagementId());
|
|
|
+ List<ContractManage> contractManages = contractManageService.selectByExample(contractManageExample);
|
|
|
+ if(CollectionUtils.isNotEmpty(contractManages)){
|
|
|
+
|
|
|
+ String contractId = contractManages.get(0).getId();
|
|
|
+ // 新增一条定金收款记录
|
|
|
+ PayLog payLog = new PayLog();
|
|
|
+ payLog.setId(IdUtil.simpleUUID());
|
|
|
+ payLog.setBusinessId(model.getId());
|
|
|
+ payLog.setHouseId(model.getHouseId());
|
|
|
+ payLog.setContractId(contractId);
|
|
|
+ payLog.setCustomerManagementId(model.getCustomerManagementId());
|
|
|
+ // 收款类型 预收款
|
|
|
+ payLog.setPayType(1);
|
|
|
+ // 款项内容 定金
|
|
|
+ payLog.setContentType(1);
|
|
|
+ payLog.setPayMoney(model.getReceivedAmount());
|
|
|
+ payLog.setPayTime(new Date());
|
|
|
+ payLog.setPaymentMethod(model.getPaymentMethod());
|
|
|
+ payLog.setStatus(0);
|
|
|
+ payLog.setPaymentStatus(1);
|
|
|
+ payLog.setCreatedAt(new Date());
|
|
|
+ payLog.setCreatedBy("1");
|
|
|
+ payLog.setSerialNumber(model.getSerialNumber());
|
|
|
+ payLog.setBankName(model.getBankName());
|
|
|
+ payLog.setBankBranchName(model.getBankBranchName());
|
|
|
+ payLog.setBankNumber(model.getBankNumber());
|
|
|
+ payLogMapper.insertSelective(payLog);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|