Browse Source

员工微信认证功能

java110 5 years ago
parent
commit
7aec551e05
18 changed files with 948 additions and 15 deletions
  1. 90 0
      java110-bean/src/main/java/com/java110/dto/staffAppAuth/StaffAppAuthDto.java
  2. 81 0
      java110-bean/src/main/java/com/java110/po/staffAppAuth/StaffAppAuthPo.java
  3. 3 0
      java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
  4. 124 0
      java110-db/src/main/resources/mapper/user/StaffAppAuthServiceDaoImplMapper.xml
  5. 18 15
      java110-generator/src/main/resources/newBack/template_1.json
  6. 53 0
      java110-interface/src/main/java/com/java110/intf/user/IStaffAppAuthInnerServiceSMO.java
  7. 113 0
      service-user/src/main/java/com/java110/user/api/StaffApi.java
  8. 17 0
      service-user/src/main/java/com/java110/user/bmo/staffAppAuth/IDeleteStaffAppAuthBMO.java
  9. 19 0
      service-user/src/main/java/com/java110/user/bmo/staffAppAuth/IGetStaffAppAuthBMO.java
  10. 19 0
      service-user/src/main/java/com/java110/user/bmo/staffAppAuth/ISaveStaffAppAuthBMO.java
  11. 19 0
      service-user/src/main/java/com/java110/user/bmo/staffAppAuth/IUpdateStaffAppAuthBMO.java
  12. 34 0
      service-user/src/main/java/com/java110/user/bmo/staffAppAuth/impl/DeleteStaffAppAuthBMOImpl.java
  13. 44 0
      service-user/src/main/java/com/java110/user/bmo/staffAppAuth/impl/GetStaffAppAuthBMOImpl.java
  14. 38 0
      service-user/src/main/java/com/java110/user/bmo/staffAppAuth/impl/SaveStaffAppAuthBMOImpl.java
  15. 34 0
      service-user/src/main/java/com/java110/user/bmo/staffAppAuth/impl/UpdateStaffAppAuthBMOImpl.java
  16. 61 0
      service-user/src/main/java/com/java110/user/dao/IStaffAppAuthServiceDao.java
  17. 98 0
      service-user/src/main/java/com/java110/user/dao/impl/StaffAppAuthServiceDaoImpl.java
  18. 83 0
      service-user/src/main/java/com/java110/user/smo/impl/StaffAppAuthInnerServiceSMOImpl.java

+ 90 - 0
java110-bean/src/main/java/com/java110/dto/staffAppAuth/StaffAppAuthDto.java

@@ -0,0 +1,90 @@
+package com.java110.dto.staffAppAuth;
+
+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 StaffAppAuthDto extends PageDto implements Serializable {
+
+    private String auId;
+private String appType;
+private String openId;
+private String state;
+private String storeId;
+private String openName;
+private String staffId;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getAuId() {
+        return auId;
+    }
+public void setAuId(String auId) {
+        this.auId = auId;
+    }
+public String getAppType() {
+        return appType;
+    }
+public void setAppType(String appType) {
+        this.appType = appType;
+    }
+public String getOpenId() {
+        return openId;
+    }
+public void setOpenId(String openId) {
+        this.openId = openId;
+    }
+public String getState() {
+        return state;
+    }
+public void setState(String state) {
+        this.state = state;
+    }
+public String getStoreId() {
+        return storeId;
+    }
+public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+public String getOpenName() {
+        return openName;
+    }
+public void setOpenName(String openName) {
+        this.openName = openName;
+    }
+public String getStaffId() {
+        return staffId;
+    }
+public void setStaffId(String staffId) {
+        this.staffId = staffId;
+    }
+
+
+    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;
+    }
+}

+ 81 - 0
java110-bean/src/main/java/com/java110/po/staffAppAuth/StaffAppAuthPo.java

