Browse Source

getcustomerform调整

dev_shibei_match
yinzuomei 4 years ago
parent
commit
5ea973af03
  1. 8
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  2. 24
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java
  3. 4
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java

8
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -586,7 +586,11 @@ public class RedisKeys {
* @param customerId
* @return
*/
public static String getIcFormKey(String formCode,String customerId) {
return rootPrefix.concat("icform:").concat(formCode).concat(":").concat(customerId);
public static String getIcFormKeyForAdd(String formCode,String customerId) {
return rootPrefix.concat("icform:").concat(formCode).concat(":add:").concat(customerId);
}
public static String getIcFormKeyForExport(String formCode,String customerId) {
return rootPrefix.concat("icform:").concat(formCode).concat(":export:").concat(customerId);
}
}

24
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFootBarRedis.java

@ -51,18 +51,32 @@ public class CustomerFootBarRedis {
}
public void deleteIcForm(String formCode,String customerId) {
String key = RedisKeys.getIcFormKey(formCode,customerId);
String key = RedisKeys.getIcFormKeyForAdd(formCode,customerId);
redisUtils.delete(key);
}
public void setCustomerFormResultDTO(String formCode,String customerId, CustomerFormResultDTO value){
String key = RedisKeys.getIcFormKey(formCode,customerId);
public void setCustomerFormResultDTO(String formCode,String customerId, CustomerFormResultDTO value,Boolean dynamic){
String key="";
if (null != dynamic && dynamic) {
//新增表单
key = RedisKeys.getIcFormKeyForAdd(formCode,customerId);
}else{
//导出
key = RedisKeys.getIcFormKeyForExport(formCode,customerId);
}
Map<String, Object> map = BeanUtil.beanToMap(value, false, true);
redisUtils.hMSet(key, map);
}
public CustomerFormResultDTO getCustomerFormResultDTO(String formCode,String customerId){
String key = RedisKeys.getIcFormKey(formCode,customerId);
public CustomerFormResultDTO getCustomerFormResultDTO(String formCode,String customerId,Boolean dynamic){
String key="";
if (null != dynamic && dynamic) {
//新增表单
key = RedisKeys.getIcFormKeyForAdd(formCode,customerId);
}else{
//导出
key = RedisKeys.getIcFormKeyForExport(formCode,customerId);
}
Map<String, Object> resultMap = redisUtils.hGetAll(key);
if (CollectionUtils.isEmpty(resultMap)) {
return null;

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

@ -116,7 +116,7 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity>
*/
@Override
public CustomerFormResultDTO getCustomerForm(CustomerFormQueryDTO formDto) {
CustomerFormResultDTO customerFormResultDTO = customerFootBarRedis.getCustomerFormResultDTO(formDto.getFormCode(), formDto.getCustomerId());
CustomerFormResultDTO customerFormResultDTO = customerFootBarRedis.getCustomerFormResultDTO(formDto.getFormCode(), formDto.getCustomerId(),formDto.getDynamic());
if (null != customerFormResultDTO) {
return customerFormResultDTO;
}
@ -128,7 +128,7 @@ public class IcFormServiceImpl extends BaseServiceImpl<IcFormDao, IcFormEntity>
List<FormGroupDTO> groupList=baseDao.selectListGroup(resultDTO.getFormId());
resultDTO.setItemList(itemList);
resultDTO.setGroupList(groupList);
customerFootBarRedis.setCustomerFormResultDTO(formDto.getFormCode(),formDto.getCustomerId(),resultDTO);
customerFootBarRedis.setCustomerFormResultDTO(formDto.getFormCode(),formDto.getCustomerId(),resultDTO,formDto.getDynamic());
return resultDTO;
}

Loading…
Cancel
Save