Przeglądaj źródła

添加员工开发完成 待测试

wuxw 6 lat temu
rodzic
commit
29d4854acc
21 zmienionych plików z 1650 dodań i 48 usunięć
  1. 10 9
      Api/src/main/java/com/java110/api/listener/users/AddStaffServiceListener.java
  2. 81 0
      UserService/src/main/java/com/java110/user/dao/IOrgStaffRelServiceDao.java
  3. 129 0
      UserService/src/main/java/com/java110/user/dao/impl/OrgStaffRelServiceDaoImpl.java
  4. 83 0
      UserService/src/main/java/com/java110/user/listener/org/AbstractOrgStaffRelBusinessServiceDataFlowListener.java
  5. 180 0
      UserService/src/main/java/com/java110/user/listener/org/DeleteOrgStaffRelInfoListener.java
  6. 179 0
      UserService/src/main/java/com/java110/user/listener/org/SaveOrgStaffRelInfoListener.java
  7. 190 0
      UserService/src/main/java/com/java110/user/listener/org/UpdateOrgStaffRelInfoListener.java
  8. 73 0
      UserService/src/main/java/com/java110/user/smo/impl/OrgStaffRelInnerServiceSMOImpl.java
  9. 2 0
      WebService/src/main/java/com/java110/web/smo/impl/StaffServiceSMOImpl.java
  10. 2 1
      WebService/src/main/resources/components/staffPackage/addStaffStep/addStaffStep.js
  11. 47 32
      WebService/src/main/resources/components/staffPackage/addStaffView/addStaffView.html
  12. 13 0
      WebService/src/main/resources/components/staffPackage/addStaffView/addStaffView.js
  13. 114 0
      docs/document/services/org/DeleteOrgStaffRelInfo.md
  14. 122 0
      docs/document/services/org/SaveOrgStaffRelInfo.md
  15. 122 0
      docs/document/services/org/UpdateOrgStaffRelInfo.md
  16. 86 0
      java110-bean/src/main/java/com/java110/dto/org/OrgStaffRelDto.java
  17. 1 1
      java110-code-generator/src/main/java/com/java110/OrgStaffRelGeneratorApplication.java
  18. 1 0
      java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
  19. 41 0
      java110-core/src/main/java/com/java110/core/smo/org/IOrgStaffRelInnerServiceSMO.java
  20. 171 0
      java110-db/src/main/resources/mapper/user/OrgStaffRelServiceDaoImplMapper.xml
  21. 3 5
      java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java

+ 10 - 9
Api/src/main/java/com/java110/api/listener/users/AddStaffServiceListener.java

@@ -113,17 +113,17 @@ public class AddStaffServiceListener extends AbstractServiceApiDataFlowListener{
     private JSONObject addStaffOrg(JSONObject paramInJson) {
 
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
-        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_STORE_USER);
+        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ORG_STAFF_REL);
         business.put(CommonConstant.HTTP_SEQ,1);
         business.put(CommonConstant.HTTP_INVOKE_MODEL,CommonConstant.HTTP_INVOKE_MODEL_S);
-        JSONArray businessStaffOrgs = new JSONArray();
-        JSONObject businessStaffOrg = new JSONObject();
-        businessStaffOrg.put("storeId",paramInJson.getString("storeId"));
-        businessStaffOrg.put("storeUserId","-1");
-        businessStaffOrg.put("userId",paramInJson.getString("userId"));
-        businessStaffOrg.put("relCd",paramInJson.getString("relCd"));
-        businessStaffOrgs.add(businessStaffOrg);
-        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessStoreUser",businessStaffOrgs);
+        JSONArray businessOrgStaffRels = new JSONArray();
+        JSONObject businessOrgStaffRel = new JSONObject();
+        businessOrgStaffRel.put("storeId",paramInJson.getString("storeId"));
+        businessOrgStaffRel.put("staffId",paramInJson.getString("userId"));
+        businessOrgStaffRel.put("orgId",paramInJson.getString("orgId"));
+        businessOrgStaffRel.put("relCd",paramInJson.getString("relCd"));
+        businessOrgStaffRels.add(businessOrgStaffRel);
+        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessOrgStaffRel",businessOrgStaffRels);
 
         return business;
     }
@@ -164,6 +164,7 @@ public class AddStaffServiceListener extends AbstractServiceApiDataFlowListener{
         Assert.jsonObjectHaveKey(paramObj,"orgId", "请求报文格式错误或未包含部门信息");
         Assert.jsonObjectHaveKey(paramObj,"address", "请求报文格式错误或未包含地址信息");
         Assert.jsonObjectHaveKey(paramObj,"sex", "请求报文格式错误或未包含性别信息");
+        Assert.jsonObjectHaveKey(paramObj,"relCd", "请求报文格式错误或未包含员工角色");
 
         JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
         business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_USER_INFO);

+ 81 - 0
UserService/src/main/java/com/java110/user/dao/IOrgStaffRelServiceDao.java

@@ -0,0 +1,81 @@
+package com.java110.user.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 IOrgStaffRelServiceDao {
+
+    /**
+     * 保存 组织员工关系信息
+     * @param businessOrgStaffRelInfo 组织员工关系信息 封装
+     * @throws DAOException 操作数据库异常
+     */
+    void saveBusinessOrgStaffRelInfo(Map businessOrgStaffRelInfo) throws DAOException;
+
+
+
+    /**
+     * 查询组织员工关系信息(business过程)
+     * 根据bId 查询组织员工关系信息
+     * @param info bId 信息
+     * @return 组织员工关系信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getBusinessOrgStaffRelInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 保存 组织员工关系信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveOrgStaffRelInfoInstance(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询组织员工关系信息(instance过程)
+     * 根据bId 查询组织员工关系信息
+     * @param info bId 信息
+     * @return 组织员工关系信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getOrgStaffRelInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改组织员工关系信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateOrgStaffRelInfoInstance(Map info) throws DAOException;
+
+
+    /**
+     * 查询组织员工关系总数
+     *
+     * @param info 组织员工关系信息
+     * @return 组织员工关系数量
+     */
+    int queryOrgStaffRelsCount(Map info);
+
+}

