Compare commits
No commits in common. "4702f39cd8678b826bcd5d901ba371f0b873cde5" and "7b838714380fc163466d2e8a658b7031300f52fb" have entirely different histories.
4702f39cd8
...
7b83871438
|
|
@ -8,8 +8,6 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import cn.hutool.json.JSONUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.constant.CacheConstant;
|
||||
import org.jeecg.common.constant.IotConstants;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.entity.SurvConfig;
|
||||
import org.jeecg.common.vo.dict.DictVo;
|
||||
|
|
@ -22,7 +20,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -99,7 +96,6 @@ public class SurvConfigController extends JeecgController<SurvConfig, ISurvConfi
|
|||
@ApiOperation(value="业务参数配置表-编辑", notes="业务参数配置表-编辑")
|
||||
@RequiresPermissions("appmana:surv_config:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
@CacheEvict(value= {IotConstants.IOT_SURVCONFIG_CACHE}, allEntries=true)
|
||||
public Result<String> edit(@RequestBody SurvConfig survConfig, HttpServletRequest request) {
|
||||
//创建、更新时间不能编辑
|
||||
survConfig.setCreateTime(null);
|
||||
|
|
@ -123,7 +119,6 @@ public class SurvConfigController extends JeecgController<SurvConfig, ISurvConfi
|
|||
@ApiOperation(value="业务参数配置表-通过id删除", notes="业务参数配置表-通过id删除")
|
||||
@RequiresPermissions("appmana:surv_config:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
@CacheEvict(value= {IotConstants.IOT_SURVCONFIG_CACHE}, allEntries=true)
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
survConfigService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import org.jeecg.modules.appmana.service.ISurvHisdataOrientwaterService;
|
|||
import org.jeecg.modules.appmana.service.ISurvHisdataSoilService;
|
||||
import org.jeecg.common.vo.VOHisResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
|
@ -35,7 +34,6 @@ public class CommonServiceImpl {
|
|||
@Autowired
|
||||
private ISurvHisdataLivestockwaterService hisdataLivestockwaterService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private SurvConfigServiceImpl configService;
|
||||
|
||||
/**
|
||||
|
|
@ -148,9 +146,4 @@ public class CommonServiceImpl {
|
|||
}
|
||||
return survConfig;
|
||||
}
|
||||
|
||||
public SurvConfig queryCacheSurvConfig(String tenantId,String configType){
|
||||
return configService.getCacheConfig(tenantId, configType);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,9 +10,7 @@ import org.jeecg.common.entity.SurvConfig;
|
|||
import org.jeecg.common.vo.dict.DictVo;
|
||||
import org.jeecg.modules.appmana.mapper.SurvConfigMapper;
|
||||
import org.jeecg.modules.appmana.service.ISurvConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
|
@ -32,25 +30,17 @@ import java.util.stream.Collectors;
|
|||
@Service
|
||||
public class SurvConfigServiceImpl extends ServiceImpl<SurvConfigMapper, SurvConfig> implements ISurvConfigService {
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private CommonServiceImpl commonService;
|
||||
|
||||
@Override
|
||||
public String getValueByKey(String key) {
|
||||
return baseMapper.getValueByKey(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Cacheable(value = IotConstants.IOT_SURVCONFIG_CACHE, key = "#tenantId+':'+#type", unless = "#result == null ")
|
||||
public SurvConfig getOneByTypeWithTenant(String tenantId, String type) {
|
||||
if(StringUtils.isBlank(tenantId)){
|
||||
tenantId = "0";
|
||||
}
|
||||
return commonService.queryCacheSurvConfig(tenantId,type);
|
||||
}
|
||||
|
||||
@Cacheable(value = IotConstants.IOT_SURVCONFIG_CACHE, key = "#tenantId+':'+#type", unless = "#result == null ")
|
||||
public SurvConfig getCacheConfig(String tenantId, String type) {
|
||||
return baseMapper.getOneByTypeWithTenant(tenantId, type);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,5 @@
|
|||
<if test="param2.maintainTime!=null">
|
||||
and DATE_FORMAT(MAINTAIN_TIME, '%Y-%m-%d') = DATE_FORMAT(#{param2.maintainTime},'%Y-%m-%d')
|
||||
</if>
|
||||
order by MAINTAIN_TIME desc,CREATE_TIME desc
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue