Przeglądaj źródła

fix contract

release_toaliyun_real
xiaohanzi 5 lat temu
rodzic
commit
5a3d36e17a
9 zmienionych plików z 456 dodań i 446 usunięć
  1. +14
    -14
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java
  2. +8
    -8
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java
  3. +11
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxShop.java
  4. +4
    -4
      mallinkService/src/main/java/com/iformall/mapper/WxPropertyContractMapper.java
  5. +3
    -3
      mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java
  6. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxRentContractService.java
  7. +103
    -102
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  8. +303
    -303
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  9. +9
    -11
      mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml

+ 14
- 14
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java Wyświetl plik

@@ -136,13 +136,13 @@ public class WxPropertyContractController extends WxContractBaseController {
wxPropertyContractService.download(request, response);
}

@GetMapping("/getPropertyContractStatusInfo")
@SystemControllerLog(description = "物业合同-状态信息")
public ResultData getPropertyContractStatusInfo(@ModelAttribute WxPropertyContract wxPropertyContract) {
logger.debug("[" + getIpAddr() + "] WxPropertyContractController::getPropertyContractStatusInfo");
wxPropertyContract.updateTenantInfo(getTenantInfo());
return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractStatusInfo(wxPropertyContract));
}
// @GetMapping("/getPropertyContractStatusInfo")
// @SystemControllerLog(description = "物业合同-状态信息")
// public ResultData getPropertyContractStatusInfo(@ModelAttribute WxPropertyContract wxPropertyContract) {
// logger.debug("[" + getIpAddr() + "] WxPropertyContractController::getPropertyContractStatusInfo");
// wxPropertyContract.updateTenantInfo(getTenantInfo());
// return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractStatusInfo(wxPropertyContract));
// }

@GetMapping("/endPropertyContract")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@@ -152,13 +152,13 @@ public class WxPropertyContractController extends WxContractBaseController {
return wxPropertyContractService.endRentContract(id);
}

@GetMapping("/getRentContractList")
@SystemControllerLog(description = "物业合同-查询列表")
public ResultData getRentContractList(@ModelAttribute WxPropertyContract wxPropertyContract) {
logger.debug("[" + getIpAddr() + "] WxPropertyContractController::getRentContractList");
wxPropertyContract.updateTenantInfo(getTenantInfo());
return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractList(wxPropertyContract));
}
// @GetMapping("/getRentContractList")
// @SystemControllerLog(description = "物业合同-查询列表")
// public ResultData getRentContractList(@ModelAttribute WxPropertyContract wxPropertyContract) {
// logger.debug("[" + getIpAddr() + "] WxPropertyContractController::getRentContractList");
// wxPropertyContract.updateTenantInfo(getTenantInfo());
// return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractList(wxPropertyContract));
// }

@GetMapping("/endPropertyContractByRentContractId")
@ApiImplicitParam(name = "rentContractId", value = "rentContractId", dataType = "Long", paramType = "query", required = true)


+ 8
- 8
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java Wyświetl plik

@@ -389,13 +389,7 @@ public class WxRentContractController extends WxContractBaseController {
return new ResultData(map);
}
@GetMapping("exportContract")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)})
@SystemControllerLog(description = "租赁合同-导出合同")
public void exportContract(Long id,HttpServletRequest request, HttpServletResponse response){
wxRentContractService.exportContract(request,response,id);
}