+ 129 - 0
UserService/src/main/java/com/java110/user/dao/impl/OrgStaffRelServiceDaoImpl.java

@@ -0,0 +1,129 @@
+package com.java110.user.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.user.dao.IOrgStaffRelServiceDao;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 组织员工关系服务 与数据库交互
+ * Created by wuxw on 2017/4/5.
+ */
+@Service("orgStaffRelServiceDaoImpl")
+//@Transactional
+public class OrgStaffRelServiceDaoImpl extends BaseServiceDao implements IOrgStaffRelServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(OrgStaffRelServiceDaoImpl.class);
+
+    /**
+     * 组织员工关系信息封装
+     * @param businessOrgStaffRelInfo 组织员工关系信息 封装
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveBusinessOrgStaffRelInfo(Map businessOrgStaffRelInfo) throws DAOException {
+        businessOrgStaffRelInfo.put("month", DateUtil.getCurrentMonth());
+        // 查询business_user 数据是否已经存在
+        logger.debug("保存组织员工关系信息 入参 businessOrgStaffRelInfo : {}",businessOrgStaffRelInfo);
+        int saveFlag = sqlSessionTemplate.insert("orgStaffRelServiceDaoImpl.saveBusinessOrgStaffRelInfo",businessOrgStaffRelInfo);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存组织员工关系数据失败:"+ JSONObject.toJSONString(businessOrgStaffRelInfo));
+        }
+    }
+
+
+    /**
+     * 查询组织员工关系信息
+     * @param info bId 信息
+     * @return 组织员工关系信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getBusinessOrgStaffRelInfo(Map info) throws DAOException {
+
+        logger.debug("查询组织员工关系信息 入参 info : {}",info);
+
+        List<Map> businessOrgStaffRelInfos = sqlSessionTemplate.selectList("orgStaffRelServiceDaoImpl.getBusinessOrgStaffRelInfo",info);
+
+        return businessOrgStaffRelInfos;
+    }
+
+
+
+    /**
+     * 保存组织员工关系信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveOrgStaffRelInfoInstance(Map info) throws DAOException {
+        logger.debug("保存组织员工关系信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("orgStaffRelServiceDaoImpl.saveOrgStaffRelInfoInstance",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> getOrgStaffRelInfo(Map info) throws DAOException {
+        logger.debug("查询组织员工关系信息 入参 info : {}",info);
+
+        List<Map> businessOrgStaffRelInfos = sqlSessionTemplate.selectList("orgStaffRelServiceDaoImpl.getOrgStaffRelInfo",info);
+
+        return businessOrgStaffRelInfos;
+    }
+
+
+    /**
+     * 修改组织员工关系信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateOrgStaffRelInfoInstance(Map info) throws DAOException {
+        logger.debug("修改组织员工关系信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("orgStaffRelServiceDaoImpl.updateOrgStaffRelInfoInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改组织员工关系信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 查询组织员工关系数量
+     * @param info 组织员工关系信息
+     * @return 组织员工关系数量
+     */
+    @Override
+    public int queryOrgStaffRelsCount(Map info) {
+        logger.debug("查询组织员工关系数据 入参 info : {}",info);
+
+        List<Map> businessOrgStaffRelInfos = sqlSessionTemplate.selectList("orgStaffRelServiceDaoImpl.queryOrgStaffRelsCount", info);
+        if (businessOrgStaffRelInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessOrgStaffRelInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 83 - 0
UserService/src/main/java/com/java110/user/listener/org/AbstractOrgStaffRelBusinessServiceDataFlowListener.java

@@ -0,0 +1,83 @@
+package com.java110.user.listener.org;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.entity.center.Business;
+import com.java110.event.service.AbstractBusinessServiceDataFlowListener;
+import com.java110.user.dao.IOrgStaffRelServiceDao;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.exception.ListenerExecuteException;
+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 AbstractOrgStaffRelBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener {
+    private static Logger logger = LoggerFactory.getLogger(AbstractOrgStaffRelBusinessServiceDataFlowListener.class);
+
+
+    /**
+     * 获取 DAO工具类
+     *
+     * @return
+     */
+    public abstract IOrgStaffRelServiceDao getOrgStaffRelServiceDaoImpl();
+
+    /**
+     * 刷新 businessOrgStaffRelInfo 数据
+     * 主要将 数据库 中字段和 接口传递字段建立关系
+     *
+     * @param businessOrgStaffRelInfo
+     */
+    protected void flushBusinessOrgStaffRelInfo(Map businessOrgStaffRelInfo, String statusCd) {
+        businessOrgStaffRelInfo.put("newBId", businessOrgStaffRelInfo.get("b_id"));
+        businessOrgStaffRelInfo.put("relId", businessOrgStaffRelInfo.get("rel_id"));
+        businessOrgStaffRelInfo.put("operate", businessOrgStaffRelInfo.get("operate"));
+        businessOrgStaffRelInfo.put("storeId", businessOrgStaffRelInfo.get("store_id"));
+        businessOrgStaffRelInfo.put("orgId", businessOrgStaffRelInfo.get("org_id"));
+        businessOrgStaffRelInfo.put("staffId", businessOrgStaffRelInfo.get("staff_id"));
+        businessOrgStaffRelInfo.put("relCd", businessOrgStaffRelInfo.get("rel_cd"));
+        businessOrgStaffRelInfo.remove("bId");
+        businessOrgStaffRelInfo.put("statusCd", statusCd);
+    }
+
+
+    /**
+     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
+     *
+     * @param businessOrgStaffRel 组织员工关系信息
+     */
+    protected void autoSaveDelBusinessOrgStaffRel(Business business, JSONObject businessOrgStaffRel) {
+//自动插入DEL
+        Map info = new HashMap();
+        info.put("relId", businessOrgStaffRel.getString("relId"));
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
+        List<Map> currentOrgStaffRelInfos = getOrgStaffRelServiceDaoImpl().getOrgStaffRelInfo(info);
+        if (currentOrgStaffRelInfos == null || currentOrgStaffRelInfos.size() != 1) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info);
+        }
+
+        Map currentOrgStaffRelInfo = currentOrgStaffRelInfos.get(0);
+
+        currentOrgStaffRelInfo.put("bId", business.getbId());
+
+        currentOrgStaffRelInfo.put("relId", currentOrgStaffRelInfo.get("rel_id"));
+        currentOrgStaffRelInfo.put("operate", currentOrgStaffRelInfo.get("operate"));
+        currentOrgStaffRelInfo.put("storeId", currentOrgStaffRelInfo.get("store_id"));
+        currentOrgStaffRelInfo.put("orgId", currentOrgStaffRelInfo.get("org_id"));
+        currentOrgStaffRelInfo.put("staffId", currentOrgStaffRelInfo.get("staff_id"));
+        currentOrgStaffRelInfo.put("relCd", currentOrgStaffRelInfo.get("rel_cd"));
+
+
+        currentOrgStaffRelInfo.put("operate", StatusConstant.OPERATE_DEL);
+        getOrgStaffRelServiceDaoImpl().saveBusinessOrgStaffRelInfo(currentOrgStaffRelInfo);
+    }
+
+
+}

