修改删除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.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 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.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.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.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.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.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 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.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.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.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.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.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.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 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.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.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.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.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.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.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.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.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.model.vo.ForecastWeather7DayVo;

View File

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