@GetMapping("getRentContractList")
@ApiImplicitParams({
@@ -518,7 +512,13 @@ public class WxRentContractController extends WxContractBaseController {
return wxRentContractService.update(rentContract, user.getId(),user.getName(), EnumFromType.SWITCH.getCode(),oldDate);
}


// @GetMapping("exportContract")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)})
// @SystemControllerLog(description = "租赁合同-导出合同")
// public void exportContract(Long id,HttpServletRequest request, HttpServletResponse response){
// wxRentContractService.exportContract(request,response,id);
// }


// @GetMapping("/getRentContractStatusInfo")


+ 11
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxShop.java Wyświetl plik

@@ -131,6 +131,17 @@ public class WxShop extends TenantEntity {

@io.swagger.annotations.ApiModelProperty(value = "租金单位", name = "rentUnit")
private Integer rentUnit;
@TableField(exist = false)
private Integer rent_unit;
public Integer getRent_unit() {
return rentUnit;
}

public void setRent_unit() {
this.rent_unit = rentUnit;
}


}

+ 4
- 4
mallinkService/src/main/java/com/iformall/mapper/WxPropertyContractMapper.java Wyświetl plik

@@ -18,7 +18,7 @@ public interface WxPropertyContractMapper extends CommonMapper<WxPropertyContrac

List<WxPropertyContract> findList(WxPropertyContract wxPropertyContract);

List<Map<String,Object>> queryPropertyContractData(WxPropertyContract wxRentContract);
//List<Map<String,Object>> queryPropertyContractData(WxPropertyContract wxRentContract);

int queryRentContractWaitSignStatus(WxPropertyContract wxRentContract);

@@ -36,11 +36,11 @@ public interface WxPropertyContractMapper extends CommonMapper<WxPropertyContrac

void updateRentWaitSignStatus(WxPropertyContract wxRentContract);

void updateRentInvalidStatus(WxPropertyContract wxRentContract);
//void updateRentInvalidStatus(WxPropertyContract wxRentContract);

List<WxRentContract> getRentContractListByShop(Map<String, Object> params);
//List<WxRentContract> getRentContractListByShop(Map<String, Object> params);

List<WxRentContract> getRentContractListByPoint(Map<String, Object> params);
//List<WxRentContract> getRentContractListByPoint(Map<String, Object> params);

void updateApplyStatus(WxPropertyContract wxPropertyContract);


+ 3
- 3
mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java Wyświetl plik

@@ -52,11 +52,11 @@ public interface WxPropertyContractService {

void download(HttpServletRequest request, HttpServletResponse response);

Object getRentContractStatusInfo(WxPropertyContract record);
//Object getRentContractStatusInfo(WxPropertyContract record);

ResultData endRentContract(Long id);

Object getRentContractList(WxPropertyContract record);
//Object getRentContractList(WxPropertyContract record);


ResultData endPropertyContractByRentContractId(Long rentContractId);
@@ -71,7 +71,7 @@ public interface WxPropertyContractService {

List<WxBillProperty> getWxBillPropertyPreview(Long id);

Map<String, Object> updateStatus(WxPropertyContract record);
//Map<String, Object> updateStatus(WxPropertyContract record);

List<WxBillProperty> buildProperty(WxMerchant wxMerchant, Long userId, WxPropertyContract propertyContract, Integer isPreview,boolean saveDb);



+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxRentContractService.java Wyświetl plik

@@ -64,7 +64,7 @@ public interface WxRentContractService {

PageInfo<WxRentContract> getRentContractList(WxRentContract rentContract, Integer pageNum, Integer pageSize);

void exportContract(HttpServletRequest request, HttpServletResponse response, Long id);
//void exportContract(HttpServletRequest request, HttpServletResponse response, Long id);

ResultData updateFile(WxRentContract wxRentContract, Long userId,String userName,Date oldRentStartDate);



+ 103
- 102
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java Wyświetl plik

@@ -79,14 +79,14 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
@Override
public Map<String, Object> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) {
//Object rentContractStatusInfo = getRentContractStatusInfo(record);
PageHelper.startPage(pageIndex, pageSize);
List<Map<String, Object>> rentContractData = wxPropertyContractMapper.queryPropertyContractData(record);
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(rentContractData);
Map<String, Object> result = new HashMap<>();
//result.put("rentContractStatusInfo", rentContractStatusInfo);
result.put("pageInfo", pageInfo);
return result;
// PageHelper.startPage(pageIndex, pageSize);
// List<Map<String, Object>> rentContractData = wxPropertyContractMapper.queryPropertyContractData(record);
// PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(rentContractData);
// Map<String, Object> result = new HashMap<>();
// //result.put("rentContractStatusInfo", rentContractStatusInfo);
// result.put("pageInfo", pageInfo);
// return result;
return null;
}

@Override
@@ -886,32 +886,32 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
}
}

@Override
@Transactional(rollbackFor = {Exception.class})
public Object getRentContractStatusInfo(WxPropertyContract record) {
Map<String, Object> resultData = new HashMap();
//商铺信息
WxShop wxShop = new WxShop();
wxShop.updateTenantInfo(record);
wxShop.setType(record.getRentShopType());
wxShop.setStatus(EnumShopStatus.RENT.getCode());
List<WxShop> rentedList = wxShopMapper.findList(wxShop);
wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode());
List<WxShop> unrentedList = wxShopMapper.findList(wxShop);
HashMap<String, Object> shopMap = new HashMap<>(3);
int rentedCount = rentedList.size();
int unrentedCount = unrentedList.size();
shopMap.put("rentedCount",rentedCount);
shopMap.put("unrentedCount",unrentedCount);
shopMap.put("allCount",rentedCount+unrentedCount);
resultData.put("shopCountInfo", shopMap);
//需要更新的状态
resultData.putAll(updateStatus(record));
return resultData;
}
// @Override
// @Transactional(rollbackFor = {Exception.class})
// public Object getRentContractStatusInfo(WxPropertyContract record) {
//
// Map<String, Object> resultData = new HashMap();
// //商铺信息
// WxShop wxShop = new WxShop();
// wxShop.updateTenantInfo(record);
// wxShop.setType(record.getRentShopType());
// wxShop.setStatus(EnumShopStatus.RENT.getCode());
// List<WxShop> rentedList = wxShopMapper.findList(wxShop);
// wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode());
// List<WxShop> unrentedList = wxShopMapper.findList(wxShop);
//
// HashMap<String, Object> shopMap = new HashMap<>(3);
// int rentedCount = rentedList.size();
// int unrentedCount = unrentedList.size();
// shopMap.put("rentedCount",rentedCount);
// shopMap.put("unrentedCount",unrentedCount);
// shopMap.put("allCount",rentedCount+unrentedCount);
// resultData.put("shopCountInfo", shopMap);
//
// //需要更新的状态
// resultData.putAll(updateStatus(record));
// return resultData;
// }

@Transactional(rollbackFor = {Exception.class})
@Override
@@ -933,37 +933,38 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
}


@Override
public Object getRentContractList(WxPropertyContract record) {
Map<String, Object> params = new HashMap<>();
params.put("tenantId", record.getTenantId());
params.put("rentShopType", record.getRentShopType());
List<WxRentContract> contractList;
if (record.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) {
contractList = wxPropertyContractMapper.getRentContractListByShop(params);
} else {
contractList = wxPropertyContractMapper.getRentContractListByPoint(params);
}
return contractList;
}
// @Override
// public Object getRentContractList(WxPropertyContract record) {
// Map<String, Object> params = new HashMap<>();
// params.put("tenantId", record.getTenantId());
// params.put("rentShopType", record.getRentShopType());
// List<WxRentContract> contractList;
// if (record.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) {
// contractList = wxPropertyContractMapper.getRentContractListByShop(params);
// } else {
// contractList = wxPropertyContractMapper.getRentContractListByPoint(params);
// }
// return contractList;
// }

@Override
public ResultData endPropertyContractByRentContractId(Long rentContractId) {
WxPropertyContract wxPropertyContractParam = new WxPropertyContract();
wxPropertyContractParam.setRentContractId(rentContractId);
List<Map<String, Object>> contractData = wxPropertyContractMapper.queryPropertyContractData(wxPropertyContractParam);
if (contractData.size() == 0) {
return new ResultData(ErrorCode.PROPERTY_CONTRACT_IS_NOT_FOUND);
}
Map<String, Object> contractMap = contractData.get(0);
WxPropertyContract wxPropertyContract = wxPropertyContractMapper.selectById((Long) contractMap.get("id"));
wxPropertyContract.setStatus(EnumRentContractStatus.TERMINATE.getCode());
try {
wxPropertyContractMapper.updateById(wxPropertyContract);
} catch (MallinkException e) {
logger.info("终止合同失败:" + e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage());
}
// WxPropertyContract wxPropertyContractParam = new WxPropertyContract();
// wxPropertyContractParam.setRentContractId(rentContractId);
// wxPropertyContractMapper.findList(wxPropertyContractParam);
// //List<Map<String, Object>> contractData = wxPropertyContractMapper.queryPropertyContractData(wxPropertyContractParam);
// if (contractData.size() == 0) {
// return new ResultData(ErrorCode.PROPERTY_CONTRACT_IS_NOT_FOUND);
// }
// Map<String, Object> contractMap = contractData.get(0);
// WxPropertyContract wxPropertyContract = wxPropertyContractMapper.selectById((Long) contractMap.get("id"));
// wxPropertyContract.setStatus(EnumRentContractStatus.TERMINATE.getCode());
// try {
// wxPropertyContractMapper.updateById(wxPropertyContract);
// } catch (MallinkException e) {
// logger.info("终止合同失败:" + e.getMessage());
// throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage());
// }
return new ResultData(Result.SUCCESS, "操作成功");
}

@@ -1001,46 +1002,46 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
return new ResultData(false);
}

@Override
public Map<String, Object> updateStatus(WxPropertyContract record) {
Map<String, Object> resultData = new HashMap();
WxPropertyContract wxPropertyContract = new WxPropertyContract();
wxPropertyContract.updateTenantInfo(record);
wxPropertyContract.setRentShopType(record.getRentShopType());
int allCount = wxPropertyContractMapper.selectCount(new QueryWrapper(wxPropertyContract));
resultData.put("allCount", allCount);
//作废合同
wxPropertyContract.setStatus(EnumRentContractStatus.INVALID.getCode());
wxPropertyContractMapper.updateRentInvalidStatus(wxPropertyContract);
//待签约
//wxPropertyContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
//wxPropertyContractMapper.updateRentWaitSignStatus(wxPropertyContract);
//int waitSignCount = wxPropertyContractMapper.queryRentContractWaitSignStatus(wxPropertyContract);
resultData.put("waitSignCount", 0);
//计租中
wxPropertyContract.setStatus(EnumRentContractStatus.PAING.getCode());
wxPropertyContractMapper.updateRentContractPaidStatus(wxPropertyContract);
int rendPaidCount = wxPropertyContractMapper.queryRentContractPaidStatus(wxPropertyContract);
resultData.put("rendPaidCount", rendPaidCount);
//将到期
//wxPropertyContract.setStatus(EnumRentContractStatus.CONTRACT_END_SOON.getCode());
//wxPropertyContractMapper.updateRentContractEndSoonStatus(wxPropertyContract);
//int endSoonCount = wxPropertyContractMapper.queryRentContractEndSoonStatus(wxPropertyContract);
resultData.put("endSoonCount", 0);
//到期
wxPropertyContract.setStatus(EnumRentContractStatus.OUT_DATE.getCode());
int endCount = wxPropertyContractMapper.queryRentContractEndStatus(wxPropertyContract);
wxPropertyContractMapper.updateRentContractEndStatus(wxPropertyContract);
resultData.put("endCount", endCount);
return resultData;
}
// @Override
// public Map<String, Object> updateStatus(WxPropertyContract record) {
// Map<String, Object> resultData = new HashMap();
// WxPropertyContract wxPropertyContract = new WxPropertyContract();
// wxPropertyContract.updateTenantInfo(record);
// wxPropertyContract.setRentShopType(record.getRentShopType());
//
// int allCount = wxPropertyContractMapper.selectCount(new QueryWrapper(wxPropertyContract));
// resultData.put("allCount", allCount);
//
// //作废合同
// wxPropertyContract.setStatus(EnumRentContractStatus.INVALID.getCode());
// wxPropertyContractMapper.updateRentInvalidStatus(wxPropertyContract);
//
// //待签约
// //wxPropertyContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
// //wxPropertyContractMapper.updateRentWaitSignStatus(wxPropertyContract);
// //int waitSignCount = wxPropertyContractMapper.queryRentContractWaitSignStatus(wxPropertyContract);
// resultData.put("waitSignCount", 0);
//
// //计租中
// wxPropertyContract.setStatus(EnumRentContractStatus.PAING.getCode());
// wxPropertyContractMapper.updateRentContractPaidStatus(wxPropertyContract);
// int rendPaidCount = wxPropertyContractMapper.queryRentContractPaidStatus(wxPropertyContract);
// resultData.put("rendPaidCount", rendPaidCount);
//
// //将到期
// //wxPropertyContract.setStatus(EnumRentContractStatus.CONTRACT_END_SOON.getCode());
// //wxPropertyContractMapper.updateRentContractEndSoonStatus(wxPropertyContract);
// //int endSoonCount = wxPropertyContractMapper.queryRentContractEndSoonStatus(wxPropertyContract);
// resultData.put("endSoonCount", 0);
//
// //到期
// wxPropertyContract.setStatus(EnumRentContractStatus.OUT_DATE.getCode());
// int endCount = wxPropertyContractMapper.queryRentContractEndStatus(wxPropertyContract);
// wxPropertyContractMapper.updateRentContractEndStatus(wxPropertyContract);
// resultData.put("endCount", endCount);
//
// return resultData;
// }

public static void downLoadFromUrl(String urlStr, String fileName, String savePath) throws IOException {
URL url = new URL(urlStr);


+ 303
- 303
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Wyświetl plik

@@ -1589,32 +1589,32 @@ public class WxRentContractServiceImpl implements WxRentContractService {
// return resultData;
// }

@Override
public void exportContract(HttpServletRequest request, HttpServletResponse response, Long id) {
String contracType = "0";
String templatePath = null;
Map<String, Object> result = null;
if (EnumContractType.ALL.getCode().toString().equals(contracType)) {
logger.info("获取租赁及物业合同数据");
result = getRentAndPropertyInfo(id);
result.put("contractType", EnumContractType.ALL.getMessage());
if (EnumRentContractType.RENT_BY_AREA.getCode().equals(result.get("type"))) {
templatePath = "contract-word-template/contract_rent_property.docx";
} else {
templatePath = "contract-word-template/contract_rent_property_by_ratio.docx";
}
logger.info("租赁及物业合同数据结果:" + result);
}
if (templatePath == null) {
logger.info("没有租赁及物业合同模板");
return;
}
String filepath = fmUploadDir;
String filename = UUID.randomUUID() + ".docx";
String exportFileName = result.get("merchantName").toString() + "合同.docx";
WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response,null);
}
// @Override
// public void exportContract(HttpServletRequest request, HttpServletResponse response, Long id) {
// String contracType = "0";
// String templatePath = null;
// Map<String, Object> result = null;
// if (EnumContractType.ALL.getCode().toString().equals(contracType)) {
// logger.info("获取租赁及物业合同数据");
// result = getRentAndPropertyInfo(id);
// result.put("contractType", EnumContractType.ALL.getMessage());
// if (EnumRentContractType.RENT_BY_AREA.getCode().equals(result.get("type"))) {
// templatePath = "contract-word-template/contract_rent_property.docx";
// } else {
// templatePath = "contract-word-template/contract_rent_property_by_ratio.docx";
// }
// logger.info("租赁及物业合同数据结果:" + result);
// }
//
// if (templatePath == null) {
// logger.info("没有租赁及物业合同模板");
// return;
// }
// String filepath = fmUploadDir;
// String filename = UUID.randomUUID() + ".docx";
// String exportFileName = result.get("merchantName").toString() + "合同.docx";
// WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response,null);
// }

@Override
@Transactional(rollbackFor = {Exception.class})
@@ -1699,283 +1699,283 @@ public class WxRentContractServiceImpl implements WxRentContractService {
}
}

public Map<String, Object> getRentAndPropertyInfo(Long id) {
logger.info("获取租赁物业合同数据>>>>>>id:" + id);
Map<String, Object> result = new HashMap<>();
WxRentContract wxRentContract = wxRentContractMapper.selectById(id);
if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) {
JSONArray jsonArray = JSONArray.parseArray(wxRentContract.getRentInfo());
StringBuffer shopNumberStr = new StringBuffer();
StringBuffer floorNameStr = new StringBuffer();
StringBuffer buildingNameStr = new StringBuffer();
StringBuffer buildAreaStr = new StringBuffer();
StringBuffer operationAreaStr = new StringBuffer();
for (int i = 0, size = jsonArray.size(); i < size; i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
shopNumberStr.append("[").append(jsonObject.getString("shopNumber")).append("]");
floorNameStr.append("[").append(jsonObject.getString("floor")).append("]");
buildingNameStr.append("[").append(jsonObject.getString("building")).append("]");
buildAreaStr.append("[").append(jsonObject.getString("buildArea")).append("]");
operationAreaStr.append("[").append(jsonObject.getString("operationArea")).append("]");
}
result.put("shopNumber", shopNumberStr);
result.put("floorName", floorNameStr);
result.put("buildingName", buildingNameStr);
result.put("buildArea", buildAreaStr);
result.put("operationArea", operationAreaStr);
} else {
//record.setId(wxRentContract.getShopId());
if (wxRentContract.shopIdsByRentInfo().size() == 0) {
result.put("shopNumber", " ");
result.put("floorName", " ");
result.put("buildingName", " ");
result.put("buildArea", " ");
result.put("operationArea", " ");
}else {
WxShop record = new WxShop();
record.setIds(wxRentContract.shopIdsByRentInfo());
List<Map<String, Object>> wxShops = wxShopMapper.findListMap(record);
if (!wxShops.isEmpty()) {
//店铺信息
Map<String, Object> wxShop = wxShops.get(0);
result.put("shopNumber", wxShop.get("shopNumber"));
result.put("floorName", wxShop.get("floor"));
result.put("buildingName", wxShop.get("building"));
result.put("buildArea", wxShop.get("buildArea"));
result.put("operationArea", wxShop.get("operationArea"));
}
}
}
//MALL信息
WxMall wxMall = new WxMall();
wxMall.setTenantInfo(wxRentContract);
wxMall = wxMallMapper.findList(wxMall).get(0);
result.put("mallName", wxMall.getName());
result.put("province", wxMall.getProvince());
result.put("city", wxMall.getCity());
//商户信息
WxMerchant merchant = wxMerchantService.getById(wxRentContract.getMerchantId());
//经营业态
wxRentContract.getMerchantId();
WxBusiness wxBusiness = wxBusinessMapper.selectById(merchant.getBusinessId());
result.put("business", wxBusiness.getTitle());
if (merchant != null) {
result.put("merchantName", merchant.getName());
//法人信息
WxMerchantCorp wxMerchantCorp = merchant.getWxMerchantCorp();
result.put("corpPapersNumber", StringUtils.isNotEmpty(wxMerchantCorp.getCorpPapersNumber()) ? wxMerchantCorp.getCorpPapersNumber() : " ");
result.put("corpPapersType", wxMerchantCorp.getCorpPapersType() != null ? EnumPapersType.getEnum(wxMerchantCorp.getCorpPapersType()).getMessage() : " ");
result.put("corpPapersPerson", StringUtils.isNotEmpty(wxMerchantCorp.getCorpPapersPerson()) ? wxMerchantCorp.getCorpPapersPerson() : " ");
//税务信息
WxMerchantTax wxMerchantTax = merchant.getWxMerchantTax();
result.put("taxPapersType", wxMerchantTax.getTaxPapersType() != null ? EnumTaxpayerType.getEnum(wxMerchantTax.getTaxPapersType()).getMessage() : " ");
result.put("bankName", StringUtils.isNotEmpty(wxMerchantTax.getBankName()) ? wxMerchantTax.getBankName() : " ");
result.put("bankAccount", StringUtils.isNotEmpty(wxMerchantTax.getBankAccount()) ? wxMerchantTax.getBankAccount() : " ");
result.put("invoiceAddressPhone", StringUtils.isNotEmpty(wxMerchantTax.getInvoiceAddressPhone()) ? wxMerchantTax.getInvoiceAddressPhone() : " ");
} else {
result.put("merchantName", "");
//法人信息
result.put("corpPapersNumber", " ");
result.put("corpPapersType", " ");
result.put("corpPapersPerson", " ");
//税务信息
result.put("taxPapersType", " ");
result.put("bankName", " ");
result.put("bankAccount", " ");
result.put("invoiceAddressPhone", " ");
}
//租赁合同信息
String rentalStartDate = DateUtils.date2String(wxRentContract.getRentalStartDate(), "yyyy-MM-dd");
result.put("rentalStartDate", rentalStartDate);
result.put("rentalStartDateYear", rentalStartDate.substring(0, 4));
result.put("rentalStartDateMonth", rentalStartDate.substring(5, 7));
result.put("rentalStartDateDay", rentalStartDate.substring(8));
String rentalEndDate = DateUtils.date2String(wxRentContract.getRentalEndDate(), "yyyy-MM-dd");
result.put("rentalEndDate", rentalEndDate);
result.put("rentalEndDateYear", rentalEndDate.substring(0, 4));
result.put("rentalEndDateMonth", rentalEndDate.substring(5, 7));
result.put("rentalEndDateDay", rentalEndDate.substring(8));
result.put("price", wxRentContract.getPrice());
result.put("contractNumber", wxRentContract.getContractNumber());
Integer lease = wxRentContract.getLease();
Integer receivePeriod = wxRentContract.getReceivePeriod();
result.put("lease", lease);
result.put("receivePeriod", receivePeriod);
String payAccountStr = " ";
if(wxRentContract.getPayAccount() != null && !wxRentContract.getPayAccount().equals("")) {
payAccountStr = wxRentContract.getPayAccount();
}
result.put("payAccount", payAccountStr);
result.put("signDate", DateUtils.date2String(wxRentContract.getSignDate(), "yyyy-MM-dd"));
//主体名称-乙方
if (StringUtils.isNotEmpty(wxRentContract.getSubjectName())) {
result.put("corpPapersPerson", wxRentContract.getSubjectName());
} else {
result.put("corpPapersPerson", " ");
}
//品牌
Long brandId = merchant.getBrand();
String brand = " ";
if (brandId != null) {
WxBrand wxBrand = WxBrandMapper.selectById(brandId);
if (wxBrand != null) {
brand = wxBrand.getName();
}
}
result.put("brand", brand);
// TODO
//double adjustRatio = wxRentContract.getAdjustRatio() != null ? wxRentContract.getAdjustRatio() / 100.0 : 0;
result.put("adjustRatio", 0);
double priceRent = new BigDecimal(wxRentContract.getPrice())
.divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
result.put("priceRent", priceRent);
if (!wxRentContract.getRentArea().equals("0")) {
double unitPrice = new BigDecimal(wxRentContract.getPrice())
.divide(new BigDecimal(wxRentContract.getRentArea()), 2, RoundingMode.HALF_EVEN)
.divide(new BigDecimal(100))
.setScale(2, RoundingMode.HALF_EVEN).doubleValue();
result.put("unitPriceRent", unitPrice);
result.put("priceRentUpper", PriceUtil.digitUppercase(priceRent));
result.put("unitPriceRentUpper", PriceUtil.digitUppercase(unitPrice));
} else {
result.put("unitPriceRent", 0);
result.put("priceRentUpper", PriceUtil.digitUppercase(0));
result.put("unitPriceRentUpper", PriceUtil.digitUppercase(0));
}
//租赁保证金
int cashDepositMonthRent = 3;
double cashDepositRent = new BigDecimal(wxRentContract.getPrice()).multiply(new BigDecimal(cashDepositMonthRent))
.divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
result.put("cashDepositMonthRent", cashDepositMonthRent);
result.put("cashDepositRent", cashDepositRent);
result.put("cashDepositRentUpper", PriceUtil.digitUppercase(cashDepositRent));
result.put("type", wxRentContract.getType());
int extralease = lease % 12;
int extracount = extralease > 0 ? 1 : 0;
int paycount = lease / 12 + extracount;
int index = 10 - paycount;
int count = paycount - 1;
BigDecimal rentPrice = new BigDecimal(priceRent);
//保底
if (wxRentContract.getRevenue() != null) {
double revenue = new BigDecimal(wxRentContract.getRevenue())
.divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
result.put("revenue", revenue);
result.put("revenueUpper", PriceUtil.digitUppercase(revenue));
} else {
result.put("revenue", 0);
result.put("revenueUpper", PriceUtil.digitUppercase(0));
}
if (!wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) {
areaWay(wxRentContract, result, lease, extralease, extracount, paycount, index, count, rentPrice);
} else {
ratioWay(wxRentContract, result, lease, extralease, extracount, paycount, index, count, rentPrice);
}
//物业合同信息
WxPropertyContract propertyContract = new WxPropertyContract();
propertyContract.updateTenantInfo(wxRentContract);
propertyContract.setRentContractId(wxRentContract.getId());
// Optional<Map<String, Object>> first = wxPropertyContractMapper.queryPropertyContractData(propertyContract)
// .stream().filter(rc -> !rc.get("status").equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode())
// && !rc.get("status").equals(EnumRentContractStatus.WAIT_SIGN.getCode())
// && !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode())
// && !rc.get("status").equals(EnumRentContractStatus.CONTRACT_END.getCode())
// && !rc.get("status").equals(EnumRentContractStatus.INTENTION.getCode())).findFirst();
Optional<Map<String, Object>> first = wxPropertyContractMapper.queryPropertyContractData(propertyContract)
.stream().filter(rc -> !rc.get("status").equals(EnumRentContractStatus.TERMINATE.getCode())
&& !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode())
&& !rc.get("status").equals(EnumRentContractStatus.OUT_DATE.getCode())).findFirst();
Map<String, Object> wxPropertyContract = null;
if (first.isPresent()) {
wxPropertyContract = first.get();
}
if (wxPropertyContract != null) {
Integer receivePeriodProperty = (Integer) wxPropertyContract.get("receivePeriod");
result.put("receivePeriodProperty", receivePeriodProperty);
double priceProperty = new BigDecimal(wxPropertyContract.get("price").toString())
.divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
result.put("priceProperty", priceProperty);
if (!wxRentContract.getRentArea().equals("0")) {
double unitPriceProperty = new BigDecimal(wxPropertyContract.get("price").toString())
.divide(new BigDecimal(wxRentContract.getRentArea()), 2, RoundingMode.HALF_EVEN)
.divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
result.put("unitPriceProperty", unitPriceProperty);
result.put("pricePropertyUpper", PriceUtil.digitUppercase(priceProperty));
result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(unitPriceProperty));
} else {
result.put("unitPriceProperty", 0);
result.put("pricePropertyUpper", PriceUtil.digitUppercase(0));
result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(0));
}
//首期物业费
Calendar instance = Calendar.getInstance();
instance.setTime(wxRentContract.getRentalStartDate());
instance.add(Calendar.MONTH, 0);
Date starttime = instance.getTime();
String startdate = DateUtils.date2String(starttime, "yyyy-MM-dd");
result.put("rentalStartDateProperty", startdate);
result.put("rentalStartDateYearProperty", startdate.substring(0, 4));
result.put("rentalStartDateMonthProperty", startdate.substring(5, 7));
result.put("rentalStartDateDayProperty", startdate.substring(8));
//结束时间
instance.clear();
instance.setTime(starttime);
instance.add(Calendar.MONTH, receivePeriodProperty);
instance.add(Calendar.DAY_OF_MONTH, -1);
Date endtime = instance.getTime();
String enddate = DateUtils.date2String(endtime, "yyyy-MM-dd");
result.put("rentalEndDateProperty", enddate);
result.put("rentalEndDateYearProperty", enddate.substring(0, 4));
result.put("rentalEndDateMonthProperty", enddate.substring(5, 7));
result.put("rentalEndDateDayProperty", enddate.substring(8));
double pricePropertyFirst = new BigDecimal(priceProperty)
.multiply(new BigDecimal(receivePeriodProperty))
.setScale(2, RoundingMode.HALF_EVEN).doubleValue();
result.put("pricePropertyFirst", pricePropertyFirst);
result.put("pricePropertyFirstUpper", PriceUtil.digitUppercase(pricePropertyFirst));
//物业保证金
int cashDepositMonthProperty = 3;
double cashDepositProperty = new BigDecimal(wxPropertyContract.get("price").toString()).multiply(new BigDecimal(cashDepositMonthProperty))
.divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
result.put("cashDepositMonthProperty", cashDepositMonthProperty);
result.put("cashDepositProperty", cashDepositProperty);
result.put("cashDepositPropertyUpper", PriceUtil.digitUppercase(cashDepositProperty));
} else {
result.put("receivePeriodProperty", " ");
result.put("priceProperty", " ");
result.put("unitPriceProperty", " ");
result.put("pricePropertyUpper", " ");
result.put("unitPricePropertyUpper", " ");
//首期物业费
result.put("rentalStartDateProperty", " ");
result.put("rentalStartDateYearProperty", " ");
result.put("rentalStartDateMonthProperty", " ");
result.put("rentalStartDateDayProperty", " ");
//结束时间
result.put("rentalEndDateProperty", " ");
result.put("rentalEndDateYearProperty", " ");
result.put("rentalEndDateMonthProperty", " ");
result.put("rentalEndDateDayProperty", " ");
result.put("pricePropertyFirst", " ");
result.put("pricePropertyFirstUpper", " ");
//物业保证金
result.put("cashDepositMonthProperty", " ");
result.put("cashDepositProperty", " ");
result.put("cashDepositPropertyUpper", " ");
}
return result;
}
// public Map<String, Object> getRentAndPropertyInfo(Long id) {
// logger.info("获取租赁物业合同数据>>>>>>id:" + id);
// Map<String, Object> result = new HashMap<>();
// WxRentContract wxRentContract = wxRentContractMapper.selectById(id);
// if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) {
// JSONArray jsonArray = JSONArray.parseArray(wxRentContract.getRentInfo());
// StringBuffer shopNumberStr = new StringBuffer();
// StringBuffer floorNameStr = new StringBuffer();
// StringBuffer buildingNameStr = new StringBuffer();
// StringBuffer buildAreaStr = new StringBuffer();
// StringBuffer operationAreaStr = new StringBuffer();
// for (int i = 0, size = jsonArray.size(); i < size; i++) {
// JSONObject jsonObject = jsonArray.getJSONObject(i);
// shopNumberStr.append("[").append(jsonObject.getString("shopNumber")).append("]");
// floorNameStr.append("[").append(jsonObject.getString("floor")).append("]");
// buildingNameStr.append("[").append(jsonObject.getString("building")).append("]");
// buildAreaStr.append("[").append(jsonObject.getString("buildArea")).append("]");
// operationAreaStr.append("[").append(jsonObject.getString("operationArea")).append("]");
// }
// result.put("shopNumber", shopNumberStr);
// result.put("floorName", floorNameStr);
// result.put("buildingName", buildingNameStr);
// result.put("buildArea", buildAreaStr);
// result.put("operationArea", operationAreaStr);
// } else {
// //record.setId(wxRentContract.getShopId());
// if (wxRentContract.shopIdsByRentInfo().size() == 0) {
// result.put("shopNumber", " ");
// result.put("floorName", " ");
// result.put("buildingName", " ");
// result.put("buildArea", " ");
// result.put("operationArea", " ");
// }else {
// WxShop record = new WxShop();
// record.setIds(wxRentContract.shopIdsByRentInfo());
// List<Map<String, Object>> wxShops = wxShopMapper.findListMap(record);
// if (!wxShops.isEmpty()) {
// //店铺信息
// Map<String, Object> wxShop = wxShops.get(0);
// result.put("shopNumber", wxShop.get("shopNumber"));
// result.put("floorName", wxShop.get("floor"));
// result.put("buildingName", wxShop.get("building"));
// result.put("buildArea", wxShop.get("buildArea"));
// result.put("operationArea", wxShop.get("operationArea"));
// }
// }
// }
// //MALL信息
// WxMall wxMall = new WxMall();
// wxMall.setTenantInfo(wxRentContract);
// wxMall = wxMallMapper.findList(wxMall).get(0);
// result.put("mallName", wxMall.getName());
// result.put("province", wxMall.getProvince());
// result.put("city", wxMall.getCity());
//
// //商户信息
// WxMerchant merchant = wxMerchantService.getById(wxRentContract.getMerchantId());
// //经营业态
// wxRentContract.getMerchantId();
// WxBusiness wxBusiness = wxBusinessMapper.selectById(merchant.getBusinessId());
// result.put("business", wxBusiness.getTitle());
//
// if (merchant != null) {
// result.put("merchantName", merchant.getName());
// //法人信息
// WxMerchantCorp wxMerchantCorp = merchant.getWxMerchantCorp();
// result.put("corpPapersNumber", StringUtils.isNotEmpty(wxMerchantCorp.getCorpPapersNumber()) ? wxMerchantCorp.getCorpPapersNumber() : " ");
// result.put("corpPapersType", wxMerchantCorp.getCorpPapersType() != null ? EnumPapersType.getEnum(wxMerchantCorp.getCorpPapersType()).getMessage() : " ");
// result.put("corpPapersPerson", StringUtils.isNotEmpty(wxMerchantCorp.getCorpPapersPerson()) ? wxMerchantCorp.getCorpPapersPerson() : " ");
// //税务信息
// WxMerchantTax wxMerchantTax = merchant.getWxMerchantTax();
// result.put("taxPapersType", wxMerchantTax.getTaxPapersType() != null ? EnumTaxpayerType.getEnum(wxMerchantTax.getTaxPapersType()).getMessage() : " ");
// result.put("bankName", StringUtils.isNotEmpty(wxMerchantTax.getBankName()) ? wxMerchantTax.getBankName() : " ");
// result.put("bankAccount", StringUtils.isNotEmpty(wxMerchantTax.getBankAccount()) ? wxMerchantTax.getBankAccount() : " ");
// result.put("invoiceAddressPhone", StringUtils.isNotEmpty(wxMerchantTax.getInvoiceAddressPhone()) ? wxMerchantTax.getInvoiceAddressPhone() : " ");
// } else {
// result.put("merchantName", "");
// //法人信息
// result.put("corpPapersNumber", " ");
// result.put("corpPapersType", " ");
// result.put("corpPapersPerson", " ");
// //税务信息
// result.put("taxPapersType", " ");
// result.put("bankName", " ");
// result.put("bankAccount", " ");
// result.put("invoiceAddressPhone", " ");
// }
// //租赁合同信息
// String rentalStartDate = DateUtils.date2String(wxRentContract.getRentalStartDate(), "yyyy-MM-dd");
// result.put("rentalStartDate", rentalStartDate);
// result.put("rentalStartDateYear", rentalStartDate.substring(0, 4));
// result.put("rentalStartDateMonth", rentalStartDate.substring(5, 7));
// result.put("rentalStartDateDay", rentalStartDate.substring(8));
// String rentalEndDate = DateUtils.date2String(wxRentContract.getRentalEndDate(), "yyyy-MM-dd");
// result.put("rentalEndDate", rentalEndDate);
// result.put("rentalEndDateYear", rentalEndDate.substring(0, 4));
// result.put("rentalEndDateMonth", rentalEndDate.substring(5, 7));
// result.put("rentalEndDateDay", rentalEndDate.substring(8));
// result.put("price", wxRentContract.getPrice());
// result.put("contractNumber", wxRentContract.getContractNumber());
// Integer lease = wxRentContract.getLease();
// Integer receivePeriod = wxRentContract.getReceivePeriod();
// result.put("lease", lease);
// result.put("receivePeriod", receivePeriod);
// String payAccountStr = " ";
// if(wxRentContract.getPayAccount() != null && !wxRentContract.getPayAccount().equals("")) {
// payAccountStr = wxRentContract.getPayAccount();
// }
// result.put("payAccount", payAccountStr);
// result.put("signDate", DateUtils.date2String(wxRentContract.getSignDate(), "yyyy-MM-dd"));
// //主体名称-乙方
// if (StringUtils.isNotEmpty(wxRentContract.getSubjectName())) {
// result.put("corpPapersPerson", wxRentContract.getSubjectName());
// } else {
// result.put("corpPapersPerson", " ");
// }
//
// //品牌
// Long brandId = merchant.getBrand();
// String brand = " ";
// if (brandId != null) {
// WxBrand wxBrand = WxBrandMapper.selectById(brandId);
// if (wxBrand != null) {
// brand = wxBrand.getName();
// }
// }
// result.put("brand", brand);
// // TODO
// //double adjustRatio = wxRentContract.getAdjustRatio() != null ? wxRentContract.getAdjustRatio() / 100.0 : 0;
// result.put("adjustRatio", 0);
// double priceRent = new BigDecimal(wxRentContract.getPrice())
// .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
// result.put("priceRent", priceRent);
// if (!wxRentContract.getRentArea().equals("0")) {
// double unitPrice = new BigDecimal(wxRentContract.getPrice())
// .divide(new BigDecimal(wxRentContract.getRentArea()), 2, RoundingMode.HALF_EVEN)
// .divide(new BigDecimal(100))
// .setScale(2, RoundingMode.HALF_EVEN).doubleValue();
// result.put("unitPriceRent", unitPrice);
// result.put("priceRentUpper", PriceUtil.digitUppercase(priceRent));
// result.put("unitPriceRentUpper", PriceUtil.digitUppercase(unitPrice));
// } else {
// result.put("unitPriceRent", 0);
// result.put("priceRentUpper", PriceUtil.digitUppercase(0));
// result.put("unitPriceRentUpper", PriceUtil.digitUppercase(0));
// }
//
// //租赁保证金
// int cashDepositMonthRent = 3;
// double cashDepositRent = new BigDecimal(wxRentContract.getPrice()).multiply(new BigDecimal(cashDepositMonthRent))
// .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
// result.put("cashDepositMonthRent", cashDepositMonthRent);
// result.put("cashDepositRent", cashDepositRent);
// result.put("cashDepositRentUpper", PriceUtil.digitUppercase(cashDepositRent));
// result.put("type", wxRentContract.getType());
// int extralease = lease % 12;
// int extracount = extralease > 0 ? 1 : 0;
// int paycount = lease / 12 + extracount;
// int index = 10 - paycount;
// int count = paycount - 1;
// BigDecimal rentPrice = new BigDecimal(priceRent);
// //保底
// if (wxRentContract.getRevenue() != null) {
// double revenue = new BigDecimal(wxRentContract.getRevenue())
// .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
// result.put("revenue", revenue);
// result.put("revenueUpper", PriceUtil.digitUppercase(revenue));
// } else {
// result.put("revenue", 0);
// result.put("revenueUpper", PriceUtil.digitUppercase(0));
// }
// if (!wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) {
// areaWay(wxRentContract, result, lease, extralease, extracount, paycount, index, count, rentPrice);
// } else {
// ratioWay(wxRentContract, result, lease, extralease, extracount, paycount, index, count, rentPrice);
// }
// //物业合同信息
// WxPropertyContract propertyContract = new WxPropertyContract();
// propertyContract.updateTenantInfo(wxRentContract);
// propertyContract.setRentContractId(wxRentContract.getId());
//// Optional<Map<String, Object>> first = wxPropertyContractMapper.queryPropertyContractData(propertyContract)
//// .stream().filter(rc -> !rc.get("status").equals(EnumRentContractStatus.CONTRACT_TERMINATE.getCode())
//// && !rc.get("status").equals(EnumRentContractStatus.WAIT_SIGN.getCode())
//// && !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode())
//// && !rc.get("status").equals(EnumRentContractStatus.CONTRACT_END.getCode())
//// && !rc.get("status").equals(EnumRentContractStatus.INTENTION.getCode())).findFirst();
// Optional<Map<String, Object>> first = wxPropertyContractMapper.queryPropertyContractData(propertyContract)
// .stream().filter(rc -> !rc.get("status").equals(EnumRentContractStatus.TERMINATE.getCode())
// && !rc.get("status").equals(EnumRentContractStatus.INVALID.getCode())
// && !rc.get("status").equals(EnumRentContractStatus.OUT_DATE.getCode())).findFirst();
// Map<String, Object> wxPropertyContract = null;
// if (first.isPresent()) {
// wxPropertyContract = first.get();
// }
// if (wxPropertyContract != null) {
// Integer receivePeriodProperty = (Integer) wxPropertyContract.get("receivePeriod");
// result.put("receivePeriodProperty", receivePeriodProperty);
// double priceProperty = new BigDecimal(wxPropertyContract.get("price").toString())
// .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
// result.put("priceProperty", priceProperty);
// if (!wxRentContract.getRentArea().equals("0")) {
// double unitPriceProperty = new BigDecimal(wxPropertyContract.get("price").toString())
// .divide(new BigDecimal(wxRentContract.getRentArea()), 2, RoundingMode.HALF_EVEN)
// .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
// result.put("unitPriceProperty", unitPriceProperty);
// result.put("pricePropertyUpper", PriceUtil.digitUppercase(priceProperty));
// result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(unitPriceProperty));
// } else {
// result.put("unitPriceProperty", 0);
// result.put("pricePropertyUpper", PriceUtil.digitUppercase(0));
// result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(0));
// }
//
// //首期物业费
// Calendar instance = Calendar.getInstance();
// instance.setTime(wxRentContract.getRentalStartDate());
// instance.add(Calendar.MONTH, 0);
// Date starttime = instance.getTime();
// String startdate = DateUtils.date2String(starttime, "yyyy-MM-dd");
// result.put("rentalStartDateProperty", startdate);
// result.put("rentalStartDateYearProperty", startdate.substring(0, 4));
// result.put("rentalStartDateMonthProperty", startdate.substring(5, 7));
// result.put("rentalStartDateDayProperty", startdate.substring(8));
// //结束时间
// instance.clear();
// instance.setTime(starttime);
// instance.add(Calendar.MONTH, receivePeriodProperty);
// instance.add(Calendar.DAY_OF_MONTH, -1);
// Date endtime = instance.getTime();
// String enddate = DateUtils.date2String(endtime, "yyyy-MM-dd");
// result.put("rentalEndDateProperty", enddate);
// result.put("rentalEndDateYearProperty", enddate.substring(0, 4));
// result.put("rentalEndDateMonthProperty", enddate.substring(5, 7));
// result.put("rentalEndDateDayProperty", enddate.substring(8));
// double pricePropertyFirst = new BigDecimal(priceProperty)
// .multiply(new BigDecimal(receivePeriodProperty))
// .setScale(2, RoundingMode.HALF_EVEN).doubleValue();
// result.put("pricePropertyFirst", pricePropertyFirst);
// result.put("pricePropertyFirstUpper", PriceUtil.digitUppercase(pricePropertyFirst));
//
//
// //物业保证金
// int cashDepositMonthProperty = 3;
// double cashDepositProperty = new BigDecimal(wxPropertyContract.get("price").toString()).multiply(new BigDecimal(cashDepositMonthProperty))
// .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
// result.put("cashDepositMonthProperty", cashDepositMonthProperty);
// result.put("cashDepositProperty", cashDepositProperty);
// result.put("cashDepositPropertyUpper", PriceUtil.digitUppercase(cashDepositProperty));
//
//
// } else {
// result.put("receivePeriodProperty", " ");
// result.put("priceProperty", " ");
// result.put("unitPriceProperty", " ");
// result.put("pricePropertyUpper", " ");
// result.put("unitPricePropertyUpper", " ");
// //首期物业费
// result.put("rentalStartDateProperty", " ");
// result.put("rentalStartDateYearProperty", " ");
// result.put("rentalStartDateMonthProperty", " ");
// result.put("rentalStartDateDayProperty", " ");
// //结束时间
// result.put("rentalEndDateProperty", " ");
// result.put("rentalEndDateYearProperty", " ");
// result.put("rentalEndDateMonthProperty", " ");
// result.put("rentalEndDateDayProperty", " ");
// result.put("pricePropertyFirst", " ");
// result.put("pricePropertyFirstUpper", " ");
// //物业保证金
// result.put("cashDepositMonthProperty", " ");
// result.put("cashDepositProperty", " ");
// result.put("cashDepositPropertyUpper", " ");
// }
//
//
// return result;
// }

