Browse Source

增加:footbar删除功能

增加:oper运营端查询footbar列表功能
修复:footbar列表增加display新列的返回
dev_shibei_match
wxz 5 years ago
parent
commit
16097c9899
  1. 12
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java
  2. 37
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java
  3. 5
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java
  4. 4
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java
  5. 13
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java
  6. 38
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml

12
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java

@ -17,6 +17,9 @@ public class CustomerFootBarFormDTO {
// 查询footbar列表分组 // 查询footbar列表分组
public interface ListFootBarGroup extends CustomerClientShowGroup {} public interface ListFootBarGroup extends CustomerClientShowGroup {}
// 运营端查询footbar列表分组
public interface ListFootBarGroup4Oper extends CustomerClientShowGroup {}
// 更新footbar // 更新footbar
public interface UpdateFootBarGroup extends CustomerClientShowGroup {} public interface UpdateFootBarGroup extends CustomerClientShowGroup {}
@ -32,14 +35,17 @@ public class CustomerFootBarFormDTO {
// 为客户添加默认footbar // 为客户添加默认footbar
public interface AddDefaultFootbars4Customer extends CustomerClientShowGroup {} public interface AddDefaultFootbars4Customer extends CustomerClientShowGroup {}
@NotBlank(message = "FootBar的ID不能为空", groups = { UpdateFootBarGroup.class, FootBarDetailGroup.class, UpdateDisplayStatusGroup.class }) // 删除footbar
public interface DeleteFootbarsGroup extends CustomerClientShowGroup {}
@NotBlank(message = "FootBar的ID不能为空", groups = { UpdateFootBarGroup.class, FootBarDetailGroup.class, UpdateDisplayStatusGroup.class, DeleteFootbarsGroup.class })
private String id; private String id;
@NotBlank(message = "客户ID不能为空", groups = { AddDefaultFootbars4Customer.class }) @NotBlank(message = "客户ID不能为空", groups = { AddDefaultFootbars4Customer.class, ListFootBarGroup4Oper.class })
private String customerId; private String customerId;
// 哪一个端:gov,resi // 哪一个端:gov,resi
@NotBlank(message = "app类型不能为空", groups = { ListFootBarGroup.class, CreateFootBarGroup.class, AddDefaultFootbars4Customer.class }) @NotBlank(message = "app类型不能为空", groups = { ListFootBarGroup.class, CreateFootBarGroup.class, AddDefaultFootbars4Customer.class, ListFootBarGroup4Oper.class })
private String appType; private String appType;
@NotBlank(message = "名称不能为空", groups = { CreateFootBarGroup.class, UpdateFootBarGroup.class }) @NotBlank(message = "名称不能为空", groups = { CreateFootBarGroup.class, UpdateFootBarGroup.class })

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

@ -120,6 +120,31 @@ public class CustomerFootBarController {
return new Result<List<CustomerFootBarDTO>>().ok(barDTOS); return new Result<List<CustomerFootBarDTO>>().ok(barDTOS);
} }
/**
* 运营端查询footbar列表
* @param formDTO
* @return
*/
@PostMapping("customerfootbars4oper")
public Result<List<CustomerFootBarDTO>> getCustomerfootbars4Oper(@RequestBody CustomerFootBarFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CustomerFootBarFormDTO.ListFootBarGroup4Oper.class);
String customerId = formDTO.getCustomerId();
String appType = formDTO.getAppType();
List<CustomerFootBarEntity> footbars = customerFootBarService.listAllCustomerFootBars(customerId, appType);
List<CustomerFootBarDTO> barDTOS = new LinkedList<>();
footbars.forEach(barEntity -> {
CustomerFootBarEntity defaultFootBarEntity = customerFootBarService.getByAppTypeAndBarKeyOfCustomer("default", barEntity.getAppType(), barEntity.getBarKey());
CustomerFootBarDTO barDTO = new CustomerFootBarDTO();
BeanUtils.copyProperties(barEntity, barDTO);
barDTO.setDefaultBarName(defaultFootBarEntity.getBarName());
barDTOS.add(barDTO);
});
return new Result<List<CustomerFootBarDTO>>().ok(barDTOS);
}
/** /**
* 创建footbar只能创建默认的不能直接为客户创建 * 创建footbar只能创建默认的不能直接为客户创建
* @param form * @param form
@ -192,4 +217,16 @@ public class CustomerFootBarController {
return new Result(); return new Result();
} }
/**
* 删除footbar
* @param form
* @return
*/
@PostMapping("deletefootbar")
public Result deleteFootBar(@RequestBody CustomerFootBarFormDTO form) {
ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.DeleteFootbarsGroup.class);
customerFootBarService.deleteFootBar(form.getId());
return new Result();
}
} }

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