+ 180 - 0
UserService/src/main/java/com/java110/user/listener/org/DeleteOrgStaffRelInfoListener.java

@@ -0,0 +1,180 @@
+package com.java110.user.listener.org;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+import com.java110.user.dao.IOrgStaffRelServiceDao;
+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 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、businessOrgStaffRel:{} 组织员工关系基本信息节点
+ * 2、businessOrgStaffRelAttr:[{}] 组织员工关系属性信息节点
+ * 3、businessOrgStaffRelPhoto:[{}] 组织员工关系照片信息节点
+ * 4、businessOrgStaffRelCerdentials:[{}] 组织员工关系证件信息节点
+ * 协议地址 :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("deleteOrgStaffRelInfoListener")
+@Transactional
+public class DeleteOrgStaffRelInfoListener extends AbstractOrgStaffRelBusinessServiceDataFlowListener {
+
+    private final static Logger logger = LoggerFactory.getLogger(DeleteOrgStaffRelInfoListener.class);
+    @Autowired
+    IOrgStaffRelServiceDao orgStaffRelServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 3;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_ORG_STAFF_REL;
+    }
+
+    /**
+     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
+     *
+     * @param dataFlowContext 数据对象
+     * @param business        当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessOrgStaffRel 节点
+        if (data.containsKey("businessOrgStaffRel")) {
+            //处理 businessOrgStaffRel 节点
+            if (data.containsKey("businessOrgStaffRel")) {
+                Object _obj = data.get("businessOrgStaffRel");
+                JSONArray businessOrgStaffRels = null;
+                if (_obj instanceof JSONObject) {
+                    businessOrgStaffRels = new JSONArray();
+                    businessOrgStaffRels.add(_obj);
+                } else {
+                    businessOrgStaffRels = (JSONArray) _obj;
+                }
+                //JSONObject businessOrgStaffRel = data.getJSONObject("businessOrgStaffRel");
+                for (int _orgStaffRelIndex = 0; _orgStaffRelIndex < businessOrgStaffRels.size(); _orgStaffRelIndex++) {
+                    JSONObject businessOrgStaffRel = businessOrgStaffRels.getJSONObject(_orgStaffRelIndex);
+                    doBusinessOrgStaffRel(business, businessOrgStaffRel);
+                    if (_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("relId", businessOrgStaffRel.getString("relId"));
+                    }
+                }
+            }
+        }
+
+
+    }
+
+    /**
+     * 删除 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> businessOrgStaffRelInfos = orgStaffRelServiceDaoImpl.getBusinessOrgStaffRelInfo(info);
+        if (businessOrgStaffRelInfos != null && businessOrgStaffRelInfos.size() > 0) {
+            for (int _orgStaffRelIndex = 0; _orgStaffRelIndex < businessOrgStaffRelInfos.size(); _orgStaffRelIndex++) {
+                Map businessOrgStaffRelInfo = businessOrgStaffRelInfos.get(_orgStaffRelIndex);
+                flushBusinessOrgStaffRelInfo(businessOrgStaffRelInfo, StatusConstant.STATUS_CD_INVALID);
+                orgStaffRelServiceDaoImpl.updateOrgStaffRelInfoInstance(businessOrgStaffRelInfo);
+                dataFlowContext.addParamOut("relId", businessOrgStaffRelInfo.get("rel_id"));
+            }
+        }
+
+    }
+
+    /**
+     * 撤单
+     * 从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> orgStaffRelInfo = orgStaffRelServiceDaoImpl.getOrgStaffRelInfo(info);
+        if (orgStaffRelInfo != null && orgStaffRelInfo.size() > 0) {
+
+            //组织员工关系信息
+            List<Map> businessOrgStaffRelInfos = orgStaffRelServiceDaoImpl.getBusinessOrgStaffRelInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if (businessOrgStaffRelInfos == null || businessOrgStaffRelInfos.size() == 0) {
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(orgStaffRel),程序内部异常,请检查! " + delInfo);
+            }
+            for (int _orgStaffRelIndex = 0; _orgStaffRelIndex < businessOrgStaffRelInfos.size(); _orgStaffRelIndex++) {
+                Map businessOrgStaffRelInfo = businessOrgStaffRelInfos.get(_orgStaffRelIndex);
+                flushBusinessOrgStaffRelInfo(businessOrgStaffRelInfo, StatusConstant.STATUS_CD_VALID);
+                orgStaffRelServiceDaoImpl.updateOrgStaffRelInfoInstance(businessOrgStaffRelInfo);
+            }
+        }
+    }
+
+
+    /**
+     * 处理 businessOrgStaffRel 节点
+     *
+     * @param business            总的数据节点
+     * @param businessOrgStaffRel 组织员工关系节点
+     */
+    private void doBusinessOrgStaffRel(Business business, JSONObject businessOrgStaffRel) {
+
+        Assert.jsonObjectHaveKey(businessOrgStaffRel, "relId", "businessOrgStaffRel 节点下没有包含 relId 节点");
+
+        if (businessOrgStaffRel.getString("relId").startsWith("-")) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "relId 错误,不能自动生成(必须已经存在的relId)" + businessOrgStaffRel);
+        }
+        //自动插入DEL
+        autoSaveDelBusinessOrgStaffRel(business, businessOrgStaffRel);
+    }
+
+    public IOrgStaffRelServiceDao getOrgStaffRelServiceDaoImpl() {
+        return orgStaffRelServiceDaoImpl;
+    }
+
+    public void setOrgStaffRelServiceDaoImpl(IOrgStaffRelServiceDao orgStaffRelServiceDaoImpl) {
+        this.orgStaffRelServiceDaoImpl = orgStaffRelServiceDaoImpl;
+    }
+}

