wuxw
2019-04-24 1fbad8443bb5324571cfba6fcb6f1b6b0d7f5266
查询小区楼信息完成
13个文件已修改
7个文件已添加
1547 ■■■■ 已修改文件
Api/src/main/java/com/java110/api/listener/floor/QueryFloorsListener.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CommunityService/src/main/java/com/java110/community/dao/IFloorServiceDao.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CommunityService/src/main/java/com/java110/community/dao/impl/FloorServiceDaoImpl.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CommunityService/src/main/java/com/java110/community/smo/impl/FloorInnerServiceSMOImpl.java 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserService/src/main/java/com/java110/user/dao/IUserServiceDao.java 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserService/src/main/java/com/java110/user/dao/impl/UserServiceDaoImpl.java 266 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserService/src/main/java/com/java110/user/smo/impl/UserInnerServiceSMOImpl.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/FloorDto.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/UserDto.java 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/FloorVo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/MorePageVo.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/api/ApiFloorDataVo.java 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/api/ApiFloorVo.java 77 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-common/src/main/java/com/java110/common/util/Assert.java 151 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-common/src/main/java/com/java110/common/util/BeanConvertUtil.java 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-config/src/main/resources/mapper/floor/FloorServiceDaoImplMapper.xml 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-config/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-core/src/main/java/com/java110/core/context/DataFlowContext.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-core/src/main/java/com/java110/core/smo/floor/IFloorInnerServiceSMO.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-core/src/main/java/com/java110/core/smo/user/IUserInnerServiceSMO.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/floor/QueryFloorsListener.java
@@ -1,15 +1,38 @@
package com.java110.api.listener.floor;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.listener.AbstractServiceApiDataFlowListener;
import com.java110.common.constant.ServiceCodeConstant;
import com.java110.common.util.Assert;
import com.java110.common.util.BeanConvertUtil;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.core.smo.floor.IFloorInnerServiceSMO;
import com.java110.dto.FloorDto;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.vo.api.ApiFloorDataVo;
import com.java110.vo.api.ApiFloorVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import java.util.List;
/**
 * @ClassName FloorDto
 * @Description 小区楼数据层侦听类
 * @Author wuxw
 * @Date 2019/4/24 8:52
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
@Java110Listener("QueryFloorsListener")
public class QueryFloorsListener extends AbstractServiceApiDataFlowListener {
    @Autowired
    private IFloorInnerServiceSMO floorInnerServiceSMOImpl;
    @Override
    public String getServiceCode() {
@@ -21,8 +44,46 @@
        return HttpMethod.GET;
    }
    /**
     * 业务层数据处理
     *
     * @param event 时间对象
     */
    @Override
    public void soService(ServiceDataFlowEvent event) {
        DataFlowContext dataFlowContext = event.getDataFlowContext();
        //获取请求数据
        JSONObject reqJson = dataFlowContext.getReqJson();
        validateFloorData(reqJson);
        int page = reqJson.getInteger("page");
        int row = reqJson.getInteger("row");
        String communityId = reqJson.getString("communityId");
        ApiFloorVo apiFloorVo = new ApiFloorVo();
        //查询总记录数
        int total = floorInnerServiceSMOImpl.queryFloorsCount(communityId);
        apiFloorVo.setTotal(total);
        if (total > 0) {
            List<FloorDto> floorDtoList = floorInnerServiceSMOImpl.queryFloors(page, row, communityId);
            apiFloorVo.setApiFloorDataVoList(BeanConvertUtil.covertBeanList(floorDtoList, ApiFloorDataVo.class));
        }
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiFloorVo), HttpStatus.OK);
        dataFlowContext.setResponseEntity(responseEntity);
    }
    /**
     * 校验查询条件是否满足条件
     *
     * @param reqJson 包含查询条件
     */
    private void validateFloorData(JSONObject reqJson) {
        Assert.jsonObjectHaveKey(reqJson, "page", "请求中未包含page信息");
        Assert.jsonObjectHaveKey(reqJson, "row", "请求中未包含page信息");
        Assert.jsonObjectHaveKey(reqJson, "communityId", "请求中未包含communityId信息");
        Assert.isInteger(reqJson.getString("page"), "不是有效数字");
        Assert.isInteger(reqJson.getString("row"), "不是有效数字");
    }
@@ -30,4 +91,13 @@
    public int getOrder() {
        return super.DEFAULT_ORDER;
    }
    public IFloorInnerServiceSMO getFloorInnerServiceSMOImpl() {
        return floorInnerServiceSMOImpl;
    }
    public void setFloorInnerServiceSMOImpl(IFloorInnerServiceSMO floorInnerServiceSMOImpl) {
        this.floorInnerServiceSMOImpl = floorInnerServiceSMOImpl;
    }
}
CommunityService/src/main/java/com/java110/community/dao/IFloorServiceDao.java
@@ -2,6 +2,7 @@
import com.java110.common.exception.DAOException;
import com.java110.dto.FloorDto;
import com.java110.entity.merchant.BoMerchant;
import com.java110.entity.merchant.BoMerchantAttr;
import com.java110.entity.merchant.Merchant;
@@ -15,58 +16,76 @@
 * 小区楼组件内部之间使用,没有给外围系统提供服务能力
 * 小区楼服务接口类,要求全部以字符串传输,方便微服务化
 * 新建客户,修改客户,删除客户,查询客户等功能
 *
 * <p>
 * Created by wuxw on 2016/12/27.
 */
public interface IFloorServiceDao {
    /**
     * 保存 小区楼信息
     *
     * @param businessFloorInfo 小区楼信息 封装
     * @throws DAOException 操作数据库异常
     */
    public void saveBusinessFloorInfo(Map businessFloorInfo) throws DAOException;
    void saveBusinessFloorInfo(Map businessFloorInfo) throws DAOException;
    /**
     * 查询小区楼信息(business过程)
     * 根据bId 查询小区楼信息
     *
     * @param info bId 信息
     * @return 小区楼信息
     * @throws DAOException
     * @throws DAOException 异常信息
     */
    public List<Map> getBusinessFloorInfo(Map info) throws DAOException;
    List<Map> getBusinessFloorInfo(Map info) throws DAOException;
    /**
     * 保存 小区楼信息 Business数据到 Instance中
     * @param info
     * @throws DAOException
     *
     * @param info 信息
     * @throws DAOException 异常信息
     */
    public void saveFloorInfoInstance(Map info) throws DAOException;
    void saveFloorInfoInstance(Map info) throws DAOException;
    /**
     * 查询小区楼信息(instance过程)
     * 根据bId 查询小区楼信息
     *
     * @param info bId 信息
     * @return 小区楼信息
     * @throws DAOException
     */
    public List<Map> getFloorInfo(Map info) throws DAOException;
    List<Map> getFloorInfo(Map info) throws DAOException;
    /**
     * 修改小区楼信息
     *
     * @param info 修改信息
     * @throws DAOException
     */
    public void updateFloorInfoInstance(Map info) throws DAOException;
    void updateFloorInfoInstance(Map info) throws DAOException;
    /**
     * 根据小区ID查询 小区楼数量
     *
     * @param communitId 小区ID
     * @return 小区楼数量
     * @throws DAOException 数据库异常信息
     */
    int queryFloorsCount(String communitId) throws DAOException;
    /**
     * 查询小区楼信息
     *
     * @param floorMap 查询条件
     * @return 小区楼列表集合
     * @throws DAOException 数据库操作异常
     */
    List<Map> queryFloors(Map floorMap) throws DAOException;
}
CommunityService/src/main/java/com/java110/community/dao/impl/FloorServiceDaoImpl.java
@@ -21,10 +21,11 @@
//@Transactional
public class FloorServiceDaoImpl extends BaseServiceDao implements IFloorServiceDao {
    private final static Logger logger = LoggerFactory.getLogger(FloorServiceDaoImpl.class);
    private static Logger logger = LoggerFactory.getLogger(FloorServiceDaoImpl.class);
    /**
     * 小区楼信息封装
     *
     * @param businessFloorInfo 小区楼信息 封装
     * @throws DAOException
     */
@@ -32,17 +33,18 @@
    public void saveBusinessFloorInfo(Map businessFloorInfo) throws DAOException {
        businessFloorInfo.put("month", DateUtil.getCurrentMonth());
        // 查询business_user 数据是否已经存在
        logger.debug("保存小区楼信息 入参 businessFloorInfo : {}",businessFloorInfo);
        int saveFlag = sqlSessionTemplate.insert("floorServiceDaoImpl.saveBusinessFloorInfo",businessFloorInfo);
        logger.debug("保存小区楼信息 入参 businessFloorInfo : {}", businessFloorInfo);
        int saveFlag = sqlSessionTemplate.insert("floorServiceDaoImpl.saveBusinessFloorInfo", businessFloorInfo);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存小区楼数据失败:"+ JSONObject.toJSONString(businessFloorInfo));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小区楼数据失败:" + JSONObject.toJSONString(businessFloorInfo));
        }
    }
    /**
     * 查询小区楼信息
     *
     * @param info bId 信息
     * @return 小区楼信息
     * @throws DAOException
@@ -50,43 +52,44 @@
    @Override
    public List<Map> getBusinessFloorInfo(Map info) throws DAOException {
        logger.debug("查询小区楼信息 入参 info : {}",info);
        logger.debug("查询小区楼信息 入参 info : {}", info);
        List<Map> businessFloorInfos = sqlSessionTemplate.selectList("floorServiceDaoImpl.getBusinessFloorInfo",info);
        List<Map> businessFloorInfos = sqlSessionTemplate.selectList("floorServiceDaoImpl.getBusinessFloorInfo", info);
        return businessFloorInfos;
    }
    /**
     * 保存小区楼信息 到 instance
     * @param info   bId 信息
     *
     * @param info bId 信息
     * @throws DAOException
     */
    @Override
    public void saveFloorInfoInstance(Map info) throws DAOException {
        logger.debug("保存小区楼信息Instance 入参 info : {}",info);
        logger.debug("保存小区楼信息Instance 入参 info : {}", info);
        int saveFlag = sqlSessionTemplate.insert("floorServiceDaoImpl.saveFloorInfoInstance",info);
        int saveFlag = sqlSessionTemplate.insert("floorServiceDaoImpl.saveFloorInfoInstance", info);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存小区楼信息Instance数据失败:"+ JSONObject.toJSONString(info));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小区楼信息Instance数据失败:" + JSONObject.toJSONString(info));
        }
    }
    /**
     * 查询小区楼信息(instance)
     *
     * @param info bId 信息
     * @return
     * @throws DAOException
     */
    @Override
    public List<Map> getFloorInfo(Map info) throws DAOException {
        logger.debug("查询小区楼信息 入参 info : {}",info);
        logger.debug("查询小区楼信息 入参 info : {}", info);
        List<Map> businessFloorInfos = sqlSessionTemplate.selectList("floorServiceDaoImpl.getFloorInfo",info);
        List<Map> businessFloorInfos = sqlSessionTemplate.selectList("floorServiceDaoImpl.getFloorInfo", info);
        return businessFloorInfos;
    }
