| New file |
| | |
| | | package com.java110.api.listener.room; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.common.constant.ServiceCodeAddRoomBindingConstant; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.common.util.StringUtil; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import com.java110.common.constant.CommonConstant; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("bindingAddRoomBindingListener") |
| | | public class BindingAddRoomBindingListener extends AbstractServiceApiListener { |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | JSONArray infos = reqJson.getJSONArray("data"); |
| | | |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "roomNum", "必填,请填写房屋编号"); |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "layer", "必填,请填写房屋楼层"); |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "section", "必填,请填写房屋楼层"); |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "apartment", "必填,请选择房屋户型"); |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "builtUpArea", "必填,请填写房屋建筑面积"); |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "unitPrice", "必填,请填写房屋每平米单价"); |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "state", "必填,请选择房屋状态"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | HttpHeaders header = new HttpHeaders(); |
| | | context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D"); |
| | | JSONArray businesses = new JSONArray(); |
| | | |
| | | AppService service = event.getAppService(); |
| | | |
| | | |
| | | JSONArray infos = reqJson.getJSONArray("data"); |
| | | |
| | | |
| | | JSONObject viewFloorInfo = getObj(infos, "viewFloorInfo"); |
| | | JSONObject viewUnitInfo = getObj(infos, "viewUnitInfo"); |
| | | JSONObject addRoomView = getObj(infos, "addRoomView"); |
| | | if (!hasKey(viewFloorInfo, "floorId")) { |
| | | viewFloorInfo.put("floorId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_floorId)); |
| | | businesses.add(addBusinessFloor(viewFloorInfo, context)); |
| | | } |
| | | if (!hasKey(viewUnitInfo, "unitId")) { |
| | | viewUnitInfo.put("unitId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_unitId)); |
| | | businesses.add(addBusinessUnit(viewUnitInfo, context)); |
| | | } |
| | | if (!hasKey(addRoomView, "roomId")) { |
| | | addRoomView.put("roomId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_roomId)); |
| | | businesses.add(addBusinessRoom(addRoomView, context)); |
| | | } |
| | | |
| | | |
| | | JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders()); |
| | | |
| | | //将 rest header 信息传递到下层服务中去 |
| | | super.freshHttpHeader(header, context.getRequestCurrentHeaders()); |
| | | |
| | | ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeAddRoomBindingConstant.BINDING_ADDROOMBINDING; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | private JSONObject addBusinessFloor(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FLOOR_INFO); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessObj = new JSONObject(); |
| | | businessObj.putAll(paramInJson); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessFloor", businessObj); |
| | | return business; |
| | | } |
| | | |
| | | private JSONObject addBusinessUnit(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_UNIT_INFO); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessObj = new JSONObject(); |
| | | businessObj.putAll(paramInJson); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessUnit", businessObj); |
| | | return business; |
| | | } |
| | | |
| | | private JSONObject addBusinessRoom(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ROOM_INFO); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessObj = new JSONObject(); |
| | | businessObj.putAll(paramInJson); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessRoom", businessObj); |
| | | return business; |
| | | } |
| | | |
| | | |
| | | private boolean hasKey(JSONObject info, String key) { |
| | | if (!info.containsKey(key) |
| | | || StringUtil.isEmpty(info.getString(key)) |
| | | || info.getString(key).startsWith("-")) { |
| | | return false; |
| | | } |
| | | return true; |
| | | |
| | | } |
| | | |
| | | private JSONObject getObj(JSONArray infos , String flowComponent){ |
| | | |
| | | JSONObject serviceInfo = null; |
| | | |
| | | for(int infoIndex = 0 ; infoIndex < infos.size(); infoIndex ++){ |
| | | |
| | | Assert.hasKeyAndValue(infos.getJSONObject(infoIndex), "flowComponent", "未包含服务流程组件名称"); |
| | | |
| | | if(flowComponent.equals(infos.getJSONObject(infoIndex).getString("flowComponent"))){ |
| | | serviceInfo = infos.getJSONObject(infoIndex); |
| | | Assert.notNull(serviceInfo, "未包含服务信息"); |
| | | return serviceInfo; |
| | | } |
| | | } |
| | | |
| | | throw new IllegalArgumentException("未找到组件编码为【" + flowComponent + "】数据"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | maxWaitMillis: 20000 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: prod.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: prod.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: prod.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: test.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: prod.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: test.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 2000 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: prod.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: test.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: prod.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: test.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: prod.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: test.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: prod.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: test.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: prod.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: test.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: prod.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: test.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: prod.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: test.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| New file |
| | |
| | | package com.java110.web.components.room; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.addRoomBinding.IAddRoomBindingBindingSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 添加添加房屋组件 |
| | | */ |
| | | @Component("addRoomBindingBinding") |
| | | public class AddRoomBindingBindingComponent { |
| | | |
| | | @Autowired |
| | | private IAddRoomBindingBindingSMO addRoomBindingBindingSMOImpl; |
| | | |
| | | /** |
| | | * 添加添加房屋数据 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> binding(IPageData pd){ |
| | | return addRoomBindingBindingSMOImpl.bindingAddRoomBinding(pd); |
| | | } |
| | | |
| | | public IAddRoomBindingBindingSMO getAddRoomBindingBindingSMOImpl() { |
| | | return addRoomBindingBindingSMOImpl; |
| | | } |
| | | |
| | | public void setAddRoomBindingBindingSMOImpl(IAddRoomBindingBindingSMO addRoomBindingBindingSMOImpl) { |
| | | this.addRoomBindingBindingSMOImpl = addRoomBindingBindingSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.addRoomBinding; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 添加添加房屋接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IAddRoomBindingBindingSMO { |
| | | |
| | | /** |
| | | * 添加添加房屋 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> bindingAddRoomBinding(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.addRoomBinding.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ServiceCodeAddRoomBindingConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.web.smo.addRoomBinding.IAddRoomBindingBindingSMO; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.core.AbstractComponentSMO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 添加小区服务实现类 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Service("addRoomBindingBindingSMOImpl") |
| | | public class AddRoomBindingBindingSMOImpl extends AbstractComponentSMO implements IAddRoomBindingBindingSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | JSONArray infos = paramIn.getJSONArray("data"); |
| | | //Assert.hasKeyAndValue(paramIn, "xxx", "xxx"); |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "roomNum", "必填,请填写房屋编号"); |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "layer", "必填,请填写房屋楼层"); |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "section", "必填,请填写房屋楼层"); |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "apartment", "必填,请选择房屋户型"); |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "builtUpArea", "必填,请填写房屋建筑面积"); |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "unitPrice", "必填,请填写房屋每平米单价"); |
| | | Assert.hasKeyByFlowData(infos, "addRoomView", "state", "必填,请选择房屋状态"); |
| | | |
| | | |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.PRIVILEGE_ROOM); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/" + ServiceCodeAddRoomBindingConstant.BINDING_ADDROOMBINDING, |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> bindingAddRoomBinding(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| | |
| | | maxWaitMillis: 20000 |
| | | host: dev.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: prod.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| | |
| | | maxWaitMillis: 20000 |
| | | host: test.redis.java110.com |
| | | port: 6379 |
| | | timeout: 3000 |
| | | password: |
| | | |
| | | eureka: |
| | | instance: |
| New file |
| | |
| | | <div id="component" > |
| | | |
| | | <div class="java110_step"> |
| | | <div id="step" ></div> |
| | | </div> |
| | | |
| | | <!-- 选择 应用信息 --> |
| | | <div v-if="addRoomBindingInfo.index == 0"> |
| | | <vc:create name="viewFloorInfo" |
| | | callBackListener="addRoomBinding" |
| | | callBackFunction="notify" |
| | | ></vc:create> |
| | | </div> |
| | | <div v-if="addRoomBindingInfo.index == 1"> |
| | | <vc:create name="viewUnitInfo" |
| | | callBackListener="addRoomBinding" |
| | | callBackFunction="notify" |
| | | ></vc:create> |
| | | </div> |
| | | <div v-if="addRoomBindingInfo.index == 2"> |
| | | <vc:create name="addRoomView" |
| | | callBackListener="addRoomBinding" |
| | | callBackFunction="notify" |
| | | ></vc:create> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-md-10"></div> |
| | | <div class="col-md-2 " style="margin-bottom:10px; text-align:right"> |
| | | <button type="button" class="btn btn-secondary" v-on:click="_prevStep()">上一步</button> |
| | | <button v-if="addRoomBindingInfo.index != 2" type="button" class="btn btn-primary" style="margin-left:10px;" v-on:click="_nextStep()">下一步</button> |
| | | <button v-if="addRoomBindingInfo.index == 2" type="button" class="btn btn-primary" style="margin-left:10px;" v-on:click="_finishStep()">完成</button> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| New file |
| | |
| | | /** |
| | | 入驻小区 |
| | | **/ |
| | | (function(vc){ |
| | | vc.extends({ |
| | | data:{ |
| | | addRoomBindingInfo:{ |
| | | $step:{}, |
| | | index:0, |
| | | infos:[] |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | vc.component._initStep(); |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on("addRoomBinding", "notify", function(_info){ |
| | | vc.component.addRoomBindingInfo.infos[vc.component.addRoomBindingInfo.index] = _info; |
| | | }); |
| | | |
| | | }, |
| | | methods:{ |
| | | _initStep:function(){ |
| | | vc.component.addRoomBindingInfo.$step = $("#step"); |
| | | vc.component.addRoomBindingInfo.$step.step({ |
| | | index: 0, |
| | | time: 500, |
| | | title: ["选择楼","选择单元","添加房屋"] |
| | | }); |
| | | vc.component.addRoomBindingInfo.index = vc.component.addRoomBindingInfo.$step.getIndex(); |
| | | }, |
| | | _prevStep:function(){ |
| | | vc.component.addRoomBindingInfo.$step.prevStep(); |
| | | vc.component.addRoomBindingInfo.index = vc.component.addRoomBindingInfo.$step.getIndex(); |
| | | |
| | | vc.emit('viewFloorInfo', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | vc.emit('viewUnitInfo', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | vc.emit('addRoomView', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | |
| | | }, |
| | | _nextStep:function(){ |
| | | var _currentData = vc.component.addRoomBindingInfo.infos[vc.component.addRoomBindingInfo.index]; |
| | | if( _currentData == null || _currentData == undefined){ |
| | | vc.message("请选择或填写必选信息"); |
| | | return ; |
| | | } |
| | | vc.component.addRoomBindingInfo.$step.nextStep(); |
| | | vc.component.addRoomBindingInfo.index = vc.component.addRoomBindingInfo.$step.getIndex(); |
| | | |
| | | vc.emit('viewFloorInfo', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | vc.emit('viewUnitInfo', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | vc.emit('addRoomView', 'onIndex', vc.component.serviceBindingInfo.index); |
| | | |
| | | }, |
| | | _finishStep:function(){ |
| | | |
| | | |
| | | var _currentData = vc.component.addRoomBindingInfo.infos[vc.component.addRoomBindingInfo.index]; |
| | | if( _currentData == null || _currentData == undefined){ |
| | | vc.message("请选择或填写必选信息"); |
| | | return ; |
| | | } |
| | | |
| | | var param = { |
| | | data:vc.component.addRoomBindingInfo.infos |
| | | } |
| | | |
| | | vc.http.post( |
| | | 'addRoomBindingBinding', |
| | | 'binding', |
| | | JSON.stringify(param), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | if(res.status == 200){ |
| | | |
| | | vc.message('处理成功',true); |
| | | //关闭model |
| | | vc.jumpToPage("/?" + vc.objToGetParam(JSON.parse(json))); |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | })(window.vc); |
| New file |
| | |
| | | <div class="row"> |
| | | <div class="col-lg-12"> |
| | | <div class="ibox"> |
| | | <div class="ibox-title"> |
| | | <h5>添加房屋</h5> |
| | | <div class="ibox-tools" style="top:10px;"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">房屋编号</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addRoomViewInfo.roomNum" type="text" placeholder="必填,请填写房屋编号" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">房屋楼层</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addRoomViewInfo.layer" type="text" placeholder="必填,请填写房屋楼层" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">房间数</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addRoomViewInfo.section" type="text" placeholder="必填,请填写房间数" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">房屋户型</label> |
| | | <div class="col-sm-10"> |
| | | <select class="custom-select" v-model="addRoomViewInfo.apartment"> |
| | | <option selected disabled value="">必填,请选择房屋户型</option> |
| | | <option value="一室两厅">1010</option> |
| | | <option value="两室两厅">2020</option> |
| | | </select> </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">建筑面积</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addRoomViewInfo.builtUpArea" type="text" placeholder="必填,请填写建筑面积" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">房屋单价</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addRoomViewInfo.unitPrice" type="text" placeholder="必填,请填写房屋单价" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">备注</label> |
| | | <div class="col-sm-10"> |
| | | <textarea placeholder="选填,请填写备注" class="form-control" v-model="addRoomViewInfo.remark"></textarea> </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc){ |
| | | |
| | | vc.extends({ |
| | | propTypes: { |
| | | callBackListener:vc.propTypes.string, //父组件名称 |
| | | callBackFunction:vc.propTypes.string //父组件监听方法 |
| | | }, |
| | | data:{ |
| | | addRoomViewInfo:{ |
| | | flowComponent:'addRoom', |
| | | roomNum:'', |
| | | layer:'', |
| | | section:'', |
| | | apartment:'', |
| | | builtUpArea:'', |
| | | unitPrice:'', |
| | | state:'2002', |
| | | remark:'', |
| | | |
| | | } |
| | | }, |
| | | watch:{ |
| | | addRoomViewInfo:{ |
| | | deep: true, |
| | | handler:function(){ |
| | | vc.component.saveAddRoomInfo(); |
| | | } |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | |
| | | vc.on('addRoomViewInfo', 'onIndex', function(_index){ |
| | | vc.component.addRoomViewInfo.index = _index; |
| | | }); |
| | | }, |
| | | methods:{ |
| | | addRoomValidate(){ |
| | | return vc.validate.validate({ |
| | | addRoomViewInfo:vc.component.addRoomViewInfo |
| | | },{ |
| | | 'addRoomViewInfo.roomNum':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"房屋编号不能为空" |
| | | }, |
| | | { |
| | | limit:"maxLength", |
| | | param:"12", |
| | | errInfo:"房屋编号长度不能超过12位" |
| | | }, |
| | | ], |
| | | 'addRoomViewInfo.layer':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"房屋楼层不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"房屋楼层高度必须为数字" |
| | | }, |
| | | ], |
| | | 'addRoomViewInfo.section':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"房间数不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"房间数必须为数字" |
| | | }, |
| | | ], |
| | | 'addRoomViewInfo.apartment':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"房屋户型不能为空" |
| | | }, |
| | | { |
| | | limit:"maxLength", |
| | | param:"50", |
| | | errInfo:"房屋户型不能大于50" |
| | | }, |
| | | ], |
| | | 'addRoomViewInfo.builtUpArea':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"建筑面积不能为空" |
| | | }, |
| | | { |
| | | limit:"money", |
| | | param:"", |
| | | errInfo:"建筑面积错误,如 300.00" |
| | | }, |
| | | ], |
| | | 'addRoomViewInfo.unitPrice':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"房屋单价不能为空" |
| | | }, |
| | | { |
| | | limit:"money", |
| | | param:"", |
| | | errInfo:"房屋单价错误 如 300.00" |
| | | }, |
| | | ], |
| | | 'addRoomViewInfo.state':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"房屋状态不能为空" |
| | | }, |
| | | { |
| | | limit:"maxLength", |
| | | param:"12", |
| | | errInfo:"房屋状态 不能超过12位" |
| | | }, |
| | | ], |
| | | 'addRoomViewInfo.remark':[ |
| | | { |
| | | limit:"maxLength", |
| | | param:"200", |
| | | errInfo:"备注内容不能超过200" |
| | | }, |
| | | ], |
| | | |
| | | }); |
| | | }, |
| | | saveAddRoomInfo:function(){ |
| | | if(vc.component.addRoomValidate()){ |
| | | //侦听回传 |
| | | vc.emit($props.callBackListener,$props.callBackFunction, vc.component.addRoomViewInfo); |
| | | return ; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc); |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en" |
| | | xmlns="http://www.w3.org/1999/xhtml" |
| | | xmlns:th="http://www.thymeleaf.org" |
| | | xmlns:vc="http://www.thymeleaf.org"> |
| | | <head> |
| | | <meta charset="UTF-8"/> |
| | | <title>添加房屋|java110</title> |
| | | <vc:create name="commonTop"></vc:create> |
| | | </head> |
| | | <body> |
| | | <vc:create name="bodyTop"></vc:create> |
| | | <div id="wrapper"> |
| | | <vc:create name="menu"></vc:create> |
| | | |
| | | |
| | | <div id="page-wrapper" class="gray-bg dashbard-1"> |
| | | <div class="row border-bottom"> |
| | | <vc:create name="nav"></vc:create> |
| | | </div> |
| | | <!-- id="component" --> |
| | | <div class="wrapper wrapper-content animated fadeInRight"> |
| | | <vc:create name="addRoomBinding"></vc:create> |
| | | </div> |
| | | |
| | | <vc:create name="copyright"></vc:create> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <vc:create name="commonBottom"></vc:create> |
| | | </body> |
| | | </html> |
| | |
| | | |
| | | genneratorListListener(data); |
| | | |
| | | //genneratorServiceCodeConstant(data); |
| | | genneratorServiceCodeConstant(data); |
| | | |
| | | |
| | | } |
| | |
| | | * @param data |
| | | */ |
| | | private void genneratorServiceCodeConstant(JSONObject data) { |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/web/constant/ServiceCodeConstant.java").getFile()); |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/relationship/constant/ServiceCodeConstant.java").getFile()); |
| | | String fileContext = sb.toString(); |
| | | |
| | | fileContext = super.replaceTemplateContext(fileContext, data); |
| | | fileContext = super.replaceBindingTemplateContext(fileContext, data); |
| | | |
| | | String variable = data.getString("package").indexOf("Package") >0 ? |
| | | data.getString("package").replace("Package","") : |
| | | data.getString("package"); |
| | | variable += ("." + data.getString("templateCode")); |
| | | fileContext = fileContext.replace("@@constantVariable@@", variable); |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/web/constant/" + data.getString("templateCode") + "/ServiceCode" + toUpperCaseFirstOne(data.getString("templateCode")) + "Constant.java"; |
| | | + "out/relationship/constant/" + data.getString("templateCode") + "/ServiceCode" + toUpperCaseFirstOne(data.getString("templateCode")) + "Constant.java"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| New file |
| | |
| | | package com.java110.code.relationship; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.code.BaseGenerator; |
| | | import com.java110.code.web.GeneratorStart; |
| | | |
| | | public class GeneratorFlow extends BaseGenerator { |
| | | |
| | | public void generator(JSONObject data) { |
| | | |
| | | //处理组件 |
| | | generatorComponentHtml(data); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 生成 html js java 类 |
| | | * |
| | | * @param data |
| | | */ |
| | | private void generatorComponentHtml(JSONObject data) { |
| | | |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/relationship/flow.html").getFile()); |
| | | String fileContext = sb.toString(); |
| | | |
| | | fileContext = super.replaceBindingTemplateContext(fileContext, data); |
| | | |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/relationship/" + data.getString("templateCode") + "/" + data.getString("templateCode") + "Flow.html"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | GeneratorBindingComponent generatorBindingComponent = new GeneratorBindingComponent(); |
| | | generatorBindingComponent.generator(data); |
| | | |
| | | GeneratorFlow generatorFlow = new GeneratorFlow(); |
| | | generatorFlow.generator(data); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.util.StringUtil; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.core.context.DataFlowContext; |
| | |
| | | import com.java110.common.constant.CommonConstant; |
| | | import com.java110.common.constant.ServiceCodeConstant; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.common.constant.ServiceCode@@TemplateCode@@Constant; |
| | | |
| | | |
| | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | JSONArray infos = reqJson.getJSONObject("infos") |
| | | JSONArray infos = reqJson.getJSONArray("data"); |
| | | |
| | | @@validateTemplateColumns@@ |
| | | } |
| | |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCode@@TemplateCode@@Constant.@@TEMPLATECODE@@; |
| | | return ServiceCode@@TemplateCode@@Constant.BINDING_@@TEMPLATECODE@@; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | private boolean hasKey(JSONObject info, String key){ |
| | | if(!info.containsKey(key) |
| | | || StringUtils.isEmpty(info.getString(key)) |
| | | || StringUtil.isEmpty(info.getString(key)) |
| | | || info.getString(key).startsWith("-")){ |
| | | return false; |
| | | } |
| | |
| | | |
| | | private JSONObject getObj(JSONArray infos , String flowComponent){ |
| | | |
| | | JSONObject serviceInfo = null; |
| | | |
| | | for(int infoIndex = 0 ; infoIndex < infos.size(); infoIndex ++){ |
| | | |
| | | Assert.hasKeyAndValue(infos.getJSONObject(infoIndex), "flowComponent", "未包含服务流程组件名称"); |
| | | |
| | | if(flowComponent.equals(infos.getJSONObject(infoIndex).getString("flowComponent"))){ |
| | | serviceInfo = infos.getJSONObject(infoIndex); |
| | | Assert.notNull(serviceInfo, "未包含服务信息"); |
| | | return infos.getJSONObject(infoIndex); |
| | | return serviceInfo; |
| | | } |
| | | } |
| | | |
| | |
| | | package com.java110.web.smo.@@templateCode@@.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.util.Assert; |
| | |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | JSONArray infos = paramIn.getJSONObject("infos") |
| | | JSONArray infos = paramIn.getJSONArray("data"); |
| | | //Assert.hasKeyAndValue(paramIn, "xxx", "xxx"); |
| | | @@validateTemplateColumns@@ |
| | | |
| | |
| | | super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/@@templateCode@@.@@templateCode@@", |
| | | ServiceConstant.SERVICE_API_URL + "/api/" + ServiceCode@@TemplateCode@@Constant.BINDING_@@TEMPLATECODE@@, |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | |
| | | } |
| | | |
| | | vc.http.post( |
| | | '@@templateCode@@', |
| | | '@@templateCode@@Binding', |
| | | 'binding', |
| | | JSON.stringify(param), |
| | | { |
| New file |
| | |
| | | package com.java110.common.constant; |
| | | |
| | | /** |
| | | * @@templateName@@常量类 |
| | | * Created by wuxw on 2017/5/20. |
| | | */ |
| | | public class ServiceCode@@TemplateCode@@Constant { |
| | | |
| | | /** |
| | | * 添加 @@templateName@@ |
| | | */ |
| | | public static final String BINDING_@@TEMPLATECODE@@ = "@@constantVariable@@"; |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en" |
| | | xmlns="http://www.w3.org/1999/xhtml" |
| | | xmlns:th="http://www.thymeleaf.org" |
| | | xmlns:vc="http://www.thymeleaf.org"> |
| | | <head> |
| | | <meta charset="UTF-8"/> |
| | | <title>@@templateName@@|java110</title> |
| | | <vc:create name="commonTop"></vc:create> |
| | | </head> |
| | | <body> |
| | | <vc:create name="bodyTop"></vc:create> |
| | | <div id="wrapper"> |
| | | <vc:create name="menu"></vc:create> |
| | | |
| | | |
| | | <div id="page-wrapper" class="gray-bg dashbard-1"> |
| | | <div class="row border-bottom"> |
| | | <vc:create name="nav"></vc:create> |
| | | </div> |
| | | <!-- id="component" --> |
| | | <div class="wrapper wrapper-content animated fadeInRight"> |
| | | <vc:create name="@@templateCode@@"></vc:create> |
| | | </div> |
| | | |
| | | <vc:create name="copyright"></vc:create> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <vc:create name="commonBottom"></vc:create> |
| | | </body> |
| | | </html> |
| New file |
| | |
| | | package com.java110.common.constant; |
| | | |
| | | /** |
| | | * 添加房屋常量类 |
| | | * Created by wuxw on 2017/5/20. |
| | | */ |
| | | public class ServiceCodeAddRoomBindingConstant { |
| | | |
| | | /** |
| | | * 添加 添加房屋 |
| | | */ |
| | | public static final String BINDING_ADDROOMBINDING = "room.addRoomBinding"; |
| | | |
| | | |
| | | |
| | | } |