+ 179 - 0
UserService/src/main/java/com/java110/user/listener/org/SaveOrgStaffRelInfoListener.java

@@ -0,0 +1,179 @@
+package com.java110.user.listener.org;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+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 com.java110.user.dao.IOrgStaffRelServiceDao;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.util.Assert;
+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("saveOrgStaffRelInfoListener")
+@Transactional
+public class SaveOrgStaffRelInfoListener extends AbstractOrgStaffRelBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(SaveOrgStaffRelInfoListener.class);
+
+    @Autowired
+    private IOrgStaffRelServiceDao orgStaffRelServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 0;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_ORG_STAFF_REL;
+    }
+
+    /**
+     * 保存组织员工关系信息 business 表中
+     *
+     * @param dataFlowContext 数据对象
+     * @param business        当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessOrgStaffRel 节点
+        if (data.containsKey("businessOrgStaffRel")) {
+            Object bObj = data.get("businessOrgStaffRel");
+            JSONArray businessOrgStaffRels = null;
+            if (bObj instanceof JSONObject) {
+                businessOrgStaffRels = new JSONArray();
+                businessOrgStaffRels.add(bObj);
+            } else {
+                businessOrgStaffRels = (JSONArray) bObj;
+            }
+            //JSONObject businessOrgStaffRel = data.getJSONObject("businessOrgStaffRel");
+            for (int bOrgStaffRelIndex = 0; bOrgStaffRelIndex < businessOrgStaffRels.size(); bOrgStaffRelIndex++) {
+                JSONObject businessOrgStaffRel = businessOrgStaffRels.getJSONObject(bOrgStaffRelIndex);
+                doBusinessOrgStaffRel(business, businessOrgStaffRel);
+                if (bObj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("relId", businessOrgStaffRel.getString("relId"));
+                }
+            }
+        }
+    }
+
+    /**
+     * 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> businessOrgStaffRelInfo = orgStaffRelServiceDaoImpl.getBusinessOrgStaffRelInfo(info);
+        if (businessOrgStaffRelInfo != null && businessOrgStaffRelInfo.size() > 0) {
+            reFreshShareColumn(info, businessOrgStaffRelInfo.get(0));
+            orgStaffRelServiceDaoImpl.saveOrgStaffRelInfoInstance(info);
+            if (businessOrgStaffRelInfo.size() == 1) {
+                dataFlowContext.addParamOut("relId", businessOrgStaffRelInfo.get(0).get("rel_id"));
+            }
+        }
+    }
+
+
+    /**
+     * 刷 分片字段
+     *
+     * @param info         查询对象
+     * @param businessInfo 小区ID
+     */
+    private void reFreshShareColumn(Map info, Map businessInfo) {
+
+        if (info.containsKey("storeId")) {
+            return;
+        }
+
+        if (!businessInfo.containsKey("store_id")) {
+            return;
+        }
+
+        info.put("storeId", businessInfo.get("store_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> orgStaffRelInfo = orgStaffRelServiceDaoImpl.getOrgStaffRelInfo(info);
+        if (orgStaffRelInfo != null && orgStaffRelInfo.size() > 0) {
+            reFreshShareColumn(paramIn, orgStaffRelInfo.get(0));
+            orgStaffRelServiceDaoImpl.updateOrgStaffRelInfoInstance(paramIn);
+        }
+    }
+
+
+    /**
+     * 处理 businessOrgStaffRel 节点
+     *
+     * @param business            总的数据节点
+     * @param businessOrgStaffRel 组织员工关系节点
+     */
+    private void doBusinessOrgStaffRel(Business business, JSONObject businessOrgStaffRel) {
+
+        Assert.jsonObjectHaveKey(businessOrgStaffRel, "relId", "businessOrgStaffRel 节点下没有包含 relId 节点");
+
+        if (businessOrgStaffRel.getString("relId").startsWith("-")) {
+            //刷新缓存
+            //flushOrgStaffRelId(business.getDatas());
+
+            businessOrgStaffRel.put("relId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_relId));
+
+        }
+
+        businessOrgStaffRel.put("bId", business.getbId());
+        businessOrgStaffRel.put("operate", StatusConstant.OPERATE_ADD);
+        //保存组织员工关系信息
+        orgStaffRelServiceDaoImpl.saveBusinessOrgStaffRelInfo(businessOrgStaffRel);
+
+    }
+
+    public IOrgStaffRelServiceDao getOrgStaffRelServiceDaoImpl() {
+        return orgStaffRelServiceDaoImpl;
+    }
+
+    public void setOrgStaffRelServiceDaoImpl(IOrgStaffRelServiceDao orgStaffRelServiceDaoImpl) {
+        this.orgStaffRelServiceDaoImpl = orgStaffRelServiceDaoImpl;
+    }
+}

+ 190 - 0
UserService/src/main/java/com/java110/user/listener/org/UpdateOrgStaffRelInfoListener.java

@@ -0,0 +1,190 @@
+package com.java110.user.listener.org;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+import com.java110.user.dao.IOrgStaffRelServiceDao;
+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 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、businessOrgStaffRel:{} 组织员工关系基本信息节点
+ * 2、businessOrgStaffRelAttr:[{}] 组织员工关系属性信息节点
+ * 3、businessOrgStaffRelPhoto:[{}] 组织员工关系照片信息节点
+ * 4、businessOrgStaffRelCerdentials:[{}] 组织员工关系证件信息节点
+ * 协议地址 :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("updateOrgStaffRelInfoListener")
+@Transactional
+public class UpdateOrgStaffRelInfoListener extends AbstractOrgStaffRelBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateOrgStaffRelInfoListener.class);
+    @Autowired
+    private IOrgStaffRelServiceDao orgStaffRelServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 2;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_ORG_STAFF_REL;
+    }
+
+    /**
+     * business过程
+     *
+     * @param dataFlowContext 上下文对象
+     * @param business        业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessOrgStaffRel 节点
+        if (data.containsKey("businessOrgStaffRel")) {
+            //处理 businessOrgStaffRel 节点
+            if (data.containsKey("businessOrgStaffRel")) {
+                Object _obj = data.get("businessOrgStaffRel");
+                JSONArray businessOrgStaffRels = null;
+                if (_obj instanceof JSONObject) {
+                    businessOrgStaffRels = new JSONArray();
+                    businessOrgStaffRels.add(_obj);
+                } else {
+                    businessOrgStaffRels = (JSONArray) _obj;
+                }
+                //JSONObject businessOrgStaffRel = data.getJSONObject("businessOrgStaffRel");
+                for (int _orgStaffRelIndex = 0; _orgStaffRelIndex < businessOrgStaffRels.size(); _orgStaffRelIndex++) {
+                    JSONObject businessOrgStaffRel = businessOrgStaffRels.getJSONObject(_orgStaffRelIndex);
+                    doBusinessOrgStaffRel(business, businessOrgStaffRel);
+                    if (_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("relId", businessOrgStaffRel.getString("relId"));
+                    }
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 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> businessOrgStaffRelInfos = orgStaffRelServiceDaoImpl.getBusinessOrgStaffRelInfo(info);
+        if (businessOrgStaffRelInfos != null && businessOrgStaffRelInfos.size() > 0) {
+            for (int _orgStaffRelIndex = 0; _orgStaffRelIndex < businessOrgStaffRelInfos.size(); _orgStaffRelIndex++) {
+                Map businessOrgStaffRelInfo = businessOrgStaffRelInfos.get(_orgStaffRelIndex);
+                flushBusinessOrgStaffRelInfo(businessOrgStaffRelInfo, StatusConstant.STATUS_CD_VALID);
+                orgStaffRelServiceDaoImpl.updateOrgStaffRelInfoInstance(businessOrgStaffRelInfo);
+                if (businessOrgStaffRelInfo.size() == 1) {
+                    dataFlowContext.addParamOut("relId", businessOrgStaffRelInfo.get("rel_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 delInfo = new HashMap();
+        delInfo.put("bId", business.getbId());
+        delInfo.put("operate", StatusConstant.OPERATE_DEL);
+        //组织员工关系信息
+        List<Map> orgStaffRelInfo = orgStaffRelServiceDaoImpl.getOrgStaffRelInfo(info);
+        if (orgStaffRelInfo != null && orgStaffRelInfo.size() > 0) {
+
+            //组织员工关系信息
+            List<Map> businessOrgStaffRelInfos = orgStaffRelServiceDaoImpl.getBusinessOrgStaffRelInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if (businessOrgStaffRelInfos == null || businessOrgStaffRelInfos.size() == 0) {
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(orgStaffRel),程序内部异常,请检查! " + delInfo);
+            }
+            for (int _orgStaffRelIndex = 0; _orgStaffRelIndex < businessOrgStaffRelInfos.size(); _orgStaffRelIndex++) {
+                Map businessOrgStaffRelInfo = businessOrgStaffRelInfos.get(_orgStaffRelIndex);
+                flushBusinessOrgStaffRelInfo(businessOrgStaffRelInfo, StatusConstant.STATUS_CD_VALID);
+                orgStaffRelServiceDaoImpl.updateOrgStaffRelInfoInstance(businessOrgStaffRelInfo);
+            }
+        }
+
+    }
+
+
+    /**
+     * 处理 businessOrgStaffRel 节点
+     *
+     * @param business            总的数据节点
+     * @param businessOrgStaffRel 组织员工关系节点
+     */
+    private void doBusinessOrgStaffRel(Business business, JSONObject businessOrgStaffRel) {
+
+        Assert.jsonObjectHaveKey(businessOrgStaffRel, "relId", "businessOrgStaffRel 节点下没有包含 relId 节点");
+
+        if (businessOrgStaffRel.getString("relId").startsWith("-")) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "relId 错误,不能自动生成(必须已经存在的relId)" + businessOrgStaffRel);
+        }
+        //自动保存DEL
+        autoSaveDelBusinessOrgStaffRel(business, businessOrgStaffRel);
+
+        businessOrgStaffRel.put("bId", business.getbId());
+        businessOrgStaffRel.put("operate", StatusConstant.OPERATE_ADD);
+        //保存组织员工关系信息
+        orgStaffRelServiceDaoImpl.saveBusinessOrgStaffRelInfo(businessOrgStaffRel);
+
+    }
+
+
+    public IOrgStaffRelServiceDao getOrgStaffRelServiceDaoImpl() {
+        return orgStaffRelServiceDaoImpl;
+    }
+
+    public void setOrgStaffRelServiceDaoImpl(IOrgStaffRelServiceDao orgStaffRelServiceDaoImpl) {
+        this.orgStaffRelServiceDaoImpl = orgStaffRelServiceDaoImpl;
+    }
+
+
+}