public void ratioWay(WxRentContract wxRentContract, Map<String, Object> result, Integer lease, int extralease, int extracount, int paycount, int index, int count, BigDecimal rentPrice) {
String adjustRatio = wxRentContract.getAdjustRatio();


+ 9
- 11
mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml Wyświetl plik

@@ -21,7 +21,6 @@
<result column="brand" jdbcType="VARCHAR" property="brand"/>
<result column="business_id" jdbcType="INTEGER" property="businessId"/>
<result column="shop_type" jdbcType="INTEGER" property="shopType"/>
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
<result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/>
<result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
<result column="rent_area" jdbcType="VARCHAR" property="rentArea"/>
@@ -53,7 +52,7 @@
`id`,`merchant_id`,`price`,`rental_start_date`,`rental_end_date`,
`sign_date`,`receive_period`,`tenant_id`,`parent_tenant_id`,`filepath`,`status`,`contract_number`,
`deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`,
`shop_type`,`shop_id`,`updatetime`,`createtime`,`rent_area`,
`shop_type`,`updatetime`,`createtime`,`rent_area`,
`link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`,
`start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`,
`file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`,late_pay_ratio,late_pay_day
@@ -84,7 +83,6 @@
<if test=" null != brand ">and `brand` = #{brand}</if>
<if test=" null != businessId ">and `business_id` = #{businessId}</if>
<if test=" null != shopType ">and `shop_type` = #{shopType}</if>
<if test=" null != shopId ">and `shop_id` = #{shopId}</if>
<if test=" null != updatetime ">and `updatetime` = #{updatetime}</if>
<if test=" null != createtime ">and `createtime` = #{createtime}</if>
<if test=" null != rentArea ">and `rent_area` = #{rentArea}</if>
@@ -115,7 +113,7 @@
<include refid="dynamicWhereConditions"/>
</select>
<select id="queryPropertyContractData" resultType="hashmap" parameterType="com.iformall.domain.po.WxRentContract">
<!-- <select id="queryPropertyContractData" resultType="hashmap" parameterType="com.iformall.domain.po.WxRentContract">
select rc.id,rc.merchant_name merchantName,rc.rental_start_date rentalStartDate,rc.rental_end_date
rentalEndDate,rc.`status`,rc.price,rc.contract_number contractNumber,s.shop_number shopNumber,
f.floor_name floorName,b.building_name buildingName,receive_period receivePeriod,
@@ -193,7 +191,7 @@

<if test=" null != sortColumns"> order by ${sortColumns} </if>
<if test=" null == sortColumns">order by rc.createtime desc,rc.id desc</if>
</select>
</select> -->
<select id="queryRentContractWaitSignStatus" resultType="int"
parameterType="com.iformall.domain.po.WxPropertyContract">
@@ -285,7 +283,7 @@
and merchant_id is null
</update>
<update id="updateRentInvalidStatus" parameterType="com.iformall.domain.po.WxPropertyContract">
<!-- <update id="updateRentInvalidStatus" parameterType="com.iformall.domain.po.WxPropertyContract">
update wx_property_contract set status=#{status} where shop_id in (
select s.shop_id from (SELECT shop_id FROM wx_property_contract WHERE merchant_id is not null and status!=6
<if test=" null != tenantId and '' != tenantId">
@@ -301,9 +299,9 @@
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
</update>
</update> -->
<select id="getRentContractListByShop" parameterType="hashmap" resultType="com.iformall.domain.po.WxRentContract">
<!-- <select id="getRentContractListByShop" parameterType="hashmap" resultType="com.iformall.domain.po.WxRentContract">
select rc.* from wx_rent_contract rc
where rc.status not in(0,1,5,6,7,8)
<if test=" null != tenantId and '' != tenantId">
@@ -322,9 +320,9 @@
</if>
) pc)
<if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if>
</select>
</select> -->
<select id="getRentContractListByPoint" parameterType="hashmap" resultType="com.iformall.domain.po.WxRentContract">
<!-- <select id="getRentContractListByPoint" parameterType="hashmap" resultType="com.iformall.domain.po.WxRentContract">
select rc.*,s.shop_number from wx_rent_contract rc
inner join wx_shop s on rc.shop_id=s.id
where rc.status not in(0,1,5,6,7,8)
@@ -344,7 +342,7 @@
</if>
) pc)
<if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if>
</select>
</select> -->
<update id="updateApplyStatus" parameterType="com.iformall.domain.po.WxPropertyContract">


Ładowanie…
Anuluj
Zapisz