|
@@ -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");
|
|
|
-
|
|
|
- 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);
|
|
|
|
|
@@ -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();
|
|
|
|
|
|
Integer lineId = (Integer) mapVal.get("lineId");
|