+ 73 - 0
UserService/src/main/java/com/java110/user/smo/impl/OrgStaffRelInnerServiceSMOImpl.java

@@ -0,0 +1,73 @@
+package com.java110.user.smo.impl;
+
+
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.core.smo.org.IOrgStaffRelInnerServiceSMO;
+import com.java110.core.smo.user.IUserInnerServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.UserDto;
+import com.java110.dto.org.OrgStaffRelDto;
+import com.java110.user.dao.IOrgStaffRelServiceDao;
+import com.java110.utils.util.BeanConvertUtil;
+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 OrgStaffRelInnerServiceSMOImpl extends BaseServiceSMO implements IOrgStaffRelInnerServiceSMO {
+
+    @Autowired
+    private IOrgStaffRelServiceDao orgStaffRelServiceDaoImpl;
+
+    @Autowired
+    private IUserInnerServiceSMO userInnerServiceSMOImpl;
+
+    @Override
+    public List<OrgStaffRelDto> queryOrgStaffRels(@RequestBody OrgStaffRelDto orgStaffRelDto) {
+
+        //校验是否传了 分页信息
+
+        int page = orgStaffRelDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            orgStaffRelDto.setPage((page - 1) * orgStaffRelDto.getRow());
+        }
+
+        List<OrgStaffRelDto> orgStaffRels = BeanConvertUtil.covertBeanList(orgStaffRelServiceDaoImpl.getOrgStaffRelInfo(BeanConvertUtil.beanCovertMap(orgStaffRelDto)), OrgStaffRelDto.class);
+
+        return orgStaffRels;
+    }
+
+
+    @Override
+    public int queryOrgStaffRelsCount(@RequestBody OrgStaffRelDto orgStaffRelDto) {
+        return orgStaffRelServiceDaoImpl.queryOrgStaffRelsCount(BeanConvertUtil.beanCovertMap(orgStaffRelDto));
+    }
+
+    public IOrgStaffRelServiceDao getOrgStaffRelServiceDaoImpl() {
+        return orgStaffRelServiceDaoImpl;
+    }
+
+    public void setOrgStaffRelServiceDaoImpl(IOrgStaffRelServiceDao orgStaffRelServiceDaoImpl) {
+        this.orgStaffRelServiceDaoImpl = orgStaffRelServiceDaoImpl;
+    }
+
+    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
+        return userInnerServiceSMOImpl;
+    }
+
+    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
+        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
+    }
+}

