|
@@ -10,6 +10,7 @@ import com.steerinfo.dil.service.IRmsLineService;
|
|
|
|
|
|
import com.steerinfo.dil.util.BaseRESTfulController;
|
|
|
import com.steerinfo.dil.util.ColumnDataUtil;
|
|
|
+import com.steerinfo.dil.util.DataChange;
|
|
|
import com.steerinfo.dil.util.PageListAdd;
|
|
|
import com.steerinfo.framework.controller.RESTfulResult;
|
|
|
import com.steerinfo.framework.service.pagehelper.PageHelper;
|
|
@@ -20,6 +21,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.models.auth.In;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
@@ -72,32 +74,13 @@ public class RmsLineController extends BaseRESTfulController {
|
|
|
Integer pageSize,
|
|
|
Integer apiId,
|
|
|
String con){
|
|
|
- //框计算
|
|
|
+
|
|
|
if(con != null){
|
|
|
- if(!"undefined".equals(con)){
|
|
|
- String index="get_line_list"; //设置要查询的索引名称
|
|
|
- return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));//获取查询结果
|
|
|
+ if(!"".equals(con)){
|
|
|
+ mapValue.put("index", con);
|
|
|
}
|
|
|
}
|
|
|
- List<Map<String,Object>> list = null;
|
|
|
- //如果有条件查询则跳过初始化,和创建索引
|
|
|
- if(mapValue.size() == 0){
|
|
|
- //将查询结果存入索引中
|
|
|
- list = rmsLineMapper.getAllLineDesk(mapValue);
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- //添加索引
|
|
|
- map.put("index","get_line_list");
|
|
|
- //添加id
|
|
|
- map.put("indexId","lineId");
|
|
|
- list.add(map);
|
|
|
- //新建索引
|
|
|
- esFeign.insertIndex(list);
|
|
|
- //删除
|
|
|
- list.remove(list.size()-1);
|
|
|
- }
|
|
|
- if(list == null) {
|
|
|
- list = rmsLineMapper.getAllLineDesk(mapValue);
|
|
|
- }
|
|
|
+ List<Map<String, Object>> list = rmsLineMapper.getAllLineDesk(mapValue);
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
//分页查询数据
|
|
|
List<Map<String, Object>> columnList = rmsLineMapper.getAllLineDesk(mapValue);
|
|
@@ -115,6 +98,7 @@ public class RmsLineController extends BaseRESTfulController {
|
|
|
@ApiImplicitParam(name = "mapValue", value = "运输路线", required = false, dataType = "Map"),
|
|
|
})
|
|
|
@PostMapping("/insertSelective")
|
|
|
+ @Transactional
|
|
|
public RESTfulResult insertSelective(@RequestBody(required = false) Map<String,Object> mapVal){
|
|
|
// 创建运输路线主表实体
|
|
|
RmsLine rmsLine = new RmsLine();
|
|
@@ -136,24 +120,7 @@ public class RmsLineController extends BaseRESTfulController {
|
|
|
//存放到运输路线主表实体中
|
|
|
rmsLine.setLineEndNodeId(new BigDecimal(lineEndNodeId));
|
|
|
//生成运输线路编号
|
|
|
- String lineNo = "";
|
|
|
- if(lineId < 10){
|
|
|
- lineNo = "YSXL0000000"+lineId;
|
|
|
- }else if(lineId >= 10 || lineId <100){
|
|
|
- lineNo = "YSXL000000"+lineId;
|
|
|
- }else if(lineId >= 100 || lineId <1000){
|
|
|
- lineNo = "YSXL00000"+lineId;
|
|
|
- }else if(lineId >= 1000 || lineId <10000){
|
|
|
- lineNo = "YSXL0000"+lineId;
|
|
|
- }else if(lineId >= 10000 || lineId <100000){
|
|
|
- lineNo = "YSXL000"+lineId;
|
|
|
- }else if(lineId >= 100000 || lineId <1000000){
|
|
|
- lineNo = "YSXL00"+lineId;
|
|
|
- }else if(lineId >= 1000000 || lineId <10000000){
|
|
|
- lineNo = "YSXL0"+lineId;
|
|
|
- }else if(lineId >= 10000000 || lineId <100000000){
|
|
|
- lineNo = "YSXL"+lineId;
|
|
|
- }
|
|
|
+ String lineNo = DataChange.generateEightDigitsNumber("YSXL", lineId);
|
|
|
//将运输线路存放进运输线路主表实体中
|
|
|
rmsLine.setLineNo(lineNo);
|
|
|
//逻辑删除(0为未删除,1为删除)
|
|
@@ -205,7 +172,6 @@ public class RmsLineController extends BaseRESTfulController {
|
|
|
@ApiOperation(value = "修改运输线路信息")
|
|
|
@PostMapping("/updateByPrimaryKeySelective")
|
|
|
public RESTfulResult updateByPrimaryKeySelective(@RequestBody(required = false) Map<String,Object> mapVal) {
|
|
|
- //创建一个运输线路主表实体
|
|
|
RmsLine rmsLine = new RmsLine();
|
|
|
//拿到前端传递的运输线路主表id
|
|
|
Integer lineId = (Integer) mapVal.get("lineId");
|