刘小明
2024-08-29 af8b0ddeeb5fc71f5099e6be44dc9d3064a3b243
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java
@@ -1,11 +1,14 @@
package com.dy.pmsPlatform.station;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.alibaba.excel.util.StringUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.daoPlt.PltProductionLineMapper;
import com.dy.pmsGlobal.daoPlt.PltStationMapper;
import com.dy.pmsGlobal.pojoPlt.PltProductionLine;
import com.dy.pmsGlobal.pojoPlt.PltStation;
import com.dy.pmsGlobal.util.QrCodeConstant;
import com.dy.pmsGlobal.util.QrCodeUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
@@ -23,7 +26,7 @@
    private PltStationMapper dao;
    private PltProductionLineMapper lineDao;
    private static final String stationPrefix = "103" ;
//    private static final String stationPrefix = "103" ;
    private static final String DEFAULT_CODE = "0001";
    private static final String CODE_FORMAT = "%04d";
@@ -125,7 +128,7 @@
        //查询符合条件的记录
        rsVo.obj = this.dao.selectSome(params) ;
        rsVo.obj.parallelStream().forEach(item->{
            item.qrCode = QrCodeUtil.genQrCodeString(stationPrefix+item.id);
            item.qrCode = QrCodeUtil.genQrCodeString(QrCodeConstant.TypeStation+item.id);
        });
        return rsVo ;
    }
@@ -148,5 +151,14 @@
    public List<PltStation> selectAll() {
        return dao.selectAll();
    }
    public JSONArray selectAllIdAndName() {
        List<PltStation> list = dao.selectAll();
        JSONArray child = new JSONArray();
        list.forEach(item->{
            child.add(new JSONObject().set("id", String.valueOf(item.getId())).set("name", item.getName()));
        });
        return child;
    }
}