rain
2024-06-14 8d9a2d656e4ae007590c622e5f7c228adacdca49
src/main/java/com/dji/sample/patches/service/impl/ShpToDataSourceServiceImpl.java
@@ -79,11 +79,13 @@
    }
    @Transactional
    public void savaInMysql(List<TbDkjbxxEntity> list, String workspaceId) {
    public void savaInMysql(List<TbDkjbxxEntity> list, String workspaceId,String id,String name) {
        for (int i = 0; i < list.size(); i++) {
            LotInfo lotInfo = new LotInfo();
            lotInfo.setWorkspaceId(workspaceId);
            lotInfo = dbConvertToEntity(list.get(i), workspaceId);
            lotInfo.setTaskId(id);
            lotInfo.setTaskName(name);
            lotInfo = dbConvertToEntity(list.get(i), workspaceId, id, name);
            shpToDataSourceMapper.insert(lotInfo);
        }
    }
@@ -95,20 +97,24 @@
     * @param file 需要转换的DKJBXX对象。
     * @return 返回一个构建好的LotInfo对象,包含从数据库实体中转换来的信息。
     */
    private LotInfo dbConvertToEntity(TbDkjbxxEntity file, String workspaceId) {
    private LotInfo dbConvertToEntity(TbDkjbxxEntity file, String workspaceId,String id,String name) {
        LotInfo.LotInfoBuilder builder = LotInfo.builder();
        builder.bsm(file.getFId())
                .xzqdm(file.getFXzqdmsys())
                .xzqdm(file.getFXzqdm())
                .dkbh(file.getFTbbh())
                .dkfw(file.getFShape())
                .workspaceId(workspaceId)
                .isplan(0)
                .isPlan(0)
                .xmc(DistrictCodeUtils.nameToCode(file.getFXzqdm()))
                .investigate(0)
                .taskId(id)
                .taskName(name)
                .build();
        return builder.build();
    }
    public List<LotInfo> getNoPlan(){
   return shpToDataSourceMapper.selectList(new LambdaQueryWrapper<LotInfo>().eq(LotInfo::getIsplan,0));
   return shpToDataSourceMapper.selectList(new LambdaQueryWrapper<LotInfo>().eq(LotInfo::getIsPlan,0));
    }
}