| | |
| | | package com.java110.web.smo.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ResponseConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.exception.SMOException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.utils.constant.PrivilegeCodeConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.core.BaseComponentSMO; |
| | | import com.java110.web.smo.IBusinessTypeServiceSMO; |
| | | import com.java110.web.smo.ICbusinessTypeServiceSMO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * add by wuxw 2019-04-22 |
| | | */ |
| | | |
| | | @Service("businessTypeServiceSMO") |
| | | public class BusinessTypeServiceSMOImpl extends BaseComponentSMO implements IBusinessTypeServiceSMO { |
| | | @Service("businessTypeServiceSMOImpl") |
| | | public class BusinessTypeServiceSMOImpl extends BaseComponentSMO implements ICbusinessTypeServiceSMO { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(BusinessTypeServiceSMOImpl.class); |
| | | |
| | |
| | | @Override |
| | | public ResponseEntity<String> listBusinessType(IPageData pd) { |
| | | |
| | | validateListDemo(pd); |
| | | validateListBusinessType(pd); |
| | | |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | int page = Integer.parseInt(paramIn.getString("page")); |
| | |
| | | |
| | | |
| | | //校验用户是否有权限 |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.PRIVILEGE_FLOOR); |
| | | //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.PRIVILEGE_FLOOR); |
| | | |
| | | ResponseEntity responseEntity = super.getStoreInfo(pd, restTemplate); |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public ResponseEntity<String> saveBusinessType(IPageData pd) { |
| | |
| | | * |
| | | * @param pd 页面封装对象 |
| | | */ |
| | | private void validateListDemo(IPageData pd) { |
| | | private void validateListBusinessType(IPageData pd) { |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "page", "请求报文中未包含page节点"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "row", "请求报文中未包含row节点"); |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 校验查询小区楼信息 |
| | | * |
| | | * @param pd 页面封装对象 |
| | | */ |
| | | private void validateListDemoStudy(IPageData pd) { |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "page", "请求报文中未包含page节点"); |
| | | Assert.jsonObjectHaveKey(pd.getReqData(), "row", "请求报文中未包含row节点"); |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | Assert.isInteger(paramIn.getString("page"), "page不是数字"); |
| | | Assert.isInteger(paramIn.getString("row"), "rows不是数字"); |
| | | int row = Integer.parseInt(paramIn.getString("row")); |
| | | |
| | | |
| | | if (row > MAX_ROW) { |
| | | throw new SMOException(ResponseConstant.RESULT_CODE_ERROR, "row 数量不能大于50"); |
| | | } |
| | | |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |