rain
2024-04-18 3dae83e56bbdef77404be7b47d19136bb8251c8c
src/main/java/com/dji/sample/patches/service/impl/ShpToDataSourceServiceImpl.java
@@ -80,10 +80,11 @@
        return multipartFile;
    }
    @Transactional
    public void savaInMysql(List<TbDkjbxxEntity> list){
    public void savaInMysql(List<TbDkjbxxEntity> list,String workspaceId){
        for (int i = 0; i <list.size() ; i++) {
            LotInfo lotInfo = new LotInfo();
            lotInfo=dbConvertToEntity(list.get(i));
            lotInfo.setWorkspaceId(workspaceId);
            lotInfo=dbConvertToEntity(list.get(i),workspaceId);
            mapper.insert(lotInfo);
        }
    }
@@ -92,7 +93,7 @@
     * @param file 需要转换的DKJBXX对象。
     * @return 返回一个构建好的LotInfo对象,包含从数据库实体中转换来的信息。
     */
    private LotInfo dbConvertToEntity(TbDkjbxxEntity file) {
    private LotInfo dbConvertToEntity(TbDkjbxxEntity file,String workspaceId) {
        LotInfo.LotInfoBuilder builder = LotInfo.builder();
        if (file != null) {
            builder.bsm(file.getBsm())
@@ -109,6 +110,7 @@
                    .yzb(file.getYzb())
                    .kzxx(file.getKzxx())
                    .dklx(file.getDklx())
                    .workspaceId(workspaceId)
                    .build();
        }
        return builder.build();