@ -33,7 +33,10 @@ import java.util.List;
@Mapper @Mapper
public interface CustomerFootBarDao extends BaseDao<CustomerFootBarEntity> { public interface CustomerFootBarDao extends BaseDao<CustomerFootBarEntity> {
List<CustomerFootBarEntity> listCustomerFootBars(@Param("customerId") String customerId, List<CustomerFootBarEntity> listDisplayCustomerFootBars(@Param("customerId") String customerId,
@Param("appType") String appType);
List<CustomerFootBarEntity> listAllCustomerFootBars(@Param("customerId") String customerId,
@Param("appType") String appType); @Param("appType") String appType);
/** /**

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

@ -97,6 +97,8 @@ public interface CustomerFootBarService extends BaseService<CustomerFootBarEntit
List<CustomerFootBarEntity> listCustomerFootBars(String customerId, String appType); List<CustomerFootBarEntity> listCustomerFootBars(String customerId, String appType);
List<CustomerFootBarEntity> listAllCustomerFootBars(String customerId, String appType);
void createFootBar(CustomerFootBarFormDTO form); void createFootBar(CustomerFootBarFormDTO form);
void updateFootBar(CustomerFootBarFormDTO form); void updateFootBar(CustomerFootBarFormDTO form);
@ -110,4 +112,6 @@ public interface CustomerFootBarService extends BaseService<CustomerFootBarEntit
void updateDisplayStatus(String id, Boolean display); void updateDisplayStatus(String id, Boolean display);
void addDefault4Customer(String customerId, String appType); void addDefault4Customer(String customerId, String appType);
void deleteFootBar(String id);
} }

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

@ -36,7 +36,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -108,7 +107,12 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD
@Override @Override
public List<CustomerFootBarEntity> listCustomerFootBars(String customerId, String appType) { public List<CustomerFootBarEntity> listCustomerFootBars(String customerId, String appType) {
return baseDao.listCustomerFootBars(customerId, appType); return baseDao.listDisplayCustomerFootBars(customerId, appType);
}
@Override
public List<CustomerFootBarEntity> listAllCustomerFootBars(String customerId, String appType) {
return baseDao.listAllCustomerFootBars(customerId, appType);
} }
@Override @Override
@ -225,6 +229,11 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD
} }
} }
@Override
public void deleteFootBar(String id) {
baseDao.deleteById(id);
}
/** /**
* 添加footbar之前的校验 * 添加footbar之前的校验
* @param form * @param form

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

@ -35,27 +35,55 @@
</update> </update>
<!--查询客户的footbar列表--> <!--查询客户的footbar列表-->
<select id="listCustomerFootBars" resultType="com.epmet.entity.CustomerFootBarEntity"> <select id="listDisplayCustomerFootBars" resultType="com.epmet.entity.CustomerFootBarEntity">
SELECT SELECT
id, id,
customer_id, customer_id,
app_type, app_type,
bar_key, bar_key,
bar_name, bar_name,
app_type,
page_title, page_title,
icon_path, icon_path,
selected_icon_path, selected_icon_path,
`order_index`, display,
order_index,
del_flag, del_flag,
revision, revision,
created_by, created_by,
created_time, created_time,
updated_by, updated_by,
updated_time, updated_time
ORDER_INDEX
FROM FROM
customer_foot_bar customer_foot_bar
<where>
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND APP_TYPE = #{appType}
AND DISPLAY = 1
</where>
ORDER BY `ORDER_INDEX` ASC
</select>
<select id="listAllCustomerFootBars" resultType="com.epmet.entity.CustomerFootBarEntity">
SELECT
id,
customer_id,
app_type,
bar_key,
bar_name,
page_title,
icon_path,
selected_icon_path,
display,
order_index,
del_flag,
revision,
created_by,
created_time,
updated_by,
updated_time
FROM
customer_foot_bar
<where> <where>
DEL_FLAG = '0' DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId} AND CUSTOMER_ID = #{customerId}

Loading…
Cancel
Save