@@ -0,0 +1,81 @@
+package com.java110.po.staffAppAuth;
+
+import java.io.Serializable;
+
+public class StaffAppAuthPo implements Serializable {
+
+    private String auId;
+    private String appType;
+    private String openId;
+    private String statusCd = "0";
+    private String state;
+    private String storeId;
+    private String openName;
+    private String staffId;
+
+    public String getAuId() {
+        return auId;
+    }
+
+    public void setAuId(String auId) {
+        this.auId = auId;
+    }
+
+    public String getAppType() {
+        return appType;
+    }
+
+    public void setAppType(String appType) {
+        this.appType = appType;
+    }
+
+    public String getOpenId() {
+        return openId;
+    }
+
+    public void setOpenId(String openId) {
+        this.openId = openId;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+
+    public String getOpenName() {
+        return openName;
+    }
+
+    public void setOpenName(String openName) {
+        this.openName = openName;
+    }
+
+    public String getStaffId() {
+        return staffId;
+    }
+
+    public void setStaffId(String staffId) {
+        this.staffId = staffId;
+    }
+
+
+}

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

@@ -175,6 +175,7 @@ public class GenerateCodeFactory {
     public static final String CODE_PREFIX_errId = "10";
     public static final String CODE_PREFIX_IfdId = "11";
     public static final String CODE_PREFIX_databusId = "12";
+    public static final String CODE_PREFIX_auId = "13";
 
 
     /**
@@ -892,4 +893,6 @@ public class GenerateCodeFactory {
         }
         return result;
     }
+
+
 }

+ 124 - 0
java110-db/src/main/resources/mapper/user/StaffAppAuthServiceDaoImplMapper.xml

@@ -0,0 +1,124 @@
+<?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="staffAppAuthServiceDaoImpl">
+
+
+
+
+
+    <!-- 保存员工微信认证信息 add by wuxw 2018-07-03 -->
+    <insert id="saveStaffAppAuthInfo" parameterType="Map">
+        insert into staff_app_auth(
+au_id,app_type,open_id,state,store_id,open_name,staff_id
+) values (
+#{auId},#{appType},#{openId},#{state},#{storeId},#{openName},#{staffId}
+)
+    </insert>
+
+
+
+    <!-- 查询员工微信认证信息 add by wuxw 2018-07-03 -->
+    <select id="getStaffAppAuthInfo" parameterType="Map" resultType="Map">
+        select  t.au_id,t.au_id auId,t.app_type,t.app_type appType,t.open_id,t.open_id openId,t.status_cd,t.status_cd statusCd,t.state,t.store_id,t.store_id storeId,t.open_name,t.open_name openName,t.staff_id,t.staff_id staffId 
+from staff_app_auth t 
+where 1 =1 
+<if test="auId !=null and auId != ''">
+   and t.au_id= #{auId}
+</if> 
+<if test="appType !=null and appType != ''">
+   and t.app_type= #{appType}
+</if> 
+<if test="openId !=null and openId != ''">
+   and t.open_id= #{openId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+<if test="openName !=null and openName != ''">
+   and t.open_name= #{openName}
+</if> 
+<if test="staffId !=null and staffId != ''">
+   and t.staff_id= #{staffId}
+</if> 
+order by t.create_time desc
+<if test="page != -1 and page != null ">
+   limit #{page}, #{row}
+</if> 
+
+    </select>
+
+
+
+
+    <!-- 修改员工微信认证信息 add by wuxw 2018-07-03 -->
+    <update id="updateStaffAppAuthInfo" parameterType="Map">
+        update  staff_app_auth t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="appType !=null and appType != ''">
+, t.app_type= #{appType}
+</if> 
+<if test="openId !=null and openId != ''">
+, t.open_id= #{openId}
+</if> 
+<if test="state !=null and state != ''">
+, t.state= #{state}
+</if> 
+<if test="storeId !=null and storeId != ''">
+, t.store_id= #{storeId}
+</if> 
+<if test="openName !=null and openName != ''">
+, t.open_name= #{openName}
+</if> 
+<if test="staffId !=null and staffId != ''">
+, t.staff_id= #{staffId}
+</if> 
+ where 1=1 <if test="auId !=null and auId != ''">
+and t.au_id= #{auId}
+</if> 
+
+    </update>
+
+    <!-- 查询员工微信认证数量 add by wuxw 2018-07-03 -->
+     <select id="queryStaffAppAuthsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from staff_app_auth t 
+where 1 =1 
+<if test="auId !=null and auId != ''">
+   and t.au_id= #{auId}
+</if> 
+<if test="appType !=null and appType != ''">
+   and t.app_type= #{appType}
+</if> 
+<if test="openId !=null and openId != ''">
+   and t.open_id= #{openId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+<if test="openName !=null and openName != ''">
+   and t.open_name= #{openName}
+</if> 
+<if test="staffId !=null and staffId != ''">
+   and t.staff_id= #{staffId}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 18 - 15
java110-generator/src/main/resources/newBack/template_1.json

@@ -1,27 +1,30 @@
 {
   "autoMove": true,
-  "id": "databusId",
-  "name": "businessDatabus",
-  "desc": "业务数据同步",
-  "shareParam": "databusId",
-  "shareColumn": "databus_id",
-  "shareName": "job",
-  "tableName": "c_business_databus",
+  "id": "auId",
+  "name": "staffAppAuth",
+  "desc": "员工微信认证",
+  "shareParam": "storeId",
+  "shareColumn": "store_id",
+  "shareName": "user",
+  "tableName": "staff_app_auth",
   "param": {
-    "databusId": "databus_id",
-    "businessTypeCd": "business_type_cd",
-    "beanName": "bean_name",
-    "seq": "seq",
+    "auId": "au_id",
+    "staffId": "staff_id",
+    "storeId": "store_id",
+    "appType": "app_type",
+    "openId": "open_id",
+    "state": "state",
+    "openName": "open_name",
     "statusCd": "status_cd"
   },
   "required": [
     {
-      "code": "businessTypeCd",
-      "msg": "业务类型不能为空"
+      "code": "staffId",
+      "msg": "员工不能为空"
     },
     {
-      "code": "beanName",
-      "msg": "适配器不能为空"
+      "code": "appType",
+      "msg": "应用类型不能为空"
     }
   ]
 }

+ 53 - 0
java110-interface/src/main/java/com/java110/intf/user/IStaffAppAuthInnerServiceSMO.java

@@ -0,0 +1,53 @@
+package com.java110.intf.user;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.staffAppAuth.StaffAppAuthDto;
+import com.java110.po.staffAppAuth.StaffAppAuthPo;
+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 IStaffAppAuthInnerServiceSMO
+ * @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("/staffAppAuthApi")
+public interface IStaffAppAuthInnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveStaffAppAuth", method = RequestMethod.POST)
+    public int saveStaffAppAuth(@RequestBody StaffAppAuthPo staffAppAuthPo);
+
+    @RequestMapping(value = "/updateStaffAppAuth", method = RequestMethod.POST)
+    public int updateStaffAppAuth(@RequestBody  StaffAppAuthPo staffAppAuthPo);
+
+    @RequestMapping(value = "/deleteStaffAppAuth", method = RequestMethod.POST)
+    public int deleteStaffAppAuth(@RequestBody  StaffAppAuthPo staffAppAuthPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param staffAppAuthDto 数据对象分享
+     * @return StaffAppAuthDto 对象数据
+     */
+    @RequestMapping(value = "/queryStaffAppAuths", method = RequestMethod.POST)
+    List<StaffAppAuthDto> queryStaffAppAuths(@RequestBody StaffAppAuthDto staffAppAuthDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param staffAppAuthDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryStaffAppAuthsCount", method = RequestMethod.POST)
+    int queryStaffAppAuthsCount(@RequestBody StaffAppAuthDto staffAppAuthDto);
+}

+ 113 - 0
service-user/src/main/java/com/java110/user/api/StaffApi.java

@@ -0,0 +1,113 @@
+package com.java110.user.api;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.staffAppAuth.StaffAppAuthDto;
+import com.java110.po.staffAppAuth.StaffAppAuthPo;
+import com.java110.user.bmo.staffAppAuth.IDeleteStaffAppAuthBMO;
+import com.java110.user.bmo.staffAppAuth.IGetStaffAppAuthBMO;
+import com.java110.user.bmo.staffAppAuth.ISaveStaffAppAuthBMO;
+import com.java110.user.bmo.staffAppAuth.IUpdateStaffAppAuthBMO;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@RestController
+@RequestMapping(value = "/staff")
+public class StaffApi {
+
+    @Autowired
+    private ISaveStaffAppAuthBMO saveStaffAppAuthBMOImpl;
+    @Autowired
+    private IUpdateStaffAppAuthBMO updateStaffAppAuthBMOImpl;
+    @Autowired
+    private IDeleteStaffAppAuthBMO deleteStaffAppAuthBMOImpl;
+
+    @Autowired
+    private IGetStaffAppAuthBMO getStaffAppAuthBMOImpl;
+
+    /**
+     * 微信保存消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /staffAppAuth/saveStaffAppAuth
+     * @path /app/staffAppAuth/saveStaffAppAuth
+     */
+    @RequestMapping(value = "/saveStaffAppAuth", method = RequestMethod.POST)
+    public ResponseEntity<String> saveStaffAppAuth(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId");
+        Assert.hasKeyAndValue(reqJson, "appType", "请求报文中未包含appType");
+
+
+        StaffAppAuthPo staffAppAuthPo = BeanConvertUtil.covertBean(reqJson, StaffAppAuthPo.class);
+        return saveStaffAppAuthBMOImpl.save(staffAppAuthPo);
+    }
+
+    /**
+     * 微信修改消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /staffAppAuth/updateStaffAppAuth
+     * @path /app/staffAppAuth/updateStaffAppAuth
+     */
+    @RequestMapping(value = "/updateStaffAppAuth", method = RequestMethod.POST)
+    public ResponseEntity<String> updateStaffAppAuth(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId");
+        Assert.hasKeyAndValue(reqJson, "appType", "请求报文中未包含appType");
+        Assert.hasKeyAndValue(reqJson, "auId", "auId不能为空");
+
+
+        StaffAppAuthPo staffAppAuthPo = BeanConvertUtil.covertBean(reqJson, StaffAppAuthPo.class);
+        return updateStaffAppAuthBMOImpl.update(staffAppAuthPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /staffAppAuth/deleteStaffAppAuth
+     * @path /app/staffAppAuth/deleteStaffAppAuth
+     */
+    @RequestMapping(value = "/deleteStaffAppAuth", method = RequestMethod.POST)
+    public ResponseEntity<String> deleteStaffAppAuth(@RequestBody JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
+
+        Assert.hasKeyAndValue(reqJson, "auId", "auId不能为空");
+
+
+        StaffAppAuthPo staffAppAuthPo = BeanConvertUtil.covertBean(reqJson, StaffAppAuthPo.class);
+        return deleteStaffAppAuthBMOImpl.delete(staffAppAuthPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param storeId 小区ID
+     * @return
+     * @serviceCode /staffAppAuth/queryStaffAppAuth
+     * @path /app/staffAppAuth/queryStaffAppAuth
+     */
+    @RequestMapping(value = "/queryStaffAppAuth", method = RequestMethod.GET)
+    public ResponseEntity<String> queryStaffAppAuth(@RequestParam(value = "store-id") String storeId,
+                                                    @RequestParam(value = "user-id") String userId,
+                                                    @RequestParam(value = "page") int page,
+                                                    @RequestParam(value = "row") int row) {
+        StaffAppAuthDto staffAppAuthDto = new StaffAppAuthDto();
+        staffAppAuthDto.setPage(page);
+        staffAppAuthDto.setRow(row);
+        staffAppAuthDto.setStoreId(storeId);
+        staffAppAuthDto.setStaffId(userId);
+        return getStaffAppAuthBMOImpl.get(staffAppAuthDto);
+    }
+}

+ 17 - 0
service-user/src/main/java/com/java110/user/bmo/staffAppAuth/IDeleteStaffAppAuthBMO.java

@@ -0,0 +1,17 @@
+package com.java110.user.bmo.staffAppAuth;
+import com.java110.po.staffAppAuth.StaffAppAuthPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IDeleteStaffAppAuthBMO {
+
+
+    /**
+     * 修改员工微信认证
+     * add by wuxw
+     * @param staffAppAuthPo
+     * @return
+     */
+    ResponseEntity<String> delete(StaffAppAuthPo staffAppAuthPo);
+
+
+}

+ 19 - 0
service-user/src/main/java/com/java110/user/bmo/staffAppAuth/IGetStaffAppAuthBMO.java

@@ -0,0 +1,19 @@
+package com.java110.user.bmo.staffAppAuth;
+
+import com.java110.dto.staffAppAuth.StaffAppAuthDto;
+import org.springframework.http.ResponseEntity;
+
+public interface IGetStaffAppAuthBMO {
+
+
+    /**
+     * 查询员工微信认证
+     * add by wuxw
+     *
+     * @param staffAppAuthDto
+     * @return
+     */
+    ResponseEntity<String> get(StaffAppAuthDto staffAppAuthDto);
+
+
+}

+ 19 - 0
service-user/src/main/java/com/java110/user/bmo/staffAppAuth/ISaveStaffAppAuthBMO.java

@@ -0,0 +1,19 @@
+package com.java110.user.bmo.staffAppAuth;
+
+import com.java110.po.staffAppAuth.StaffAppAuthPo;
+import org.springframework.http.ResponseEntity;
+
+public interface ISaveStaffAppAuthBMO {
+
+
+    /**
+     * 添加员工微信认证
+     * add by wuxw
+     *
+     * @param staffAppAuthPo
+     * @return
+     */
+    ResponseEntity<String> save(StaffAppAuthPo staffAppAuthPo);
+
+
+}

+ 19 - 0
service-user/src/main/java/com/java110/user/bmo/staffAppAuth/IUpdateStaffAppAuthBMO.java

@@ -0,0 +1,19 @@
+package com.java110.user.bmo.staffAppAuth;
+
+import com.java110.po.staffAppAuth.StaffAppAuthPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IUpdateStaffAppAuthBMO {
+
+
+    /**
+     * 修改员工微信认证
+     * add by wuxw
+     *
+     * @param staffAppAuthPo
+     * @return
+     */
+    ResponseEntity<String> update(StaffAppAuthPo staffAppAuthPo);
+
+
+}

+ 34 - 0
service-user/src/main/java/com/java110/user/bmo/staffAppAuth/impl/DeleteStaffAppAuthBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.user.bmo.staffAppAuth.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
+import com.java110.po.staffAppAuth.StaffAppAuthPo;
+import com.java110.user.bmo.staffAppAuth.IDeleteStaffAppAuthBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("deleteStaffAppAuthBMOImpl")
+public class DeleteStaffAppAuthBMOImpl implements IDeleteStaffAppAuthBMO {
+
+    @Autowired
+    private IStaffAppAuthInnerServiceSMO staffAppAuthInnerServiceSMOImpl;
+
+    /**
+     * @param staffAppAuthPo 数据
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> delete(StaffAppAuthPo staffAppAuthPo) {
+
+        int flag = staffAppAuthInnerServiceSMOImpl.deleteStaffAppAuth(staffAppAuthPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 44 - 0
service-user/src/main/java/com/java110/user/bmo/staffAppAuth/impl/GetStaffAppAuthBMOImpl.java

@@ -0,0 +1,44 @@
+package com.java110.user.bmo.staffAppAuth.impl;
+
+import com.java110.dto.staffAppAuth.StaffAppAuthDto;
+import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
+import com.java110.user.bmo.staffAppAuth.IGetStaffAppAuthBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service("getStaffAppAuthBMOImpl")
+public class GetStaffAppAuthBMOImpl implements IGetStaffAppAuthBMO {
+
+    @Autowired
+    private IStaffAppAuthInnerServiceSMO staffAppAuthInnerServiceSMOImpl;
+
+    /**
+     * @param staffAppAuthDto
+     * @return 订单服务能够接受的报文
+     */
+    public ResponseEntity<String> get(StaffAppAuthDto staffAppAuthDto) {
+
+
+        int count = staffAppAuthInnerServiceSMOImpl.queryStaffAppAuthsCount(staffAppAuthDto);
+
+        List<StaffAppAuthDto> staffAppAuthDtos = null;
+        if (count > 0) {
+            staffAppAuthDtos = staffAppAuthInnerServiceSMOImpl.queryStaffAppAuths(staffAppAuthDto);
+        } else {
+            staffAppAuthDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) staffAppAuthDto.getRow()), count, staffAppAuthDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        return responseEntity;
+    }
+
+}

+ 38 - 0
service-user/src/main/java/com/java110/user/bmo/staffAppAuth/impl/SaveStaffAppAuthBMOImpl.java

@@ -0,0 +1,38 @@
+package com.java110.user.bmo.staffAppAuth.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
+import com.java110.po.staffAppAuth.StaffAppAuthPo;
+import com.java110.user.bmo.staffAppAuth.ISaveStaffAppAuthBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("saveStaffAppAuthBMOImpl")
+public class SaveStaffAppAuthBMOImpl implements ISaveStaffAppAuthBMO {
+
+    @Autowired
+    private IStaffAppAuthInnerServiceSMO staffAppAuthInnerServiceSMOImpl;
+
+    /**
+     * 添加小区信息
+     *
+     * @param staffAppAuthPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> save(StaffAppAuthPo staffAppAuthPo) {
+
+        staffAppAuthPo.setAuId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_auId));
+        int flag = staffAppAuthInnerServiceSMOImpl.saveStaffAppAuth(staffAppAuthPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 34 - 0
service-user/src/main/java/com/java110/user/bmo/staffAppAuth/impl/UpdateStaffAppAuthBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.user.bmo.staffAppAuth.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
+import com.java110.po.staffAppAuth.StaffAppAuthPo;
+import com.java110.user.bmo.staffAppAuth.IUpdateStaffAppAuthBMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("updateStaffAppAuthBMOImpl")
+public class UpdateStaffAppAuthBMOImpl implements IUpdateStaffAppAuthBMO {
+
+    @Autowired
+    private IStaffAppAuthInnerServiceSMO staffAppAuthInnerServiceSMOImpl;
+
+    /**
+     * @param staffAppAuthPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> update(StaffAppAuthPo staffAppAuthPo) {
+
+        int flag = staffAppAuthInnerServiceSMOImpl.updateStaffAppAuth(staffAppAuthPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 61 - 0
service-user/src/main/java/com/java110/user/dao/IStaffAppAuthServiceDao.java

@@ -0,0 +1,61 @@
+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 IStaffAppAuthServiceDao {
+
+
+    /**
+     * 保存 员工微信认证信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveStaffAppAuthInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询员工微信认证信息(instance过程)
+     * 根据bId 查询员工微信认证信息
+     * @param info bId 信息
+     * @return 员工微信认证信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getStaffAppAuthInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改员工微信认证信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateStaffAppAuthInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询员工微信认证总数
+     *
+     * @param info 员工微信认证信息
+     * @return 员工微信认证数量
+     */
+    int queryStaffAppAuthsCount(Map info);
+
+}

+ 98 - 0
service-user/src/main/java/com/java110/user/dao/impl/StaffAppAuthServiceDaoImpl.java

@@ -0,0 +1,98 @@
+package com.java110.user.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.user.dao.IStaffAppAuthServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 员工微信认证服务 与数据库交互
+ * Created by wuxw on 2017/4/5.
+ */
+@Service("staffAppAuthServiceDaoImpl")
+//@Transactional
+public class StaffAppAuthServiceDaoImpl extends BaseServiceDao implements IStaffAppAuthServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(StaffAppAuthServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存员工微信认证信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveStaffAppAuthInfo(Map info) throws DAOException {
+        logger.debug("保存员工微信认证信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("staffAppAuthServiceDaoImpl.saveStaffAppAuthInfo",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> getStaffAppAuthInfo(Map info) throws DAOException {
+        logger.debug("查询员工微信认证信息 入参 info : {}",info);
+
+        List<Map> businessStaffAppAuthInfos = sqlSessionTemplate.selectList("staffAppAuthServiceDaoImpl.getStaffAppAuthInfo",info);
+
+        return businessStaffAppAuthInfos;
+    }
+
+
+    /**
+     * 修改员工微信认证信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateStaffAppAuthInfo(Map info) throws DAOException {
+        logger.debug("修改员工微信认证信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("staffAppAuthServiceDaoImpl.updateStaffAppAuthInfo",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改员工微信认证信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 查询员工微信认证数量
+     * @param info 员工微信认证信息
+     * @return 员工微信认证数量
+     */
+    @Override
+    public int queryStaffAppAuthsCount(Map info) {
+        logger.debug("查询员工微信认证数据 入参 info : {}",info);
+
+        List<Map> businessStaffAppAuthInfos = sqlSessionTemplate.selectList("staffAppAuthServiceDaoImpl.queryStaffAppAuthsCount", info);
+        if (businessStaffAppAuthInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessStaffAppAuthInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 83 - 0
service-user/src/main/java/com/java110/user/smo/impl/StaffAppAuthInnerServiceSMOImpl.java

@@ -0,0 +1,83 @@
+package com.java110.user.smo.impl;
+
+
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.staffAppAuth.StaffAppAuthDto;
+import com.java110.intf.user.IStaffAppAuthInnerServiceSMO;
+import com.java110.po.staffAppAuth.StaffAppAuthPo;
+import com.java110.user.dao.IStaffAppAuthServiceDao;
+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.List;
+
+/**
+ * @ClassName FloorInnerServiceSMOImpl
+ * @Description 员工微信认证内部服务实现类
+ * @Author wuxw
+ * @Date 2019/4/24 9:20
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@RestController
+public class StaffAppAuthInnerServiceSMOImpl extends BaseServiceSMO implements IStaffAppAuthInnerServiceSMO {
+
+    @Autowired
+    private IStaffAppAuthServiceDao staffAppAuthServiceDaoImpl;
+
+
+    @Override
+    public int saveStaffAppAuth(@RequestBody StaffAppAuthPo staffAppAuthPo) {
+        int saveFlag = 1;
+        staffAppAuthServiceDaoImpl.saveStaffAppAuthInfo(BeanConvertUtil.beanCovertMap(staffAppAuthPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int updateStaffAppAuth(@RequestBody StaffAppAuthPo staffAppAuthPo) {
+        int saveFlag = 1;
+        staffAppAuthServiceDaoImpl.updateStaffAppAuthInfo(BeanConvertUtil.beanCovertMap(staffAppAuthPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int deleteStaffAppAuth(@RequestBody StaffAppAuthPo staffAppAuthPo) {
+        int saveFlag = 1;
+        staffAppAuthPo.setStatusCd("1");
+        staffAppAuthServiceDaoImpl.updateStaffAppAuthInfo(BeanConvertUtil.beanCovertMap(staffAppAuthPo));
+        return saveFlag;
+    }
+
+    @Override
+    public List<StaffAppAuthDto> queryStaffAppAuths(@RequestBody StaffAppAuthDto staffAppAuthDto) {
+
+        //校验是否传了 分页信息
+
+        int page = staffAppAuthDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            staffAppAuthDto.setPage((page - 1) * staffAppAuthDto.getRow());
+        }
+
+        List<StaffAppAuthDto> staffAppAuths = BeanConvertUtil.covertBeanList(staffAppAuthServiceDaoImpl.getStaffAppAuthInfo(BeanConvertUtil.beanCovertMap(staffAppAuthDto)), StaffAppAuthDto.class);
+
+        return staffAppAuths;
+    }
+
+
+    @Override
+    public int queryStaffAppAuthsCount(@RequestBody StaffAppAuthDto staffAppAuthDto) {
+        return staffAppAuthServiceDaoImpl.queryStaffAppAuthsCount(BeanConvertUtil.beanCovertMap(staffAppAuthDto));
+    }
+
+    public IStaffAppAuthServiceDao getStaffAppAuthServiceDaoImpl() {
+        return staffAppAuthServiceDaoImpl;
+    }
+
+    public void setStaffAppAuthServiceDaoImpl(IStaffAppAuthServiceDao staffAppAuthServiceDaoImpl) {
+        this.staffAppAuthServiceDaoImpl = staffAppAuthServiceDaoImpl;
+    }
+}