Compare commits
2 Commits
ac32c13ad6
...
489e7de49c
| Author | SHA1 | Date | |
|---|---|---|---|
| 489e7de49c | |||
| 2022f778d1 |
@@ -233,6 +233,18 @@ public class AssetsService {
|
||||
return assetsVo;
|
||||
}
|
||||
|
||||
public Long queryAssetsManageType(JSONObject params) throws Exception {
|
||||
TableContext tableContext = getTableContext();
|
||||
List<FormWhereCondition> conditions = buildConditions(params,tableContext.getTableBean());
|
||||
OaAssetsVo assetsVo = new OaAssetsVo();
|
||||
FormColumn formColumn = FormTableExecutor.queryOne(tableContext, conditions,false);
|
||||
if(formColumn == null) {
|
||||
return null;
|
||||
}
|
||||
Map<String, Object> fieldsMap = formColumn.getFieldsMap();
|
||||
return (Long) fieldsMap.get("运营类型");
|
||||
}
|
||||
|
||||
private String getStringValue(Map<String, Object> fieldsMap,String key) {
|
||||
Object o = fieldsMap.get(key);
|
||||
if(o == null) {
|
||||
@@ -294,7 +306,7 @@ public class AssetsService {
|
||||
|
||||
public void fillPageQueryVo(Map<String, Object> fieldsMap,OaAssetsVo assetsVo) throws BusinessException {
|
||||
assetsVo.setAssetsNo(getStringValue(fieldsMap,"资产编号"));
|
||||
assetsVo.setAssetsName(getStringValue(fieldsMap,"品牌名称"));
|
||||
assetsVo.setAssetsName(getStringValue(fieldsMap,"资产名称"));
|
||||
assetsVo.setAssetsDesc(getStringValue(fieldsMap,"详情信息"));
|
||||
assetsVo.setFormId(getStringValue(fieldsMap,"id"));
|
||||
assetsVo.setLayout(getStringValue(fieldsMap,"户型"));
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
package com.seeyon.apps.assetstenant.assets;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.assetstenant.config.AssetsTenantConfigProvider;
|
||||
import com.seeyon.apps.assetstenant.constants.AssetsTenantConstants;
|
||||
import com.seeyon.apps.assetstenant.contract.ContractAssetsVo;
|
||||
import com.seeyon.apps.assetstenant.file.OaFileVo;
|
||||
import com.seeyon.apps.assetstenant.po.PageQueryVo;
|
||||
import com.seeyon.cap4.form.bean.FormTableBean;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.exceptions.BusinessException;
|
||||
import com.seeyon.ctp.common.filemanager.manager.AttachmentManager;
|
||||
import com.seeyon.ctp.organization.bo.V3xOrgMember;
|
||||
import com.seeyon.ctp.organization.manager.OrgManager;
|
||||
import com.seeyon.utils.form.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class ShAssetsService {
|
||||
|
||||
private AssetsTenantConfigProvider configProvider = (AssetsTenantConfigProvider) AppContext.getBean("assetsTenantConfigProvider");
|
||||
private AttachmentManager attachmentManager = (AttachmentManager) AppContext.getBean("attachmentManager");
|
||||
private OrgManager orgManager = (OrgManager) AppContext.getBean("orgManager");
|
||||
private String getFormNo() {
|
||||
return configProvider.getBizConfigByKey(AssetsTenantConstants.ASSETS_FORMNO);
|
||||
}
|
||||
|
||||
public PageQueryVo pageQuery(JSONObject params) throws Exception {
|
||||
TableContext master = FormTableExecutor.master(getFormNo());
|
||||
FormTableBean masterTableBean = master.getTableBean();
|
||||
List<FormWhereCondition> conditions = buildConditions(params,masterTableBean);
|
||||
Integer pageNo = params.getInteger("pageNo") == null ? 1 : params.getInteger("pageNo");
|
||||
Integer pageSize = params.getInteger("pageSize") == null ? 10 : params.getInteger("pageSize");
|
||||
PageQueryVo<OaAssetsVo> pageQueryVo = new PageQueryVo();
|
||||
List<FormColumn> datas = FormTableExecutor.pageQuery(master,null,conditions,pageNo,pageSize,true);
|
||||
List<OaAssetsVo> vos = new ArrayList<>();
|
||||
Long count = FormTableExecutor.count(master,null, conditions);
|
||||
if(datas.size() > 0){
|
||||
for (FormColumn data : datas) {
|
||||
Map<String, Object> map = data.getFieldsMap();
|
||||
OaAssetsVo oaAssetsVo = new OaAssetsVo();
|
||||
fillPageQueryVo(map, oaAssetsVo);
|
||||
vos.add(oaAssetsVo);
|
||||
}
|
||||
pageQueryVo.setDatas(vos);
|
||||
pageQueryVo.setTotalCount(count);
|
||||
}
|
||||
return pageQueryVo;
|
||||
}
|
||||
|
||||
private List<FormWhereCondition> buildConditions(JSONObject params, FormTableBean formTableBean) throws BusinessException {
|
||||
List<FormWhereCondition> conditions = new ArrayList<>();
|
||||
if(StringUtils.isNotBlank(params.getString("cusNo"))) {
|
||||
conditions.add(FormWhereCondition.build().display("租户编码").value(params.getString("cusNo")));
|
||||
}
|
||||
if(StringUtils.isNotBlank(params.getString("assetsNo"))) {
|
||||
conditions.add(FormWhereCondition.build().display("资产编号").value(params.getString("assetsNo")));
|
||||
}
|
||||
if(StringUtils.isNotBlank(params.getString("assetsStatus"))) {
|
||||
conditions.add(FormWhereCondition.build().display("资产状态").value(EnumMapUtils.getEnumItemValueByDisplayValue(formTableBean,"资产状态",params.getString("assetsStatus"))));
|
||||
}
|
||||
if(StringUtils.isNotBlank(params.getString("assetsType"))) {
|
||||
handleAssetsSubType(conditions,params.getString("assetsType"));
|
||||
}
|
||||
if(StringUtils.isNotBlank(params.getString("manageType"))) {
|
||||
conditions.add(FormWhereCondition.build().display("运营类型")
|
||||
.value(EnumMapUtils.getEnumItemValueByDisplayValue(formTableBean,"运营类型",params.getString("manageType"))));
|
||||
}
|
||||
if(StringUtils.isNotBlank(params.getString("layout"))) {
|
||||
conditions.add(FormWhereCondition.build().display("户型")
|
||||
.value(EnumMapUtils.getEnumItemValueByDisplayValue(formTableBean,"户型",params.getString("layout"))));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(params.getString("keyWord"))){
|
||||
conditions.add(FormWhereCondition.build().display("资产名称")
|
||||
.startWithBracket(true)
|
||||
.concatFactor(ClauseFactor.OR)
|
||||
.value(params.getString("keyWord"))
|
||||
.clauseFactor(ClauseFactor.LIKE));
|
||||
conditions.add(FormWhereCondition.build().display("房屋地址")
|
||||
.value(params.getString("keyWord"))
|
||||
.endWithBracket(true)
|
||||
.clauseFactor(ClauseFactor.LIKE));
|
||||
}
|
||||
return conditions;
|
||||
}
|
||||
|
||||
private void handleAssetsSubType(List<FormWhereCondition> conditions,String type) throws BusinessException {
|
||||
TableContext master = FormTableExecutor.master(getFormNo());
|
||||
FormTableBean masterTableBean = master.getTableBean();
|
||||
}
|
||||
|
||||
public OaAssetsVo queryAssetsDetail(String id) throws Exception {
|
||||
if(id == null) {
|
||||
return null;
|
||||
}
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("assetsNo", id);
|
||||
return queryAssetsDetail(object);
|
||||
}
|
||||
|
||||
private TableContext getTableContext() throws BusinessException {
|
||||
TableContext tableContext = FormTableExecutor.master(getFormNo());
|
||||
return tableContext;
|
||||
}
|
||||
|
||||
public ContractAssetsVo queryContractAssetsDetail(JSONObject params) throws Exception {
|
||||
TableContext tableContext = getTableContext();
|
||||
List<FormWhereCondition> conditions = buildConditions(params,tableContext.getTableBean());
|
||||
ContractAssetsVo assetsVo = new ContractAssetsVo();
|
||||
FormColumn formColumn = FormTableExecutor.queryOne(tableContext,conditions,true);
|
||||
if(formColumn == null) {
|
||||
return assetsVo;
|
||||
}
|
||||
Map<String, Object> fieldsMap = formColumn.getFieldsMap();
|
||||
assetsVo.setFormId(formColumn.getId());
|
||||
assetsVo.setAssetsNo(getStringValue(fieldsMap,"资产编号"));
|
||||
assetsVo.setAssetsName(getStringValue(fieldsMap,"资产名称"));
|
||||
assetsVo.setManager(getStringValue(fieldsMap,"资产管理员"));
|
||||
assetsVo.setAddress(getStringValue(fieldsMap,"所在地址"));
|
||||
assetsVo.setZone(getStringValue(fieldsMap,"所在区域"));
|
||||
if(fieldsMap.get("资产图片") != null) {
|
||||
assetsVo.setDetailImg(OaFileVo.getInstance(fieldsMap.get("资产图片"),attachmentManager));
|
||||
}
|
||||
return assetsVo;
|
||||
}
|
||||
|
||||
public OaAssetsVo queryAssetsDetail(JSONObject params) throws Exception {
|
||||
TableContext tableContext = getTableContext();
|
||||
List<FormWhereCondition> conditions = buildConditions(params,tableContext.getTableBean());
|
||||
OaAssetsVo assetsVo = new OaAssetsVo();
|
||||
FormColumn formColumn = FormTableExecutor.queryOne(tableContext, conditions,true);
|
||||
if(formColumn == null) {
|
||||
return assetsVo;
|
||||
}
|
||||
Map<String, Object> fieldsMap = formColumn.getFieldsMap();
|
||||
fillDetailVo(fieldsMap,assetsVo);
|
||||
return assetsVo;
|
||||
}
|
||||
|
||||
public Long queryAssetsManageType(JSONObject params) throws Exception {
|
||||
TableContext tableContext = getTableContext();
|
||||
List<FormWhereCondition> conditions = buildConditions(params,tableContext.getTableBean());
|
||||
OaAssetsVo assetsVo = new OaAssetsVo();
|
||||
FormColumn formColumn = FormTableExecutor.queryOne(tableContext, conditions,false);
|
||||
if(formColumn == null) {
|
||||
return null;
|
||||
}
|
||||
Map<String, Object> fieldsMap = formColumn.getFieldsMap();
|
||||
return (Long) fieldsMap.get("运营类型");
|
||||
}
|
||||
|
||||
private String getStringValue(Map<String, Object> fieldsMap,String key) {
|
||||
Object o = fieldsMap.get(key);
|
||||
if(o == null) {
|
||||
return null;
|
||||
}
|
||||
return o + "";
|
||||
}
|
||||
|
||||
public void fillDetailVo(Map<String, Object> fieldsMap,OaAssetsVo assetsVo) throws BusinessException {
|
||||
assetsVo.setAssetsNo(getStringValue(fieldsMap,"资产编号"));
|
||||
assetsVo.setAssetsName(getStringValue(fieldsMap,"资产名称"));
|
||||
// assetsVo.setAssetsDesc(getStringValue(fieldsMap,"详情信息"));
|
||||
assetsVo.setFormId(getStringValue(fieldsMap,"id"));
|
||||
assetsVo.setAssetsStatus(getStringValue(fieldsMap,"资产状态"));
|
||||
assetsVo.setAssetsAddress(getStringValue(fieldsMap,"房屋地址"));
|
||||
assetsVo.setManageType(getStringValue(fieldsMap,"运营类型"));
|
||||
|
||||
String lnglat = getStringValue(fieldsMap, "坐落经纬度");
|
||||
if(StringUtils.isNotBlank(lnglat)){
|
||||
// 统一替换逗号为分号,然后分割,兼容 ; 和 , 两种格式
|
||||
String[] lnglatArr = lnglat.replace(",", ";").split(";");
|
||||
// 增加数组长度判断,防止越界异常
|
||||
if (lnglatArr.length >= 2) {
|
||||
assetsVo.setLongitude(lnglatArr[0].trim()); // trim() 去除多余空格
|
||||
assetsVo.setLatitude(lnglatArr[1].trim());
|
||||
}
|
||||
}
|
||||
assetsVo.setFloorNo(getStringValue(fieldsMap,"楼层"));
|
||||
assetsVo.setManagerPhone(getStringValue(fieldsMap,"委托经办人电话"));
|
||||
assetsVo.setLayout(getStringValue(fieldsMap,"户型"));
|
||||
assetsVo.setRenovationStatus(getStringValue(fieldsMap,"装修情况"));
|
||||
assetsVo.setManagerName(getStringValue(fieldsMap,"委托经办人") + "管家");
|
||||
String area = getStringValue(fieldsMap,"建筑面积");
|
||||
assetsVo.setFootPrint(area);
|
||||
if(fieldsMap.get("房源图片") != null) {
|
||||
assetsVo.setDetailImg(OaFileVo.getInstance(fieldsMap.get("房源图片"),attachmentManager));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void fillPageQueryVo(Map<String, Object> fieldsMap,OaAssetsVo assetsVo) throws BusinessException {
|
||||
assetsVo.setAssetsNo(getStringValue(fieldsMap,"资产编号"));
|
||||
assetsVo.setAssetsName(getStringValue(fieldsMap,"资产名称"));
|
||||
assetsVo.setFormId(getStringValue(fieldsMap,"id"));
|
||||
assetsVo.setLayout(getStringValue(fieldsMap,"户型"));
|
||||
assetsVo.setRenovationStatus(getStringValue(fieldsMap,"装修情况"));
|
||||
String area = getStringValue(fieldsMap,"建筑面积");
|
||||
assetsVo.setFootPrint(area);
|
||||
if(fieldsMap.get("资产图片") != null) {
|
||||
assetsVo.setDetailImg(OaFileVo.getInstance(fieldsMap.get("房源图片"),attachmentManager));
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String,Object> getAssetsManagerInfo(String assetsNo) throws Exception {
|
||||
List<FormWhereCondition> conditions = new ArrayList<>();
|
||||
conditions.add(FormWhereCondition.build().display("资产编号").value(assetsNo));
|
||||
TableContext tableContext = getTableContext();
|
||||
FormColumn formColumn = FormTableExecutor.queryOne(tableContext, conditions,false);
|
||||
if(formColumn == null || formColumn.getFieldsMap() == null) {
|
||||
return null;
|
||||
}
|
||||
return formColumn.getFieldsMap();
|
||||
}
|
||||
}
|
||||
@@ -288,6 +288,7 @@ public class BillService {
|
||||
// 8. 组装子表数据
|
||||
Map<String, Object> subTableRowData = new HashMap<>();
|
||||
subTableRowData.put("账单-明细编号", fieldsMap.get("账单-账单明细编号"));
|
||||
subTableRowData.put("账单-租赁账单编号", fieldsMap.get("租赁账单编号"));
|
||||
subTableRowData.put("账单-开始日期", df.format((Date)fieldsMap.get("账单-开始日期")));
|
||||
subTableRowData.put("账单-结束日期", df.format((Date)fieldsMap.get("账单-结束日期")));
|
||||
subTableRowData.put("账单-当期缴费期限", fieldsMap.get("账单-当前缴费时限"));
|
||||
@@ -309,7 +310,7 @@ public class BillService {
|
||||
subTableRowData.put("账单-资产编号", fieldsMap.get("资产编号"));
|
||||
subTableRowData.put("账单-资产名称", fieldsMap.get("资产名称"));
|
||||
FormFieldBean formFieldBean = subTableBean.getFieldBeanByDisplay("收款结果");
|
||||
subTableRowData.put("账单-收款结果", EnumMapUtils.getEnumItemValueByEnumId("已结清",formFieldBean.getEnumId()));
|
||||
subTableRowData.put("收款结果", EnumMapUtils.getEnumItemValueByEnumId("已结清",formFieldBean.getEnumId()));
|
||||
subFormDataList.add(subTableRowData);
|
||||
// 9. 获取合同信息 + 非空校验
|
||||
String contractNo = (String) fieldsMap.get("合同编号");
|
||||
@@ -338,7 +339,7 @@ public class BillService {
|
||||
}
|
||||
// 11. 组装主表数据(线程安全日期)
|
||||
TableContext receivePayFlowTableContext = FormTableExecutor.master(templateCode);
|
||||
mainData.put("选择收款项", EnumMapUtils.getEnumItemValueByDisplayValue(receivePayFlowTableContext.getTableBean(), "收款项", "租金"));
|
||||
mainData.put("选择收款项", EnumMapUtils.getEnumItemValueByDisplayValue(receivePayFlowTableContext.getTableBean(), "选择收款项", "租金"));
|
||||
mainData.put("经办日期", LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
mainData.put("合同编号", contractNo);
|
||||
mainData.put("本次收款金额", actualReceipts);
|
||||
|
||||
@@ -94,12 +94,10 @@ public class FeeRecordService {
|
||||
}
|
||||
|
||||
public void payCallBack(String billNo, String bizType, String payDate) throws Exception {
|
||||
if("rent".equals(bizType)) {
|
||||
if("rent".equals(bizType) || "margin".equals(bizType)) {
|
||||
billService.payCallBack(billNo,payDate);
|
||||
}else if("wae".equals(bizType)){
|
||||
// waeBillService.payCallBack(billNo,payDate);
|
||||
}else if("margin".equals(bizType)){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ public enum AssetsTenantConstants {
|
||||
restPwd("",""),
|
||||
formLoginName("2019","表单数据录入登录名"),
|
||||
ASSETS_FORMNO("","资产运营档案编码"),
|
||||
ASSETS_SH_FORMNO("","二手房档案编码"),
|
||||
CONTRACT_FORMNO("","租赁合同表单编码"),
|
||||
DISCHARGE_TEMPLATECODE("","退租申请模板编码"),
|
||||
FALLBACK_FORMNO("","留言板表单编码"),
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.seeyon.apps.assetstenant.flow;
|
||||
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.seeyon.aicloud.common.JsonUtils;
|
||||
import com.seeyon.apps.assetstenant.config.AssetsTenantConfigProvider;
|
||||
import com.seeyon.apps.assetstenant.constants.AssetsTenantConstants;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
@@ -13,6 +15,7 @@ import java.util.Map;
|
||||
|
||||
public class FlowCreateService {
|
||||
|
||||
private static final Log log = Log.get(FlowCreateService.class);
|
||||
private AssetsTenantConfigProvider configProvider = (AssetsTenantConfigProvider) AppContext.getBean("assetsTenantConfigProvider");
|
||||
|
||||
public void flowStart(String flowName,Map<String,Object> mainFormData, Map<String, List<Object>> subFormDatas,String appName,String templateCode) throws Exception {
|
||||
@@ -34,6 +37,7 @@ public class FlowCreateService {
|
||||
for (String key : subFormDatas.keySet()) {
|
||||
formDatas.put(key,subFormDatas.get(key));
|
||||
}
|
||||
log.info("流程发起的参数为: " + JsonUtils.toJSONString(params));
|
||||
OaResp oaResp = client.sendPost(flowName, url, params);
|
||||
if(oaResp.getCode() != 0) {
|
||||
throw new Exception(flowName + "流程发起失败:" + oaResp.getMessage());
|
||||
|
||||
@@ -115,14 +115,11 @@ public class ReserveService {
|
||||
FormSaveUtil.formSave(loginName,getFormNo(),factory,mainFormData,null);
|
||||
}
|
||||
|
||||
public String getManageType(String assetsNo) throws Exception {
|
||||
public Long getManageType(String assetsNo) throws Exception {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("assetsNo", assetsNo);
|
||||
OaAssetsVo oaAssetsVo = assetsService.queryAssetsDetail(param);
|
||||
if(oaAssetsVo == null) {
|
||||
return null;
|
||||
}
|
||||
return oaAssetsVo.getManageType();
|
||||
Long manageType = assetsService.queryAssetsManageType(param);
|
||||
return manageType;
|
||||
}
|
||||
|
||||
public void cancelReserve(String id) throws BusinessException {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ViewRecordResource extends BaseResource {
|
||||
log.info("增加租户浏览记录:"+params);
|
||||
try{
|
||||
viewRecordService.record(params);
|
||||
return success("预约成功");
|
||||
return success("记录成功");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return fail(e.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user