Merge remote-tracking branch 'origin/master'
8 文件已重命名
63个文件已添加
39个文件已修改
| | |
| | | responseEntity = tmpRestTemplate.exchange(serviceUrl, HttpMethod.POST, httpEntity, String.class); |
| | | } |
| | | } catch (HttpStatusCodeException e) { //这里spring 框架 在4XX 或 5XX 时抛出 HttpServerErrorException 异常,需要重新封装一下 |
| | | responseEntity = new ResponseEntity<String>("请求下游系统异常," + e.getResponseBodyAsString(), e.getStatusCode()); |
| | | responseEntity = new ResponseEntity<String>( e.getResponseBodyAsString(), e.getStatusCode()); |
| | | } |
| | | return responseEntity; |
| | | } |
| | |
| | | responseEntity = tmpRestTemplate.exchange(service.getUrl(), HttpMethod.POST, httpEntity, String.class); |
| | | } |
| | | } catch (HttpStatusCodeException e) { //这里spring 框架 在4XX 或 5XX 时抛出 HttpServerErrorException 异常,需要重新封装一下 |
| | | responseEntity = new ResponseEntity<String>("请求下游系统异常," + e.getResponseBodyAsString(), e.getStatusCode()); |
| | | responseEntity = new ResponseEntity<String>( e.getResponseBodyAsString(), e.getStatusCode()); |
| | | } |
| | | |
| | | logger.debug("API 服务调用下游服务请求:{},返回为:{}", httpEntity, responseEntity); |
| | |
| | | feeDto.setCommunityId(paramInJson.getString("communityId")); |
| | | List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | |
| | | if (feeDtos == null || feeDtos.size() != 1){ |
| | | if (feeDtos == null || feeDtos.size() != 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "查询费用信息失败,未查到数据或查到多条数据"); |
| | | } |
| | | |
| | | feeDto = feeDtos.get(0); |
| | | paramInJson.put("feeInfo",feeDto); |
| | | paramInJson.put("feeInfo", feeDto); |
| | | |
| | | BigDecimal feePrice = new BigDecimal("0.00"); |
| | | |
| | |
| | | } else { |
| | | throw new IllegalArgumentException("暂不支持该类公式"); |
| | | } |
| | | } else if("6666".equals(feeDto.getPayerObjType())) {//车位相关 |
| | | } else if ("6666".equals(feeDto.getPayerObjType())) {//车位相关 |
| | | String computingFormula = feeDto.getComputingFormula(); |
| | | if ("1001".equals(computingFormula)) { //面积*单价+附加费 |
| | | ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto(); |
| | |
| | | throw new IllegalArgumentException("暂不支持该类公式"); |
| | | } |
| | | } |
| | | BigDecimal cycles = null; |
| | | //BigDecimal receivableAmount = feePrice; |
| | | if ("-101".equals(paramInJson.getString("cycles"))) {//自定义缴费 |
| | | BigDecimal receivedAmount = new BigDecimal(Double.parseDouble(paramInJson.getString("receivedAmount"))); |
| | | cycles = receivedAmount.divide(feePrice,2,BigDecimal.ROUND_HALF_EVEN); |
| | | paramInJson.put("tmpCycles", cycles); |
| | | businessFeeDetail.put("cycles", cycles.doubleValue()); |
| | | businessFeeDetail.put("receivableAmount", receivedAmount.doubleValue()); |
| | | } else { |
| | | cycles = new BigDecimal(Double.parseDouble(paramInJson.getString("cycles"))); |
| | | double tmpReceivableAmount = cycles.multiply(feePrice).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | businessFeeDetail.put("receivableAmount", tmpReceivableAmount); |
| | | } |
| | | |
| | | BigDecimal receivableAmount = feePrice; |
| | | BigDecimal cycles = new BigDecimal(Double.parseDouble(paramInJson.getString("cycles"))); |
| | | double tmpReceivableAmount = cycles.multiply(receivableAmount).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | |
| | | businessFeeDetail.put("receivableAmount", tmpReceivableAmount); |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessFeeDetail", businessFeeDetail); |
| | | |
| | | return business; |
| | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_FEE_INFO); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ+1); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + 1); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessFee = new JSONObject(); |
| | | FeeDto feeInfo = (FeeDto)paramInJson.get("feeInfo"); |
| | | FeeDto feeInfo = (FeeDto) paramInJson.get("feeInfo"); |
| | | Date endTime = feeInfo.getEndTime(); |
| | | Calendar endCalender = Calendar.getInstance(); |
| | | endCalender.setTime(endTime); |
| | | endCalender.add(Calendar.MONTH, Integer.parseInt(paramInJson.getString("cycles"))); |
| | | int hours = 0; |
| | | if ("-101".equals(paramInJson.getString("cycles"))) { |
| | | hours = new Double(Double.parseDouble(paramInJson.getString("tmpCycles")) * DateUtil.getCurrentMonthDay() * 24).intValue(); |
| | | endCalender.add(Calendar.HOUR, hours); |
| | | } else { |
| | | endCalender.add(Calendar.MONTH, Integer.parseInt(paramInJson.getString("cycles"))); |
| | | } |
| | | feeInfo.setEndTime(endCalender.getTime()); |
| | | Map feeMap = BeanConvertUtil.beanCovertMap(feeInfo); |
| | | feeMap.put("startTime", DateUtil.getFormatTimeString(feeInfo.getStartTime(), DateUtil.DATE_FORMATE_STRING_A)); |
| | |
| | | public void setRoomInnerServiceSMOImpl(IRoomInnerServiceSMO roomInnerServiceSMOImpl) { |
| | | this.roomInnerServiceSMOImpl = roomInnerServiceSMOImpl; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.inspectionRoute; |
| | | |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.utils.constant.ServiceCodeInspectionRouteConstant; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("deleteInspectionRouteListener") |
| | | public class DeleteInspectionRouteListener extends AbstractServiceApiListener { |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "configId", "inspectionRouteId不能为空"); |
| | | |
| | | } |
| | | |
| | | @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(); |
| | | |
| | | //添加单元信息 |
| | | businesses.add(deleteInspectionRoute(reqJson, 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 ServiceCodeInspectionRouteConstant.DELETE_INSPECTIONROUTE; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | private JSONObject deleteInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_INSPECTION_ROUTE); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessInspectionRoute = new JSONObject(); |
| | | businessInspectionRoute.putAll(paramInJson); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionRoute", businessInspectionRoute); |
| | | return business; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.inspectionRoute; |
| | | |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.utils.constant.ServiceCodeInspectionRouteConstant; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.inspectionRoute.IInspectionRouteInnerServiceSMO; |
| | | import com.java110.dto.inspectionRoute.InspectionRouteDto; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.vo.api.inspectionRoute.ApiInspectionRouteDataVo; |
| | | import com.java110.vo.api.inspectionRoute.ApiInspectionRouteVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 查询小区侦听类 |
| | | */ |
| | | @Java110Listener("listInspectionRoutesListener") |
| | | public class ListInspectionRoutesListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IInspectionRouteInnerServiceSMO inspectionRouteInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeInspectionRouteConstant.LIST_INSPECTIONROUTES; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public IInspectionRouteInnerServiceSMO getInspectionRouteInnerServiceSMOImpl() { |
| | | return inspectionRouteInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setInspectionRouteInnerServiceSMOImpl(IInspectionRouteInnerServiceSMO inspectionRouteInnerServiceSMOImpl) { |
| | | this.inspectionRouteInnerServiceSMOImpl = inspectionRouteInnerServiceSMOImpl; |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | super.validatePageInfo(reqJson); |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | InspectionRouteDto inspectionRouteDto = BeanConvertUtil.covertBean(reqJson, InspectionRouteDto.class); |
| | | |
| | | int count = inspectionRouteInnerServiceSMOImpl.queryInspectionRoutesCount(inspectionRouteDto); |
| | | |
| | | List<ApiInspectionRouteDataVo> inspectionRoutes = null; |
| | | |
| | | if (count > 0) { |
| | | inspectionRoutes = BeanConvertUtil.covertBeanList(inspectionRouteInnerServiceSMOImpl.queryInspectionRoutes(inspectionRouteDto), ApiInspectionRouteDataVo.class); |
| | | } else { |
| | | inspectionRoutes = new ArrayList<>(); |
| | | } |
| | | |
| | | ApiInspectionRouteVo apiInspectionRouteVo = new ApiInspectionRouteVo(); |
| | | |
| | | apiInspectionRouteVo.setTotal(count); |
| | | apiInspectionRouteVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row"))); |
| | | apiInspectionRouteVo.setInspectionRoutes(inspectionRoutes); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiInspectionRouteVo), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.inspectionRoute; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.ServiceCodeInspectionRouteConstant; |
| | | |
| | | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("saveInspectionRouteListener") |
| | | public class SaveInspectionRouteListener extends AbstractServiceApiListener { |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "routeName", "必填,请填写路线名称,字数100个以内"); |
| | | Assert.hasKeyAndValue(reqJson, "inspectionName", "必填,请选择巡点名称"); |
| | | Assert.hasKeyAndValue(reqJson, "machineQuantity", "无需填写,系统自动生成"); |
| | | Assert.hasKeyAndValue(reqJson, "checkQuantity", "必填,请输入巡检路线的检查项数量"); |
| | | |
| | | } |
| | | |
| | | @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(); |
| | | |
| | | //添加单元信息 |
| | | businesses.add(addInspectionRoute(reqJson, 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 ServiceCodeInspectionRouteConstant.ADD_INSPECTIONROUTE; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | private JSONObject addInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_INSPECTION_ROUTE); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessInspectionRoute = new JSONObject(); |
| | | businessInspectionRoute.putAll(paramInJson); |
| | | businessInspectionRoute.put("configId", "-1"); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionRoute", businessInspectionRoute); |
| | | return business; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.inspectionRoute; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.ServiceCodeInspectionRouteConstant; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 保存巡检路线侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("updateInspectionRouteListener") |
| | | public class UpdateInspectionRouteListener extends AbstractServiceApiListener { |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "configId", "inspectionRouteId不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "routeName", "必填,请填写路线名称,字数100个以内"); |
| | | Assert.hasKeyAndValue(reqJson, "inspectionName", "必填,请选择巡点名称"); |
| | | Assert.hasKeyAndValue(reqJson, "machineQuantity", "无需填写,系统自动生成"); |
| | | Assert.hasKeyAndValue(reqJson, "checkQuantity", "必填,请输入巡检路线的检查项数量"); |
| | | |
| | | } |
| | | |
| | | @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(); |
| | | |
| | | //添加单元信息 |
| | | businesses.add(updateInspectionRoute(reqJson, 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 ServiceCodeInspectionRouteConstant.UPDATE_INSPECTIONROUTE; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加巡检路线信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @param dataFlowContext 数据上下文 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | private JSONObject updateInspectionRoute(JSONObject paramInJson, DataFlowContext dataFlowContext) { |
| | | |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_INSPECTION_ROUTE); |
| | | business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | JSONObject businessInspectionRoute = new JSONObject(); |
| | | businessInspectionRoute.putAll(paramInJson); |
| | | //计算 应收金额 |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessInspectionRoute", businessInspectionRoute); |
| | | return business; |
| | | } |
| | | |
| | | } |
| File was renamed from Api/src/main/java/com/java110/api/listener/users/AddStaffServiceListener.java |
| | |
| | | package com.java110.api.listener.users; |
| | | package com.java110.api.listener.user; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| New file |
| | |
| | | package com.java110.api.listener.user; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiDataFlowListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 修改员工 2018年12月6日 |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("changeStaffPwdServiceListener") |
| | | public class ChangeStaffPwdListener extends AbstractServiceApiDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(ChangeStaffPwdListener.class); |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.SERVICE_CODE_CHANGE_STAFF_PWD; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加员工信息 |
| | | * |
| | | * @param event |
| | | */ |
| | | @Override |
| | | public void soService(ServiceDataFlowEvent event) { |
| | | //获取数据上下文对象 |
| | | DataFlowContext dataFlowContext = event.getDataFlowContext(); |
| | | AppService service = event.getAppService(); |
| | | String paramIn = dataFlowContext.getReqData(); |
| | | Assert.isJsonObject(paramIn, "添加员工时请求参数有误,不是有效的json格式 " + paramIn); |
| | | JSONObject paramInJson = JSONObject.parseObject(paramIn); |
| | | Assert.jsonObjectHaveKey(paramInJson, "userId", "请求参数中未包含userId 节点,请确认"); |
| | | Assert.jsonObjectHaveKey(paramInJson, "oldPwd", "请求参数中未包含oldPwd 节点,请确认"); |
| | | Assert.jsonObjectHaveKey(paramInJson, "newPwd", "请求参数中未包含newPwd 节点,请确认"); |
| | | |
| | | JSONArray businesses = new JSONArray(); |
| | | //判断请求报文中包含 userId 并且 不为-1时 将已有用户添加为员工,反之,则添加用户再将用户添加为员工 |
| | | JSONObject staffBusiness = modifyStaff(paramInJson, dataFlowContext); |
| | | businesses.add(staffBusiness); |
| | | |
| | | HttpHeaders header = new HttpHeaders(); |
| | | dataFlowContext.getRequestCurrentHeaders().put(CommonConstant.HTTP_USER_ID, paramInJson.getString("userId")); |
| | | dataFlowContext.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D"); |
| | | |
| | | String paramInObj = super.restToCenterProtocol(businesses, dataFlowContext.getRequestCurrentHeaders()).toJSONString(); |
| | | |
| | | //将 rest header 信息传递到下层服务中去 |
| | | super.freshHttpHeader(header, dataFlowContext.getRequestCurrentHeaders()); |
| | | |
| | | HttpEntity<String> httpEntity = new HttpEntity<String>(paramInObj, header); |
| | | //http://user-service/test/sayHello |
| | | super.doRequest(dataFlowContext, service, httpEntity); |
| | | |
| | | super.doResponse(dataFlowContext); |
| | | } |
| | | |
| | | |
| | | private JSONObject modifyStaff(JSONObject paramObj, DataFlowContext dataFlowContext) { |
| | | //校验json 格式中是否包含 name,email,levelCd,tel |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_MODIFY_USER_INFO); |
| | | business.put(CommonConstant.HTTP_SEQ, 1); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessUser", builderStaffInfo(paramObj, dataFlowContext)); |
| | | |
| | | return business; |
| | | } |
| | | |
| | | /** |
| | | * 构建员工信息 |
| | | * |
| | | * @param paramObj |
| | | * @param dataFlowContext |
| | | * @return |
| | | */ |
| | | private JSONObject builderStaffInfo(JSONObject paramObj, DataFlowContext dataFlowContext) { |
| | | |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setStatusCd("0"); |
| | | userDto.setUserId(paramObj.getString("userId")); |
| | | List<UserDto> userDtos = userInnerServiceSMOImpl.getUserHasPwd(userDto); |
| | | |
| | | Assert.listOnlyOne(userDtos, "数据错误查询到多条用户信息或单条"); |
| | | |
| | | JSONObject userInfo = JSONObject.parseObject(JSONObject.toJSONString(userDtos.get(0))); |
| | | |
| | | if (!paramObj.getString("oldPwd").equals(userDtos.get(0).getPassword())) { |
| | | throw new IllegalArgumentException("原始密码错误"); |
| | | } |
| | | userInfo.putAll(paramObj); |
| | | userInfo.put("password", paramObj.getString("newPwd")); |
| | | |
| | | return userInfo; |
| | | } |
| | | |
| | | } |
| File was renamed from Api/src/main/java/com/java110/api/listener/users/DeleteStaffServiceListener.java |
| | |
| | | package com.java110.api.listener.users; |
| | | package com.java110.api.listener.user; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| File was renamed from Api/src/main/java/com/java110/api/listener/users/DisableStaffServiceListener.java |
| | |
| | | package com.java110.api.listener.users; |
| | | package com.java110.api.listener.user; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiDataFlowListener; |
| File was renamed from Api/src/main/java/com/java110/api/listener/users/EnableStaffServiceListener.java |
| | |
| | | package com.java110.api.listener.users; |
| | | package com.java110.api.listener.user; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiDataFlowListener; |
| File was renamed from Api/src/main/java/com/java110/api/listener/users/ModifyStaffServiceListener.java |
| | |
| | | package com.java110.api.listener.users; |
| | | package com.java110.api.listener.user; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| File was renamed from Api/src/main/java/com/java110/api/listener/users/QueryStaffByUserNameServiceListener.java |
| | |
| | | package com.java110.api.listener.users; |
| | | package com.java110.api.listener.user; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| File was renamed from Api/src/main/java/com/java110/api/listener/users/QueryStaffServiceListener.java |
| | |
| | | package com.java110.api.listener.users; |
| | | package com.java110.api.listener.user; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| New file |
| | |
| | | package com.java110.api.listener.user; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiDataFlowListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.factory.AuthenticationFactory; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | |
| | | /** |
| | | * 修改员工 2018年12月6日 |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("resetStaffPwdListener") |
| | | public class ResetStaffPwdListener extends AbstractServiceApiDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(ResetStaffPwdListener.class); |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.SERVICE_CODE_RESET_STAFF_PWD; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加员工信息 |
| | | * |
| | | * @param event |
| | | */ |
| | | @Override |
| | | public void soService(ServiceDataFlowEvent event) { |
| | | //获取数据上下文对象 |
| | | DataFlowContext dataFlowContext = event.getDataFlowContext(); |
| | | AppService service = event.getAppService(); |
| | | String paramIn = dataFlowContext.getReqData(); |
| | | Assert.isJsonObject(paramIn, "请求参数有误,不是有效的json格式 " + paramIn); |
| | | JSONObject paramInJson = JSONObject.parseObject(paramIn); |
| | | Assert.jsonObjectHaveKey(paramInJson, "userId", "请求参数中未包含userId 节点,请确认"); |
| | | |
| | | JSONArray businesses = new JSONArray(); |
| | | //判断请求报文中包含 userId 并且 不为-1时 将已有用户添加为员工,反之,则添加用户再将用户添加为员工 |
| | | JSONObject staffBusiness = modifyStaff(paramInJson, dataFlowContext); |
| | | businesses.add(staffBusiness); |
| | | |
| | | HttpHeaders header = new HttpHeaders(); |
| | | dataFlowContext.getRequestCurrentHeaders().put(CommonConstant.HTTP_USER_ID, paramInJson.getString("userId")); |
| | | dataFlowContext.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D"); |
| | | |
| | | String paramInObj = super.restToCenterProtocol(businesses, dataFlowContext.getRequestCurrentHeaders()).toJSONString(); |
| | | |
| | | //将 rest header 信息传递到下层服务中去 |
| | | super.freshHttpHeader(header, dataFlowContext.getRequestCurrentHeaders()); |
| | | |
| | | HttpEntity<String> httpEntity = new HttpEntity<String>(paramInObj, header); |
| | | //http://user-service/test/sayHello |
| | | super.doRequest(dataFlowContext, service, httpEntity); |
| | | |
| | | if (dataFlowContext.getResponseEntity().getStatusCode() == HttpStatus.OK) { |
| | | JSONObject paramOut = new JSONObject(); |
| | | paramOut.put("pwd", paramInJson.getString("pwd")); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<>(paramOut.toJSONString(), HttpStatus.OK); |
| | | dataFlowContext.setResponseEntity(responseEntity); |
| | | } |
| | | } |
| | | |
| | | |
| | | private JSONObject modifyStaff(JSONObject paramObj, DataFlowContext dataFlowContext) { |
| | | //校验json 格式中是否包含 name,email,levelCd,tel |
| | | |
| | | JSONObject business = JSONObject.parseObject("{\"datas\":{}}"); |
| | | business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_MODIFY_USER_INFO); |
| | | business.put(CommonConstant.HTTP_SEQ, 1); |
| | | business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S); |
| | | |
| | | business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessUser", builderStaffInfo(paramObj, dataFlowContext)); |
| | | |
| | | return business; |
| | | } |
| | | |
| | | /** |
| | | * 构建员工信息 |
| | | * |
| | | * @param paramObj |
| | | * @param dataFlowContext |
| | | * @return |
| | | */ |
| | | private JSONObject builderStaffInfo(JSONObject paramObj, DataFlowContext dataFlowContext) { |
| | | |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setStatusCd("0"); |
| | | userDto.setUserId(paramObj.getString("userId")); |
| | | List<UserDto> userDtos = userInnerServiceSMOImpl.getUserHasPwd(userDto); |
| | | |
| | | Assert.listOnlyOne(userDtos, "数据错误查询到多条用户信息或单条"); |
| | | |
| | | JSONObject userInfo = JSONObject.parseObject(JSONObject.toJSONString(userDtos.get(0))); |
| | | String pwd = GenerateCodeFactory.getRandomCode(6); |
| | | userInfo.putAll(paramObj); |
| | | userInfo.put("password", AuthenticationFactory.passwdMd5(pwd)); |
| | | paramObj.put("pwd", pwd); |
| | | |
| | | return userInfo; |
| | | } |
| | | |
| | | |
| | | } |
| File was renamed from Api/src/main/java/com/java110/api/listener/users/UserLogoutServiceListener.java |
| | |
| | | package com.java110.api.listener.users; |
| | | package com.java110.api.listener.user; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiDataFlowListener; |
| | |
| | | } catch (DecryptException e) { //解密异常 |
| | | responseEntity = new ResponseEntity<String>("解密异常:" + e.getMessage(), HttpStatus.NON_AUTHORITATIVE_INFORMATION); |
| | | } catch (BusinessException e) { |
| | | responseEntity = new ResponseEntity<String>("业务处理异常:" + e.getMessage(), HttpStatus.BAD_REQUEST); |
| | | responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.BAD_REQUEST); |
| | | } catch (NoAuthorityException e) { |
| | | responseEntity = new ResponseEntity<String>("鉴权失败:" + e.getMessage(), HttpStatus.UNAUTHORIZED); |
| | | } catch (InitConfigDataException e) { |
| | |
| | | package com.java110.api.listener.floor; |
| | | |
| | | import com.java110.utils.util.DateUtil; |
| | | import org.junit.Test; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | |
| | | import static org.junit.Assert.*; |
| | | |
| | |
| | | |
| | | @Test |
| | | public void soService() { |
| | | int a = 16; |
| | | int b = 16; |
| | | System.out.println(Math.ceil((double) a/(double) b)); |
| | | Date endTime = new Date(); |
| | | Calendar endCalender = Calendar.getInstance(); |
| | | endCalender.setTime(endTime); |
| | | endCalender.add(Calendar.HOUR, 365*24*10+3); |
| | | |
| | | System.out.printf("time "+ DateUtil.getFormatTimeString(endCalender.getTime(),DateUtil.DATE_FORMATE_STRING_A)); |
| | | } |
| | | } |
| | |
| | | dockerfile: Dockerfile |
| | | restart: always |
| | | ports: |
| | | - "443:8443" |
| | | - "8012:8012" |
| | | volumes: |
| | | - ../target/AppFrontService.jar:/root/target/AppFrontService.jar |
| | | networks: |
| | |
| | | try { |
| | | responseEntity = restTemplate.exchange(url, httpMethod, httpEntity, String.class); |
| | | } catch (HttpStatusCodeException e) { //这里spring 框架 在4XX 或 5XX 时抛出 HttpServerErrorException 异常,需要重新封装一下 |
| | | responseEntity = new ResponseEntity<String>("请求下游系统异常," + e.getResponseBodyAsString(), e.getStatusCode()); |
| | | responseEntity = new ResponseEntity<String>( e.getResponseBodyAsString(), e.getStatusCode()); |
| | | } catch (Exception e) { |
| | | responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); |
| | | } finally { |
| | |
| | | try { |
| | | responseEntity = restTemplate.exchange(url, httpMethod, httpEntity, String.class); |
| | | } catch (HttpStatusCodeException e) { //这里spring 框架 在4XX 或 5XX 时抛出 HttpServerErrorException 异常,需要重新封装一下 |
| | | responseEntity = new ResponseEntity<String>("请求下游系统异常," + e.getResponseBodyAsString(), e.getStatusCode()); |
| | | responseEntity = new ResponseEntity<String>( e.getResponseBodyAsString(), e.getStatusCode()); |
| | | } catch (Exception e) { |
| | | responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); |
| | | } finally { |
| New file |
| | |
| | | package com.java110.community.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 巡检路线组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 巡检路线服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface IInspectionRouteServiceDao { |
| | | |
| | | /** |
| | | * 保存 巡检路线信息 |
| | | * @param businessInspectionRouteInfo 巡检路线信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | void saveBusinessInspectionRouteInfo(Map businessInspectionRouteInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询巡检路线信息(business过程) |
| | | * 根据bId 查询巡检路线信息 |
| | | * @param info bId 信息 |
| | | * @return 巡检路线信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getBusinessInspectionRouteInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 巡检路线信息 Business数据到 Instance中 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveInspectionRouteInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询巡检路线信息(instance过程) |
| | | * 根据bId 查询巡检路线信息 |
| | | * @param info bId 信息 |
| | | * @return 巡检路线信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getInspectionRouteInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改巡检路线信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateInspectionRouteInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询巡检路线总数 |
| | | * |
| | | * @param info 巡检路线信息 |
| | | * @return 巡检路线数量 |
| | | */ |
| | | int queryInspectionRoutesCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.community.dao.IInspectionRouteServiceDao; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 巡检路线服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("inspectionRouteServiceDaoImpl") |
| | | //@Transactional |
| | | public class InspectionRouteServiceDaoImpl extends BaseServiceDao implements IInspectionRouteServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(InspectionRouteServiceDaoImpl.class); |
| | | |
| | | /** |
| | | * 巡检路线信息封装 |
| | | * @param businessInspectionRouteInfo 巡检路线信息 封装 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveBusinessInspectionRouteInfo(Map businessInspectionRouteInfo) throws DAOException { |
| | | businessInspectionRouteInfo.put("month", DateUtil.getCurrentMonth()); |
| | | // 查询business_user 数据是否已经存在 |
| | | logger.debug("保存巡检路线信息 入参 businessInspectionRouteInfo : {}",businessInspectionRouteInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("inspectionRouteServiceDaoImpl.saveBusinessInspectionRouteInfo",businessInspectionRouteInfo); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存巡检路线数据失败:"+ JSONObject.toJSONString(businessInspectionRouteInfo)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询巡检路线信息 |
| | | * @param info bId 信息 |
| | | * @return 巡检路线信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getBusinessInspectionRouteInfo(Map info) throws DAOException { |
| | | |
| | | logger.debug("查询巡检路线信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessInspectionRouteInfos = sqlSessionTemplate.selectList("inspectionRouteServiceDaoImpl.getBusinessInspectionRouteInfo",info); |
| | | |
| | | return businessInspectionRouteInfos; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存巡检路线信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveInspectionRouteInfoInstance(Map info) throws DAOException { |
| | | logger.debug("保存巡检路线信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("inspectionRouteServiceDaoImpl.saveInspectionRouteInfoInstance",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存巡检路线信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询巡检路线信息(instance) |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getInspectionRouteInfo(Map info) throws DAOException { |
| | | logger.debug("查询巡检路线信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessInspectionRouteInfos = sqlSessionTemplate.selectList("inspectionRouteServiceDaoImpl.getInspectionRouteInfo",info); |
| | | |
| | | return businessInspectionRouteInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改巡检路线信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateInspectionRouteInfoInstance(Map info) throws DAOException { |
| | | logger.debug("修改巡检路线信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("inspectionRouteServiceDaoImpl.updateInspectionRouteInfoInstance",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改巡检路线信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询巡检路线数量 |
| | | * @param info 巡检路线信息 |
| | | * @return 巡检路线数量 |
| | | */ |
| | | @Override |
| | | public int queryInspectionRoutesCount(Map info) { |
| | | logger.debug("查询巡检路线数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessInspectionRouteInfos = sqlSessionTemplate.selectList("inspectionRouteServiceDaoImpl.queryInspectionRoutesCount", info); |
| | | if (businessInspectionRouteInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessInspectionRouteInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.listener.inspectionRoute; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.community.dao.IInspectionRouteServiceDao; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.event.service.AbstractBusinessServiceDataFlowListener; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 巡检路线 服务侦听 父类 |
| | | * Created by wuxw on 2018/7/4. |
| | | */ |
| | | public abstract class AbstractInspectionRouteBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener { |
| | | private static Logger logger = LoggerFactory.getLogger(AbstractInspectionRouteBusinessServiceDataFlowListener.class); |
| | | |
| | | |
| | | /** |
| | | * 获取 DAO工具类 |
| | | * |
| | | * @return |
| | | */ |
| | | public abstract IInspectionRouteServiceDao getInspectionRouteServiceDaoImpl(); |
| | | |
| | | /** |
| | | * 刷新 businessInspectionRouteInfo 数据 |
| | | * 主要将 数据库 中字段和 接口传递字段建立关系 |
| | | * |
| | | * @param businessInspectionRouteInfo |
| | | */ |
| | | protected void flushBusinessInspectionRouteInfo(Map businessInspectionRouteInfo, String statusCd) { |
| | | businessInspectionRouteInfo.put("newBId", businessInspectionRouteInfo.get("b_id")); |
| | | businessInspectionRouteInfo.put("operate", businessInspectionRouteInfo.get("operate")); |
| | | businessInspectionRouteInfo.put("inspectionRouteId", businessInspectionRouteInfo.get("inspection_routeId")); |
| | | businessInspectionRouteInfo.put("checkQuantity", businessInspectionRouteInfo.get("check_quantity")); |
| | | businessInspectionRouteInfo.put("machineQuantity", businessInspectionRouteInfo.get("machine_quantity")); |
| | | businessInspectionRouteInfo.put("remark", businessInspectionRouteInfo.get("remark")); |
| | | businessInspectionRouteInfo.put("communityId", businessInspectionRouteInfo.get("community_id")); |
| | | businessInspectionRouteInfo.put("routeName", businessInspectionRouteInfo.get("Route_name")); |
| | | businessInspectionRouteInfo.remove("bId"); |
| | | businessInspectionRouteInfo.put("statusCd", statusCd); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中 |
| | | * |
| | | * @param businessInspectionRoute 巡检路线信息 |
| | | */ |
| | | protected void autoSaveDelBusinessInspectionRoute(Business business, JSONObject businessInspectionRoute) { |
| | | //自动插入DEL |
| | | Map info = new HashMap(); |
| | | info.put("inspectionRouteId", businessInspectionRoute.getString("inspectionRouteId")); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | List<Map> currentInspectionRouteInfos = getInspectionRouteServiceDaoImpl().getInspectionRouteInfo(info); |
| | | if (currentInspectionRouteInfos == null || currentInspectionRouteInfos.size() != 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info); |
| | | } |
| | | |
| | | Map currentInspectionRouteInfo = currentInspectionRouteInfos.get(0); |
| | | |
| | | currentInspectionRouteInfo.put("bId", business.getbId()); |
| | | |
| | | currentInspectionRouteInfo.put("operate", currentInspectionRouteInfo.get("operate")); |
| | | currentInspectionRouteInfo.put("inspectionRouteId", currentInspectionRouteInfo.get("inspection_routeId")); |
| | | currentInspectionRouteInfo.put("checkQuantity", currentInspectionRouteInfo.get("check_quantity")); |
| | | currentInspectionRouteInfo.put("machineQuantity", currentInspectionRouteInfo.get("machine_quantity")); |
| | | currentInspectionRouteInfo.put("remark", currentInspectionRouteInfo.get("remark")); |
| | | currentInspectionRouteInfo.put("communityId", currentInspectionRouteInfo.get("community_id")); |
| | | currentInspectionRouteInfo.put("routeName", currentInspectionRouteInfo.get("Route_name")); |
| | | |
| | | |
| | | currentInspectionRouteInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | getInspectionRouteServiceDaoImpl().saveBusinessInspectionRouteInfo(currentInspectionRouteInfo); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.listener.inspectionRoute; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.community.dao.IInspectionRouteServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 删除巡检路线信息 侦听 |
| | | * <p> |
| | | * 处理节点 |
| | | * 1、businessInspectionRoute:{} 巡检路线基本信息节点 |
| | | * 2、businessInspectionRouteAttr:[{}] 巡检路线属性信息节点 |
| | | * 3、businessInspectionRoutePhoto:[{}] 巡检路线照片信息节点 |
| | | * 4、businessInspectionRouteCerdentials:[{}] 巡检路线证件信息节点 |
| | | * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("deleteInspectionRouteInfoListener") |
| | | @Transactional |
| | | public class DeleteInspectionRouteInfoListener extends AbstractInspectionRouteBusinessServiceDataFlowListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(DeleteInspectionRouteInfoListener.class); |
| | | @Autowired |
| | | IInspectionRouteServiceDao inspectionRouteServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 3; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_DELETE_INSPECTION_ROUTE; |
| | | } |
| | | |
| | | /** |
| | | * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessInspectionRoute 节点 |
| | | if (data.containsKey("businessInspectionRoute")) { |
| | | //处理 businessInspectionRoute 节点 |
| | | if (data.containsKey("businessInspectionRoute")) { |
| | | Object _obj = data.get("businessInspectionRoute"); |
| | | JSONArray businessInspectionRoutes = null; |
| | | if (_obj instanceof JSONObject) { |
| | | businessInspectionRoutes = new JSONArray(); |
| | | businessInspectionRoutes.add(_obj); |
| | | } else { |
| | | businessInspectionRoutes = (JSONArray) _obj; |
| | | } |
| | | //JSONObject businessInspectionRoute = data.getJSONObject("businessInspectionRoute"); |
| | | for (int _inspectionRouteIndex = 0; _inspectionRouteIndex < businessInspectionRoutes.size(); _inspectionRouteIndex++) { |
| | | JSONObject businessInspectionRoute = businessInspectionRoutes.getJSONObject(_inspectionRouteIndex); |
| | | doBusinessInspectionRoute(business, businessInspectionRoute); |
| | | if (_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("inspectionRouteId", businessInspectionRoute.getString("inspectionRouteId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除 instance数据 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | |
| | | //巡检路线信息 |
| | | Map info = new HashMap(); |
| | | info.put("bId", business.getbId()); |
| | | info.put("operate", StatusConstant.OPERATE_DEL); |
| | | |
| | | //巡检路线信息 |
| | | List<Map> businessInspectionRouteInfos = inspectionRouteServiceDaoImpl.getBusinessInspectionRouteInfo(info); |
| | | if (businessInspectionRouteInfos != null && businessInspectionRouteInfos.size() > 0) { |
| | | for (int _inspectionRouteIndex = 0; _inspectionRouteIndex < businessInspectionRouteInfos.size(); _inspectionRouteIndex++) { |
| | | Map businessInspectionRouteInfo = businessInspectionRouteInfos.get(_inspectionRouteIndex); |
| | | flushBusinessInspectionRouteInfo(businessInspectionRouteInfo, StatusConstant.STATUS_CD_INVALID); |
| | | inspectionRouteServiceDaoImpl.updateInspectionRouteInfoInstance(businessInspectionRouteInfo); |
| | | dataFlowContext.addParamOut("inspectionRouteId", businessInspectionRouteInfo.get("inspection_routeId")); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 撤单 |
| | | * 从business表中查询到DEL的数据 将instance中的数据更新回来 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId", bId); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_INVALID); |
| | | |
| | | Map delInfo = new HashMap(); |
| | | delInfo.put("bId", business.getbId()); |
| | | delInfo.put("operate", StatusConstant.OPERATE_DEL); |
| | | //巡检路线信息 |
| | | List<Map> inspectionRouteInfo = inspectionRouteServiceDaoImpl.getInspectionRouteInfo(info); |
| | | if (inspectionRouteInfo != null && inspectionRouteInfo.size() > 0) { |
| | | |
| | | //巡检路线信息 |
| | | List<Map> businessInspectionRouteInfos = inspectionRouteServiceDaoImpl.getBusinessInspectionRouteInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if (businessInspectionRouteInfos == null || businessInspectionRouteInfos.size() == 0) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(inspectionRoute),程序内部异常,请检查! " + delInfo); |
| | | } |
| | | for (int _inspectionRouteIndex = 0; _inspectionRouteIndex < businessInspectionRouteInfos.size(); _inspectionRouteIndex++) { |
| | | Map businessInspectionRouteInfo = businessInspectionRouteInfos.get(_inspectionRouteIndex); |
| | | flushBusinessInspectionRouteInfo(businessInspectionRouteInfo, StatusConstant.STATUS_CD_VALID); |
| | | inspectionRouteServiceDaoImpl.updateInspectionRouteInfoInstance(businessInspectionRouteInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理 businessInspectionRoute 节点 |
| | | * |
| | | * @param business 总的数据节点 |
| | | * @param businessInspectionRoute 巡检路线节点 |
| | | */ |
| | | private void doBusinessInspectionRoute(Business business, JSONObject businessInspectionRoute) { |
| | | |
| | | Assert.jsonObjectHaveKey(businessInspectionRoute, "inspectionRouteId", "businessInspectionRoute 节点下没有包含 inspectionRouteId 节点"); |
| | | |
| | | if (businessInspectionRoute.getString("inspectionRouteId").startsWith("-")) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "inspectionRouteId 错误,不能自动生成(必须已经存在的inspectionRouteId)" + businessInspectionRoute); |
| | | } |
| | | //自动插入DEL |
| | | autoSaveDelBusinessInspectionRoute(business, businessInspectionRoute); |
| | | } |
| | | |
| | | public IInspectionRouteServiceDao getInspectionRouteServiceDaoImpl() { |
| | | return inspectionRouteServiceDaoImpl; |
| | | } |
| | | |
| | | public void setInspectionRouteServiceDaoImpl(IInspectionRouteServiceDao inspectionRouteServiceDaoImpl) { |
| | | this.inspectionRouteServiceDaoImpl = inspectionRouteServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.community.listener.inspectionRoute; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.community.dao.IInspectionRouteServiceDao; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.entity.center.Business; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 保存 巡检路线信息 侦听 |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("saveInspectionRouteInfoListener") |
| | | @Transactional |
| | | public class SaveInspectionRouteInfoListener extends AbstractInspectionRouteBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(SaveInspectionRouteInfoListener.class); |
| | | |
| | | @Autowired |
| | | private IInspectionRouteServiceDao inspectionRouteServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_SAVE_INSPECTION_ROUTE; |
| | | } |
| | | |
| | | /** |
| | | * 保存巡检路线信息 business 表中 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessInspectionRoute 节点 |
| | | if (data.containsKey("businessInspectionRoute")) { |
| | | Object bObj = data.get("businessInspectionRoute"); |
| | | JSONArray businessInspectionRoutes = null; |
| | | if (bObj instanceof JSONObject) { |
| | | businessInspectionRoutes = new JSONArray(); |
| | | businessInspectionRoutes.add(bObj); |
| | | } else { |
| | | businessInspectionRoutes = (JSONArray) bObj; |
| | | } |
| | | //JSONObject businessInspectionRoute = data.getJSONObject("businessInspectionRoute"); |
| | | for (int bInspectionRouteIndex = 0; bInspectionRouteIndex < businessInspectionRoutes.size(); bInspectionRouteIndex++) { |
| | | JSONObject businessInspectionRoute = businessInspectionRoutes.getJSONObject(bInspectionRouteIndex); |
| | | doBusinessInspectionRoute(business, businessInspectionRoute); |
| | | if (bObj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("inspectionRouteId", businessInspectionRoute.getString("inspectionRouteId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * business 数据转移到 instance |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Map info = new HashMap(); |
| | | info.put("bId", business.getbId()); |
| | | info.put("operate", StatusConstant.OPERATE_ADD); |
| | | |
| | | //巡检路线信息 |
| | | List<Map> businessInspectionRouteInfo = inspectionRouteServiceDaoImpl.getBusinessInspectionRouteInfo(info); |
| | | if (businessInspectionRouteInfo != null && businessInspectionRouteInfo.size() > 0) { |
| | | reFreshShareColumn(info, businessInspectionRouteInfo.get(0)); |
| | | inspectionRouteServiceDaoImpl.saveInspectionRouteInfoInstance(info); |
| | | if (businessInspectionRouteInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("inspectionRouteId", businessInspectionRouteInfo.get(0).get("inspection_routeId")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 刷 分片字段 |
| | | * |
| | | * @param info 查询对象 |
| | | * @param businessInfo 小区ID |
| | | */ |
| | | private void reFreshShareColumn(Map info, Map businessInfo) { |
| | | |
| | | if (info.containsKey("communityId")) { |
| | | return; |
| | | } |
| | | |
| | | if (!businessInfo.containsKey("community_id")) { |
| | | return; |
| | | } |
| | | |
| | | info.put("communityId", businessInfo.get("community_id")); |
| | | } |
| | | |
| | | /** |
| | | * 撤单 |
| | | * |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId", bId); |
| | | info.put("statusCd", StatusConstant.STATUS_CD_VALID); |
| | | Map paramIn = new HashMap(); |
| | | paramIn.put("bId", bId); |
| | | paramIn.put("statusCd", StatusConstant.STATUS_CD_INVALID); |
| | | //巡检路线信息 |
| | | List<Map> inspectionRouteInfo = inspectionRouteServiceDaoImpl.getInspectionRouteInfo(info); |
| | | if (inspectionRouteInfo != null && inspectionRouteInfo.size() > 0) { |
| | | reFreshShareColumn(paramIn, inspectionRouteInfo.get(0)); |
| | | inspectionRouteServiceDaoImpl.updateInspectionRouteInfoInstance(paramIn); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理 businessInspectionRoute 节点 |
| | | * |
| | | * @param business 总的数据节点 |
| | | * @param businessInspectionRoute 巡检路线节点 |
| | | */ |
| | | private void doBusinessInspectionRoute(Business business, JSONObject businessInspectionRoute) { |
| | | |
| | | Assert.jsonObjectHaveKey(businessInspectionRoute, "inspectionRouteId", "businessInspectionRoute 节点下没有包含 inspectionRouteId 节点"); |
| | | |
| | | if (businessInspectionRoute.getString("inspectionRouteId").startsWith("-")) { |
| | | //刷新缓存 |
| | | //flushInspectionRouteId(business.getDatas()); |
| | | |
| | | businessInspectionRoute.put("inspectionRouteId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_inspectionRouteId)); |
| | | |
| | | } |
| | | |
| | | businessInspectionRoute.put("bId", business.getbId()); |
| | | businessInspectionRoute.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存巡检路线信息 |
| | | inspectionRouteServiceDaoImpl.saveBusinessInspectionRouteInfo(businessInspectionRoute); |
| | | |
| | | } |
| | | |
| | | public IInspectionRouteServiceDao getInspectionRouteServiceDaoImpl() { |
| | | return inspectionRouteServiceDaoImpl; |
| | | } |
| | | |
| | | public void setInspectionRouteServiceDaoImpl(IInspectionRouteServiceDao inspectionRouteServiceDaoImpl) { |
| | | this.inspectionRouteServiceDaoImpl = inspectionRouteServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.community.listener.inspectionRoute; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.StatusConstant; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.community.dao.IInspectionRouteServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 修改巡检路线信息 侦听 |
| | | * |
| | | * 处理节点 |
| | | * 1、businessInspectionRoute:{} 巡检路线基本信息节点 |
| | | * 2、businessInspectionRouteAttr:[{}] 巡检路线属性信息节点 |
| | | * 3、businessInspectionRoutePhoto:[{}] 巡检路线照片信息节点 |
| | | * 4、businessInspectionRouteCerdentials:[{}] 巡检路线证件信息节点 |
| | | * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("updateInspectionRouteInfoListener") |
| | | @Transactional |
| | | public class UpdateInspectionRouteInfoListener extends AbstractInspectionRouteBusinessServiceDataFlowListener { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(UpdateInspectionRouteInfoListener.class); |
| | | @Autowired |
| | | private IInspectionRouteServiceDao inspectionRouteServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 2; |
| | | } |
| | | |
| | | @Override |
| | | public String getBusinessTypeCd() { |
| | | return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_INSPECTION_ROUTE; |
| | | } |
| | | |
| | | /** |
| | | * business过程 |
| | | * @param dataFlowContext 上下文对象 |
| | | * @param business 业务对象 |
| | | */ |
| | | @Override |
| | | protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理"); |
| | | |
| | | //处理 businessInspectionRoute 节点 |
| | | if(data.containsKey("businessInspectionRoute")){ |
| | | //处理 businessInspectionRoute 节点 |
| | | if(data.containsKey("businessInspectionRoute")){ |
| | | Object _obj = data.get("businessInspectionRoute"); |
| | | JSONArray businessInspectionRoutes = null; |
| | | if(_obj instanceof JSONObject){ |
| | | businessInspectionRoutes = new JSONArray(); |
| | | businessInspectionRoutes.add(_obj); |
| | | }else { |
| | | businessInspectionRoutes = (JSONArray)_obj; |
| | | } |
| | | //JSONObject businessInspectionRoute = data.getJSONObject("businessInspectionRoute"); |
| | | for (int _inspectionRouteIndex = 0; _inspectionRouteIndex < businessInspectionRoutes.size();_inspectionRouteIndex++) { |
| | | JSONObject businessInspectionRoute = businessInspectionRoutes.getJSONObject(_inspectionRouteIndex); |
| | | doBusinessInspectionRoute(business, businessInspectionRoute); |
| | | if(_obj instanceof JSONObject) { |
| | | dataFlowContext.addParamOut("inspectionRouteId", businessInspectionRoute.getString("inspectionRouteId")); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * business to instance 过程 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | JSONObject data = business.getDatas(); |
| | | |
| | | Map info = new HashMap(); |
| | | info.put("bId",business.getbId()); |
| | | info.put("operate",StatusConstant.OPERATE_ADD); |
| | | |
| | | //巡检路线信息 |
| | | List<Map> businessInspectionRouteInfos = inspectionRouteServiceDaoImpl.getBusinessInspectionRouteInfo(info); |
| | | if( businessInspectionRouteInfos != null && businessInspectionRouteInfos.size() >0) { |
| | | for (int _inspectionRouteIndex = 0; _inspectionRouteIndex < businessInspectionRouteInfos.size();_inspectionRouteIndex++) { |
| | | Map businessInspectionRouteInfo = businessInspectionRouteInfos.get(_inspectionRouteIndex); |
| | | flushBusinessInspectionRouteInfo(businessInspectionRouteInfo,StatusConstant.STATUS_CD_VALID); |
| | | inspectionRouteServiceDaoImpl.updateInspectionRouteInfoInstance(businessInspectionRouteInfo); |
| | | if(businessInspectionRouteInfo.size() == 1) { |
| | | dataFlowContext.addParamOut("inspectionRouteId", businessInspectionRouteInfo.get("inspection_routeId")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 撤单 |
| | | * @param dataFlowContext 数据对象 |
| | | * @param business 当前业务对象 |
| | | */ |
| | | @Override |
| | | protected void doRecover(DataFlowContext dataFlowContext, Business business) { |
| | | |
| | | String bId = business.getbId(); |
| | | //Assert.hasLength(bId,"请求报文中没有包含 bId"); |
| | | Map info = new HashMap(); |
| | | info.put("bId",bId); |
| | | info.put("statusCd",StatusConstant.STATUS_CD_VALID); |
| | | Map delInfo = new HashMap(); |
| | | delInfo.put("bId",business.getbId()); |
| | | delInfo.put("operate",StatusConstant.OPERATE_DEL); |
| | | //巡检路线信息 |
| | | List<Map> inspectionRouteInfo = inspectionRouteServiceDaoImpl.getInspectionRouteInfo(info); |
| | | if(inspectionRouteInfo != null && inspectionRouteInfo.size() > 0){ |
| | | |
| | | //巡检路线信息 |
| | | List<Map> businessInspectionRouteInfos = inspectionRouteServiceDaoImpl.getBusinessInspectionRouteInfo(delInfo); |
| | | //除非程序出错了,这里不会为空 |
| | | if(businessInspectionRouteInfos == null || businessInspectionRouteInfos.size() == 0){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(inspectionRoute),程序内部异常,请检查! "+delInfo); |
| | | } |
| | | for (int _inspectionRouteIndex = 0; _inspectionRouteIndex < businessInspectionRouteInfos.size();_inspectionRouteIndex++) { |
| | | Map businessInspectionRouteInfo = businessInspectionRouteInfos.get(_inspectionRouteIndex); |
| | | flushBusinessInspectionRouteInfo(businessInspectionRouteInfo,StatusConstant.STATUS_CD_VALID); |
| | | inspectionRouteServiceDaoImpl.updateInspectionRouteInfoInstance(businessInspectionRouteInfo); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 处理 businessInspectionRoute 节点 |
| | | * @param business 总的数据节点 |
| | | * @param businessInspectionRoute 巡检路线节点 |
| | | */ |
| | | private void doBusinessInspectionRoute(Business business,JSONObject businessInspectionRoute){ |
| | | |
| | | Assert.jsonObjectHaveKey(businessInspectionRoute,"inspectionRouteId","businessInspectionRoute 节点下没有包含 inspectionRouteId 节点"); |
| | | |
| | | if(businessInspectionRoute.getString("inspectionRouteId").startsWith("-")){ |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"inspectionRouteId 错误,不能自动生成(必须已经存在的inspectionRouteId)"+businessInspectionRoute); |
| | | } |
| | | //自动保存DEL |
| | | autoSaveDelBusinessInspectionRoute(business,businessInspectionRoute); |
| | | |
| | | businessInspectionRoute.put("bId",business.getbId()); |
| | | businessInspectionRoute.put("operate", StatusConstant.OPERATE_ADD); |
| | | //保存巡检路线信息 |
| | | inspectionRouteServiceDaoImpl.saveBusinessInspectionRouteInfo(businessInspectionRoute); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public IInspectionRouteServiceDao getInspectionRouteServiceDaoImpl() { |
| | | return inspectionRouteServiceDaoImpl; |
| | | } |
| | | |
| | | public void setInspectionRouteServiceDaoImpl(IInspectionRouteServiceDao inspectionRouteServiceDaoImpl) { |
| | | this.inspectionRouteServiceDaoImpl = inspectionRouteServiceDaoImpl; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.smo.impl; |
| | | |
| | | |
| | | import com.java110.community.dao.IInspectionRouteServiceDao; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.smo.inspectionRoute.IInspectionRouteInnerServiceSMO; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.inspectionRoute.InspectionRouteDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 巡检路线内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class InspectionRouteInnerServiceSMOImpl extends BaseServiceSMO implements IInspectionRouteInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IInspectionRouteServiceDao inspectionRouteServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<InspectionRouteDto> queryInspectionRoutes(@RequestBody InspectionRouteDto inspectionRouteDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = inspectionRouteDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | inspectionRouteDto.setPage((page - 1) * inspectionRouteDto.getRow()); |
| | | } |
| | | |
| | | List<InspectionRouteDto> inspectionRoutes = BeanConvertUtil.covertBeanList(inspectionRouteServiceDaoImpl.getInspectionRouteInfo(BeanConvertUtil.beanCovertMap(inspectionRouteDto)), InspectionRouteDto.class); |
| | | |
| | | if (inspectionRoutes == null || inspectionRoutes.size() == 0) { |
| | | return inspectionRoutes; |
| | | } |
| | | |
| | | return inspectionRoutes; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int queryInspectionRoutesCount(@RequestBody InspectionRouteDto inspectionRouteDto) { |
| | | return inspectionRouteServiceDaoImpl.queryInspectionRoutesCount(BeanConvertUtil.beanCovertMap(inspectionRouteDto)); } |
| | | |
| | | public IInspectionRouteServiceDao getInspectionRouteServiceDaoImpl() { |
| | | return inspectionRouteServiceDaoImpl; |
| | | } |
| | | |
| | | public void setInspectionRouteServiceDaoImpl(IInspectionRouteServiceDao inspectionRouteServiceDaoImpl) { |
| | | this.inspectionRouteServiceDaoImpl = inspectionRouteServiceDaoImpl; |
| | | } |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) { |
| | | this.userInnerServiceSMOImpl = userInnerServiceSMOImpl; |
| | | } |
| | | } |
| | |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.entity.center.Business; |
| | | import com.java110.fee.dao.IFeeServiceDao; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.NumberUtils; |
| | | |
| | | import java.util.*; |
| | | |
| | |
| | | feeDetailInfo.put("operate", "ADD"); |
| | | List<Map> feeDetails = feeDetailServiceDaoImpl.getBusinessFeeDetailInfo(feeDetailInfo); |
| | | Assert.listOnlyOne(feeDetails, "business表中存在多条缴费记录或没有"); |
| | | |
| | | int cycles = Integer.parseInt(feeDetails.get(0).get("cycles").toString()); |
| | | String cyclesStr = feeDetails.get(0).get("cycles").toString(); |
| | | double cycles = Double.parseDouble(cyclesStr); |
| | | |
| | | Map feeMap = null; |
| | | if (businessFeeInfos != null && businessFeeInfos.size() > 0) { |
| | |
| | | Assert.listOnlyOne(feeInfo, "查询到多条数据或未查询到数据" + feeMap); |
| | | //根据当前的结束时间 修改 |
| | | Date endTime = (Date) feeInfo.get(0).get("end_time"); |
| | | Calendar endCalender = Calendar.getInstance(); |
| | | endCalender.setTime(endTime); |
| | | endCalender.add(Calendar.MONTH, cycles); |
| | | if(cycles > 0) { |
| | | Calendar endCalender = Calendar.getInstance(); |
| | | endCalender.setTime(endTime); |
| | | if(StringUtil.isNumber(cyclesStr)) { |
| | | endCalender.add(Calendar.MONTH, new Double(cycles).intValue()); |
| | | }else{ |
| | | int hours = new Double(cycles * DateUtil.getCurrentMonthDay() * 24).intValue(); |
| | | endCalender.add(Calendar.HOUR, hours); |
| | | } |
| | | businessFeeInfo.put("end_time", endCalender.getTime()); |
| | | } |
| | | flushBusinessFeeInfo(businessFeeInfo, StatusConstant.STATUS_CD_VALID); |
| | |
| | | try { |
| | | responseEntity = restTemplate.exchange(url, httpMethod, httpEntity, String.class); |
| | | } catch (HttpStatusCodeException e) { //这里spring 框架 在4XX 或 5XX 时抛出 HttpServerErrorException 异常,需要重新封装一下 |
| | | responseEntity = new ResponseEntity<String>("请求下游系统异常," + e.getResponseBodyAsString(), e.getStatusCode()); |
| | | responseEntity = new ResponseEntity<String>( e.getResponseBodyAsString(), e.getStatusCode()); |
| | | } catch (Exception e) { |
| | | responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); |
| | | } finally { |
| | |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getUsers(Map info) throws DAOException; |
| | | |
| | | /** |
| | | * 查询用户密码 |
| | | * 根据bId 查询组织信息 |
| | | * @param info bId 信息 |
| | | * @return 组织信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getUserHasPwd(Map info) throws DAOException; |
| | | } |
| | |
| | | |
| | | return businessStaffs; |
| | | } |
| | | |
| | | /** |
| | | * 查询用户密码 |
| | | * 根据bId 查询组织信息 |
| | | * @param info bId 信息 |
| | | * @return 组织信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getUserHasPwd(Map info) throws DAOException{ |
| | | logger.debug("查询用户密码 入参 info : {}",info); |
| | | |
| | | List<Map> businessStaffs = sqlSessionTemplate.selectList("userServiceDaoImpl.getUserHasPwd",info); |
| | | return businessStaffs; |
| | | } |
| | | } |
| | |
| | | return staffs; |
| | | } |
| | | |
| | | @Override |
| | | public List<UserDto> getUserHasPwd(@RequestBody UserDto userDto) { |
| | | //校验是否传了 分页信息 |
| | | List<UserDto> staffs = BeanConvertUtil.covertBeanList(userServiceDaoImpl.getUserHasPwd(BeanConvertUtil.beanCovertMap(userDto)), UserDto.class); |
| | | |
| | | return staffs; |
| | | |
| | | } |
| | | |
| | | private void freshUserAttrs(List<UserDto> userDtos) { |
| | | |
| | | Map param = null; |
| New file |
| | |
| | | package com.java110.web.components.inspectionRoute; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.inspectionRoute.IAddInspectionRouteSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 添加巡检路线组件 |
| | | */ |
| | | @Component("addInspectionRoute") |
| | | public class AddInspectionRouteComponent { |
| | | |
| | | @Autowired |
| | | private IAddInspectionRouteSMO addInspectionRouteSMOImpl; |
| | | |
| | | /** |
| | | * 添加巡检路线数据 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> save(IPageData pd){ |
| | | return addInspectionRouteSMOImpl.saveInspectionRoute(pd); |
| | | } |
| | | |
| | | public IAddInspectionRouteSMO getAddInspectionRouteSMOImpl() { |
| | | return addInspectionRouteSMOImpl; |
| | | } |
| | | |
| | | public void setAddInspectionRouteSMOImpl(IAddInspectionRouteSMO addInspectionRouteSMOImpl) { |
| | | this.addInspectionRouteSMOImpl = addInspectionRouteSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.inspectionRoute; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.inspectionRoute.IListInspectionRoutesSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 应用组件管理类 |
| | | * <p> |
| | | * add by wuxw |
| | | * <p> |
| | | * 2019-06-29 |
| | | */ |
| | | @Component("chooseInspectionRoute") |
| | | public class ChooseInspectionRouteComponent { |
| | | |
| | | @Autowired |
| | | private IListInspectionRoutesSMO listInspectionRoutesSMOImpl; |
| | | |
| | | /** |
| | | * 查询应用列表 |
| | | * |
| | | * @param pd 页面数据封装 |
| | | * @return 返回 ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> list(IPageData pd) { |
| | | return listInspectionRoutesSMOImpl.listInspectionRoutes(pd); |
| | | } |
| | | |
| | | public IListInspectionRoutesSMO getListInspectionRoutesSMOImpl() { |
| | | return listInspectionRoutesSMOImpl; |
| | | } |
| | | |
| | | public void setListInspectionRoutesSMOImpl(IListInspectionRoutesSMO listInspectionRoutesSMOImpl) { |
| | | this.listInspectionRoutesSMOImpl = listInspectionRoutesSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.inspectionRoute; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.inspectionRoute.IDeleteInspectionRouteSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 添加巡检路线组件 |
| | | */ |
| | | @Component("deleteInspectionRoute") |
| | | public class DeleteInspectionRouteComponent { |
| | | |
| | | @Autowired |
| | | private IDeleteInspectionRouteSMO deleteInspectionRouteSMOImpl; |
| | | |
| | | /** |
| | | * 添加巡检路线数据 |
| | | * |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> delete(IPageData pd) { |
| | | return deleteInspectionRouteSMOImpl.deleteInspectionRoute(pd); |
| | | } |
| | | |
| | | public IDeleteInspectionRouteSMO getDeleteInspectionRouteSMOImpl() { |
| | | return deleteInspectionRouteSMOImpl; |
| | | } |
| | | |
| | | public void setDeleteInspectionRouteSMOImpl(IDeleteInspectionRouteSMO deleteInspectionRouteSMOImpl) { |
| | | this.deleteInspectionRouteSMOImpl = deleteInspectionRouteSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.inspectionRoute; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.inspectionRoute.IEditInspectionRouteSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 编辑小区组件 |
| | | */ |
| | | @Component("editInspectionRoute") |
| | | public class EditInspectionRouteComponent { |
| | | |
| | | @Autowired |
| | | private IEditInspectionRouteSMO editInspectionRouteSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区数据 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> update(IPageData pd){ |
| | | return editInspectionRouteSMOImpl.updateInspectionRoute(pd); |
| | | } |
| | | |
| | | public IEditInspectionRouteSMO getEditInspectionRouteSMOImpl() { |
| | | return editInspectionRouteSMOImpl; |
| | | } |
| | | |
| | | public void setEditInspectionRouteSMOImpl(IEditInspectionRouteSMO editInspectionRouteSMOImpl) { |
| | | this.editInspectionRouteSMOImpl = editInspectionRouteSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.inspectionRoute; |
| | | |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.inspectionRoute.IListInspectionRoutesSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 巡检路线组件管理类 |
| | | * |
| | | * add by wuxw |
| | | * |
| | | * 2019-06-29 |
| | | */ |
| | | @Component("inspectionRouteManage") |
| | | public class InspectionRouteManageComponent { |
| | | |
| | | @Autowired |
| | | private IListInspectionRoutesSMO listInspectionRoutesSMOImpl; |
| | | |
| | | /** |
| | | * 查询巡检路线列表 |
| | | * @param pd 页面数据封装 |
| | | * @return 返回 ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> list(IPageData pd){ |
| | | return listInspectionRoutesSMOImpl.listInspectionRoutes(pd); |
| | | } |
| | | |
| | | public IListInspectionRoutesSMO getListInspectionRoutesSMOImpl() { |
| | | return listInspectionRoutesSMOImpl; |
| | | } |
| | | |
| | | public void setListInspectionRoutesSMOImpl(IListInspectionRoutesSMO listInspectionRoutesSMOImpl) { |
| | | this.listInspectionRoutesSMOImpl = listInspectionRoutesSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.staff; |
| | | |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.staff.IChangeStaffPwdServiceSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 搜索员工 |
| | | */ |
| | | @Component("changeStaffPwd") |
| | | public class ChangeStaffPwdComponent { |
| | | |
| | | @Autowired |
| | | IChangeStaffPwdServiceSMO changeStaffPwdServiceSMOImpl; |
| | | |
| | | public ResponseEntity<String> change(IPageData pd) { |
| | | return changeStaffPwdServiceSMOImpl.change(pd); |
| | | } |
| | | |
| | | public IChangeStaffPwdServiceSMO getChangeStaffPwdServiceSMOImpl() { |
| | | return changeStaffPwdServiceSMOImpl; |
| | | } |
| | | |
| | | public void setChangeStaffPwdServiceSMOImpl(IChangeStaffPwdServiceSMO changeStaffPwdServiceSMOImpl) { |
| | | this.changeStaffPwdServiceSMOImpl = changeStaffPwdServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.staff; |
| | | |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.staff.IChangeStaffPwdServiceSMO; |
| | | import com.java110.web.smo.staff.IResetStaffPwdServiceSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 搜索员工 |
| | | */ |
| | | @Component("resetStaffPwd") |
| | | public class ResetStaffPwdComponent { |
| | | |
| | | @Autowired |
| | | IResetStaffPwdServiceSMO resetStaffPwdServiceSMOImpl; |
| | | |
| | | public ResponseEntity<String> reset(IPageData pd) { |
| | | return resetStaffPwdServiceSMOImpl.reset(pd); |
| | | } |
| | | |
| | | public IResetStaffPwdServiceSMO getResetStaffPwdServiceSMOImpl() { |
| | | return resetStaffPwdServiceSMOImpl; |
| | | } |
| | | |
| | | public void setResetStaffPwdServiceSMOImpl(IResetStaffPwdServiceSMO resetStaffPwdServiceSMOImpl) { |
| | | this.resetStaffPwdServiceSMOImpl = resetStaffPwdServiceSMOImpl; |
| | | } |
| | | } |
| | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("成功", HttpStatus.OK); |
| | | ImportOwner owner = null; |
| | | for (ImportParkingSpace parkingSpace : parkingSpaces) { |
| | | |
| | | JSONObject savedParkingAreaInfo = getExistsParkingArea(pd, result, parkingSpace); |
| | | paramIn = new JSONObject(); |
| | | // 如果不存在,才插入 |
| | | if (savedParkingAreaInfo == null) { |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/parkingArea.saveParkingArea"; |
| | | paramIn.put("communityId", result.getCommunityId()); |
| | | paramIn.put("typeCd",parkingSpace.getTypeCd()); |
| | | paramIn.put("num", parkingSpace.getPaNum()); |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST); |
| | | savedParkingAreaInfo = getExistsParkingArea(pd, result, parkingSpace); |
| | | } |
| | | if (responseEntity != null && responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息 |
| | | continue; |
| | | } |
| | | |
| | | JSONObject savedParkingSpaceInfo = getExistsParkSpace(pd, result, parkingSpace); |
| | | if (savedParkingSpaceInfo != null) { |
| | | continue; |
| | | } |
| | | |
| | | paramIn = new JSONObject(); |
| | | |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/parkingSpace.saveParkingSpace"; |
| | | |
| | | paramIn.put("paId", savedParkingAreaInfo.getString("paId")); |
| | | paramIn.put("communityId", result.getCommunityId()); |
| | | paramIn.put("userId", result.getUserId()); |
| | | paramIn.put("num", parkingSpace.getPsNum()); |
| | |
| | | |
| | | String feeTypeCd = "1001".equals(parkingSpace.getTypeCd()) |
| | | ? FeeTypeConstant.FEE_TYPE_SELL_UP_PARKING_SPACE : FeeTypeConstant.FEE_TYPE_SELL_DOWN_PARKING_SPACE; |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/fee.queryFeeConfig?communityId=" + result.getCommunityId() + "&feeTypeCd=" + feeTypeCd; |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/feeConfig.listFeeConfigs?page=1&row=1&communityId=" + result.getCommunityId() + "&feeTypeCd=" + feeTypeCd+"&isDefault=T"; |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET); |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | continue; |
| | | } |
| | | |
| | | JSONObject configInfo = JSONArray.parseArray(responseEntity.getBody()).getJSONObject(0); |
| | | JSONObject configInfo = JSONObject.parseObject(responseEntity.getBody()).getJSONArray("feeConfigs").getJSONObject(0); |
| | | if (!configInfo.containsKey("additionalAmount")) { |
| | | continue; |
| | | } |
| | |
| | | paramIn.put("link", owner.getTel()); |
| | | paramIn.put("sex", owner.getSex()); |
| | | paramIn.put("ownerTypeCd", "1001"); |
| | | paramIn.put("idCard",owner.getIdCard()); |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST); |
| | | if (responseEntity.getStatusCode() == HttpStatus.OK) { |
| | | savedOwnerInfo = getExistsOwner(pd, result, owner); |
| | |
| | | paramIn.put("userId", result.getUserId()); |
| | | paramIn.put("name", importFloor.getFloorNum() + "号楼"); |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST); |
| | | savedFloorInfo = getExistsFloor(pd, result, importFloor); |
| | | } |
| | | if (responseEntity != null && responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息 |
| | | continue; |
| | | } |
| | | |
| | | savedFloorInfo = getExistsFloor(pd, result, importFloor); |
| | | |
| | | |
| | | if (savedFloorInfo == null) { |
| | | continue; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询存在的停车场 |
| | | * |
| | | * @param pd |
| | | * @param result |
| | | * @param parkingSpace |
| | | * @return |
| | | */ |
| | | private JSONObject getExistsParkingArea(IPageData pd, ComponentValidateResult result, ImportParkingSpace parkingSpace) { |
| | | String apiUrl = ""; |
| | | ResponseEntity<String> responseEntity = null; |
| | | apiUrl = ServiceConstant.SERVICE_API_URL + "/api/parkingArea.listParkingAreas?page=1&row=1&communityId=" + result.getCommunityId() |
| | | + "&num=" + parkingSpace.getPaNum(); |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET); |
| | | |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息 |
| | | return null; |
| | | } |
| | | |
| | | JSONObject savedParkingAreaInfoResult = JSONObject.parseObject(responseEntity.getBody()); |
| | | |
| | | if (!savedParkingAreaInfoResult.containsKey("parkingAreas") || savedParkingAreaInfoResult.getJSONArray("parkingAreas").size() != 1) { |
| | | return null; |
| | | } |
| | | |
| | | JSONObject savedParkingAreaInfo = savedParkingAreaInfoResult.getJSONArray("parkingAreas").getJSONObject(0); |
| | | |
| | | return savedParkingAreaInfo; |
| | | } |
| | | |
| | | /** |
| | | * 数据校验处理 |
| | | * |
| | | * @param floors |
| | |
| | | continue; |
| | | } |
| | | importParkingSpace = new ImportParkingSpace(); |
| | | importParkingSpace.setPsNum(os[0].toString()); |
| | | importParkingSpace.setTypeCd(os[1].toString()); |
| | | importParkingSpace.setArea(Double.parseDouble(os[2].toString())); |
| | | if (StringUtil.isNullOrNone(os[3])) { |
| | | importParkingSpace.setPaNum(os[0].toString()); |
| | | importParkingSpace.setPsNum(os[1].toString()); |
| | | importParkingSpace.setTypeCd(os[2].toString()); |
| | | importParkingSpace.setArea(Double.parseDouble(os[3].toString())); |
| | | if (StringUtil.isNullOrNone(os[4])) { |
| | | parkingSpaces.add(importParkingSpace); |
| | | continue; |
| | | } |
| | | ImportOwner importOwner = getImportOwner(owners, os[3].toString()); |
| | | ImportOwner importOwner = getImportOwner(owners, os[4].toString()); |
| | | importParkingSpace.setImportOwner(importOwner); |
| | | if (importOwner != null) { |
| | | importParkingSpace.setCarNum(os[4].toString()); |
| | | importParkingSpace.setCarBrand(os[5].toString()); |
| | | importParkingSpace.setCarType(os[6].toString()); |
| | | importParkingSpace.setCarColor(os[7].toString()); |
| | | importParkingSpace.setSellOrHire(os[8].toString()); |
| | | importParkingSpace.setCarNum(os[5].toString()); |
| | | importParkingSpace.setCarBrand(os[6].toString()); |
| | | importParkingSpace.setCarType(os[7].toString()); |
| | | importParkingSpace.setCarColor(os[8].toString()); |
| | | importParkingSpace.setSellOrHire(os[9].toString()); |
| | | } |
| | | |
| | | parkingSpaces.add(importParkingSpace); |
| | |
| | | importOwner.setSex("男".equals(os[2].toString()) ? "0" : "1"); |
| | | importOwner.setAge(Integer.parseInt(os[3].toString())); |
| | | importOwner.setTel(os[4].toString()); |
| | | importOwner.setIdCard(os[5].toString()); |
| | | owners.add(importOwner); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.inspectionRoute; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 添加巡检路线接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IAddInspectionRouteSMO { |
| | | |
| | | /** |
| | | * 添加巡检路线 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> saveInspectionRoute(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.inspectionRoute; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 添加巡检路线接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IDeleteInspectionRouteSMO { |
| | | |
| | | /** |
| | | * 添加巡检路线 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> deleteInspectionRoute(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.inspectionRoute; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 修改巡检路线接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IEditInspectionRouteSMO { |
| | | |
| | | /** |
| | | * 修改小区 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> updateInspectionRoute(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.inspectionRoute; |
| | | |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 巡检路线管理服务接口类 |
| | | * |
| | | * add by wuxw 2019-06-29 |
| | | */ |
| | | public interface IListInspectionRoutesSMO { |
| | | |
| | | /** |
| | | * 查询巡检路线信息 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象数据 |
| | | * @throws SMOException 业务代码层 |
| | | */ |
| | | ResponseEntity<String> listInspectionRoutes(IPageData pd) throws SMOException; |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.inspectionRoute.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.component.AbstractComponentSMO; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.inspectionRoute.IAddInspectionRouteSMO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | /** |
| | | * 添加小区服务实现类 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Service("addInspectionRouteSMOImpl") |
| | | public class AddInspectionRouteSMOImpl extends AbstractComponentSMO implements IAddInspectionRouteSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | |
| | | //Assert.hasKeyAndValue(paramIn, "xxx", "xxx"); |
| | | Assert.hasKeyAndValue(paramIn, "routeName", "必填,请填写路线名称,字数100个以内"); |
| | | Assert.hasKeyAndValue(paramIn, "inspectionName", "必填,请选择巡点名称"); |
| | | Assert.hasKeyAndValue(paramIn, "machineQuantity", "无需填写,系统自动生成"); |
| | | Assert.hasKeyAndValue(paramIn, "checkQuantity", "必填,请输入巡检路线的检查项数量"); |
| | | |
| | | |
| | | //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_INSPECTIONROUTE); |
| | | |
| | | } |
| | | |
| | | @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/inspectionRoute.saveInspectionRoute", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> saveInspectionRoute(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.inspectionRoute.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.component.AbstractComponentSMO; |
| | | import com.java110.utils.constant.PrivilegeCodeConstant; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.inspectionRoute.IDeleteInspectionRouteSMO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | /** |
| | | * 添加小区服务实现类 |
| | | * delete by wuxw 2019-06-30 |
| | | */ |
| | | @Service("deleteInspectionRouteSMOImpl") |
| | | public class DeleteInspectionRouteSMOImpl extends AbstractComponentSMO implements IDeleteInspectionRouteSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | |
| | | //Assert.hasKeyAndValue(paramIn, "xxx", "xxx"); |
| | | Assert.hasKeyAndValue(paramIn, "configId", "inspectionRouteId不能为空"); |
| | | |
| | | |
| | | //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_INSPECTIONROUTE); |
| | | |
| | | } |
| | | |
| | | @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/inspectionRoute.deleteInspectionRoute", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> deleteInspectionRoute(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.inspectionRoute.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.component.AbstractComponentSMO; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.inspectionRoute.IEditInspectionRouteSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | /** |
| | | * 添加巡检路线服务实现类 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Service("eidtInspectionRouteSMOImpl") |
| | | public class EditInspectionRouteSMOImpl extends AbstractComponentSMO implements IEditInspectionRouteSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | |
| | | Assert.hasKeyAndValue(paramIn, "configId", "inspectionRouteId不能为空"); |
| | | Assert.hasKeyAndValue(paramIn, "routeName", "必填,请填写路线名称,字数100个以内"); |
| | | Assert.hasKeyAndValue(paramIn, "inspectionName", "必填,请选择巡点名称"); |
| | | Assert.hasKeyAndValue(paramIn, "machineQuantity", "无需填写,系统自动生成"); |
| | | Assert.hasKeyAndValue(paramIn, "checkQuantity", "必填,请输入巡检路线的检查项数量"); |
| | | |
| | | |
| | | //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST__INSPECTIONROUTE); |
| | | |
| | | } |
| | | |
| | | @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/inspectionRoute.updateInspectionRoute", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> updateInspectionRoute(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.inspectionRoute.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.component.AbstractComponentSMO; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.web.smo.inspectionRoute.IListInspectionRoutesSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 查询inspectionRoute服务类 |
| | | */ |
| | | @Service("listInspectionRoutesSMOImpl") |
| | | public class ListInspectionRoutesSMOImpl extends AbstractComponentSMO implements IListInspectionRoutesSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | public ResponseEntity<String> listInspectionRoutes(IPageData pd) throws SMOException { |
| | | return businessProcess(pd); |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | super.validatePageInfo(pd); |
| | | |
| | | //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_INSPECTIONROUTE); |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | Map paramMap = BeanConvertUtil.beanCovertMap(result); |
| | | paramIn.putAll(paramMap); |
| | | |
| | | String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/inspectionRoute.listInspectionRoutes" + mapToUrlParam(paramIn); |
| | | |
| | | |
| | | ResponseEntity<String> responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.staff; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 修改员工密码 |
| | | * Created by Administrator on 2019/4/2. |
| | | */ |
| | | public interface IChangeStaffPwdServiceSMO { |
| | | |
| | | /** |
| | | * 保存员工信息 |
| | | * |
| | | * @param pd |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> change(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.staff; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 重置员工密码 |
| | | * Created by Administrator on 2019/4/2. |
| | | */ |
| | | public interface IResetStaffPwdServiceSMO { |
| | | |
| | | /** |
| | | * 保存员工信息 |
| | | * |
| | | * @param pd |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> reset(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.staff.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.component.AbstractComponentSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.factory.AuthenticationFactory; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.web.smo.staff.IChangeStaffPwdServiceSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 查询carInout服务类 |
| | | */ |
| | | @Service("changeStaffPwdSMOImpl") |
| | | public class ChangeStaffPwdSMOImpl extends AbstractComponentSMO implements IChangeStaffPwdServiceSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | public ResponseEntity<String> change(IPageData pd) throws SMOException { |
| | | return businessProcess(pd); |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | Assert.hasKeyAndValue(paramIn, "communityId", "必填,请填写小区信息"); |
| | | Assert.hasKeyAndValue(paramIn, "oldPwd", "必填,请填写原始密码"); |
| | | Assert.hasKeyAndValue(paramIn, "newPwd", "必填,请填写新密码"); |
| | | |
| | | //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_CARINOUT); |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | Map paramMap = BeanConvertUtil.beanCovertMap(result); |
| | | paramIn.putAll(paramMap); |
| | | |
| | | paramIn.put("oldPwd", AuthenticationFactory.passwdMd5(paramIn.getString("oldPwd"))); |
| | | paramIn.put("newPwd", AuthenticationFactory.passwdMd5(paramIn.getString("newPwd"))); |
| | | |
| | | String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/user.changeStaffPwd"; |
| | | |
| | | ResponseEntity<String> responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | apiUrl, |
| | | HttpMethod.POST); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.staff.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.component.AbstractComponentSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.factory.AuthenticationFactory; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.web.smo.staff.IResetStaffPwdServiceSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 查询carInout服务类 |
| | | */ |
| | | @Service("resetStaffPwdSMOImpl") |
| | | public class ResetStaffPwdSMOImpl extends AbstractComponentSMO implements IResetStaffPwdServiceSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | public ResponseEntity<String> reset(IPageData pd) throws SMOException { |
| | | return businessProcess(pd); |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | Assert.hasKeyAndValue(paramIn, "communityId", "必填,请填写小区信息"); |
| | | Assert.hasKeyAndValue(paramIn, "userId", "必填,请填写用户ID"); |
| | | |
| | | //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_CARINOUT); |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | |
| | | super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/user.resetStaffPwd"; |
| | | |
| | | ResponseEntity<String> responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | apiUrl, |
| | | HttpMethod.POST); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| | |
| | | <option value="6">6个月</option> |
| | | <option value="12">一年</option> |
| | | <option value="24">两年</option> |
| | | <option value="-101">自定义</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | }); |
| | | }, |
| | | _changeMonth:function(_cycles){ |
| | | vc.component.payFeeOrderInfo.totalFeePrice = parseFloat(_cycles)*parseFloat(vc.component.payFeeOrderInfo.feePrice); |
| | | if('-101' == _cycles){ |
| | | vc.component.payFeeOrderInfo.totalFeePrice = 0.00; |
| | | vc.component.payFeeOrderInfo.receivedAmount = ''; |
| | | return ; |
| | | } |
| | | vc.component.payFeeOrderInfo.totalFeePrice = Math.floor(parseFloat(_cycles)*parseFloat(vc.component.payFeeOrderInfo.feePrice)*100)/100; |
| | | vc.component.payFeeOrderInfo.receivedAmount = vc.component.payFeeOrderInfo.totalFeePrice ; |
| | | }, |
| | | _back:function(){ |
| New file |
| | |
| | | <div id = "addInspectionRouteModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" > |
| | | <div class="modal-dialog modal-lg"> |
| | | <div class="modal-content"> |
| | | <div class="modal-body"> |
| | | <h3 class="m-t-none m-b ">添加巡检路线</h3> |
| | | <div class="ibox-content"> |
| | | <div> |
| | | <div> |
| | | <!--<div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">楼名称</label> |
| | | <div class="col-sm-10"><input v-model="addFloorInfo.name" 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="addFloorInfo.floorNum" type="email" 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="addFloorInfo.remark" type="tel" 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="addInspectionRouteInfo.routeName" 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="addInspectionRouteInfo.inspectionName"> |
| | | <option selected disabled value="">必填,请选择巡检点</option> |
| | | <option value="1000">巡点1</option> |
| | | <option value="1001">巡点2</option> |
| | | <option value="1002">巡点3</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="addInspectionRouteInfo.machineQuantity" 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="addInspectionRouteInfo.checkQuantity" 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="addInspectionRouteInfo.remark" type="text" placeholder="选填,请填写备注" class="form-control"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="ibox-content"> |
| | | <button class="btn btn-primary float-right" type="button" v-on:click="saveInspectionRouteInfo()" ><i class="fa fa-check"></i> 保存</button> |
| | | <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">取消</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc){ |
| | | |
| | | vc.extends({ |
| | | propTypes: { |
| | | callBackListener:vc.propTypes.string, //父组件名称 |
| | | callBackFunction:vc.propTypes.string //父组件监听方法 |
| | | }, |
| | | data:{ |
| | | addInspectionRouteInfo:{ |
| | | configId:'', |
| | | routeName:'', |
| | | inspectionName:'', |
| | | machineQuantity:'', |
| | | checkQuantity:'', |
| | | remark:'', |
| | | |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('addInspectionRoute','openAddInspectionRouteModal',function(){ |
| | | $('#addInspectionRouteModel').modal('show'); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | addInspectionRouteValidate(){ |
| | | return vc.validate.validate({ |
| | | addInspectionRouteInfo:vc.component.addInspectionRouteInfo |
| | | },{ |
| | | 'addInspectionRouteInfo.routeName':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"路线名称不能为空" |
| | | }, |
| | | { |
| | | limit:"maxin", |
| | | param:"1,100", |
| | | errInfo:"路线名称字数不能超过100个" |
| | | }, |
| | | ], |
| | | 'addInspectionRouteInfo.inspectionName':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"巡检点不能为空" |
| | | }, |
| | | { |
| | | limit:"maxLength", |
| | | param:"3000", |
| | | errInfo:"1个巡检路线的巡检点上限为100个" |
| | | }, |
| | | ], |
| | | 'addInspectionRouteInfo.machineQuantity':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"设备数量不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"数量(数字)格式错误" |
| | | }, |
| | | ], |
| | | 'addInspectionRouteInfo.checkQuantity':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"检查项数量不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"数量(数字)格式错误" |
| | | }, |
| | | ], |
| | | 'addInspectionRouteInfo.remark':[ |
| | | { |
| | | limit:"maxin", |
| | | param:"1,200", |
| | | errInfo:"收费项目不能超过100位" |
| | | }, |
| | | ], |
| | | |
| | | |
| | | |
| | | |
| | | }); |
| | | }, |
| | | saveInspectionRouteInfo:function(){ |
| | | if(!vc.component.addInspectionRouteValidate()){ |
| | | vc.toast(vc.validate.errInfo); |
| | | |
| | | return ; |
| | | } |
| | | |
| | | vc.component.addInspectionRouteInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | //不提交数据将数据 回调给侦听处理 |
| | | if(vc.notNull($props.callBackListener)){ |
| | | vc.emit($props.callBackListener,$props.callBackFunction,vc.component.addInspectionRouteInfo); |
| | | $('#addInspectionRouteModel').modal('hide'); |
| | | return ; |
| | | } |
| | | |
| | | vc.http.post( |
| | | 'addInspectionRoute', |
| | | 'save', |
| | | JSON.stringify(vc.component.addInspectionRouteInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | $('#addInspectionRouteModel').modal('hide'); |
| | | vc.component.clearAddInspectionRouteInfo(); |
| | | vc.emit('inspectionRouteManage','listInspectionRoute',{}); |
| | | |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | |
| | | }); |
| | | }, |
| | | clearAddInspectionRouteInfo:function(){ |
| | | vc.component.addInspectionRouteInfo = { |
| | | routeName:'', |
| | | inspectionName:'', |
| | | machineQuantity:'', |
| | | checkQuantity:'', |
| | | remark:'', |
| | | |
| | | }; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc); |
| New file |
| | |
| | | <div id = "chooseInspectionRouteModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="chooseInspectionRouteModelLabel" aria-hidden="true" > |
| | | <div class="modal-dialog modal-lg"> |
| | | <div class="modal-content"> |
| | | <div class="modal-header"> |
| | | <h3 class="modal-title" id="chooseInspectionRouteModelLabel">选择巡检路线</h3> |
| | | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| | | <span aria-hidden="true">×</span> |
| | | </button> |
| | | </div> |
| | | <div class="modal-body"> |
| | | <div class=" row"> |
| | | <div class="col-lg-12"> |
| | | <div class="ibox "> |
| | | <div class="row"> |
| | | |
| | | <div class="col-sm-7 m-b-xs"> |
| | | </div> |
| | | <div class="col-sm-5"> |
| | | <div class="input-group"> |
| | | <input placeholder="输入巡检路线名称" type="text" v-model="chooseInspectionRouteInfo._currentInspectionRouteName" class="form-control form-control-sm"> |
| | | <span class="input-group-append"> |
| | | <button type="button" class="btn btn-sm btn-primary" v-on:click="queryInspectionRoutes()">查询</button> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="table-responsive" style="margin-top:15px"> |
| | | <table class="table table-striped"> |
| | | <thead> |
| | | <tr> |
| | | <th class="text-center">inspectionRouteId</th> |
| | | <th class="text-center">路线名称</th> |
| | | <th class="text-center">巡检点</th> |
| | | <th class="text-center">设备数量</th> |
| | | <th class="text-center">检查项数量</th> |
| | | <th class="text-center">备注</th> |
| | | <th class="text-center">操作</th> |
| | | |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr v-for="inspectionRoute in chooseInspectionRouteInfo.inspectionRoutes"> |
| | | <td class="text-center">{{inspectionRoute.configId}}</td> |
| | | <td class="text-center">{{inspectionRoute.routeName}}</td> |
| | | <td class="text-center">{{inspectionRoute.inspectionName}}</td> |
| | | <td class="text-center">{{inspectionRoute.machineQuantity}}</td> |
| | | <td class="text-center">{{inspectionRoute.checkQuantity}}</td> |
| | | <td class="text-center">{{inspectionRoute.remark}}</td> |
| | | |
| | | <td> |
| | | <button class="btn btn-primary btn-xs" v-on:click="chooseInspectionRoute(inspectionRoute)">选择</button> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc){ |
| | | vc.extends({ |
| | | propTypes: { |
| | | emitChooseInspectionRoute:vc.propTypes.string, |
| | | emitLoadData:vc.propTypes.string |
| | | }, |
| | | data:{ |
| | | chooseInspectionRouteInfo:{ |
| | | inspectionRoutes:[], |
| | | _currentInspectionRouteName:'', |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('chooseInspectionRoute','openChooseInspectionRouteModel',function(_param){ |
| | | $('#chooseInspectionRouteModel').modal('show'); |
| | | vc.component._refreshChooseInspectionRouteInfo(); |
| | | vc.component._loadAllInspectionRouteInfo(1,10,''); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | _loadAllInspectionRouteInfo:function(_page,_row,_name){ |
| | | var param = { |
| | | params:{ |
| | | page:_page, |
| | | row:_row, |
| | | communityId:vc.getCurrentCommunity().communityId, |
| | | name:_name |
| | | } |
| | | }; |
| | | |
| | | //发送get请求 |
| | | vc.http.get('chooseInspectionRoute', |
| | | 'list', |
| | | param, |
| | | function(json){ |
| | | var _inspectionRouteInfo = JSON.parse(json); |
| | | vc.component.chooseInspectionRouteInfo.inspectionRoutes = _inspectionRouteInfo.inspectionRoutes; |
| | | },function(){ |
| | | console.log('请求失败处理'); |
| | | } |
| | | ); |
| | | }, |
| | | chooseInspectionRoute:function(_inspectionRoute){ |
| | | if(_inspectionRoute.hasOwnProperty('name')){ |
| | | _inspectionRoute.inspectionRouteName = _inspectionRoute.name; |
| | | } |
| | | vc.emit($props.emitChooseInspectionRoute,'chooseInspectionRoute',_inspectionRoute); |
| | | vc.emit($props.emitLoadData,'listInspectionRouteData',{ |
| | | inspectionRouteId:_inspectionRoute.inspectionRouteId |
| | | }); |
| | | $('#chooseInspectionRouteModel').modal('hide'); |
| | | }, |
| | | queryInspectionRoutes:function(){ |
| | | vc.component._loadAllInspectionRouteInfo(1,10,vc.component.chooseInspectionRouteInfo._currentInspectionRouteName); |
| | | }, |
| | | _refreshChooseInspectionRouteInfo:function(){ |
| | | vc.component.chooseInspectionRouteInfo._currentInspectionRouteName = ""; |
| | | } |
| | | } |
| | | |
| | | }); |
| | | })(window.vc); |
| New file |
| | |
| | | <div class="modal fade" id="deleteInspectionRouteModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> |
| | | <div class="modal-dialog" role="document"> |
| | | <div class="modal-content"> |
| | | <div class="modal-header"> |
| | | <h5 class="modal-title" id="exampleModalLabel">请确认您的操作!</h5> |
| | | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| | | <span aria-hidden="true">×</span> |
| | | </button> |
| | | </div> |
| | | <div class="modal-body"> |
| | | <tr align="center"><th>确定删除巡检路线</th></tr> |
| | | </div> |
| | | <div class="modal-footer"> |
| | | <button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeDeleteInspectionRouteModel()">点错了</button> |
| | | <button type="button" class="btn btn-primary" v-on:click="deleteInspectionRoute()">确认删除</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc,vm){ |
| | | |
| | | vc.extends({ |
| | | data:{ |
| | | deleteInspectionRouteInfo:{ |
| | | |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('deleteInspectionRoute','openDeleteInspectionRouteModal',function(_params){ |
| | | |
| | | vc.component.deleteInspectionRouteInfo = _params; |
| | | $('#deleteInspectionRouteModel').modal('show'); |
| | | |
| | | }); |
| | | }, |
| | | methods:{ |
| | | deleteInspectionRoute:function(){ |
| | | vc.component.deleteInspectionRouteInfo.communityId=vc.getCurrentCommunity().communityId; |
| | | vc.http.post( |
| | | 'deleteInspectionRoute', |
| | | 'delete', |
| | | JSON.stringify(vc.component.deleteInspectionRouteInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | $('#deleteInspectionRouteModel').modal('hide'); |
| | | vc.emit('inspectionRouteManage','listInspectionRoute',{}); |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | vc.message(json); |
| | | |
| | | }); |
| | | }, |
| | | closeDeleteInspectionRouteModel:function(){ |
| | | $('#deleteInspectionRouteModel').modal('hide'); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc,window.vc.component); |
| New file |
| | |
| | | <div id = "editInspectionRouteModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" > |
| | | <div class="modal-dialog modal-lg"> |
| | | <div class="modal-content"> |
| | | <div class="modal-body"> |
| | | <h3 class="m-t-none m-b ">修改巡检路线</h3> |
| | | <div class="ibox-content"> |
| | | <div> |
| | | <div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">路线名称</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editInspectionRouteInfo.routeName" 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="editInspectionRouteInfo.inspectionName"> |
| | | <option selected disabled value="">必填,请选择巡检点</option> |
| | | <option value="1000">巡点1</option> |
| | | <option value="1001">巡点2</option> |
| | | <option value="1002">巡点3</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="editInspectionRouteInfo.machineQuantity" 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="editInspectionRouteInfo.checkQuantity" 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="editInspectionRouteInfo.remark" type="text" placeholder="选填,请填写备注" class="form-control"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="ibox-content"> |
| | | <button class="btn btn-primary float-right" type="button" v-on:click="editInspectionRoute()" ><i class="fa fa-check"></i> 保存</button> |
| | | <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">取消</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc,vm){ |
| | | |
| | | vc.extends({ |
| | | data:{ |
| | | editInspectionRouteInfo:{ |
| | | configId:'', |
| | | routeName:'', |
| | | inspectionName:'', |
| | | machineQuantity:'', |
| | | checkQuantity:'', |
| | | remark:'', |
| | | |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('editInspectionRoute','openEditInspectionRouteModal',function(_params){ |
| | | vc.component.refreshEditInspectionRouteInfo(); |
| | | $('#editInspectionRouteModel').modal('show'); |
| | | vc.copyObject(_params, vc.component.editInspectionRouteInfo ); |
| | | vc.component.editInspectionRouteInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | }); |
| | | }, |
| | | methods:{ |
| | | editInspectionRouteValidate:function(){ |
| | | return vc.validate.validate({ |
| | | editInspectionRouteInfo:vc.component.editInspectionRouteInfo |
| | | },{ |
| | | 'editInspectionRouteInfo.routeName':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"路线名称不能为空" |
| | | }, |
| | | { |
| | | limit:"maxin", |
| | | param:"1,100", |
| | | errInfo:"路线名称字数不能超过100个" |
| | | }, |
| | | ], |
| | | 'editInspectionRouteInfo.inspectionName':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"巡检点不能为空" |
| | | }, |
| | | { |
| | | limit:"maxLength", |
| | | param:"3000", |
| | | errInfo:"1个巡检路线的巡检点上限为100个" |
| | | }, |
| | | ], |
| | | 'editInspectionRouteInfo.machineQuantity':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"设备数量不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"数量(数字)格式错误" |
| | | }, |
| | | ], |
| | | 'editInspectionRouteInfo.checkQuantity':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"检查项数量不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"数量(数字)格式错误" |
| | | }, |
| | | ], |
| | | 'editInspectionRouteInfo.remark':[ |
| | | { |
| | | limit:"maxin", |
| | | param:"1,200", |
| | | errInfo:"收费项目不能超过100位" |
| | | }, |
| | | ], |
| | | 'editInspectionRouteInfo.configId':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"inspectionRouteId不能为空" |
| | | }] |
| | | |
| | | }); |
| | | }, |
| | | editInspectionRoute:function(){ |
| | | if(!vc.component.editInspectionRouteValidate()){ |
| | | vc.toast(vc.validate.errInfo); |
| | | return ; |
| | | } |
| | | |
| | | vc.http.post( |
| | | 'editInspectionRoute', |
| | | 'update', |
| | | JSON.stringify(vc.component.editInspectionRouteInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | $('#editInspectionRouteModel').modal('hide'); |
| | | vc.emit('inspectionRouteManage','listInspectionRoute',{}); |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | }); |
| | | }, |
| | | refreshEditInspectionRouteInfo:function(){ |
| | | vc.component.editInspectionRouteInfo= { |
| | | configId:'', |
| | | routeName:'', |
| | | inspectionName:'', |
| | | machineQuantity:'', |
| | | checkQuantity:'', |
| | | remark:'', |
| | | |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc,window.vc.component); |
| New file |
| | |
| | | <div id="component" class="wrapper wrapper-content animated fadeInRight ecommerce"> |
| | | <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="row"> |
| | | <div class="col-sm-4" > |
| | | <div class="form-group"> |
| | | <input type="text" placeholder="请输入路线名称" v-model="inspectionRouteManageInfo.conditions.routeName" class=" form-control"> |
| | | </div> </div><div class="col-sm-4" > |
| | | <div class="form-group"> |
| | | <input type="text" placeholder="请输入巡检点名称" v-model="inspectionRouteManageInfo.conditions.inspectionName" class=" form-control"> |
| | | </div> </div><div class="col-sm-3" > |
| | | <div class="form-group"> |
| | | <input type="text" placeholder="请输入备注" v-model="inspectionRouteManageInfo.conditions.remark" class=" form-control"> |
| | | </div> </div><div class="col-sm-1"> |
| | | <button type="button" class="btn btn-primary btn-sm" v-on:click="_queryInspectionRouteMethod()"> |
| | | <i class="glyphicon glyphicon-search"></i> 查询 |
| | | </button> |
| | | </div></div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-lg-12"> |
| | | <div class="ibox"> |
| | | <div class="ibox-title"> |
| | | <h5>巡检路线信息</h5> |
| | | <div class="ibox-tools" style="top:10px;"> |
| | | <button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddInspectionRouteModal()"> |
| | | <i class="glyphicon glyphicon-plus"></i> |
| | | 添加巡检路线 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | |
| | | <table class="footable table table-stripped toggle-arrow-tiny" |
| | | data-page-size="15" |
| | | > |
| | | <thead> |
| | | <tr> |
| | | <th class="text-center">inspectionRouteId</th> |
| | | <th class="text-center">路线名称</th> |
| | | <th class="text-center">巡检点</th> |
| | | <th class="text-center">设备数量</th> |
| | | <th class="text-center">检查项数量</th> |
| | | <th class="text-center">备注</th> |
| | | <th class="text-center">操作</th> |
| | | |
| | | |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr v-for="inspectionRoute in inspectionRouteManageInfo.inspectionRoutes"> |
| | | <td class="text-center">{{inspectionRoute.configId}}</td> |
| | | <td class="text-center">{{inspectionRoute.routeName}}</td> |
| | | <td class="text-center">{{inspectionRoute.inspectionName}}</td> |
| | | <td class="text-center">{{inspectionRoute.machineQuantity}}</td> |
| | | <td class="text-center">{{inspectionRoute.checkQuantity}}</td> |
| | | <td class="text-center">{{inspectionRoute.remark}}</td> |
| | | <td class="text-center"><div class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="_openEditInspectionRouteModel(inspectionRoute)">修改</button> |
| | | </div> |
| | | <div class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="_openDeleteInspectionRouteModel(inspectionRoute)">删除</button> |
| | | </div></td> |
| | | |
| | | </tr> |
| | | </tbody> |
| | | <tfoot> |
| | | <tr> |
| | | <td colspan="7"> |
| | | <ul class="pagination float-right"></ul> |
| | | </td> |
| | | </tr> |
| | | </tfoot> |
| | | </table> |
| | | <!-- 分页 --> |
| | | <vc:create name="pagination"></vc:create> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <vc:create name="addInspectionRoute" |
| | | callBackListener="" |
| | | callBackFunction="" |
| | | ></vc:create> |
| | | <vc:create name="editInspectionRoute"></vc:create> |
| | | <vc:create name="deleteInspectionRoute"></vc:create> |
| | | |
| | | </div> |
| New file |
| | |
| | | /** |
| | | 入驻小区 |
| | | **/ |
| | | (function(vc){ |
| | | var DEFAULT_PAGE = 1; |
| | | var DEFAULT_ROWS = 10; |
| | | vc.extends({ |
| | | data:{ |
| | | inspectionRouteManageInfo:{ |
| | | inspectionRoutes:[], |
| | | total:0, |
| | | records:1, |
| | | moreCondition:false, |
| | | routeName:'', |
| | | conditions:{ |
| | | routeName:'', |
| | | inspectionName:'', |
| | | remark:'', |
| | | |
| | | } |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | vc.component._listInspectionRoutes(DEFAULT_PAGE, DEFAULT_ROWS); |
| | | }, |
| | | _initEvent:function(){ |
| | | |
| | | vc.on('inspectionRouteManage','listInspectionRoute',function(_param){ |
| | | vc.component._listInspectionRoutes(DEFAULT_PAGE, DEFAULT_ROWS); |
| | | }); |
| | | vc.on('pagination','page_event',function(_currentPage){ |
| | | vc.component._listInspectionRoutes(_currentPage,DEFAULT_ROWS); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | _listInspectionRoutes:function(_page, _rows){ |
| | | |
| | | vc.component.inspectionRouteManageInfo.conditions.page = _page; |
| | | vc.component.inspectionRouteManageInfo.conditions.row = _rows; |
| | | var param = { |
| | | params:vc.component.inspectionRouteManageInfo.conditions |
| | | }; |
| | | |
| | | //发送get请求 |
| | | vc.http.get('inspectionRouteManage', |
| | | 'list', |
| | | param, |
| | | function(json,res){ |
| | | var _inspectionRouteManageInfo=JSON.parse(json); |
| | | vc.component.inspectionRouteManageInfo.total = _inspectionRouteManageInfo.total; |
| | | vc.component.inspectionRouteManageInfo.records = _inspectionRouteManageInfo.records; |
| | | vc.component.inspectionRouteManageInfo.inspectionRoutes = _inspectionRouteManageInfo.inspectionRoutes; |
| | | vc.emit('pagination','init',{ |
| | | total:vc.component.inspectionRouteManageInfo.records, |
| | | currentPage:_page |
| | | }); |
| | | },function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | } |
| | | ); |
| | | }, |
| | | _openAddInspectionRouteModal:function(){ |
| | | vc.emit('addInspectionRoute','openAddInspectionRouteModal',{}); |
| | | }, |
| | | _openEditInspectionRouteModel:function(_inspectionRoute){ |
| | | vc.emit('editInspectionRoute','openEditInspectionRouteModal',_inspectionRoute); |
| | | }, |
| | | _openDeleteInspectionRouteModel:function(_inspectionRoute){ |
| | | vc.emit('deleteInspectionRoute','openDeleteInspectionRouteModal',_inspectionRoute); |
| | | }, |
| | | _queryInspectionRouteMethod:function(){ |
| | | vc.component._listInspectionRoutes(DEFAULT_PAGE, DEFAULT_ROWS); |
| | | |
| | | }, |
| | | _moreCondition:function(){ |
| | | if(vc.component.inspectionRouteManageInfo.moreCondition){ |
| | | vc.component.inspectionRouteManageInfo.moreCondition = false; |
| | | }else{ |
| | | vc.component.inspectionRouteManageInfo.moreCondition = true; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | }); |
| | | })(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;"> |
| | | <button type="button" v-if="viewInspectionRouteInfo.index != 2" class="btn btn-primary btn-sm" style="margin-right:10px;" v-on:click="_openSelectInspectionRouteInfoModel()"> |
| | | <i class="glyphicon glyphicon-search"></i> 选择巡检路线</button> |
| | | |
| | | <button type="button" v-if="viewInspectionRouteInfo.index != 2" class="btn btn-primary btn-sm" v-on:click="_openAddInspectionRouteInfoModel()"> |
| | | <i class="glyphicon glyphicon-plus"></i> 添加巡检路线</button> |
| | | </div> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row"> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label" >路线名称:</label> |
| | | <label class="">{{viewInspectionRouteInfo.routeName}}</label> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label" >巡检点:</label> |
| | | <label class="">{{viewInspectionRouteInfo.inspectionName}}</label> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label" >设备数量:</label> |
| | | <label class="">{{viewInspectionRouteInfo.machineQuantity}}</label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label" >检查项数量:</label> |
| | | <label class="">{{viewInspectionRouteInfo.checkQuantity}}</label> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label" >备注:</label> |
| | | <label class="">{{viewInspectionRouteInfo.remark}}</label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <vc:create name="addInspectionRoute" |
| | | callBackListener="viewInspectionRouteInfo" |
| | | callBackFunction="chooseInspectionRoute" |
| | | ></vc:create> |
| | | |
| | | |
| | | <vc:create name="chooseInspectionRoute" |
| | | emitChooseInspectionRoute="viewInspectionRouteInfo" |
| | | emitLoadData="viewInspectionRouteInfo" |
| | | ></vc:create> |
| | | </div> |
| New file |
| | |
| | | /** |
| | | 巡检路线 组件 |
| | | **/ |
| | | (function(vc){ |
| | | |
| | | vc.extends({ |
| | | propTypes: { |
| | | callBackListener:vc.propTypes.string, //父组件名称 |
| | | callBackFunction:vc.propTypes.string //父组件监听方法 |
| | | }, |
| | | data:{ |
| | | viewInspectionRouteInfo:{ |
| | | index:0, |
| | | flowComponent:'viewInspectionRouteInfo', |
| | | routeName:'', |
| | | inspectionName:'', |
| | | machineQuantity:'', |
| | | checkQuantity:'', |
| | | remark:'', |
| | | |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | //根据请求参数查询 查询 业主信息 |
| | | vc.component._loadInspectionRouteInfoData(); |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('viewInspectionRouteInfo','chooseInspectionRoute',function(_app){ |
| | | vc.copyObject(_app, vc.component.viewInspectionRouteInfo); |
| | | vc.emit($props.callBackListener,$props.callBackFunction,vc.component.viewInspectionRouteInfo); |
| | | }); |
| | | |
| | | vc.on('viewInspectionRouteInfo', 'onIndex', function(_index){ |
| | | vc.component.viewInspectionRouteInfo.index = _index; |
| | | }); |
| | | |
| | | }, |
| | | methods:{ |
| | | |
| | | _openSelectInspectionRouteInfoModel(){ |
| | | vc.emit('chooseInspectionRoute','openChooseInspectionRouteModel',{}); |
| | | }, |
| | | _openAddInspectionRouteInfoModel(){ |
| | | vc.emit('addInspectionRoute','openAddInspectionRouteModal',{}); |
| | | }, |
| | | _loadInspectionRouteInfoData:function(){ |
| | | |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc); |
| | |
| | | <div class="row"> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label">房屋ID:</label> |
| | | <label class="">{{roomInfo.roomId}}</label> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label">房屋编号:</label> |
| | | <label class="">{{roomInfo.roomNum}}</label> |
| | | <label class="col-form-label">楼栋:</label> |
| | | <label class="">{{roomInfo.floorNum}}号楼</label> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label">单元:</label> |
| | | <label class="">{{roomInfo.unitNum}}</label> |
| | | <label class="">{{roomInfo.unitNum}}单元</label> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label">房屋编号:</label> |
| | | <label class="">{{roomInfo.roomNum}}室</label> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label">房屋ID:</label> |
| | | <label class="">{{roomInfo.roomId}}</label> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label">楼层:</label> |
| | |
| | | <label class="">{{roomInfo.section}}</label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label">户型:</label> |
| | | <label class="">{{roomInfo.apartment}}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label">建筑面积:</label> |
| | |
| | | <label class="">{{roomInfo.unitPrice}}元/平方米</label> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-4"> |
| | | <div class="form-group"> |
| | | <label class="col-form-label">创建员工:</label> |
| | |
| | | <div class="footer" id="copyright"> |
| | | <div class="float-right"> |
| | | <strong>{{copyrightInfo.logo}}小区管理系统</strong> |
| | | <strong>HC小区管理系统</strong> |
| | | </div> |
| | | <div> |
| | | <strong>Copyright</strong> |
| | | <span v-if = "copyrightInfo.logo == 'HC'">{{copyrightInfo.company}} © {{copyrightInfo.date}} | {{copyrightInfo.openSource}}</span> |
| | | <span v-else> |
| | | {{copyrightInfo.logo}} 团队 |
| | | <span> |
| | | java110 团队 |
| | | </span> |
| | | </div> |
| | | </div> |
| | |
| | | <div component="login"> |
| | | <div> |
| | | <h1 class="logo-name">{{loginInfo.logo}}</h1> |
| | | <h1 class="logo-name" >HC</h1> |
| | | </div> |
| | | <h3>请登录</h3> |
| | | <p style="color: red;">{{loginInfo.errorInfo}}</p> |
| | |
| | | <li class="nav-header" v-on:click="_gotoIndex()"> |
| | | <div class="dropdown profile-element"> |
| | | <a data-toggle="dropdown" class="dropdown-toggle" href="/"> |
| | | <span class="block m-t-xs font-bold">{{logo}}小区管理系统</span> |
| | | <span class="block m-t-xs font-bold">HC小区管理系统</span> |
| | | </a> |
| | | </div> |
| | | <div class="logo-element"> |
| | | {{logo}} |
| | | HC |
| | | </div> |
| | | </li> |
| | | |
| | |
| | | </form> |
| | | </div> |
| | | <ul class="nav navbar-top-links navbar-right"> |
| | | <li style="padding: 20px" v-if="logo == 'HC'"> |
| | | <span class="m-r-sm text-muted welcome-message"> |
| | | <a target="_blank" href="https://www.bilibili.com/video/av78427253">演示视频</a> |
| | | </span> |
| | | </li> |
| | | <li class="nav-item dropdown"> |
| | | <a class="nav-link dropdown-toggle" |
| | | data-toggle="dropdown" |
| | |
| | | </div> |
| | | </li> |
| | | <li style="padding: 20px"> |
| | | <span class="m-r-sm text-muted welcome-message">欢迎访问{{logo}}小区管理系统,{{userName}}!</span> |
| | | <span class="m-r-sm text-muted welcome-message">欢迎访问HC小区管理系统,{{userName}}!</span> |
| | | </li> |
| | | <li class="dropdown"> |
| | | <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#"> |
| | |
| | | <div component="login"> |
| | | <div> |
| | | <h1 class="logo-name">{{registerInfo.logo}}</h1> |
| | | <h1 class="logo-name" >HC</h1> |
| | | </div> |
| | | <h3>请注册</h3> |
| | | <p style="color: #0e9aef;">{{registerInfo.validateInfo}}</p> |
| New file |
| | |
| | | <div> |
| | | <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> |
| | | <div> |
| | | <div class="form-group row"> |
| | | <div class="col-sm-3"></div> |
| | | <label class="col-sm-2 col-form-label">原始密码</label> |
| | | <div class="col-sm-4"> |
| | | <div class="custom-file"> |
| | | <input v-model="changeStaffPwdInfo.oldPwd" type="password" placeholder="必填,请输入原始密码" |
| | | class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <div class="col-sm-3"></div> |
| | | <label class="col-sm-2 col-form-label">新密码</label> |
| | | <div class="col-sm-4"> |
| | | <div class="custom-file"> |
| | | <input v-model="changeStaffPwdInfo.newPwd" type="password" placeholder="必填,请输入新密码" |
| | | class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <div class="col-sm-3"></div> |
| | | <label class="col-sm-2 col-form-label">确认密码</label> |
| | | <div class="col-sm-4"> |
| | | <div class="custom-file"> |
| | | <input v-model="changeStaffPwdInfo.reNewPwd" type="password" placeholder="必填,请输入确认密码" |
| | | class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </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-primary" |
| | | v-on:click="_changePwd()">确认修改 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | /** |
| | | 权限组 |
| | | **/ |
| | | (function (vc) { |
| | | |
| | | vc.extends({ |
| | | data: { |
| | | changeStaffPwdInfo: { |
| | | communityId: vc.getCurrentCommunity().communityId, |
| | | oldPwd: '', |
| | | newPwd: '', |
| | | reNewPwd:'' |
| | | } |
| | | }, |
| | | |
| | | _initMethod: function () { |
| | | |
| | | }, |
| | | _initEvent: function () { |
| | | |
| | | }, |
| | | methods: { |
| | | assetImportValidate: function () { |
| | | return vc.validate.validate({ |
| | | changeStaffPwdInfo: vc.component.changeStaffPwdInfo |
| | | }, { |
| | | |
| | | 'changeStaffPwdInfo.oldPwd': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "原始密码不能为空" |
| | | } |
| | | ], |
| | | 'changeStaffPwdInfo.newPwd': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "新密码不能为空" |
| | | } |
| | | ], |
| | | 'changeStaffPwdInfo.reNewPwd': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "确认密码不能为空" |
| | | } |
| | | ], |
| | | 'changeStaffPwdInfo.communityId': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "还未入驻小区,请先入驻小区" |
| | | } |
| | | ] |
| | | }); |
| | | }, |
| | | _changePwd: function () { |
| | | |
| | | if (!vc.component.assetImportValidate()) { |
| | | return; |
| | | } |
| | | |
| | | var _userInfo = vc.getData("/nav/getUserInfo"); |
| | | |
| | | if(_userInfo.name == 'wuxw' || _userInfo.name == 'dev' || _userInfo.name == 'dails' || _userInfo.name == 'admin'){ |
| | | vc.toast("演示环境密码,不允许修改"); |
| | | return ; |
| | | } |
| | | |
| | | |
| | | if(vc.component.changeStaffPwdInfo.newPwd != vc.component.changeStaffPwdInfo.reNewPwd){ |
| | | vc.toast('两次密码不一致'); |
| | | return ; |
| | | } |
| | | |
| | | vc.http.post( |
| | | 'changeStaffPwd', |
| | | 'change', |
| | | JSON.stringify(vc.component.changeStaffPwdInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | vc.toast("修改成功"); |
| | | vc.component.changeStaffPwdInfo.oldPwd = ''; |
| | | vc.component.changeStaffPwdInfo.newPwd = ''; |
| | | vc.component.changeStaffPwdInfo.reNewPwd = ''; |
| | | return ; |
| | | } |
| | | vc.toast(json); |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | vc.toast(errInfo); |
| | | }); |
| | | |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc); |
| New file |
| | |
| | | <div class="modal fade" id="resetStaffPwdModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> |
| | | <div class="modal-dialog" role="document"> |
| | | <div class="modal-content"> |
| | | <div class="modal-header"> |
| | | <h5 class="modal-title" id="exampleModalLabel">请确认您的操作!</h5> |
| | | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| | | <span aria-hidden="true">×</span> |
| | | </button> |
| | | </div> |
| | | <div class="modal-body"> |
| | | <tr align="center"><th>确认是否重置密码!</th></tr> |
| | | </div> |
| | | <div class="modal-footer"> |
| | | <button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeResetStaffPwdModel()">点错了</button> |
| | | <button type="button" class="btn btn-primary" v-on:click="resetStaffPwd()">确认重置</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc){ |
| | | vc.extends({ |
| | | data:{ |
| | | resetStaffPwdInfo:{} |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('resetStaffPwd','openResetStaffPwd',function(_staffInfo){ |
| | | vc.component.resetStaffPwdInfo = _staffInfo; |
| | | $('#resetStaffPwdModel').modal('show'); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | closeDeleteStaffModel:function(){ |
| | | $('#resetStaffPwdModel').modal('hide'); |
| | | }, |
| | | |
| | | resetStaffPwd:function(){ |
| | | var _dataObj = { |
| | | communityId:vc.getCurrentCommunity().communityId, |
| | | userId:vc.component.resetStaffPwdInfo.userId |
| | | }; |
| | | vc.http.post( |
| | | 'resetStaffPwd', |
| | | 'reset', |
| | | JSON.stringify(_dataObj), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | var _pwd = JSON.parse(json); |
| | | $('#resetStaffPwdModel').modal('hide'); |
| | | vc.toast("修改密码成功,密码为"+_pwd.pwd+"请及时修改密码",10*1000); |
| | | return ; |
| | | } |
| | | vc.component.resetStaffPwdInfo.errorInfo = json; |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.component.resetStaffPwdInfo.errorInfo = errInfo; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | })(window.vc); |
| | |
| | | <div class="form-group"> |
| | | <select class="custom-select" v-model="staffInfo.conditions.departmentOrgId"> |
| | | <option selected value="">必填,请选择部门</option> |
| | | <option v-for="departmentOrg in staffInfo.departmentOrgs" :value="departmentOrg.orgId"> |
| | | <option v-for="departmentOrg in staffInfo.departmentOrgs" |
| | | :value="departmentOrg.orgId"> |
| | | {{departmentOrg.orgName}} |
| | | </option> |
| | | </select> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="table-responsive"> |
| | | <table class="table table-striped table-bordered table-hover dataTables-example"> |
| | | <thead> |
| | | <tr> |
| | | <th>员工ID</th> |
| | | <th>名称</th> |
| | | <th>部门</th> |
| | | <th>邮箱</th> |
| | | <th>地址</th> |
| | | <th>性别</th> |
| | | <th>手机号</th> |
| | | <th>操作</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr class="gradeX" v-for="staff in staffData"> |
| | | <td>{{staff.userId}}</td> |
| | | <td>{{staff.name}}</td> |
| | | <td>{{staff.orgName}}</td> |
| | | <td>{{staff.email}}</td> |
| | | <td>{{staff.address}}</td> |
| | | <td>{{staff.sex == 0 ? '男' : '女'}}</td> |
| | | <td>{{staff.tel}}</td> |
| | | <table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15"> |
| | | <thead> |
| | | <tr> |
| | | <th>员工ID</th> |
| | | <th>名称</th> |
| | | <th>部门</th> |
| | | <th>邮箱</th> |
| | | <th>地址</th> |
| | | <th>性别</th> |
| | | <th>手机号</th> |
| | | <th class="text-right">操作</th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr class="gradeX" v-for="staff in staffData"> |
| | | <td>{{staff.userId}}</td> |
| | | <td>{{staff.name}}</td> |
| | | <td>{{staff.orgName}}</td> |
| | | <td>{{staff.email}}</td> |
| | | <td>{{staff.address}}</td> |
| | | <td>{{staff.sex == 0 ? '男' : '女'}}</td> |
| | | <td>{{staff.tel}}</td> |
| | | |
| | | <td> |
| | | <i class="glyphicon glyphicon-edit" style="color: #17a2b8;" |
| | | v-on:click="openEditStaff(staff)"></i> |
| | | <i v-if="staff.relCd != 600311000001" class="glyphicon glyphicon-remove-sign" |
| | | style="color: #dc3545;margin-left:5px" |
| | | v-on:click="openDeleteStaff(staff)"></i> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | <!-- 分页 --> |
| | | <vc:create name="pagination"></vc:create> |
| | | </div> |
| | | <td class="text-right"> |
| | | <div class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="openEditStaff(staff)">修改 |
| | | </button> |
| | | </div> |
| | | <div class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="_resetStaffPwd(staff)">重置密码 |
| | | </button> |
| | | </div> |
| | | <div v-if="staff.relCd != 600311000001" class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="openDeleteStaff(staff)">删除 |
| | | </button> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | <!-- 分页 --> |
| | | <vc:create name="pagination"></vc:create> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <vc:create name="resetStaffPwd"></vc:create> |
| | | </div> |
| | |
| | | }, |
| | | _queryStaffMethod:function(){ |
| | | vc.component.loadData(DEFAULT_PAGE,DEFAULT_ROWS) |
| | | }, |
| | | _resetStaffPwd:function(_staff){ |
| | | vc.emit('resetStaffPwd','openResetStaffPwd',_staff); |
| | | } |
| | | |
| | | }, |
| 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>修改密码|精诚物业服务有限公司</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> |
| | | <div class="wrapper wrapper-content" style="padding-bottom: 0px;"> |
| | | <vc:create name="breadcrumb"></vc:create> |
| | | </div> |
| | | <!-- id="component" --> |
| | | <div id="component" class="wrapper wrapper-content animated fadeInRight"> |
| | | <vc:create name="changeStaffPwd"></vc:create> |
| | | </div> |
| | | |
| | | <vc:create name="copyright"></vc:create> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <vc:create name="commonBottom"></vc:create> |
| | | </body> |
| | | </html> |
| 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> |
| | | <div class="wrapper wrapper-content" style="padding-bottom: 0px;"> |
| | | <vc:create name="breadcrumb"></vc:create> |
| | | </div> |
| | | <!-- id="component" --> |
| | | <div class="wrapper wrapper-content animated fadeInRight"> |
| | | <vc:create name="inspectionRouteManage"></vc:create> |
| | | </div> |
| | | |
| | | <vc:create name="copyright"></vc:create> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <vc:create name="commonBottom"></vc:create> |
| | | </body> |
| | | </html> |
| New file |
| | |
| | | |
| | | |
| | | **1\. 删除巡检路线** |
| | | ###### 接口功能 |
| | | > API服务做删除巡检路线时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://inspectionRoute-service/inspectionRouteApi/service](http://inspectionRoute-service/inspectionRouteApi/service) |
| | | |
| | | ###### 支持格式 |
| | | > JSON |
| | | |
| | | ###### HTTP请求方式 |
| | | > POST |
| | | |
| | | ###### 协议接口 |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-:| |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |-|business|1|Array|-|业务节点|-| |
| | | |
| | | ###### orders |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |orders|appId|1|String|10|系统ID|由中心服务提供| |
| | | |orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列| |
| | | |orders|userId|1|String|30|用户ID|已有用户ID| |
| | | |orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明| |
| | | |orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss| |
| | | |orders|remark|1|String|200|备注|备注| |
| | | |orders|sign|?|String|64|签名|查看加密说明| |
| | | |orders|attrs|?|Array|-|订单属性|-| |
| | | |attrs|specCd|1|String|12|规格编码|由中心服务提供| |
| | | |attrs|value|1|String|50|属性值|-| |
| | | |orders|response|1|Object|-|返回结果节点|-| |
| | | |response|code|1|String|4|返回状态|查看状态说明| |
| | | |response|message|1|String|200|返回状态描述|-| |
| | | |
| | | ###### business |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|business|?|Array|-|业务节点|-| |
| | | |business|businessTypeCd|1|String|12|业务类型编码|500100030002| |
| | | |business|datas|1|Object|-|数据节点|不同的服务下的节点不一样| |
| | | |datas|businessInspectionRouteInfo|1|Object|-|小区成员|小区成员| |
| | | |businessInspectionRouteInfo|inspectionRouteId|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://inspectionRoute-service/inspectionRouteApi/service](http://inspectionRoute-service/inspectionRouteApi/service) |
| | | |
| | | ``` javascript |
| | | 请求头信息: |
| | | Content-Type:application/json |
| | | |
| | | 请求报文: |
| | | |
| | | { |
| | | "orders": { |
| | | "appId": "外系统ID,分配得到", |
| | | "transactionId": "100000000020180409224736000001", |
| | | "userId": "用户ID", |
| | | "orderTypeCd": "订单类型,查询,受理", |
| | | "requestTime": "20180409224736", |
| | | "remark": "备注", |
| | | "sign": "这个服务是否要求MD5签名", |
| | | "businessType":"I", |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | }, |
| | | "business": { |
| | | "businessTypeCd": "500200050001", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessInspectionRouteInfo": { |
| | | "inspectionRouteId":"填写存在的值" |
| | | } |
| | | }, |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | } |
| | | } |
| | | |
| | | 返回报文: |
| | | { |
| | | "orderTypeCd": "D", |
| | | "response": { |
| | | "code": "0000", |
| | | "message": "成功" |
| | | }, |
| | | "responseTime": "20190418102004", |
| | | "bId": "202019041810750003", |
| | | "businessType": "B", |
| | | "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc", |
| | | "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947" |
| | | } |
| | | |
| | | ``` |
| New file |
| | |
| | | |
| | | |
| | | **1\. 保存巡检路线** |
| | | ###### 接口功能 |
| | | > API服务做保存巡检路线时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://inspectionRoute-service/inspectionRouteApi/service](http://inspectionRoute-service/inspectionRouteApi/service) |
| | | |
| | | ###### 支持格式 |
| | | > JSON |
| | | |
| | | ###### HTTP请求方式 |
| | | > POST |
| | | |
| | | ###### 协议接口 |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-:| |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |-|business|1|Array|-|业务节点|-| |
| | | |
| | | ###### orders |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |orders|appId|1|String|10|系统ID|由中心服务提供| |
| | | |orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列| |
| | | |orders|userId|1|String|30|用户ID|已有用户ID| |
| | | |orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明| |
| | | |orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss| |
| | | |orders|remark|1|String|200|备注|备注| |
| | | |orders|sign|?|String|64|签名|查看加密说明| |
| | | |orders|attrs|?|Array|-|订单属性|-| |
| | | |attrs|specCd|1|String|12|规格编码|由中心服务提供| |
| | | |attrs|value|1|String|50|属性值|-| |
| | | |orders|response|1|Object|-|返回结果节点|-| |
| | | |response|code|1|String|4|返回状态|查看状态说明| |
| | | |response|message|1|String|200|返回状态描述|-| |
| | | |
| | | ###### business |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|business|?|Array|-|业务节点|-| |
| | | |business|businessTypeCd|1|String|12|业务类型编码|500100030002| |
| | | |business|datas|1|Object|-|数据节点|不同的服务下的节点不一样| |
| | | |datas|businessInspectionRouteInfo|1|Object|-|小区成员|小区成员| |
| | | |businessInspectionRouteInfo|inspectionRouteId|1|String|30|-|-| |
| | | |businessInspectionRouteInfo|checkQuantity|1|String|30|-|-| |
| | | |businessInspectionRouteInfo|machineQuantity|1|String|30|-|-| |
| | | |businessInspectionRouteInfo|remark|1|String|30|-|-| |
| | | |businessInspectionRouteInfo|communityId|1|String|30|-|-| |
| | | |businessInspectionRouteInfo|routeName|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://inspectionRoute-service/inspectionRouteApi/service](http://inspectionRoute-service/inspectionRouteApi/service) |
| | | |
| | | ``` javascript |
| | | 请求头信息: |
| | | Content-Type:application/json |
| | | |
| | | 请求报文: |
| | | |
| | | { |
| | | "orders": { |
| | | "appId": "外系统ID,分配得到", |
| | | "transactionId": "100000000020180409224736000001", |
| | | "userId": "用户ID", |
| | | "orderTypeCd": "订单类型,查询,受理", |
| | | "requestTime": "20180409224736", |
| | | "remark": "备注", |
| | | "sign": "这个服务是否要求MD5签名", |
| | | "businessType":"I", |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | }, |
| | | "business": { |
| | | "businessTypeCd": "500200030001", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessInspectionRouteInfo": { |
| | | "inspectionRouteId":"填写具体值", |
| | | "checkQuantity":"填写具体值", |
| | | "machineQuantity":"填写具体值", |
| | | "remark":"填写具体值", |
| | | "communityId":"填写具体值", |
| | | "routeName":"填写具体值" |
| | | } |
| | | }, |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | } |
| | | } |
| | | |
| | | 返回报文: |
| | | { |
| | | "orderTypeCd": "D", |
| | | "response": { |
| | | "code": "0000", |
| | | "message": "成功" |
| | | }, |
| | | "responseTime": "20190418102004", |
| | | "bId": "202019041810750003", |
| | | "businessType": "B", |
| | | "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc", |
| | | "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947" |
| | | } |
| | | |
| | | ``` |
| New file |
| | |
| | | |
| | | |
| | | **1\. 修改巡检路线** |
| | | ###### 接口功能 |
| | | > API服务做修改巡检路线时调用该接口 |
| | | |
| | | ###### URL |
| | | > [http://inspectionRoute-service/inspectionRouteApi/service](http://inspectionRoute-service/inspectionRouteApi/service) |
| | | |
| | | ###### 支持格式 |
| | | > JSON |
| | | |
| | | ###### HTTP请求方式 |
| | | > POST |
| | | |
| | | ###### 协议接口 |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-:| |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |-|business|1|Array|-|业务节点|-| |
| | | |
| | | ###### orders |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|orders|1|Object|-|订单节点|-| |
| | | |orders|appId|1|String|10|系统ID|由中心服务提供| |
| | | |orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列| |
| | | |orders|userId|1|String|30|用户ID|已有用户ID| |
| | | |orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明| |
| | | |orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss| |
| | | |orders|remark|1|String|200|备注|备注| |
| | | |orders|sign|?|String|64|签名|查看加密说明| |
| | | |orders|attrs|?|Array|-|订单属性|-| |
| | | |attrs|specCd|1|String|12|规格编码|由中心服务提供| |
| | | |attrs|value|1|String|50|属性值|-| |
| | | |orders|response|1|Object|-|返回结果节点|-| |
| | | |response|code|1|String|4|返回状态|查看状态说明| |
| | | |response|message|1|String|200|返回状态描述|-| |
| | | |
| | | ###### business |
| | | |父元素名称|参数名称|约束|类型|长度|描述|取值说明| |
| | | | :-: | :-: | :-: | :-: | :-: | :-: | :-: | |
| | | |-|business|?|Array|-|业务节点|-| |
| | | |business|businessTypeCd|1|String|12|业务类型编码|500100030002| |
| | | |business|datas|1|Object|-|数据节点|不同的服务下的节点不一样| |
| | | |datas|businessInspectionRouteInfo|1|Object|-|小区成员|小区成员| |
| | | |businessInspectionRouteInfo|inspectionRouteId|1|String|30|-|-| |
| | | |businessInspectionRouteInfo|checkQuantity|1|String|30|-|-| |
| | | |businessInspectionRouteInfo|machineQuantity|1|String|30|-|-| |
| | | |businessInspectionRouteInfo|remark|1|String|30|-|-| |
| | | |businessInspectionRouteInfo|communityId|1|String|30|-|-| |
| | | |businessInspectionRouteInfo|routeName|1|String|30|-|-| |
| | | |
| | | |
| | | ###### 返回协议 |
| | | |
| | | 当http返回状态不为200 时请求处理失败 body内容为失败的原因 |
| | | |
| | | 当http返回状态为200时请求处理成功,body内容为返回内容, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ###### 举例 |
| | | > 地址:[http://inspectionRoute-service/inspectionRouteApi/service](http://inspectionRoute-service/inspectionRouteApi/service) |
| | | |
| | | ``` javascript |
| | | 请求头信息: |
| | | Content-Type:application/json |
| | | |
| | | 请求报文: |
| | | |
| | | { |
| | | "orders": { |
| | | "appId": "外系统ID,分配得到", |
| | | "transactionId": "100000000020180409224736000001", |
| | | "userId": "用户ID", |
| | | "orderTypeCd": "订单类型,查询,受理", |
| | | "requestTime": "20180409224736", |
| | | "remark": "备注", |
| | | "sign": "这个服务是否要求MD5签名", |
| | | "businessType":"I", |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | }, |
| | | "business": { |
| | | "businessTypeCd": "500200040001", |
| | | "bId":"1234567892", |
| | | "remark": "备注", |
| | | "datas": { |
| | | "businessInspectionRouteInfo": { |
| | | "inspectionRouteId":"填写具体值", |
| | | "checkQuantity":"填写具体值", |
| | | "machineQuantity":"填写具体值", |
| | | "remark":"填写具体值", |
| | | "communityId":"填写具体值", |
| | | "routeName":"填写具体值" |
| | | } |
| | | }, |
| | | "attrs": [{ |
| | | "specCd": "配置的字段ID", |
| | | "value": "具体值" |
| | | }] |
| | | } |
| | | } |
| | | |
| | | 返回报文: |
| | | { |
| | | "orderTypeCd": "D", |
| | | "response": { |
| | | "code": "0000", |
| | | "message": "成功" |
| | | }, |
| | | "responseTime": "20190418102004", |
| | | "bId": "202019041810750003", |
| | | "businessType": "B", |
| | | "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc", |
| | | "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947" |
| | | } |
| | | |
| | | ``` |
| New file |
| | |
| | | package com.java110.dto.inspectionRoute; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 巡检路线数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class InspectionRouteDto extends PageDto implements Serializable { |
| | | |
| | | private String inspectionRouteId; |
| | | private String checkQuantity; |
| | | private String machineQuantity; |
| | | private String remark; |
| | | private String communityId; |
| | | private String routeName; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getInspectionRouteId() { |
| | | return inspectionRouteId; |
| | | } |
| | | |
| | | public void setInspectionRouteId(String inspectionRouteId) { |
| | | this.inspectionRouteId = inspectionRouteId; |
| | | } |
| | | |
| | | public String getCheckQuantity() { |
| | | return checkQuantity; |
| | | } |
| | | |
| | | public void setCheckQuantity(String checkQuantity) { |
| | | this.checkQuantity = checkQuantity; |
| | | } |
| | | |
| | | public String getMachineQuantity() { |
| | | return machineQuantity; |
| | | } |
| | | |
| | | public void setMachineQuantity(String machineQuantity) { |
| | | this.machineQuantity = machineQuantity; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public String getCommunityId() { |
| | | return communityId; |
| | | } |
| | | |
| | | public void setCommunityId(String communityId) { |
| | | this.communityId = communityId; |
| | | } |
| | | |
| | | public String getRouteName() { |
| | | return routeName; |
| | | } |
| | | |
| | | public void setRouteName(String routeName) { |
| | | this.routeName = routeName; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| | |
| | | private String staffName; |
| | | |
| | | private String openId; |
| | | private String statusCd; |
| | | |
| | | private List<UserAttrDto> userAttrs; |
| | | |
| | |
| | | public void setUserAttrs(List<UserAttrDto> userAttrs) { |
| | | this.userAttrs = userAttrs; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| | |
| | | |
| | | private String tel; |
| | | |
| | | private String idCard; |
| | | |
| | | public String getOwnerNum() { |
| | | return ownerNum; |
| | | } |
| | |
| | | public void setOwnerId(String ownerId) { |
| | | this.ownerId = ownerId; |
| | | } |
| | | |
| | | public String getIdCard() { |
| | | return idCard; |
| | | } |
| | | |
| | | public void setIdCard(String idCard) { |
| | | this.idCard = idCard; |
| | | } |
| | | } |
| | |
| | | */ |
| | | public class ImportParkingSpace { |
| | | |
| | | private String paNum; |
| | | |
| | | private String psNum; |
| | | |
| | | private String typeCd; |
| | |
| | | public void setSellOrHire(String sellOrHire) { |
| | | this.sellOrHire = sellOrHire; |
| | | } |
| | | |
| | | public String getPaNum() { |
| | | return paNum; |
| | | } |
| | | |
| | | public void setPaNum(String paNum) { |
| | | this.paNum = paNum; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.inspectionRoute; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class ApiInspectionRouteDataVo implements Serializable { |
| | | |
| | | private String configId; |
| | | private String routeName; |
| | | private String inspectionName; |
| | | private String machineQuantity; |
| | | private String checkQuantity; |
| | | private String remark; |
| | | public String getConfigId() { |
| | | return configId; |
| | | } |
| | | public void setConfigId(String configId) { |
| | | this.configId = configId; |
| | | } |
| | | public String getRouteName() { |
| | | return routeName; |
| | | } |
| | | public void setRouteName(String routeName) { |
| | | this.routeName = routeName; |
| | | } |
| | | public String getInspectionName() { |
| | | return inspectionName; |
| | | } |
| | | public void setInspectionName(String inspectionName) { |
| | | this.inspectionName = inspectionName; |
| | | } |
| | | public String getMachineQuantity() { |
| | | return machineQuantity; |
| | | } |
| | | public void setMachineQuantity(String machineQuantity) { |
| | | this.machineQuantity = machineQuantity; |
| | | } |
| | | public String getCheckQuantity() { |
| | | return checkQuantity; |
| | | } |
| | | public void setCheckQuantity(String checkQuantity) { |
| | | this.checkQuantity = checkQuantity; |
| | | } |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.inspectionRoute; |
| | | |
| | | import com.java110.vo.MorePageVo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class ApiInspectionRouteVo extends MorePageVo implements Serializable { |
| | | List<ApiInspectionRouteDataVo> inspectionRoutes; |
| | | |
| | | |
| | | public List<ApiInspectionRouteDataVo> getInspectionRoutes() { |
| | | return inspectionRoutes; |
| | | } |
| | | |
| | | public void setInspectionRoutes(List<ApiInspectionRouteDataVo> inspectionRoutes) { |
| | | this.inspectionRoutes = inspectionRoutes; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110; |
| | | |
| | | |
| | | import com.java110.code.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 巡检路线代码生成器 |
| | | */ |
| | | public class InspectionRouteGeneratorApplication { |
| | | |
| | | protected InspectionRouteGeneratorApplication() { |
| | | // prevents calls from subclass |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | /** |
| | | * 代码生成器 入口方法 |
| | | * 此处生成的mapper文件包含过程表和实例表的sql,所以要求两张表的特殊字段也要写上 |
| | | * BusinessTypeCd |
| | | * @param args 参数 |
| | | */ |
| | | public static void main(String[] args) { |
| | | Data data = new Data(); |
| | | data.setId("inspectionRouteId"); |
| | | data.setName("inspectionRoute"); |
| | | data.setDesc("巡检路线"); |
| | | data.setShareParam("communityId"); |
| | | data.setShareColumn("community_id"); |
| | | data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_INSPECTION_ROUTE"); |
| | | data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_INSPECTION_ROUTE"); |
| | | data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_INSPECTION_ROUTE"); |
| | | data.setNewBusinessTypeCdValue("500200030001"); |
| | | data.setUpdateBusinessTypeCdValue("500200040001"); |
| | | data.setDeleteBusinessTypeCdValue("500200050001"); |
| | | data.setBusinessTableName("business_inspection_route"); |
| | | data.setTableName("inspection_route"); |
| | | Map<String, String> param = new HashMap<String, String>(); |
| | | param.put("inspectionRouteId", "inspection_routeId"); //map的key为你自定义的字段名就是驼峰命名法的那个,value为数据库表的字段名 |
| | | param.put("routeName", "Route_name"); |
| | | param.put("machineQuantity", "machine_quantity"); |
| | | param.put("checkQuantity", "check_quantity"); |
| | | param.put("communityId", "community_id"); |
| | | param.put("remark", "remark"); |
| | | param.put("statusCd", "status_cd"); |
| | | param.put("operate", "operate"); |
| | | param.put("bId", "b_id"); |
| | | data.setParams(param); |
| | | GeneratorSaveInfoListener generatorSaveInfoListener = new GeneratorSaveInfoListener(); |
| | | generatorSaveInfoListener.generator(data); |
| | | |
| | | GeneratorAbstractBussiness generatorAbstractBussiness = new GeneratorAbstractBussiness(); |
| | | generatorAbstractBussiness.generator(data); |
| | | |
| | | GeneratorIServiceDaoListener generatorIServiceDaoListener = new GeneratorIServiceDaoListener(); |
| | | generatorIServiceDaoListener.generator(data); |
| | | |
| | | GeneratorServiceDaoImplListener generatorServiceDaoImplListener = new GeneratorServiceDaoImplListener(); |
| | | generatorServiceDaoImplListener.generator(data); |
| | | |
| | | GeneratorServiceDaoImplMapperListener generatorServiceDaoImplMapperListener = null; |
| | | generatorServiceDaoImplMapperListener = new GeneratorServiceDaoImplMapperListener(); |
| | | generatorServiceDaoImplMapperListener.generator(data); |
| | | |
| | | GeneratorUpdateInfoListener generatorUpdateInfoListener = new GeneratorUpdateInfoListener(); |
| | | generatorUpdateInfoListener.generator(data); |
| | | |
| | | GeneratorDeleteInfoListener generatorDeleteInfoListener = new GeneratorDeleteInfoListener(); |
| | | generatorDeleteInfoListener.generator(data); |
| | | |
| | | GeneratorInnerServiceSMOImpl generatorInnerServiceSMOImpl = new GeneratorInnerServiceSMOImpl(); |
| | | generatorInnerServiceSMOImpl.generator(data); |
| | | |
| | | GeneratorDtoBean generatorDtoBean = new GeneratorDtoBean(); |
| | | generatorDtoBean.generator(data); |
| | | |
| | | GeneratorIInnerServiceSMO generatorIInnerServiceSMO = new GeneratorIInnerServiceSMO(); |
| | | generatorIInnerServiceSMO.generator(data); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110; |
| | | |
| | | |
| | | import com.java110.code.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 巡检路线设备关系维护代码生成器 |
| | | */ |
| | | public class InspectionRoutePointRelGeneratorApplication { |
| | | |
| | | protected InspectionRoutePointRelGeneratorApplication() { |
| | | // prevents calls from subclass |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | /** |
| | | * 代码生成器 入口方法 |
| | | * 此处生成的mapper文件包含过程表和实例表的sql,所以要求两张表的特殊字段也要写上 |
| | | * BusinessTypeCd |
| | | * @param args 参数 |
| | | */ |
| | | public static void main(String[] args) { |
| | | Data data = new Data(); |
| | | data.setId("irmRelId"); |
| | | data.setName("inspection_route_point_rel"); |
| | | data.setDesc("巡检路线巡检点关系维护"); |
| | | data.setShareParam("communityId"); |
| | | data.setShareColumn("community_id"); |
| | | data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_INSPECTION_ROUTE_MACHINE_REL"); |
| | | data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_INSPECTION_ROUTE_MACHINE_REL"); |
| | | data.setNewBusinessTypeCdValue("500200030002"); |
| | | data.setDeleteBusinessTypeCdValue("500200050002"); |
| | | data.setBusinessTableName("business_inspection_route_machine_rel"); |
| | | data.setTableName("inspection_route_machine_rel"); |
| | | Map<String, String> param = new HashMap<String, String>(); |
| | | param.put("irmRelId", "irm_relId"); //map的key为你自定义的字段名就是驼峰命名法的那个,value为数据库表的字段名 |
| | | param.put("inspectionRouteId", "inspection_routeId"); |
| | | param.put("inspectionId", "inspection_id"); |
| | | param.put("communityId", "community_id"); |
| | | param.put("remark", "remark"); |
| | | param.put("statusCd", "status_cd"); |
| | | param.put("operate", "operate"); |
| | | param.put("bId", "b_id"); |
| | | data.setParams(param); |
| | | GeneratorSaveInfoListener generatorSaveInfoListener = new GeneratorSaveInfoListener(); |
| | | generatorSaveInfoListener.generator(data); |
| | | |
| | | GeneratorAbstractBussiness generatorAbstractBussiness = new GeneratorAbstractBussiness(); |
| | | generatorAbstractBussiness.generator(data); |
| | | |
| | | GeneratorIServiceDaoListener generatorIServiceDaoListener = new GeneratorIServiceDaoListener(); |
| | | generatorIServiceDaoListener.generator(data); |
| | | |
| | | GeneratorServiceDaoImplListener generatorServiceDaoImplListener = new GeneratorServiceDaoImplListener(); |
| | | generatorServiceDaoImplListener.generator(data); |
| | | |
| | | GeneratorServiceDaoImplMapperListener generatorServiceDaoImplMapperListener = null; |
| | | generatorServiceDaoImplMapperListener = new GeneratorServiceDaoImplMapperListener(); |
| | | generatorServiceDaoImplMapperListener.generator(data); |
| | | |
| | | GeneratorUpdateInfoListener generatorUpdateInfoListener = new GeneratorUpdateInfoListener(); |
| | | generatorUpdateInfoListener.generator(data); |
| | | |
| | | GeneratorDeleteInfoListener generatorDeleteInfoListener = new GeneratorDeleteInfoListener(); |
| | | generatorDeleteInfoListener.generator(data); |
| | | |
| | | GeneratorInnerServiceSMOImpl generatorInnerServiceSMOImpl = new GeneratorInnerServiceSMOImpl(); |
| | | generatorInnerServiceSMOImpl.generator(data); |
| | | |
| | | GeneratorDtoBean generatorDtoBean = new GeneratorDtoBean(); |
| | | generatorDtoBean.generator(data); |
| | | |
| | | GeneratorIInnerServiceSMO generatorIInnerServiceSMO = new GeneratorIInnerServiceSMO(); |
| | | generatorIInnerServiceSMO.generator(data); |
| | | } |
| | | } |
| | |
| | | try { |
| | | responseEntity = restTemplate.exchange(url, httpMethod, httpEntity, String.class); |
| | | } catch (HttpStatusCodeException e) { //这里spring 框架 在4XX 或 5XX 时抛出 HttpServerErrorException 异常,需要重新封装一下 |
| | | responseEntity = new ResponseEntity<String>("请求下游系统异常," + e.getResponseBodyAsString(), e.getStatusCode()); |
| | | responseEntity = new ResponseEntity<String>( e.getResponseBodyAsString(), e.getStatusCode()); |
| | | } catch (Exception e) { |
| | | responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR); |
| | | } finally { |
| | |
| | | public static final String CODE_PREFIX_bwId = "11"; |
| | | public static final String CODE_PREFIX_inoutId = "12"; |
| | | public static final String CODE_PREFIX_inspectionId = "13"; |
| | | public static final String CODE_PREFIX_inspectionRouteId = "50"; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 获取随机数 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getRandomCode(int bit) { |
| | | Random random = new Random(); |
| | | String result = ""; |
| | | for (int i = 0; i < bit; i++) { |
| | | result += random.nextInt(10); |
| | | } |
| | | return result; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.core.smo.inspectionRoute; |
| | | |
| | | import com.java110.core.feign.FeignConfiguration; |
| | | import com.java110.dto.inspectionRoute.InspectionRouteDto; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName IInspectionRouteInnerServiceSMO |
| | | * @Description 巡检路线接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "community-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/inspectionRouteApi") |
| | | public interface IInspectionRouteInnerServiceSMO { |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param inspectionRouteDto 数据对象分享 |
| | | * @return InspectionRouteDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryInspectionRoutes", method = RequestMethod.POST) |
| | | List<InspectionRouteDto> queryInspectionRoutes(@RequestBody InspectionRouteDto inspectionRouteDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param inspectionRouteDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryInspectionRoutesCount", method = RequestMethod.POST) |
| | | int queryInspectionRoutesCount(@RequestBody InspectionRouteDto inspectionRouteDto); |
| | | } |
| | |
| | | */ |
| | | @RequestMapping(value = "/getUsers", method = RequestMethod.POST) |
| | | List<UserDto> getUsers(@RequestBody UserDto userDto); |
| | | |
| | | @RequestMapping(value = "/getUserHasPwd", method = RequestMethod.POST) |
| | | List<UserDto> getUserHasPwd(@RequestBody UserDto userDto); |
| | | } |
| New file |
| | |
| | | -- 巡检路线表 |
| | | CREATE TABLE inspection_route( |
| | | `inspection_route_id` VARCHAR(30) NOT NULL UNIQUE COMMENT 'Route_ID', |
| | | `b_id` varchar(30) NOT NULL COMMENT '业务Id', |
| | | `route_name` VARCHAR(100) NOT NULL COMMENT '路线名称', |
| | | `machine_quantity` int(11) NOT NULL COMMENT '设备数量', |
| | | `check_quantity` int(11) NOT NULL COMMENT '检查项数量', |
| | | `community_id` varchar(30) NOT NULL COMMENT '小区ID', |
| | | `remark` VARCHAR(200) COMMENT '备注说明', |
| | | `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | `status_cd` VARCHAR(2) NOT NULL COMMENT '数据状态,详细参考t_dict表0在用1失效', |
| | | KEY `idx_inspection_inspection_route_id` (`inspection_route_id`) |
| | | ); |
| | | |
| | | CREATE TABLE `business_inspection_route` ( |
| | | `inspection_route_id` VARCHAR(30) NOT NULL UNIQUE COMMENT 'RouteID', |
| | | `b_id` varchar(30) NOT NULL COMMENT '业务Id', |
| | | `route_name` VARCHAR(100) NOT NULL COMMENT '路线名称', |
| | | `machine_quantity` int(11) NOT NULL COMMENT '设备数量', |
| | | `check_quantity` int(11) NOT NULL COMMENT '检查项数量', |
| | | `community_id` varchar(30) NOT NULL COMMENT '小区ID', |
| | | `remark` VARCHAR(200) COMMENT '备注说明', |
| | | `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | `operate` varchar(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL', |
| | | KEY `idx_b_inspection_inspection_route_id` (`inspection_route_id`) |
| | | ); |
| | | |
| | | -- 巡检路线和巡检点关联关系表 |
| | | CREATE TABLE `inspection_route_point_rel` ( |
| | | `irp_rel_id` VARCHAR(30) NOT NULL UNIQUE COMMENT 'inspection_route and point relation ID', |
| | | `b_id` varchar(30) NOT NULL COMMENT '业务Id', |
| | | `inspection_route_id` VARCHAR(30) NOT NULL COMMENT '路线ID', |
| | | `inspection_id` varchar(30) NOT NULL COMMENT '巡检点ID', |
| | | `community_id` varchar(30) NOT NULL COMMENT '小区ID', |
| | | `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | `status_cd` VARCHAR(2) NOT NULL COMMENT '数据状态,详细参考t_dict表0在用1失效', |
| | | KEY `idx_b_inspection_inspection_route_point_id` (`irp_rel_id`) |
| | | ); |
| | | CREATE TABLE `business_inspection_route_point_rel` ( |
| | | `irp_rel_id` VARCHAR(30) NOT NULL UNIQUE COMMENT 'inspection_route and point relation ID', |
| | | `b_id` varchar(30) NOT NULL COMMENT '业务Id', |
| | | `inspection_route_id` VARCHAR(30) NOT NULL COMMENT '路线ID', |
| | | `inspection_id` varchar(30) NOT NULL COMMENT '巡检点ID', |
| | | `community_id` varchar(30) NOT NULL COMMENT '小区ID', |
| | | `remark` VARCHAR(200) COMMENT '备注说明', |
| | | `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | `operate` varchar(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL', |
| | | KEY `idx_b_inspection_inspection_route_point_id` (`irp_rel_id`) |
| | | ); |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="inspectionRouteServiceDaoImpl"> |
| | | |
| | | <!-- 保存巡检路线信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveBusinessInspectionRouteInfo" parameterType="Map"> |
| | | insert into business_inspection_route( |
| | | operate,inspection_routeId,check_quantity,machine_quantity,remark,community_id,b_id,Route_name |
| | | ) values ( |
| | | #{operate},#{inspectionRouteId},#{checkQuantity},#{machineQuantity},#{remark},#{communityId},#{bId},#{routeName} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询巡检路线信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessInspectionRouteInfo" parameterType="Map" resultType="Map"> |
| | | select t.operate,t.inspection_routeId,t.inspection_routeId inspectionRouteId,t.check_quantity,t.check_quantity checkQuantity,t.machine_quantity,t.machine_quantity machineQuantity,t.remark,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.Route_name,t.Route_name routeName |
| | | from business_inspection_route t |
| | | where 1 =1 |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | | <if test="inspectionRouteId !=null and inspectionRouteId != ''"> |
| | | and t.inspection_routeId= #{inspectionRouteId} |
| | | </if> |
| | | <if test="checkQuantity !=null and checkQuantity != ''"> |
| | | and t.check_quantity= #{checkQuantity} |
| | | </if> |
| | | <if test="machineQuantity !=null and machineQuantity != ''"> |
| | | and t.machine_quantity= #{machineQuantity} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="routeName !=null and routeName != ''"> |
| | | and t.Route_name= #{routeName} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 保存巡检路线信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveInspectionRouteInfoInstance" parameterType="Map"> |
| | | insert into inspection_route( |
| | | inspection_routeId,check_quantity,machine_quantity,remark,status_cd,community_id,b_id,Route_name |
| | | ) select t.inspection_routeId,t.check_quantity,t.machine_quantity,t.remark,'0',t.community_id,t.b_id,t.Route_name from business_inspection_route t where 1=1 |
| | | and t.operate= 'ADD' |
| | | <if test="inspectionRouteId !=null and inspectionRouteId != ''"> |
| | | and t.inspection_routeId= #{inspectionRouteId} |
| | | </if> |
| | | <if test="checkQuantity !=null and checkQuantity != ''"> |
| | | and t.check_quantity= #{checkQuantity} |
| | | </if> |
| | | <if test="machineQuantity !=null and machineQuantity != ''"> |
| | | and t.machine_quantity= #{machineQuantity} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="routeName !=null and routeName != ''"> |
| | | and t.Route_name= #{routeName} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询巡检路线信息 add by wuxw 2018-07-03 --> |
| | | <select id="getInspectionRouteInfo" parameterType="Map" resultType="Map"> |
| | | select t.inspection_routeId,t.inspection_routeId inspectionRouteId,t.check_quantity,t.check_quantity checkQuantity,t.machine_quantity,t.machine_quantity machineQuantity,t.remark,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.Route_name,t.Route_name routeName |
| | | from inspection_route t |
| | | where 1 =1 |
| | | <if test="inspectionRouteId !=null and inspectionRouteId != ''"> |
| | | and t.inspection_routeId= #{inspectionRouteId} |
| | | </if> |
| | | <if test="checkQuantity !=null and checkQuantity != ''"> |
| | | and t.check_quantity= #{checkQuantity} |
| | | </if> |
| | | <if test="machineQuantity !=null and machineQuantity != ''"> |
| | | and t.machine_quantity= #{machineQuantity} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="routeName !=null and routeName != ''"> |
| | | and t.Route_name= #{routeName} |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 修改巡检路线信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateInspectionRouteInfoInstance" parameterType="Map"> |
| | | update inspection_route t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="checkQuantity !=null and checkQuantity != ''"> |
| | | , t.check_quantity= #{checkQuantity} |
| | | </if> |
| | | <if test="machineQuantity !=null and machineQuantity != ''"> |
| | | , t.machine_quantity= #{machineQuantity} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | , t.remark= #{remark} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | , t.community_id= #{communityId} |
| | | </if> |
| | | <if test="routeName !=null and routeName != ''"> |
| | | , t.Route_name= #{routeName} |
| | | </if> |
| | | where 1=1 <if test="inspectionRouteId !=null and inspectionRouteId != ''"> |
| | | and t.inspection_routeId= #{inspectionRouteId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询巡检路线数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryInspectionRoutesCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from inspection_route t |
| | | where 1 =1 |
| | | <if test="inspectionRouteId !=null and inspectionRouteId != ''"> |
| | | and t.inspection_routeId= #{inspectionRouteId} |
| | | </if> |
| | | <if test="checkQuantity !=null and checkQuantity != ''"> |
| | | and t.check_quantity= #{checkQuantity} |
| | | </if> |
| | | <if test="machineQuantity !=null and machineQuantity != ''"> |
| | | and t.machine_quantity= #{machineQuantity} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="bId !=null and bId != ''"> |
| | | and t.b_id= #{bId} |
| | | </if> |
| | | <if test="routeName !=null and routeName != ''"> |
| | | and t.Route_name= #{routeName} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | </select> |
| | | |
| | | <!-- 查询用户密码 --> |
| | | <select id="getUserHasPwd" parameterType="Map" resultType="Map"> |
| | | select u.user_id, u.user_id userId,u.name,u.name userName,u.email,u.address,u.password,u.location_cd,u.location_cd locationCd, |
| | | u.age,u.sex,u.tel,u.level_cd levelCd,u.b_id,u.password |
| | | from u_user u |
| | | <if test="openId != null and openId !=''"> |
| | | ,u_user_attr ua |
| | | </if> |
| | | where 1= 1 |
| | | <if test="openId != null and openId != ''"> |
| | | and u.user_id = ua.user_id |
| | | and ua.spec_cd = '100201911001' |
| | | and ua.value = #{openId} |
| | | and ua.status_cd = '0' |
| | | </if> |
| | | <if test="bId != null and bId !=''"> |
| | | and u.b_id = #{bId} |
| | | </if> |
| | | <if test="userId != null and userId != ''"> |
| | | and u.user_id = #{userId} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and u.status_cd = #{statusCd} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | listener.soDataService(event); |
| | | }catch (Exception e){ |
| | | LoggerEngine.error("发布侦听失败",e); |
| | | throw new RuntimeException("发布侦听失败,"+listener+ event + e); |
| | | throw new RuntimeException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | listener.soService(event); |
| | | }catch (Exception e){ |
| | | LoggerEngine.error("发布侦听失败",e); |
| | | throw new RuntimeException("发布侦听失败,"+listener+ event + e); |
| | | throw new RuntimeException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | multicastEvent(businessTypeCd,targetDataFlowEvent, asyn); |
| | | }catch (Exception e){ |
| | | throw new BusinessException(ResponseConstant.RESULT_CODE_INNER_ERROR,"发布侦听失败,失败原因为:"+e); |
| | | logger.error("发布侦听失败",e); |
| | | throw new BusinessException(ResponseConstant.RESULT_CODE_INNER_ERROR,e.getMessage()); |
| | | } |
| | | |
| | | } |
| | |
| | | listener.soService(event); |
| | | }catch (Exception e){ |
| | | LoggerEngine.error("发布侦听失败",e); |
| | | throw new RuntimeException("发布侦听失败,"+listener+ event + e); |
| | | throw new RuntimeException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | multicastEvent(serviceCode, targetDataFlowEvent, asyn); |
| | | } catch (Exception e) { |
| | | logger.error("发布侦听失败,失败原因为:", e); |
| | | throw new BusinessException(ResponseConstant.RESULT_CODE_INNER_ERROR, "发布侦听失败,失败原因为:" + e.getMessage()); |
| | | throw new BusinessException(ResponseConstant.RESULT_CODE_INNER_ERROR, e.getMessage()); |
| | | } |
| | | |
| | | } |
| | |
| | | listener.soService(event); |
| | | } catch (Exception e) { |
| | | LoggerEngine.error("发布侦听失败", e); |
| | | throw new RuntimeException("发布侦听失败," + listener + event + e); |
| | | throw new RuntimeException(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | */ |
| | | public static final String BUSINESS_TYPE_DELETE_INSPECTION ="300200050001"; |
| | | |
| | | /** |
| | | * 保存巡检路线 |
| | | * 3保存 |
| | | */ |
| | | public static final String BUSINESS_TYPE_SAVE_INSPECTION_ROUTE="500200030001"; |
| | | |
| | | /** |
| | | * 修改巡检路线 |
| | | * 4 修改 |
| | | */ |
| | | public static final String BUSINESS_TYPE_UPDATE_INSPECTION_ROUTE="500200040001"; |
| | | /** |
| | | * 删除巡检路线 |
| | | * 5 删除 |
| | | */ |
| | | public static final String BUSINESS_TYPE_DELETE_INSPECTION_ROUTE ="500200050001"; |
| | | /** |
| | | * 保存巡检路线设备关联关系 |
| | | * 3保存 |
| | | */ |
| | | public static final String BUSINESS_TYPE_SAVE_INSPECTION_ROUTE_MACHINE_REL="500200030002"; |
| | | |
| | | /** |
| | | * 删除巡检路线设备关联关系 |
| | | * 5 删除 |
| | | */ |
| | | public static final String BUSINESS_TYPE_DELETE_INSPECTION_ROUTE_MACHINE_REL ="500200050002"; |
| | | |
| | | |
| | | } |
| | |
| | | public static final String SERVICE_CODE_QUERY_STAFF_BY_NAME = "query.staff.byName"; |
| | | |
| | | /** |
| | | * 修改员工密码 |
| | | */ |
| | | public static final String SERVICE_CODE_CHANGE_STAFF_PWD = "user.changeStaffPwd"; |
| | | |
| | | /** |
| | | * 修改重置密码 |
| | | */ |
| | | public static final String SERVICE_CODE_RESET_STAFF_PWD = "user.resetStaffPwd"; |
| | | |
| | | /** |
| | | * 保存商户信息 |
| | | */ |
| | | public static final String SERVICE_CODE_SAVE_COMMUNITY_INFO = "save.community.info"; |
| New file |
| | |
| | | package com.java110.utils.constant; |
| | | |
| | | /** |
| | | * 巡检路线常量类 |
| | | * Created by wuxw on 2017/5/20. |
| | | */ |
| | | public class ServiceCodeInspectionRouteConstant { |
| | | |
| | | /** |
| | | * 添加 巡检路线 |
| | | */ |
| | | public static final String ADD_INSPECTIONROUTE = "inspectionRoute.saveInspectionRoute"; |
| | | |
| | | |
| | | /** |
| | | * 修改 巡检路线 |
| | | */ |
| | | public static final String UPDATE_INSPECTIONROUTE = "inspectionRoute.updateInspectionRoute"; |
| | | /** |
| | | * 删除 巡检路线 |
| | | */ |
| | | public static final String DELETE_INSPECTIONROUTE = "inspectionRoute.deleteInspectionRoute"; |
| | | |
| | | |
| | | /** |
| | | * 查询 巡检路线 |
| | | */ |
| | | public static final String LIST_INSPECTIONROUTES = "inspectionRoute.listInspectionRoutes"; |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | public static int getCurrentMonthDay() { |
| | | Calendar a = Calendar.getInstance(); |
| | | a.set(Calendar.DATE, 1); |
| | | a.roll(Calendar.DATE, -1); |
| | | int maxDate = a.get(Calendar.DATE); |
| | | return maxDate; |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Description: 获得字符(byte)的实际长度<br> |
| | | * 1、…<br> |