+ 2 - 0
WebService/src/main/java/com/java110/web/smo/impl/StaffServiceSMOImpl.java

@@ -42,6 +42,8 @@ public class StaffServiceSMOImpl extends BaseComponentSMO implements IStaffServi
         Assert.jsonObjectHaveKey(pd.getReqData(), "sex", "请求报文格式错误或未包含性别信息");
         Assert.jsonObjectHaveKey(pd.getReqData(), "address", "请求报文格式错误或未包含地址信息");
         Assert.jsonObjectHaveKey(pd.getReqData(), "orgId", "请求报文格式错误或未包含部门信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "relCd", "请求报文格式错误或未包含员工角色");
+
 
         ResponseEntity responseEntity = super.getStoreInfo(pd, restTemplate);
 

+ 2 - 1
WebService/src/main/resources/components/staffPackage/addStaffStep/addStaffStep.js

@@ -33,6 +33,7 @@
                     email:'',
                     tel:'',
                     address:'',
+                    relCd:'',
                 }
             }
         },
@@ -108,7 +109,7 @@
 
                            vc.message('处理成功',true);
                            //关闭model
-                           vc.jumpToPage("/flow/staff?" + vc.objToGetParam(JSON.parse(json)));
+                           vc.jumpToPage("/flow/staff");
                            return ;
                        }
                        vc.message(json);

+ 47 - 32
WebService/src/main/resources/components/staffPackage/addStaffView/addStaffView.html

@@ -10,38 +10,53 @@
             <div class="ibox-content">
 
                 <div class="form-group row">
-         <label class="col-sm-2 col-form-label">员工名称</label>
-         <div class="col-sm-10">
-           <input v-model="addStaffViewInfo.username"                   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="addStaffViewInfo.sex">
-         <option selected  disabled value="">必填,请选择员工性别</option>
-         <option  value="1">男</option>
-<option  value="0">女</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="addStaffViewInfo.email"                   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="addStaffViewInfo.tel"                   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="addStaffViewInfo.address"                   type="text" placeholder="必填,请填写家庭住址" class="form-control">
-         </div>
-</div>
+                    <label class="col-sm-2 col-form-label">员工名称</label>
+                    <div class="col-sm-10">
+                        <input v-model="addStaffViewInfo.username" 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="addStaffViewInfo.sex">
+                            <option selected disabled value="">必填,请选择员工性别</option>
+                            <option value="1">男</option>
+                            <option value="0">女</option>
+                        </select></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="addStaffViewInfo.relCd">
+                            <option selected disabled value="">必填,请选择岗位</option>
+                            <option value="10000">普通员工</option>
+                            <option value="20000">部门经理</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="addStaffViewInfo.email" 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="addStaffViewInfo.tel" 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="addStaffViewInfo.address" type="text" placeholder="必填,请填写家庭住址"
+                               class="form-control">
+                    </div>
+                </div>
 
             </div>
         </div>

+ 13 - 0
WebService/src/main/resources/components/staffPackage/addStaffView/addStaffView.js

@@ -13,6 +13,7 @@
                 email:'',
                 tel:'',
                 address:'',
+                relCd:'',
             }
         },
         watch:{
@@ -61,6 +62,18 @@
                             errInfo:"员工性别不能为空"
                         },
                     ],