@@ -94,19 +97,41 @@
    /**
     * 修改小区楼信息
     *
     * @param info 修改信息
     * @throws DAOException
     */
    @Override
    public void updateFloorInfoInstance(Map info) throws DAOException {
        logger.debug("修改小区楼信息Instance 入参 info : {}",info);
        logger.debug("修改小区楼信息Instance 入参 info : {}", info);
        int saveFlag = sqlSessionTemplate.update("floorServiceDaoImpl.updateFloorInfoInstance",info);
        int saveFlag = sqlSessionTemplate.update("floorServiceDaoImpl.updateFloorInfoInstance", info);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改小区楼信息Instance数据失败:"+ JSONObject.toJSONString(info));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改小区楼信息Instance数据失败:" + JSONObject.toJSONString(info));
        }
    }
    @Override
    public int queryFloorsCount(String communityId) throws DAOException {
        logger.debug("查询小区楼信息 入参 communityId : {}", communityId);
        List<Map> businessFloorInfos = sqlSessionTemplate.selectList("floorServiceDaoImpl.queryFloorsCount", communityId);
        if (businessFloorInfos.size() < 1) {
            return 0;
        }
        return Integer.parseInt((String) businessFloorInfos.get(0).get("count"));
    }
    @Override
    public List<Map> queryFloors(Map floorMap) throws DAOException {
        logger.debug("查询小区楼信息 入参 floorMap : {}", floorMap);
        List<Map> businessFloorInfos = sqlSessionTemplate.selectList("floorServiceDaoImpl.queryFloors", floorMap);
        return businessFloorInfos;
    }
}
CommunityService/src/main/java/com/java110/community/smo/impl/FloorInnerServiceSMOImpl.java
New file
@@ -0,0 +1,117 @@
package com.java110.community.smo.impl;
import com.java110.common.util.BeanConvertUtil;
import com.java110.community.dao.IFloorServiceDao;
import com.java110.core.base.smo.BaseServiceSMO;
import com.java110.core.smo.floor.IFloorInnerServiceSMO;
import com.java110.core.smo.user.IUserInnerServiceSMO;
import com.java110.dto.FloorDto;
import com.java110.dto.UserDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @ClassName FloorInnerServiceSMOImpl
 * @Description 小区内部服务实现类
 * @Author wuxw
 * @Date 2019/4/24 9:20
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
@RestController
public class FloorInnerServiceSMOImpl extends BaseServiceSMO implements IFloorInnerServiceSMO {
    @Autowired
    private IFloorServiceDao floorServiceDaoImpl;
    @Autowired
    private IUserInnerServiceSMO userInnerServiceSMOImpl;
    /**
     * 查询 信息
     *
     * @param page        封装查询条件
     * @param row         行数
     * @param communityId 小区ID
     * @return 小区对应的楼
     */
    @Override
    public List<FloorDto> queryFloors(@RequestParam("page") int page, @RequestParam("row") int row, @RequestParam("communityId") String communityId) {
        Map<String, Object> floorInfo = new HashMap<String, Object>();
        floorInfo.put("page", page);
        floorInfo.put("row", row);
        floorInfo.put("communityId", communityId);
        List<FloorDto> floors = BeanConvertUtil.covertBeanList(floorServiceDaoImpl.queryFloors(floorInfo), FloorDto.class);
        String[] userIds = getUserIds(floors);
        //根据 userId 查询用户信息
        List<UserDto> users = userInnerServiceSMOImpl.getUserInfo(userIds);
        for (FloorDto floor : floors) {
            refreshFloor(floor, users);
        }
        return floors;
    }
    /**
     * 查询小区对应总记录数
     *
     * @param communityId 小区ID
     * @return 小区对应的楼总记录数
     */
    @Override
    public int queryFloorsCount(String communityId) {
        return floorServiceDaoImpl.queryFloorsCount(communityId);
    }
    /**
     * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中
     *
     * @param floor 小区楼信息
     * @param users 用户列表
     */
    private void refreshFloor(FloorDto floor, List<UserDto> users) {
        for (UserDto user : users) {
            if (floor.getUserId().equals(user.getUserId())) {
                BeanConvertUtil.covertBean(user, floor);
            }
        }
    }
    /**
     * 获取批量userId
     *
     * @param floors 小区楼信息
     * @return 批量userIds 信息
     */
    private String[] getUserIds(List<FloorDto> floors) {
        List<String> userIds = new ArrayList<>();
        for (FloorDto floor : floors) {
            userIds.add(floor.getUserId());
        }
        return (String[]) userIds.toArray();
    }
    public IFloorServiceDao getFloorServiceDaoImpl() {
        return floorServiceDaoImpl;
    }
    public void setFloorServiceDaoImpl(IFloorServiceDao floorServiceDaoImpl) {
        this.floorServiceDaoImpl = floorServiceDaoImpl;
    }
    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
        return userInnerServiceSMOImpl;
    }
    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
    }
}
UserService/src/main/java/com/java110/user/dao/IUserServiceDao.java
@@ -1,9 +1,6 @@
package com.java110.user.dao;
import com.alibaba.fastjson.JSONObject;
import com.java110.common.exception.DAOException;
import com.java110.common.log.LoggerEngine;
import com.java110.common.util.Assert;
import com.java110.entity.user.BoCust;
import com.java110.entity.user.BoCustAttr;
import com.java110.entity.user.Cust;
@@ -16,210 +13,234 @@
 * 用户组件内部之间使用,没有给外围系统提供服务能力
 * 用户服务接口类,要求全部以字符串传输,方便微服务化
 * 新建客户,修改客户,删除客户,查询客户等功能
 *
 * <p>
 * Created by wuxw on 2016/12/27.
 */
