Browse Source

Merge remote-tracking branch 'origin/dev_ui_upgrade' into develop

dev_shibei_match
yinzuomei 4 years ago
parent
commit
a2dc3ab7b2
  1. 27
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SyncFootBar4CustomerFormDTO.java
  2. 10
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java
  3. 24
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java
  4. 3
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java
  5. 52
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java
  6. 42
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml

27
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SyncFootBar4CustomerFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 客户定制化-同步footbar
*
* @author yinzuomei@elink-cn.com
* @date 2021/7/28 15:21
*/
@Data
public class SyncFootBar4CustomerFormDTO implements Serializable {
private static final long serialVersionUID = 8879950597580438204L;
@NotBlank(message = "customerId不能为空")
private String customerId;
@NotBlank(message = "appType不能为空")
private String appType;
private List<String> syncBarKeyList;
private List<String> addBarKeyList;
@NotBlank(message = "操作用户不能为空")
private String userId;
}

10
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java

@ -17,10 +17,12 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
@ -33,6 +35,7 @@ import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CheckFloatFootBarFormDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.dto.form.NotOnlineFootBarFormDTO;
import com.epmet.dto.form.SyncFootBar4CustomerFormDTO;
import com.epmet.dto.result.CheckFloatFootBarResultDTO;
import com.epmet.dto.result.CustomerFootBarResultDTO;
import com.epmet.entity.CustomerFootBarEntity;
@ -281,9 +284,10 @@ public class CustomerFootBarController {
* @author yinzuomei
* @date 2021/7/28 10:01
*/
@PostMapping("createfootbar-customer")
public Result createFootBarCustomer(@RequestBody CustomerFootBarFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.CreateFootBarGroup.class);
@PostMapping("syncfootbar4customer")
public Result createFootBarCustomer(@LoginUser TokenDto tokenDto, @RequestBody SyncFootBar4CustomerFormDTO form) {
form.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(form);
customerFootBarService.createFootBarCustomer(form);
return new Result();
}

24
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java

@ -95,4 +95,28 @@ public interface CustomerFootBarDao extends BaseDao<CustomerFootBarEntity> {
* @date 2021/7/28 9:49
*/
List<CustomerFootBarEntity> selectNotOnlineFootBars(@Param("customerId") String customerId, @Param("appType")String appType);
/**
* 根据key查询
*
* @param customerId
* @param appType
* @param barKeyList
* @return com.epmet.entity.CustomerFootBarEntity
* @author yinzuomei
* @date 2021/7/28 15:27
*/
List<CustomerFootBarEntity> selectListByKey(@Param("customerId")String customerId,
@Param("appType")String appType,
@Param("barKeyList")List<String> barKeyList);
int updateCustomerFootBarByKey(@Param("customerId")String customerId,
@Param("appType")String appType,
@Param("barKey")String barKey,
@Param("userId")String userId,
@Param("pageTitle")String pageTitle,
@Param("barName")String barName,
@Param("iconPath")String iconPath,
@Param("selectedIconPath")String selectedIconPath,
@Param("floatIconPath")String floatIconPath);
}

3
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java

@ -24,6 +24,7 @@ import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CheckFloatFootBarFormDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.dto.form.NotOnlineFootBarFormDTO;
import com.epmet.dto.form.SyncFootBar4CustomerFormDTO;
import com.epmet.dto.result.CheckFloatFootBarResultDTO;
import com.epmet.dto.result.CustomerFootBarResultDTO;
import com.epmet.entity.CustomerFootBarEntity;
@ -138,7 +139,7 @@ public interface CustomerFootBarService extends BaseService<CustomerFootBarEntit
* @author yinzuomei
* @date 2021/7/28 10:01
*/
void createFootBarCustomer(CustomerFootBarFormDTO form);
void createFootBarCustomer(SyncFootBar4CustomerFormDTO form);
/**
* 客户定制化-FootBar配置获取当前客户未上线的

52
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java

@ -20,6 +20,7 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
@ -33,6 +34,7 @@ import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CheckFloatFootBarFormDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.dto.form.NotOnlineFootBarFormDTO;
import com.epmet.dto.form.SyncFootBar4CustomerFormDTO;
import com.epmet.dto.result.CheckFloatFootBarResultDTO;
import com.epmet.dto.result.CustomerFootBarResultDTO;
import com.epmet.entity.CustomerFootBarEntity;
@ -344,23 +346,41 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD
* @author yinzuomei
* @date 2021/7/28 10:01
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void createFootBarCustomer(CustomerFootBarFormDTO form) {
validateBeforeCreate(form);
CustomerFootBarEntity entity = new CustomerFootBarEntity();
entity.setAppType(form.getAppType());
entity.setCustomerId(form.getCustomerId());
entity.setBarKey(form.getBarKey());
entity.setBarName(form.getBarName());
entity.setIconPath(form.getIconPath());
entity.setPageTitle(form.getPageTitle());
entity.setSelectedIconPath(form.getSelectedIconPath());
entity.setOrderIndex(baseDao.fetchNextOrder(form.getCustomerId(), form.getAppType()));
entity.setDisplay(true);
entity.setFloatIconPath(form.getFloatIconPath());
baseDao.insert(entity);
public void createFootBarCustomer(SyncFootBar4CustomerFormDTO form) {
if (!CollectionUtils.isEmpty(form.getSyncBarKeyList())) {
List<CustomerFootBarEntity> syncList = baseDao.selectListByKey(Constant.DEFAULT_CUSTOMER, form.getAppType(), form.getSyncBarKeyList());
syncList.forEach(syncEntity -> {
baseDao.updateCustomerFootBarByKey(form.getCustomerId(),
form.getAppType(),
syncEntity.getBarKey(),
form.getUserId(),
syncEntity.getPageTitle(),
syncEntity.getBarName(),
syncEntity.getIconPath(),
syncEntity.getSelectedIconPath(),
syncEntity.getFloatIconPath()
);
});
}
if (!CollectionUtils.isEmpty(form.getAddBarKeyList())) {
List<CustomerFootBarEntity> addList = baseDao.selectListByKey(Constant.DEFAULT_CUSTOMER, form.getAppType(), form.getAddBarKeyList());
addList.forEach(addEntity -> {
CustomerFootBarFormDTO footBarFormDTO = new CustomerFootBarFormDTO();
footBarFormDTO.setCustomerId(form.getCustomerId());
footBarFormDTO.setAppType(form.getAppType());
footBarFormDTO.setBarKey(addEntity.getBarKey());
footBarFormDTO.setBarName(addEntity.getBarName());
validateBeforeCreate(footBarFormDTO);
CustomerFootBarEntity entity = ConvertUtils.sourceToTarget(addEntity, CustomerFootBarEntity.class);
entity.setCustomerId(form.getCustomerId());
entity.setOrderIndex(baseDao.fetchNextOrder(form.getCustomerId(), form.getAppType()));
entity.setDisplay(true);
baseDao.insert(entity);
});
}
}
/**

42
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml

@ -171,6 +171,7 @@
page_title,
icon_path,
selected_icon_path,
FLOAT_ICON_PATH as floatIconPath,
display,
order_index,
del_flag,
@ -200,6 +201,7 @@
page_title,
icon_path,
selected_icon_path,
FLOAT_ICON_PATH as floatIconPath,
display,
order_index,
del_flag,
@ -221,7 +223,8 @@
m.app_type as appType,
m.PAGE_TITLE as pageTitle,
m.ICON_PATH as iconPath,
m.SELECTED_ICON_PATH as selectedIconPath
m.SELECTED_ICON_PATH as selectedIconPath,
m.FLOAT_ICON_PATH as floatIconPath
from customer_foot_bar m
where m.DEL_FLAG='0'
and m.CUSTOMER_ID='default'
@ -235,4 +238,41 @@
and cfb.app_type=#{appType}
)order by m.ORDER_INDEX asc
</select>
<!-- 根据key查询 -->
<select id="selectListByKey" parameterType="map" resultType="com.epmet.entity.CustomerFootBarEntity">
select
m.BAR_NAME as barName,
m.BAR_KEY as barKey,
m.app_type as appType,
m.PAGE_TITLE as pageTitle,
m.ICON_PATH as iconPath,
m.SELECTED_ICON_PATH as selectedIconPath,
m.FLOAT_ICON_PATH as floatIconPath
from customer_foot_bar m
where m.DEL_FLAG='0'
and m.CUSTOMER_ID=#{customerId}
and m.app_type=#{appType}
and m.DISPLAY='1'
and m.BAR_KEY in
<foreach collection="barKeyList" item="barKey" open="( " separator=" , " index="index" close=")">
#{barKey}
</foreach>
</select>
<update id="updateCustomerFootBarByKey" parameterType="map">
UPDATE customer_foot_bar
SET BAR_NAME = #{barName},
PAGE_TITLE = #{pageTitle},
ICON_PATH = #{iconPath},
SELECTED_ICON_PATH = #{selectedIconPath},
FLOAT_ICON_PATH = #{floatIconPath},
UPDATED_BY = #{userId},
UPDATED_TIME = NOW()
WHERE
CUSTOMER_ID = #{customerId}
AND app_type = #{appType}
AND BAR_KEY = #{barKey}
AND DEL_FLAG = '0'
</update>
</mapper>
Loading…
Cancel
Save