+                    'addStaffViewInfo.relCd':[
+                    {
+                        limit:"required",
+                        param:"",
+                        errInfo:"员工岗位不能为空"
+                    },
+                     {
+                        limit:"num",
+                        param:"",
+                        errInfo:"员工岗位错误"
+                    },
+                    ],
 'addStaffViewInfo.email':[
 {
                             limit:"required",

+ 114 - 0
docs/document/services/org/DeleteOrgStaffRelInfo.md

@@ -0,0 +1,114 @@
+
+
+**1\. 删除组织员工关系**
+###### 接口功能
+> API服务做删除组织员工关系时调用该接口
+
+###### URL
+> [http://orgStaffRel-service/orgStaffRelApi/service](http://orgStaffRel-service/orgStaffRelApi/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|businessOrgStaffRelInfo|1|Object|-|小区成员|小区成员|
+|businessOrgStaffRelInfo|relId|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://orgStaffRel-service/orgStaffRelApi/service](http://orgStaffRel-service/orgStaffRelApi/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": "140200050001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessOrgStaffRelInfo": {
+                "relId":"填写存在的值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 122 - 0
docs/document/services/org/SaveOrgStaffRelInfo.md

@@ -0,0 +1,122 @@
+
+
+**1\. 保存组织员工关系**
+###### 接口功能
+> API服务做保存组织员工关系时调用该接口
+
+###### URL
+> [http://orgStaffRel-service/orgStaffRelApi/service](http://orgStaffRel-service/orgStaffRelApi/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|businessOrgStaffRelInfo|1|Object|-|小区成员|小区成员|
+|businessOrgStaffRelInfo|relId|1|String|30|-|-|
+|businessOrgStaffRelInfo|storeId|1|String|30|-|-|
+|businessOrgStaffRelInfo|orgId|1|String|30|-|-|
+|businessOrgStaffRelInfo|staffId|1|String|30|-|-|
+|businessOrgStaffRelInfo|relCd|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://orgStaffRel-service/orgStaffRelApi/service](http://orgStaffRel-service/orgStaffRelApi/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": "140200030001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessOrgStaffRelInfo": {
+                "relId":"填写具体值",
+        "storeId":"填写具体值",
+        "orgId":"填写具体值",
+        "staffId":"填写具体值",
+        "relCd":"填写具体值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 122 - 0
docs/document/services/org/UpdateOrgStaffRelInfo.md

@@ -0,0 +1,122 @@
+
+
+**1\. 修改组织员工关系**
+###### 接口功能
+> API服务做修改组织员工关系时调用该接口
+
+###### URL
+> [http://orgStaffRel-service/orgStaffRelApi/service](http://orgStaffRel-service/orgStaffRelApi/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|businessOrgStaffRelInfo|1|Object|-|小区成员|小区成员|
+|businessOrgStaffRelInfo|relId|1|String|30|-|-|
+|businessOrgStaffRelInfo|storeId|1|String|30|-|-|
+|businessOrgStaffRelInfo|orgId|1|String|30|-|-|
+|businessOrgStaffRelInfo|staffId|1|String|30|-|-|
+|businessOrgStaffRelInfo|relCd|1|String|30|-|-|
+
+
+###### 返回协议
+
+当http返回状态不为200 时请求处理失败 body内容为失败的原因
+
+当http返回状态为200时请求处理成功,body内容为返回内容,
+
+
+
+
+
+###### 举例
+> 地址:[http://orgStaffRel-service/orgStaffRelApi/service](http://orgStaffRel-service/orgStaffRelApi/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": "140200040001",
+    "bId":"1234567892",
+    "remark": "备注",
+    "datas": {
+      "businessOrgStaffRelInfo": {
+                "relId":"填写具体值",
+        "storeId":"填写具体值",
+        "orgId":"填写具体值",
+        "staffId":"填写具体值",
+        "relCd":"填写具体值"
+      }
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}
+
+返回报文:
+ {
+	"orderTypeCd": "D",
+	"response": {
+		"code": "0000",
+		"message": "成功"
+	},
+	"responseTime": "20190418102004",
+	"bId": "202019041810750003",
+	"businessType": "B",
+	"transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
+	"dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
+}
+
+```

+ 86 - 0
java110-bean/src/main/java/com/java110/dto/org/OrgStaffRelDto.java

@@ -0,0 +1,86 @@
+package com.java110.dto.org;
+
+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 OrgStaffRelDto extends PageDto implements Serializable {
+
+    private String relId;
+    private String storeId;
+    private String orgId;
+    private String staffId;
+    private String relCd;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getRelId() {
+        return relId;
+    }
+
+    public void setRelId(String relId) {
+        this.relId = relId;
+    }
+
+    public String getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+
+    public String getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(String orgId) {
+        this.orgId = orgId;
+    }
+
+    public String getStaffId() {
+        return staffId;
+    }
+
+    public void setStaffId(String staffId) {
+        this.staffId = staffId;
+    }
+
+    public String getRelCd() {
+        return relCd;
+    }
+
+    public void setRelCd(String relCd) {
+        this.relCd = relCd;
+    }
+
+
+    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;
+    }
+}

+ 1 - 1
java110-code-generator/src/main/java/com/java110/OrgStaffRelGeneratorApplication.java

@@ -35,7 +35,7 @@ public class OrgStaffRelGeneratorApplication {
         data.setNewBusinessTypeCdValue("140200030001");
         data.setUpdateBusinessTypeCdValue("140200040001");
         data.setDeleteBusinessTypeCdValue("140200050001");
-        data.setBusinessTableName("business_org");
+        data.setBusinessTableName("business_org_staff_rel");
         data.setTableName("u_org_staff_rel");
         Map<String, String> param = new HashMap<String, String>();
         param.put("relId", "rel_id");       //map的key为你自定义的字段名就是驼峰命名法的那个,value为数据库表的字段名

+ 1 - 0
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java

@@ -95,6 +95,7 @@ public class GenerateCodeFactory {
     public static final String CODE_PREFIX_repairId = "82";
     public static final String CODE_PREFIX_ruId = "83";
     public static final String CODE_PREFIX_orgId = "84";
+    public static final String CODE_PREFIX_relId = "84";
 
 
 

+ 41 - 0
java110-core/src/main/java/com/java110/core/smo/org/IOrgStaffRelInnerServiceSMO.java

@@ -0,0 +1,41 @@
+package com.java110.core.smo.org;
+
+import com.java110.core.feign.FeignConfiguration;
+import com.java110.dto.org.OrgStaffRelDto;
+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 IOrgStaffRelInnerServiceSMO
+ * @Description 组织员工关系接口类
+ * @Author wuxw
+ * @Date 2019/4/24 9:04
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@FeignClient(name = "user-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/orgStaffRelApi")
+public interface IOrgStaffRelInnerServiceSMO {
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     * @param orgStaffRelDto 数据对象分享
+     * @return OrgStaffRelDto 对象数据
+     */
+    @RequestMapping(value = "/queryOrgStaffRels", method = RequestMethod.POST)
+    List<OrgStaffRelDto> queryOrgStaffRels(@RequestBody OrgStaffRelDto orgStaffRelDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param orgStaffRelDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryOrgStaffRelsCount", method = RequestMethod.POST)
+    int queryOrgStaffRelsCount(@RequestBody OrgStaffRelDto orgStaffRelDto);
+}

+ 171 - 0
java110-db/src/main/resources/mapper/user/OrgStaffRelServiceDaoImplMapper.xml

@@ -0,0 +1,171 @@
+<?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="orgStaffRelServiceDaoImpl">
+
+    <!-- 保存组织员工关系信息 add by wuxw 2018-07-03 -->
+       <insert id="saveBusinessOrgStaffRelInfo" parameterType="Map">
+           insert into business_org_staff_rel(
+rel_id,operate,store_id,b_id,org_id,staff_id,rel_cd
+) values (
+#{relId},#{operate},#{storeId},#{bId},#{orgId},#{staffId},#{relCd}
+)
+       </insert>
+
+
+       <!-- 查询组织员工关系信息(Business) add by wuxw 2018-07-03 -->
+       <select id="getBusinessOrgStaffRelInfo" parameterType="Map" resultType="Map">
+           select  t.rel_id,t.rel_id relId,t.operate,t.store_id,t.store_id storeId,t.b_id,t.b_id bId,t.org_id,t.org_id orgId,t.staff_id,t.staff_id staffId,t.rel_cd,t.rel_cd relCd 
+from business_org_staff_rel t 
+where 1 =1 
+<if test="relId !=null and relId != ''">
+   and t.rel_id= #{relId}
+</if> 
+<if test="operate !=null and operate != ''">
+   and t.operate= #{operate}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="orgId !=null and orgId != ''">
+   and t.org_id= #{orgId}
+</if> 
+<if test="staffId !=null and staffId != ''">
+   and t.staff_id= #{staffId}
+</if> 
+<if test="relCd !=null and relCd != ''">
+   and t.rel_cd= #{relCd}
+</if> 
+
+       </select>
+
+
+
+
+
+    <!-- 保存组织员工关系信息至 instance表中 add by wuxw 2018-07-03 -->
+    <insert id="saveOrgStaffRelInfoInstance" parameterType="Map">
+        insert into u_org_staff_rel(
+rel_id,status_cd,store_id,b_id,org_id,staff_id,rel_cd
+) select t.rel_id,'0',t.store_id,t.b_id,t.org_id,t.staff_id,t.rel_cd from business_org_staff_rel t where 1=1
+<if test="relId !=null and relId != ''">
+   and t.rel_id= #{relId}
+</if> 
+   and t.operate= 'ADD'
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="orgId !=null and orgId != ''">
+   and t.org_id= #{orgId}
+</if> 
+<if test="staffId !=null and staffId != ''">
+   and t.staff_id= #{staffId}
+</if> 
+<if test="relCd !=null and relCd != ''">
+   and t.rel_cd= #{relCd}
+</if> 
+
+    </insert>
+
+
+
+    <!-- 查询组织员工关系信息 add by wuxw 2018-07-03 -->
+    <select id="getOrgStaffRelInfo" parameterType="Map" resultType="Map">
+        select  t.rel_id,t.rel_id relId,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id storeId,t.b_id,t.b_id bId,t.org_id,t.org_id orgId,t.staff_id,t.staff_id staffId,t.rel_cd,t.rel_cd relCd 
+from u_org_staff_rel t 
+where 1 =1 
+<if test="relId !=null and relId != ''">
+   and t.rel_id= #{relId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="orgId !=null and orgId != ''">
+   and t.org_id= #{orgId}
+</if> 
+<if test="staffId !=null and staffId != ''">
+   and t.staff_id= #{staffId}
+</if> 
+<if test="relCd !=null and relCd != ''">
+   and t.rel_cd= #{relCd}
+</if> 
+<if test="page != -1 and page != null ">
+   limit #{page}, #{row}
+</if> 
+
+    </select>
+
+
+
+
+    <!-- 修改组织员工关系信息 add by wuxw 2018-07-03 -->
+    <update id="updateOrgStaffRelInfoInstance" parameterType="Map">
+        update  u_org_staff_rel t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="storeId !=null and storeId != ''">
+, t.store_id= #{storeId}
+</if> 
+<if test="orgId !=null and orgId != ''">
+, t.org_id= #{orgId}
+</if> 
+<if test="staffId !=null and staffId != ''">
+, t.staff_id= #{staffId}
+</if> 
+<if test="relCd !=null and relCd != ''">
+, t.rel_cd= #{relCd}
+</if> 
+ where 1=1 <if test="relId !=null and relId != ''">
+and t.rel_id= #{relId}
+</if> 
+<if test="bId !=null and bId != ''">
+and t.b_id= #{bId}
+</if> 
+
+    </update>
+
+    <!-- 查询组织员工关系数量 add by wuxw 2018-07-03 -->
+     <select id="queryOrgStaffRelsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from u_org_staff_rel t 
+where 1 =1 
+<if test="relId !=null and relId != ''">
+   and t.rel_id= #{relId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="orgId !=null and orgId != ''">
+   and t.org_id= #{orgId}
+</if> 
+<if test="staffId !=null and staffId != ''">
+   and t.staff_id= #{staffId}
+</if> 
+<if test="relCd !=null and relCd != ''">
+   and t.rel_cd= #{relCd}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 3 - 5
java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java

@@ -498,16 +498,14 @@ public class BusinessTypeConstant {
 
 
     /**
-     *  保存组织
+     *  保存员工组织关系
      * 14开头  3保存
      */
     public static final String BUSINESS_TYPE_SAVE_ORG_STAFF_REL="140200030001";
-    /**
-     *  修改组织
-     */
+
     public static final String BUSINESS_TYPE_UPDATE_ORG_STAFF_REL="140200040001";
     /**
-     *  删除组织
+     *  删除员工组织关系
      */
     public static final String BUSINESS_TYPE_DELETE_ORG_STAFF_REL ="140200050001";