소스 검색

合并1117

yousongbo 1 주 전
부모
커밋
c21e24b2f1

+ 0 - 1
suishenbang-framework/src/main/java/com/dgtly/framework/aspectj/DataScopeAspect.java

@@ -96,7 +96,6 @@ public class DataScopeAspect
      * 
      * @param joinPoint 切点
      * @param user 用户
-     * @param alias 别名
      */
     public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias)
     {

+ 7 - 2
suishenbang-sync/suishenbang-sync-common/src/main/java/com/dgtly/sync/service/AnalysisDiyCustomerComponent.java

@@ -27,6 +27,7 @@ import com.dgtly.system.service.ISysConfigService;
 import com.dgtly.system.service.ISysDictDataService;
 import com.dgtly.system.service.impl.SysUserServiceImpl;
 import com.dgtly.wxportal.mapper.WxQyUserMapper;
+import lombok.extern.slf4j.Slf4j;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -94,7 +95,7 @@ public class AnalysisDiyCustomerComponent {
 
 
     public SyncLog analyDiyCustomer1() {
-
+        log.info("开始同步经销商用户B");
         if (roleMsq == null) {
             Long roleId = Long.parseLong(configService.selectConfigByKey("libang.msq.roleid"));
             roleMsq = new Long[]{roleId};
@@ -234,6 +235,7 @@ public class AnalysisDiyCustomerComponent {
      */
     //@Override
     public SyncLog analyDiyCustomer() {
+        log.info("开始解析DIY经销商用户A");
         if(deptId==null){
             deptId = Long.parseLong(configService.selectConfigByKey("libang.customer.deptid"));
         }
@@ -794,6 +796,9 @@ public class AnalysisDiyCustomerComponent {
      */
     public Integer buildSysUser(JSONArray jsonArray, Set<String> loginNameSet,Set<String> diyNameSet, int isManager, List<SyncFailDetail> failDetails,String packageId, Map<String,Customers> cusMap) {
         // JSONArray jsonArray = json.getJSONArray("userlist");
+        log.info("开始解析用户列表");
+        log.info("用户列表数量:{}", jsonArray.size());
+        log.info("开始解析用户列表{}",jsonArray);
         int count = 0;
         List<String> interfaceList = new ArrayList<>();
         List<UserAssVO> assVOList =new ArrayList<>();
@@ -913,7 +918,7 @@ public class AnalysisDiyCustomerComponent {
         }
         for (int i = 0; i < jsonArray.size(); i++) {
             JSONObject jo = jsonArray.getJSONObject(i);
-
+            log.info("数据同步当前数据:{}", jo);
             try {
                 String userNo = jo.getString("userNo");
                 String enable = jo.getString("enable");

+ 3 - 9
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxController.java

@@ -321,15 +321,9 @@ public class WxController extends ApiBaseController {
         String chain = obj.getString("chain");
         String customerName = obj.getString("customerName");
         String order = obj.getString("order");
-        String message = "";
-        if("123456789".equals(order)){
-            message = "出厂通知:您有订单<a href='https://suishenbangtest.nipponpaint.com.cn/order/onlineTracking/distributor?parType=customer_level&parValue=%s&status=6'>"+customerName+"</a> 货物已出厂,可以进入<a href='https://suishenbangtest.nipponpaint.com.cn/order/onlineTracking/distributor?parType=customer_level&parValue=%s&status=6'>随身邦</a>查询详情。";
-           // message = "交货通知:您有订单6114600627 已于今天交货,可以进入<a href='https://suishenbangtest.nipponpaint.com.cn/order/onlineTracking/distributor?parType=customer_level&parValue=%s&status=4'>随身邦</a>查询详情。";
-        }else {
-            String temple = configService.selectConfigByKey("wx.notification.order.complete");
-            String orderFormat = getOrderFormat(order, customerName);
-            message = String.format(temple, orderFormat, chain);
-        }
+        String temple = configService.selectConfigByKey("wx.notification.order.complete");
+        String orderFormat = getOrderFormat(order, customerName);
+        String message = String.format(temple, orderFormat, chain);
         Set<String> customerCodes = new HashSet<>();
         customerCodes.add(chain);
         logger.info("收到需要通知的经销商组织代码:"+chain);

+ 6 - 1
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxPortalController.java

@@ -83,7 +83,7 @@ public class WxPortalController extends ApiBaseController {
     @PostMapping("/portalData")
     public Object getMagent(){
         ParameterObject obj =  getParameterObject();
-        obj.checkParameterNotNull("userId,agent");
+        obj.checkParameterNotNull("userId,agent,userType");
         String loginType="";
         List<Map<String, Object>> loginTypeList = jdbcTemplate.queryForList("select dict_label shopType,dict_value shopTypeValue  from sys_dict_data where  dict_type='system_login_type'  and dict_label=?  ",obj.getString("agent"));
         if(loginTypeList.size()!=0){
@@ -92,6 +92,11 @@ public class WxPortalController extends ApiBaseController {
 
         WxBanner wxBanner = new WxBanner();
         List<WxMagnet> wxMagnetList =  wxMagnetService.selectMagnetByUserId(obj.getString("userId"), obj.getString("cw"), obj.getString("salesLevel"),loginType);
+        //筛选掉没有权限的磁贴
+        String userType = obj.getString("userType");
+        wxMagnetList = wxMagnetList.stream()
+                .filter(magnet -> userType.equals(magnet.getUserType()))
+                .collect(Collectors.toList());
         List<WxBanner> wxBannerList = wxBannerService.selectWxBannerList(wxBanner);
         return AjaxResult.success().putKV("magnets",wxMagnetList).putKV("banners",wxBannerList);
     }

+ 13 - 2
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/domain/WxMagnet.java

@@ -8,8 +8,6 @@ import org.apache.commons.lang3.builder.ToStringStyle;
 
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.Size;
-import java.util.ArrayList;
-import java.util.List;
 
 /**
  * H5磁贴表 wx_magnet
@@ -26,9 +24,14 @@ public class WxMagnet extends BaseEntity
     /** 菜单名称 */
     private String magnetName;
 
+
     /** 显示顺序 */
     private String orderNum;
 
+
+    /** 用户类型 */
+    private String userType;
+
     /** 磁贴URL */
     private String url;
 
@@ -170,6 +173,14 @@ public class WxMagnet extends BaseEntity
         this.isEncry = isEncry;
     }
 
+    public String getUserType() {
+        return userType;
+    }
+
+    public void setUserType(String userType) {
+        this.userType = userType;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 1 - 1
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/mapper/WxMagnetMapper.java

@@ -58,7 +58,7 @@ public interface WxMagnetMapper
      * @param magnetName 磁贴名称
      * @return 结果
      */
-    WxMagnet checkMagnetNameUnique(@Param("magnetName") String magnetName);
+    WxMagnet checkMagnetNameUnique(@Param("magnetName") String magnetName,@Param("userType") String userType);
 
     /**
      * 新增保存磁贴信息

+ 2 - 8
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/impl/WxMagnetServiceImpl.java

@@ -111,7 +111,7 @@ public class WxMagnetServiceImpl implements IWxMagnetService
     @Override
     public String checkMagnetNameUnique(WxMagnet wxMagnet) {
         Long magnetId = StringUtils.isNull(wxMagnet.getMagnetId()) ? -1L : wxMagnet.getMagnetId();
-        WxMagnet info = wxMagnetMapper.checkMagnetNameUnique(wxMagnet.getMagnetName());
+        WxMagnet info = wxMagnetMapper.checkMagnetNameUnique(wxMagnet.getMagnetName(),wxMagnet.getUserType());
         if (StringUtils.isNotNull(info) && info.getMagnetId().longValue() != magnetId.longValue())
         {
             return UserConstants.MENU_NAME_NOT_UNIQUE;
@@ -216,16 +216,10 @@ public class WxMagnetServiceImpl implements IWxMagnetService
      */
     @Override
     public List<WxMagnet> selectMagnetByUserId(String userId, String cw, String salesLevel,String  loginType) {
-//        List<WxMagnet> list;
-//        if (StringUtils.isNotEmpty(cw) && null != salesLevel && "customer_level".equals(salesLevel)) {
-//            String roleId = cw.equals("1") ? configService.selectConfigByKey("libang.customer.roleid") : configService.selectConfigByKey("libang.cw.roleid");
-//            list = wxMagnetMapper.selectMagnetByCw(userId, roleId);
-//        } else {
-//            list = wxMagnetMapper.selectMagnetByUserId(userId);
-//        }
         List<WxMagnet> list  = wxMagnetMapper.selectMagnetByUserId(userId,loginType);
         if(list!=null && list.size()>0){
             for(WxMagnet wxMagnet: list){
+
                 logger.info("isEncry::::"+wxMagnet.getIsEncry());
                 if("1".equals(wxMagnet.getIsEncry())){
                     String sapEmploeeId = this.wxMagnetMapper.selectSapEmploeeIdByUserId(userId);

+ 18 - 8
suishenbang-wxportal/suishenbang-wxportal-common/src/main/resources/mapper/wxportal/WxMagnetMapper.xml

@@ -7,6 +7,7 @@
     <resultMap type="com.dgtly.wxportal.domain.WxMagnet" id="WxMagnetResult">
         <id     property="magnetId"       column="magnet_id"        />
         <result property="magnetName"     column="magnet_name"      />
+        <result property="userType"     column="user_type"      />
         <result property="fatherMagnet"     column="father_magnet"      />
         <result property="orderNum"       column="order_num"      />
         <result property="url"            column="url"            />
@@ -25,18 +26,18 @@
     </resultMap>
 
     <sql id="selectMagnetVo">
-        select magnet_id, magnet_name, father_magnet,order_num, url,  visible, magnet_size, bg_url ,remark, magnet_type, applet_qr_url, create_by, create_time
+        select magnet_id, magnet_name, user_type,father_magnet,order_num, url,  visible, magnet_size, bg_url ,remark, magnet_type, applet_qr_url, create_by, create_time
 		from wx_magnet
     </sql>
 
     <select id="selectTileMagnetList" parameterType="com.dgtly.wxportal.domain.WxMagnet" resultMap="WxMagnetResult">
-    select distinct m.magnet_id, m.father_magnet, m.magnet_name, m.url, m.visible, m.magnet_size
+    select distinct m.magnet_id, m.father_magnet, m.magnet_name,m.user_type, m.url, m.visible, m.magnet_size
     , m.bg_url, m.order_num, m.create_time, m.magnet_type, m.applet_qr_url
     from wx_magnet m where  m.visible =0
     </select>
 
     <select id="selectMagnetList" parameterType="com.dgtly.wxportal.domain.WxMagnet" resultMap="WxMagnetResult">
-        select distinct m.magnet_id, m.father_magnet, m.magnet_name, m.url, m.visible, m.magnet_size
+        select distinct m.magnet_id, m.father_magnet, m.magnet_name,m.user_type, m.url, m.visible, m.magnet_size
         , m.bg_url, m.order_num, m.create_time, m.magnet_type, m.applet_qr_url
         from wx_magnet m
         <where>
@@ -49,6 +50,9 @@
             <if test="magnetSize != null and magnetSize != ''">
                 AND m.magnet_size = #{magnetSize}
             </if>
+            <if test="userType != null and userType != ''">
+                AND m.user_type = #{userType}
+            </if>
             <if test="magnetType != null and magnetType != ''">
                 AND m.magnet_type = #{magnetType}
             </if>
@@ -73,13 +77,14 @@
 
     <select id="checkMagnetNameUnique"  resultMap="WxMagnetResult">
         <include refid="selectMagnetVo"/>
-        where magnet_name=#{magnetName}
+        where magnet_name=#{magnetName} and user_type=#{userType}
     </select>
 
     <insert id="insertMagnet" parameterType="com.dgtly.wxportal.domain.WxMagnet">
         insert into wx_magnet(
         <if test="magnetId != null and magnetId != 0">magnet_id,</if>
         <if test="magnetName != null and magnetName != ''">magnet_name,</if>
+        <if test="userType != null and userType != ''">user_type,</if>
         <if test="fatherMagnet != null and fatherMagnet != ''">father_magnet,</if>
         <if test="orderNum != null and orderNum != ''">order_num,</if>
         <if test="url != null and url != ''">url,</if>
@@ -94,6 +99,7 @@
         )values(
         <if test="magnetId != null and magnetId != 0">#{magnetId},</if>
         <if test="magnetName != null and magnetName != ''">#{magnetName},</if>
+        <if test="userType != null and userType != ''">#{userType},</if>
         <if test="fatherMagnet != null and fatherMagnet != ''">#{fatherMagnet},</if>
         <if test="orderNum != null and orderNum != ''">#{orderNum},</if>
         <if test="url != null and url != ''">#{url},</if>
@@ -112,6 +118,7 @@
         update wx_magnet
         <set>
             <if test="magnetName != null and magnetName != ''">magnet_name = #{magnetName},</if>
+            <if test="userType != null and userType != ''">user_type = #{userType},</if>
             <if test="fatherMagnet != null and fatherMagnet != ''">father_magnet =#{fatherMagnet},</if>
             <if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
             <if test="url != null and url != ''">url = #{url},</if>
@@ -133,7 +140,7 @@
     </select>
 
     <select id="selectMagnetAllByUserId"  resultMap="WxMagnetResult">
-        select distinct m.magnet_id,  m.magnet_name,m.father_magnet, m.url, m.visible, m.magnet_size
+        select distinct m.magnet_id,  m.magnet_name,m.user_type,m.father_magnet, m.url, m.visible, m.magnet_size
         , m.bg_url, m.order_num, m.create_time, m.magnet_type, m.applet_qr_url
         from wx_magnet m
         left join wx_role_magnet rm on m.magnet_id = rm.magnet_id
@@ -144,6 +151,9 @@
             <if test="wxMagnet.magnetName != null and wxMagnet.magnetName != ''">
                 AND m.magnet_name like concat('%', #{wxMagnet.magnetName}, '%')
             </if>
+            <if test="wxMagnet.userType != null and wxMagnet.userType != ''">
+                AND m.user_type = #{wxMagnet.userType}
+            </if>
             <if test="wxMagnet.visible != null and wxMagnet.visible != ''">
                 AND m.visible = #{wxMagnet.visible}
             </if>
@@ -177,7 +187,7 @@
     </insert>
 
     <select id="selectMagnetByUserId" parameterType="String" resultMap="WxMagnetResult">
-        select distinct m.magnet_id,  m.magnet_name,m.father_magnet, m.url, m.visible, m.magnet_size
+        select distinct m.magnet_id, m.magnet_name,m.user_type,m.father_magnet, m.url, m.visible, m.magnet_size
         , m.bg_url, m.order_num, m.create_time, m.magnet_type, m.applet_qr_url,m.is_encry
         from wx_magnet m
         left join wx_role_magnet rm on m.magnet_id = rm.magnet_id
@@ -199,7 +209,7 @@
     </select>
 
     <select id="selectWxMagnetRoleByUserId" parameterType="String" resultMap="WxMagnetResult">
-        select distinct m.magnet_id,  m.magnet_name,m.father_magnet, m.url, m.visible, m.magnet_size
+        select distinct m.magnet_id,  m.magnet_name,m.user_type,m.father_magnet, m.url, m.visible, m.magnet_size
         , m.bg_url, m.order_num, m.create_time, m.magnet_type, m.applet_qr_url,m.is_encry
         from wx_magnet m
         left join wx_role_magnet rm on m.magnet_id = rm.magnet_id
@@ -213,7 +223,7 @@
     </select>
 
     <select id="selectMagnetByCw" parameterType="String" resultMap="WxMagnetResult">
-        select distinct m.magnet_id,  m.magnet_name,m.father_magnet, m.url, m.visible, m.magnet_size
+        select distinct m.magnet_id,  m.magnet_name,m.user_type,m.father_magnet, m.url, m.visible, m.magnet_size
         , m.bg_url, m.order_num, m.create_time, m.magnet_type, m.applet_qr_url,m.is_encry
         from wx_magnet m
         left join wx_role_magnet rm on m.magnet_id = rm.magnet_id

+ 9 - 1
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/add.html

@@ -99,7 +99,15 @@
                 </select>
             </div>
         </div>
-
+        <div class="form-group">
+            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>磁贴入口:</label>
+            <div class="col-sm-8">
+                <select name="userType" id="sel_userType" class="form-control m-b"
+                        th:with="type=${@dict.getType('sys_system_name')}">
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                </select>
+            </div>
+        </div>
         <div class="form-group">
             <label class="col-sm-3 control-label"><span style="color: red; ">*</span>磁贴名称:</label>
             <div class="col-sm-8">

+ 11 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/edit.html

@@ -94,6 +94,17 @@
                 </select>
             </div>
         </div>
+        <div class="form-group">
+            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>磁贴入口:</label>
+            <div class="col-sm-8">
+                <select name="userType" id="sel_userType" class="form-control m-b"
+                        th:with="type=${@dict.getType('sys_system_name')}"
+                        onchange="javascript:magnetTypeChange()">
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
+                            th:field="*{userType}"></option>
+                </select>
+            </div>
+        </div>
         <div class="form-group">
             <label class="col-sm-3 control-label"><span style="color: red; ">*</span>磁贴名称:</label>
             <div class="col-sm-8">

+ 17 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/magnet/wxMagnet.html

@@ -42,6 +42,12 @@
 							<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
 						</select>
 						</li>
+						<li>
+							磁贴入口:<select name="userType" th:with="type=${@dict.getType('sys_system_name')}">
+							<option value="">所有</option>
+							<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+						</select>
+						</li>
 						<li>
 							<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
 							<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
@@ -75,6 +81,8 @@
 	var datas = [[${@dict.getType('sys_show_hide')}]];
 	var magnetSizeList = [[${@dict.getType('wx_magnet_size')}]];
 	var magnetTypeDatas = [[${@dict.getType('sys_magnet_type')}]];
+    var userTypeDatas = [[${@dict.getType('sys_system_name')}]];
+
 	var prefix = ctx + "wxportal/magnet";
 
 	$(function() {
@@ -141,6 +149,15 @@
 						return $.table.selectDictLabel(magnetTypeDatas, item.magnetType);
 					}
 				},
+                {
+                    title: '磁贴入口',
+                    field: 'userType',
+                    width: '10%',
+                    align: "left",
+                    formatter: function(value, item, index) {
+                        return $.table.selectDictLabel(userTypeDatas, item.userType);
+                    }
+                },
 				{
 					title: '磁贴尺寸',
 					field: 'magnetType',