Commit 9aea7611 authored by 王夏晖's avatar 王夏晖

修改批量新增操作的后台接收方式;新增参数关联后套配置

parent 2ce4f57d
package org.rcisoft.business.mainte.adaptive.dao;
import com.sun.xml.internal.rngom.parse.host.Base;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.mainte.adaptive.entity.BusParamRefer;
import org.rcisoft.business.mainte.adaptive.entity.TotalSensor;
import org.rcisoft.business.mainte.adaptive.vo.Params;
import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -13,7 +15,7 @@ import java.util.List;
* Created by JiChao on 2018/4/28.
*/
@Repository
public interface BusParamReferRepository {
public interface BusParamReferRepository extends BaseMapper<BusParamRefer>{
/**
* 查询网关参数
......
......@@ -81,7 +81,7 @@ public class ParamLibraryController {
@ApiOperation(value="添加", notes="添加")
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping(value = "/add")
public Result add(@Valid BusParamLibraryList busParamLibraryList) {
public Result add(@RequestBody BusParamLibraryList busParamLibraryList) {
PersistModel data = paramLibraryService.save(busParamLibraryList);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
......
......@@ -30,7 +30,7 @@ public class BusDeviceParamController extends PaginationController<BusDevicePara
@ApiOperation(value="添加设备参数模板", notes="添加设备参数模板")
@PostMapping(value = "/add")
public Result add(@Valid BusDeviceParamList busDeviceParamList) {
public Result add(@RequestBody BusDeviceParamList busDeviceParamList) {
PersistModel data = busDeviceParamServiceImpl.save(busDeviceParamList);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
......
......@@ -11,10 +11,7 @@ import org.rcisoft.core.controller.PaginationController;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
......@@ -36,7 +33,7 @@ public class BusDevicetpParamController extends PaginationController<BusDevicetp
*/
@ApiOperation(value="添加设备类型模板", notes="添加设备类型模板")
@PostMapping(value = "/add")
public Result add(@Valid BusDevicetpParamList busDevicetpParamList) {
public Result add(@RequestBody BusDevicetpParamList busDevicetpParamList) {
PersistModel data = busDevicetpParamServiceImpl.save(busDevicetpParamList);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
......
......@@ -28,7 +28,7 @@ public class BusLibraryParamController extends PaginationController<BusLibraryPa
@ApiOperation(value="添加设备参数库模板", notes="添加设备参数库模板")
@PostMapping(value = "/add")
public Result add(@Valid BusLibraryParamList busLibraryParamList) {
public Result add(@RequestBody BusLibraryParamList busLibraryParamList) {
PersistModel data = busLibraryParamServiceImpl.save(busLibraryParamList);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
......
package org.rcisoft.business.manage.controller;
/*固定导入*/
import io.swagger.annotations.ApiOperation;
import org.rcisoft.business.mainte.adaptive.entity.BusParamRefer;
import org.rcisoft.business.manage.service.BusParamReferService;
import org.rcisoft.core.constant.MessageConstant;
import org.rcisoft.core.controller.PaginationController;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/**
* Created by on 2018-5-2 16:09:30.
*/
@RestController
@RequestMapping("manage/busparamrefer")
public class BusParamReferController extends PaginationController<BusParamRefer> {
@Autowired
private BusParamReferService busParamReferServiceImpl;
@ApiOperation(value="修改", notes="修改")
@PutMapping("/update")
public Result update(@Valid BusParamRefer busParamRefer) {
PersistModel data = busParamReferServiceImpl.merge(busParamRefer);
return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
busParamRefer);
}
}
package org.rcisoft.business.manage.service;
import org.rcisoft.business.mainte.adaptive.entity.BusParamRefer;
import org.rcisoft.core.model.PersistModel;
/**
* Created by on 2018-5-2 16:09:30.
*/
public interface BusParamReferService {
/**
* 修改
* @param busParamRefer
* @return
*/
PersistModel merge(BusParamRefer busParamRefer);
}
package org.rcisoft.business.manage.service.impl;
import lombok.extern.slf4j.Slf4j;
import org.rcisoft.business.mainte.adaptive.dao.BusParamReferRepository;
import org.rcisoft.business.mainte.adaptive.entity.BusParamRefer;
import org.rcisoft.business.manage.service.BusParamReferService;
import org.rcisoft.core.model.PersistModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.util.HashMap;
import java.util.Map;
/**
* Created by on 2018-5-2 16:09:30.
*/
@Service
@Transactional(readOnly = true,propagation = Propagation.NOT_SUPPORTED)
@Slf4j
public class BusParamReferServiceImpl implements BusParamReferService {
@Autowired
private BusParamReferRepository busParamReferRepository;
@Override
public PersistModel merge(BusParamRefer busParamRefer) {
Example example = new Example(BusParamRefer.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("id",busParamRefer.getId());
int line = busParamReferRepository.updateByExampleSelective(busParamRefer,example);
return new PersistModel(line);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment