修改删除bug

This commit is contained in:
qdxkrs 2022-06-22 17:36:42 +08:00
parent 90f22fa887
commit ca01cb1536
25 changed files with 33 additions and 28 deletions

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.FileAppEntity; import com.xkrs.microservice.model.entity.FileAppEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.service.CacheService; import com.xkrs.microservice.service.CacheService;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.CropClassifyRecordEntity; import com.xkrs.microservice.model.entity.CropClassifyRecordEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.*; import com.xkrs.microservice.model.entity.*;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.FarmingInfoEntity; import com.xkrs.microservice.model.entity.FarmingInfoEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.FileDocumentEntity; import com.xkrs.microservice.model.entity.FileDocumentEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.model.vo.FileServerResultVo; import com.xkrs.microservice.model.vo.FileServerResultVo;
import com.xkrs.microservice.service.FileServerService; import com.xkrs.microservice.service.FileServerService;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.context.i18n.LocaleContextHolder;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.HydrologicalStationEntity; import com.xkrs.microservice.model.entity.HydrologicalStationEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.IndependentCheckEntity; import com.xkrs.microservice.model.entity.IndependentCheckEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.IrrigationCheckEntity; import com.xkrs.microservice.model.entity.IrrigationCheckEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.IrrigationRecordEntity; import com.xkrs.microservice.model.entity.IrrigationRecordEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.IrrigationSarRecordEntity; import com.xkrs.microservice.model.entity.IrrigationSarRecordEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.vo.ShpCityVo; import com.xkrs.microservice.model.vo.ShpCityVo;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import nl.basjes.parse.useragent.UserAgent; import nl.basjes.parse.useragent.UserAgent;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.SysRoleEntity; import com.xkrs.microservice.model.entity.SysRoleEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.TeaGardenPlotEntity; import com.xkrs.microservice.model.entity.TeaGardenPlotEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.TifProductEntity; import com.xkrs.microservice.model.entity.TifProductEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.TypicalFarmerEntity; import com.xkrs.microservice.model.entity.TypicalFarmerEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.TypicalPlotEntity; import com.xkrs.microservice.model.entity.TypicalPlotEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.TypicalPlotIrrigationEntity; import com.xkrs.microservice.model.entity.TypicalPlotIrrigationEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.entity.WcsRecordEntity; import com.xkrs.microservice.model.entity.WcsRecordEntity;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.common.tool.PageBean; import com.xkrs.microservice.common.tool.PageBean;

View File

@ -1,4 +1,4 @@
package com.xkrs.microservice.controller; package com.xkrs.microservice.common.tool.controller;
import com.xkrs.microservice.common.encapsulation.PromptMessageEnum; import com.xkrs.microservice.common.encapsulation.PromptMessageEnum;
import com.xkrs.microservice.model.vo.ForecastWeather7DayVo; import com.xkrs.microservice.model.vo.ForecastWeather7DayVo;

View File

@ -8,8 +8,10 @@ import com.xkrs.microservice.util.CopyPropertiesUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@ -57,7 +59,8 @@ public class TeaGardenPlotServiceImpl implements TeaGardenPlotService {
* 新增典型地块记录 * 新增典型地块记录
* @param teaGardenPlotQo * @param teaGardenPlotQo
*/ */
@Cacheable(keyGenerator = "keyGenerator", unless="#result == null") @Transactional(rollbackFor=Exception.class)
@CacheEvict(value = "TeaGardenPlotServiceCache",allEntries = true)
@Override @Override
public void add(TeaGardenPlotQo teaGardenPlotQo){ public void add(TeaGardenPlotQo teaGardenPlotQo){
TeaGardenPlotEntity teaGardenPlotEntity = new TeaGardenPlotEntity(); TeaGardenPlotEntity teaGardenPlotEntity = new TeaGardenPlotEntity();
@ -73,7 +76,8 @@ public class TeaGardenPlotServiceImpl implements TeaGardenPlotService {
* 更新典型地块记录 * 更新典型地块记录
* @param teaGardenPlotQo * @param teaGardenPlotQo
*/ */
@Cacheable(keyGenerator = "keyGenerator", unless="#result == null") @Transactional(rollbackFor=Exception.class)
@CacheEvict(value = "TeaGardenPlotServiceCache",allEntries = true)
@Override @Override
public void update(TeaGardenPlotQo teaGardenPlotQo){ public void update(TeaGardenPlotQo teaGardenPlotQo){
TeaGardenPlotEntity teaGardenPlotEntity = new TeaGardenPlotEntity(); TeaGardenPlotEntity teaGardenPlotEntity = new TeaGardenPlotEntity();
@ -90,11 +94,12 @@ public class TeaGardenPlotServiceImpl implements TeaGardenPlotService {
* @param id * @param id
* @return * @return
*/ */
@Cacheable(keyGenerator = "keyGenerator", unless="#result == null") @Transactional(rollbackFor=Exception.class)
@CacheEvict(value = "TeaGardenPlotServiceCache",allEntries = true)
@Override @Override
public int delete(Integer id){ public int delete(Integer id){
Optional<TeaGardenPlotEntity> teaGardenPlotEntityOptional = teaGardenPlotDao.findById(id); Optional<TeaGardenPlotEntity> teaGardenPlotEntityOptional = teaGardenPlotDao.findById(id);
if(teaGardenPlotEntityOptional.isPresent()){ if(teaGardenPlotEntityOptional.isEmpty()){
return 1; return 1;
} }
teaGardenPlotDao.deleteById(id); teaGardenPlotDao.deleteById(id);