public interface IUserServiceDao {
    /**
     * 保存用户基本信息(过程表)
     *
     * @param boCust 用户基本信息
     * @return
     */
    public int saveDataToBoCust(BoCust boCust) throws RuntimeException;
    int saveDataToBoCust(BoCust boCust) throws RuntimeException;
    /**
     * 保存用户属性(过程表)
     *
     * @param boCustAttr 用户属性
     * @return
     * @throws RuntimeException
     */
    public int saveDataToBoCustAttr(BoCustAttr boCustAttr) throws RuntimeException ;
    int saveDataToBoCustAttr(BoCustAttr boCustAttr) throws RuntimeException;
    /**
     *  同事保存用户基本信息和属性(过程表)
     * 同事保存用户基本信息和属性(过程表)
     *
     * @param boCustInfo 用户信息
     * @return
     * @throws RuntimeException
     */
    public String saveDataToBoCustAndBoCustAttr(String boCustInfo) throws RuntimeException;
    String saveDataToBoCustAndBoCustAttr(String boCustInfo) throws RuntimeException;
    /**
     * 保存用户基本信息
     *
     * @param cust
     * @return
     * @throws RuntimeException
     */
    public int saveDataToCust(Cust cust) throws RuntimeException;
    int saveDataToCust(Cust cust) throws RuntimeException;
    /**
     *  保存用户属性
     * 保存用户属性
     *
     * @param custAttr
     * @return
     * @throws RuntimeException
     */
    public int saveDataToCustAttr(CustAttr custAttr) throws RuntimeException;
    int saveDataToCustAttr(CustAttr custAttr) throws RuntimeException;
    /**
     * 删除用户基本信息(实例数据)
     *
     * @param cust
     * @return
     * @throws RuntimeException
     */
    public int deleteDataToCust(Cust cust) throws RuntimeException;
    int deleteDataToCust(Cust cust) throws RuntimeException;
    /**
     *  删除用户属性(实例数据)
     * 删除用户属性(实例数据)
     *
     * @param custAttr
     * @return
     * @throws RuntimeException
     */
    public int deleteDataToCustAttr(CustAttr custAttr) throws RuntimeException;
    int deleteDataToCustAttr(CustAttr custAttr) throws RuntimeException;
    /**
     * 同事保存用户基本信息和属性
     *
     * @param custInfo
     * @return
     * @throws RuntimeException
     */
    public String saveDataToCustAndCustAttr(String custInfo) throws RuntimeException;
    String saveDataToCustAndCustAttr(String custInfo) throws RuntimeException;
    /**
     * 更新用户基本信息
     *
     * @param cust
     * @return
     * @throws RuntimeException
     */
    public String updateDataToCust(String cust) throws RuntimeException;
    String updateDataToCust(String cust) throws RuntimeException;
    /**
     *  更新用户属性
     * 更新用户属性
     *
     * @param custAttr
     * @return
     * @throws RuntimeException
     */
    public String updateDataToCustAttr(String custAttr) throws RuntimeException;
    String updateDataToCustAttr(String custAttr) throws RuntimeException;
    /**
     * 同事更新用户基本信息和属性
     *
     * @param custInfo
     * @return
     * @throws RuntimeException
     */
    public String updateDataToCustAndCustAttr(String custInfo) throws RuntimeException;
    String updateDataToCustAndCustAttr(String custInfo) throws RuntimeException;
    /**
     * 查询用户基本信息(一般没用,就算有用)
     *
     * @param cust
     * @return
     * @throws RuntimeException
     */
    public Cust queryDataToCust(Cust cust) throws RuntimeException ;
    Cust queryDataToCust(Cust cust) throws RuntimeException;
    /**
     *  查询用户属性
     * 查询用户属性
     *
     * @param custAttr
     * @return
     * @throws RuntimeException
     */
    public List<CustAttr> queryDataToCustAttr(CustAttr custAttr) throws RuntimeException;
    List<CustAttr> queryDataToCustAttr(CustAttr custAttr) throws RuntimeException;
    /**
     * 查询保存用户基本信息和属性
     *
     * @param custInfo
     * @return
     * @throws RuntimeException
     */
    public String queryDataToCustAndCustAttr(String custInfo) throws RuntimeException;
    String queryDataToCustAndCustAttr(String custInfo) throws RuntimeException;
    /**
     *
     * 查询 客户基本信息(过程表bo_cust)
     *
     * @param boCust
     * @return
     * @throws Exception
     */
    public List<BoCust> queryBoCust(BoCust boCust) throws Exception;
    List<BoCust> queryBoCust(BoCust boCust) throws Exception;
    /**
     *
     * 查询 客户属性信息(过程表 bo_cust_attr)
     *
     * @param boCustAttr
     * @return
     * @throws Exception
     */
    public List<BoCustAttr> queryBoCustAttr(BoCustAttr boCustAttr) throws Exception;
    List<BoCustAttr> queryBoCustAttr(BoCustAttr boCustAttr) throws Exception;
    /**
     * 保存用户信息
     *
     * @param userInfo
     * @throws DAOException
     */
    public void saveBusinessUserInfo(Map userInfo) throws DAOException;
    void saveBusinessUserInfo(Map userInfo) throws DAOException;
    /**
     * 保存用户属性
     *
     * @param userAttr
     * @throws DAOException
     */
    public void saveBusinessUserAttr(Map userAttr) throws DAOException;
    void saveBusinessUserAttr(Map userAttr) throws DAOException;
    void saveUserInfoInstance(Map businessUser);
    void saveUserAttrInstance(Map attrInstance);
    void updateUserInfoInstance(Map businessUser);
    public void saveUserInfoInstance(Map businessUser);
    public void saveUserAttrInstance(Map attrInstance);
    public void updateUserInfoInstance(Map businessUser);
    public void updateUserAttrInstance(Map attrInstance);
    void updateUserAttrInstance(Map attrInstance);
    /**
     * 查询用户信息
     *
     * @param info
     * @return
     * @throws DAOException
     */
    public Map queryBusinessUserInfo(Map info) throws DAOException;
    Map queryBusinessUserInfo(Map info) throws DAOException;
    /**
     * 查询用户信息
     *
     * @param info
     * @return
     * @throws DAOException
     */
    public List<Map> queryBusinessUserInfoAttrs(Map info) throws DAOException;
    List<Map> queryBusinessUserInfoAttrs(Map info) throws DAOException;
    /**
     * 查询用户信息
     *
     * @param info
     * @return
     * @throws DAOException
     */
    public Map queryUserInfo(Map info) throws DAOException;
    Map queryUserInfo(Map info) throws DAOException;
    /**
     * 查询用户信息
     *
     * @param info 信息
     * @return
     * @throws DAOException
     */
    List<Map> queryUsersInfo(Map info) throws DAOException;
    /**
     * 查询用户信息
     *
     * @param info
     * @return
     * @throws DAOException
     */
    public List<Map> queryUserInfoAttrs(Map info) throws DAOException;
    List<Map> queryUserInfoAttrs(Map info) throws DAOException;
    /**
     * 保存用户地址信息
     * Business 过程
     *
     * @param userAddress 用户地址信息
     * @throws DAOException
     */
@@ -229,6 +250,7 @@
    /**
     * 查询用户地址信息
     * business 过程
     *
     * @param info b_id
     * @return 查询到的用户地址信息
     * @throws DAOException
@@ -237,6 +259,7 @@
    /**
     * 保存Business 数据到 Instance
     *
     * @param businessUserAddress 从business 中查出的数据
     * @throws DAOException 数据处理异常
     */
@@ -245,6 +268,7 @@
    /**
     * 作废用户信息数据
     *
     * @param businessUserAddress 用户地址信息 b_id
     * @throws DAOException 数据处理异常
     */
@@ -254,6 +278,7 @@
    /**
     * 保存用户打标信息
     * Business 过程
     *
     * @param userTag 用户打标信息
     * @throws DAOException
     */
@@ -263,6 +288,7 @@
    /**
     * 查询用户打标信息
     * business 过程
     *
     * @param info b_id
     * @return 查询到的用户打标信息
     * @throws DAOException
@@ -271,6 +297,7 @@
    /**
     * 保存Business 数据到 Instance
     *
     * @param businessUserTag 从business 中查出的数据
     * @throws DAOException 数据处理异常
     */
@@ -279,16 +306,17 @@
    /**
     * 作废用户打标数据
     *
     * @param businessUserTag 用户地址信息 b_id
     * @throws DAOException 数据处理异常
     */
    public void updateUserTagInstance(Map businessUserTag) throws DAOException;
    /**
     * 保存用户证件信息
     * Business 过程
     *
     * @param userCredentials 用户证件信息
     * @throws DAOException
     */
@@ -298,6 +326,7 @@
    /**
     * 查询用户证件信息
     * business 过程
     *
     * @param info b_id
     * @return 查询到的用户打标信息
     * @throws DAOException
@@ -306,6 +335,7 @@
    /**
     * 保存Business 数据到 Instance
     *
     * @param businessUserCredentials 从business 中查出的数据
     * @throws DAOException 数据处理异常
     */
@@ -314,8 +344,9 @@
    /**
     * 作废用户证件数据
     *
     * @param businessUserCredentials 用户地址信息 b_id
     * @throws DAOException 数据处理异常
     */
    public void updateUserCredentialsInstance(Map businessUserCredentials) throws DAOException;
}
}
UserService/src/main/java/com/java110/user/dao/impl/UserServiceDaoImpl.java
@@ -37,22 +37,23 @@
    /**
     * 保存用户基本信息
     * 功能只用与保存用户处理
     *
     * @param boCust 用户基本信息
     * @return
     */
    @Override
    public int saveDataToBoCust(BoCust boCust) throws RuntimeException{
    public int saveDataToBoCust(BoCust boCust) throws RuntimeException {
        logger.debug("----【userServiceDaoImpl.saveDataToBoCust】保存数据入参 : " + boCust);
        int saveFlag = 0;
        try {
            saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveDataToBoCust",boCust);
            saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveDataToBoCust", boCust);
        }catch(RuntimeException e){
            logger.error("----【userServiceDaoImpl.saveDataToBoCust】保存数据异常 : " ,e);
        } catch (RuntimeException e) {
            logger.error("----【userServiceDaoImpl.saveDataToBoCust】保存数据异常 : ", e);
            return saveFlag;
        }finally {
        } finally {
            logger.debug("----【userServiceDaoImpl.saveDataToBoCust】保存数据出参 : saveFlag:" + saveFlag);
            return saveFlag;
        }
@@ -71,13 +72,13 @@
        logger.debug("----【userServiceDaoImpl.saveDataToBoCustAttr】保存数据入参 : " + boCustAttr);
        //为了保险起见,再测检测reqList 是否有值
        if(boCustAttr == null){
        if (boCustAttr == null) {
            logger.debug("----【userServiceDaoImpl.saveDataToBoCustAttr】保存数据出错 : " + boCustAttr);
            return 0;
        }
        int saveFlag = 0;
        saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveDataToBoCustAttr",boCustAttr);
        saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveDataToBoCustAttr", boCustAttr);
        logger.debug("----【userServiceDaoImpl.saveDataToBoCustAttr】保存数据出参 :saveFlag " + saveFlag);
        return saveFlag;
@@ -86,6 +87,7 @@
    /**
     * 保存实例数据 客户信息至Cust表中
     *
     * @param cust
     * @return
     * @throws RuntimeException
@@ -94,13 +96,13 @@
    public int saveDataToCust(Cust cust) throws RuntimeException {
        logger.debug("----【userServiceDaoImpl.saveDataToCust】保存数据入参 : " + cust);
        //为了保险起见,再测检测reqList 是否有值
        if(cust == null){
        if (cust == null) {
            logger.debug("----【userServiceDaoImpl.saveDataToCust】保存数据出错 : " + cust);
            throw new IllegalArgumentException("请求参数错误,cust : " + cust);
        }
        int saveFlag = 0;
        saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveDataToCust",cust);
        saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveDataToCust", cust);
        logger.debug("----【userServiceDaoImpl.saveDataToCust】保存数据出参 :saveFlag " + saveFlag);
        return saveFlag;
@@ -108,6 +110,7 @@
    /**
     * 保存实例数据 客户属性信息至CustAttr表中
     *
     * @param custAttr
     * @return
     * @throws RuntimeException
@@ -116,13 +119,13 @@
    public int saveDataToCustAttr(CustAttr custAttr) throws RuntimeException {
        logger.debug("----【userServiceDaoImpl.saveDataToCust】保存数据入参 : " + custAttr);
        //为了保险起见,再测检测reqList 是否有值
        if(custAttr == null){
        if (custAttr == null) {
            logger.debug("----【userServiceDaoImpl.saveDataToCust】保存数据出错 : " + custAttr);
            throw new IllegalArgumentException("请求参数错误,custAttr : " + custAttr);
        }
        int saveFlag = 0;
        saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveDataToCustAttr",custAttr);
        saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveDataToCustAttr", custAttr);
        logger.debug("----【userServiceDaoImpl.saveDataToCust】保存数据出参 :saveFlag " + saveFlag);
        return saveFlag;
@@ -130,41 +133,43 @@
    /**
     * 删除用户基本信息(实例数据)
     *
     * @param cust
     * @return
     * @throws RuntimeException
     */
    public int deleteDataToCust(Cust cust) throws RuntimeException{
    public int deleteDataToCust(Cust cust) throws RuntimeException {
        logger.debug("----【userServiceDaoImpl.deleteDataToCust】保存数据入参 : " + cust);
        //为了保险起见,再测检测reqList 是否有值
        if(cust == null){
        if (cust == null) {
            logger.debug("----【userServiceDaoImpl.deleteDataToCust】保存数据出错 : " + cust);
            throw new IllegalArgumentException("请求参数错误,cust : " + cust);
        }
        int saveFlag = 0;
        saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.deleteDataToCust",cust);
        saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.deleteDataToCust", cust);
        logger.debug("----【userServiceDaoImpl.deleteDataToCust】保存数据出参 :saveFlag " + saveFlag);
        return saveFlag;
    }
    /**
     *  删除用户属性(实例数据)
     * 删除用户属性(实例数据)
     *
     * @param custAttr
     * @return
     * @throws RuntimeException
     */
    public int deleteDataToCustAttr(CustAttr custAttr) throws RuntimeException{
    public int deleteDataToCustAttr(CustAttr custAttr) throws RuntimeException {
        logger.debug("----【userServiceDaoImpl.deleteDataToCustAttr】保存数据入参 : " + custAttr);
        //为了保险起见,再测检测reqList 是否有值
        if(custAttr == null){
        if (custAttr == null) {
            logger.debug("----【userServiceDaoImpl.deleteDataToCustAttr】保存数据出错 : " + custAttr);
            throw new IllegalArgumentException("请求参数错误,custAttr : " + custAttr);
        }
        int saveFlag = 0;
        saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.deleteDataToCustAttr",custAttr);
        saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.deleteDataToCustAttr", custAttr);
        logger.debug("----【userServiceDaoImpl.deleteDataToCustAttr】保存数据出参 :saveFlag " + saveFlag);
        return saveFlag;
@@ -181,7 +186,7 @@
    @Override
    public String saveDataToBoCustAndBoCustAttr(String boCustInfo) throws RuntimeException {
        logger.debug("----【userServiceDaoImpl.saveDataToBoCustAndBoCustAttr】保存数据入参"+boCustInfo);
        logger.debug("----【userServiceDaoImpl.saveDataToBoCustAndBoCustAttr】保存数据入参" + boCustInfo);
        return null;
    }
@@ -208,6 +213,7 @@
    /**
     * 根据客户ID查询客户信息,包括基本信息和属性信息
     *
     * @param cust
     * @return
     * @throws RuntimeException
@@ -216,12 +222,12 @@
    public Cust queryDataToCust(Cust cust) throws RuntimeException {
        logger.debug("----【userServiceDaoImpl.queryDataToCust】保存数据入参 : " + cust);
        //为了保险起见,再测检测reqList 是否有值
        if(cust == null){
        if (cust == null) {
            logger.debug("----【userServiceDaoImpl.queryDataToCust】保存数据出错 : " + cust);
            throw new IllegalArgumentException("请求参数错误,cust : " + cust);
        }
        Cust newCust  = sqlSessionTemplate.selectOne("userServiceDaoImpl.queryDataToCust",cust);
        Cust newCust = sqlSessionTemplate.selectOne("userServiceDaoImpl.queryDataToCust", cust);
        logger.debug("----【userServiceDaoImpl.queryDataToCust】保存数据出参 :newCust " + newCust);
@@ -239,12 +245,12 @@
    public List<CustAttr> queryDataToCustAttr(CustAttr custAttr) throws RuntimeException {
        logger.debug("----【userServiceDaoImpl.queryDataToCustAttr】保存数据入参 : " + custAttr);
        //为了保险起见,再测检测reqList 是否有值
        if(custAttr == null){
        if (custAttr == null) {
            logger.debug("----【userServiceDaoImpl.queryDataToCust】保存数据出错 : " + custAttr);
            throw new IllegalArgumentException("请求参数错误,CustAttr : " + custAttr);
        }
        List<CustAttr> custAttrs  = sqlSessionTemplate.selectList("userServiceDaoImpl.queryDataToCustAttr",custAttr);
        List<CustAttr> custAttrs = sqlSessionTemplate.selectList("userServiceDaoImpl.queryDataToCustAttr", custAttr);
        logger.debug("----【userServiceDaoImpl.queryDataToCust】保存数据出参 :custAttrs " + custAttrs);
@@ -257,41 +263,40 @@
    }
    /**
     *
     * 查询 客户基本信息(过程表bo_cust)
     *
     * @param boCust
     * @return
     * @throws Exception
     */
    public List<BoCust> queryBoCust(BoCust boCust) throws Exception{
        logger.debug("----【userServiceDaoImpl.queryBoCustAttr】:"+boCust);
    public List<BoCust> queryBoCust(BoCust boCust) throws Exception {
        logger.debug("----【userServiceDaoImpl.queryBoCustAttr】:" + boCust);
        Assert.isNull(boCust,"查询bo_cust 入参为空");
        Assert.isNull(boCust, "查询bo_cust 入参为空");
        return sqlSessionTemplate.selectList("userServiceDaoImpl.queryBoCust",boCust);
        return sqlSessionTemplate.selectList("userServiceDaoImpl.queryBoCust", boCust);
    }
    /**
     *
     * 查询 客户属性信息(过程表 bo_cust_attr)
     *
     * @param boCustAttr
     * @return
     * @throws Exception
     */
    public List<BoCustAttr> queryBoCustAttr(BoCustAttr boCustAttr) throws Exception{
    public List<BoCustAttr> queryBoCustAttr(BoCustAttr boCustAttr) throws Exception {
        logger.debug("【userServiceDaoImpl.queryBoCustAttr】:"+boCustAttr);
        logger.debug("【userServiceDaoImpl.queryBoCustAttr】:" + boCustAttr);
        Assert.isNull(boCustAttr,"查询bo_cust_attr 入参为空");
        Assert.isNull(boCustAttr, "查询bo_cust_attr 入参为空");
        return sqlSessionTemplate.selectList("userServiceDaoImpl.queryBoCustAttr",boCustAttr);
        return sqlSessionTemplate.selectList("userServiceDaoImpl.queryBoCustAttr", boCustAttr);
    }
    /**
     * 保存用户信息
     *
     * @param userInfo
     * @throws DAOException
     */
@@ -301,14 +306,16 @@
        // 查询business_user 数据是否已经存在
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveBusinessUserInfo",userInfo);
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveBusinessUserInfo", userInfo);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存用户数据失败:"+JSONObject.toJSONString(userInfo));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存用户数据失败:" + JSONObject.toJSONString(userInfo));
        }
    }
    /**
     * 保存用户属性
     *
     * @param userAttr
     * @throws DAOException
     */
@@ -316,66 +323,66 @@
    public void saveBusinessUserAttr(Map userAttr) throws DAOException {
        logger.debug("----【userServiceDaoImpl.saveBusinessUserAttr】保存数据入参 : " + JSONObject.toJSONString(userAttr));
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveBusinessUserAttr",userAttr);
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveBusinessUserAttr", userAttr);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存用户属性数据失败:"+JSONObject.toJSONString(userAttr));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存用户属性数据失败:" + JSONObject.toJSONString(userAttr));
        }
    }
    @Override
    public void saveUserInfoInstance(Map businessUser) {
        logger.debug("----【userServiceDaoImpl.saveUserInfoInstance】保存数据入参 : " + JSONObject.toJSONString(businessUser));
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveUserInfoInstance",businessUser);
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveUserInfoInstance", businessUser);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存用户Instance数据失败:"+JSONObject.toJSONString(businessUser));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存用户Instance数据失败:" + JSONObject.toJSONString(businessUser));
        }
    }
    @Override
    public void saveUserAttrInstance(Map attrInstance) {
        logger.debug("----【userServiceDaoImpl.saveUserAttrInstance】保存数据入参 : " + JSONObject.toJSONString(attrInstance));
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveUserAttrInstance",attrInstance);
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveUserAttrInstance", attrInstance);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存用户Instance数据失败:"+JSONObject.toJSONString(attrInstance));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存用户Instance数据失败:" + JSONObject.toJSONString(attrInstance));
        }
    }
    @Override
    public void updateUserInfoInstance(Map businessUser) {
        logger.debug("----【userServiceDaoImpl.updateUserInfoInstance】保存数据入参 : " + JSONObject.toJSONString(businessUser));
        int saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.updateUserInfoInstance",businessUser);
        int saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.updateUserInfoInstance", businessUser);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改用户Instance数据失败:"+JSONObject.toJSONString(businessUser));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改用户Instance数据失败:" + JSONObject.toJSONString(businessUser));
        }
    }
    @Override
    public void updateUserAttrInstance(Map attrInstance) {
        logger.debug("----【userServiceDaoImpl.updateUserAttrInstance】保存数据入参 : " + JSONObject.toJSONString(attrInstance));
        int saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.updateUserAttrInstance",attrInstance);
        int saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.updateUserAttrInstance", attrInstance);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改用户Instance数据失败:"+JSONObject.toJSONString(attrInstance));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改用户Instance数据失败:" + JSONObject.toJSONString(attrInstance));
        }
    }
    /**
     * 查询用户信息
     *
     * @param info
     * @return
     * @throws DAOException
     */
    public Map queryBusinessUserInfo(Map info) throws DAOException{
        Assert.notNull(info,"queryBusinessUserInfo 的参数不能为空");
    public Map queryBusinessUserInfo(Map info) throws DAOException {
        Assert.notNull(info, "queryBusinessUserInfo 的参数不能为空");
        logger.debug("----【userServiceDaoImpl.queryBusinessUserInfo】保存数据入参 : " + JSONObject.toJSONString(info));
        List<Map> users = sqlSessionTemplate.selectList("userServiceDaoImpl.queryBusinessUserInfo",info);
        if(users == null || users.size() == 0){
        List<Map> users = sqlSessionTemplate.selectList("userServiceDaoImpl.queryBusinessUserInfo", info);
        if (users == null || users.size() == 0) {
            return null;
        }
        return users.get(0);
@@ -383,29 +390,31 @@
    /**
     * 查询用户信息
     *
     * @param info
     * @return
     * @throws DAOException
     */
    public List<Map> queryBusinessUserInfoAttrs(Map info) throws DAOException{
        Assert.notNull(info,"queryBusinessUserInfoAttrs 的参数不能为空");
    public List<Map> queryBusinessUserInfoAttrs(Map info) throws DAOException {
        Assert.notNull(info, "queryBusinessUserInfoAttrs 的参数不能为空");
        logger.debug("----【userServiceDaoImpl.queryBusinessUserInfoAttrs】保存数据入参 : " + JSONObject.toJSONString(info));
        List<Map> userAttrs = sqlSessionTemplate.selectList("userServiceDaoImpl.queryBusinessUserInfoAttrs",info);
        List<Map> userAttrs = sqlSessionTemplate.selectList("userServiceDaoImpl.queryBusinessUserInfoAttrs", info);
        return userAttrs;
    }
    /**
     * 查询用户信息
     *
     * @param info
     * @return
     * @throws DAOException
     */
    @Override
    public Map queryUserInfo(Map info) throws DAOException{
        Assert.notNull(info,"queryUserInfo 的参数不能为空");
    public Map queryUserInfo(Map info) throws DAOException {
        Assert.notNull(info, "queryUserInfo 的参数不能为空");
        logger.debug("----【userServiceDaoImpl.queryUserInfo】保存数据入参 : " + JSONObject.toJSONString(info));
        List<Map> users = sqlSessionTemplate.selectList("userServiceDaoImpl.queryUserInfo",info);
        if(users == null || users.size() == 0){
        List<Map> users = sqlSessionTemplate.selectList("userServiceDaoImpl.queryUserInfo", info);
        if (users == null || users.size() == 0) {
            return null;
        }
        return users.get(0);
@@ -413,45 +422,64 @@
    /**
     * 查询用户信息
     *
     * @param info
     * @return
     * @throws DAOException
     */
    @Override
    public List<Map> queryUserInfoAttrs(Map info) throws DAOException{
        Assert.notNull(info,"queryUserInfo 的参数不能为空");
    public List<Map> queryUsersInfo(Map info) throws DAOException {
        Assert.notNull(info, "queryUserInfo 的参数不能为空");
        logger.debug("----【userServiceDaoImpl.queryUserInfo】保存数据入参 : " + JSONObject.toJSONString(info));
        List<Map> users = sqlSessionTemplate.selectList("userServiceDaoImpl.queryUserInfo", info);
        return users;
    }
    /**
     * 查询用户信息
     *
     * @param info
     * @return
     * @throws DAOException
     */
    @Override
    public List<Map> queryUserInfoAttrs(Map info) throws DAOException {
        Assert.notNull(info, "queryUserInfo 的参数不能为空");
        logger.debug("----【userServiceDaoImpl.updateUserAttrInstance】保存数据入参 : " + JSONObject.toJSONString(info));
        List<Map> userAttrs = sqlSessionTemplate.selectList("userServiceDaoImpl.queryUserInfoAttrs",info);
        List<Map> userAttrs = sqlSessionTemplate.selectList("userServiceDaoImpl.queryUserInfoAttrs", info);
        return userAttrs;
    }
    /**
     * 保存用户地址信息
     * Business 过程
     *
     * @param userAddress 用户地址信息
     * @throws DAOException
     */
    public void saveBusinessUserAddress(Map userAddress) throws DAOException{
    public void saveBusinessUserAddress(Map userAddress) throws DAOException {
        logger.debug("----【userServiceDaoImpl.saveBusinessUserAddress】保存数据入参 : " + JSONObject.toJSONString(userAddress));
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveBusinessUserAddress",userAddress);
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveBusinessUserAddress", userAddress);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存用户地址数据失败:"+JSONObject.toJSONString(userAddress));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存用户地址数据失败:" + JSONObject.toJSONString(userAddress));
        }
    }
    /**
     * 查询用户地址信息
     * business 过程
     *
     * @param info b_id
     * @return 查询到的用户地址信息
     * @throws DAOException
     */
    public Map queryBusinessUserAddress(Map info) throws DAOException{
        Assert.notNull(info,"queryBusinessUserAddress 的参数不能为空");
    public Map queryBusinessUserAddress(Map info) throws DAOException {
        Assert.notNull(info, "queryBusinessUserAddress 的参数不能为空");
        logger.debug("----【userServiceDaoImpl.queryBusinessUserAddress】保存数据入参 : " + JSONObject.toJSONString(info));
        List<Map> users = sqlSessionTemplate.selectList("userServiceDaoImpl.queryBusinessUserAddress",info);
        if(users == null || users.size() == 0){
        List<Map> users = sqlSessionTemplate.selectList("userServiceDaoImpl.queryBusinessUserAddress", info);
        if (users == null || users.size() == 0) {
            return null;
        }
        return users.get(0);
@@ -459,29 +487,31 @@
    /**
     * 保存用户地址 Business 数据到 Instance
     *
     * @param businessUserAddress 从business 中查出的数据
     * @throws DAOException 数据处理异常
     */
    public void saveUserAddressInstance(Map businessUserAddress) throws DAOException{
    public void saveUserAddressInstance(Map businessUserAddress) throws DAOException {
        logger.debug("----【userServiceDaoImpl.saveUserAddressInstance】保存数据入参 : " + JSONObject.toJSONString(businessUserAddress));
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveUserAddressInstance",businessUserAddress);
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveUserAddressInstance", businessUserAddress);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存用户地址Instance数据失败:"+JSONObject.toJSONString(businessUserAddress));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存用户地址Instance数据失败:" + JSONObject.toJSONString(businessUserAddress));
        }
    }
    /**
     * 作废用户地址信息数据
     *
     * @param businessUserAddress 用户地址信息 b_id
     * @throws DAOException 数据处理异常
     */
    public void updateUserAddressInstance(Map businessUserAddress) throws DAOException{
    public void updateUserAddressInstance(Map businessUserAddress) throws DAOException {
        logger.debug("----【userServiceDaoImpl.updateUserAddressInstance】保存数据入参 : " + JSONObject.toJSONString(businessUserAddress));
        int saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.updateUserAddressInstance",businessUserAddress);
        int saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.updateUserAddressInstance", businessUserAddress);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改用户Instance数据失败:"+JSONObject.toJSONString(businessUserAddress));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改用户Instance数据失败:" + JSONObject.toJSONString(businessUserAddress));
        }
    }
@@ -489,15 +519,16 @@
    /**
     * 保存用户打标信息
     * Business 过程
     *
     * @param userTag 用户打标信息
     * @throws DAOException
     */
    public void saveBusinessUserTag(Map userTag) throws DAOException{
    public void saveBusinessUserTag(Map userTag) throws DAOException {
        logger.debug("----【userServiceDaoImpl.saveBusinessUserTag】保存数据入参 : " + JSONObject.toJSONString(userTag));
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveBusinessUserTag",userTag);
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveBusinessUserTag", userTag);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存用户打标数据失败:"+JSONObject.toJSONString(userTag));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存用户打标数据失败:" + JSONObject.toJSONString(userTag));
        }
    }
@@ -505,15 +536,16 @@
    /**
     * 查询用户打标信息
     * business 过程
     *
     * @param info b_id
     * @return 查询到的用户打标信息
     * @throws DAOException
     */
    public Map queryBusinessUserTag(Map info) throws DAOException{
        Assert.notNull(info,"queryBusinessUserTag 的参数不能为空");
    public Map queryBusinessUserTag(Map info) throws DAOException {
        Assert.notNull(info, "queryBusinessUserTag 的参数不能为空");
        logger.debug("----【userServiceDaoImpl.queryBusinessUserTag】保存数据入参 : " + JSONObject.toJSONString(info));
        List<Map> users = sqlSessionTemplate.selectList("userServiceDaoImpl.queryBusinessUserTag",info);
        if(users == null || users.size() == 0){
        List<Map> users = sqlSessionTemplate.selectList("userServiceDaoImpl.queryBusinessUserTag", info);
        if (users == null || users.size() == 0) {
            return null;
        }
        return users.get(0);
@@ -521,30 +553,32 @@
    /**
     * 保存Business 数据到 Instance
     *
     * @param businessUserTag 从business 中查出的数据
     * @throws DAOException 数据处理异常
     */
    public void saveUserTagInstance(Map businessUserTag) throws DAOException{
    public void saveUserTagInstance(Map businessUserTag) throws DAOException {
        logger.debug("----【userServiceDaoImpl.saveUserTagInstance】保存数据入参 : " + JSONObject.toJSONString(businessUserTag));
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveUserTagInstance",businessUserTag);
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveUserTagInstance", businessUserTag);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存用户打标Instance数据失败:"+JSONObject.toJSONString(businessUserTag));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存用户打标Instance数据失败:" + JSONObject.toJSONString(businessUserTag));
        }
    }
    /**
     * 作废用户打标数据
     *
     * @param businessUserTag 用户地址信息 b_id
     * @throws DAOException 数据处理异常
     */
    public void updateUserTagInstance(Map businessUserTag) throws DAOException{
    public void updateUserTagInstance(Map businessUserTag) throws DAOException {
        logger.debug("----【userServiceDaoImpl.updateUserTagInstance】保存数据入参 : " + JSONObject.toJSONString(businessUserTag));
        int saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.updateUserTagInstance",businessUserTag);
        int saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.updateUserTagInstance", businessUserTag);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改用户Instance数据失败:"+JSONObject.toJSONString(businessUserTag));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改用户Instance数据失败:" + JSONObject.toJSONString(businessUserTag));
        }
    }
@@ -552,15 +586,16 @@
    /**
     * 保存用户证件信息
     * Business 过程
     *
     * @param userCredentials 用户证件信息
     * @throws DAOException
     */
    public void saveBusinessUserCredentials(Map userCredentials) throws DAOException{
    public void saveBusinessUserCredentials(Map userCredentials) throws DAOException {
        logger.debug("----【userServiceDaoImpl.saveBusinessUserCredentials】保存数据入参 : " + JSONObject.toJSONString(userCredentials));
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveBusinessUserCredentials",userCredentials);
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveBusinessUserCredentials", userCredentials);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存用户打标数据失败:"+JSONObject.toJSONString(userCredentials));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存用户打标数据失败:" + JSONObject.toJSONString(userCredentials));
        }
    }
@@ -568,15 +603,16 @@
    /**
     * 查询用户证件信息
     * business 过程
     *
     * @param info b_id
     * @return 查询到的用户打标信息
     * @throws DAOException
     */
    public Map queryBusinessUserCredentials(Map info) throws DAOException{
        Assert.notNull(info,"queryBusinessUserCredentials 的参数不能为空");
    public Map queryBusinessUserCredentials(Map info) throws DAOException {
        Assert.notNull(info, "queryBusinessUserCredentials 的参数不能为空");
        logger.debug("----【userServiceDaoImpl.queryBusinessUserCredentials】保存数据入参 : " + JSONObject.toJSONString(info));
        List<Map> users = sqlSessionTemplate.selectList("userServiceDaoImpl.queryBusinessUserCredentials",info);
        if(users == null || users.size() == 0){
        List<Map> users = sqlSessionTemplate.selectList("userServiceDaoImpl.queryBusinessUserCredentials", info);
        if (users == null || users.size() == 0) {
            return null;
        }
        return users.get(0);
@@ -584,30 +620,32 @@
    /**
     * 保存Business 数据到 Instance
     *
     * @param businessUserCredentials 从business 中查出的数据
     * @throws DAOException 数据处理异常
     */
    public void saveUserCredentialsInstance(Map businessUserCredentials) throws DAOException{
    public void saveUserCredentialsInstance(Map businessUserCredentials) throws DAOException {
        logger.debug("----【userServiceDaoImpl.saveUserCredentialsInstance】保存数据入参 : " + JSONObject.toJSONString(businessUserCredentials));
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveUserCredentialsInstance",businessUserCredentials);
        int saveFlag = sqlSessionTemplate.insert("userServiceDaoImpl.saveUserCredentialsInstance", businessUserCredentials);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存用户打标Instance数据失败:"+JSONObject.toJSONString(businessUserCredentials));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存用户打标Instance数据失败:" + JSONObject.toJSONString(businessUserCredentials));
        }
    }
    /**
     * 作废用户证件数据
     *
     * @param businessUserCredentials 用户地址信息 b_id
     * @throws DAOException 数据处理异常
     */
    public void updateUserCredentialsInstance(Map businessUserCredentials) throws DAOException{
    public void updateUserCredentialsInstance(Map businessUserCredentials) throws DAOException {
        logger.debug("----【userServiceDaoImpl.updateUserCredentialsInstance】保存数据入参 : " + JSONObject.toJSONString(businessUserCredentials));
        int saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.updateUserCredentialsInstance",businessUserCredentials);
        int saveFlag = sqlSessionTemplate.update("userServiceDaoImpl.updateUserCredentialsInstance", businessUserCredentials);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改用户Instance数据失败:"+JSONObject.toJSONString(businessUserCredentials));
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改用户Instance数据失败:" + JSONObject.toJSONString(businessUserCredentials));
        }
    }
}
UserService/src/main/java/com/java110/user/smo/impl/UserInnerServiceSMOImpl.java
@@ -1,13 +1,53 @@
package com.java110.user.smo.impl;
import com.java110.common.constant.StatusConstant;
import com.java110.common.util.BeanConvertUtil;
import com.java110.core.smo.user.IUserInnerServiceSMO;
import com.java110.dto.UserDto;
import com.java110.user.dao.IUserServiceDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 用户服务实现类
 */
@RestController
public class UserInnerServiceSMOImpl implements IUserInnerServiceSMO {
    @Autowired
    private IUserServiceDao userServiceDaoImpl;
    @Override
    public String getUserServiceVersion(@RequestParam("code") String code) {
        return code + " 0.0.6";
    }
    /**
     * 查询用户信息
     *
     * @param userIds 用户ID
     *                支持 多个查询
     * @return
     */
    @Override
    public List<UserDto> getUserInfo(String[] userIds) {
        Map userInfo = new HashMap();
        userInfo.put("statusCd", StatusConstant.STATUS_CD_VALID);
        userInfo.put("userIds", userIds);
        return BeanConvertUtil.covertBeanList(userServiceDaoImpl.queryUsersInfo(userInfo), UserDto.class);
    }
    public IUserServiceDao getUserServiceDaoImpl() {
        return userServiceDaoImpl;
    }
    public void setUserServiceDaoImpl(IUserServiceDao userServiceDaoImpl) {
        this.userServiceDaoImpl = userServiceDaoImpl;
    }
}
java110-bean/src/main/java/com/java110/dto/FloorDto.java
New file
@@ -0,0 +1,96 @@
package com.java110.dto;
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 FloorDto implements Serializable {
    /**
     * floorId
     */
    private String floorId;
    /**
     * 编号
     */
    private String floorNum;
    /**
     * 名称
     */
    private String floorName;
    private String remark;
    private String userId;
    private String userName;
    private Date createTime;
    public String getFloorId() {
        return floorId;
    }
    public void setFloorId(String floorId) {
        this.floorId = floorId;
    }
    public String getFloorNum() {
        return floorNum;
    }
    public void setFloorNum(String floorNum) {
        this.floorNum = floorNum;
    }
    public String getFloorName() {
        return floorName;
    }
    public void setFloorName(String floorName) {
        this.floorName = floorName;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getUserName() {
        return userName;
    }
    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getUserId() {
        return userId;
    }
    public void setUserId(String userId) {
        this.userId = userId;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
java110-bean/src/main/java/com/java110/dto/UserDto.java
New file
@@ -0,0 +1,115 @@
package com.java110.dto;
import java.io.Serializable;
/**
 * @ClassName UserDto
 * @Description 查询 用户信息
 * @Author wuxw
 * @Date 2019/4/24 14:43
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
public class UserDto extends Dto implements Serializable {
    private String userId;
    private String userName;
    private String tel;
    private String email;
    private String address;
    private String password;
    private String locationCd;
    private int age;
    private String sex;
    private String levelCd;
    public String getUserId() {
        return userId;
    }
    public void setUserId(String userId) {
        this.userId = userId;
    }
    public String getUserName() {
        return userName;
    }
    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getTel() {
        return tel;
    }
    public void setTel(String tel) {
        this.tel = tel;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public String getLocationCd() {
        return locationCd;
    }
    public void setLocationCd(String locationCd) {
        this.locationCd = locationCd;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    public String getLevelCd() {
        return levelCd;
    }
    public void setLevelCd(String levelCd) {
        this.levelCd = levelCd;
    }
}
java110-bean/src/main/java/com/java110/vo/FloorVo.java
@@ -2,5 +2,8 @@
import java.io.Serializable;
/**
 *
 */
public class FloorVo extends Vo implements Serializable {
}
java110-bean/src/main/java/com/java110/vo/MorePageVo.java
New file
@@ -0,0 +1,48 @@
package com.java110.vo;
import java.io.Serializable;
/**
 * @ClassName MorePageVo
 * @Description TODO
 * @Author wuxw
 * @Date 2019/4/24 11:19
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
public class MorePageVo extends Vo implements Serializable {
    // 分页页数
    private int page;
    // 行数
    private int rows;
    // 总记录数
    private int total;
    public int getPage() {
        return page;
    }
    public void setPage(int page) {
        this.page = page;
    }
    public int getRows() {
        return rows;
    }
    public void setRows(int rows) {
        this.rows = rows;
    }
    public int getTotal() {
        return total;
    }
    public void setTotal(int total) {
        this.total = total;
    }
}
java110-bean/src/main/java/com/java110/vo/api/ApiFloorDataVo.java
New file
@@ -0,0 +1,83 @@
package com.java110.vo.api;
import com.java110.vo.Vo;
/**
 * @ClassName ApiFloorDataVo
 * @Description TODO
 * @Author wuxw
 * @Date 2019/4/24 11:18
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
public class ApiFloorDataVo  extends Vo {
    /**
     * floorId
     */
    private String floorId;
    /**
     * 编号
     */
    private String floorNum;
    /**
     * 名称
     */
    private String floorName;
    private String remark;
    private String userName;
    private String createTime;
    public String getFloorId() {
        return floorId;
    }
    public void setFloorId(String floorId) {
        this.floorId = floorId;
    }
    public String getFloorNum() {
        return floorNum;
    }
    public void setFloorNum(String floorNum) {
        this.floorNum = floorNum;
    }
    public String getFloorName() {
        return floorName;
    }
    public void setFloorName(String floorName) {
        this.floorName = floorName;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getUserName() {
        return userName;
    }
    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getCreateTime() {
        return createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}
java110-bean/src/main/java/com/java110/vo/api/ApiFloorVo.java
@@ -1,81 +1,24 @@
package com.java110.vo.api;
import com.java110.vo.Vo;
import com.java110.vo.MorePageVo;
import java.io.Serializable;
import java.util.List;
/**
 * API 查询小区楼返回对象
 */
public class ApiFloorVo extends Vo implements Serializable {
    /**
     * floorId
     */
    private String floorId;
    /**
     * 编号
     */
    private String floorNum;
    /**
     * 名称
     */
    private String floorName;
    private String remark;
    private String userName;
    private String createTime;
public class ApiFloorVo  extends MorePageVo implements Serializable {
    public String getFloorId() {
        return floorId;
    private List<ApiFloorDataVo> apiFloorDataVoList;
    public List<ApiFloorDataVo> getApiFloorDataVoList() {
        return apiFloorDataVoList;
    }
    public void setFloorId(String floorId) {
        this.floorId = floorId;
    }
    public String getFloorNum() {
        return floorNum;
    }
    public void setFloorNum(String floorNum) {
        this.floorNum = floorNum;
    }
    public String getFloorName() {
        return floorName;
    }
    public void setFloorName(String floorName) {
        this.floorName = floorName;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getUserName() {
        return userName;
    }
    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getCreateTime() {
        return createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    public void setApiFloorDataVoList(List<ApiFloorDataVo> apiFloorDataVoList) {
        this.apiFloorDataVoList = apiFloorDataVoList;
    }
}
java110-common/src/main/java/com/java110/common/util/Assert.java
@@ -11,135 +11,143 @@
 * 自定义 断言
 * Created by wuxw on 2017/4/22.
 */
public class Assert extends org.springframework.util.Assert{
public class Assert extends org.springframework.util.Assert {
    /**
     * 判断 jsonObject 是否为空
     *
     * @param jsonObject
     * @param key
     * @param message
     */
    public static void isNotNull(Map jsonObject,String key,String message){
        Assert.notEmpty(jsonObject,message);
    public static void isNotNull(Map jsonObject, String key, String message) {
        Assert.notEmpty(jsonObject, message);
        if(!jsonObject.containsKey(key)){
            throw new IllegalArgumentException(message) ;
        }
    }
    /**
     * 判断 jsonObject 是否为空
     * @param jsonObject
     * @param key
     * @param message
     */
    public static void jsonObjectHaveKey(JSONObject jsonObject,String key,String message){
        isNotNull(jsonObject,key,message);
    }
    /**
     * 判断 jsonObject 是否为空
     * @param jsonStr
     * @param key
     * @param message
     */
    public static void jsonObjectHaveKey(String jsonStr,String key,String message){
        Assert.hasLength(jsonStr,"不是有效的json为空,"+message);
        if(isJsonObject(jsonStr)) {
            JSONObject jsonObject = JSONObject.parseObject(jsonStr);
            isNotNull(jsonObject, key, message);
        }else{
        if (!jsonObject.containsKey(key)) {
            throw new IllegalArgumentException(message);
        }
    }
    /**
     * 判断 jsonObject 是否为空
     * @param info
     *
     * @param jsonObject
     * @param key
     * @param message
     */
    public static void hasKey(Map info,String key,String message){
        isNotNull(info,key,message);
    public static void jsonObjectHaveKey(JSONObject jsonObject, String key, String message) {
        isNotNull(jsonObject, key, message);
    }
    /**
     * 判断 jsonObject 是否为空
     *
     * @param jsonStr
     * @param key
     * @param message
     */
    public static void jsonObjectHaveKey(String jsonStr, String key, String message) {
        Assert.hasLength(jsonStr, "不是有效的json为空," + message);
        if (isJsonObject(jsonStr)) {
            JSONObject jsonObject = JSONObject.parseObject(jsonStr);
            isNotNull(jsonObject, key, message);
        } else {
            throw new IllegalArgumentException(message);
        }
    }
    /**
     * 判断 jsonObject 是否为空
     *
     * @param info
     * @param key
     * @param message
     */
    public static void hasKeyAndValue(Map info,String key,String message){
        isNotNull(info,key,message);
        hasLength(info.get(key)== null?"":info.get(key).toString(),message);
    public static void hasKey(Map info, String key, String message) {
        isNotNull(info, key, message);
    }
    /**
     * 判断 jsonObject 是否为空
     *
     * @param info
     * @param key
     * @param message
     */
    public static void hasKeyAndValue(Map info, String key, String message) {
        isNotNull(info, key, message);
        hasLength(info.get(key) == null ? "" : info.get(key).toString(), message);
    }
    /**
     * 判断json是否为空
     *
     * @param jsonArray
     * @param message
     */
    public static void listIsNull(List jsonArray,String message){
    public static void listIsNull(List jsonArray, String message) {
        if(jsonArray != null && jsonArray.size() > 0 ){
            throw new IllegalArgumentException(message) ;
        if (jsonArray != null && jsonArray.size() > 0) {
            throw new IllegalArgumentException(message);
        }
    }
    /**
     * 判断json是否为空
     *
     * @param jsonArray
     * @param message
     */
    public static void listNotNull(List jsonArray,String message){
    public static void listNotNull(List jsonArray, String message) {
        Assert.notNull(jsonArray,message);
        Assert.notNull(jsonArray, message);
        if(jsonArray.size()< 1){
            throw new IllegalArgumentException(message) ;
        if (jsonArray.size() < 1) {
            throw new IllegalArgumentException(message);
        }
    }
    /**
     * 判断list 是否为空
     *
     * @param targetList
     * @param message
     */
    public static void isNotNull(List<?> targetList , String message){
    public static void isNotNull(List<?> targetList, String message) {
        Assert.notNull(targetList,message);
        Assert.notNull(targetList, message);
        if(targetList.size()< 1){
            throw new IllegalArgumentException(message) ;
        if (targetList.size() < 1) {
            throw new IllegalArgumentException(message);
        }
    }
    /**
     * 判断是否只有一条记录数据
     *
     * @param targetList
     * @param message
     */
    public static void isOne(List<?> targetList,String message){
        Assert.isNull(targetList,message);
    public static void isOne(List<?> targetList, String message) {
        Assert.isNull(targetList, message);
        if(targetList.size() != 1){
            throw new IllegalArgumentException(message) ;
        if (targetList.size() != 1) {
            throw new IllegalArgumentException(message);
        }
    }
    /**
     * 校验map 中是否有值
     *
     * @param targetMap
     * @param message
     */
    public static void hasSize(Map<?,?> targetMap, String message){
        Assert.isNull(targetMap,message);
    public static void hasSize(Map<?, ?> targetMap, String message) {
        Assert.isNull(targetMap, message);
        if(targetMap.size() < 1){
        if (targetMap.size() < 1) {
            throw new IllegalArgumentException(message);
        }
@@ -147,36 +155,38 @@
    /**
     * 判断 jsonObject 是否为空
     *
     * @param strValue
     * @param message
     */
    public static void isJsonObject(String strValue,String message){
        if(!isJsonObject(strValue)){
    public static void isJsonObject(String strValue, String message) {
        if (!isJsonObject(strValue)) {
            throw new IllegalArgumentException(message);
        }
    }
    /**
     * 校验是否为JSON
     *
     * @param msg
     * @return
     */
    public static Boolean isJsonObject(String msg) {
        try{
        try {
            JSONObject.parseObject(msg);
        }catch (Exception e){
        } catch (Exception e) {
            return false;
        }
        return true;
    }
    public static Boolean isPageJsonObject(String msg){
        try{
    public static Boolean isPageJsonObject(String msg) {
        try {
            JSONObject jsonObject = JSONObject.parseObject(msg);
            if(!jsonObject.containsKey("meta") || !jsonObject.containsKey("param")){
            if (!jsonObject.containsKey("meta") || !jsonObject.containsKey("param")) {
                return false;
            }
        }catch (Exception e){
        } catch (Exception e) {
            return false;
        }
        return true;
@@ -184,19 +194,20 @@
    /**
     * 校验是否为整数
     *
     * @param text
     * @param msg
     */
    public static void isInteger(String text,String msg){
        if(!StringUtils.isNumeric(text)){
    public static void isInteger(String text, String msg) {
        if (!StringUtils.isNumeric(text)) {
            throw new IllegalArgumentException(msg);
        }
    }
    public static void isDate(String text,String msg){
        try{
    public static void isDate(String text, String msg) {
        try {
            DateUtil.getDefaultDateFromString(text);
        }catch (Exception e){
        } catch (Exception e) {
            throw new IllegalArgumentException(msg);
        }
    }
java110-common/src/main/java/com/java110/common/util/BeanConvertUtil.java
New file
@@ -0,0 +1,120 @@
package com.java110.common.util;
import org.apache.commons.beanutils.BeanUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @ClassName BeanConvertUtil
 * @Description bean 转化工具类
 * @Author wuxw
 * @Date 2019/4/24 12:53
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
public final class BeanConvertUtil {
    private BeanConvertUtil() {
    }
    /**
     * 对象A转为对象B
     * 这个也支持map转bean
     *
     * @param orgBean 原始对象
     * @param dstBean 目标对象类
     * @param <T1>    原始对象
     * @param <T2>    目标对象
     * @return 目标对象
     */
    public static <T1, T2> T2 covertBean(T1 orgBean, T2 dstBean) {
        try {
            BeanUtils.copyProperties(dstBean, orgBean);
        } catch (Exception e) {
            throw new RuntimeException("bean转换bean失败", e);
        }
        return dstBean;
    }
    /**
     * 对象A转为对象B (类)
     * 这个也支持map转bean
     *
     * @param orgBean 原始对象
     * @param t       目标对象类
     * @param <T1>    原始对象
     * @param <T2>    目标对象
     * @return 目标对象
     */
    public static <T1, T2> T2 covertBean(T1 orgBean, Class<T2> t) {
        T2 returnModel = null;
        try {
            returnModel = t.newInstance();
            BeanUtils.copyProperties(returnModel, orgBean);
        } catch (Exception e) {
            throw new RuntimeException("bean转换bean失败", e);
        }
        return returnModel;
    }
    /**
     * 对象A集合转为对象B集合
     *
     * @param orgBeans 原始对象列表
     * @param t        目标对象类
     * @param <T1>     原始对象
     * @param <T2>     目标对象
     * @return 目标对象
     */
    public static <T1, T2> List<T2> covertBeanList(List<T1> orgBeans, Class<T2> t) {
        List<T2> newBeanList = new ArrayList<T2>();
        for (T1 orgbean : orgBeans) {
            T2 newBean = covertBean(orgbean, t);
            newBeanList.add(newBean);
        }
        return newBeanList;
    }
    /**
     * bean转换为map对象
     *
     * @param orgBean 原始bean
     * @return map对象
     */
    public static  Map<String, Object> beanCovertMap(Object orgBean) {
        Map<String, Object> newMap = new HashMap<String, Object>();
        try {
            BeanUtils.populate(orgBean, newMap);
        } catch (Exception e) {
            throw new RuntimeException("bean转换Map失败", e);
        }
        return newMap;
    }
    /**
     * bean集合转换为map对象集合
     *
     * @param orgBeans 原始bean 列表
     * @return map对象 列表
     */
    public static List<Map<String, Object>> beanCovertMapList(List<Object> orgBeans) {
        List<Map<String, Object>> newMaps = new ArrayList<Map<String, Object>>();
        Map<String, Object> newMap = null;
        for (Object orgbean : orgBeans) {
            newMap = beanCovertMap(orgbean);
            newMaps.add(newMap);
        }
        return newMaps;
    }
}
java110-config/src/main/resources/mapper/floor/FloorServiceDaoImplMapper.xml
@@ -132,4 +132,38 @@
    </update>
    <select id="queryFloorsCount" parameterType="String" resultType="Map">
        SELECT
            COUNT(1) count
        FROM
            f_floor f,
            s_community_member cm
        WHERE f.`floor_id` = cm.`member_id`
            AND cm.`member_type_cd` = '390001200004'
            AND cm.`community_id` = #{communityId}
            AND f.`status_cd` = '0'
            AND cm.`status_cd` = '0'
    </select>
    <!-- 查询小区 内的楼 -->
    <select id="queryFloors" parameterType="Map" resultType="Map">
        SELECT
            f.`floor_id` floorId,
            f.`floor_num` floorNum,
            f.`name`,
            f.`remark`,
            f.`user_id` userId,
            cm.`community_id` communityId
        FROM
            f_floor f,
            s_community_member cm
        WHERE f.`floor_id` = cm.`member_id`
            AND cm.`member_type_cd` = '390001200004'
            AND cm.`community_id` = #{communityId}
            AND f.`status_cd` = '0'
            AND cm.`status_cd` = '0'
            LIMIT #{page}, #{row}
    </select>
</mapper>
java110-config/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml
@@ -271,6 +271,12 @@
        <if test="statusCd !=null and statusCd != ''">
            and u.status_cd = #{statusCd}
        </if>
        <if test="userIds != null and userIds != null">
            and u.user_id in
                <foreach collection="userIds" item="item" open="(" close=")" separator=",">
                    #{item}
                </foreach>
        </if>
    </select>
java110-core/src/main/java/com/java110/core/context/DataFlowContext.java
@@ -19,60 +19,60 @@
     * 请求报文
     * @return
     */
    public String getReqData();
     String getReqData();
    //AppId
    public String getAppId();
     String getAppId();
    public JSONObject getReqJson();
     JSONObject getReqJson();
    /**
     * 返回报文
     * @return
     */
    public JSONObject getResJson();
     JSONObject getResJson();
    /**
     * 添加各个环节的耗时
     * @param dataFlowLinksCost
     */
    public void addLinksCostDates(DataFlowLinksCost dataFlowLinksCost);
     void addLinksCostDates(DataFlowLinksCost dataFlowLinksCost);
    /**
     * 添加日志信息
     * @param dataFlowLog
     */
    public void addLogDatas(DataFlowLog dataFlowLog);
     void addLogDatas(DataFlowLog dataFlowLog);
    public List<DataFlowLinksCost> getLinksCostDates();
     List<DataFlowLinksCost> getLinksCostDates();
    public List<Business> getBusinesses();
     List<Business> getBusinesses();
    /**
     * 源请求头信息
     * @return
     */
    public Map<String, String> getRequestHeaders();
     Map<String, String> getRequestHeaders();
    /**
     * 终返回头信息
     * @return
     */
    public Map<String, String> getResponseHeaders();
     Map<String, String> getResponseHeaders();
    /**
     * 当前请求头信息
     * @return
     */
    public Map<String, String> getRequestCurrentHeaders();
     Map<String, String> getRequestCurrentHeaders();
    /**
     * 当前返回头信息
     * @return
     */
    public Map<String, String> getResponseCurrentHeaders();
     Map<String, String> getResponseCurrentHeaders();
    public IOrders getOrder();
     IOrders getOrder();
    /**
java110-core/src/main/java/com/java110/core/smo/floor/IFloorInnerServiceSMO.java
New file
@@ -0,0 +1,44 @@
package com.java110.core.smo.floor;
import com.java110.dto.FloorDto;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
 * @ClassName IFloorInnerServiceSMO
 * @Description 小区楼接口类
 * @Author wuxw
 * @Date 2019/4/24 9:04
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
@FeignClient("community-service")
@RequestMapping("/floorApi")
public interface IFloorInnerServiceSMO {
    /**
     * <p>查询小区楼信息</p>
     *
     * @param page        页数
     * @param row         行数
     * @param communityId 小区ID
     * @return FloorDto 对象数据
     */
    @RequestMapping(value = "/queryFloors", method = RequestMethod.GET)
    List<FloorDto> queryFloors(@RequestParam("page") int page,
                               @RequestParam("row") int row,
                               @RequestParam("communityId") String communityId);
    /**
     * 查询<p>小区楼</p>总记录数
     *
     * @param communityId 小区ID
     * @return 小区下的小区楼记录数
     */
    @RequestMapping(value = "/queryFloorsCount", method = RequestMethod.GET)
    int queryFloorsCount(@RequestParam("communityId") String communityId);
}
java110-core/src/main/java/com/java110/core/smo/user/IUserInnerServiceSMO.java
@@ -1,9 +1,12 @@
package com.java110.core.smo.user;
import com.java110.dto.UserDto;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
 * 用户服务接口类(供服务间调用)
@@ -14,9 +17,20 @@
    /**
     * 查询用户服务版本
     * @param code
     * @return
     *
     * @param code 编码 没有任何意义 随便传一个字符串就可以
     * @return 编码 + 版本号
     */
    @RequestMapping(value = "/getUserServiceVersion",method = RequestMethod.GET)
    @RequestMapping(value = "/getUserServiceVersion", method = RequestMethod.GET)
    String getUserServiceVersion(@RequestParam("code") String code);
    /**
     * 查询用户信息
     *
     * @param userIds 用户ID
     *                支持 多个查询
     * @return 用户封装信息
     */
    @RequestMapping(value = "/getUserInfo", method = RequestMethod.GET)
    List<UserDto> getUserInfo(@RequestParam("userIds") String[] userIds);
}